condition

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlwaysTrueCondition

type AlwaysTrueCondition struct{}

AlwaysTrueCondition is a condition that allways evaluates to true.

func NewAlwaysTrueCondition

func NewAlwaysTrueCondition() *AlwaysTrueCondition

NewAlwaysTrueCondition creates a new condition that allways evaluates to true.

func (*AlwaysTrueCondition) Evaluate

func (c *AlwaysTrueCondition) Evaluate(ctx context.Context) (bool, error)

Evaluate evaluates the condition.

type Condition

type Condition interface {
	// Evaluate evaluates the condition.
	Evaluate(ctx context.Context) (bool, error)
}

Condition is a condition that can be evaluated.

type NegatedCondition

type NegatedCondition struct {
	Condition
}

NegatedCondition is a condition that negates another condition.

func NewNegatedCondition

func NewNegatedCondition(cond Condition) *NegatedCondition

NewNegatedCondition creates a new condition that negates the given condition.

func (*NegatedCondition) Evaluate

func (c *NegatedCondition) Evaluate(ctx context.Context) (bool, error)

Evaluate evaluates the condition.

type TemplateCondition

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

TemplateCondition is a condition that evaluates a template.

func NewTemplateCondition

func NewTemplateCondition(condition string) *TemplateCondition

NewTemplateCondition creates a new condition that evaluates a template.

func (*TemplateCondition) Evaluate

func (c *TemplateCondition) Evaluate(ctx context.Context) (bool, error)

Evaluate evaluates the condition.

Jump to

Keyboard shortcuts

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