Documentation ¶
Index ¶
- type BaseClient
- type ConnectorRequest
- type ConnectorResponse
- type CreateConnectorRequest
- type EmptyResponse
- type ErrorResponse
- type GetAllConnectorsResponse
- type GetAllTasksResponse
- type GetConnectorConfigResponse
- type GetConnectorStatusResponse
- type HighLevelClient
- type MockBaseClient
- func (_m *MockBaseClient) CreateConnector(req CreateConnectorRequest) (ConnectorResponse, error)
- func (_m *MockBaseClient) DeleteConnector(req ConnectorRequest) (EmptyResponse, error)
- func (_m *MockBaseClient) GetAll() (GetAllConnectorsResponse, error)
- func (_m *MockBaseClient) GetAllTasks(req ConnectorRequest) (GetAllTasksResponse, error)
- func (_m *MockBaseClient) GetConnector(req ConnectorRequest) (ConnectorResponse, error)
- func (_m *MockBaseClient) GetConnectorConfig(req ConnectorRequest) (GetConnectorConfigResponse, error)
- func (_m *MockBaseClient) GetConnectorStatus(req ConnectorRequest) (GetConnectorStatusResponse, error)
- func (_m *MockBaseClient) GetTaskStatus(req TaskRequest) (TaskStatusResponse, error)
- func (_m *MockBaseClient) PauseConnector(req ConnectorRequest) (EmptyResponse, error)
- func (_m *MockBaseClient) RestartConnector(req ConnectorRequest) (EmptyResponse, error)
- func (_m *MockBaseClient) RestartTask(req TaskRequest) (EmptyResponse, error)
- func (_m *MockBaseClient) ResumeConnector(req ConnectorRequest) (EmptyResponse, error)
- func (_m *MockBaseClient) SetBasicAuth(username string, password string)
- func (_m *MockBaseClient) SetClientCertificates(certs ...tls.Certificate)
- func (_m *MockBaseClient) SetDebug()
- func (_m *MockBaseClient) SetHeader(name string, value string)
- func (_m *MockBaseClient) SetInsecureSSL()
- func (_m *MockBaseClient) UpdateConnector(req CreateConnectorRequest) (ConnectorResponse, error)
- func (_m *MockBaseClient) ValidateConnectorConfig(req ValidateConnectorConfigRequest) (ValidateConnectorConfigResponse, error)
- type MockHighLevelClient
- func (_m *MockHighLevelClient) CreateConnector(req CreateConnectorRequest, sync bool) (ConnectorResponse, error)
- func (_m *MockHighLevelClient) DeleteConnector(req ConnectorRequest, sync bool) (EmptyResponse, error)
- func (_m *MockHighLevelClient) DeployConnector(req CreateConnectorRequest) error
- func (_m *MockHighLevelClient) DeployMultipleConnector(connectors []CreateConnectorRequest) error
- func (_m *MockHighLevelClient) GetAll() (GetAllConnectorsResponse, error)
- func (_m *MockHighLevelClient) GetAllTasks(req ConnectorRequest) (GetAllTasksResponse, error)
- func (_m *MockHighLevelClient) GetConnector(req ConnectorRequest) (ConnectorResponse, error)
- func (_m *MockHighLevelClient) GetConnectorConfig(req ConnectorRequest) (GetConnectorConfigResponse, error)
- func (_m *MockHighLevelClient) GetConnectorStatus(req ConnectorRequest) (GetConnectorStatusResponse, error)
- func (_m *MockHighLevelClient) GetTaskStatus(req TaskRequest) (TaskStatusResponse, error)
- func (_m *MockHighLevelClient) IsUpToDate(connector string, config map[string]interface{}) (bool, error)
- func (_m *MockHighLevelClient) PauseConnector(req ConnectorRequest, sync bool) (EmptyResponse, error)
- func (_m *MockHighLevelClient) RestartConnector(req ConnectorRequest) (EmptyResponse, error)
- func (_m *MockHighLevelClient) RestartTask(req TaskRequest) (EmptyResponse, error)
- func (_m *MockHighLevelClient) ResumeConnector(req ConnectorRequest, sync bool) (EmptyResponse, error)
- func (_m *MockHighLevelClient) SetBasicAuth(username string, password string)
- func (_m *MockHighLevelClient) SetClientCertificates(certs ...tls.Certificate)
- func (_m *MockHighLevelClient) SetDebug()
- func (_m *MockHighLevelClient) SetHeader(name string, value string)
- func (_m *MockHighLevelClient) SetInsecureSSL()
- func (_m *MockHighLevelClient) SetParallelism(value int)
- func (_m *MockHighLevelClient) UpdateConnector(req CreateConnectorRequest, sync bool) (ConnectorResponse, error)
- func (_m *MockHighLevelClient) ValidateConnectorConfig(req ValidateConnectorConfigRequest) (ValidateConnectorConfigResponse, error)
- type TaskDetails
- type TaskID
- type TaskRequest
- type TaskStatus
- type TaskStatusResponse
- type ValidateConfigResponse
- type ValidateConnectorConfigRequest
- type ValidateConnectorConfigResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseClient ¶
type BaseClient interface { GetAll() (GetAllConnectorsResponse, error) GetConnector(req ConnectorRequest) (ConnectorResponse, error) CreateConnector(req CreateConnectorRequest) (ConnectorResponse, error) UpdateConnector(req CreateConnectorRequest) (ConnectorResponse, error) DeleteConnector(req ConnectorRequest) (EmptyResponse, error) GetConnectorConfig(req ConnectorRequest) (GetConnectorConfigResponse, error) GetConnectorStatus(req ConnectorRequest) (GetConnectorStatusResponse, error) RestartConnector(req ConnectorRequest) (EmptyResponse, error) PauseConnector(req ConnectorRequest) (EmptyResponse, error) ResumeConnector(req ConnectorRequest) (EmptyResponse, error) GetAllTasks(req ConnectorRequest) (GetAllTasksResponse, error) GetTaskStatus(req TaskRequest) (TaskStatusResponse, error) RestartTask(req TaskRequest) (EmptyResponse, error) ValidateConnectorConfig(req ValidateConnectorConfigRequest) (ValidateConnectorConfigResponse, error) SetInsecureSSL() SetDebug() SetClientCertificates(certs ...tls.Certificate) SetBasicAuth(username string, password string) SetHeader(name string, value string) }
BaseClient implement the kafka-connect contract as a client handle retries on 409 response
type ConnectorRequest ¶
type ConnectorRequest struct {
Name string `json:"name"`
}
ConnectorRequest is generic request used when interacting with connector endpoint
type ConnectorResponse ¶
type ConnectorResponse struct { EmptyResponse Name string `json:"name"` Config map[string]interface{} `json:"config"` Tasks []TaskID `json:"tasks"` }
ConnectorResponse is generic response when interacting with connector endpoint
type CreateConnectorRequest ¶
type CreateConnectorRequest struct { ConnectorRequest Config map[string]interface{} `json:"config"` }
CreateConnectorRequest is request used for creating connector
type EmptyResponse ¶
type EmptyResponse struct { Code int ErrorResponse }
EmptyResponse is response returned by multiple endpoint when only StatusCode matter
type ErrorResponse ¶
type ErrorResponse struct { ErrorCode int `json:"error_code,omitempty"` Message string `json:"message,omitempty"` }
ErrorResponse is generic error returned by kafka connect
func (ErrorResponse) Error ¶
func (err ErrorResponse) Error() string
type GetAllConnectorsResponse ¶
type GetAllConnectorsResponse struct { EmptyResponse Connectors []string }
GetAllConnectorsResponse is request used to get list of available connectors
type GetAllTasksResponse ¶
type GetAllTasksResponse struct { Code int Tasks []TaskDetails }
GetAllTasksResponse is response to get all tasks of a specific endpoint
type GetConnectorConfigResponse ¶
type GetConnectorConfigResponse struct { EmptyResponse Config map[string]interface{} }
GetConnectorConfigResponse is response returned by GetConfig endpoint
type GetConnectorStatusResponse ¶
type GetConnectorStatusResponse struct { EmptyResponse Name string `json:"name"` ConnectorStatus map[string]string `json:"connector"` TasksStatus []TaskStatus `json:"tasks"` }
GetConnectorStatusResponse is response returned by GetStatus endpoint
type HighLevelClient ¶
type HighLevelClient interface { // kafka-connect api GetAll() (GetAllConnectorsResponse, error) GetConnector(req ConnectorRequest) (ConnectorResponse, error) CreateConnector(req CreateConnectorRequest, sync bool) (ConnectorResponse, error) UpdateConnector(req CreateConnectorRequest, sync bool) (ConnectorResponse, error) DeleteConnector(req ConnectorRequest, sync bool) (EmptyResponse, error) GetConnectorConfig(req ConnectorRequest) (GetConnectorConfigResponse, error) GetConnectorStatus(req ConnectorRequest) (GetConnectorStatusResponse, error) RestartConnector(req ConnectorRequest) (EmptyResponse, error) PauseConnector(req ConnectorRequest, sync bool) (EmptyResponse, error) ResumeConnector(req ConnectorRequest, sync bool) (EmptyResponse, error) GetAllTasks(req ConnectorRequest) (GetAllTasksResponse, error) GetTaskStatus(req TaskRequest) (TaskStatusResponse, error) RestartTask(req TaskRequest) (EmptyResponse, error) ValidateConnectorConfig(req ValidateConnectorConfigRequest) (ValidateConnectorConfigResponse, error) // custom features, mostly composition of previous ones IsUpToDate(connector string, config map[string]interface{}) (bool, error) DeployConnector(req CreateConnectorRequest) (err error) DeployMultipleConnector(connectors []CreateConnectorRequest) (err error) SetInsecureSSL() SetDebug() SetClientCertificates(certs ...tls.Certificate) SetParallelism(value int) SetBasicAuth(username string, password string) SetHeader(name string, value string) }
HighLevelClient support all function of kafka-connect API + some more features
type MockBaseClient ¶
MockBaseClient is an autogenerated mock type for the BaseClient type
func NewMockBaseClient ¶
func NewMockBaseClient(t interface { mock.TestingT Cleanup(func()) }) *MockBaseClient
NewMockBaseClient creates a new instance of MockBaseClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockBaseClient) CreateConnector ¶
func (_m *MockBaseClient) CreateConnector(req CreateConnectorRequest) (ConnectorResponse, error)
CreateConnector provides a mock function with given fields: req
func (*MockBaseClient) DeleteConnector ¶
func (_m *MockBaseClient) DeleteConnector(req ConnectorRequest) (EmptyResponse, error)
DeleteConnector provides a mock function with given fields: req
func (*MockBaseClient) GetAll ¶
func (_m *MockBaseClient) GetAll() (GetAllConnectorsResponse, error)
GetAll provides a mock function with given fields:
func (*MockBaseClient) GetAllTasks ¶
func (_m *MockBaseClient) GetAllTasks(req ConnectorRequest) (GetAllTasksResponse, error)
GetAllTasks provides a mock function with given fields: req
func (*MockBaseClient) GetConnector ¶
func (_m *MockBaseClient) GetConnector(req ConnectorRequest) (ConnectorResponse, error)
GetConnector provides a mock function with given fields: req
func (*MockBaseClient) GetConnectorConfig ¶
func (_m *MockBaseClient) GetConnectorConfig(req ConnectorRequest) (GetConnectorConfigResponse, error)
GetConnectorConfig provides a mock function with given fields: req
func (*MockBaseClient) GetConnectorStatus ¶
func (_m *MockBaseClient) GetConnectorStatus(req ConnectorRequest) (GetConnectorStatusResponse, error)
GetConnectorStatus provides a mock function with given fields: req
func (*MockBaseClient) GetTaskStatus ¶
func (_m *MockBaseClient) GetTaskStatus(req TaskRequest) (TaskStatusResponse, error)
GetTaskStatus provides a mock function with given fields: req
func (*MockBaseClient) PauseConnector ¶
func (_m *MockBaseClient) PauseConnector(req ConnectorRequest) (EmptyResponse, error)
PauseConnector provides a mock function with given fields: req
func (*MockBaseClient) RestartConnector ¶
func (_m *MockBaseClient) RestartConnector(req ConnectorRequest) (EmptyResponse, error)
RestartConnector provides a mock function with given fields: req
func (*MockBaseClient) RestartTask ¶
func (_m *MockBaseClient) RestartTask(req TaskRequest) (EmptyResponse, error)
RestartTask provides a mock function with given fields: req
func (*MockBaseClient) ResumeConnector ¶
func (_m *MockBaseClient) ResumeConnector(req ConnectorRequest) (EmptyResponse, error)
ResumeConnector provides a mock function with given fields: req
func (*MockBaseClient) SetBasicAuth ¶
func (_m *MockBaseClient) SetBasicAuth(username string, password string)
SetBasicAuth provides a mock function with given fields: username, password
func (*MockBaseClient) SetClientCertificates ¶
func (_m *MockBaseClient) SetClientCertificates(certs ...tls.Certificate)
SetClientCertificates provides a mock function with given fields: certs
func (*MockBaseClient) SetDebug ¶
func (_m *MockBaseClient) SetDebug()
SetDebug provides a mock function with given fields:
func (*MockBaseClient) SetHeader ¶
func (_m *MockBaseClient) SetHeader(name string, value string)
SetHeader provides a mock function with given fields: name, value
func (*MockBaseClient) SetInsecureSSL ¶
func (_m *MockBaseClient) SetInsecureSSL()
SetInsecureSSL provides a mock function with given fields:
func (*MockBaseClient) UpdateConnector ¶
func (_m *MockBaseClient) UpdateConnector(req CreateConnectorRequest) (ConnectorResponse, error)
UpdateConnector provides a mock function with given fields: req
func (*MockBaseClient) ValidateConnectorConfig ¶
func (_m *MockBaseClient) ValidateConnectorConfig(req ValidateConnectorConfigRequest) (ValidateConnectorConfigResponse, error)
ValidateConnectorConfig provides a mock function with given fields: req
type MockHighLevelClient ¶
MockHighLevelClient is an autogenerated mock type for the HighLevelClient type
func NewMockHighLevelClient ¶
func NewMockHighLevelClient(t interface { mock.TestingT Cleanup(func()) }) *MockHighLevelClient
NewMockHighLevelClient creates a new instance of MockHighLevelClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockHighLevelClient) CreateConnector ¶
func (_m *MockHighLevelClient) CreateConnector(req CreateConnectorRequest, sync bool) (ConnectorResponse, error)
CreateConnector provides a mock function with given fields: req, sync
func (*MockHighLevelClient) DeleteConnector ¶
func (_m *MockHighLevelClient) DeleteConnector(req ConnectorRequest, sync bool) (EmptyResponse, error)
DeleteConnector provides a mock function with given fields: req, sync
func (*MockHighLevelClient) DeployConnector ¶
func (_m *MockHighLevelClient) DeployConnector(req CreateConnectorRequest) error
DeployConnector provides a mock function with given fields: req
func (*MockHighLevelClient) DeployMultipleConnector ¶
func (_m *MockHighLevelClient) DeployMultipleConnector(connectors []CreateConnectorRequest) error
DeployMultipleConnector provides a mock function with given fields: connectors
func (*MockHighLevelClient) GetAll ¶
func (_m *MockHighLevelClient) GetAll() (GetAllConnectorsResponse, error)
GetAll provides a mock function with given fields:
func (*MockHighLevelClient) GetAllTasks ¶
func (_m *MockHighLevelClient) GetAllTasks(req ConnectorRequest) (GetAllTasksResponse, error)
GetAllTasks provides a mock function with given fields: req
func (*MockHighLevelClient) GetConnector ¶
func (_m *MockHighLevelClient) GetConnector(req ConnectorRequest) (ConnectorResponse, error)
GetConnector provides a mock function with given fields: req
func (*MockHighLevelClient) GetConnectorConfig ¶
func (_m *MockHighLevelClient) GetConnectorConfig(req ConnectorRequest) (GetConnectorConfigResponse, error)
GetConnectorConfig provides a mock function with given fields: req
func (*MockHighLevelClient) GetConnectorStatus ¶
func (_m *MockHighLevelClient) GetConnectorStatus(req ConnectorRequest) (GetConnectorStatusResponse, error)
GetConnectorStatus provides a mock function with given fields: req
func (*MockHighLevelClient) GetTaskStatus ¶
func (_m *MockHighLevelClient) GetTaskStatus(req TaskRequest) (TaskStatusResponse, error)
GetTaskStatus provides a mock function with given fields: req
func (*MockHighLevelClient) IsUpToDate ¶
func (_m *MockHighLevelClient) IsUpToDate(connector string, config map[string]interface{}) (bool, error)
IsUpToDate provides a mock function with given fields: connector, config
func (*MockHighLevelClient) PauseConnector ¶
func (_m *MockHighLevelClient) PauseConnector(req ConnectorRequest, sync bool) (EmptyResponse, error)
PauseConnector provides a mock function with given fields: req, sync
func (*MockHighLevelClient) RestartConnector ¶
func (_m *MockHighLevelClient) RestartConnector(req ConnectorRequest) (EmptyResponse, error)
RestartConnector provides a mock function with given fields: req
func (*MockHighLevelClient) RestartTask ¶
func (_m *MockHighLevelClient) RestartTask(req TaskRequest) (EmptyResponse, error)
RestartTask provides a mock function with given fields: req
func (*MockHighLevelClient) ResumeConnector ¶
func (_m *MockHighLevelClient) ResumeConnector(req ConnectorRequest, sync bool) (EmptyResponse, error)
ResumeConnector provides a mock function with given fields: req, sync
func (*MockHighLevelClient) SetBasicAuth ¶
func (_m *MockHighLevelClient) SetBasicAuth(username string, password string)
SetBasicAuth provides a mock function with given fields: username, password
func (*MockHighLevelClient) SetClientCertificates ¶
func (_m *MockHighLevelClient) SetClientCertificates(certs ...tls.Certificate)
SetClientCertificates provides a mock function with given fields: certs
func (*MockHighLevelClient) SetDebug ¶
func (_m *MockHighLevelClient) SetDebug()
SetDebug provides a mock function with given fields:
func (*MockHighLevelClient) SetHeader ¶
func (_m *MockHighLevelClient) SetHeader(name string, value string)
SetHeader provides a mock function with given fields: name, value
func (*MockHighLevelClient) SetInsecureSSL ¶
func (_m *MockHighLevelClient) SetInsecureSSL()
SetInsecureSSL provides a mock function with given fields:
func (*MockHighLevelClient) SetParallelism ¶
func (_m *MockHighLevelClient) SetParallelism(value int)
SetParallelism provides a mock function with given fields: value
func (*MockHighLevelClient) UpdateConnector ¶
func (_m *MockHighLevelClient) UpdateConnector(req CreateConnectorRequest, sync bool) (ConnectorResponse, error)
UpdateConnector provides a mock function with given fields: req, sync
func (*MockHighLevelClient) ValidateConnectorConfig ¶
func (_m *MockHighLevelClient) ValidateConnectorConfig(req ValidateConnectorConfigRequest) (ValidateConnectorConfigResponse, error)
ValidateConnectorConfig provides a mock function with given fields: req
type TaskDetails ¶
TaskDetails is detail of a specific task on a specific endpoint
type TaskRequest ¶
TaskRequest is generic request when interacting with task endpoint
type TaskStatus ¶
type TaskStatus struct { ID int `json:"id"` State string `json:"state"` WorkerID string `json:"worker_id"` Trace string `json:"trace,omitempty"` }
TaskStatus define task status
type TaskStatusResponse ¶
type TaskStatusResponse struct { Code int Status TaskStatus }
TaskStatusResponse is response returned by get task status endpoint
type ValidateConfigResponse ¶
type ValidateConnectorConfigRequest ¶
type ValidateConnectorConfigRequest struct { ConnectorRequest Config map[string]interface{} `json:"config"` }
type ValidateConnectorConfigResponse ¶
type ValidateConnectorConfigResponse struct { EmptyResponse Name string `json:"name"` ErrorCount int `json:"error_count"` Groups []string `json:"groups"` Configs []ValidateConfigResponse `json:"configs"` }