Documentation
¶
Overview ¶
Package util implements helpers to handle kernel battery data
Index ¶
- Constants
- func ByteStringToInt(d []byte) int
- func ByteStringToString(d []byte) string
- func CalculateDischarge(current, old int) int
- func CalculateDischargeRatePerHour(d int, h time.Duration) float32
- func Capacity() int
- func Check(e error)
- func CheckBattery()
- func CycleCount() int
- func DischargeStats(timestamp time.Time, currentTimestamp time.Time, charge int) (d int, dt time.Duration, dr float32)
- func EnergyFull() float32
- func EnergyFullDesign() float32
- func EnergyNow() float32
- func InputByteArrayToInt(s string) int
- func Manufacturer() string
- func MilliWattsToWatts(m int) float32
- func ParameterPath(p string) string
- func ParseTime(timestamp time.Time) string
- func PowerNow() float32
- func Status() string
- type BatteryPeriod
- type BatteryStats
Constants ¶
View Source
const BatteryPath = "/sys/class/power_supply/BAT0/"
Variables ¶
This section is empty.
Functions ¶
func ByteStringToInt ¶
func ByteStringToString ¶
func CalculateDischarge ¶
func CheckBattery ¶
func CheckBattery()
func CycleCount ¶
func CycleCount() int
func DischargeStats ¶
func EnergyFull ¶
func EnergyFull() float32
func EnergyFullDesign ¶
func EnergyFullDesign() float32
func InputByteArrayToInt ¶
func Manufacturer ¶
func Manufacturer() string
func MilliWattsToWatts ¶
func ParameterPath ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.