Documentation ¶
Index ¶
- Variables
- type Argument
- type ArgumentWithNumberValue
- type ArgumentWithValue
- type Arguments
- func (left Arguments) Equal(right Arguments) bool
- func (arguments *Arguments) NormalizeState()
- func (arguments *Arguments) Parse() (args []string, err error)
- func (arguments *Arguments) UnmarshalJSON(data []byte) (err error)
- func (arguments *Arguments) UnmarshalYAML(value *yaml.Node) (err error)
- func (arguments *Arguments) ValidateLazy() (err error)
- type Base
- func (argument *Base) Disable()
- func (argument *Base) Enable()
- func (argument *Base) GetArgument() string
- func (argument *Base) GetName() string
- func (argument *Base) GetSeperator(seperator Seperator) (sep Seperator)
- func (argument *Base) GetType() Type
- func (argument *Base) IsDisabled() bool
- func (argument *Base) IsMandatory() bool
- func (argument *Base) NormalizeState()
- func (argument *Base) Parse(sep Seperator) (string, error)
- func (argument *Base) Reset()
- func (argument *Base) ValidateLazy() (err error)
- type Boolean
- type BooleanType
- type BooleanValue
- type Connect
- func (argument *Connect) Disable()
- func (argument *Connect) Enable()
- func (argument *Connect) GetArgument() string
- func (argument *Connect) GetName() string
- func (argument *Connect) GetSeperator(seperator Seperator) (sep Seperator)
- func (argument *Connect) GetType() Type
- func (argument *Connect) IsDisabled() bool
- func (argument *Connect) IsMandatory() bool
- func (argument *Connect) NormalizeState()
- func (argument *Connect) Parse(sep Seperator) (string, error)
- func (argument *Connect) ParseWithIP(ip string) (string, error)
- func (argument *Connect) Reset()
- func (argument *Connect) ValidateLazy() (err error)
- type Enum
- func (left *Enum) Equal(right *Enum) bool
- func (argument *Enum) GetDefault() string
- func (argument *Enum) GetValue() string
- func (argument *Enum) NormalizeState()
- func (argument *Enum) Parse(sep Seperator) (arg string, err error)
- func (argument *Enum) Reset()
- func (argument *Enum) ValidateLazy() (err error)
- type EnumItem
- type Float
- func (argument *Float) GetDefault() float32
- func (argument *Float) GetMaxValue() float32
- func (argument *Float) GetMinValue() float32
- func (argument *Float) GetValue() float32
- func (argument *Float) NormalizeState()
- func (argument *Float) Parse(sep Seperator) (arg string, err error)
- func (argument *Float) Reset()
- func (argument *Float) ValidateLazy() (err error)
- type Integer
- func (argument *Integer) GetDefault() int
- func (argument *Integer) GetMaxValue() int
- func (argument *Integer) GetMinValue() int
- func (argument *Integer) GetValue() int
- func (argument *Integer) NormalizeState()
- func (argument *Integer) Parse(sep Seperator) (arg string, err error)
- func (argument *Integer) Reset()
- func (argument *Integer) ValidateLazy() (err error)
- type NumberValue
- type Seperator
- type String
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BOOLEANVALUE_BOOL = BooleanValue{BOOLEANTYPE_BOOL, "true", "false"} BOOLEANVALUE_BOOLUPPER = BooleanValue{BOOLEANTYPE_BOOLUPPER, "True", "False"} BOOLEANVALUE_BOOLUPPERFULL = BooleanValue{BOOLEANTYPE_BOOLUPPERFULL, "TRUE", "FALSE"} BOOLEANVALUE_INTEGER = BooleanValue{BOOLEANTYPE_INTEGER, "1", "0"} )
View Source
var ( BOOLEANTYPE_UNDEFINED = BooleanType{""} BOOLEANTYPE_BOOL = BooleanType{"bool"} BOOLEANTYPE_BOOLUPPER = BooleanType{"boolupper"} BOOLEANTYPE_BOOLUPPERFULL = BooleanType{"boolupperfull"} BOOLEANTYPE_INTEGER = BooleanType{"integer"} BOOLEANTYPE_CUSTOM = BooleanType{"custom"} )
View Source
var ( TYPE_UNDEFINED = Type{""} TYPE_BOOLEAN = Type{"boolean"} TYPE_STRING = Type{"string"} TYPE_INTEGER = Type{"integer"} TYPE_FLOAT = Type{"float"} TYPE_ENUM = Type{"enum"} TYPE_BASE = Type{"base"} TYPE_CONNECT = Type{"connect"} )
View Source
var (
SEPERATOR_SPACE = newSpaceSeperator()
)
Functions ¶
This section is empty.
Types ¶
type ArgumentWithNumberValue ¶
type ArgumentWithNumberValue[T NumberValue] interface { ArgumentWithValue[T] GetMinValue() T GetMaxValue() T }
type ArgumentWithValue ¶
type Arguments ¶
type Arguments struct { Seperator *Seperator `json:"seperator,omitempty" yaml:"seperator,omitempty"` Arguments []Argument `json:"items,omitempty" yaml:"items,omitempty"` }
func (*Arguments) NormalizeState ¶
func (arguments *Arguments) NormalizeState()
func (*Arguments) UnmarshalJSON ¶
func (*Arguments) UnmarshalYAML ¶
TODO YAML and JSON unmarshl can be unified in one function by using their Decode interfaces we need to declare a new interface Decode and assign it the decode functions --> then YAML and JSON Decoder implement that interface and it can be given as input to the function function: unmarshl(Argument, Decoder) (Argument, err)
func (*Arguments) ValidateLazy ¶
type Base ¶
type Base struct { Type Type `json:"type" yaml:"type"` Mandatory bool `json:"mandatory" yaml:"mandatory"` Disabled bool `json:"disabled" yaml:"disabled"` Seperator *Seperator `json:"seperator,omitempty" yaml:"seperator,omitempty"` Argument string `json:"argument" yaml:"argument"` Name string `json:"name" yaml:"name"` }
func (*Base) GetArgument ¶
func (*Base) GetSeperator ¶
func (*Base) IsDisabled ¶
func (*Base) IsMandatory ¶
func (*Base) NormalizeState ¶
func (argument *Base) NormalizeState()
func (*Base) ValidateLazy ¶
type Boolean ¶
type Boolean struct { Base `yaml:",inline"` Default bool `json:"default" yaml:"default"` Value bool `json:"value" yaml:"value"` Values *BooleanValue `json:"values" yaml:"values"` }
func (*Boolean) GetDefault ¶
func (*Boolean) NormalizeState ¶
func (argument *Boolean) NormalizeState()
func (*Boolean) ValidateLazy ¶
type BooleanType ¶
type BooleanType struct {
// contains filtered or unexported fields
}
func BooleanTypeFromString ¶
func BooleanTypeFromString(s string) (BooleanType, error)
func (BooleanType) MarshalJSON ¶
func (t BooleanType) MarshalJSON() ([]byte, error)
func (BooleanType) String ¶
func (t BooleanType) String() string
func (*BooleanType) UnmarshalJSON ¶
func (t *BooleanType) UnmarshalJSON(data []byte) (err error)
func (*BooleanType) UnmarshalYAML ¶
func (t *BooleanType) UnmarshalYAML(value *yaml.Node) (err error)
type BooleanValue ¶
type BooleanValue struct { Type BooleanType `json:"type" yaml:"type"` True string `json:"true" yaml:"true"` False string `json:"false" yaml:"false"` }
type Connect ¶
type Connect struct { Type Type `json:"type" yaml:"type"` Argument string `json:"argument" yaml:"argument"` }
func (*Connect) GetArgument ¶
func (*Connect) GetSeperator ¶
func (*Connect) IsDisabled ¶
func (*Connect) IsMandatory ¶
func (*Connect) NormalizeState ¶
func (argument *Connect) NormalizeState()
func (*Connect) ValidateLazy ¶
type Enum ¶
type Enum struct { Base `yaml:",inline"` Value string `json:"value" yaml:"value"` Items []EnumItem `json:"items" yaml:"items"` }
func (*Enum) GetDefault ¶
func (*Enum) NormalizeState ¶
func (argument *Enum) NormalizeState()
func (*Enum) ValidateLazy ¶
type Float ¶
type Float struct { Base `yaml:",inline"` Default float32 `json:"default" yaml:"default"` Value float32 `json:"value" yaml:"value"` MinValue float32 `json:"minvalue" yaml:"minvalue"` MaxValue float32 `json:"maxvalue" yaml:"maxvalue"` }
func (*Float) GetDefault ¶
func (*Float) GetMaxValue ¶
func (*Float) GetMinValue ¶
func (*Float) NormalizeState ¶
func (argument *Float) NormalizeState()
func (*Float) ValidateLazy ¶
type Integer ¶
type Integer struct { Base `yaml:",inline"` Default int `json:"default" yaml:"default"` Value int `json:"value" yaml:"value"` MinValue int `json:"minvalue" yaml:"minvalue"` MaxValue int `json:"maxvalue" yaml:"maxvalue"` }
func (*Integer) GetDefault ¶
func (*Integer) GetMaxValue ¶
func (*Integer) GetMinValue ¶
func (*Integer) NormalizeState ¶
func (argument *Integer) NormalizeState()
func (*Integer) ValidateLazy ¶
type NumberValue ¶
type String ¶
type String struct { Base `yaml:",inline"` Default string `json:"default" yaml:"default"` Value string `json:"value" yaml:"value"` }
func (*String) GetDefault ¶
func (*String) NormalizeState ¶
func (argument *String) NormalizeState()
func (*String) ValidateLazy ¶
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
func TypeFromString ¶
func (Type) MarshalJSON ¶
func (*Type) UnmarshalJSON ¶
func (*Type) UnmarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.