common

package
v0.0.0-...-58a0e46 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNil

func AssertNil(err error)

AssertNil used to assert the error.

func Dumper

func Dumper(log *xlog.Log, args *config.Config)

Dumper used to start the dumper worker.

func EscapeBytes

func EscapeBytes(bytes []byte) []byte

EscapeBytes used to escape the literal byte.

func Loader

func Loader(log *xlog.Log, args *config.Config)

Loader used to start the loader worker.

func ReadFile

func ReadFile(file string) ([]byte, error)

ReadFile used to read datas from file.

func WriteFile

func WriteFile(file string, data string) error

WriteFile used to write datas to file.

Types

type Connection

type Connection struct {
	ID int
	// contains filtered or unexported fields
}

Connection tuple.

func (*Connection) Execute

func (conn *Connection) Execute(query string) error

Execute used to executes the query.

func (*Connection) Fetch

func (conn *Connection) Fetch(query string) (*sqltypes.Result, error)

Fetch used to fetch the results.

func (*Connection) StreamFetch

func (conn *Connection) StreamFetch(query string) (driver.Rows, error)

StreamFetch used to the results with streaming.

type Files

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

Files tuple.

type Pool

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

Pool tuple.

func NewPool

func NewPool(log *xlog.Log, cap int, address string, user string, password string, vars string) (*Pool, error)

NewPool creates the new pool.

func (*Pool) Close

func (p *Pool) Close()

Close used to close the pool and the connections.

func (*Pool) Get

func (p *Pool) Get() *Connection

Get used to get one connection from the pool.

func (*Pool) Put

func (p *Pool) Put(conn *Connection)

Put used to put one connection to the pool.

Jump to

Keyboard shortcuts

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