validation

package
v0.0.0-...-de93ea6 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DomainName

func DomainName(v string, acceptTrailingDot bool) error

DomainName checks if the given string is a valid domain name.

func Host

func Host(host string) error

Host validates if host is a valid IP address or subdomain in DNS (RFC 1123).

func IPAddressOrCIDR

func IPAddressOrCIDR(ip string) error

IPAddressOrCIDR validates ip as being a valid IP or CIDR (IPv4/IPv6)

func MergeCertificateData

func MergeCertificateData(addlData, systemData []byte) ([]*x509.Certificate, error)

MergeCertificateData merges certificates, if any, from adlData and systemData, returning the merged certificates as a slice of *x509.Certificate.

func Port

func Port(port int) error

Port validates if port is a valid port number between 1-65535.

func Subdomain

func Subdomain(v string) error

Subdomain checks if the given string is a valid subdomain name.

func TrustBundleConfigMap

func TrustBundleConfigMap(cfgMap *corev1.ConfigMap, caDataKey string) ([]*x509.Certificate, []byte, error)

TrustBundleConfigMap validates that ConfigMap contains a trust bundle named <caDataKey> and it contains one or more valid PEM encoded certificates, returning a byte slice of <caDataKey> contents upon success.

func URI

func URI(uri string) (string, error)

URI validates uri as being a http(s) valid url and returns the url scheme.

Types

This section is empty.

Jump to

Keyboard shortcuts

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