metadata

package
v0.0.0-...-3d01529 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2015 License: ISC Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = 1
)

Variables

View Source
var (
	ErrVersion     = errors.New("invalid version")
	ErrCompression = errors.New("invalid compression")
	ErrType        = errors.New("invalid type")
	ErrTypeDir     = errors.New("invalid dir type")
	ErrTypeSymlink = errors.New("invalid symlink type")
	ErrTypeFile    = errors.New("invalid file type")

	CompNone = [4]byte{'n', 'o', 'n', 'e'}
	CompGZIP = [4]byte{'g', 'z', 'i', 'p'}

	TypeDir     = [4]byte{'d', 'i', 'r'}
	TypeSymlink = [4]byte{'s', 'y', 'm', 'l'}
	TypeFile    = [4]byte{'f', 'i', 'l', 'e'}
)

Functions

func IsEOF

func IsEOF(err error) bool

Types

type Dir

type Dir struct {
	Name     string      // directory name
	Mode     os.FileMode // mode
	Owner    int         // owner id
	Group    int         // group id
	Modified time.Time   // modification time
}

type File

type File struct {
	Name     string      // filename
	Mode     os.FileMode // file mode
	Owner    int         // owner id
	Group    int         // group id
	Size     int64       // file size
	Modified time.Time   // modification time

	MimeType string            // MIME type
	Digest   [sha256.Size]byte // payload digest AND external pointer
}
type Header struct {
	Version     int     // metadata version
	Compression [4]byte // metadata compression
}

type MetadataDecoder

type MetadataDecoder struct {
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(r io.Reader) (*MetadataDecoder, error)

func (*MetadataDecoder) Next

func (m *MetadataDecoder) Next() (interface{}, error)

type MetadataEncoder

type MetadataEncoder struct {
	// contains filtered or unexported fields
}

func NewEncoder

func NewEncoder(w io.Writer, compress bool) (*MetadataEncoder, error)

func (*MetadataEncoder) Dir

func (m *MetadataEncoder) Dir(path string, fi os.FileInfo) error

func (*MetadataEncoder) File

func (m *MetadataEncoder) File(path string, fi os.FileInfo, mime string,
	digest *[sha256.Size]byte) error

func (*MetadataEncoder) Flush

func (m *MetadataEncoder) Flush()
func (m *MetadataEncoder) Symlink(path string, fi os.FileInfo) error
type Symlink struct {
	Name string // filename
	Link string // symbolic link path
}

Jump to

Keyboard shortcuts

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