Function
NewFileWriter
(bFile *BlocksFile, hash string, bodySize int64, isPartial bool)
Source from the content-addressed store, hash-verified
| 20 | } |
| 21 | |
| 22 | func 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 | |
| 35 | func (this *FileWriter) WriteMeta(status int, expiresAt int64, expectedFileSize int64) error { |
| 36 | this.hasMeta = true |
Tested by
no test coverage detected