mysql

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	//DSN        string
	Conf DBConfig
	// contains filtered or unexported fields
}

func NewDB

func NewDB(conf DBConfig, opts ...DBOption) (*DB, error)

func (*DB) ApplyOptions

func (o *DB) ApplyOptions(options ...DBOption) *DB

func (*DB) GetDatabase

func (d *DB) GetDatabase() (*sqlx.DB, error)

func (*DB) GetDatabaseUntil

func (d *DB) GetDatabaseUntil(maxWaitInterval time.Duration, failAfter time.Duration) (*sqlx.DB, error)

type DBConfig

type DBConfig struct {
	Address    string
	DataName   string
	UserName   string
	Password   string
	DriverName string
}

type DBOption

type DBOption interface {
	// contains filtered or unexported methods
}

A DBOption sets options.

type DBOptionFunc

type DBOptionFunc func(*DB)

DBOptionFunc wraps a function that modifies DB into an implementation of the DBOption interface.

type EmptyDBOption

type EmptyDBOption struct{}

EmptyDBUrlOption does not alter the DBuration. It can be embedded in another structure to build custom options.

This API is EXPERIMENTAL.

Jump to

Keyboard shortcuts

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