request

package
v0.0.0-...-f94be1b Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const CtxKey = contextKey("original-request")

CtxKey is a key against which api request will get stored in the context.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) (*interface{}, error)

FromContext retrieves the api request body stored against the request.ctxKey from the context.

func NewContext

func NewContext(ctx context.Context, request interface{}) context.Context

NewContext returns a new context with the given request body.

func NewRequestIDContext

func NewRequestIDContext(ctx context.Context, originalRequestBody []byte) context.Context

NewRequestIDContext returns a new context with request ID.

Types

type RequestInfo

type RequestInfo struct {
	Id   string
	Body []byte
}

func FromRequestIDContext

func FromRequestIDContext(ctx context.Context) (*RequestInfo, error)

FromContext retrieves the rs ap request Id stored against the querytranslate.ctxKeyRequestId from the context.

Jump to

Keyboard shortcuts

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