Documentation
¶
Index ¶
- Constants
- type Cookie
- type Ctx
- func (ctx *Ctx) Accepts(offers ...string) string
- func (ctx *Ctx) AcceptsCharsets(offers ...string) string
- func (ctx *Ctx) AcceptsEncodings(offers ...string) string
- func (ctx *Ctx) AcceptsLanguages(offers ...string) string
- func (ctx *Ctx) Append(field string, values ...string)
- func (ctx *Ctx) Attachment(name ...string)
- func (ctx *Ctx) BaseURL() 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) BodyParser(v interface{}) error
- 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(args ...interface{})
- 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) Ip() string
- func (ctx *Ctx) Ips() []string
- func (ctx *Ctx) Is(ext string) bool
- func (ctx *Ctx) JSON(v interface{}) error
- func (ctx *Ctx) JSONBytes(raw []byte)
- func (ctx *Ctx) JSONP(v interface{}, cb ...string) error
- func (ctx *Ctx) JSONString(raw string)
- func (ctx *Ctx) Json(v interface{}) error
- func (ctx *Ctx) JsonBytes(raw []byte)
- func (ctx *Ctx) JsonString(raw string)
- 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) 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() *Route
- func (ctx *Ctx) SaveFile(fh *multipart.FileHeader, path string) error
- 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(offset ...int) (subs []string)
- func (ctx *Ctx) Type(ext string) *Ctx
- func (ctx *Ctx) Vary(fields ...string)
- func (ctx *Ctx) Write(args ...interface{})
- func (ctx *Ctx) XHR() bool
- func (ctx *Ctx) XML(v interface{}) error
- func (ctx *Ctx) Xhr() bool
- func (ctx *Ctx) Xml(v interface{}) error
- type Fiber
- func (f *Fiber) All(args ...interface{}) *Fiber
- func (f *Fiber) Connect(args ...interface{}) *Fiber
- func (f *Fiber) Delete(args ...interface{}) *Fiber
- func (f *Fiber) Get(args ...interface{}) *Fiber
- func (f *Fiber) Group(path string) *Group
- func (f *Fiber) Head(args ...interface{}) *Fiber
- func (f *Fiber) Listen(address interface{}, tls ...string)
- func (f *Fiber) Options(args ...interface{}) *Fiber
- func (f *Fiber) Patch(args ...interface{}) *Fiber
- func (f *Fiber) Post(args ...interface{}) *Fiber
- func (f *Fiber) Put(args ...interface{}) *Fiber
- func (f *Fiber) Shutdown() error
- func (f *Fiber) Static(args ...string)
- func (f *Fiber) Test(req *http.Request) (*http.Response, error)
- func (f *Fiber) Trace(args ...interface{}) *Fiber
- func (f *Fiber) Use(args ...interface{}) *Fiber
- type Group
- func (g *Group) All(args ...interface{}) *Group
- func (g *Group) Connect(args ...interface{}) *Group
- func (g *Group) Delete(args ...interface{}) *Group
- func (g *Group) Get(args ...interface{}) *Group
- func (g *Group) Head(args ...interface{}) *Group
- func (g *Group) Options(args ...interface{}) *Group
- func (g *Group) Patch(args ...interface{}) *Group
- func (g *Group) Post(args ...interface{}) *Group
- func (g *Group) Put(args ...interface{}) *Group
- func (g *Group) Trace(args ...interface{}) *Group
- func (g *Group) Use(args ...interface{}) *Group
- type Route
Constants ¶
const (
// Version : Fiber version
Version = "1.4.2"
)
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 : struct
type Ctx ¶
type Ctx struct { Fasthttp *fasthttp.RequestCtx // contains filtered or unexported fields }
Ctx : struct
func (*Ctx) Accepts ¶
Accepts : https://fiber.wiki/context#accepts
func (*Ctx) AcceptsCharsets ¶
AcceptsCharsets : https://fiber.wiki/context#acceptscharsets
func (*Ctx) AcceptsEncodings ¶
AcceptsEncodings : https://fiber.wiki/context#acceptsencodings
func (*Ctx) AcceptsLanguages ¶
AcceptsLanguages : https://fiber.wiki/context#acceptslanguages
func (*Ctx) Append ¶
Append : https://fiber.wiki/context#append
func (*Ctx) Attachment ¶
Attachment : https://fiber.wiki/context#attachment
func (*Ctx) BaseURL ¶ added in v1.0.0
BaseURL : https://fiber.wiki/context#baseurl
func (*Ctx) BasicAuth ¶
BasicAuth : https://fiber.wiki/context#basicauth
func (*Ctx) BodyParser ¶ added in v1.0.0
BodyParser : https://fiber.wiki/context#bodyparser
func (*Ctx) ClearCookie ¶
ClearCookie : https://fiber.wiki/context#clearcookie
func (*Ctx) Cookie ¶
Cookie : https://fiber.wiki/context#cookie
func (*Ctx) Cookies ¶
Cookies : https://fiber.wiki/context#cookies
func (*Ctx) Download ¶
Download : https://fiber.wiki/context#download
func (*Ctx) FormFile ¶
func (ctx *Ctx) FormFile(key string) (*multipart.FileHeader, error)
FormFile : https://fiber.wiki/context#formfile
func (*Ctx) FormValue ¶
FormValue : https://fiber.wiki/context#formvalue
func (*Ctx) Format ¶
func (ctx *Ctx) Format(args ...interface{})
Format : https://fiber.wiki/context#format
func (*Ctx) HeadersSent ¶
func (ctx *Ctx) HeadersSent()
HeadersSent : https://fiber.wiki/context#headerssent
func (*Ctx) Hostname ¶
Hostname : https://fiber.wiki/context#hostname
func (*Ctx) JSONBytes ¶ added in v1.3.1
JSONBytes : https://fiber.wiki/context#jsonbytes
func (*Ctx) JSONP ¶ added in v1.0.0
JSONP : https://fiber.wiki/context#jsonp
func (*Ctx) JSONString ¶ added in v1.3.1
JSONString : https://fiber.wiki/context#json
func (*Ctx) JsonBytes ¶ added in v1.2.3
JsonBytes is deprecated, this will be removed in v2: Use c.JSONBytes() instead
func (*Ctx) JsonString ¶ added in v1.2.3
JsonString is deprecated, this will be removed in v2: Use c.JSONString() instead
func (*Ctx) Locals ¶
Locals : https://fiber.wiki/context#locals
func (*Ctx) Location ¶
Location : https://fiber.wiki/context#location
func (*Ctx) MultipartForm ¶
MultipartForm : https://fiber.wiki/context#multipartform
func (*Ctx) OriginalURL ¶ added in v1.0.0
OriginalURL : https://fiber.wiki/context#originalurl
func (*Ctx) OriginalUrl ¶
OriginalUrl is deprecated, this will be removed in v2: Use c.OriginalURL() instead
func (*Ctx) Params ¶
Params : https://fiber.wiki/context#params
func (*Ctx) Protocol ¶
Protocol : https://fiber.wiki/context#protocol
func (*Ctx) Query ¶
Query : https://fiber.wiki/context#query
func (*Ctx) Redirect ¶
Redirect : https://fiber.wiki/context#redirect
func (*Ctx) SaveFile ¶ added in v1.0.0
func (ctx *Ctx) SaveFile(fh *multipart.FileHeader, path string) error
SaveFile : https://fiber.wiki/context#secure
func (*Ctx) SendBytes ¶
SendBytes : https://fiber.wiki/context#sendbytes
func (*Ctx) SendFile ¶
SendFile : https://fiber.wiki/context#sendfile
func (*Ctx) SendStatus ¶
SendStatus : https://fiber.wiki/context#sendstatus
func (*Ctx) SendString ¶
SendString : https://fiber.wiki/context#sendstring
func (*Ctx) SignedCookies ¶
func (ctx *Ctx) SignedCookies()
SignedCookies : https://fiber.wiki/context#signedcookies
func (*Ctx) Status ¶
Status : https://fiber.wiki/context#status
func (*Ctx) Subdomains ¶
Subdomains : https://fiber.wiki/context#subdomains
func (*Ctx) Write ¶
func (ctx *Ctx) Write(args ...interface{})
Write : https://fiber.wiki/context#write
type Fiber ¶
type Fiber struct { // Server name header Server string // Show fiber banner Banner bool // https://github.com/valyala/fasthttp/blob/master/server.go#L150 Engine *engine // https://www.nginx.com/blog/socket-sharding-nginx-release-1-9-1/ Prefork bool // contains filtered or unexported fields }
Fiber structure
func (*Fiber) Connect ¶
Connect establishes a tunnel to the server identified by the target resource.
func (*Fiber) Get ¶
Get requests a representation of the specified resource. Requests using GET should only retrieve data.
func (*Fiber) Head ¶
Head asks for a response identical to that of a GET request, but without the response body.
func (*Fiber) Options ¶
Options is used to describe the communication options for the target resource.
func (*Fiber) Post ¶
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 ¶
Put replaces all current representations of the target resource with the request payload.
func (*Fiber) Test ¶ added in v1.4.0
Test takes a http.Request and execute a fake connection to the application It returns a http.Response when the connection was successfull
type Group ¶ added in v1.0.0
type Group struct {
// contains filtered or unexported fields
}
Group :
type Route ¶ added in v1.0.0
type Route struct { // HTTP method in uppercase, can be a * for Use() & All() Method string // Stores the original path Path string // Bool that defines if the route is a Use() middleware Midware bool // wildcard bool is for routes without a path, * and /* Wildcard bool // Stores compiled regex special routes :params, *wildcards, optionals? Regex *regexp.Regexp // Store params if special routes :params, *wildcards, optionals? Params []string // Callback function for specific route Handler func(*Ctx) }
Route : struct