Documentation ¶
Index ¶
- Constants
- func Init(bp *coremain.BP, args any) (any, error)
- func MustRegExecQuickSetup(typ string, f ExecQuickSetupFunc)
- func MustRegMatchQuickSetup(typ string, f MatchQuickSetupFunc)
- func RegExecQuickSetup(typ string, f ExecQuickSetupFunc) error
- func RegMatchQuickSetup(typ string, f MatchQuickSetupFunc) error
- type ActionAccept
- type ActionGoto
- type ActionJump
- type ActionReject
- type ActionReturn
- type Args
- type BQ
- type ChainNode
- type ChainWalker
- type ExecQuickSetupFunc
- type Executable
- type ExecutableFunc
- type MatchAlwaysFalse
- type MatchAlwaysTrue
- type MatchConfig
- type MatchFunc
- type MatchQuickSetupFunc
- type Matcher
- type QuickConfigurableExec
- type QuickConfigurableMatch
- type RecursiveExecutable
- type RecursiveExecutableFunc
- type RuleArgs
- type RuleConfig
- type Sequence
Constants ¶
View Source
const PluginType = "sequence"
Variables ¶
This section is empty.
Functions ¶
func MustRegExecQuickSetup ¶
func MustRegExecQuickSetup(typ string, f ExecQuickSetupFunc)
func MustRegMatchQuickSetup ¶
func MustRegMatchQuickSetup(typ string, f MatchQuickSetupFunc)
func RegExecQuickSetup ¶
func RegExecQuickSetup(typ string, f ExecQuickSetupFunc) error
func RegMatchQuickSetup ¶
func RegMatchQuickSetup(typ string, f MatchQuickSetupFunc) error
Types ¶
type ActionAccept ¶
type ActionAccept struct{}
func (ActionAccept) Exec ¶
func (a ActionAccept) Exec(_ context.Context, _ *query_context.Context, _ ChainWalker) error
type ActionGoto ¶
type ActionGoto struct {
To []*ChainNode
}
func (ActionGoto) Exec ¶
func (a ActionGoto) Exec(ctx context.Context, qCtx *query_context.Context, _ ChainWalker) error
type ActionJump ¶
type ActionJump struct {
To []*ChainNode
}
func (*ActionJump) Exec ¶
func (a *ActionJump) Exec(ctx context.Context, qCtx *query_context.Context, next ChainWalker) error
type ActionReject ¶
type ActionReject struct {
Rcode int
}
func (ActionReject) Exec ¶
func (a ActionReject) Exec(_ context.Context, qCtx *query_context.Context, _ ChainWalker) error
type ActionReturn ¶
type ActionReturn struct{}
func (ActionReturn) Exec ¶
func (a ActionReturn) Exec(ctx context.Context, qCtx *query_context.Context, next ChainWalker) error
type BQ ¶
type ChainNode ¶
type ChainNode struct { Matches []Matcher // Can be empty, indicates this node has no match specified. // At least one of E or RE must not nil. // In case both are set. E is preferred. E Executable RE RecursiveExecutable }
type ChainWalker ¶
type ChainWalker struct {
// contains filtered or unexported fields
}
func NewChainWalker ¶
func NewChainWalker(chain []*ChainNode, jumpBack *ChainWalker) ChainWalker
func (*ChainWalker) ExecNext ¶
func (w *ChainWalker) ExecNext(ctx context.Context, qCtx *query_context.Context) error
type ExecQuickSetupFunc ¶
ExecQuickSetupFunc configures an Executable or RecursiveExecutable with a simple string args.
func GetExecQuickSetup ¶
func GetExecQuickSetup(typ string) ExecQuickSetupFunc
type Executable ¶
type Executable interface {
Exec(ctx context.Context, qCtx *query_context.Context) error
}
Executable represents something that is executable.
func ToExecutable ¶
func ToExecutable(v any) Executable
type ExecutableFunc ¶
type ExecutableFunc func(ctx context.Context, qCtx *query_context.Context) error
func (ExecutableFunc) Exec ¶
func (f ExecutableFunc) Exec(ctx context.Context, qCtx *query_context.Context) error
type MatchAlwaysFalse ¶
type MatchAlwaysFalse struct{}
func (MatchAlwaysFalse) Match ¶
func (m MatchAlwaysFalse) Match(_ context.Context, _ *query_context.Context) (bool, error)
type MatchAlwaysTrue ¶
type MatchAlwaysTrue struct{}
func (MatchAlwaysTrue) Match ¶
func (m MatchAlwaysTrue) Match(_ context.Context, _ *query_context.Context) (bool, error)
type MatchConfig ¶
type MatchQuickSetupFunc ¶
MatchQuickSetupFunc configures a Matcher with a simple string args.
func GetMatchQuickSetup ¶
func GetMatchQuickSetup(typ string) MatchQuickSetupFunc
type QuickConfigurableExec ¶
QuickConfigurableExec can configure an exiting plugin with additional args. Expecting return is an Executable or RecursiveExecutable.
type QuickConfigurableMatch ¶
QuickConfigurableMatch can configure an exiting plugin with additional args.
type RecursiveExecutable ¶
type RecursiveExecutable interface {
Exec(ctx context.Context, qCtx *query_context.Context, next ChainWalker) error
}
RecursiveExecutable represents something that is executable and requires stack.
type RecursiveExecutableFunc ¶
type RecursiveExecutableFunc func(ctx context.Context, qCtx *query_context.Context, next ChainWalker) error
func (RecursiveExecutableFunc) Exec ¶
func (f RecursiveExecutableFunc) Exec(ctx context.Context, qCtx *query_context.Context, next ChainWalker) error
type RuleConfig ¶
type RuleConfig struct { Matches []MatchConfig `yaml:"matches"` Tag string `yaml:"tag"` Type string `yaml:"type"` Args string `yaml:"args"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.