store

package
v3.6.5-1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnPool

type ConnPool struct {
	MaxOpenConns    int
	MaxIdleConns    int
	ConnMaxLifetime time.Duration
}

ConnPool contains database/sql settings for the connection pool.

type DataStore

type DataStore interface {
	String() string
	SetConnPool(configFile string) error
	GetConnPool() *ConnPool
	GetOpenConns() int
	Prepare(queryFile string) error
	NamedStmt(queryName string, obj interface{}) (*sqlx.NamedStmt, error)
	Exec(queryName string, arg interface{}) (int64, error)
	Read(queryName string, dest, arg interface{}) error
	Begin() (*sqlx.Tx, error)
	Close() error
}

func NewDataStore

func NewDataStore(driver, dsn string) (DataStore, error)

NewDataStore returns a DataStore interface.

func NewMysqlDataStore

func NewMysqlDataStore(configFile string) (DataStore, error)

NewmysqlDataStore creates a new instance of mysqlDataStore.

Jump to

Keyboard shortcuts

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