Documentation
¶
Index ¶
- func NewRouter(grpcAddr string, logger *zap.Logger) (*blasthttp.Router, error)
- type DeleteHandler
- type GRPCService
- func (s *GRPCService) DeleteDocument(stream protobuf.Blast_DeleteDocumentServer) error
- func (s *GRPCService) DeleteNode(ctx context.Context, req *protobuf.DeleteNodeRequest) (*empty.Empty, error)
- func (s *GRPCService) GetCluster(ctx context.Context, req *empty.Empty) (*protobuf.GetClusterResponse, error)
- func (s *GRPCService) GetDocument(ctx context.Context, req *protobuf.GetDocumentRequest) (*protobuf.GetDocumentResponse, error)
- func (s *GRPCService) GetIndexConfig(ctx context.Context, req *empty.Empty) (*protobuf.GetIndexConfigResponse, error)
- func (s *GRPCService) GetIndexStats(ctx context.Context, req *empty.Empty) (*protobuf.GetIndexStatsResponse, error)
- func (s *GRPCService) GetNode(ctx context.Context, req *protobuf.GetNodeRequest) (*protobuf.GetNodeResponse, error)
- func (s *GRPCService) IndexDocument(stream protobuf.Blast_IndexDocumentServer) error
- func (s *GRPCService) NodeID() string
- func (s *GRPCService) Search(ctx context.Context, req *protobuf.SearchRequest) (*protobuf.SearchResponse, error)
- func (s *GRPCService) SetNode(ctx context.Context, req *protobuf.SetNodeRequest) (*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
- type GetHandler
- type Index
- func (i *Index) BulkDelete(ids []string) (int, error)
- func (i *Index) BulkIndex(docs []map[string]interface{}) (int, error)
- func (i *Index) Close() error
- func (i *Index) Config() (map[string]interface{}, error)
- func (i *Index) Delete(id string) error
- func (i *Index) Get(id string) (map[string]interface{}, error)
- func (i *Index) Index(id string, fields map[string]interface{}) error
- func (i *Index) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (i *Index) SnapshotItems() <-chan *protobuf.Document
- func (i *Index) Stats() (map[string]interface{}, error)
- type IndexHandler
- type RaftFSM
- func (f *RaftFSM) Apply(l *raft.Log) interface{}
- func (f *RaftFSM) DeleteDocument(id string) error
- func (f *RaftFSM) DeleteDocuments(ids []string) (int, error)
- func (f *RaftFSM) DeleteNodeConfig(nodeId string) error
- func (f *RaftFSM) GetDocument(id string) (map[string]interface{}, error)
- func (f *RaftFSM) GetIndexConfig() (map[string]interface{}, error)
- func (f *RaftFSM) GetIndexStats() (map[string]interface{}, error)
- func (f *RaftFSM) GetNodeConfig(nodeId string) (map[string]interface{}, error)
- func (f *RaftFSM) IndexDocument(id string, fields map[string]interface{}) error
- func (f *RaftFSM) IndexDocuments(docs []map[string]interface{}) (int, error)
- func (f *RaftFSM) Restore(rc io.ReadCloser) error
- func (f *RaftFSM) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (f *RaftFSM) SetNodeConfig(nodeId string, nodeConfig map[string]interface{}) 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) DeleteDocument(ids []string) (int, error)
- func (s *RaftServer) DeleteNode(nodeId string) error
- func (s *RaftServer) GetCluster() (map[string]interface{}, error)
- func (s *RaftServer) GetDocument(id string) (map[string]interface{}, error)
- func (s *RaftServer) GetIndexConfig() (map[string]interface{}, error)
- func (s *RaftServer) GetIndexStats() (map[string]interface{}, error)
- func (s *RaftServer) GetNode(id string) (map[string]interface{}, error)
- func (s *RaftServer) IndexDocument(docs []map[string]interface{}) (int, 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) NodeID() string
- func (s *RaftServer) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (s *RaftServer) SetNode(nodeId string, nodeConfig map[string]interface{}) error
- func (s *RaftServer) Snapshot() error
- func (s *RaftServer) Start() error
- func (s *RaftServer) State() raft.RaftState
- func (s *RaftServer) Stats() map[string]string
- func (s *RaftServer) Stop() error
- func (s *RaftServer) WaitForDetectLeader(timeout time.Duration) error
- type RootHandler
- type SearchHandler
- 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 NewDeleteDocumentHandler ¶
func NewDeleteDocumentHandler(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(clusterConfig *config.ClusterConfig, raftServer *RaftServer, logger *zap.Logger) (*GRPCService, error)
func (*GRPCService) DeleteDocument ¶
func (s *GRPCService) DeleteDocument(stream protobuf.Blast_DeleteDocumentServer) error
func (*GRPCService) DeleteNode ¶
func (s *GRPCService) DeleteNode(ctx context.Context, req *protobuf.DeleteNodeRequest) (*empty.Empty, error)
func (*GRPCService) GetCluster ¶
func (s *GRPCService) GetCluster(ctx context.Context, req *empty.Empty) (*protobuf.GetClusterResponse, error)
func (*GRPCService) GetDocument ¶
func (s *GRPCService) GetDocument(ctx context.Context, req *protobuf.GetDocumentRequest) (*protobuf.GetDocumentResponse, error)
func (*GRPCService) GetIndexConfig ¶
func (s *GRPCService) GetIndexConfig(ctx context.Context, req *empty.Empty) (*protobuf.GetIndexConfigResponse, error)
func (*GRPCService) GetIndexStats ¶
func (s *GRPCService) GetIndexStats(ctx context.Context, req *empty.Empty) (*protobuf.GetIndexStatsResponse, error)
func (*GRPCService) GetNode ¶
func (s *GRPCService) GetNode(ctx context.Context, req *protobuf.GetNodeRequest) (*protobuf.GetNodeResponse, error)
func (*GRPCService) IndexDocument ¶
func (s *GRPCService) IndexDocument(stream protobuf.Blast_IndexDocumentServer) error
func (*GRPCService) NodeID ¶ added in v0.7.1
func (s *GRPCService) NodeID() string
func (*GRPCService) Search ¶
func (s *GRPCService) Search(ctx context.Context, req *protobuf.SearchRequest) (*protobuf.SearchResponse, error)
func (*GRPCService) SetNode ¶
func (s *GRPCService) SetNode(ctx context.Context, req *protobuf.SetNodeRequest) (*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
type GetHandler ¶
type GetHandler struct {
// contains filtered or unexported fields
}
func NewGetDocumentHandler ¶
func NewGetDocumentHandler(client *grpc.Client, logger *zap.Logger) *GetHandler
func (*GetHandler) ServeHTTP ¶
func (h *GetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
func (*Index) Search ¶
func (i *Index) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
func (*Index) SnapshotItems ¶
type IndexHandler ¶
type IndexHandler struct {
// contains filtered or unexported fields
}
func NewSetDocumentHandler ¶
func NewSetDocumentHandler(client *grpc.Client, logger *zap.Logger) *IndexHandler
func (*IndexHandler) ServeHTTP ¶
func (h *IndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RaftFSM ¶
type RaftFSM struct {
// contains filtered or unexported fields
}
func NewRaftFSM ¶
func (*RaftFSM) DeleteDocument ¶ added in v0.7.1
func (*RaftFSM) DeleteDocuments ¶ added in v0.7.1
func (*RaftFSM) DeleteNodeConfig ¶ added in v0.7.1
func (*RaftFSM) GetDocument ¶
func (*RaftFSM) GetIndexConfig ¶
func (*RaftFSM) GetIndexStats ¶
func (*RaftFSM) GetNodeConfig ¶ added in v0.7.1
func (*RaftFSM) IndexDocument ¶ added in v0.7.1
func (*RaftFSM) IndexDocuments ¶ added in v0.7.1
func (*RaftFSM) Search ¶
func (f *RaftFSM) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
func (*RaftFSM) SetNodeConfig ¶ added in v0.7.1
type RaftFSMSnapshot ¶ added in v0.7.1
type RaftFSMSnapshot struct {
// contains filtered or unexported fields
}
func (*RaftFSMSnapshot) Persist ¶ added in v0.7.1
func (f *RaftFSMSnapshot) Persist(sink raft.SnapshotSink) error
func (*RaftFSMSnapshot) Release ¶ added in v0.7.1
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) DeleteDocument ¶
func (s *RaftServer) DeleteDocument(ids []string) (int, error)
func (*RaftServer) DeleteNode ¶ added in v0.7.1
func (s *RaftServer) DeleteNode(nodeId string) error
func (*RaftServer) GetCluster ¶ added in v0.7.1
func (s *RaftServer) GetCluster() (map[string]interface{}, error)
func (*RaftServer) GetDocument ¶
func (s *RaftServer) GetDocument(id string) (map[string]interface{}, error)
func (*RaftServer) GetIndexConfig ¶
func (s *RaftServer) GetIndexConfig() (map[string]interface{}, error)
func (*RaftServer) GetIndexStats ¶
func (s *RaftServer) GetIndexStats() (map[string]interface{}, error)
func (*RaftServer) GetNode ¶ added in v0.7.1
func (s *RaftServer) GetNode(id string) (map[string]interface{}, error)
func (*RaftServer) IndexDocument ¶
func (s *RaftServer) IndexDocument(docs []map[string]interface{}) (int, error)
func (*RaftServer) IsLeader ¶
func (s *RaftServer) IsLeader() bool
func (*RaftServer) LeaderAddress ¶
func (s *RaftServer) LeaderAddress(timeout time.Duration) (raft.ServerAddress, error)
func (*RaftServer) NodeID ¶ added in v0.7.1
func (s *RaftServer) NodeID() string
func (*RaftServer) Search ¶
func (s *RaftServer) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
func (*RaftServer) SetNode ¶ added in v0.7.1
func (s *RaftServer) SetNode(nodeId string, nodeConfig map[string]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 SearchHandler ¶
type SearchHandler struct {
// contains filtered or unexported fields
}
func NewSearchHandler ¶
func NewSearchHandler(client *grpc.Client, logger *zap.Logger) *SearchHandler
func (*SearchHandler) ServeHTTP ¶
func (h *SearchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.