Documentation ¶
Index ¶
- type AuthHeaders
- type AuthHeadersFunc
- type Codec
- type GRPCMethodConfig
- type Invoker
- type Router
- func (rr *Router) HealthCheck(path string, callback func() error)
- func (rr *Router) RegisterGRPCMethod(ctx context.Context, config GRPCMethodConfig) error
- func (rr *Router) RegisterService(ctx context.Context, ss protoreflect.ServiceDescriptor, conn Invoker) error
- func (rr *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (rr *Router) SetNotFoundHandler(handler http.Handler)
- func (rr *Router) StaticJSON(path string, document interface{}) error
- func (rr *Router) Use(middleware func(http.Handler) http.Handler)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHeaders ¶
type AuthHeaders interface {
AuthHeaders(context.Context, *http.Request) (map[string]string, error)
}
AuthHeaders translates a request into headers to pass on to the remote server Errors which implement gRPC status will be returned to the client as HTTP errors, otherwise 500 with a log line
type AuthHeadersFunc ¶
func (AuthHeadersFunc) AuthHeaders ¶
type Codec ¶
type Codec interface { ToProto(body []byte, msg protoreflect.Message) error FromProto(msg protoreflect.Message) ([]byte, error) }
type GRPCMethodConfig ¶
type GRPCMethodConfig struct { AuthHeaders AuthHeaders Invoker Invoker Method protoreflect.MethodDescriptor }
type Router ¶
type Router struct { ForwardResponseHeaders map[string]bool ForwardRequestHeaders map[string]bool Codec Codec // contains filtered or unexported fields }
func (*Router) HealthCheck ¶
func (*Router) RegisterGRPCMethod ¶
func (rr *Router) RegisterGRPCMethod(ctx context.Context, config GRPCMethodConfig) error
func (*Router) RegisterService ¶
func (rr *Router) RegisterService(ctx context.Context, ss protoreflect.ServiceDescriptor, conn Invoker) error
RegisterService calls RegisterGRPCMethod on all methods of the service with default config.
func (*Router) SetNotFoundHandler ¶
func (*Router) StaticJSON ¶
Click to show internal directories.
Click to hide internal directories.