utils

package
v0.1.67 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserNoProxyRE = regexp.MustCompile(`^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(3[0-2]|[1-2][0-9]|[0-9]))$|^(.?[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$|^""$`)

the following regex defines four different patterns: first pattern is to validate IPv4 address second,is for IPv4 CIDR range validation third pattern is to validate domains and the fourth petterrn is to be able to remove the existing no-proxy value by typing empty string (""). nolint

Functions

func HasDuplicates added in v0.1.65

func HasDuplicates(valSlice []string) (string, bool)

func IsURL

func IsURL(val interface{}) error

IsURL validates whether the given value is a valid URL

func MatchNoPorxyRE added in v0.1.65

func MatchNoPorxyRE(noProxyValues []string) error

func ValidateAdditionalTrustBundle

func ValidateAdditionalTrustBundle(val interface{}) error

func ValidateHTTPProxy

func ValidateHTTPProxy(val interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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