manager

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: Apache-2.0 Imports: 29 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) 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 (*GRPCService) GetState

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

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

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

func (*RaftFSM) GetMetadata

func (f *RaftFSM) GetMetadata(id string) (map[string]interface{}, error)

func (*RaftFSM) Restore

func (f *RaftFSM) Restore(rc io.ReadCloser) 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(id string, metadata map[string]interface{}, bootstrap bool, indexConfig map[string]interface{}, logger *zap.Logger) (*RaftServer, error)

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

func (s *RaftServer) LeaderID(timeout time.Duration) (raft.ServerID, 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)

type Server

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

func NewServer

func NewServer(id string, metadata map[string]interface{}, peerAddr string, indexConfig map[string]interface{}, logger *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