Documentation
¶
Overview ¶
Package scanmode resolves the scan mode that applies to a token: its own #tap or #hold trait, then the configured mode of the reader it came from, then the global readers.scan.mode.
It sits below both the service loop that acts on the answer and the API method that reports it, so a client is never told a policy other than the one removal will apply.
Index ¶
- func ForToken(cfg *config.Instance, st *state.State, t *tokens.Token) string
- func ForTokenAfterRemoval(cfg *config.Instance, st *state.State, t *tokens.Token) string
- func HoldForToken(cfg *config.Instance, st *state.State, t *tokens.Token) bool
- func HoldForTokenAfterRemoval(cfg *config.Instance, st *state.State, t *tokens.Token) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForTokenAfterRemoval ¶
ForTokenAfterRemoval resolves like ForToken, except that a reader which has since disconnected keeps the decision made while it was still present.
The exit timer is only armed when hold is enabled, and re-resolving when it fires is what catches the mode being turned off during the delay. A reader that disappeared in the meantime is lost information rather than a policy change: falling back to the global mode there would silently drop its per-reader override, so a hold reader on a tap device would arm the timer and then never exit the media it launched.
The API reports this same answer, so `readers` never claims tap for an owner whose removal will exit.
func HoldForToken ¶
HoldForToken reports whether removing t should exit media.
Types ¶
This section is empty.