Documentation ¶
Overview ¶
Package snmp implements the 'agent snmp' subcommand.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OptPairs ¶
type OptPairs[T any] []struct { // contains filtered or unexported fields }
OptPairs is just a useful type alias to avoid writing this out multiple times.
type Options ¶
Options represents an ordered map of choices
func NewOptions ¶
NewOptions creates a new Options object from a set of pairs. We don't just create one directly from a map because map iteration order is random.
func (Options[T]) Flag ¶
func (o Options[T]) Flag(target *string) OptionsFlag[T]
Flag creates a flag using these options and storing the selected choice in target.
type OptionsFlag ¶
type OptionsFlag[T any] struct { // contains filtered or unexported fields }
OptionsFlag is an implementation of pflag.Value that complains when set to an invalid option.
func (OptionsFlag[T]) Set ¶
func (a OptionsFlag[T]) Set(p string) error
Set sets the value, returning an error if the given choice isn't valid.
func (OptionsFlag[T]) String ¶
func (a OptionsFlag[T]) String() string
String returns a string representation of this value.
func (OptionsFlag[T]) Type ¶
func (a OptionsFlag[T]) Type() string
Type is how the value is represented in the auto-generated help.