flagvar

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidEnum = errors.New("invalid enum option")

Functions

This section is empty.

Types

type Enum

type Enum struct {
	Choices []string
	Value   string
}

func (*Enum) Help

func (e *Enum) Help() string

func (*Enum) Set

func (e *Enum) Set(v string) error

func (*Enum) String

func (e *Enum) String() string

type File

type File struct {
	Value string
}

File is a flag.Value for file paths. Returns any errors from os.Stat.

func (*File) Help

func (f *File) Help() string

Help returns a string to include in the flag's help message.

func (*File) Set

func (f *File) Set(v string) error

Set implements flag.Value by checking for the file's existence through using os.Stat. Any error returned by os.Stat is returned by this function.

func (*File) String

func (f *File) String() string

String implements flag.Value by returning the current file path.

func (*File) Type

func (f *File) Type() string

Type implements pflag.Value by noting our Value is string typed.

type TCPAddr

type TCPAddr struct {
	Network string
	Value   *net.TCPAddr
	Text    string
}

TCPAddr is a flag.Value for file paths. Returns any errors from net.ResolveTCPAddr.

func (*TCPAddr) Help

func (t *TCPAddr) Help() string

Help returns a string to include in the flag's help message.

func (*TCPAddr) Set

func (t *TCPAddr) Set(v string) error

Set implements flag.Value by parsing the provided address using net.ResolveTCPAddr. Any error return is returned by this function.

func (*TCPAddr) String

func (t *TCPAddr) String() string

String implements flag.Value by returning the current Text.

func (*TCPAddr) Type

func (t *TCPAddr) Type() string

Type implements pflag.Value by noting our Value is net.TCPAddr typed.

Jump to

Keyboard shortcuts

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