Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-unixfs
Commits
2e3a9f76
Commit
2e3a9f76
authored
8 years ago
by
Zander Mackie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Some Comments to unixfs/format
License: MIT Signed-off-by:
Zander Mackie
<
zmackie@gmail.com
>
parent
63cfd751
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
format.go
format.go
+4
-1
No files found.
format.go
View file @
2e3a9f76
...
...
@@ -51,7 +51,7 @@ func FilePBData(data []byte, totalsize uint64) []byte {
return
data
}
//
R
eturns Bytes that represent a Directory
//
FolderPBData r
eturns 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
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment