server

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCGateway

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

func NewGRPCGateway

func NewGRPCGateway(httpAddress string, grpcAddress string, certificateFile string, keyFile string, commonName string, logger *zap.Logger) (*GRPCGateway, error)

func (*GRPCGateway) Start

func (s *GRPCGateway) Start() error

func (*GRPCGateway) Stop

func (s *GRPCGateway) Stop() error

type GRPCServer

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

func NewGRPCServer

func NewGRPCServer(grpcAddress string, raftServer *RaftServer, certificateFile string, keyFile string, commonName string, logger *zap.Logger) (*GRPCServer, error)

func (*GRPCServer) Start

func (s *GRPCServer) Start() error

func (*GRPCServer) Stop

func (s *GRPCServer) Stop() error

type GRPCService

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

func NewGRPCService

func NewGRPCService(raftServer *RaftServer, certificateFile string, commonName string, logger *zap.Logger) (*GRPCService, error)

func (*GRPCService) Cluster

func (s *GRPCService) Cluster(ctx context.Context, req *empty.Empty) (*protobuf.ClusterResponse, error)

func (*GRPCService) Delete

func (s *GRPCService) Delete(ctx context.Context, req *protobuf.DeleteRequest) (*empty.Empty, error)

func (*GRPCService) Get

func (*GRPCService) Join

func (*GRPCService) Leave

func (s *GRPCService) Leave(ctx context.Context, req *protobuf.LeaveRequest) (*empty.Empty, error)

func (*GRPCService) LivenessCheck

func (s *GRPCService) LivenessCheck(ctx context.Context, req *empty.Empty) (*protobuf.LivenessCheckResponse, error)

func (*GRPCService) Metrics

func (s *GRPCService) Metrics(ctx context.Context, req *empty.Empty) (*protobuf.MetricsResponse, error)

func (*GRPCService) Node

func (*GRPCService) ReadinessCheck

func (s *GRPCService) ReadinessCheck(ctx context.Context, req *empty.Empty) (*protobuf.ReadinessCheckResponse, error)

func (*GRPCService) Scan

func (*GRPCService) Set

func (*GRPCService) Snapshot

func (s *GRPCService) Snapshot(ctx context.Context, req *empty.Empty) (*empty.Empty, error)

func (*GRPCService) Start

func (s *GRPCService) Start() error

func (*GRPCService) Stop

func (s *GRPCService) Stop() error

func (*GRPCService) Watch

func (s *GRPCService) Watch(req *empty.Empty, server protobuf.KVS_WatchServer) error

type KVSFSMSnapshot

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

func (*KVSFSMSnapshot) Persist

func (f *KVSFSMSnapshot) Persist(sink raft.SnapshotSink) error

func (*KVSFSMSnapshot) Release

func (f *KVSFSMSnapshot) Release()

type RaftFSM

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

func NewRaftFSM

func NewRaftFSM(path string, logger *zap.Logger) (*RaftFSM, error)

func (*RaftFSM) Apply

func (f *RaftFSM) Apply(l *raft.Log) interface{}

func (*RaftFSM) Close

func (f *RaftFSM) Close() error

func (*RaftFSM) Get

func (f *RaftFSM) Get(key string) ([]byte, error)

func (*RaftFSM) Restore

func (f *RaftFSM) Restore(rc io.ReadCloser) error

func (*RaftFSM) Scan

func (f *RaftFSM) Scan(prefix string) ([][]byte, error)

func (*RaftFSM) Snapshot

func (f *RaftFSM) Snapshot() (raft.FSMSnapshot, error)

func (*RaftFSM) Stats

func (f *RaftFSM) Stats() map[string]string

type RaftServer

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

func NewRaftServer

func NewRaftServer(id string, raftAddress string, dataDirectory string, bootstrap bool, logger *zap.Logger) (*RaftServer, error)

func (*RaftServer) Delete

func (s *RaftServer) Delete(req *protobuf.DeleteRequest) error

func (*RaftServer) Exist

func (s *RaftServer) Exist(id string) (bool, error)

func (*RaftServer) Get

func (*RaftServer) Join

func (s *RaftServer) Join(id string, node *protobuf.Node) error

func (*RaftServer) LeaderAddress

func (s *RaftServer) LeaderAddress(timeout time.Duration) (raft.ServerAddress, error)

func (*RaftServer) LeaderID

func (s *RaftServer) LeaderID(timeout time.Duration) (raft.ServerID, error)

func (*RaftServer) Leave

func (s *RaftServer) Leave(id string) error

func (*RaftServer) Node

func (s *RaftServer) Node() (*protobuf.Node, error)

func (*RaftServer) Nodes

func (s *RaftServer) Nodes() (map[string]*protobuf.Node, error)

func (*RaftServer) Scan

func (*RaftServer) Set

func (s *RaftServer) Set(req *protobuf.SetRequest) error

func (*RaftServer) Snapshot

func (s *RaftServer) Snapshot() error

func (*RaftServer) Start

func (s *RaftServer) Start() error

func (*RaftServer) State

func (s *RaftServer) State() raft.RaftState

func (*RaftServer) StateStr

func (s *RaftServer) StateStr() string

func (*RaftServer) Stop

func (s *RaftServer) Stop() error

func (*RaftServer) WaitForDetectLeader

func (s *RaftServer) WaitForDetectLeader(timeout time.Duration) error

Jump to

Keyboard shortcuts

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