Documentation
¶
Index ¶
- type Operation
- type ServiceRegistrationHandler
- func (h *ServiceRegistrationHandler) AllocRegistrations(allocID string) (*serviceregistration.AllocRegistration, error)
- func (h *ServiceRegistrationHandler) GetOps() []Operation
- func (h *ServiceRegistrationHandler) RegisterWorkload(services *serviceregistration.WorkloadServices) error
- func (h *ServiceRegistrationHandler) RemoveWorkload(services *serviceregistration.WorkloadServices)
- func (h *ServiceRegistrationHandler) UpdateTTL(checkID, namespace, output, status string) error
- func (h *ServiceRegistrationHandler) UpdateWorkload(old, newServices *serviceregistration.WorkloadServices) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Operation ¶
type Operation struct {
Op string // add, remove, or update
AllocID string
Name string // task or group name
OccurredAt time.Time
}
Operation represents the register/deregister operations.
type ServiceRegistrationHandler ¶
type ServiceRegistrationHandler struct {
// AllocRegistrationsFn allows injecting return values for the
// AllocRegistrations function.
AllocRegistrationsFn func(allocID string) (*serviceregistration.AllocRegistration, error)
// contains filtered or unexported fields
}
ServiceRegistrationHandler is the mock implementation of the serviceregistration.Handler interface and can be used for testing.
func NewServiceRegistrationHandler ¶
func NewServiceRegistrationHandler(log hclog.Logger) *ServiceRegistrationHandler
NewServiceRegistrationHandler returns a ready to use ServiceRegistrationHandler for testing.
func (*ServiceRegistrationHandler) AllocRegistrations ¶
func (h *ServiceRegistrationHandler) AllocRegistrations(allocID string) (*serviceregistration.AllocRegistration, error)
func (*ServiceRegistrationHandler) GetOps ¶
func (h *ServiceRegistrationHandler) GetOps() []Operation
GetOps returns all stored operations within the handler.
func (*ServiceRegistrationHandler) RegisterWorkload ¶
func (h *ServiceRegistrationHandler) RegisterWorkload(services *serviceregistration.WorkloadServices) error
func (*ServiceRegistrationHandler) RemoveWorkload ¶
func (h *ServiceRegistrationHandler) RemoveWorkload(services *serviceregistration.WorkloadServices)
func (*ServiceRegistrationHandler) UpdateTTL ¶
func (h *ServiceRegistrationHandler) UpdateTTL(checkID, namespace, output, status string) error
func (*ServiceRegistrationHandler) UpdateWorkload ¶
func (h *ServiceRegistrationHandler) UpdateWorkload(old, newServices *serviceregistration.WorkloadServices) error
Click to show internal directories.
Click to hide internal directories.