Documentation ¶
Index ¶
- Variables
- func AesDecode(val string, key []byte) ([]byte, error)
- func AesEncode(val []byte, key []byte) (string, error)
- func Any2json(data any) (gjson.Result, error)
- func Any2struct(data any, stru any) error
- func Base64Decode(val string) ([]byte, error)
- func Base64Encode[T string | []byte](val T) string
- func BytesToString(b []byte) string
- func Charset(content []byte, content_type string) ([]byte, string, error)
- func CompressionBrDecode(ctx context.Context, r *bytes.Buffer) (*bytes.Buffer, error)
- func CompressionDecode(ctx context.Context, r *bytes.Buffer, encoding string) (*bytes.Buffer, error)
- func CompressionDeflateDecode(ctx context.Context, r *bytes.Buffer) (*bytes.Buffer, error)
- func CompressionGzipDecode(ctx context.Context, r *bytes.Buffer) (*bytes.Buffer, error)
- func CompressionZlibDecode(ctx context.Context, r *bytes.Buffer) (*bytes.Buffer, 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.ReadCloser) (err error)
- func CreateCertKey() (*ecdsa.PrivateKey, error)
- func CreateCertWithCert(rootCert *x509.Certificate, key *ecdsa.PrivateKey, preCert *x509.Certificate) (*x509.Certificate, error)
- func CreateProxyCertWithCert(crt *x509.Certificate, key *ecdsa.PrivateKey, preCert *x509.Certificate) (tlsCert tls.Certificate, err error)
- func CreateProxyCertWithName(serverName string) (tlsCert tls.Certificate, err error)
- func CreateRootCert(key *ecdsa.PrivateKey) (*x509.Certificate, error)
- func Decode[T string | []byte](txt T, code string) T
- func DecodeRead(txt io.Reader, code string) io.Reader
- func DelSliceIndex[T any](val []T, indexs ...int) []T
- func FreePort() (int, error)
- 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 GetContentTypeWithBytes(content []byte) string
- func GetDefaultDir() (string, error)
- func GetHost(addrTypes ...int) net.IP
- func GetHosts(addrTypes ...int) []net.IP
- func GetServerName(addr string) string
- func GetTime(txt string, desc ...bool) string
- func GetTlsCert(cert *x509.Certificate, key *ecdsa.PrivateKey) (tls.Certificate, error)
- func GetTrack(point0, point1 [2]float64, point_nums float64) [][2]float64
- func Hex(val any) string
- func HmacSha1[T string | []byte](val, key T) []byte
- func ImgDiffer(c, c2 []byte) (float64, error)
- func JsonMarshal(data any) ([]byte, error)
- func JsonUnMarshal(data []byte, v any) error
- func LoadCertData(data []byte) (*x509.Certificate, error)
- func LoadCertKeyData(data []byte) (*ecdsa.PrivateKey, error)
- func Md5[T string | []byte](val T) [16]byte
- func Merge(c1 any, c2 any)
- func MkDir(path string) error
- func NaoId(l ...int) string
- func NaoIdWithStr(val string, l ...int) string
- func ParseHost(host string) (net.IP, int)
- func ParseIp(ip net.IP) int
- func PathEscape(txt string) string
- func PathExist(path string) bool
- func PathJoin(elem ...string) string
- func PathUnescape(txt string) (string, error)
- func QueryEscape(txt string) string
- func QueryUnescape(txt string) (string, error)
- func RanFloat64(val, val2 int64) float64
- func RanInt(val, val2 int) int
- func RanInt64(val, val2 int64) int64
- func Sha1[T string | []byte](val T) []byte
- func Signal(preCtx context.Context, fun func())
- func SplitHostPort(address string) (string, int, error)
- func StringToBytes(s string) []byte
- func UrlJoin(base, href string) (string, error)
- func Uuid() uuid.UUID
- func WrapError(err error, val ...any) error
- type BonId
Constants ¶
This section is empty.
Variables ¶
View Source
var CrtFile []byte
View Source
var KeyFile []byte
随机函数
Functions ¶
func CompressionBrDecode ¶
压缩解码
func CompressionDecode ¶
func CompressionDecode(ctx context.Context, r *bytes.Buffer, encoding string) (*bytes.Buffer, error)
压缩解码
func CompressionGzipDecode ¶
func CompressionZlibDecode ¶
func CopySlices ¶
func CopySlices[T any](value []T) []T
func CopySlicess ¶
func CopySlicess[T any](value [][]T) [][]T
func CopyWitchContext ¶
func CreateCertWithCert ¶
func CreateCertWithCert(rootCert *x509.Certificate, key *ecdsa.PrivateKey, preCert *x509.Certificate) (*x509.Certificate, error)
func CreateProxyCertWithCert ¶
func CreateProxyCertWithCert(crt *x509.Certificate, key *ecdsa.PrivateKey, preCert *x509.Certificate) (tlsCert tls.Certificate, err error)
func CreateProxyCertWithName ¶
func CreateProxyCertWithName(serverName string) (tlsCert tls.Certificate, err error)
func DelSliceIndex ¶
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 GetContentTypeWithBytes ¶
func GetServerName ¶
func GetTlsCert ¶
func GetTlsCert(cert *x509.Certificate, key *ecdsa.PrivateKey) (tls.Certificate, error)
func GetTrack ¶
:param point0: 起点 :param point1: 终点 :param control_point: 控制点 :param point_nums: 生成曲线坐标点的数量.数量越多图越凹凸不平,越少越平滑
func JsonMarshal ¶
func JsonUnMarshal ¶
func LoadCertData ¶
func LoadCertData(data []byte) (*x509.Certificate, error)
func LoadCertKeyData ¶
func LoadCertKeyData(data []byte) (*ecdsa.PrivateKey, error)
func RanFloat64 ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.