discovery

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package discovery provides service discovery basics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consul added in v0.0.2

type Consul struct {
	Client  *api.Client
	Service string

	Datacenter string // Consul datacenter (dc param)
	Filter     string // Consul filter expression (filter param)
}

Consul service discovery backend

func NewConsul added in v0.0.2

func NewConsul(client *api.Client, service string) *Consul

NewConsul creates a new service discovery provider for Solana cluster

func NewConsulFromConfig added in v0.0.2

func NewConsulFromConfig(config *types.ConsulSDConfig) (*Consul, error)

NewConsulFromConfig invokes NewConsul using typed config.

func (*Consul) DiscoverTargets added in v0.0.2

func (c *Consul) DiscoverTargets(ctx context.Context) ([]string, error)

DiscoverTargets queries Consul Catalog API to find nodes. Returns a list of targets referred to by IP addresses.

type Discoverer

type Discoverer interface {
	DiscoverTargets(ctx context.Context) ([]string, error)
}

Discoverer returns a list of host:port combinations for all targets.

func NewFromConfig added in v0.0.2

func NewFromConfig(t *types.TargetGroup) (Discoverer, error)

NewFromConfig attempts to create a discoverer from config.

Jump to

Keyboard shortcuts

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