Documentation
¶
Index ¶
- func DefaultLimit(limit int) int
- func JSONToMarkdown(data interface{}) (string, error)
- func ValidateRegex(fl validator.FieldLevel) bool
- type Filter
- type FilterOperator
- type QueryOption
- func WithArchived(archived int64) QueryOption
- func WithCode(code string) QueryOption
- func WithFilters(filters ...Filter) QueryOption
- func WithId(id int64) QueryOption
- func WithMcId(mcId int64) QueryOption
- func WithName(name string) QueryOption
- func WithPhone(phone string) QueryOption
- func WithStatus(status int64) QueryOption
- func WithTitle(title string) QueryOption
- func WithType(t int64) QueryOption
- func WithUserId(uid int64) QueryOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONToMarkdown ¶
JSONToMarkdown 把任意对象序列化为 JSON 字符串,并包裹 ```json 标记
func ValidateRegex ¶
func ValidateRegex(fl validator.FieldLevel) bool
ValidateRegex 自定义正则验证函数(标签为"customRegex")
Types ¶
type Filter ¶
type Filter struct {
Field string
Value interface{}
Operator FilterOperator
}
Filter 定义过滤器结构体
type FilterOperator ¶
type FilterOperator string
FilterOperator 定义过滤器操作符类型
const ( OpEqual FilterOperator = "=" OpLike FilterOperator = "LIKE" OpGt FilterOperator = ">" OpLt FilterOperator = "<" OpGte FilterOperator = ">=" OpLte FilterOperator = "<=" OpIn FilterOperator = "IN" OpNotIn FilterOperator = "NOT IN" )
type QueryOption ¶
QueryOption 定义查询选项函数类型
func WithArchived ¶
func WithArchived(archived int64) QueryOption
func WithCode ¶
func WithCode(code string) QueryOption
func WithMcId ¶
func WithMcId(mcId int64) QueryOption
func WithName ¶
func WithName(name string) QueryOption
func WithStatus ¶
func WithStatus(status int64) QueryOption
func WithTitle ¶
func WithTitle(title string) QueryOption
func WithType ¶
func WithType(t int64) QueryOption
func WithUserId ¶
func WithUserId(uid int64) QueryOption
Click to show internal directories.
Click to hide internal directories.