updog

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandStatusQuery   hostCommand = "status"
	CommandListAvailable hostCommand = "list-available"
	CommandPrepareUpdate hostCommand = "prepare-update"
	CommandApplyUpdate   hostCommand = "apply-update"
	CommandBootUpdate    hostCommand = "boot-update"
)
View Source
const (
	StatusBootable        hostStatus = "bootable"
	StatusUpToDate        hostStatus = "up-to-date"
	StatusUpdateAvailable hostStatus = "available"
	StatusUpdateApplied   hostStatus = "applied"
	StatusUpdatePrepared  hostStatus = "prepared"
	StatusPendingAction   hostStatus = "pending"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host interface {
	Status() (*statusResponse, error)
	ListAvailable() (*listAvailableResponse, error)
	PrepareUpdate(id UpdateID) (*prepareUpdateResponse, error)
	ApplyUpdate(id UpdateID) (*applyUpdateResponse, error)
	BootUpdate(id UpdateID, rebootNow bool) (*bootUpdateResponse, error)
}

Host is the integration for this platform and the host - this is a very light mapping between the platform requirements and the implementation backing the interaction itself.

type NoopUpdate

type NoopUpdate struct{}

func (*NoopUpdate) Identifier

func (n *NoopUpdate) Identifier() interface{}

type Platform

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

func New

func New() (*Platform, error)

func (*Platform) BootUpdate

func (p *Platform) BootUpdate(target platform.Update, rebootNow bool) error

BootUpdate causes the platform to configure itself to use the update on next boot. Optionally, the caller may indicate that the update should be immediately rebooted to use.

func (*Platform) ListAvailable

func (p *Platform) ListAvailable() (platform.Available, error)

ListAvailable provides the list of updates that a platform is offering for use. The list MUST be ordered in preference as well as recency.

func (*Platform) Prepare

func (p *Platform) Prepare(target platform.Update) error

Prepare causes the platform to take steps towards an update without committing to it. For example, a platform may require steps to preform pre-flight checks or initialization migrations prior to executing an update.

func (*Platform) Status

func (p *Platform) Status() (platform.Status, error)

Status reports the underlying platform's health and metadata.

func (*Platform) Update

func (p *Platform) Update(target platform.Update) error

Update causes the platform to commit to an update - potentially taking irreversible steps to do so.

type UpdateID

type UpdateID = string

UpdateID is the type of the opaque Identifier used for this platform.

Jump to

Keyboard shortcuts

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