Documentation
¶
Overview ¶
Package network says whether the phone is online, and how.
nimbus native plugin add network
s, err := network.Get(ctx)
network.Watch(ctx, func(s network.Status) { setOnline(s.Connected) })
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Status ¶
type Status struct {
Connected bool `json:"connected"` // whether it is online
Type string `json:"type"` // "wifi", "cellular", "wired", "other" or "none"
Expensive bool `json:"expensive"` // metered, such as mobile data
Address string `json:"address"` // the phone's IP on this network, not its public one
Airplane bool `json:"airplane"` // airplane mode; Android only, as iOS doesn't say
}
Status is the phone's connection.
Click to show internal directories.
Click to hide internal directories.