connect

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMysqlConnect

func GetMysqlConnect(cfg *MysqlConfig) *gorm.DB

GetMysqlConnect 获取新的数据库连接

func GetMysqlConnectSingle

func GetMysqlConnectSingle(cfg *MysqlConfig) *gorm.DB

GetMysqlConnectSingle 获取同一个数据库连接

func NewRedisDao

func NewRedisDao(options *RedisDao) *redis.Client

NewRedisDao 连接池

func NewRedisDaoSingleton

func NewRedisDaoSingleton(options *RedisDao) *redis.Client

NewRedisDaoSingleton 获取同一个redis连接

Types

type MysqlConfig

type MysqlConfig struct {
	User     string
	Password string
	Addr     string
	Port     uint
	DBName   string
	Charset  string
	Debug    bool
}

MysqlConfig 数据库配置类型

type RedisDao

type RedisDao struct {
	Addr     string
	Port     int
	Password string
	DB       int
}

RedisDao redis connect

Jump to

Keyboard shortcuts

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