discovery

package
v0.0.0-...-3cc3ff2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 0 Imported by: 0

README

Discovery

Handles the service discovery clients implementations.

Available Clients

Consul by HashiCorp

The discovery/consul package implements Consul client adapter using a native Go package (see the docs for details).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PlainResolver

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

PlainResolver returns the given hostname as it is. It might be useful to resolve services using the default DNS lookup mechanism.

func NewPlainResolver

func NewPlainResolver(address string) PlainResolver

func (PlainResolver) Resolve

func (d PlainResolver) Resolve() (string, bool)

type Resolver

type Resolver interface {
	// Resolve the current hostname.
	// Returns the address and `true` in case if the service has been resolved.
	Resolve() (address string, ok bool)
}

Resolver returns a resolved hostname

type ResolverFunc

type ResolverFunc func() (string, bool)

func (ResolverFunc) Resolve

func (fn ResolverFunc) Resolve() (string, bool)

type Service

type Service struct {
	Host   string
	Port   int
	Name   string
	ID     string
	Scheme string
}

Service represents all the information about a discovered service.

type Updates

type Updates chan []Service

Updates is used to retrieve discovered services.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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