manager

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(grpcAddr string, logger *zap.Logger) (*blasthttp.Router, error)

Types

type DeleteHandler

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

func NewDeleteHandler

func NewDeleteHandler(client *grpc.Client, logger *zap.Logger) *DeleteHandler

func (*DeleteHandler) ServeHTTP

func (h *DeleteHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GRPCService

type GRPCService struct {
	*grpc.Service
	// contains filtered or unexported fields
}

func NewGRPCService

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

func (*GRPCService) DeleteNode

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

func (*GRPCService) DeleteValue added in v0.7.1

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

func (*GRPCService) GetCluster

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

func (*GRPCService) GetNode

func (*GRPCService) GetValue added in v0.7.1

func (*GRPCService) NodeID added in v0.7.1

func (s *GRPCService) NodeID() string

func (*GRPCService) SetNode

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

func (*GRPCService) SetValue added in v0.7.1

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

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) WatchCluster

func (s *GRPCService) WatchCluster(req *empty.Empty, server protobuf.Blast_WatchClusterServer) error

func (*GRPCService) WatchStore added in v0.7.1

type GetHandler

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

func NewGetHandler

func NewGetHandler(client *grpc.Client, logger *zap.Logger) *GetHandler

func (*GetHandler) ServeHTTP

func (h *GetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type PutHandler

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

func NewPutHandler

func NewPutHandler(client *grpc.Client, logger *zap.Logger) *PutHandler

func (*PutHandler) ServeHTTP

func (h *PutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

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) DeleteNodeConfig added in v0.7.1

func (f *RaftFSM) DeleteNodeConfig(nodeId string) error

func (*RaftFSM) DeleteValue added in v0.7.1

func (f *RaftFSM) DeleteValue(key string) error

func (*RaftFSM) GetNodeConfig added in v0.7.1

func (f *RaftFSM) GetNodeConfig(nodeId string) (map[string]interface{}, error)

func (*RaftFSM) GetValue added in v0.7.1

func (f *RaftFSM) GetValue(key string) (interface{}, error)

func (*RaftFSM) Restore

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

func (*RaftFSM) SetNodeConfig added in v0.7.1

func (f *RaftFSM) SetNodeConfig(nodeId string, nodeConfig map[string]interface{}) error

func (*RaftFSM) SetValue added in v0.7.1

func (f *RaftFSM) SetValue(key string, value interface{}, merge bool) error

func (*RaftFSM) Snapshot

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

func (*RaftFSM) Start

func (f *RaftFSM) Start() error

func (*RaftFSM) Stop

func (f *RaftFSM) Stop() error

type RaftFSMSnapshot

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

func (*RaftFSMSnapshot) Persist

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

func (*RaftFSMSnapshot) Release

func (f *RaftFSMSnapshot) Release()

type RaftServer

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

func NewRaftServer

func NewRaftServer(nodeConfig *config.NodeConfig, indexConfig *config.IndexConfig, bootstrap bool, logger *zap.Logger) (*RaftServer, error)

func (*RaftServer) DeleteNode added in v0.7.1

func (s *RaftServer) DeleteNode(nodeId string) error

func (*RaftServer) DeleteValue added in v0.7.1

func (s *RaftServer) DeleteValue(key string) error

func (*RaftServer) GetCluster added in v0.7.1

func (s *RaftServer) GetCluster() (map[string]interface{}, error)

func (*RaftServer) GetNode added in v0.7.1

func (s *RaftServer) GetNode(id string) (map[string]interface{}, error)

func (*RaftServer) GetValue added in v0.7.1

func (s *RaftServer) GetValue(key string) (interface{}, error)

func (*RaftServer) IsLeader

func (s *RaftServer) IsLeader() bool

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) NodeID added in v0.7.1

func (s *RaftServer) NodeID() string

func (*RaftServer) SetNode added in v0.7.1

func (s *RaftServer) SetNode(nodeId string, nodeConfig map[string]interface{}) error

func (*RaftServer) SetValue added in v0.7.1

func (s *RaftServer) SetValue(key string, value interface{}) 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) Stats

func (s *RaftServer) Stats() map[string]string

func (*RaftServer) Stop

func (s *RaftServer) Stop() error

func (*RaftServer) WaitForDetectLeader

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

type RootHandler

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

func NewRootHandler

func NewRootHandler(logger *zap.Logger) *RootHandler

func (*RootHandler) ServeHTTP

func (h *RootHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Server

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

func NewServer

func NewServer(clusterConfig *config.ClusterConfig, nodeConfig *config.NodeConfig, indexConfig *config.IndexConfig, logger *zap.Logger, grpcLogger *zap.Logger, httpLogger accesslog.Logger) (*Server, error)

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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