storage

package
v0.0.0-...-91c7ab2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DB_TYPE_MYSQL  = "mysql"
	DB_TYPE_SQLITE = "sqlite"
)

Variables

This section is empty.

Functions

func GetDB

func GetDB() *gorm.DB

func InitDB

func InitDB(conf Database)

Types

type Database

type Database struct {
	Type         string `toml:"type"`
	Sqlite       Sqlite `toml:"sqlite"`
	Mysql        Mysql  `toml:"mysql"`
	MaxOpenConns int    `toml:"max_open_conns"`
	MaxIdleConns int    `toml:"max_idle_conns"`
	MaxLiftTime  int64  `toml:"max_lift_time"`
}

type Mysql

type Mysql struct {
	UserName string `toml:"username"`
	Password string `toml:"passwd"`
	Address  string `toml:"address"`
	Port     int64  `toml:"port"`
	DataBase string `toml:"database"`
}

type Sqlite

type Sqlite struct {
	DbFile string `toml:"db_file"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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