label

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance string

Instance is a label instance.

const (
	// Presubmit indicates that the test should be run as part of a presubmit run.
	Presubmit Instance = "presubmit"

	// Postsubmit indicates that the test should be run as part of a postsubmit run.
	Postsubmit Instance = "postsubmit"
)

type Selector

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

Selector is a Set of label filter expressions that get applied together to decide whether tests should be selected for execution or not.

func NewSelector

func NewSelector(present []Instance, absent []Instance) Selector

func ParseSelector

func ParseSelector(s string) (Selector, error)

func (*Selector) Excludes

func (f *Selector) Excludes(inputs Set) bool

Excludes returns false, if the given set of labels, even combined with new ones, could end up satisfying the Selector. It returns false, if Matches would never return true, even if new labels are added to the input set.

func (*Selector) Selects

func (f *Selector) Selects(inputs Set) bool

Selects returns true, if the given label set satisfies the Selector.

func (Selector) String

func (f Selector) String() string

type Set

type Set map[Instance]struct{}

Set is a set of labels

func NewSet

func NewSet(labels ...Instance) Set

NewSet returns a new label set.

func (Set) Add

func (l Set) Add(labels ...Instance) Set

Add adds the given labels and returns a new, combined set

func (Set) All

func (l Set) All() []Instance

All returns all labels in this set.

func (Set) Clone

func (l Set) Clone() Set

Clone this set of labels

func (Set) Merge

func (l Set) Merge(s Set) Set

Merge returns a set that is merging of l and s.

Jump to

Keyboard shortcuts

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