imagepattern

package
v0.8.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 3 Imported by: ? 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

This section is empty.

Variables

This section is empty.

Functions

func IsImagePattern

func IsImagePattern(image string) bool

func NewMatcher

func NewMatcher(pattern string) (*regexp.Regexp, []namedMatchingGroup, error)

NewMatcher returns a Regexp that can be used to match an image or image tag against a pattern. The supplied pattern is NOT a regex. It is acorn's own custom syntax with the following characteristics: - Assumed to be valid docker tag characters: 0-9A-Za-z_.- - Outside of the special matching/sorting groups, a tag must match the pattern exactly - There are three special matching/sorting groups: #, *, and ** - ** indicates a portion of the tag doesn't need to match the pattern and won't be considered for sorting. It is the "wildcard" - * indicates a portion of the tag that will be matched and sorted alphabetically - # indicates a portion of the tag that will be matched and sorted numerically

Here are a few simple examples of patterns and what they would match: - "v#.#" - Matches: "v1.0", "v2.0" (return as latest). Doesn't match: "v1.alpha", "1.0", "v1.0.0" - "v1.0-*" - Matches: "v1.0-alpha", "v1.0-beta" (returned as latest). Doesn't match: "v1.0" - "v1.#-**" - Matches: "v1.0-cv23jkha", "v1.1-2020-01-01" (returned as latest).

Types

This section is empty.

Jump to

Keyboard shortcuts

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