requestid

package
v0.0.367 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachRequestIDToError added in v0.0.161

func AttachRequestIDToError(err error, reqid RequestID) error

func WithContext added in v0.0.345

func WithContext(ctx context.Context, rdata RequestData) context.Context

Types

type Interceptor

type Interceptor struct{}

func (Interceptor) Streaming

func (Interceptor) Streaming(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

func (Interceptor) Unary

func (Interceptor) Unary(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

type RequestData

type RequestData struct {
	Started   time.Time `json:"started"`
	RequestID RequestID `json:"request_id"`
}

func AllocateRequestID added in v0.0.197

func AllocateRequestID(ctx context.Context) (context.Context, RequestData)

func NewRequestData added in v0.0.345

func NewRequestData() RequestData

func RequestDataFromContext

func RequestDataFromContext(ctx context.Context) (RequestData, bool)

type RequestID added in v0.0.161

type RequestID string

func NewID added in v0.0.161

func NewID() RequestID

func RequestIDFromContext

func RequestIDFromContext(ctx context.Context) (RequestID, bool)

Jump to

Keyboard shortcuts

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