http

package
v1.5.3 Latest Latest
Warning

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

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

Documentation

Overview

Package http contains middleware and utility functions to modify HTTP requests and responses.

Index

Constants

View Source
const XHttpCode = "x-http-code"

XHttpCode is used to set the header for the response HTTP code.

Variables

This section is empty.

Functions

func CustomHTTPErrorHandler

func CustomHTTPErrorHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, err *errors.EncodedError)

CustomHTTPErrorHandler handles custom error objects in the context of HTTP requests. It is similar to runtime.DefaultHTTPErrorHandler but accepts an *errors.EncodedError object.

func HTTPResponseModifier

func HTTPResponseModifier(ctx context.Context, w http.ResponseWriter, p proto.Message) error

HTTPResponseModifier is a helper function designed to modify the status code in the context of HTTP responses.

Types

This section is empty.

Jump to

Keyboard shortcuts

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