mock

package
v1.4.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2023 License: MPL-2.0 Imports: 5 Imported by: 2

Documentation

Index

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 (*ServiceRegistrationHandler) GetOps

func (h *ServiceRegistrationHandler) GetOps() []Operation

GetOps returns all stored operations within the handler.

func (*ServiceRegistrationHandler) RegisterWorkload

func (*ServiceRegistrationHandler) RemoveWorkload

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL