connectrpc

package
v0.0.0-...-e5cd6cf Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 28 Imported by: 9

Documentation

Index

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

type ConnectWebServer struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

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

Noop

func (ContentTypeInterceptor) WrapStreamingHandler

func (ContentTypeInterceptor) WrapUnary

type ErrorsInterceptor

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

func NewErrorsInterceptor

func NewErrorsInterceptor(fallbackLogger *zap.Logger, options ...Option) *ErrorsInterceptor

func (*ErrorsInterceptor) WrapStreamingClient

func (*ErrorsInterceptor) WrapStreamingHandler

func (*ErrorsInterceptor) WrapUnary

WrapUnary implements [Interceptor] by applying the interceptor function.

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

type Option

type Option func(*ErrorsInterceptor)

func WithErrorMapper

func WithErrorMapper(callback func(error) error) Option

Jump to

Keyboard shortcuts

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