arguments

package
v0.0.0-...-b9cfb1f Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFloat

func IsFloat(value string) bool

IsFloat checks if the input string is able to be parsed as an integer.

func IsInt

func IsInt(value string) bool

IsInt checks if the input string is able to be parsed as an integer.

Types

type Argument

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

func NewFloat

func NewFloat(name string, optional bool) *Argument

NewFloat returns a new Float argument with the given name and optional value.

func NewInt

func NewInt(name string, optional bool) *Argument

NewInt returns a new Int argument with the given name and optional value.

func NewString

func NewString(name string, optional bool) *Argument

NewString returns a new String argument with the given name and optional value.

func NewStringEnum

func NewStringEnum(name string, optional bool, options []string) *Argument

NewStringEnum returns a new String Enum argument with the given name and optional value.

func (*Argument) ConvertValue

func (argument *Argument) ConvertValue(value string) interface{}

ConvertValues returns the converted value of the value.

func (*Argument) GetInputAmount

func (argument *Argument) GetInputAmount() int

GetInputAmount returns the amount of arguments of input this argument requires.

func (*Argument) GetName

func (argument *Argument) GetName() string

GetName returns the name of the argument.

func (*Argument) GetOutput

func (argument *Argument) GetOutput() interface{}

GetOutput returns the output value of this argument.

func (*Argument) IsOptional

func (argument *Argument) IsOptional() bool

IsOptional checks if the argument is optional.

func (*Argument) IsValidValue

func (argument *Argument) IsValidValue(value string) bool

IsValidValue checks if the given value is valid for the argument.

func (*Argument) SetInputAmount

func (argument *Argument) SetInputAmount(amount int)

SetInputAmount sets the amount of arguments the input of this argument requires.

func (*Argument) SetName

func (argument *Argument) SetName(name string)

SetName sets the name of the argument.

func (*Argument) SetOptional

func (argument *Argument) SetOptional(value bool)

SetOptional sets the argument optional or non-optional.

func (*Argument) SetOutput

func (argument *Argument) SetOutput(value interface{})

SetOutput sets the output value of this argument.

func (*Argument) ShouldMerge

func (argument *Argument) ShouldMerge() bool

ShouldMerge returns whether this argument should merge all its values or not.

Jump to

Keyboard shortcuts

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