manifests

package
v0.0.0-...-e85cb22 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ManifestPathDelimiter = "/"

Variables

This section is empty.

Functions

This section is empty.

Types

type FileBuilder

type FileBuilder struct {
	Path   string
	Blocks map[uint64]ManifestBlock
	// contains filtered or unexported fields
}

func (*FileBuilder) AddBlock

func (b *FileBuilder) AddBlock(blockId uint64, block *ManifestBlock) error

func (*FileBuilder) Build

func (b *FileBuilder) Build() (*ManifestFile, error)

type Manifest

type Manifest struct {
	Files map[string]ManifestFile
}

func (*Manifest) Hash

func (m *Manifest) Hash() uint64

func (*Manifest) ToProto

func (m *Manifest) ToProto() (*proto.ManifestProto, error)

type ManifestBlock

type ManifestBlock struct {
	Hash blocks.BlockHash
	Size uint64
}

func (*ManifestBlock) ToProto

func (b *ManifestBlock) ToProto() *proto.ManifestBlockProto

type ManifestBuilder

type ManifestBuilder struct {
	Files map[string]*FileBuilder
	// contains filtered or unexported fields
}

func ManifestBuilderSink

func ManifestBuilderSink() (blocks.BlockProcessor, *ManifestBuilder)

func (*ManifestBuilder) AddFile

func (b *ManifestBuilder) AddFile(file string) *FileBuilder

func (*ManifestBuilder) Build

func (b *ManifestBuilder) Build() (*Manifest, error)

func (*ManifestBuilder) BuildProto

func (b *ManifestBuilder) BuildProto() (*proto.ManifestProto, error)

func (*ManifestBuilder) FromProto

func (b *ManifestBuilder) FromProto(p *proto.ManifestProto) error

Adds the information from a protobuffer into the builder.

type ManifestFile

type ManifestFile struct {
	Path   string
	Blocks []ManifestBlock
}

func (*ManifestFile) Hash

func (f *ManifestFile) Hash() uint64

Jump to

Keyboard shortcuts

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