Documentation
¶
Index ¶
- Constants
- Variables
- func Evaluate(parseCtx *ParseContext, context context.Context, userContext interface{}, ...) (interface{}, error)
- func ParseFile(ctx *ParseContext, p parsley.Parser, path string) (parsley.Node, error)
- func ParseFiles(ctx *ParseContext, p parsley.Parser, ...) error
- func ParseText(ctx *ParseContext, p parsley.Parser, input string) (parsley.Node, error)
- func RetryableError(err error, duration time.Duration) error
- type Block
- type BlockCloser
- type BlockContainer
- type BlockContext
- type BlockDirective
- type BlockInitialiser
- type BlockInterpreter
- type BlockNode
- type BlockNodeRegistry
- type BlockProvider
- type BlockPublisher
- type BlockRunner
- type BlockTransformerRegistryAware
- type Container
- type Contexter
- type Dependencies
- type DirectiveTransformerRegistryAware
- type EvalContext
- func (e *EvalContext) BlockContainer(id ID) (BlockContainer, bool)
- func (e *EvalContext) Cancel() bool
- func (e *EvalContext) Deadline() (deadline time.Time, ok bool)
- func (e *EvalContext) Done() <-chan struct{}
- func (e *EvalContext) Err() error
- func (e *EvalContext) HasSubscribers(id ID) bool
- func (e *EvalContext) JobScheduler() JobScheduler
- func (e *EvalContext) New(ctx context.Context, cancel context.CancelFunc, ...) *EvalContext
- func (e *EvalContext) Publish(c Container)
- func (e *EvalContext) Run() bool
- func (e *EvalContext) SetStdout(stdout io.Writer)
- func (e *EvalContext) Subscribe(container *NodeContainer, id ID)
- func (e *EvalContext) Unsubscribe(container *NodeContainer, id ID)
- func (e *EvalContext) Value(key interface{}) interface{}
- type EvalStage
- type FunctionInterpreter
- type FunctionNode
- type FunctionTransformerRegistryAware
- type ID
- type IDNode
- func (i *IDNode) Classifier() rune
- func (i *IDNode) ID() ID
- func (i *IDNode) Pos() parsley.Pos
- func (i *IDNode) ReaderPos() parsley.Pos
- func (i *IDNode) Schema() interface{}
- func (i *IDNode) SetReaderPos(f func(parsley.Pos) parsley.Pos)
- func (i *IDNode) String() string
- func (i *IDNode) Token() string
- func (i *IDNode) Value() interface{}
- type IDRegistry
- type Identifiable
- type Job
- type JobContainer
- type JobScheduler
- type LogArray
- type LogArrayMarshaler
- type LogEvent
- type LogObjectMarshaler
- type Logger
- type LoggerContext
- type Loggerer
- type NameNode
- func (t *NameNode) NameNode() *IDNode
- func (t *NameNode) Pos() parsley.Pos
- func (t *NameNode) ReaderPos() parsley.Pos
- func (t *NameNode) Schema() interface{}
- func (t *NameNode) SelectorNode() *IDNode
- func (t *NameNode) SetReaderPos(f func(parsley.Pos) parsley.Pos)
- func (t *NameNode) String() string
- func (t *NameNode) Token() string
- func (t *NameNode) Value() interface{}
- type NilContainer
- type Node
- type NodeContainer
- type ParameterConfig
- type ParameterConfigOption
- type ParameterContainer
- type ParameterDirective
- type ParameterNode
- type ParseContext
- func (p *ParseContext) AddBlockNode(node BlockNode) error
- func (p *ParseContext) BlockNode(id ID) (BlockNode, bool)
- func (p *ParseContext) BlockTransformerRegistry() parsley.NodeTransformerRegistry
- func (p *ParseContext) DirectiveTransformerRegistry() parsley.NodeTransformerRegistry
- func (p *ParseContext) FileSet() *parsley.FileSet
- func (p *ParseContext) FunctionTransformerRegistry() parsley.NodeTransformerRegistry
- func (p *ParseContext) GenerateID() ID
- func (p *ParseContext) IDExists(id ID) bool
- func (p *ParseContext) New(config ParseContextOverride) *ParseContext
- func (p *ParseContext) NewForModule() *ParseContext
- func (p *ParseContext) RegisterID(id ID) error
- type ParseContextOverride
- type ParseContextOverrider
- type PubSub
- type Result
- type Retry
- type RetryConfig
- type Retryable
- type RuntimeConfig
- type RuntimeConfigOption
- type UserContexter
- type VariableNode
- type WaitGroup
Constants ¶
const ( BlockTypeConfiguration = "configuration" BlockTypeDirective = "directive" BlockTypeGenerator = "generator" BlockTypeMain = "main" BlockTypeTask = "task" )
const ( ClassifierNone = rune(0) ClassifierAnnotation = '@' )
const FunctionNameRegExpPattern = schema.NameRegExpPattern + "(?:\\." + schema.NameRegExpPattern + ")?"
FunctionNameRegExpPattern defines a valid function name
const LogTimeFormat = "2006-01-02T15:04:05.000Z07:00"
Variables ¶
var EvalStages = map[string]EvalStage{ "parse": EvalStageParse, "resolve": EvalStageResolve, "init": EvalStageInit, "main": EvalStageMain, "close": EvalStageClose, "ignore": EvalStageIgnore, }
EvalStages returns with the evaluation stages
var Keywords = []string{
"map",
}
Keywords are reserved strings and may not be used as identifiers.
var Version = "v0.0.0"
Functions ¶
func Evaluate ¶
func Evaluate( parseCtx *ParseContext, context context.Context, userContext interface{}, logger Logger, scheduler JobScheduler, id ID, inputParams map[ID]interface{}, ) (interface{}, error)
Evaluate will evaluate the given node which was previously parsed with the passed parse context
func ParseFiles ¶
func ParseFiles( ctx *ParseContext, p parsley.Parser, nodeBuilder func(nodes []parsley.Node) parsley.Node, paths []string, ) error
ParseFiles parses multiple files as one The result node will be created using the nodeBuilder function The transformation and the static checking will run on the built node
Types ¶
type BlockCloser ¶
BlockCloser defines a Close function which runs after the main evaluation stage
type BlockContainer ¶
type BlockContainer interface {
Container
Param(ID) interface{}
SetChild(Container)
SetError(parsley.Error)
EvalStage() EvalStage
}
BlockContainer is a simple wrapper around a block object
type BlockContext ¶
type BlockContext struct {
// contains filtered or unexported fields
}
func NewBlockContext ¶
func NewBlockContext( evalContext *EvalContext, blockPublisher BlockPublisher, ) *BlockContext
NewBlockContext creates a new block context
func (*BlockContext) BlockPublisher ¶
func (b *BlockContext) BlockPublisher() BlockPublisher
func (*BlockContext) JobScheduler ¶
func (b *BlockContext) JobScheduler() JobScheduler
func (*BlockContext) Logger ¶
func (b *BlockContext) Logger() Logger
func (*BlockContext) Stdout ¶
func (b *BlockContext) Stdout() io.Writer
func (*BlockContext) UserContext ¶
func (b *BlockContext) UserContext() interface{}
type BlockDirective ¶
type BlockDirective interface {
Block
RuntimeConfigOption
}
BlockDirective provides a way to add metadata or define alternate runtime execution for blocks
type BlockInitialiser ¶
BlockInitialiser defines an Init() function which runs before the main evaluation stage If the skipped return value is true then the block won't be evaluated
type BlockInterpreter ¶
type BlockInterpreter interface {
Schema() schema.Schema
CreateBlock(ID, *BlockContext) Block
SetParam(b Block, name ID, value interface{}) error
SetBlock(b Block, name ID, key string, value interface{}) error
Param(b Block, name ID) interface{}
ValueParamName() ID
ParseContext(*ParseContext) *ParseContext
}
BlockInterpreter defines an interpreter for blocks
type BlockNode ¶
type BlockNode interface {
Node
Children() []Node
ParameterName() ID
BlockType() ID
Interpreter() BlockInterpreter
SetSchema(schema.Schema)
GetPropertySchema(ID) (schema.Schema, bool)
Key() *string
}
BlockNode is the AST node for a block
type BlockNodeRegistry ¶
BlockNodeRegistry is an interface for looking up named blocks
type BlockProvider ¶
type BlockProvider interface {
BlockInterpreters(*ParseContext) (map[ID]BlockInterpreter, error)
}
BlockProvider is an interface for an object which provides additional block types
type BlockPublisher ¶
type BlockPublisher interface {
PublishBlock(block Block, onScheduled func() error) (published bool, err error)
}
BlockPublisher defines an interface which generator blocks should use to publish generated blocks The PublishBlock function will either:
- return immediately with published=false if the block is not a dependency of other blocks
- otherwise it will block until all other blocks depending on the published block will finish running
If the onScheduled function is not nil, it will be called after the published block was scheduled
type BlockRunner ¶
BlockRunner defines a Run() function which runs the main business logic
type BlockTransformerRegistryAware ¶
type BlockTransformerRegistryAware interface {
BlockTransformerRegistry() parsley.NodeTransformerRegistry
}
BlockTransformerRegistryAware is an interface to get a block node transformer registry
type Container ¶
type Container interface {
Node() Node
Value() (interface{}, parsley.Error)
WaitGroups() []WaitGroup
Close()
}
Container is a conflow object container
type Dependencies ¶
type Dependencies map[ID]VariableNode
Dependencies is a variable list
func (Dependencies) Add ¶
func (d Dependencies) Add(d2 Dependencies)
type DirectiveTransformerRegistryAware ¶
type DirectiveTransformerRegistryAware interface {
DirectiveTransformerRegistry() parsley.NodeTransformerRegistry
}
DirectiveTransformerRegistryAware is an interface to get a block node transformer registry
type EvalContext ¶
type EvalContext struct {
UserContext interface{}
Logger Logger
Stdout io.Writer
InputParams map[ID]interface{}
// contains filtered or unexported fields
}
EvalContext is the evaluation context
func NewEvalContext ¶
func NewEvalContext( ctx context.Context, userContext interface{}, logger Logger, jobScheduler JobScheduler, dependencies map[ID]BlockContainer, ) *EvalContext
NewEvalContext returns with a new evaluation context
func (*EvalContext) BlockContainer ¶
func (e *EvalContext) BlockContainer(id ID) (BlockContainer, bool)
BlockContainer returns with the given block container instance if it exists
func (*EvalContext) Cancel ¶
func (e *EvalContext) Cancel() bool
func (*EvalContext) Done ¶
func (e *EvalContext) Done() <-chan struct{}
func (*EvalContext) Err ¶
func (e *EvalContext) Err() error
func (*EvalContext) HasSubscribers ¶
func (e *EvalContext) HasSubscribers(id ID) bool
func (*EvalContext) JobScheduler ¶
func (e *EvalContext) JobScheduler() JobScheduler
func (*EvalContext) New ¶
func (e *EvalContext) New( ctx context.Context, cancel context.CancelFunc, dependencies map[ID]BlockContainer, ) *EvalContext
New creates a new eval context by copying the parent and overriding the provided values
func (*EvalContext) Publish ¶
func (e *EvalContext) Publish(c Container)
func (*EvalContext) Run ¶
func (e *EvalContext) Run() bool
func (*EvalContext) SetStdout ¶
func (e *EvalContext) SetStdout(stdout io.Writer)
func (*EvalContext) Subscribe ¶
func (e *EvalContext) Subscribe(container *NodeContainer, id ID)
func (*EvalContext) Unsubscribe ¶
func (e *EvalContext) Unsubscribe(container *NodeContainer, id ID)
func (*EvalContext) Value ¶
func (e *EvalContext) Value(key interface{}) interface{}
type EvalStage ¶
type EvalStage int8
EvalStage means an evaluation stage (default, pre or post)
type FunctionInterpreter ¶
type FunctionInterpreter interface {
Schema() schema.Schema
Eval(ctx interface{}, args []interface{}) (interface{}, error)
}
FunctionInterpreter defines an interpreter for functions
type FunctionNode ¶
type FunctionNode interface {
parsley.Node
parsley.StaticCheckable
Name() ID
ArgumentNodes() []parsley.Node
}
FunctionNode is the AST node for a function
type FunctionTransformerRegistryAware ¶
type FunctionTransformerRegistryAware interface {
FunctionTransformerRegistry() parsley.NodeTransformerRegistry
}
FunctionTransformerRegistryAware is an interface to get a function node transformer registry
type IDNode ¶
type IDNode struct {
// contains filtered or unexported fields
}
IDNode contains an identifier
func (*IDNode) Classifier ¶
Classifier returns with classifier of the id A classifier is a single rune, like '@', '$', '&'.
func (*IDNode) ReaderPos ¶
ReaderPos returns the position of the first character immediately after this node
func (*IDNode) Schema ¶
func (i *IDNode) Schema() interface{}
Schema returns the schema for the node's value
func (*IDNode) SetReaderPos ¶
SetReaderPos changes the reader position
type IDRegistry ¶
IDRegistry generates and stores identifiers
func NewIDRegistry ¶
func NewIDRegistry(minLength int, maxLength int) IDRegistry
type Identifiable ¶
type Identifiable interface {
ID() ID
}
Identifiable makes an object to have a string identifier and have an identifiable parent
type JobContainer ¶
type JobScheduler ¶
JobScheduler is the job scheduler
type LogArray ¶
type LogArray interface {
LogArrayMarshaler
Object(obj LogObjectMarshaler) LogArray
ID(val ID) LogArray
Str(val string) LogArray
Bytes(val []byte) LogArray
Hex(val []byte) LogArray
Err(err error) LogArray
Bool(b bool) LogArray
Int(i int) LogArray
Int8(i int8) LogArray
Int16(i int16) LogArray
Int32(i int32) LogArray
Int64(i int64) LogArray
Uint(i uint) LogArray
Uint8(i uint8) LogArray
Uint16(i uint16) LogArray
Uint32(i uint32) LogArray
Uint64(i uint64) LogArray
Float32(f float32) LogArray
Float64(f float64) LogArray
Time(t time.Time) LogArray
Dur(d time.Duration) LogArray
Interface(i interface{}) LogArray
IPAddr(ip net.IP) LogArray
IPPrefix(pfx net.IPNet) LogArray
MACAddr(ha net.HardwareAddr) LogArray
}
type LogArrayMarshaler ¶
type LogArrayMarshaler interface {
MarshalLogArray(a LogArray)
}
type LogEvent ¶
type LogEvent interface {
Enabled() bool
Discard() LogEvent
Msg(msg string)
Msgf(format string, v ...interface{})
Fields(fields map[string]interface{}) LogEvent
Dict(key string, dict LogEvent) LogEvent
Array(key string, arr LogArrayMarshaler) LogEvent
Object(key string, obj LogObjectMarshaler) LogEvent
EmbedObject(obj LogObjectMarshaler) LogEvent
ID(key string, val ID) LogEvent
Str(key, val string) LogEvent
Strs(key string, vals []string) LogEvent
Bytes(key string, val []byte) LogEvent
Hex(key string, val []byte) LogEvent
RawJSON(key string, b []byte) LogEvent
AnErr(key string, err error) LogEvent
Errs(key string, errs []error) LogEvent
Err(err error) LogEvent
Stack() LogEvent
Bool(key string, b bool) LogEvent
Bools(key string, b []bool) LogEvent
Int(key string, i int) LogEvent
Ints(key string, i []int) LogEvent
Int8(key string, i int8) LogEvent
Ints8(key string, i []int8) LogEvent
Int16(key string, i int16) LogEvent
Ints16(key string, i []int16) LogEvent
Int32(key string, i int32) LogEvent
Ints32(key string, i []int32) LogEvent
Int64(key string, i int64) LogEvent
Ints64(key string, i []int64) LogEvent
Uint(key string, i uint) LogEvent
Uints(key string, i []uint) LogEvent
Uint8(key string, i uint8) LogEvent
Uints8(key string, i []uint8) LogEvent
Uint16(key string, i uint16) LogEvent
Uints16(key string, i []uint16) LogEvent
Uint32(key string, i uint32) LogEvent
Uints32(key string, i []uint32) LogEvent
Uint64(key string, i uint64) LogEvent
Uints64(key string, i []uint64) LogEvent
Float32(key string, f float32) LogEvent
Floats32(key string, f []float32) LogEvent
Float64(key string, f float64) LogEvent
Floats64(key string, f []float64) LogEvent
Timestamp() LogEvent
Time(key string, t time.Time) LogEvent
Times(key string, t []time.Time) LogEvent
Dur(key string, d time.Duration) LogEvent
Durs(key string, d []time.Duration) LogEvent
TimeDiff(key string, t time.Time, start time.Time) LogEvent
Interface(key string, i interface{}) LogEvent
Caller() LogEvent
IPAddr(key string, ip net.IP) LogEvent
IPPrefix(key string, pfx net.IPNet) LogEvent
MACAddr(key string, ha net.HardwareAddr) LogEvent
}
LogEvent is an interface for enriching and sending log events
type LogObjectMarshaler ¶
type LogObjectMarshaler interface {
MarshalLogObject(e LogEvent)
}
type Logger ¶
type Logger interface {
With() LoggerContext
Debug() LogEvent
Info() LogEvent
Warn() LogEvent
Error() LogEvent
Fatal() LogEvent
Panic() LogEvent
Log() LogEvent
Print(v ...interface{})
Printf(format string, v ...interface{})
Array() LogArray
}
Logger is an interface for structured logging
type LoggerContext ¶
type LoggerContext interface {
Logger() Logger
Fields(fields map[string]interface{}) LoggerContext
Dict(key string, dict LogEvent) LoggerContext
Array(key string, arr LogArrayMarshaler) LoggerContext
Object(key string, obj LogObjectMarshaler) LoggerContext
EmbedObject(obj LogObjectMarshaler) LoggerContext
ID(key string, val ID) LoggerContext
Str(key, val string) LoggerContext
Strs(key string, vals []string) LoggerContext
Bytes(key string, val []byte) LoggerContext
Hex(key string, val []byte) LoggerContext
RawJSON(key string, b []byte) LoggerContext
AnErr(key string, err error) LoggerContext
Errs(key string, errs []error) LoggerContext
Err(err error) LoggerContext
Bool(key string, b bool) LoggerContext
Bools(key string, b []bool) LoggerContext
Int(key string, i int) LoggerContext
Ints(key string, i []int) LoggerContext
Int8(key string, i int8) LoggerContext
Ints8(key string, i []int8) LoggerContext
Int16(key string, i int16) LoggerContext
Ints16(key string, i []int16) LoggerContext
Int32(key string, i int32) LoggerContext
Ints32(key string, i []int32) LoggerContext
Int64(key string, i int64) LoggerContext
Ints64(key string, i []int64) LoggerContext
Uint(key string, i uint) LoggerContext
Uints(key string, i []uint) LoggerContext
Uint8(key string, i uint8) LoggerContext
Uints8(key string, i []uint8) LoggerContext
Uint16(key string, i uint16) LoggerContext
Uints16(key string, i []uint16) LoggerContext
Uint32(key string, i uint32) LoggerContext
Uints32(key string, i []uint32) LoggerContext
Uint64(key string, i uint64) LoggerContext
Uints64(key string, i []uint64) LoggerContext
Float32(key string, f float32) LoggerContext
Floats32(key string, f []float32) LoggerContext
Float64(key string, f float64) LoggerContext
Floats64(key string, f []float64) LoggerContext
Timestamp() LoggerContext
Time(key string, t time.Time) LoggerContext
Times(key string, t []time.Time) LoggerContext
Dur(key string, d time.Duration) LoggerContext
Durs(key string, d []time.Duration) LoggerContext
Interface(key string, i interface{}) LoggerContext
Caller() LoggerContext
CallerWithSkipFrameCount(skipFrameCount int) LoggerContext
Stack() LoggerContext
IPAddr(key string, ip net.IP) LoggerContext
IPPrefix(key string, pfx net.IPNet) LoggerContext
MACAddr(key string, ha net.HardwareAddr) LoggerContext
}
LoggerContext is an interface for setting up child loggers
type NameNode ¶
type NameNode struct {
// contains filtered or unexported fields
}
NameNode contains a name node A name node consists of one identifier, or two separated by a single character
func NewNameNode ¶
func NewNameNode(selector *IDNode, sep parsley.LiteralNode, name *IDNode) *NameNode
NewNameNode creates a new name node type
func (*NameNode) ReaderPos ¶
ReaderPos returns the position of the first character immediately after this node
func (*NameNode) Schema ¶
func (t *NameNode) Schema() interface{}
Schema returns the schema for the node's value
func (*NameNode) SelectorNode ¶
SelectorNode returns with selector node A selector can be e.g. a package name for functions, or the parameter name for block types
func (*NameNode) SetReaderPos ¶
SetReaderPos changes the reader position
type NilContainer ¶
type NilContainer struct {
// contains filtered or unexported fields
}
NilContainer is a container which evaluates to nil
func (NilContainer) Close ¶
func (n NilContainer) Close()
func (NilContainer) Node ¶
func (n NilContainer) Node() Node
func (NilContainer) Pending ¶
func (n NilContainer) Pending() bool
func (NilContainer) Value ¶
func (n NilContainer) Value() (interface{}, parsley.Error)
func (NilContainer) WaitGroups ¶
func (n NilContainer) WaitGroups() []WaitGroup
type Node ¶
type Node interface {
parsley.Node
Identifiable
EvalStage() EvalStage
Dependencies() Dependencies
Directives() []BlockNode
Provides() []ID
Generates() []ID
CreateContainer(
ctx *EvalContext,
runtimeConfig RuntimeConfig,
parent BlockContainer,
value interface{},
wgs []WaitGroup,
pending bool,
) JobContainer
Value(userCtx interface{}) (interface{}, parsley.Error)
}
Node is an identifiable node which has dependencies and has an evaluation stage
type NodeContainer ¶
type NodeContainer struct {
// contains filtered or unexported fields
}
NodeContainer wraps a node and registers the dependencies as they become available
func NewNodeContainer ¶
func NewNodeContainer( ctx *EvalContext, parent BlockContainer, node Node, scheduler JobScheduler, ) (*NodeContainer, parsley.Error)
NewNodeContainer creates a new node container
func (*NodeContainer) Close ¶
func (n *NodeContainer) Close()
func (*NodeContainer) CreateContainer ¶
func (n *NodeContainer) CreateContainer(value interface{}, wgs []WaitGroup) (JobContainer, parsley.Error)
func (*NodeContainer) Run ¶
func (n *NodeContainer) Run() (pending bool, err parsley.Error)
Run will schedule the node if it's ready. If the node is not ready, then it will return with pending true
func (*NodeContainer) SetDependency ¶
func (n *NodeContainer) SetDependency(dep Container)
SetDependency stores the given container If all dependencies are set on the node then it will schedule the node for running.
type ParameterConfig ¶
func (ParameterConfig) ApplyToParameterConfig ¶
func (p ParameterConfig) ApplyToParameterConfig(p2 *ParameterConfig)
type ParameterConfigOption ¶
type ParameterConfigOption interface {
ApplyToParameterConfig(*ParameterConfig)
}
type ParameterContainer ¶
type ParameterContainer interface {
Container
BlockContainer() BlockContainer
}
ParameterContainer is a parameter container
type ParameterDirective ¶
type ParameterDirective interface {
Block
ApplyToParameterConfig(*ParameterConfig)
}
ParameterDirective provides a way to add metadata for parameters
type ParameterNode ¶
type ParameterNode interface {
Node
parsley.StaticCheckable
Name() ID
ValueNode() parsley.Node
IsDeclaration() bool
SetSchema(schema.Schema)
}
ParameterNode is the AST node for a parameter
type ParseContext ¶
type ParseContext struct {
// contains filtered or unexported fields
}
ParseContext is the parsing context
func NewParseContext ¶
func NewParseContext( fileset *parsley.FileSet, idRegistry IDRegistry, directiveTransformerRegistry parsley.NodeTransformerRegistry, ) *ParseContext
NewParseContext returns with a new parsing context
func (*ParseContext) AddBlockNode ¶
func (p *ParseContext) AddBlockNode(node BlockNode) error
AddBlockNode adds a new block node It returns with an error if a block with the same id was already registered
func (*ParseContext) BlockNode ¶
func (p *ParseContext) BlockNode(id ID) (BlockNode, bool)
BlockNode returns with the given block node if it exists
func (*ParseContext) BlockTransformerRegistry ¶
func (p *ParseContext) BlockTransformerRegistry() parsley.NodeTransformerRegistry
BlockTransformerRegistry returns with the block node transformer registry
func (*ParseContext) DirectiveTransformerRegistry ¶
func (p *ParseContext) DirectiveTransformerRegistry() parsley.NodeTransformerRegistry
DirectiveTransformerRegistry returns with the directive node transformer registry
func (*ParseContext) FileSet ¶
func (p *ParseContext) FileSet() *parsley.FileSet
FileSet returns with the file set
func (*ParseContext) FunctionTransformerRegistry ¶
func (p *ParseContext) FunctionTransformerRegistry() parsley.NodeTransformerRegistry
FunctionTransformerRegistry returns with the function node transformer registry
func (*ParseContext) GenerateID ¶
func (p *ParseContext) GenerateID() ID
GenerateID generates a new id
func (*ParseContext) IDExists ¶
func (p *ParseContext) IDExists(id ID) bool
IDExists returns true if the identifier already exists
func (*ParseContext) New ¶
func (p *ParseContext) New(config ParseContextOverride) *ParseContext
New creates a new child context
func (*ParseContext) NewForModule ¶
func (p *ParseContext) NewForModule() *ParseContext
func (*ParseContext) RegisterID ¶
func (p *ParseContext) RegisterID(id ID) error
RegisterID registers a new id and returns an error if it was already registered
type ParseContextOverride ¶
type ParseContextOverride struct {
BlockTransformerRegistry parsley.NodeTransformerRegistry
FunctionTransformerRegistry parsley.NodeTransformerRegistry
DirectiveTransformerRegistry parsley.NodeTransformerRegistry
}
ParseContextOverride stores override values for a parse context
type ParseContextOverrider ¶
type ParseContextOverrider interface {
ParseContextOverride() ParseContextOverride
}
ParseContextOverrider defines an interface to be able to override a parse config
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
func (*PubSub) HasSubscribers ¶
HasSubscribers will return true if the given block has subscribers
func (*PubSub) Publish ¶
Publish will notify all node containers which are subscribed for the dependency The ready function will run on any containers which have all dependencies satisfied
func (*PubSub) Subscribe ¶
func (p *PubSub) Subscribe(c *NodeContainer, id ID)
Subscribe will subscribe the given node container for the given dependency
func (*PubSub) Unsubscribe ¶
func (p *PubSub) Unsubscribe(c *NodeContainer, id ID)
Unsubscribe will unsubscribe the given node container for the given dependency
type Retry ¶
type Retry string
Retry is a block run result which indicates we need to retry
func (Retry) RetryAfter ¶
func (Retry) RetryReason ¶
type RetryConfig ¶
type RetryConfig struct {
Limit int
}
type RuntimeConfig ¶
type RuntimeConfig struct {
Skip *bool
Timeout *time.Duration
Triggers []ID
RetryConfig *RetryConfig
}
func (*RuntimeConfig) ApplyToRuntimeConfig ¶
func (r *RuntimeConfig) ApplyToRuntimeConfig(r2 *RuntimeConfig)
func (*RuntimeConfig) IsTrigger ¶
func (r *RuntimeConfig) IsTrigger(trigger ID) bool
type RuntimeConfigOption ¶
type RuntimeConfigOption interface {
ApplyToRuntimeConfig(*RuntimeConfig)
}
type UserContexter ¶
type UserContexter interface {
UserContext(ctx interface{}) interface{}
}
UserContexter defines an interface about creating a new user context
type VariableNode ¶
type VariableNode interface {
parsley.Node
Identifiable
ParentID() ID
ParamName() ID
}
VariableNode stores a variable reference. It always refers to a named block's parameter.