Documentation
¶
Index ¶
- func EvaluateExpression[T any](expression string, context any) (T, error)
- func EvaluateUnaryExpression(expression string, context any) (bool, error)
- func GetNodeField[T any](request NodeRequest, path string) (T, error)
- func GetNodeFieldRaw[T any](request NodeRequest, path string) (T, error)
- func RenderTemplate[T any](template string, context any) (T, error)
- type CustomNode
- type CustomNodeHandler
- type Decision
- type Engine
- type EngineConfig
- type EngineLoader
- type EvaluateBatchRequest
- type EvaluateBatchResult
- type EvaluationOptions
- type EvaluationResponse
- type FilesystemLoader
- type Loader
- type LoaderConfig
- type NodeRequest
- type NodeResponse
- type StaticLoader
- type ZipLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateUnaryExpression ¶
func GetNodeField ¶
func GetNodeField[T any](request NodeRequest, path string) (T, error)
func GetNodeFieldRaw ¶
func GetNodeFieldRaw[T any](request NodeRequest, path string) (T, error)
Types ¶
type CustomNode ¶
type CustomNode struct {
ID string `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"`
Config json.RawMessage `json:"config"`
}
type CustomNodeHandler ¶
type CustomNodeHandler func(request NodeRequest) (NodeResponse, error)
type Decision ¶
type Decision interface {
Evaluate(context any) (*EvaluationResponse, error)
EvaluateWithOpts(context any, options EvaluationOptions) (*EvaluationResponse, error)
Dispose()
}
type Engine ¶
type Engine interface {
Evaluate(key string, context any) (*EvaluationResponse, error)
EvaluateWithOpts(key string, context any, options EvaluationOptions) (*EvaluationResponse, error)
EvaluateBatch(requests []EvaluateBatchRequest) ([]EvaluateBatchResult, error)
EvaluateBatchWithOpts(requests []EvaluateBatchRequest, options EvaluationOptions) ([]EvaluateBatchResult, error)
GetDecision(key string) (Decision, error)
CreateDecision(data []byte) (Decision, error)
Dispose()
}
func NewEngine ¶
func NewEngine(config EngineConfig) Engine
type EngineConfig ¶
type EngineConfig struct {
Loader EngineLoader
CustomNodeHandler CustomNodeHandler
}
type EngineLoader ¶
type EngineLoader interface {
// contains filtered or unexported methods
}
type EvaluateBatchRequest ¶
type EvaluateBatchResult ¶
type EvaluateBatchResult struct {
Success bool `json:"success"`
Data *EvaluationResponse `json:"data,omitempty"`
Error json.RawMessage `json:"error,omitempty"`
}
type EvaluationOptions ¶
type EvaluationResponse ¶
type EvaluationResponse struct {
Performance string `json:"performance"`
Result json.RawMessage `json:"result"`
Trace *json.RawMessage `json:"trace"`
}
type FilesystemLoader ¶
type FilesystemLoader struct {
Path string
}
type LoaderConfig ¶
type LoaderConfig interface {
EngineLoader
// contains filtered or unexported methods
}
type NodeRequest ¶
type NodeRequest struct {
Node CustomNode `json:"node"`
Input json.RawMessage `json:"input"`
}
type NodeResponse ¶
type StaticLoader ¶
type StaticLoader struct {
Content map[string]json.RawMessage
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
deps
|
|
|
darwin_amd64
Package darwin_amd64 is required to provide support for vendoring modules DO NOT REMOVE
|
Package darwin_amd64 is required to provide support for vendoring modules DO NOT REMOVE |
|
darwin_arm64
Package darwin_arm64 is required to provide support for vendoring modules DO NOT REMOVE
|
Package darwin_arm64 is required to provide support for vendoring modules DO NOT REMOVE |
|
linux_amd64
Package linux_amd64 is required to provide support for vendoring modules DO NOT REMOVE
|
Package linux_amd64 is required to provide support for vendoring modules DO NOT REMOVE |
|
linux_arm64
Package linux_arm64 is required to provide support for vendoring modules DO NOT REMOVE
|
Package linux_arm64 is required to provide support for vendoring modules DO NOT REMOVE |
|
windows_amd64
Package windows_amd64 is required to provide support for vendoring modules DO NOT REMOVE
|
Package windows_amd64 is required to provide support for vendoring modules DO NOT REMOVE |
|
examples
|
|
|
custom-node
command
|
|
Click to show internal directories.
Click to hide internal directories.