Documentation ¶
Index ¶
- Variables
- func BinaryToIPString(b []byte) string
- func ConvertSeq[T, U any](seq iter.Seq[T], f func(e T) U) iter.Seq[U]
- func GenerateRandomString(n int) (string, error)
- func GetIPFromHeader(headerValue string) (string, error)
- func GjsonGet(json []byte, path string) (gjson.Result, error)
- func GjsonIter(json string) (iter.Seq2[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 MapValuesToSlice[Map ~map[K]V, K comparable, V any](m Map) []V
- func SplitIPAddr(v4v6Bundle string) (string, string, string)
- func Uint64SubInt64(a uint64, b int64) uint64
- func Unique[T comparable](s []T) []T
- type GinCustomWriter
- 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 ConvertSeq ¶ added in v1.5.8
func GenerateRandomString ¶
func GetIPFromHeader ¶
func IPDesensitize ¶
func IPStringToBinary ¶
func IsFileExists ¶
func Itoa ¶
func Itoa[T constraints.Integer](i T) string
func MapValuesToSlice ¶ added in v1.4.0
func MapValuesToSlice[Map ~map[K]V, K comparable, V any](m Map) []V
func SplitIPAddr ¶
SplitIPAddr 传入/分割的v4v6混合地址,返回v4和v6地址与有效地址
func Uint64SubInt64 ¶
func Unique ¶ added in v1.4.0
func Unique[T comparable](s []T) []T
Types ¶
type GinCustomWriter ¶ added in v1.5.10
type GinCustomWriter struct { gin.ResponseWriter // contains filtered or unexported fields }
func NewGinCustomWriter ¶ added in v1.5.10
func NewGinCustomWriter(c *gin.Context, code int) *GinCustomWriter
func (*GinCustomWriter) WriteHeader ¶ added in v1.5.10
func (w *GinCustomWriter) WriteHeader(code int)
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.