structflags

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem()

Functions

func MustPopulateFlagsFromStruct

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

func PopulateFlagsFromStruct

func PopulateFlagsFromStruct(v 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(k reflect.Kind) 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