MCPcopy Create free account
hub / github.com/goinaction/code / store

Function store

chapter10/listing02/listing02.go:87–95  ·  view source on GitHub ↗

store knows how to store bulks of data from any Storer.

(s Storer, data []Data)

Source from the content-addressed store, hash-verified

85
86// store knows how to store bulks of data from any Storer.
87func store(s Storer, data []Data) (int, error) {
88 for i, d := range data {
89 if err := s.Store(d); err != nil {
90 return i, err
91 }
92 }
93
94 return len(data), nil
95}
96
97// Copy knows how to pull and store data from the System.
98func Copy(sys *System, batch int) error {

Callers 1

CopyFunction · 0.70

Calls 1

StoreMethod · 0.65

Tested by

no test coverage detected