unixfs

package
v0.2.3-buildfails Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2015 License: MIT Imports: 3 Imported by: 0

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

This section is empty.

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 BytesForMetadata(m *Metadata) ([]byte, error)

func DataSize

func DataSize(data []byte) (uint64, error)

func FilePBData

func FilePBData(data []byte, totalsize uint64) []byte

func FolderPBData

func FolderPBData() []byte

Returns Bytes that represent a Directory

func FromBytes

func FromBytes(data []byte) (*pb.Data, error)

func UnwrapData

func UnwrapData(data []byte) ([]byte, error)

func WrapData

func WrapData(b []byte) []byte

Types

type Metadata

type Metadata struct {
	MimeType string
	Size     uint64
}

func MetadataFromBytes

func MetadataFromBytes(b []byte) (*Metadata, error)

func (*Metadata) Bytes

func (m *Metadata) Bytes() ([]byte, error)

type MultiBlock

type MultiBlock struct {
	Data []byte
	// contains filtered or unexported fields
}

func (*MultiBlock) AddBlockSize

func (mb *MultiBlock) AddBlockSize(s uint64)

func (*MultiBlock) FileSize

func (mb *MultiBlock) FileSize() uint64

func (*MultiBlock) GetBytes

func (mb *MultiBlock) GetBytes() ([]byte, error)

func (*MultiBlock) NumChildren

func (mb *MultiBlock) NumChildren() int

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL