Documentation ¶
Index ¶
- Constants
- Variables
- func Exec(dir string, path string, args ...string) error
- type Args
- type Dummy
- func (d *Dummy) Close() error
- func (d *Dummy) DeleteTransformValue(namespace, entityId, key string) error
- func (d *Dummy) GetTransformValue(namespace string, entityId string, key string) (*string, error)
- func (d *Dummy) SetTransformValue(namespace, entityId, key, value string, ttlSec *int64) error
- func (d *Dummy) Type() string
- type Executable
- type Expression
- type Factory
- type File
- type Interface
- type Listener
- type Package
- type Redis
- func (r *Redis) Close() error
- func (r *Redis) DeleteTransformValue(namespace, entityId, key string) error
- func (r *Redis) GetTransformValue(namespace string, entityId string, key string) (*string, error)
- func (r *Redis) SetTransformValue(namespace, entityId, key, value string, ttlMs *int64) error
- func (r *Redis) Type() string
- type Storage
- type Symbol
- type Symbols
Constants ¶
const ( DestinationNamespace = "destination" DummyStorageType = "dummy" RedisStorageType = "redis" )
Variables ¶
var DummyFactory = dummyFactory{}
Functions ¶
Types ¶
type Dummy ¶
type Dummy struct{}
func (*Dummy) DeleteTransformValue ¶
func (*Dummy) GetTransformValue ¶
func (*Dummy) SetTransformValue ¶
type Executable ¶
type Executable interface {
// contains filtered or unexported methods
}
Executable is an entity which can be loaded as Interface. This is an algebraic type with no logic of its own. Factory implementations are responsible for implementing processing logic for relevant Executables.
type Expression ¶
type Expression string
Expression is a piece of code with no external requirements, generally representing a function body. Implements Executable interface.
type Factory ¶
type Factory interface { // CreateScript loads an Executable and returns an Interface instance for using it. // `variables` are the global variables to be made available for Executable. // `includes` are code snippets to embed into script. CreateScript(executable Executable, variables map[string]interface{}, standalone bool, includes ...string) (Interface, error) }
Factory loads an Executable.
type File ¶
type File string
File is the executable script path. This exists mainly for tests to emulate the Package, but without the hassle of providing a valid package. Implements Executable interface.
type Interface ¶
type Interface interface { // Describe returns exported Symbols. Describe() (Symbols, error) // Execute executes a function with the provided `name` and `args` and collects the execution result into `result`. // Execution result maybe multiline stream that will be written into provided Listener. Execute(name string, args Args, result interface{}, listener Listener) error // Close disposes of the instance and releases associated resources. Close() }
Interface defines the loaded Executable.
type Listener ¶
type Listener interface { // Data is executed on each line of resulting multiline stream. Data(data []byte) // Log is executed for each log record generated during execution. Log(level, message string) // Timeout to use for execution. Timeout() time.Duration }
Listener interface is used to collect execution "side-effects".
type Package ¶
type Package string
Package is an external package which should be obtained before loading. Package format specification depends on the Factory implementation. Implements Executable interface.
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
func (*Redis) DeleteTransformValue ¶
func (*Redis) GetTransformValue ¶
func (*Redis) SetTransformValue ¶
type Storage ¶
type Storage interface { io.Closer //** Transformation Key Value ** GetTransformValue(namespace string, entityId string, key string) (*string, error) SetTransformValue(namespace, entityId, key, value string, ttlMs *int64) error DeleteTransformValue(namespace, entityId, key string) error Type() string }
type Symbol ¶
type Symbol struct { // Type is the symbol type and corresponds to JavaScript's `typeof`. Type string `json:"type"` // Value is the symbol value. // It is nil when the symbol is a function. Value json.RawMessage `json:"value,omitempty"` }
Symbol represents a JavaScript value.