Documentation
¶
Overview ¶
Package power reports whether the device is running on mains power or a battery, and how much of that battery is left. The updater uses it to refuse an install that could lose power part-way through.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Source ¶
type Source string
Source is where the device is drawing power from.
const ( // SourceNoBattery means the hardware has no battery at all, so it is // running on whatever mains supply it always runs on. SourceNoBattery Source = "noBattery" // SourceExternal means a charger or dock is supplying power. The battery // percentage does not matter while this is true. SourceExternal Source = "external" // SourceBattery means the device is discharging and Percent is its // remaining charge. SourceBattery Source = "battery" // SourceUnknown means the hardware may have a battery but its state could // not be read. Callers must treat this as "could lose power at any // moment", not as "probably fine". SourceUnknown Source = "unknown" )
Click to show internal directories.
Click to hide internal directories.