mysql

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.0.5

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

func NewClient added in v0.0.5

func NewClient(options ...Option) *Client

func (*Client) Close added in v0.0.5

func (c *Client) Close()

func (*Client) GetCtxDb added in v0.0.5

func (c *Client) GetCtxDb(ctx context.Context, dbName string) *gorm.DB

func (*Client) GetDb added in v0.0.5

func (c *Client) GetDb(dbName string) *gorm.DB

func (*Client) Ping added in v0.0.5

func (c *Client) Ping() []error

func (*Client) Stats added in v0.0.5

func (c *Client) Stats()

type ClientOptions added in v0.0.5

type ClientOptions struct{}

func (ClientOptions) WithConf added in v0.0.5

func (ClientOptions) WithConf(conf config.Config) Option

func (ClientOptions) WithDbConfig added in v0.0.5

func (ClientOptions) WithDbConfig(dbConfigs []DbConfig) Option

func (ClientOptions) WithGormConfig added in v0.1.6

func (ClientOptions) WithGormConfig(gormConfig *gorm.Config) Option

func (ClientOptions) WithLogger added in v0.0.5

func (ClientOptions) WithLogger(logger log.Logger) Option

func (ClientOptions) WithProxy added in v0.0.5

func (ClientOptions) WithProxy(proxys ...func() interface{}) Option

func (ClientOptions) WithStateTicker added in v0.0.5

func (ClientOptions) WithStateTicker(stateTicker time.Duration) Option

type ConnPool added in v0.1.6

type ConnPool interface {
	gorm.ConnPool

	SQLClose
}

type DbConfig

type DbConfig struct {
	Db          string `json:"db" yaml:"db"`
	Dsn         string `json:"dns" yaml:"dsn"`
	MaxIdle     int    `json:"max_idle" yaml:"maxidle"`
	MaxOpen     int    `json:"max_open" yaml:"maxopen"`
	MaxLifetime int    `json:"max_lifetime" yaml:"maxlifetime"`
}

type MonitorProxy added in v0.0.9

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

func NewMonitorProxy

func NewMonitorProxy(options ...MonitorProxyOption) *MonitorProxy

func (*MonitorProxy) Close added in v0.0.9

func (mp *MonitorProxy) Close() error

func (*MonitorProxy) ExecContext added in v0.1.6

func (mp *MonitorProxy) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*MonitorProxy) NextProxy added in v0.0.9

func (mp *MonitorProxy) NextProxy(db interface{})

Implement Proxy interface.

func (*MonitorProxy) PrepareContext added in v0.1.6

func (mp *MonitorProxy) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)

func (*MonitorProxy) ProxyName added in v0.0.9

func (mp *MonitorProxy) ProxyName() string

Implement Proxy interface.

func (*MonitorProxy) QueryContext added in v0.1.6

func (mp *MonitorProxy) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*MonitorProxy) QueryRowContext added in v0.1.6

func (mp *MonitorProxy) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row

type MonitorProxyOption

type MonitorProxyOption func(c *MonitorProxy)

type MonitorProxyOptions

type MonitorProxyOptions struct{}

func (MonitorProxyOptions) WithConf

func (MonitorProxyOptions) WithLogger

func (MonitorProxyOptions) WithLogger(logger log.Logger) MonitorProxyOption

func (MonitorProxyOptions) WithTracer

type Option

type Option func(c *Client)

type SQLClose added in v0.0.9

type SQLClose interface {
	Close() error
}

Jump to

Keyboard shortcuts

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