updateengine

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	UpdateStatusIdle                = "UPDATE_STATUS_IDLE"
	UpdateStatusCheckingForUpdate   = "UPDATE_STATUS_CHECKING_FOR_UPDATE"
	UpdateStatusUpdateAvailable     = "UPDATE_STATUS_UPDATE_AVAILABLE"
	UpdateStatusDownloading         = "UPDATE_STATUS_DOWNLOADING"
	UpdateStatusVerifying           = "UPDATE_STATUS_VERIFYING"
	UpdateStatusFinalizing          = "UPDATE_STATUS_FINALIZING"
	UpdateStatusUpdatedNeedReboot   = "UPDATE_STATUS_UPDATED_NEED_REBOOT"
	UpdateStatusReportingErrorEvent = "UPDATE_STATUS_REPORTING_ERROR_EVENT"
)

The possible update statuses returned from the update engine

These correspond to current operation values exposed over DBus and defined by `update_engine`: https://github.com/coreos/update_engine/blob/v0.4.3/src/update_engine/update_attempter.h#L34-L43

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New() (*Client, error)

func (*Client) AttemptUpdate added in v0.2.2

func (c *Client) AttemptUpdate() error

AttemptUpdate will trigger an update if available. This is an asynchronous call - it returns immediately.

func (*Client) Close added in v0.2.2

func (c *Client) Close() error

func (*Client) GetStatus

func (c *Client) GetStatus() (Status, error)

GetStatus gets the current status from update_engine

func (*Client) RebootNeededSignal

func (c *Client) RebootNeededSignal(rcvr chan Status, stop <-chan struct{})

func (*Client) ReceiveStatuses

func (c *Client) ReceiveStatuses(rcvr chan Status, stop <-chan struct{})

ReceiveStatuses receives signal messages from dbus and sends them as Statues on the rcvr channel, until the stop channel is closed. An attempt is made to get the initial status and send it on the rcvr channel before receiving starts.

type Status

type Status struct {
	LastCheckedTime  int64
	Progress         float64
	CurrentOperation string
	NewVersion       string
	NewSize          int64
}

func NewStatus

func NewStatus(body []interface{}) (s Status)

func (*Status) String

func (s *Status) String() string

Jump to

Keyboard shortcuts

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