Documentation ¶
Index ¶
- Constants
- type Context
- type Cookie
- type ErrorHandler
- type Flushable
- type Handler
- type HandlerChain
- type HandlerFunction
- type HandlerWrapper
- type MediaType
- type Method
- type MultiReadRequest
- func (m *MultiReadRequest) Context() Context
- func (m *MultiReadRequest) Cookie(name string) (*Cookie, bool)
- func (m *MultiReadRequest) Cookies() []*Cookie
- func (m *MultiReadRequest) Header(name string) (string, bool)
- func (m *MultiReadRequest) HeaderNames() []string
- func (m *MultiReadRequest) Headers(name string) []string
- func (m *MultiReadRequest) IsSecure() bool
- func (m *MultiReadRequest) Method() Method
- func (m *MultiReadRequest) Parameter(name string) (string, bool)
- func (m *MultiReadRequest) ParameterNames() []string
- func (m *MultiReadRequest) Parameters(name string) []string
- func (m *MultiReadRequest) Path() string
- func (m *MultiReadRequest) QueryString() string
- func (m *MultiReadRequest) Reader() io.Reader
- func (m *MultiReadRequest) Scheme() string
- type MultiReadResponse
- func (m *MultiReadResponse) AddCookie(cookie *Cookie)
- func (m *MultiReadResponse) AddHeader(name string, value string)
- func (m *MultiReadResponse) CharacterEncoding() string
- func (m *MultiReadResponse) ContentLength() int
- func (m *MultiReadResponse) ContentType() string
- func (m *MultiReadResponse) Context() Context
- func (m *MultiReadResponse) CopyBodyToResponse() error
- func (m *MultiReadResponse) DeleteHeader(name string)
- func (m *MultiReadResponse) Flush() error
- func (m *MultiReadResponse) Header(name string) (string, bool)
- func (m *MultiReadResponse) HeaderNames() []string
- func (m *MultiReadResponse) Headers(name string) []string
- func (m *MultiReadResponse) IsCommitted() bool
- func (m *MultiReadResponse) Reset()
- func (m *MultiReadResponse) SetCharacterEncoding(charset string)
- func (m *MultiReadResponse) SetContentLength(len int)
- func (m *MultiReadResponse) SetContentType(contentType string)
- func (m *MultiReadResponse) SetHeader(name string, value string)
- func (m *MultiReadResponse) SetStatus(status Status)
- func (m *MultiReadResponse) Status() Status
- func (m *MultiReadResponse) Writer() io.Writer
- type NotFoundError
- type PathVariable
- type PathVariables
- type Request
- type RequestDelegate
- type Response
- type ReturnValueHandler
- type SameSite
- type Server
- type Status
Constants ¶
View Source
const ( HeaderAccept = "Accept" HeaderCharset = "Accept-Charset" HeaderAcceptEncoding = "Accept-Encoding" HeaderAcceptLanguage = "Accept-Language" HeaderAcceptPatch = "Accept-Patch" HeaderAcceptRanges = "Accept-Ranges" HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials" HeaderAccessControlAllowHeaders = "Access-Control-Allow-Headers" HeaderAccessControlAllowMethods = "Access-Control-Allow-Methods" HeaderAccessControlAllowOrigin = "Access-Control-Allow-Origin" HeaderAccessControlExposeHeaders = "Access-Control-Expose-Headers" HeaderAccessControlMaxAge = "Access-Control-Max-Age" HeaderAccessControlRequestHeaders = "Access-Control-Request-Headers" HeaderAccessControlRequestMethod = "Access-Control-Request-Method" HeaderAge = "Age" HeaderAllow = "Allow" HeaderAuthorization = "Authorization" HeaderCacheControl = "Cache-Control" HeaderConnection = "Connection" HeaderContentDisposition = "Content-Disposition" HeaderContentEncoding = "Content-Encoding" HeaderContentLanguage = "Content-Language" HeaderContentLength = "Content-Length" HeaderContentType = "Content-Type" HeaderCookie = "Cookie" HeaderDate = "Date" HeaderETag = "ETag" HeaderExpect = "Expect" HeaderExpires = "Expires" HeaderFrom = "From" HeaderHost = "Host" HeaderIfMatch = "If-Match" HeaderIfModifiedSince = "If-Modified-Since" HeaderIfNoneMatch = "If-None-Match" HeaderIfRange = "If-Range" HeaderIfUnmodifiedSince = "If-Unmodified-Since" HeaderLastModified = "Last-Modified" HeaderLink = "Link" HeaderLocation = "Location" HeaderMaxForwards = "Max-Forwards" HeaderOrigin = "Origin" HeaderPragma = "Pragma" HeaderProxyAuthenticate = "Proxy-Authenticate" HeaderProxyAuthorization = "Proxy-Authorization" HeaderRange = "Range" HeaderReferer = "Referer" HeaderRetryAfter = "Retry-After" HeaderServer = "Server" HeaderSetCookie = "Set-Cookie" HeaderSetCookie2 = "Set-Cookie2" HeaderTE = "TE" HeaderTrailer = "Trailer" HeaderTransferEncoding = "TransferEncoding" HeaderUpgrade = "Upgrade" HeaderUserAgent = "UserAgent" HeaderVary = "Vary" HeaderVia = "Via" HeaderWarning = "Warning" HeaderWWWAuthenticate = "WWW-Authenticate" )
View Source
const (
PathVariablesAttribute = "PathVariables"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface { context.Context IsCompleted() bool Abort() IsAborted() bool Request() Request Response() Response }
func NewContext ¶
func WithRequest ¶
func WithResponse ¶
type ErrorHandler ¶
type HandlerChain ¶
type HandlerChain []HandlerFunction
type HandlerFunction ¶
type HandlerFunction func(ctx Context, next RequestDelegate) error
type HandlerWrapper ¶
type HandlerWrapper struct {
// contains filtered or unexported fields
}
func WrapHandler ¶
func WrapHandler(handler Handler) *HandlerWrapper
func (*HandlerWrapper) Invoke ¶
func (w *HandlerWrapper) Invoke(ctx Context, next RequestDelegate) error
func (*HandlerWrapper) SetReturnValueHandlers ¶
func (w *HandlerWrapper) SetReturnValueHandlers(handlers []ReturnValueHandler)
func (*HandlerWrapper) Unwrap ¶
func (w *HandlerWrapper) Unwrap() Handler
type MediaType ¶
type MediaType string
const ( MediaTypeAll MediaType = "*/*" MediaTypeAtomXml MediaType = "application/atom+xml" MediaTypeCbor MediaType = "application/cbor" MediaTypeFormUrlencoded MediaType = "application/x-www-form-urlencoded" MediaTypeGraphqlResponse MediaType = "application/graphql-response+json" MediaTypeJson MediaType = "application/json" MediaTypeJsonUtf8 MediaType = "application/json;charset=UTF-8" MediaTypeYaml MediaType = "application/yaml" MediaTypeYamlUtf8 MediaType = "application/yaml;charset=UTF-8" MediaTypeOctetStream MediaType = "application/octet-stream" MediaTypePdf MediaType = "application/pdf" MediaTypeProblemJson MediaType = "application/problem+json" MediaTypeProblemJsonUtf8 MediaType = "application/problem+json;charset=UTF-8" MediaTypeProblemXml MediaType = "application/problem+xml" MediaTypeProtobuf MediaType = "application/x-protobuf" MediaTypeRssXml MediaType = "application/rss+xml" MediaTypeStreamJson MediaType = "application/stream+json" MediaTypeXhtmlXml MediaType = "application/xhtml+xml" MediaTypeXml MediaType = "application/xml" MediaTypeImageGif MediaType = "image/gif" MediaTypeImageJpeg MediaType = "image/jpeg" MediaTypeImagePng MediaType = "image/png" MediaTypeMultipartFormData MediaType = "multipart/form-data" MediaTypeMultipartMixed MediaType = "multipart/mixed" MediaTypeMultipartRelated MediaType = "multipart/related" MediaTypeTextEventStream MediaType = "text/event-stream" MediaTypeTextHtml MediaType = "text/html" MediaTypeTextMarkdown MediaType = "text/markdown" MediaTypeTextPlain MediaType = "text/plain" MediaTypeTextXml MediaType = "text/xml" )
func (MediaType) IsWildcardSubtype ¶
func (MediaType) IsWildcardType ¶
type MultiReadRequest ¶
type MultiReadRequest struct {
// contains filtered or unexported fields
}
func NewMultiReadRequest ¶
func NewMultiReadRequest(request Request) *MultiReadRequest
func (*MultiReadRequest) Context ¶
func (m *MultiReadRequest) Context() Context
func (*MultiReadRequest) Cookies ¶
func (m *MultiReadRequest) Cookies() []*Cookie
func (*MultiReadRequest) HeaderNames ¶
func (m *MultiReadRequest) HeaderNames() []string
func (*MultiReadRequest) Headers ¶
func (m *MultiReadRequest) Headers(name string) []string
func (*MultiReadRequest) IsSecure ¶
func (m *MultiReadRequest) IsSecure() bool
func (*MultiReadRequest) Method ¶
func (m *MultiReadRequest) Method() Method
func (*MultiReadRequest) Parameter ¶
func (m *MultiReadRequest) Parameter(name string) (string, bool)
func (*MultiReadRequest) ParameterNames ¶
func (m *MultiReadRequest) ParameterNames() []string
func (*MultiReadRequest) Parameters ¶
func (m *MultiReadRequest) Parameters(name string) []string
func (*MultiReadRequest) Path ¶
func (m *MultiReadRequest) Path() string
func (*MultiReadRequest) QueryString ¶
func (m *MultiReadRequest) QueryString() string
func (*MultiReadRequest) Reader ¶
func (m *MultiReadRequest) Reader() io.Reader
func (*MultiReadRequest) Scheme ¶
func (m *MultiReadRequest) Scheme() string
type MultiReadResponse ¶
type MultiReadResponse struct {
// contains filtered or unexported fields
}
func NewMultiReadResponse ¶
func NewMultiReadResponse(response Response) *MultiReadResponse
func (*MultiReadResponse) AddCookie ¶
func (m *MultiReadResponse) AddCookie(cookie *Cookie)
func (*MultiReadResponse) AddHeader ¶
func (m *MultiReadResponse) AddHeader(name string, value string)
func (*MultiReadResponse) CharacterEncoding ¶
func (m *MultiReadResponse) CharacterEncoding() string
func (*MultiReadResponse) ContentLength ¶
func (m *MultiReadResponse) ContentLength() int
func (*MultiReadResponse) ContentType ¶
func (m *MultiReadResponse) ContentType() string
func (*MultiReadResponse) Context ¶
func (m *MultiReadResponse) Context() Context
func (*MultiReadResponse) CopyBodyToResponse ¶
func (m *MultiReadResponse) CopyBodyToResponse() error
func (*MultiReadResponse) DeleteHeader ¶
func (m *MultiReadResponse) DeleteHeader(name string)
func (*MultiReadResponse) Flush ¶
func (m *MultiReadResponse) Flush() error
func (*MultiReadResponse) HeaderNames ¶
func (m *MultiReadResponse) HeaderNames() []string
func (*MultiReadResponse) Headers ¶
func (m *MultiReadResponse) Headers(name string) []string
func (*MultiReadResponse) IsCommitted ¶
func (m *MultiReadResponse) IsCommitted() bool
func (*MultiReadResponse) Reset ¶
func (m *MultiReadResponse) Reset()
func (*MultiReadResponse) SetCharacterEncoding ¶
func (m *MultiReadResponse) SetCharacterEncoding(charset string)
func (*MultiReadResponse) SetContentLength ¶
func (m *MultiReadResponse) SetContentLength(len int)
func (*MultiReadResponse) SetContentType ¶
func (m *MultiReadResponse) SetContentType(contentType string)
func (*MultiReadResponse) SetHeader ¶
func (m *MultiReadResponse) SetHeader(name string, value string)
func (*MultiReadResponse) SetStatus ¶
func (m *MultiReadResponse) SetStatus(status Status)
func (*MultiReadResponse) Status ¶
func (m *MultiReadResponse) Status() Status
func (*MultiReadResponse) Writer ¶
func (m *MultiReadResponse) Writer() io.Writer
type NotFoundError ¶
type NotFoundError struct { }
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
type PathVariable ¶
type PathVariables ¶
type PathVariables struct {
// contains filtered or unexported fields
}
func (*PathVariables) Put ¶
func (p *PathVariables) Put(name string, value string)
type Request ¶
type Request interface { Context() Context Cookie(name string) (*Cookie, bool) Cookies() []*Cookie Parameter(name string) (string, bool) ParameterNames() []string Parameters(name string) []string QueryString() string Header(name string) (string, bool) HeaderNames() []string Headers(name string) []string Path() string Method() Method Reader() io.Reader Scheme() string IsSecure() bool }
type RequestDelegate ¶
type RequestDelegate interface {
Invoke(ctx Context)
}
type Response ¶
type Response interface { Context() Context AddCookie(cookie *Cookie) ContentLength() int SetContentLength(len int) CharacterEncoding() string SetCharacterEncoding(charset string) ContentType() string SetContentType(contentType string) AddHeader(name string, value string) SetHeader(name string, value string) DeleteHeader(name string) Header(name string) (string, bool) HeaderNames() []string Headers(name string) []string Status() Status SetStatus(status Status) Writer() io.Writer Flush() error IsCommitted() bool Reset() }
type ReturnValueHandler ¶
type Status ¶
type Status int
const ( StatusContinue Status = 100 StatusSwitchingProtocols Status = 101 StatusProcessing Status = 102 StatusEarlyHints Status = 103 StatusOK Status = 200 StatusCreated Status = 201 StatusAccepted Status = 202 StatusNonAuthoritativeInfo Status = 203 StatusNoContent Status = 204 StatusResetContent Status = 205 StatusPartialContent Status = 206 StatusMultiStatus Status = 207 StatusAlreadyReported Status = 208 StatusIMUsed Status = 226 StatusMultipleChoices Status = 300 StatusMovedPermanently Status = 301 StatusFound Status = 302 StatusSeeOther Status = 303 StatusNotModified Status = 304 StatusUseProxy Status = 305 StatusTemporaryRedirect Status = 307 StatusPermanentRedirect Status = 308 StatusBadRequest Status = 400 StatusPaymentRequired Status = 402 StatusForbidden Status = 403 StatusNotFound Status = 404 StatusMethodNotAllowed Status = 405 StatusNotAcceptable Status = 406 StatusProxyAuthRequired Status = 407 StatusRequestTimeout Status = 408 StatusConflict Status = 409 StatusGone Status = 410 StatusLengthRequired Status = 411 StatusPreconditionFailed Status = 412 StatusRequestEntityTooLarge Status = 413 StatusRequestURITooLong Status = 414 StatusUnsupportedMediaType Status = 415 StatusRequestedRangeNotSatisfiable Status = 416 StatusExpectationFailed Status = 417 StatusTeapot Status = 418 StatusMisdirectedRequest Status = 421 StatusUnprocessableEntity Status = 422 StatusLocked Status = 423 StatusFailedDependency Status = 424 StatusTooEarly Status = 425 StatusUpgradeRequired Status = 426 StatusPreconditionRequired Status = 428 StatusTooManyRequests Status = 429 StatusRequestHeaderFieldsTooLarge Status = 431 StatusInternalServerError Status = 500 StatusNotImplemented Status = 501 StatusBadGateway Status = 502 StatusGatewayTimeout Status = 504 StatusHTTPVersionNotSupported Status = 505 StatusVariantAlsoNegotiates Status = 506 StatusInsufficientStorage Status = 507 StatusLoopDetected Status = 508 StatusNotExtended Status = 510 StatusNetworkAuthenticationRequired Status = 511 )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.