payload

package
v0.0.0-...-05fe59e Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotPayload = errors.New("payload: input is neither a payload.bin (magic \"CrAU\") nor a zip archive containing payload.bin")

Functions

This section is empty.

Types

type ExtractOptions

type ExtractOptions struct {
	OutputDir   string
	Partitions  []string
	Concurrency int
	SourceDir   string
	SkipVerify  bool
	Logger      *slog.Logger
	OnProgress  ProgressFunc
}
type Header struct {
	Version              uint64
	ManifestLen          uint64
	MetadataSignatureLen uint32
}

type MissingSourceError

type MissingSourceError struct {
	Partitions []string
}

func (*MissingSourceError) Error

func (e *MissingSourceError) Error() string

type Partition

type Partition struct {
	Name                  string
	Size                  uint64
	Hash                  []byte
	OldSize               uint64
	OldHash               []byte
	NeedsSource           bool
	TotalOperations       int
	UnsupportedOperations []string
}

type Payload

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

func NewFromReaderAt

func NewFromReaderAt(ra io.ReaderAt, size int64) (*Payload, error)

func Open

func Open(name string) (*Payload, error)

func (*Payload) BlockSize

func (p *Payload) BlockSize() uint64

func (*Payload) Close

func (p *Payload) Close() error

func (*Payload) Extract

func (p *Payload) Extract(ctx context.Context, opts ExtractOptions) error

func (*Payload) Header

func (p *Payload) Header() Header

func (*Payload) IsDelta

func (p *Payload) IsDelta() bool

func (*Payload) Manifest

func (*Payload) MinorVersion

func (p *Payload) MinorVersion() uint32

func (*Payload) Partitions

func (p *Payload) Partitions() []Partition

func (*Payload) SetLogger

func (p *Payload) SetLogger(logger *slog.Logger)

type ProgressEvent

type ProgressEvent struct {
	Partition    string
	TotalOps     int
	CompletedOps int
	Done         bool
	Err          error
}

type ProgressFunc

type ProgressFunc func(ProgressEvent)

type UnknownPartitionsError

type UnknownPartitionsError struct {
	Names []string
}

func (*UnknownPartitionsError) Error

func (e *UnknownPartitionsError) Error() string

type UnsupportedOperationsError

type UnsupportedOperationsError struct {
	Partitions map[string][]string
}

func (*UnsupportedOperationsError) Error

type VerificationError

type VerificationError struct {
	Partition string
	Subject   string
	Expected  string
	Actual    string
}

func (*VerificationError) Error

func (e *VerificationError) Error() string

Jump to

Keyboard shortcuts

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