utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LoggingHttpTransport = &loghttp.Transport{
		LogRequest: func(req *http.Request) {
			log.Trace().Msgf("[%p] %s %s %v", req, req.Method, req.URL, req.Header)
		},
		LogResponse: func(resp *http.Response) {
			log.Trace().Msgf("[%p] %d %s", resp.Request, resp.StatusCode, resp.Request.URL)
		},
	}
)

Functions

func DNS1035Name

func DNS1035Name(input string) string

func DNS1035WithPrefix

func DNS1035WithPrefix(input string, prefix string) string

func DomainHash

func DomainHash(domain string) string

func DoneOrSleep

func DoneOrSleep(ctx context.Context, duration time.Duration) bool

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

func GenerateRandomString

func GenerateRandomString(s int) (string, error)

func Htpasswd

func Htpasswd(user, pass string) (string, error)

func IsEmailValid

func IsEmailValid(e string) bool

IsEmailValid checks if the email provided passes the required structure and length. https://golangcode.com/validate-an-email-address/

func K8SLabel

func K8SLabel(input string) string

func MakeHTTPS

func MakeHTTPS(url string) string

func MergeMap

func MergeMap(m1, m2 map[string]string) map[string]string

func ParseMemoryQuantityToGB

func ParseMemoryQuantityToGB(s string) (amount float32, err error)

func ReverseSlice

func ReverseSlice(s interface{})

func URLJoin

func URLJoin(base string, paths ...string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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