agent

package
v0.0.0-...-c928be0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2014 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AGENT_VERBOSE_LEVEL = 6
)

Variables

This section is empty.

Functions

func Verbose

func Verbose(message string, args ...interface{})

Types

type ConsulServiceAgent

type ConsulServiceAgent struct {
	/* the client */
	Client *consulapi.Client
	/* the wait index */
	WaitIndex uint64
}

func (*ConsulServiceAgent) FindServices

func (r *ConsulServiceAgent) FindServices(filter string) ([]Service, error)

func (*ConsulServiceAgent) GetService

func (r *ConsulServiceAgent) GetService(svc *consulapi.CatalogService) (service Service)

func (*ConsulServiceAgent) WatchServices

func (r *ConsulServiceAgent) WatchServices(service *Service, updateChannel chan *Service) (chan bool, error)

type DiscoveryAgent

type DiscoveryAgent interface {
	/* search for service which match the filter */
	FindServices(filter string) ([]Service, error)
	/* notify my channel of updates to services */
	WatchServices(services *Service, updateChannel chan *Service) (chan bool, error)
}

func NewConsulServiceAgent

func NewConsulServiceAgent(uri *url.URL) (DiscoveryAgent, error)

type Service

type Service struct {
	ID string
	/* the name of the service */
	Name string
	/* the ip address of the service */
	Address string
	/* the port the service is running on */
	Port uint
	/* any tags related to the service */
	Tags []string
}

Jump to

Keyboard shortcuts

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