Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
MasterIP string
MasterPort int
MasterUser string
MasterPassword string
AnnounceIP string
AnnouncePort int
// Send command (PSYNC MasterReplicaId MasterReplicaOffset) to master.
// Replica will start a partial synchronization if replicaId and offset exist in master.
// Set ContinueIfPartialFailed true if you hope do a full synchronized after partial synchronization failed.
MasterReplicaId string
MasterReplicaOffset int
// Whether to do a full synchronized after partial synchronization failed.
ContinueIfPartialFailed bool
// Receive RDB from master in full synchronization. RdbWriter will be closed when full synchronization finished.
RdbWriter io.WriteCloser
// Whether to continue incremental synchronization(AOF) after full synchronization.
ContinueAfterFullSync bool
// Receive AOF byte stream after full synchronization if ContinueAfterFullSync is true.
// Receive all AOF bytes stream in partial synchronization.
AofWriter io.Writer
}
type Replica ¶
type Replica struct {
// contains filtered or unexported fields
}
func NewReplica ¶
func (*Replica) SyncWithMaster ¶
SyncWithMaster establish a connection with the master, and sync data from master. replication.c::syncWithMaster
Click to show internal directories.
Click to hide internal directories.