Documentation
¶
Index ¶
- Constants
- type Blob
- type Configuration
- type EncodingFn
- type HashFactory
- type Packfile
- type PackfileCtor
- type PackfileInMemory
- func (p *PackfileInMemory) AddBlob(resourceType resources.Type, version versioning.Version, mac objects.MAC, ...) error
- func (p *PackfileInMemory) Cleanup() error
- func (p *PackfileInMemory) Entries() []Blob
- func (p *PackfileInMemory) Serialize(encoder EncodingFn) (io.Reader, objects.MAC, error)
- func (p *PackfileInMemory) Size() uint64
- type PackfileInMemoryFooter
- type PackfileOnDisk
- func (w *PackfileOnDisk) AddBlob(t resources.Type, v versioning.Version, mac objects.MAC, data []byte, ...) error
- func (w *PackfileOnDisk) Cleanup() error
- func (w *PackfileOnDisk) Entries() []Blob
- func (w *PackfileOnDisk) Serialize(encoder EncodingFn) (io.Reader, objects.MAC, error)
- func (w *PackfileOnDisk) Size() uint64
Constants ¶
View Source
const BLOB_RECORD_SIZE = 56
View Source
const FOOTER_SIZE = 56
View Source
const VERSION = "1.0.0"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blob ¶
type Blob struct {
Type resources.Type
Version versioning.Version
MAC objects.MAC
Offset uint64
Length uint32
Flags uint32
}
func NewInMemoryIndexFromBytes ¶ added in v1.0.3
func NewInMemoryIndexFromBytes(version versioning.Version, serialized []byte) ([]Blob, error)
type Configuration ¶
type Configuration struct {
MinSize uint64 `json:"min_size"`
AvgSize uint64 `json:"avg_size"`
MaxSize uint64 `json:"max_size"`
}
func NewDefaultConfiguration ¶
func NewDefaultConfiguration() *Configuration
type HashFactory ¶ added in v1.0.3
type Packfile ¶ added in v1.0.3
type Packfile interface {
AddBlob(t resources.Type, v versioning.Version, mac objects.MAC, data []byte, flags uint32) error
Size() uint64
Entries() []Blob
Serialize(EncodingFn) (io.Reader, objects.MAC, error)
Cleanup() error
}
It is the responsibility of the packfile, to return a reader (through serialize) that will produce the expected format as documented below:
- 0....N Blob bytes (encoded individually) - Index into blobs (encoded as a whole) - MAC of index - Footer (encoded as a whole) - Encoded footer length (uint32)
func NewPackfileInMemory ¶ added in v1.0.3
func NewPackfileInMemory(hf HashFactory) (Packfile, error)
func NewPackfileOnDisk ¶ added in v1.0.3
func NewPackfileOnDisk(tempDir string, hf HashFactory) (Packfile, error)
type PackfileCtor ¶ added in v1.0.3
type PackfileCtor func(HashFactory) (Packfile, error)
type PackfileInMemory ¶ added in v1.0.3
type PackfileInMemory struct {
Blobs []byte
Index []Blob
// contains filtered or unexported fields
}
func NewPackfileInMemoryFromBytes ¶ added in v1.0.3
func NewPackfileInMemoryFromBytes(hasher hash.Hash, version versioning.Version, serialized []byte) (*PackfileInMemory, error)
func (*PackfileInMemory) AddBlob ¶ added in v1.0.3
func (p *PackfileInMemory) AddBlob(resourceType resources.Type, version versioning.Version, mac objects.MAC, data []byte, flags uint32) error
func (*PackfileInMemory) Cleanup ¶ added in v1.0.3
func (p *PackfileInMemory) Cleanup() error
func (*PackfileInMemory) Entries ¶ added in v1.0.3
func (p *PackfileInMemory) Entries() []Blob
func (*PackfileInMemory) Serialize ¶ added in v1.0.3
func (p *PackfileInMemory) Serialize(encoder EncodingFn) (io.Reader, objects.MAC, error)
func (*PackfileInMemory) Size ¶ added in v1.0.3
func (p *PackfileInMemory) Size() uint64
type PackfileInMemoryFooter ¶ added in v1.0.3
type PackfileInMemoryFooter struct {
}
func NewInMemoryFooterFromBytes ¶ added in v1.0.3
func NewInMemoryFooterFromBytes(version versioning.Version, serialized []byte) (PackfileInMemoryFooter, error)
type PackfileOnDisk ¶ added in v1.0.3
type PackfileOnDisk struct {
// contains filtered or unexported fields
}
func (*PackfileOnDisk) AddBlob ¶ added in v1.0.3
func (w *PackfileOnDisk) AddBlob(t resources.Type, v versioning.Version, mac objects.MAC, data []byte, flags uint32) error
func (*PackfileOnDisk) Cleanup ¶ added in v1.0.3
func (w *PackfileOnDisk) Cleanup() error
func (*PackfileOnDisk) Entries ¶ added in v1.0.3
func (w *PackfileOnDisk) Entries() []Blob
func (*PackfileOnDisk) Serialize ¶ added in v1.0.3
func (w *PackfileOnDisk) Serialize(encoder EncodingFn) (io.Reader, objects.MAC, error)
func (*PackfileOnDisk) Size ¶ added in v1.0.3
func (w *PackfileOnDisk) Size() uint64
Click to show internal directories.
Click to hide internal directories.