backendpool

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: Apache-2.0 Imports: 24 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(logger logrus.FieldLogger) *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)
	Close()
}

Jump to

Keyboard shortcuts

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