manifest

package
v0.0.0-...-e4b2db6 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2014 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Size    int64
	ModTime time.Time
	Hashes  HashSet
	Seen    bool `msg:"-"` // used for hash tracking; don't serialize
}

func NewFileFromPath

func NewFileFromPath(path string, opts HashOptions) (*File, error)

func (*File) DecodeMsg

func (z *File) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements the msgp.Decodable interface

func (*File) EncodeMsg

func (z *File) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements the msgp.Encodable interface

func (*File) MarshalMsg

func (z *File) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements the msgp.Marshaler interface

func (*File) Msgsize

func (z *File) Msgsize() (s int)

Msgsize implements the msgp.Sizer interface

func (*File) UnmarshalMsg

func (z *File) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg unmarshals a File from MessagePack, returning any extra bytes and any errors encountered

type HashOptions

type HashOptions struct {
	DisableMD5    bool
	DisableSHA1   bool
	DisableSHA256 bool
}

type HashSet

type HashSet struct {
	MD5     []byte
	SHA1    []byte
	SHA256  []byte
	CRC32   *uint32
	Adler32 *uint32
}

func (*HashSet) DecodeMsg

func (z *HashSet) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements the msgp.Decodable interface

func (*HashSet) EncodeMsg

func (z *HashSet) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements the msgp.Encodable interface

func (*HashSet) MarshalMsg

func (z *HashSet) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements the msgp.Marshaler interface

func (*HashSet) Msgsize

func (z *HashSet) Msgsize() (s int)

Msgsize implements the msgp.Sizer interface

func (*HashSet) UnmarshalMsg

func (z *HashSet) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg unmarshals a HashSet from MessagePack, returning any extra bytes and any errors encountered

type Manifest

type Manifest struct {
	Files map[string]File
}

func New

func New() *Manifest

func Read

func Read(r io.Reader) (*Manifest, error)

func ReadFromFile

func ReadFromFile(filename string) (*Manifest, error)

func (*Manifest) DecodeMsg

func (z *Manifest) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements the msgp.Decodable interface

func (*Manifest) EncodeMsg

func (z *Manifest) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements the msgp.Encodable interface

func (*Manifest) MarshalMsg

func (z *Manifest) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements the msgp.Marshaler interface

func (*Manifest) Msgsize

func (z *Manifest) Msgsize() (s int)

Msgsize implements the msgp.Sizer interface

func (*Manifest) UnmarshalMsg

func (z *Manifest) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg unmarshals a Manifest from MessagePack, returning any extra bytes and any errors encountered

func (Manifest) Write

func (m Manifest) Write(w io.Writer) error

func (Manifest) WriteToFile

func (m Manifest) WriteToFile(filename string) error

Jump to

Keyboard shortcuts

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