Documentation ¶
Index ¶
- Constants
- type GRPCGateway
- type GRPCServer
- type GRPCService
- func (s *GRPCService) BulkDelete(ctx context.Context, req *protobuf.DeleteDocuments) (*emptypb.Empty, error)
- func (s *GRPCService) Cluster(ctx context.Context, req *empty.Empty) (*protobuf.ClusterResponse, error)
- func (s *GRPCService) Delete(ctx context.Context, in *protobuf.DeleteDocument) (*emptypb.Empty, error)
- func (s *GRPCService) DeleteDictionary(ctx context.Context, req *protobuf.DeleteDictionaryRequest) (*protobuf.DictionaryResponse, error)
- func (s *GRPCService) Join(ctx context.Context, req *protobuf.JoinRequest) (*emptypb.Empty, error)
- func (s *GRPCService) Leave(ctx context.Context, req *protobuf.LeaveRequest) (*emptypb.Empty, error)
- func (s *GRPCService) LivenessCheck(ctx context.Context, in *emptypb.Empty) (*protobuf.LivenessCheckResponse, error)
- func (s *GRPCService) Metrics(ctx context.Context, req *empty.Empty) (*protobuf.MetricsResponse, error)
- func (s *GRPCService) Node(ctx context.Context, req *empty.Empty) (*protobuf.NodeResponse, error)
- func (s *GRPCService) ReadinessCheck(context.Context, *emptypb.Empty) (*protobuf.ReadinessCheckResponse, error)
- func (s *GRPCService) Search(ctx context.Context, req *protobuf.SearchRequest) (*protobuf.SearchResponse, error)
- func (s *GRPCService) Start() error
- func (s *GRPCService) Stop() error
- func (s *GRPCService) Upload(ctx context.Context, req *protobuf.Documents) (*emptypb.Empty, error)
- func (s *GRPCService) UploadDictionary(ctx context.Context, req *protobuf.UserDictionaryRecords) (*protobuf.DictionaryResponse, error)
- func (s *GRPCService) Watch(req *empty.Empty, server protobuf.Docsearch_WatchServer) error
- type Option
- type RaftServer
- func (s *RaftServer) AddUserDictionary(req *protobuf.UserDictionaryRecords) (*protobuf.DictionaryResponse, error)
- func (s *RaftServer) BulkDelete(req *protobuf.DeleteDocuments) error
- func (s *RaftServer) Exist(id string) (bool, error)
- func (s *RaftServer) Join(id string, node *protobuf.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(id string) error
- func (s *RaftServer) Node() (*protobuf.Node, error)
- func (s *RaftServer) Nodes() (map[string]*protobuf.Node, error)
- func (s *RaftServer) RemoveDictionary(req *protobuf.DeleteDictionaryRequest) (*protobuf.DictionaryResponse, error)
- func (s *RaftServer) Search(req *protobuf.SearchRequest) (*protobuf.SearchResponse, error)
- func (s *RaftServer) Start() error
- func (s *RaftServer) State() raft.RaftState
- func (s *RaftServer) StateStr() string
- func (s *RaftServer) Stop() error
- func (s *RaftServer) Upload(req *protobuf.Documents) error
- func (s *RaftServer) WaitForDetectLeader(timeout time.Duration) error
Constants ¶
View Source
const ( XTenantID = "X-Tenant-ID" XIndexKey = "X-Index-Key" XRequestID = "X-Request-ID" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCGateway ¶
type GRPCGateway struct {
// contains filtered or unexported fields
}
func NewGRPCGateway ¶
func NewGRPCGateway(httpAddress string, grpcAddress string, certFile string, keyFile string, commonName string, logger logger.DefaultLogger) (*GRPCGateway, error)
func (*GRPCGateway) Start ¶
func (s *GRPCGateway) Start() error
func (*GRPCGateway) Stop ¶
func (s *GRPCGateway) Stop() error
type GRPCServer ¶
type GRPCServer struct {
// contains filtered or unexported fields
}
func NewGRPCServerWithTLS ¶
func NewGRPCServerWithTLS(grpcAddress string, raftServer *RaftServer, certificateFile string, keyFile string, commonName string, logger logger.LogrusLogger) (*GRPCServer, error)
func NewGrpcServer ¶
func NewGrpcServer(grpcAddress string, raftServer *RaftServer, logger logger.LogrusLogger) (*GRPCServer, error)
func (*GRPCServer) Start ¶
func (s *GRPCServer) Start() error
func (*GRPCServer) Stop ¶
func (s *GRPCServer) Stop() error
type GRPCService ¶
type GRPCService struct { *protobuf.UnimplementedDocsearchServer // contains filtered or unexported fields }
func NewGRPCService ¶
func NewGRPCService(opts ...Option) (*GRPCService, error)
func (*GRPCService) BulkDelete ¶
func (s *GRPCService) BulkDelete(ctx context.Context, req *protobuf.DeleteDocuments) (*emptypb.Empty, error)
func (*GRPCService) Cluster ¶
func (s *GRPCService) Cluster(ctx context.Context, req *empty.Empty) (*protobuf.ClusterResponse, error)
func (*GRPCService) Delete ¶
func (s *GRPCService) Delete(ctx context.Context, in *protobuf.DeleteDocument) (*emptypb.Empty, error)
func (*GRPCService) DeleteDictionary ¶
func (s *GRPCService) DeleteDictionary(ctx context.Context, req *protobuf.DeleteDictionaryRequest) (*protobuf.DictionaryResponse, error)
func (*GRPCService) Join ¶
func (s *GRPCService) Join(ctx context.Context, req *protobuf.JoinRequest) (*emptypb.Empty, error)
func (*GRPCService) Leave ¶
func (s *GRPCService) Leave(ctx context.Context, req *protobuf.LeaveRequest) (*emptypb.Empty, error)
func (*GRPCService) LivenessCheck ¶
func (s *GRPCService) LivenessCheck(ctx context.Context, in *emptypb.Empty) (*protobuf.LivenessCheckResponse, error)
func (*GRPCService) Metrics ¶
func (s *GRPCService) Metrics(ctx context.Context, req *empty.Empty) (*protobuf.MetricsResponse, error)
func (*GRPCService) Node ¶
func (s *GRPCService) Node(ctx context.Context, req *empty.Empty) (*protobuf.NodeResponse, error)
func (*GRPCService) ReadinessCheck ¶
func (s *GRPCService) ReadinessCheck(context.Context, *emptypb.Empty) (*protobuf.ReadinessCheckResponse, error)
func (*GRPCService) Search ¶
func (s *GRPCService) Search(ctx context.Context, req *protobuf.SearchRequest) (*protobuf.SearchResponse, error)
func (*GRPCService) Start ¶
func (s *GRPCService) Start() error
func (*GRPCService) Stop ¶
func (s *GRPCService) Stop() error
func (*GRPCService) UploadDictionary ¶
func (s *GRPCService) UploadDictionary(ctx context.Context, req *protobuf.UserDictionaryRecords) (*protobuf.DictionaryResponse, error)
func (*GRPCService) Watch ¶
func (s *GRPCService) Watch(req *empty.Empty, server protobuf.Docsearch_WatchServer) error
type Option ¶
type Option func(service *GRPCService)
func WithCertificate ¶
func WithLogger ¶
func WithLogger(logger logger.LogrusLogger) Option
func WithRaftServer ¶
func WithRaftServer(raftServer *RaftServer) Option
type RaftServer ¶
type RaftServer struct {
// contains filtered or unexported fields
}
func NewRaftServer ¶
func NewRaftServer(conf *config.AppConfig, raftAddress string, bootstrap bool, log logger.LogrusLogger) (*RaftServer, error)
func (*RaftServer) AddUserDictionary ¶
func (s *RaftServer) AddUserDictionary(req *protobuf.UserDictionaryRecords) (*protobuf.DictionaryResponse, error)
AddUserDictionary is ユーザー辞書の追加
func (*RaftServer) BulkDelete ¶
func (s *RaftServer) BulkDelete(req *protobuf.DeleteDocuments) error
BulkDelete is ドキュメントの一括削除
func (*RaftServer) Exist ¶
func (s *RaftServer) Exist(id string) (bool, error)
Exist is ノードが既にクラスター内に存在しているか
func (*RaftServer) Join ¶
func (s *RaftServer) Join(id string, node *protobuf.Node) error
Join is ノードの追加
func (*RaftServer) LeaderAddress ¶
func (s *RaftServer) LeaderAddress(timeout time.Duration) (raft.ServerAddress, error)
LeaderAddress is リーダーアドレスの取得
func (*RaftServer) Nodes ¶
func (s *RaftServer) Nodes() (map[string]*protobuf.Node, error)
Nodes is 全ノードの取得
func (*RaftServer) RemoveDictionary ¶
func (s *RaftServer) RemoveDictionary(req *protobuf.DeleteDictionaryRequest) (*protobuf.DictionaryResponse, error)
func (*RaftServer) Search ¶
func (s *RaftServer) Search(req *protobuf.SearchRequest) (*protobuf.SearchResponse, error)
Search is ドキュメントの検索
func (*RaftServer) StateStr ¶
func (s *RaftServer) StateStr() string
StateStr is raft serverの状態を文字列で取得
func (*RaftServer) Upload ¶
func (s *RaftServer) Upload(req *protobuf.Documents) error
Upload is ドキュメンの追加・更新
func (*RaftServer) WaitForDetectLeader ¶
func (s *RaftServer) WaitForDetectLeader(timeout time.Duration) error
WaitForDetectLeader is リーダーの検出待ち
Click to show internal directories.
Click to hide internal directories.