policy

package
v0.0.0-...-478d272 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type Numerical struct {
	Order string
}

Numerical representes a Numerical ordering policy

func NewNumerical

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

NewNumerical constructs a Numerical object validating the provided order argument

func (*Numerical) Latest

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

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

RegexFilter represents a regular expression filter

func NewRegexFilter

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

NewRegexFilter constructs new RegexFilter object

func (*RegexFilter) Apply

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

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

func (*RegexFilter) GetOriginalTag

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

GetOriginalTag returns the original tag before replace extraction

func (*RegexFilter) Items

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