 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package format implements a data format for files in the ipfs filesystem It is not the only format in ipfs, but it is the one that the filesystem assumes
Index ¶
- Constants
- Variables
- func BytesForMetadata(m *Metadata) ([]byte, error)
- func DataSize(data []byte) (uint64, error)
- func FilePBData(data []byte, totalsize uint64) []byte
- func FolderPBData() []byte
- func FromBytes(data []byte) (*pb.Data, error)
- func SymlinkData(path string) ([]byte, error)
- func UnwrapData(data []byte) ([]byte, error)
- func WrapData(b []byte) []byte
- type FSNode
- type Metadata
Constants ¶
      View Source
      
  
const ( TRaw = pb.Data_Raw TFile = pb.Data_File TDirectory = pb.Data_Directory TMetadata = pb.Data_Metadata )
Variables ¶
      View Source
      
  
    var ErrInvalidDirLocation = errors.New("found directory node in unexpected place")
    
      View Source
      
  
    var ErrMalformedFileFormat = errors.New("malformed data in file format")
    
      View Source
      
  
var ErrUnrecognizedType = errors.New("unrecognized node type")
    Functions ¶
func BytesForMetadata ¶
func FilePBData ¶
func SymlinkData ¶ added in v0.3.8
func UnwrapData ¶
Types ¶
type FSNode ¶ added in v0.3.2
type FSNode struct {
	Data []byte
	// node type of this node
	Type pb.Data_DataType
	// contains filtered or unexported fields
}
    func FSNodeFromBytes ¶ added in v0.3.2
func (*FSNode) AddBlockSize ¶ added in v0.3.2
AddBlockSize adds the size of the next child block of this node
func (*FSNode) NumChildren ¶ added in v0.3.2
func (*FSNode) RemoveBlockSize ¶ added in v0.3.2
       Directories
      ¶
      Directories
      ¶
    
    | Path | Synopsis | 
|---|---|
| package unixfs/io implements convenience objects for working with the ipfs unixfs data format. | package unixfs/io implements convenience objects for working with the ipfs unixfs data format. | 
| Package unixfs_pb is a generated protocol buffer package. | Package unixfs_pb is a generated protocol buffer package. | 
 Click to show internal directories. 
   Click to hide internal directories.