MCPcopy
hub / github.com/hoanhan101/ultimate-go / pull

Function pull

go/design/decoupling_1.go:123–132  ·  view source on GitHub ↗

pull knows how to pull bulks of data from Xenia, leveraging the foundation that we have built. We don't need to add method to System to do this. There is no state inside System that we want the System to maintain. Instead, we want the System to understand the behavior. Functions are a great way of w

(x *Xenia, data []Data)

Source from the content-addressed store, hash-verified

121// doesn't indicate any level, what field or state that we are using on that value that we use to
122// make the call.
123func pull(x *Xenia, data []Data) (int, error) {
124 // Range over the slice of data and share each element with the Xenial's Pull method.
125 for i := range data {
126 if err := x.Pull(&data[i]); err != nil {
127 return i, err
128 }
129 }
130
131 return len(data), nil
132}
133
134// store knows how to store bulks of data into Pillar.
135// Similar to the function above.

Callers 1

CopyFunction · 0.70

Calls 1

PullMethod · 0.65

Tested by

no test coverage detected