Version: v0.12.9 Latest Latest

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 3



Package endpoint provides the type Endpoint, to be used with the targets.Targets interface.



This section is empty.


This section is empty.


func NamesFromEndpoints added in v0.11.4

func NamesFromEndpoints(endpoints []Endpoint) []string

NamesFromEndpoints is convenience function to build a list of names from endpoints.


type Endpoint

type Endpoint struct {
	Name        string
	Labels      map[string]string
	LastUpdated time.Time
	Port        int
	IP          net.IP

Endpoint represents a targets and associated parameters.

func EndpointsFromNames

func EndpointsFromNames(names []string) []Endpoint

EndpointsFromNames is convenience function to build a list of endpoints from only names. It leaves the Port field in Endpoint unset and initializes Labels field to an empty map.

func (*Endpoint) Dst added in v0.12.6

func (ep *Endpoint) Dst() string

Dst return the "dst" label for the endpoint

func (*Endpoint) Key added in v0.11.4

func (ep *Endpoint) Key() string

Key returns a string key that uniquely identifies that endpoint. Endpoint key consists of endpoint name, port and labels.

func (*Endpoint) Resolve added in v0.12.1

func (ep *Endpoint) Resolve(ipVersion int, resolver Resolver) (net.IP, error)

Resolve resolves endpoint to an IP address. If endpoint has an embedded IP address it uses that, otherwise a global reolver is used.

type Lister added in v0.11.4

type Lister interface {
	// ListEndpoints returns list of endpoints (name, port tupples).
	ListEndpoints() []Endpoint

Lister should implement the ListEndpoints method.

type Resolver added in v0.12.1

type Resolver interface {
	// Resolve, given a target and IP Version will return the IP address for that
	// target.
	Resolve(name string, ipVer int) (net.IP, error)

Jump to

Keyboard shortcuts

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