Help us shape the future of Go! Take the 2026 Go Developer Survey

policy

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AlphabeticalOrderAsc ascending order
	AlphabeticalOrderAsc = "ASC"
	// AlphabeticalOrderDesc descending order
	AlphabeticalOrderDesc = "DESC"
)
View Source
const (
	// NumericalOrderAsc ascending order
	NumericalOrderAsc = "ASC"
	// NumericalOrderDesc descending order
	NumericalOrderDesc = "DESC"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alphabetical

type Alphabetical struct {
	Order string
}

Alphabetical representes a alphabetical ordering policy

func NewAlphabetical

func NewAlphabetical(order string) (*Alphabetical, error)

NewAlphabetical constructs a Alphabetical object validating the provided order argument

func (*Alphabetical) Latest

func (p *Alphabetical) Latest(versions []string) (string, error)

Latest returns latest version from a provided list of strings

type Numerical added in v0.6.0

type Numerical struct {
	Order string
}

Numerical representes a Numerical ordering policy

func NewNumerical added in v0.6.0

func NewNumerical(order string) (*Numerical, error)

NewNumerical constructs a Numerical object validating the provided order argument

func (*Numerical) Latest added in v0.6.0

func (p *Numerical) Latest(versions []string) (string, error)

Latest returns latest version from a provided list of strings

type Policer

type Policer interface {
	Latest([]string) (string, error)
}

Policer is an interface representing a policy implementation type

func PolicerFromSpec

func PolicerFromSpec(choice imagev1.ImagePolicyChoice) (Policer, error)

PolicerFromSpec constructs a new policy object based on

type RegexFilter added in v0.2.0

type RegexFilter struct {
	Regexp  *regexp.Regexp
	Replace string
	// contains filtered or unexported fields
}

RegexFilter represents a regular expression filter

func NewRegexFilter added in v0.2.0

func NewRegexFilter(pattern string, replace string) (*RegexFilter, error)

NewRegexFilter constructs new RegexFilter object

func (*RegexFilter) Apply added in v0.2.0

func (f *RegexFilter) Apply(list []string)

Apply will construct the filtered list of tags based on the provided list of tags

func (*RegexFilter) GetOriginalTag added in v0.2.0

func (f *RegexFilter) GetOriginalTag(tag string) string

GetOriginalTag returns the original tag before replace extraction

func (*RegexFilter) Items added in v0.2.0

func (f *RegexFilter) Items() []string

Items returns the list of filtered tags

type SemVer

type SemVer struct {
	Range string
	// contains filtered or unexported fields
}

SemVer representes a SemVer policy

func NewSemVer

func NewSemVer(r string) (*SemVer, error)

NewSemVer constructs a SemVer object validating the provided semver constraint

func (*SemVer) Latest

func (p *SemVer) Latest(versions []string) (string, error)

Latest returns latest version from a provided list of strings

Jump to

Keyboard shortcuts

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