validation

package
v1.2.16 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: MIT Imports: 13 Imported by: 1

Documentation

Overview

Package validation provides core type validation functionality

Index

Constants

This section is empty.

Variables

View Source
var IsDigest = validation.By(checkIsDigest)

IsDigest makes sure the digest.Digest is a validly formatted digest

View Source
var IsMediaType = validation.By(checkIsMediaType)

IsMediaType checkes to make sure it in the correct format of a media type

View Source
var IsPortablePath = validation.By(checkIsPortablePath)

IsPortablePath makes sure it is a portable path

View Source
var IsRelativePath = validation.By(checkIsRelativePath)

IsRelativePath makes sure it is a relative path

View Source
var KubernetesAnnotations = validation.By(func(value any) error {
	return apivalidation.ValidateAnnotations(value.(map[string]string), field.NewPath("")).ToAggregate()
})

KubernetesAnnotations ensures that the keys and values conform to the Kubernetes rules for annotations

View Source
var KubernetesLabels = validation.By(func(value any) error {
	return v1validation.ValidateLabels(value.(map[string]string), field.NewPath("")).ToAggregate()
})

KubernetesLabels ensures that the labels keys and value conform to the Kubernetes rules for labels

View Source
var NoTrailingSlash = validation.By(checkNoTrailingSlash)

NoTrailingSlash makes sure the has no trailing slash

View Source
var TrailingSlash = validation.By(checkTrailingSlash)

TrailingSlash makes sure the has a trailing slash

View Source
var TrailingSlashInPart = validation.WithContext(checkTrailingSlashWithContext)

TrailingSlashInPart ensure the trailing slash is there iff the part is a archive part based on the manifest in the context

Functions

func ContextWithManifest

func ContextWithManifest(ctx context.Context, manifest *ocispec.Manifest) context.Context

ContextWithManifest addes the provides manifest to the context (for validation purposes)

func ManifestFromContext

func ManifestFromContext(ctx context.Context) *ocispec.Manifest

ManifestFromContext returns the database instance customized for this request

func ValidateManifest

func ValidateManifest(m ocispec.Manifest) error

ValidateManifest validates a bottle Manifest for correctness

Types

This section is empty.

Jump to

Keyboard shortcuts

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