Documentation ¶
Index ¶
- Constants
- Variables
- type Delayer
- type Options
- func (opts *Options) Validate() error
- 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) WithSkipIntegrityCheck(skipIntegrityCheck bool) *Options
- func (o *Options) WithStreamChunkSize(streamChunkSize int) *Options
- func (o *Options) WithWaitForIndexing(waitForIndexing bool) *Options
- type TxReplicator
Constants ¶
const DefaultAllowTxDiscarding = false
const DefaultChunkSize int = 64 * 1024 // 64 * 1024 64 KiB
const DefaultPrefetchTxBufferSize int = 100
const DefaultReplicationCommitConcurrency int = 10
const DefaultSkipIntegrityCheck = false
const DefaultWaitForIndexing = false
Variables ¶
var ErrAlreadyRunning = errors.New("already running")
var ErrAlreadyStopped = errors.New("already stopped")
var ErrIllegalArguments = errors.New("illegal arguments")
var ErrInvalidOptions = fmt.Errorf("%w: invalid options", ErrIllegalArguments)
var ErrInvalidReplicationMetadata = errors.New("invalid replication metadata retrieved")
var ErrNoSynchronousReplicationOnPrimary = errors.New("primary is not running with synchronous replication")
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) WithSkipIntegrityCheck ¶ added in v1.5.0
WithSkipIntegrityCheck disable integrity checks when reading data during replication
func (*Options) WithStreamChunkSize ¶
WithStreamChunkSize sets streaming chunk size
func (*Options) WithWaitForIndexing ¶ added in v1.5.0
WithWaitForIndexing wait for indexing to be up to date during replication
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