request

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncomingRequestID

func IncomingRequestID(ctx context.Context) string

func OutgoingRequestID

func OutgoingRequestID(ctx context.Context) string

Types

type RequestIDMiddleware

type RequestIDMiddleware struct{}

func NewRequestIDMiddleware

func NewRequestIDMiddleware() *RequestIDMiddleware

func (*RequestIDMiddleware) Stream

Stream returns a new stream server interceptor that creates a request ID and sets it on the context. If the request already contains a proper request ID, it will be persisted, and a new request ID will be appended to it, separated by a dot '.'. In order to chain request IDs (when calling other services), the caller can extract the ID from the context, or use metadata.AppendToOutgoingContext with the context available in GRPC handlers.

func (*RequestIDMiddleware) StreamClient

StreamClient returns a new stream client interceptor that forwards request IDs to the outgoing context. If the context doesn't contain a request ID, no ID is added to the outgoing context.

func (*RequestIDMiddleware) Unary

Unary returns a new unary server interceptor that creates a request ID and sets it on the context. If the request already contains a proper request ID, it will be persisted, and a new request ID will be appended to it, separated by a dot '.'. In order to chain request IDs (when calling other services), the caller can extract the ID from the context, or use metadata.AppendToOutgoingContext with the context available in GRPC handlers.

func (*RequestIDMiddleware) UnaryClient

UnaryClient returns a new unary client interceptor that forwards request IDs to the outgoing context. If the context doesn't contain a request ID, no ID is added to the outgoing context.

Jump to

Keyboard shortcuts

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