MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / NewFileWriter

Function NewFileWriter

internal/utils/bfs/file_writer.go:22–33  ·  view source on GitHub ↗
(bFile *BlocksFile, hash string, bodySize int64, isPartial bool)

Source from the content-addressed store, hash-verified

20}
21
22func NewFileWriter(bFile *BlocksFile, hash string, bodySize int64, isPartial bool) (*FileWriter, error) {
23 if isPartial && bodySize <= 0 {
24 return nil, errors.New("invalid body size for partial content")
25 }
26
27 return &FileWriter{
28 bFile: bFile,
29 hash: hash,
30 bodySize: bodySize,
31 isPartial: isPartial,
32 }, nil
33}
34
35func (this *FileWriter) WriteMeta(status int, expiresAt int64, expectedFileSize int64) error {
36 this.hasMeta = true

Callers 1

OpenFileWriterMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected