Documentation
¶
Index ¶
- func ByteToStringView(b []byte, maxLen int) string
- func Bytes2Size(num int64) string
- func Contains[T comparable](value T, slice []T) bool
- func ContainsString(s string, keywords []string) bool
- func Decimal(value float64, decimalPlace int) float64
- func DifferenceSets[T comparable](set1, set2 map[T]bool) (diff1, diff2 []T)
- func EscapeMarkdownText(text string) string
- func Filter[T any](arr []T, f func(T) bool) []T
- func GenerateKey() string
- func GenerateTradeNo() string
- func GetGinValue[T any](c *gin.Context, key string) (T, bool)
- func GetIp() (ip string)
- func GetLocalTimezone() string
- func GetModelsWithMatch(modelList *[]string, modelName string) string
- func GetOrDefault[T any](env string, defaultValue T) T
- func GetPointer[T any](val T) *T
- func GetRandomInt(length int) int
- func GetRandomString(length int) string
- func GetTimeString() string
- func GetTimestamp() int64
- func GetUUID() string
- func GetUnixTime() int64
- func IntMax(a int, b int) int
- func Interface2String(inter interface{}) string
- func IsFileExist(path string) bool
- func IsIpInCidr(ip string, cidr string) bool
- func Marshal[T interface{}](data T) string
- func Max(a int, b int) int
- func MessageWithRequestId(message string, id string) string
- func NumClamp(value, minVal, maxVal float64) float64
- func OpenBrowser(url string)
- func ProxyFunc(req *http.Request) (*url.URL, error)
- func RequestBuilder(ctx context.Context, method string, url string, body any, header http.Header) (req *http.Request, err error)
- func Seconds2Time(num int) (time string)
- func SetProxy(proxyAddr string, ctx context.Context) context.Context
- func SliceToMap[T comparable](slice []T) map[T]bool
- func Socks5ProxyFunc(ctx context.Context, network, addr string) (net.Conn, error)
- func String2Int(str string) int
- func String2Int64(str string) int64
- func UnescapeHTML(x string) interface{}
- func UnmarshalString[T interface{}](data string) (form T, err error)
- type ContextKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteToStringView ¶ added in v0.5.3
func Bytes2Size ¶
func Contains ¶
func Contains[T comparable](value T, slice []T) bool
func ContainsString ¶
func DifferenceSets ¶
func DifferenceSets[T comparable](set1, set2 map[T]bool) (diff1, diff2 []T)
func EscapeMarkdownText ¶
func GenerateKey ¶
func GenerateKey() string
func GenerateTradeNo ¶
func GenerateTradeNo() string
func GetLocalTimezone ¶
func GetLocalTimezone() string
func GetModelsWithMatch ¶
func GetOrDefault ¶
func GetPointer ¶
func GetPointer[T any](val T) *T
func GetRandomInt ¶
func GetRandomString ¶
func GetTimeString ¶
func GetTimeString() string
func GetTimestamp ¶
func GetTimestamp() int64
func GetUnixTime ¶
func GetUnixTime() int64
func Interface2String ¶
func Interface2String(inter interface{}) string
func IsFileExist ¶
func MessageWithRequestId ¶
func OpenBrowser ¶
func OpenBrowser(url string)
func RequestBuilder ¶
func Seconds2Time ¶
func SliceToMap ¶
func SliceToMap[T comparable](slice []T) map[T]bool
func Socks5ProxyFunc ¶
func String2Int ¶
func String2Int64 ¶
func UnescapeHTML ¶
func UnescapeHTML(x string) interface{}
func UnmarshalString ¶
Types ¶
type ContextKey ¶
type ContextKey string
const ProxyAddrKey ContextKey = "proxyAddr"
const ProxyHTTPAddrKey ContextKey = "proxyHttpAddr"
const ProxySock5AddrKey ContextKey = "proxySock5Addr"
Click to show internal directories.
Click to hide internal directories.