Documentation ¶
Index ¶
Constants ¶
const ( // UpdateStatusUpdatedNeedReboot is the status returned by updateengine on // dbus when a reboot is needed UpdateStatusUpdatedNeedReboot = "UPDATE_STATUS_UPDATED_NEED_REBOOT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a dbus client subscribed to updateengine status updates
func New ¶
New returns a Client connected to dbus over a private connection with a subscription to updateengine.
func (*Client) GetStatus ¶
GetStatus returns the current status of updateengine it returns an error if there is a problem getting the status from dbus
func (*Client) RebootNeededSignal ¶
RebootNeededSignal watches the updateengine status update subscription and passes the status on the rcvr channel whenever the status update is UpdateStatusUpdatedNeedReboot. The stop channel terminates the function. This function is intended to be called as a goroutine
type Status ¶
type Status struct { LastCheckedTime int64 Progress float64 CurrentOperation string NewVersion string NewSize int64 }
Status is a struct containing the information passed by updateengine on every status update.
func NewStatus ¶
func NewStatus(body []interface{}) (s Status)
NewStatus creates a new status from a list of fields. this function will panic at runtime if there are less than five elements in the provided list, or if they are not typed int64, float64, string, string, int64 respectively.
func TryNewStatus ¶ added in v0.6.2
TryNewStatus attempts to create a new Status from a list of fields in the dbus.Signal. An error is returned if the signal is nil, has less fields than required, or has a field of incorrect type (types must be int64, float64, string, string, int64 respectively). If successful, the new status is returned.