common

package
v0.0.0-...-4624acb Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MaxBinlogSyncerReconnect is the max reconnection times for binlog syncer in go-mysql.
	MaxBinlogSyncerReconnect = 60
	// SlaveReadTimeout is slave read binlog data timeout, ref: https://dev.mysql.com/doc/refman/8.0/en/replication-options-replica.html#sysvar_slave_net_timeout
	SlaveReadTimeout = 1 * time.Minute
	// MasterHeartbeatPeriod is the master server send heartbeat period, ref: `MASTER_HEARTBEAT_PERIOD` in https://dev.mysql.com/doc/refman/8.0/en/change-master-to.html
	MasterHeartbeatPeriod = 30 * time.Second
)

Functions

func SetDefaultReplicationCfg

func SetDefaultReplicationCfg(cfg *replication.BinlogSyncerConfig, retryCount int)

SetDefaultReplicationCfg sets some default value for BinlogSyncerConfig Note: retryCount should be greater than 0, set retryCount = 1 if you want to disable retry sync.

Types

type Stage

type Stage int32

Stage represents a stage for some binlog related objects, like Writer.Reader.

const (
	StageNew Stage = iota
	StagePrepared
	StageClosed
)

valid stages for binlog related objects.

func (Stage) String

func (s Stage) String() string

String implements Stringer.String.

Jump to

Keyboard shortcuts

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