interceptor

package
v0.0.0-...-b992e40 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderXRequestID = "x-request-id"

Variables

View Source
var (
	ErrorRequestIDMissing     = errors.New("x-request-id header is missing")
	ErrorFailedToSetRequestID = errors.New("failed to set x-request-id header")
	ErrorInvalidRequestID     = errors.New("invalid x-request-id provided")
)

Functions

This section is empty.

Types

type Interceptor

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

func NewRequestIDInterceptor

func NewRequestIDInterceptor(allowEmptyRequestID bool, logger *slog.Logger) *Interceptor

NewRequestIDInterceptor creates a new Interceptor instance.

func (*Interceptor) WrapStreamingClient

func (i *Interceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc

WrapStreamingClient wraps a streaming client function with request ID validation.

func (*Interceptor) WrapStreamingHandler

WrapStreamingHandler wraps a streaming handler function with request ID validation.

func (*Interceptor) WrapUnary

func (i *Interceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc

WrapUnary wraps a unary function with request ID validation.

Jump to

Keyboard shortcuts

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