constraint

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constraints

type Constraints struct {
	Ref         List
	Repo        List
	Instance    List
	Platform    List
	Environment List
	Event       List
	Branch      List
	Status      List
	Matrix      Map
	Local       types.BoolTrue
	Path        Path
}

Constraints defines a set of runtime constraints.

func (*Constraints) Match

func (c *Constraints) Match(metadata frontend.Metadata) bool

Match returns true if all constraints match the given input. If a single constraint fails a false value is returned.

type List

type List struct {
	Include []string
	Exclude []string
}

List defines a runtime constraint for exclude & include string slices.

func (*List) Excludes

func (c *List) Excludes(v string) bool

Excludes returns true if the string matches the exclude patterns.

func (*List) Includes

func (c *List) Includes(v string) bool

Includes returns true if the string matches the include patterns.

func (*List) Match

func (c *List) Match(v string) bool

Match returns true if the string matches the include patterns and does not match any of the exclude patterns.

func (*List) UnmarshalYAML

func (c *List) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML unmarshals the constraint.

type Map

type Map struct {
	Include map[string]string
	Exclude map[string]string
}

Map defines a runtime constraint for exclude & include map strings.

func (*Map) Match

func (c *Map) Match(params map[string]string) bool

Match returns true if the params matches the include key values and does not match any of the exclude key values.

func (*Map) UnmarshalYAML

func (c *Map) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals the constraint map.

type Path

type Path struct {
	Include       []string
	Exclude       []string
	IgnoreMessage string `yaml:"ignore_message,omitempty"`
}

Path defines a runtime constrain for exclude & include paths.

func (*Path) Excludes

func (c *Path) Excludes(v []string) bool

Excludes returns true if the string matches any of the exclude patterns.

func (*Path) Includes

func (c *Path) Includes(v []string) bool

Includes returns true if the string matches any of the include patterns.

func (*Path) Match

func (c *Path) Match(v []string, message string) bool

Match returns true if file paths in string slice matches the include and not exclude patterns

or if commit message contains ignore message.

func (*Path) UnmarshalYAML

func (c *Path) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML unmarshals the constraint.

Jump to

Keyboard shortcuts

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