MCPcopy
hub / github.com/perkeep/perkeep / WriteFileFromReader

Function WriteFileFromReader

pkg/schema/filewriter.go:85–87  ·  view source on GitHub ↗

WriteFileFromReader creates and uploads a "file" JSON schema composed of chunks of r, also uploading the chunks. The returned BlobRef is of the JSON file schema blob. The filename is optional.

(ctx context.Context, bs blobserver.StatReceiver, filename string, r io.Reader)

Source from the content-addressed store, hash-verified

83// BlobRef is of the JSON file schema blob.
84// The filename is optional.
85func WriteFileFromReader(ctx context.Context, bs blobserver.StatReceiver, filename string, r io.Reader) (blob.Ref, error) {
86 return WriteFileFromReaderWithModTime(ctx, bs, filename, time.Time{}, r)
87}
88
89// WriteFileMap uploads chunks of r to bs while populating file and
90// finally uploading file's Blob. The returned blobref is of file's

Callers 15

RunMethod · 0.92
importTransactionMethod · 0.92
importTweetMethod · 0.92
TestIntegrationRunFunction · 0.92
urlFileRefMethod · 0.92
importItemMethod · 0.92
updatePhotoMethod · 0.92
importBookmarkTextMethod · 0.92
updatePhotoInAlbumMethod · 0.92
importPhotoMethod · 0.92
importStatusMethod · 0.92
TestArchiverStressFunction · 0.92

Calls 1

Tested by 13

TestIntegrationRunFunction · 0.74
TestArchiverStressFunction · 0.74
TestPackNormalFunction · 0.74
TestPackNoDeleteFunction · 0.74
TestPackLargeFunction · 0.74
TestReindexFunction · 0.74
TestForeachZipBlobFunction · 0.74
TestRemoveBlobsFunction · 0.74
populatePackedFunction · 0.74
populatePacked2Function · 0.74
storageAndBlobRefFunction · 0.74