message

package
v0.0.0-...-ec252d0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package message provides common utilities for working with HTTP messages.

Index

Constants

View Source
const (
	HeaderAccept      = "Accept"
	HeaderContentType = "Content-Type"
	HeaderHost        = "Host"
)

Header* are common header keys or values.

View Source
const (
	MIMEApplicationJSON = "application/json"
	MIMEApplicationXML  = "application/xml"
	MIMETextXML         = "text/xml"
	MIMEGRPC            = "application/grpc"
)

MIME are common MIME types

View Source
const (
	CtxErrors key = "error"
)

Ctx* are context value keys

Variables

This section is empty.

Functions

func WithError

func WithError(r *http.Request, err error)

WithError adds the error to the current request. Middleware later picks it out, and writes out the status.

https://cs.opensource.google/go/go/+/refs/tags/go1.21.6:src/net/http/server.go;l=2141-2150 https://github.com/go-chi/render/blob/14f1cb3d5c2969d6e462632a205eacb6421eb4dc/responder.go#L25-L26

Types

This section is empty.

Jump to

Keyboard shortcuts

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