Documentation
¶
Overview ¶
Package connectionpolicy defines the default reaction to a discovered device.
Policy evaluates discovery state only. It never opens an endpoint, creates a Session, or asks a user for input; those actions remain the responsibility of the client that consumes a decision.
Index ¶
Constants ¶
const Default = PolicyAsk
Default is the safe policy used when configuration does not specify one.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action string
Action identifies the next step a client should take after evaluating a device-discovery event.
const ( // ActionNone means no discovery-driven action should be taken. ActionNone Action = "none" // ActionAsk requires the client to ask the user before opening the endpoint. ActionAsk Action = "ask" // ActionConnect permits the client to open the endpoint without a further // approval prompt. ActionConnect Action = "connect" // ActionDeny tells the client to ignore the discovery event without asking. ActionDeny Action = "deny" )
type Policy ¶
type Policy string
Policy identifies the default client reaction to a newly discovered endpoint.
const ( // PolicyAsk requires the client to obtain the user's approval before opening // a discovered endpoint. PolicyAsk Policy = "ask" // PolicyAuto permits the client to open a discovered endpoint without asking // for approval first when it has sufficient connection parameters. PolicyAuto Policy = "auto" // PolicyDeny tells the client to ignore a discovered endpoint. It does not // restrict an explicit user-requested connection. PolicyDeny Policy = "deny" )
func FromConfig ¶
FromConfig resolves an optional configuration value, using Default when the field is omitted. A non-empty unrecognized value is rejected rather than silently changing the user's intended connection behavior.