Documentation
¶
Index ¶
- Constants
- func NewRequestResponseHandler[Req any, Res any](cont *Content, prefix string, handler RequestResponseHandler[Req, Res]) http.HandlerFunc
- func NewResponseHandler[Res any](cont *Content, prefix string, handler ResponseHandler[Res]) http.HandlerFunc
- type Content
- type Handler
- type Media
- type RequestResponseHandler
- type ResponseHandler
Constants ¶
View Source
const (
// TypeKey for HTTP headers.
TypeKey = "Content-Type"
)
Variables ¶
This section is empty.
Functions ¶
func NewRequestResponseHandler ¶ added in v1.346.0
func NewRequestResponseHandler[Req any, Res any](cont *Content, prefix string, handler RequestResponseHandler[Req, Res]) http.HandlerFunc
NewRequestResponseHandler for content.
func NewResponseHandler ¶ added in v1.346.0
func NewResponseHandler[Res any](cont *Content, prefix string, handler ResponseHandler[Res]) http.HandlerFunc
NewResponseHandler for content.
Types ¶
type Content ¶ added in v1.287.0
type Content struct {
// contains filtered or unexported fields
}
Content creates types from media types.
func NewContent ¶ added in v1.287.0
NewContent with an encoding.
func (*Content) NewFromMedia ¶ added in v1.287.0
NewFromMedia for content.
func (*Content) NewFromRequest ¶ added in v1.287.0
NewFromRequest for content.
func (*Content) NewHandler ¶ added in v1.287.0
func (c *Content) NewHandler(prefix string, handler Handler) http.HandlerFunc
NewHandler for content.
type Media ¶ added in v1.340.0
type Media struct { // The encoder for the media type. Encoder encoding.Encoder // The type, e.g. text. Type string // The sub type, e.g. plain. Subtype string }
Media for content. https://en.wikipedia.org/wiki/Media_type
type RequestResponseHandler ¶ added in v1.346.0
RequestResponseHandler is a handler with a generic request and response.
Click to show internal directories.
Click to hide internal directories.