replication

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 18 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Membership  cluster.Membership
	Registrator cluster.Registrator
}

Config - configuration structure of the replication module

type InMessage

type InMessage struct {
	MemberID  cluster.MemberID
	Namespace auth.Namespace
	Data      []byte
}

InMessage - incoming replication message which is forwarded to the user

func (*InMessage) String

func (msg *InMessage) String() string

type Replication

type Replication interface {
	// Returns a replicator for a specific namespace responsible handling
	// the broadcast and send operations of outgoing events
	GetReplicator(namespace auth.Namespace) (Replicator, error)
	// Returns a channel on which the replicated incoming events from remote peers are received
	Notification() <-chan *InMessage
	// Starts a synchronization procedure with the cluster, returns a channel on which incoming sync events
	// are received and need to be stored locally
	Sync(waitTime time.Duration) <-chan *InMessage
	// Use this method to listen for synchronization request of remote peers, receive a channel on which
	// to send the outgoing sync events
	SyncRequest() <-chan chan []byte
	// Stops the replication and free resources
	Stop()
}

Replication - interface for replication between registry cluster peers

func New

func New(conf *Config) (Replication, error)

New - Create a new replication instance

type Replicator

type Replicator interface {
	Broadcast(data []byte) error
	Send(memberID cluster.MemberID, data []byte) error
}

Replicator - the per-namespace interface for sending messages

Jump to

Keyboard shortcuts

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