flagext

package
v0.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultValues

func DefaultValues(rs ...Registerer)

DefaultValues initiates a set of configs (Registerers) with their defaults.

Types

type CIDR

type CIDR struct {
	Value *net.IPNet
}

CIDR is a network CIDR.

func (*CIDR) Set

func (c *CIDR) Set(s string) error

Set implements flag.Value.

func (CIDR) String

func (c CIDR) String() string

String implements flag.Value.

type CIDRSliceCSV

type CIDRSliceCSV []CIDR

CIDRSliceCSV is a slice of CIDRs that is parsed from a comma-separated string. It implements flag.Value and yaml Marshalers.

func (CIDRSliceCSV) MarshalYAML

func (c CIDRSliceCSV) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler.

func (*CIDRSliceCSV) Set

func (c *CIDRSliceCSV) Set(s string) error

Set implements flag.Value

func (CIDRSliceCSV) String

func (c CIDRSliceCSV) String() string

String implements flag.Value

func (*CIDRSliceCSV) UnmarshalYAML

func (c *CIDRSliceCSV) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler.

type Registerer

type Registerer interface {
	RegisterFlags(*flag.FlagSet)
}

Registerer is a thing that can RegisterFlags

type Secret

type Secret struct {
	Value string
}

func (Secret) MarshalYAML

func (v Secret) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler.

func (*Secret) Set

func (v *Secret) Set(s string) error

Set implements flag.Value

func (Secret) String

func (v Secret) String() string

String implements flag.Value

func (*Secret) UnmarshalYAML

func (v *Secret) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler.

type StringSlice

type StringSlice []string

StringSlice is a slice of strings that implements flag.Value

func (*StringSlice) Set

func (v *StringSlice) Set(s string) error

Set implements flag.Value

func (StringSlice) String

func (v StringSlice) String() string

String implements flag.Value

type Time

type Time time.Time

Time usable as flag or in YAML config.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL