Documentation
¶
Index ¶
- Constants
- Variables
- func AddRequestInfoToContext(req *http.Request) *http.Request
- func ContextWithCustomHandlerForTest(ctx context.Context, requestID string) context.Context
- func ContextWithCustomHandlerMarkerForTest(ctx context.Context) context.Context
- func CustomHandlerContext(ctx context.Context) bool
- func GetMetadataFromRequest(req *http.Request) metadata.MD
- func HeaderAppender() grpctransport.ServerResponseFunc
- func HeaderProvider() grpctransport.ServerRequestFunc
- func RequestIDFromRequestContext(ctx context.Context) (string, bool)
Constants ¶
const ( // HandlerTypeCustom Set this value in any custom handler bypassing grpc-middleware. // This makes sure that any value passed in the context is processed by UAM middlewares HandlerTypeCustom = "custom-handler" HeaderKeyRequestID = "x-request-id" HeaderKeyAuditID = "x-nv-audit-id" HeaderETag = "etag" HeaderNewETag = "new-etag" HeaderIfMatch = "if-match" )
const HeaderNVPrefix = "nvkit-"
Variables ¶
var ( StandardHeaders = []string{ HeaderKeyRequestID, HeaderKeyAuditID, HeaderETag, } )
Functions ¶
func AddRequestInfoToContext ¶
AddRequestInfoToContext adds any custom values from request headers to request context that helps nvkit middleware
func ContextWithCustomHandlerForTest ¶ added in v1.0.15
ContextWithCustomHandlerForTest enriches ctx the way AddRequestInfoToContext does for custom-handler paths; for tests outside this package.
func ContextWithCustomHandlerMarkerForTest ¶ added in v1.0.15
ContextWithCustomHandlerMarkerForTest sets only the custom-handler marker (no request ID key), for tests outside this package.
func CustomHandlerContext ¶ added in v1.0.15
CustomHandlerContext reports whether ctx carries the custom-handler marker set by AddRequestInfoToContext.
func GetMetadataFromRequest ¶
GetMetadataFromRequest gets any custom values to be added to request metadata that helps nvkit middleware
func HeaderAppender ¶
func HeaderAppender() grpctransport.ServerResponseFunc
HeaderAppender adds header information to the response NOTE: This function is only called in the success path of go-kit's framework. In the error-path, error-handler handles populating the right header
func HeaderProvider ¶
func HeaderProvider() grpctransport.ServerRequestFunc
HeaderProvider provides a way to append headers to the request context.
Types ¶
This section is empty.