eshttp

package
v0.0.0-...-c75b225 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package eshttp provides methods of communication with Elastic Search by way of HTTP calls

Package eshttp is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SubmitBulkToES(bulk []byte, companyNumbers []byte, esDestURL string, esDestIndex string) ([]byte, error)
	GetAlphaKeys(companyNames []byte, alphaKeyURL string) ([]byte, error)
}

Client provides an interface with which to communicate with Elastic Search by way of HTTP requests

func NewClient

func NewClient(writer write.Writer) Client

NewClient returns a concrete implementation of the Client interface

func NewClientWithRequester

func NewClientWithRequester(writer write.Writer, requester Requester) Client

NewClientWithRequester returns a concrete implementation of the Client interface, taking a custom Requester

type ClientImpl

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

ClientImpl provides a concrete implementation of the Client interface

func (*ClientImpl) GetAlphaKeys

func (c *ClientImpl) GetAlphaKeys(companyNames []byte, alphaKeyURL string) ([]byte, error)

GetAlphaKeys performs a POST request to fetch alpha keys for a given set of company names

func (*ClientImpl) SubmitBulkToES

func (c *ClientImpl) SubmitBulkToES(bulk []byte, companyNumbers []byte, esDestURL string, esDestIndex string) ([]byte, error)

SubmitBulkToES uses an HTTP post request to submit data to Elastic Search

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

func (m *MockClient) GetAlphaKeys(companyNames []byte, alphaKeyURL string) ([]byte, error)

GetAlphaKeys mocks base method.

func (*MockClient) SubmitBulkToES

func (m *MockClient) SubmitBulkToES(bulk, companyNumbers []byte, esDestURL, esDestIndex string) ([]byte, error)

SubmitBulkToES mocks base method.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) GetAlphaKeys

func (mr *MockClientMockRecorder) GetAlphaKeys(companyNames, alphaKeyURL interface{}) *gomock.Call

GetAlphaKeys indicates an expected call of GetAlphaKeys.

func (*MockClientMockRecorder) SubmitBulkToES

func (mr *MockClientMockRecorder) SubmitBulkToES(bulk, companyNumbers, esDestURL, esDestIndex interface{}) *gomock.Call

SubmitBulkToES indicates an expected call of SubmitBulkToES.

type MockRequester

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

MockRequester is a mock of Requester interface

func NewMockRequester

func NewMockRequester(ctrl *gomock.Controller) *MockRequester

NewMockRequester creates a new mock instance

func (*MockRequester) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockRequester) Post

func (m *MockRequester) Post(arg0 []byte, arg1 string) (*http.Response, error)

Post mocks base method

type MockRequesterMockRecorder

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

MockRequesterMockRecorder is the mock recorder for MockRequester

func (*MockRequesterMockRecorder) Post

func (mr *MockRequesterMockRecorder) Post(arg0 interface{}, arg1 interface{}) *gomock.Call

Post indicates an expected call of Post

type Request

type Request struct{}

Request provides a concrete implementation of the Requester interface

func (*Request) Post

func (req *Request) Post(body []byte, uri string) (*http.Response, error)

Post performs a POST request, using a provided body, against a given uri

type Requester

type Requester interface {
	Post(body []byte, uri string) (*http.Response, error)
}

Requester provides an interface by which to execute HTTP requests

func NewRequester

func NewRequester() Requester

NewRequester returns a concrete implementation of the Requester interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL