flag

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DebugFlag added in v0.2.1

type DebugFlag struct {
	IsDebug bool
}

func NewDebugFlag added in v0.2.1

func NewDebugFlag() *DebugFlag

Create a new DebugFlag.

func (*DebugFlag) AddFlags added in v0.2.1

func (f *DebugFlag) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*DebugFlag) Validate added in v0.2.1

func (f *DebugFlag) Validate() error

Validate flag values.

type Flag

type Flag interface {
	// Add flags to the command.
	AddFlags(cmd *cobra.Command)

	// Validate values set to flags.
	Validate() error
}

Flag is the interface that handles command line options.

type FlagSet

type FlagSet struct {
	// contains filtered or unexported fields
}

FlagSet is the collection of flags to be set to the command.

func NewFlagSet

func NewFlagSet(args ...Flag) *FlagSet

Create a new flag collection.

func (*FlagSet) AddAllFlags

func (s *FlagSet) AddAllFlags(cmd *cobra.Command)

Add flags to the command.

func (*FlagSet) ValidateAll

func (s *FlagSet) ValidateAll() error

Validate all flags.

type FramingFlags added in v0.1.2

type FramingFlags struct {
	AcceptedFraming []string
}

func NewFramingFlags added in v0.1.2

func NewFramingFlags() *FramingFlags

Create a new FramingFlags with default values set.

func (*FramingFlags) AddFlags added in v0.1.2

func (f *FramingFlags) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*FramingFlags) ToProtoAcceptedFraming added in v0.1.2

func (f *FramingFlags) ToProtoAcceptedFraming() []v1.Framing

Return accepted framing

func (*FramingFlags) Validate added in v0.1.2

func (f *FramingFlags) Validate() error

Validate flag values.

type MinElevationFlags

type MinElevationFlags struct {
	MinElevation float64
}

func NewMinElevationFlags

func NewMinElevationFlags() *MinElevationFlags

Create a new MinElevationFlags with default values set.

func (*MinElevationFlags) AddFlags

func (f *MinElevationFlags) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*MinElevationFlags) Validate

func (f *MinElevationFlags) Validate() error

Validate flag values.

type OutputFormatFlags

type OutputFormatFlags struct {
	Format string
}

func NewOutputFormatFlags

func NewOutputFormatFlags() *OutputFormatFlags

Create a new OutputFormatFlags with default values set.

func (*OutputFormatFlags) AddFlags

func (f *OutputFormatFlags) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*OutputFormatFlags) ToPrinter

func (f *OutputFormatFlags) ToPrinter() printer.Printer

Return a Printer corresponding to the output format.

func (*OutputFormatFlags) Validate

func (f *OutputFormatFlags) Validate() error

Validate flag values.

type PassRangeFlags

type PassRangeFlags struct {
	AOSAfter       time.Time
	AOSBefore      time.Time
	DurationInDays uint8

	// Maximum duration in days used in the validation.
	MaxDurationInDays uint8
	// contains filtered or unexported fields
}

func NewPassRangeFlags

func NewPassRangeFlags() *PassRangeFlags

Create a new PassRangeFlags with default values set.

func (*PassRangeFlags) AddFlags

func (f *PassRangeFlags) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*PassRangeFlags) Validate

func (f *PassRangeFlags) Validate() error

Validate flag values.

type PlanIdFlag added in v0.2.0

type PlanIdFlag struct {
	AcceptedPlanId []string
}

func NewPlanIdFlag added in v0.2.0

func NewPlanIdFlag() *PlanIdFlag

Create a new PlanIdFlag with default values set.

func (*PlanIdFlag) AddFlags added in v0.2.0

func (f *PlanIdFlag) AddFlags(cmd *cobra.Command)

Add a flag to the command.

func (*PlanIdFlag) Validate added in v0.2.0

func (f *PlanIdFlag) Validate() error

Validate flag values.

type ProxyFlags added in v0.1.2

type ProxyFlags struct {
	ProxyProtocol string

	UDPListenHost string
	UDPListenPort uint16
	UDPSendHost   string
	UDPSendPort   uint16

	TCPListenHost string
	TCPListenPort uint16
}

func NewProxyFlags added in v0.1.2

func NewProxyFlags() *ProxyFlags

Create a new ProxyFlags with default values set.

func (*ProxyFlags) AddFlags added in v0.1.2

func (f *ProxyFlags) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*ProxyFlags) ToProxy added in v0.1.2

func (f *ProxyFlags) ToProxy() stream.Proxy

Return a Proxy corresponding to the protocol.

func (*ProxyFlags) Validate added in v0.1.2

func (f *ProxyFlags) Validate() error

Validate flag values.

type UWRangeFlags

type UWRangeFlags struct {
	StartTime      time.Time
	EndTime        time.Time
	DurationInDays uint16

	// Maximum duration in days used in the validation.
	MaxDurationInDays uint16
	// contains filtered or unexported fields
}

func NewUWRangeFlags

func NewUWRangeFlags() *UWRangeFlags

Create a new UWRangeFlags with default values set.

func (*UWRangeFlags) AddFlags

func (f *UWRangeFlags) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*UWRangeFlags) Validate

func (f *UWRangeFlags) Validate() error

Validate flag values.

type VerboseFlags added in v0.1.2

type VerboseFlags struct {
	IsVerbose bool
}

func NewVerboseFlags added in v0.1.2

func NewVerboseFlags() *VerboseFlags

Create a new VerboseFlags.

func (*VerboseFlags) AddFlags added in v0.1.2

func (f *VerboseFlags) AddFlags(cmd *cobra.Command)

Add flags to the command.

func (*VerboseFlags) Validate added in v0.1.2

func (f *VerboseFlags) Validate() error

Validate flag values.

Jump to

Keyboard shortcuts

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