discover

package
v0.0.0-...-60b8695 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 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

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

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

NewBuilder returns a new resolver builder for service discovery.

func Scheme

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

Scheme returns the gRPC scheme for service discovery.

Types

type DNS

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

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

Option configures the discovery dialing.

func WithDNS

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