goo_db

package
v1.1.183 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(configs ...Config) (err error)

Types

type Client

type Client struct {
	*xorm.EngineGroup
}

func Default added in v1.1.39

func Default() *Client

func GetClient added in v1.1.39

func GetClient(names ...string) *Client

func New added in v1.1.1

func New(conf Config) (cli *Client, err error)

type Config

type Config struct {
	Name        string   `yaml:"name" json:"name"`
	Driver      string   `yaml:"driver" json:"driver"`
	Master      string   `yaml:"master" json:"master"`
	Slaves      []string `yaml:"slaves" json:"slaves"`
	MaxIdle     int      `yaml:"max_idle" json:"max_idle"`
	MaxOpen     int      `yaml:"max_open" json:"max_open"`
	MaxLifetime int      `yaml:"max_lifetime" json:"max_lifetime"` // 最大生命周期,单位秒
	AutoPing    bool     `yaml:"auto_ping" json:"auto_ping"`
	LogModel    bool     `yaml:"log_model" json:"log_model"`
	LogFilepath string   `yaml:"log_filepath" json:"log_filepath"`
}

Jump to

Keyboard shortcuts

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