consul

package
v0.9.1-spreadfix Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: MPL-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

type MockConsulOp struct {
	Op      string // add, remove, or update
	AllocID string
	Task    string
}

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

Jump to

Keyboard shortcuts

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