Documentation ¶
Index ¶
- Variables
- func BoolPtr(b bool) *bool
- func BytesToString(b []byte) string
- func CleanHTMLTag(htmlContent string) string
- func CompositeURL(urls ...string) string
- func CopyDir(srcPath, desPath string) error
- func CopyFile(src, des string) (written int64, err error)
- func FileIsExisted(filename string) bool
- func GenUUIDWithOutDash() string
- func GetClientIP(ctx context.Context) string
- func GetQueryBool(ctx *gin.Context, key string, defaultValue bool) (bool, error)
- func GetUserAgent(ctx context.Context) string
- func HTMLFormatWordCount(html string) int64
- func IfElse(condition bool, a, b interface{}) interface{}
- func Int32Ptr(i int32) *int32
- func Int64Ptr(i int64) *int64
- func MakeDir(dir string) error
- func MapKeyToArray[K comparable, V any](m map[K]V) []K
- func Md5Hex(str string) string
- func MustGetQueryBool(ctx *gin.Context, key string) (bool, error)
- func MustGetQueryInt(ctx *gin.Context, key string) (int, error)
- func MustGetQueryInt32(ctx *gin.Context, key string) (int32, error)
- func MustGetQueryInt64(ctx *gin.Context, key string) (int64, error)
- func MustGetQueryString(ctx *gin.Context, key string) (string, error)
- func ParamBool(ctx *gin.Context, key string) (bool, error)
- func ParamInt32(ctx *gin.Context, key string) (int32, error)
- func ParamInt64(ctx *gin.Context, key string) (int64, error)
- func ParamString(ctx *gin.Context, key string) (string, error)
- func RainbowPage(page, total, display int) []int
- func Slug(slug string) string
- func StringPtr(s string) *string
- func StringToBytes(s string) []byte
- func TimeFormat(totalSeconds int) string
- func TimePtr(t time.Time) *time.Time
- func Unzip(src string, dest string) ([]string, error)
- func ZipFile(dst string, srcs ...string) (err error)
- type CounterCache
- type Queue
Constants ¶
This section is empty.
Variables ¶
View Source
var Validate = validator.New()
Functions ¶
func BytesToString ¶
BytesToString converts byte slice to string without a memory allocation.
func CleanHTMLTag ¶ added in v1.0.7
func CompositeURL ¶
func FileIsExisted ¶
func GenUUIDWithOutDash ¶
func GenUUIDWithOutDash() string
func GetClientIP ¶
func GetQueryBool ¶
func GetUserAgent ¶
func HTMLFormatWordCount ¶ added in v1.0.7
func MapKeyToArray ¶
func MapKeyToArray[K comparable, V any](m map[K]V) []K
func RainbowPage ¶
func StringToBytes ¶
StringToBytes converts string to byte slice without a memory allocation.
func TimeFormat ¶
TimeFormat format time interval to human-readable
Types ¶
type CounterCache ¶
type CounterCache[K comparable] struct { // contains filtered or unexported fields }
func NewCounterCache ¶
func NewCounterCache[K comparable](refreshDuration time.Duration, batchIncr func(map[K]int64), singleIncr func(K, int64)) *CounterCache[K]
func (*CounterCache[K]) Get ¶
func (c *CounterCache[K]) Get(key K) int64
func (*CounterCache[K]) IncrBy ¶
func (c *CounterCache[K]) IncrBy(key K, value int64) int64
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
func NewQueueCap ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.