Documentation ¶
Index ¶
- type ConsulServiceAPI
- type MockConsulOp
- type MockConsulServiceClient
- func (m *MockConsulServiceClient) AllocRegistrations(allocID string) (*consul.AllocRegistration, error)
- func (m *MockConsulServiceClient) GetOps() []MockConsulOp
- func (m *MockConsulServiceClient) RegisterTask(task *consul.TaskServices) error
- func (m *MockConsulServiceClient) RemoveTask(task *consul.TaskServices)
- func (m *MockConsulServiceClient) UpdateTask(old, newSvcs *consul.TaskServices) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsulServiceAPI ¶
type ConsulServiceAPI interface { RegisterTask(*consul.TaskServices) error RemoveTask(*consul.TaskServices) UpdateTask(old, newTask *consul.TaskServices) error AllocRegistrations(allocID string) (*consul.AllocRegistration, error) }
ConsulServiceAPI is the interface the Nomad Client uses to register and remove services and checks from Consul.
type MockConsulOp ¶
MockConsulOp represents the register/deregister operations.
func NewMockConsulOp ¶
func NewMockConsulOp(op, allocID, task string) MockConsulOp
type MockConsulServiceClient ¶
type MockConsulServiceClient struct { // AllocRegistrationsFn allows injecting return values for the // AllocRegistrations function. AllocRegistrationsFn func(allocID string) (*consul.AllocRegistration, error) // contains filtered or unexported fields }
MockConsulServiceClient implements the ConsulServiceAPI interface to record and log task registration/deregistration.
func NewMockConsulServiceClient ¶
func NewMockConsulServiceClient(t testing.T, logger log.Logger) *MockConsulServiceClient
func (*MockConsulServiceClient) AllocRegistrations ¶
func (m *MockConsulServiceClient) AllocRegistrations(allocID string) (*consul.AllocRegistration, error)
func (*MockConsulServiceClient) GetOps ¶
func (m *MockConsulServiceClient) GetOps() []MockConsulOp
func (*MockConsulServiceClient) RegisterTask ¶
func (m *MockConsulServiceClient) RegisterTask(task *consul.TaskServices) error
func (*MockConsulServiceClient) RemoveTask ¶
func (m *MockConsulServiceClient) RemoveTask(task *consul.TaskServices)
func (*MockConsulServiceClient) UpdateTask ¶
func (m *MockConsulServiceClient) UpdateTask(old, newSvcs *consul.TaskServices) error
Click to show internal directories.
Click to hide internal directories.