requestid

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderName      = "X-Request-ID"
	ContextKey      = "servicebase_request_id"
	GRPCMetadataKey = ContextKey
)
View Source
const (
	DefaultLoggerFieldName = "request_id"
)

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) string

func NewHandler

func NewHandler(handler http.Handler) http.Handler

func NewLogHandler added in v1.2.0

func NewLogHandler(field string, h slog.Handler) slog.Handler

func StreamServerInterceptor

func StreamServerInterceptor(srv interface{}, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error

func UnaryServerInterceptor

func UnaryServerInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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