Documentation ¶
Index ¶
- Constants
- Variables
- func IsBlockSchema(s schema.Schema) bool
- func NewInterpreter(uri string) (conflow.BlockInterpreter, error)
- func TransformChildren(parseCtx *conflow.ParseContext, blockID conflow.ID, nodes []parsley.Node, ...) ([]conflow.Node, conflow.Dependencies, parsley.Error)
- func TransformMainNode(ctx interface{}, node parsley.Node, id conflow.ID, ...) (parsley.Node, parsley.Error)
- func TransformNode(ctx interface{}, node parsley.Node, interpreter conflow.BlockInterpreter) (parsley.Node, parsley.Error)
- type Container
- func (c *Container) Cancel() bool
- func (c *Container) Close()
- func (c *Container) EvalStage() conflow.EvalStage
- func (c *Container) JobID() int
- func (c *Container) JobName() conflow.ID
- func (c *Container) Lightweight() bool
- func (c *Container) Node() conflow.Node
- func (c *Container) Param(name conflow.ID) interface{}
- func (c *Container) Pending() bool
- func (c *Container) PublishBlock(block conflow.Block, f func() error) (bool, error)
- func (c *Container) Run()
- func (c *Container) SetChild(container conflow.Container)
- func (c *Container) SetError(err parsley.Error)
- func (c *Container) SetJobID(id int)
- func (c *Container) Value() (interface{}, parsley.Error)
- func (c *Container) WaitGroups() []conflow.WaitGroup
- type InterpreterRegistry
- type Node
- func (n *Node) BlockType() conflow.ID
- func (n *Node) Children() []conflow.Node
- func (n *Node) CreateContainer(ctx *conflow.EvalContext, runtimeConfig conflow.RuntimeConfig, ...) conflow.JobContainer
- func (n *Node) Dependencies() conflow.Dependencies
- func (n *Node) Directives() []conflow.BlockNode
- func (n *Node) EvalStage() conflow.EvalStage
- func (n *Node) Generates() []conflow.ID
- func (n *Node) GetPropertySchema(name conflow.ID) (schema.Schema, bool)
- func (n *Node) ID() conflow.ID
- func (n *Node) Interpreter() conflow.BlockInterpreter
- func (n *Node) Key() *string
- func (n *Node) ParameterName() conflow.ID
- func (n *Node) Pos() parsley.Pos
- func (n *Node) Provides() []conflow.ID
- func (n *Node) ReaderPos() parsley.Pos
- func (n *Node) Schema() interface{}
- func (n *Node) SetReaderPos(f func(parsley.Pos) parsley.Pos)
- func (n *Node) SetSchema(s schema.Schema)
- func (n *Node) StaticCheck(ctx interface{}) parsley.Error
- func (n *Node) String() string
- func (n *Node) Token() string
- func (n *Node) Value(userCtx interface{}) (interface{}, parsley.Error)
- func (n *Node) Walk(f func(n parsley.Node) bool) bool
- type StaticContainer
- func (s *StaticContainer) Cancel() bool
- func (s *StaticContainer) Close()
- func (s *StaticContainer) EvalStage() conflow.EvalStage
- func (s *StaticContainer) JobID() int
- func (s *StaticContainer) JobName() conflow.ID
- func (s *StaticContainer) Lightweight() bool
- func (s *StaticContainer) Node() conflow.Node
- func (s *StaticContainer) Pending() bool
- func (s *StaticContainer) Run()
- func (s *StaticContainer) SetJobID(jobID int)
- func (s *StaticContainer) Value() (interface{}, parsley.Error)
- func (s *StaticContainer) WaitGroups() []conflow.WaitGroup
Constants ¶
const ( TokenBlock = "BLOCK" TokenDirective = "BLOCK_DIRECTIVE" TokenBlockBody = "BLOCK_BODY" TokenName = "NAME" )
Node tokens
Variables ¶
var ContainerGracefulTimeoutSec = 10
ContainerGracefulTimeoutSec is the graceful timeout in seconds
Functions ¶
func IsBlockSchema ¶
func NewInterpreter ¶
func NewInterpreter(uri string) (conflow.BlockInterpreter, error)
func TransformChildren ¶
func TransformChildren( parseCtx *conflow.ParseContext, blockID conflow.ID, nodes []parsley.Node, interpreter conflow.BlockInterpreter, ) ([]conflow.Node, conflow.Dependencies, parsley.Error)
func TransformMainNode ¶
func TransformNode ¶
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container is a block container
func NewContainer ¶
func NewContainer( evalCtx *conflow.EvalContext, runtimeConfig conflow.RuntimeConfig, node conflow.BlockNode, parent conflow.BlockContainer, value interface{}, wgs []conflow.WaitGroup, pending bool, ) *Container
NewContainer creates a new block container instance
func (*Container) Lightweight ¶
func (*Container) PublishBlock ¶
func (*Container) Value ¶
Value returns with the block or the error if any occurred If the block was skipped then a nil value is returned
func (*Container) WaitGroups ¶
WaitGroups returns nil
type InterpreterRegistry ¶
type InterpreterRegistry map[string]conflow.BlockInterpreter
InterpreterRegistry contains a list of block interpreters and behaves as a node transformer registry
func (InterpreterRegistry) NodeTransformer ¶
func (i InterpreterRegistry) NodeTransformer(name string) (parsley.NodeTransformer, bool)
NodeTransformer returns with the named node transformer
func (InterpreterRegistry) Register ¶
func (i InterpreterRegistry) Register(name string, interpreter conflow.BlockInterpreter) InterpreterRegistry
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is a block node
func NewNode ¶
func NewNode( idNode *conflow.IDNode, nameNode *conflow.NameNode, keyNode *terminal.StringNode, children []conflow.Node, token string, directives []conflow.BlockNode, readerPos parsley.Pos, interpreter conflow.BlockInterpreter, dependencies conflow.Dependencies, ) *Node
NewNode creates a new block node
func (*Node) CreateContainer ¶
func (n *Node) CreateContainer( ctx *conflow.EvalContext, runtimeConfig conflow.RuntimeConfig, parent conflow.BlockContainer, value interface{}, wgs []conflow.WaitGroup, pending bool, ) conflow.JobContainer
func (*Node) Dependencies ¶
func (n *Node) Dependencies() conflow.Dependencies
Dependencies returns the blocks/parameters this block depends on
func (*Node) Directives ¶
Directives returns with the directive blocks
func (*Node) GetPropertySchema ¶
func (*Node) Interpreter ¶
func (n *Node) Interpreter() conflow.BlockInterpreter
Interpreter returns with the interpreter
func (*Node) ParameterName ¶
ParameterName returns with the parameter name
func (*Node) Provides ¶
Provides returns with the all the defined blocked node ids inside this block
func (*Node) Schema ¶
func (n *Node) Schema() interface{}
Schema returns the schema for the node's value
func (*Node) SetReaderPos ¶
SetReaderPos amends the reader position using the given function
func (*Node) StaticCheck ¶
StaticCheck runs static analysis on the node
type StaticContainer ¶
type StaticContainer struct {
// contains filtered or unexported fields
}
StaticContainer is a container for blocks where there is no dynamic child evaluation required
func NewStaticContainer ¶
func NewStaticContainer( evalCtx *conflow.EvalContext, node conflow.BlockNode, ) *StaticContainer
NewStaticContainer creates a new static block container instance
func (*StaticContainer) Cancel ¶
func (s *StaticContainer) Cancel() bool
func (*StaticContainer) Close ¶
func (s *StaticContainer) Close()
func (*StaticContainer) EvalStage ¶
func (s *StaticContainer) EvalStage() conflow.EvalStage
func (*StaticContainer) JobID ¶
func (s *StaticContainer) JobID() int
func (*StaticContainer) JobName ¶
func (s *StaticContainer) JobName() conflow.ID
func (*StaticContainer) Lightweight ¶
func (s *StaticContainer) Lightweight() bool
func (*StaticContainer) Node ¶
func (s *StaticContainer) Node() conflow.Node
Node returns with the block node
func (*StaticContainer) Pending ¶
func (s *StaticContainer) Pending() bool
func (*StaticContainer) Run ¶
func (s *StaticContainer) Run()
func (*StaticContainer) SetJobID ¶
func (s *StaticContainer) SetJobID(jobID int)
func (*StaticContainer) Value ¶
func (s *StaticContainer) Value() (interface{}, parsley.Error)
Value returns with the block or the error if any occurred If the block was skipped then a nil value is returned
func (*StaticContainer) WaitGroups ¶
func (s *StaticContainer) WaitGroups() []conflow.WaitGroup