]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/file_header.go
Add tests and clean up
[rbdr/mobius] / hotline / file_header.go
index 60c652e36eb5cf1be776b192ed5bdc822cc71315..7e0df1666c54757f7bcd8841400ebb35f5bdaf20 100644 (file)
@@ -27,6 +27,15 @@ func NewFileHeader(fileName string, isDir bool) FileHeader {
        return fh
 }
 
        return fh
 }
 
+func (fh *FileHeader) Read(p []byte) (n int, err error) {
+       p = concat.Slices(
+               fh.Size,
+               fh.Type,
+               fh.FilePath,
+       )
+       return len(p), nil
+}
+
 func (fh *FileHeader) Payload() []byte {
        return concat.Slices(
                fh.Size,
 func (fh *FileHeader) Payload() []byte {
        return concat.Slices(
                fh.Size,