utils

package
v0.0.0-...-51161bb Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyCloser

func CopyCloser(dst io.WriteCloser, src io.ReadCloser)

func CopyHeader

func CopyHeader(dst, src http.Header)

func DisableProxySettings

func DisableProxySettings() error

func Fallback

func Fallback[T comparable](value, nilValue, fallback T) T

func GenerateCertificate

func GenerateCertificate(host string, caKey any, caCert *x509.Certificate) (*tls.Certificate, error)

gen new certificate for host, derived by ca

func LoadCertificate

func LoadCertificate(host string, caKey any, caCert *x509.Certificate) (certPEM, keyPEM []byte, err error)

load certificate from local path

func LoadKeyCert

func LoadKeyCert(caKeyPath, caCertPath string) (caKey any, caCert *x509.Certificate, err error)

load key and cert by given path

func SetProxySettings

func SetProxySettings(proxyServer string) error

func StringFallback

func StringFallback(value, fallback 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