xgodbkv

package
v0.3.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause-Clear Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetId

func GetId(value string) uint

KV换取ID信息

value	待查询的信息

func GetValue

func GetValue(id uint) string

KV换取VALUE信息

id	待查询的ID值

func Regedit added in v0.0.17

func Regedit(c *Config)

注入配置项

Types

type Config

type Config struct {
	DB      *gorm.DB
	KVTable string // 配置表名称
	sync.Map
}

数据库相关配置

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关键词结构类型

func (*KeyValue) TableName

func (c *KeyValue) TableName() string

获取表名

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL