http

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 12 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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