Documentation
¶
Index ¶
- Constants
- type Cookie
- type Ctx
- func (ctx *Ctx) Accepts(typ string) bool
- func (ctx *Ctx) AcceptsCharsets(charset string) bool
- func (ctx *Ctx) AcceptsEncodings(encoding string) bool
- func (ctx *Ctx) AcceptsLanguages(lang string) bool
- func (ctx *Ctx) Append(field string, values ...string)
- func (ctx *Ctx) Attachment(name ...string)
- func (ctx *Ctx) BaseUrl() string
- func (ctx *Ctx) BasicAuth() (user, pass string, ok bool)
- func (ctx *Ctx) Body(args ...interface{}) string
- func (ctx *Ctx) ClearCookie(name ...string)
- func (ctx *Ctx) Cookie(key, value string, options ...interface{})
- func (ctx *Ctx) Cookies(args ...interface{}) string
- func (ctx *Ctx) Download(file string, name ...string)
- func (ctx *Ctx) End()
- func (ctx *Ctx) FormFile(key string) (*multipart.FileHeader, error)
- func (ctx *Ctx) FormValue(key string) string
- func (ctx *Ctx) Format()
- func (ctx *Ctx) Fresh() bool
- func (ctx *Ctx) Get(key string) string
- func (ctx *Ctx) HeadersSent()
- func (ctx *Ctx) Hostname() string
- func (ctx *Ctx) Ip() string
- func (ctx *Ctx) Ips() []string
- func (ctx *Ctx) Is(ext string) bool
- func (ctx *Ctx) Json(v interface{}) error
- func (ctx *Ctx) Jsonp(v interface{}, cb ...string) error
- func (ctx *Ctx) Links(link ...string)
- func (ctx *Ctx) Locals(key string, val ...interface{}) interface{}
- func (ctx *Ctx) Location(path string)
- func (ctx *Ctx) Method() string
- func (ctx *Ctx) MultipartForm() (*multipart.Form, error)
- func (ctx *Ctx) Next()
- func (ctx *Ctx) OriginalUrl() string
- func (ctx *Ctx) Params(key string) string
- func (ctx *Ctx) Path() string
- func (ctx *Ctx) Protocol() string
- func (ctx *Ctx) Query(key string) string
- func (ctx *Ctx) Range()
- func (ctx *Ctx) Redirect(path string, status ...int)
- func (ctx *Ctx) Render()
- func (ctx *Ctx) Route() (s struct{ ... })
- func (ctx *Ctx) Secure() bool
- func (ctx *Ctx) Send(args ...interface{})
- func (ctx *Ctx) SendBytes(body []byte)
- func (ctx *Ctx) SendFile(file string, gzip ...bool)
- func (ctx *Ctx) SendStatus(status int)
- func (ctx *Ctx) SendString(body string)
- func (ctx *Ctx) Set(key string, val string)
- func (ctx *Ctx) SignedCookies()
- func (ctx *Ctx) Stale() bool
- func (ctx *Ctx) Status(status int) *Ctx
- func (ctx *Ctx) Subdomains() (subs []string)
- func (ctx *Ctx) Type(ext string) *Ctx
- func (ctx *Ctx) Vary(field ...string)
- func (ctx *Ctx) Write(args ...interface{})
- func (ctx *Ctx) Xhr() bool
- type Fasthttp
- type Fiber
- func (r *Fiber) All(args ...interface{})
- func (r *Fiber) Connect(args ...interface{})
- func (r *Fiber) Delete(args ...interface{})
- func (r *Fiber) Get(args ...interface{})
- func (r *Fiber) Head(args ...interface{})
- func (r *Fiber) Listen(port int, addr ...string)
- func (r *Fiber) Options(args ...interface{})
- func (r *Fiber) Patch(args ...interface{})
- func (r *Fiber) Post(args ...interface{})
- func (r *Fiber) Put(args ...interface{})
- func (r *Fiber) Static(args ...string)
- func (r *Fiber) Trace(args ...interface{})
- func (r *Fiber) Use(args ...interface{})
Constants ¶
const ( StatusContinue = 100 // RFC 7231, 6.2.1 StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2 StatusProcessing = 102 // RFC 2518, 10.1 StatusOK = 200 // RFC 7231, 6.3.1 StatusCreated = 201 // RFC 7231, 6.3.2 StatusAccepted = 202 // RFC 7231, 6.3.3 StatusNonAuthoritativeInfo = 203 // RFC 7231, 6.3.4 StatusNoContent = 204 // RFC 7231, 6.3.5 StatusResetContent = 205 // RFC 7231, 6.3.6 StatusPartialContent = 206 // RFC 7233, 4.1 StatusMultiStatus = 207 // RFC 4918, 11.1 StatusAlreadyReported = 208 // RFC 5842, 7.1 StatusIMUsed = 226 // RFC 3229, 10.4.1 StatusMultipleChoices = 300 // RFC 7231, 6.4.1 StatusMovedPermanently = 301 // RFC 7231, 6.4.2 StatusFound = 302 // RFC 7231, 6.4.3 StatusSeeOther = 303 // RFC 7231, 6.4.4 StatusNotModified = 304 // RFC 7232, 4.1 StatusUseProxy = 305 // RFC 7231, 6.4.5 // StatusSwitchProxy = 306 // RFC 7231, 6.4.6 (Unused) StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7 StatusPermanentRedirect = 308 // RFC 7538, 3 StatusBadRequest = 400 // RFC 7231, 6.5.1 StatusPaymentRequired = 402 // RFC 7231, 6.5.2 StatusForbidden = 403 // RFC 7231, 6.5.3 StatusNotFound = 404 // RFC 7231, 6.5.4 StatusMethodNotAllowed = 405 // RFC 7231, 6.5.5 StatusNotAcceptable = 406 // RFC 7231, 6.5.6 StatusProxyAuthRequired = 407 // RFC 7235, 3.2 StatusRequestTimeout = 408 // RFC 7231, 6.5.7 StatusConflict = 409 // RFC 7231, 6.5.8 StatusGone = 410 // RFC 7231, 6.5.9 StatusLengthRequired = 411 // RFC 7231, 6.5.10 StatusPreconditionFailed = 412 // RFC 7232, 4.2 StatusRequestEntityTooLarge = 413 // RFC 7231, 6.5.11 StatusRequestURITooLong = 414 // RFC 7231, 6.5.12 StatusUnsupportedMediaType = 415 // RFC 7231, 6.5.13 StatusRequestedRangeNotSatisfiable = 416 // RFC 7233, 4.4 StatusExpectationFailed = 417 // RFC 7231, 6.5.14 StatusTeapot = 418 // RFC 7168, 2.3.3 StatusUnprocessableEntity = 422 // RFC 4918, 11.2 StatusLocked = 423 // RFC 4918, 11.3 StatusFailedDependency = 424 // RFC 4918, 11.4 StatusUpgradeRequired = 426 // RFC 7231, 6.5.15 StatusPreconditionRequired = 428 // RFC 6585, 3 StatusTooManyRequests = 429 // RFC 6585, 4 StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5 StatusInternalServerError = 500 // RFC 7231, 6.6.1 StatusNotImplemented = 501 // RFC 7231, 6.6.2 StatusBadGateway = 502 // RFC 7231, 6.6.3 StatusGatewayTimeout = 504 // RFC 7231, 6.6.5 StatusHTTPVersionNotSupported = 505 // RFC 7231, 6.6.6 StatusVariantAlsoNegotiates = 506 // RFC 2295, 8.1 StatusInsufficientStorage = 507 // RFC 4918, 11.5 StatusLoopDetected = 508 // RFC 5842, 7.2 StatusNotExtended = 510 // RFC 2774, 7 StatusNetworkAuthenticationRequired = 511 // RFC 6585, 6 )
Credits @valyala https://github.com/valyala/fasthttp/blob/master/status.go
const Version = "0.9.0"
Version for debugging
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cookie ¶
type Cookie struct { Expire int // time.Unix(1578981376, 0) MaxAge int Domain string Path string HttpOnly bool Secure bool SameSite string }
Cookie :
type Ctx ¶
type Ctx struct { Fasthttp *fasthttp.RequestCtx // contains filtered or unexported fields }
Ctx struct
func (*Ctx) AcceptsCharsets ¶
AcceptsCharsets :
func (*Ctx) AcceptsEncodings ¶
AcceptsEncodings :
func (*Ctx) AcceptsLanguages ¶
AcceptsLanguages :
func (*Ctx) FormFile ¶
func (ctx *Ctx) FormFile(key string) (*multipart.FileHeader, error)
FormFile :
func (*Ctx) MultipartForm ¶
MultipartForm :
func (*Ctx) Render ¶
func (ctx *Ctx) Render()
Render TODO https://expressjs.com/en/4x/api.html#res.render
func (*Ctx) Route ¶
func (ctx *Ctx) Route() (s struct { Method string Path string Wildcard bool Regex *regexp.Regexp Params []string Values []string Handler func(*Ctx) })
Route : Only use in debugging
func (*Ctx) SendString ¶
SendString : Same as Send() but without type assertion
type Fasthttp ¶
type Fasthttp struct { Concurrency int DisableKeepAlive bool ReadBufferSize int WriteBufferSize int ReadTimeout time.Duration WriteTimeout time.Duration IdleTimeout time.Duration MaxConnsPerIP int MaxRequestsPerConn int TCPKeepalive bool TCPKeepalivePeriod time.Duration MaxRequestBodySize int ReduceMemoryUsage bool GetOnly bool DisableHeaderNamesNormalizing bool SleepWhenConcurrencyLimitsExceeded time.Duration NoDefaultContentType bool KeepHijackedConns bool }
Fasthttp settings https://github.com/valyala/fasthttp/blob/master/server.go#L150
type Fiber ¶
type Fiber struct { // Server name header Server string // Disable the fiber banner on launch Banner bool // Provide certificate files to enable TLS CertKey string CertFile string // Fasthttp server settings Fasthttp *Fasthttp // ALPHA SETTINGS, DO NOT USE! RedirectTrailingSlash bool Prefork bool // contains filtered or unexported fields }
Fiber structure
func (*Fiber) Connect ¶
func (r *Fiber) Connect(args ...interface{})
Connect establishes a tunnel to the server identified by the target resource.
func (*Fiber) Delete ¶
func (r *Fiber) Delete(args ...interface{})
Delete deletes the specified resource.
func (*Fiber) Get ¶
func (r *Fiber) Get(args ...interface{})
Get requests a representation of the specified resource. Requests using GET should only retrieve data.
func (*Fiber) Head ¶
func (r *Fiber) Head(args ...interface{})
Head asks for a response identical to that of a GET request, but without the response body.
func (*Fiber) Options ¶
func (r *Fiber) Options(args ...interface{})
Options is used to describe the communication options for the target resource.
func (*Fiber) Patch ¶
func (r *Fiber) Patch(args ...interface{})
Patch is used to apply partial modifications to a resource.
func (*Fiber) Post ¶
func (r *Fiber) Post(args ...interface{})
Post is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.
func (*Fiber) Put ¶
func (r *Fiber) Put(args ...interface{})
Put replaces all current representations of the target resource with the request payload.