1 Star 0 Fork 0

nggs / micro

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.go 940 Bytes
一键复制 编辑 原始数据 按行查看 历史
李文建 提交于 2020-04-05 00:11 . 整合其他模块代码
package static_data
type IndexType int
const (
IndexTypeNot IndexType = iota // 不是索引
IndexTypeUnique // 唯一索引,值不可以重复
IndexTypeNormal // 普通索引,值可以重复
IndexNameNot = ""
IndexNameUnique = "unique"
IndexNameNormal = "normal"
)
// 索引类型到名字的映射
var gIndexName2Type = map[string]IndexType{
IndexNameNot: IndexTypeNot,
IndexNameUnique: IndexTypeUnique,
IndexNameNormal: IndexTypeNormal,
}
func IndexName2Type(i string) (o IndexType, ok bool) {
o, ok = gIndexName2Type[i]
return
}
// 索引类型到名字的映射
var gIndexType2Name = map[IndexType]string{
IndexTypeNot: IndexNameNot,
IndexTypeUnique: IndexNameUnique,
IndexTypeNormal: IndexNameNormal,
}
func IndexType2Name(i IndexType) (o string, ok bool) {
o, ok = gIndexType2Name[i]
return
}
func (i IndexType) String() string {
return gIndexType2Name[i]
}
Go
1
https://gitee.com/nggs/micro.git
git@gitee.com:nggs/micro.git
nggs
micro
micro
bac99dff65eb

搜索帮助

53164aa7 5694891 3bd8fe86 5694891