db

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnConfig

type ConnConfig struct {
	Host   string `json:"host"`
	Port   string `json:"port"`
	User   string `json:"user,omitempty"`
	Pwd    string `json:"pwd"`
	DBName string `json:"db,omitempty"`
}

type MySQLConfig

type MySQLConfig struct {
	MaxOpenNum     int                            `json:"max_open_num"`
	MaxIdleNum     int                            `json:"max_idle_num"`
	RequestTimeout int                            `json:"request_timeout"`
	Charset        string                         `json:"charset"`
	DebuggerLog    bool                           `json:"debugger_log"`
	DBMap          map[string]MySQLDateBaseConfig `json:"db"`
}

type MySQLDateBaseConfig

type MySQLDateBaseConfig struct {
	Master ConnConfig   `json:"master"`
	Slave  []ConnConfig `json:"slave"`
}

type MysqlService

type MysqlService struct {
	// contains filtered or unexported fields
}

func (*MysqlService) GetDB

func (s *MysqlService) GetDB(dbName string) (*xorm.EngineGroup, error)

func (*MysqlService) Init

func (s *MysqlService) Init()

func (*MysqlService) Run

type RedisConfig

type RedisConfig struct {
	MinIdleNum int                   `json:"min_idle_num"`
	PoolSize   int                   `json:"pool_size"`
	DBMap      map[string]ConnConfig `json:"db"`
}

type RedisService

type RedisService struct {
	// contains filtered or unexported fields
}

func (*RedisService) GetDB

func (s *RedisService) GetDB(dbName string) (*redis.Client, error)

func (*RedisService) Init

func (s *RedisService) Init()

func (*RedisService) Run

Jump to

Keyboard shortcuts

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