history

package
v1.1.1-release Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHistory

func AddHistory(dbName string, SchemaName string, TableName string, Property HistoryProperty, ToServerIDList []int) (int, error)

func CheckWhere added in v1.2.2

func CheckWhere(dbName, SchemaName, TableName, Where string) error

func CheckWhere0 added in v1.2.2

func CheckWhere0(Uri string, SchemaName string, TableName string, Where string) error

func DBConnect

func DBConnect(uri string) mysql.MysqlConnection

func DelHistory

func DelHistory(dbName string, ID int) bool

func KillHistory

func KillHistory(dbName string, ID int) error

func Start

func Start(dbName string, ID int) error

Types

type HisotryStatus

type HisotryStatus string
const (
	HISTORY_STATUS_ALL     HisotryStatus = "All"
	HISTORY_STATUS_CLOSE   HisotryStatus = "close"
	HISTORY_STATUS_RUNNING HisotryStatus = "running"
	HISTORY_STATUS_OVER    HisotryStatus = "over"
	HISTORY_STATUS_HALFWAY HisotryStatus = "halfway"
	HISTORY_STATUS_KILLED  HisotryStatus = "killed"
)

type History

type History struct {
	sync.RWMutex
	ID         int
	DbName     string
	SchemaName string
	TableName  string
	Property   HistoryProperty
	Status     HisotryStatus
	NowStartI  int //当前第几条数据
	ThreadPool []*ThreadStatus

	Fields         []TableStruct `json:"-"`
	Uri            string        `json:"-"`
	ToServerIDList []int
	StartTime      string
	OverTime       string
	// contains filtered or unexported fields
}

func GetHistoryList

func GetHistoryList(dbName, SchemaName, TableName string, status HisotryStatus) []History

func (*History) Start

func (This *History) Start() error

func (*History) Stop

func (This *History) Stop() error

type HistoryProperty

type HistoryProperty struct {
	ThreadNum      int    // 协程数量,每个协程一个连接
	ThreadCountPer int    // 协程每次最多处理多少条数据
	Where          string // where 条件
}

type TableStruct

type TableStruct struct {
	COLUMN_NAME       *string
	COLUMN_DEFAULT    *string
	IS_NULLABLE       *string
	COLUMN_TYPE       *string
	COLUMN_KEY        *string
	EXTRA             *string
	COLUMN_COMMENT    *string
	DATA_TYPE         *string
	NUMERIC_PRECISION *uint64
	NUMERIC_SCALE     *uint64
}

func GetSchemaTableFieldList

func GetSchemaTableFieldList(db mysql.MysqlConnection, schema string, table string) []TableStruct

type ThreadStatus

type ThreadStatus struct {
	Num       int
	Error     error
	NowStartI int // 当前执行第几条
}

Jump to

Keyboard shortcuts

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