Documentation
¶
Index ¶
- func NewRouter(grpcAddr string, logger *zap.Logger) (*blasthttp.Router, error)
- type DeleteHandler
- type GRPCService
- func (s *GRPCService) DeleteNode(ctx context.Context, req *protobuf.DeleteNodeRequest) (*empty.Empty, error)
- func (s *GRPCService) DeleteState(ctx context.Context, req *protobuf.DeleteStateRequest) (*empty.Empty, error)
- func (s *GRPCService) GetCluster(ctx context.Context, req *empty.Empty) (*protobuf.GetClusterResponse, error)
- func (s *GRPCService) GetNode(ctx context.Context, req *protobuf.GetNodeRequest) (*protobuf.GetNodeResponse, error)
- func (s *GRPCService) GetState(ctx context.Context, req *protobuf.GetStateRequest) (*protobuf.GetStateResponse, error)
- func (s *GRPCService) SetNode(ctx context.Context, req *protobuf.SetNodeRequest) (*empty.Empty, error)
- func (s *GRPCService) SetState(ctx context.Context, req *protobuf.SetStateRequest) (*empty.Empty, error)
- func (s *GRPCService) Snapshot(ctx context.Context, req *empty.Empty) (*empty.Empty, error)
- func (s *GRPCService) Start() error
- func (s *GRPCService) Stop() error
- func (s *GRPCService) WatchCluster(req *empty.Empty, server protobuf.Blast_WatchClusterServer) error
- func (s *GRPCService) WatchState(req *protobuf.WatchStateRequest, server protobuf.Blast_WatchStateServer) error
- type GetHandler
- type PutHandler
- type RaftFSM
- func (f *RaftFSM) Apply(l *raft.Log) interface{}
- func (f *RaftFSM) Get(key string) (interface{}, error)
- func (f *RaftFSM) GetMetadata(id string) (map[string]interface{}, error)
- func (f *RaftFSM) Restore(rc io.ReadCloser) error
- func (f *RaftFSM) Snapshot() (raft.FSMSnapshot, error)
- func (f *RaftFSM) Start() error
- func (f *RaftFSM) Stop() error
- type RaftFSMSnapshot
- type RaftServer
- func (s *RaftServer) DeleteMetadata(id string) error
- func (s *RaftServer) DeleteState(key string) error
- func (s *RaftServer) GetMetadata(id string) (map[string]interface{}, error)
- func (s *RaftServer) GetServers() (map[string]interface{}, error)
- func (s *RaftServer) GetState(key string) (interface{}, error)
- func (s *RaftServer) IsLeader() bool
- func (s *RaftServer) LeaderAddress(timeout time.Duration) (raft.ServerAddress, error)
- func (s *RaftServer) LeaderID(timeout time.Duration) (raft.ServerID, error)
- func (s *RaftServer) SetMetadata(id string, metadata map[string]interface{}) error
- func (s *RaftServer) SetState(key string, value interface{}) error
- func (s *RaftServer) Snapshot() error
- func (s *RaftServer) Start() error
- func (s *RaftServer) State() string
- func (s *RaftServer) Stats() map[string]string
- func (s *RaftServer) Stop() error
- func (s *RaftServer) WaitForDetectLeader(timeout time.Duration) error
- type RootHandler
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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) DeleteState ¶
func (s *GRPCService) DeleteState(ctx context.Context, req *protobuf.DeleteStateRequest) (*empty.Empty, error)
func (*GRPCService) GetCluster ¶
func (s *GRPCService) GetCluster(ctx context.Context, req *empty.Empty) (*protobuf.GetClusterResponse, error)
func (*GRPCService) GetNode ¶
func (s *GRPCService) GetNode(ctx context.Context, req *protobuf.GetNodeRequest) (*protobuf.GetNodeResponse, error)
func (*GRPCService) GetState ¶
func (s *GRPCService) GetState(ctx context.Context, req *protobuf.GetStateRequest) (*protobuf.GetStateResponse, error)
func (*GRPCService) SetNode ¶
func (s *GRPCService) SetNode(ctx context.Context, req *protobuf.SetNodeRequest) (*empty.Empty, error)
func (*GRPCService) SetState ¶
func (s *GRPCService) SetState(ctx context.Context, req *protobuf.SetStateRequest) (*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) WatchState ¶
func (s *GRPCService) WatchState(req *protobuf.WatchStateRequest, server protobuf.Blast_WatchStateServer) error
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 (*RaftFSM) GetMetadata ¶
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 (*RaftServer) DeleteMetadata ¶
func (s *RaftServer) DeleteMetadata(id string) error
func (*RaftServer) DeleteState ¶
func (s *RaftServer) DeleteState(key string) error
func (*RaftServer) GetMetadata ¶
func (s *RaftServer) GetMetadata(id string) (map[string]interface{}, error)
func (*RaftServer) GetServers ¶
func (s *RaftServer) GetServers() (map[string]interface{}, error)
func (*RaftServer) GetState ¶
func (s *RaftServer) GetState(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) SetMetadata ¶
func (s *RaftServer) SetMetadata(id string, metadata map[string]interface{}) error
func (*RaftServer) SetState ¶
func (s *RaftServer) SetState(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() string
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)
Click to show internal directories.
Click to hide internal directories.