Commit 2e3a9f76 authored by Zander Mackie's avatar Zander Mackie

Add Some Comments to unixfs/format

License: MIT
Signed-off-by: default avatarZander Mackie <zmackie@gmail.com>
parent 63cfd751
......@@ -51,7 +51,7 @@ func FilePBData(data []byte, totalsize uint64) []byte {
return data
}
// Returns Bytes that represent a Directory
//FolderPBData returns Bytes that represent a Directory.
func FolderPBData() []byte {
pbfile := new(pb.Data)
typ := pb.Data_Directory
......@@ -65,6 +65,7 @@ func FolderPBData() []byte {
return data
}
//WrapData marshals raw bytes into a `Data_Raw` type protobuf message.
func WrapData(b []byte) []byte {
pbdata := new(pb.Data)
typ := pb.Data_Raw
......@@ -81,6 +82,7 @@ func WrapData(b []byte) []byte {
return out
}
//SymlinkData returns a `Data_Symlink` protobuf message for the path you specify.
func SymlinkData(path string) ([]byte, error) {
pbdata := new(pb.Data)
typ := pb.Data_Symlink
......@@ -184,6 +186,7 @@ type Metadata struct {
Size uint64
}
//MetadataFromBytes Unmarshals a protobuf message into Metadata.
func MetadataFromBytes(b []byte) (*Metadata, error) {
pbd := new(pb.Data)
err := proto.Unmarshal(b, pbd)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment