Documentation ¶
Index ¶
- Constants
- func GetTokens(text string) []string
- func ParseTools(text string, registered map[string]FnVarTool) map[string]FnVarTool
- func SplitToken(token string) []string
- func Transform(text string, transform string) string
- type FnVarTool
- type FnVarToolCtx
- type FnVarToolDate
- type FnVarToolRnd
- type FnVarToolUser
- type FnVarsEngine
- func (instance *FnVarsEngine) GetByName(toolName string) FnVarTool
- func (instance *FnVarsEngine) Register(tool FnVarTool)
- func (instance *FnVarsEngine) Solve(input interface{}, context ...interface{}) (interface{}, error)
- func (instance *FnVarsEngine) SolveArray(a []string, context ...interface{}) ([]string, error)
- func (instance *FnVarsEngine) SolveMap(m map[string]string, context ...interface{}) (map[string]string, error)
- func (instance *FnVarsEngine) SolveText(text string, context ...interface{}) (string, error)
- type FnVarsHelper
Constants ¶
View Source
const (
ToolCtx = "ctx"
)
View Source
const ToolDate = "date"
View Source
const (
ToolRnd = "rnd"
)
View Source
const ToolUser = "user"
Variables ¶
This section is empty.
Functions ¶
func ParseTools ¶
ParseTools a text and extract a map of all tools supported
func SplitToken ¶
Types ¶
type FnVarTool ¶
type FnVarToolCtx ¶
type FnVarToolCtx struct{}
FnVarToolCtx ctx|var1|4, ctx|var2
func (*FnVarToolCtx) Name ¶
func (instance *FnVarToolCtx) Name() string
func (*FnVarToolCtx) Solve ¶
func (instance *FnVarToolCtx) Solve(token string, context ...interface{}) (interface{}, error)
type FnVarToolDate ¶
type FnVarToolDate struct{}
FnVarToolDate date|yyyy-MM-dd|upper
func (*FnVarToolDate) Name ¶
func (instance *FnVarToolDate) Name() string
func (*FnVarToolDate) Solve ¶
func (instance *FnVarToolDate) Solve(token string, context ...interface{}) (interface{}, error)
type FnVarToolRnd ¶
type FnVarToolRnd struct{}
FnVarToolRnd rnd|chars|4|upper
func (*FnVarToolRnd) Name ¶
func (instance *FnVarToolRnd) Name() string
func (*FnVarToolRnd) Solve ¶
func (instance *FnVarToolRnd) Solve(token string, context ...interface{}) (interface{}, error)
type FnVarToolUser ¶
type FnVarToolUser struct {
// contains filtered or unexported fields
}
FnVarToolUser person|name,mobile,mail|3
func (*FnVarToolUser) GetDataRoot ¶
func (instance *FnVarToolUser) GetDataRoot() string
func (*FnVarToolUser) Name ¶
func (instance *FnVarToolUser) Name() string
func (*FnVarToolUser) SetDataRoot ¶
func (instance *FnVarToolUser) SetDataRoot(value string)
func (*FnVarToolUser) Solve ¶
func (instance *FnVarToolUser) Solve(token string, context ...interface{}) (interface{}, error)
type FnVarsEngine ¶
type FnVarsEngine struct {
// contains filtered or unexported fields
}
func (*FnVarsEngine) GetByName ¶
func (instance *FnVarsEngine) GetByName(toolName string) FnVarTool
func (*FnVarsEngine) Register ¶
func (instance *FnVarsEngine) Register(tool FnVarTool)
func (*FnVarsEngine) Solve ¶
func (instance *FnVarsEngine) Solve(input interface{}, context ...interface{}) (interface{}, error)
func (*FnVarsEngine) SolveArray ¶
func (instance *FnVarsEngine) SolveArray(a []string, context ...interface{}) ([]string, error)
type FnVarsHelper ¶
type FnVarsHelper struct { }
var FnVars *FnVarsHelper
func (*FnVarsHelper) NewEngine ¶
func (instance *FnVarsHelper) NewEngine() *FnVarsEngine
Click to show internal directories.
Click to hide internal directories.