common

package
v0.0.0-...-6a1ef26 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: GPL-3.0 Imports: 16 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 *Args)

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 *Args)

Loader used to start the loader worker.

func ReadFile

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

ReadFile used to read datas from file.

func Streamer

func Streamer(log *xlog.Log, args *Args)

Streamer used to start the streamer worker.

func WriteFile

func WriteFile(file string, data string) error

WriteFile used to write datas to file.

Types

type Args

type Args struct {
	User            string
	Password        string
	Address         string
	ToUser          string
	ToPassword      string
	ToAddress       string
	ToDatabase      string
	ToEngine        string
	Database        string
	Table           string
	Outdir          string
	SessionVars     string
	Threads         int
	ChunksizeInMB   int
	StmtSize        int
	Allbytes        uint64
	Allrows         uint64
	OverwriteTables bool

	// Interval in millisecond.
	IntervalMs int
}

Args tuple.

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