discovery

package
v0.0.0-...-7d43bac Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2017 License: MIT Imports: 4 Imported by: 3

Documentation

Overview

Package discovery provides support for service discovery mechanisms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option represents function which is used to apply service discovery options.

func ByInfo

func ByInfo(i service.Info) Option

ByInfo allows to discover service by its info metadata.

func ByName

func ByName(name string) Option

ByName allows to discover service by its name.

func ByTag

func ByTag(tag string) Option

ByTag allows to discover service by its tag(s).

func ByVersion

func ByVersion(version string) Option

ByVersion allows to discover service by its version.

func UsingLBStrategy

func UsingLBStrategy(s lb.LoadBalancingStrategy) Option

UsingLBStrategy allows to discover service using specified load balancing strategy.

func WithInfo

func WithInfo(i service.Info) Option

WithInfo allows to register service by its info metadata.

type Options

type Options struct {
	Info     service.Info             // service info
	Strategy lb.LoadBalancingStrategy // load balancing strategy
}

Options represents service discovery options.

type ServiceDiscovery

type ServiceDiscovery interface {
	RegisterService(options ...Option) error
	DeregisterService(options ...Option) error
	GetServiceAddress(options ...Option) (*url.URL, error)

	system.Disposer
}

ServiceDiscovery represents service registration and localization mechanism.

Directories

Path Synopsis
Package consul provides support for service discovery mechanism based on Consul by HashiCorp.
Package consul provides support for service discovery mechanism based on Consul by HashiCorp.
Package plain provides support for self-hosted, in-memory, client-server plain discovery service mechanism.
Package plain provides support for self-hosted, in-memory, client-server plain discovery service mechanism.

Jump to

Keyboard shortcuts

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