xgodb

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

README

xgodb模块说明

此模块为操作数据库的相关模块,依赖 gorm ,使用 MySQL 作为存储数据库

数据库说明

Documentation

Overview

数据库操作相关服务

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool

func GetBool(name string) bool

获取开关值

func GetFloat

func GetFloat(name string) float64

获取浮点数值

func GetInt

func GetInt(name string) int64

读取配置项的值

func GetSelect

func GetSelect(name string) string

获取select下拉列表

func GetString

func GetString(name string) string

获取string值的配置

func KvId added in v0.0.10

func KvId(val string) uint

KV换取ID信息

value	待查询的信息

func KvValue added in v0.0.10

func KvValue(id uint) string

KV换取VALUE信息

id	待查询的ID值

func Regedit

func Regedit(c *Config)

配置信息注册

func SetBool added in v0.0.3

func SetBool(name string, val bool) error

设置bool类型配置

name	配置项的名称
val		配置项的值

func SetFloat added in v0.0.3

func SetFloat(name string, val float64) error

设置float类型配置

name	配置项的名称
val		配置项的值

func SetInt added in v0.0.3

func SetInt(name string, val int64) error

设置int类型配置

name	配置项的名称
val		配置项的值

func SetLongText added in v0.0.3

func SetLongText(name, val string) error

设置longtext类型配置 下拉列表,多项使用,分割key和key_cn使用:分割

name	配置项的名称
val		配置项的值

func SetSelect added in v0.0.3

func SetSelect(name, val string) error

设置select类型配置 下拉列表,多项使用,分割key和key_cn使用:分割

name	配置项的名称
val		配置项的值

func SetString added in v0.0.3

func SetString(name, val string) error

设置string类型配置

name	配置项的名称
val		配置项的值

func SetText added in v0.0.3

func SetText(name, val string) error

设置text类型配置 下拉列表,多项使用,分割key和key_cn使用:分割

name	配置项的名称
val		配置项的值

Types

type Config

type Config struct {
	DB              *gorm.DB
	ConfigTable     string                  // 配置表名称
	ConfigUserTable string                  // 用户配置存储表
	KeyValue        string                  // key_value表存储名称
	ConfigEdit      func(name string) error // 配置项修改的回调函数
}

数据库相关配置

Directories

Path Synopsis
数据库配置的读写支持
数据库配置的读写支持

Jump to

Keyboard shortcuts

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