GrpcClient implements the Search() and DocCount() subset of the bleve.Index interface by accessing a remote cbft server via grpc protocol. This allows callers to add a GrpcClient as a target of a bleve.IndexAlias, and implements cbft protocol features like query consistency and auth.
| 40 | // a bleve.IndexAlias, and implements cbft protocol features like |
| 41 | // query consistency and auth. |
| 42 | type GrpcClient struct { |
| 43 | Mgr *cbgt.Manager |
| 44 | name string |
| 45 | HostPort string |
| 46 | IndexName string |
| 47 | IndexUUID string |
| 48 | PIndexNames []string |
| 49 | |
| 50 | Consistency *cbgt.ConsistencyParams |
| 51 | GrpcCli pb.SearchServiceClient |
| 52 | |
| 53 | lastMutex sync.RWMutex |
| 54 | lastSearchStatus int |
| 55 | lastErrBody []byte |
| 56 | sc streamHandler |
| 57 | } |
| 58 | |
| 59 | func (g *GrpcClient) SetStreamHandler(sc streamHandler) { |
| 60 | g.sc = sc |
nothing calls this directly
no outgoing calls
no test coverage detected