Documentation
¶
Index ¶
- type Client
- func (c *Client) ConditionQuery(ctx context.Context, serverID uuid.UUID) (*v1types.ServerResponse, error)
- func (c *Client) ConditionStatusUpdate(ctx context.Context, conditionKind rctypes.Kind, ...) (*v1types.ServerResponse, error)
- func (c *Client) ConditionTaskPublish(ctx context.Context, conditionKind rctypes.Kind, ...) (*v1types.ServerResponse, error)
- func (c *Client) ConditionTaskQuery(ctx context.Context, conditionKind rctypes.Kind, serverID uuid.UUID) (*v1types.ServerResponse, error)
- type Error
- type HTTPRequestDoer
- type MockHTTPRequestDoer
- type MockHTTPRequestDoer_Do_Call
- func (_c *MockHTTPRequestDoer_Do_Call) Return(_a0 *http.Response, _a1 error) *MockHTTPRequestDoer_Do_Call
- func (_c *MockHTTPRequestDoer_Do_Call) Run(run func(req *http.Request)) *MockHTTPRequestDoer_Do_Call
- func (_c *MockHTTPRequestDoer_Do_Call) RunAndReturn(run func(*http.Request) (*http.Response, error)) *MockHTTPRequestDoer_Do_Call
- type MockHTTPRequestDoer_Expecter
- type MockQueryor
- func (_m *MockQueryor) ConditionQuery(ctx context.Context, serverID uuid.UUID) (*types.ServerResponse, error)
- func (_m *MockQueryor) ConditionStatusUpdate(ctx context.Context, conditionKind condition.Kind, serverID uuid.UUID, ...) (*types.ServerResponse, error)
- func (_m *MockQueryor) ConditionTaskPublish(ctx context.Context, conditionKind condition.Kind, serverID uuid.UUID, ...) (*types.ServerResponse, error)
- func (_m *MockQueryor) ConditionTaskQuery(ctx context.Context, conditionKind condition.Kind, serverID uuid.UUID) (*types.ServerResponse, error)
- func (_m *MockQueryor) EXPECT() *MockQueryor_Expecter
- type MockQueryor_ConditionQuery_Call
- func (_c *MockQueryor_ConditionQuery_Call) Return(_a0 *types.ServerResponse, _a1 error) *MockQueryor_ConditionQuery_Call
- func (_c *MockQueryor_ConditionQuery_Call) Run(run func(ctx context.Context, serverID uuid.UUID)) *MockQueryor_ConditionQuery_Call
- func (_c *MockQueryor_ConditionQuery_Call) RunAndReturn(run func(context.Context, uuid.UUID) (*types.ServerResponse, error)) *MockQueryor_ConditionQuery_Call
- type MockQueryor_ConditionStatusUpdate_Call
- func (_c *MockQueryor_ConditionStatusUpdate_Call) Return(_a0 *types.ServerResponse, _a1 error) *MockQueryor_ConditionStatusUpdate_Call
- func (_c *MockQueryor_ConditionStatusUpdate_Call) Run(...) *MockQueryor_ConditionStatusUpdate_Call
- func (_c *MockQueryor_ConditionStatusUpdate_Call) RunAndReturn(...) *MockQueryor_ConditionStatusUpdate_Call
- type MockQueryor_ConditionTaskPublish_Call
- func (_c *MockQueryor_ConditionTaskPublish_Call) Return(_a0 *types.ServerResponse, _a1 error) *MockQueryor_ConditionTaskPublish_Call
- func (_c *MockQueryor_ConditionTaskPublish_Call) Run(...) *MockQueryor_ConditionTaskPublish_Call
- func (_c *MockQueryor_ConditionTaskPublish_Call) RunAndReturn(...) *MockQueryor_ConditionTaskPublish_Call
- type MockQueryor_ConditionTaskQuery_Call
- func (_c *MockQueryor_ConditionTaskQuery_Call) Return(_a0 *types.ServerResponse, _a1 error) *MockQueryor_ConditionTaskQuery_Call
- func (_c *MockQueryor_ConditionTaskQuery_Call) Run(...) *MockQueryor_ConditionTaskQuery_Call
- func (_c *MockQueryor_ConditionTaskQuery_Call) RunAndReturn(...) *MockQueryor_ConditionTaskQuery_Call
- type MockQueryor_Expecter
- func (_e *MockQueryor_Expecter) ConditionQuery(ctx interface{}, serverID interface{}) *MockQueryor_ConditionQuery_Call
- func (_e *MockQueryor_Expecter) ConditionStatusUpdate(ctx interface{}, conditionKind interface{}, serverID interface{}, ...) *MockQueryor_ConditionStatusUpdate_Call
- func (_e *MockQueryor_Expecter) ConditionTaskPublish(ctx interface{}, conditionKind interface{}, serverID interface{}, ...) *MockQueryor_ConditionTaskPublish_Call
- func (_e *MockQueryor_Expecter) ConditionTaskQuery(ctx interface{}, conditionKind interface{}, serverID interface{}) *MockQueryor_ConditionTaskQuery_Call
- type Option
- type Queryor
- type RequestError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client can perform queries against the Conditions Orchestrator API service.
func (*Client) ConditionQuery ¶
func (*Client) ConditionStatusUpdate ¶
func (*Client) ConditionTaskPublish ¶
type Error ¶
type Error struct {
Cause string
}
Error holds the cause of a client error and implements the Error interface.
type HTTPRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type MockHTTPRequestDoer ¶
MockHTTPRequestDoer is an autogenerated mock type for the HTTPRequestDoer type
func NewMockHTTPRequestDoer ¶
func NewMockHTTPRequestDoer(t interface { mock.TestingT Cleanup(func()) }) *MockHTTPRequestDoer
NewMockHTTPRequestDoer creates a new instance of MockHTTPRequestDoer. 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 (*MockHTTPRequestDoer) EXPECT ¶
func (_m *MockHTTPRequestDoer) EXPECT() *MockHTTPRequestDoer_Expecter
type MockHTTPRequestDoer_Do_Call ¶
MockHTTPRequestDoer_Do_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Do'
func (*MockHTTPRequestDoer_Do_Call) Return ¶
func (_c *MockHTTPRequestDoer_Do_Call) Return(_a0 *http.Response, _a1 error) *MockHTTPRequestDoer_Do_Call
func (*MockHTTPRequestDoer_Do_Call) Run ¶
func (_c *MockHTTPRequestDoer_Do_Call) Run(run func(req *http.Request)) *MockHTTPRequestDoer_Do_Call
func (*MockHTTPRequestDoer_Do_Call) RunAndReturn ¶
func (_c *MockHTTPRequestDoer_Do_Call) RunAndReturn(run func(*http.Request) (*http.Response, error)) *MockHTTPRequestDoer_Do_Call
type MockHTTPRequestDoer_Expecter ¶
type MockHTTPRequestDoer_Expecter struct {
// contains filtered or unexported fields
}
func (*MockHTTPRequestDoer_Expecter) Do ¶
func (_e *MockHTTPRequestDoer_Expecter) Do(req interface{}) *MockHTTPRequestDoer_Do_Call
Do is a helper method to define mock.On call
- req *http.Request
type MockQueryor ¶
MockQueryor is an autogenerated mock type for the Queryor type
func NewMockQueryor ¶
func NewMockQueryor(t interface { mock.TestingT Cleanup(func()) }) *MockQueryor
NewMockQueryor creates a new instance of MockQueryor. 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 (*MockQueryor) ConditionQuery ¶
func (_m *MockQueryor) ConditionQuery(ctx context.Context, serverID uuid.UUID) (*types.ServerResponse, error)
ConditionQuery provides a mock function with given fields: ctx, serverID
func (*MockQueryor) ConditionStatusUpdate ¶
func (_m *MockQueryor) ConditionStatusUpdate(ctx context.Context, conditionKind condition.Kind, serverID uuid.UUID, conditionID uuid.UUID, statusValue *condition.StatusValue, onlyUpdateTimestamp bool) (*types.ServerResponse, error)
ConditionStatusUpdate provides a mock function with given fields: ctx, conditionKind, serverID, conditionID, statusValue, onlyUpdateTimestamp
func (*MockQueryor) ConditionTaskPublish ¶
func (_m *MockQueryor) ConditionTaskPublish(ctx context.Context, conditionKind condition.Kind, serverID uuid.UUID, conditionID uuid.UUID, task *condition.Task[interface{}, interface{}], onlyUpdateTimestamp bool) (*types.ServerResponse, error)
ConditionTaskPublish provides a mock function with given fields: ctx, conditionKind, serverID, conditionID, task, onlyUpdateTimestamp
func (*MockQueryor) ConditionTaskQuery ¶
func (_m *MockQueryor) ConditionTaskQuery(ctx context.Context, conditionKind condition.Kind, serverID uuid.UUID) (*types.ServerResponse, error)
ConditionTaskQuery provides a mock function with given fields: ctx, conditionKind, serverID
func (*MockQueryor) EXPECT ¶
func (_m *MockQueryor) EXPECT() *MockQueryor_Expecter
type MockQueryor_ConditionQuery_Call ¶
MockQueryor_ConditionQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConditionQuery'
func (*MockQueryor_ConditionQuery_Call) Return ¶
func (_c *MockQueryor_ConditionQuery_Call) Return(_a0 *types.ServerResponse, _a1 error) *MockQueryor_ConditionQuery_Call
func (*MockQueryor_ConditionQuery_Call) Run ¶
func (_c *MockQueryor_ConditionQuery_Call) Run(run func(ctx context.Context, serverID uuid.UUID)) *MockQueryor_ConditionQuery_Call
func (*MockQueryor_ConditionQuery_Call) RunAndReturn ¶
func (_c *MockQueryor_ConditionQuery_Call) RunAndReturn(run func(context.Context, uuid.UUID) (*types.ServerResponse, error)) *MockQueryor_ConditionQuery_Call
type MockQueryor_ConditionStatusUpdate_Call ¶
MockQueryor_ConditionStatusUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConditionStatusUpdate'
func (*MockQueryor_ConditionStatusUpdate_Call) Return ¶
func (_c *MockQueryor_ConditionStatusUpdate_Call) Return(_a0 *types.ServerResponse, _a1 error) *MockQueryor_ConditionStatusUpdate_Call
func (*MockQueryor_ConditionStatusUpdate_Call) Run ¶
func (_c *MockQueryor_ConditionStatusUpdate_Call) Run(run func(ctx context.Context, conditionKind condition.Kind, serverID uuid.UUID, conditionID uuid.UUID, statusValue *condition.StatusValue, onlyUpdateTimestamp bool)) *MockQueryor_ConditionStatusUpdate_Call
func (*MockQueryor_ConditionStatusUpdate_Call) RunAndReturn ¶
func (_c *MockQueryor_ConditionStatusUpdate_Call) RunAndReturn(run func(context.Context, condition.Kind, uuid.UUID, uuid.UUID, *condition.StatusValue, bool) (*types.ServerResponse, error)) *MockQueryor_ConditionStatusUpdate_Call
type MockQueryor_ConditionTaskPublish_Call ¶
MockQueryor_ConditionTaskPublish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConditionTaskPublish'
func (*MockQueryor_ConditionTaskPublish_Call) Return ¶
func (_c *MockQueryor_ConditionTaskPublish_Call) Return(_a0 *types.ServerResponse, _a1 error) *MockQueryor_ConditionTaskPublish_Call
func (*MockQueryor_ConditionTaskPublish_Call) RunAndReturn ¶
type MockQueryor_ConditionTaskQuery_Call ¶
MockQueryor_ConditionTaskQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConditionTaskQuery'
func (*MockQueryor_ConditionTaskQuery_Call) Return ¶
func (_c *MockQueryor_ConditionTaskQuery_Call) Return(_a0 *types.ServerResponse, _a1 error) *MockQueryor_ConditionTaskQuery_Call
func (*MockQueryor_ConditionTaskQuery_Call) Run ¶
func (_c *MockQueryor_ConditionTaskQuery_Call) Run(run func(ctx context.Context, conditionKind condition.Kind, serverID uuid.UUID)) *MockQueryor_ConditionTaskQuery_Call
func (*MockQueryor_ConditionTaskQuery_Call) RunAndReturn ¶
func (_c *MockQueryor_ConditionTaskQuery_Call) RunAndReturn(run func(context.Context, condition.Kind, uuid.UUID) (*types.ServerResponse, error)) *MockQueryor_ConditionTaskQuery_Call
type MockQueryor_Expecter ¶
type MockQueryor_Expecter struct {
// contains filtered or unexported fields
}
func (*MockQueryor_Expecter) ConditionQuery ¶
func (_e *MockQueryor_Expecter) ConditionQuery(ctx interface{}, serverID interface{}) *MockQueryor_ConditionQuery_Call
ConditionQuery is a helper method to define mock.On call
- ctx context.Context
- serverID uuid.UUID
func (*MockQueryor_Expecter) ConditionStatusUpdate ¶
func (_e *MockQueryor_Expecter) ConditionStatusUpdate(ctx interface{}, conditionKind interface{}, serverID interface{}, conditionID interface{}, statusValue interface{}, onlyUpdateTimestamp interface{}) *MockQueryor_ConditionStatusUpdate_Call
ConditionStatusUpdate is a helper method to define mock.On call
- ctx context.Context
- conditionKind condition.Kind
- serverID uuid.UUID
- conditionID uuid.UUID
- statusValue *condition.StatusValue
- onlyUpdateTimestamp bool
func (*MockQueryor_Expecter) ConditionTaskPublish ¶
func (_e *MockQueryor_Expecter) ConditionTaskPublish(ctx interface{}, conditionKind interface{}, serverID interface{}, conditionID interface{}, task interface{}, onlyUpdateTimestamp interface{}) *MockQueryor_ConditionTaskPublish_Call
ConditionTaskPublish is a helper method to define mock.On call
- ctx context.Context
- conditionKind condition.Kind
- serverID uuid.UUID
- conditionID uuid.UUID
- task *condition.Task[interface{},interface{}]
- onlyUpdateTimestamp bool
func (*MockQueryor_Expecter) ConditionTaskQuery ¶
func (_e *MockQueryor_Expecter) ConditionTaskQuery(ctx interface{}, conditionKind interface{}, serverID interface{}) *MockQueryor_ConditionTaskQuery_Call
ConditionTaskQuery is a helper method to define mock.On call
- ctx context.Context
- conditionKind condition.Kind
- serverID uuid.UUID
type Option ¶
Option allows setting custom parameters during construction
func WithAuthToken ¶
WithAuthToken sets the client auth token.
func WithHTTPClient ¶
func WithHTTPClient(doer HTTPRequestDoer) Option
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
type Queryor ¶
type Queryor interface { // Retrieve the current in-complete condition for the serverID // The returned condition is in either the Active or Pending states. ConditionQuery(ctx context.Context, serverID uuid.UUID) (*v1types.ServerResponse, error) // Update a Condition status ConditionStatusUpdate(ctx context.Context, conditionKind rctypes.Kind, serverID, conditionID uuid.UUID, statusValue *rctypes.StatusValue, onlyUpdateTimestamp bool) (*v1types.ServerResponse, error) // Publish Task ConditionTaskPublish(ctx context.Context, conditionKind rctypes.Kind, serverID, conditionID uuid.UUID, task *rctypes.Task[any, any], onlyUpdateTimestamp bool) (*v1types.ServerResponse, error) // Query task ConditionTaskQuery(ctx context.Context, conditionKind rctypes.Kind, serverID uuid.UUID) (*v1types.ServerResponse, error) }
The Queryor interface enables
type RequestError ¶
RequestError is returned when the client gets an error while performing a request.
func (RequestError) Error ¶
func (e RequestError) Error() string
Error returns the RequestError in string format