Documentation
¶
Index ¶
- Constants
- Variables
- func CachedProperty(name string) string
- func HWAddrWLAN() (string, error)
- func MemoryInfo() (info map[string]int, err error)
- func Properties() (props map[string]string, err error)
- func Property(name string) string
- func Rotation() (rotation int, err error)
- type Battery
- type Display
- type PackageInfo
- type Processor
Constants ¶
View Source
const ( BatteryStatusUnknown = 1 BatteryStatusCharging = 2 BatteryStatusDischarging = 3 BatteryStatusNotCharging = 4 BatteryStatusFull = 5 BatteryHealthUnknown = 1 BatteryHealthGood = 2 BatteryHealthOverheat = 3 BatteryHealthDead = 4 BatteryHealthOverVoltage = 5 BatteryHealthUnspecifiedFailure = 6 BatteryHealthCold = 7 )
Variables ¶
View Source
var (
ErrGetprop = errors.New("error call getprop")
)
View Source
var (
ErrPackageNotExist = errors.New("package not exist")
)
Functions ¶
func HWAddrWLAN ¶
func MemoryInfo ¶
MemoryInfo read from /proc/meminfo, unit kB
func Properties ¶
Properties extract info from $ adb shell getprop
Types ¶
type Battery ¶
type Battery struct { ACPowered bool `json:"acPowered"` USBPowered bool `json:"usbPowered"` WirelessPowered bool `json:"wirelessPowered"` Status int `json:"status"` Health int `json:"health"` Present bool `json:"present"` Level int `json:"level"` Scale int `json:"scale"` Voltage int `json:"voltage"` Temperature int `json:"temperature"` Technology string `json:"technology"` }
func (*Battery) StatusName ¶
type Display ¶
func WindowSize ¶
WindowSize parse command "wm size" output command output example:
Physical size: 1440x2560 Override size: 1080x1920
type PackageInfo ¶
func StatPackage ¶
func StatPackage(packageName string) (pi PackageInfo, err error)
StatPackage returns PackageInfo If package not found, err will be ErrPackageNotExist
Click to show internal directories.
Click to hide internal directories.