discover

package
v3.32.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package discover implements a gRPC discovery middleware.

Index

Constants

This section is empty.

Variables

View Source
var DefaultHTTPPorts = map[bool]int{
	// contains filtered or unexported fields
}

DefaultHTTPPorts is a map of the default HTTP ports, with/without TLS.

View Source
var DefaultPorts = map[bool]int{
	// contains filtered or unexported fields
}

DefaultPorts is a map of the default gRPC ports, with/without TLS.

View Source
var HTTPScheme = map[bool]string{
	// contains filtered or unexported fields
}

HTTPScheme is a map of the HTTP schemes, with/without TLS.

Functions

func Address added in v3.8.5

func Address(role ttnpb.ClusterRole, host string) (string, error)

Address returns the host with service discovery gRPC scheme for the given role.

func DefaultPort

func DefaultPort(target string, port int) (string, error)

DefaultPort appends port if target does not already have one.

func DefaultURL

func DefaultURL(target string, port int, tls bool) (string, error)

DefaultURL appends protocol and port if target does not already have one.

func NewBuilder added in v3.8.5

func NewBuilder(scheme string, opts ...Option) resolver.Builder

NewBuilder returns a new resolver builder for service discovery.

func Scheme added in v3.8.5

func Scheme(role ttnpb.ClusterRole) (string, error)

Scheme returns the gRPC scheme for service discovery.

Types

type DNS added in v3.8.5

type DNS interface {
	LookupSRV(ctx context.Context, service, proto, name string) (cname string, addrs []*net.SRV, err error)
}

DNS provides DNS lookup functionality for service discovery.

type Option added in v3.8.5

type Option interface {
	// contains filtered or unexported methods
}

Option configures the discovery dialing.

func WithDNS added in v3.8.5

func WithDNS(dns DNS) Option

WithDNS configures the resolver with a custom DNS resolver.

Jump to

Keyboard shortcuts

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