consul

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2017 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHook

func NewHook(token string) (hook.Hook, error)

NewHook creates new Consul hook that is responsible for graceful Consul deregistration.

Types

type Hook

type Hook struct {
	// contains filtered or unexported fields
}

Hook is an executor hook implementation that will register and deregister a service instance in Consul right after startup and just before task termination, respectively.

func (*Hook) DeregisterFromConsul

func (h *Hook) DeregisterFromConsul(taskInfo mesos.TaskInfo) error

DeregisterFromConsul will deregister service IDs from Consul that were created during AfterTaskStartEvent hook event.

func (*Hook) HandleEvent

func (h *Hook) HandleEvent(event hook.Event) error

HandleEvent calls appropriate hook functions that correspond to supported event types. Unsupported events are ignored.

func (*Hook) RegisterIntoConsul

func (h *Hook) RegisterIntoConsul(taskInfo mesos.TaskInfo) error

RegisterIntoConsul generates an id and sends service information to Consul Agent

Jump to

Keyboard shortcuts

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