connect

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidationError added in v0.3.2

func IsValidationError(err error) bool

IsValidationError reports whether err — or anything in its wrap chain — originated from NewValidationError.

func New

func New(
	log *slog.Logger,
	core provider,
	domain string,
	opts ...connect.HandlerOption,
) *http.ServeMux

New creates and returns gRPC server.

func NewLoggingInterceptor added in v0.3.2

func NewLoggingInterceptor(log *slog.Logger) connect.Option

NewLoggingInterceptor returns a connect.Option that wraps unary handlers with structured request/response logging at debug level.

func NewValidationError added in v0.3.2

func NewValidationError(format string, args ...any) error

NewValidationError formats and returns a validation error. Use this anywhere the client sent input we cannot accept; the connect-go handler will surface it as CodeInvalidArgument (HTTP 400) with the formatted message as detail.

func RequestIDFrom added in v0.3.2

func RequestIDFrom(ctx context.Context) string

RequestIDFrom extracts the request ID from context, returning empty string if absent.

func WithRequestID added in v0.3.2

func WithRequestID(ctx context.Context, id string) context.Context

WithRequestID stores a request ID in the context for log correlation. Thin wrapper over internal/reqid so callers depending on this package do not have to import the reqid package directly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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