util

package
v7.0.0-...-1c7ecba Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCert

func GenerateCert(ipaddr string) ([]byte, []byte, error)

https://golang.org/src/crypto/tls/generate_cert.go as a function

func GetCertPool

func GetCertPool(paths []string) (*x509.CertPool, error)

func IsEndpointAllowed

func IsEndpointAllowed(endpoint *url.URL, allowedDomains []string) bool

IsEndpointAllowed checks whether the endpoint URL is allowed based on an allowed domains list.

func RemoveDuplicateStr

func RemoveDuplicateStr(strSlice []string) []string

RemoveDuplicateStr removes duplicates from a slice of strings.

func SplitHostPort

func SplitHostPort(hostport string) (host, port string)

SplitHostPort separates host and port. If the port is not valid, it returns the entire input as host, and it doesn't check the validity of the host. Unlike net.SplitHostPort, but per RFC 3986, it requires ports to be numeric. *** taken from net/url, modified validOptionalPort() to accept ":*"

Types

This section is empty.

Jump to

Keyboard shortcuts

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