Documentation ¶
Index ¶
Constants ¶
const ( Name = "driplane" Version = "1.16.1" Author = "Gianluca Braga aka Matrix86" )
Info on driplane
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { sync.RWMutex FilePath string // contains filtered or unexported fields }
Configuration contains all the configs read by yaml file
func LoadConfiguration ¶
func LoadConfiguration(path string) (*Configuration, error)
LoadConfiguration create a Configuration struct from a filename
func (*Configuration) Get ¶
func (c *Configuration) Get(name string) string
Get returns the config value with that name, if it exists
func (*Configuration) GetConfig ¶
func (c *Configuration) GetConfig() map[string]string
GetConfig returns the complete configuration in a flatten way
type FeederNode ¶
type FeederNode struct { Name string `"<" @Ident` Params []*Param `(":" @@ ("," @@)*)? ">"` Next *Node `("|" @@)?` }
FeederNode identifies the Feeder in the rule
type FilterNode ¶
type FilterNode struct { Neg bool `@("!")?` Name string `@Ident` Params []*Param `"(" ( @@ ("," @@)* )? ")"` Next *Node `("|" @@)?` }
FilterNode identifies the Filter in the rule
type Node ¶
type Node struct { //Action *ActionNode `( @@ ` Filter *FilterNode `( @@` RuleCall *RuleCall `| @@)` }
Node identifies a Filter or a RuleCall
type Orchestrator ¶
Orchestrator handles the pipelines and rules
func NewOrchestrator ¶
func NewOrchestrator(config *Configuration) (Orchestrator, error)
NewOrchestrator create a new instance of the Orchestrator
func (*Orchestrator) HasRunningFeeder ¶
func (o *Orchestrator) HasRunningFeeder() bool
HasRunningFeeder return true if one or more feeders are running
func (*Orchestrator) StartFeeders ¶
func (o *Orchestrator) StartFeeders()
StartFeeders opens the gates
func (*Orchestrator) StopFeeders ¶
func (o *Orchestrator) StopFeeders()
StopFeeders closes the gates
func (*Orchestrator) WaitFeeders ¶
func (o *Orchestrator) WaitFeeders()
WaitFeeders waits until all the feeders are stopped
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser handles the parsing of the rules
type PipeRule ¶
PipeRule identifies a single rule
func NewPipeRule ¶
func NewPipeRule(node *RuleNode, config *Configuration, filename string, deps []string) (*PipeRule, error)
NewPipeRule creates and returns a PipeRule struct
func (*PipeRule) GetIdentifier ¶ added in v1.3.1
GetIdentifier return the name with the file of the current Piperule
type RuleNode ¶
type RuleNode struct { Identifier string `@Ident "="">"` Feeder *FeederNode `( @@` First *Node `| @@ ) ";"` }
RuleNode defines the first part of the Rule
type Ruleset ¶
type Ruleset struct {
// contains filtered or unexported fields
}
Ruleset identifies a set of rules
func RuleSetInstance ¶
func RuleSetInstance() *Ruleset
RuleSetInstance is the singleton for the Ruleset object
func (*Ruleset) AddRule ¶
func (r *Ruleset) AddRule(filename string, node *RuleNode, config *Configuration, deps []string) error
AddRule appends a new rule to the set
func (*Ruleset) CompileAst ¶ added in v1.3.1
CompileAst compiles the AST