Versions in this module Expand all Collapse all v1 v1.22.0 Apr 25, 2024 Changes in this version + const HeaderContentDisposition + const HeaderContentType + const HeaderForwardedFor + const HeaderRealIP + const HeaderRequestID + const HeaderUserAgent + const MIME_FORM_URLENCODED + const MIME_JSON + const MIME_MSGPACK + const MIME_MULTIPART_FORMDAT + const MIME_OCTET_STREAM + const MIME_PROTOBUF + const MIME_XML + func ClientIP(r *http.Request) string + func ClientIPByHeaderForwardedFor(headerForwardedFor string) string + func ClientIPByHeaderRealIP(headerRealIP string) string + func ContextWithStatusCode(ctx context.Context, statusCode int) context.Context + func MaybeWriteHeader(ctx context.Context, w io.Writer, contentType string, param map[string]string) + func Metadata(key string, values ...string) courier.Metadata + func StatusCodeFromContext(ctx context.Context) int + type ApplicationOgg struct + func NewApplicationOgg() *ApplicationOgg + func (ApplicationOgg) ContentType() string + type Attachment struct + func NewAttachment(filename string, contentType string) *Attachment + func (a *Attachment) ContentType() string + func (a *Attachment) Meta() courier.Metadata + type AudioMidi struct + func NewAudioMidi() *AudioMidi + func (AudioMidi) ContentType() string + type AudioMp3 struct + func NewAudioMp3() *AudioMp3 + func (AudioMp3) ContentType() string + type AudioOgg struct + func NewAudioOgg() *AudioOgg + func (AudioOgg) ContentType() string + type AudioWave struct + func NewAudioWave() *AudioWave + func (AudioWave) ContentType() string + type AudioWebm struct + func NewAudioWebm() *AudioWebm + func (AudioWebm) ContentType() string + type CSS struct + func NewCSS() *CSS + func (CSS) ContentType() string + type ContentTypeDescriber interface + ContentType func() string + type CookiesDescriber interface + Cookies func() []*http.Cookie + type Encode func(ctx context.Context, w io.Writer, v interface{}) error + type HTML struct + func NewHTML() *HTML + func (HTML) ContentType() string + type ImageBmp struct + func NewImageBmp() *ImageBmp + func (ImageBmp) ContentType() string + type ImageGIF struct + func NewImageGIF() *ImageGIF + func (ImageGIF) ContentType() string + type ImageJPEG struct + func NewImageJPEG() *ImageJPEG + func (ImageJPEG) ContentType() string + type ImagePNG struct + func NewImagePNG() *ImagePNG + func (ImagePNG) ContentType() string + type ImageSVG struct + func NewImageSVG() *ImageSVG + func (ImageSVG) ContentType() string + type ImageWebp struct + func NewImageWebp() *ImageWebp + func (ImageWebp) ContentType() string + type Method struct + type MethodConnect struct + func (MethodConnect) Method() string + type MethodDelete struct + func (MethodDelete) Method() string + type MethodGet struct + func (MethodGet) Method() string + type MethodHead struct + func (MethodHead) Method() string + type MethodOptions struct + func (MethodOptions) Method() string + type MethodPatch struct + func (MethodPatch) Method() string + type MethodPost struct + func (MethodPost) Method() string + type MethodPut struct + func (MethodPut) Method() string + type MethodTrace struct + func (MethodTrace) Method() string + type Plain struct + func NewPlain() *Plain + func (Plain) ContentType() string + type RedirectDescriber interface + Location func() *url.URL + type RequestInfo interface + Body func() io.ReadCloser + Context func() context.Context + Header func() http.Header + Values func(in string, name string) []string + func NewRequestInfo(r *http.Request) RequestInfo + type Response struct + ContentType string + Cookies []*http.Cookie + Location *url.URL + Metadata courier.Metadata + StatusCode int + Value interface{} + func ResponseFrom(v interface{}) *Response + func (response *Response) Error() string + func (response *Response) Unwrap() error + func (response *Response) WriteTo(rw http.ResponseWriter, r *http.Request, ...) error + type ResponseWrapper func(v interface{}) *Response + func Compose(responseWrappers ...ResponseWrapper) ResponseWrapper + func WithContentType(contentType string) ResponseWrapper + func WithCookies(cookies ...*http.Cookie) ResponseWrapper + func WithMetadata(metadatas ...courier.Metadata) ResponseWrapper + func WithSchema(s interface{}) ResponseWrapper + func WithStatusCode(statusCode int) ResponseWrapper + type ResponseWriterError interface + WriteError func(err error) (int, error) + type StatusCodeDescriber interface + StatusCode func() int + type StatusFound struct + func RedirectWithStatusFound(u *net_url.URL) *StatusFound + func (StatusFound) StatusCode() int + func (r StatusFound) Location() *net_url.URL + type StatusMovedPermanently struct + func RedirectWithStatusMovedPermanently(u *net_url.URL) *StatusMovedPermanently + func (StatusMovedPermanently) StatusCode() int + func (r StatusMovedPermanently) Location() *net_url.URL + type StatusMultipleChoices struct + func RedirectWithStatusMultipleChoices(u *net_url.URL) *StatusMultipleChoices + func (StatusMultipleChoices) StatusCode() int + func (r StatusMultipleChoices) Location() *net_url.URL + type StatusNotModified struct + func RedirectWithStatusNotModified(u *net_url.URL) *StatusNotModified + func (StatusNotModified) StatusCode() int + func (r StatusNotModified) Location() *net_url.URL + type StatusPermanentRedirect struct + func RedirectWithStatusPermanentRedirect(u *net_url.URL) *StatusPermanentRedirect + func (StatusPermanentRedirect) StatusCode() int + func (r StatusPermanentRedirect) Location() *net_url.URL + type StatusSeeOther struct + func RedirectWithStatusSeeOther(u *net_url.URL) *StatusSeeOther + func (StatusSeeOther) StatusCode() int + func (r StatusSeeOther) Location() *net_url.URL + type StatusTemporaryRedirect struct + func RedirectWithStatusTemporaryRedirect(u *net_url.URL) *StatusTemporaryRedirect + func (StatusTemporaryRedirect) StatusCode() int + func (r StatusTemporaryRedirect) Location() *net_url.URL + type StatusUseProxy struct + func RedirectWithStatusUseProxy(u *net_url.URL) *StatusUseProxy + func (StatusUseProxy) StatusCode() int + func (r StatusUseProxy) Location() *net_url.URL + type Transformer interface + DecodeFrom func(r io.Reader, v interface{}, headers ...textproto.MIMEHeader) error + EncodeTo func(w io.Writer, v interface{}) (mediaType string, err error) + NamedByTag func() string + Names func() []string + New func(context.Context, typesutil.Type) (Transformer, error) + String func() string + type Upgrader interface + Upgrade func(w http.ResponseWriter, r *http.Request) error + type VideoOgg struct + func NewVideoOgg() *VideoOgg + func (VideoOgg) ContentType() string + type VideoWebm struct + func NewVideoWebm() *VideoWebm + func (VideoWebm) ContentType() string + type WithFromRequestInfo interface + FromRequestInfo func(ri RequestInfo) error + type WithHeader interface + Header func() http.Header