config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config holds the configuration schema for image replacement rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Exclude []ExclusionRule   `json:"exclude"`
	Replace []ReplacementRule `json:"replace"`
}

Config represents the schema of the webhook's configuration.

func Load

func Load(path string) (*Config, error)

Load loads the configuration for the webhook from the given path.

func (*Config) Validate added in v0.0.2

func (c *Config) Validate() error

Validate validates the configuration.

type ExclusionRule

type ExclusionRule struct {
	Prefix string `json:"prefix"`
}

ExclusionRule represents a rule for an image prefix that should explicitly be excluded from any replacements.

func (*ExclusionRule) Validate added in v0.0.2

func (r *ExclusionRule) Validate() error

Validate validates the exclusion rule.

type ReplacementRule

type ReplacementRule struct {
	Prefix      string `json:"prefix"`
	Replacement string `json:"replacement"`
}

ReplacementRule represents a rule that matches an image prefix and replaces it with the provided replacement.

func (*ReplacementRule) Validate added in v0.0.2

func (r *ReplacementRule) Validate() error

Validate validates the replacement rule.

Jump to

Keyboard shortcuts

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