consul

package
v0.0.0-...-204770a Latest Latest
Warning

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

Go to latest
Published: May 16, 2016 License: MIT Imports: 6 Imported by: ? 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 Client

type Client interface {
	Service(service string, tag string, queryOpts *consul.QueryOptions) ([]*consul.ServiceEntry, *consul.QueryMeta, error)
}

Client is a wrapper around the Consul API.

func NewClient

func NewClient(c *consul.Client) Client

NewClient returns an implementation of the Client interface expecting a fully setup Consul Client.

type Publisher

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

Publisher yields endpoints for a service in Consul. Updates to the service are watched and will update the Publisher endpoints.

func NewPublisher

func NewPublisher(
	client Client,
	factory loadbalancer.Factory,
	logger log.Logger,
	service string,
	tags ...string,
) (*Publisher, error)

NewPublisher returns a Consul publisher which returns Endpoints for the requested service. It only returns instances for which all of the passed tags are present.

func (*Publisher) Endpoints

func (p *Publisher) Endpoints() ([]endpoint.Endpoint, error)

Endpoints implements the Publisher interface.

func (*Publisher) Stop

func (p *Publisher) Stop()

Stop terminates the publisher.

Jump to

Keyboard shortcuts

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