server

package
v0.0.0-...-80f65e5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: MIT Imports: 24 Imported by: 0

Documentation

Index

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.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns default options.

type Server

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

Server represents a server that handles user requests and executes commands.

func New

func New(meta metaStore, data dataStore, parser commandParser, opts Options) *Server

New creates a new server.

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

func (s *Server) BootstrapCluster() error

BootstrapCluster creates a new cluster and runs the server.

func (*Server) ExecuteCommand

ExecuteCommand executes a command that placed into the request.

func (*Server) JoinCluster

func (s *Server) JoinCluster(joinAddr string) error

JoinCluster joins to an existing cluster and runs the server.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops a grpc server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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