utils

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGjsonNotFound  = errors.New("specified path does not exist")
	ErrGjsonWrongType = errors.New("wrong type")
)
View Source
var (
	HttpClientSkipTlsVerify *http.Client
	HttpClient              *http.Client
)
View Source
var (
	Json = jsoniter.ConfigCompatibleWithStandardLibrary

	DNSServers = []string{"1.1.1.1:53", "223.5.5.5:53"}
)

Functions

func GenerateRandomString

func GenerateRandomString(n int) (string, error)

func GjsonGet

func GjsonGet(json []byte, path string) (gjson.Result, error)

func GjsonParseStringMap

func GjsonParseStringMap(jsonObject string) (map[string]string, error)

func IPDesensitize

func IPDesensitize(ipAddr string) string

func IsFileExists

func IsFileExists(path string) bool

func IsWindows

func IsWindows() bool

func SplitIPAddr

func SplitIPAddr(v4v6Bundle string) (string, string, string)

SplitIPAddr 传入/分割的v4v6混合地址,返回v4和v6地址与有效地址

func Uint64SubInt64

func Uint64SubInt64(a uint64, b int64) uint64

Types

type HybridFS

type HybridFS struct {
	// contains filtered or unexported fields
}

HybridFS combines embed.FS and os.DirFS.

func NewHybridFS

func NewHybridFS(embed embed.FS, subDir string, localDir string) (*HybridFS, error)

func (*HybridFS) Open

func (hfs *HybridFS) Open(name string) (fs.File, error)

type RequestWrapper

type RequestWrapper struct {
	// contains filtered or unexported fields
}

func NewRequestWrapper

func NewRequestWrapper(req *http.Request, writer gin.ResponseWriter) (*RequestWrapper, error)

func (*RequestWrapper) Close

func (rw *RequestWrapper) Close() error

func (*RequestWrapper) Read

func (rw *RequestWrapper) Read(p []byte) (int, error)

func (*RequestWrapper) Write

func (rw *RequestWrapper) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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