Documentation ¶
Index ¶
- type Options
- type Server
- func (s *Server) AddToCluster(ctx context.Context, req *api.AddToClusterRequest) (*api.AddToClusterResponse, error)
- func (s *Server) BootstrapCluster() error
- func (s *Server) ExecuteCommand(ctx context.Context, req *api.ExecuteCommandRequest) (*api.ExecuteCommandResponse, error)
- func (s *Server) JoinCluster(joinAddr string) error
- func (s *Server) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { ID string ListenAddr string RaftAddr string RESPAddr string Dir string Logger *log.Logger Clock serverClock GCInterval time.Duration }
Options is a server options.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a server that handles user requests and executes commands.
func (*Server) AddToCluster ¶
func (s *Server) AddToCluster(ctx context.Context, req *api.AddToClusterRequest) (*api.AddToClusterResponse, error)
AddToCluster add a new node to the existing cluster.
func (*Server) BootstrapCluster ¶
BootstrapCluster creates a new cluster and runs the server.
func (*Server) ExecuteCommand ¶
func (s *Server) ExecuteCommand(ctx context.Context, req *api.ExecuteCommandRequest) (*api.ExecuteCommandResponse, error)
ExecuteCommand executes a command that placed into the request.
func (*Server) JoinCluster ¶
JoinCluster joins to an existing cluster and runs the server.
Click to show internal directories.
Click to hide internal directories.