Documentation
¶
Index ¶
- func NewBase64Bytes(val []byte, p *[]byte) *base64BytesValue
- func NewDuration(val time.Duration, p *time.Duration) *durationValue
- func NewHexBytes(val []byte, p *[]byte) *hexBytesValue
- func NewIP(val net.IP, p *net.IP) *ipValue
- func NewIPMask(val net.IPMask, p *net.IPMask) *ipMaskValue
- func NewIPNet(val net.IPNet, p *net.IPNet) *ipNetValue
- func NewIPSlice(val []net.IP, p *[]net.IP) *ipSliceValue
- func NewInt(p *int) *intValue
- func NewRawBytes(val []byte, p *[]byte) *rawBytesValue
- func NewString(p *string) *stringValue
- func ParseIPv4Mask(s string) net.IPMask
- type EnumStringValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBase64Bytes ¶ added in v0.12.0
NewBase64Bytes creates a pflag.Value that parses base64-encoded textual input.
func NewDuration ¶
NewDuration creates a new durationValue.
func NewHexBytes ¶ added in v0.12.0
NewHexBytes creates a pflag.Value that parses hex-encoded textual input.
func NewRawBytes ¶ added in v0.12.0
NewRawBytes creates a pflag.Value that keeps raw textual bytes semantics.
func ParseIPv4Mask ¶ added in v0.12.0
ParseIPv4Mask parses masks written as dotted decimal or hex bytes (e.g. ffffff00).
Types ¶
type EnumStringValue ¶ added in v0.16.0
type EnumStringValue[E ~string] struct { // contains filtered or unexported fields }
EnumStringValue implements pflag.Value for string-based enum types. It validates on Set() that the value is in the allowed set, supports case-insensitive matching, and exposes allowed values via EnumValues().
func NewEnumString ¶ added in v0.16.0
func NewEnumString[E ~string](target *E, values map[E][]string) *EnumStringValue[E]
NewEnumString creates an EnumStringValue for the given target pointer. values maps each enum constant to its string representations; the first string in each slice is canonical, additional strings are aliases.
func (*EnumStringValue[E]) EnumValues ¶ added in v0.16.0
func (v *EnumStringValue[E]) EnumValues() []string
EnumValues returns the sorted canonical names for this enum. Satisfies the structcli.EnumValuer interface.
func (*EnumStringValue[E]) Set ¶ added in v0.16.0
func (v *EnumStringValue[E]) Set(s string) error
func (*EnumStringValue[E]) String ¶ added in v0.16.0
func (v *EnumStringValue[E]) String() string
func (*EnumStringValue[E]) Type ¶ added in v0.16.0
func (v *EnumStringValue[E]) Type() string