Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetInteface ¶ added in v0.3.14
func SetInteface(inf Interfaces)
设置外部数据源
inf 实现Interfaces接口的外部数据源
Types ¶
type Config ¶
type Config struct { DB *gorm.DB KVTable string // 配置表名称 sync.Map // contains filtered or unexported fields }
数据库相关配置
type Interfaces ¶ added in v0.3.14
type Interfaces interface { GetId(value string) uint // 根据字符串获取ID值 GetValue(id uint) string // 根据ID值获取字符串 }
使用外部数据源的接口
type KeyValue ¶
type KeyValue struct { Id uint `gorm:"column:id;primaryKey;type:BIGINT UNSIGNED;not null;autoIncrement" json:"id" form:"id"` Fid uint `` //上级分类编号(数据分析时使用) /* 139-byte string literal not displayed */ Value string `gorm:"column:value;type:varchar(200);unique;comment:对应的值" json:"value" form:"value"` //对应的值 CreatedAt string `gorm:"column:created_at;type:datetime;comment:创建时间" json:"created_at" form:"created_at"` }
KV关键词结构类型
Click to show internal directories.
Click to hide internal directories.