5 "github.com/jhalter/mobius/concat"
8 type FileHeader struct {
9 Size []byte // Total size of FileHeader payload
10 Type []byte // 0 for file, 1 for dir
11 FilePath []byte // encoded file path
14 func NewFileHeader(fileName string, isDir bool) FileHeader {
16 Size: make([]byte, 2),
17 Type: []byte{0x00, 0x00},
18 FilePath: EncodeFilePath(fileName),
21 fh.Type = []byte{0x00, 0x01}
24 encodedPathLen := uint16(len(fh.FilePath) + len(fh.Type))
25 binary.BigEndian.PutUint16(fh.Size, encodedPathLen)
30 func (fh *FileHeader) Payload() []byte {