database

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sqlx.DB
View Source
var (
	ErrRowsAffectedZero = errors.New("rows affected is zero")
)
View Source
var Redis *redis.Client

Functions

func ConnectMySQL

func ConnectMySQL() (err error)

func ConnectPG

func ConnectPG() (err error)

func ConnectRedis

func ConnectRedis() error

func NewTransaction

func NewTransaction(ctx context.Context, fn func(ctx context.Context, tx *sqlx.Tx) error) (err error)

Types

type DSN

type DSN struct {
	Host     string
	Port     int
	User     string
	Password string
	DBName   string
}

Jump to

Keyboard shortcuts

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