Documentation
¶
Index ¶
- func DeleteElemFromUint64Slice(i int, a []uint64) []uint64
- func DeleteElemOrderFromUint64Slice(i int, a []uint64) []uint64
- func GenShortId() (string, error)
- func GetAvatarUrl(key string) string
- func GetDate() string
- func GetDefaultAvatarUrl() string
- func GetQiNiuPublicAccessUrl(path string) string
- func GetReqID(c *gin.Context) string
- func GetShowTime(ts time.Time) string
- func GetStaticImageUrl(key string) string
- func GetTodayDateInt() int
- func Md5(str string) (string, error)
- func StringSliceContains(ss []string, s string) bool
- func StringSliceEqual(a, b []string) bool
- func StringSliceReflectEqual(a, b []string) bool
- func TimeLayout() string
- func TimeToShortString(ts time.Time) string
- func TimeToString(ts time.Time) string
- func Uint64ShuffleSlice(a []uint64) []uint64
- func Uint64SliceReverse(a []uint64) []uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteElemFromUint64Slice ¶
从slice删除元素 fast version, 会改变顺序 i:slice的索引值 a: slice
func DeleteElemOrderFromUint64Slice ¶
从slice删除元素 slow version, 保持原有顺序 i:slice的索引值 a: slice
func GenShortId ¶
func GetAvatarUrl ¶
user's avatar, if empty, use default avatar
func GetDefaultAvatarUrl ¶
func GetDefaultAvatarUrl() string
func GetQiNiuPublicAccessUrl ¶
获取七牛资源的公有链接 无需配置bucket, 域名会自动到域名所绑定的bucket去查找
func GetStaticImageUrl ¶
func StringSliceContains ¶
字符串切片中是否包含另一个字符串 来自go源码 net/http/server.go
func StringSliceReflectEqual ¶
判断 string slice 是否相等 因为使用了反射,所以效率较低,可以看benchmark结果
func TimeLayout ¶
func TimeLayout() string
func TimeToShortString ¶
func TimeToString ¶
func Uint64ShuffleSlice ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.