Documentation ¶
Index ¶
- Constants
- Variables
- type Delayer
- type Options
- func (opts *Options) Valid() bool
- func (o *Options) WithAllowTxDiscarding(allowTxDiscarding bool) *Options
- func (o *Options) WithDelayer(delayer Delayer) *Options
- func (o *Options) WithPrefetchTxBufferSize(prefetchTxBufferSize int) *Options
- func (o *Options) WithPrimaryDatabase(primaryDatabase string) *Options
- func (o *Options) WithPrimaryHost(primaryHost string) *Options
- func (o *Options) WithPrimaryPassword(primaryPassword string) *Options
- func (o *Options) WithPrimaryPort(primaryPort int) *Options
- func (o *Options) WithPrimaryUsername(primaryUsername string) *Options
- func (o *Options) WithReplicationCommitConcurrency(replicationCommitConcurrency int) *Options
- func (o *Options) WithStreamChunkSize(streamChunkSize int) *Options
- type TxReplicator
Constants ¶
View Source
const DefaultAllowTxDiscarding = false
View Source
const DefaultChunkSize int = 64 * 1024 // 64 * 1024 64 KiB
View Source
const DefaultPrefetchTxBufferSize int = 100
View Source
const DefaultReplicationCommitConcurrency int = 10
Variables ¶
View Source
var ErrAlreadyRunning = errors.New("already running")
View Source
var ErrAlreadyStopped = errors.New("already stopped")
View Source
var ErrIllegalArguments = errors.New("illegal arguments")
View Source
var ErrInvalidReplicationMetadata = errors.New("invalid replication metadata retrieved")
View Source
var ErrNoSynchronousReplicationOnPrimary = errors.New("primary is not running with synchronous replication")
View Source
var ErrReplicaDivergedFromPrimary = errors.New("replica diverged from primary")
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func DefaultOptions ¶
func DefaultOptions() *Options
func (*Options) WithAllowTxDiscarding ¶ added in v1.4.0
WithAllowTxDiscarding enable auto discarding of precommitted transactions
func (*Options) WithDelayer ¶
WithDelayer sets delayer used to pause re-attempts
func (*Options) WithPrefetchTxBufferSize ¶ added in v1.4.0
WithPrefetchTxBufferSize sets tx buffer size
func (*Options) WithPrimaryDatabase ¶ added in v1.4.1
WithPrimaryDatabase sets the source database name
func (*Options) WithPrimaryHost ¶ added in v1.4.1
WithPrimaryHost sets the source database address
func (*Options) WithPrimaryPassword ¶ added in v1.4.1
WithPrimaryPassword sets password used for replication
func (*Options) WithPrimaryPort ¶ added in v1.4.1
WithPrimaryPort sets the source database port
func (*Options) WithPrimaryUsername ¶ added in v1.4.1
WithPrimaryUsername sets username used for replication
func (*Options) WithReplicationCommitConcurrency ¶ added in v1.4.0
WithReplicationCommitConcurrency sets the number of goroutines doing replication
func (*Options) WithStreamChunkSize ¶
WithStreamChunkSize sets streaming chunk size
type TxReplicator ¶
type TxReplicator struct {
// contains filtered or unexported fields
}
func NewTxReplicator ¶
func (*TxReplicator) Start ¶
func (txr *TxReplicator) Start() error
func (*TxReplicator) Stop ¶
func (txr *TxReplicator) Stop() error
Click to show internal directories.
Click to hide internal directories.