consul

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CheckHTTPGet represents HTTP GET CheckType.
	CheckHTTPGet = CheckType("HTTP_GET")
	// CheckTCP represents TCP CheckType.
	CheckTCP = CheckType("TCP")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

Agent is a type responsible for registering and deregistering services in Consul agent.

func NewAgent

func NewAgent(tokenFile string) *Agent

NewAgent returns a new Agent.

func (*Agent) Deregister

func (a *Agent) Deregister(services []ServiceInstance) error

Deregister removes passed service instances from Consul discovery service.

func (*Agent) Register

func (a *Agent) Register(services []ServiceInstance) error

Register adds passed service instances to Consul discovery service.

type Check

type Check struct {
	Type     CheckType
	Address  string
	Interval time.Duration
	Timeout  time.Duration
}

Check represents a Consul health check definition.

type CheckType

type CheckType string

CheckType is a health check type.

type ServiceInstance

type ServiceInstance struct {
	ID    string
	Name  string
	Host  string
	Port  int
	Tags  []string
	Check *Check
}

ServiceInstance represents a Consul service that should be registered.

Jump to

Keyboard shortcuts

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