consul

package
v0.0.0-...-2ecaaad Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2016 License: MIT Imports: 6 Imported by: 0

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