storage

package
v5.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB
View Source
var Redis *redis.Client

Functions

func InitDB

func InitDB(cfg DBConfig) error

func InitRedis

func InitRedis(cfg RedisConfig) (func(), error)

Types

type DBConfig

type DBConfig struct {
	Gorm     Gorm
	MySQL    MySQL
	Postgres Postgres
}

type Gorm

type Gorm struct {
	Debug             bool
	DBType            string
	MaxLifetime       int
	MaxOpenConns      int
	MaxIdleConns      int
	TablePrefix       string
	EnableAutoMigrate bool
}

type MySQL

type MySQL struct {
	Address    string
	User       string
	Password   string
	DBName     string
	Parameters string
}

func (MySQL) DSN

func (a MySQL) DSN() string

type Postgres

type Postgres struct {
	Address  string
	User     string
	Password string
	DBName   string
	SSLMode  string
}

func (Postgres) DSN

func (a Postgres) DSN() string

type RedisConfig

type RedisConfig struct {
	Address  string
	Password string
	DB       int
}

Jump to

Keyboard shortcuts

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