backendpool

package
v0.1.1-rc.5.debug2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownBackend = grpc.Errorf(codes.Unimplemented, "unknown backend")
)
View Source
var (
	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

Types

type Pool

type Pool interface {
	// Conn returns a dialled grpc.ClientConn for a given backend name.
	Conn(backendName string) (*grpc.ClientConn, error)

	// Close closes all the connections of the pool.
	Close() error
}

func NewStatic

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

NewStatic creates a backend pool that has static configuration.

Jump to

Keyboard shortcuts

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