Documentation ¶
Index ¶
- Constants
- Variables
- func EnrichedFuncMap(extraVars map[string]interface{}) template.FuncMap
- func NewGoTemplateExecutor(name string, expression string, extraFunctions template.FuncMap) (*goTemplateExecutor, error)
- func SetScriptFactory(newScriptFactory script.Factory)
- func ToJSONorStringBytes(responseObject interface{}) ([]byte, error)
- func ToString(responseObject interface{}, allowArray bool, allowObject bool, ...) string
- type DestinationPlugin
- type Expression
- type NodeExecutor
- type SourceExecutor
- type SourcePlugin
- type TemplateExecutor
Constants ¶
View Source
const TableNameParameter = "JITSU_TABLE_NAME"
View Source
const TransformDefaultTemplate = "return $"
Variables ¶
View Source
var JSONSerializeFuncs = template.FuncMap{ "json": func(v interface{}) (string, error) { return marshal(v, false, false) }, "json_indent": func(v interface{}) (string, error) { return marshal(v, true, false) }, "json_indent_quote": func(v interface{}) (string, error) { return marshal(v, true, true) }, "get": func(v interface{}, path string, defaultValue interface{}) (interface{}, error) { return get_impl(v, path, defaultValue) }, "TABLE_NAME": TableNameParameter, }
JSONSerializeFuncs are additional funcs for using from text/template. for example for embedding whole object as JSON into another JSON
Functions ¶
func EnrichedFuncMap ¶
func NewGoTemplateExecutor ¶
func SetScriptFactory ¶
func ToJSONorStringBytes ¶
Types ¶
type DestinationPlugin ¶
type DestinationPlugin struct { Package string ID string Type string Config map[string]interface{} // contains filtered or unexported fields }
func (*DestinationPlugin) String ¶
func (p *DestinationPlugin) String() string
type Expression ¶
type Expression string
func (Expression) String ¶
func (e Expression) String() string
type NodeExecutor ¶
func NewScriptExecutor ¶
func NewScriptExecutor(nodeScript nodeScript, variables map[string]interface{}, includes ...string) (*NodeExecutor, error)
func (*NodeExecutor) Expression ¶
func (e *NodeExecutor) Expression() string
func (*NodeExecutor) Format ¶
func (e *NodeExecutor) Format() string
func (*NodeExecutor) ProcessEvent ¶
func (*NodeExecutor) Validate ¶
func (e *NodeExecutor) Validate() error
type SourceExecutor ¶
type SourceExecutor struct { script.Interface *SourcePlugin }
func NewSourceExecutor ¶
func NewSourceExecutor(sourcePlugin *SourcePlugin) (*SourceExecutor, error)
func (*SourceExecutor) Catalog ¶
func (e *SourceExecutor) Catalog() (interface{}, error)
func (*SourceExecutor) Spec ¶
func (e *SourceExecutor) Spec() map[string]interface{}
func (*SourceExecutor) Stream ¶
func (e *SourceExecutor) Stream(streamName string, configuration interface{}, state interface{}, listener script.Listener) (interface{}, error)
func (*SourceExecutor) Validate ¶
func (e *SourceExecutor) Validate() error
type SourcePlugin ¶
type SourcePlugin struct { Package string ID string Type string Config map[string]interface{} // contains filtered or unexported fields }
func (*SourcePlugin) String ¶
func (s *SourcePlugin) String() string
type TemplateExecutor ¶
type TemplateExecutor interface { ProcessEvent(events.Event, script.Listener) (interface{}, error) Format() string Expression() string Close() }
func SmartParse ¶
func SmartParse(name string, expression string, extraFunctions template.FuncMap) (TemplateExecutor, error)
SmartParse is a factory method that returns TemplateExecutor implementation based on provided expression language
Click to show internal directories.
Click to hide internal directories.