Documentation
¶
Index ¶
- func CompareStringList(x string, lst []string, cmp StrCmp) bool
- func CompareSubsetLength(lst1, lst2 []string, strict bool) bool
- func CompareSubsetList(lst1, lst2 []string, cmp StrCmp, strict bool) bool
- func ContainPermit(admission, permit int, strict bool) bool
- func EndStringList(x string, lst []string) bool
- func InStringList(x string, lst []string) bool
- func IsNoop(permit int) bool
- func IsSubsetList(lst1, lst2 []string, strict bool) bool
- func MatchString(a, b string, cmp StrCmp) bool
- func MatchStringList(x string, lst []string, cmp StrCmp) bool
- func SearchStringList(x string, lst []string, cmp StrCmp) bool
- func StartStringList(x string, lst []string) bool
- type Permit
- type SqlJoin
- type StrCmp
- type UserType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareSubsetLength ¶
比较两个列表的长度
func CompareSubsetList ¶
lst1 是否 lst2 的(真)子集
func ContainPermit ¶
func MatchStringList ¶
是否在字符串列表中,主要适用于 strcmp.Contains 和 strcmp.EndsWith
func SearchStringList ¶
是否在字符串列表中,仅适用于 strcmp.Equal 和 strcmp.StartsWith
Types ¶
type Permit ¶
type Permit int
const ( View Permit = 2 << iota // 查看详情 Draft // 草稿状态 Delete // 删除丢弃 Add // 新增添加 Edit // 编辑修改 Export // 导出下载 Noop Permit = 0 // 无操作 Batch Permit = 1 // 批量处理 )
操作列表
func PermitString ¶
PermitString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Permit) IsAPermit ¶
IsAPermit returns "true" if the value is listed in the enum definition. "false" otherwise
func (Permit) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Permit
func (*Permit) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Permit
type SqlJoin ¶
type SqlJoin int
const ( Join SqlJoin = iota InnerJoin OuterJoin CrossJoin LeftJoin SqlJoin = iota LeftInnerJoin LeftOuterJoin RightJoin SqlJoin = iota + 1 RightInnerJoin RightOuterJoin )
数据表联接
func SqlJoinString ¶
SqlJoinString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (SqlJoin) IsASqlJoin ¶
IsASqlJoin returns "true" if the value is listed in the enum definition. "false" otherwise
func (SqlJoin) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for SqlJoin
func (*SqlJoin) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for SqlJoin
type StrCmp ¶
type StrCmp int
const ( Omit StrCmp = iota // 不比较 Contains // 包含 StartsWith // 打头 EndsWith // 结尾 CaseInsensitive // 不分大小写 IgnoreSpaces // 忽略空格 Equal // 相等 )
字符串比较方式
func StrCmpString ¶
StrCmpString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (StrCmp) IsAStrCmp ¶
IsAStrCmp returns "true" if the value is listed in the enum definition. "false" otherwise
func (StrCmp) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for StrCmp
func (*StrCmp) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for StrCmp
type UserType ¶
type UserType int
const ( Anonymous UserType = iota // 匿名用户(未登录/未注册) Forbidden // 封禁用户(有违规被封号) Limited // 受限用户(未过审或被降级) Regular // 正常用户(正式会员) Super // 超级用户(后台管理权限) )
用户分类
func UserTypeString ¶
UserTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func UserTypeValues ¶
func UserTypeValues() []UserType
UserTypeValues returns all values of the enum
func (UserType) IsAUserType ¶
IsAUserType returns "true" if the value is listed in the enum definition. "false" otherwise
func (UserType) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for UserType
func (*UserType) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for UserType