Documentation ¶
Index ¶
- func NagateMatcher(m handler.Matcher) handler.Matcher
- func ParseExecutableNode(in interface{}, logger *zap.Logger) (handler.ExecutableChainNode, error)
- type BatchMatherAnd
- type BatchMatherOr
- type FallbackConfig
- type FallbackNode
- type IfNode
- func (b *IfNode) Exec(ctx context.Context, qCtx *handler.Context, next handler.ExecutableChainNode) (err error)
- func (b *IfNode) LinkNext(n handler.ExecutableChainNode)
- func (b *IfNode) LinkPrevious(n handler.ExecutableChainNode)
- func (b *IfNode) Next() handler.ExecutableChainNode
- func (b *IfNode) Previous() handler.ExecutableChainNode
- type IfNodeConfig
- type NagativeMatcher
- type ParallelConfig
- type ParallelNode
- type RefExecPluginNode
- type RefMatcherPluginNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseExecutableNode ¶
func ParseExecutableNode(in interface{}, logger *zap.Logger) (handler.ExecutableChainNode, error)
ParseExecutableNode parses in into a ExecutableChainNode. in can be: (a / a slice of) Executable, (a / a slice of) string of registered handler.ExecutablePlugin tag, (a / a slice of) map[string]interface{}, which can be parsed to FallbackConfig, ParallelConfig or IfNodeConfig, a []interface{} that contains all of the above.
Types ¶
type BatchMatherAnd ¶
type BatchMatherOr ¶
type FallbackConfig ¶
type FallbackConfig struct { // Primary exec sequence. Primary interface{} `yaml:"primary"` // Secondary exec sequence. Secondary interface{} `yaml:"secondary"` StatLength int `yaml:"stat_length"` // An Zero value disables the normal fallback. Threshold int `yaml:"threshold"` // FastFallback threshold in milliseconds. Zero means fast fallback is disabled. FastFallback int `yaml:"fast_fallback"` // AlwaysStandby: secondary should always standby in fast fallback. AlwaysStandby bool `yaml:"always_standby"` }
type FallbackNode ¶
type FallbackNode struct {
// contains filtered or unexported fields
}
func ParseFallbackNode ¶
func ParseFallbackNode(c *FallbackConfig, logger *zap.Logger) (*FallbackNode, error)
func (*FallbackNode) Exec ¶
func (f *FallbackNode) Exec(ctx context.Context, qCtx *handler.Context, next handler.ExecutableChainNode) error
type IfNode ¶
type IfNode struct { ConditionMatcher handler.Matcher // This cannot be nil. ExecutableNode handler.ExecutableChainNode // This cannot be nil. // contains filtered or unexported fields }
IfNode implement handler.ExecutableChainNode. Internal IfNode.ExecutableNode will also be linked by LinkPrevious and LinkNext.
func ParseIfChainNode ¶
func ParseIfChainNode(c *IfNodeConfig, logger *zap.Logger) (*IfNode, error)
func (*IfNode) LinkNext ¶
func (b *IfNode) LinkNext(n handler.ExecutableChainNode)
func (*IfNode) LinkPrevious ¶
func (b *IfNode) LinkPrevious(n handler.ExecutableChainNode)
func (*IfNode) Next ¶
func (b *IfNode) Next() handler.ExecutableChainNode
func (*IfNode) Previous ¶
func (b *IfNode) Previous() handler.ExecutableChainNode
type IfNodeConfig ¶
type IfNodeConfig struct { // Available type are: // 1. string (a tag of registered handler.MatcherPlugin) // 2. handler.Matcher. // 3. a slice of interface{} and contains above type. (In this case, the logic // between multiple matchers is OR.) // Must specify one condition. If both conditions are given, If takes the priority. If interface{} `yaml:"if"` // logical OR IfAnd interface{} `yaml:"if_and"` // logical AND // See ParseExecutableNode. This cannot be nil. Exec interface{} `yaml:"exec"` }
IfNodeConfig is a config to build a IfNode.
type NagativeMatcher ¶
type NagativeMatcher struct {
// contains filtered or unexported fields
}
type ParallelConfig ¶
type ParallelConfig struct { Parallel []interface{} `yaml:"parallel"` Timeout uint `yaml:"timeout"` }
type ParallelNode ¶
type ParallelNode struct {
// contains filtered or unexported fields
}
func ParseParallelNode ¶
func ParseParallelNode(c *ParallelConfig, logger *zap.Logger) (*ParallelNode, error)
func (*ParallelNode) Exec ¶
func (p *ParallelNode) Exec(ctx context.Context, qCtx *handler.Context, next handler.ExecutableChainNode) error
type RefExecPluginNode ¶
type RefExecPluginNode struct {
// contains filtered or unexported fields
}
RefExecPluginNode is a handler.ExecutablePlugin reference tag.
func NewREPNode ¶
func NewREPNode(tag string) *RefExecPluginNode
NewREPNode creates a RefExecPluginNode from tag.
func (*RefExecPluginNode) Exec ¶
func (n *RefExecPluginNode) Exec(ctx context.Context, qCtx *handler.Context, next handler.ExecutableChainNode) (err error)
Click to show internal directories.
Click to hide internal directories.