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

Method Clone

internal/utils/bfs/file_header.go:154–168  ·  view source on GitHub ↗

Clone current header

()

Source from the content-addressed store, hash-verified

152
153// Clone current header
154func (this *FileHeader) Clone() *FileHeader {
155 return &FileHeader{
156 Version: this.Version,
157 ModifiedAt: this.ModifiedAt,
158 ExpiresAt: this.ExpiresAt,
159 Status: this.Status,
160 HeaderSize: this.HeaderSize,
161 BodySize: this.BodySize,
162 ExpiredBodySize: this.ExpiredBodySize,
163 HeaderBlocks: this.HeaderBlocks,
164 BodyBlocks: this.BodyBlocks,
165 IsCompleted: this.IsCompleted,
166 IsWriting: this.IsWriting,
167 }
168}
169
170func (this *FileHeader) Encode(hash string) ([]byte, error) {
171 headerJSON, err := json.Marshal(this)

Callers 2

TestFileHeader_CloneFunction · 0.80
CloneFileHeaderMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestFileHeader_CloneFunction · 0.64