Documentation ¶
Index ¶
- Variables
- func GetEndTimeOfToday() time.Time
- func GetFirstDateOfMonth() time.Time
- func GetFirstDateOfWeek() time.Time
- func GetStartTimeOfToday() time.Time
- func IsZeroOfUnderlyingType(x interface{}) bool
- func ListStringToInterface(t []string) []interface{}
- func MBuildFkUnwind(collection, localField, remoteField, remark string) []bson.D
- func MBuildFkUnwindOfEmptyReturn(collection, localField, remoteField, remark string) []bson.D
- func MBuilderFk(collection, localField, remoteField, remark string) bson.D
- func MGen2dSphere(k string) mongo.IndexModel
- func MGenNormal(k string) mongo.IndexModel
- func MGenUnique(k string, sparse bool) mongo.IndexModel
- func MTN(instance interface{}) string
- func MUserFk(local, remark string) bson.D
- func MUserInfoFk(localField ...string) []bson.D
- func NewFST(name string) funcTime
- func RandomInt(start, end int) int
- func RandomStr(n int) string
- func RangeRandomIntSet(start int64, end int64, count int64) []int64
- func RemoveDuplicatesUnordered(elements []string) []string
- func RetryFunc(f func() error, maxRetryCount uint, interval time.Duration) error
- func STN(modelName string) string
- func SaveSliceToFiles(filePath string, values []interface{}, headers ...string) error
- func StrToB58(s string) string
- func StrToB62(s string) string
- func StrToInt(s string) int64
- func StructCopy(origin, newData interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxRetrySmallError = errors.New("重试次数需要大于1")
Functions ¶
func GetEndTimeOfToday ¶ added in v0.1.5
GetEndTimeOfToday 获取今日23点59分59秒
func GetFirstDateOfMonth ¶ added in v0.1.5
GetFirstDateOfMonth 获取本月第一天0点
func GetFirstDateOfWeek ¶ added in v0.1.5
GetFirstDateOfWeek 获取本周周一0点
func GetStartTimeOfToday ¶ added in v0.1.5
GetStartTimeOfToday 获取今日0点
func IsZeroOfUnderlyingType ¶
func IsZeroOfUnderlyingType(x interface{}) bool
func ListStringToInterface ¶
func ListStringToInterface(t []string) []interface{}
func MBuildFkUnwind ¶ added in v0.1.7
MBuildFkUnwind 构建通用解构外键
func MBuildFkUnwindOfEmptyReturn ¶ added in v0.1.8
MBuildFkUnwindOfEmptyReturn preserveNullAndEmptyArrays 默认为false 不存在时则不返回 文档 https://docs.mongodb.com/manual/reference/operator/aggregation/unwind/
func MBuilderFk ¶ added in v0.1.7
MBuilderFk 构建通用外键
func MGen2dSphere ¶ added in v0.1.4
func MGen2dSphere(k string) mongo.IndexModel
MGen2dSphere mongo 生成2dSphere索引
func MGenNormal ¶ added in v0.1.4
func MGenNormal(k string) mongo.IndexModel
MGenNormal mongo 生成普通索引
func MGenUnique ¶ added in v0.1.4
func MGenUnique(k string, sparse bool) mongo.IndexModel
MGenUnique mongo 生成唯一索引
func MTN ¶ added in v0.1.4
func MTN(instance interface{}) string
MTN 模型获取表名 使用 instanceToTableName 方法
func MUserInfoFk ¶ added in v0.1.7
func RangeRandomIntSet ¶
RangeRandomIntSet 范围随机正整数但不重复
func RemoveDuplicatesUnordered ¶
RemoveDuplicatesUnordered 删除重复字符串但不保证排序
func SaveSliceToFiles ¶ added in v0.1.4
func StructCopy ¶
func StructCopy(origin, newData interface{}) error
StructCopy 相同名称的struct field 进行copy
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.