config

package
v0.0.0-...-66c7839 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENABLE_ROLLBACK_UPDATE = true
	ENABLE_ROLLBACK_INSERT = true
	ENABLE_ROLLBACK_DELETE = true
	SAVE_DIR               = "rollback_sqls"
)
View Source
const (
	DB_HOST                = "127.0.0.1"
	DB_PORT                = 3306
	DB_USERNAME            = "root"
	DB_PASSWORD            = "root"
	DB_SCHEMA              = ""
	DB_AUTO_COMMIT         = true
	DB_MAX_OPEN_CONNS      = 8
	DB_MAX_IDEL_CONNS      = 8
	DB_CHARSET             = "utf8mb4"
	DB_TIMEOUT             = 10
	DB_PASSWORD_IS_DECRYPT = true
	SQL_LOG_BIN            = true
)
View Source
const DefaultOfflineStatSaveDir = "offline_stat_output"
View Source
const (
	EXECUTE_PARALLER = 1
)

Variables

This section is empty.

Functions

func LogDefautConfig

func LogDefautConfig() string

func SetDBConfig

func SetDBConfig(dbc *DBConfig)

设置 DBConfig

func SetExecuteConfig

func SetExecuteConfig(cfg *ExecuteConfig)

func SetStartConfig

func SetStartConfig(cfg *CreateConfig)

Types

type CreateConfig

type CreateConfig struct {
	StartLogFile         string
	StartLogPos          uint64
	EndLogFile           string
	EndLogPos            uint64
	StartTime            string
	EndTime              string
	RollbackSchemas      []string
	RollbackTables       []string
	ThreadID             uint32
	Now                  time.Time
	EnableRollbackUpdate bool
	EnableRollbackInsert bool
	EnableRollbackDelete bool
	SaveDir              string
	MatchSqls            []string // 使用sql语句来匹配需要查询的时间段或者
}

func NewStartConfig

func NewStartConfig() *CreateConfig

func (*CreateConfig) Check

func (this *CreateConfig) Check() error

func (*CreateConfig) EndInfoString

func (this *CreateConfig) EndInfoString() string

func (*CreateConfig) EndPostInfoRatherThan

func (this *CreateConfig) EndPostInfoRatherThan(otherEndFile string, otherEndPos uint64) bool

结束位点大于其他位点

func (*CreateConfig) EndTimeRatherThan

func (this *CreateConfig) EndTimeRatherThan(otherEndTime string) (bool, error)

结束时间大于其他位点

func (*CreateConfig) GetSaveDir

func (this *CreateConfig) GetSaveDir() string

设置最终的保存文件

func (*CreateConfig) HaveEndPosInfo

func (this *CreateConfig) HaveEndPosInfo() bool

是否所有结束位点信息

func (*CreateConfig) HaveEndTime

func (this *CreateConfig) HaveEndTime() bool

是否有结束时间

func (*CreateConfig) HaveStartPosInfo

func (this *CreateConfig) HaveStartPosInfo() bool

是否有开始位点信息

func (*CreateConfig) HaveStartTime

func (this *CreateConfig) HaveStartTime() bool

是否有开始事件

func (*CreateConfig) StartInfoString

func (this *CreateConfig) StartInfoString() string

func (*CreateConfig) StartPosInfoLessThan

func (this *CreateConfig) StartPosInfoLessThan(otherStartFile string, otherStartPos uint64) bool

开始位点小于其他位点

func (*CreateConfig) StartTimeLessThan

func (this *CreateConfig) StartTimeLessThan(otherStartTime string) (bool, error)

开始时间小于其他位点

type DBConfig

type DBConfig struct {
	Username          string
	Password          string
	Database          string
	CharSet           string
	Host              string
	Timeout           int
	Port              int
	MaxOpenConns      int
	MaxIdelConns      int
	AllowOldPasswords int
	AutoCommit        bool
	PasswordIsDecrypt bool
	SqlLogBin         bool
}

func GetDBConfig

func GetDBConfig() *DBConfig

func (*DBConfig) Check

func (this *DBConfig) Check() error

func (*DBConfig) GetDataSource

func (this *DBConfig) GetDataSource() string

func (*DBConfig) GetPassword

func (this *DBConfig) GetPassword() string

获取密码, 有判断是否需要进行解密

func (*DBConfig) GetSyncerConfig

func (this *DBConfig) GetSyncerConfig() replication.BinlogSyncerConfig

type ExecuteConfig

type ExecuteConfig struct {
	FilePath string
	Paraller int64
}

func (*ExecuteConfig) Check

func (this *ExecuteConfig) Check() error

type OfflineConfig

type OfflineConfig struct {
	BinlogFiles          []string
	ThreadID             uint32
	Now                  time.Time
	EnableRollbackUpdate bool
	EnableRollbackInsert bool
	EnableRollbackDelete bool
	SaveDir              string
	SchemaFile           string   // 建表语句
	MatchSqls            []string // 使用sql语句来匹配需要查询的时间段或者
}

func NewOffileConfig

func NewOffileConfig() *OfflineConfig

func (*OfflineConfig) Check

func (this *OfflineConfig) Check() error

func (*OfflineConfig) GetSaveDir

func (this *OfflineConfig) GetSaveDir() string

设置最终的保存文件

type OfflineStatConfig

type OfflineStatConfig struct {
	SaveDir     string
	BinlogFiles []string
}

func (*OfflineStatConfig) Check

func (this *OfflineStatConfig) Check() error

func (*OfflineStatConfig) TableStatFilePath

func (this *OfflineStatConfig) TableStatFilePath() string

func (*OfflineStatConfig) ThreadStatFilePath

func (this *OfflineStatConfig) ThreadStatFilePath() string

func (*OfflineStatConfig) TimestampStatFilePath

func (this *OfflineStatConfig) TimestampStatFilePath() string

func (*OfflineStatConfig) TransactionStatFilePath

func (this *OfflineStatConfig) TransactionStatFilePath() string

Jump to

Keyboard shortcuts

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