Documentation ¶
Overview ¶
Package cloudserver provides primitives for gRPC and HTTP servers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChainHTTPMiddleware ¶
func ChainHTTPMiddleware(next http.Handler, middlewares ...HTTPMiddleware) http.Handler
ChainHTTPMiddleware chains the HTTP handler middleware to execute from left to right.
Types ¶
type Config ¶
type Config struct { // Timeout of all requests to the servers. // Defaults to 10 seconds below the default Cloud Run timeout for managed services. Timeout time.Duration `default:"290s"` }
Config provides config for gRPC and HTTP servers.
type HTTPMiddleware ¶
HTTPMiddleware is a HTTP middleware.
type Middleware ¶
type Middleware struct { // Config for the middleware. Config Config }
Middleware provides standard middleware for gRPC and HTTP servers.
func (*Middleware) GRPCUnaryServerInterceptor ¶
func (i *Middleware) GRPCUnaryServerInterceptor( ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (resp interface{}, err error)
GRPCUnaryServerInterceptor implements grpc.UnaryServerInterceptor.
func (*Middleware) HTTPServer ¶
func (i *Middleware) HTTPServer(next http.Handler) http.Handler
HTTPServer provides HTTP server middleware.
Click to show internal directories.
Click to hide internal directories.