Documentation ¶
Index ¶
- Variables
- func BinaryToIPString(b []byte) string
- func Compare[T constraints.Ordered](x, y T) int
- func GenerateRandomString(n int) (string, error)
- func GetIPFromHeader(headerValue string) (string, error)
- func GjsonGet(json []byte, path string) (gjson.Result, error)
- func GjsonParseStringMap(jsonObject string) (map[string]string, error)
- func IPDesensitize(ipAddr string) string
- func IPStringToBinary(ip string) ([]byte, error)
- func IfOr[T any](a bool, x, y T) T
- func IfOrFn[T any](a bool, x, y func() T) T
- func IsFileExists(path string) bool
- func Itoa[T constraints.Integer](i T) string
- func SplitIPAddr(v4v6Bundle string) (string, string, string)
- func Uint64SubInt64(a uint64, b int64) uint64
- type RequestWrapper
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 BinaryToIPString ¶
func Compare ¶
func Compare[T constraints.Ordered](x, y T) int
Compare returns
-1 if x is less than y, 0 if x equals y, +1 if x is greater than y.
For floating-point types, a NaN is considered less than any non-NaN, a NaN is considered equal to a NaN, and -0.0 is equal to 0.0.
func GenerateRandomString ¶
func GetIPFromHeader ¶
func IPDesensitize ¶
func IPStringToBinary ¶
func IsFileExists ¶
func Itoa ¶
func Itoa[T constraints.Integer](i T) string
func SplitIPAddr ¶
SplitIPAddr 传入/分割的v4v6混合地址,返回v4和v6地址与有效地址
func Uint64SubInt64 ¶
Types ¶
type RequestWrapper ¶
type RequestWrapper struct {
// contains filtered or unexported fields
}
func NewRequestWrapper ¶
func NewRequestWrapper(req *http.Request, writer http.ResponseWriter) (*RequestWrapper, error)
func (*RequestWrapper) Close ¶
func (rw *RequestWrapper) Close() error
Click to show internal directories.
Click to hide internal directories.