Documentation ¶
Overview ¶
Package client is a generated GoMock package.
Package client is a generated GoMock package.
Index ¶
- func NewAwsHttpClient(config config.ESAWSRequestSigningConfig) (*http.Client, error)
- type BulkProcessor
- type BulkProcessorParameters
- type BulkService
- type BulkableRequest
- type BulkableRequestType
- type CLIClient
- type Client
- type IntegrationTestsClient
- type MockBulkProcessor
- type MockBulkProcessorMockRecorder
- type MockCLIClient
- func (m *MockCLIClient) Bulk() BulkService
- func (m *MockCLIClient) CatIndices(ctx context.Context) (v7.CatIndicesResponse, error)
- func (m *MockCLIClient) Count(ctx context.Context, index, query string) (int64, error)
- func (m *MockCLIClient) EXPECT() *MockCLIClientMockRecorder
- func (m *MockCLIClient) PutMapping(ctx context.Context, index, root, key, valueType string) error
- func (m *MockCLIClient) RunBulkProcessor(ctx context.Context, p *BulkProcessorParameters) (BulkProcessor, error)
- func (m *MockCLIClient) Scroll(ctx context.Context, scrollID string) (*v7.SearchResult, ScrollService, error)
- func (m *MockCLIClient) ScrollFirstPage(ctx context.Context, index, query string) (*v7.SearchResult, ScrollService, error)
- func (m *MockCLIClient) Search(ctx context.Context, p *SearchParameters) (*v7.SearchResult, error)
- func (m *MockCLIClient) SearchWithDSL(ctx context.Context, index, query string) (*v7.SearchResult, error)
- type MockCLIClientMockRecorder
- func (mr *MockCLIClientMockRecorder) Bulk() *gomock.Call
- func (mr *MockCLIClientMockRecorder) CatIndices(ctx interface{}) *gomock.Call
- func (mr *MockCLIClientMockRecorder) Count(ctx, index, query interface{}) *gomock.Call
- func (mr *MockCLIClientMockRecorder) PutMapping(ctx, index, root, key, valueType interface{}) *gomock.Call
- func (mr *MockCLIClientMockRecorder) RunBulkProcessor(ctx, p interface{}) *gomock.Call
- func (mr *MockCLIClientMockRecorder) Scroll(ctx, scrollID interface{}) *gomock.Call
- func (mr *MockCLIClientMockRecorder) ScrollFirstPage(ctx, index, query interface{}) *gomock.Call
- func (mr *MockCLIClientMockRecorder) Search(ctx, p interface{}) *gomock.Call
- func (mr *MockCLIClientMockRecorder) SearchWithDSL(ctx, index, query interface{}) *gomock.Call
- type MockClient
- func (m *MockClient) Count(ctx context.Context, index, query string) (int64, error)
- func (m *MockClient) EXPECT() *MockClientMockRecorder
- func (m *MockClient) PutMapping(ctx context.Context, index, root, key, valueType string) error
- func (m *MockClient) RunBulkProcessor(ctx context.Context, p *BulkProcessorParameters) (BulkProcessor, error)
- func (m *MockClient) Scroll(ctx context.Context, scrollID string) (*v7.SearchResult, ScrollService, error)
- func (m *MockClient) ScrollFirstPage(ctx context.Context, index, query string) (*v7.SearchResult, ScrollService, error)
- func (m *MockClient) Search(ctx context.Context, p *SearchParameters) (*v7.SearchResult, error)
- func (m *MockClient) SearchWithDSL(ctx context.Context, index, query string) (*v7.SearchResult, error)
- type MockClientMockRecorder
- func (mr *MockClientMockRecorder) Count(ctx, index, query interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) PutMapping(ctx, index, root, key, valueType interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) RunBulkProcessor(ctx, p interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) Scroll(ctx, scrollID interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) ScrollFirstPage(ctx, index, query interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) Search(ctx, p interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) SearchWithDSL(ctx, index, query interface{}) *gomock.Call
- type MockIntegrationTestsClient
- func (m *MockIntegrationTestsClient) CreateIndex(ctx context.Context, index string) (bool, error)
- func (m *MockIntegrationTestsClient) DeleteIndex(ctx context.Context, indexName string) (bool, error)
- func (m *MockIntegrationTestsClient) EXPECT() *MockIntegrationTestsClientMockRecorder
- func (m *MockIntegrationTestsClient) IndexExists(ctx context.Context, indexName string) (bool, error)
- func (m *MockIntegrationTestsClient) IndexGetSettings(ctx context.Context, indexName string) (map[string]*v7.IndicesGetSettingsResponse, error)
- func (m *MockIntegrationTestsClient) IndexPutSettings(ctx context.Context, indexName, bodyString string) (bool, error)
- func (m *MockIntegrationTestsClient) IndexPutTemplate(ctx context.Context, templateName, bodyString string) (bool, error)
- type MockIntegrationTestsClientMockRecorder
- func (mr *MockIntegrationTestsClientMockRecorder) CreateIndex(ctx, index interface{}) *gomock.Call
- func (mr *MockIntegrationTestsClientMockRecorder) DeleteIndex(ctx, indexName interface{}) *gomock.Call
- func (mr *MockIntegrationTestsClientMockRecorder) IndexExists(ctx, indexName interface{}) *gomock.Call
- func (mr *MockIntegrationTestsClientMockRecorder) IndexGetSettings(ctx, indexName interface{}) *gomock.Call
- func (mr *MockIntegrationTestsClientMockRecorder) IndexPutSettings(ctx, indexName, bodyString interface{}) *gomock.Call
- func (mr *MockIntegrationTestsClientMockRecorder) IndexPutTemplate(ctx, templateName, bodyString interface{}) *gomock.Call
- type MockScrollService
- type MockScrollServiceMockRecorder
- type ScrollService
- type SearchParameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAwsHttpClient ¶
func NewAwsHttpClient(config config.ESAWSRequestSigningConfig) (*http.Client, error)
Types ¶
type BulkProcessor ¶
type BulkProcessor interface { Stop() error Add(request *BulkableRequest) }
type BulkProcessorParameters ¶
type BulkProcessorParameters struct { Name string NumOfWorkers int BulkActions int BulkSize int FlushInterval time.Duration Backoff elastic.Backoff BeforeFunc elastic.BulkBeforeFunc AfterFunc elastic.BulkAfterFunc }
BulkProcessorParameters holds all required and optional parameters for executing bulk service
type BulkService ¶
type BulkService interface { Do(ctx context.Context) error NumberOfActions() int Add(request *BulkableRequest) }
type BulkableRequest ¶
type BulkableRequest struct { RequestType BulkableRequestType Index string ID string Version int64 Doc map[string]interface{} }
type BulkableRequestType ¶
type BulkableRequestType uint8
const ( BulkableRequestTypeIndex BulkableRequestType = iota BulkableRequestTypeDelete )
type CLIClient ¶
type CLIClient interface { Client CatIndices(ctx context.Context) (elastic.CatIndicesResponse, error) Bulk() BulkService }
type Client ¶
type Client interface { Search(ctx context.Context, p *SearchParameters) (*elastic.SearchResult, error) SearchWithDSL(ctx context.Context, index, query string) (*elastic.SearchResult, error) Scroll(ctx context.Context, scrollID string) (*elastic.SearchResult, ScrollService, error) ScrollFirstPage(ctx context.Context, index, query string) (*elastic.SearchResult, ScrollService, error) Count(ctx context.Context, index, query string) (int64, error) RunBulkProcessor(ctx context.Context, p *BulkProcessorParameters) (BulkProcessor, error) PutMapping(ctx context.Context, index, root, key, valueType string) error }
Client is a wrapper around ElasticSearch client library. It simplifies the interface and enables mocking. We intentionally let implementation details of the elastic library bleed through, as the main purpose is testability not abstraction.
type IntegrationTestsClient ¶
type IntegrationTestsClient interface { CreateIndex(ctx context.Context, index string) (bool, error) IndexPutTemplate(ctx context.Context, templateName string, bodyString string) (bool, error) IndexExists(ctx context.Context, indexName string) (bool, error) DeleteIndex(ctx context.Context, indexName string) (bool, error) IndexPutSettings(ctx context.Context, indexName string, bodyString string) (bool, error) IndexGetSettings(ctx context.Context, indexName string) (map[string]*elastic.IndicesGetSettingsResponse, error) }
func NewIntegrationTestsClient ¶
func NewIntegrationTestsClient(url string, version string) (IntegrationTestsClient, error)
type MockBulkProcessor ¶
type MockBulkProcessor struct {
// contains filtered or unexported fields
}
MockBulkProcessor is a mock of BulkProcessor interface.
func NewMockBulkProcessor ¶
func NewMockBulkProcessor(ctrl *gomock.Controller) *MockBulkProcessor
NewMockBulkProcessor creates a new mock instance.
func (*MockBulkProcessor) Add ¶
func (m *MockBulkProcessor) Add(request *BulkableRequest)
Add mocks base method.
func (*MockBulkProcessor) EXPECT ¶
func (m *MockBulkProcessor) EXPECT() *MockBulkProcessorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockBulkProcessorMockRecorder ¶
type MockBulkProcessorMockRecorder struct {
// contains filtered or unexported fields
}
MockBulkProcessorMockRecorder is the mock recorder for MockBulkProcessor.
func (*MockBulkProcessorMockRecorder) Add ¶
func (mr *MockBulkProcessorMockRecorder) Add(request interface{}) *gomock.Call
Add indicates an expected call of Add.
func (*MockBulkProcessorMockRecorder) Stop ¶
func (mr *MockBulkProcessorMockRecorder) Stop() *gomock.Call
Stop indicates an expected call of Stop.
type MockCLIClient ¶
type MockCLIClient struct {
// contains filtered or unexported fields
}
MockCLIClient is a mock of CLIClient interface.
func NewMockCLIClient ¶
func NewMockCLIClient(ctrl *gomock.Controller) *MockCLIClient
NewMockCLIClient creates a new mock instance.
func (*MockCLIClient) CatIndices ¶
func (m *MockCLIClient) CatIndices(ctx context.Context) (v7.CatIndicesResponse, error)
CatIndices mocks base method.
func (*MockCLIClient) EXPECT ¶
func (m *MockCLIClient) EXPECT() *MockCLIClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCLIClient) PutMapping ¶
func (m *MockCLIClient) PutMapping(ctx context.Context, index, root, key, valueType string) error
PutMapping mocks base method.
func (*MockCLIClient) RunBulkProcessor ¶
func (m *MockCLIClient) RunBulkProcessor(ctx context.Context, p *BulkProcessorParameters) (BulkProcessor, error)
RunBulkProcessor mocks base method.
func (*MockCLIClient) Scroll ¶
func (m *MockCLIClient) Scroll(ctx context.Context, scrollID string) (*v7.SearchResult, ScrollService, error)
Scroll mocks base method.
func (*MockCLIClient) ScrollFirstPage ¶
func (m *MockCLIClient) ScrollFirstPage(ctx context.Context, index, query string) (*v7.SearchResult, ScrollService, error)
ScrollFirstPage mocks base method.
func (*MockCLIClient) Search ¶
func (m *MockCLIClient) Search(ctx context.Context, p *SearchParameters) (*v7.SearchResult, error)
Search mocks base method.
func (*MockCLIClient) SearchWithDSL ¶
func (m *MockCLIClient) SearchWithDSL(ctx context.Context, index, query string) (*v7.SearchResult, error)
SearchWithDSL mocks base method.
type MockCLIClientMockRecorder ¶
type MockCLIClientMockRecorder struct {
// contains filtered or unexported fields
}
MockCLIClientMockRecorder is the mock recorder for MockCLIClient.
func (*MockCLIClientMockRecorder) Bulk ¶
func (mr *MockCLIClientMockRecorder) Bulk() *gomock.Call
Bulk indicates an expected call of Bulk.
func (*MockCLIClientMockRecorder) CatIndices ¶
func (mr *MockCLIClientMockRecorder) CatIndices(ctx interface{}) *gomock.Call
CatIndices indicates an expected call of CatIndices.
func (*MockCLIClientMockRecorder) Count ¶
func (mr *MockCLIClientMockRecorder) Count(ctx, index, query interface{}) *gomock.Call
Count indicates an expected call of Count.
func (*MockCLIClientMockRecorder) PutMapping ¶
func (mr *MockCLIClientMockRecorder) PutMapping(ctx, index, root, key, valueType interface{}) *gomock.Call
PutMapping indicates an expected call of PutMapping.
func (*MockCLIClientMockRecorder) RunBulkProcessor ¶
func (mr *MockCLIClientMockRecorder) RunBulkProcessor(ctx, p interface{}) *gomock.Call
RunBulkProcessor indicates an expected call of RunBulkProcessor.
func (*MockCLIClientMockRecorder) Scroll ¶
func (mr *MockCLIClientMockRecorder) Scroll(ctx, scrollID interface{}) *gomock.Call
Scroll indicates an expected call of Scroll.
func (*MockCLIClientMockRecorder) ScrollFirstPage ¶
func (mr *MockCLIClientMockRecorder) ScrollFirstPage(ctx, index, query interface{}) *gomock.Call
ScrollFirstPage indicates an expected call of ScrollFirstPage.
func (*MockCLIClientMockRecorder) Search ¶
func (mr *MockCLIClientMockRecorder) Search(ctx, p interface{}) *gomock.Call
Search indicates an expected call of Search.
func (*MockCLIClientMockRecorder) SearchWithDSL ¶
func (mr *MockCLIClientMockRecorder) SearchWithDSL(ctx, index, query interface{}) *gomock.Call
SearchWithDSL indicates an expected call of SearchWithDSL.
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) EXPECT ¶
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClient) PutMapping ¶
func (m *MockClient) PutMapping(ctx context.Context, index, root, key, valueType string) error
PutMapping mocks base method.
func (*MockClient) RunBulkProcessor ¶
func (m *MockClient) RunBulkProcessor(ctx context.Context, p *BulkProcessorParameters) (BulkProcessor, error)
RunBulkProcessor mocks base method.
func (*MockClient) Scroll ¶
func (m *MockClient) Scroll(ctx context.Context, scrollID string) (*v7.SearchResult, ScrollService, error)
Scroll mocks base method.
func (*MockClient) ScrollFirstPage ¶
func (m *MockClient) ScrollFirstPage(ctx context.Context, index, query string) (*v7.SearchResult, ScrollService, error)
ScrollFirstPage mocks base method.
func (*MockClient) Search ¶
func (m *MockClient) Search(ctx context.Context, p *SearchParameters) (*v7.SearchResult, error)
Search mocks base method.
func (*MockClient) SearchWithDSL ¶
func (m *MockClient) SearchWithDSL(ctx context.Context, index, query string) (*v7.SearchResult, error)
SearchWithDSL mocks base method.
type MockClientMockRecorder ¶
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
func (*MockClientMockRecorder) Count ¶
func (mr *MockClientMockRecorder) Count(ctx, index, query interface{}) *gomock.Call
Count indicates an expected call of Count.
func (*MockClientMockRecorder) PutMapping ¶
func (mr *MockClientMockRecorder) PutMapping(ctx, index, root, key, valueType interface{}) *gomock.Call
PutMapping indicates an expected call of PutMapping.
func (*MockClientMockRecorder) RunBulkProcessor ¶
func (mr *MockClientMockRecorder) RunBulkProcessor(ctx, p interface{}) *gomock.Call
RunBulkProcessor indicates an expected call of RunBulkProcessor.
func (*MockClientMockRecorder) Scroll ¶
func (mr *MockClientMockRecorder) Scroll(ctx, scrollID interface{}) *gomock.Call
Scroll indicates an expected call of Scroll.
func (*MockClientMockRecorder) ScrollFirstPage ¶
func (mr *MockClientMockRecorder) ScrollFirstPage(ctx, index, query interface{}) *gomock.Call
ScrollFirstPage indicates an expected call of ScrollFirstPage.
func (*MockClientMockRecorder) Search ¶
func (mr *MockClientMockRecorder) Search(ctx, p interface{}) *gomock.Call
Search indicates an expected call of Search.
func (*MockClientMockRecorder) SearchWithDSL ¶
func (mr *MockClientMockRecorder) SearchWithDSL(ctx, index, query interface{}) *gomock.Call
SearchWithDSL indicates an expected call of SearchWithDSL.
type MockIntegrationTestsClient ¶
type MockIntegrationTestsClient struct {
// contains filtered or unexported fields
}
MockIntegrationTestsClient is a mock of IntegrationTestsClient interface.
func NewMockIntegrationTestsClient ¶
func NewMockIntegrationTestsClient(ctrl *gomock.Controller) *MockIntegrationTestsClient
NewMockIntegrationTestsClient creates a new mock instance.
func (*MockIntegrationTestsClient) CreateIndex ¶
CreateIndex mocks base method.
func (*MockIntegrationTestsClient) DeleteIndex ¶
func (m *MockIntegrationTestsClient) DeleteIndex(ctx context.Context, indexName string) (bool, error)
DeleteIndex mocks base method.
func (*MockIntegrationTestsClient) EXPECT ¶
func (m *MockIntegrationTestsClient) EXPECT() *MockIntegrationTestsClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockIntegrationTestsClient) IndexExists ¶
func (m *MockIntegrationTestsClient) IndexExists(ctx context.Context, indexName string) (bool, error)
IndexExists mocks base method.
func (*MockIntegrationTestsClient) IndexGetSettings ¶
func (m *MockIntegrationTestsClient) IndexGetSettings(ctx context.Context, indexName string) (map[string]*v7.IndicesGetSettingsResponse, error)
IndexGetSettings mocks base method.
func (*MockIntegrationTestsClient) IndexPutSettings ¶
func (m *MockIntegrationTestsClient) IndexPutSettings(ctx context.Context, indexName, bodyString string) (bool, error)
IndexPutSettings mocks base method.
func (*MockIntegrationTestsClient) IndexPutTemplate ¶
func (m *MockIntegrationTestsClient) IndexPutTemplate(ctx context.Context, templateName, bodyString string) (bool, error)
IndexPutTemplate mocks base method.
type MockIntegrationTestsClientMockRecorder ¶
type MockIntegrationTestsClientMockRecorder struct {
// contains filtered or unexported fields
}
MockIntegrationTestsClientMockRecorder is the mock recorder for MockIntegrationTestsClient.
func (*MockIntegrationTestsClientMockRecorder) CreateIndex ¶
func (mr *MockIntegrationTestsClientMockRecorder) CreateIndex(ctx, index interface{}) *gomock.Call
CreateIndex indicates an expected call of CreateIndex.
func (*MockIntegrationTestsClientMockRecorder) DeleteIndex ¶
func (mr *MockIntegrationTestsClientMockRecorder) DeleteIndex(ctx, indexName interface{}) *gomock.Call
DeleteIndex indicates an expected call of DeleteIndex.
func (*MockIntegrationTestsClientMockRecorder) IndexExists ¶
func (mr *MockIntegrationTestsClientMockRecorder) IndexExists(ctx, indexName interface{}) *gomock.Call
IndexExists indicates an expected call of IndexExists.
func (*MockIntegrationTestsClientMockRecorder) IndexGetSettings ¶
func (mr *MockIntegrationTestsClientMockRecorder) IndexGetSettings(ctx, indexName interface{}) *gomock.Call
IndexGetSettings indicates an expected call of IndexGetSettings.
func (*MockIntegrationTestsClientMockRecorder) IndexPutSettings ¶
func (mr *MockIntegrationTestsClientMockRecorder) IndexPutSettings(ctx, indexName, bodyString interface{}) *gomock.Call
IndexPutSettings indicates an expected call of IndexPutSettings.
func (*MockIntegrationTestsClientMockRecorder) IndexPutTemplate ¶
func (mr *MockIntegrationTestsClientMockRecorder) IndexPutTemplate(ctx, templateName, bodyString interface{}) *gomock.Call
IndexPutTemplate indicates an expected call of IndexPutTemplate.
type MockScrollService ¶
type MockScrollService struct {
// contains filtered or unexported fields
}
MockScrollService is a mock of ScrollService interface.
func NewMockScrollService ¶
func NewMockScrollService(ctrl *gomock.Controller) *MockScrollService
NewMockScrollService creates a new mock instance.
func (*MockScrollService) Clear ¶
func (m *MockScrollService) Clear(ctx context.Context) error
Clear mocks base method.
func (*MockScrollService) EXPECT ¶
func (m *MockScrollService) EXPECT() *MockScrollServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockScrollServiceMockRecorder ¶
type MockScrollServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockScrollServiceMockRecorder is the mock recorder for MockScrollService.
func (*MockScrollServiceMockRecorder) Clear ¶
func (mr *MockScrollServiceMockRecorder) Clear(ctx interface{}) *gomock.Call
Clear indicates an expected call of Clear.
type ScrollService ¶
ScrollService is a interface for elastic.ScrollService
type SearchParameters ¶
type SearchParameters struct { Index string Query elastic.Query From int PageSize int Sorter []elastic.Sorter SearchAfter []interface{} }
SearchParameters holds all required and optional parameters for executing a search