Versions in this module Expand all Collapse all v0 v0.5.0 Mar 22, 2019 Changes in this version + type GRPCClient struct + func NewGRPCClient(address string) (*GRPCClient, error) + func (c *GRPCClient) Close() error + func (c *GRPCClient) Delete(req *kvs.KeyValuePair, opts ...grpc.CallOption) error + func (c *GRPCClient) Get(req *kvs.KeyValuePair, opts ...grpc.CallOption) (*kvs.KeyValuePair, error) + func (c *GRPCClient) Join(req *raft.Node, opts ...grpc.CallOption) error + func (c *GRPCClient) Leave(req *raft.Node, opts ...grpc.CallOption) error + func (c *GRPCClient) Put(req *kvs.KeyValuePair, opts ...grpc.CallOption) error + func (c *GRPCClient) Snapshot(opts ...grpc.CallOption) error + type GRPCServer struct + func NewGRPCServer(grpcAddr string, service *GRPCService, logger *log.Logger) (*GRPCServer, error) + func (s *GRPCServer) Start() error + func (s *GRPCServer) Stop() error + type GRPCService struct + func NewGRPCService(raftServer *RaftServer, logger *log.Logger) (*GRPCService, error) + func (s *GRPCService) Delete(ctx context.Context, req *kvs.KeyValuePair) (*empty.Empty, error) + func (s *GRPCService) Get(ctx context.Context, req *kvs.KeyValuePair) (*kvs.KeyValuePair, error) + func (s *GRPCService) GetCluster(ctx context.Context, req *empty.Empty) (*raft.Cluster, error) + func (s *GRPCService) GetNode(ctx context.Context, req *empty.Empty) (*raft.Node, error) + func (s *GRPCService) Join(ctx context.Context, req *raft.Node) (*empty.Empty, error) + func (s *GRPCService) Leave(ctx context.Context, req *raft.Node) (*empty.Empty, error) + func (s *GRPCService) Put(ctx context.Context, req *kvs.KeyValuePair) (*empty.Empty, error) + func (s *GRPCService) Snapshot(ctx context.Context, req *empty.Empty) (*empty.Empty, error) + type HTTPServer struct + func NewHTTPServer(httpAddr string, grpcClient *GRPCClient, logger *log.Logger, ...) (*HTTPServer, error) + func (s *HTTPServer) Start() error + func (s *HTTPServer) Stop() error + type KVS struct + func NewKVS(dir string, valueDir string, logger *log.Logger) (*KVS, error) + func (b *KVS) Close() error + func (b *KVS) Delete(key []byte) error + func (b *KVS) Get(key []byte) ([]byte, error) + func (b *KVS) Set(key []byte, value []byte) error + func (b *KVS) SnapshotItems() <-chan *kvs.KeyValuePair + type KVSFSMSnapshot struct + func (f *KVSFSMSnapshot) Persist(sink raft.SnapshotSink) error + func (f *KVSFSMSnapshot) Release() + type RaftFSM struct + func NewRaftFSM(path string, logger *log.Logger) (*RaftFSM, error) + func (f *RaftFSM) Apply(l *raft.Log) interface{} + func (f *RaftFSM) Close() error + func (f *RaftFSM) Get(key []byte) ([]byte, error) + func (f *RaftFSM) GetMetadata(nodeId string) (*blastraft.Node, error) + func (f *RaftFSM) Restore(rc io.ReadCloser) error + func (f *RaftFSM) Snapshot() (raft.FSMSnapshot, error) + type RaftServer struct + BindAddr string + DataDir string + Node *blastraft.Node + func NewRaftServer(node *blastraft.Node, bootstrap bool, logger *log.Logger) (*RaftServer, error) + func (s *RaftServer) Delete(kvp *kvs.KeyValuePair) error + func (s *RaftServer) Get(kvp *kvs.KeyValuePair) (*kvs.KeyValuePair, error) + func (s *RaftServer) GetCluster() (*blastraft.Cluster, error) + func (s *RaftServer) GetNode() (*blastraft.Node, error) + func (s *RaftServer) Join(node *blastraft.Node) error + func (s *RaftServer) LeaderAddress(timeout time.Duration) (raft.ServerAddress, error) + func (s *RaftServer) LeaderID(timeout time.Duration) (raft.ServerID, error) + func (s *RaftServer) Leave(node *blastraft.Node) error + func (s *RaftServer) Set(kvp *kvs.KeyValuePair) error + func (s *RaftServer) Snapshot() error + func (s *RaftServer) Start() error + func (s *RaftServer) Stop() error + func (s *RaftServer) WaitForDetectLeader(timeout time.Duration) error v0.4.0 Mar 14, 2019 Changes in this version + var DurationSeconds = prometheus.NewHistogramVec(prometheus.HistogramOpts{ ... }, []string{ ... }) + var OperationsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + func RecordMetrics(start time.Time, funcName string) + type Client struct + func NewClient(address string) (*Client, error) + func (c *Client) Close() error + func (c *Client) Delete(req *kvs.DeleteRequest, opts ...grpc.CallOption) (*empty.Empty, error) + func (c *Client) Get(req *kvs.GetRequest, opts ...grpc.CallOption) (*kvs.GetResponse, error) + func (c *Client) Join(req *raft.JoinRequest, opts ...grpc.CallOption) (*empty.Empty, error) + func (c *Client) Leave(req *raft.LeaveRequest, opts ...grpc.CallOption) (*empty.Empty, error) + func (c *Client) Put(req *kvs.PutRequest, opts ...grpc.CallOption) (*empty.Empty, error) + func (c *Client) Snapshot(opts ...grpc.CallOption) (*empty.Empty, error) + type RootHandler struct + func NewRootHandler(logger *log.Logger) *RootHandler + func (h *RootHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type Server struct + func NewServer(nodeId string, bindAddr string, grpcAddr string, httpAddr string, ...) *Server + func (s *Server) Start() + func (s *Server) Stop() + type Service struct + func NewService(store *store.KeyValueStore, logger *log.Logger) (*Service, error) + func (s *Service) Delete(ctx context.Context, req *kvs.DeleteRequest) (*empty.Empty, error) + func (s *Service) Get(ctx context.Context, req *kvs.GetRequest) (*kvs.GetResponse, error) + func (s *Service) Join(ctx context.Context, req *raft.JoinRequest) (*empty.Empty, error) + func (s *Service) Leave(ctx context.Context, req *raft.LeaveRequest) (*empty.Empty, error) + func (s *Service) Put(ctx context.Context, req *kvs.PutRequest) (*empty.Empty, error) + func (s *Service) Snapshot(ctx context.Context, req *empty.Empty) (*empty.Empty, error)