Documentation ¶
Index ¶
- Constants
- func Error(failure error, title ...string) µ.Result
- func Header[T µ.ReadableHeaderValues](header string, value T) µ.Result
- func Send(data any) µ.Result
- type HeaderEnumConnection
- type HeaderEnumContent
- func (h HeaderEnumContent) ApplicationJSON(out *µ.Output) error
- func (h HeaderEnumContent) Form(out *µ.Output) error
- func (h HeaderEnumContent) HTML(out *µ.Output) error
- func (h HeaderEnumContent) JSON(out *µ.Output) error
- func (h HeaderEnumContent) Set(value string) µ.Result
- func (h HeaderEnumContent) Text(out *µ.Output) error
- func (h HeaderEnumContent) TextHTML(out *µ.Output) error
- func (h HeaderEnumContent) TextPlain(out *µ.Output) error
- type HeaderEnumTransferEncoding
- type HeaderOf
- type StatusCode
- func (code StatusCode) Accepted(out ...µ.Result) error
- func (code StatusCode) BadGateway(out ...µ.Result) error
- func (code StatusCode) BadRequest(out ...µ.Result) error
- func (code StatusCode) Conflict(out ...µ.Result) error
- func (code StatusCode) Created(out ...µ.Result) error
- func (code StatusCode) Forbidden(out ...µ.Result) error
- func (code StatusCode) Found(out ...µ.Result) error
- func (code StatusCode) GatewayTimeout(out ...µ.Result) error
- func (code StatusCode) Gone(out ...µ.Result) error
- func (code StatusCode) HTTPVersionNotSupported(out ...µ.Result) error
- func (code StatusCode) InternalServerError(out ...µ.Result) error
- func (code StatusCode) LengthRequired(out ...µ.Result) error
- func (code StatusCode) MethodNotAllowed(out ...µ.Result) error
- func (code StatusCode) MovedPermanently(out ...µ.Result) error
- func (code StatusCode) MultipleChoices(out ...µ.Result) error
- func (code StatusCode) NoContent(out ...µ.Result) error
- func (code StatusCode) NonAuthoritativeInfo(out ...µ.Result) error
- func (code StatusCode) NotAcceptable(out ...µ.Result) error
- func (code StatusCode) NotFound(out ...µ.Result) error
- func (code StatusCode) NotImplemented(out ...µ.Result) error
- func (code StatusCode) NotModified(out ...µ.Result) error
- func (code StatusCode) OK(out ...µ.Result) error
- func (code StatusCode) PaymentRequired(out ...µ.Result) error
- func (code StatusCode) PermanentRedirect(out ...µ.Result) error
- func (code StatusCode) PreconditionFailed(out ...µ.Result) error
- func (code StatusCode) ProxyAuthRequired(out ...µ.Result) error
- func (code StatusCode) RequestEntityTooLarge(out ...µ.Result) error
- func (code StatusCode) RequestTimeout(out ...µ.Result) error
- func (code StatusCode) RequestURITooLong(out ...µ.Result) error
- func (code StatusCode) ResetContent(out ...µ.Result) error
- func (code StatusCode) SeeOther(out ...µ.Result) error
- func (code StatusCode) ServiceUnavailable(out ...µ.Result) error
- func (code StatusCode) TemporaryRedirect(out ...µ.Result) error
- func (code StatusCode) Unauthorized(out ...µ.Result) error
- func (code StatusCode) UnsupportedMediaType(out ...µ.Result) error
- func (code StatusCode) UseProxy(out ...µ.Result) error
Constants ¶
const ( Age = HeaderOf[int]("Age") CacheControl = HeaderOf[string]("Cache-Control") Connection = HeaderEnumConnection("Connection") ContentEncoding = HeaderOf[string]("Content-Encoding") ContentLanguage = HeaderOf[string]("Content-Language") ContentLength = HeaderOf[int]("Content-Length") ContentLocation = HeaderOf[string]("Content-Location") ContentMD5 = HeaderOf[string]("Content-MD5") ContentRange = HeaderOf[string]("Content-Range") ContentType = HeaderEnumContent("Content-Type") Date = HeaderOf[time.Time]("Date") ETag = HeaderOf[string]("ETag") Expires = HeaderOf[time.Time]("Expires") LastModified = HeaderOf[time.Time]("Last-Modified") Link = HeaderOf[string]("Link") Location = HeaderOf[string]("Location") RetryAfter = HeaderOf[time.Time]("Retry-After") Server = HeaderOf[string]("Server") SetCookie = HeaderOf[string]("Set-Cookie") TransferEncoding = HeaderEnumTransferEncoding("Transfer-Encoding") Via = HeaderOf[string]("Via") )
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
return µ.Status.Ok()
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HeaderEnumConnection ¶
type HeaderEnumConnection string
Type of HTTP Header, Connection enumeration
const Connection = HeaderEnumConnection("Connection") ø.Connection.KeepAlive
func (HeaderEnumConnection) Close ¶
func (h HeaderEnumConnection) Close(out *µ.Output) error
Close defines header `???: close`
type HeaderEnumContent ¶
type HeaderEnumContent string
Type of HTTP Header, Content-Type enumeration
const ContentType = HeaderEnumContent("Content-Type") ø.ContentType.JSON
func (HeaderEnumContent) ApplicationJSON ¶
func (h HeaderEnumContent) ApplicationJSON(out *µ.Output) error
ApplicationJSON defines header `???: application/json`
func (HeaderEnumContent) Form ¶
func (h HeaderEnumContent) Form(out *µ.Output) error
Form defined Header `???: application/x-www-form-urlencoded`
func (HeaderEnumContent) HTML ¶
func (h HeaderEnumContent) HTML(out *µ.Output) error
HTML defined Header `???: text/html`
func (HeaderEnumContent) JSON ¶
func (h HeaderEnumContent) JSON(out *µ.Output) error
JSON defines header `???: application/json`
func (HeaderEnumContent) Set ¶
func (h HeaderEnumContent) Set(value string) µ.Result
Sets value of HTTP header
func (HeaderEnumContent) Text ¶
func (h HeaderEnumContent) Text(out *µ.Output) error
Text defined Header `???: text/plain`
type HeaderEnumTransferEncoding ¶
type HeaderEnumTransferEncoding string
Type of HTTP Header, Transfer-Encoding enumeration
const TransferEncoding = HeaderEnumTransferEncoding("Transfer-Encoding") ø.TransferEncoding.Chunked
func (HeaderEnumTransferEncoding) Chunked ¶
func (h HeaderEnumTransferEncoding) Chunked(out *µ.Output) error
Chunked defines header `Transfer-Encoding: chunked`
type HeaderOf ¶
type HeaderOf[T µ.ReadableHeaderValues] string
Type of HTTP Header
const Host = HeaderOf[string]("Host") ø.Host.Set("example.com")
type StatusCode ¶
type StatusCode int
StatusCode is a wrapper type over http.StatusCode so that ...
func (StatusCode) Accepted ¶
func (code StatusCode) Accepted(out ...µ.Result) error
Accepted ⟼ http.StatusAccepted
func (StatusCode) BadGateway ¶
func (code StatusCode) BadGateway(out ...µ.Result) error
BadGateway ⟼ http.StatusBadGateway
func (StatusCode) BadRequest ¶
func (code StatusCode) BadRequest(out ...µ.Result) error
BadRequest ⟼ http.StatusBadRequest
func (StatusCode) Conflict ¶
func (code StatusCode) Conflict(out ...µ.Result) error
Conflict ⟼ http.StatusConflict
func (StatusCode) Created ¶
func (code StatusCode) Created(out ...µ.Result) error
Created ⟼ http.StatusCreated
func (StatusCode) Forbidden ¶
func (code StatusCode) Forbidden(out ...µ.Result) error
Forbidden ⟼ http.StatusForbidden
func (StatusCode) Found ¶
func (code StatusCode) Found(out ...µ.Result) error
Found ⟼ http.StatusFound
func (StatusCode) GatewayTimeout ¶
func (code StatusCode) GatewayTimeout(out ...µ.Result) error
GatewayTimeout ⟼ http.StatusGatewayTimeout
func (StatusCode) HTTPVersionNotSupported ¶
func (code StatusCode) HTTPVersionNotSupported(out ...µ.Result) error
HTTPVersionNotSupported ⟼ http.StatusHTTPVersionNotSupported
func (StatusCode) InternalServerError ¶
func (code StatusCode) InternalServerError(out ...µ.Result) error
InternalServerError ⟼ http.StatusInternalServerError
func (StatusCode) LengthRequired ¶
func (code StatusCode) LengthRequired(out ...µ.Result) error
LengthRequired ⟼ http.StatusLengthRequired
func (StatusCode) MethodNotAllowed ¶
func (code StatusCode) MethodNotAllowed(out ...µ.Result) error
MethodNotAllowed ⟼ http.StatusMethodNotAllowed
func (StatusCode) MovedPermanently ¶
func (code StatusCode) MovedPermanently(out ...µ.Result) error
MovedPermanently ⟼ http.StatusMovedPermanently
func (StatusCode) MultipleChoices ¶
func (code StatusCode) MultipleChoices(out ...µ.Result) error
MultipleChoices ⟼ http.StatusMultipleChoices
func (StatusCode) NoContent ¶
func (code StatusCode) NoContent(out ...µ.Result) error
NoContent ⟼ http.StatusNoContent
func (StatusCode) NonAuthoritativeInfo ¶
func (code StatusCode) NonAuthoritativeInfo(out ...µ.Result) error
NonAuthoritativeInfo ⟼ http.StatusNonAuthoritativeInfo
func (StatusCode) NotAcceptable ¶
func (code StatusCode) NotAcceptable(out ...µ.Result) error
NotAcceptable ⟼ http.StatusNotAcceptable
func (StatusCode) NotFound ¶
func (code StatusCode) NotFound(out ...µ.Result) error
NotFound ⟼ http.StatusNotFound
func (StatusCode) NotImplemented ¶
func (code StatusCode) NotImplemented(out ...µ.Result) error
NotImplemented ⟼ http.StatusNotImplemented
func (StatusCode) NotModified ¶
func (code StatusCode) NotModified(out ...µ.Result) error
NotModified ⟼ http.StatusNotModified
func (StatusCode) PaymentRequired ¶
func (code StatusCode) PaymentRequired(out ...µ.Result) error
PaymentRequired ⟼ http.StatusPaymentRequired
func (StatusCode) PermanentRedirect ¶
func (code StatusCode) PermanentRedirect(out ...µ.Result) error
PermanentRedirect ⟼ http.StatusPermanentRedirect
func (StatusCode) PreconditionFailed ¶
func (code StatusCode) PreconditionFailed(out ...µ.Result) error
PreconditionFailed ⟼ http.StatusPreconditionFailed
func (StatusCode) ProxyAuthRequired ¶
func (code StatusCode) ProxyAuthRequired(out ...µ.Result) error
ProxyAuthRequired ⟼ http.StatusProxyAuthRequired
func (StatusCode) RequestEntityTooLarge ¶
func (code StatusCode) RequestEntityTooLarge(out ...µ.Result) error
RequestEntityTooLarge ⟼ http.StatusRequestEntityTooLarge
func (StatusCode) RequestTimeout ¶
func (code StatusCode) RequestTimeout(out ...µ.Result) error
RequestTimeout ⟼ http.StatusRequestTimeout
func (StatusCode) RequestURITooLong ¶
func (code StatusCode) RequestURITooLong(out ...µ.Result) error
RequestURITooLong ⟼ http.StatusRequestURITooLong
func (StatusCode) ResetContent ¶
func (code StatusCode) ResetContent(out ...µ.Result) error
ResetContent ⟼ http.StatusResetContent
func (StatusCode) SeeOther ¶
func (code StatusCode) SeeOther(out ...µ.Result) error
SeeOther ⟼ http.StatusSeeOther
func (StatusCode) ServiceUnavailable ¶
func (code StatusCode) ServiceUnavailable(out ...µ.Result) error
ServiceUnavailable ⟼ http.StatusServiceUnavailable
func (StatusCode) TemporaryRedirect ¶
func (code StatusCode) TemporaryRedirect(out ...µ.Result) error
TemporaryRedirect ⟼ http.StatusTemporaryRedirect
func (StatusCode) Unauthorized ¶
func (code StatusCode) Unauthorized(out ...µ.Result) error
Unauthorized ⟼ http.StatusUnauthorized
func (StatusCode) UnsupportedMediaType ¶
func (code StatusCode) UnsupportedMediaType(out ...µ.Result) error
UnsupportedMediaType ⟼ http.StatusUnsupportedMediaType