mysql

package
v0.0.0-...-72724d7 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NewYKKSM is an alias for the global YKKSM sql driver structure
	NewYKKSM = drivers.NewYKKSM
	// NewYKVal is an alias for the global YKVal sql driver structure
	NewYKVal = drivers.NewYKVal
	// NewYKAuth is an alias for the global YKAuth sql driver structure
	NewYKAuth = drivers.NewYKAuth
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     int
	Name     string
	User     string
	Password string
	TLS      bool
}

Config is the structure containing the information to create a mysql connection using roster

func (Config) Addr

func (c Config) Addr() string

Addr returns a connect string passed to the sql.Open command

func (Config) Connect

func (c Config) Connect(logger zerolog.Logger) (*sql.DB, error)

Connect use the configuration to initialize a sql.DB connection with MySQL

func (Config) IsSet

func (c Config) IsSet() bool

IsSet is a check to ensure config is properly set up

func (Config) String

func (c Config) String() string

String is a representation of the connection string with password obfuscated

type LoggerFunc

type LoggerFunc func(v ...interface{})

LoggerFunc is here to catch errors and pipe them to our logger https://github.com/go-sql-driver/mysql/blob/749ddf1598b47e3cd909414bda735fe790ef3d30/errors.go#L43

func (LoggerFunc) Print

func (lf LoggerFunc) Print(v ...interface{})

Print wraps a function to implement Logger interface

Jump to

Keyboard shortcuts

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