validate

package
v0.8.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: AGPL-3.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	StoreUnit = 1024

	KByte = 1 * StoreUnit
	MByte = KByte * StoreUnit
	GByte = MByte * StoreUnit
	TByte = GByte * StoreUnit
	PByte = TByte * StoreUnit
	EByte = PByte * StoreUnit
	ZByte = EByte * StoreUnit
	YByte = ZByte * StoreUnit
)
View Source
const (
	Millisecond = time.Duration(1)
	Second      = 1000 * Millisecond
	Minute      = 60 * Second
	Hour        = 60 * Minute
	Day         = 24 * Hour
)

Variables

This section is empty.

Functions

func CueValidate

func CueValidate(cueTpl string) error

CueValidate validates cue file

func LoadConfigObjectFromContent

func LoadConfigObjectFromContent(cfgType appsv1alpha1.CfgFileFormat, rawData string) (map[string]interface{}, error)

func ValidateConfigurationWithCue

func ValidateConfigurationWithCue(cueString string, cfgType appsv1alpha1.CfgFileFormat, rawData string) error

Types

type ConfigValidator

type ConfigValidator interface {
	Validate(data map[string]string) error
}

func NewConfigValidator

func NewConfigValidator(configConstraint *appsv1alpha1.ConfigConstraintSpec, options ...ValidatorOptions) ConfigValidator

type CueType

type CueType string

CueType defines cue type +enum

const (
	NullableType            CueType = "nullable"
	FloatType               CueType = "float"
	IntType                 CueType = "integer"
	BoolType                CueType = "boolean"
	StringType              CueType = "string"
	StructType              CueType = "object"
	ListType                CueType = "array"
	K8SQuantityType         CueType = "quantity"
	ClassicStorageType      CueType = "storage"
	ClassicTimeDurationType CueType = "timeDuration"
)

type CueWalkVisitor

type CueWalkVisitor interface {
	Visit(val cue.Value)
}

type ValidatorOptions

type ValidatorOptions = func(key string) bool

func WithKeySelector

func WithKeySelector(keys []string) ValidatorOptions

Jump to

Keyboard shortcuts

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