util

package
v7.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCert added in v7.2.0

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, useSystemPool bool) (*x509.CertPool, error)

func IsEndpointAllowed added in v7.3.0

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

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

func RemoveDuplicateStr added in v7.4.0

func RemoveDuplicateStr(strSlice []string) []string

RemoveDuplicateStr removes duplicates from a slice of strings.

func SplitHostPort added in v7.3.0

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