executable_seq

package
v1.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EarlyStop earlyStop

EarlyStop is a noop ExecutableCmd that returns earlyStop == true.

Functions

func ExecRoot added in v1.5.2

func ExecRoot(ctx context.Context, qCtx *handler.Context, logger *zap.Logger, entry ExecutableCmd) error

ExecRoot executes the ExecutableCmd and qCtx.ExecDefer(). This intends for root cmd node.

func NagateMatcher added in v1.5.0

func NagateMatcher(m handler.Matcher) handler.Matcher

Types

type ExecutableCmd

type ExecutableCmd interface {
	ExecCmd(ctx context.Context, qCtx *handler.Context, logger *zap.Logger) (earlyStop bool, err error)
}

func ParseExecutableCmd added in v1.5.0

func ParseExecutableCmd(in interface{}) (ExecutableCmd, error)

type ExecutableCmdSequence

type ExecutableCmdSequence struct {
	// contains filtered or unexported fields
}

func ParseExecutableCmdSequence

func ParseExecutableCmdSequence(in []interface{}) (*ExecutableCmdSequence, error)

func (*ExecutableCmdSequence) ExecCmd

func (es *ExecutableCmdSequence) ExecCmd(ctx context.Context, qCtx *handler.Context, logger *zap.Logger) (earlyStop bool, err error)

ExecCmd executes the sequence.

func (*ExecutableCmdSequence) Len

func (es *ExecutableCmdSequence) Len() int

type FallbackConfig

type FallbackConfig struct {
	// Primary exec sequence, must have at least one element.
	Primary []interface{} `yaml:"primary"`
	// Secondary exec sequence, must have at least one element.
	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 FallbackECS

type FallbackECS struct {
	// contains filtered or unexported fields
}

func ParseFallbackECS

func ParseFallbackECS(c *FallbackConfig) (*FallbackECS, error)

func (*FallbackECS) ExecCmd

func (f *FallbackECS) ExecCmd(ctx context.Context, qCtx *handler.Context, logger *zap.Logger) (earlyStop bool, err error)

type IfBlock

type IfBlock struct {
	IfMatcher     []handler.Matcher
	IfAndMatcher  []handler.Matcher
	ExecutableCmd ExecutableCmd
}

func ParseIfBlock

func ParseIfBlock(c *IfBlockConfig) (*IfBlock, error)

func (*IfBlock) ExecCmd

func (b *IfBlock) ExecCmd(ctx context.Context, qCtx *handler.Context, logger *zap.Logger) (earlyStop bool, err error)

type IfBlockConfig

type IfBlockConfig struct {
	If    []string      `yaml:"if"`
	IfAnd []string      `yaml:"if_and"`
	Exec  []interface{} `yaml:"exec"`
	Goto  string        `yaml:"goto"` // Deprecated, use Exec + EarlyStop instead.
}

IfBlockConfig can build a IfBlock from human input.

type NagativeMatcher added in v1.5.0

type NagativeMatcher struct {
	// contains filtered or unexported fields
}

func (*NagativeMatcher) Match added in v1.5.0

func (n *NagativeMatcher) Match(ctx context.Context, qCtx *handler.Context) (matched bool, err error)

type ParallelECS

type ParallelECS struct {
	// contains filtered or unexported fields
}

func ParseParallelECS

func ParseParallelECS(c *ParallelECSConfig) (*ParallelECS, error)

func (*ParallelECS) ExecCmd

func (p *ParallelECS) ExecCmd(ctx context.Context, qCtx *handler.Context, logger *zap.Logger) (earlyStop bool, err error)

type ParallelECSConfig

type ParallelECSConfig struct {
	Parallel [][]interface{} `yaml:"parallel"`
	Timeout  uint            `yaml:"timeout"`
}

type RefESExecutablePlugin added in v1.5.0

type RefESExecutablePlugin string

RefESExecutablePlugin is a handler.ESExecutablePlugin reference tag.

func (RefESExecutablePlugin) ExecCmd added in v1.5.0

func (ref RefESExecutablePlugin) ExecCmd(ctx context.Context, qCtx *handler.Context, logger *zap.Logger) (earlyStop bool, err error)

func (RefESExecutablePlugin) ExecES added in v1.5.0

func (ref RefESExecutablePlugin) ExecES(ctx context.Context, qCtx *handler.Context) (earlyStop bool, err error)

type RefMatcherPlugin added in v1.5.0

type RefMatcherPlugin string

RefMatcherPlugin is a handler.MatcherPlugin reference tag.

func (RefMatcherPlugin) Match added in v1.5.0

func (ref RefMatcherPlugin) Match(ctx context.Context, qCtx *handler.Context) (matched bool, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL