emitter

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
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

View Source
const Status = StatusCode(0)

Status is collection of constants for HTTP Status Code

return µ.Status.Ok()

Variables

This section is empty.

Functions

func Error

func Error(failure error, title ...string) µ.Result

Error appends Issue, RFC 7807: Problem Details for HTTP APIs

func Header[T µ.ReadableHeaderValues](header string, value T) µ.Result

Header defines HTTP headers to the request

ø.Header("User-Agent", "gurl")

func Send

func Send(data any) µ.Result

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`

func (HeaderEnumConnection) KeepAlive

func (h HeaderEnumConnection) KeepAlive(out *µ.Output) error

KeepAlive defines header `???: keep-alive`

func (HeaderEnumConnection) Set

func (h HeaderEnumConnection) Set(value string) µ.Result

Sets value of HTTP header

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`

func (HeaderEnumContent) TextHTML

func (h HeaderEnumContent) TextHTML(out *µ.Output) error

TextHTML defined Header `???: text/html`

func (HeaderEnumContent) TextPlain

func (h HeaderEnumContent) TextPlain(out *µ.Output) error

TextPlain 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`

func (HeaderEnumTransferEncoding) Identity

func (h HeaderEnumTransferEncoding) Identity(out *µ.Output) error

Identity defines header `Transfer-Encoding: identity`

func (HeaderEnumTransferEncoding) Set

Sets value of HTTP header

type HeaderOf

type HeaderOf[T µ.ReadableHeaderValues] string

Type of HTTP Header

const Host = HeaderOf[string]("Host")
ø.Host.Set("example.com")

func (HeaderOf[T]) Set

func (h HeaderOf[T]) Set(value T) µ.Result

Sets value of HTTP header

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) Gone

func (code StatusCode) Gone(out ...µ.Result) error

Gone ⟼ http.StatusGone

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) OK

func (code StatusCode) OK(out ...µ.Result) error

OK ⟼ http.StatusOK

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

func (StatusCode) UseProxy

func (code StatusCode) UseProxy(out ...µ.Result) error

UseProxy ⟼ http.StatusUseProxy

Jump to

Keyboard shortcuts

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