replication

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultChunkSize int = 64 * 1024 // 64 * 1024 64 KiB

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")

Functions

This section is empty.

Types

type Delayer

type Delayer interface {
	DelayAfter(retries int) time.Duration
}

type Options

type Options struct {
	// contains filtered or unexported fields
}

func DefaultOptions

func DefaultOptions() *Options

func (*Options) Valid

func (opts *Options) Valid() bool

func (*Options) WithDelayer

func (o *Options) WithDelayer(delayer Delayer) *Options

WithDelayer sets delayer used to pause re-attempts

func (*Options) WithFollowerPassword

func (o *Options) WithFollowerPassword(followerPassword string) *Options

WithFollowerPassword sets password used for replication

func (*Options) WithFollowerUsername

func (o *Options) WithFollowerUsername(followerUsername string) *Options

WithFollowerUsername sets username used for replication

func (*Options) WithMasterAddress

func (o *Options) WithMasterAddress(masterAddress string) *Options

WithMasterAddress sets the source database address

func (*Options) WithMasterDatabase

func (o *Options) WithMasterDatabase(masterDatabase string) *Options

WithMasterDatabase sets the source database name

func (*Options) WithMasterPort

func (o *Options) WithMasterPort(masterPort int) *Options

WithMasterPort sets the source database port

func (*Options) WithStreamChunkSize

func (o *Options) WithStreamChunkSize(streamChunkSize int) *Options

WithStreamChunkSize sets streaming chunk size

type TxReplicator

type TxReplicator struct {
	// contains filtered or unexported fields
}

func NewTxReplicator

func NewTxReplicator(db database.DB, opts *Options, logger logger.Logger) (*TxReplicator, error)

func (*TxReplicator) Start

func (txr *TxReplicator) Start() error

func (*TxReplicator) Stop

func (txr *TxReplicator) Stop() error

Jump to

Keyboard shortcuts

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