db

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMysql

func NewMysql(c *Conf) (*gorm.DB, error)

func NewRedis

func NewRedis(c *Conf) *redis.Client

Types

type Conf

type Conf struct {
	Redis struct {
		Addr         string
		PassWord     string
		Db           int
		PoolSize     int
		MaxRetries   int
		MinIdleConns int
	}
	MySQL struct {
		Addr           string
		UserName       string
		PassWord       string
		Database       string
		MinIdleConns   int
		MaxOpenConns   int
		ConMaxLeftTime int
	}
}

func NewDBConfig

func NewDBConfig() (config *Conf)

type DBManage

type DBManage struct {
	Rdb *redis.Client
	Mdb *gorm.DB
}

Jump to

Keyboard shortcuts

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