router

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRouteNotFound = status.Errorf(codes.Unimplemented, "unknown route to service")
)

Functions

func NewDynamic

func NewDynamic(logger logrus.FieldLogger) *dynamic

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

func NewStatic

func NewStatic(logger logrus.FieldLogger, routes []*pb.Route) *static

Types

type Router

type Router interface {
	// Route returns a backend name for a given call, or an error.
	Route(ctx context.Context, fullMethodName string) (backendName string, err error)
}

Router is an interface that decides what backend a given stream should be directed to.

Jump to

Keyboard shortcuts

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