Versions in this module Expand all Collapse all v0 v0.0.1 Aug 25, 2023 Changes in this version + var ErrBadImageReference = errors.New("bad image reference") + var ErrWrongRuleType = errors.New("wrong rule type") + func NewImageInspector() *imageInspector + func ParseImageReference(imageRef string) (string, string) + type Engine struct + func NewEngine(repo *repo.Repo, inspector ImageInspector, rules []Rule) (*Engine, error) + func NewEngineFromFile(repo *repo.Repo, inspector ImageInspector, file string) (*Engine, error) + func (e Engine) GetRules() []Rule + func (e Engine) Mutate(_ context.Context, imageRef string) (string, []string) + func (e Engine) Validate(ctx context.Context, imageRef string) (bool, string) + type ImageInspector interface + GetDigest func(context.Context, string) (string, error) + type MutationRule struct + NewRegistry string + Registry string + RegistryRegexp *regexp.Regexp + Type MutationType + func (r MutationRule) Mutate(domain string) (string, bool) + type MutationType string + const MutationTypeDefaultRegistry + const MutationTypeRewriteRegistry + type Rule struct + MutationRule MutationRule + Name string + ValidationRule ValidationRule + type Rules struct + Rules []Rule + type ValidateType string + const ValidateTypeLatest + const ValidateTypeLock + const ValidateTypeRollingTag + const ValidateTypeSemVer + type ValidationRule struct + Allow bool + ImageName string + ImageNameRegexp *regexp.Regexp + ImageTag string + ImageTagSemVer *semver.Constraints + RollingTagAfter time.Time + Type ValidateType + func (r ValidationRule) Match(ctx context.Context, repo *repo.Repo, inspector ImageInspector, ...) bool