cluster

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	Start() error
	Join(string, string) error
	Remove(string) error
	Bootstrap() raft.Future
	IsLeader() bool
	GetLeader() string
	Shutdown() raft.Future
	// contains filtered or unexported methods
}

func NewCluster

func NewCluster(config ClusterConfig) (Cluster, error)

func NewEmptyCluster

func NewEmptyCluster() Cluster

type ClusterConfig

type ClusterConfig struct {
	Node        string
	Bind        string
	User        string
	Pass        string
	ManagerType string
	ManagerAddr string
	ManagerJoin string
}

type EmptyCluster

type EmptyCluster struct {
}

func (*EmptyCluster) Bootstrap

func (c *EmptyCluster) Bootstrap() raft.Future

func (*EmptyCluster) GetLeader

func (c *EmptyCluster) GetLeader() string

func (*EmptyCluster) IsLeader

func (c *EmptyCluster) IsLeader() bool

func (*EmptyCluster) Join

func (c *EmptyCluster) Join(a, b string) error

func (*EmptyCluster) Remove

func (c *EmptyCluster) Remove(a string) error

func (*EmptyCluster) Shutdown

func (c *EmptyCluster) Shutdown() raft.Future

func (*EmptyCluster) Start

func (c *EmptyCluster) Start() error

type EmptyFuture

type EmptyFuture struct {
}

func (*EmptyFuture) Error

func (e *EmptyFuture) Error() error

type MembershipManager

type MembershipManager interface {
	Start() error
	Close()
}

func GetManager

func GetManager(config *ClusterConfig, cluster Cluster) (MembershipManager, error)

type RaftCluster

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

func (*RaftCluster) Bootstrap

func (c *RaftCluster) Bootstrap() raft.Future

func (*RaftCluster) GetLeader

func (c *RaftCluster) GetLeader() string

func (*RaftCluster) IsLeader

func (c *RaftCluster) IsLeader() bool

func (*RaftCluster) Join

func (c *RaftCluster) Join(nodeID, addr string) error

func (*RaftCluster) Remove

func (c *RaftCluster) Remove(nodeID string) error

func (*RaftCluster) Shutdown

func (c *RaftCluster) Shutdown() raft.Future

func (*RaftCluster) Start

func (c *RaftCluster) Start() error

Jump to

Keyboard shortcuts

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