structflags

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DurationType = reflect.TypeOf(time.Duration(0))
View Source
var UnmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem()

Functions

func MustPopulateFlagsFromStruct

func MustPopulateFlagsFromStruct(s interface{}) []cli.Flag

func PopulateFlagsFromStruct

func PopulateFlagsFromStruct(s interface{}) ([]cli.Flag, error)

func PopulateStructFromCliContext

func PopulateStructFromCliContext(cfg interface{}, c *cli.Context) error

Types

type ParsedTag

type ParsedTag struct {
	Name    string
	Usage   string
	Aliases []string
	Opts    map[string]struct{}
}

func Parse

func Parse(tag reflect.StructTag, parent *ParsedTag) *ParsedTag

func (*ParsedTag) ToCliFlag

func (parsed *ParsedTag) ToCliFlag(v reflect.Value) cli.Flag

type Unmarshaler

type Unmarshaler interface {
	UnmarshalFlag(string) error
}

Jump to

Keyboard shortcuts

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