flagext

package
v0.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: Apache-2.0 Imports: 8 Imported by: 74

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultValues

func DefaultValues(rs ...Registerer)

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

func DeprecatedFlag

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

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 DayValue

type DayValue struct {
	model.Time
	// contains filtered or unexported fields
}

DayValue is a model.Time that can be used as a flag. NB it only parses days!

func NewDayValue

func NewDayValue(t model.Time) DayValue

NewDayValue makes a new DayValue; will round t down to the nearest midnight.

func (*DayValue) IsSet

func (v *DayValue) IsSet() bool

IsSet returns true is the DayValue has been set.

func (*DayValue) Set

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

Set implements flag.Value

func (DayValue) String

func (v DayValue) String() string

String implements flag.Value

type Registerer

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

Registerer is a thing that can RegisterFlags

type StringSlice added in v0.2.0

type StringSlice []string

StringSlice is a slice of strings that implements flag.Value

func (*StringSlice) Set added in v0.2.0

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

Set implements flag.Value

func (StringSlice) String added in v0.2.0

func (v StringSlice) String() string

String implements flag.Value

type Strings

type Strings []string

Strings is a list of strings.

func (*Strings) Set

func (ss *Strings) Set(s string) error

Set implements flag.Value

func (Strings) String

func (ss Strings) String() string

String implements flag.Value

type URLValue

type URLValue struct {
	*url.URL
}

URLValue is a url.URL that can be used as a flag.

func (*URLValue) Set

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

Set implements flag.Value

func (URLValue) String

func (v URLValue) String() string

String implements flag.Value

func (*URLValue) UnmarshalYAML

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

UnmarshalYAML implements yaml.Unmarshaler.

Jump to

Keyboard shortcuts

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