flagext

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeprecatedFlagsUsed = promauto.NewCounter(
	prometheus.CounterOpts{
		Name: "deprecated_flags_inuse_total",
		Help: "The number of deprecated flags currently set.",
	})

DeprecatedFlagsUsed is the metric that counts deprecated flags set.

Functions

func DefaultValues

func DefaultValues(rs ...Registerer)

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

func DeprecatedFlag

func DeprecatedFlag(f *flag.FlagSet, name, message string, logger log.Logger)

DeprecatedFlag logs a warning when you try to use it.

func RegisterFlags

func RegisterFlags(rs ...Registerer)

RegisterFlags registers flags with the provided Registerers

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