dbservice

package
v0.0.0-...-f612c76 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MysqlDB

type MysqlDB struct {
	Pool    *sql.DB // Mysql连接池
	DBValid bool    // Mysql是否可用
}

func (*MysqlDB) CheckHealth

func (mysqlDB *MysqlDB) CheckHealth()

定时检测数据库是否正常

func (*MysqlDB) Close

func (mysqlDB *MysqlDB) Close() error

func (*MysqlDB) Get

func (mysqlDB *MysqlDB) Get() (*sql.Conn, error)

func (*MysqlDB) InitPool

func (mysqlDB *MysqlDB) InitPool() error

func (*MysqlDB) Ping

func (mysqlDB *MysqlDB) Ping() (bool, error)

检测数据库连接

type RedisDB

type RedisDB struct {
	DBValid bool // Redis是否正常
	// contains filtered or unexported fields
}

func (*RedisDB) Get

func (redisDB *RedisDB) Get() redis.Conn

func (*RedisDB) IsDBRedisValid

func (redisDB *RedisDB) IsDBRedisValid() bool

Jump to

Keyboard shortcuts

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