Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 8 Imported by: 2

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 IsBase64Encoded added in v1.10.0

func IsBase64Encoded(s string) bool

IsBase64Encoded checks if the given string is a valid base64 encoded string.

func IsEverestObjectInUse

func IsEverestObjectInUse(obj client.Object) bool

IsEverestObjectInUse Checks whether the Everest object is in use. Returns true in case "everest.percona.com/in-use-protection" finalizer is present.

func IsEverestReadOnlyObject

func IsEverestReadOnlyObject(obj client.Object) bool

IsEverestReadOnlyObject Checks whether the Everest object is in use. Returns true in case "everest.percona.com/readonly-protection" finalizer is present.

func ValidateDNSName added in v1.10.0

func ValidateDNSName(dnsName string) []string

ValidateDNSName checks if the given string is a valid DNS name.

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.

Jump to

Keyboard shortcuts

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