Documentation ¶
Index ¶
- Variables
- type Command
- type Op
- type Server
- func (s *Server) ApplyDeleteOp(key string) error
- func (s *Server) ApplyGetOp(key string) (string, error)
- func (s *Server) ApplySetOp(key, value string) error
- func (s *Server) BootstrapCluster() error
- func (s *Server) Join(serverId, advertise string) error
- func (s *Server) Shutdown() error
- func (s *Server) Start() error
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyKey = errors.New("an empty key")
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server behaves a Raft server.
func (*Server) ApplyDeleteOp ¶
func (*Server) ApplySetOp ¶
func (*Server) BootstrapCluster ¶
BootstrapCluster bootstrap a new cluster. There are no existing peers, then this server becomes the first server, and therefore leader of the cluster.
Click to show internal directories.
Click to hide internal directories.