mysql

package
v0.0.0-...-61829c1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBGetter

type DBGetter interface {
	Get() *gorm.DB
}

type DBTable

type DBTable struct {
	Name string
	// contains filtered or unexported fields
}

func NewDBTable

func NewDBTable() *DBTable

func (*DBTable) AutoMigrate

func (dbTable *DBTable) AutoMigrate(db *gorm.DB) (err error)

func (*DBTable) Register

func (dbTable *DBTable) Register(model Model)

func (*DBTable) SetName

func (dbTable *DBTable) SetName(name string)

type Model

type Model interface {
	TableName() string
}

type MySQL

type MySQL struct {
	Name            string
	Host            string `conf:"upstream" validate:"@hostname"`
	Port            int
	User            string           `conf:"env" validate:"@string[1,)"`
	Password        presets.Password `conf:"env" validate:"@string[1,)"`
	Extra           string
	PoolSize        int
	ConnMaxLifetime time.Duration
	presets.Retry
	// contains filtered or unexported fields
}

func (*MySQL) Connect

func (m *MySQL) Connect() error

func (MySQL) DockerDefaults

func (m MySQL) DockerDefaults() conf.DockerDefaults

func (*MySQL) Get

func (m *MySQL) Get() *gorm.DB

func (MySQL) GetConnect

func (m MySQL) GetConnect() string

func (*MySQL) Init

func (m *MySQL) Init()

func (MySQL) MarshalDefaults

func (m MySQL) MarshalDefaults(v interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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