baseMySQL

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, wg *sync.WaitGroup, logger logrus.FieldLogger, dbCfg *Config) (*sqlx.DB, error)

New will return new mysql connection and will start ping goroutine to monitor connection state On ctx.Done() db object will be automatically closed

Types

type Config

type Config struct {
	Secret, Username, Host, Database string
	NoTLS                            bool
}

Config is used to pass connection settings to NewDatabase

type NullTime

type NullTime mysqlDrv.NullTime

NullTime is wrapper for mysql.NullTime Implements json.Marshaler and sql.Scanner

func (*NullTime) MarshalJSON

func (nt *NullTime) MarshalJSON() ([]byte, error)

MarshalJSON for NullTime

func (*NullTime) Scan added in v1.1.0

func (nt *NullTime) Scan(value interface{}) error

Scan implements the Scanner interface for NullTime

Jump to

Keyboard shortcuts

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