Documentation
¶
Index ¶
- Variables
- func IsolateRequestPanicInterceptor(logger *zap.Logger) connect.Interceptor
- type ConnectWebServer
- func (s *ConnectWebServer) Error() error
- func (s *ConnectWebServer) HealthHandler() http.Handler
- func (s *ConnectWebServer) Launch(serverListenerAddress string)
- func (s *ConnectWebServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (s *ConnectWebServer) Shutdown(d time.Duration)
- func (s *ConnectWebServer) Terminating() <-chan struct{}
- type ContentTypeInterceptor
- func (i ContentTypeInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (i ContentTypeInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (i ContentTypeInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
- type ErrorsInterceptor
- func (i *ErrorsInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (i *ErrorsInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (i *ErrorsInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
- type HandlerGetter
- type HealthGRPCHandler
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var InternalErrorMessage = "Unexpected error. Please try later."
Functions ¶
func IsolateRequestPanicInterceptor ¶
func IsolateRequestPanicInterceptor(logger *zap.Logger) connect.Interceptor
IsolateRequestPanicInterceptor creates a Connect interceptor that recovers from panics in request handlers, preventing panics from affecting other concurrent requests. This interceptor logs panic details with stack traces and converts panics to proper Connect errors that can be handled by clients.
Types ¶
type ConnectWebServer ¶
func New ¶
func New(handlerGetters []HandlerGetter, opts ...server.Option) *ConnectWebServer
func (*ConnectWebServer) Error ¶
func (s *ConnectWebServer) Error() error
func (*ConnectWebServer) HealthHandler ¶
func (s *ConnectWebServer) HealthHandler() http.Handler
func (*ConnectWebServer) Launch ¶
func (s *ConnectWebServer) Launch(serverListenerAddress string)
Launch should be run in a go func(), watch for termination by waiting on IsTerminating() channel
func (*ConnectWebServer) ServeHTTP ¶
func (s *ConnectWebServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
func (*ConnectWebServer) Shutdown ¶
func (s *ConnectWebServer) Shutdown(d time.Duration)
func (*ConnectWebServer) Terminating ¶
func (s *ConnectWebServer) Terminating() <-chan struct{}
type ContentTypeInterceptor ¶
type ContentTypeInterceptor struct {
// contains filtered or unexported fields
}
func (ContentTypeInterceptor) WrapStreamingClient ¶
func (i ContentTypeInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
Noop
func (ContentTypeInterceptor) WrapStreamingHandler ¶
func (i ContentTypeInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
type ErrorsInterceptor ¶
type ErrorsInterceptor struct {
// contains filtered or unexported fields
}
func NewErrorsInterceptor ¶
func NewErrorsInterceptor(fallbackLogger *zap.Logger, options ...Option) *ErrorsInterceptor
func (*ErrorsInterceptor) WrapStreamingClient ¶
func (i *ErrorsInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
func (*ErrorsInterceptor) WrapStreamingHandler ¶
func (i *ErrorsInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
type HandlerGetter ¶
type HandlerGetter func(opts ...connect.HandlerOption) (string, http.Handler)
type HealthGRPCHandler ¶
type HealthGRPCHandler struct {
// contains filtered or unexported fields
}
func NewHealthGRPCHandler ¶
func NewHealthGRPCHandler(check server.HealthCheck) *HealthGRPCHandler
func (HealthGRPCHandler) Check ¶
func (c HealthGRPCHandler) Check(ctx context.Context, req *connect.Request[grpc_health_v1.HealthCheckRequest]) (*connect.Response[grpc_health_v1.HealthCheckResponse], error)
func (HealthGRPCHandler) Watch ¶
func (c HealthGRPCHandler) Watch(ctx context.Context, req *connect.Request[grpc_health_v1.HealthCheckRequest], stream *connect.ServerStream[grpc_health_v1.HealthCheckResponse]) error
Click to show internal directories.
Click to hide internal directories.