Documentation
¶
Index ¶
- func All(vs []string, f func(string) bool) bool
- func Any(vs []string, f func(string) bool) bool
- func CamelCaseToSnakeCase(name string) string
- func ConvertToMySQLTableName(obj interface{}) string
- func ConvertToTableName(obj interface{}) string
- func Deref(t reflect.Type) reflect.Type
- func Filter(vs []string, f func(string) bool) []string
- func GetFirstDateOfMonth(d time.Time) time.Time
- func GetFirstDateOfYear(d time.Time) time.Time
- func GetID() int64
- func GetLastDateOfMonth(d time.Time) time.Time
- func GetLastDateOfYear(d time.Time) time.Time
- func GetZeroTime(d time.Time) time.Time
- func Include(vs []string, t string) bool
- func Index(vs []string, t string) int
- func Map(vs []string, f func(string) string) []string
- func MongoPipeline(str string) mongo.Pipeline
- func ToSlice(arr interface{}) []interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CamelCaseToSnakeCase ¶
CamelCaseToSnakeCase returns a snake case string from a camel case string.
func ConvertToMySQLTableName ¶
func ConvertToMySQLTableName(obj interface{}) string
ConvertToMySQLTableName convert the type name of a object to a table name. lower case
func ConvertToTableName ¶
func ConvertToTableName(obj interface{}) string
ConvertToTableName convert the type name of a object to a table name. lower case and plural format
func Filter ¶
Filter returns a new slice containing all strings in the slice that satisfy the predicate f.
func GetFirstDateOfMonth ¶
GetFirstDateOfMonth 获取传入的时间所在月份的第一天,即某月第一天的0点。如传入time.Now(), 返回当前月份的第一天0点时间。
func GetFirstDateOfYear ¶
GetFirstDateOfYear 获取传入的时间所在年份的第一天
func GetLastDateOfMonth ¶
GetLastDateOfMonth 获取传入的时间所在月份的最后一天,即某月最后一天的0点。如传入time.Now(), 返回当前月份的最后一天0点时间。
func GetLastDateOfYear ¶
GetLastDateOfYear 获取传入的时间所在年份的最后一天
func Map ¶
Map returns a new slice containing the results of applying the function f to each string in the original slice.
func MongoPipeline ¶
MongoPipeline gets aggregation pipeline from a string
Types ¶
This section is empty.