backendpool

package
v0.0.0-...-2d7a0ec Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownBackend = grpc.Errorf(codes.Unimplemented, "unknown backend")
)
View Source
var (
	// Top DialContext func with decreased Dial Timeout in comparison to DefaultDialer.
	ParentDialFunc = (&net.Dialer{
		Timeout:   1 * time.Second,
		KeepAlive: 30 * time.Second,
	}).DialContext
)

Functions

func NewDynamic

func NewDynamic() *dynamic

NewDynamic creates a pool with a dynamic allocator

func NewStatic

func NewStatic(backends []*pb.Backend) (*static, error)

NewStatic creates a backend pool that has static configuration.

Types

type Pool

type Pool interface {
	// Tripper returns an already established http.RoundTripper just for this backend.
	Tripper(backendName string) (http.RoundTripper, error)
}

Jump to

Keyboard shortcuts

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