adhoc

package
v1.0.0-beta.7.test-hos... Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultALookup is the lookup resolver for DNS A records.
	// You can override it for caching or testing.
	DefaultALookup = net.LookupHost
)

Functions

func NewDynamic

func NewDynamic() *dynamic

NewDynamic creates a new dynamic router that can be have its routes updated.

func NewStaticAddresser

func NewStaticAddresser(rules []*pb.Adhoc) *static

Types

type Addresser

type Addresser interface {
	// Address decides the ip:port to send the request to, if any. Errors may be returned if permission is denied.
	// The returned string must contain contain both ip and port separated by colon.
	Address(r *http.Request) (string, error)
}

Addresser implements logic that decides what "ad-hoc" ip:port to dial for a backend, if any.

Adhoc rules are a way of forwarding requests to services that fall outside of pre-defined Routes and Backends.

Jump to

Keyboard shortcuts

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