mysql

package
v5.9.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_CONNECT_TIMEOUT = 10 * time.Second
	DEFAULT_READ_TIMEOUT    = 10 * time.Second
	DEFAULT_WRITE_TIMEOUT   = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(config *Config, logger golog.ILogger) (*Client, error)

func (*Client) Begin

func (this *Client) Begin() error

func (*Client) Closed

func (this *Client) Closed() bool

func (*Client) Commit

func (this *Client) Commit() error

func (*Client) Exec

func (this *Client) Exec(query string, args ...interface{}) (sql.Result, error)

func (*Client) Free

func (this *Client) Free()

func (*Client) Query

func (this *Client) Query(query string, args ...interface{}) (*sql.Rows, error)

func (*Client) QueryRow

func (this *Client) QueryRow(query string, args ...interface{}) *sql.Row

func (*Client) Rollback

func (this *Client) Rollback() error

func (*Client) SetLogger

func (this *Client) SetLogger(logger golog.ILogger)

type Config

type Config struct {
	*mysql.Config

	LogLevel int
}

func NewConfig

func NewConfig(user, pass, host, port, dbname string) *Config

type NewClientFunc

type NewClientFunc func() (*Client, error)

type PConfig

type PConfig struct {
	pool.Config

	NewClientFunc func() (*Client, error)
}

type Pool

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

func NewPool

func NewPool(config *PConfig) *Pool

func (*Pool) Get

func (this *Pool) Get() (*Client, error)

func (*Pool) Put

func (this *Pool) Put(client *Client) error

Jump to

Keyboard shortcuts

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