cluster

package
v1.9.24 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MPL-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GossipConfig added in v1.2.0

type GossipConfig struct {
	JoinList []string
	Network  NetworkConfig
}

type MultiNode added in v1.3.0

type MultiNode interface {
	Node(cluster string, config RaftConfig) Node
	Shutdown() error
}

func NewMultiNode added in v1.3.0

func NewMultiNode(config NodeConfig, dialer func(address string, opts ...grpc.DialOption) (*grpc.ClientConn, error), server *grpc.Server, logger *zap.Logger) MultiNode

type NetworkConfig added in v1.2.0

type NetworkConfig struct {
	AdvertizedHost string
	AdvertizedPort int
	ListeningPort  int
}

func (NetworkConfig) AdvertizedAddress added in v1.2.0

func (n NetworkConfig) AdvertizedAddress() string

type Node added in v1.2.0

type Node interface {
	Run(context.Context)
	RunFromAppliedIndex(ctx context.Context, idx uint64)
	Shutdown() error
	Apply(context.Context, []byte) error
	Ready() <-chan struct{}
	Call(id uint64, f func(*grpc.ClientConn) error) error
	Index() uint64
}

func NewNode added in v1.2.0

func NewNode(config NodeConfig, dialer func(address string, opts ...grpc.DialOption) (*grpc.ClientConn, error), server *grpc.Server, logger *zap.Logger) Node

type NodeConfig added in v1.2.0

type NodeConfig struct {
	ID            uint64
	ServiceName   string
	DataDirectory string
	GossipConfig  GossipConfig
	RaftConfig    RaftConfig
}

type NodeRPCServer added in v1.2.0

type NodeRPCServer struct {
}

type RaftConfig added in v1.2.0

type RaftConfig struct {
	ExpectedNodeCount         int
	AppliedIndex              uint64
	DisableProposalForwarding bool
	LeaderFunc                func(context.Context) error
	Network                   NetworkConfig
	GetStateSnapshot          func() ([]byte, error)
	CommitApplier             raft.CommitApplier
	SnapshotApplier           raft.SnapshotApplier
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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