mysql

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDB

func GetDB(opts ...Option) (*gorm.DB, error)

Types

type MysqlComponent

type MysqlComponent struct {
	Host            string `toml:"host" json:"host"`
	Port            int    `toml:"port" json:"port"`
	User            string `toml:"user" json:"user"`
	Passwd          string `toml:"passwd" json:"passwd"`
	DbName          string `toml:"dbname" json:"dbname"`
	MaxIdleConns    int    `toml:"max_idle_conns" json:"max_idle_conns"`
	MaxOpenConns    int    `toml:"max_open_conns" json:"max_open_conns"`
	ConnMaxIdletime int    `toml:"conn_max_idletime" json:"conn_max_idletime"`
	ConnMaxLifetime int    `toml:"conn_max_lifetime" json:"conn_max_lifetime"`
	// contains filtered or unexported fields
}

func (*MysqlComponent) Init

func (mc *MysqlComponent) Init(ctx context.Context) error

func (*MysqlComponent) IsReady

func (mc *MysqlComponent) IsReady()

func (*MysqlComponent) Name

func (mc *MysqlComponent) Name() string

func (*MysqlComponent) Ready

func (mc *MysqlComponent) Ready() bool

type Option

type Option func(*MysqlComponent)

func SetConfig

func SetConfig(cfg toybox.ConfigMate) Option

func SetName

func SetName(name string) Option

Jump to

Keyboard shortcuts

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