Documentation ¶
Overview ¶
Package director provides proxy call routing facility
Index ¶
- type RemoteBackendFactory
- type Router
- func (r *Router) Director(ctx context.Context, fullMethodName string) (proxy.Mode, []proxy.Backend, error)
- func (r *Router) Register(srv *grpc.Server)
- func (r *Router) RegisterLocalBackend(serviceName string, backend proxy.Backend)
- func (r *Router) RegisterStreamedRegex(regex string)
- func (r *Router) StreamedDetector(fullMethodName string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RemoteBackendFactory ¶
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) *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 ¶
Register is no-op to implement factory.Registrator interface.
Actual proxy handler is installed via grpc.UnknownServiceHandler option.
func (*Router) RegisterLocalBackend ¶
RegisterLocalBackend registers local backend by service name.
func (*Router) RegisterStreamedRegex ¶
RegisterStreamedRegex register regex for streamed method.
This could be exact literal match: /^\/serviceName\/methodName$/ or any suffix/prefix match.
func (*Router) StreamedDetector ¶
StreamedDetector implements proxy.StreamedDetector.