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

Method OpenFileWriter

internal/utils/bfs/fs.go:90–104  ·  view source on GitHub ↗

OpenFileWriter 打开文件写入器

(hash string, bodySize int64, isPartial bool)

Source from the content-addressed store, hash-verified

88
89// OpenFileWriter 打开文件写入器
90func (this *FS) OpenFileWriter(hash string, bodySize int64, isPartial bool) (*FileWriter, error) {
91 if this.isClosed {
92 return nil, errors.New("the fs closed")
93 }
94
95 if isPartial && bodySize <= 0 {
96 return nil, errors.New("invalid body size for partial content")
97 }
98
99 bFile, err := this.openBFileForHashWriting(hash)
100 if err != nil {
101 return nil, err
102 }
103 return bFile.OpenFileWriter(hash, bodySize, isPartial)
104}
105
106// OpenFileReader 打开文件读取器
107func (this *FS) OpenFileReader(hash string, isPartial bool) (*FileReader, error) {

Callers 6

TestNewFileWriterFunction · 0.45
TestFS_OpenFileWriterFunction · 0.45

Calls 1

Tested by 6

TestNewFileWriterFunction · 0.36
TestFS_OpenFileWriterFunction · 0.36