values

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2016 License: MIT, MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool bool

Bool is a boolean value for the Value interface

func NewBool

func NewBool(val bool, p *bool) *Bool

NewBool returns a new bool value

func (*Bool) Get

func (b *Bool) Get() interface{}

Get returns the value interface

func (*Bool) IsBoolValue

func (b *Bool) IsBoolValue() bool

IsBoolValue returns true since it is a BoolValue

func (*Bool) Set

func (b *Bool) Set(s string) error

Set sets the value from a string

func (*Bool) String

func (b *Bool) String() string

String returns the value as a string

type Duration

type Duration time.Duration

Duration is a Time.Duration value for the Value interface

func NewDuration

func NewDuration(val time.Duration, p *time.Duration) *Duration

NewDuration returns a new time.Duration value

func (*Duration) Get

func (d *Duration) Get() interface{}

Get returns the value interface

func (*Duration) Set

func (d *Duration) Set(s string) error

Set sets the value from a string

func (*Duration) String

func (d *Duration) String() string

String returns the value as a string

type Float64

type Float64 float64

Float64 is a float64 value for the Value interface

func NewFloat64

func NewFloat64(val float64, p *float64) *Float64

NewFloat64 returns a new float64 value

func (*Float64) Get

func (f *Float64) Get() interface{}

Get returns the value interface

func (*Float64) Set

func (f *Float64) Set(s string) error

Set sets the value from a string

func (*Float64) String

func (f *Float64) String() string

String returns the value as a string

type Int

type Int int

Int is an integer value for the Value interface

func NewInt

func NewInt(val int, p *int) *Int

NewInt returns a new integer value

func (*Int) Get

func (i *Int) Get() interface{}

Get returns the value interface

func (*Int) Set

func (i *Int) Set(s string) error

Set sets the value from a string

func (*Int) String

func (i *Int) String() string

String returns the value as a string

type Int64

type Int64 int64

Int64 is an int64 value for the Value interface

func NewInt64

func NewInt64(val int64, p *int64) *Int64

NewInt64 returns a new int64 value

func (*Int64) Get

func (i *Int64) Get() interface{}

Get returns the value interface

func (*Int64) Set

func (i *Int64) Set(s string) error

Set sets the value from a string

func (*Int64) String

func (i *Int64) String() string

String returns the value as a string

type List

type List []Value

List is list of values

func (List) GetAll

func (v List) GetAll() []interface{}

GetAll gets an interface for all values in the list

func (List) Strings

func (v List) Strings() []string

Strings returns all the values as their strings

type Map

type Map map[string]Value

Map is a map fo values with strings for keys

func (Map) Keys

func (v Map) Keys() []string

Keys returns the keys of the value map

func (Map) Values

func (v Map) Values() List

Values returns a ValueList of all the values in the map

type String

type String string

String is a string value for the Value interface

func NewString

func NewString(val string, p *string) *String

NewString returns a new string value

func (*String) Get

func (s *String) Get() interface{}

Get returns the value interface

func (*String) Set

func (s *String) Set(val string) error

Set sets the value from a string

func (*String) String

func (s *String) String() string

String returns the value as a string

type Uint

type Uint uint

Uint is a unit value for the Value interface

func NewUint

func NewUint(val uint, p *uint) *Uint

NewUint returns a new uint value

func (*Uint) Get

func (u *Uint) Get() interface{}

Get returns the value interface

func (*Uint) Set

func (u *Uint) Set(s string) error

Set sets the value from a string

func (*Uint) String

func (u *Uint) String() string

String returns the value as a string

type Uint64

type Uint64 uint64

Uint64 is a uint64 value for the Value interface

func NewUint64

func NewUint64(val uint64, p *uint64) *Uint64

NewUint64 returns a new uint64 value

func (*Uint64) Get

func (u *Uint64) Get() interface{}

Get returns the value interface

func (*Uint64) Set

func (u *Uint64) Set(s string) error

Set sets the value from a string

func (*Uint64) String

func (u *Uint64) String() string

String returns the value as a string

type Value

type Value interface {
	Get() interface{}
	String() string
	Set(string) error
}

Value is the interface to the dynamic value stored in a flag. (The default value is represented as a string.)

If a Value has an IsBoolFlag() bool method returning true, the command-line parser makes -name equivalent to -name=true rather than using the next command-line argument.

Jump to

Keyboard shortcuts

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