Documentation ¶
Index ¶
- Variables
- func Any2json(data any, path ...string) gjson.Result
- func Base64Decode(val string) ([]byte, error)
- func Base64Encode[T string | []byte](val T) string
- func BytesToString(b []byte) string
- func Charset(content []byte, contentType string) ([]byte, string, error)
- func CopySlices[T any](value []T) []T
- func CopySlicess[T any](value [][]T) [][]T
- func CopyWitchContext(ctx context.Context, writer io.Writer, reader io.Reader) (err error)
- func Decode[T string | []byte](txt T, code string) T
- func GetCertData(cert *x509.Certificate) []byte
- func GetCertKeyData(key *ecdsa.PrivateKey) ([]byte, error)
- func GetCertWithCN(rootCert *x509.Certificate, key *ecdsa.PrivateKey, commonName string) (*x509.Certificate, error)
- func GetCertWithCert(rootCert *x509.Certificate, key *ecdsa.PrivateKey, preCert *x509.Certificate) (*x509.Certificate, error)
- func GetContentTypeWithBytes(content []byte) string
- func GetHosts(addrTypes ...int) []net.IP
- func GetProxyCertWithCert(preCert *x509.Certificate) (tlsCert tls.Certificate, err error)
- func GetProxyCertWithName(serverName string) (tlsCert tls.Certificate, err error)
- func GetServerName(addr string) string
- func GetTlsCert(cert *x509.Certificate, key *ecdsa.PrivateKey) (tls.Certificate, error)
- func Hex(val any) string
- func LoadCertData(data []byte) (*x509.Certificate, error)
- func LoadCertKeyData(data []byte) (*ecdsa.PrivateKey, error)
- func Md5[T string | []byte](val T) [16]byte
- func ParseHost(host string) (net.IP, int)
- func ParseIp(ip net.IP) int
- func Sha1[T string | []byte](val T) []byte
- func SplitHostPort(address string) (string, int, error)
- func StringToBytes(s string) []byte
- func UrlJoin(base, href string) (string, error)
- func WrapError(err error, val ...any) error
- func ZipDecode(ctx context.Context, r *bytes.Buffer, encoding string) (*bytes.Buffer, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var CrtFile []byte
View Source
var JsonConfig = jsoniter.Config{ EscapeHTML: true, CaseSensitive: true, }.Froze()
View Source
var KeyFile []byte
Rand 随机函数
Functions ¶
func CopySlices ¶
func CopySlices[T any](value []T) []T
func CopySlicess ¶
func CopySlicess[T any](value [][]T) [][]T
func CopyWitchContext ¶
func GetCertData ¶
func GetCertData(cert *x509.Certificate) []byte
func GetCertKeyData ¶
func GetCertKeyData(key *ecdsa.PrivateKey) ([]byte, error)
func GetCertWithCN ¶
func GetCertWithCN(rootCert *x509.Certificate, key *ecdsa.PrivateKey, commonName string) (*x509.Certificate, error)
func GetCertWithCert ¶
func GetCertWithCert(rootCert *x509.Certificate, key *ecdsa.PrivateKey, preCert *x509.Certificate) (*x509.Certificate, error)
func GetContentTypeWithBytes ¶
func GetProxyCertWithCert ¶
func GetProxyCertWithCert(preCert *x509.Certificate) (tlsCert tls.Certificate, err error)
func GetProxyCertWithName ¶
func GetProxyCertWithName(serverName string) (tlsCert tls.Certificate, err error)
func GetServerName ¶
func GetTlsCert ¶
func GetTlsCert(cert *x509.Certificate, key *ecdsa.PrivateKey) (tls.Certificate, error)
func LoadCertData ¶
func LoadCertData(data []byte) (*x509.Certificate, error)
func LoadCertKeyData ¶
func LoadCertKeyData(data []byte) (*ecdsa.PrivateKey, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.