xdb

package module
v0.0.0-...-25f7f3c Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) *gorm.DB

New 用配置生成一个 gorm mysql 数据库对象,若目标数据库未启动会一直等待

func SetLogger

func SetLogger(logger *zap.SugaredLogger)

Types

type Config

type Config struct {
	Host     string `default:"mysql"`
	Port     string `default:"3306"`
	User     string `default:"root"`
	Password string `default:"root"`
	Name     string
	Lifetime int `default:"3000"`
}

Config 数据库配置,可以被主配置直接引用

Jump to

Keyboard shortcuts

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