mysql

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMySQL

type ConfigMySQL struct {
	DB []Item `yaml:"mysql"`
}

type Item

type Item struct {
	Name    string        `yaml:"name"`
	Host    string        `yaml:"host"`
	Port    int           `yaml:"port"`
	Schema  string        `yaml:"schema"`
	User    string        `yaml:"user"`
	Passwd  string        `yaml:"passwd"`
	MaxIdle int           `yaml:"idle"`
	MaxOpen int           `yaml:"open"`
	TTL     time.Duration `yaml:"ttl"`
}

type MySQL

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

func New

func New(cfg *ConfigMySQL) *MySQL

func (*MySQL) Down

func (db *MySQL) Down() error

func (*MySQL) Get

func (db *MySQL) Get(name string) (*conn, error)

func (*MySQL) Up

func (db *MySQL) Up() error

Jump to

Keyboard shortcuts

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