director

package
v0.11.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package director provides proxy call routing facility

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RemoteBackendFactory

type RemoteBackendFactory func(target string) (proxy.Backend, error)

RemoteBackendFactory provides backend generation by address (target).

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router wraps grpc-proxy StreamDirector.

func NewRouter

func NewRouter(backendFactory RemoteBackendFactory, localBackend proxy.Backend) *Router

NewRouter builds new Router.

func (*Router) Director

func (r *Router) Director(ctx context.Context, fullMethodName string) (proxy.Mode, []proxy.Backend, error)

Director implements proxy.StreamDirector function.

func (*Router) Register

func (r *Router) Register(srv *grpc.Server)

Register is no-op to implement factory.Registrator interface.

Actual proxy handler is installed via grpc.UnknownServiceHandler option.

func (*Router) RegisterStreamedRegex

func (r *Router) RegisterStreamedRegex(regex string)

RegisterStreamedRegex register regex for streamed method.

This could be exact literal match: /^\/serviceName\/methodName$/ or any suffix/prefix match.

func (*Router) StreamedDetector

func (r *Router) StreamedDetector(fullMethodName string) bool

StreamedDetector implements proxy.StreamedDetector.

Jump to

Keyboard shortcuts

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