Documentation ¶
Index ¶
- Variables
- func Name(T Type) string
- type BooT
- func (b BooT) Bool() bool
- func (b BooT) Duration() time.Duration
- func (b BooT) Float() float64
- func (b *BooT) FromString(s string) error
- func (b BooT) Int() int64
- func (b BooT) List() []string
- func (b BooT) Meta() *Metadata
- func (b *BooT) Set(bo bool)
- func (b BooT) String() string
- func (b BooT) Uint() uint64
- type Concrete
- type Desc
- type DurT
- func (d DurT) Bool() bool
- func (d DurT) Duration() time.Duration
- func (d DurT) Float() float64
- func (d *DurT) FromString(s string) error
- func (d DurT) Int() int64
- func (d DurT) List() []string
- func (d DurT) Meta() *Metadata
- func (d *DurT) Set(du time.Duration)
- func (d DurT) String() string
- func (d DurT) Uint() uint64
- type FltT
- func (f FltT) Bool() bool
- func (f FltT) Duration() time.Duration
- func (f FltT) Float() float64
- func (f *FltT) FromString(s string) error
- func (f FltT) Int() int64
- func (f FltT) List() []string
- func (f FltT) Meta() *Metadata
- func (f *FltT) Set(fl float64)
- func (f FltT) String() string
- func (f FltT) Uint() uint64
- type IntT
- func (in IntT) Bool() bool
- func (in IntT) Duration() time.Duration
- func (in IntT) Float() float64
- func (in *IntT) FromString(s string) error
- func (in IntT) Int() int64
- func (in IntT) List() []string
- func (in IntT) Meta() *Metadata
- func (in *IntT) Set(i int64)
- func (in IntT) String() string
- func (in IntT) Uint() uint64
- type Item
- type LstT
- func (l LstT) Bool() bool
- func (l LstT) Duration() time.Duration
- func (l LstT) Float() float64
- func (l *LstT) FromString(s string) error
- func (l LstT) Int() int64
- func (l LstT) List() (li []string)
- func (l LstT) Meta() *Metadata
- func (l *LstT) Set(li ...string)
- func (l LstT) String() (o string)
- func (l LstT) Uint() uint64
- type Metadata
- type StrT
- func (s StrT) Bool() bool
- func (s StrT) Duration() time.Duration
- func (s StrT) Float() float64
- func (s *StrT) FromString(st string) error
- func (s StrT) Int() int64
- func (s StrT) List() []string
- func (s StrT) Meta() *Metadata
- func (s *StrT) Set(st string)
- func (s StrT) String() string
- func (s StrT) Uint() uint64
- type Type
- type UinT
- func (u UinT) Bool() bool
- func (u UinT) Duration() time.Duration
- func (u UinT) Float() float64
- func (u *UinT) FromString(s string) error
- func (u UinT) Int() int64
- func (u UinT) List() []string
- func (u UinT) Meta() *Metadata
- func (u *UinT) Set(ui uint64)
- func (u UinT) String() string
- func (u UinT) Uint() uint64
Constants ¶
This section is empty.
Variables ¶
var Names = []string{
"Bool",
"Int",
"Uint",
"Duration",
"Float",
"String",
"List",
}
Names provides the string associated with the Concrete type.
Functions ¶
Types ¶
type BooT ¶
type BooT struct { *Metadata // contains filtered or unexported fields }
BooT is a boolean item type
func (*BooT) FromString ¶
type Concrete ¶
type Concrete interface { Bool() bool Int() int64 Uint() uint64 Duration() time.Duration Float() float64 String() string List() []string }
Concrete should return a value for the correct concrete type and panic otherwise, except for String which should always yield a value.
type Desc ¶
type Desc struct {
Name, Group, Description, Documentation, Default string
Type Type
Aliases []string
}
Desc is the named field form of Metadata for generating a Metadata
type DurT ¶
type DurT struct { *Metadata // contains filtered or unexported fields }
DurT is a duration item type
func (*DurT) FromString ¶
type FltT ¶
type FltT struct { *Metadata // contains filtered or unexported fields }
FltT is a float64 item type
func (*FltT) FromString ¶
type IntT ¶
type IntT struct { *Metadata // contains filtered or unexported fields }
IntT is an int64 item type
func (*IntT) FromString ¶
type Item ¶
type Item interface { Name() string Type() Type Aliases() []string Group() string Description() string Documentation() string Default() string FromString(string) error Meta() *Metadata Concrete }
Item provides accessors for a Config item type's metadata and current contents, including a generic string format setter.
type Metadata ¶
Metadata stores the information about the types.Item for documentation purposes
func New ¶
New allows you to create a Metadata with a sparsely filled, named field struct literal.
name, type, group and tags all will be canonicalized to lower case.
func (*Metadata) Description ¶
func (*Metadata) Documentation ¶
type StrT ¶
type StrT struct { *Metadata // contains filtered or unexported fields }
StrT is a string item type
func (*StrT) FromString ¶
type UinT ¶
type UinT struct { *Metadata // contains filtered or unexported fields }
UinT is an uint64 item type