discovery

package
v0.0.0-...-fd5963e Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Binary is the standard port that clients interact with on services.
	Binary = "binary"

	// Wildcard may be used in the User and Service fields of Name to recieve updates
	// from multiple services.
	Wildcard = "*"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Lookup looks up the Record for the given Name.
	Lookup(Name) (Record, error)

	// Watch monitors service records for changes.
	// Watch will send updates for all services which match the provided query.
	// Every service that exists that matches will send an update on the channel.
	// Cluster must be a valid cluster name.
	Watch(context.Context, Name) (<-chan Update, error)
}
var DefaultClient Client = &dnsClient{}

type Name

type Name struct {
	Cluster string
	User    string
	Service string
}

type Port

type Port struct {
	Name string
	Addr string
}

type Record

type Record struct {
	Name  Name
	Tasks []Task
}

func (Record) Addrs

func (r Record) Addrs(portname string) (addrs []string)

Addrs returns the addresses corresponding to the provided address name for each of the tasks in the service

type Task

type Task struct {
	Addrs []Port
}

type Update

type Update struct {
	IsDelete bool
	Record
}

Jump to

Keyboard shortcuts

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