clients

package
v0.0.0-...-dae8c3a Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MySQLServers = map[string]*gorm.DB{}

MySQLServers 服务器连接

View Source
var PgSQLServers = map[string]*gorm.DB{}

PgSQLServers 服务器连接

Functions

func GetMySQLBySite

func GetMySQLBySite(siteCode string) *gorm.DB

GetMySQLBySite 依据平台获取DB

func GetPgSQLBySite

func GetPgSQLBySite(siteCode string) *gorm.DB

GetPgSQLBySite 依据平台获取DB

func GetRedisBySite

func GetRedisBySite(siteCode string) *redis.Client

GetRedisBySite 依据平台获取DB

func MySQL

func MySQL(connStr string) (*gorm.DB, error)

MySQL 获取 mysql 连接 dsn := "user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local"

func MySQLSystem

func MySQLSystem() (*gorm.DB, error)

MySQLSystem 获取默认的 mysql 连接

func PgSQL

func PgSQL(connStr string) (*gorm.DB, error)

PgSQL 获取 postgres 连接 dsn := "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai"

func PgSQLSystem

func PgSQLSystem() (*gorm.DB, error)

PgSQLSystem 获取默认的 postgres 连接

func Redis

func Redis(connStr string) *redis.Client

Redis 获取 redis 连接

func RedisSystem

func RedisSystem() *redis.Client

RedisSystem 获取默认的 redis 连接

Types

This section is empty.

Jump to

Keyboard shortcuts

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