dbs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MongoDB *mongo.Client
View Source
var MysqlDB *sql.DB
View Source
var RedisDB redis.UniversalClient

Functions

This section is empty.

Types

type DBs

type DBs struct {
	MySQL *MySQL `yaml:",omitempty"`
	Mongo *Mongo `yaml:",omitempty"`
	Redis *Redis `yaml:",omitempty"`
}

func Defaults

func Defaults(dbs *DBs) (*DBs, error)

Defaults dbs

type Mongo

type Mongo struct {
	Schema      string `json:",omitempty"`
	MaxPoolSize uint64 `json:",omitempty"`
	MinPoolSize uint64 `json:",omitempty"`
}

Mongo mongodb setup

type MySQL

type MySQL struct {
	Schema      string `json:",omitempty"`
	MaxPoolSize int    `json:",omitempty"`
	MinPoolSize int    `json:",omitempty"`
}

MySQL mysql setup

type Redis

type Redis struct {
	Addrs       []string `json:",omitempty"`
	MaxPoolSize int      `json:",omitempty"`
	MinPoolSize int      `json:",omitempty"`

	// zero val is valid
	Username string
	Password string
	DB       int
}

Redis redis setup

Jump to

Keyboard shortcuts

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