workflow

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorkflow

func NewWorkflow(ctx context.Context, core adapter.Core, logger log.Logger, tag string, options WorkflowOptions) (adapter.Workflow, error)

Types

type Rule

type Rule interface {
	Check(ctx context.Context, core adapter.Core) error
	Exec(ctx context.Context, core adapter.Core, logger log.Logger, dnsCtx *adapter.DNSContext) (adapter.ReturnMode, error)
}

type RuleExec

type RuleExec struct {
	Execs []*RuleItemExec
}

func (*RuleExec) Check

func (r *RuleExec) Check(ctx context.Context, core adapter.Core) error

func (*RuleExec) Exec

func (r *RuleExec) Exec(ctx context.Context, core adapter.Core, logger log.Logger, dnsCtx *adapter.DNSContext) (adapter.ReturnMode, error)

func (*RuleExec) UnmarshalYAML

func (r *RuleExec) UnmarshalYAML(unmarshal func(any) error) error

type RuleExecOptions

type RuleExecOptions struct {
	Execs []yaml.Node `yaml:"exec,omitempty"`
}

type RuleItemExec

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

func (*RuleItemExec) UnmarshalYAML

func (r *RuleItemExec) UnmarshalYAML(unmarshal func(interface{}) error) error

type RuleItemExecOptions

type RuleItemExecOptions struct {
	Mark          yaml.Node `yaml:"mark,omitempty"`
	Metadata      yaml.Node `yaml:"metadata,omitempty"`
	Plugin        yaml.Node `yaml:"plugin,omitempty"`
	Upstream      yaml.Node `yaml:"upstream,omitempty"`
	JumpTo        yaml.Node `yaml:"jump-to,omitempty"`
	GoTo          yaml.Node `yaml:"go-to,omitempty"`
	WorkflowRules yaml.Node `yaml:"workflow-rules,omitempty"`
	Fallback      yaml.Node `yaml:"fallback,omitempty"`
	Parallel      yaml.Node `yaml:"parallel,omitempty"`
	SetTTL        yaml.Node `yaml:"set-ttl,omitempty"`
	SetRespIP     yaml.Node `yaml:"set-resp-ip,omitempty"`
	Clean         yaml.Node `yaml:"clean,omitempty"`
	Return        yaml.Node `yaml:"return,omitempty"`
}

type RuleItemMatch

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

func (*RuleItemMatch) UnmarshalYAML

func (r *RuleItemMatch) UnmarshalYAML(unmarshal func(interface{}) error) error

type RuleItemMatchOptions

type RuleItemMatchOptions struct {
	Listener   yaml.Node `yaml:"listener,omitempty"`
	ClientIP   yaml.Node `yaml:"client-ip,omitempty"`
	QType      yaml.Node `yaml:"qtype,omitempty"`
	QName      yaml.Node `yaml:"qname,omitempty"`
	HasRespMsg yaml.Node `yaml:"has-resp-msg,omitempty"`
	RespIP     yaml.Node `yaml:"resp-ip,omitempty"`
	Mark       yaml.Node `yaml:"mark,omitempty"`
	Env        yaml.Node `yaml:"env,omitempty"`
	Metadata   yaml.Node `yaml:"metadata,omitempty"`
	Plugin     yaml.Node `yaml:"plugin,omitempty"`
	MatchOr    yaml.Node `yaml:"match-or,omitempty"`
	MatchAnd   yaml.Node `yaml:"match-and,omitempty"`
	//
	Invert bool `yaml:"invert,omitempty"`
}

type RuleMatchAnd

type RuleMatchAnd struct {
	MatchAnds []*RuleItemMatch
	ElseExecs []*RuleItemExec
	Execs     []*RuleItemExec
}

func (*RuleMatchAnd) Check

func (r *RuleMatchAnd) Check(ctx context.Context, core adapter.Core) error

func (*RuleMatchAnd) Exec

func (r *RuleMatchAnd) Exec(ctx context.Context, core adapter.Core, logger log.Logger, dnsCtx *adapter.DNSContext) (adapter.ReturnMode, error)

func (*RuleMatchAnd) UnmarshalYAML

func (r *RuleMatchAnd) UnmarshalYAML(unmarshal func(any) error) error

type RuleMatchAndOptions

type RuleMatchAndOptions struct {
	MatchAnds []yaml.Node `yaml:"match-and,omitempty"`
	ElseExecs []yaml.Node `yaml:"else-exec,omitempty"`
	Execs     []yaml.Node `yaml:"exec,omitempty"`
}

type RuleMatchOr

type RuleMatchOr struct {
	MatchOrs  []*RuleItemMatch
	ElseExecs []*RuleItemExec
	Execs     []*RuleItemExec
}

func (*RuleMatchOr) Check

func (o *RuleMatchOr) Check(ctx context.Context, core adapter.Core) error

func (*RuleMatchOr) Exec

func (o *RuleMatchOr) Exec(ctx context.Context, core adapter.Core, logger log.Logger, dnsCtx *adapter.DNSContext) (adapter.ReturnMode, error)

func (*RuleMatchOr) UnmarshalYAML

func (r *RuleMatchOr) UnmarshalYAML(unmarshal func(any) error) error

type RuleMatchOrOptions

type RuleMatchOrOptions struct {
	MatchOrs  []yaml.Node `yaml:"match-or,omitempty"`
	ElseExecs []yaml.Node `yaml:"else-exec,omitempty"`
	Execs     []yaml.Node `yaml:"exec,omitempty"`
}

type RuleOptions

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

func (*RuleOptions) UnmarshalYAML

func (r *RuleOptions) UnmarshalYAML(unmarshal func(interface{}) error) error

type Workflow

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

func (*Workflow) Check

func (w *Workflow) Check() error

func (*Workflow) Exec

func (w *Workflow) Exec(ctx context.Context, dnsCtx *adapter.DNSContext) (adapter.ReturnMode, error)

func (*Workflow) Tag

func (w *Workflow) Tag() string

type WorkflowOptions

type WorkflowOptions struct {
	Tag   string                      `yaml:"tag"`
	Rules utils.Listable[RuleOptions] `yaml:"rules"`
}

Jump to

Keyboard shortcuts

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