executable_seq

package
Version: v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 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 BatchMatherAnd added in v1.8.5

type BatchMatherAnd []handler.Matcher

func (BatchMatherAnd) Match added in v1.8.5

func (bm BatchMatherAnd) Match(ctx context.Context, qCtx *handler.Context) (bool, error)

type BatchMatherOr added in v1.8.5

type BatchMatherOr []handler.Matcher

func (BatchMatherOr) Match added in v1.8.5

func (bm BatchMatherOr) Match(ctx context.Context, qCtx *handler.Context) (bool, error)

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)

ParseExecutableCmd parses in into a ExecutableCmd. in can be: a handler.Executable or a handler.ESExecutable or a string or a map[string]interface{}, which can be parsed to FallbackConfig, ParallelECSConfig or IfBlockConfig, or a slice of all of above.

type ExecutableCmdSequence

type ExecutableCmdSequence []ExecutableCmd

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.

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 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 {
	// Available type are string and handler.Matcher, or a slice of them.
	If interface{} `yaml:"if"`
	// Available type are string and handler.Matcher, or a slice of them.
	IfAnd interface{} `yaml:"if_and"`
	// See ParseExecutableCmd.
	Exec interface{} `yaml:"exec"`
}

IfBlockConfig is a config to build a IfBlock.

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