flags

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrInvalidVarType added in v0.2.0

func ErrInvalidVarType(name string, ptr interface{}) error

Types

type Bool added in v0.3.0

type Bool interface {
	GetBool() (bool, bool)
}

Bool is a flag of type bool

type Duration

type Duration interface {
	GetDuration() (time.Duration, bool)
}

Duration is a flag of type time.Duration

type Flag

type Flag interface {
	Changed() bool
}

type Int added in v0.10.2

type Int interface {
	GetInt() (int, bool)
}

Int is a flag of type int

type Int16 added in v0.3.0

type Int16 interface {
	GetInt16() (int16, bool)
}

Int16 is a flag of type int16

type Int32 added in v0.3.0

type Int32 interface {
	GetInt32() (int32, bool)
}

Int32 is a flag of type int32

type Looker

type Looker interface {
	Lookup(name string) Flag
}

type Mapper

type Mapper interface {
	Looker
	Parse()

	Var(v interface{}, name string, usage string, args ...interface{}) Mapper
	VarP(v interface{}, name string, short rune, usage string, args ...interface{}) Mapper
}

func GetMapper

func GetMapper(set interface{}) Mapper

func RegisterMapper added in v0.3.0

func RegisterMapper(set interface{}, m Mapper) Mapper

type MapperFunc added in v0.3.0

type MapperFunc func(name string) Flag

func (MapperFunc) GetBool added in v0.3.0

func (m MapperFunc) GetBool(name string) (bool, bool)

GetBool tries to find a field of a given name and return a bool

func (MapperFunc) GetDuration added in v0.3.0

func (m MapperFunc) GetDuration(name string) (time.Duration, bool)

GetDuration tries to find a field of a given name and return a time.Duration

func (MapperFunc) GetInt added in v0.10.2

func (m MapperFunc) GetInt(name string) (int, bool)

GetInt tries to find a field of a given name and return a int

func (MapperFunc) GetInt16 added in v0.3.0

func (m MapperFunc) GetInt16(name string) (int16, bool)

GetInt16 tries to find a field of a given name and return a int16

func (MapperFunc) GetInt32 added in v0.3.0

func (m MapperFunc) GetInt32(name string) (int32, bool)

GetInt32 tries to find a field of a given name and return a int32

func (MapperFunc) GetString added in v0.3.0

func (m MapperFunc) GetString(name string) (string, bool)

GetString tries to find a field of a given name and return a string

func (MapperFunc) GetStringSlice added in v0.10.3

func (m MapperFunc) GetStringSlice(name string) ([]string, bool)

GetStringSlice tries to find a field of a given name and return a []string

func (MapperFunc) GetUint added in v0.10.2

func (m MapperFunc) GetUint(name string) (uint, bool)

GetUint tries to find a field of a given name and return a uint

func (MapperFunc) GetUint16 added in v0.3.0

func (m MapperFunc) GetUint16(name string) (uint16, bool)

GetUint16 tries to find a field of a given name and return a uint16

func (MapperFunc) GetUint32 added in v0.3.0

func (m MapperFunc) GetUint32(name string) (uint32, bool)

GetUint32 tries to find a field of a given name and return a uint32

type String added in v0.3.0

type String interface {
	GetString() (string, bool)
}

String is a flag of type string

type StringSlice added in v0.10.3

type StringSlice interface {
	GetStringSlice() ([]string, bool)
}

StringSlice is a flag of type []string

type Uint added in v0.10.2

type Uint interface {
	GetUint() (uint, bool)
}

Uint is a flag of type uint

type Uint16

type Uint16 interface {
	GetUint16() (uint16, bool)
}

Uint16 is a flag of type uint16

type Uint32 added in v0.3.0

type Uint32 interface {
	GetUint32() (uint32, bool)
}

Uint32 is a flag of type uint32

Directories

Path Synopsis
cobra module

Jump to

Keyboard shortcuts

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