engine

package
v0.0.0-...-3d20527 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2019 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessRules

func ProcessRules(rules []Rule, state multistep.StateBag) []string

func Run

func Run(rule Rule, state multistep.StateBag)

func RunGroup

func RunGroup(group RulesGroup, state multistep.StateBag) []string

Types

type ActionStep

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

func (*ActionStep) Cleanup

func (s *ActionStep) Cleanup(multistep.StateBag)

func (*ActionStep) Run

type CommentsCondition

type CommentsCondition struct {
	Count string `mapstructure:"count,omitempty"`
}

func (*CommentsCondition) IsEmpty

func (c *CommentsCondition) IsEmpty() bool

func (*CommentsCondition) Match

func (c *CommentsCondition) Match(meta types.Data) bool

type Condition

type Condition struct {
	Order         int                  `mapstructure:"order,omitempty"`
	MatchKind     string               `mapstructure:"match-kind,omitempty"`
	IfLabeled     []string             `mapstructure:"if-labeled,omitempty"`
	SkipIfLabeled []string             `mapstructure:"skip-if-labeled,omitempty"`
	Files         FilesCondition       `mapstructure:"files,omitempty"`
	Title         TitleCondition       `mapstructure:"title,omitempty"`
	Description   DescriptionCondition `mapstructure:"description,omitempty"`
	Ref           RefCondition         `mapstructure:"ref,omitempty"`
	Comments      CommentsCondition    `mapstructure:"comments,omitempty"`
	Patch         PatchCondition       `mapstructure:"patch,omitempty"`
}

func (*Condition) Match

func (c *Condition) Match(meta types.Data) bool

type DescriptionCondition

type DescriptionCondition struct {
	StartsWith string   `mapstructure:"starts-with,omitempty"`
	EndsWith   string   `mapstructure:"ends-with,omitempty"`
	Patterns   []string `mapstructure:"patterns,omitempty"`
}

func (*DescriptionCondition) IsEmpty

func (c *DescriptionCondition) IsEmpty() bool

func (*DescriptionCondition) Match

func (c *DescriptionCondition) Match(meta types.Data) bool

type FilesCondition

type FilesCondition struct {
	Patterns   []string `mapstructure:"patterns,omitempty"`
	Extensions []string `mapstructure:"extensions,omitempty"`
}

func (*FilesCondition) IsEmpty

func (c *FilesCondition) IsEmpty() bool

func (*FilesCondition) Match

func (c *FilesCondition) Match(meta types.Data) bool

type PatchCondition

type PatchCondition struct {
	Hunk struct {
		StartsAt    int      `mapstructure:"starts-at,omitempty"`
		Patterns    []string `mapstructure:"patterns,omitempty"`
		NotPatterns []string `mapstructure:"not-patterns,omitempty"`
	} `mapstructure:"hunk,omitempty"`
}

func (*PatchCondition) IsEmpty

func (c *PatchCondition) IsEmpty() bool

func (*PatchCondition) Match

func (c *PatchCondition) Match(meta types.Data) bool

type RefCondition

type RefCondition struct {
	Equals   string   `mapstructure:"match,omitempty"`
	Patterns []string `mapstructure:"patterns,omitempty"`
}

func (*RefCondition) IsEmpty

func (c *RefCondition) IsEmpty() bool

func (*RefCondition) Match

func (c *RefCondition) Match(meta types.Data) bool

type Rule

type Rule interface {
	Name() string
	Order() int
	Accept(meta types.Data) bool
	Actions() []actions.Action
}

func NewRule

func NewRule(name string, config *viper.Viper) Rule

type RulesByConditionOrder

type RulesByConditionOrder []Rule

func (RulesByConditionOrder) Len

func (r RulesByConditionOrder) Len() int

func (RulesByConditionOrder) Less

func (r RulesByConditionOrder) Less(i, j int) bool

func (RulesByConditionOrder) Swap

func (r RulesByConditionOrder) Swap(i, j int)

type RulesGroup

type RulesGroup struct {
	Key   int
	Rules []Rule
}

func GroupByRuleOrder

func GroupByRuleOrder(rules []Rule) []RulesGroup

type TitleCondition

type TitleCondition struct {
	StartsWith string   `mapstructure:"starts-with,omitempty"`
	EndsWith   string   `mapstructure:"ends-with,omitempty"`
	Patterns   []string `mapstructure:"patterns,omitempty"`
}

func (*TitleCondition) IsEmpty

func (c *TitleCondition) IsEmpty() bool

func (*TitleCondition) Match

func (c *TitleCondition) Match(meta types.Data) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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