MCPcopy
hub / github.com/perkeep/perkeep / WriteFileMap

Function WriteFileMap

pkg/schema/filewriter.go:92–94  ·  view source on GitHub ↗

WriteFileMap uploads chunks of r to bs while populating file and finally uploading file's Blob. The returned blobref is of file's JSON blob.

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

Source from the content-addressed store, hash-verified

90// finally uploading file's Blob. The returned blobref is of file's
91// JSON blob.
92func WriteFileMap(ctx context.Context, bs blobserver.StatReceiver, file *Builder, r io.Reader) (blob.Ref, error) {
93 return writeFileMapRolling(ctx, bs, file, r)
94}
95
96func serverHasBlob(ctx context.Context, bs blobserver.BlobStatter, br blob.Ref) (have bool, err error) {
97 _, err = blobserver.StatBlob(ctx, bs, br)

Callers 10

UploadFileMethod · 0.92
populateFunction · 0.92
imprtMethod · 0.92
uploadNodeRegularFileMethod · 0.92
TestWriteFileMapFunction · 0.85
TestWriteThenReadFunction · 0.85
TestReaderSeekStressFunction · 0.85
TestReaderEfficiencyFunction · 0.85
TestReaderForeachChunkFunction · 0.85

Calls 1

writeFileMapRollingFunction · 0.85

Tested by 6

populateFunction · 0.74
TestWriteFileMapFunction · 0.68
TestWriteThenReadFunction · 0.68
TestReaderSeekStressFunction · 0.68
TestReaderEfficiencyFunction · 0.68
TestReaderForeachChunkFunction · 0.68