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) RegisterWorkload(svcs *consul.WorkloadServices) error
- func (m *MockConsulServiceClient) RemoveWorkload(svcs *consul.WorkloadServices)
- func (m *MockConsulServiceClient) UpdateTTL(checkID, output, status string) error
- func (m *MockConsulServiceClient) UpdateWorkload(old, newSvcs *consul.WorkloadServices) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsulServiceAPI ¶ added in v0.9.0
type ConsulServiceAPI interface { RegisterWorkload(*consul.WorkloadServices) error RemoveWorkload(*consul.WorkloadServices) UpdateWorkload(old, newTask *consul.WorkloadServices) error AllocRegistrations(allocID string) (*consul.AllocRegistration, error) UpdateTTL(id, output, status string) error }
ConsulServiceAPI is the interface the Nomad Client uses to register and remove services and checks from Consul.
type MockConsulOp ¶ added in v0.9.0
type MockConsulOp struct { Op string // add, remove, or update AllocID string Name string // task or group name }
MockConsulOp represents the register/deregister operations.
func NewMockConsulOp ¶ added in v0.9.0
func NewMockConsulOp(op, allocID, name string) MockConsulOp
type MockConsulServiceClient ¶ added in v0.9.0
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 ¶ added in v0.9.0
func NewMockConsulServiceClient(t testing.T, logger log.Logger) *MockConsulServiceClient
func (*MockConsulServiceClient) AllocRegistrations ¶ added in v0.9.0
func (m *MockConsulServiceClient) AllocRegistrations(allocID string) (*consul.AllocRegistration, error)
func (*MockConsulServiceClient) GetOps ¶ added in v0.9.0
func (m *MockConsulServiceClient) GetOps() []MockConsulOp
func (*MockConsulServiceClient) RegisterWorkload ¶ added in v0.10.2
func (m *MockConsulServiceClient) RegisterWorkload(svcs *consul.WorkloadServices) error
func (*MockConsulServiceClient) RemoveWorkload ¶ added in v0.10.2
func (m *MockConsulServiceClient) RemoveWorkload(svcs *consul.WorkloadServices)
func (*MockConsulServiceClient) UpdateTTL ¶ added in v0.10.0
func (m *MockConsulServiceClient) UpdateTTL(checkID, output, status string) error
func (*MockConsulServiceClient) UpdateWorkload ¶ added in v0.10.2
func (m *MockConsulServiceClient) UpdateWorkload(old, newSvcs *consul.WorkloadServices) error
Click to show internal directories.
Click to hide internal directories.