MCPcopy
hub / github.com/perkeep/perkeep / writeFileMapRolling

Function writeFileMapRolling

pkg/schema/filewriter.go:265–272  ·  view source on GitHub ↗

writeFileMap uploads chunks of r to bs while populating fileMap and finally uploading fileMap. The returned blobref is of fileMap's JSON blob. It uses rolling checksum for the chunks sizes.

(ctx context.Context, bs blobserver.StatReceiver, file *Builder, r io.Reader)

Source from the content-addressed store, hash-verified

263// finally uploading fileMap. The returned blobref is of fileMap's
264// JSON blob. It uses rolling checksum for the chunks sizes.
265func writeFileMapRolling(ctx context.Context, bs blobserver.StatReceiver, file *Builder, r io.Reader) (blob.Ref, error) {
266 n, spans, err := writeFileChunks(ctx, bs, file, r)
267 if err != nil {
268 return blob.Ref{}, err
269 }
270 // The top-level content parts
271 return uploadBytes(ctx, bs, file, n, spans).Get()
272}
273
274// WriteFileChunks uploads chunks of r to bs while populating file.
275// It does not upload file.

Callers 1

WriteFileMapFunction · 0.85

Calls 3

writeFileChunksFunction · 0.85
uploadBytesFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected