database

package
v0.0.0-...-a671794 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnector

func NewConnector(config Config) (driver.Connector, error)

NewConnector returns a new database connector for the application.

func SetLogger

func SetLogger(logger logur.Logger)

SetLogger configures the global database logger.

Types

type Config

type Config struct {
	Host string
	Port int
	User string
	Pass string
	Name string

	Params map[string]string
}

Config holds information necessary for connecting to a database.

func (Config) DSN

func (c Config) DSN() string

DSN returns a MySQL driver compatible data source name.

func (Config) Validate

func (c Config) Validate() error

Validate checks that the configuration is valid.

Jump to

Keyboard shortcuts

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