validate

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedLabels

type AllowedLabels struct {
	// contains filtered or unexported fields
}

AllowedLabels allows labels to be validated against a set of allowed labels. The zero value is ready to use and denies all labels.

func (*AllowedLabels) Add

func (l *AllowedLabels) Add(key, value string) error

Add adds a new allowed label. The key and value are anchored regular expressions. An error is returned if the regular expressions are invalid or the key is empty.

func (*AllowedLabels) String

func (l *AllowedLabels) String() string

func (*AllowedLabels) Validate

func (l *AllowedLabels) Validate(lbls map[string]string) error

Validate validates all labels against the allowed labels.

func (*AllowedLabels) ValidateLabel

func (l *AllowedLabels) ValidateLabel(key, value string) error

ValidateLabel validates a single label against the allowed labels.

Jump to

Keyboard shortcuts

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