wrappers

package
v0.0.0-...-a011022 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedis

func NewRedis(host string, port int) *redis.Client

NewRedis creates a new redis object

Types

type MySQL

type MySQL struct {
	// contains filtered or unexported fields
}

MySQL represents the mysql wrapper object

func NewMySQL

func NewMySQL(sock, host string, port int, user, pass, base string) *MySQL

NewMySQL creates a new mysql object

func (*MySQL) Close

func (my *MySQL) Close()

Close closes a database connection

func (*MySQL) Exec

func (my *MySQL) Exec(cb func(db *sql.DB) (sql.Result, error)) (sql.Result, error)

Exec executes a stmt callback and manages the open/close of the db link

func (*MySQL) Open

func (my *MySQL) Open() (link *sql.DB, err error)

Open opens a new database connection

func (*MySQL) Query

func (my *MySQL) Query(cb func(db *sql.DB) (*sql.Rows, error)) (*sql.Rows, error)

Query executes a query callback and manages the open/close of the db link

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

Redis represents the actual redis wrapper object

Jump to

Keyboard shortcuts

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