Documentation
¶
Index ¶
- func CallFunction(runtime *goja.Runtime, functionName string, arguments []interface{}) (interface{}, error)
- func CleanupScriptlet(scriptlet string) string
- func GetMetadata(clout *cloutpkg.Clout) (ard.StringMap, error)
- func GetMetadataSection(name string, clout *cloutpkg.Clout) (ard.Value, error)
- func GetScriptlet(name string, clout *cloutpkg.Clout) (string, error)
- func GetScriptletNames(baseName string, clout *cloutpkg.Clout) ([]string, error)
- func SetScriptlet(name string, scriptlet string, clout *cloutpkg.Clout) error
- func ToJavaScriptStyle(name string) string
- func UnwrapException(err error) error
- type CloutAPI
- func (self *CloutAPI) Call(scriptletName string, functionName string, arguments []interface{}) (interface{}, error)
- func (self *CloutAPI) Coerce(value interface{}) (interface{}, error)
- func (self *CloutAPI) Define(scriptletName string, scriptlet string) error
- func (self *CloutAPI) Exec(scriptletName string) error
- func (self *CloutAPI) ExecAll(scriptletBaseName string) error
- func (self *CloutAPI) MarshalJSON() ([]byte, error)
- func (self *CloutAPI) MarshalYAML() (interface{}, error)
- func (self *CloutAPI) NewCoercible(value goja.Value, site interface{}, source interface{}, target interface{}) (Coercible, error)
- func (self *CloutAPI) NewConstraints(value goja.Value, site interface{}, source interface{}, target interface{}) (Constraints, error)
- func (self *CloutAPI) NewKey() string
- func (self *CloutAPI) Unwrap(value interface{}) interface{}
- type CloutContext
- func (self *CloutContext) CallFunction(scriptletName string, functionName string, arguments []interface{}, ...) (interface{}, error)
- func (self *CloutContext) Exec(scriptletName string) error
- func (self *CloutContext) ExecAll(scriptletBaseName string) error
- func (self *CloutContext) NewCoercible(data ard.Value, functionCallContext FunctionCallContext) (Coercible, error)
- func (self *CloutContext) NewConstraints(list ard.List, functionCallContext FunctionCallContext) (Constraints, error)
- func (self *CloutContext) NewConstraintsFromNotation(notation ard.StringMap, name string, functionCallContext FunctionCallContext) (Constraints, error)
- func (self *CloutContext) NewFunctionCall(map_ ard.StringMap, notation ard.StringMap, ...) (*FunctionCall, error)
- func (self *CloutContext) NewList(list ard.List, entryConstraints Constraints, ...) (List, error)
- func (self *CloutContext) NewMap(list ard.List, keyConstraints Constraints, valueConstraints Constraints, ...) (Map, error)
- func (self *CloutContext) NewMapEntry(data interface{}, keyConstraints Constraints, valueConstraints Constraints, ...) (MapEntry, error)
- func (self *CloutContext) NewRuntime(apis map[string]interface{}) *goja.Runtime
- func (self *CloutContext) NewValue(data ard.Value, notation ard.StringMap, ...) (*Value, error)
- func (self *CloutContext) NewValueForList(list ard.List, notation ard.StringMap, functionCallContext FunctionCallContext) (*Value, error)
- func (self *CloutContext) NewValueForMap(list ard.List, notation ard.StringMap, functionCallContext FunctionCallContext) (*Value, error)
- type Coercible
- type Constraints
- type Context
- func (self *Context) Exec(clout *cloutpkg.Clout, scriptletName string, apis map[string]interface{}) error
- func (self *Context) Fail(message string)
- func (self *Context) FailOnError(err error)
- func (self *Context) Failf(format string, args ...interface{})
- func (self *Context) GetProgram(name string, scriptlet string) (*goja.Program, error)
- func (self *Context) NewCloutAPI(clout *cloutpkg.Clout, runtime *goja.Runtime) *CloutAPI
- func (self *Context) NewCloutContext(clout *cloutpkg.Clout, runtime *goja.Runtime) *CloutContext
- func (self *Context) NewCloutRuntime(clout *cloutpkg.Clout, apis map[string]interface{}) *goja.Runtime
- func (self *Context) NewPucciniAPI() *PucciniAPI
- type Error
- type FunctionCall
- func (self *FunctionCall) Coerce() (ard.Value, error)
- func (self *FunctionCall) CoerceArguments() ([]ard.Value, error)
- func (self *FunctionCall) NewError(arguments []interface{}, message string, cause error) *Error
- func (self *FunctionCall) NewErrorf(arguments []interface{}, format string, arg ...interface{}) *Error
- func (self *FunctionCall) SetConstraints(constraints Constraints)
- func (self *FunctionCall) Signature(arguments []ard.Value) string
- func (self *FunctionCall) Unwrap() ard.Value
- func (self *FunctionCall) Validate(value ard.Value, errorWhenInvalid bool) (bool, error)
- func (self *FunctionCall) WrapError(arguments []interface{}, err error) *Error
- type FunctionCallContext
- type List
- type Log
- type Map
- type MapEntry
- type Mapper
- type PucciniAPI
- func (self *PucciniAPI) Atob(from string) ([]byte, error)
- func (self *PucciniAPI) Btoa(from []byte) (string, error)
- func (self *PucciniAPI) DeepCopy(value ard.Value) ard.Value
- func (self *PucciniAPI) Download(sourceUrl string, targetPath string) error
- func (self *PucciniAPI) Exec(name string, arguments ...string) (string, error)
- func (self *PucciniAPI) Fail(message string)
- func (self *PucciniAPI) Failf(format string, args ...interface{})
- func (entry *PucciniAPI) IsType(value ard.Value, type_ string) (bool, error)
- func (entry *PucciniAPI) JoinFilePath(elements ...string) string
- func (self *PucciniAPI) LoadString(url string) (string, error)
- func (self *PucciniAPI) NewXMLDocument() *etree.Document
- func (entry *PucciniAPI) Sprintf(format string, args ...interface{}) string
- func (self *PucciniAPI) Timestamp() ard.Value
- func (entry *PucciniAPI) ValidateFormat(code string, format string) error
- func (self *PucciniAPI) Write(data interface{}, path string, dontOverwrite bool)
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallFunction ¶
func CleanupScriptlet ¶
func GetMetadataSection ¶
func GetScriptletNames ¶ added in v0.14.0
func ToJavaScriptStyle ¶
func UnwrapException ¶
Types ¶
type CloutAPI ¶
func (*CloutAPI) MarshalJSON ¶
json.Marshaler interface
func (*CloutAPI) MarshalYAML ¶
yaml.Marshaler interface
func (*CloutAPI) NewCoercible ¶
func (*CloutAPI) NewConstraints ¶
func (self *CloutAPI) NewConstraints(value goja.Value, site interface{}, source interface{}, target interface{}) (Constraints, error)
type CloutContext ¶
func (*CloutContext) CallFunction ¶
func (self *CloutContext) CallFunction(scriptletName string, functionName string, arguments []interface{}, functionCallContext FunctionCallContext) (interface{}, error)
func (*CloutContext) Exec ¶
func (self *CloutContext) Exec(scriptletName string) error
func (*CloutContext) ExecAll ¶ added in v0.14.0
func (self *CloutContext) ExecAll(scriptletBaseName string) error
func (*CloutContext) NewCoercible ¶
func (self *CloutContext) NewCoercible(data ard.Value, functionCallContext FunctionCallContext) (Coercible, error)
func (*CloutContext) NewConstraints ¶
func (self *CloutContext) NewConstraints(list ard.List, functionCallContext FunctionCallContext) (Constraints, error)
func (*CloutContext) NewConstraintsFromNotation ¶
func (self *CloutContext) NewConstraintsFromNotation(notation ard.StringMap, name string, functionCallContext FunctionCallContext) (Constraints, error)
func (*CloutContext) NewFunctionCall ¶
func (self *CloutContext) NewFunctionCall(map_ ard.StringMap, notation ard.StringMap, functionCallContext FunctionCallContext) (*FunctionCall, error)
func (*CloutContext) NewList ¶
func (self *CloutContext) NewList(list ard.List, entryConstraints Constraints, functionCallContext FunctionCallContext) (List, error)
func (*CloutContext) NewMap ¶
func (self *CloutContext) NewMap(list ard.List, keyConstraints Constraints, valueConstraints Constraints, functionCallContext FunctionCallContext) (Map, error)
func (*CloutContext) NewMapEntry ¶
func (self *CloutContext) NewMapEntry(data interface{}, keyConstraints Constraints, valueConstraints Constraints, functionCallContext FunctionCallContext) (MapEntry, error)
func (*CloutContext) NewRuntime ¶
func (self *CloutContext) NewRuntime(apis map[string]interface{}) *goja.Runtime
func (*CloutContext) NewValue ¶
func (self *CloutContext) NewValue(data ard.Value, notation ard.StringMap, functionCallContext FunctionCallContext) (*Value, error)
func (*CloutContext) NewValueForList ¶
func (self *CloutContext) NewValueForList(list ard.List, notation ard.StringMap, functionCallContext FunctionCallContext) (*Value, error)
func (*CloutContext) NewValueForMap ¶
func (self *CloutContext) NewValueForMap(list ard.List, notation ard.StringMap, functionCallContext FunctionCallContext) (*Value, error)
type Constraints ¶
type Constraints []*FunctionCall
func (Constraints) Apply ¶
func (self Constraints) Apply(value interface{}) (interface{}, error)
func (Constraints) Validate ¶
func (self Constraints) Validate(value interface{}) (bool, error)
type Context ¶
type Context struct { Quiet bool Format string Strict bool AllowTimestamps bool Pretty bool Output string Log *Log Stdout io.Writer Stderr io.Writer Stdin io.Writer // contains filtered or unexported fields }
func NewContext ¶
func (*Context) FailOnError ¶
func (*Context) GetProgram ¶
func (*Context) NewCloutAPI ¶
func (*Context) NewCloutContext ¶
func (*Context) NewCloutRuntime ¶
func (*Context) NewPucciniAPI ¶
func (self *Context) NewPucciniAPI() *PucciniAPI
type Error ¶
type Error struct { FunctionCall *FunctionCall Arguments []interface{} Message string Cause error }
type FunctionCall ¶
type FunctionCall struct { CloutContext *CloutContext `json:"-" yaml:"-"` FunctionCallContext FunctionCallContext `json:"-" yaml:"-"` Notation ard.StringMap `json:"-" yaml:"-"` Name string `json:"name" yaml:"name"` Arguments []Coercible `json:"arguments" yaml:"arguments"` Path string `json:"path,omitempty" yaml:"path,omitempty"` URL string `json:"url,omitempty" yaml:"url,omitempty"` Row int `json:"row" yaml:"row"` Column int `json:"column" yaml:"column"` Constraints Constraints `json:"constraints,omitempty" yaml:"constraints,omitempty"` }
func (*FunctionCall) Coerce ¶
func (self *FunctionCall) Coerce() (ard.Value, error)
Coercible interface
func (*FunctionCall) CoerceArguments ¶
func (self *FunctionCall) CoerceArguments() ([]ard.Value, error)
func (*FunctionCall) NewError ¶
func (self *FunctionCall) NewError(arguments []interface{}, message string, cause error) *Error
func (*FunctionCall) NewErrorf ¶
func (self *FunctionCall) NewErrorf(arguments []interface{}, format string, arg ...interface{}) *Error
func (*FunctionCall) SetConstraints ¶
func (self *FunctionCall) SetConstraints(constraints Constraints)
Coercible interface
func (*FunctionCall) WrapError ¶
func (self *FunctionCall) WrapError(arguments []interface{}, err error) *Error
type FunctionCallContext ¶
type FunctionCallContext struct { Site interface{} Source interface{} Target interface{} }
func (FunctionCallContext) API ¶
func (self FunctionCallContext) API() map[string]interface{}
type MapEntry ¶
type PucciniAPI ¶
type PucciniAPI struct { Log *Log Stdout io.Writer Stderr io.Writer Stdin io.Writer Output string Format string Strict bool AllowTimestamps bool Pretty bool // contains filtered or unexported fields }
func (*PucciniAPI) Atob ¶ added in v0.14.0
func (self *PucciniAPI) Atob(from string) ([]byte, error)
func (*PucciniAPI) Btoa ¶ added in v0.14.0
func (self *PucciniAPI) Btoa(from []byte) (string, error)
func (*PucciniAPI) DeepCopy ¶ added in v0.14.0
func (self *PucciniAPI) DeepCopy(value ard.Value) ard.Value
func (*PucciniAPI) Download ¶
func (self *PucciniAPI) Download(sourceUrl string, targetPath string) error
func (*PucciniAPI) Exec ¶
func (self *PucciniAPI) Exec(name string, arguments ...string) (string, error)
func (*PucciniAPI) Fail ¶ added in v0.11.0
func (self *PucciniAPI) Fail(message string)
func (*PucciniAPI) Failf ¶ added in v0.11.0
func (self *PucciniAPI) Failf(format string, args ...interface{})
func (*PucciniAPI) JoinFilePath ¶
func (entry *PucciniAPI) JoinFilePath(elements ...string) string
func (*PucciniAPI) LoadString ¶ added in v0.14.0
func (self *PucciniAPI) LoadString(url string) (string, error)
func (*PucciniAPI) NewXMLDocument ¶
func (self *PucciniAPI) NewXMLDocument() *etree.Document
func (*PucciniAPI) Sprintf ¶
func (entry *PucciniAPI) Sprintf(format string, args ...interface{}) string
func (*PucciniAPI) Timestamp ¶
func (self *PucciniAPI) Timestamp() ard.Value
func (*PucciniAPI) ValidateFormat ¶
func (entry *PucciniAPI) ValidateFormat(code string, format string) error
func (*PucciniAPI) Write ¶
func (self *PucciniAPI) Write(data interface{}, path string, dontOverwrite bool)
type Value ¶
type Value struct { Notation ard.StringMap `json:"-" yaml:"-"` Data interface{} `json:"data" yaml:"data"` // List, Map, or ard.Value Constraints Constraints `json:"constraints,omitempty" yaml:"constraints,omitempty"` }
func (*Value) SetConstraints ¶
func (self *Value) SetConstraints(constraints Constraints)
Coercible interface
Click to show internal directories.
Click to hide internal directories.