xdb

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 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 creates a gorm mysql database object with configuration, waits indefinitely if target database is not started

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 database configuration, can be directly referenced by main configuration

Jump to

Keyboard shortcuts

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