api

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: BSD-3-Clause-Clear Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cancel added in v0.2.0

func Cancel(ctx context.Context, cfg *config.Config) (string, error)

func Check added in v0.9.0

func Check(ctx context.Context, cfg *config.Config, options ...UpdateOpt) (target.Targets, *status.CurrentStatus, error)

func Fetch

func Fetch(ctx context.Context, cfg *config.Config, toVersion int, options ...UpdateOpt) error

func Install

func Install(ctx context.Context, cfg *config.Config, options ...UpdateOpt) error

func Start

func Start(ctx context.Context, cfg *config.Config, options ...UpdateOpt) error

func Update

func Update(ctx context.Context, cfg *config.Config, toVersion int, options ...UpdateOpt) error

Types

type DiffOption added in v1.2.0

type DiffOption func(*DiffOptions)

func WithTUFEnabled added in v1.2.0

func WithTUFEnabled(enabled bool) DiffOption

type DiffOptions added in v1.2.0

type DiffOptions struct {
	EnableTUF bool
}

type DiffReport added in v1.2.0

type DiffReport struct {
	FromTarget *target.Target `json:"from_target"`
	ToTarget   *target.Target `json:"to_target"`
	WireSize   int64          `json:"wire_size"`
	DiskSize   int64          `json:"disk_size"`
	// Blobs maps app base URI to list of blobs info, grouping by app
	Blobs map[string][]compose.BlobInfo `json:"blobs"`
}

func Diff added in v1.2.0

func Diff(ctx context.Context, cfg *config.Config, fromVersion, toVersion int, options ...DiffOption) (*DiffReport, error)

type FetchProgressFunc added in v1.0.0

type FetchProgressFunc = compose.FetchProgressFunc

type InstallProgressFunc added in v1.0.0

type InstallProgressFunc = compose.InstallProgressFunc

type PostStateHandler added in v1.0.0

type PostStateHandler func(StateName, *UpdateInfo)

type PreStateHandler added in v1.0.0

type PreStateHandler func(StateName, *UpdateInfo)

type StartProgressFunc added in v1.0.0

type StartProgressFunc = compose.AppStartProgress

type StateName added in v1.0.0

type StateName = state.ActionName

type UpdateInfo added in v1.0.0

type UpdateInfo = state.UpdateInfo

type UpdateMode added in v1.0.0

type UpdateMode = state.UpdateMode

type UpdateOpt added in v1.0.0

type UpdateOpt func(*UpdateOpts)

func WithEventSender added in v1.0.0

func WithEventSender(sender *events.EventSender) UpdateOpt

func WithFetchProgressHandler added in v1.0.0

func WithFetchProgressHandler(handler FetchProgressFunc) UpdateOpt

func WithForceUpdate added in v1.0.0

func WithForceUpdate(enabled bool) UpdateOpt

func WithGatewayClient added in v1.0.0

func WithGatewayClient(client *client.GatewayClient) UpdateOpt

func WithInstallProgressHandler added in v1.0.0

func WithInstallProgressHandler(handler InstallProgressFunc) UpdateOpt

func WithMaxAttempts added in v1.0.0

func WithMaxAttempts(count int) UpdateOpt

func WithPostStateHandler added in v1.0.0

func WithPostStateHandler(handler PostStateHandler) UpdateOpt

func WithPreStateHandler added in v1.0.0

func WithPreStateHandler(handler PreStateHandler) UpdateOpt

func WithRequireLatest added in v1.0.0

func WithRequireLatest(enabled bool) UpdateOpt

func WithStartProgressHandler added in v1.0.0

func WithStartProgressHandler(handler StartProgressFunc) UpdateOpt

func WithSyncCurrent added in v1.0.0

func WithSyncCurrent(enabled bool) UpdateOpt

func WithTUF added in v0.9.0

func WithTUF(enabled bool) UpdateOpt

type UpdateOpts added in v1.0.0

type UpdateOpts struct {
	UpdateRunnerOpts
	EnableTUF              bool
	Force                  bool
	SyncCurrent            bool
	MaxAttempts            int
	RequireLatest          bool
	FetchProgressHandler   FetchProgressFunc
	InstallProgressHandler InstallProgressFunc
	StartProgressHandler   StartProgressFunc
}

type UpdateRunner added in v1.0.0

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

UpdateRunner runs the OTA update states

func (*UpdateRunner) GetFromTarget added in v1.0.0

func (sm *UpdateRunner) GetFromTarget() target.Target

func (*UpdateRunner) Run added in v1.0.0

func (sm *UpdateRunner) Run(ctx context.Context, cfg *config.Config) error

type UpdateRunnerOpt added in v1.0.0

type UpdateRunnerOpt func(*UpdateRunnerOpts)

type UpdateRunnerOpts added in v1.0.0

type UpdateRunnerOpts struct {
	EventSender      *events.EventSender
	GatewayClient    *client.GatewayClient
	PreStateHandler  PreStateHandler
	PostStateHandler PostStateHandler
}

Jump to

Keyboard shortcuts

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