Documentation
¶
Overview ¶
Package capability holds the one rule every collection status of res/system follows: a state and, where something is missing, why (testdata/capability/v1). Packages keep their own status types and error sentinels and ask this package whether a pair is allowed.
Index ¶
Constants ¶
const ( Unsupported = "unsupported" Permission = "permission" NoDevice = "no_device" ToolMissing = "tool_missing" )
The reasons every package shares (testdata/capability/v1).
Variables ¶
This section is empty.
Functions ¶
func Allowed ¶
Allowed reports whether state is known and reason fits it: none for complete and partial, permission or none for permission-denied, unsupported or tool_missing for unsupported, and none, permission, no_device or tool_missing for unavailable. The state exited, which only process observation uses, takes none. The Go observers always give an unavailable status a reason (Unavailable); the empty one stays allowed for a status another binding wrote.
func Unavailable ¶ added in v0.5.0
Unavailable is the reason of an unavailable status after a native read failed with err: permission when the system refused the read, tool_missing when a program it needs is not installed, and no_device otherwise, which covers a device, session or source that is absent or did not answer. A nil err, for a read that failed without one, is no_device.
Types ¶
This section is empty.