Documentation
¶
Overview ¶
Package recv defines a pure computations to compose HTTP response receivers
Index ¶
- Constants
- func Bytes(val *[]byte) http.Arrow
- func Code(code ...http.StatusCode) http.Arrow
- func Recv(out interface{}) http.Arrow
- type Content
- func (h Content) Any(cat *gurl.IOCat) *gurl.IOCat
- func (h Content) Form(cat *gurl.IOCat) *gurl.IOCat
- func (h Content) HTML(cat *gurl.IOCat) *gurl.IOCat
- func (h Content) Is(value string) http.Arrow
- func (h Content) JSON(cat *gurl.IOCat) *gurl.IOCat
- func (h Content) String(value *string) http.Arrow
- func (h Content) Text(cat *gurl.IOCat) *gurl.IOCat
- type Header
- type StatusCode
- func (code StatusCode) Accepted(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) BadGateway(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) BadRequest(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) Conflict(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) Created(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) Forbidden(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) Found(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) GatewayTimeout(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) Gone(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) HTTPVersionNotSupported(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) InternalServerError(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) LengthRequired(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) MethodNotAllowed(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) MovedPermanently(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) MultipleChoices(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) NoContent(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) NonAuthoritativeInfo(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) NotAcceptable(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) NotFound(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) NotImplemented(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) NotModified(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) OK(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) PaymentRequired(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) PreconditionFailed(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) ProxyAuthRequired(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) RequestEntityTooLarge(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) RequestTimeout(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) RequestURITooLong(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) ResetContent(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) SeeOther(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) ServiceUnavailable(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) Unauthorized(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) UnsupportedMediaType(cat *gurl.IOCat) *gurl.IOCat
- func (code StatusCode) UseProxy(cat *gurl.IOCat) *gurl.IOCat
Constants ¶
const ( CacheControl = Header("Cache-Control") Connection = Header("Connection") ContentEncoding = Header("Content-Encoding") ContentLanguage = Header("Content-Language") ContentLength = Header("Content-Length") ContentType = Content("Content-Type") Date = Header("Date") ETag = Header("ETag") Expires = Header("Expires") LastModified = Header("Last-Modified") Link = Header("Link") Location = Header("Location") Server = Header("Server") SetCookie = Header("Set-Cookie") TransferEncoding = Header("Transfer-Encoding") )
List of supported HTTP header constants https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields
const Status = StatusCode(0)
Status is collection of constants for HTTP Status Code checks
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Content ¶
type Content Header
Content defines headers for content negotiation
func (Content) Is ¶
Is matches value of HTTP header, Use wildcard string ("*") to match any header value
type Header ¶
type Header string
Header matches presence of header in the response or match its entire content. The execution fails with BadMatchHead if the matched value do not meet expectations.
http.Join( ... ƒ.ContentType.JSON, ƒ.ContentEncoding.Is(...), )
func (Header) Is ¶
Is matches value of HTTP header, Use wildcard string ("*") to match any header value
type StatusCode ¶
type StatusCode int
StatusCode is a warpper type over http.StatusCode
http.Join( ... ƒ.Code(http.StatusOK), ) so that response code is matched using constant http.Join( ... ƒ.Status.OK, )
func (StatusCode) Accepted ¶
func (code StatusCode) Accepted(cat *gurl.IOCat) *gurl.IOCat
Accepted ⟼ http.StatusAccepted
func (StatusCode) BadGateway ¶
func (code StatusCode) BadGateway(cat *gurl.IOCat) *gurl.IOCat
BadGateway ⟼ http.StatusBadGateway
func (StatusCode) BadRequest ¶
func (code StatusCode) BadRequest(cat *gurl.IOCat) *gurl.IOCat
BadRequest ⟼ http.StatusBadRequest
func (StatusCode) Conflict ¶
func (code StatusCode) Conflict(cat *gurl.IOCat) *gurl.IOCat
Conflict ⟼ http.StatusConflict
func (StatusCode) Created ¶
func (code StatusCode) Created(cat *gurl.IOCat) *gurl.IOCat
Created ⟼ http.StatusCreated
func (StatusCode) Forbidden ¶
func (code StatusCode) Forbidden(cat *gurl.IOCat) *gurl.IOCat
Forbidden ⟼ http.StatusForbidden
func (StatusCode) Found ¶
func (code StatusCode) Found(cat *gurl.IOCat) *gurl.IOCat
Found ⟼ http.StatusFound
func (StatusCode) GatewayTimeout ¶
func (code StatusCode) GatewayTimeout(cat *gurl.IOCat) *gurl.IOCat
GatewayTimeout ⟼ http.StatusGatewayTimeout
func (StatusCode) Gone ¶
func (code StatusCode) Gone(cat *gurl.IOCat) *gurl.IOCat
Gone ⟼ http.StatusGone
func (StatusCode) HTTPVersionNotSupported ¶
func (code StatusCode) HTTPVersionNotSupported(cat *gurl.IOCat) *gurl.IOCat
HTTPVersionNotSupported ⟼ http.StatusHTTPVersionNotSupported
func (StatusCode) InternalServerError ¶
func (code StatusCode) InternalServerError(cat *gurl.IOCat) *gurl.IOCat
InternalServerError ⟼ http.StatusInternalServerError
func (StatusCode) LengthRequired ¶
func (code StatusCode) LengthRequired(cat *gurl.IOCat) *gurl.IOCat
LengthRequired ⟼ http.StatusLengthRequired
func (StatusCode) MethodNotAllowed ¶
func (code StatusCode) MethodNotAllowed(cat *gurl.IOCat) *gurl.IOCat
MethodNotAllowed ⟼ http.StatusMethodNotAllowed
func (StatusCode) MovedPermanently ¶
func (code StatusCode) MovedPermanently(cat *gurl.IOCat) *gurl.IOCat
MovedPermanently ⟼ http.StatusMovedPermanently
func (StatusCode) MultipleChoices ¶
func (code StatusCode) MultipleChoices(cat *gurl.IOCat) *gurl.IOCat
MultipleChoices ⟼ http.StatusMultipleChoices
func (StatusCode) NoContent ¶
func (code StatusCode) NoContent(cat *gurl.IOCat) *gurl.IOCat
NoContent ⟼ http.StatusNoContent
func (StatusCode) NonAuthoritativeInfo ¶
func (code StatusCode) NonAuthoritativeInfo(cat *gurl.IOCat) *gurl.IOCat
NonAuthoritativeInfo ⟼ http.StatusNonAuthoritativeInfo
func (StatusCode) NotAcceptable ¶
func (code StatusCode) NotAcceptable(cat *gurl.IOCat) *gurl.IOCat
NotAcceptable ⟼ http.StatusNotAcceptable
func (StatusCode) NotFound ¶
func (code StatusCode) NotFound(cat *gurl.IOCat) *gurl.IOCat
NotFound ⟼ http.StatusNotFound
func (StatusCode) NotImplemented ¶
func (code StatusCode) NotImplemented(cat *gurl.IOCat) *gurl.IOCat
NotImplemented ⟼ http.StatusNotImplemented
func (StatusCode) NotModified ¶
func (code StatusCode) NotModified(cat *gurl.IOCat) *gurl.IOCat
NotModified ⟼ http.StatusNotModified
func (StatusCode) PaymentRequired ¶
func (code StatusCode) PaymentRequired(cat *gurl.IOCat) *gurl.IOCat
PaymentRequired ⟼ http.StatusPaymentRequired
func (StatusCode) PreconditionFailed ¶
func (code StatusCode) PreconditionFailed(cat *gurl.IOCat) *gurl.IOCat
PreconditionFailed ⟼ http.StatusPreconditionFailed
func (StatusCode) ProxyAuthRequired ¶
func (code StatusCode) ProxyAuthRequired(cat *gurl.IOCat) *gurl.IOCat
ProxyAuthRequired ⟼ http.StatusProxyAuthRequired
func (StatusCode) RequestEntityTooLarge ¶
func (code StatusCode) RequestEntityTooLarge(cat *gurl.IOCat) *gurl.IOCat
RequestEntityTooLarge ⟼ http.StatusRequestEntityTooLarge
func (StatusCode) RequestTimeout ¶
func (code StatusCode) RequestTimeout(cat *gurl.IOCat) *gurl.IOCat
RequestTimeout ⟼ http.StatusRequestTimeout
func (StatusCode) RequestURITooLong ¶
func (code StatusCode) RequestURITooLong(cat *gurl.IOCat) *gurl.IOCat
RequestURITooLong ⟼ http.StatusRequestURITooLong
func (StatusCode) ResetContent ¶
func (code StatusCode) ResetContent(cat *gurl.IOCat) *gurl.IOCat
ResetContent ⟼ http.StatusResetContent
func (StatusCode) SeeOther ¶
func (code StatusCode) SeeOther(cat *gurl.IOCat) *gurl.IOCat
SeeOther ⟼ http.StatusSeeOther
func (StatusCode) ServiceUnavailable ¶
func (code StatusCode) ServiceUnavailable(cat *gurl.IOCat) *gurl.IOCat
ServiceUnavailable ⟼ http.StatusServiceUnavailable
func (StatusCode) Unauthorized ¶
func (code StatusCode) Unauthorized(cat *gurl.IOCat) *gurl.IOCat
Unauthorized ⟼ http.StatusUnauthorized
func (StatusCode) UnsupportedMediaType ¶
func (code StatusCode) UnsupportedMediaType(cat *gurl.IOCat) *gurl.IOCat
UnsupportedMediaType ⟼ http.StatusUnsupportedMediaType