Documentation ¶
Index ¶
- func ConvertToFloatModifier(i interface{}) (interface{}, error)
- func ConvertToIntModifier(i interface{}) (interface{}, error)
- func FirstModifier(i interface{}) (interface{}, error)
- func LengthModifier(i interface{}) (interface{}, error)
- func NilModifier(i interface{}) (interface{}, error)
- func NullModifier(i interface{}) (interface{}, error)
- func QuoteModifier(i interface{}) (interface{}, error)
- func QuoteString(input string) string
- func StringToLowerModifier(i interface{}) (interface{}, error)
- func StringToUpperModifier(i interface{}) (interface{}, error)
- type ModifierOptions
- type ValueModifier
- func ConstructModifier(options ModifierOptions) ValueModifier
- func MakeFirstModifier(vmod ValueModifier) ValueModifier
- func MakeLengthModifier(vmod ValueModifier) ValueModifier
- func MakeQuoteModifier(vmod ValueModifier) ValueModifier
- func MakeRegExModifier(pattern string, vmod ValueModifier) ValueModifier
- func MakeStringToLowerModifier(vmod ValueModifier) ValueModifier
- func MakeStringToUpperModifier(vmod ValueModifier) ValueModifier
- func MakeToFloatModifier(vmod ValueModifier) ValueModifier
- func MakeToIntModifier(vmod ValueModifier) ValueModifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToFloatModifier ¶
func ConvertToFloatModifier(i interface{}) (interface{}, error)
ConvertToFloatModifier -- convert a scaler to a floating value
func ConvertToIntModifier ¶
func ConvertToIntModifier(i interface{}) (interface{}, error)
ConvertToIntModifier -- A value modifier to make a string or a float64 an integer (float64's will round down) Note: XML floats are strings, need to be converted to float then an int
func FirstModifier ¶ added in v1.3.0
func FirstModifier(i interface{}) (interface{}, error)
FirstModifier -- get the first element from an array
func LengthModifier ¶
func LengthModifier(i interface{}) (interface{}, error)
LengthModifier -- Convert the interface value to a length if valid or return error
func NilModifier ¶
func NilModifier(i interface{}) (interface{}, error)
NilModifier -- converts a nil to a string
func NullModifier ¶
func NullModifier(i interface{}) (interface{}, error)
NullModifier -- performs a NOP
func QuoteModifier ¶
func QuoteModifier(i interface{}) (interface{}, error)
QuoteModifier -- quote a string
func QuoteString ¶
QuoteString -- Quote a string handling '\"' as well
func StringToLowerModifier ¶
func StringToLowerModifier(i interface{}) (interface{}, error)
func StringToUpperModifier ¶
func StringToUpperModifier(i interface{}) (interface{}, error)
Types ¶
type ModifierOptions ¶
type ModifierOptions struct {
// contains filtered or unexported fields
}
ModifierOptions -- Common options for modifiers
func AddModifierOptions ¶
func AddModifierOptions(set shell.CmdSet) ModifierOptions
AddModifierOptions -- Add options for modifiers
type ValueModifier ¶
type ValueModifier func(i interface{}) (interface{}, error)
ValueModifier -- a function for modifying a value in a chain
func ConstructModifier ¶
func ConstructModifier(options ModifierOptions) ValueModifier
ConstructModifier -- Build a modifier chain based on common options
func MakeFirstModifier ¶ added in v1.3.0
func MakeFirstModifier(vmod ValueModifier) ValueModifier
func MakeLengthModifier ¶
func MakeLengthModifier(vmod ValueModifier) ValueModifier
func MakeQuoteModifier ¶
func MakeQuoteModifier(vmod ValueModifier) ValueModifier
MakeQuoteModifier -- create a modifier for quoting a string
func MakeRegExModifier ¶
func MakeRegExModifier(pattern string, vmod ValueModifier) ValueModifier
func MakeStringToLowerModifier ¶
func MakeStringToLowerModifier(vmod ValueModifier) ValueModifier
func MakeStringToUpperModifier ¶
func MakeStringToUpperModifier(vmod ValueModifier) ValueModifier
func MakeToFloatModifier ¶
func MakeToFloatModifier(vmod ValueModifier) ValueModifier
func MakeToIntModifier ¶
func MakeToIntModifier(vmod ValueModifier) ValueModifier