origin: github.com/openshift/origin/pkg/cmd/flagtypes Index | Files

package flagtypes

import "github.com/openshift/origin/pkg/cmd/flagtypes"

Package flagtypes provides types that implement the pflags.Value interface for converting command line flags to objects.

Index

Package Files

addr.go doc.go glog.go net.go

func GLog Uses

func GLog(flags *pflag.FlagSet)

GLog binds the log flags from the default Google "flag" package into a pflag.FlagSet.

type Addr Uses

type Addr struct {
    // Specified by the caller
    DefaultScheme string
    DefaultPort   int
    AllowPrefix   bool

    // Provided will be true if Set is invoked
    Provided bool
    // Value is the exact value provided on the flag
    Value string

    // URL represents the user input. The Host field is guaranteed
    // to be set if Provided is true
    URL *url.URL
    // Host is the hostname or IP portion of the user input
    Host string
    // IPv6Host is true if the hostname appears to be an IPv6 input
    IPv6Host bool
    // Port is the port portion of the user input. Will be 0 if no port was found
    // and no default port could be established.
    Port int
}

Addr is a flag type that attempts to load a host, IP, host:port, or URL value from a string argument. It tracks whether the value was set and allows the caller to provide defaults for the scheme and port.

func (Addr) Default Uses

func (a Addr) Default() Addr

Default creates a new Address with the value set

func (*Addr) HostPort Uses

func (a *Addr) HostPort(defaultPort int) string

HostPort returns the host and port joined together. If no port is set :0 will be appended.

func (*Addr) Set Uses

func (a *Addr) Set(value string) error

Set attempts to set a string value to an address

func (*Addr) String Uses

func (a *Addr) String() string

String returns the string representation of the Addr

func (*Addr) Type Uses

func (a *Addr) Type() string

Type returns a string representation of what kind of value this is

type IP Uses

type IP net.IP

IP adapts net.IP for use as a flag.

func (*IP) Set Uses

func (ip *IP) Set(value string) error

func (IP) String Uses

func (ip IP) String() string

func (*IP) Type Uses

func (ip *IP) Type() string

Type returns a string representation of what kind of argument this is

type IPNet Uses

type IPNet net.IPNet

IPNet adapts net.IPNet for use as a flag.

func DefaultIPNet Uses

func DefaultIPNet(value string) IPNet

func (*IPNet) Set Uses

func (ipnet *IPNet) Set(value string) error

func (IPNet) String Uses

func (ipnet IPNet) String() string

func (*IPNet) Type Uses

func (ipnet *IPNet) Type() string

Type returns a string representation of what kind of argument this is

Package flagtypes imports 8 packages (graph) and is imported by 38 packages. Updated 2019-04-08. Refresh now. Tools for package owners.