utils

package
v1.7.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNameNotRFC1035Compatible appears when some of the provided names are not RFC1035 compatible.
	ErrNameNotRFC1035Compatible = func(fieldName string) error {
		return fmt.Errorf(`'%s' is not RFC 1035 compatible. The name should contain only lowercase alphanumeric characters or '-', start with an alphabetic character, end with an alphanumeric character`,
			fieldName,
		)
	}

	// ErrNameTooLong when the given fieldName is too long.
	ErrNameTooLong = func(fieldName string) error {
		return fmt.Errorf("'%s' can be at most 22 characters long", fieldName)
	}
)

Functions

func ValidateEverestResourceName

func ValidateEverestResourceName(s, name string) error

ValidateEverestResourceName names to be RFC-1035 compatible https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#rfc-1035-label-names. It has an additional limitation at most 22 characters.

func ValidateRFC1035

func ValidateRFC1035(s, name string) error

ValidateRFC1035 names to be RFC-1035 compatible https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#rfc-1035-label-names

func ValidateURL

func ValidateURL(urlStr string) bool

ValidateURL checks if the given string is a valid URL.

Types

This section is empty.

Directories

Path Synopsis
Package must provides a function to panic if an error is not nil.
Package must provides a function to panic if an error is not nil.

Jump to

Keyboard shortcuts

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