generator

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default block size to use for all generated payloads.
	BlockSize = 4096

	// Default data size limit to process in a single operation.
	ChunkSize = BlockSize * 256
)

Variables

View Source
var (

	// ErrProcedureExists indicates that a given procedure type has
	// already been added to the Generator.
	ErrProcedureExists = errors.New("generator: procedure already exists")
)

Functions

func Bzip2

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

Bzip2 simplifies using a Bzip2Writer when working with in-memory buffers.

func NewBzip2Writer

func NewBzip2Writer(w io.Writer) (io.WriteCloser, error)

NewBzip2Writer wraps a writer, compressing all data written to it.

func NewInstallInfo

func NewInstallInfo(r io.ReadSeeker) (*metadata.InstallInfo, error)

Types

type Generator

type Generator struct {
	destructor.MultiDestructor
	// contains filtered or unexported fields
}

Generator assembles an update payload from a number of sources. Each of its methods must only be called once, ending with Write.

func (*Generator) Partition

func (g *Generator) Partition(proc *Procedure) error

Partition adds the given /usr update Procedure to the payload. It must always be the first procedure added to the Generator.

func (*Generator) Write

func (g *Generator) Write(path string) (err error)

Write finalizes the payload, writing it out to the given file path.

type Procedure

type Procedure struct {
	metadata.InstallProcedure
	io.ReadCloser
}

Procedure represent independent update within a payload.

func FullUpdate

func FullUpdate(path string) (*Procedure, error)

FullUpdate generates an update Procedure for the given file, embedding its entire contents in the payload so it does not depend any previous state.

Jump to

Keyboard shortcuts

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