diff --git a/404.html b/404.html index 098ea88109f..118e9ef2676 100644 --- a/404.html +++ b/404.html @@ -6,13 +6,13 @@ Page Not Found | Fiber - - + +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- - + + \ No newline at end of file diff --git a/api/app/index.html b/api/app/index.html index d4c6581cd08..40a40ad0104 100644 --- a/api/app/index.html +++ b/api/app/index.html @@ -6,13 +6,13 @@ πŸš€ App | Fiber - - + +
-
Skip to main content
Version: v2.x

πŸš€ App

Static​

Use the Static method to serve static files such as images, CSS, and JavaScript.

info

By default, Static will serve index.html files in response to a request on a directory.

Signature
func (app *App) Static(prefix, root string, config ...Static) Router

Use the following code to serve files in a directory named ./public

app.Static("/", "./public")

// => http://localhost:3000/hello.html
// => http://localhost:3000/js/jquery.js
// => http://localhost:3000/css/style.css
Examples
// Serve files from multiple directories
app.Static("/", "./public")

// Serve files from "./files" directory:
app.Static("/", "./files")

You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below:

Examples
app.Static("/static", "./public")

// => http://localhost:3000/static/hello.html
// => http://localhost:3000/static/js/jquery.js
// => http://localhost:3000/static/css/style.css

If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings.

fiber.Static{}
// Static defines configuration options when defining static assets.
type Static struct {
// When set to true, the server tries minimizing CPU usage by caching compressed files.
// This works differently than the github.com/gofiber/compression middleware.
// Optional. Default value false
Compress bool `json:"compress"`

// When set to true, enables byte range requests.
// Optional. Default value false
ByteRange bool `json:"byte_range"`

// When set to true, enables directory browsing.
// Optional. Default value false.
Browse bool `json:"browse"`

// When set to true, enables direct download.
// Optional. Default value false.
Download bool `json:"download"`

// The name of the index file for serving a directory.
// Optional. Default value "index.html".
Index string `json:"index"`

// Expiration duration for inactive file handlers.
// Use a negative time.Duration to disable it.
//
// Optional. Default value 10 * time.Second.
CacheDuration time.Duration `json:"cache_duration"`

// The value for the Cache-Control HTTP-header
// that is set on the file response. MaxAge is defined in seconds.
//
// Optional. Default value 0.
MaxAge int `json:"max_age"`

// ModifyResponse defines a function that allows you to alter the response.
//
// Optional. Default: nil
ModifyResponse Handler

// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *Ctx) bool
}
Example
// Custom config
app.Static("/", "./public", fiber.Static{
Compress: true,
ByteRange: true,
Browse: true,
Index: "john.html",
CacheDuration: 10 * time.Second,
MaxAge: 3600,
})

Route Handlers​

Registers a route bound to a specific HTTP method.

Signatures
// HTTP methods
func (app *App) Get(path string, handlers ...Handler) Router
func (app *App) Head(path string, handlers ...Handler) Router
func (app *App) Post(path string, handlers ...Handler) Router
func (app *App) Put(path string, handlers ...Handler) Router
func (app *App) Delete(path string, handlers ...Handler) Router
func (app *App) Connect(path string, handlers ...Handler) Router
func (app *App) Options(path string, handlers ...Handler) Router
func (app *App) Trace(path string, handlers ...Handler) Router
func (app *App) Patch(path string, handlers ...Handler) Router

// Add allows you to specifiy a method as value
func (app *App) Add(method, path string, handlers ...Handler) Router

// All will register the route on all HTTP methods
// Almost the same as app.Use but not bound to prefixes
func (app *App) All(path string, handlers ...Handler) Router
Examples
// Simple GET handler
app.Get("/api/list", func(c *fiber.Ctx) error {
return c.SendString("I'm a GET request!")
})

// Simple POST handler
app.Post("/api/register", func(c *fiber.Ctx) error {
return c.SendString("I'm a POST request!")
})

Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc

Signature
func (app *App) Use(args ...interface{}) Router
Examples
// Match any request
app.Use(func(c *fiber.Ctx) error {
return c.Next()
})

// Match request starting with /api
app.Use("/api", func(c *fiber.Ctx) error {
return c.Next()
})

// Match requests starting with /api or /home (multiple-prefix support)
app.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {
return c.Next()
})

// Attach multiple handlers
app.Use("/api", func(c *fiber.Ctx) error {
c.Set("X-Custom-Header", random.String(32))
return c.Next()
}, func(c *fiber.Ctx) error {
return c.Next()
})

Mount​

You can Mount Fiber instance by creating a *Mount

Signature
func (a *App) Mount(prefix string, app *App) Router
Examples
func main() {
app := fiber.New()
micro := fiber.New()
app.Mount("/john", micro) // GET /john/doe -> 200 OK

micro.Get("/doe", func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK)
})

log.Fatal(app.Listen(":3000"))
}

MountPath​

The MountPath property contains one or more path patterns on which a sub-app was mounted.

Signature
func (app *App) MountPath() string
Examples
func main() {
app := fiber.New()
one := fiber.New()
two := fiber.New()
three := fiber.New()

two.Mount("/three", three)
one.Mount("/two", two)
app.Mount("/one", one)

one.MountPath() // "/one"
two.MountPath() // "/one/two"
three.MountPath() // "/one/two/three"
app.MountPath() // ""
}
caution

Mounting order is important for MountPath. If you want to get mount paths properly, you should start mounting from the deepest app.

Group​

You can group routes by creating a *Group struct.

Signature
func (app *App) Group(prefix string, handlers ...Handler) Router
Examples
func main() {
app := fiber.New()

api := app.Group("/api", handler) // /api

v1 := api.Group("/v1", handler) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", handler) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

Route​

You can define routes with a common prefix inside the common function.

Signature
func (app *App) Route(prefix string, fn func(router Router), name ...string) Router
Examples
func main() {
app := fiber.New()

app.Route("/test", func(api fiber.Router) {
api.Get("/foo", handler).Name("foo") // /test/foo (name: test.foo)
api.Get("/bar", handler).Name("bar") // /test/bar (name: test.bar)
}, "test.")

log.Fatal(app.Listen(":3000"))
}

Server​

Server returns the underlying fasthttp server

Signature
func (app *App) Server() *fasthttp.Server
Examples
func main() {
app := fiber.New()

app.Server().MaxConnsPerIP = 1

// ...
}

Server Shutdown​

Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners and then waits indefinitely for all connections to return to idle before shutting down.

ShutdownWithTimeout will forcefully close any active connections after the timeout expires.

ShutdownWithContext shuts down the server including by force if the context's deadline is exceeded.

func (app *App) Shutdown() error
func (app *App) ShutdownWithTimeout(timeout time.Duration) error
func (app *App) ShutdownWithContext(ctx context.Context) error

HandlersCount​

This method returns the amount of registered handlers.

Signature
func (app *App) HandlersCount() uint32

Stack​

This method returns the original router stack

Signature
func (app *App) Stack() [][]*Route
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/john/:age", handler)
app.Post("/register", handler)

data, _ := json.MarshalIndent(app.Stack(), "", " ")
fmt.Println(string(data))

app.Listen(":3000")
}
Result
[
[
{
"method": "GET",
"path": "/john/:age",
"params": [
"age"
]
}
],
[
{
"method": "HEAD",
"path": "/john/:age",
"params": [
"age"
]
}
],
[
{
"method": "POST",
"path": "/register",
"params": null
}
]
]

Name​

This method assigns the name of latest created route.

Signature
func (app *App) Name(name string) Router
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/", handler)
app.Name("index")

app.Get("/doe", handler).Name("home")

app.Trace("/tracer", handler).Name("tracert")

app.Delete("/delete", handler).Name("delete")

a := app.Group("/a")
a.Name("fd.")

a.Get("/test", handler).Name("test")

data, _ := json.MarshalIndent(app.Stack(), "", " ")
fmt.Print(string(data))

app.Listen(":3000")

}
Result
[
[
{
"method": "GET",
"name": "index",
"path": "/",
"params": null
},
{
"method": "GET",
"name": "home",
"path": "/doe",
"params": null
},
{
"method": "GET",
"name": "fd.test",
"path": "/a/test",
"params": null
}
],
[
{
"method": "HEAD",
"name": "",
"path": "/",
"params": null
},
{
"method": "HEAD",
"name": "",
"path": "/doe",
"params": null
},
{
"method": "HEAD",
"name": "",
"path": "/a/test",
"params": null
}
],
null,
null,
[
{
"method": "DELETE",
"name": "delete",
"path": "/delete",
"params": null
}
],
null,
null,
[
{
"method": "TRACE",
"name": "tracert",
"path": "/tracer",
"params": null
}
],
null
]

GetRoute​

This method gets the route by name.

Signature
func (app *App) GetRoute(name string) Route
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/", handler).Name("index")

data, _ := json.MarshalIndent(app.GetRoute("index"), "", " ")
fmt.Print(string(data))


app.Listen(":3000")

}
Result
{
"method": "GET",
"name": "index",
"path": "/",
"params": null
}

GetRoutes​

This method gets all routes.

Signature
func (app *App) GetRoutes(filterUseOption ...bool) []Route

When filterUseOption equal to true, it will filter the routes registered by the middleware.

Examples
func main() {
app := fiber.New()
app.Post("/", func (c *fiber.Ctx) error {
return c.SendString("Hello, World!")
}).Name("index")
data, _ := json.MarshalIndent(app.GetRoutes(true), "", " ")
fmt.Print(string(data))
}
Result
[
{
"method": "POST",
"name": "index",
"path": "/",
"params": null
}
]

Config​

Config returns the app config as value ( read-only ).

Signature
func (app *App) Config() Config

Handler​

Handler returns the server handler that can be used to serve custom *fasthttp.RequestCtx requests.

Signature
func (app *App) Handler() fasthttp.RequestHandler

Listen​

Listen serves HTTP requests from the given address.

Signature
func (app *App) Listen(addr string) error
Examples
// Listen on port :8080 
app.Listen(":8080")

// Custom host
app.Listen("127.0.0.1:8080")

ListenTLS​

ListenTLS serves HTTPs requests from the given address using certFile and keyFile paths to as TLS certificate and key file.

Signature
func (app *App) ListenTLS(addr, certFile, keyFile string) error
Examples
app.ListenTLS(":443", "./cert.pem", "./cert.key");

Using ListenTLS defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
Certificates: []tls.Certificate{
cert,
},
}

ListenTLSWithCertificate​

Signature
func (app *App) ListenTLS(addr string, cert tls.Certificate) error
Examples
app.ListenTLSWithCertificate(":443", cert);

Using ListenTLSWithCertificate defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
Certificates: []tls.Certificate{
cert,
},
}

ListenMutualTLS​

ListenMutualTLS serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file

Signature
func (app *App) ListenMutualTLS(addr, certFile, keyFile, clientCertFile string) error
Examples
app.ListenMutualTLS(":443", "./cert.pem", "./cert.key", "./ca-chain-cert.pem");

Using ListenMutualTLS defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: clientCertPool,
Certificates: []tls.Certificate{
cert,
},
}

ListenMutualTLSWithCertificate​

ListenMutualTLSWithCertificate serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file

Signature
func (app *App) ListenMutualTLSWithCertificate(addr string, cert tls.Certificate, clientCertPool *x509.CertPool) error
Examples
app.ListenMutualTLSWithCertificate(":443", cert, clientCertPool);

Using ListenMutualTLSWithCertificate defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: clientCertPool,
Certificates: []tls.Certificate{
cert,
},
}

Listener​

You can pass your own net.Listener using the Listener method. This method can be used to enable TLS/HTTPS with a custom tls.Config.

Signature
func (app *App) Listener(ln net.Listener) error
Examples
ln, _ := net.Listen("tcp", ":3000")

cer, _:= tls.LoadX509KeyPair("server.crt", "server.key")

ln = tls.NewListener(ln, &tls.Config{Certificates: []tls.Certificate{cer}})

app.Listener(ln)

Test​

Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 1s if you want to disable a timeout altogether, pass -1 as a second argument.

Signature
func (app *App) Test(req *http.Request, msTimeout ...int) (*http.Response, error)
Examples
// Create route with GET method for test:
app.Get("/", func(c *fiber.Ctx) error {
fmt.Println(c.BaseURL()) // => http://google.com
fmt.Println(c.Get("X-Custom-Header")) // => hi

return c.SendString("hello, World!")
})

// http.Request
req := httptest.NewRequest("GET", "http://google.com", nil)
req.Header.Set("X-Custom-Header", "hi")

// http.Response
resp, _ := app.Test(req)

// Do something with results:
if resp.StatusCode == fiber.StatusOK {
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body)) // => Hello, World!
}

Hooks​

Hooks is a method to return hooks property.

Signature
func (app *App) Hooks() *Hooks
- - +
Skip to main content
Version: v2.x

πŸš€ App

Static​

Use the Static method to serve static files such as images, CSS, and JavaScript.

info

By default, Static will serve index.html files in response to a request on a directory.

Signature
func (app *App) Static(prefix, root string, config ...Static) Router

Use the following code to serve files in a directory named ./public

app.Static("/", "./public")

// => http://localhost:3000/hello.html
// => http://localhost:3000/js/jquery.js
// => http://localhost:3000/css/style.css
Examples
// Serve files from multiple directories
app.Static("/", "./public")

// Serve files from "./files" directory:
app.Static("/", "./files")

You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below:

Examples
app.Static("/static", "./public")

// => http://localhost:3000/static/hello.html
// => http://localhost:3000/static/js/jquery.js
// => http://localhost:3000/static/css/style.css

If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings.

fiber.Static{}
// Static defines configuration options when defining static assets.
type Static struct {
// When set to true, the server tries minimizing CPU usage by caching compressed files.
// This works differently than the github.com/gofiber/compression middleware.
// Optional. Default value false
Compress bool `json:"compress"`

// When set to true, enables byte range requests.
// Optional. Default value false
ByteRange bool `json:"byte_range"`

// When set to true, enables directory browsing.
// Optional. Default value false.
Browse bool `json:"browse"`

// When set to true, enables direct download.
// Optional. Default value false.
Download bool `json:"download"`

// The name of the index file for serving a directory.
// Optional. Default value "index.html".
Index string `json:"index"`

// Expiration duration for inactive file handlers.
// Use a negative time.Duration to disable it.
//
// Optional. Default value 10 * time.Second.
CacheDuration time.Duration `json:"cache_duration"`

// The value for the Cache-Control HTTP-header
// that is set on the file response. MaxAge is defined in seconds.
//
// Optional. Default value 0.
MaxAge int `json:"max_age"`

// ModifyResponse defines a function that allows you to alter the response.
//
// Optional. Default: nil
ModifyResponse Handler

// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *Ctx) bool
}
Example
// Custom config
app.Static("/", "./public", fiber.Static{
Compress: true,
ByteRange: true,
Browse: true,
Index: "john.html",
CacheDuration: 10 * time.Second,
MaxAge: 3600,
})

Route Handlers​

Registers a route bound to a specific HTTP method.

Signatures
// HTTP methods
func (app *App) Get(path string, handlers ...Handler) Router
func (app *App) Head(path string, handlers ...Handler) Router
func (app *App) Post(path string, handlers ...Handler) Router
func (app *App) Put(path string, handlers ...Handler) Router
func (app *App) Delete(path string, handlers ...Handler) Router
func (app *App) Connect(path string, handlers ...Handler) Router
func (app *App) Options(path string, handlers ...Handler) Router
func (app *App) Trace(path string, handlers ...Handler) Router
func (app *App) Patch(path string, handlers ...Handler) Router

// Add allows you to specifiy a method as value
func (app *App) Add(method, path string, handlers ...Handler) Router

// All will register the route on all HTTP methods
// Almost the same as app.Use but not bound to prefixes
func (app *App) All(path string, handlers ...Handler) Router
Examples
// Simple GET handler
app.Get("/api/list", func(c *fiber.Ctx) error {
return c.SendString("I'm a GET request!")
})

// Simple POST handler
app.Post("/api/register", func(c *fiber.Ctx) error {
return c.SendString("I'm a POST request!")
})

Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc

Signature
func (app *App) Use(args ...interface{}) Router
Examples
// Match any request
app.Use(func(c *fiber.Ctx) error {
return c.Next()
})

// Match request starting with /api
app.Use("/api", func(c *fiber.Ctx) error {
return c.Next()
})

// Match requests starting with /api or /home (multiple-prefix support)
app.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {
return c.Next()
})

// Attach multiple handlers
app.Use("/api", func(c *fiber.Ctx) error {
c.Set("X-Custom-Header", random.String(32))
return c.Next()
}, func(c *fiber.Ctx) error {
return c.Next()
})

Mount​

You can Mount Fiber instance by creating a *Mount

Signature
func (a *App) Mount(prefix string, app *App) Router
Examples
func main() {
app := fiber.New()
micro := fiber.New()
app.Mount("/john", micro) // GET /john/doe -> 200 OK

micro.Get("/doe", func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK)
})

log.Fatal(app.Listen(":3000"))
}

MountPath​

The MountPath property contains one or more path patterns on which a sub-app was mounted.

Signature
func (app *App) MountPath() string
Examples
func main() {
app := fiber.New()
one := fiber.New()
two := fiber.New()
three := fiber.New()

two.Mount("/three", three)
one.Mount("/two", two)
app.Mount("/one", one)

one.MountPath() // "/one"
two.MountPath() // "/one/two"
three.MountPath() // "/one/two/three"
app.MountPath() // ""
}
caution

Mounting order is important for MountPath. If you want to get mount paths properly, you should start mounting from the deepest app.

Group​

You can group routes by creating a *Group struct.

Signature
func (app *App) Group(prefix string, handlers ...Handler) Router
Examples
func main() {
app := fiber.New()

api := app.Group("/api", handler) // /api

v1 := api.Group("/v1", handler) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", handler) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

Route​

You can define routes with a common prefix inside the common function.

Signature
func (app *App) Route(prefix string, fn func(router Router), name ...string) Router
Examples
func main() {
app := fiber.New()

app.Route("/test", func(api fiber.Router) {
api.Get("/foo", handler).Name("foo") // /test/foo (name: test.foo)
api.Get("/bar", handler).Name("bar") // /test/bar (name: test.bar)
}, "test.")

log.Fatal(app.Listen(":3000"))
}

Server​

Server returns the underlying fasthttp server

Signature
func (app *App) Server() *fasthttp.Server
Examples
func main() {
app := fiber.New()

app.Server().MaxConnsPerIP = 1

// ...
}

Server Shutdown​

Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners and then waits indefinitely for all connections to return to idle before shutting down.

ShutdownWithTimeout will forcefully close any active connections after the timeout expires.

ShutdownWithContext shuts down the server including by force if the context's deadline is exceeded.

func (app *App) Shutdown() error
func (app *App) ShutdownWithTimeout(timeout time.Duration) error
func (app *App) ShutdownWithContext(ctx context.Context) error

HandlersCount​

This method returns the amount of registered handlers.

Signature
func (app *App) HandlersCount() uint32

Stack​

This method returns the original router stack

Signature
func (app *App) Stack() [][]*Route
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/john/:age", handler)
app.Post("/register", handler)

data, _ := json.MarshalIndent(app.Stack(), "", " ")
fmt.Println(string(data))

app.Listen(":3000")
}
Result
[
[
{
"method": "GET",
"path": "/john/:age",
"params": [
"age"
]
}
],
[
{
"method": "HEAD",
"path": "/john/:age",
"params": [
"age"
]
}
],
[
{
"method": "POST",
"path": "/register",
"params": null
}
]
]

Name​

This method assigns the name of latest created route.

Signature
func (app *App) Name(name string) Router
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/", handler)
app.Name("index")

app.Get("/doe", handler).Name("home")

app.Trace("/tracer", handler).Name("tracert")

app.Delete("/delete", handler).Name("delete")

a := app.Group("/a")
a.Name("fd.")

a.Get("/test", handler).Name("test")

data, _ := json.MarshalIndent(app.Stack(), "", " ")
fmt.Print(string(data))

app.Listen(":3000")

}
Result
[
[
{
"method": "GET",
"name": "index",
"path": "/",
"params": null
},
{
"method": "GET",
"name": "home",
"path": "/doe",
"params": null
},
{
"method": "GET",
"name": "fd.test",
"path": "/a/test",
"params": null
}
],
[
{
"method": "HEAD",
"name": "",
"path": "/",
"params": null
},
{
"method": "HEAD",
"name": "",
"path": "/doe",
"params": null
},
{
"method": "HEAD",
"name": "",
"path": "/a/test",
"params": null
}
],
null,
null,
[
{
"method": "DELETE",
"name": "delete",
"path": "/delete",
"params": null
}
],
null,
null,
[
{
"method": "TRACE",
"name": "tracert",
"path": "/tracer",
"params": null
}
],
null
]

GetRoute​

This method gets the route by name.

Signature
func (app *App) GetRoute(name string) Route
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/", handler).Name("index")

data, _ := json.MarshalIndent(app.GetRoute("index"), "", " ")
fmt.Print(string(data))


app.Listen(":3000")

}
Result
{
"method": "GET",
"name": "index",
"path": "/",
"params": null
}

GetRoutes​

This method gets all routes.

Signature
func (app *App) GetRoutes(filterUseOption ...bool) []Route

When filterUseOption equal to true, it will filter the routes registered by the middleware.

Examples
func main() {
app := fiber.New()
app.Post("/", func (c *fiber.Ctx) error {
return c.SendString("Hello, World!")
}).Name("index")
data, _ := json.MarshalIndent(app.GetRoutes(true), "", " ")
fmt.Print(string(data))
}
Result
[
{
"method": "POST",
"name": "index",
"path": "/",
"params": null
}
]

Config​

Config returns the app config as value ( read-only ).

Signature
func (app *App) Config() Config

Handler​

Handler returns the server handler that can be used to serve custom *fasthttp.RequestCtx requests.

Signature
func (app *App) Handler() fasthttp.RequestHandler

Listen​

Listen serves HTTP requests from the given address.

Signature
func (app *App) Listen(addr string) error
Examples
// Listen on port :8080 
app.Listen(":8080")

// Custom host
app.Listen("127.0.0.1:8080")

ListenTLS​

ListenTLS serves HTTPs requests from the given address using certFile and keyFile paths to as TLS certificate and key file.

Signature
func (app *App) ListenTLS(addr, certFile, keyFile string) error
Examples
app.ListenTLS(":443", "./cert.pem", "./cert.key");

Using ListenTLS defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
Certificates: []tls.Certificate{
cert,
},
}

ListenTLSWithCertificate​

Signature
func (app *App) ListenTLS(addr string, cert tls.Certificate) error
Examples
app.ListenTLSWithCertificate(":443", cert);

Using ListenTLSWithCertificate defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
Certificates: []tls.Certificate{
cert,
},
}

ListenMutualTLS​

ListenMutualTLS serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file

Signature
func (app *App) ListenMutualTLS(addr, certFile, keyFile, clientCertFile string) error
Examples
app.ListenMutualTLS(":443", "./cert.pem", "./cert.key", "./ca-chain-cert.pem");

Using ListenMutualTLS defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: clientCertPool,
Certificates: []tls.Certificate{
cert,
},
}

ListenMutualTLSWithCertificate​

ListenMutualTLSWithCertificate serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file

Signature
func (app *App) ListenMutualTLSWithCertificate(addr string, cert tls.Certificate, clientCertPool *x509.CertPool) error
Examples
app.ListenMutualTLSWithCertificate(":443", cert, clientCertPool);

Using ListenMutualTLSWithCertificate defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: clientCertPool,
Certificates: []tls.Certificate{
cert,
},
}

Listener​

You can pass your own net.Listener using the Listener method. This method can be used to enable TLS/HTTPS with a custom tls.Config.

Signature
func (app *App) Listener(ln net.Listener) error
Examples
ln, _ := net.Listen("tcp", ":3000")

cer, _:= tls.LoadX509KeyPair("server.crt", "server.key")

ln = tls.NewListener(ln, &tls.Config{Certificates: []tls.Certificate{cer}})

app.Listener(ln)

Test​

Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 1s if you want to disable a timeout altogether, pass -1 as a second argument.

Signature
func (app *App) Test(req *http.Request, msTimeout ...int) (*http.Response, error)
Examples
// Create route with GET method for test:
app.Get("/", func(c *fiber.Ctx) error {
fmt.Println(c.BaseURL()) // => http://google.com
fmt.Println(c.Get("X-Custom-Header")) // => hi

return c.SendString("hello, World!")
})

// http.Request
req := httptest.NewRequest("GET", "http://google.com", nil)
req.Header.Set("X-Custom-Header", "hi")

// http.Response
resp, _ := app.Test(req)

// Do something with results:
if resp.StatusCode == fiber.StatusOK {
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body)) // => Hello, World!
}

Hooks​

Hooks is a method to return hooks property.

Signature
func (app *App) Hooks() *Hooks
+ + \ No newline at end of file diff --git a/api/client/index.html b/api/client/index.html index a18e72753c7..4712aec3a62 100644 --- a/api/client/index.html +++ b/api/client/index.html @@ -6,14 +6,14 @@ 🌎 Client | Fiber - - + +
Skip to main content
Version: v2.x

🌎 Client

Start request​

Start a http request with http method and url.

Signatures
// Client http methods
func (c *Client) Get(url string) *Agent
func (c *Client) Head(url string) *Agent
func (c *Client) Post(url string) *Agent
func (c *Client) Put(url string) *Agent
func (c *Client) Patch(url string) *Agent
func (c *Client) Delete(url string) *Agent

✨ Agent​

Agent is built on top of FastHTTP's HostClient which has lots of convenient helper methods such as dedicated methods for request methods.

Parse​

Parse initializes a HostClient.

Parse
a := AcquireAgent()
req := a.Request()
req.Header.SetMethod(MethodGet)
req.SetRequestURI("http://example.com")

if err := a.Parse(); err != nil {
panic(err)
}

code, body, errs := a.Bytes() // ...

Set​

Set sets the given key: value header.

Signature
func (a *Agent) Set(k, v string) *Agent
func (a *Agent) SetBytesK(k []byte, v string) *Agent
func (a *Agent) SetBytesV(k string, v []byte) *Agent
func (a *Agent) SetBytesKV(k []byte, v []byte) *Agent
Example
agent.Set("k1", "v1").
SetBytesK([]byte("k1"), "v1").
SetBytesV("k1", []byte("v1")).
SetBytesKV([]byte("k2"), []byte("v2"))
// ...

Add​

Add adds the given key: value header. Multiple headers with the same key may be added with this function.

Signature
func (a *Agent) Add(k, v string) *Agent
func (a *Agent) AddBytesK(k []byte, v string) *Agent
func (a *Agent) AddBytesV(k string, v []byte) *Agent
func (a *Agent) AddBytesKV(k []byte, v []byte) *Agent
Example
agent.Add("k1", "v1").
AddBytesK([]byte("k1"), "v1").
AddBytesV("k1", []byte("v1")).
AddBytesKV([]byte("k2"), []byte("v2"))
// Headers:
// K1: v1
// K1: v1
// K1: v1
// K2: v2

ConnectionClose​

ConnectionClose adds the Connection: close header.

Signature
func (a *Agent) ConnectionClose() *Agent
Example
agent.ConnectionClose()
// ...

UserAgent​

UserAgent sets User-Agent header value.

Signature
func (a *Agent) UserAgent(userAgent string) *Agent
func (a *Agent) UserAgentBytes(userAgent []byte) *Agent
Example
agent.UserAgent("fiber")
// ...

Cookie sets a cookie in key: value form. Cookies can be used to set multiple cookies.

Signature
func (a *Agent) Cookie(key, value string) *Agent
func (a *Agent) CookieBytesK(key []byte, value string) *Agent
func (a *Agent) CookieBytesKV(key, value []byte) *Agent
func (a *Agent) Cookies(kv ...string) *Agent
func (a *Agent) CookiesBytesKV(kv ...[]byte) *Agent
Example
agent.Cookie("k", "v")
agent.Cookies("k1", "v1", "k2", "v2")
// ...

Referer​

Referer sets the Referer header value.

Signature
func (a *Agent) Referer(referer string) *Agent
func (a *Agent) RefererBytes(referer []byte) *Agent
Example
agent.Referer("https://docs.gofiber.io")
// ...

ContentType​

ContentType sets Content-Type header value.

Signature
func (a *Agent) ContentType(contentType string) *Agent
func (a *Agent) ContentTypeBytes(contentType []byte) *Agent
Example
agent.ContentType("custom-type")
// ...

Host​

Host sets the Host header.

Signature
func (a *Agent) Host(host string) *Agent
func (a *Agent) HostBytes(host []byte) *Agent
Example
agent.Host("example.com")
// ...

QueryString​

QueryString sets the URI query string.

Signature
func (a *Agent) QueryString(queryString string) *Agent
func (a *Agent) QueryStringBytes(queryString []byte) *Agent
Example
agent.QueryString("foo=bar")
// ...

BasicAuth​

BasicAuth sets the URI username and password using HTTP Basic Auth.

Signature
func (a *Agent) BasicAuth(username, password string) *Agent
func (a *Agent) BasicAuthBytes(username, password []byte) *Agent
Example
agent.BasicAuth("foo", "bar")
// ...

Body​

There are several ways to set request body.

Signature
func (a *Agent) BodyString(bodyString string) *Agent
func (a *Agent) Body(body []byte) *Agent

// BodyStream sets request body stream and, optionally body size.
//
// If bodySize is >= 0, then the bodyStream must provide exactly bodySize bytes
// before returning io.EOF.
//
// If bodySize < 0, then bodyStream is read until io.EOF.
//
// bodyStream.Close() is called after finishing reading all body data
// if it implements io.Closer.
//
// Note that GET and HEAD requests cannot have body.
func (a *Agent) BodyStream(bodyStream io.Reader, bodySize int) *Agent
Example
agent.BodyString("foo=bar")
agent.Body([]byte("bar=baz"))
agent.BodyStream(strings.NewReader("body=stream"), -1)
// ...

JSON​

JSON sends a JSON request by setting the Content-Type header to application/json.

Signature
func (a *Agent) JSON(v interface{}) *Agent
Example
agent.JSON(fiber.Map{"success": true})
// ...

XML​

XML sends an XML request by setting the Content-Type header to application/xml.

Signature
func (a *Agent) XML(v interface{}) *Agent
Example
agent.XML(fiber.Map{"success": true})
// ...

Form​

Form sends a form request by setting the Content-Type header to application/x-www-form-urlencoded.

Signature
// Form sends form request with body if args is non-nil.
//
// It is recommended obtaining args via AcquireArgs and release it
// manually in performance-critical code.
func (a *Agent) Form(args *Args) *Agent
Example
args := AcquireArgs()
args.Set("foo", "bar")

agent.Form(args)
// ...
ReleaseArgs(args)

MultipartForm​

MultipartForm sends multipart form request by setting the Content-Type header to multipart/form-data. These requests can include key-value's and files.

Signature
// MultipartForm sends multipart form request with k-v and files.
//
// It is recommended to obtain args via AcquireArgs and release it
// manually in performance-critical code.
func (a *Agent) MultipartForm(args *Args) *Agent
Example
args := AcquireArgs()
args.Set("foo", "bar")

agent.MultipartForm(args)
// ...
ReleaseArgs(args)

Fiber provides several methods for sending files. Note that they must be called before MultipartForm.

Boundary​

Boundary sets boundary for multipart form request.

Signature
func (a *Agent) Boundary(boundary string) *Agent
Example
agent.Boundary("myBoundary")
.MultipartForm(nil)
// ...

SendFile(s)​

SendFile read a file and appends it to a multipart form request. Sendfiles can be used to append multiple files.

Signature
func (a *Agent) SendFile(filename string, fieldname ...string) *Agent
func (a *Agent) SendFiles(filenamesAndFieldnames ...string) *Agent
Example
agent.SendFile("f", "field name")
.SendFiles("f1", "field name1", "f2").
.MultipartForm(nil)
// ...

FileData​

FileData appends file data for multipart form request.

// FormFile represents multipart form file
type FormFile struct {
// Fieldname is form file's field name
Fieldname string
// Name is form file's name
Name string
// Content is form file's content
Content []byte
}
Signature
// FileData appends files for multipart form request.
//
// It is recommended obtaining formFile via AcquireFormFile and release it
// manually in performance-critical code.
func (a *Agent) FileData(formFiles ...*FormFile) *Agent
Example
ff1 := &FormFile{"filename1", "field name1", []byte("content")}
ff2 := &FormFile{"filename2", "field name2", []byte("content")}
agent.FileData(ff1, ff2).
MultipartForm(nil)
// ...

Debug​

Debug mode enables logging request and response detail to io.writer(default is os.Stdout).

Signature
func (a *Agent) Debug(w ...io.Writer) *Agent
Example
agent.Debug()
// ...

Timeout​

Timeout sets request timeout duration.

Signature
func (a *Agent) Timeout(timeout time.Duration) *Agent
Example
agent.Timeout(time.Second)
// ...

Reuse​

Reuse enables the Agent instance to be used again after one request. If agent is reusable, then it should be released manually when it is no longer used.

Signature
func (a *Agent) Reuse() *Agent
Example
agent.Reuse()
// ...

InsecureSkipVerify​

InsecureSkipVerify controls whether the Agent verifies the server certificate chain and host name.

Signature
func (a *Agent) InsecureSkipVerify() *Agent
Example
agent.InsecureSkipVerify()
// ...

TLSConfig​

TLSConfig sets tls config.

Signature
func (a *Agent) TLSConfig(config *tls.Config) *Agent
Example
// Create tls certificate
cer, _ := tls.LoadX509KeyPair("pem", "key")

config := &tls.Config{
Certificates: []tls.Certificate{cer},
}

agent.TLSConfig(config)
// ...

MaxRedirectsCount​

MaxRedirectsCount sets max redirect count for GET and HEAD.

Signature
func (a *Agent) MaxRedirectsCount(count int) *Agent
Example
agent.MaxRedirectsCount(7)
// ...

JSONEncoder​

JSONEncoder sets custom json encoder.

Signature
func (a *Agent) JSONEncoder(jsonEncoder utils.JSONMarshal) *Agent
Example
agent.JSONEncoder(json.Marshal)
// ...

JSONDecoder​

JSONDecoder sets custom json decoder.

Signature
func (a *Agent) JSONDecoder(jsonDecoder utils.JSONUnmarshal) *Agent
Example
agent.JSONDecoder(json.Unmarshal)
// ...

Request​

Request returns Agent request instance.

Signature
func (a *Agent) Request() *Request
Example
req := agent.Request()
// ...

SetResponse​

SetResponse sets custom response for the Agent instance. It is recommended obtaining custom response via AcquireResponse and release it manually in performance-critical code.

Signature
func (a *Agent) SetResponse(customResp *Response) *Agent
Example
resp := AcquireResponse()
agent.SetResponse(resp)
// ...
ReleaseResponse(resp)

Dest​

Dest sets custom dest. The contents of dest will be replaced by the response body, if the dest is too small a new slice will be allocated.

Signature
func (a *Agent) Dest(dest []byte) *Agent {
Example
agent.Dest(nil)
// ...

Bytes​

Bytes returns the status code, bytes body and errors of url.

Signature
func (a *Agent) Bytes() (code int, body []byte, errs []error)
Example
code, body, errs := agent.Bytes()
// ...

String​

String returns the status code, string body and errors of url.

Signature
func (a *Agent) String() (int, string, []error)
Example
code, body, errs := agent.String()
// ...

Struct​

Struct returns the status code, bytes body and errors of url. And bytes body will be unmarshalled to given v.

Signature
func (a *Agent) Struct(v interface{}) (code int, body []byte, errs []error)
Example
var d data
code, body, errs := agent.Struct(&d)
// ...

RetryIf​

RetryIf controls whether a retry should be attempted after an error. -By default, will use isIdempotent function from fasthttp

Signature
func (a *Agent) RetryIf(retryIf RetryIfFunc) *Agent
Example
agent.Get("https://example.com").RetryIf(func (req *fiber.Request) bool {
return req.URI() == "https://example.com"
})
// ...
- - +By default, will use isIdempotent function from fasthttp

Signature
func (a *Agent) RetryIf(retryIf RetryIfFunc) *Agent
Example
agent.Get("https://example.com").RetryIf(func (req *fiber.Request) bool {
return req.URI() == "https://example.com"
})
// ...
+ + \ No newline at end of file diff --git a/api/constants/index.html b/api/constants/index.html index 24a99e7b30a..0b3294156cf 100644 --- a/api/constants/index.html +++ b/api/constants/index.html @@ -6,13 +6,13 @@ πŸ“‹ Constants | Fiber - - + +
-
Skip to main content
Version: v2.x

πŸ“‹ Constants

HTTP methods were copied from net/http.

const (
MethodGet = "GET" // RFC 7231, 4.3.1
MethodHead = "HEAD" // RFC 7231, 4.3.2
MethodPost = "POST" // RFC 7231, 4.3.3
MethodPut = "PUT" // RFC 7231, 4.3.4
MethodPatch = "PATCH" // RFC 5789
MethodDelete = "DELETE" // RFC 7231, 4.3.5
MethodConnect = "CONNECT" // RFC 7231, 4.3.6
MethodOptions = "OPTIONS" // RFC 7231, 4.3.7
MethodTrace = "TRACE" // RFC 7231, 4.3.8
methodUse = "USE"
)

MIME types that are commonly used

const (
MIMETextXML = "text/xml"
MIMETextHTML = "text/html"
MIMETextPlain = "text/plain"
MIMEApplicationXML = "application/xml"
MIMEApplicationJSON = "application/json"
MIMEApplicationJavaScript = "application/javascript"
MIMEApplicationForm = "application/x-www-form-urlencoded"
MIMEOctetStream = "application/octet-stream"
MIMEMultipartForm = "multipart/form-data"

MIMETextXMLCharsetUTF8 = "text/xml; charset=utf-8"
MIMETextHTMLCharsetUTF8 = "text/html; charset=utf-8"
MIMETextPlainCharsetUTF8 = "text/plain; charset=utf-8"
MIMEApplicationXMLCharsetUTF8 = "application/xml; charset=utf-8"
MIMEApplicationJSONCharsetUTF8 = "application/json; charset=utf-8"
MIMEApplicationJavaScriptCharsetUTF8 = "application/javascript; charset=utf-8"
)

HTTP status codes were copied from net/http.

const (
StatusContinue = 100 // RFC 7231, 6.2.1
StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2
StatusProcessing = 102 // RFC 2518, 10.1
StatusEarlyHints = 103 // RFC 8297
StatusOK = 200 // RFC 7231, 6.3.1
StatusCreated = 201 // RFC 7231, 6.3.2
StatusAccepted = 202 // RFC 7231, 6.3.3
StatusNonAuthoritativeInformation = 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
StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7
StatusPermanentRedirect = 308 // RFC 7538, 3
StatusBadRequest = 400 // RFC 7231, 6.5.1
StatusUnauthorized = 401 // RFC 7235, 3.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
StatusMisdirectedRequest = 421 // RFC 7540, 9.1.2
StatusUnprocessableEntity = 422 // RFC 4918, 11.2
StatusLocked = 423 // RFC 4918, 11.3
StatusFailedDependency = 424 // RFC 4918, 11.4
StatusTooEarly = 425 // RFC 8470, 5.2.
StatusUpgradeRequired = 426 // RFC 7231, 6.5.15
StatusPreconditionRequired = 428 // RFC 6585, 3
StatusTooManyRequests = 429 // RFC 6585, 4
StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5
StatusUnavailableForLegalReasons = 451 // RFC 7725, 3
StatusInternalServerError = 500 // RFC 7231, 6.6.1
StatusNotImplemented = 501 // RFC 7231, 6.6.2
StatusBadGateway = 502 // RFC 7231, 6.6.3
StatusServiceUnavailable = 503 // RFC 7231, 6.6.4
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
)

Errors

var (
ErrBadRequest = NewError(StatusBadRequest) // RFC 7231, 6.5.1
ErrUnauthorized = NewError(StatusUnauthorized) // RFC 7235, 3.1
ErrPaymentRequired = NewError(StatusPaymentRequired) // RFC 7231, 6.5.2
ErrForbidden = NewError(StatusForbidden) // RFC 7231, 6.5.3
ErrNotFound = NewError(StatusNotFound) // RFC 7231, 6.5.4
ErrMethodNotAllowed = NewError(StatusMethodNotAllowed) // RFC 7231, 6.5.5
ErrNotAcceptable = NewError(StatusNotAcceptable) // RFC 7231, 6.5.6
ErrProxyAuthRequired = NewError(StatusProxyAuthRequired) // RFC 7235, 3.2
ErrRequestTimeout = NewError(StatusRequestTimeout) // RFC 7231, 6.5.7
ErrConflict = NewError(StatusConflict) // RFC 7231, 6.5.8
ErrGone = NewError(StatusGone) // RFC 7231, 6.5.9
ErrLengthRequired = NewError(StatusLengthRequired) // RFC 7231, 6.5.10
ErrPreconditionFailed = NewError(StatusPreconditionFailed) // RFC 7232, 4.2
ErrRequestEntityTooLarge = NewError(StatusRequestEntityTooLarge) // RFC 7231, 6.5.11
ErrRequestURITooLong = NewError(StatusRequestURITooLong) // RFC 7231, 6.5.12
ErrUnsupportedMediaType = NewError(StatusUnsupportedMediaType) // RFC 7231, 6.5.13
ErrRequestedRangeNotSatisfiable = NewError(StatusRequestedRangeNotSatisfiable) // RFC 7233, 4.4
ErrExpectationFailed = NewError(StatusExpectationFailed) // RFC 7231, 6.5.14
ErrTeapot = NewError(StatusTeapot) // RFC 7168, 2.3.3
ErrMisdirectedRequest = NewError(StatusMisdirectedRequest) // RFC 7540, 9.1.2
ErrUnprocessableEntity = NewError(StatusUnprocessableEntity) // RFC 4918, 11.2
ErrLocked = NewError(StatusLocked) // RFC 4918, 11.3
ErrFailedDependency = NewError(StatusFailedDependency) // RFC 4918, 11.4
ErrTooEarly = NewError(StatusTooEarly) // RFC 8470, 5.2.
ErrUpgradeRequired = NewError(StatusUpgradeRequired) // RFC 7231, 6.5.15
ErrPreconditionRequired = NewError(StatusPreconditionRequired) // RFC 6585, 3
ErrTooManyRequests = NewError(StatusTooManyRequests) // RFC 6585, 4
ErrRequestHeaderFieldsTooLarge = NewError(StatusRequestHeaderFieldsTooLarge) // RFC 6585, 5
ErrUnavailableForLegalReasons = NewError(StatusUnavailableForLegalReasons) // RFC 7725, 3
ErrInternalServerError = NewError(StatusInternalServerError) // RFC 7231, 6.6.1
ErrNotImplemented = NewError(StatusNotImplemented) // RFC 7231, 6.6.2
ErrBadGateway = NewError(StatusBadGateway) // RFC 7231, 6.6.3
ErrServiceUnavailable = NewError(StatusServiceUnavailable) // RFC 7231, 6.6.4
ErrGatewayTimeout = NewError(StatusGatewayTimeout) // RFC 7231, 6.6.5
ErrHTTPVersionNotSupported = NewError(StatusHTTPVersionNotSupported) // RFC 7231, 6.6.6
ErrVariantAlsoNegotiates = NewError(StatusVariantAlsoNegotiates) // RFC 2295, 8.1
ErrInsufficientStorage = NewError(StatusInsufficientStorage) // RFC 4918, 11.5
ErrLoopDetected = NewError(StatusLoopDetected) // RFC 5842, 7.2
ErrNotExtended = NewError(StatusNotExtended) // RFC 2774, 7
ErrNetworkAuthenticationRequired = NewError(StatusNetworkAuthenticationRequired) // RFC 6585, 6
)

HTTP Headers were copied from net/http.

const (
HeaderAuthorization = "Authorization"
HeaderProxyAuthenticate = "Proxy-Authenticate"
HeaderProxyAuthorization = "Proxy-Authorization"
HeaderWWWAuthenticate = "WWW-Authenticate"
HeaderAge = "Age"
HeaderCacheControl = "Cache-Control"
HeaderClearSiteData = "Clear-Site-Data"
HeaderExpires = "Expires"
HeaderPragma = "Pragma"
HeaderWarning = "Warning"
HeaderAcceptCH = "Accept-CH"
HeaderAcceptCHLifetime = "Accept-CH-Lifetime"
HeaderContentDPR = "Content-DPR"
HeaderDPR = "DPR"
HeaderEarlyData = "Early-Data"
HeaderSaveData = "Save-Data"
HeaderViewportWidth = "Viewport-Width"
HeaderWidth = "Width"
HeaderETag = "ETag"
HeaderIfMatch = "If-Match"
HeaderIfModifiedSince = "If-Modified-Since"
HeaderIfNoneMatch = "If-None-Match"
HeaderIfUnmodifiedSince = "If-Unmodified-Since"
HeaderLastModified = "Last-Modified"
HeaderVary = "Vary"
HeaderConnection = "Connection"
HeaderKeepAlive = "Keep-Alive"
HeaderAccept = "Accept"
HeaderAcceptCharset = "Accept-Charset"
HeaderAcceptEncoding = "Accept-Encoding"
HeaderAcceptLanguage = "Accept-Language"
HeaderCookie = "Cookie"
HeaderExpect = "Expect"
HeaderMaxForwards = "Max-Forwards"
HeaderSetCookie = "Set-Cookie"
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"
HeaderOrigin = "Origin"
HeaderTimingAllowOrigin = "Timing-Allow-Origin"
HeaderXPermittedCrossDomainPolicies = "X-Permitted-Cross-Domain-Policies"
HeaderDNT = "DNT"
HeaderTk = "Tk"
HeaderContentDisposition = "Content-Disposition"
HeaderContentEncoding = "Content-Encoding"
HeaderContentLanguage = "Content-Language"
HeaderContentLength = "Content-Length"
HeaderContentLocation = "Content-Location"
HeaderContentType = "Content-Type"
HeaderForwarded = "Forwarded"
HeaderVia = "Via"
HeaderXForwardedFor = "X-Forwarded-For"
HeaderXForwardedHost = "X-Forwarded-Host"
HeaderXForwardedProto = "X-Forwarded-Proto"
HeaderXForwardedProtocol = "X-Forwarded-Protocol"
HeaderXForwardedSsl = "X-Forwarded-Ssl"
HeaderXUrlScheme = "X-Url-Scheme"
HeaderLocation = "Location"
HeaderFrom = "From"
HeaderHost = "Host"
HeaderReferer = "Referer"
HeaderReferrerPolicy = "Referrer-Policy"
HeaderUserAgent = "User-Agent"
HeaderAllow = "Allow"
HeaderServer = "Server"
HeaderAcceptRanges = "Accept-Ranges"
HeaderContentRange = "Content-Range"
HeaderIfRange = "If-Range"
HeaderRange = "Range"
HeaderContentSecurityPolicy = "Content-Security-Policy"
HeaderContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"
HeaderCrossOriginResourcePolicy = "Cross-Origin-Resource-Policy"
HeaderExpectCT = "Expect-CT"
HeaderFeaturePolicy = "Feature-Policy"
HeaderPublicKeyPins = "Public-Key-Pins"
HeaderPublicKeyPinsReportOnly = "Public-Key-Pins-Report-Only"
HeaderStrictTransportSecurity = "Strict-Transport-Security"
HeaderUpgradeInsecureRequests = "Upgrade-Insecure-Requests"
HeaderXContentTypeOptions = "X-Content-Type-Options"
HeaderXDownloadOptions = "X-Download-Options"
HeaderXFrameOptions = "X-Frame-Options"
HeaderXPoweredBy = "X-Powered-By"
HeaderXXSSProtection = "X-XSS-Protection"
HeaderLastEventID = "Last-Event-ID"
HeaderNEL = "NEL"
HeaderPingFrom = "Ping-From"
HeaderPingTo = "Ping-To"
HeaderReportTo = "Report-To"
HeaderTE = "TE"
HeaderTrailer = "Trailer"
HeaderTransferEncoding = "Transfer-Encoding"
HeaderSecWebSocketAccept = "Sec-WebSocket-Accept"
HeaderSecWebSocketExtensions = "Sec-WebSocket-Extensions"
HeaderSecWebSocketKey = "Sec-WebSocket-Key"
HeaderSecWebSocketProtocol = "Sec-WebSocket-Protocol"
HeaderSecWebSocketVersion = "Sec-WebSocket-Version"
HeaderAcceptPatch = "Accept-Patch"
HeaderAcceptPushPolicy = "Accept-Push-Policy"
HeaderAcceptSignature = "Accept-Signature"
HeaderAltSvc = "Alt-Svc"
HeaderDate = "Date"
HeaderIndex = "Index"
HeaderLargeAllocation = "Large-Allocation"
HeaderLink = "Link"
HeaderPushPolicy = "Push-Policy"
HeaderRetryAfter = "Retry-After"
HeaderServerTiming = "Server-Timing"
HeaderSignature = "Signature"
HeaderSignedHeaders = "Signed-Headers"
HeaderSourceMap = "SourceMap"
HeaderUpgrade = "Upgrade"
HeaderXDNSPrefetchControl = "X-DNS-Prefetch-Control"
HeaderXPingback = "X-Pingback"
HeaderXRequestID = "X-Request-ID"
HeaderXRequestedWith = "X-Requested-With"
HeaderXRobotsTag = "X-Robots-Tag"
HeaderXUACompatible = "X-UA-Compatible"
)
- - +
Skip to main content
Version: v2.x

πŸ“‹ Constants

HTTP methods were copied from net/http.

const (
MethodGet = "GET" // RFC 7231, 4.3.1
MethodHead = "HEAD" // RFC 7231, 4.3.2
MethodPost = "POST" // RFC 7231, 4.3.3
MethodPut = "PUT" // RFC 7231, 4.3.4
MethodPatch = "PATCH" // RFC 5789
MethodDelete = "DELETE" // RFC 7231, 4.3.5
MethodConnect = "CONNECT" // RFC 7231, 4.3.6
MethodOptions = "OPTIONS" // RFC 7231, 4.3.7
MethodTrace = "TRACE" // RFC 7231, 4.3.8
methodUse = "USE"
)

MIME types that are commonly used

const (
MIMETextXML = "text/xml"
MIMETextHTML = "text/html"
MIMETextPlain = "text/plain"
MIMEApplicationXML = "application/xml"
MIMEApplicationJSON = "application/json"
MIMEApplicationJavaScript = "application/javascript"
MIMEApplicationForm = "application/x-www-form-urlencoded"
MIMEOctetStream = "application/octet-stream"
MIMEMultipartForm = "multipart/form-data"

MIMETextXMLCharsetUTF8 = "text/xml; charset=utf-8"
MIMETextHTMLCharsetUTF8 = "text/html; charset=utf-8"
MIMETextPlainCharsetUTF8 = "text/plain; charset=utf-8"
MIMEApplicationXMLCharsetUTF8 = "application/xml; charset=utf-8"
MIMEApplicationJSONCharsetUTF8 = "application/json; charset=utf-8"
MIMEApplicationJavaScriptCharsetUTF8 = "application/javascript; charset=utf-8"
)

HTTP status codes were copied from net/http.

const (
StatusContinue = 100 // RFC 7231, 6.2.1
StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2
StatusProcessing = 102 // RFC 2518, 10.1
StatusEarlyHints = 103 // RFC 8297
StatusOK = 200 // RFC 7231, 6.3.1
StatusCreated = 201 // RFC 7231, 6.3.2
StatusAccepted = 202 // RFC 7231, 6.3.3
StatusNonAuthoritativeInformation = 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
StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7
StatusPermanentRedirect = 308 // RFC 7538, 3
StatusBadRequest = 400 // RFC 7231, 6.5.1
StatusUnauthorized = 401 // RFC 7235, 3.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
StatusMisdirectedRequest = 421 // RFC 7540, 9.1.2
StatusUnprocessableEntity = 422 // RFC 4918, 11.2
StatusLocked = 423 // RFC 4918, 11.3
StatusFailedDependency = 424 // RFC 4918, 11.4
StatusTooEarly = 425 // RFC 8470, 5.2.
StatusUpgradeRequired = 426 // RFC 7231, 6.5.15
StatusPreconditionRequired = 428 // RFC 6585, 3
StatusTooManyRequests = 429 // RFC 6585, 4
StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5
StatusUnavailableForLegalReasons = 451 // RFC 7725, 3
StatusInternalServerError = 500 // RFC 7231, 6.6.1
StatusNotImplemented = 501 // RFC 7231, 6.6.2
StatusBadGateway = 502 // RFC 7231, 6.6.3
StatusServiceUnavailable = 503 // RFC 7231, 6.6.4
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
)

Errors

var (
ErrBadRequest = NewError(StatusBadRequest) // RFC 7231, 6.5.1
ErrUnauthorized = NewError(StatusUnauthorized) // RFC 7235, 3.1
ErrPaymentRequired = NewError(StatusPaymentRequired) // RFC 7231, 6.5.2
ErrForbidden = NewError(StatusForbidden) // RFC 7231, 6.5.3
ErrNotFound = NewError(StatusNotFound) // RFC 7231, 6.5.4
ErrMethodNotAllowed = NewError(StatusMethodNotAllowed) // RFC 7231, 6.5.5
ErrNotAcceptable = NewError(StatusNotAcceptable) // RFC 7231, 6.5.6
ErrProxyAuthRequired = NewError(StatusProxyAuthRequired) // RFC 7235, 3.2
ErrRequestTimeout = NewError(StatusRequestTimeout) // RFC 7231, 6.5.7
ErrConflict = NewError(StatusConflict) // RFC 7231, 6.5.8
ErrGone = NewError(StatusGone) // RFC 7231, 6.5.9
ErrLengthRequired = NewError(StatusLengthRequired) // RFC 7231, 6.5.10
ErrPreconditionFailed = NewError(StatusPreconditionFailed) // RFC 7232, 4.2
ErrRequestEntityTooLarge = NewError(StatusRequestEntityTooLarge) // RFC 7231, 6.5.11
ErrRequestURITooLong = NewError(StatusRequestURITooLong) // RFC 7231, 6.5.12
ErrUnsupportedMediaType = NewError(StatusUnsupportedMediaType) // RFC 7231, 6.5.13
ErrRequestedRangeNotSatisfiable = NewError(StatusRequestedRangeNotSatisfiable) // RFC 7233, 4.4
ErrExpectationFailed = NewError(StatusExpectationFailed) // RFC 7231, 6.5.14
ErrTeapot = NewError(StatusTeapot) // RFC 7168, 2.3.3
ErrMisdirectedRequest = NewError(StatusMisdirectedRequest) // RFC 7540, 9.1.2
ErrUnprocessableEntity = NewError(StatusUnprocessableEntity) // RFC 4918, 11.2
ErrLocked = NewError(StatusLocked) // RFC 4918, 11.3
ErrFailedDependency = NewError(StatusFailedDependency) // RFC 4918, 11.4
ErrTooEarly = NewError(StatusTooEarly) // RFC 8470, 5.2.
ErrUpgradeRequired = NewError(StatusUpgradeRequired) // RFC 7231, 6.5.15
ErrPreconditionRequired = NewError(StatusPreconditionRequired) // RFC 6585, 3
ErrTooManyRequests = NewError(StatusTooManyRequests) // RFC 6585, 4
ErrRequestHeaderFieldsTooLarge = NewError(StatusRequestHeaderFieldsTooLarge) // RFC 6585, 5
ErrUnavailableForLegalReasons = NewError(StatusUnavailableForLegalReasons) // RFC 7725, 3
ErrInternalServerError = NewError(StatusInternalServerError) // RFC 7231, 6.6.1
ErrNotImplemented = NewError(StatusNotImplemented) // RFC 7231, 6.6.2
ErrBadGateway = NewError(StatusBadGateway) // RFC 7231, 6.6.3
ErrServiceUnavailable = NewError(StatusServiceUnavailable) // RFC 7231, 6.6.4
ErrGatewayTimeout = NewError(StatusGatewayTimeout) // RFC 7231, 6.6.5
ErrHTTPVersionNotSupported = NewError(StatusHTTPVersionNotSupported) // RFC 7231, 6.6.6
ErrVariantAlsoNegotiates = NewError(StatusVariantAlsoNegotiates) // RFC 2295, 8.1
ErrInsufficientStorage = NewError(StatusInsufficientStorage) // RFC 4918, 11.5
ErrLoopDetected = NewError(StatusLoopDetected) // RFC 5842, 7.2
ErrNotExtended = NewError(StatusNotExtended) // RFC 2774, 7
ErrNetworkAuthenticationRequired = NewError(StatusNetworkAuthenticationRequired) // RFC 6585, 6
)

HTTP Headers were copied from net/http.

const (
HeaderAuthorization = "Authorization"
HeaderProxyAuthenticate = "Proxy-Authenticate"
HeaderProxyAuthorization = "Proxy-Authorization"
HeaderWWWAuthenticate = "WWW-Authenticate"
HeaderAge = "Age"
HeaderCacheControl = "Cache-Control"
HeaderClearSiteData = "Clear-Site-Data"
HeaderExpires = "Expires"
HeaderPragma = "Pragma"
HeaderWarning = "Warning"
HeaderAcceptCH = "Accept-CH"
HeaderAcceptCHLifetime = "Accept-CH-Lifetime"
HeaderContentDPR = "Content-DPR"
HeaderDPR = "DPR"
HeaderEarlyData = "Early-Data"
HeaderSaveData = "Save-Data"
HeaderViewportWidth = "Viewport-Width"
HeaderWidth = "Width"
HeaderETag = "ETag"
HeaderIfMatch = "If-Match"
HeaderIfModifiedSince = "If-Modified-Since"
HeaderIfNoneMatch = "If-None-Match"
HeaderIfUnmodifiedSince = "If-Unmodified-Since"
HeaderLastModified = "Last-Modified"
HeaderVary = "Vary"
HeaderConnection = "Connection"
HeaderKeepAlive = "Keep-Alive"
HeaderAccept = "Accept"
HeaderAcceptCharset = "Accept-Charset"
HeaderAcceptEncoding = "Accept-Encoding"
HeaderAcceptLanguage = "Accept-Language"
HeaderCookie = "Cookie"
HeaderExpect = "Expect"
HeaderMaxForwards = "Max-Forwards"
HeaderSetCookie = "Set-Cookie"
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"
HeaderOrigin = "Origin"
HeaderTimingAllowOrigin = "Timing-Allow-Origin"
HeaderXPermittedCrossDomainPolicies = "X-Permitted-Cross-Domain-Policies"
HeaderDNT = "DNT"
HeaderTk = "Tk"
HeaderContentDisposition = "Content-Disposition"
HeaderContentEncoding = "Content-Encoding"
HeaderContentLanguage = "Content-Language"
HeaderContentLength = "Content-Length"
HeaderContentLocation = "Content-Location"
HeaderContentType = "Content-Type"
HeaderForwarded = "Forwarded"
HeaderVia = "Via"
HeaderXForwardedFor = "X-Forwarded-For"
HeaderXForwardedHost = "X-Forwarded-Host"
HeaderXForwardedProto = "X-Forwarded-Proto"
HeaderXForwardedProtocol = "X-Forwarded-Protocol"
HeaderXForwardedSsl = "X-Forwarded-Ssl"
HeaderXUrlScheme = "X-Url-Scheme"
HeaderLocation = "Location"
HeaderFrom = "From"
HeaderHost = "Host"
HeaderReferer = "Referer"
HeaderReferrerPolicy = "Referrer-Policy"
HeaderUserAgent = "User-Agent"
HeaderAllow = "Allow"
HeaderServer = "Server"
HeaderAcceptRanges = "Accept-Ranges"
HeaderContentRange = "Content-Range"
HeaderIfRange = "If-Range"
HeaderRange = "Range"
HeaderContentSecurityPolicy = "Content-Security-Policy"
HeaderContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"
HeaderCrossOriginResourcePolicy = "Cross-Origin-Resource-Policy"
HeaderExpectCT = "Expect-CT"
HeaderFeaturePolicy = "Feature-Policy"
HeaderPublicKeyPins = "Public-Key-Pins"
HeaderPublicKeyPinsReportOnly = "Public-Key-Pins-Report-Only"
HeaderStrictTransportSecurity = "Strict-Transport-Security"
HeaderUpgradeInsecureRequests = "Upgrade-Insecure-Requests"
HeaderXContentTypeOptions = "X-Content-Type-Options"
HeaderXDownloadOptions = "X-Download-Options"
HeaderXFrameOptions = "X-Frame-Options"
HeaderXPoweredBy = "X-Powered-By"
HeaderXXSSProtection = "X-XSS-Protection"
HeaderLastEventID = "Last-Event-ID"
HeaderNEL = "NEL"
HeaderPingFrom = "Ping-From"
HeaderPingTo = "Ping-To"
HeaderReportTo = "Report-To"
HeaderTE = "TE"
HeaderTrailer = "Trailer"
HeaderTransferEncoding = "Transfer-Encoding"
HeaderSecWebSocketAccept = "Sec-WebSocket-Accept"
HeaderSecWebSocketExtensions = "Sec-WebSocket-Extensions"
HeaderSecWebSocketKey = "Sec-WebSocket-Key"
HeaderSecWebSocketProtocol = "Sec-WebSocket-Protocol"
HeaderSecWebSocketVersion = "Sec-WebSocket-Version"
HeaderAcceptPatch = "Accept-Patch"
HeaderAcceptPushPolicy = "Accept-Push-Policy"
HeaderAcceptSignature = "Accept-Signature"
HeaderAltSvc = "Alt-Svc"
HeaderDate = "Date"
HeaderIndex = "Index"
HeaderLargeAllocation = "Large-Allocation"
HeaderLink = "Link"
HeaderPushPolicy = "Push-Policy"
HeaderRetryAfter = "Retry-After"
HeaderServerTiming = "Server-Timing"
HeaderSignature = "Signature"
HeaderSignedHeaders = "Signed-Headers"
HeaderSourceMap = "SourceMap"
HeaderUpgrade = "Upgrade"
HeaderXDNSPrefetchControl = "X-DNS-Prefetch-Control"
HeaderXPingback = "X-Pingback"
HeaderXRequestID = "X-Request-ID"
HeaderXRequestedWith = "X-Requested-With"
HeaderXRobotsTag = "X-Robots-Tag"
HeaderXUACompatible = "X-UA-Compatible"
)
+ + \ No newline at end of file diff --git a/api/ctx/index.html b/api/ctx/index.html index f4f34aa149f..c428d0ec0a2 100644 --- a/api/ctx/index.html +++ b/api/ctx/index.html @@ -6,8 +6,8 @@ 🧠 Ctx | Fiber - - + +
@@ -24,8 +24,8 @@ If the parameter is not a number, it is still tried to be converted and usually returned as 1.

info

Defaults to the integer zero (0), if the param doesn't exist.

Signature
func (c *Ctx) QueryInt(key string, defaultValue ...int) int
Example
// GET http://example.com/?name=alex&wanna_cake=2&id=

app.Get("/", func(c *fiber.Ctx) error {
c.QueryInt("wanna_cake", 1) // 2
c.QueryInt("name", 1) // 1
c.QueryInt("id", 1) // 1
c.QueryInt("id") // 0

// ...
})

QueryParser​

This method is similar to BodyParser, but for query parameters. It is important to use the struct tag "query". For example, if you want to parse a query parameter with a field called Pass, you would use a struct field of query:"pass".

Signature
func (c *Ctx) QueryParser(out interface{}) error
Example
// Field names should start with an uppercase letter
type Person struct {
Name string `query:"name"`
Pass string `query:"pass"`
Products []string `query:"products"`
}

app.Get("/", func(c *fiber.Ctx) error {
p := new(Person)

if err := c.QueryParser(p); err != nil {
return err
}

log.Println(p.Name) // john
log.Println(p.Pass) // doe
log.Println(p.Products) // [shoe, hat]

// ...
})
// Run tests with the following curl command

// curl "http://localhost:3000/?name=john&pass=doe&products=shoe,hat"

Range​

A struct containing the type and a slice of ranges will be returned.

Signature
func (c *Ctx) Range(size int) (Range, error)
Example
// Range: bytes=500-700, 700-900
app.Get("/", func(c *fiber.Ctx) error {
b := c.Range(1000)
if b.Type == "bytes" {
for r := range r.Ranges {
fmt.Println(r)
// [500, 700]
}
}
})

Redirect​

Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code.

info

If not specified, status defaults to 302 Found.

Signature
func (c *Ctx) Redirect(location string, status ...int) error
Example
app.Get("/coffee", func(c *fiber.Ctx) error {
return c.Redirect("/teapot")
})

app.Get("/teapot", func(c *fiber.Ctx) error {
return c.Status(fiber.StatusTeapot).Send("🍡 short and stout 🍡")
})
More examples
app.Get("/", func(c *fiber.Ctx) error {
return c.Redirect("/foo/bar")
return c.Redirect("../login")
return c.Redirect("http://example.com")
return c.Redirect("http://example.com", 301)
})

RedirectToRoute​

Redirects to the specific route along with the parameters and with specified status, a positive integer that corresponds to an HTTP status code.

info

If not specified, status defaults to 302 Found.

info

If you want to send queries to route, you must add "queries" key typed as map[string]string to params.

Signature
func (c *Ctx) RedirectToRoute(routeName string, params fiber.Map, status ...int) error
Example
app.Get("/", func(c *fiber.Ctx) error {
// /user/fiber
return c.RedirectToRoute("user", fiber.Map{
"name": "fiber"
})
})

app.Get("/with-queries", func(c *fiber.Ctx) error {
// /user/fiber?data[0][name]=john&data[0][age]=10&test=doe
return c.RedirectToRoute("user", fiber.Map{
"name": "fiber",
"queries": map[string]string{"data[0][name]": "john", "data[0][age]": "10", "test": "doe"},
})
})

app.Get("/user/:name", func(c *fiber.Ctx) error {
return c.SendString(c.Params("name"))
}).Name("user")

RedirectBack​

Redirects back to refer URL. It redirects to fallback URL if refer header doesn't exists, with specified status, a positive integer that corresponds to an HTTP status code.

info

If not specified, status defaults to 302 Found.

Signature
func (c *Ctx) RedirectBack(fallback string, status ...int) error
Example
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Home page")
})
app.Get("/test", func(c *fiber.Ctx) error {
c.Set("Content-Type", "text/html")
return c.SendString(`<a href="/back">Back</a>`)
})

app.Get("/back", func(c *fiber.Ctx) error {
return c.RedirectBack("/")
})

Render​

Renders a view with data and sends a text/html response. By default Render uses the default Go Template engine. If you want to use another View engine, please take a look at our Template middleware.

Signature
func (c *Ctx) Render(name string, bind interface{}, layouts ...string) error

Request​

Request return the *fasthttp.Request pointer

Signature
func (c *Ctx) Request() *fasthttp.Request
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Request().Header.Method()
// => []byte("GET")
})

ReqHeaderParser​

This method is similar to BodyParser, but for request headers. It is important to use the struct tag "reqHeader". For example, if you want to parse a request header with a field called Pass, you would use a struct field of reqHeader:"pass".

Signature
func (c *Ctx) ReqHeaderParser(out interface{}) error
Example
// Field names should start with an uppercase letter
type Person struct {
Name string `reqHeader:"name"`
Pass string `reqHeader:"pass"`
Products []string `reqHeader:"products"`
}

app.Get("/", func(c *fiber.Ctx) error {
p := new(Person)

if err := c.ReqHeaderParser(p); err != nil {
return err
}

log.Println(p.Name) // john
log.Println(p.Pass) // doe
log.Println(p.Products) // [shoe, hat]

// ...
})
// Run tests with the following curl command

// curl "http://localhost:3000/" -H "name: john" -H "pass: doe" -H "products: shoe,hat"

Response​

Response return the *fasthttp.Response pointer

Signature
func (c *Ctx) Response() *fasthttp.Response
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Response().BodyWriter().Write([]byte("Hello, World!"))
// => "Hello, World!"
return nil
})

RestartRouting​

Instead of executing the next method when calling Next, RestartRouting restarts execution from the first method that matches the current route. This may be helpful after overriding the path, i. e. an internal redirect. Note that handlers might be executed again which could result in an infinite loop.

Signature
func (c *Ctx) RestartRouting() error
Example
app.Get("/new", func(c *fiber.Ctx) error {
return c.SendString("From /new")
})

app.Get("/old", func(c *fiber.Ctx) error {
c.Path("/new")
return c.RestartRouting()
})

Route​

Returns the matched Route struct.

Signature
func (c *Ctx) Route() *Route
Example
// http://localhost:8080/hello


app.Get("/hello/:name", func(c *fiber.Ctx) error {
r := c.Route()
fmt.Println(r.Method, r.Path, r.Params, r.Handlers)
// GET /hello/:name handler [name]

// ...
})
caution

Do not rely on c.Route() in middlewares before calling c.Next() - c.Route() returns the last executed route.

Example
func MyMiddleware() fiber.Handler {
return func(c *fiber.Ctx) error {
beforeNext := c.Route().Path // Will be '/'
err := c.Next()
afterNext := c.Route().Path // Will be '/hello/:name'
return err
}
}

SaveFile​

Method is used to save any multipart file to disk.

Signature
func (c *Ctx) SaveFile(fh *multipart.FileHeader, path string) error
Example
app.Post("/", func(c *fiber.Ctx) error {
// Parse the multipart form:
if form, err := c.MultipartForm(); err == nil {
// => *multipart.Form

// Get all files from "documents" key:
files := form.File["documents"]
// => []*multipart.FileHeader

// Loop through files:
for _, file := range files {
fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])
// => "tutorial.pdf" 360641 "application/pdf"

// Save the files to disk:
if err := c.SaveFile(file, fmt.Sprintf("./%s", file.Filename)); err != nil {
return err
}
}
return err
}
})

SaveFileToStorage​

Method is used to save any multipart file to an external storage system.

Signature
func (c *Ctx) SaveFileToStorage(fileheader *multipart.FileHeader, path string, storage Storage) error
Example
storage := memory.New()

app.Post("/", func(c *fiber.Ctx) error {
// Parse the multipart form:
if form, err := c.MultipartForm(); err == nil {
// => *multipart.Form

// Get all files from "documents" key:
files := form.File["documents"]
// => []*multipart.FileHeader

// Loop through files:
for _, file := range files {
fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])
// => "tutorial.pdf" 360641 "application/pdf"

// Save the files to storage:
if err := c.SaveFileToStorage(file, fmt.Sprintf("./%s", file.Filename), storage); err != nil {
return err
}
}
return err
}
})

Secure​

A boolean property that is true , if a TLS connection is established.

Signature
func (c *Ctx) Secure() bool
Example
// Secure() method is equivalent to:
c.Protocol() == "https"

Send​

Sets the HTTP response body.

Signature
func (c *Ctx) Send(body []byte) error
Example
app.Get("/", func(c *fiber.Ctx) error {
return c.Send([]byte("Hello, World!")) // => "Hello, World!"
})

Fiber also provides SendString and SendStream methods for raw inputs.

tip

Use this if you don't need type assertion, recommended for faster performance.

Signature
func (c *Ctx) SendString(body string) error
func (c *Ctx) SendStream(stream io.Reader, size ...int) error
Example
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
// => "Hello, World!"

return c.SendStream(bytes.NewReader([]byte("Hello, World!")))
// => "Hello, World!"
})

SendFile​

Transfers the file from the given path. Sets the Content-Type response HTTP header field based on the filenames extension.

caution

Method doesnΒ΄t use gzipping by default, set it to true to enable.

Signature
func (c *Ctx) SendFile(file string, compress ...bool) error
Example
app.Get("/not-found", func(c *fiber.Ctx) error {
return c.SendFile("./public/404.html");

// Disable compression
return c.SendFile("./static/index.html", false);
})
info

If the file contains an url specific character you have to escape it before passing the file path into the sendFile function.

Example
app.Get("/file-with-url-chars", func(c *fiber.Ctx) error {
return c.SendFile(url.PathEscape("hash_sign_#.txt"))
})

SendStatus​

Sets the status code and the correct status message in the body, if the response body is empty.

tip

You can find all used status codes and messages here.

Signature
func (c *Ctx) SendStatus(status int) error
Example
app.Get("/not-found", func(c *fiber.Ctx) error {
return c.SendStatus(415)
// => 415 "Unsupported Media Type"

c.SendString("Hello, World!")
return c.SendStatus(415)
// => 415 "Hello, World!"
})

Set​

Sets the response’s HTTP header field to the specified key, value.

Signature
func (c *Ctx) Set(key string, val string)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Set("Content-Type", "text/plain")
// => "Content-type: text/plain"

// ...
})

SetParserDecoder​

Allow you to config BodyParser/QueryParser decoder, base on schema's options, providing possibility to add custom type for pausing.

Signature
func SetParserDecoder(parserConfig fiber.ParserConfig{
IgnoreUnknownKeys bool,
ParserType []fiber.ParserType{
Customtype interface{},
Converter func(string) reflect.Value,
},
ZeroEmpty bool,
SetAliasTag string,
})
Example

type CustomTime time.Time

// String() returns the time in string
func (ct *CustomTime) String() string {
t := time.Time(*ct).String()
return t
}

// Register the converter for CustomTime type format as 2006-01-02
var timeConverter = func(value string) reflect.Value {
fmt.Println("timeConverter", value)
if v, err := time.Parse("2006-01-02", value); err == nil {
return reflect.ValueOf(v)
}
return reflect.Value{}
}

customTime := fiber.ParserType{
Customtype: CustomTime{},
Converter: timeConverter,
}

// Add setting to the Decoder
fiber.SetParserDecoder(fiber.ParserConfig{
IgnoreUnknownKeys: true,
ParserType: []fiber.ParserType{customTime},
ZeroEmpty: true,
})

// Example to use CustomType, you pause custom time format not in RFC3339
type Demo struct {
Date CustomTime `form:"date" query:"date"`
Title string `form:"title" query:"title"`
Body string `form:"body" query:"body"`
}

app.Post("/body", func(c *fiber.Ctx) error {
var d Demo
c.BodyParser(&d)
fmt.Println("d.Date", d.Date.String())
return c.JSON(d)
})

app.Get("/query", func(c *fiber.Ctx) error {
var d Demo
c.QueryParser(&d)
fmt.Println("d.Date", d.Date.String())
return c.JSON(d)
})

// curl -X POST -F title=title -F body=body -F date=2021-10-20 http://localhost:3000/body

// curl -X GET "http://localhost:3000/query?title=title&body=body&date=2021-10-20"

SetUserContext​

Sets the user specified implementation for context interface.

Signature
func (c *Ctx) SetUserContext(ctx context.Context)
Example
app.Get("/", func(c *fiber.Ctx) error {
ctx := context.Background()
c.SetUserContext(ctx)
// Here ctx could be any context implementation

// ...
})

Stale​

https://expressjs.com/en/4x/api.html#req.stale

Signature
func (c *Ctx) Stale() bool

Status​

Sets the HTTP status for the response.

info

Method is a chainable.

Signature
func (c *Ctx) Status(status int) *Ctx
Example
app.Get("/fiber", func(c *fiber.Ctx) error {
c.Status(fiber.StatusOK)
return nil
}

app.Get("/hello", func(c *fiber.Ctx) error {
return c.Status(fiber.StatusBadRequest).SendString("Bad Request")
}

app.Get("/world", func(c *fiber.Ctx) error {
return c.Status(fiber.StatusNotFound).SendFile("./public/gopher.png")
})

Subdomains​

Returns a string slice of subdomains in the domain name of the request.

The application property subdomain offset, which defaults to 2, is used for determining the beginning of the subdomain segments.

Signature
func (c *Ctx) Subdomains(offset ...int) []string
Example
// Host: "tobi.ferrets.example.com"

app.Get("/", func(c *fiber.Ctx) error {
c.Subdomains() // ["ferrets", "tobi"]
c.Subdomains(1) // ["tobi"]

// ...
})

Type​

Sets the Content-Type HTTP header to the MIME type listed here specified by the file extension.

Signature
func (c *Ctx) Type(ext string, charset ...string) *Ctx
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Type(".html") // => "text/html"
c.Type("html") // => "text/html"
c.Type("png") // => "image/png"

c.Type("json", "utf-8") // => "application/json; charset=utf-8"

// ...
})

UserContext​

UserContext returns a context implementation that was set by user earlier -or returns a non-nil, empty context, if it was not set earlier.

Signature
func (c *Ctx) UserContext() context.Context
Example
app.Get("/", func(c *fiber.Ctx) error {
ctx := c.UserContext()
// ctx is context implementation set by user

// ...
})

Vary​

Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location.

info

Multiple fields are allowed.

Signature
func (c *Ctx) Vary(fields ...string)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Vary("Origin") // => Vary: Origin
c.Vary("User-Agent") // => Vary: Origin, User-Agent

// No duplicates
c.Vary("Origin") // => Vary: Origin, User-Agent

c.Vary("Accept-Encoding", "Accept")
// => Vary: Origin, User-Agent, Accept-Encoding, Accept

// ...
})

Write​

Write adopts the Writer interface

Signature
func (c *Ctx) Write(p []byte) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Write([]byte("Hello, World!")) // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

Writef​

Writef adopts the string with variables

Signature
func (c *Ctx) Writef(f string, a ...interface{}) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
world := "World!"
c.Writef("Hello, %s", world) // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

WriteString​

WriteString adopts the string

Signature
func (c *Ctx) WriteString(s string) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.WriteString("Hello, World!") // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

XHR​

A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery).

Signature
func (c *Ctx) XHR() bool
Example
// X-Requested-With: XMLHttpRequest

app.Get("/", func(c *fiber.Ctx) error {
c.XHR() // true

// ...
})

XML​

Converts any interface or string to XML using the standard encoding/xml package.

info

XML also sets the content header to application/xml.

Signature
func (c *Ctx) XML(data interface{}) error 
Example
type SomeStruct struct {
XMLName xml.Name `xml:"Fiber"`
Name string `xml:"Name"`
Age uint8 `xml:"Age"`
}

app.Get("/", func(c *fiber.Ctx) error {
// Create data struct:
data := SomeStruct{
Name: "Grame",
Age: 20,
}

return c.XML(data)
// <Fiber>
// <Name>Grame</Name>
// <Age>20</Age>
// </Fiber>
})
- - +or returns a non-nil, empty context, if it was not set earlier.

Signature
func (c *Ctx) UserContext() context.Context
Example
app.Get("/", func(c *fiber.Ctx) error {
ctx := c.UserContext()
// ctx is context implementation set by user

// ...
})

Vary​

Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location.

info

Multiple fields are allowed.

Signature
func (c *Ctx) Vary(fields ...string)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Vary("Origin") // => Vary: Origin
c.Vary("User-Agent") // => Vary: Origin, User-Agent

// No duplicates
c.Vary("Origin") // => Vary: Origin, User-Agent

c.Vary("Accept-Encoding", "Accept")
// => Vary: Origin, User-Agent, Accept-Encoding, Accept

// ...
})

Write​

Write adopts the Writer interface

Signature
func (c *Ctx) Write(p []byte) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Write([]byte("Hello, World!")) // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

Writef​

Writef adopts the string with variables

Signature
func (c *Ctx) Writef(f string, a ...interface{}) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
world := "World!"
c.Writef("Hello, %s", world) // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

WriteString​

WriteString adopts the string

Signature
func (c *Ctx) WriteString(s string) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.WriteString("Hello, World!") // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

XHR​

A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery).

Signature
func (c *Ctx) XHR() bool
Example
// X-Requested-With: XMLHttpRequest

app.Get("/", func(c *fiber.Ctx) error {
c.XHR() // true

// ...
})

XML​

Converts any interface or string to XML using the standard encoding/xml package.

info

XML also sets the content header to application/xml.

Signature
func (c *Ctx) XML(data interface{}) error 
Example
type SomeStruct struct {
XMLName xml.Name `xml:"Fiber"`
Name string `xml:"Name"`
Age uint8 `xml:"Age"`
}

app.Get("/", func(c *fiber.Ctx) error {
// Create data struct:
data := SomeStruct{
Name: "Grame",
Age: 20,
}

return c.XML(data)
// <Fiber>
// <Name>Grame</Name>
// <Age>20</Age>
// </Fiber>
})
+ + \ No newline at end of file diff --git a/api/fiber/index.html b/api/fiber/index.html index 93723fcc878..352df7c514a 100644 --- a/api/fiber/index.html +++ b/api/fiber/index.html @@ -6,13 +6,13 @@ πŸ“¦ Fiber | Fiber - - + +
-
Skip to main content
Version: v2.x

πŸ“¦ Fiber

New​

This method creates a new App named instance. You can pass optional config when creating a new instance.

Signature
func New(config ...Config) *App
Example
// Default config
app := fiber.New()

// ...

Config​

You can pass an optional Config when creating a new Fiber instance.

Example
// Custom config
app := fiber.New(fiber.Config{
Prefork: true,
CaseSensitive: true,
StrictRouting: true,
ServerHeader: "Fiber",
AppName: "Test App v1.0.1"
})

// ...

Config fields

PropertyTypeDescriptionDefault
AppNamestringThis allows to setup app name for the app""
BodyLimitintSets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response.4 * 1024 * 1024
CaseSensitiveboolWhen enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same.false
ColorSchemeColorsYou can define custom color scheme. They'll be used for startup message, route list and some middlewares.DefaultColors
CompressedFileSuffixstringAdds a suffix to the original file name and tries saving the resulting compressed file under the new file name.".fiber.gz"
ConcurrencyintMaximum number of concurrent connections.256 * 1024
DisableDefaultContentTypeboolWhen set to true, causes the default Content-Type header to be excluded from the Response.false
DisableDefaultDateboolWhen set to true causes the default date header to be excluded from the response.false
DisableHeaderNormalizingboolBy default all header names are normalized: conteNT-tYPE -> Content-Typefalse
DisableKeepaliveboolDisable keep-alive connections, the server will close incoming connections after sending the first response to the clientfalse
DisablePreParseMultipartFormboolWill not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data.false
DisableStartupMessageboolWhen set to true, it will not print out debug informationfalse
ETagboolEnable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled.false
EnableIPValidationboolIf set to true, c.IP() and c.IPs() will validate IP addresses before returning them. Also, c.IP() will return only the first valid IP rather than just the raw header value that may be a comma seperated string.

WARNING: There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header.
false
EnablePrintRoutesboolEnablePrintRoutes enables print all routes with their method, path, name and handler..false
EnableTrustedProxyCheckboolWhen set to true, fiber will check whether proxy is trusted, using TrustedProxies list.

By default c.Protocol() will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, c.IP() will get value from ProxyHeader header, c.Hostname() will get value from X-Forwarded-Host header.
If EnableTrustedProxyCheck is true, and RemoteIP is in the list of TrustedProxies c.Protocol(), c.IP(), and c.Hostname() will have the same behaviour when EnableTrustedProxyCheck disabled, if RemoteIP isn't in the list, c.Protocol() will return https in case when tls connection is handled by the app, or http otherwise, c.IP() will return RemoteIP() from fasthttp context, c.Hostname() will return fasthttp.Request.URI().Host()
false
ErrorHandlerErrorHandlerErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests.DefaultErrorHandler
GETOnlyboolRejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set.false
IdleTimeouttime.DurationThe maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used.nil
ImmutableboolWhen enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue #185.false
JSONDecoderutils.JSONUnmarshalAllowing for flexibility in using another json library for decoding.json.Unmarshal
JSONEncoderutils.JSONMarshalAllowing for flexibility in using another json library for encoding.json.Marshal
NetworkstringKnown networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only)

WARNING: When prefork is set to true, only "tcp4" and "tcp6" can be chosen.
NetworkTCP4
PassLocalsToViewsboolPassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our Template Middleware for supported engines.false
PreforkboolEnables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding. NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with CMD ./app or CMD ["sh", "-c", "/app"]. For more info, see this issue comment.false
ProxyHeaderstringThis will enable c.IP() to return the value of the given header key. By default c.IP()will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. X-Forwarded-*.""
ReadBufferSizeintper-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies).4096
ReadTimeouttime.DurationThe amount of time allowed to read the full request, including the body. The default timeout is unlimited.nil
RequestMethods[]stringRequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish.DefaultMethods
ServerHeaderstringEnables the Server HTTP header with the given value.""
StreamRequestBodyboolStreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit.false
StrictRoutingboolWhen enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same.false
TrustedProxies[]stringContains the list of trusted proxy IP's. Look at EnableTrustedProxyCheck doc.

It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses.
[]string*__*
UnescapePathboolConverts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special charactersfalse
ViewsViewsViews is the interface that wraps the Render function. See our Template Middleware for supported engines.nil
ViewsLayoutstringViews Layout is the global layout for all template render until override on Render function. See our Template Middleware for supported engines.""
WriteBufferSizeintPer-connection buffer size for responses' writing.4096
WriteTimeouttime.DurationThe maximum duration before timing out writes of the response. The default timeout is unlimited.nil
XMLEncoderutils.XMLMarshalAllowing for flexibility in using another XML library for encoding.xml.Marshal

NewError​

NewError creates a new HTTPError instance with an optional message.

Signature
func NewError(code int, message ...string) *Error
Example
app.Get("/", func(c *fiber.Ctx) error {
return fiber.NewError(782, "Custom error message")
})

IsChild​

IsChild determines if the current process is a result of Prefork.

Signature
func IsChild() bool
Example
// Prefork will spawn child processes
app := fiber.New(fiber.Config{
Prefork: true,
})

if !fiber.IsChild() {
fmt.Println("I'm the parent process")
} else {
fmt.Println("I'm a child process")
}

// ...
- - +
Skip to main content
Version: v2.x

πŸ“¦ Fiber

New​

This method creates a new App named instance. You can pass optional config when creating a new instance.

Signature
func New(config ...Config) *App
Example
// Default config
app := fiber.New()

// ...

Config​

You can pass an optional Config when creating a new Fiber instance.

Example
// Custom config
app := fiber.New(fiber.Config{
Prefork: true,
CaseSensitive: true,
StrictRouting: true,
ServerHeader: "Fiber",
AppName: "Test App v1.0.1"
})

// ...

Config fields

PropertyTypeDescriptionDefault
AppNamestringThis allows to setup app name for the app""
BodyLimitintSets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response.4 * 1024 * 1024
CaseSensitiveboolWhen enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same.false
ColorSchemeColorsYou can define custom color scheme. They'll be used for startup message, route list and some middlewares.DefaultColors
CompressedFileSuffixstringAdds a suffix to the original file name and tries saving the resulting compressed file under the new file name.".fiber.gz"
ConcurrencyintMaximum number of concurrent connections.256 * 1024
DisableDefaultContentTypeboolWhen set to true, causes the default Content-Type header to be excluded from the Response.false
DisableDefaultDateboolWhen set to true causes the default date header to be excluded from the response.false
DisableHeaderNormalizingboolBy default all header names are normalized: conteNT-tYPE -> Content-Typefalse
DisableKeepaliveboolDisable keep-alive connections, the server will close incoming connections after sending the first response to the clientfalse
DisablePreParseMultipartFormboolWill not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data.false
DisableStartupMessageboolWhen set to true, it will not print out debug informationfalse
ETagboolEnable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled.false
EnableIPValidationboolIf set to true, c.IP() and c.IPs() will validate IP addresses before returning them. Also, c.IP() will return only the first valid IP rather than just the raw header value that may be a comma seperated string.

WARNING: There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header.
false
EnablePrintRoutesboolEnablePrintRoutes enables print all routes with their method, path, name and handler..false
EnableTrustedProxyCheckboolWhen set to true, fiber will check whether proxy is trusted, using TrustedProxies list.

By default c.Protocol() will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, c.IP() will get value from ProxyHeader header, c.Hostname() will get value from X-Forwarded-Host header.
If EnableTrustedProxyCheck is true, and RemoteIP is in the list of TrustedProxies c.Protocol(), c.IP(), and c.Hostname() will have the same behaviour when EnableTrustedProxyCheck disabled, if RemoteIP isn't in the list, c.Protocol() will return https in case when tls connection is handled by the app, or http otherwise, c.IP() will return RemoteIP() from fasthttp context, c.Hostname() will return fasthttp.Request.URI().Host()
false
ErrorHandlerErrorHandlerErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests.DefaultErrorHandler
GETOnlyboolRejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set.false
IdleTimeouttime.DurationThe maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used.nil
ImmutableboolWhen enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue #185.false
JSONDecoderutils.JSONUnmarshalAllowing for flexibility in using another json library for decoding.json.Unmarshal
JSONEncoderutils.JSONMarshalAllowing for flexibility in using another json library for encoding.json.Marshal
NetworkstringKnown networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only)

WARNING: When prefork is set to true, only "tcp4" and "tcp6" can be chosen.
NetworkTCP4
PassLocalsToViewsboolPassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our Template Middleware for supported engines.false
PreforkboolEnables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding. NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with CMD ./app or CMD ["sh", "-c", "/app"]. For more info, see this issue comment.false
ProxyHeaderstringThis will enable c.IP() to return the value of the given header key. By default c.IP()will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. X-Forwarded-*.""
ReadBufferSizeintper-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies).4096
ReadTimeouttime.DurationThe amount of time allowed to read the full request, including the body. The default timeout is unlimited.nil
RequestMethods[]stringRequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish.DefaultMethods
ServerHeaderstringEnables the Server HTTP header with the given value.""
StreamRequestBodyboolStreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit.false
StrictRoutingboolWhen enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same.false
TrustedProxies[]stringContains the list of trusted proxy IP's. Look at EnableTrustedProxyCheck doc.

It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses.
[]string*__*
UnescapePathboolConverts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special charactersfalse
ViewsViewsViews is the interface that wraps the Render function. See our Template Middleware for supported engines.nil
ViewsLayoutstringViews Layout is the global layout for all template render until override on Render function. See our Template Middleware for supported engines.""
WriteBufferSizeintPer-connection buffer size for responses' writing.4096
WriteTimeouttime.DurationThe maximum duration before timing out writes of the response. The default timeout is unlimited.nil
XMLEncoderutils.XMLMarshalAllowing for flexibility in using another XML library for encoding.xml.Marshal

NewError​

NewError creates a new HTTPError instance with an optional message.

Signature
func NewError(code int, message ...string) *Error
Example
app.Get("/", func(c *fiber.Ctx) error {
return fiber.NewError(782, "Custom error message")
})

IsChild​

IsChild determines if the current process is a result of Prefork.

Signature
func IsChild() bool
Example
// Prefork will spawn child processes
app := fiber.New(fiber.Config{
Prefork: true,
})

if !fiber.IsChild() {
fmt.Println("I'm the parent process")
} else {
fmt.Println("I'm a child process")
}

// ...
+ + \ No newline at end of file diff --git a/api/middleware/adaptor/index.html b/api/middleware/adaptor/index.html index e993bb21053..2c01be770e9 100644 --- a/api/middleware/adaptor/index.html +++ b/api/middleware/adaptor/index.html @@ -6,13 +6,13 @@ Adaptor | Fiber - - + +
-
Skip to main content
Version: v2.x

Adaptor

Converter for net/http handlers to/from Fiber request handlers, special thanks to @arsmn!

Signatures​

NameSignatureDescription
HTTPHandlerHTTPHandler(h http.Handler) fiber.Handlerhttp.Handler -> fiber.Handler
HTTPHandlerFuncHTTPHandlerFunc(h http.HandlerFunc) fiber.Handlerhttp.HandlerFunc -> fiber.Handler
HTTPMiddlewareHTTPHandlerFunc(mw func(http.Handler) http.Handler) fiber.Handlerfunc(http.Handler) http.Handler -> fiber.Handler
FiberHandlerFiberHandler(h fiber.Handler) http.Handlerfiber.Handler -> http.Handler
FiberHandlerFuncFiberHandlerFunc(h fiber.Handler) http.HandlerFuncfiber.Handler -> http.HandlerFunc
FiberAppFiberApp(app *fiber.App) http.HandlerFuncFiber app -> http.HandlerFunc
ConvertRequestConvertRequest(c *fiber.Ctx, forServer bool) (*http.Request, error)fiber.Ctx -> http.Request
CopyContextToFiberContextCopyContextToFiberContext(context interface{}, requestContext *fasthttp.RequestCtx)context.Context -> fasthttp.RequestCtx

Examples​

net/http to Fiber​

package main

import (
"fmt"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// New fiber app
app := fiber.New()

// http.Handler -> fiber.Handler
app.Get("/", adaptor.HTTPHandler(handler(greet)))

// http.HandlerFunc -> fiber.Handler
app.Get("/func", adaptor.HTTPHandlerFunc(greet))

// Listen on port 3000
app.Listen(":3000")
}

func handler(f http.HandlerFunc) http.Handler {
return http.HandlerFunc(f)
}

func greet(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello World!")
}

net/http middleware to Fiber​

package main

import (
"log"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// New fiber app
app := fiber.New()

// http middleware -> fiber.Handler
app.Use(adaptor.HTTPMiddleware(logMiddleware))

// Listen on port 3000
app.Listen(":3000")
}

func logMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
log.Println("log middleware")
next.ServeHTTP(w, r)
})
}

Fiber Handler to net/http​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// fiber.Handler -> http.Handler
http.Handle("/", adaptor.FiberHandler(greet))

// fiber.Handler -> http.HandlerFunc
http.HandleFunc("/func", adaptor.FiberHandlerFunc(greet))

// Listen on port 3000
http.ListenAndServe(":3000", nil)
}

func greet(c *fiber.Ctx) error {
return c.SendString("Hello World!")
}

Fiber App to net/http​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
app := fiber.New()

app.Get("/greet", greet)

// Listen on port 3000
http.ListenAndServe(":3000", adaptor.FiberApp(app))
}

func greet(c *fiber.Ctx) error {
return c.SendString("Hello World!")
}

Fiber Context to (net/http).Request​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
app := fiber.New()

app.Get("/greet", greetWithHTTPReq)

// Listen on port 3000
http.ListenAndServe(":3000", adaptor.FiberApp(app))
}

func greetWithHTTPReq(c *fiber.Ctx) error {
httpReq, err := adaptor.ConvertRequest(c, false)
if err != nil {
return err
}

return c.SendString("Request URL: " + httpReq.URL.String())
}
- - +
Skip to main content
Version: v2.x

Adaptor

Converter for net/http handlers to/from Fiber request handlers, special thanks to @arsmn!

Signatures​

NameSignatureDescription
HTTPHandlerHTTPHandler(h http.Handler) fiber.Handlerhttp.Handler -> fiber.Handler
HTTPHandlerFuncHTTPHandlerFunc(h http.HandlerFunc) fiber.Handlerhttp.HandlerFunc -> fiber.Handler
HTTPMiddlewareHTTPHandlerFunc(mw func(http.Handler) http.Handler) fiber.Handlerfunc(http.Handler) http.Handler -> fiber.Handler
FiberHandlerFiberHandler(h fiber.Handler) http.Handlerfiber.Handler -> http.Handler
FiberHandlerFuncFiberHandlerFunc(h fiber.Handler) http.HandlerFuncfiber.Handler -> http.HandlerFunc
FiberAppFiberApp(app *fiber.App) http.HandlerFuncFiber app -> http.HandlerFunc
ConvertRequestConvertRequest(c *fiber.Ctx, forServer bool) (*http.Request, error)fiber.Ctx -> http.Request
CopyContextToFiberContextCopyContextToFiberContext(context interface{}, requestContext *fasthttp.RequestCtx)context.Context -> fasthttp.RequestCtx

Examples​

net/http to Fiber​

package main

import (
"fmt"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// New fiber app
app := fiber.New()

// http.Handler -> fiber.Handler
app.Get("/", adaptor.HTTPHandler(handler(greet)))

// http.HandlerFunc -> fiber.Handler
app.Get("/func", adaptor.HTTPHandlerFunc(greet))

// Listen on port 3000
app.Listen(":3000")
}

func handler(f http.HandlerFunc) http.Handler {
return http.HandlerFunc(f)
}

func greet(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello World!")
}

net/http middleware to Fiber​

package main

import (
"log"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// New fiber app
app := fiber.New()

// http middleware -> fiber.Handler
app.Use(adaptor.HTTPMiddleware(logMiddleware))

// Listen on port 3000
app.Listen(":3000")
}

func logMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
log.Println("log middleware")
next.ServeHTTP(w, r)
})
}

Fiber Handler to net/http​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// fiber.Handler -> http.Handler
http.Handle("/", adaptor.FiberHandler(greet))

// fiber.Handler -> http.HandlerFunc
http.HandleFunc("/func", adaptor.FiberHandlerFunc(greet))

// Listen on port 3000
http.ListenAndServe(":3000", nil)
}

func greet(c *fiber.Ctx) error {
return c.SendString("Hello World!")
}

Fiber App to net/http​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
app := fiber.New()

app.Get("/greet", greet)

// Listen on port 3000
http.ListenAndServe(":3000", adaptor.FiberApp(app))
}

func greet(c *fiber.Ctx) error {
return c.SendString("Hello World!")
}

Fiber Context to (net/http).Request​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
app := fiber.New()

app.Get("/greet", greetWithHTTPReq)

// Listen on port 3000
http.ListenAndServe(":3000", adaptor.FiberApp(app))
}

func greetWithHTTPReq(c *fiber.Ctx) error {
httpReq, err := adaptor.ConvertRequest(c, false)
if err != nil {
return err
}

return c.SendString("Request URL: " + httpReq.URL.String())
}
+ + \ No newline at end of file diff --git a/api/middleware/basicauth/index.html b/api/middleware/basicauth/index.html index 92d691767d8..5185a3c3a72 100644 --- a/api/middleware/basicauth/index.html +++ b/api/middleware/basicauth/index.html @@ -6,13 +6,13 @@ BasicAuth | Fiber - - + +
-
Skip to main content
Version: v2.x

BasicAuth

Basic Authentication middleware for Fiber that provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized or a custom response for missing or invalid credentials.

Signatures​

func New(config Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/basicauth"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
app.Use(basicauth.New(basicauth.Config{
Users: map[string]string{
"john": "doe",
"admin": "123456",
},
}))

// Or extend your config for customization
app.Use(basicauth.New(basicauth.Config{
Users: map[string]string{
"john": "doe",
"admin": "123456",
},
Realm: "Forbidden",
Authorizer: func(user, pass string) bool {
if user == "john" && pass == "doe" {
return true
}
if user == "admin" && pass == "123456" {
return true
}
return false
},
Unauthorized: func(c *fiber.Ctx) error {
return c.SendFile("./unauthorized.html")
},
ContextUsername: "_user",
ContextPassword: "_pass",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Users defines the allowed credentials
//
// Required. Default: map[string]string{}
Users map[string]string

// Realm is a string to define realm attribute of BasicAuth.
// the realm identifies the system to authenticate against
// and can be used by clients to save credentials
//
// Optional. Default: "Restricted".
Realm string

// Authorizer defines a function you can pass
// to check the credentials however you want.
// It will be called with a username and password
// and is expected to return true or false to indicate
// that the credentials were approved or not.
//
// Optional. Default: nil.
Authorizer func(string, string) bool

// Unauthorized defines the response body for unauthorized responses.
// By default it will return with a 401 Unauthorized and the correct WWW-Auth header
//
// Optional. Default: nil
Unauthorized fiber.Handler

// ContextUser is the key to store the username in Locals
//
// Optional. Default: "username"
ContextUsername string

// ContextPass is the key to store the password in Locals
//
// Optional. Default: "password"
ContextPassword string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Users: map[string]string{},
Realm: "Restricted",
Authorizer: nil,
Unauthorized: nil,
ContextUsername: "username",
ContextPassword: "password",
}
- - +
Skip to main content
Version: v2.x

BasicAuth

Basic Authentication middleware for Fiber that provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized or a custom response for missing or invalid credentials.

Signatures​

func New(config Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/basicauth"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
app.Use(basicauth.New(basicauth.Config{
Users: map[string]string{
"john": "doe",
"admin": "123456",
},
}))

// Or extend your config for customization
app.Use(basicauth.New(basicauth.Config{
Users: map[string]string{
"john": "doe",
"admin": "123456",
},
Realm: "Forbidden",
Authorizer: func(user, pass string) bool {
if user == "john" && pass == "doe" {
return true
}
if user == "admin" && pass == "123456" {
return true
}
return false
},
Unauthorized: func(c *fiber.Ctx) error {
return c.SendFile("./unauthorized.html")
},
ContextUsername: "_user",
ContextPassword: "_pass",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Users defines the allowed credentials
//
// Required. Default: map[string]string{}
Users map[string]string

// Realm is a string to define realm attribute of BasicAuth.
// the realm identifies the system to authenticate against
// and can be used by clients to save credentials
//
// Optional. Default: "Restricted".
Realm string

// Authorizer defines a function you can pass
// to check the credentials however you want.
// It will be called with a username and password
// and is expected to return true or false to indicate
// that the credentials were approved or not.
//
// Optional. Default: nil.
Authorizer func(string, string) bool

// Unauthorized defines the response body for unauthorized responses.
// By default it will return with a 401 Unauthorized and the correct WWW-Auth header
//
// Optional. Default: nil
Unauthorized fiber.Handler

// ContextUser is the key to store the username in Locals
//
// Optional. Default: "username"
ContextUsername string

// ContextPass is the key to store the password in Locals
//
// Optional. Default: "password"
ContextPassword string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Users: map[string]string{},
Realm: "Restricted",
Authorizer: nil,
Unauthorized: nil,
ContextUsername: "username",
ContextPassword: "password",
}
+ + \ No newline at end of file diff --git a/api/middleware/cache/index.html b/api/middleware/cache/index.html index 6ac29877ded..0e45a2e5995 100644 --- a/api/middleware/cache/index.html +++ b/api/middleware/cache/index.html @@ -6,15 +6,15 @@ Cache | Fiber - - + +
Skip to main content
Version: v2.x

Cache

Cache middleware for Fiber designed to intercept responses and cache them. This middleware will cache the Body, Content-Type and StatusCode using the c.Path() as unique identifier. Special thanks to @codemicro for creating this middleware for Fiber core!

Request Directives
Cache-Control: no-cache will return the up-to-date response but still caches it. You will always get a miss cache status.
-Cache-Control: no-store will refrain from caching. You will always get the up-to-date response.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cache"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(cache.New())

// Or extend your config for customization
app.Use(cache.New(cache.Config{
Next: func(c *fiber.Ctx) bool {
return c.Query("refresh") == "true"
},
Expiration: 30 * time.Minute,
CacheControl: true,
}))

Or you can custom key and expire time like this:

app.Use(cache.New(cache.Config{
ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration {
newCacheTime, _ := strconv.Atoi(c.GetRespHeader("Cache-Time", "600"))
return time.Second * time.Duration(newCacheTime)
},
KeyGenerator: func(c *fiber.Ctx) string {
return utils.CopyString(c.Path())
},
}))

app.Get("/", func(c *fiber.Ctx) error {
c.Response().Header.Add("Cache-Time", "6000")
return c.SendString("hi")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Expiration is the time that an cached response will live
//
// Optional. Default: 1 * time.Minute
Expiration time.Duration

// CacheHeader header on response header, indicate cache status, with the following possible return value
//
// hit, miss, unreachable
//
// Optional. Default: X-Cache
CacheHeader string

// CacheControl enables client side caching if set to true
//
// Optional. Default: false
CacheControl bool

// Key allows you to generate custom keys, by default c.Path() is used
//
// Default: func(c *fiber.Ctx) string {
// return utils.CopyString(c.Path())
// }
KeyGenerator func(*fiber.Ctx) string

// allows you to generate custom Expiration Key By Key, default is Expiration (Optional)
//
// Default: nil
ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration

// Store is used to store the state of the middleware
//
// Default: an in memory store for this process only
Storage fiber.Storage

// allows you to store additional headers generated by next middlewares & handler
//
// Default: false
StoreResponseHeaders bool

// Max number of bytes of response bodies simultaneously stored in cache. When limit is reached,
// entries with the nearest expiration are deleted to make room for new.
// 0 means no limit
//
// Default: 0
MaxBytes uint

// You can specify HTTP methods to cache.
// The middleware just caches the routes of its methods in this slice.
//
// Default: []string{fiber.MethodGet, fiber.MethodHead}
Methods []string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Expiration: 1 * time.Minute,
CacheHeader: "X-Cache",
CacheControl: false,
KeyGenerator: func(c *fiber.Ctx) string {
return utils.CopyString(c.Path())
},
ExpirationGenerator: nil,
StoreResponseHeaders: false,
Storage: nil,
MaxBytes: 0,
Methods: []string{fiber.MethodGet, fiber.MethodHead},
}
- - +Cache-Control: no-store will refrain from caching. You will always get the up-to-date response.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cache"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(cache.New())

// Or extend your config for customization
app.Use(cache.New(cache.Config{
Next: func(c *fiber.Ctx) bool {
return c.Query("refresh") == "true"
},
Expiration: 30 * time.Minute,
CacheControl: true,
}))

Or you can custom key and expire time like this:

app.Use(cache.New(cache.Config{
ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration {
newCacheTime, _ := strconv.Atoi(c.GetRespHeader("Cache-Time", "600"))
return time.Second * time.Duration(newCacheTime)
},
KeyGenerator: func(c *fiber.Ctx) string {
return utils.CopyString(c.Path())
},
}))

app.Get("/", func(c *fiber.Ctx) error {
c.Response().Header.Add("Cache-Time", "6000")
return c.SendString("hi")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Expiration is the time that an cached response will live
//
// Optional. Default: 1 * time.Minute
Expiration time.Duration

// CacheHeader header on response header, indicate cache status, with the following possible return value
//
// hit, miss, unreachable
//
// Optional. Default: X-Cache
CacheHeader string

// CacheControl enables client side caching if set to true
//
// Optional. Default: false
CacheControl bool

// Key allows you to generate custom keys, by default c.Path() is used
//
// Default: func(c *fiber.Ctx) string {
// return utils.CopyString(c.Path())
// }
KeyGenerator func(*fiber.Ctx) string

// allows you to generate custom Expiration Key By Key, default is Expiration (Optional)
//
// Default: nil
ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration

// Store is used to store the state of the middleware
//
// Default: an in memory store for this process only
Storage fiber.Storage

// allows you to store additional headers generated by next middlewares & handler
//
// Default: false
StoreResponseHeaders bool

// Max number of bytes of response bodies simultaneously stored in cache. When limit is reached,
// entries with the nearest expiration are deleted to make room for new.
// 0 means no limit
//
// Default: 0
MaxBytes uint

// You can specify HTTP methods to cache.
// The middleware just caches the routes of its methods in this slice.
//
// Default: []string{fiber.MethodGet, fiber.MethodHead}
Methods []string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Expiration: 1 * time.Minute,
CacheHeader: "X-Cache",
CacheControl: false,
KeyGenerator: func(c *fiber.Ctx) string {
return utils.CopyString(c.Path())
},
ExpirationGenerator: nil,
StoreResponseHeaders: false,
Storage: nil,
MaxBytes: 0,
Methods: []string{fiber.MethodGet, fiber.MethodHead},
}
+ + \ No newline at end of file diff --git a/api/middleware/compress/index.html b/api/middleware/compress/index.html index 88b3a4c8a59..ff2f80cd15c 100644 --- a/api/middleware/compress/index.html +++ b/api/middleware/compress/index.html @@ -6,13 +6,13 @@ Compress | Fiber - - + +
-
Skip to main content
Version: v2.x

Compress

Compression middleware for Fiber that will compress the response using gzip, deflate and brotli compression depending on the Accept-Encoding header.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/compress"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(compress.New())

// Or extend your config for customization
app.Use(compress.New(compress.Config{
Level: compress.LevelBestSpeed, // 1
}))

// Skip middleware for specific routes
app.Use(compress.New(compress.Config{
Next: func(c *fiber.Ctx) bool {
return c.Path() == "/dont_compress"
},
Level: compress.LevelBestSpeed, // 1
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Level determines the compression algoritm
//
// Optional. Default: LevelDefault
// LevelDisabled: -1
// LevelDefault: 0
// LevelBestSpeed: 1
// LevelBestCompression: 2
Level int
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Level: LevelDefault,
}

Constants​

// Compression levels
const (
LevelDisabled = -1
LevelDefault = 0
LevelBestSpeed = 1
LevelBestCompression = 2
)
- - +
Skip to main content
Version: v2.x

Compress

Compression middleware for Fiber that will compress the response using gzip, deflate and brotli compression depending on the Accept-Encoding header.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/compress"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(compress.New())

// Or extend your config for customization
app.Use(compress.New(compress.Config{
Level: compress.LevelBestSpeed, // 1
}))

// Skip middleware for specific routes
app.Use(compress.New(compress.Config{
Next: func(c *fiber.Ctx) bool {
return c.Path() == "/dont_compress"
},
Level: compress.LevelBestSpeed, // 1
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Level determines the compression algoritm
//
// Optional. Default: LevelDefault
// LevelDisabled: -1
// LevelDefault: 0
// LevelBestSpeed: 1
// LevelBestCompression: 2
Level int
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Level: LevelDefault,
}

Constants​

// Compression levels
const (
LevelDisabled = -1
LevelDefault = 0
LevelBestSpeed = 1
LevelBestCompression = 2
)
+ + \ No newline at end of file diff --git a/api/middleware/cors/index.html b/api/middleware/cors/index.html index 9087854c3ec..3c1dffa7a59 100644 --- a/api/middleware/cors/index.html +++ b/api/middleware/cors/index.html @@ -6,13 +6,13 @@ CORS | Fiber - - + +
-
Skip to main content
Version: v2.x

CORS

CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(cors.New())

// Or extend your config for customization
app.Use(cors.New(cors.Config{
AllowOrigins: "https://gofiber.io, https://gofiber.net",
AllowHeaders: "Origin, Content-Type, Accept",
}))

Using the AllowOriginsFunc function. In this example any origin will be allowed via CORS.

For example, if a browser running on http://localhost:3000 sends a request, this will be accepted and the access-control-allow-origin response header will be set to http://localhost:3000.

Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via AllowOrigins.

app.Use(cors.New())

app.Use(cors.New(cors.Config{
AllowOriginsFunc: func(origin string) bool {
return os.Getenv("ENVIRONMENT") == "development"
},
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// AllowOriginsFunc defines a function that will set the 'access-control-allow-origin'
// response header to the 'origin' request header when returned true.
//
// Note: Using this feature is discouraged in production and it's best practice to explicitly
// set CORS origins via 'AllowOrigins'
//
// Optional. Default: nil
AllowOriginsFunc func(origin string) bool

// AllowOrigin defines a list of origins that may access the resource.
//
// Optional. Default value "*"
AllowOrigins string

// AllowMethods defines a list methods allowed when accessing the resource.
// This is used in response to a preflight request.
//
// Optional. Default value "GET,POST,HEAD,PUT,DELETE,PATCH"
AllowMethods string

// AllowHeaders defines a list of request headers that can be used when
// making the actual request. This is in response to a preflight request.
//
// Optional. Default value "".
AllowHeaders string

// AllowCredentials indicates whether or not the response to the request
// can be exposed when the credentials flag is true. When used as part of
// a response to a preflight request, this indicates whether or not the
// actual request can be made using credentials.
//
// Optional. Default value false.
AllowCredentials bool

// ExposeHeaders defines a whitelist headers that clients are allowed to
// access.
//
// Optional. Default value "".
ExposeHeaders string

// MaxAge indicates how long (in seconds) the results of a preflight request
// can be cached.
//
// Optional. Default value 0.
MaxAge int
}

Default Config​

var ConfigDefault = Config{
Next: nil,
AllowOriginsFunc: nil,
AllowOrigins: "*",
AllowMethods: strings.Join([]string{
fiber.MethodGet,
fiber.MethodPost,
fiber.MethodHead,
fiber.MethodPut,
fiber.MethodDelete,
fiber.MethodPatch,
}, ","),
AllowHeaders: "",
AllowCredentials: false,
ExposeHeaders: "",
MaxAge: 0,
}
- - +
Skip to main content
Version: v2.x

CORS

CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(cors.New())

// Or extend your config for customization
app.Use(cors.New(cors.Config{
AllowOrigins: "https://gofiber.io, https://gofiber.net",
AllowHeaders: "Origin, Content-Type, Accept",
}))

Using the AllowOriginsFunc function. In this example any origin will be allowed via CORS.

For example, if a browser running on http://localhost:3000 sends a request, this will be accepted and the access-control-allow-origin response header will be set to http://localhost:3000.

Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via AllowOrigins.

app.Use(cors.New())

app.Use(cors.New(cors.Config{
AllowOriginsFunc: func(origin string) bool {
return os.Getenv("ENVIRONMENT") == "development"
},
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// AllowOriginsFunc defines a function that will set the 'access-control-allow-origin'
// response header to the 'origin' request header when returned true.
//
// Note: Using this feature is discouraged in production and it's best practice to explicitly
// set CORS origins via 'AllowOrigins'
//
// Optional. Default: nil
AllowOriginsFunc func(origin string) bool

// AllowOrigin defines a list of origins that may access the resource.
//
// Optional. Default value "*"
AllowOrigins string

// AllowMethods defines a list methods allowed when accessing the resource.
// This is used in response to a preflight request.
//
// Optional. Default value "GET,POST,HEAD,PUT,DELETE,PATCH"
AllowMethods string

// AllowHeaders defines a list of request headers that can be used when
// making the actual request. This is in response to a preflight request.
//
// Optional. Default value "".
AllowHeaders string

// AllowCredentials indicates whether or not the response to the request
// can be exposed when the credentials flag is true. When used as part of
// a response to a preflight request, this indicates whether or not the
// actual request can be made using credentials.
//
// Optional. Default value false.
AllowCredentials bool

// ExposeHeaders defines a whitelist headers that clients are allowed to
// access.
//
// Optional. Default value "".
ExposeHeaders string

// MaxAge indicates how long (in seconds) the results of a preflight request
// can be cached.
//
// Optional. Default value 0.
MaxAge int
}

Default Config​

var ConfigDefault = Config{
Next: nil,
AllowOriginsFunc: nil,
AllowOrigins: "*",
AllowMethods: strings.Join([]string{
fiber.MethodGet,
fiber.MethodPost,
fiber.MethodHead,
fiber.MethodPut,
fiber.MethodDelete,
fiber.MethodPatch,
}, ","),
AllowHeaders: "",
AllowCredentials: false,
ExposeHeaders: "",
MaxAge: 0,
}
+ + \ No newline at end of file diff --git a/api/middleware/csrf/index.html b/api/middleware/csrf/index.html index 965fe448911..af6580f0654 100644 --- a/api/middleware/csrf/index.html +++ b/api/middleware/csrf/index.html @@ -6,13 +6,13 @@ CSRF | Fiber - - + +
-
Skip to main content
Version: v2.x

CSRF

CSRF middleware for Fiber that provides Cross-site request forgery protection by passing a csrf token via cookies. This cookie value will be used to compare against the client csrf token on requests, other than those defined as "safe" by RFC7231 (GET, HEAD, OPTIONS, or TRACE). When the csrf token is invalid, this middleware will return the fiber.ErrForbidden error.

CSRF Tokens are generated on GET requests. You can retrieve the CSRF token with c.Locals(contextKey), where contextKey is the string you set in the config (see Custom Config below).

When no csrf_ cookie is set, or the token has expired, a new token will be generated and csrf_ cookie set.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/csrf"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(csrf.New())

// Or extend your config for customization
app.Use(csrf.New(csrf.Config{
KeyLookup: "header:X-Csrf-Token",
CookieName: "csrf_",
CookieSameSite: "Lax",
Expiration: 1 * time.Hour,
KeyGenerator: utils.UUID,
Extractor: func(c *fiber.Ctx) (string, error) { ... },
}))
note

KeyLookup will be ignored if Extractor is explicitly set.

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// KeyLookup is a string in the form of "<source>:<key>" that is used
// to create an Extractor that extracts the token from the request.
// Possible values:
// - "header:<name>"
// - "query:<name>"
// - "param:<name>"
// - "form:<name>"
// - "cookie:<name>"
//
// Ignored if an Extractor is explicitly set.
//
// Optional. Default: "header:X-CSRF-Token"
KeyLookup string

// Name of the session cookie. This cookie will store session key.
// Optional. Default value "csrf_".
CookieName string

// Domain of the CSRF cookie.
// Optional. Default value "".
CookieDomain string

// Path of the CSRF cookie.
// Optional. Default value "".
CookiePath string

// Indicates if CSRF cookie is secure.
// Optional. Default value false.
CookieSecure bool

// Indicates if CSRF cookie is HTTP only.
// Optional. Default value false.
CookieHTTPOnly bool

// Indicates if CSRF cookie is requested by SameSite.
// Optional. Default value "Lax".
CookieSameSite string

// Decides whether cookie should last for only the browser sesison.
// Ignores Expiration if set to true
CookieSessionOnly bool

// Expiration is the duration before csrf token will expire
//
// Optional. Default: 1 * time.Hour
Expiration time.Duration

// Store is used to store the state of the middleware
//
// Optional. Default: memory.New()
Storage fiber.Storage

// Context key to store generated CSRF token into context.
// If left empty, token will not be stored in context.
//
// Optional. Default: ""
ContextKey string

// KeyGenerator creates a new CSRF token
//
// Optional. Default: utils.UUID
KeyGenerator func() string

// Extractor returns the csrf token
//
// If set this will be used in place of an Extractor based on KeyLookup.
//
// Optional. Default will create an Extractor based on KeyLookup.
Extractor func(c *fiber.Ctx) (string, error)
}

Default Config​

var ConfigDefault = Config{
KeyLookup: "header:" + HeaderName,
CookieName: "csrf_",
CookieSameSite: "Lax",
Expiration: 1 * time.Hour,
KeyGenerator: utils.UUID,
ErrorHandler: defaultErrorHandler,
Extractor: CsrfFromHeader(HeaderName),
}

Constants​

const (
HeaderName = "X-Csrf-Token"
)

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
app.Use(csrf.New(csrf.Config{
Storage: storage,
}))
- - +
Skip to main content
Version: v2.x

CSRF

CSRF middleware for Fiber that provides Cross-site request forgery protection by passing a csrf token via cookies. This cookie value will be used to compare against the client csrf token on requests, other than those defined as "safe" by RFC7231 (GET, HEAD, OPTIONS, or TRACE). When the csrf token is invalid, this middleware will return the fiber.ErrForbidden error.

CSRF Tokens are generated on GET requests. You can retrieve the CSRF token with c.Locals(contextKey), where contextKey is the string you set in the config (see Custom Config below).

When no csrf_ cookie is set, or the token has expired, a new token will be generated and csrf_ cookie set.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/csrf"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(csrf.New())

// Or extend your config for customization
app.Use(csrf.New(csrf.Config{
KeyLookup: "header:X-Csrf-Token",
CookieName: "csrf_",
CookieSameSite: "Lax",
Expiration: 1 * time.Hour,
KeyGenerator: utils.UUID,
Extractor: func(c *fiber.Ctx) (string, error) { ... },
}))
note

KeyLookup will be ignored if Extractor is explicitly set.

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// KeyLookup is a string in the form of "<source>:<key>" that is used
// to create an Extractor that extracts the token from the request.
// Possible values:
// - "header:<name>"
// - "query:<name>"
// - "param:<name>"
// - "form:<name>"
// - "cookie:<name>"
//
// Ignored if an Extractor is explicitly set.
//
// Optional. Default: "header:X-CSRF-Token"
KeyLookup string

// Name of the session cookie. This cookie will store session key.
// Optional. Default value "csrf_".
CookieName string

// Domain of the CSRF cookie.
// Optional. Default value "".
CookieDomain string

// Path of the CSRF cookie.
// Optional. Default value "".
CookiePath string

// Indicates if CSRF cookie is secure.
// Optional. Default value false.
CookieSecure bool

// Indicates if CSRF cookie is HTTP only.
// Optional. Default value false.
CookieHTTPOnly bool

// Indicates if CSRF cookie is requested by SameSite.
// Optional. Default value "Lax".
CookieSameSite string

// Decides whether cookie should last for only the browser sesison.
// Ignores Expiration if set to true
CookieSessionOnly bool

// Expiration is the duration before csrf token will expire
//
// Optional. Default: 1 * time.Hour
Expiration time.Duration

// Store is used to store the state of the middleware
//
// Optional. Default: memory.New()
Storage fiber.Storage

// Context key to store generated CSRF token into context.
// If left empty, token will not be stored in context.
//
// Optional. Default: ""
ContextKey string

// KeyGenerator creates a new CSRF token
//
// Optional. Default: utils.UUID
KeyGenerator func() string

// Extractor returns the csrf token
//
// If set this will be used in place of an Extractor based on KeyLookup.
//
// Optional. Default will create an Extractor based on KeyLookup.
Extractor func(c *fiber.Ctx) (string, error)
}

Default Config​

var ConfigDefault = Config{
KeyLookup: "header:" + HeaderName,
CookieName: "csrf_",
CookieSameSite: "Lax",
Expiration: 1 * time.Hour,
KeyGenerator: utils.UUID,
ErrorHandler: defaultErrorHandler,
Extractor: CsrfFromHeader(HeaderName),
}

Constants​

const (
HeaderName = "X-Csrf-Token"
)

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
app.Use(csrf.New(csrf.Config{
Storage: storage,
}))
+ + \ No newline at end of file diff --git a/api/middleware/earlydata/index.html b/api/middleware/earlydata/index.html index ac7b3494b63..4fb0e25666c 100644 --- a/api/middleware/earlydata/index.html +++ b/api/middleware/earlydata/index.html @@ -6,15 +6,15 @@ EarlyData | Fiber - - + +
Skip to main content
Version: v2.x

EarlyData

The Early Data middleware for Fiber adds support for TLS 1.3's early data ("0-RTT") feature. Citing RFC 8446, when a client and server share a PSK, TLS 1.3 allows clients to send data on the first flight ("early data") to speed up the request, effectively reducing the regular 1-RTT request to a 0-RTT request.

Make sure to enable fiber's EnableTrustedProxyCheck config option before using this middleware in order to not trust bogus HTTP request headers of the client.

Also be aware that enabling support for early data in your reverse proxy (e.g. nginx, as done with a simple ssl_early_data on;) makes requests replayable. Refer to the following documents before continuing:

By default, this middleware allows early data requests on safe HTTP request methods only and rejects the request otherwise, i.e. aborts the request before executing your handler. This behavior can be controlled by the AllowEarlyData config option. -Safe HTTP methods β€” GET, HEAD, OPTIONS and TRACE β€” should not modify a state on the server.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/earlydata"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(earlydata.New())

// Or extend your config for customization
app.Use(earlydata.New(earlydata.Config{
Error: fiber.ErrTooEarly,
// ...
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// IsEarlyData returns whether the request is an early-data request.
//
// Optional. Default: a function which checks if the "Early-Data" request header equals "1".
IsEarlyData func(c *fiber.Ctx) bool

// AllowEarlyData returns whether the early-data request should be allowed or rejected.
//
// Optional. Default: a function which rejects the request on unsafe and allows the request on safe HTTP request methods.
AllowEarlyData func(c *fiber.Ctx) bool

// Error is returned in case an early-data request is rejected.
//
// Optional. Default: fiber.ErrTooEarly.
Error error
}

Default Config​

var ConfigDefault = Config{
IsEarlyData: func(c *fiber.Ctx) bool {
return c.Get(DefaultHeaderName) == DefaultHeaderTrueValue
},

AllowEarlyData: func(c *fiber.Ctx) bool {
return fiber.IsMethodSafe(c.Method())
},

Error: fiber.ErrTooEarly,
}

Constants​

const (
DefaultHeaderName = "Early-Data"
DefaultHeaderTrueValue = "1"
)
- - +Safe HTTP methods β€” GET, HEAD, OPTIONS and TRACE β€” should not modify a state on the server.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/earlydata"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(earlydata.New())

// Or extend your config for customization
app.Use(earlydata.New(earlydata.Config{
Error: fiber.ErrTooEarly,
// ...
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// IsEarlyData returns whether the request is an early-data request.
//
// Optional. Default: a function which checks if the "Early-Data" request header equals "1".
IsEarlyData func(c *fiber.Ctx) bool

// AllowEarlyData returns whether the early-data request should be allowed or rejected.
//
// Optional. Default: a function which rejects the request on unsafe and allows the request on safe HTTP request methods.
AllowEarlyData func(c *fiber.Ctx) bool

// Error is returned in case an early-data request is rejected.
//
// Optional. Default: fiber.ErrTooEarly.
Error error
}

Default Config​

var ConfigDefault = Config{
IsEarlyData: func(c *fiber.Ctx) bool {
return c.Get(DefaultHeaderName) == DefaultHeaderTrueValue
},

AllowEarlyData: func(c *fiber.Ctx) bool {
return fiber.IsMethodSafe(c.Method())
},

Error: fiber.ErrTooEarly,
}

Constants​

const (
DefaultHeaderName = "Early-Data"
DefaultHeaderTrueValue = "1"
)
+ + \ No newline at end of file diff --git a/api/middleware/encryptcookie/index.html b/api/middleware/encryptcookie/index.html index 9e5709ef4ca..796c8933bd6 100644 --- a/api/middleware/encryptcookie/index.html +++ b/api/middleware/encryptcookie/index.html @@ -6,13 +6,13 @@ Encrypt Cookie | Fiber - - + +
-
Skip to main content
Version: v2.x

Encrypt Cookie

Encrypt middleware for Fiber which encrypts cookie values. Note: this middleware does not encrypt cookie names.

Signatures​

// Intitializes the middleware
func New(config ...Config) fiber.Handler

// Returns a random 32 character long string
func GenerateKey() string

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/encryptcookie"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
// `Key` must be a 32 character string. It's used to encrypt the values, so make sure it is random and keep it secret.
// You can run `openssl rand -base64 32` or call `encryptcookie.GenerateKey()` to create a random key for you.
// Make sure not to set `Key` to `encryptcookie.GenerateKey()` because that will create a new key every run.
app.Use(encryptcookie.New(encryptcookie.Config{
Key: "secret-thirty-2-character-string",
}))

// Get / reading out the encrypted cookie
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("value=" + c.Cookies("test"))
})

// Post / create the encrypted cookie
app.Post("/", func(c *fiber.Ctx) error {
c.Cookie(&fiber.Cookie{
Name: "test",
Value: "SomeThing",
})
return nil
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Array of cookie keys that should not be encrypted.
//
// Optional. Default: ["csrf_"]
Except []string

// Base64 encoded unique key to encode & decode cookies.
//
// Required. The key should be 32 bytes of random data in base64-encoded form.
// You may run `openssl rand -base64 32` or use `encryptcookie.GenerateKey()` to generate a new key.
Key string

// Custom function to encrypt cookies.
//
// Optional. Default: EncryptCookie
Encryptor func(decryptedString, key string) (string, error)

// Custom function to decrypt cookies.
//
// Optional. Default: DecryptCookie
Decryptor func(encryptedString, key string) (string, error)
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Except: []string{"csrf_"},
Key: "",
Encryptor: EncryptCookie,
Decryptor: DecryptCookie,
}

Normally, encryptcookie middleware skips csrf_ cookies. However, it won't work when you use custom cookie names for CSRF. You should update Except config to avoid this problem. For example:

app.Use(encryptcookie.New(encryptcookie.Config{
Key: "secret-thirty-2-character-string",
Except: []string{"csrf_1"}, // exclude CSRF cookie
}))
app.Use(csrf.New(csrf.Config{
KeyLookup: "form:test",
CookieName: "csrf_1",
CookieHTTPOnly: true,
}))
- - +
Skip to main content
Version: v2.x

Encrypt Cookie

Encrypt middleware for Fiber which encrypts cookie values. Note: this middleware does not encrypt cookie names.

Signatures​

// Intitializes the middleware
func New(config ...Config) fiber.Handler

// Returns a random 32 character long string
func GenerateKey() string

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/encryptcookie"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
// `Key` must be a 32 character string. It's used to encrypt the values, so make sure it is random and keep it secret.
// You can run `openssl rand -base64 32` or call `encryptcookie.GenerateKey()` to create a random key for you.
// Make sure not to set `Key` to `encryptcookie.GenerateKey()` because that will create a new key every run.
app.Use(encryptcookie.New(encryptcookie.Config{
Key: "secret-thirty-2-character-string",
}))

// Get / reading out the encrypted cookie
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("value=" + c.Cookies("test"))
})

// Post / create the encrypted cookie
app.Post("/", func(c *fiber.Ctx) error {
c.Cookie(&fiber.Cookie{
Name: "test",
Value: "SomeThing",
})
return nil
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Array of cookie keys that should not be encrypted.
//
// Optional. Default: ["csrf_"]
Except []string

// Base64 encoded unique key to encode & decode cookies.
//
// Required. The key should be 32 bytes of random data in base64-encoded form.
// You may run `openssl rand -base64 32` or use `encryptcookie.GenerateKey()` to generate a new key.
Key string

// Custom function to encrypt cookies.
//
// Optional. Default: EncryptCookie
Encryptor func(decryptedString, key string) (string, error)

// Custom function to decrypt cookies.
//
// Optional. Default: DecryptCookie
Decryptor func(encryptedString, key string) (string, error)
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Except: []string{"csrf_"},
Key: "",
Encryptor: EncryptCookie,
Decryptor: DecryptCookie,
}

Normally, encryptcookie middleware skips csrf_ cookies. However, it won't work when you use custom cookie names for CSRF. You should update Except config to avoid this problem. For example:

app.Use(encryptcookie.New(encryptcookie.Config{
Key: "secret-thirty-2-character-string",
Except: []string{"csrf_1"}, // exclude CSRF cookie
}))
app.Use(csrf.New(csrf.Config{
KeyLookup: "form:test",
CookieName: "csrf_1",
CookieHTTPOnly: true,
}))
+ + \ No newline at end of file diff --git a/api/middleware/envvar/index.html b/api/middleware/envvar/index.html index cc40afd660f..b690d067327 100644 --- a/api/middleware/envvar/index.html +++ b/api/middleware/envvar/index.html @@ -6,13 +6,13 @@ EnvVar | Fiber - - + +
-
Skip to main content
Version: v2.x

EnvVar

EnvVar middleware for Fiber that can be used to expose environment variables with various options.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/envvar"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use("/expose/envvars", envvar.New())

// Or extend your config for customization
app.Use("/expose/envvars", envvar.New(
envvar.Config{
ExportVars: map[string]string{"testKey": "", "testDefaultKey": "testDefaultVal"},
ExcludeVars: map[string]string{"excludeKey": ""},
}),
)
note

You will need to provide a path to use the envvar middleware.

Response​

Http response contract:

{
"vars": {
"someEnvVariable": "someValue",
"anotherEnvVariable": "anotherValue",
}
}

Config​

// Config defines the config for middleware.
type Config struct {
// ExportVars specifies the environment variables that should export
ExportVars map[string]string
// ExcludeVars specifies the environment variables that should not export
ExcludeVars map[string]string
}

Default Config​

Config{}
- - +
Skip to main content
Version: v2.x

EnvVar

EnvVar middleware for Fiber that can be used to expose environment variables with various options.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/envvar"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use("/expose/envvars", envvar.New())

// Or extend your config for customization
app.Use("/expose/envvars", envvar.New(
envvar.Config{
ExportVars: map[string]string{"testKey": "", "testDefaultKey": "testDefaultVal"},
ExcludeVars: map[string]string{"excludeKey": ""},
}),
)
note

You will need to provide a path to use the envvar middleware.

Response​

Http response contract:

{
"vars": {
"someEnvVariable": "someValue",
"anotherEnvVariable": "anotherValue",
}
}

Config​

// Config defines the config for middleware.
type Config struct {
// ExportVars specifies the environment variables that should export
ExportVars map[string]string
// ExcludeVars specifies the environment variables that should not export
ExcludeVars map[string]string
}

Default Config​

Config{}
+ + \ No newline at end of file diff --git a/api/middleware/etag/index.html b/api/middleware/etag/index.html index 8c038432681..775ee764fa3 100644 --- a/api/middleware/etag/index.html +++ b/api/middleware/etag/index.html @@ -6,13 +6,13 @@ ETag | Fiber - - + +
-
Skip to main content
Version: v2.x

ETag

ETag middleware for Fiber that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/etag"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(etag.New())

// Get / receives Etag: "13-1831710635" in response header
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

// Or extend your config for customization
app.Use(etag.New(etag.Config{
Weak: true,
}))

// Get / receives Etag: "W/"13-1831710635" in response header
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Weak indicates that a weak validator is used. Weak etags are easy
// to generate, but are far less useful for comparisons. Strong
// validators are ideal for comparisons but can be very difficult
// to generate efficiently. Weak ETag values of two representations
// of the same resources might be semantically equivalent, but not
// byte-for-byte identical. This means weak etags prevent caching
// when byte range requests are used, but strong etags mean range
// requests can still be cached.
Weak bool
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Weak: false,
}
- - +
Skip to main content
Version: v2.x

ETag

ETag middleware for Fiber that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/etag"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(etag.New())

// Get / receives Etag: "13-1831710635" in response header
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

// Or extend your config for customization
app.Use(etag.New(etag.Config{
Weak: true,
}))

// Get / receives Etag: "W/"13-1831710635" in response header
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Weak indicates that a weak validator is used. Weak etags are easy
// to generate, but are far less useful for comparisons. Strong
// validators are ideal for comparisons but can be very difficult
// to generate efficiently. Weak ETag values of two representations
// of the same resources might be semantically equivalent, but not
// byte-for-byte identical. This means weak etags prevent caching
// when byte range requests are used, but strong etags mean range
// requests can still be cached.
Weak bool
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Weak: false,
}
+ + \ No newline at end of file diff --git a/api/middleware/expvar/index.html b/api/middleware/expvar/index.html index 32c02b99695..caefcf70b51 100644 --- a/api/middleware/expvar/index.html +++ b/api/middleware/expvar/index.html @@ -6,13 +6,13 @@ ExpVar | Fiber - - + +
-
Skip to main content
Version: v2.x

ExpVar

Expvar middleware for Fiber that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is /debug/vars.

Signatures​

func New() fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
expvarmw "github.com/gofiber/fiber/v2/middleware/expvar"
)

After you initiate your Fiber app, you can use the following possibilities:

var count = expvar.NewInt("count")

app.Use(expvarmw.New())
app.Get("/", func(c *fiber.Ctx) error {
count.Add(1)

return c.SendString(fmt.Sprintf("hello expvar count %d", count.Value()))
})

Visit path /debug/vars to see all vars and use query r=key to filter exposed variables.

curl 127.0.0.1:3000
hello expvar count 1

curl 127.0.0.1:3000/debug/vars
{
"cmdline": ["xxx"],
"count": 1,
"expvarHandlerCalls": 33,
"expvarRegexpErrors": 0,
"memstats": {...}
}

curl 127.0.0.1:3000/debug/vars?r=c
{
"cmdline": ["xxx"],
"count": 1
}

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool
}

Default Config​

var ConfigDefault = Config{
Next: nil,
}
- - +
Skip to main content
Version: v2.x

ExpVar

Expvar middleware for Fiber that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is /debug/vars.

Signatures​

func New() fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
expvarmw "github.com/gofiber/fiber/v2/middleware/expvar"
)

After you initiate your Fiber app, you can use the following possibilities:

var count = expvar.NewInt("count")

app.Use(expvarmw.New())
app.Get("/", func(c *fiber.Ctx) error {
count.Add(1)

return c.SendString(fmt.Sprintf("hello expvar count %d", count.Value()))
})

Visit path /debug/vars to see all vars and use query r=key to filter exposed variables.

curl 127.0.0.1:3000
hello expvar count 1

curl 127.0.0.1:3000/debug/vars
{
"cmdline": ["xxx"],
"count": 1,
"expvarHandlerCalls": 33,
"expvarRegexpErrors": 0,
"memstats": {...}
}

curl 127.0.0.1:3000/debug/vars?r=c
{
"cmdline": ["xxx"],
"count": 1
}

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool
}

Default Config​

var ConfigDefault = Config{
Next: nil,
}
+ + \ No newline at end of file diff --git a/api/middleware/favicon/index.html b/api/middleware/favicon/index.html index 53bafe319cf..2023b3b5f43 100644 --- a/api/middleware/favicon/index.html +++ b/api/middleware/favicon/index.html @@ -6,13 +6,13 @@ Favicon | Fiber - - + +
-
Skip to main content
Version: v2.x

Favicon

Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware.

note

This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or custom favicon URL.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/favicon"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(favicon.New())

// Or extend your config for customization
app.Use(favicon.New(favicon.Config{
File: "./favicon.ico",
URL: "/favicon.ico",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// File holds the path to an actual favicon that will be cached
//
// Optional. Default: ""
File string

// URL for favicon handler
//
// Optional. Default: "/favicon.ico"
URL string

// FileSystem is an optional alternate filesystem to search for the favicon in.
// An example of this could be an embedded or network filesystem
//
// Optional. Default: nil
FileSystem http.FileSystem

// CacheControl defines how the Cache-Control header in the response should be set
//
// Optional. Default: "public, max-age=31536000"
CacheControl string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
File: "",
URL: fPath,
CacheControl: "public, max-age=31536000",
}
- - +
Skip to main content
Version: v2.x

Favicon

Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware.

note

This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or custom favicon URL.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/favicon"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(favicon.New())

// Or extend your config for customization
app.Use(favicon.New(favicon.Config{
File: "./favicon.ico",
URL: "/favicon.ico",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// File holds the path to an actual favicon that will be cached
//
// Optional. Default: ""
File string

// URL for favicon handler
//
// Optional. Default: "/favicon.ico"
URL string

// FileSystem is an optional alternate filesystem to search for the favicon in.
// An example of this could be an embedded or network filesystem
//
// Optional. Default: nil
FileSystem http.FileSystem

// CacheControl defines how the Cache-Control header in the response should be set
//
// Optional. Default: "public, max-age=31536000"
CacheControl string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
File: "",
URL: fPath,
CacheControl: "public, max-age=31536000",
}
+ + \ No newline at end of file diff --git a/api/middleware/filesystem/index.html b/api/middleware/filesystem/index.html index ff9fe924506..038051dda2c 100644 --- a/api/middleware/filesystem/index.html +++ b/api/middleware/filesystem/index.html @@ -6,13 +6,13 @@ FileSystem | Fiber - - + +
-
Skip to main content
Version: v2.x

FileSystem

Filesystem middleware for Fiber that enables you to serve files from a directory.

caution

:params & :optionals? within the prefix path are not supported!

To handle paths with spaces (or other url encoded values) make sure to set fiber.Config{ UnescapePath: true }

Signatures​

func New(config Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
app.Use(filesystem.New(filesystem.Config{
Root: http.Dir("./assets"),
}))

// Or extend your config for customization
app.Use(filesystem.New(filesystem.Config{
Root: http.Dir("./assets"),
Browse: true,
Index: "index.html",
NotFoundFile: "404.html",
MaxAge: 3600,
}))

If your environment (Go 1.16+) supports it, we recommend using Go Embed instead of the other solutions listed as this one is native to Go and the easiest to use.

embed​

Embed is the native method to embed files in a Golang excecutable. Introduced in Go 1.16.

package main

import (
"embed"
"io/fs"
"log"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)

// Embed a single file
//go:embed index.html
var f embed.FS

// Embed a directory
//go:embed static/*
var embedDirStatic embed.FS

func main() {
app := fiber.New()

app.Use("/", filesystem.New(filesystem.Config{
Root: http.FS(f),
}))

// Access file "image.png" under `static/` directory via URL: `http://<server>/static/image.png`.
// Without `PathPrefix`, you have to access it via URL:
// `http://<server>/static/static/image.png`.
app.Use("/static", filesystem.New(filesystem.Config{
Root: http.FS(embedDirStatic),
PathPrefix: "static",
Browse: true,
}))

log.Fatal(app.Listen(":3000"))
}

pkger​

https://github.com/markbates/pkger

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/markbates/pkger"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: pkger.Dir("/assets"),
}))

log.Fatal(app.Listen(":3000"))
}

packr​

https://github.com/gobuffalo/packr

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/gobuffalo/packr/v2"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: packr.New("Assets Box", "/assets"),
}))

log.Fatal(app.Listen(":3000"))
}

go.rice​

https://github.com/GeertJohan/go.rice

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/GeertJohan/go.rice"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: rice.MustFindBox("assets").HTTPBox(),
}))

log.Fatal(app.Listen(":3000"))
}

fileb0x​

https://github.com/UnnoTed/fileb0x

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"<Your go module>/myEmbeddedFiles"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: myEmbeddedFiles.HTTP,
}))

log.Fatal(app.Listen(":3000"))
}

statik​

https://github.com/rakyll/statik

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

// Use blank to invoke init function and register data to statik
_ "<Your go module>/statik"
"github.com/rakyll/statik/fs"
)

func main() {
statikFS, err := fs.New()
if err != nil {
panic(err)
}

app := fiber.New()

app.Use("/", filesystem.New(filesystem.Config{
Root: statikFS,
}))

log.Fatal(app.Listen(":3000"))
}

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Root is a FileSystem that provides access
// to a collection of files and directories.
//
// Required. Default: nil
Root http.FileSystem `json:"-"`

// PathPrefix defines a prefix to be added to a filepath when
// reading a file from the FileSystem.
//
// Use when using Go 1.16 embed.FS
//
// Optional. Default ""
PathPrefix string `json:"path_prefix"`

// Enable directory browsing.
//
// Optional. Default: false
Browse bool `json:"browse"`

// Index file for serving a directory.
//
// Optional. Default: "index.html"
Index string `json:"index"`

// The value for the Cache-Control HTTP-header
// that is set on the file response. MaxAge is defined in seconds.
//
// Optional. Default value 0.
MaxAge int `json:"max_age"`

// File to return if path is not found. Useful for SPA's.
//
// Optional. Default: ""
NotFoundFile string `json:"not_found_file"`

// The value for the Content-Type HTTP-header
// that is set on the file response
//
// Optional. Default: ""
ContentTypeCharset string `json:"content_type_charset"`
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Root: nil,
PathPrefix: "",
Browse: false,
Index: "/index.html",
MaxAge: 0,
ContentTypeCharset: "",
}
- - +
Skip to main content
Version: v2.x

FileSystem

Filesystem middleware for Fiber that enables you to serve files from a directory.

caution

:params & :optionals? within the prefix path are not supported!

To handle paths with spaces (or other url encoded values) make sure to set fiber.Config{ UnescapePath: true }

Signatures​

func New(config Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
app.Use(filesystem.New(filesystem.Config{
Root: http.Dir("./assets"),
}))

// Or extend your config for customization
app.Use(filesystem.New(filesystem.Config{
Root: http.Dir("./assets"),
Browse: true,
Index: "index.html",
NotFoundFile: "404.html",
MaxAge: 3600,
}))

If your environment (Go 1.16+) supports it, we recommend using Go Embed instead of the other solutions listed as this one is native to Go and the easiest to use.

embed​

Embed is the native method to embed files in a Golang excecutable. Introduced in Go 1.16.

package main

import (
"embed"
"io/fs"
"log"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)

// Embed a single file
//go:embed index.html
var f embed.FS

// Embed a directory
//go:embed static/*
var embedDirStatic embed.FS

func main() {
app := fiber.New()

app.Use("/", filesystem.New(filesystem.Config{
Root: http.FS(f),
}))

// Access file "image.png" under `static/` directory via URL: `http://<server>/static/image.png`.
// Without `PathPrefix`, you have to access it via URL:
// `http://<server>/static/static/image.png`.
app.Use("/static", filesystem.New(filesystem.Config{
Root: http.FS(embedDirStatic),
PathPrefix: "static",
Browse: true,
}))

log.Fatal(app.Listen(":3000"))
}

pkger​

https://github.com/markbates/pkger

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/markbates/pkger"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: pkger.Dir("/assets"),
}))

log.Fatal(app.Listen(":3000"))
}

packr​

https://github.com/gobuffalo/packr

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/gobuffalo/packr/v2"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: packr.New("Assets Box", "/assets"),
}))

log.Fatal(app.Listen(":3000"))
}

go.rice​

https://github.com/GeertJohan/go.rice

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/GeertJohan/go.rice"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: rice.MustFindBox("assets").HTTPBox(),
}))

log.Fatal(app.Listen(":3000"))
}

fileb0x​

https://github.com/UnnoTed/fileb0x

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"<Your go module>/myEmbeddedFiles"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: myEmbeddedFiles.HTTP,
}))

log.Fatal(app.Listen(":3000"))
}

statik​

https://github.com/rakyll/statik

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

// Use blank to invoke init function and register data to statik
_ "<Your go module>/statik"
"github.com/rakyll/statik/fs"
)

func main() {
statikFS, err := fs.New()
if err != nil {
panic(err)
}

app := fiber.New()

app.Use("/", filesystem.New(filesystem.Config{
Root: statikFS,
}))

log.Fatal(app.Listen(":3000"))
}

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Root is a FileSystem that provides access
// to a collection of files and directories.
//
// Required. Default: nil
Root http.FileSystem `json:"-"`

// PathPrefix defines a prefix to be added to a filepath when
// reading a file from the FileSystem.
//
// Use when using Go 1.16 embed.FS
//
// Optional. Default ""
PathPrefix string `json:"path_prefix"`

// Enable directory browsing.
//
// Optional. Default: false
Browse bool `json:"browse"`

// Index file for serving a directory.
//
// Optional. Default: "index.html"
Index string `json:"index"`

// The value for the Cache-Control HTTP-header
// that is set on the file response. MaxAge is defined in seconds.
//
// Optional. Default value 0.
MaxAge int `json:"max_age"`

// File to return if path is not found. Useful for SPA's.
//
// Optional. Default: ""
NotFoundFile string `json:"not_found_file"`

// The value for the Content-Type HTTP-header
// that is set on the file response
//
// Optional. Default: ""
ContentTypeCharset string `json:"content_type_charset"`
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Root: nil,
PathPrefix: "",
Browse: false,
Index: "/index.html",
MaxAge: 0,
ContentTypeCharset: "",
}
+ + \ No newline at end of file diff --git a/api/middleware/helmet/index.html b/api/middleware/helmet/index.html index 33e6827782d..78225a82b3e 100644 --- a/api/middleware/helmet/index.html +++ b/api/middleware/helmet/index.html @@ -6,13 +6,13 @@ Helmet | Fiber - - + +
-
Skip to main content
Version: v2.x

Helmet

Helmet middleware helps secure your apps by setting various HTTP headers.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/helmet"
)

func main() {
app := fiber.New()

app.Use(helmet.New())

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome!")
})

app.Listen(":3000")
}

Test:

curl -I http://localhost:3000

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// XSSProtection
// Optional. Default value "0".
XSSProtection string

// ContentTypeNosniff
// Optional. Default value "nosniff".
ContentTypeNosniff string

// XFrameOptions
// Optional. Default value "SAMEORIGIN".
// Possible values: "SAMEORIGIN", "DENY", "ALLOW-FROM uri"
XFrameOptions string

// HSTSMaxAge
// Optional. Default value 0.
HSTSMaxAge int

// HSTSExcludeSubdomains
// Optional. Default value false.
HSTSExcludeSubdomains bool

// ContentSecurityPolicy
// Optional. Default value "".
ContentSecurityPolicy string

// CSPReportOnly
// Optional. Default value false.
CSPReportOnly bool

// HSTSPreloadEnabled
// Optional. Default value false.
HSTSPreloadEnabled bool

// ReferrerPolicy
// Optional. Default value "ReferrerPolicy".
ReferrerPolicy string

// Permissions-Policy
// Optional. Default value "".
PermissionPolicy string

// Cross-Origin-Embedder-Policy
// Optional. Default value "require-corp".
CrossOriginEmbedderPolicy string

// Cross-Origin-Opener-Policy
// Optional. Default value "same-origin".
CrossOriginOpenerPolicy string

// Cross-Origin-Resource-Policy
// Optional. Default value "same-origin".
CrossOriginResourcePolicy string

// Origin-Agent-Cluster
// Optional. Default value "?1".
OriginAgentCluster string

// X-DNS-Prefetch-Control
// Optional. Default value "off".
XDNSPrefetchControl string

// X-Download-Options
// Optional. Default value "noopen".
XDownloadOptions string

// X-Permitted-Cross-Domain-Policies
// Optional. Default value "none".
XPermittedCrossDomain string
}

Default Config​

var ConfigDefault = Config{
XSSProtection: "0",
ContentTypeNosniff: "nosniff",
XFrameOptions: "SAMEORIGIN",
ReferrerPolicy: "no-referrer",
CrossOriginEmbedderPolicy: "require-corp",
CrossOriginOpenerPolicy: "same-origin",
CrossOriginResourcePolicy: "same-origin",
OriginAgentCluster: "?1",
XDNSPrefetchControl: "off",
XDownloadOptions: "noopen",
XPermittedCrossDomain: "none",
}
- - +
Skip to main content
Version: v2.x

Helmet

Helmet middleware helps secure your apps by setting various HTTP headers.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/helmet"
)

func main() {
app := fiber.New()

app.Use(helmet.New())

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome!")
})

app.Listen(":3000")
}

Test:

curl -I http://localhost:3000

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// XSSProtection
// Optional. Default value "0".
XSSProtection string

// ContentTypeNosniff
// Optional. Default value "nosniff".
ContentTypeNosniff string

// XFrameOptions
// Optional. Default value "SAMEORIGIN".
// Possible values: "SAMEORIGIN", "DENY", "ALLOW-FROM uri"
XFrameOptions string

// HSTSMaxAge
// Optional. Default value 0.
HSTSMaxAge int

// HSTSExcludeSubdomains
// Optional. Default value false.
HSTSExcludeSubdomains bool

// ContentSecurityPolicy
// Optional. Default value "".
ContentSecurityPolicy string

// CSPReportOnly
// Optional. Default value false.
CSPReportOnly bool

// HSTSPreloadEnabled
// Optional. Default value false.
HSTSPreloadEnabled bool

// ReferrerPolicy
// Optional. Default value "ReferrerPolicy".
ReferrerPolicy string

// Permissions-Policy
// Optional. Default value "".
PermissionPolicy string

// Cross-Origin-Embedder-Policy
// Optional. Default value "require-corp".
CrossOriginEmbedderPolicy string

// Cross-Origin-Opener-Policy
// Optional. Default value "same-origin".
CrossOriginOpenerPolicy string

// Cross-Origin-Resource-Policy
// Optional. Default value "same-origin".
CrossOriginResourcePolicy string

// Origin-Agent-Cluster
// Optional. Default value "?1".
OriginAgentCluster string

// X-DNS-Prefetch-Control
// Optional. Default value "off".
XDNSPrefetchControl string

// X-Download-Options
// Optional. Default value "noopen".
XDownloadOptions string

// X-Permitted-Cross-Domain-Policies
// Optional. Default value "none".
XPermittedCrossDomain string
}

Default Config​

var ConfigDefault = Config{
XSSProtection: "0",
ContentTypeNosniff: "nosniff",
XFrameOptions: "SAMEORIGIN",
ReferrerPolicy: "no-referrer",
CrossOriginEmbedderPolicy: "require-corp",
CrossOriginOpenerPolicy: "same-origin",
CrossOriginResourcePolicy: "same-origin",
OriginAgentCluster: "?1",
XDNSPrefetchControl: "off",
XDownloadOptions: "noopen",
XPermittedCrossDomain: "none",
}
+ + \ No newline at end of file diff --git a/api/middleware/idempotency/index.html b/api/middleware/idempotency/index.html index 883ae339adf..1b4753e17c7 100644 --- a/api/middleware/idempotency/index.html +++ b/api/middleware/idempotency/index.html @@ -6,13 +6,13 @@ Idempotency | Fiber - - + +
-
Skip to main content
Version: v2.x

Idempotency

Idempotency middleware for Fiber allows for fault-tolerant APIs where duplicate requests β€” for example due to networking issues on the client-side β€” do not erroneously cause the same action performed multiple times on the server-side.

Refer to https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02 for a better understanding.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/idempotency"
)

After you initiate your Fiber app, you can use the following possibilities:

Default Config​

app.Use(idempotency.New())

Custom Config​

app.Use(idempotency.New(idempotency.Config{
Lifetime: 42 * time.Minute,
// ...
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: a function which skips the middleware on safe HTTP request method.
Next func(c *fiber.Ctx) bool

// Lifetime is the maximum lifetime of an idempotency key.
//
// Optional. Default: 30 * time.Minute
Lifetime time.Duration

// KeyHeader is the name of the header that contains the idempotency key.
//
// Optional. Default: X-Idempotency-Key
KeyHeader string
// KeyHeaderValidate defines a function to validate the syntax of the idempotency header.
//
// Optional. Default: a function which ensures the header is 36 characters long (the size of an UUID).
KeyHeaderValidate func(string) error

// KeepResponseHeaders is a list of headers that should be kept from the original response.
//
// Optional. Default: nil (to keep all headers)
KeepResponseHeaders []string

// Lock locks an idempotency key.
//
// Optional. Default: an in-memory locker for this process only.
Lock Locker

// Storage stores response data by idempotency key.
//
// Optional. Default: an in-memory storage for this process only.
Storage fiber.Storage
}

Default Config​

var ConfigDefault = Config{
Next: func(c *fiber.Ctx) bool {
// Skip middleware if the request was done using a safe HTTP method
return fiber.IsMethodSafe(c.Method())
},

Lifetime: 30 * time.Minute,

KeyHeader: "X-Idempotency-Key",
KeyHeaderValidate: func(k string) error {
if l, wl := len(k), 36; l != wl { // UUID length is 36 chars
return fmt.Errorf("%w: invalid length: %d != %d", ErrInvalidIdempotencyKey, l, wl)
}

return nil
},

KeepResponseHeaders: nil,

Lock: nil, // Set in configDefault so we don't allocate data here.

Storage: nil, // Set in configDefault so we don't allocate data here.
}
- - +
Skip to main content
Version: v2.x

Idempotency

Idempotency middleware for Fiber allows for fault-tolerant APIs where duplicate requests β€” for example due to networking issues on the client-side β€” do not erroneously cause the same action performed multiple times on the server-side.

Refer to https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02 for a better understanding.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/idempotency"
)

After you initiate your Fiber app, you can use the following possibilities:

Default Config​

app.Use(idempotency.New())

Custom Config​

app.Use(idempotency.New(idempotency.Config{
Lifetime: 42 * time.Minute,
// ...
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: a function which skips the middleware on safe HTTP request method.
Next func(c *fiber.Ctx) bool

// Lifetime is the maximum lifetime of an idempotency key.
//
// Optional. Default: 30 * time.Minute
Lifetime time.Duration

// KeyHeader is the name of the header that contains the idempotency key.
//
// Optional. Default: X-Idempotency-Key
KeyHeader string
// KeyHeaderValidate defines a function to validate the syntax of the idempotency header.
//
// Optional. Default: a function which ensures the header is 36 characters long (the size of an UUID).
KeyHeaderValidate func(string) error

// KeepResponseHeaders is a list of headers that should be kept from the original response.
//
// Optional. Default: nil (to keep all headers)
KeepResponseHeaders []string

// Lock locks an idempotency key.
//
// Optional. Default: an in-memory locker for this process only.
Lock Locker

// Storage stores response data by idempotency key.
//
// Optional. Default: an in-memory storage for this process only.
Storage fiber.Storage
}

Default Config​

var ConfigDefault = Config{
Next: func(c *fiber.Ctx) bool {
// Skip middleware if the request was done using a safe HTTP method
return fiber.IsMethodSafe(c.Method())
},

Lifetime: 30 * time.Minute,

KeyHeader: "X-Idempotency-Key",
KeyHeaderValidate: func(k string) error {
if l, wl := len(k), 36; l != wl { // UUID length is 36 chars
return fmt.Errorf("%w: invalid length: %d != %d", ErrInvalidIdempotencyKey, l, wl)
}

return nil
},

KeepResponseHeaders: nil,

Lock: nil, // Set in configDefault so we don't allocate data here.

Storage: nil, // Set in configDefault so we don't allocate data here.
}
+ + \ No newline at end of file diff --git a/api/middleware/keyauth/index.html b/api/middleware/keyauth/index.html index a1643717dbc..3b84aaf470d 100644 --- a/api/middleware/keyauth/index.html +++ b/api/middleware/keyauth/index.html @@ -6,13 +6,13 @@ Keyauth | Fiber - - + +
-
Skip to main content
Version: v2.x

Keyauth

Key auth middleware provides a key based authentication.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
)

var (
apiKey = "correct horse battery staple"
)

func validateAPIKey(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
}

func main() {
app := fiber.New()

// note that the keyauth middleware needs to be defined before the routes are defined!
app.Use(keyauth.New(keyauth.Config{
KeyLookup: "cookie:access_token",
Validator: validateAPIKey,
}))

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})

app.Listen(":3000")
}

Test:

# No api-key specified -> 400 missing 
curl http://localhost:3000
#> missing or malformed API Key

curl --cookie "access_token=correct horse battery staple" http://localhost:3000
#> Successfully authenticated!

curl --cookie "access_token=Clearly A Wrong Key" http://localhost:3000
#> missing or malformed API Key

For a more detailed example, see also the github.com/gofiber/recipes repository and specifically the fiber-envoy-extauthz repository and the keyauth example code.

Authenticate only certain endpoints​

If you want to authenticate only certain endpoints, you can use the Config of keyauth and apply a filter function (eg. authFilter) like so

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
"regexp"
"strings"
)

var (
apiKey = "correct horse battery staple"
protectedURLs = []*regexp.Regexp{
regexp.MustCompile("^/authenticated$"),
regexp.MustCompile("^/auth2$"),
}
)

func validateAPIKey(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
}

func authFilter(c *fiber.Ctx) bool {
originalURL := strings.ToLower(c.OriginalURL())

for _, pattern := range protectedURLs {
if pattern.MatchString(originalURL) {
return false
}
}
return true
}

func main() {
app := fiber.New()

app.Use(keyauth.New(keyauth.Config{
Next: authFilter,
KeyLookup: "cookie:access_token",
Validator: validateAPIKey,
}))

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome")
})
app.Get("/authenticated", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})
app.Get("/auth2", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated 2!")
})

app.Listen(":3000")
}

Which results in this

# / does not need to be authenticated
curl http://localhost:3000
#> Welcome

# /authenticated needs to be authenticated
curl --cookie "access_token=correct horse battery staple" http://localhost:3000/authenticated
#> Successfully authenticated!

# /auth2 needs to be authenticated too
curl --cookie "access_token=correct horse battery staple" http://localhost:3000/auth2
#> Successfully authenticated 2!

Specifying middleware in the handler​

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
)

const (
apiKey = "my-super-secret-key"
)

func main() {
app := fiber.New()

authMiddleware := keyauth.New(keyauth.Config{
Validator: func(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
},
})

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome")
})

app.Get("/allowed", authMiddleware, func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})

app.Listen(":3000")
}

Which results in this

# / does not need to be authenticated
curl http://localhost:3000
#> Welcome

# /allowed needs to be authenticated too
curl --header "Authorization: Bearer my-super-secret-key" http://localhost:3000/allowed
#> Successfully authenticated!

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// SuccessHandler defines a function which is executed for a valid key.
// Optional. Default: nil
SuccessHandler fiber.Handler

// ErrorHandler defines a function which is executed for an invalid key.
// It may be used to define a custom error.
// Optional. Default: 401 Invalid or expired key
ErrorHandler fiber.ErrorHandler

// KeyLookup is a string in the form of "<source>:<name>" that is used
// to extract key from the request.
// Optional. Default value "header:Authorization".
// Possible values:
// - "header:<name>"
// - "query:<name>"
// - "form:<name>"
// - "param:<name>"
// - "cookie:<name>"
KeyLookup string

// AuthScheme to be used in the Authorization header.
// Optional. Default value "Bearer".
AuthScheme string

// Validator is a function to validate key.
Validator func(*fiber.Ctx, string) (bool, error)

// Context key to store the bearertoken from the token into context.
// Optional. Default: "token".
ContextKey string
}

Default Config​

var ConfigDefault = Config{
SuccessHandler: func(c *fiber.Ctx) error {
return c.Next()
},
ErrorHandler: func(c *fiber.Ctx, err error) error {
if err == ErrMissingOrMalformedAPIKey {
return c.Status(fiber.StatusUnauthorized).SendString(err.Error())
}
return c.Status(fiber.StatusUnauthorized).SendString("Invalid or expired API Key")
},
KeyLookup: "header:" + fiber.HeaderAuthorization,
AuthScheme: "Bearer",
ContextKey: "token",
}
- - +
Skip to main content
Version: v2.x

Keyauth

Key auth middleware provides a key based authentication.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
)

var (
apiKey = "correct horse battery staple"
)

func validateAPIKey(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
}

func main() {
app := fiber.New()

// note that the keyauth middleware needs to be defined before the routes are defined!
app.Use(keyauth.New(keyauth.Config{
KeyLookup: "cookie:access_token",
Validator: validateAPIKey,
}))

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})

app.Listen(":3000")
}

Test:

# No api-key specified -> 400 missing 
curl http://localhost:3000
#> missing or malformed API Key

curl --cookie "access_token=correct horse battery staple" http://localhost:3000
#> Successfully authenticated!

curl --cookie "access_token=Clearly A Wrong Key" http://localhost:3000
#> missing or malformed API Key

For a more detailed example, see also the github.com/gofiber/recipes repository and specifically the fiber-envoy-extauthz repository and the keyauth example code.

Authenticate only certain endpoints​

If you want to authenticate only certain endpoints, you can use the Config of keyauth and apply a filter function (eg. authFilter) like so

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
"regexp"
"strings"
)

var (
apiKey = "correct horse battery staple"
protectedURLs = []*regexp.Regexp{
regexp.MustCompile("^/authenticated$"),
regexp.MustCompile("^/auth2$"),
}
)

func validateAPIKey(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
}

func authFilter(c *fiber.Ctx) bool {
originalURL := strings.ToLower(c.OriginalURL())

for _, pattern := range protectedURLs {
if pattern.MatchString(originalURL) {
return false
}
}
return true
}

func main() {
app := fiber.New()

app.Use(keyauth.New(keyauth.Config{
Next: authFilter,
KeyLookup: "cookie:access_token",
Validator: validateAPIKey,
}))

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome")
})
app.Get("/authenticated", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})
app.Get("/auth2", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated 2!")
})

app.Listen(":3000")
}

Which results in this

# / does not need to be authenticated
curl http://localhost:3000
#> Welcome

# /authenticated needs to be authenticated
curl --cookie "access_token=correct horse battery staple" http://localhost:3000/authenticated
#> Successfully authenticated!

# /auth2 needs to be authenticated too
curl --cookie "access_token=correct horse battery staple" http://localhost:3000/auth2
#> Successfully authenticated 2!

Specifying middleware in the handler​

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
)

const (
apiKey = "my-super-secret-key"
)

func main() {
app := fiber.New()

authMiddleware := keyauth.New(keyauth.Config{
Validator: func(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
},
})

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome")
})

app.Get("/allowed", authMiddleware, func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})

app.Listen(":3000")
}

Which results in this

# / does not need to be authenticated
curl http://localhost:3000
#> Welcome

# /allowed needs to be authenticated too
curl --header "Authorization: Bearer my-super-secret-key" http://localhost:3000/allowed
#> Successfully authenticated!

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// SuccessHandler defines a function which is executed for a valid key.
// Optional. Default: nil
SuccessHandler fiber.Handler

// ErrorHandler defines a function which is executed for an invalid key.
// It may be used to define a custom error.
// Optional. Default: 401 Invalid or expired key
ErrorHandler fiber.ErrorHandler

// KeyLookup is a string in the form of "<source>:<name>" that is used
// to extract key from the request.
// Optional. Default value "header:Authorization".
// Possible values:
// - "header:<name>"
// - "query:<name>"
// - "form:<name>"
// - "param:<name>"
// - "cookie:<name>"
KeyLookup string

// AuthScheme to be used in the Authorization header.
// Optional. Default value "Bearer".
AuthScheme string

// Validator is a function to validate key.
Validator func(*fiber.Ctx, string) (bool, error)

// Context key to store the bearertoken from the token into context.
// Optional. Default: "token".
ContextKey string
}

Default Config​

var ConfigDefault = Config{
SuccessHandler: func(c *fiber.Ctx) error {
return c.Next()
},
ErrorHandler: func(c *fiber.Ctx, err error) error {
if err == ErrMissingOrMalformedAPIKey {
return c.Status(fiber.StatusUnauthorized).SendString(err.Error())
}
return c.Status(fiber.StatusUnauthorized).SendString("Invalid or expired API Key")
},
KeyLookup: "header:" + fiber.HeaderAuthorization,
AuthScheme: "Bearer",
ContextKey: "token",
}
+ + \ No newline at end of file diff --git a/api/middleware/limiter/index.html b/api/middleware/limiter/index.html index 137a0a43c53..aada3cb473f 100644 --- a/api/middleware/limiter/index.html +++ b/api/middleware/limiter/index.html @@ -6,13 +6,13 @@ Limiter | Fiber - - + +
-
Skip to main content
Version: v2.x

Limiter

Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

note

This module does not share state with other processes/servers by default.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/limiter"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(limiter.New())

// Or extend your config for customization
app.Use(limiter.New(limiter.Config{
Next: func(c *fiber.Ctx) bool {
return c.IP() == "127.0.0.1"
},
Max: 20,
Expiration: 30 * time.Second,
KeyGenerator: func(c *fiber.Ctx) string {
return c.Get("x-forwarded-for")
},
LimitReached: func(c *fiber.Ctx) error {
return c.SendFile("./toofast.html")
},
Storage: myCustomStorage{},
}))

Sliding window​

Instead of using the standard fixed window algorithm, you can enable the sliding window algorithm.

A example of such configuration is:

app.Use(limiter.New(limiter.Config{
Max: 20,
Expiration: 30 * time.Second,
LimiterMiddleware: limiter.SlidingWindow{},
}))

This means that every window will take into account the previous window(if there was any). The given formula for the rate is:

weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration)
rate = weightOfPreviousWindpw + current window's amount request.

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Max number of recent connections during `Duration` seconds before sending a 429 response
//
// Default: 5
Max int

// KeyGenerator allows you to generate custom keys, by default c.IP() is used
//
// Default: func(c *fiber.Ctx) string {
// return c.IP()
// }
KeyGenerator func(*fiber.Ctx) string

// Expiration is the time on how long to keep records of requests in memory
//
// Default: 1 * time.Minute
Expiration time.Duration

// LimitReached is called when a request hits the limit
//
// Default: func(c *fiber.Ctx) error {
// return c.SendStatus(fiber.StatusTooManyRequests)
// }
LimitReached fiber.Handler

// When set to true, requests with StatusCode >= 400 won't be counted.
//
// Default: false
SkipFailedRequests bool

// When set to true, requests with StatusCode < 400 won't be counted.
//
// Default: false
SkipSuccessfulRequests bool

// Store is used to store the state of the middleware
//
// Default: an in memory store for this process only
Storage fiber.Storage

// LimiterMiddleware is the struct that implements limiter middleware.
//
// Default: a new Fixed Window Rate Limiter
LimiterMiddleware LimiterHandler
}
note

A custom store can be used if it implements the Storage interface - more details and an example can be found in store.go.

Default Config​

var ConfigDefault = Config{
Max: 5,
Expiration: 1 * time.Minute,
KeyGenerator: func(c *fiber.Ctx) string {
return c.IP()
},
LimitReached: func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusTooManyRequests)
},
SkipFailedRequests: false,
SkipSuccessfulRequests: false,
LimiterMiddleware: FixedWindow{},
}

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
app.Use(limiter.New(limiter.Config{
Storage: storage,
}))
- - +
Skip to main content
Version: v2.x

Limiter

Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

note

This module does not share state with other processes/servers by default.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/limiter"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(limiter.New())

// Or extend your config for customization
app.Use(limiter.New(limiter.Config{
Next: func(c *fiber.Ctx) bool {
return c.IP() == "127.0.0.1"
},
Max: 20,
Expiration: 30 * time.Second,
KeyGenerator: func(c *fiber.Ctx) string {
return c.Get("x-forwarded-for")
},
LimitReached: func(c *fiber.Ctx) error {
return c.SendFile("./toofast.html")
},
Storage: myCustomStorage{},
}))

Sliding window​

Instead of using the standard fixed window algorithm, you can enable the sliding window algorithm.

A example of such configuration is:

app.Use(limiter.New(limiter.Config{
Max: 20,
Expiration: 30 * time.Second,
LimiterMiddleware: limiter.SlidingWindow{},
}))

This means that every window will take into account the previous window(if there was any). The given formula for the rate is:

weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration)
rate = weightOfPreviousWindpw + current window's amount request.

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Max number of recent connections during `Duration` seconds before sending a 429 response
//
// Default: 5
Max int

// KeyGenerator allows you to generate custom keys, by default c.IP() is used
//
// Default: func(c *fiber.Ctx) string {
// return c.IP()
// }
KeyGenerator func(*fiber.Ctx) string

// Expiration is the time on how long to keep records of requests in memory
//
// Default: 1 * time.Minute
Expiration time.Duration

// LimitReached is called when a request hits the limit
//
// Default: func(c *fiber.Ctx) error {
// return c.SendStatus(fiber.StatusTooManyRequests)
// }
LimitReached fiber.Handler

// When set to true, requests with StatusCode >= 400 won't be counted.
//
// Default: false
SkipFailedRequests bool

// When set to true, requests with StatusCode < 400 won't be counted.
//
// Default: false
SkipSuccessfulRequests bool

// Store is used to store the state of the middleware
//
// Default: an in memory store for this process only
Storage fiber.Storage

// LimiterMiddleware is the struct that implements limiter middleware.
//
// Default: a new Fixed Window Rate Limiter
LimiterMiddleware LimiterHandler
}
note

A custom store can be used if it implements the Storage interface - more details and an example can be found in store.go.

Default Config​

var ConfigDefault = Config{
Max: 5,
Expiration: 1 * time.Minute,
KeyGenerator: func(c *fiber.Ctx) string {
return c.IP()
},
LimitReached: func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusTooManyRequests)
},
SkipFailedRequests: false,
SkipSuccessfulRequests: false,
LimiterMiddleware: FixedWindow{},
}

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
app.Use(limiter.New(limiter.Config{
Storage: storage,
}))
+ + \ No newline at end of file diff --git a/api/middleware/logger/index.html b/api/middleware/logger/index.html index 331b1eb71db..811502b3fdf 100644 --- a/api/middleware/logger/index.html +++ b/api/middleware/logger/index.html @@ -6,14 +6,14 @@ Logger | Fiber - - + +
Skip to main content
Version: v2.x

Logger

Logger middleware for Fiber that logs HTTP request/response details.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
)
tip

The order of registration plays a role. Only all routes that are registered after this one will be logged. -The middleware should therefore be one of the first to be registered.

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(logger.New())

// Or extend your config for customization
// Logging remote IP and Port
app.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))

// Logging Request ID
app.Use(requestid.New())
app.Use(logger.New(logger.Config{
// For more options, see the Config section
Format: "${pid} ${locals:requestid} ${status} - ${method} ${path}​\n",
}))

// Changing TimeZone & TimeFormat
app.Use(logger.New(logger.Config{
Format: "${pid} ${status} - ${method} ${path}\n",
TimeFormat: "02-Jan-2006",
TimeZone: "America/New_York",
}))

// Custom File Writer
file, err := os.OpenFile("./123.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
log.Fatalf("error opening file: %v", err)
}
defer file.Close()
app.Use(logger.New(logger.Config{
Output: file,
}))

// Add Custom Tags
app.Use(logger.New(logger.Config{
CustomTags: map[string]logger.LogFunc{
"custom_tag": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) {
return output.WriteString("it is a custom tag")
},
},
}))

// Callback after log is written
app.Use(logger.New(logger.Config{
TimeFormat: time.RFC3339Nano,
TimeZone: "Asia/Shanghai",
Done: func(c *fiber.Ctx, logString []byte) {
if c.Response().StatusCode() != fiber.StatusOK {
reporter.SendToSlack(logString)
}
},
}))

// Disable colors when outputting to default format
app.Use(logger.New(logger.Config{
DisableColors: true,
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Done is a function that is called after the log string for a request is written to Output,
// and pass the log string as parameter.
//
// Optional. Default: nil
Done func(c *fiber.Ctx, logString []byte)

// tagFunctions defines the custom tag action
//
// Optional. Default: map[string]LogFunc
CustomTags map[string]LogFunc

// Format defines the logging tags
//
// Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\n
Format string

// TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html
//
// Optional. Default: 15:04:05
TimeFormat string

// TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc
//
// Optional. Default: "Local"
TimeZone string

// TimeInterval is the delay before the timestamp is updated
//
// Optional. Default: 500 * time.Millisecond
TimeInterval time.Duration

// Output is a writer where logs are written
//
// Default: os.Stdout
Output io.Writer

// DisableColors defines if the logs output should be colorized
//
// Default: false
DisableColors bool

enableColors bool
enableLatency bool
timeZoneLocation *time.Location
}
type LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)

Default Config​

var ConfigDefault = Config{
Next: nil,
Done: nil,
Format: "[${time}] ${status} - ${latency} ${method} ${path}\n",
TimeFormat: "15:04:05",
TimeZone: "Local",
TimeInterval: 500 * time.Millisecond,
Output: os.Stdout,
DisableColors: true,
}

Constants​

// Logger variables
const (
TagPid = "pid"
TagTime = "time"
TagReferer = "referer"
TagProtocol = "protocol"
TagPort = "port"
TagIP = "ip"
TagIPs = "ips"
TagHost = "host"
TagMethod = "method"
TagPath = "path"
TagURL = "url"
TagUA = "ua"
TagLatency = "latency"
TagStatus = "status" // response status
TagResBody = "resBody" // response body
TagReqHeaders = "reqHeaders"
TagQueryStringParams = "queryParams" // request query parameters
TagBody = "body" // request body
TagBytesSent = "bytesSent"
TagBytesReceived = "bytesReceived"
TagRoute = "route"
TagError = "error"
// DEPRECATED: Use TagReqHeader instead
TagHeader = "header:" // request header
TagReqHeader = "reqHeader:" // request header
TagRespHeader = "respHeader:" // response header
TagQuery = "query:" // request query
TagForm = "form:" // request form
TagCookie = "cookie:" // request cookie
TagLocals = "locals:"
// colors
TagBlack = "black"
TagRed = "red"
TagGreen = "green"
TagYellow = "yellow"
TagBlue = "blue"
TagMagenta = "magenta"
TagCyan = "cyan"
TagWhite = "white"
TagReset = "reset"
)
- - +The middleware should therefore be one of the first to be registered.

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(logger.New())

// Or extend your config for customization
// Logging remote IP and Port
app.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))

// Logging Request ID
app.Use(requestid.New())
app.Use(logger.New(logger.Config{
// For more options, see the Config section
Format: "${pid} ${locals:requestid} ${status} - ${method} ${path}​\n",
}))

// Changing TimeZone & TimeFormat
app.Use(logger.New(logger.Config{
Format: "${pid} ${status} - ${method} ${path}\n",
TimeFormat: "02-Jan-2006",
TimeZone: "America/New_York",
}))

// Custom File Writer
file, err := os.OpenFile("./123.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
log.Fatalf("error opening file: %v", err)
}
defer file.Close()
app.Use(logger.New(logger.Config{
Output: file,
}))

// Add Custom Tags
app.Use(logger.New(logger.Config{
CustomTags: map[string]logger.LogFunc{
"custom_tag": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) {
return output.WriteString("it is a custom tag")
},
},
}))

// Callback after log is written
app.Use(logger.New(logger.Config{
TimeFormat: time.RFC3339Nano,
TimeZone: "Asia/Shanghai",
Done: func(c *fiber.Ctx, logString []byte) {
if c.Response().StatusCode() != fiber.StatusOK {
reporter.SendToSlack(logString)
}
},
}))

// Disable colors when outputting to default format
app.Use(logger.New(logger.Config{
DisableColors: true,
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Done is a function that is called after the log string for a request is written to Output,
// and pass the log string as parameter.
//
// Optional. Default: nil
Done func(c *fiber.Ctx, logString []byte)

// tagFunctions defines the custom tag action
//
// Optional. Default: map[string]LogFunc
CustomTags map[string]LogFunc

// Format defines the logging tags
//
// Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\n
Format string

// TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html
//
// Optional. Default: 15:04:05
TimeFormat string

// TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc
//
// Optional. Default: "Local"
TimeZone string

// TimeInterval is the delay before the timestamp is updated
//
// Optional. Default: 500 * time.Millisecond
TimeInterval time.Duration

// Output is a writer where logs are written
//
// Default: os.Stdout
Output io.Writer

// DisableColors defines if the logs output should be colorized
//
// Default: false
DisableColors bool

enableColors bool
enableLatency bool
timeZoneLocation *time.Location
}
type LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)

Default Config​

var ConfigDefault = Config{
Next: nil,
Done: nil,
Format: "[${time}] ${status} - ${latency} ${method} ${path}\n",
TimeFormat: "15:04:05",
TimeZone: "Local",
TimeInterval: 500 * time.Millisecond,
Output: os.Stdout,
DisableColors: true,
}

Constants​

// Logger variables
const (
TagPid = "pid"
TagTime = "time"
TagReferer = "referer"
TagProtocol = "protocol"
TagPort = "port"
TagIP = "ip"
TagIPs = "ips"
TagHost = "host"
TagMethod = "method"
TagPath = "path"
TagURL = "url"
TagUA = "ua"
TagLatency = "latency"
TagStatus = "status" // response status
TagResBody = "resBody" // response body
TagReqHeaders = "reqHeaders"
TagQueryStringParams = "queryParams" // request query parameters
TagBody = "body" // request body
TagBytesSent = "bytesSent"
TagBytesReceived = "bytesReceived"
TagRoute = "route"
TagError = "error"
// DEPRECATED: Use TagReqHeader instead
TagHeader = "header:" // request header
TagReqHeader = "reqHeader:" // request header
TagRespHeader = "respHeader:" // response header
TagQuery = "query:" // request query
TagForm = "form:" // request form
TagCookie = "cookie:" // request cookie
TagLocals = "locals:"
// colors
TagBlack = "black"
TagRed = "red"
TagGreen = "green"
TagYellow = "yellow"
TagBlue = "blue"
TagMagenta = "magenta"
TagCyan = "cyan"
TagWhite = "white"
TagReset = "reset"
)
+ + \ No newline at end of file diff --git a/api/middleware/monitor/index.html b/api/middleware/monitor/index.html index 2ead77fc51a..9593f6407c7 100644 --- a/api/middleware/monitor/index.html +++ b/api/middleware/monitor/index.html @@ -6,14 +6,14 @@ Monitor | Fiber - - + +
Skip to main content
Version: v2.x

Monitor

Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor

caution

Monitor is still in beta, API might change in the future!

Signatures​

func New() fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/monitor"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config (Assign the middleware to /metrics)
app.Get("/metrics", monitor.New())

// Or extend your config for customization
// Assign the middleware to /metrics
// and change the Title to `MyService Metrics Page`
app.Get("/metrics", monitor.New(monitor.Config{Title: "MyService Metrics Page"}))

You can also access the API endpoint with -curl -X GET -H "Accept: application/json" http://localhost:3000/metrics which returns:

{"pid":{ "cpu":0.4568381746582226, "ram":20516864,   "conns":3 },
"os": { "cpu":8.759124087593099, "ram":3997155328, "conns":44,
"total_ram":8245489664, "load_avg":0.51 }}

Config​

// Config defines the config for middleware.
type Config struct {
// Metrics page title
//
// Optional. Default: "Fiber Monitor"
Title string

// Refresh period
//
// Optional. Default: 3 seconds
Refresh time.Duration

// Whether the service should expose only the monitoring API.
//
// Optional. Default: false
APIOnly bool

// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Custom HTML Code to Head Section(Before End)
//
// Optional. Default: empty
CustomHead string

// FontURL for specify font resource path or URL . also you can use relative path
//
// Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap
FontURL string

// ChartJsURL for specify ChartJS library path or URL . also you can use relative path
//
// Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js
ChartJsURL string

index string
}

Default Config​

var ConfigDefault = Config{
Title: defaultTitle,
Refresh: defaultRefresh,
FontURL: defaultFontURL,
ChartJsURL: defaultChartJSURL,
CustomHead: defaultCustomHead,
APIOnly: false,
Next: nil,
index: newIndex(viewBag{
defaultTitle,
defaultRefresh,
defaultFontURL,
defaultChartJSURL,
defaultCustomHead,
}),
}
- - +curl -X GET -H "Accept: application/json" http://localhost:3000/metrics which returns:

{"pid":{ "cpu":0.4568381746582226, "ram":20516864,   "conns":3 },
"os": { "cpu":8.759124087593099, "ram":3997155328, "conns":44,
"total_ram":8245489664, "load_avg":0.51 }}

Config​

// Config defines the config for middleware.
type Config struct {
// Metrics page title
//
// Optional. Default: "Fiber Monitor"
Title string

// Refresh period
//
// Optional. Default: 3 seconds
Refresh time.Duration

// Whether the service should expose only the monitoring API.
//
// Optional. Default: false
APIOnly bool

// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Custom HTML Code to Head Section(Before End)
//
// Optional. Default: empty
CustomHead string

// FontURL for specify font resource path or URL . also you can use relative path
//
// Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap
FontURL string

// ChartJsURL for specify ChartJS library path or URL . also you can use relative path
//
// Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js
ChartJsURL string

index string
}

Default Config​

var ConfigDefault = Config{
Title: defaultTitle,
Refresh: defaultRefresh,
FontURL: defaultFontURL,
ChartJsURL: defaultChartJSURL,
CustomHead: defaultCustomHead,
APIOnly: false,
Next: nil,
index: newIndex(viewBag{
defaultTitle,
defaultRefresh,
defaultFontURL,
defaultChartJSURL,
defaultCustomHead,
}),
}
+ + \ No newline at end of file diff --git a/api/middleware/pprof/index.html b/api/middleware/pprof/index.html index 0a88d650b30..647aafd53d9 100644 --- a/api/middleware/pprof/index.html +++ b/api/middleware/pprof/index.html @@ -6,13 +6,13 @@ Pprof | Fiber - - + +
-
Skip to main content
Version: v2.x

Pprof

Pprof middleware for Fiber that serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/.

Signatures​

func New() fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/pprof"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(pprof.New())

// Or extend your config for customization

// For example, in systems where you have multiple ingress endpoints, it is common to add a URL prefix, like so:
app.Use(pprof.New(pprof.Config{Prefix: "/endpoint-prefix"}))

// This prefix will be added to the default path of "/debug/pprof/", for a resulting URL of: "/endpoint-prefix/debug/pprof/".

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Prefix defines a URL prefix added before "/debug/pprof".
// Note that it should start with (but not end with) a slash.
// Example: "/federated-fiber"
//
// Optional. Default: ""
Prefix string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
}
- - +
Skip to main content
Version: v2.x

Pprof

Pprof middleware for Fiber that serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/.

Signatures​

func New() fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/pprof"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(pprof.New())

// Or extend your config for customization

// For example, in systems where you have multiple ingress endpoints, it is common to add a URL prefix, like so:
app.Use(pprof.New(pprof.Config{Prefix: "/endpoint-prefix"}))

// This prefix will be added to the default path of "/debug/pprof/", for a resulting URL of: "/endpoint-prefix/debug/pprof/".

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Prefix defines a URL prefix added before "/debug/pprof".
// Note that it should start with (but not end with) a slash.
// Example: "/federated-fiber"
//
// Optional. Default: ""
Prefix string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
}
+ + \ No newline at end of file diff --git a/api/middleware/proxy/index.html b/api/middleware/proxy/index.html index 13cd17ca4cf..2341086b0ec 100644 --- a/api/middleware/proxy/index.html +++ b/api/middleware/proxy/index.html @@ -6,13 +6,13 @@ Proxy | Fiber - - + +
-
Skip to main content
Version: v2.x

Proxy

Proxy middleware for Fiber that allows you to proxy requests to multiple servers.

Signatures​

// Balancer create a load balancer among multiple upstrem servers.
func Balancer(config Config) fiber.Handler
// Forward performs the given http request and fills the given http response.
func Forward(addr string, clients ...*fasthttp.Client) fiber.Handler
// Do performs the given http request and fills the given http response.
func Do(c *fiber.Ctx, addr string, clients ...*fasthttp.Client) error
// DoRedirects performs the given http request and fills the given http response while following up to maxRedirectsCount redirects.
func DoRedirects(c *fiber.Ctx, addr string, maxRedirectsCount int, clients ...*fasthttp.Client) error
// DoDeadline performs the given request and waits for response until the given deadline.
func DoDeadline(c *fiber.Ctx, addr string, deadline time.Time, clients ...*fasthttp.Client) error
// DoTimeout performs the given request and waits for response during the given timeout duration.
func DoTimeout(c *fiber.Ctx, addr string, timeout time.Duration, clients ...*fasthttp.Client) error
// DomainForward the given http request based on the given domain and fills the given http response
func DomainForward(hostname string, addr string, clients ...*fasthttp.Client) fiber.Handler
// BalancerForward performs the given http request based round robin balancer and fills the given http response
func BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/proxy"
)

After you initiate your Fiber app, you can use the following possibilities:

// if target https site uses a self-signed certificate, you should
// call WithTlsConfig before Do and Forward
proxy.WithTlsConfig(&tls.Config{
InsecureSkipVerify: true,
})
// if you need to use global self-custom client, you should use proxy.WithClient.
proxy.WithClient(&fasthttp.Client{
NoDefaultUserAgentHeader: true,
DisablePathNormalizing: true,
})

// Forward to url
app.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif"))

// If you want to forward with a specific domain. You have to use proxy.DomainForward.
app.Get("/payments", proxy.DomainForward("docs.gofiber.io", "http://localhost:8000"))

// Forward to url with local custom client
app.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif", &fasthttp.Client{
NoDefaultUserAgentHeader: true,
DisablePathNormalizing: true,
}))

// Make request within handler
app.Get("/:id", func(c *fiber.Ctx) error {
url := "https://i.imgur.com/"+c.Params("id")+".gif"
if err := proxy.Do(c, url); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests while following redirects
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoRedirects(c, "http://google.com", 3); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests and wait up to 5 seconds before timing out
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoTimeout(c, "http://localhost:3000", time.Second * 5); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests, timeout a minute from now
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoDeadline(c, "http://localhost", time.Now().Add(time.Minute)); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Minimal round robin balancer
app.Use(proxy.Balancer(proxy.Config{
Servers: []string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
},
}))

// Or extend your balancer for customization
app.Use(proxy.Balancer(proxy.Config{
Servers: []string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
},
ModifyRequest: func(c *fiber.Ctx) error {
c.Request().Header.Add("X-Real-IP", c.IP())
return nil
},
ModifyResponse: func(c *fiber.Ctx) error {
c.Response().Header.Del(fiber.HeaderServer)
return nil
},
}))

// Or this way if the balancer is using https and the destination server is only using http.
app.Use(proxy.BalancerForward([]string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Servers defines a list of <scheme>://<host> HTTP servers,
//
// which are used in a round-robin manner.
// i.e.: "https://foobar.com, http://www.foobar.com"
//
// Required
Servers []string

// ModifyRequest allows you to alter the request
//
// Optional. Default: nil
ModifyRequest fiber.Handler

// ModifyResponse allows you to alter the response
//
// Optional. Default: nil
ModifyResponse fiber.Handler

// Timeout is the request timeout used when calling the proxy client
//
// Optional. Default: 1 second
Timeout time.Duration

// Per-connection buffer size for requests' reading.
// This also limits the maximum header size.
// Increase this buffer if your clients send multi-KB RequestURIs
// and/or multi-KB headers (for example, BIG cookies).
ReadBufferSize int

// Per-connection buffer size for responses' writing.
WriteBufferSize int

// tls config for the http client.
TlsConfig *tls.Config

// Client is custom client when client config is complex.
// Note that Servers, Timeout, WriteBufferSize, ReadBufferSize and TlsConfig
// will not be used if the client are set.
Client *fasthttp.LBClient
}

Default Config​

var ConfigDefault = Config{
Next: nil,
ModifyRequest: nil,
ModifyResponse: nil,
Timeout: fasthttp.DefaultLBClientTimeout,
}
- - +
Skip to main content
Version: v2.x

Proxy

Proxy middleware for Fiber that allows you to proxy requests to multiple servers.

Signatures​

// Balancer create a load balancer among multiple upstrem servers.
func Balancer(config Config) fiber.Handler
// Forward performs the given http request and fills the given http response.
func Forward(addr string, clients ...*fasthttp.Client) fiber.Handler
// Do performs the given http request and fills the given http response.
func Do(c *fiber.Ctx, addr string, clients ...*fasthttp.Client) error
// DoRedirects performs the given http request and fills the given http response while following up to maxRedirectsCount redirects.
func DoRedirects(c *fiber.Ctx, addr string, maxRedirectsCount int, clients ...*fasthttp.Client) error
// DoDeadline performs the given request and waits for response until the given deadline.
func DoDeadline(c *fiber.Ctx, addr string, deadline time.Time, clients ...*fasthttp.Client) error
// DoTimeout performs the given request and waits for response during the given timeout duration.
func DoTimeout(c *fiber.Ctx, addr string, timeout time.Duration, clients ...*fasthttp.Client) error
// DomainForward the given http request based on the given domain and fills the given http response
func DomainForward(hostname string, addr string, clients ...*fasthttp.Client) fiber.Handler
// BalancerForward performs the given http request based round robin balancer and fills the given http response
func BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/proxy"
)

After you initiate your Fiber app, you can use the following possibilities:

// if target https site uses a self-signed certificate, you should
// call WithTlsConfig before Do and Forward
proxy.WithTlsConfig(&tls.Config{
InsecureSkipVerify: true,
})
// if you need to use global self-custom client, you should use proxy.WithClient.
proxy.WithClient(&fasthttp.Client{
NoDefaultUserAgentHeader: true,
DisablePathNormalizing: true,
})

// Forward to url
app.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif"))

// If you want to forward with a specific domain. You have to use proxy.DomainForward.
app.Get("/payments", proxy.DomainForward("docs.gofiber.io", "http://localhost:8000"))

// Forward to url with local custom client
app.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif", &fasthttp.Client{
NoDefaultUserAgentHeader: true,
DisablePathNormalizing: true,
}))

// Make request within handler
app.Get("/:id", func(c *fiber.Ctx) error {
url := "https://i.imgur.com/"+c.Params("id")+".gif"
if err := proxy.Do(c, url); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests while following redirects
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoRedirects(c, "http://google.com", 3); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests and wait up to 5 seconds before timing out
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoTimeout(c, "http://localhost:3000", time.Second * 5); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests, timeout a minute from now
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoDeadline(c, "http://localhost", time.Now().Add(time.Minute)); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Minimal round robin balancer
app.Use(proxy.Balancer(proxy.Config{
Servers: []string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
},
}))

// Or extend your balancer for customization
app.Use(proxy.Balancer(proxy.Config{
Servers: []string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
},
ModifyRequest: func(c *fiber.Ctx) error {
c.Request().Header.Add("X-Real-IP", c.IP())
return nil
},
ModifyResponse: func(c *fiber.Ctx) error {
c.Response().Header.Del(fiber.HeaderServer)
return nil
},
}))

// Or this way if the balancer is using https and the destination server is only using http.
app.Use(proxy.BalancerForward([]string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Servers defines a list of <scheme>://<host> HTTP servers,
//
// which are used in a round-robin manner.
// i.e.: "https://foobar.com, http://www.foobar.com"
//
// Required
Servers []string

// ModifyRequest allows you to alter the request
//
// Optional. Default: nil
ModifyRequest fiber.Handler

// ModifyResponse allows you to alter the response
//
// Optional. Default: nil
ModifyResponse fiber.Handler

// Timeout is the request timeout used when calling the proxy client
//
// Optional. Default: 1 second
Timeout time.Duration

// Per-connection buffer size for requests' reading.
// This also limits the maximum header size.
// Increase this buffer if your clients send multi-KB RequestURIs
// and/or multi-KB headers (for example, BIG cookies).
ReadBufferSize int

// Per-connection buffer size for responses' writing.
WriteBufferSize int

// tls config for the http client.
TlsConfig *tls.Config

// Client is custom client when client config is complex.
// Note that Servers, Timeout, WriteBufferSize, ReadBufferSize and TlsConfig
// will not be used if the client are set.
Client *fasthttp.LBClient
}

Default Config​

var ConfigDefault = Config{
Next: nil,
ModifyRequest: nil,
ModifyResponse: nil,
Timeout: fasthttp.DefaultLBClientTimeout,
}
+ + \ No newline at end of file diff --git a/api/middleware/recover/index.html b/api/middleware/recover/index.html index 61f0174b09c..14cd2d488d3 100644 --- a/api/middleware/recover/index.html +++ b/api/middleware/recover/index.html @@ -6,13 +6,13 @@ Recover | Fiber - - + +
-
Skip to main content
Version: v2.x

Recover

Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(recover.New())

// This panic will be caught by the middleware
app.Get("/", func(c *fiber.Ctx) error {
panic("I'm an error")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// EnableStackTrace enables handling stack trace
//
// Optional. Default: false
EnableStackTrace bool

// StackTraceHandler defines a function to handle stack trace
//
// Optional. Default: defaultStackTraceHandler
StackTraceHandler func(c *fiber.Ctx, e interface{})
}

Default Config​

var ConfigDefault = Config{
Next: nil,
EnableStackTrace: false,
StackTraceHandler: defaultStackTraceHandler,
}
- - +
Skip to main content
Version: v2.x

Recover

Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(recover.New())

// This panic will be caught by the middleware
app.Get("/", func(c *fiber.Ctx) error {
panic("I'm an error")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// EnableStackTrace enables handling stack trace
//
// Optional. Default: false
EnableStackTrace bool

// StackTraceHandler defines a function to handle stack trace
//
// Optional. Default: defaultStackTraceHandler
StackTraceHandler func(c *fiber.Ctx, e interface{})
}

Default Config​

var ConfigDefault = Config{
Next: nil,
EnableStackTrace: false,
StackTraceHandler: defaultStackTraceHandler,
}
+ + \ No newline at end of file diff --git a/api/middleware/redirect/index.html b/api/middleware/redirect/index.html index d86891b693d..d95ff43232f 100644 --- a/api/middleware/redirect/index.html +++ b/api/middleware/redirect/index.html @@ -6,13 +6,13 @@ Redirect | Fiber - - + +
-
Skip to main content
Version: v2.x

Redirect

Redirection middleware for Fiber.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/redirect"
)

func main() {
app := fiber.New()

app.Use(redirect.New(redirect.Config{
Rules: map[string]string{
"/old": "/new",
"/old/*": "/new/$1",
},
StatusCode: 301,
}))

app.Get("/new", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})
app.Get("/new/*", func(c *fiber.Ctx) error {
return c.SendString("Wildcard: " + c.Params("*"))
})

app.Listen(":3000")
}

Test:

curl http://localhost:3000/old
curl http://localhost:3000/old/hello

Config​

// Config defines the config for middleware.
type Config struct {
// Filter defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// Rules defines the URL path rewrite rules. The values captured in asterisk can be
// retrieved by index e.g. $1, $2 and so on.
// Required. Example:
// "/old": "/new",
// "/api/*": "/$1",
// "/js/*": "/public/javascripts/$1",
// "/users/*/orders/*": "/user/$1/order/$2",
Rules map[string]string

// The status code when redirecting
// This is ignored if Redirect is disabled
// Optional. Default: 302 (fiber.StatusFound)
StatusCode int

rulesRegex map[*regexp.Regexp]string
}

Default Config​

var ConfigDefault = Config{
StatusCode: fiber.StatusFound,
}
- - +
Skip to main content
Version: v2.x

Redirect

Redirection middleware for Fiber.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/redirect"
)

func main() {
app := fiber.New()

app.Use(redirect.New(redirect.Config{
Rules: map[string]string{
"/old": "/new",
"/old/*": "/new/$1",
},
StatusCode: 301,
}))

app.Get("/new", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})
app.Get("/new/*", func(c *fiber.Ctx) error {
return c.SendString("Wildcard: " + c.Params("*"))
})

app.Listen(":3000")
}

Test:

curl http://localhost:3000/old
curl http://localhost:3000/old/hello

Config​

// Config defines the config for middleware.
type Config struct {
// Filter defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// Rules defines the URL path rewrite rules. The values captured in asterisk can be
// retrieved by index e.g. $1, $2 and so on.
// Required. Example:
// "/old": "/new",
// "/api/*": "/$1",
// "/js/*": "/public/javascripts/$1",
// "/users/*/orders/*": "/user/$1/order/$2",
Rules map[string]string

// The status code when redirecting
// This is ignored if Redirect is disabled
// Optional. Default: 302 (fiber.StatusFound)
StatusCode int

rulesRegex map[*regexp.Regexp]string
}

Default Config​

var ConfigDefault = Config{
StatusCode: fiber.StatusFound,
}
+ + \ No newline at end of file diff --git a/api/middleware/requestid/index.html b/api/middleware/requestid/index.html index 9ba01540963..865d21235c0 100644 --- a/api/middleware/requestid/index.html +++ b/api/middleware/requestid/index.html @@ -6,15 +6,15 @@ RequestID | Fiber - - + +
Skip to main content
Version: v2.x

RequestID

RequestID middleware for Fiber that adds an indentifier to the response.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/requestid"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(requestid.New())

// Or extend your config for customization
app.Use(requestid.New(requestid.Config{
Header: "X-Custom-Header",
Generator: func() string {
return "static-id"
},
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Header is the header key where to get/set the unique request ID
//
// Optional. Default: "X-Request-ID"
Header string

// Generator defines a function to generate the unique identifier.
//
// Optional. Default: utils.UUID
Generator func() string

// ContextKey defines the key used when storing the request ID in
// the locals for a specific request.
//
// Optional. Default: requestid
ContextKey interface{}
}

Default Config​

The default config uses a fast UUID generator which will expose the number of requests made to the server. To conceal this value for better privacy, use the -utils.UUIDv4 generator.

var ConfigDefault = Config{
Next: nil,
Header: fiber.HeaderXRequestID,
Generator: utils.UUID,
ContextKey: "requestid",
}
- - +utils.UUIDv4 generator.

var ConfigDefault = Config{
Next: nil,
Header: fiber.HeaderXRequestID,
Generator: utils.UUID,
ContextKey: "requestid",
}
+ + \ No newline at end of file diff --git a/api/middleware/rewrite/index.html b/api/middleware/rewrite/index.html index 33900117d41..19ac9206c59 100644 --- a/api/middleware/rewrite/index.html +++ b/api/middleware/rewrite/index.html @@ -6,13 +6,13 @@ Rewrite | Fiber - - + +
-
Skip to main content
Version: v2.x

Rewrite

Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/rewrite"
)

func main() {
app := fiber.New()

app.Use(rewrite.New(rewrite.Config{
Rules: map[string]string{
"/old": "/new",
"/old/*": "/new/$1",
},
}))

app.Get("/new", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})
app.Get("/new/*", func(c *fiber.Ctx) error {
return c.SendString("Wildcard: " + c.Params("*"))
})

app.Listen(":3000")
}

Test:

curl http://localhost:3000/old
curl http://localhost:3000/old/hello
- - +
Skip to main content
Version: v2.x

Rewrite

Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/rewrite"
)

func main() {
app := fiber.New()

app.Use(rewrite.New(rewrite.Config{
Rules: map[string]string{
"/old": "/new",
"/old/*": "/new/$1",
},
}))

app.Get("/new", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})
app.Get("/new/*", func(c *fiber.Ctx) error {
return c.SendString("Wildcard: " + c.Params("*"))
})

app.Listen(":3000")
}

Test:

curl http://localhost:3000/old
curl http://localhost:3000/old/hello
+ + \ No newline at end of file diff --git a/api/middleware/session/index.html b/api/middleware/session/index.html index ad51d665281..323cb30cdaa 100644 --- a/api/middleware/session/index.html +++ b/api/middleware/session/index.html @@ -6,13 +6,13 @@ Session | Fiber - - + +
-
Skip to main content
Version: v2.x

Session

Session middleware for Fiber.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

Signatures​

func New(config ...Config) *Store
func (s *Store) RegisterType(i interface{})
func (s *Store) Get(c *fiber.Ctx) (*Session, error)
func (s *Store) Reset() error

func (s *Session) Get(key string) interface{}
func (s *Session) Set(key string, val interface{})
func (s *Session) Delete(key string)
func (s *Session) Destroy() error
func (s *Session) Regenerate() error
func (s *Session) Save() error
func (s *Session) Fresh() bool
func (s *Session) ID() string
func (s *Session) Keys() []string
caution

Storing interface{} values are limited to built-ins Go types.

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/session"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
// This stores all of your app's sessions
store := session.New()

app.Get("/", func(c *fiber.Ctx) error {
// Get session from storage
sess, err := store.Get(c)
if err != nil {
panic(err)
}

// Get value
name := sess.Get("name")

// Set key/value
sess.Set("name", "john")

// Get all Keys
keys := sess.Keys()

// Delete key
sess.Delete("name")

// Destroy session
if err := sess.Destroy(); err != nil {
panic(err)
}

// Sets a specific expiration for this session
sess.SetExpiry(time.Second * 2)

// Save session
if err := sess.Save(); err != nil {
panic(err)
}

return c.SendString(fmt.Sprintf("Welcome %v", name))
})

Config​

// Config defines the config for middleware.
type Config struct {
// Allowed session duration
// Optional. Default value 24 * time.Hour
Expiration time.Duration

// Storage interface to store the session data
// Optional. Default value memory.New()
Storage fiber.Storage

// KeyLookup is a string in the form of "<source>:<name>" that is used
// to extract session id from the request.
// Possible values: "header:<name>", "query:<name>" or "cookie:<name>"
// Optional. Default value "cookie:session_id".
KeyLookup string

// Domain of the CSRF cookie.
// Optional. Default value "".
CookieDomain string

// Path of the CSRF cookie.
// Optional. Default value "".
CookiePath string

// Indicates if CSRF cookie is secure.
// Optional. Default value false.
CookieSecure bool

// Indicates if CSRF cookie is HTTP only.
// Optional. Default value false.
CookieHTTPOnly bool

// Value of SameSite cookie.
// Optional. Default value "Lax".
CookieSameSite string

// Decides whether cookie should last for only the browser sesison.
// Ignores Expiration if set to true
// Optional. Default value false.
CookieSessionOnly bool

// KeyGenerator generates the session key.
// Optional. Default value utils.UUIDv4
KeyGenerator func() string

// Deprecated: Please use KeyLookup
CookieName string

// Source defines where to obtain the session id
source Source

// The session name
sessionName string
}

Default Config​

var ConfigDefault = Config{
Expiration: 24 * time.Hour,
KeyLookup: "cookie:session_id",
KeyGenerator: utils.UUIDv4,
source: "cookie",
sessionName: "session_id",
}

Constants​

const (
SourceCookie Source = "cookie"
SourceHeader Source = "header"
SourceURLQuery Source = "query"
)

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
store := session.New(session.Config{
Storage: storage,
})

To use the store, see the Examples.

- - +
Skip to main content
Version: v2.x

Session

Session middleware for Fiber.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

Signatures​

func New(config ...Config) *Store
func (s *Store) RegisterType(i interface{})
func (s *Store) Get(c *fiber.Ctx) (*Session, error)
func (s *Store) Reset() error

func (s *Session) Get(key string) interface{}
func (s *Session) Set(key string, val interface{})
func (s *Session) Delete(key string)
func (s *Session) Destroy() error
func (s *Session) Regenerate() error
func (s *Session) Save() error
func (s *Session) Fresh() bool
func (s *Session) ID() string
func (s *Session) Keys() []string
caution

Storing interface{} values are limited to built-ins Go types.

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/session"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
// This stores all of your app's sessions
store := session.New()

app.Get("/", func(c *fiber.Ctx) error {
// Get session from storage
sess, err := store.Get(c)
if err != nil {
panic(err)
}

// Get value
name := sess.Get("name")

// Set key/value
sess.Set("name", "john")

// Get all Keys
keys := sess.Keys()

// Delete key
sess.Delete("name")

// Destroy session
if err := sess.Destroy(); err != nil {
panic(err)
}

// Sets a specific expiration for this session
sess.SetExpiry(time.Second * 2)

// Save session
if err := sess.Save(); err != nil {
panic(err)
}

return c.SendString(fmt.Sprintf("Welcome %v", name))
})

Config​

// Config defines the config for middleware.
type Config struct {
// Allowed session duration
// Optional. Default value 24 * time.Hour
Expiration time.Duration

// Storage interface to store the session data
// Optional. Default value memory.New()
Storage fiber.Storage

// KeyLookup is a string in the form of "<source>:<name>" that is used
// to extract session id from the request.
// Possible values: "header:<name>", "query:<name>" or "cookie:<name>"
// Optional. Default value "cookie:session_id".
KeyLookup string

// Domain of the CSRF cookie.
// Optional. Default value "".
CookieDomain string

// Path of the CSRF cookie.
// Optional. Default value "".
CookiePath string

// Indicates if CSRF cookie is secure.
// Optional. Default value false.
CookieSecure bool

// Indicates if CSRF cookie is HTTP only.
// Optional. Default value false.
CookieHTTPOnly bool

// Value of SameSite cookie.
// Optional. Default value "Lax".
CookieSameSite string

// Decides whether cookie should last for only the browser sesison.
// Ignores Expiration if set to true
// Optional. Default value false.
CookieSessionOnly bool

// KeyGenerator generates the session key.
// Optional. Default value utils.UUIDv4
KeyGenerator func() string

// Deprecated: Please use KeyLookup
CookieName string

// Source defines where to obtain the session id
source Source

// The session name
sessionName string
}

Default Config​

var ConfigDefault = Config{
Expiration: 24 * time.Hour,
KeyLookup: "cookie:session_id",
KeyGenerator: utils.UUIDv4,
source: "cookie",
sessionName: "session_id",
}

Constants​

const (
SourceCookie Source = "cookie"
SourceHeader Source = "header"
SourceURLQuery Source = "query"
)

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
store := session.New(session.Config{
Storage: storage,
})

To use the store, see the Examples.

+ + \ No newline at end of file diff --git a/api/middleware/skip/index.html b/api/middleware/skip/index.html index c1115a1c179..c9999e08e65 100644 --- a/api/middleware/skip/index.html +++ b/api/middleware/skip/index.html @@ -6,13 +6,13 @@ Skip | Fiber - - + +
-
Skip to main content
Version: v2.x

Skip

Skip middleware for Fiber that skips a wrapped handler if a predicate is true.

Signatures​

func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/skip"
)

After you initiate your Fiber app, you can use the following possibilities:

func main() {
app := fiber.New()

app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool {
return ctx.Method() == fiber.MethodGet
}))

app.Get("/", func(ctx *fiber.Ctx) error {
return ctx.SendString("It was a GET request!")
})

log.Fatal(app.Listen(":3000"))
}

func BasicHandler(ctx *fiber.Ctx) error {
return ctx.SendString("It was not a GET request!")
}
tip

app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.

- - +
Skip to main content
Version: v2.x

Skip

Skip middleware for Fiber that skips a wrapped handler if a predicate is true.

Signatures​

func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/skip"
)

After you initiate your Fiber app, you can use the following possibilities:

func main() {
app := fiber.New()

app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool {
return ctx.Method() == fiber.MethodGet
}))

app.Get("/", func(ctx *fiber.Ctx) error {
return ctx.SendString("It was a GET request!")
})

log.Fatal(app.Listen(":3000"))
}

func BasicHandler(ctx *fiber.Ctx) error {
return ctx.SendString("It was not a GET request!")
}
tip

app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.

+ + \ No newline at end of file diff --git a/api/middleware/timeout/index.html b/api/middleware/timeout/index.html index eebe70c1cf9..0431d69886b 100644 --- a/api/middleware/timeout/index.html +++ b/api/middleware/timeout/index.html @@ -6,13 +6,13 @@ Timeout | Fiber - - + +
-
Skip to main content
Version: v2.x

Timeout

There exist two distinct implementations of timeout middleware Fiber.

New

Wraps a fiber.Handler with a timeout. If the handler takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler.

caution

This has been deprecated since it raises race conditions.

NewWithContext

As a fiber.Handler wrapper, it creates a context with context.WithTimeout and pass it in UserContext.

If the context passed executions (eg. DB ops, Http calls) takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler.

It does not cancel long running executions. Underlying executions must handle timeout by using context.Context parameter.

Signatures​

func New(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler
func NewWithContext(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/timeout"
)

After you initiate your Fiber app, you can use the following possibilities:

func main() {
app := fiber.New()

h := func(c *fiber.Ctx) error {
sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")
if err := sleepWithContext(c.UserContext(), sleepTime); err != nil {
return fmt.Errorf("%w: execution error", err)
}
return nil
}

app.Get("/foo/:sleepTime", timeout.New(h, 2*time.Second))
log.Fatal(app.Listen(":3000"))
}

func sleepWithContext(ctx context.Context, d time.Duration) error {
timer := time.NewTimer(d)

select {
case <-ctx.Done():
if !timer.Stop() {
<-timer.C
}
return context.DeadlineExceeded
case <-timer.C:
}
return nil
}

Test http 200 with curl:

curl --location -I --request GET 'http://localhost:3000/foo/1000' 

Test http 408 with curl:

curl --location -I --request GET 'http://localhost:3000/foo/3000' 

Use with custom error:

var ErrFooTimeOut = errors.New("foo context canceled")

func main() {
app := fiber.New()
h := func(c *fiber.Ctx) error {
sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")
if err := sleepWithContextWithCustomError(c.UserContext(), sleepTime); err != nil {
return fmt.Errorf("%w: execution error", err)
}
return nil
}

app.Get("/foo/:sleepTime", timeout.NewWithContext(h, 2*time.Second, ErrFooTimeOut))
log.Fatal(app.Listen(":3000"))
}

func sleepWithContextWithCustomError(ctx context.Context, d time.Duration) error {
timer := time.NewTimer(d)
select {
case <-ctx.Done():
if !timer.Stop() {
<-timer.C
}
return ErrFooTimeOut
case <-timer.C:
}
return nil
}

Sample usage with a DB call:

func main() {
app := fiber.New()
db, _ := gorm.Open(postgres.Open("postgres://localhost/foodb"), &gorm.Config{})

handler := func(ctx *fiber.Ctx) error {
tran := db.WithContext(ctx.UserContext()).Begin()

if tran = tran.Exec("SELECT pg_sleep(50)"); tran.Error != nil {
return tran.Error
}

if tran = tran.Commit(); tran.Error != nil {
return tran.Error
}

return nil
}

app.Get("/foo", timeout.NewWithContext(handler, 10*time.Second))
log.Fatal(app.Listen(":3000"))
}
- - +
Skip to main content
Version: v2.x

Timeout

There exist two distinct implementations of timeout middleware Fiber.

New

Wraps a fiber.Handler with a timeout. If the handler takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler.

caution

This has been deprecated since it raises race conditions.

NewWithContext

As a fiber.Handler wrapper, it creates a context with context.WithTimeout and pass it in UserContext.

If the context passed executions (eg. DB ops, Http calls) takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler.

It does not cancel long running executions. Underlying executions must handle timeout by using context.Context parameter.

Signatures​

func New(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler
func NewWithContext(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/timeout"
)

After you initiate your Fiber app, you can use the following possibilities:

func main() {
app := fiber.New()

h := func(c *fiber.Ctx) error {
sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")
if err := sleepWithContext(c.UserContext(), sleepTime); err != nil {
return fmt.Errorf("%w: execution error", err)
}
return nil
}

app.Get("/foo/:sleepTime", timeout.New(h, 2*time.Second))
log.Fatal(app.Listen(":3000"))
}

func sleepWithContext(ctx context.Context, d time.Duration) error {
timer := time.NewTimer(d)

select {
case <-ctx.Done():
if !timer.Stop() {
<-timer.C
}
return context.DeadlineExceeded
case <-timer.C:
}
return nil
}

Test http 200 with curl:

curl --location -I --request GET 'http://localhost:3000/foo/1000' 

Test http 408 with curl:

curl --location -I --request GET 'http://localhost:3000/foo/3000' 

Use with custom error:

var ErrFooTimeOut = errors.New("foo context canceled")

func main() {
app := fiber.New()
h := func(c *fiber.Ctx) error {
sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")
if err := sleepWithContextWithCustomError(c.UserContext(), sleepTime); err != nil {
return fmt.Errorf("%w: execution error", err)
}
return nil
}

app.Get("/foo/:sleepTime", timeout.NewWithContext(h, 2*time.Second, ErrFooTimeOut))
log.Fatal(app.Listen(":3000"))
}

func sleepWithContextWithCustomError(ctx context.Context, d time.Duration) error {
timer := time.NewTimer(d)
select {
case <-ctx.Done():
if !timer.Stop() {
<-timer.C
}
return ErrFooTimeOut
case <-timer.C:
}
return nil
}

Sample usage with a DB call:

func main() {
app := fiber.New()
db, _ := gorm.Open(postgres.Open("postgres://localhost/foodb"), &gorm.Config{})

handler := func(ctx *fiber.Ctx) error {
tran := db.WithContext(ctx.UserContext()).Begin()

if tran = tran.Exec("SELECT pg_sleep(50)"); tran.Error != nil {
return tran.Error
}

if tran = tran.Commit(); tran.Error != nil {
return tran.Error
}

return nil
}

app.Get("/foo", timeout.NewWithContext(handler, 10*time.Second))
log.Fatal(app.Listen(":3000"))
}
+ + \ No newline at end of file diff --git a/assets/js/044897a3.a33c1c99.js b/assets/js/044897a3.5da13a11.js similarity index 99% rename from assets/js/044897a3.a33c1c99.js rename to assets/js/044897a3.5da13a11.js index 01086d09790..db5ba4b7a4b 100644 --- a/assets/js/044897a3.a33c1c99.js +++ b/assets/js/044897a3.5da13a11.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7316],{3905:(e,n,t)=>{t.d(n,{Zo:()=>s,kt:()=>f});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var u=r.createContext({}),c=function(e){var n=r.useContext(u),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},s=function(e){var n=c(e.components);return r.createElement(u.Provider,{value:n},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},h=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,u=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),d=c(t),h=a,f=d["".concat(u,".").concat(h)]||d[h]||p[h]||i;return t?r.createElement(f,o(o({ref:n},s),{},{components:t})):r.createElement(f,o({ref:n},s))}));function f(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=h;var l={};for(var u in n)hasOwnProperty.call(n,u)&&(l[u]=n[u]);l.originalType=e,l[d]="string"==typeof e?e:a,o[1]=l;for(var c=2;c{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=t(7462),a=(t(7294),t(3905));const i={id:"keyauth",title:"Keyauth"},o=void 0,l={unversionedId:"api/middleware/keyauth",id:"api/middleware/keyauth",title:"Keyauth",description:"Key auth middleware provides a key based authentication.",source:"@site/docs/core/api/middleware/keyauth.md",sourceDirName:"api/middleware",slug:"/api/middleware/keyauth",permalink:"/next/api/middleware/keyauth",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/keyauth.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"keyauth",title:"Keyauth"},sidebar:"tutorialSidebar",previous:{title:"Idempotency",permalink:"/next/api/middleware/idempotency"},next:{title:"Limiter",permalink:"/next/api/middleware/limiter"}},u={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Authenticate only certain endpoints",id:"authenticate-only-certain-endpoints",level:3},{value:"Specifying middleware in the handler",id:"specifying-middleware-in-the-handler",level:3},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],s={toc:c},d="wrapper";function p(e){let{components:n,...t}=e;return(0,a.kt)(d,(0,r.Z)({},s,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Key auth middleware provides a key based authentication."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n)\n\nvar (\n apiKey = "correct horse battery staple"\n)\n\nfunc validateAPIKey(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n}\n\nfunc main() {\n app := fiber.New()\n\n // note that the keyauth middleware needs to be defined before the routes are defined!\n app.Use(keyauth.New(keyauth.Config{\n KeyLookup: "cookie:access_token",\n Validator: validateAPIKey,\n }))\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Test:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# No api-key specified -> 400 missing \ncurl http://localhost:3000\n#> missing or malformed API Key\n\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000\n#> Successfully authenticated!\n\ncurl --cookie "access_token=Clearly A Wrong Key" http://localhost:3000\n#> missing or malformed API Key\n')),(0,a.kt)("p",null,"For a more detailed example, see also the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/recipes"},(0,a.kt)("inlineCode",{parentName:"a"},"github.com/gofiber/recipes"))," repository and specifically the ",(0,a.kt)("inlineCode",{parentName:"p"},"fiber-envoy-extauthz")," repository and the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/recipes/blob/master/fiber-envoy-extauthz/authz/main.go"},(0,a.kt)("inlineCode",{parentName:"a"},"keyauth example"))," code."),(0,a.kt)("h3",{id:"authenticate-only-certain-endpoints"},"Authenticate only certain endpoints"),(0,a.kt)("p",null,"If you want to authenticate only certain endpoints, you can use the ",(0,a.kt)("inlineCode",{parentName:"p"},"Config")," of keyauth and apply a filter function (eg. ",(0,a.kt)("inlineCode",{parentName:"p"},"authFilter"),") like so"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n "regexp"\n "strings"\n)\n\nvar (\n apiKey = "correct horse battery staple"\n protectedURLs = []*regexp.Regexp{\n regexp.MustCompile("^/authenticated$"),\n regexp.MustCompile("^/auth2$"),\n }\n)\n\nfunc validateAPIKey(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n}\n\nfunc authFilter(c *fiber.Ctx) bool {\n originalURL := strings.ToLower(c.OriginalURL())\n\n for _, pattern := range protectedURLs {\n if pattern.MatchString(originalURL) {\n return false\n }\n }\n return true\n}\n\nfunc main() {\n app := fiber.New()\n\n app.Use(keyauth.New(keyauth.Config{\n Next: authFilter,\n KeyLookup: "cookie:access_token",\n Validator: validateAPIKey,\n }))\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome")\n })\n app.Get("/authenticated", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n app.Get("/auth2", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated 2!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,"Which results in this"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# / does not need to be authenticated\ncurl http://localhost:3000\n#> Welcome\n\n# /authenticated needs to be authenticated\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000/authenticated\n#> Successfully authenticated!\n\n# /auth2 needs to be authenticated too\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000/auth2\n#> Successfully authenticated 2!\n')),(0,a.kt)("h3",{id:"specifying-middleware-in-the-handler"},"Specifying middleware in the handler"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n)\n\nconst (\n apiKey = "my-super-secret-key"\n)\n\nfunc main() {\n app := fiber.New()\n\n authMiddleware := keyauth.New(keyauth.Config{\n Validator: func(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n },\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome")\n })\n\n app.Get("/allowed", authMiddleware, func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,"Which results in this"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# / does not need to be authenticated\ncurl http://localhost:3000\n#> Welcome\n\n# /allowed needs to be authenticated too\ncurl --header "Authorization: Bearer my-super-secret-key" http://localhost:3000/allowed\n#> Successfully authenticated!\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // SuccessHandler defines a function which is executed for a valid key.\n // Optional. Default: nil\n SuccessHandler fiber.Handler\n\n // ErrorHandler defines a function which is executed for an invalid key.\n // It may be used to define a custom error.\n // Optional. Default: 401 Invalid or expired key\n ErrorHandler fiber.ErrorHandler\n\n // KeyLookup is a string in the form of ":" that is used\n // to extract key from the request.\n // Optional. Default value "header:Authorization".\n // Possible values:\n // - "header:"\n // - "query:"\n // - "form:"\n // - "param:"\n // - "cookie:"\n KeyLookup string\n\n // AuthScheme to be used in the Authorization header.\n // Optional. Default value "Bearer".\n AuthScheme string\n\n // Validator is a function to validate key.\n Validator func(*fiber.Ctx, string) (bool, error)\n\n // Context key to store the bearertoken from the token into context.\n // Optional. Default: "token".\n ContextKey string\n}\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n SuccessHandler: func(c *fiber.Ctx) error {\n return c.Next()\n },\n ErrorHandler: func(c *fiber.Ctx, err error) error {\n if err == ErrMissingOrMalformedAPIKey {\n return c.Status(fiber.StatusUnauthorized).SendString(err.Error())\n }\n return c.Status(fiber.StatusUnauthorized).SendString("Invalid or expired API Key")\n },\n KeyLookup: "header:" + fiber.HeaderAuthorization,\n AuthScheme: "Bearer",\n ContextKey: "token",\n}\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7316],{3905:(e,n,t)=>{t.d(n,{Zo:()=>s,kt:()=>f});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var u=r.createContext({}),c=function(e){var n=r.useContext(u),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},s=function(e){var n=c(e.components);return r.createElement(u.Provider,{value:n},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},h=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,u=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),d=c(t),h=a,f=d["".concat(u,".").concat(h)]||d[h]||p[h]||i;return t?r.createElement(f,o(o({ref:n},s),{},{components:t})):r.createElement(f,o({ref:n},s))}));function f(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=h;var l={};for(var u in n)hasOwnProperty.call(n,u)&&(l[u]=n[u]);l.originalType=e,l[d]="string"==typeof e?e:a,o[1]=l;for(var c=2;c{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=t(7462),a=(t(7294),t(3905));const i={id:"keyauth",title:"Keyauth"},o=void 0,l={unversionedId:"api/middleware/keyauth",id:"api/middleware/keyauth",title:"Keyauth",description:"Key auth middleware provides a key based authentication.",source:"@site/docs/core/api/middleware/keyauth.md",sourceDirName:"api/middleware",slug:"/api/middleware/keyauth",permalink:"/next/api/middleware/keyauth",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/keyauth.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"keyauth",title:"Keyauth"},sidebar:"tutorialSidebar",previous:{title:"Idempotency",permalink:"/next/api/middleware/idempotency"},next:{title:"Limiter",permalink:"/next/api/middleware/limiter"}},u={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Authenticate only certain endpoints",id:"authenticate-only-certain-endpoints",level:3},{value:"Specifying middleware in the handler",id:"specifying-middleware-in-the-handler",level:3},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],s={toc:c},d="wrapper";function p(e){let{components:n,...t}=e;return(0,a.kt)(d,(0,r.Z)({},s,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Key auth middleware provides a key based authentication."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n)\n\nvar (\n apiKey = "correct horse battery staple"\n)\n\nfunc validateAPIKey(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n}\n\nfunc main() {\n app := fiber.New()\n\n // note that the keyauth middleware needs to be defined before the routes are defined!\n app.Use(keyauth.New(keyauth.Config{\n KeyLookup: "cookie:access_token",\n Validator: validateAPIKey,\n }))\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Test:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# No api-key specified -> 400 missing \ncurl http://localhost:3000\n#> missing or malformed API Key\n\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000\n#> Successfully authenticated!\n\ncurl --cookie "access_token=Clearly A Wrong Key" http://localhost:3000\n#> missing or malformed API Key\n')),(0,a.kt)("p",null,"For a more detailed example, see also the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/recipes"},(0,a.kt)("inlineCode",{parentName:"a"},"github.com/gofiber/recipes"))," repository and specifically the ",(0,a.kt)("inlineCode",{parentName:"p"},"fiber-envoy-extauthz")," repository and the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/recipes/blob/master/fiber-envoy-extauthz/authz/main.go"},(0,a.kt)("inlineCode",{parentName:"a"},"keyauth example"))," code."),(0,a.kt)("h3",{id:"authenticate-only-certain-endpoints"},"Authenticate only certain endpoints"),(0,a.kt)("p",null,"If you want to authenticate only certain endpoints, you can use the ",(0,a.kt)("inlineCode",{parentName:"p"},"Config")," of keyauth and apply a filter function (eg. ",(0,a.kt)("inlineCode",{parentName:"p"},"authFilter"),") like so"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n "regexp"\n "strings"\n)\n\nvar (\n apiKey = "correct horse battery staple"\n protectedURLs = []*regexp.Regexp{\n regexp.MustCompile("^/authenticated$"),\n regexp.MustCompile("^/auth2$"),\n }\n)\n\nfunc validateAPIKey(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n}\n\nfunc authFilter(c *fiber.Ctx) bool {\n originalURL := strings.ToLower(c.OriginalURL())\n\n for _, pattern := range protectedURLs {\n if pattern.MatchString(originalURL) {\n return false\n }\n }\n return true\n}\n\nfunc main() {\n app := fiber.New()\n\n app.Use(keyauth.New(keyauth.Config{\n Next: authFilter,\n KeyLookup: "cookie:access_token",\n Validator: validateAPIKey,\n }))\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome")\n })\n app.Get("/authenticated", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n app.Get("/auth2", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated 2!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,"Which results in this"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# / does not need to be authenticated\ncurl http://localhost:3000\n#> Welcome\n\n# /authenticated needs to be authenticated\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000/authenticated\n#> Successfully authenticated!\n\n# /auth2 needs to be authenticated too\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000/auth2\n#> Successfully authenticated 2!\n')),(0,a.kt)("h3",{id:"specifying-middleware-in-the-handler"},"Specifying middleware in the handler"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n)\n\nconst (\n apiKey = "my-super-secret-key"\n)\n\nfunc main() {\n app := fiber.New()\n\n authMiddleware := keyauth.New(keyauth.Config{\n Validator: func(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n },\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome")\n })\n\n app.Get("/allowed", authMiddleware, func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,"Which results in this"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# / does not need to be authenticated\ncurl http://localhost:3000\n#> Welcome\n\n# /allowed needs to be authenticated too\ncurl --header "Authorization: Bearer my-super-secret-key" http://localhost:3000/allowed\n#> Successfully authenticated!\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // SuccessHandler defines a function which is executed for a valid key.\n // Optional. Default: nil\n SuccessHandler fiber.Handler\n\n // ErrorHandler defines a function which is executed for an invalid key.\n // It may be used to define a custom error.\n // Optional. Default: 401 Invalid or expired key\n ErrorHandler fiber.ErrorHandler\n\n // KeyLookup is a string in the form of ":" that is used\n // to extract key from the request.\n // Optional. Default value "header:Authorization".\n // Possible values:\n // - "header:"\n // - "query:"\n // - "form:"\n // - "param:"\n // - "cookie:"\n KeyLookup string\n\n // AuthScheme to be used in the Authorization header.\n // Optional. Default value "Bearer".\n AuthScheme string\n\n // Validator is a function to validate key.\n Validator func(*fiber.Ctx, string) (bool, error)\n\n // Context key to store the bearertoken from the token into context.\n // Optional. Default: "token".\n ContextKey string\n}\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n SuccessHandler: func(c *fiber.Ctx) error {\n return c.Next()\n },\n ErrorHandler: func(c *fiber.Ctx, err error) error {\n if err == ErrMissingOrMalformedAPIKey {\n return c.Status(fiber.StatusUnauthorized).SendString(err.Error())\n }\n return c.Status(fiber.StatusUnauthorized).SendString("Invalid or expired API Key")\n },\n KeyLookup: "header:" + fiber.HeaderAuthorization,\n AuthScheme: "Bearer",\n ContextKey: "token",\n}\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/04b03e77.399f66c0.js b/assets/js/04b03e77.84d07949.js similarity index 98% rename from assets/js/04b03e77.399f66c0.js rename to assets/js/04b03e77.84d07949.js index 547a42df7c0..6056792f7f7 100644 --- a/assets/js/04b03e77.399f66c0.js +++ b/assets/js/04b03e77.84d07949.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5163],{3905:(e,r,t)=>{t.d(r,{Zo:()=>d,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var c=n.createContext({}),p=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):o(o({},r),e)),t},d=function(e){var r=p(e.components);return n.createElement(c.Provider,{value:r},e.children)},f="mdxType",u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},s=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),f=p(t),s=a,m=f["".concat(c,".").concat(s)]||f[s]||u[s]||i;return t?n.createElement(m,o(o({ref:r},d),{},{components:t})):n.createElement(m,o({ref:r},d))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=s;var l={};for(var c in r)hasOwnProperty.call(r,c)&&(l[c]=r[c]);l.originalType=e,l[f]="string"==typeof e?e:a,o[1]=l;for(var p=2;p{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var n=t(7462),a=(t(7294),t(3905));const i={id:"recover",title:"Recover"},o=void 0,l={unversionedId:"api/middleware/recover",id:"api/middleware/recover",title:"Recover",description:"Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.",source:"@site/docs/core/api/middleware/recover.md",sourceDirName:"api/middleware",slug:"/api/middleware/recover",permalink:"/next/api/middleware/recover",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/recover.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"recover",title:"Recover"},sidebar:"tutorialSidebar",previous:{title:"Proxy",permalink:"/next/api/middleware/proxy"},next:{title:"Redirect",permalink:"/next/api/middleware/redirect"}},c={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],d={toc:p},f="wrapper";function u(e){let{components:r,...t}=e;return(0,a.kt)(f,(0,n.Z)({},d,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Recover middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that recovers from panics anywhere in the stack chain and handles the control to the centralized ",(0,a.kt)("a",{parentName:"p",href:"https://docs.gofiber.io/error-handling"},"ErrorHandler"),"."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/recover"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(recover.New())\n\n// This panic will be caught by the middleware\napp.Get("/", func(c *fiber.Ctx) error {\n panic("I\'m an error")\n})\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // EnableStackTrace enables handling stack trace\n //\n // Optional. Default: false\n EnableStackTrace bool\n\n // StackTraceHandler defines a function to handle stack trace\n //\n // Optional. Default: defaultStackTraceHandler\n StackTraceHandler func(c *fiber.Ctx, e interface{})\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n EnableStackTrace: false,\n StackTraceHandler: defaultStackTraceHandler,\n}\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5163],{3905:(e,r,t)=>{t.d(r,{Zo:()=>d,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var c=n.createContext({}),p=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):o(o({},r),e)),t},d=function(e){var r=p(e.components);return n.createElement(c.Provider,{value:r},e.children)},f="mdxType",u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},s=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),f=p(t),s=a,m=f["".concat(c,".").concat(s)]||f[s]||u[s]||i;return t?n.createElement(m,o(o({ref:r},d),{},{components:t})):n.createElement(m,o({ref:r},d))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=s;var l={};for(var c in r)hasOwnProperty.call(r,c)&&(l[c]=r[c]);l.originalType=e,l[f]="string"==typeof e?e:a,o[1]=l;for(var p=2;p{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var n=t(7462),a=(t(7294),t(3905));const i={id:"recover",title:"Recover"},o=void 0,l={unversionedId:"api/middleware/recover",id:"api/middleware/recover",title:"Recover",description:"Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.",source:"@site/docs/core/api/middleware/recover.md",sourceDirName:"api/middleware",slug:"/api/middleware/recover",permalink:"/next/api/middleware/recover",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/recover.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"recover",title:"Recover"},sidebar:"tutorialSidebar",previous:{title:"Proxy",permalink:"/next/api/middleware/proxy"},next:{title:"Redirect",permalink:"/next/api/middleware/redirect"}},c={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],d={toc:p},f="wrapper";function u(e){let{components:r,...t}=e;return(0,a.kt)(f,(0,n.Z)({},d,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Recover middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that recovers from panics anywhere in the stack chain and handles the control to the centralized ",(0,a.kt)("a",{parentName:"p",href:"https://docs.gofiber.io/error-handling"},"ErrorHandler"),"."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/recover"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(recover.New())\n\n// This panic will be caught by the middleware\napp.Get("/", func(c *fiber.Ctx) error {\n panic("I\'m an error")\n})\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // EnableStackTrace enables handling stack trace\n //\n // Optional. Default: false\n EnableStackTrace bool\n\n // StackTraceHandler defines a function to handle stack trace\n //\n // Optional. Default: defaultStackTraceHandler\n StackTraceHandler func(c *fiber.Ctx, e interface{})\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n EnableStackTrace: false,\n StackTraceHandler: defaultStackTraceHandler,\n}\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/054c93da.1f799190.js b/assets/js/054c93da.3f06e20c.js similarity index 98% rename from assets/js/054c93da.1f799190.js rename to assets/js/054c93da.3f06e20c.js index 5fd51f8731c..0dbe6427dd6 100644 --- a/assets/js/054c93da.1f799190.js +++ b/assets/js/054c93da.3f06e20c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5987],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var p=n.createContext({}),c=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},s=function(e){var t=c(e.components);return n.createElement(p.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,p=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=c(r),f=a,m=u["".concat(p,".").concat(f)]||u[f]||d[f]||i;return r?n.createElement(m,o(o({ref:t},s),{},{components:r})):n.createElement(m,o({ref:t},s))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=f;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[u]="string"==typeof e?e:a,o[1]=l;for(var c=2;c{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var n=r(7462),a=(r(7294),r(3905));const i={id:"expvar",title:"ExpVar"},o=void 0,l={unversionedId:"api/middleware/expvar",id:"api/middleware/expvar",title:"ExpVar",description:"Expvar middleware for Fiber that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is /debug/vars.",source:"@site/docs/core/api/middleware/expvar.md",sourceDirName:"api/middleware",slug:"/api/middleware/expvar",permalink:"/next/api/middleware/expvar",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/expvar.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"expvar",title:"ExpVar"},sidebar:"tutorialSidebar",previous:{title:"ETag",permalink:"/next/api/middleware/etag"},next:{title:"Favicon",permalink:"/next/api/middleware/favicon"}},p={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],s={toc:c},u="wrapper";function d(e){let{components:t,...r}=e;return(0,a.kt)(u,(0,n.Z)({},s,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Expvar middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is ",(0,a.kt)("inlineCode",{parentName:"p"},"/debug/vars"),"."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New() fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n expvarmw "github.com/gofiber/fiber/v2/middleware/expvar"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var count = expvar.NewInt("count")\n\napp.Use(expvarmw.New())\napp.Get("/", func(c *fiber.Ctx) error {\n count.Add(1)\n\n return c.SendString(fmt.Sprintf("hello expvar count %d", count.Value()))\n})\n')),(0,a.kt)("p",null,"Visit path ",(0,a.kt)("inlineCode",{parentName:"p"},"/debug/vars")," to see all vars and use query ",(0,a.kt)("inlineCode",{parentName:"p"},"r=key")," to filter exposed variables."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'curl 127.0.0.1:3000\nhello expvar count 1\n\ncurl 127.0.0.1:3000/debug/vars\n{\n "cmdline": ["xxx"],\n "count": 1,\n "expvarHandlerCalls": 33,\n "expvarRegexpErrors": 0,\n "memstats": {...}\n}\n\ncurl 127.0.0.1:3000/debug/vars?r=c\n{\n "cmdline": ["xxx"],\n "count": 1\n}\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct { \n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n}\n")))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5987],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var p=n.createContext({}),c=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},s=function(e){var t=c(e.components);return n.createElement(p.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,p=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=c(r),f=a,m=u["".concat(p,".").concat(f)]||u[f]||d[f]||i;return r?n.createElement(m,o(o({ref:t},s),{},{components:r})):n.createElement(m,o({ref:t},s))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=f;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[u]="string"==typeof e?e:a,o[1]=l;for(var c=2;c{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var n=r(7462),a=(r(7294),r(3905));const i={id:"expvar",title:"ExpVar"},o=void 0,l={unversionedId:"api/middleware/expvar",id:"api/middleware/expvar",title:"ExpVar",description:"Expvar middleware for Fiber that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is /debug/vars.",source:"@site/docs/core/api/middleware/expvar.md",sourceDirName:"api/middleware",slug:"/api/middleware/expvar",permalink:"/next/api/middleware/expvar",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/expvar.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"expvar",title:"ExpVar"},sidebar:"tutorialSidebar",previous:{title:"ETag",permalink:"/next/api/middleware/etag"},next:{title:"Favicon",permalink:"/next/api/middleware/favicon"}},p={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],s={toc:c},u="wrapper";function d(e){let{components:t,...r}=e;return(0,a.kt)(u,(0,n.Z)({},s,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Expvar middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is ",(0,a.kt)("inlineCode",{parentName:"p"},"/debug/vars"),"."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New() fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n expvarmw "github.com/gofiber/fiber/v2/middleware/expvar"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var count = expvar.NewInt("count")\n\napp.Use(expvarmw.New())\napp.Get("/", func(c *fiber.Ctx) error {\n count.Add(1)\n\n return c.SendString(fmt.Sprintf("hello expvar count %d", count.Value()))\n})\n')),(0,a.kt)("p",null,"Visit path ",(0,a.kt)("inlineCode",{parentName:"p"},"/debug/vars")," to see all vars and use query ",(0,a.kt)("inlineCode",{parentName:"p"},"r=key")," to filter exposed variables."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'curl 127.0.0.1:3000\nhello expvar count 1\n\ncurl 127.0.0.1:3000/debug/vars\n{\n "cmdline": ["xxx"],\n "count": 1,\n "expvarHandlerCalls": 33,\n "expvarRegexpErrors": 0,\n "memstats": {...}\n}\n\ncurl 127.0.0.1:3000/debug/vars?r=c\n{\n "cmdline": ["xxx"],\n "count": 1\n}\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct { \n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n}\n")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/09303bcf.5170086f.js b/assets/js/09303bcf.b2f81c78.js similarity index 99% rename from assets/js/09303bcf.5170086f.js rename to assets/js/09303bcf.b2f81c78.js index 381de24911e..d2ed50241fd 100644 --- a/assets/js/09303bcf.5170086f.js +++ b/assets/js/09303bcf.b2f81c78.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7620],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>h});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},u=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},d="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},g=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),d=s(r),g=a,h=d["".concat(l,".").concat(g)]||d[g]||c[g]||i;return r?n.createElement(h,o(o({ref:t},u),{},{components:r})):n.createElement(h,o({ref:t},u))}));function h(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=g;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p[d]="string"==typeof e?e:a,o[1]=p;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>c,frontMatter:()=>i,metadata:()=>p,toc:()=>s});var n=r(7462),a=(r(7294),r(3905));const i={id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},o=void 0,p={unversionedId:"guide/grouping",id:"guide/grouping",title:"\ud83c\udfad Grouping",description:"In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.",source:"@site/docs/core/guide/grouping.md",sourceDirName:"guide",slug:"/guide/grouping",permalink:"/next/guide/grouping",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/grouping.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:2,frontMatter:{id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0c Routing",permalink:"/next/guide/routing"},next:{title:"\ud83d\udcdd Templates",permalink:"/next/guide/templates"}},l={},s=[{value:"Paths",id:"paths",level:2},{value:"Group Handlers",id:"group-handlers",level:2}],u={toc:s},d="wrapper";function c(e){let{components:t,...r}=e;return(0,a.kt)(d,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.")),(0,a.kt)("h2",{id:"paths"},"Paths"),(0,a.kt)("p",null,"Like ",(0,a.kt)("strong",{parentName:"p"},"Routing"),", groups can also have paths that belong to a cluster."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", middleware) // /api\n\n v1 := api.Group("/v1", middleware) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", middleware) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("p",null,"A ",(0,a.kt)("strong",{parentName:"p"},"Group")," of paths can have an optional handler."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1") // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2") // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"Running ",(0,a.kt)("strong",{parentName:"p"},"/api"),", ",(0,a.kt)("strong",{parentName:"p"},"/v1")," or ",(0,a.kt)("strong",{parentName:"p"},"/v2")," will result in ",(0,a.kt)("strong",{parentName:"p"},"404")," error, make sure you have the errors set.")),(0,a.kt)("h2",{id:"group-handlers"},"Group Handlers"),(0,a.kt)("p",null,"Group handlers can also be used as a routing path but they must have ",(0,a.kt)("strong",{parentName:"p"},"Next")," added to them so that the flow can continue."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n handler := func(c *fiber.Ctx) error {\n return c.SendStatus(fiber.StatusOK)\n }\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1", func(c *fiber.Ctx) error { // middleware for /api/v1\n c.Set("Version", "v1")\n return c.Next()\n })\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7620],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>h});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},u=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},d="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},g=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),d=s(r),g=a,h=d["".concat(l,".").concat(g)]||d[g]||c[g]||i;return r?n.createElement(h,o(o({ref:t},u),{},{components:r})):n.createElement(h,o({ref:t},u))}));function h(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=g;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p[d]="string"==typeof e?e:a,o[1]=p;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>c,frontMatter:()=>i,metadata:()=>p,toc:()=>s});var n=r(7462),a=(r(7294),r(3905));const i={id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},o=void 0,p={unversionedId:"guide/grouping",id:"guide/grouping",title:"\ud83c\udfad Grouping",description:"In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.",source:"@site/docs/core/guide/grouping.md",sourceDirName:"guide",slug:"/guide/grouping",permalink:"/next/guide/grouping",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/grouping.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:2,frontMatter:{id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0c Routing",permalink:"/next/guide/routing"},next:{title:"\ud83d\udcdd Templates",permalink:"/next/guide/templates"}},l={},s=[{value:"Paths",id:"paths",level:2},{value:"Group Handlers",id:"group-handlers",level:2}],u={toc:s},d="wrapper";function c(e){let{components:t,...r}=e;return(0,a.kt)(d,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.")),(0,a.kt)("h2",{id:"paths"},"Paths"),(0,a.kt)("p",null,"Like ",(0,a.kt)("strong",{parentName:"p"},"Routing"),", groups can also have paths that belong to a cluster."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", middleware) // /api\n\n v1 := api.Group("/v1", middleware) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", middleware) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("p",null,"A ",(0,a.kt)("strong",{parentName:"p"},"Group")," of paths can have an optional handler."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1") // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2") // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"Running ",(0,a.kt)("strong",{parentName:"p"},"/api"),", ",(0,a.kt)("strong",{parentName:"p"},"/v1")," or ",(0,a.kt)("strong",{parentName:"p"},"/v2")," will result in ",(0,a.kt)("strong",{parentName:"p"},"404")," error, make sure you have the errors set.")),(0,a.kt)("h2",{id:"group-handlers"},"Group Handlers"),(0,a.kt)("p",null,"Group handlers can also be used as a routing path but they must have ",(0,a.kt)("strong",{parentName:"p"},"Next")," added to them so that the flow can continue."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n handler := func(c *fiber.Ctx) error {\n return c.SendStatus(fiber.StatusOK)\n }\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1", func(c *fiber.Ctx) error { // middleware for /api/v1\n c.Set("Version", "v1")\n return c.Next()\n })\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/0c35ae3f.7d98fbac.js b/assets/js/0c35ae3f.d4c5f429.js similarity index 99% rename from assets/js/0c35ae3f.7d98fbac.js rename to assets/js/0c35ae3f.d4c5f429.js index c63210f4500..6e89bd523c9 100644 --- a/assets/js/0c35ae3f.7d98fbac.js +++ b/assets/js/0c35ae3f.d4c5f429.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6600,7554],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>g});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=a.createContext({}),p=function(e){var t=a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=p(e.components);return a.createElement(o.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),c=p(n),m=r,g=c["".concat(o,".").concat(m)]||c[m]||d[m]||i;return n?a.createElement(g,l(l({ref:t},u),{},{components:n})):a.createElement(g,l({ref:t},u))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=m;var s={};for(var o in t)hasOwnProperty.call(t,o)&&(s[o]=t[o]);s.originalType=e,s[c]="string"==typeof e?e:r,l[1]=s;for(var p=2;p{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>m,frontMatter:()=>l,metadata:()=>o,toc:()=>u});var a=n(7462),r=(n(7294),n(3905)),i=n(6074);const l={id:"app",title:"\ud83d\ude80 App",description:"The app instance conventionally denotes the Fiber application.",sidebar_position:2},s=void 0,o={unversionedId:"api/app",id:"version-v2.x/api/app",title:"\ud83d\ude80 App",description:"The app instance conventionally denotes the Fiber application.",source:"@site/versioned_docs/version-v2.x/api/app.md",sourceDirName:"api",slug:"/api/app",permalink:"/api/app",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:2,frontMatter:{id:"app",title:"\ud83d\ude80 App",description:"The app instance conventionally denotes the Fiber application.",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udce6 Fiber",permalink:"/api/fiber"},next:{title:"\ud83e\udde0 Ctx",permalink:"/api/ctx"}},p={},u=[{value:"Static",id:"static",level:2},{value:"Route Handlers",id:"route-handlers",level:2},{value:"Mount",id:"mount",level:2},{value:"MountPath",id:"mountpath",level:2},{value:"Group",id:"group",level:2},{value:"Route",id:"route",level:2},{value:"Server",id:"server",level:2},{value:"Server Shutdown",id:"server-shutdown",level:2},{value:"HandlersCount",id:"handlerscount",level:2},{value:"Stack",id:"stack",level:2},{value:"Name",id:"name",level:2},{value:"GetRoute",id:"getroute",level:2},{value:"GetRoutes",id:"getroutes",level:2},{value:"Config",id:"config",level:2},{value:"Handler",id:"handler",level:2},{value:"Listen",id:"listen",level:2},{value:"ListenTLS",id:"listentls",level:2},{value:"ListenTLSWithCertificate",id:"listentlswithcertificate",level:2},{value:"ListenMutualTLS",id:"listenmutualtls",level:2},{value:"ListenMutualTLSWithCertificate",id:"listenmutualtlswithcertificate",level:2},{value:"Listener",id:"listener",level:2},{value:"Test",id:"test",level:2},{value:"Hooks",id:"hooks",level:2}],c={toc:u},d="wrapper";function m(e){let{components:t,...n}=e;return(0,r.kt)(d,(0,a.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"static"},"Static"),(0,r.kt)("p",null,"Use the ",(0,r.kt)("strong",{parentName:"p"},"Static")," method to serve static files such as ",(0,r.kt)("strong",{parentName:"p"},"images"),", ",(0,r.kt)("strong",{parentName:"p"},"CSS,")," and ",(0,r.kt)("strong",{parentName:"p"},"JavaScript"),"."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"By default, ",(0,r.kt)("strong",{parentName:"p"},"Static")," will serve ",(0,r.kt)("inlineCode",{parentName:"p"},"index.html")," files in response to a request on a directory.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Static(prefix, root string, config ...Static) Router\n")),(0,r.kt)("p",null,"Use the following code to serve files in a directory named ",(0,r.kt)("inlineCode",{parentName:"p"},"./public")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Static("/", "./public")\n\n// => http://localhost:3000/hello.html\n// => http://localhost:3000/js/jquery.js\n// => http://localhost:3000/css/style.css\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Serve files from multiple directories\napp.Static("/", "./public")\n\n// Serve files from "./files" directory:\napp.Static("/", "./files")\n')),(0,r.kt)("p",null,"You can use any virtual path prefix ","(",(0,r.kt)("em",{parentName:"p"},"where the path does not actually exist in the file system"),")"," for files that are served by the ",(0,r.kt)("strong",{parentName:"p"},"Static")," method, specify a prefix path for the static directory, as shown below:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'app.Static("/static", "./public")\n\n// => http://localhost:3000/static/hello.html\n// => http://localhost:3000/static/js/jquery.js\n// => http://localhost:3000/static/css/style.css\n')),(0,r.kt)("p",null,"If you want to have a little bit more control regarding the settings for serving static files. You could use the ",(0,r.kt)("inlineCode",{parentName:"p"},"fiber.Static")," struct to enable specific settings."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="fiber.Static{}"',title:'"fiber.Static{}"'},'// Static defines configuration options when defining static assets.\ntype Static struct {\n // When set to true, the server tries minimizing CPU usage by caching compressed files.\n // This works differently than the github.com/gofiber/compression middleware.\n // Optional. Default value false\n Compress bool `json:"compress"`\n\n // When set to true, enables byte range requests.\n // Optional. Default value false\n ByteRange bool `json:"byte_range"`\n\n // When set to true, enables directory browsing.\n // Optional. Default value false.\n Browse bool `json:"browse"`\n\n // When set to true, enables direct download.\n // Optional. Default value false.\n Download bool `json:"download"`\n\n // The name of the index file for serving a directory.\n // Optional. Default value "index.html".\n Index string `json:"index"`\n\n // Expiration duration for inactive file handlers.\n // Use a negative time.Duration to disable it.\n //\n // Optional. Default value 10 * time.Second.\n CacheDuration time.Duration `json:"cache_duration"`\n\n // The value for the Cache-Control HTTP-header\n // that is set on the file response. MaxAge is defined in seconds.\n //\n // Optional. Default value 0.\n MaxAge int `json:"max_age"`\n\n // ModifyResponse defines a function that allows you to alter the response.\n //\n // Optional. Default: nil\n ModifyResponse Handler\n\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *Ctx) bool\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Custom config\napp.Static("/", "./public", fiber.Static{\n Compress: true,\n ByteRange: true,\n Browse: true,\n Index: "john.html",\n CacheDuration: 10 * time.Second,\n MaxAge: 3600,\n})\n')),(0,r.kt)("h2",{id:"route-handlers"},"Route Handlers"),(0,r.kt)(i.default,{mdxType:"RoutingHandler"}),(0,r.kt)("h2",{id:"mount"},"Mount"),(0,r.kt)("p",null,"You can Mount Fiber instance by creating a ",(0,r.kt)("inlineCode",{parentName:"p"},"*Mount")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *App) Mount(prefix string, app *App) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'func main() {\n app := fiber.New()\n micro := fiber.New()\n app.Mount("/john", micro) // GET /john/doe -> 200 OK\n\n micro.Get("/doe", func(c *fiber.Ctx) error {\n return c.SendStatus(fiber.StatusOK)\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("h2",{id:"mountpath"},"MountPath"),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"MountPath")," property contains one or more path patterns on which a sub-app was mounted."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) MountPath() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'func main() {\n app := fiber.New()\n one := fiber.New()\n two := fiber.New()\n three := fiber.New()\n\n two.Mount("/three", three)\n one.Mount("/two", two)\n app.Mount("/one", one)\n \n one.MountPath() // "/one"\n two.MountPath() // "/one/two"\n three.MountPath() // "/one/two/three"\n app.MountPath() // ""\n}\n')),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Mounting order is important for MountPath. If you want to get mount paths properly, you should start mounting from the deepest app.")),(0,r.kt)("h2",{id:"group"},"Group"),(0,r.kt)("p",null,"You can group routes by creating a ",(0,r.kt)("inlineCode",{parentName:"p"},"*Group")," struct."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Group(prefix string, handlers ...Handler) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", handler) // /api\n\n v1 := api.Group("/v1", handler) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", handler) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("h2",{id:"route"},"Route"),(0,r.kt)("p",null,"You can define routes with a common prefix inside the common function."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Route(prefix string, fn func(router Router), name ...string) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'func main() {\n app := fiber.New()\n\n app.Route("/test", func(api fiber.Router) {\n api.Get("/foo", handler).Name("foo") // /test/foo (name: test.foo)\n api.Get("/bar", handler).Name("bar") // /test/bar (name: test.bar)\n }, "test.")\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("h2",{id:"server"},"Server"),(0,r.kt)("p",null,"Server returns the underlying ",(0,r.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/valyala/fasthttp#Server"},"fasthttp server")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Server() *fasthttp.Server\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},"func main() {\n app := fiber.New()\n\n app.Server().MaxConnsPerIP = 1\n\n // ...\n}\n")),(0,r.kt)("h2",{id:"server-shutdown"},"Server Shutdown"),(0,r.kt)("p",null,"Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners and then waits indefinitely for all connections to return to idle before shutting down."),(0,r.kt)("p",null,"ShutdownWithTimeout will forcefully close any active connections after the timeout expires."),(0,r.kt)("p",null,"ShutdownWithContext shuts down the server including by force if the context's deadline is exceeded."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"func (app *App) Shutdown() error\nfunc (app *App) ShutdownWithTimeout(timeout time.Duration) error\nfunc (app *App) ShutdownWithContext(ctx context.Context) error\n")),(0,r.kt)("h2",{id:"handlerscount"},"HandlersCount"),(0,r.kt)("p",null,"This method returns the amount of registered handlers."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) HandlersCount() uint32\n")),(0,r.kt)("h2",{id:"stack"},"Stack"),(0,r.kt)("p",null,"This method returns the original router stack"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Stack() [][]*Route\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'var handler = func(c *fiber.Ctx) error { return nil }\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/john/:age", handler)\n app.Post("/register", handler)\n\n data, _ := json.MarshalIndent(app.Stack(), "", " ")\n fmt.Println(string(data))\n\n app.Listen(":3000")\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript",metastring:'title="Result"',title:'"Result"'},'[\n [\n {\n "method": "GET",\n "path": "/john/:age",\n "params": [\n "age"\n ]\n }\n ],\n [\n {\n "method": "HEAD",\n "path": "/john/:age",\n "params": [\n "age"\n ]\n }\n ],\n [\n {\n "method": "POST",\n "path": "/register",\n "params": null\n }\n ]\n]\n')),(0,r.kt)("h2",{id:"name"},"Name"),(0,r.kt)("p",null,"This method assigns the name of latest created route."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Name(name string) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'var handler = func(c *fiber.Ctx) error { return nil }\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/", handler)\n app.Name("index")\n\n app.Get("/doe", handler).Name("home")\n\n app.Trace("/tracer", handler).Name("tracert")\n\n app.Delete("/delete", handler).Name("delete")\n\n a := app.Group("/a")\n a.Name("fd.")\n\n a.Get("/test", handler).Name("test")\n\n data, _ := json.MarshalIndent(app.Stack(), "", " ")\n fmt.Print(string(data))\n\n app.Listen(":3000")\n\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript",metastring:'title="Result"',title:'"Result"'},'[\n [\n {\n "method": "GET",\n "name": "index",\n "path": "/",\n "params": null\n },\n {\n "method": "GET",\n "name": "home",\n "path": "/doe",\n "params": null\n },\n {\n "method": "GET",\n "name": "fd.test",\n "path": "/a/test",\n "params": null\n }\n ],\n [\n {\n "method": "HEAD",\n "name": "",\n "path": "/",\n "params": null\n },\n {\n "method": "HEAD",\n "name": "",\n "path": "/doe",\n "params": null\n },\n {\n "method": "HEAD",\n "name": "",\n "path": "/a/test",\n "params": null\n }\n ],\n null,\n null,\n [\n {\n "method": "DELETE",\n "name": "delete",\n "path": "/delete",\n "params": null\n }\n ],\n null,\n null,\n [\n {\n "method": "TRACE",\n "name": "tracert",\n "path": "/tracer",\n "params": null\n }\n ],\n null\n]\n')),(0,r.kt)("h2",{id:"getroute"},"GetRoute"),(0,r.kt)("p",null,"This method gets the route by name."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) GetRoute(name string) Route\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'var handler = func(c *fiber.Ctx) error { return nil }\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/", handler).Name("index")\n \n data, _ := json.MarshalIndent(app.GetRoute("index"), "", " ")\n fmt.Print(string(data))\n\n\n app.Listen(":3000")\n\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript",metastring:'title="Result"',title:'"Result"'},'{\n "method": "GET",\n "name": "index",\n "path": "/",\n "params": null\n}\n')),(0,r.kt)("h2",{id:"getroutes"},"GetRoutes"),(0,r.kt)("p",null,"This method gets all routes."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) GetRoutes(filterUseOption ...bool) []Route\n")),(0,r.kt)("p",null,"When filterUseOption equal to true, it will filter the routes registered by the middleware."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'func main() {\n app := fiber.New()\n app.Post("/", func (c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n }).Name("index")\n data, _ := json.MarshalIndent(app.GetRoutes(true), "", " ")\n fmt.Print(string(data))\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript",metastring:'title="Result"',title:'"Result"'},'[\n {\n "method": "POST",\n "name": "index",\n "path": "/",\n "params": null\n }\n]\n')),(0,r.kt)("h2",{id:"config"},"Config"),(0,r.kt)("p",null,"Config returns the app config as value ","("," read-only ",")","."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Config() Config\n")),(0,r.kt)("h2",{id:"handler"},"Handler"),(0,r.kt)("p",null,"Handler returns the server handler that can be used to serve custom ","*","fasthttp.RequestCtx requests."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Handler() fasthttp.RequestHandler\n")),(0,r.kt)("h2",{id:"listen"},"Listen"),(0,r.kt)("p",null,"Listen serves HTTP requests from the given address."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Listen(addr string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Listen on port :8080 \napp.Listen(":8080")\n\n// Custom host\napp.Listen("127.0.0.1:8080")\n')),(0,r.kt)("h2",{id:"listentls"},"ListenTLS"),(0,r.kt)("p",null,"ListenTLS serves HTTPs requests from the given address using certFile and keyFile paths to as TLS certificate and key file."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) ListenTLS(addr, certFile, keyFile string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'app.ListenTLS(":443", "./cert.pem", "./cert.key");\n')),(0,r.kt)("p",null,"Using ",(0,r.kt)("inlineCode",{parentName:"p"},"ListenTLS")," defaults to the following config ","("," use ",(0,r.kt)("inlineCode",{parentName:"p"},"Listener")," to provide your own config ",")"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Default *tls.Config"',title:'"Default','*tls.Config"':!0},"&tls.Config{\n MinVersion: tls.VersionTLS12,\n Certificates: []tls.Certificate{\n cert,\n },\n}\n")),(0,r.kt)("h2",{id:"listentlswithcertificate"},"ListenTLSWithCertificate"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) ListenTLS(addr string, cert tls.Certificate) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'app.ListenTLSWithCertificate(":443", cert);\n')),(0,r.kt)("p",null,"Using ",(0,r.kt)("inlineCode",{parentName:"p"},"ListenTLSWithCertificate")," defaults to the following config ","("," use ",(0,r.kt)("inlineCode",{parentName:"p"},"Listener")," to provide your own config ",")"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Default *tls.Config"',title:'"Default','*tls.Config"':!0},"&tls.Config{\n MinVersion: tls.VersionTLS12,\n Certificates: []tls.Certificate{\n cert,\n },\n}\n")),(0,r.kt)("h2",{id:"listenmutualtls"},"ListenMutualTLS"),(0,r.kt)("p",null,"ListenMutualTLS serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) ListenMutualTLS(addr, certFile, keyFile, clientCertFile string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'app.ListenMutualTLS(":443", "./cert.pem", "./cert.key", "./ca-chain-cert.pem");\n')),(0,r.kt)("p",null,"Using ",(0,r.kt)("inlineCode",{parentName:"p"},"ListenMutualTLS")," defaults to the following config ","("," use ",(0,r.kt)("inlineCode",{parentName:"p"},"Listener")," to provide your own config ",")"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Default *tls.Config"',title:'"Default','*tls.Config"':!0},"&tls.Config{\n MinVersion: tls.VersionTLS12,\n ClientAuth: tls.RequireAndVerifyClientCert,\n ClientCAs: clientCertPool,\n Certificates: []tls.Certificate{\n cert,\n },\n}\n")),(0,r.kt)("h2",{id:"listenmutualtlswithcertificate"},"ListenMutualTLSWithCertificate"),(0,r.kt)("p",null,"ListenMutualTLSWithCertificate serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) ListenMutualTLSWithCertificate(addr string, cert tls.Certificate, clientCertPool *x509.CertPool) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'app.ListenMutualTLSWithCertificate(":443", cert, clientCertPool);\n')),(0,r.kt)("p",null,"Using ",(0,r.kt)("inlineCode",{parentName:"p"},"ListenMutualTLSWithCertificate")," defaults to the following config ","("," use ",(0,r.kt)("inlineCode",{parentName:"p"},"Listener")," to provide your own config ",")"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Default *tls.Config"',title:'"Default','*tls.Config"':!0},"&tls.Config{\n MinVersion: tls.VersionTLS12,\n ClientAuth: tls.RequireAndVerifyClientCert,\n ClientCAs: clientCertPool,\n Certificates: []tls.Certificate{\n cert,\n },\n}\n")),(0,r.kt)("h2",{id:"listener"},"Listener"),(0,r.kt)("p",null,"You can pass your own ",(0,r.kt)("a",{parentName:"p",href:"https://pkg.go.dev/net/#Listener"},(0,r.kt)("inlineCode",{parentName:"a"},"net.Listener"))," using the ",(0,r.kt)("inlineCode",{parentName:"p"},"Listener")," method. This method can be used to enable ",(0,r.kt)("strong",{parentName:"p"},"TLS/HTTPS")," with a custom tls.Config."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Listener(ln net.Listener) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'ln, _ := net.Listen("tcp", ":3000")\n\ncer, _:= tls.LoadX509KeyPair("server.crt", "server.key")\n\nln = tls.NewListener(ln, &tls.Config{Certificates: []tls.Certificate{cer}})\n\napp.Listener(ln)\n')),(0,r.kt)("h2",{id:"test"},"Test"),(0,r.kt)("p",null,"Testing your application is done with the ",(0,r.kt)("strong",{parentName:"p"},"Test")," method. Use this method for creating ",(0,r.kt)("inlineCode",{parentName:"p"},"_test.go")," files or when you need to debug your routing logic. The default timeout is ",(0,r.kt)("inlineCode",{parentName:"p"},"1s")," if you want to disable a timeout altogether, pass ",(0,r.kt)("inlineCode",{parentName:"p"},"-1")," as a second argument."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Test(req *http.Request, msTimeout ...int) (*http.Response, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Create route with GET method for test:\napp.Get("/", func(c *fiber.Ctx) error {\n fmt.Println(c.BaseURL()) // => http://google.com\n fmt.Println(c.Get("X-Custom-Header")) // => hi\n\n return c.SendString("hello, World!")\n})\n\n// http.Request\nreq := httptest.NewRequest("GET", "http://google.com", nil)\nreq.Header.Set("X-Custom-Header", "hi")\n\n// http.Response\nresp, _ := app.Test(req)\n\n// Do something with results:\nif resp.StatusCode == fiber.StatusOK {\n body, _ := ioutil.ReadAll(resp.Body)\n fmt.Println(string(body)) // => Hello, World!\n}\n')),(0,r.kt)("h2",{id:"hooks"},"Hooks"),(0,r.kt)("p",null,"Hooks is a method to return ",(0,r.kt)("a",{parentName:"p",href:"/guide/hooks"},"hooks")," property."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Hooks() *Hooks\n")))}m.isMDXComponent=!0},6074:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var a=n(7462),r=(n(7294),n(3905));const i={id:"route-handlers",title:"Route Handlers"},l=void 0,s={unversionedId:"partials/routing/route-handlers",id:"version-v2.x/partials/routing/route-handlers",title:"Route Handlers",description:"Registers a route bound to a specific HTTP method.",source:"@site/versioned_docs/version-v2.x/partials/routing/handler.md",sourceDirName:"partials/routing",slug:"/partials/routing/route-handlers",permalink:"/partials/routing/route-handlers",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"route-handlers",title:"Route Handlers"}},o={},p=[],u={toc:p},c="wrapper";function d(e){let{components:t,...n}=e;return(0,r.kt)(c,(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Registers a route bound to a specific ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods"},"HTTP method"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signatures"',title:'"Signatures"'},"// HTTP methods\nfunc (app *App) Get(path string, handlers ...Handler) Router\nfunc (app *App) Head(path string, handlers ...Handler) Router\nfunc (app *App) Post(path string, handlers ...Handler) Router\nfunc (app *App) Put(path string, handlers ...Handler) Router\nfunc (app *App) Delete(path string, handlers ...Handler) Router\nfunc (app *App) Connect(path string, handlers ...Handler) Router\nfunc (app *App) Options(path string, handlers ...Handler) Router\nfunc (app *App) Trace(path string, handlers ...Handler) Router\nfunc (app *App) Patch(path string, handlers ...Handler) Router\n\n// Add allows you to specifiy a method as value\nfunc (app *App) Add(method, path string, handlers ...Handler) Router\n\n// All will register the route on all HTTP methods\n// Almost the same as app.Use but not bound to prefixes\nfunc (app *App) All(path string, handlers ...Handler) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Simple GET handler\napp.Get("/api/list", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a GET request!")\n})\n\n// Simple POST handler\napp.Post("/api/register", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a POST request!")\n})\n')),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Use")," can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. ",(0,r.kt)("inlineCode",{parentName:"p"},"/john")," will match ",(0,r.kt)("inlineCode",{parentName:"p"},"/john/doe"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"/johnnnnn")," etc"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Use(args ...interface{}) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Match any request\napp.Use(func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match request starting with /api\napp.Use("/api", func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match requests starting with /api or /home (multiple-prefix support)\napp.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Attach multiple handlers \napp.Use("/api", func(c *fiber.Ctx) error {\n c.Set("X-Custom-Header", random.String(32))\n return c.Next()\n}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6600,7554],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>g});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=a.createContext({}),p=function(e){var t=a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=p(e.components);return a.createElement(o.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),c=p(n),m=r,g=c["".concat(o,".").concat(m)]||c[m]||d[m]||i;return n?a.createElement(g,l(l({ref:t},u),{},{components:n})):a.createElement(g,l({ref:t},u))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=m;var s={};for(var o in t)hasOwnProperty.call(t,o)&&(s[o]=t[o]);s.originalType=e,s[c]="string"==typeof e?e:r,l[1]=s;for(var p=2;p{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>m,frontMatter:()=>l,metadata:()=>o,toc:()=>u});var a=n(7462),r=(n(7294),n(3905)),i=n(6074);const l={id:"app",title:"\ud83d\ude80 App",description:"The app instance conventionally denotes the Fiber application.",sidebar_position:2},s=void 0,o={unversionedId:"api/app",id:"version-v2.x/api/app",title:"\ud83d\ude80 App",description:"The app instance conventionally denotes the Fiber application.",source:"@site/versioned_docs/version-v2.x/api/app.md",sourceDirName:"api",slug:"/api/app",permalink:"/api/app",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:2,frontMatter:{id:"app",title:"\ud83d\ude80 App",description:"The app instance conventionally denotes the Fiber application.",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udce6 Fiber",permalink:"/api/fiber"},next:{title:"\ud83e\udde0 Ctx",permalink:"/api/ctx"}},p={},u=[{value:"Static",id:"static",level:2},{value:"Route Handlers",id:"route-handlers",level:2},{value:"Mount",id:"mount",level:2},{value:"MountPath",id:"mountpath",level:2},{value:"Group",id:"group",level:2},{value:"Route",id:"route",level:2},{value:"Server",id:"server",level:2},{value:"Server Shutdown",id:"server-shutdown",level:2},{value:"HandlersCount",id:"handlerscount",level:2},{value:"Stack",id:"stack",level:2},{value:"Name",id:"name",level:2},{value:"GetRoute",id:"getroute",level:2},{value:"GetRoutes",id:"getroutes",level:2},{value:"Config",id:"config",level:2},{value:"Handler",id:"handler",level:2},{value:"Listen",id:"listen",level:2},{value:"ListenTLS",id:"listentls",level:2},{value:"ListenTLSWithCertificate",id:"listentlswithcertificate",level:2},{value:"ListenMutualTLS",id:"listenmutualtls",level:2},{value:"ListenMutualTLSWithCertificate",id:"listenmutualtlswithcertificate",level:2},{value:"Listener",id:"listener",level:2},{value:"Test",id:"test",level:2},{value:"Hooks",id:"hooks",level:2}],c={toc:u},d="wrapper";function m(e){let{components:t,...n}=e;return(0,r.kt)(d,(0,a.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"static"},"Static"),(0,r.kt)("p",null,"Use the ",(0,r.kt)("strong",{parentName:"p"},"Static")," method to serve static files such as ",(0,r.kt)("strong",{parentName:"p"},"images"),", ",(0,r.kt)("strong",{parentName:"p"},"CSS,")," and ",(0,r.kt)("strong",{parentName:"p"},"JavaScript"),"."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"By default, ",(0,r.kt)("strong",{parentName:"p"},"Static")," will serve ",(0,r.kt)("inlineCode",{parentName:"p"},"index.html")," files in response to a request on a directory.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Static(prefix, root string, config ...Static) Router\n")),(0,r.kt)("p",null,"Use the following code to serve files in a directory named ",(0,r.kt)("inlineCode",{parentName:"p"},"./public")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Static("/", "./public")\n\n// => http://localhost:3000/hello.html\n// => http://localhost:3000/js/jquery.js\n// => http://localhost:3000/css/style.css\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Serve files from multiple directories\napp.Static("/", "./public")\n\n// Serve files from "./files" directory:\napp.Static("/", "./files")\n')),(0,r.kt)("p",null,"You can use any virtual path prefix ","(",(0,r.kt)("em",{parentName:"p"},"where the path does not actually exist in the file system"),")"," for files that are served by the ",(0,r.kt)("strong",{parentName:"p"},"Static")," method, specify a prefix path for the static directory, as shown below:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'app.Static("/static", "./public")\n\n// => http://localhost:3000/static/hello.html\n// => http://localhost:3000/static/js/jquery.js\n// => http://localhost:3000/static/css/style.css\n')),(0,r.kt)("p",null,"If you want to have a little bit more control regarding the settings for serving static files. You could use the ",(0,r.kt)("inlineCode",{parentName:"p"},"fiber.Static")," struct to enable specific settings."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="fiber.Static{}"',title:'"fiber.Static{}"'},'// Static defines configuration options when defining static assets.\ntype Static struct {\n // When set to true, the server tries minimizing CPU usage by caching compressed files.\n // This works differently than the github.com/gofiber/compression middleware.\n // Optional. Default value false\n Compress bool `json:"compress"`\n\n // When set to true, enables byte range requests.\n // Optional. Default value false\n ByteRange bool `json:"byte_range"`\n\n // When set to true, enables directory browsing.\n // Optional. Default value false.\n Browse bool `json:"browse"`\n\n // When set to true, enables direct download.\n // Optional. Default value false.\n Download bool `json:"download"`\n\n // The name of the index file for serving a directory.\n // Optional. Default value "index.html".\n Index string `json:"index"`\n\n // Expiration duration for inactive file handlers.\n // Use a negative time.Duration to disable it.\n //\n // Optional. Default value 10 * time.Second.\n CacheDuration time.Duration `json:"cache_duration"`\n\n // The value for the Cache-Control HTTP-header\n // that is set on the file response. MaxAge is defined in seconds.\n //\n // Optional. Default value 0.\n MaxAge int `json:"max_age"`\n\n // ModifyResponse defines a function that allows you to alter the response.\n //\n // Optional. Default: nil\n ModifyResponse Handler\n\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *Ctx) bool\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Custom config\napp.Static("/", "./public", fiber.Static{\n Compress: true,\n ByteRange: true,\n Browse: true,\n Index: "john.html",\n CacheDuration: 10 * time.Second,\n MaxAge: 3600,\n})\n')),(0,r.kt)("h2",{id:"route-handlers"},"Route Handlers"),(0,r.kt)(i.default,{mdxType:"RoutingHandler"}),(0,r.kt)("h2",{id:"mount"},"Mount"),(0,r.kt)("p",null,"You can Mount Fiber instance by creating a ",(0,r.kt)("inlineCode",{parentName:"p"},"*Mount")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *App) Mount(prefix string, app *App) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'func main() {\n app := fiber.New()\n micro := fiber.New()\n app.Mount("/john", micro) // GET /john/doe -> 200 OK\n\n micro.Get("/doe", func(c *fiber.Ctx) error {\n return c.SendStatus(fiber.StatusOK)\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("h2",{id:"mountpath"},"MountPath"),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"MountPath")," property contains one or more path patterns on which a sub-app was mounted."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) MountPath() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'func main() {\n app := fiber.New()\n one := fiber.New()\n two := fiber.New()\n three := fiber.New()\n\n two.Mount("/three", three)\n one.Mount("/two", two)\n app.Mount("/one", one)\n \n one.MountPath() // "/one"\n two.MountPath() // "/one/two"\n three.MountPath() // "/one/two/three"\n app.MountPath() // ""\n}\n')),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Mounting order is important for MountPath. If you want to get mount paths properly, you should start mounting from the deepest app.")),(0,r.kt)("h2",{id:"group"},"Group"),(0,r.kt)("p",null,"You can group routes by creating a ",(0,r.kt)("inlineCode",{parentName:"p"},"*Group")," struct."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Group(prefix string, handlers ...Handler) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", handler) // /api\n\n v1 := api.Group("/v1", handler) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", handler) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("h2",{id:"route"},"Route"),(0,r.kt)("p",null,"You can define routes with a common prefix inside the common function."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Route(prefix string, fn func(router Router), name ...string) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'func main() {\n app := fiber.New()\n\n app.Route("/test", func(api fiber.Router) {\n api.Get("/foo", handler).Name("foo") // /test/foo (name: test.foo)\n api.Get("/bar", handler).Name("bar") // /test/bar (name: test.bar)\n }, "test.")\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("h2",{id:"server"},"Server"),(0,r.kt)("p",null,"Server returns the underlying ",(0,r.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/valyala/fasthttp#Server"},"fasthttp server")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Server() *fasthttp.Server\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},"func main() {\n app := fiber.New()\n\n app.Server().MaxConnsPerIP = 1\n\n // ...\n}\n")),(0,r.kt)("h2",{id:"server-shutdown"},"Server Shutdown"),(0,r.kt)("p",null,"Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners and then waits indefinitely for all connections to return to idle before shutting down."),(0,r.kt)("p",null,"ShutdownWithTimeout will forcefully close any active connections after the timeout expires."),(0,r.kt)("p",null,"ShutdownWithContext shuts down the server including by force if the context's deadline is exceeded."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"func (app *App) Shutdown() error\nfunc (app *App) ShutdownWithTimeout(timeout time.Duration) error\nfunc (app *App) ShutdownWithContext(ctx context.Context) error\n")),(0,r.kt)("h2",{id:"handlerscount"},"HandlersCount"),(0,r.kt)("p",null,"This method returns the amount of registered handlers."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) HandlersCount() uint32\n")),(0,r.kt)("h2",{id:"stack"},"Stack"),(0,r.kt)("p",null,"This method returns the original router stack"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Stack() [][]*Route\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'var handler = func(c *fiber.Ctx) error { return nil }\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/john/:age", handler)\n app.Post("/register", handler)\n\n data, _ := json.MarshalIndent(app.Stack(), "", " ")\n fmt.Println(string(data))\n\n app.Listen(":3000")\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript",metastring:'title="Result"',title:'"Result"'},'[\n [\n {\n "method": "GET",\n "path": "/john/:age",\n "params": [\n "age"\n ]\n }\n ],\n [\n {\n "method": "HEAD",\n "path": "/john/:age",\n "params": [\n "age"\n ]\n }\n ],\n [\n {\n "method": "POST",\n "path": "/register",\n "params": null\n }\n ]\n]\n')),(0,r.kt)("h2",{id:"name"},"Name"),(0,r.kt)("p",null,"This method assigns the name of latest created route."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Name(name string) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'var handler = func(c *fiber.Ctx) error { return nil }\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/", handler)\n app.Name("index")\n\n app.Get("/doe", handler).Name("home")\n\n app.Trace("/tracer", handler).Name("tracert")\n\n app.Delete("/delete", handler).Name("delete")\n\n a := app.Group("/a")\n a.Name("fd.")\n\n a.Get("/test", handler).Name("test")\n\n data, _ := json.MarshalIndent(app.Stack(), "", " ")\n fmt.Print(string(data))\n\n app.Listen(":3000")\n\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript",metastring:'title="Result"',title:'"Result"'},'[\n [\n {\n "method": "GET",\n "name": "index",\n "path": "/",\n "params": null\n },\n {\n "method": "GET",\n "name": "home",\n "path": "/doe",\n "params": null\n },\n {\n "method": "GET",\n "name": "fd.test",\n "path": "/a/test",\n "params": null\n }\n ],\n [\n {\n "method": "HEAD",\n "name": "",\n "path": "/",\n "params": null\n },\n {\n "method": "HEAD",\n "name": "",\n "path": "/doe",\n "params": null\n },\n {\n "method": "HEAD",\n "name": "",\n "path": "/a/test",\n "params": null\n }\n ],\n null,\n null,\n [\n {\n "method": "DELETE",\n "name": "delete",\n "path": "/delete",\n "params": null\n }\n ],\n null,\n null,\n [\n {\n "method": "TRACE",\n "name": "tracert",\n "path": "/tracer",\n "params": null\n }\n ],\n null\n]\n')),(0,r.kt)("h2",{id:"getroute"},"GetRoute"),(0,r.kt)("p",null,"This method gets the route by name."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) GetRoute(name string) Route\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'var handler = func(c *fiber.Ctx) error { return nil }\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/", handler).Name("index")\n \n data, _ := json.MarshalIndent(app.GetRoute("index"), "", " ")\n fmt.Print(string(data))\n\n\n app.Listen(":3000")\n\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript",metastring:'title="Result"',title:'"Result"'},'{\n "method": "GET",\n "name": "index",\n "path": "/",\n "params": null\n}\n')),(0,r.kt)("h2",{id:"getroutes"},"GetRoutes"),(0,r.kt)("p",null,"This method gets all routes."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) GetRoutes(filterUseOption ...bool) []Route\n")),(0,r.kt)("p",null,"When filterUseOption equal to true, it will filter the routes registered by the middleware."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'func main() {\n app := fiber.New()\n app.Post("/", func (c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n }).Name("index")\n data, _ := json.MarshalIndent(app.GetRoutes(true), "", " ")\n fmt.Print(string(data))\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript",metastring:'title="Result"',title:'"Result"'},'[\n {\n "method": "POST",\n "name": "index",\n "path": "/",\n "params": null\n }\n]\n')),(0,r.kt)("h2",{id:"config"},"Config"),(0,r.kt)("p",null,"Config returns the app config as value ","("," read-only ",")","."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Config() Config\n")),(0,r.kt)("h2",{id:"handler"},"Handler"),(0,r.kt)("p",null,"Handler returns the server handler that can be used to serve custom ","*","fasthttp.RequestCtx requests."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Handler() fasthttp.RequestHandler\n")),(0,r.kt)("h2",{id:"listen"},"Listen"),(0,r.kt)("p",null,"Listen serves HTTP requests from the given address."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Listen(addr string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Listen on port :8080 \napp.Listen(":8080")\n\n// Custom host\napp.Listen("127.0.0.1:8080")\n')),(0,r.kt)("h2",{id:"listentls"},"ListenTLS"),(0,r.kt)("p",null,"ListenTLS serves HTTPs requests from the given address using certFile and keyFile paths to as TLS certificate and key file."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) ListenTLS(addr, certFile, keyFile string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'app.ListenTLS(":443", "./cert.pem", "./cert.key");\n')),(0,r.kt)("p",null,"Using ",(0,r.kt)("inlineCode",{parentName:"p"},"ListenTLS")," defaults to the following config ","("," use ",(0,r.kt)("inlineCode",{parentName:"p"},"Listener")," to provide your own config ",")"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Default *tls.Config"',title:'"Default','*tls.Config"':!0},"&tls.Config{\n MinVersion: tls.VersionTLS12,\n Certificates: []tls.Certificate{\n cert,\n },\n}\n")),(0,r.kt)("h2",{id:"listentlswithcertificate"},"ListenTLSWithCertificate"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) ListenTLS(addr string, cert tls.Certificate) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'app.ListenTLSWithCertificate(":443", cert);\n')),(0,r.kt)("p",null,"Using ",(0,r.kt)("inlineCode",{parentName:"p"},"ListenTLSWithCertificate")," defaults to the following config ","("," use ",(0,r.kt)("inlineCode",{parentName:"p"},"Listener")," to provide your own config ",")"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Default *tls.Config"',title:'"Default','*tls.Config"':!0},"&tls.Config{\n MinVersion: tls.VersionTLS12,\n Certificates: []tls.Certificate{\n cert,\n },\n}\n")),(0,r.kt)("h2",{id:"listenmutualtls"},"ListenMutualTLS"),(0,r.kt)("p",null,"ListenMutualTLS serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) ListenMutualTLS(addr, certFile, keyFile, clientCertFile string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'app.ListenMutualTLS(":443", "./cert.pem", "./cert.key", "./ca-chain-cert.pem");\n')),(0,r.kt)("p",null,"Using ",(0,r.kt)("inlineCode",{parentName:"p"},"ListenMutualTLS")," defaults to the following config ","("," use ",(0,r.kt)("inlineCode",{parentName:"p"},"Listener")," to provide your own config ",")"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Default *tls.Config"',title:'"Default','*tls.Config"':!0},"&tls.Config{\n MinVersion: tls.VersionTLS12,\n ClientAuth: tls.RequireAndVerifyClientCert,\n ClientCAs: clientCertPool,\n Certificates: []tls.Certificate{\n cert,\n },\n}\n")),(0,r.kt)("h2",{id:"listenmutualtlswithcertificate"},"ListenMutualTLSWithCertificate"),(0,r.kt)("p",null,"ListenMutualTLSWithCertificate serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) ListenMutualTLSWithCertificate(addr string, cert tls.Certificate, clientCertPool *x509.CertPool) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'app.ListenMutualTLSWithCertificate(":443", cert, clientCertPool);\n')),(0,r.kt)("p",null,"Using ",(0,r.kt)("inlineCode",{parentName:"p"},"ListenMutualTLSWithCertificate")," defaults to the following config ","("," use ",(0,r.kt)("inlineCode",{parentName:"p"},"Listener")," to provide your own config ",")"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Default *tls.Config"',title:'"Default','*tls.Config"':!0},"&tls.Config{\n MinVersion: tls.VersionTLS12,\n ClientAuth: tls.RequireAndVerifyClientCert,\n ClientCAs: clientCertPool,\n Certificates: []tls.Certificate{\n cert,\n },\n}\n")),(0,r.kt)("h2",{id:"listener"},"Listener"),(0,r.kt)("p",null,"You can pass your own ",(0,r.kt)("a",{parentName:"p",href:"https://pkg.go.dev/net/#Listener"},(0,r.kt)("inlineCode",{parentName:"a"},"net.Listener"))," using the ",(0,r.kt)("inlineCode",{parentName:"p"},"Listener")," method. This method can be used to enable ",(0,r.kt)("strong",{parentName:"p"},"TLS/HTTPS")," with a custom tls.Config."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Listener(ln net.Listener) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'ln, _ := net.Listen("tcp", ":3000")\n\ncer, _:= tls.LoadX509KeyPair("server.crt", "server.key")\n\nln = tls.NewListener(ln, &tls.Config{Certificates: []tls.Certificate{cer}})\n\napp.Listener(ln)\n')),(0,r.kt)("h2",{id:"test"},"Test"),(0,r.kt)("p",null,"Testing your application is done with the ",(0,r.kt)("strong",{parentName:"p"},"Test")," method. Use this method for creating ",(0,r.kt)("inlineCode",{parentName:"p"},"_test.go")," files or when you need to debug your routing logic. The default timeout is ",(0,r.kt)("inlineCode",{parentName:"p"},"1s")," if you want to disable a timeout altogether, pass ",(0,r.kt)("inlineCode",{parentName:"p"},"-1")," as a second argument."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Test(req *http.Request, msTimeout ...int) (*http.Response, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Create route with GET method for test:\napp.Get("/", func(c *fiber.Ctx) error {\n fmt.Println(c.BaseURL()) // => http://google.com\n fmt.Println(c.Get("X-Custom-Header")) // => hi\n\n return c.SendString("hello, World!")\n})\n\n// http.Request\nreq := httptest.NewRequest("GET", "http://google.com", nil)\nreq.Header.Set("X-Custom-Header", "hi")\n\n// http.Response\nresp, _ := app.Test(req)\n\n// Do something with results:\nif resp.StatusCode == fiber.StatusOK {\n body, _ := ioutil.ReadAll(resp.Body)\n fmt.Println(string(body)) // => Hello, World!\n}\n')),(0,r.kt)("h2",{id:"hooks"},"Hooks"),(0,r.kt)("p",null,"Hooks is a method to return ",(0,r.kt)("a",{parentName:"p",href:"/guide/hooks"},"hooks")," property."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Hooks() *Hooks\n")))}m.isMDXComponent=!0},6074:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var a=n(7462),r=(n(7294),n(3905));const i={id:"route-handlers",title:"Route Handlers"},l=void 0,s={unversionedId:"partials/routing/route-handlers",id:"version-v2.x/partials/routing/route-handlers",title:"Route Handlers",description:"Registers a route bound to a specific HTTP method.",source:"@site/versioned_docs/version-v2.x/partials/routing/handler.md",sourceDirName:"partials/routing",slug:"/partials/routing/route-handlers",permalink:"/partials/routing/route-handlers",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"route-handlers",title:"Route Handlers"}},o={},p=[],u={toc:p},c="wrapper";function d(e){let{components:t,...n}=e;return(0,r.kt)(c,(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Registers a route bound to a specific ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods"},"HTTP method"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signatures"',title:'"Signatures"'},"// HTTP methods\nfunc (app *App) Get(path string, handlers ...Handler) Router\nfunc (app *App) Head(path string, handlers ...Handler) Router\nfunc (app *App) Post(path string, handlers ...Handler) Router\nfunc (app *App) Put(path string, handlers ...Handler) Router\nfunc (app *App) Delete(path string, handlers ...Handler) Router\nfunc (app *App) Connect(path string, handlers ...Handler) Router\nfunc (app *App) Options(path string, handlers ...Handler) Router\nfunc (app *App) Trace(path string, handlers ...Handler) Router\nfunc (app *App) Patch(path string, handlers ...Handler) Router\n\n// Add allows you to specifiy a method as value\nfunc (app *App) Add(method, path string, handlers ...Handler) Router\n\n// All will register the route on all HTTP methods\n// Almost the same as app.Use but not bound to prefixes\nfunc (app *App) All(path string, handlers ...Handler) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Simple GET handler\napp.Get("/api/list", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a GET request!")\n})\n\n// Simple POST handler\napp.Post("/api/register", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a POST request!")\n})\n')),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Use")," can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. ",(0,r.kt)("inlineCode",{parentName:"p"},"/john")," will match ",(0,r.kt)("inlineCode",{parentName:"p"},"/john/doe"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"/johnnnnn")," etc"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Use(args ...interface{}) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Match any request\napp.Use(func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match request starting with /api\napp.Use("/api", func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match requests starting with /api or /home (multiple-prefix support)\napp.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Attach multiple handlers \napp.Use("/api", func(c *fiber.Ctx) error {\n c.Set("X-Custom-Header", random.String(32))\n return c.Next()\n}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/0f17a9fe.d3a7354d.js b/assets/js/0f17a9fe.e120838e.js similarity index 98% rename from assets/js/0f17a9fe.d3a7354d.js rename to assets/js/0f17a9fe.e120838e.js index 02a5b057059..28e118755c1 100644 --- a/assets/js/0f17a9fe.d3a7354d.js +++ b/assets/js/0f17a9fe.e120838e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5373],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>f});var n=r(7294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var p=n.createContext({}),u=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},s=function(e){var t=u(e.components);return n.createElement(p.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,o=e.originalType,p=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),c=u(r),d=i,f=c["".concat(p,".").concat(d)]||c[d]||m[d]||o;return r?n.createElement(f,a(a({ref:t},s),{},{components:r})):n.createElement(f,a({ref:t},s))}));function f(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=r.length,a=new Array(o);a[0]=d;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[c]="string"==typeof e?e:i,a[1]=l;for(var u=2;u{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>a,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>u});var n=r(7462),i=(r(7294),r(3905));const o={id:"timeout",title:"Timeout"},a=void 0,l={unversionedId:"api/middleware/timeout",id:"version-v2.x/api/middleware/timeout",title:"Timeout",description:"There exist two distinct implementations of timeout middleware Fiber.",source:"@site/versioned_docs/version-v2.x/api/middleware/timeout.md",sourceDirName:"api/middleware",slug:"/api/middleware/timeout",permalink:"/api/middleware/timeout",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"timeout",title:"Timeout"},sidebar:"tutorialSidebar",previous:{title:"Skip",permalink:"/api/middleware/skip"},next:{title:"Guide",permalink:"/category/guide"}},p={},u=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2}],s={toc:u},c="wrapper";function m(e){let{components:t,...r}=e;return(0,i.kt)(c,(0,n.Z)({},s,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"There exist two distinct implementations of timeout middleware ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber"),"."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"New")),(0,i.kt)("p",null,"Wraps a ",(0,i.kt)("inlineCode",{parentName:"p"},"fiber.Handler")," with a timeout. If the handler takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ",(0,i.kt)("a",{parentName:"p",href:"https://docs.gofiber.io/error-handling"},"ErrorHandler"),"."),(0,i.kt)("admonition",{type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"This has been deprecated since it raises race conditions.")),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"NewWithContext")),(0,i.kt)("p",null,"As a ",(0,i.kt)("inlineCode",{parentName:"p"},"fiber.Handler")," wrapper, it creates a context with ",(0,i.kt)("inlineCode",{parentName:"p"},"context.WithTimeout")," and pass it in ",(0,i.kt)("inlineCode",{parentName:"p"},"UserContext"),". "),(0,i.kt)("p",null,"If the context passed executions (eg. DB ops, Http calls) takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ",(0,i.kt)("inlineCode",{parentName:"p"},"ErrorHandler"),"."),(0,i.kt)("p",null,"It does not cancel long running executions. Underlying executions must handle timeout by using ",(0,i.kt)("inlineCode",{parentName:"p"},"context.Context")," parameter."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler\nfunc NewWithContext(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/timeout"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n h := func(c *fiber.Ctx) error {\n sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")\n if err := sleepWithContext(c.UserContext(), sleepTime); err != nil {\n return fmt.Errorf("%w: execution error", err)\n }\n return nil\n }\n\n app.Get("/foo/:sleepTime", timeout.New(h, 2*time.Second))\n log.Fatal(app.Listen(":3000"))\n}\n\nfunc sleepWithContext(ctx context.Context, d time.Duration) error {\n timer := time.NewTimer(d)\n\n select {\n case <-ctx.Done():\n if !timer.Stop() {\n <-timer.C\n }\n return context.DeadlineExceeded\n case <-timer.C:\n }\n return nil\n}\n')),(0,i.kt)("p",null,"Test http 200 with curl:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"curl --location -I --request GET 'http://localhost:3000/foo/1000' \n")),(0,i.kt)("p",null,"Test http 408 with curl:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"curl --location -I --request GET 'http://localhost:3000/foo/3000' \n")),(0,i.kt)("p",null,"Use with custom error:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ErrFooTimeOut = errors.New("foo context canceled")\n\nfunc main() {\n app := fiber.New()\n h := func(c *fiber.Ctx) error {\n sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")\n if err := sleepWithContextWithCustomError(c.UserContext(), sleepTime); err != nil {\n return fmt.Errorf("%w: execution error", err)\n }\n return nil\n }\n\n app.Get("/foo/:sleepTime", timeout.NewWithContext(h, 2*time.Second, ErrFooTimeOut))\n log.Fatal(app.Listen(":3000"))\n}\n\nfunc sleepWithContextWithCustomError(ctx context.Context, d time.Duration) error {\n timer := time.NewTimer(d)\n select {\n case <-ctx.Done():\n if !timer.Stop() {\n <-timer.C\n }\n return ErrFooTimeOut\n case <-timer.C:\n }\n return nil\n}\n')),(0,i.kt)("p",null,"Sample usage with a DB call:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n db, _ := gorm.Open(postgres.Open("postgres://localhost/foodb"), &gorm.Config{})\n\n handler := func(ctx *fiber.Ctx) error {\n tran := db.WithContext(ctx.UserContext()).Begin()\n \n if tran = tran.Exec("SELECT pg_sleep(50)"); tran.Error != nil {\n return tran.Error\n }\n \n if tran = tran.Commit(); tran.Error != nil {\n return tran.Error\n }\n\n return nil\n }\n\n app.Get("/foo", timeout.NewWithContext(handler, 10*time.Second))\n log.Fatal(app.Listen(":3000"))\n}\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5373],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>f});var n=r(7294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var p=n.createContext({}),u=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},s=function(e){var t=u(e.components);return n.createElement(p.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,o=e.originalType,p=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),c=u(r),d=i,f=c["".concat(p,".").concat(d)]||c[d]||m[d]||o;return r?n.createElement(f,a(a({ref:t},s),{},{components:r})):n.createElement(f,a({ref:t},s))}));function f(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=r.length,a=new Array(o);a[0]=d;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[c]="string"==typeof e?e:i,a[1]=l;for(var u=2;u{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>a,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>u});var n=r(7462),i=(r(7294),r(3905));const o={id:"timeout",title:"Timeout"},a=void 0,l={unversionedId:"api/middleware/timeout",id:"version-v2.x/api/middleware/timeout",title:"Timeout",description:"There exist two distinct implementations of timeout middleware Fiber.",source:"@site/versioned_docs/version-v2.x/api/middleware/timeout.md",sourceDirName:"api/middleware",slug:"/api/middleware/timeout",permalink:"/api/middleware/timeout",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"timeout",title:"Timeout"},sidebar:"tutorialSidebar",previous:{title:"Skip",permalink:"/api/middleware/skip"},next:{title:"Guide",permalink:"/category/guide"}},p={},u=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2}],s={toc:u},c="wrapper";function m(e){let{components:t,...r}=e;return(0,i.kt)(c,(0,n.Z)({},s,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"There exist two distinct implementations of timeout middleware ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber"),"."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"New")),(0,i.kt)("p",null,"Wraps a ",(0,i.kt)("inlineCode",{parentName:"p"},"fiber.Handler")," with a timeout. If the handler takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ",(0,i.kt)("a",{parentName:"p",href:"https://docs.gofiber.io/error-handling"},"ErrorHandler"),"."),(0,i.kt)("admonition",{type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"This has been deprecated since it raises race conditions.")),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"NewWithContext")),(0,i.kt)("p",null,"As a ",(0,i.kt)("inlineCode",{parentName:"p"},"fiber.Handler")," wrapper, it creates a context with ",(0,i.kt)("inlineCode",{parentName:"p"},"context.WithTimeout")," and pass it in ",(0,i.kt)("inlineCode",{parentName:"p"},"UserContext"),". "),(0,i.kt)("p",null,"If the context passed executions (eg. DB ops, Http calls) takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ",(0,i.kt)("inlineCode",{parentName:"p"},"ErrorHandler"),"."),(0,i.kt)("p",null,"It does not cancel long running executions. Underlying executions must handle timeout by using ",(0,i.kt)("inlineCode",{parentName:"p"},"context.Context")," parameter."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler\nfunc NewWithContext(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/timeout"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n h := func(c *fiber.Ctx) error {\n sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")\n if err := sleepWithContext(c.UserContext(), sleepTime); err != nil {\n return fmt.Errorf("%w: execution error", err)\n }\n return nil\n }\n\n app.Get("/foo/:sleepTime", timeout.New(h, 2*time.Second))\n log.Fatal(app.Listen(":3000"))\n}\n\nfunc sleepWithContext(ctx context.Context, d time.Duration) error {\n timer := time.NewTimer(d)\n\n select {\n case <-ctx.Done():\n if !timer.Stop() {\n <-timer.C\n }\n return context.DeadlineExceeded\n case <-timer.C:\n }\n return nil\n}\n')),(0,i.kt)("p",null,"Test http 200 with curl:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"curl --location -I --request GET 'http://localhost:3000/foo/1000' \n")),(0,i.kt)("p",null,"Test http 408 with curl:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"curl --location -I --request GET 'http://localhost:3000/foo/3000' \n")),(0,i.kt)("p",null,"Use with custom error:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ErrFooTimeOut = errors.New("foo context canceled")\n\nfunc main() {\n app := fiber.New()\n h := func(c *fiber.Ctx) error {\n sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")\n if err := sleepWithContextWithCustomError(c.UserContext(), sleepTime); err != nil {\n return fmt.Errorf("%w: execution error", err)\n }\n return nil\n }\n\n app.Get("/foo/:sleepTime", timeout.NewWithContext(h, 2*time.Second, ErrFooTimeOut))\n log.Fatal(app.Listen(":3000"))\n}\n\nfunc sleepWithContextWithCustomError(ctx context.Context, d time.Duration) error {\n timer := time.NewTimer(d)\n select {\n case <-ctx.Done():\n if !timer.Stop() {\n <-timer.C\n }\n return ErrFooTimeOut\n case <-timer.C:\n }\n return nil\n}\n')),(0,i.kt)("p",null,"Sample usage with a DB call:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n db, _ := gorm.Open(postgres.Open("postgres://localhost/foodb"), &gorm.Config{})\n\n handler := func(ctx *fiber.Ctx) error {\n tran := db.WithContext(ctx.UserContext()).Begin()\n \n if tran = tran.Exec("SELECT pg_sleep(50)"); tran.Error != nil {\n return tran.Error\n }\n \n if tran = tran.Commit(); tran.Error != nil {\n return tran.Error\n }\n\n return nil\n }\n\n app.Get("/foo", timeout.NewWithContext(handler, 10*time.Second))\n log.Fatal(app.Listen(":3000"))\n}\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/0fb7e018.282bab2b.js b/assets/js/0fb7e018.4a6f79bc.js similarity index 99% rename from assets/js/0fb7e018.282bab2b.js rename to assets/js/0fb7e018.4a6f79bc.js index 7562e5bc00e..da239dedd83 100644 --- a/assets/js/0fb7e018.282bab2b.js +++ b/assets/js/0fb7e018.4a6f79bc.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8781],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>d});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},c=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),m=p(n),h=a,d=m["".concat(s,".").concat(h)]||m[h]||u[h]||i;return n?r.createElement(d,l(l({ref:t},c),{},{components:n})):r.createElement(d,l({ref:t},c))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,l=new Array(i);l[0]=h;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[m]="string"==typeof e?e:a,l[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const i={id:"mustache",title:"Mustache"},l=void 0,o={unversionedId:"mustache/mustache",id:"mustache/mustache",title:"Mustache",description:"Release",source:"@site/docs/template/mustache/README.md",sourceDirName:"mustache",slug:"/mustache/",permalink:"/template/mustache/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/mustache/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"mustache",title:"Mustache"},sidebar:"tutorialSidebar",previous:{title:"Jet",permalink:"/template/jet/"},next:{title:"Pug",permalink:"/template/pug/"}},s={},p=[{value:"Basic Example",id:"basic-example",level:3}],c={toc:p},m="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(m,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Mustache is a template engine created by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/cbroglie/mustache"},"hoisie/cbroglie"),", to see the original syntax documentation please ",(0,a.kt)("a",{parentName:"p",href:"https://mustache.github.io/mustache.5.html"},"click here")),(0,a.kt)("h3",{id:"basic-example"},"Basic Example"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/index.mustache"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"{{> views/partials/header }}\n\n

{{Title}}

\n\n{{> views/partials/footer }}\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/header.mustache"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"

Header

\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/footer.mustache"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"

Footer

\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/layouts/main.mustache"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"\n\n\n\n Main\n\n\n\n {{{embed}}}\n\n\n\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n \n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/mustache/v2"\n)\n\nfunc main() {\n // Create a new engine\n engine := mustache.New("./views", ".mustache")\n\n // Or from an embedded system\n // Note that with an embedded system the partials included from template files must be\n // specified relative to the filesystem\'s root, not the current working directory\n // engine := mustache.NewFileSystem(http.Dir("./views", ".mustache"), ".mustache")\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8781],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>d});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},c=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),m=p(n),h=a,d=m["".concat(s,".").concat(h)]||m[h]||u[h]||i;return n?r.createElement(d,l(l({ref:t},c),{},{components:n})):r.createElement(d,l({ref:t},c))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,l=new Array(i);l[0]=h;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[m]="string"==typeof e?e:a,l[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const i={id:"mustache",title:"Mustache"},l=void 0,o={unversionedId:"mustache/mustache",id:"mustache/mustache",title:"Mustache",description:"Release",source:"@site/docs/template/mustache/README.md",sourceDirName:"mustache",slug:"/mustache/",permalink:"/template/mustache/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/mustache/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"mustache",title:"Mustache"},sidebar:"tutorialSidebar",previous:{title:"Jet",permalink:"/template/jet/"},next:{title:"Pug",permalink:"/template/pug/"}},s={},p=[{value:"Basic Example",id:"basic-example",level:3}],c={toc:p},m="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(m,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Mustache is a template engine created by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/cbroglie/mustache"},"hoisie/cbroglie"),", to see the original syntax documentation please ",(0,a.kt)("a",{parentName:"p",href:"https://mustache.github.io/mustache.5.html"},"click here")),(0,a.kt)("h3",{id:"basic-example"},"Basic Example"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/index.mustache"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"{{> views/partials/header }}\n\n

{{Title}}

\n\n{{> views/partials/footer }}\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/header.mustache"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"

Header

\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/footer.mustache"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"

Footer

\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/layouts/main.mustache"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"\n\n\n\n Main\n\n\n\n {{{embed}}}\n\n\n\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n \n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/mustache/v2"\n)\n\nfunc main() {\n // Create a new engine\n engine := mustache.New("./views", ".mustache")\n\n // Or from an embedded system\n // Note that with an embedded system the partials included from template files must be\n // specified relative to the filesystem\'s root, not the current working directory\n // engine := mustache.NewFileSystem(http.Dir("./views", ".mustache"), ".mustache")\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/105f1242.f17a9f3c.js b/assets/js/105f1242.519a9758.js similarity index 98% rename from assets/js/105f1242.f17a9f3c.js rename to assets/js/105f1242.519a9758.js index 6cf68b1624a..9494053f6eb 100644 --- a/assets/js/105f1242.f17a9f3c.js +++ b/assets/js/105f1242.519a9758.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[509],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},c=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,c=p(e,["components","mdxType","originalType","parentName"]),u=s(r),f=a,m=u["".concat(l,".").concat(f)]||u[f]||d[f]||i;return r?n.createElement(m,o(o({ref:t},c),{},{components:r})):n.createElement(m,o({ref:t},c))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=f;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p[u]="string"==typeof e?e:a,o[1]=p;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>p,toc:()=>s});var n=r(7462),a=(r(7294),r(3905));const i={id:"skip",title:"Skip"},o=void 0,p={unversionedId:"api/middleware/skip",id:"version-v2.x/api/middleware/skip",title:"Skip",description:"Skip middleware for Fiber that skips a wrapped handler if a predicate is true.",source:"@site/versioned_docs/version-v2.x/api/middleware/skip.md",sourceDirName:"api/middleware",slug:"/api/middleware/skip",permalink:"/api/middleware/skip",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"skip",title:"Skip"},sidebar:"tutorialSidebar",previous:{title:"Session",permalink:"/api/middleware/session"},next:{title:"Timeout",permalink:"/api/middleware/timeout"}},l={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2}],c={toc:s},u="wrapper";function d(e){let{components:t,...r}=e;return(0,a.kt)(u,(0,n.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Skip middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that skips a wrapped handler if a predicate is true."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/skip"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool {\n return ctx.Method() == fiber.MethodGet\n }))\n\n app.Get("/", func(ctx *fiber.Ctx) error {\n return ctx.SendString("It was a GET request!")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\nfunc BasicHandler(ctx *fiber.Ctx) error {\n return ctx.SendString("It was not a GET request!")\n}\n')),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.")))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[509],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},c=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,c=p(e,["components","mdxType","originalType","parentName"]),u=s(r),f=a,m=u["".concat(l,".").concat(f)]||u[f]||d[f]||i;return r?n.createElement(m,o(o({ref:t},c),{},{components:r})):n.createElement(m,o({ref:t},c))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=f;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p[u]="string"==typeof e?e:a,o[1]=p;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>p,toc:()=>s});var n=r(7462),a=(r(7294),r(3905));const i={id:"skip",title:"Skip"},o=void 0,p={unversionedId:"api/middleware/skip",id:"version-v2.x/api/middleware/skip",title:"Skip",description:"Skip middleware for Fiber that skips a wrapped handler if a predicate is true.",source:"@site/versioned_docs/version-v2.x/api/middleware/skip.md",sourceDirName:"api/middleware",slug:"/api/middleware/skip",permalink:"/api/middleware/skip",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"skip",title:"Skip"},sidebar:"tutorialSidebar",previous:{title:"Session",permalink:"/api/middleware/session"},next:{title:"Timeout",permalink:"/api/middleware/timeout"}},l={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2}],c={toc:s},u="wrapper";function d(e){let{components:t,...r}=e;return(0,a.kt)(u,(0,n.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Skip middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that skips a wrapped handler if a predicate is true."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/skip"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool {\n return ctx.Method() == fiber.MethodGet\n }))\n\n app.Get("/", func(ctx *fiber.Ctx) error {\n return ctx.SendString("It was a GET request!")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\nfunc BasicHandler(ctx *fiber.Ctx) error {\n return ctx.SendString("It was not a GET request!")\n}\n')),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/11ab8220.770c36de.js b/assets/js/11ab8220.681eb402.js similarity index 99% rename from assets/js/11ab8220.770c36de.js rename to assets/js/11ab8220.681eb402.js index df7a5d7a74c..8e0e4e01ae9 100644 --- a/assets/js/11ab8220.770c36de.js +++ b/assets/js/11ab8220.681eb402.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6763],{3905:(e,r,t)=>{t.d(r,{Zo:()=>f,kt:()=>m});var n=t(7294);function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=n.createContext({}),p=function(e){var r=n.useContext(l),t=r;return e&&(t="function"==typeof e?e(r):a(a({},r),e)),t},f=function(e){var r=p(e.components);return n.createElement(l.Provider,{value:r},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},d=n.forwardRef((function(e,r){var t=e.components,i=e.mdxType,o=e.originalType,l=e.parentName,f=s(e,["components","mdxType","originalType","parentName"]),u=p(t),d=i,m=u["".concat(l,".").concat(d)]||u[d]||c[d]||o;return t?n.createElement(m,a(a({ref:r},f),{},{components:t})):n.createElement(m,a({ref:r},f))}));function m(e,r){var t=arguments,i=r&&r.mdxType;if("string"==typeof e||i){var o=t.length,a=new Array(o);a[0]=d;var s={};for(var l in r)hasOwnProperty.call(r,l)&&(s[l]=r[l]);s.originalType=e,s[u]="string"==typeof e?e:i,a[1]=s;for(var p=2;p{t.r(r),t.d(r,{assets:()=>l,contentTitle:()=>a,default:()=>c,frontMatter:()=>o,metadata:()=>s,toc:()=>p});var n=t(7462),i=(t(7294),t(3905));const o={id:"proxy",title:"Proxy"},a=void 0,s={unversionedId:"api/middleware/proxy",id:"api/middleware/proxy",title:"Proxy",description:"Proxy middleware for Fiber that allows you to proxy requests to multiple servers.",source:"@site/docs/core/api/middleware/proxy.md",sourceDirName:"api/middleware",slug:"/api/middleware/proxy",permalink:"/next/api/middleware/proxy",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/proxy.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"proxy",title:"Proxy"},sidebar:"tutorialSidebar",previous:{title:"Pprof",permalink:"/next/api/middleware/pprof"},next:{title:"Recover",permalink:"/next/api/middleware/recover"}},l={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],f={toc:p},u="wrapper";function c(e){let{components:r,...t}=e;return(0,i.kt)(u,(0,n.Z)({},f,t,{components:r,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Proxy middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that allows you to proxy requests to multiple servers."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"// Balancer create a load balancer among multiple upstrem servers.\nfunc Balancer(config Config) fiber.Handler\n// Forward performs the given http request and fills the given http response.\nfunc Forward(addr string, clients ...*fasthttp.Client) fiber.Handler\n// Do performs the given http request and fills the given http response.\nfunc Do(c *fiber.Ctx, addr string, clients ...*fasthttp.Client) error\n// DoRedirects performs the given http request and fills the given http response while following up to maxRedirectsCount redirects.\nfunc DoRedirects(c *fiber.Ctx, addr string, maxRedirectsCount int, clients ...*fasthttp.Client) error\n// DoDeadline performs the given request and waits for response until the given deadline.\nfunc DoDeadline(c *fiber.Ctx, addr string, deadline time.Time, clients ...*fasthttp.Client) error\n// DoTimeout performs the given request and waits for response during the given timeout duration.\nfunc DoTimeout(c *fiber.Ctx, addr string, timeout time.Duration, clients ...*fasthttp.Client) error\n// DomainForward the given http request based on the given domain and fills the given http response\nfunc DomainForward(hostname string, addr string, clients ...*fasthttp.Client) fiber.Handler\n// BalancerForward performs the given http request based round robin balancer and fills the given http response\nfunc BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/proxy"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// if target https site uses a self-signed certificate, you should\n// call WithTlsConfig before Do and Forward\nproxy.WithTlsConfig(&tls.Config{\n InsecureSkipVerify: true,\n})\n// if you need to use global self-custom client, you should use proxy.WithClient.\nproxy.WithClient(&fasthttp.Client{\n NoDefaultUserAgentHeader: true, \n DisablePathNormalizing: true,\n})\n\n// Forward to url\napp.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif"))\n\n// If you want to forward with a specific domain. You have to use proxy.DomainForward.\napp.Get("/payments", proxy.DomainForward("docs.gofiber.io", "http://localhost:8000"))\n\n// Forward to url with local custom client\napp.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif", &fasthttp.Client{\n NoDefaultUserAgentHeader: true, \n DisablePathNormalizing: true,\n}))\n\n// Make request within handler\napp.Get("/:id", func(c *fiber.Ctx) error {\n url := "https://i.imgur.com/"+c.Params("id")+".gif"\n if err := proxy.Do(c, url); err != nil {\n return err\n }\n // Remove Server header from response\n c.Response().Header.Del(fiber.HeaderServer)\n return nil\n})\n\n// Make proxy requests while following redirects\napp.Get("/proxy", func(c *fiber.Ctx) error {\n if err := proxy.DoRedirects(c, "http://google.com", 3); err != nil {\n return err\n }\n // Remove Server header from response\n c.Response().Header.Del(fiber.HeaderServer)\n return nil\n})\n\n// Make proxy requests and wait up to 5 seconds before timing out\napp.Get("/proxy", func(c *fiber.Ctx) error {\n if err := proxy.DoTimeout(c, "http://localhost:3000", time.Second * 5); err != nil {\n return err\n }\n // Remove Server header from response\n c.Response().Header.Del(fiber.HeaderServer)\n return nil\n})\n\n// Make proxy requests, timeout a minute from now\napp.Get("/proxy", func(c *fiber.Ctx) error {\n if err := proxy.DoDeadline(c, "http://localhost", time.Now().Add(time.Minute)); err != nil {\n return err\n }\n // Remove Server header from response\n c.Response().Header.Del(fiber.HeaderServer)\n return nil\n})\n\n// Minimal round robin balancer\napp.Use(proxy.Balancer(proxy.Config{\n Servers: []string{\n "http://localhost:3001",\n "http://localhost:3002",\n "http://localhost:3003",\n },\n}))\n\n// Or extend your balancer for customization\napp.Use(proxy.Balancer(proxy.Config{\n Servers: []string{\n "http://localhost:3001",\n "http://localhost:3002",\n "http://localhost:3003",\n },\n ModifyRequest: func(c *fiber.Ctx) error {\n c.Request().Header.Add("X-Real-IP", c.IP())\n return nil\n },\n ModifyResponse: func(c *fiber.Ctx) error {\n c.Response().Header.Del(fiber.HeaderServer)\n return nil\n },\n}))\n\n// Or this way if the balancer is using https and the destination server is only using http.\napp.Use(proxy.BalancerForward([]string{\n "http://localhost:3001",\n "http://localhost:3002",\n "http://localhost:3003",\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Servers defines a list of :// HTTP servers,\n //\n // which are used in a round-robin manner.\n // i.e.: \"https://foobar.com, http://www.foobar.com\"\n //\n // Required\n Servers []string\n\n // ModifyRequest allows you to alter the request\n //\n // Optional. Default: nil\n ModifyRequest fiber.Handler\n\n // ModifyResponse allows you to alter the response\n //\n // Optional. Default: nil\n ModifyResponse fiber.Handler\n \n // Timeout is the request timeout used when calling the proxy client\n //\n // Optional. Default: 1 second\n Timeout time.Duration\n\n // Per-connection buffer size for requests' reading.\n // This also limits the maximum header size.\n // Increase this buffer if your clients send multi-KB RequestURIs\n // and/or multi-KB headers (for example, BIG cookies).\n ReadBufferSize int\n \n // Per-connection buffer size for responses' writing.\n WriteBufferSize int\n\n // tls config for the http client.\n TlsConfig *tls.Config \n \n // Client is custom client when client config is complex. \n // Note that Servers, Timeout, WriteBufferSize, ReadBufferSize and TlsConfig \n // will not be used if the client are set.\n Client *fasthttp.LBClient\n}\n")),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n ModifyRequest: nil,\n ModifyResponse: nil,\n Timeout: fasthttp.DefaultLBClientTimeout,\n}\n")))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6763],{3905:(e,r,t)=>{t.d(r,{Zo:()=>f,kt:()=>m});var n=t(7294);function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=n.createContext({}),p=function(e){var r=n.useContext(l),t=r;return e&&(t="function"==typeof e?e(r):a(a({},r),e)),t},f=function(e){var r=p(e.components);return n.createElement(l.Provider,{value:r},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},d=n.forwardRef((function(e,r){var t=e.components,i=e.mdxType,o=e.originalType,l=e.parentName,f=s(e,["components","mdxType","originalType","parentName"]),u=p(t),d=i,m=u["".concat(l,".").concat(d)]||u[d]||c[d]||o;return t?n.createElement(m,a(a({ref:r},f),{},{components:t})):n.createElement(m,a({ref:r},f))}));function m(e,r){var t=arguments,i=r&&r.mdxType;if("string"==typeof e||i){var o=t.length,a=new Array(o);a[0]=d;var s={};for(var l in r)hasOwnProperty.call(r,l)&&(s[l]=r[l]);s.originalType=e,s[u]="string"==typeof e?e:i,a[1]=s;for(var p=2;p{t.r(r),t.d(r,{assets:()=>l,contentTitle:()=>a,default:()=>c,frontMatter:()=>o,metadata:()=>s,toc:()=>p});var n=t(7462),i=(t(7294),t(3905));const o={id:"proxy",title:"Proxy"},a=void 0,s={unversionedId:"api/middleware/proxy",id:"api/middleware/proxy",title:"Proxy",description:"Proxy middleware for Fiber that allows you to proxy requests to multiple servers.",source:"@site/docs/core/api/middleware/proxy.md",sourceDirName:"api/middleware",slug:"/api/middleware/proxy",permalink:"/next/api/middleware/proxy",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/proxy.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"proxy",title:"Proxy"},sidebar:"tutorialSidebar",previous:{title:"Pprof",permalink:"/next/api/middleware/pprof"},next:{title:"Recover",permalink:"/next/api/middleware/recover"}},l={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],f={toc:p},u="wrapper";function c(e){let{components:r,...t}=e;return(0,i.kt)(u,(0,n.Z)({},f,t,{components:r,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Proxy middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that allows you to proxy requests to multiple servers."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"// Balancer create a load balancer among multiple upstrem servers.\nfunc Balancer(config Config) fiber.Handler\n// Forward performs the given http request and fills the given http response.\nfunc Forward(addr string, clients ...*fasthttp.Client) fiber.Handler\n// Do performs the given http request and fills the given http response.\nfunc Do(c *fiber.Ctx, addr string, clients ...*fasthttp.Client) error\n// DoRedirects performs the given http request and fills the given http response while following up to maxRedirectsCount redirects.\nfunc DoRedirects(c *fiber.Ctx, addr string, maxRedirectsCount int, clients ...*fasthttp.Client) error\n// DoDeadline performs the given request and waits for response until the given deadline.\nfunc DoDeadline(c *fiber.Ctx, addr string, deadline time.Time, clients ...*fasthttp.Client) error\n// DoTimeout performs the given request and waits for response during the given timeout duration.\nfunc DoTimeout(c *fiber.Ctx, addr string, timeout time.Duration, clients ...*fasthttp.Client) error\n// DomainForward the given http request based on the given domain and fills the given http response\nfunc DomainForward(hostname string, addr string, clients ...*fasthttp.Client) fiber.Handler\n// BalancerForward performs the given http request based round robin balancer and fills the given http response\nfunc BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/proxy"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// if target https site uses a self-signed certificate, you should\n// call WithTlsConfig before Do and Forward\nproxy.WithTlsConfig(&tls.Config{\n InsecureSkipVerify: true,\n})\n// if you need to use global self-custom client, you should use proxy.WithClient.\nproxy.WithClient(&fasthttp.Client{\n NoDefaultUserAgentHeader: true, \n DisablePathNormalizing: true,\n})\n\n// Forward to url\napp.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif"))\n\n// If you want to forward with a specific domain. You have to use proxy.DomainForward.\napp.Get("/payments", proxy.DomainForward("docs.gofiber.io", "http://localhost:8000"))\n\n// Forward to url with local custom client\napp.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif", &fasthttp.Client{\n NoDefaultUserAgentHeader: true, \n DisablePathNormalizing: true,\n}))\n\n// Make request within handler\napp.Get("/:id", func(c *fiber.Ctx) error {\n url := "https://i.imgur.com/"+c.Params("id")+".gif"\n if err := proxy.Do(c, url); err != nil {\n return err\n }\n // Remove Server header from response\n c.Response().Header.Del(fiber.HeaderServer)\n return nil\n})\n\n// Make proxy requests while following redirects\napp.Get("/proxy", func(c *fiber.Ctx) error {\n if err := proxy.DoRedirects(c, "http://google.com", 3); err != nil {\n return err\n }\n // Remove Server header from response\n c.Response().Header.Del(fiber.HeaderServer)\n return nil\n})\n\n// Make proxy requests and wait up to 5 seconds before timing out\napp.Get("/proxy", func(c *fiber.Ctx) error {\n if err := proxy.DoTimeout(c, "http://localhost:3000", time.Second * 5); err != nil {\n return err\n }\n // Remove Server header from response\n c.Response().Header.Del(fiber.HeaderServer)\n return nil\n})\n\n// Make proxy requests, timeout a minute from now\napp.Get("/proxy", func(c *fiber.Ctx) error {\n if err := proxy.DoDeadline(c, "http://localhost", time.Now().Add(time.Minute)); err != nil {\n return err\n }\n // Remove Server header from response\n c.Response().Header.Del(fiber.HeaderServer)\n return nil\n})\n\n// Minimal round robin balancer\napp.Use(proxy.Balancer(proxy.Config{\n Servers: []string{\n "http://localhost:3001",\n "http://localhost:3002",\n "http://localhost:3003",\n },\n}))\n\n// Or extend your balancer for customization\napp.Use(proxy.Balancer(proxy.Config{\n Servers: []string{\n "http://localhost:3001",\n "http://localhost:3002",\n "http://localhost:3003",\n },\n ModifyRequest: func(c *fiber.Ctx) error {\n c.Request().Header.Add("X-Real-IP", c.IP())\n return nil\n },\n ModifyResponse: func(c *fiber.Ctx) error {\n c.Response().Header.Del(fiber.HeaderServer)\n return nil\n },\n}))\n\n// Or this way if the balancer is using https and the destination server is only using http.\napp.Use(proxy.BalancerForward([]string{\n "http://localhost:3001",\n "http://localhost:3002",\n "http://localhost:3003",\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Servers defines a list of :// HTTP servers,\n //\n // which are used in a round-robin manner.\n // i.e.: \"https://foobar.com, http://www.foobar.com\"\n //\n // Required\n Servers []string\n\n // ModifyRequest allows you to alter the request\n //\n // Optional. Default: nil\n ModifyRequest fiber.Handler\n\n // ModifyResponse allows you to alter the response\n //\n // Optional. Default: nil\n ModifyResponse fiber.Handler\n \n // Timeout is the request timeout used when calling the proxy client\n //\n // Optional. Default: 1 second\n Timeout time.Duration\n\n // Per-connection buffer size for requests' reading.\n // This also limits the maximum header size.\n // Increase this buffer if your clients send multi-KB RequestURIs\n // and/or multi-KB headers (for example, BIG cookies).\n ReadBufferSize int\n \n // Per-connection buffer size for responses' writing.\n WriteBufferSize int\n\n // tls config for the http client.\n TlsConfig *tls.Config \n \n // Client is custom client when client config is complex. \n // Note that Servers, Timeout, WriteBufferSize, ReadBufferSize and TlsConfig \n // will not be used if the client are set.\n Client *fasthttp.LBClient\n}\n")),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n ModifyRequest: nil,\n ModifyResponse: nil,\n Timeout: fasthttp.DefaultLBClientTimeout,\n}\n")))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/14a7e971.9dc2d0a2.js b/assets/js/14a7e971.424e0cb1.js similarity index 99% rename from assets/js/14a7e971.9dc2d0a2.js rename to assets/js/14a7e971.424e0cb1.js index 2ff5b1c2eaa..4c287227995 100644 --- a/assets/js/14a7e971.9dc2d0a2.js +++ b/assets/js/14a7e971.424e0cb1.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2369],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),u=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=u(e.components);return r.createElement(s.Provider,{value:t},e.children)},l="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,c=p(e,["components","mdxType","originalType","parentName"]),l=u(n),m=a,f=l["".concat(s,".").concat(m)]||l[m]||d[m]||o;return n?r.createElement(f,i(i({ref:t},c),{},{components:n})):r.createElement(f,i({ref:t},c))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=m;var p={};for(var s in t)hasOwnProperty.call(t,s)&&(p[s]=t[s]);p.originalType=e,p[l]="string"==typeof e?e:a,i[1]=p;for(var u=2;u{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>p,toc:()=>u});var r=n(7462),a=(n(7294),n(3905));const o={id:"routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",sidebar_position:1},i=void 0,p={unversionedId:"guide/routing",id:"version-v1.x/guide/routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",source:"@site/versioned_docs/version-v1.x/guide/routing.md",sourceDirName:"guide",slug:"/guide/routing",permalink:"/v1.x/guide/routing",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{id:"routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Guide",permalink:"/v1.x/category/guide"},next:{title:"\ud83c\udfad Grouping",permalink:"/v1.x/guide/grouping"}},s={},u=[{value:"Paths",id:"paths",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Middleware",id:"middleware",level:2},{value:"Grouping",id:"grouping",level:2}],c={toc:u},l="wrapper";function d(e){let{components:t,...n}=e;return(0,a.kt)(l,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"paths"},"Paths"),(0,a.kt)("p",null,"Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be ",(0,a.kt)("strong",{parentName:"p"},"strings")," or ",(0,a.kt)("strong",{parentName:"p"},"string patterns"),"."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Examples of route paths based on strings")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// This route path will match requests to the root route, "/":\napp.Get("/", func(c *fiber.Ctx) {\n c.Send("root")\n})\n\n// This route path will match requests to "/about":\napp.Get("/about", func(c *fiber.Ctx) {\n c.Send("about")\n})\n\n// This route path will match requests to "/random.txt":\napp.Get("/random.txt", func(c *fiber.Ctx) {\n c.Send("random.txt")\n})\n')),(0,a.kt)("h2",{id:"parameters"},"Parameters"),(0,a.kt)("p",null,"Route parameters are ",(0,a.kt)("strong",{parentName:"p"},"named URL segments")," that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the ",(0,a.kt)("a",{parentName:"p",href:"https://fiber.wiki/context#params"},"Params")," function, with the name of the route parameter specified in the path as their respective keys."),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"The name of the route parameter must be made up of ",(0,a.kt)("strong",{parentName:"p"},"characters")," ","(",(0,a.kt)("inlineCode",{parentName:"p"},"[A-Za-z0-9_]"),")",".")),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Example of define routes with route parameters")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Parameters\napp.Get("/user/:name/books/:title", func(c *fiber.Ctx) {\n c.Write(c.Params("name"))\n c.Write(c.Params("title"))\n})\n// Wildcard\napp.Get("/user/*", func(c *fiber.Ctx) {\n c.Send(c.Params("*"))\n})\n// Optional parameter\napp.Get("/user/:name?", func(c *fiber.Ctx) {\n c.Send(c.Params("name"))\n})\n')),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"Since the hyphen ","(",(0,a.kt)("inlineCode",{parentName:"p"},"-"),")"," and the dot ","(",(0,a.kt)("inlineCode",{parentName:"p"},"."),")"," are interpreted literally, they can be used along with route parameters for useful purposes.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// http://localhost:3000/plantae/prunus.persica\napp.Get("/plantae/:genus.:species", func(c *fiber.Ctx) {\n c.Params("genus") // prunus\n c.Params("species") // persica\n})\n')),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// http://localhost:3000/flights/LAX-SFO\napp.Get("/flights/:from-:to", func(c *fiber.Ctx) {\n c.Params("from") // LAX\n c.Params("to") // SFO\n})\n')),(0,a.kt)("h2",{id:"middleware"},"Middleware"),(0,a.kt)("p",null,"Functions that are designed to make changes to the request or response are called ",(0,a.kt)("strong",{parentName:"p"},"middleware functions"),". The ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/docs/tree/34729974f7d6c1d8363076e7e88cd71edc34a2ac/context/README.md#next"},"Next")," is a ",(0,a.kt)("strong",{parentName:"p"},"Fiber")," router function, when called, executes the ",(0,a.kt)("strong",{parentName:"p"},"next")," function that ",(0,a.kt)("strong",{parentName:"p"},"matches")," the current route."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Example of a middleware function")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(func(c *fiber.Ctx) {\n // Set some security headers:\n c.Set("X-XSS-Protection", "1; mode=block")\n c.Set("X-Content-Type-Options", "nosniff")\n c.Set("X-Download-Options", "noopen")\n c.Set("Strict-Transport-Security", "max-age=5184000")\n c.Set("X-Frame-Options", "SAMEORIGIN")\n c.Set("X-DNS-Prefetch-Control", "off")\n\n // Go to next middleware:\n c.Next()\n\n // End of the chain\n fmt.Println("Bye \ud83d\udc4b!")\n})\n\napp.Get("/", func(c *fiber.Ctx) {\n c.Send("Hello, World!")\n})\n')),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Use")," method path is a ",(0,a.kt)("strong",{parentName:"p"},"mount"),", or ",(0,a.kt)("strong",{parentName:"p"},"prefix")," path, and limits middleware to only apply to any paths requested that begin with it."),(0,a.kt)("h2",{id:"grouping"},"Grouping"),(0,a.kt)("p",null,"If you have many endpoints, you can organize your routes using ",(0,a.kt)("inlineCode",{parentName:"p"},"Group"),"."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", cors()) // /api\n\n v1 := api.Group("/v1", mysql()) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", mongodb()) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n app.Listen(3000)\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2369],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),u=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=u(e.components);return r.createElement(s.Provider,{value:t},e.children)},l="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,c=p(e,["components","mdxType","originalType","parentName"]),l=u(n),m=a,f=l["".concat(s,".").concat(m)]||l[m]||d[m]||o;return n?r.createElement(f,i(i({ref:t},c),{},{components:n})):r.createElement(f,i({ref:t},c))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=m;var p={};for(var s in t)hasOwnProperty.call(t,s)&&(p[s]=t[s]);p.originalType=e,p[l]="string"==typeof e?e:a,i[1]=p;for(var u=2;u{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>p,toc:()=>u});var r=n(7462),a=(n(7294),n(3905));const o={id:"routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",sidebar_position:1},i=void 0,p={unversionedId:"guide/routing",id:"version-v1.x/guide/routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",source:"@site/versioned_docs/version-v1.x/guide/routing.md",sourceDirName:"guide",slug:"/guide/routing",permalink:"/v1.x/guide/routing",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{id:"routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Guide",permalink:"/v1.x/category/guide"},next:{title:"\ud83c\udfad Grouping",permalink:"/v1.x/guide/grouping"}},s={},u=[{value:"Paths",id:"paths",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Middleware",id:"middleware",level:2},{value:"Grouping",id:"grouping",level:2}],c={toc:u},l="wrapper";function d(e){let{components:t,...n}=e;return(0,a.kt)(l,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"paths"},"Paths"),(0,a.kt)("p",null,"Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be ",(0,a.kt)("strong",{parentName:"p"},"strings")," or ",(0,a.kt)("strong",{parentName:"p"},"string patterns"),"."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Examples of route paths based on strings")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// This route path will match requests to the root route, "/":\napp.Get("/", func(c *fiber.Ctx) {\n c.Send("root")\n})\n\n// This route path will match requests to "/about":\napp.Get("/about", func(c *fiber.Ctx) {\n c.Send("about")\n})\n\n// This route path will match requests to "/random.txt":\napp.Get("/random.txt", func(c *fiber.Ctx) {\n c.Send("random.txt")\n})\n')),(0,a.kt)("h2",{id:"parameters"},"Parameters"),(0,a.kt)("p",null,"Route parameters are ",(0,a.kt)("strong",{parentName:"p"},"named URL segments")," that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the ",(0,a.kt)("a",{parentName:"p",href:"https://fiber.wiki/context#params"},"Params")," function, with the name of the route parameter specified in the path as their respective keys."),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"The name of the route parameter must be made up of ",(0,a.kt)("strong",{parentName:"p"},"characters")," ","(",(0,a.kt)("inlineCode",{parentName:"p"},"[A-Za-z0-9_]"),")",".")),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Example of define routes with route parameters")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Parameters\napp.Get("/user/:name/books/:title", func(c *fiber.Ctx) {\n c.Write(c.Params("name"))\n c.Write(c.Params("title"))\n})\n// Wildcard\napp.Get("/user/*", func(c *fiber.Ctx) {\n c.Send(c.Params("*"))\n})\n// Optional parameter\napp.Get("/user/:name?", func(c *fiber.Ctx) {\n c.Send(c.Params("name"))\n})\n')),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"Since the hyphen ","(",(0,a.kt)("inlineCode",{parentName:"p"},"-"),")"," and the dot ","(",(0,a.kt)("inlineCode",{parentName:"p"},"."),")"," are interpreted literally, they can be used along with route parameters for useful purposes.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// http://localhost:3000/plantae/prunus.persica\napp.Get("/plantae/:genus.:species", func(c *fiber.Ctx) {\n c.Params("genus") // prunus\n c.Params("species") // persica\n})\n')),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// http://localhost:3000/flights/LAX-SFO\napp.Get("/flights/:from-:to", func(c *fiber.Ctx) {\n c.Params("from") // LAX\n c.Params("to") // SFO\n})\n')),(0,a.kt)("h2",{id:"middleware"},"Middleware"),(0,a.kt)("p",null,"Functions that are designed to make changes to the request or response are called ",(0,a.kt)("strong",{parentName:"p"},"middleware functions"),". The ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/docs/tree/34729974f7d6c1d8363076e7e88cd71edc34a2ac/context/README.md#next"},"Next")," is a ",(0,a.kt)("strong",{parentName:"p"},"Fiber")," router function, when called, executes the ",(0,a.kt)("strong",{parentName:"p"},"next")," function that ",(0,a.kt)("strong",{parentName:"p"},"matches")," the current route."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Example of a middleware function")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(func(c *fiber.Ctx) {\n // Set some security headers:\n c.Set("X-XSS-Protection", "1; mode=block")\n c.Set("X-Content-Type-Options", "nosniff")\n c.Set("X-Download-Options", "noopen")\n c.Set("Strict-Transport-Security", "max-age=5184000")\n c.Set("X-Frame-Options", "SAMEORIGIN")\n c.Set("X-DNS-Prefetch-Control", "off")\n\n // Go to next middleware:\n c.Next()\n\n // End of the chain\n fmt.Println("Bye \ud83d\udc4b!")\n})\n\napp.Get("/", func(c *fiber.Ctx) {\n c.Send("Hello, World!")\n})\n')),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Use")," method path is a ",(0,a.kt)("strong",{parentName:"p"},"mount"),", or ",(0,a.kt)("strong",{parentName:"p"},"prefix")," path, and limits middleware to only apply to any paths requested that begin with it."),(0,a.kt)("h2",{id:"grouping"},"Grouping"),(0,a.kt)("p",null,"If you have many endpoints, you can organize your routes using ",(0,a.kt)("inlineCode",{parentName:"p"},"Group"),"."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", cors()) // /api\n\n v1 := api.Group("/v1", mysql()) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", mongodb()) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n app.Listen(3000)\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/15eed0c8.ecdb0f8b.js b/assets/js/15eed0c8.50da9fc6.js similarity index 99% rename from assets/js/15eed0c8.ecdb0f8b.js rename to assets/js/15eed0c8.50da9fc6.js index a689ecd856e..7d554b5d90e 100644 --- a/assets/js/15eed0c8.ecdb0f8b.js +++ b/assets/js/15eed0c8.50da9fc6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9778],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>c});var r=a(7294);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var s=r.createContext({}),g=function(e){var t=r.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},p=function(e){var t=g(e.components);return r.createElement(s.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=g(a),f=n,c=u["".concat(s,".").concat(f)]||u[f]||d[f]||o;return a?r.createElement(c,i(i({ref:t},p),{},{components:a})):r.createElement(c,i({ref:t},p))}));function c(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=a.length,i=new Array(o);i[0]=f;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:n,i[1]=l;for(var g=2;g{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>g});var r=a(7462),n=(a(7294),a(3905));const o={id:"badger",title:"Badger"},i=void 0,l={unversionedId:"badger/badger",id:"badger/badger",title:"Badger",description:"Release",source:"@site/docs/storage/badger/README.md",sourceDirName:"badger",slug:"/badger/",permalink:"/storage/badger/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/badger/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"badger",title:"Badger"},sidebar:"tutorialSidebar",previous:{title:"Azure Blob",permalink:"/storage/azureblob/"},next:{title:"Bbolt",permalink:"/storage/bbolt/"}},s={},g=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],p={toc:g},u="wrapper";function d(e){let{components:t,...a}=e;return(0,n.kt)(u,(0,r.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=badger*",alt:"Release"}),"\n",(0,n.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,n.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-badger.yml?label=Tests",alt:"Test"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,n.kt)("p",null,"A fast key-value DB using ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/dgraph-io/badger"},"dgraph-io/badger")),(0,n.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,n.kt)("h3",{id:"signatures"},"Signatures"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *badger.DB\n")),(0,n.kt)("h3",{id:"installation"},"Installation"),(0,n.kt)("p",null,"Badger is tested on the 2 last ",(0,n.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,n.kt)("p",null,"And then install the badger implementation:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/badger\n")),(0,n.kt)("h3",{id:"examples"},"Examples"),(0,n.kt)("p",null,"Import the storage package."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/badger"\n')),(0,n.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := badger.New()\n\n// Initialize custom config\nstore := badger.New(badger.Config{\n Database: "./fiber.badger",\n Reset: false,\n GCInterval: 10 * time.Second,\n})\n')),(0,n.kt)("h3",{id:"config"},"Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Database name\n //\n // Optional. Default is "./fiber.badger"\n Database string\n\n // Reset clears any existing keys in existing Table\n //\n // Optional. Default is false\n Reset bool\n\n // Time before deleting expired keys\n //\n // Optional. Default is 10 * time.Second\n GCInterval time.Duration\n\n // BadgerOptions is a way to set options in badger\n //\n // Optional. Default is badger.DefaultOptions("./fiber.badger")\n BadgerOptions badger.Options\n\n // Logger is the default logger used by badger\n //\n // Optional. Default is nil\n Logger badger.Logger\n\n // UseLogger define if any logger will be used\n //\n // Optional. Default is false\n UseLogger bool\n}\n')),(0,n.kt)("h3",{id:"default-config"},"Default Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Database: "./fiber.badger",\n Reset: false,\n GCInterval: 10 * time.Second,\n BadgerOptions: badger.DefaultOptions("./fiber.badger").WithLogger(nil),\n Logger: nil,\n UseLogger: false,\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9778],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>c});var r=a(7294);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var s=r.createContext({}),g=function(e){var t=r.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},p=function(e){var t=g(e.components);return r.createElement(s.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=g(a),f=n,c=u["".concat(s,".").concat(f)]||u[f]||d[f]||o;return a?r.createElement(c,i(i({ref:t},p),{},{components:a})):r.createElement(c,i({ref:t},p))}));function c(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=a.length,i=new Array(o);i[0]=f;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:n,i[1]=l;for(var g=2;g{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>g});var r=a(7462),n=(a(7294),a(3905));const o={id:"badger",title:"Badger"},i=void 0,l={unversionedId:"badger/badger",id:"badger/badger",title:"Badger",description:"Release",source:"@site/docs/storage/badger/README.md",sourceDirName:"badger",slug:"/badger/",permalink:"/storage/badger/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/badger/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"badger",title:"Badger"},sidebar:"tutorialSidebar",previous:{title:"Azure Blob",permalink:"/storage/azureblob/"},next:{title:"Bbolt",permalink:"/storage/bbolt/"}},s={},g=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],p={toc:g},u="wrapper";function d(e){let{components:t,...a}=e;return(0,n.kt)(u,(0,r.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=badger*",alt:"Release"}),"\n",(0,n.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,n.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-badger.yml?label=Tests",alt:"Test"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,n.kt)("p",null,"A fast key-value DB using ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/dgraph-io/badger"},"dgraph-io/badger")),(0,n.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,n.kt)("h3",{id:"signatures"},"Signatures"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *badger.DB\n")),(0,n.kt)("h3",{id:"installation"},"Installation"),(0,n.kt)("p",null,"Badger is tested on the 2 last ",(0,n.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,n.kt)("p",null,"And then install the badger implementation:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/badger\n")),(0,n.kt)("h3",{id:"examples"},"Examples"),(0,n.kt)("p",null,"Import the storage package."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/badger"\n')),(0,n.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := badger.New()\n\n// Initialize custom config\nstore := badger.New(badger.Config{\n Database: "./fiber.badger",\n Reset: false,\n GCInterval: 10 * time.Second,\n})\n')),(0,n.kt)("h3",{id:"config"},"Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Database name\n //\n // Optional. Default is "./fiber.badger"\n Database string\n\n // Reset clears any existing keys in existing Table\n //\n // Optional. Default is false\n Reset bool\n\n // Time before deleting expired keys\n //\n // Optional. Default is 10 * time.Second\n GCInterval time.Duration\n\n // BadgerOptions is a way to set options in badger\n //\n // Optional. Default is badger.DefaultOptions("./fiber.badger")\n BadgerOptions badger.Options\n\n // Logger is the default logger used by badger\n //\n // Optional. Default is nil\n Logger badger.Logger\n\n // UseLogger define if any logger will be used\n //\n // Optional. Default is false\n UseLogger bool\n}\n')),(0,n.kt)("h3",{id:"default-config"},"Default Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Database: "./fiber.badger",\n Reset: false,\n GCInterval: 10 * time.Second,\n BadgerOptions: badger.DefaultOptions("./fiber.badger").WithLogger(nil),\n Logger: nil,\n UseLogger: false,\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/187263b9.bfb865ab.js b/assets/js/187263b9.595d2ed3.js similarity index 99% rename from assets/js/187263b9.bfb865ab.js rename to assets/js/187263b9.595d2ed3.js index 3d47f2b24f4..28b9d452446 100644 --- a/assets/js/187263b9.bfb865ab.js +++ b/assets/js/187263b9.595d2ed3.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[425],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},g="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),g=u(n),f=a,m=g["".concat(l,".").concat(f)]||g[f]||p[f]||i;return n?r.createElement(m,o(o({ref:t},c),{},{components:n})):r.createElement(m,o({ref:t},c))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=f;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[g]="string"==typeof e?e:a,o[1]=s;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>s,toc:()=>u});var r=n(7462),a=(n(7294),n(3905));const i={id:"s3",title:"S3"},o=void 0,s={unversionedId:"s3/s3",id:"s3/s3",title:"S3",description:"Release",source:"@site/docs/storage/s3/README.md",sourceDirName:"s3",slug:"/s3/",permalink:"/storage/s3/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/s3/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"s3",title:"S3"},sidebar:"tutorialSidebar",previous:{title:"Ristretto",permalink:"/storage/ristretto/"},next:{title:"SQLite3",permalink:"/storage/sqlite3/"}},l={},u=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],c={toc:u},g="wrapper";function p(e){let{components:t,...n}=e;return(0,a.kt)(g,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=s3*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-s3.yml?label=Tests",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,a.kt)("p",null,"A S3 storage driver using ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/aws/aws-sdk-go-v2"},"aws/aws-sdk-go-v2"),"."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Note:")," If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: ",(0,a.kt)("a",{parentName:"p",href:"https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#specifying-credentials"},"specifying credentials")),(0,a.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,a.kt)("h3",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *s3.Client\n")),(0,a.kt)("h3",{id:"installation"},"Installation"),(0,a.kt)("p",null,"S3 is tested on the 2 last ",(0,a.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,a.kt)("p",null,"And then install the s3 implementation:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/s3\n")),(0,a.kt)("h3",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the storage package."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/s3"\n')),(0,a.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := s3.New()\n\n// Initialize custom config\nstore := s3.New(s3.Config{\n Bucket: "my-bucket-url",\n Endpoint: "my-endpoint",\n Region: "my-region",\n Reset: false,\n})\n')),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for storage.\ntype Config struct {\n // S3 bucket name\n Bucket string\n\n // AWS endpoint\n Endpoint string\n\n // AWS region\n Region string\n\n // Request timeout\n //\n // Optional. Default is 0 (no timeout)\n RequestTimeout time.Duration\n\n // Reset clears any existing keys in existing Bucket\n //\n // Optional. Default is false\n Reset bool\n\n // Credentials overrides AWS access key and AWS secret access key. Not recommended.\n //\n // Optional. Default is Credentials{}\n Credentials Credentials\n\n // The maximum number of times requests that encounter retryable failures should be attempted.\n //\n // Optional. Default is 3\n MaxAttempts int\n\n}\n\ntype Credentials struct {\n AccessKey string\n SecretAccessKey string\n}\n")),(0,a.kt)("h3",{id:"default-config"},"Default Config"),(0,a.kt)("p",null,"The default configuration lacks Bucket, Region, and Endpoint which are all required and must be overwritten:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// ConfigDefault is the default config\nvar ConfigDefault = Config{\n Bucket: "",\n Region: "",\n Endpoint: "",\n Credentials: Credentials{},\n MaxAttempts: 3,\n RequestTimeout: 0,\n Reset: false,\n}\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[425],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},g="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),g=u(n),f=a,m=g["".concat(l,".").concat(f)]||g[f]||p[f]||i;return n?r.createElement(m,o(o({ref:t},c),{},{components:n})):r.createElement(m,o({ref:t},c))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=f;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[g]="string"==typeof e?e:a,o[1]=s;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>s,toc:()=>u});var r=n(7462),a=(n(7294),n(3905));const i={id:"s3",title:"S3"},o=void 0,s={unversionedId:"s3/s3",id:"s3/s3",title:"S3",description:"Release",source:"@site/docs/storage/s3/README.md",sourceDirName:"s3",slug:"/s3/",permalink:"/storage/s3/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/s3/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"s3",title:"S3"},sidebar:"tutorialSidebar",previous:{title:"Ristretto",permalink:"/storage/ristretto/"},next:{title:"SQLite3",permalink:"/storage/sqlite3/"}},l={},u=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],c={toc:u},g="wrapper";function p(e){let{components:t,...n}=e;return(0,a.kt)(g,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=s3*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-s3.yml?label=Tests",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,a.kt)("p",null,"A S3 storage driver using ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/aws/aws-sdk-go-v2"},"aws/aws-sdk-go-v2"),"."),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Note:")," If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: ",(0,a.kt)("a",{parentName:"p",href:"https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#specifying-credentials"},"specifying credentials")),(0,a.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,a.kt)("h3",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *s3.Client\n")),(0,a.kt)("h3",{id:"installation"},"Installation"),(0,a.kt)("p",null,"S3 is tested on the 2 last ",(0,a.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,a.kt)("p",null,"And then install the s3 implementation:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/s3\n")),(0,a.kt)("h3",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the storage package."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/s3"\n')),(0,a.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := s3.New()\n\n// Initialize custom config\nstore := s3.New(s3.Config{\n Bucket: "my-bucket-url",\n Endpoint: "my-endpoint",\n Region: "my-region",\n Reset: false,\n})\n')),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for storage.\ntype Config struct {\n // S3 bucket name\n Bucket string\n\n // AWS endpoint\n Endpoint string\n\n // AWS region\n Region string\n\n // Request timeout\n //\n // Optional. Default is 0 (no timeout)\n RequestTimeout time.Duration\n\n // Reset clears any existing keys in existing Bucket\n //\n // Optional. Default is false\n Reset bool\n\n // Credentials overrides AWS access key and AWS secret access key. Not recommended.\n //\n // Optional. Default is Credentials{}\n Credentials Credentials\n\n // The maximum number of times requests that encounter retryable failures should be attempted.\n //\n // Optional. Default is 3\n MaxAttempts int\n\n}\n\ntype Credentials struct {\n AccessKey string\n SecretAccessKey string\n}\n")),(0,a.kt)("h3",{id:"default-config"},"Default Config"),(0,a.kt)("p",null,"The default configuration lacks Bucket, Region, and Endpoint which are all required and must be overwritten:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// ConfigDefault is the default config\nvar ConfigDefault = Config{\n Bucket: "",\n Region: "",\n Endpoint: "",\n Credentials: Credentials{},\n MaxAttempts: 3,\n RequestTimeout: 0,\n Reset: false,\n}\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/19323918.c5f276d7.js b/assets/js/19323918.ba7383aa.js similarity index 99% rename from assets/js/19323918.c5f276d7.js rename to assets/js/19323918.ba7383aa.js index 3653bdb441e..b1b784f8bc6 100644 --- a/assets/js/19323918.c5f276d7.js +++ b/assets/js/19323918.ba7383aa.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2650],{3905:(e,t,n)=>{n.d(t,{Zo:()=>g,kt:()=>c});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},g=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,g=o(e,["components","mdxType","originalType","parentName"]),p=u(n),f=i,c=p["".concat(l,".").concat(f)]||p[f]||d[f]||a;return n?r.createElement(c,s(s({ref:t},g),{},{components:n})):r.createElement(c,s({ref:t},g))}));function c(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,s=new Array(a);s[0]=f;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o[p]="string"==typeof e?e:i,s[1]=o;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>a,metadata:()=>o,toc:()=>u});var r=n(7462),i=(n(7294),n(3905));const a={id:"redis",title:"Redis"},s=void 0,o={unversionedId:"redis/redis",id:"redis/redis",title:"Redis",description:"Release",source:"@site/docs/storage/redis/README.md",sourceDirName:"redis",slug:"/redis/",permalink:"/storage/redis/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/redis/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"redis",title:"Redis"},sidebar:"tutorialSidebar",previous:{title:"Postgres",permalink:"/storage/postgres/"},next:{title:"Ristretto",permalink:"/storage/ristretto/"}},l={},u=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],g={toc:u},p="wrapper";function d(e){let{components:t,...n}=e;return(0,i.kt)(p,(0,r.Z)({},g,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=redis*",alt:"Release"}),"\n",(0,i.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,i.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-redis.yml?label=Tests",alt:"Test"}),"\n",(0,i.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,i.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,i.kt)("p",null,"A Redis storage driver using ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/go-redis/redis"},"go-redis/redis"),"."),(0,i.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,i.kt)("h3",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() redis.UniversalClient\n")),(0,i.kt)("h3",{id:"installation"},"Installation"),(0,i.kt)("p",null,"Redis is tested on the 2 last ",(0,i.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,i.kt)("p",null,"And then install the redis implementation:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/redis/v2\n")),(0,i.kt)("h3",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the storage package."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/redis/v2"\n')),(0,i.kt)("p",null,"You can use the one of the following options to create a Redis Storage:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := redis.New()\n\n// Initialize custom config\nstore := redis.New(redis.Config{\n Host: "127.0.0.1",\n Port: 6379,\n Username: "",\n Password: "",\n Database: 0,\n Reset: false,\n TLSConfig: nil,\n PoolSize: 10 * runtime.GOMAXPROCS(0),\n})\n\n// Initialize Redis Failover Client\nstore := redis.New(redis.Config{\n MasterName: "master-name",\n Addrs: []string{":6379"},\n})\n\n// Initialize Redis Cluster Client\nstore := redis.New(redis.Config{\n Addrs: []string{":6379", ":6380"},\n})\n\n// Create a client with support for TLS\ncer, err := tls.LoadX509KeyPair("./client.crt", "./client.key")\nif err != nil {\n log.Println(err)\n return\n}\ntlsCfg := &tls.Config{\n MinVersion: tls.VersionTLS12,\n InsecureSkipVerify: true,\n Certificates: []tls.Certificate{cer},\n}\nstore = redis.New(redis.Config{\n URL: "redis://:@127.0.0.1:6379/",\n TLSConfig: tlsCfg,\n Reset: false,\n})\n\n// Create a client with a Redis URL with all information.\nstore = redis.New(redis.Config{\n URL: "redis://:@127.0.0.1:6379/",\n Reset: false,\n})\n')),(0,i.kt)("h3",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Host name where the DB is hosted\n //\n // Optional. Default is "127.0.0.1"\n Host string\n\n // Port where the DB is listening on\n //\n // Optional. Default is 6379\n Port int\n\n // Server username\n //\n // Optional. Default is ""\n Username string\n\n // Server password\n //\n // Optional. Default is ""\n Password string\n\n // Database to be selected after connecting to the server.\n //\n // Optional. Default is 0\n Database int\n\n // URL standard format Redis URL. If this is set all other config options, Host, Port, Username, Password, Database have no effect.\n //\n // Example: redis://:@localhost:6379/\n // Optional. Default is ""\n URL string\n\n // Either a single address or a seed list of host:port addresses, this enables FailoverClient and ClusterClient\n //\n // Optional. Default is []string{}\n Addrs []string\n\n // MasterName is the sentinel master\'s name\n //\n // Optional. Default is ""\n MasterName string\n\n // ClientName will execute the `CLIENT SETNAME ClientName` command for each conn.\n //\n // Optional. Default is ""\n ClientName string\n\n // SentinelUsername\n //\n // Optional. Default is ""\n SentinelUsername string\n\n // SentinelPassword\n //\n // Optional. Default is ""\n SentinelPassword string\n\n // Reset clears any existing keys in existing Collection\n //\n // Optional. Default is false\n Reset bool\n\n // TLS Config to use. When set TLS will be negotiated.\n //\n // Optional. Default is nil\n TLSConfig *tls.Config\n\n // Maximum number of socket connections.\n //\n // Optional. Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.\n PoolSize int\n}\n')),(0,i.kt)("h3",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Host: "127.0.0.1",\n Port: 6379,\n Username: "",\n Password: "",\n URL: "",\n Database: 0,\n Reset: false,\n TLSConfig: nil,\n PoolSize: 10 * runtime.GOMAXPROCS(0),\n Addrs: []string{},\n MasterName: "",\n ClientName: "",\n SentinelUsername: "",\n SentinelPassword: "",\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2650],{3905:(e,t,n)=>{n.d(t,{Zo:()=>g,kt:()=>c});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},g=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,g=o(e,["components","mdxType","originalType","parentName"]),p=u(n),f=i,c=p["".concat(l,".").concat(f)]||p[f]||d[f]||a;return n?r.createElement(c,s(s({ref:t},g),{},{components:n})):r.createElement(c,s({ref:t},g))}));function c(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,s=new Array(a);s[0]=f;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o[p]="string"==typeof e?e:i,s[1]=o;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>a,metadata:()=>o,toc:()=>u});var r=n(7462),i=(n(7294),n(3905));const a={id:"redis",title:"Redis"},s=void 0,o={unversionedId:"redis/redis",id:"redis/redis",title:"Redis",description:"Release",source:"@site/docs/storage/redis/README.md",sourceDirName:"redis",slug:"/redis/",permalink:"/storage/redis/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/redis/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"redis",title:"Redis"},sidebar:"tutorialSidebar",previous:{title:"Postgres",permalink:"/storage/postgres/"},next:{title:"Ristretto",permalink:"/storage/ristretto/"}},l={},u=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],g={toc:u},p="wrapper";function d(e){let{components:t,...n}=e;return(0,i.kt)(p,(0,r.Z)({},g,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=redis*",alt:"Release"}),"\n",(0,i.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,i.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-redis.yml?label=Tests",alt:"Test"}),"\n",(0,i.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,i.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,i.kt)("p",null,"A Redis storage driver using ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/go-redis/redis"},"go-redis/redis"),"."),(0,i.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,i.kt)("h3",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() redis.UniversalClient\n")),(0,i.kt)("h3",{id:"installation"},"Installation"),(0,i.kt)("p",null,"Redis is tested on the 2 last ",(0,i.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,i.kt)("p",null,"And then install the redis implementation:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/redis/v2\n")),(0,i.kt)("h3",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the storage package."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/redis/v2"\n')),(0,i.kt)("p",null,"You can use the one of the following options to create a Redis Storage:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := redis.New()\n\n// Initialize custom config\nstore := redis.New(redis.Config{\n Host: "127.0.0.1",\n Port: 6379,\n Username: "",\n Password: "",\n Database: 0,\n Reset: false,\n TLSConfig: nil,\n PoolSize: 10 * runtime.GOMAXPROCS(0),\n})\n\n// Initialize Redis Failover Client\nstore := redis.New(redis.Config{\n MasterName: "master-name",\n Addrs: []string{":6379"},\n})\n\n// Initialize Redis Cluster Client\nstore := redis.New(redis.Config{\n Addrs: []string{":6379", ":6380"},\n})\n\n// Create a client with support for TLS\ncer, err := tls.LoadX509KeyPair("./client.crt", "./client.key")\nif err != nil {\n log.Println(err)\n return\n}\ntlsCfg := &tls.Config{\n MinVersion: tls.VersionTLS12,\n InsecureSkipVerify: true,\n Certificates: []tls.Certificate{cer},\n}\nstore = redis.New(redis.Config{\n URL: "redis://:@127.0.0.1:6379/",\n TLSConfig: tlsCfg,\n Reset: false,\n})\n\n// Create a client with a Redis URL with all information.\nstore = redis.New(redis.Config{\n URL: "redis://:@127.0.0.1:6379/",\n Reset: false,\n})\n')),(0,i.kt)("h3",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Host name where the DB is hosted\n //\n // Optional. Default is "127.0.0.1"\n Host string\n\n // Port where the DB is listening on\n //\n // Optional. Default is 6379\n Port int\n\n // Server username\n //\n // Optional. Default is ""\n Username string\n\n // Server password\n //\n // Optional. Default is ""\n Password string\n\n // Database to be selected after connecting to the server.\n //\n // Optional. Default is 0\n Database int\n\n // URL standard format Redis URL. If this is set all other config options, Host, Port, Username, Password, Database have no effect.\n //\n // Example: redis://:@localhost:6379/\n // Optional. Default is ""\n URL string\n\n // Either a single address or a seed list of host:port addresses, this enables FailoverClient and ClusterClient\n //\n // Optional. Default is []string{}\n Addrs []string\n\n // MasterName is the sentinel master\'s name\n //\n // Optional. Default is ""\n MasterName string\n\n // ClientName will execute the `CLIENT SETNAME ClientName` command for each conn.\n //\n // Optional. Default is ""\n ClientName string\n\n // SentinelUsername\n //\n // Optional. Default is ""\n SentinelUsername string\n\n // SentinelPassword\n //\n // Optional. Default is ""\n SentinelPassword string\n\n // Reset clears any existing keys in existing Collection\n //\n // Optional. Default is false\n Reset bool\n\n // TLS Config to use. When set TLS will be negotiated.\n //\n // Optional. Default is nil\n TLSConfig *tls.Config\n\n // Maximum number of socket connections.\n //\n // Optional. Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.\n PoolSize int\n}\n')),(0,i.kt)("h3",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Host: "127.0.0.1",\n Port: 6379,\n Username: "",\n Password: "",\n URL: "",\n Database: 0,\n Reset: false,\n TLSConfig: nil,\n PoolSize: 10 * runtime.GOMAXPROCS(0),\n Addrs: []string{},\n MasterName: "",\n ClientName: "",\n SentinelUsername: "",\n SentinelPassword: "",\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/19e7c5f6.15505080.js b/assets/js/19e7c5f6.c7165d21.js similarity index 99% rename from assets/js/19e7c5f6.15505080.js rename to assets/js/19e7c5f6.c7165d21.js index 59b3e61228b..8e0c21b3f7d 100644 --- a/assets/js/19e7c5f6.15505080.js +++ b/assets/js/19e7c5f6.c7165d21.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[4856],{3905:(e,t,n)=>{n.d(t,{Zo:()=>f,kt:()=>d});var i=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=i.createContext({}),p=function(e){var t=i.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},f=function(e){var t=p(e.components);return i.createElement(l.Provider,{value:t},e.children)},m="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},u=i.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,l=e.parentName,f=s(e,["components","mdxType","originalType","parentName"]),m=p(n),u=a,d=m["".concat(l,".").concat(u)]||m[u]||c[u]||r;return n?i.createElement(d,o(o({ref:t},f),{},{components:n})):i.createElement(d,o({ref:t},f))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,o=new Array(r);o[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[m]="string"==typeof e?e:a,o[1]=s;for(var p=2;p{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>c,frontMatter:()=>r,metadata:()=>s,toc:()=>p});var i=n(7462),a=(n(7294),n(3905));const r={id:"filesystem",title:"FileSystem"},o=void 0,s={unversionedId:"api/middleware/filesystem",id:"version-v2.x/api/middleware/filesystem",title:"FileSystem",description:"Filesystem middleware for Fiber that enables you to serve files from a directory.",source:"@site/versioned_docs/version-v2.x/api/middleware/filesystem.md",sourceDirName:"api/middleware",slug:"/api/middleware/filesystem",permalink:"/api/middleware/filesystem",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"filesystem",title:"FileSystem"},sidebar:"tutorialSidebar",previous:{title:"Favicon",permalink:"/api/middleware/favicon"},next:{title:"Helmet",permalink:"/api/middleware/helmet"}},l={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"embed",id:"embed",level:2},{value:"pkger",id:"pkger",level:2},{value:"packr",id:"packr",level:2},{value:"go.rice",id:"gorice",level:2},{value:"fileb0x",id:"fileb0x",level:2},{value:"statik",id:"statik",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],f={toc:p},m="wrapper";function c(e){let{components:t,...n}=e;return(0,a.kt)(m,(0,i.Z)({},f,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Filesystem middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that enables you to serve files from a directory."),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},(0,a.kt)("strong",{parentName:"p"},(0,a.kt)("inlineCode",{parentName:"strong"},":params")," & ",(0,a.kt)("inlineCode",{parentName:"strong"},":optionals?")," within the prefix path are not supported!")),(0,a.kt)("p",{parentName:"admonition"},(0,a.kt)("strong",{parentName:"p"},"To handle paths with spaces (or other url encoded values) make sure to set ",(0,a.kt)("inlineCode",{parentName:"strong"},"fiber.Config{ UnescapePath: true }")))),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Provide a minimal config\napp.Use(filesystem.New(filesystem.Config{\n Root: http.Dir("./assets"),\n}))\n\n// Or extend your config for customization\napp.Use(filesystem.New(filesystem.Config{\n Root: http.Dir("./assets"),\n Browse: true,\n Index: "index.html",\n NotFoundFile: "404.html",\n MaxAge: 3600,\n}))\n')),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},"If your environment (Go 1.16+) supports it, we recommend using Go Embed instead of the other solutions listed as this one is native to Go and the easiest to use.")),(0,a.kt)("h2",{id:"embed"},"embed"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://golang.org/pkg/embed/"},"Embed")," is the native method to embed files in a Golang excecutable. Introduced in Go 1.16."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "embed"\n "io/fs"\n "log"\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n)\n\n// Embed a single file\n//go:embed index.html\nvar f embed.FS\n\n// Embed a directory\n//go:embed static/*\nvar embedDirStatic embed.FS\n\nfunc main() {\n app := fiber.New()\n\n app.Use("/", filesystem.New(filesystem.Config{\n Root: http.FS(f),\n }))\n\n // Access file "image.png" under `static/` directory via URL: `http:///static/image.png`.\n // Without `PathPrefix`, you have to access it via URL:\n // `http:///static/static/image.png`.\n app.Use("/static", filesystem.New(filesystem.Config{\n Root: http.FS(embedDirStatic),\n PathPrefix: "static",\n Browse: true,\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"pkger"},"pkger"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/markbates/pkger"},"https://github.com/markbates/pkger")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n\n "github.com/markbates/pkger"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use("/assets", filesystem.New(filesystem.Config{\n Root: pkger.Dir("/assets"),\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"packr"},"packr"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/gobuffalo/packr"},"https://github.com/gobuffalo/packr")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n\n "github.com/gobuffalo/packr/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use("/assets", filesystem.New(filesystem.Config{\n Root: packr.New("Assets Box", "/assets"),\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"gorice"},"go.rice"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/GeertJohan/go.rice"},"https://github.com/GeertJohan/go.rice")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n\n "github.com/GeertJohan/go.rice"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use("/assets", filesystem.New(filesystem.Config{\n Root: rice.MustFindBox("assets").HTTPBox(),\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"fileb0x"},"fileb0x"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/UnnoTed/fileb0x"},"https://github.com/UnnoTed/fileb0x")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n\n "/myEmbeddedFiles"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use("/assets", filesystem.New(filesystem.Config{\n Root: myEmbeddedFiles.HTTP,\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"statik"},"statik"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/rakyll/statik"},"https://github.com/rakyll/statik")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n\n // Use blank to invoke init function and register data to statik\n _ "/statik" \n "github.com/rakyll/statik/fs"\n)\n\nfunc main() {\n statikFS, err := fs.New()\n if err != nil {\n panic(err)\n }\n\n app := fiber.New()\n\n app.Use("/", filesystem.New(filesystem.Config{\n Root: statikFS,\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Root is a FileSystem that provides access\n // to a collection of files and directories.\n //\n // Required. Default: nil\n Root http.FileSystem `json:"-"`\n\n // PathPrefix defines a prefix to be added to a filepath when\n // reading a file from the FileSystem.\n //\n // Use when using Go 1.16 embed.FS\n //\n // Optional. Default ""\n PathPrefix string `json:"path_prefix"`\n\n // Enable directory browsing.\n //\n // Optional. Default: false\n Browse bool `json:"browse"`\n\n // Index file for serving a directory.\n //\n // Optional. Default: "index.html"\n Index string `json:"index"`\n\n // The value for the Cache-Control HTTP-header\n // that is set on the file response. MaxAge is defined in seconds.\n //\n // Optional. Default value 0.\n MaxAge int `json:"max_age"`\n\n // File to return if path is not found. Useful for SPA\'s.\n //\n // Optional. Default: ""\n NotFoundFile string `json:"not_found_file"`\n \n // The value for the Content-Type HTTP-header\n // that is set on the file response\n //\n // Optional. Default: ""\n ContentTypeCharset string `json:"content_type_charset"`\n}\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Root: nil,\n PathPrefix: "",\n Browse: false,\n Index: "/index.html",\n MaxAge: 0,\n ContentTypeCharset: "",\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[4856],{3905:(e,t,n)=>{n.d(t,{Zo:()=>f,kt:()=>d});var i=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=i.createContext({}),p=function(e){var t=i.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},f=function(e){var t=p(e.components);return i.createElement(l.Provider,{value:t},e.children)},m="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},u=i.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,l=e.parentName,f=s(e,["components","mdxType","originalType","parentName"]),m=p(n),u=a,d=m["".concat(l,".").concat(u)]||m[u]||c[u]||r;return n?i.createElement(d,o(o({ref:t},f),{},{components:n})):i.createElement(d,o({ref:t},f))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,o=new Array(r);o[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[m]="string"==typeof e?e:a,o[1]=s;for(var p=2;p{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>c,frontMatter:()=>r,metadata:()=>s,toc:()=>p});var i=n(7462),a=(n(7294),n(3905));const r={id:"filesystem",title:"FileSystem"},o=void 0,s={unversionedId:"api/middleware/filesystem",id:"version-v2.x/api/middleware/filesystem",title:"FileSystem",description:"Filesystem middleware for Fiber that enables you to serve files from a directory.",source:"@site/versioned_docs/version-v2.x/api/middleware/filesystem.md",sourceDirName:"api/middleware",slug:"/api/middleware/filesystem",permalink:"/api/middleware/filesystem",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"filesystem",title:"FileSystem"},sidebar:"tutorialSidebar",previous:{title:"Favicon",permalink:"/api/middleware/favicon"},next:{title:"Helmet",permalink:"/api/middleware/helmet"}},l={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"embed",id:"embed",level:2},{value:"pkger",id:"pkger",level:2},{value:"packr",id:"packr",level:2},{value:"go.rice",id:"gorice",level:2},{value:"fileb0x",id:"fileb0x",level:2},{value:"statik",id:"statik",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],f={toc:p},m="wrapper";function c(e){let{components:t,...n}=e;return(0,a.kt)(m,(0,i.Z)({},f,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Filesystem middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that enables you to serve files from a directory."),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},(0,a.kt)("strong",{parentName:"p"},(0,a.kt)("inlineCode",{parentName:"strong"},":params")," & ",(0,a.kt)("inlineCode",{parentName:"strong"},":optionals?")," within the prefix path are not supported!")),(0,a.kt)("p",{parentName:"admonition"},(0,a.kt)("strong",{parentName:"p"},"To handle paths with spaces (or other url encoded values) make sure to set ",(0,a.kt)("inlineCode",{parentName:"strong"},"fiber.Config{ UnescapePath: true }")))),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Provide a minimal config\napp.Use(filesystem.New(filesystem.Config{\n Root: http.Dir("./assets"),\n}))\n\n// Or extend your config for customization\napp.Use(filesystem.New(filesystem.Config{\n Root: http.Dir("./assets"),\n Browse: true,\n Index: "index.html",\n NotFoundFile: "404.html",\n MaxAge: 3600,\n}))\n')),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},"If your environment (Go 1.16+) supports it, we recommend using Go Embed instead of the other solutions listed as this one is native to Go and the easiest to use.")),(0,a.kt)("h2",{id:"embed"},"embed"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://golang.org/pkg/embed/"},"Embed")," is the native method to embed files in a Golang excecutable. Introduced in Go 1.16."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "embed"\n "io/fs"\n "log"\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n)\n\n// Embed a single file\n//go:embed index.html\nvar f embed.FS\n\n// Embed a directory\n//go:embed static/*\nvar embedDirStatic embed.FS\n\nfunc main() {\n app := fiber.New()\n\n app.Use("/", filesystem.New(filesystem.Config{\n Root: http.FS(f),\n }))\n\n // Access file "image.png" under `static/` directory via URL: `http:///static/image.png`.\n // Without `PathPrefix`, you have to access it via URL:\n // `http:///static/static/image.png`.\n app.Use("/static", filesystem.New(filesystem.Config{\n Root: http.FS(embedDirStatic),\n PathPrefix: "static",\n Browse: true,\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"pkger"},"pkger"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/markbates/pkger"},"https://github.com/markbates/pkger")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n\n "github.com/markbates/pkger"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use("/assets", filesystem.New(filesystem.Config{\n Root: pkger.Dir("/assets"),\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"packr"},"packr"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/gobuffalo/packr"},"https://github.com/gobuffalo/packr")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n\n "github.com/gobuffalo/packr/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use("/assets", filesystem.New(filesystem.Config{\n Root: packr.New("Assets Box", "/assets"),\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"gorice"},"go.rice"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/GeertJohan/go.rice"},"https://github.com/GeertJohan/go.rice")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n\n "github.com/GeertJohan/go.rice"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use("/assets", filesystem.New(filesystem.Config{\n Root: rice.MustFindBox("assets").HTTPBox(),\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"fileb0x"},"fileb0x"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/UnnoTed/fileb0x"},"https://github.com/UnnoTed/fileb0x")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n\n "/myEmbeddedFiles"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use("/assets", filesystem.New(filesystem.Config{\n Root: myEmbeddedFiles.HTTP,\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"statik"},"statik"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/rakyll/statik"},"https://github.com/rakyll/statik")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/filesystem"\n\n // Use blank to invoke init function and register data to statik\n _ "/statik" \n "github.com/rakyll/statik/fs"\n)\n\nfunc main() {\n statikFS, err := fs.New()\n if err != nil {\n panic(err)\n }\n\n app := fiber.New()\n\n app.Use("/", filesystem.New(filesystem.Config{\n Root: statikFS,\n }))\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Root is a FileSystem that provides access\n // to a collection of files and directories.\n //\n // Required. Default: nil\n Root http.FileSystem `json:"-"`\n\n // PathPrefix defines a prefix to be added to a filepath when\n // reading a file from the FileSystem.\n //\n // Use when using Go 1.16 embed.FS\n //\n // Optional. Default ""\n PathPrefix string `json:"path_prefix"`\n\n // Enable directory browsing.\n //\n // Optional. Default: false\n Browse bool `json:"browse"`\n\n // Index file for serving a directory.\n //\n // Optional. Default: "index.html"\n Index string `json:"index"`\n\n // The value for the Cache-Control HTTP-header\n // that is set on the file response. MaxAge is defined in seconds.\n //\n // Optional. Default value 0.\n MaxAge int `json:"max_age"`\n\n // File to return if path is not found. Useful for SPA\'s.\n //\n // Optional. Default: ""\n NotFoundFile string `json:"not_found_file"`\n \n // The value for the Content-Type HTTP-header\n // that is set on the file response\n //\n // Optional. Default: ""\n ContentTypeCharset string `json:"content_type_charset"`\n}\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Root: nil,\n PathPrefix: "",\n Browse: false,\n Index: "/index.html",\n MaxAge: 0,\n ContentTypeCharset: "",\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1a56c576.e228a4c4.js b/assets/js/1a56c576.8f599ce2.js similarity index 99% rename from assets/js/1a56c576.e228a4c4.js rename to assets/js/1a56c576.8f599ce2.js index ae56eb1c56f..78a36692d2b 100644 --- a/assets/js/1a56c576.e228a4c4.js +++ b/assets/js/1a56c576.8f599ce2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2330],{3905:(e,r,t)=>{t.d(r,{Zo:()=>c,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=n.createContext({}),u=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):l(l({},r),e)),t},c=function(e){var r=u(e.components);return n.createElement(s.Provider,{value:r},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),d=u(t),f=a,m=d["".concat(s,".").concat(f)]||d[f]||p[f]||o;return t?n.createElement(m,l(l({ref:r},c),{},{components:t})):n.createElement(m,l({ref:r},c))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var o=t.length,l=new Array(o);l[0]=f;var i={};for(var s in r)hasOwnProperty.call(r,s)&&(i[s]=r[s]);i.originalType=e,i[d]="string"==typeof e?e:a,l[1]=i;for(var u=2;u{t.d(r,{Z:()=>l});var n=t(7294),a=t(6010);const o={tabItem:"tabItem_Ymn6"};function l(e){let{children:r,hidden:t,className:l}=e;return n.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,l),hidden:t},r)}},4866:(e,r,t)=>{t.d(r,{Z:()=>E});var n=t(7462),a=t(7294),o=t(6010),l=t(2466),i=t(6550),s=t(1980),u=t(7392),c=t(12);function d(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:r,label:t,attributes:n,default:a}}=e;return{value:r,label:t,attributes:n,default:a}}))}function p(e){const{values:r,children:t}=e;return(0,a.useMemo)((()=>{const e=r??d(t);return function(e){const r=(0,u.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,t])}function f(e){let{value:r,tabValues:t}=e;return t.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:t}=e;const n=(0,i.k6)(),o=function(e){let{queryString:r=!1,groupId:t}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:r,groupId:t});return[(0,s._X)(o),(0,a.useCallback)((e=>{if(!o)return;const r=new URLSearchParams(n.location.search);r.set(o,e),n.replace({...n.location,search:r.toString()})}),[o,n])]}function h(e){const{defaultValue:r,queryString:t=!1,groupId:n}=e,o=p(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:r,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!f({value:r,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const n=t.find((e=>e.default))??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:r,tabValues:o}))),[s,u]=m({queryString:t,groupId:n}),[d,h]=function(e){let{groupId:r}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(r),[n,o]=(0,c.Nk)(t);return[n,(0,a.useCallback)((e=>{t&&o.set(e)}),[t,o])]}({groupId:n}),b=(()=>{const e=s??d;return f({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!f({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),h(e)}),[u,h,o]),tabValues:o}}var b=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function v(e){let{className:r,block:t,selectedValue:i,selectValue:s,tabValues:u}=e;const c=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.o5)(),p=e=>{const r=e.currentTarget,t=c.indexOf(r),n=u[t].value;n!==i&&(d(r),s(n))},f=e=>{let r=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const t=c.indexOf(e.currentTarget)+1;r=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(e.currentTarget)-1;r=c[t]??c[c.length-1];break}}r?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},r)},u.map((e=>{let{value:r,label:t,attributes:l}=e;return a.createElement("li",(0,n.Z)({role:"tab",tabIndex:i===r?0:-1,"aria-selected":i===r,key:r,ref:e=>c.push(e),onKeyDown:f,onClick:p},l,{className:(0,o.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":i===r})}),t??r)})))}function y(e){let{lazy:r,children:t,selectedValue:n}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(r){const e=o.find((e=>e.props.value===n));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,r)=>(0,a.cloneElement)(e,{key:r,hidden:e.props.value!==n}))))}function k(e){const r=h(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",g.tabList)},a.createElement(v,(0,n.Z)({},e,r)),a.createElement(y,(0,n.Z)({},e,r)))}function E(e){const r=(0,b.Z)();return a.createElement(k,(0,n.Z)({key:String(r)},e))}},8520:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>s,default:()=>m,frontMatter:()=>i,metadata:()=>u,toc:()=>d});var n=t(7462),a=(t(7294),t(3905)),o=t(4866),l=t(5162);const i={id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:4},s=void 0,u={unversionedId:"guide/error-handling",id:"version-v2.x/guide/error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",source:"@site/versioned_docs/version-v2.x/guide/error-handling.md",sourceDirName:"guide",slug:"/guide/error-handling",permalink:"/guide/error-handling",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:4,frontMatter:{id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udcdd Templates",permalink:"/guide/templates"},next:{title:"\ud83d\udd0e Validation",permalink:"/guide/validation"}},c={},d=[{value:"Catching Errors",id:"catching-errors",level:2},{value:"Default Error Handler",id:"default-error-handler",level:2},{value:"Custom Error Handler",id:"custom-error-handler",level:2}],p={toc:d},f="wrapper";function m(e){let{components:r,...t}=e;return(0,a.kt)(f,(0,n.Z)({},p,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"catching-errors"},"Catching Errors"),(0,a.kt)("p",null,"It\u2019s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them."),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(l.Z,{value:"example",label:"Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/", func(c *fiber.Ctx) error {\n // Pass error to Fiber\n return c.SendFile("file-does-not-exist")\n})\n')))),(0,a.kt)("p",null,"Fiber does not handle ",(0,a.kt)("a",{parentName:"p",href:"https://go.dev/blog/defer-panic-and-recover"},"panics")," by default. To recover from a panic thrown by any handler in the stack, you need to include the ",(0,a.kt)("inlineCode",{parentName:"p"},"Recover")," middleware below:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/recover"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(recover.New())\n\n app.Get("/", func(c *fiber.Ctx) error {\n panic("This panic is caught by fiber")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("p",null,"You could use Fiber's custom error struct to pass an additional ",(0,a.kt)("inlineCode",{parentName:"p"},"status code")," using ",(0,a.kt)("inlineCode",{parentName:"p"},"fiber.NewError()"),". It's optional to pass a message; if this is left empty, it will default to the status code message ","(",(0,a.kt)("inlineCode",{parentName:"p"},"404")," equals ",(0,a.kt)("inlineCode",{parentName:"p"},"Not Found"),")","."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // 503 Service Unavailable\n return fiber.ErrServiceUnavailable\n\n // 503 On vacation!\n return fiber.NewError(fiber.StatusServiceUnavailable, "On vacation!")\n})\n')),(0,a.kt)("h2",{id:"default-error-handler"},"Default Error Handler"),(0,a.kt)("p",null,"Fiber provides an error handler by default. For a standard error, the response is sent as ",(0,a.kt)("strong",{parentName:"p"},"500 Internal Server Error"),". If the error is of type ",(0,a.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/gofiber/fiber#Error"},"fiber.Error"),", the response is sent with the provided status code and message."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"// Default error handler\nvar DefaultErrorHandler = func(c *fiber.Ctx, err error) error {\n // Status code defaults to 500\n code := fiber.StatusInternalServerError\n\n // Retrieve the custom status code if it's a *fiber.Error\n var e *fiber.Error\n if errors.As(err, &e) {\n code = e.Code\n }\n\n // Set Content-Type: text/plain; charset=utf-8\n c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)\n\n // Return status code with error message\n return c.Status(code).SendString(err.Error())\n}\n")),(0,a.kt)("h2",{id:"custom-error-handler"},"Custom Error Handler"),(0,a.kt)("p",null,"A custom error handler can be set using a ",(0,a.kt)("a",{parentName:"p",href:"/api/fiber#config"},"Config "),"when initializing a ",(0,a.kt)("a",{parentName:"p",href:"/api/fiber#new"},"Fiber instance"),"."),(0,a.kt)("p",null,"In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response."),(0,a.kt)("p",null,"The following example shows how to display error pages for different types of errors."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Create a new fiber instance with custom config\napp := fiber.New(fiber.Config{\n // Override default error handler\n ErrorHandler: func(ctx *fiber.Ctx, err error) error {\n // Status code defaults to 500\n code := fiber.StatusInternalServerError\n\n // Retrieve the custom status code if it\'s a *fiber.Error\n var e *fiber.Error\n if errors.As(err, &e) {\n code = e.Code\n }\n\n // Send custom error page\n err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))\n if err != nil {\n // In case the SendFile fails\n return ctx.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")\n }\n\n // Return from handler\n return nil\n },\n})\n\n// ...\n')),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},"Special thanks to the ",(0,a.kt)("a",{parentName:"p",href:"https://echo.labstack.com/"},"Echo")," & ",(0,a.kt)("a",{parentName:"p",href:"https://expressjs.com/"},"Express")," framework for inspiration regarding error handling.")))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2330],{3905:(e,r,t)=>{t.d(r,{Zo:()=>c,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=n.createContext({}),u=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):l(l({},r),e)),t},c=function(e){var r=u(e.components);return n.createElement(s.Provider,{value:r},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),d=u(t),f=a,m=d["".concat(s,".").concat(f)]||d[f]||p[f]||o;return t?n.createElement(m,l(l({ref:r},c),{},{components:t})):n.createElement(m,l({ref:r},c))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var o=t.length,l=new Array(o);l[0]=f;var i={};for(var s in r)hasOwnProperty.call(r,s)&&(i[s]=r[s]);i.originalType=e,i[d]="string"==typeof e?e:a,l[1]=i;for(var u=2;u{t.d(r,{Z:()=>l});var n=t(7294),a=t(6010);const o={tabItem:"tabItem_Ymn6"};function l(e){let{children:r,hidden:t,className:l}=e;return n.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,l),hidden:t},r)}},4866:(e,r,t)=>{t.d(r,{Z:()=>E});var n=t(7462),a=t(7294),o=t(6010),l=t(2466),i=t(6550),s=t(1980),u=t(7392),c=t(12);function d(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:r,label:t,attributes:n,default:a}}=e;return{value:r,label:t,attributes:n,default:a}}))}function p(e){const{values:r,children:t}=e;return(0,a.useMemo)((()=>{const e=r??d(t);return function(e){const r=(0,u.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,t])}function f(e){let{value:r,tabValues:t}=e;return t.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:t}=e;const n=(0,i.k6)(),o=function(e){let{queryString:r=!1,groupId:t}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:r,groupId:t});return[(0,s._X)(o),(0,a.useCallback)((e=>{if(!o)return;const r=new URLSearchParams(n.location.search);r.set(o,e),n.replace({...n.location,search:r.toString()})}),[o,n])]}function h(e){const{defaultValue:r,queryString:t=!1,groupId:n}=e,o=p(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:r,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!f({value:r,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const n=t.find((e=>e.default))??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:r,tabValues:o}))),[s,u]=m({queryString:t,groupId:n}),[d,h]=function(e){let{groupId:r}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(r),[n,o]=(0,c.Nk)(t);return[n,(0,a.useCallback)((e=>{t&&o.set(e)}),[t,o])]}({groupId:n}),b=(()=>{const e=s??d;return f({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!f({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),h(e)}),[u,h,o]),tabValues:o}}var b=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function v(e){let{className:r,block:t,selectedValue:i,selectValue:s,tabValues:u}=e;const c=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.o5)(),p=e=>{const r=e.currentTarget,t=c.indexOf(r),n=u[t].value;n!==i&&(d(r),s(n))},f=e=>{let r=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const t=c.indexOf(e.currentTarget)+1;r=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(e.currentTarget)-1;r=c[t]??c[c.length-1];break}}r?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},r)},u.map((e=>{let{value:r,label:t,attributes:l}=e;return a.createElement("li",(0,n.Z)({role:"tab",tabIndex:i===r?0:-1,"aria-selected":i===r,key:r,ref:e=>c.push(e),onKeyDown:f,onClick:p},l,{className:(0,o.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":i===r})}),t??r)})))}function y(e){let{lazy:r,children:t,selectedValue:n}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(r){const e=o.find((e=>e.props.value===n));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,r)=>(0,a.cloneElement)(e,{key:r,hidden:e.props.value!==n}))))}function k(e){const r=h(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",g.tabList)},a.createElement(v,(0,n.Z)({},e,r)),a.createElement(y,(0,n.Z)({},e,r)))}function E(e){const r=(0,b.Z)();return a.createElement(k,(0,n.Z)({key:String(r)},e))}},8520:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>s,default:()=>m,frontMatter:()=>i,metadata:()=>u,toc:()=>d});var n=t(7462),a=(t(7294),t(3905)),o=t(4866),l=t(5162);const i={id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:4},s=void 0,u={unversionedId:"guide/error-handling",id:"version-v2.x/guide/error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",source:"@site/versioned_docs/version-v2.x/guide/error-handling.md",sourceDirName:"guide",slug:"/guide/error-handling",permalink:"/guide/error-handling",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:4,frontMatter:{id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udcdd Templates",permalink:"/guide/templates"},next:{title:"\ud83d\udd0e Validation",permalink:"/guide/validation"}},c={},d=[{value:"Catching Errors",id:"catching-errors",level:2},{value:"Default Error Handler",id:"default-error-handler",level:2},{value:"Custom Error Handler",id:"custom-error-handler",level:2}],p={toc:d},f="wrapper";function m(e){let{components:r,...t}=e;return(0,a.kt)(f,(0,n.Z)({},p,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"catching-errors"},"Catching Errors"),(0,a.kt)("p",null,"It\u2019s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them."),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(l.Z,{value:"example",label:"Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/", func(c *fiber.Ctx) error {\n // Pass error to Fiber\n return c.SendFile("file-does-not-exist")\n})\n')))),(0,a.kt)("p",null,"Fiber does not handle ",(0,a.kt)("a",{parentName:"p",href:"https://go.dev/blog/defer-panic-and-recover"},"panics")," by default. To recover from a panic thrown by any handler in the stack, you need to include the ",(0,a.kt)("inlineCode",{parentName:"p"},"Recover")," middleware below:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/recover"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(recover.New())\n\n app.Get("/", func(c *fiber.Ctx) error {\n panic("This panic is caught by fiber")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("p",null,"You could use Fiber's custom error struct to pass an additional ",(0,a.kt)("inlineCode",{parentName:"p"},"status code")," using ",(0,a.kt)("inlineCode",{parentName:"p"},"fiber.NewError()"),". It's optional to pass a message; if this is left empty, it will default to the status code message ","(",(0,a.kt)("inlineCode",{parentName:"p"},"404")," equals ",(0,a.kt)("inlineCode",{parentName:"p"},"Not Found"),")","."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // 503 Service Unavailable\n return fiber.ErrServiceUnavailable\n\n // 503 On vacation!\n return fiber.NewError(fiber.StatusServiceUnavailable, "On vacation!")\n})\n')),(0,a.kt)("h2",{id:"default-error-handler"},"Default Error Handler"),(0,a.kt)("p",null,"Fiber provides an error handler by default. For a standard error, the response is sent as ",(0,a.kt)("strong",{parentName:"p"},"500 Internal Server Error"),". If the error is of type ",(0,a.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/gofiber/fiber#Error"},"fiber.Error"),", the response is sent with the provided status code and message."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"// Default error handler\nvar DefaultErrorHandler = func(c *fiber.Ctx, err error) error {\n // Status code defaults to 500\n code := fiber.StatusInternalServerError\n\n // Retrieve the custom status code if it's a *fiber.Error\n var e *fiber.Error\n if errors.As(err, &e) {\n code = e.Code\n }\n\n // Set Content-Type: text/plain; charset=utf-8\n c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)\n\n // Return status code with error message\n return c.Status(code).SendString(err.Error())\n}\n")),(0,a.kt)("h2",{id:"custom-error-handler"},"Custom Error Handler"),(0,a.kt)("p",null,"A custom error handler can be set using a ",(0,a.kt)("a",{parentName:"p",href:"/api/fiber#config"},"Config "),"when initializing a ",(0,a.kt)("a",{parentName:"p",href:"/api/fiber#new"},"Fiber instance"),"."),(0,a.kt)("p",null,"In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response."),(0,a.kt)("p",null,"The following example shows how to display error pages for different types of errors."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Create a new fiber instance with custom config\napp := fiber.New(fiber.Config{\n // Override default error handler\n ErrorHandler: func(ctx *fiber.Ctx, err error) error {\n // Status code defaults to 500\n code := fiber.StatusInternalServerError\n\n // Retrieve the custom status code if it\'s a *fiber.Error\n var e *fiber.Error\n if errors.As(err, &e) {\n code = e.Code\n }\n\n // Send custom error page\n err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))\n if err != nil {\n // In case the SendFile fails\n return ctx.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")\n }\n\n // Return from handler\n return nil\n },\n})\n\n// ...\n')),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},"Special thanks to the ",(0,a.kt)("a",{parentName:"p",href:"https://echo.labstack.com/"},"Echo")," & ",(0,a.kt)("a",{parentName:"p",href:"https://expressjs.com/"},"Express")," framework for inspiration regarding error handling.")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1a6451b0.be720878.js b/assets/js/1a6451b0.118a75c8.js similarity index 98% rename from assets/js/1a6451b0.be720878.js rename to assets/js/1a6451b0.118a75c8.js index afa0539ddac..524eacfefcd 100644 --- a/assets/js/1a6451b0.be720878.js +++ b/assets/js/1a6451b0.118a75c8.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2248],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var p=n.createContext({}),s=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},c=function(e){var t=s(e.components);return n.createElement(p.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,p=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=s(r),f=a,m=u["".concat(p,".").concat(f)]||u[f]||d[f]||i;return r?n.createElement(m,o(o({ref:t},c),{},{components:r})):n.createElement(m,o({ref:t},c))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=f;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[u]="string"==typeof e?e:a,o[1]=l;for(var s=2;s{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var n=r(7462),a=(r(7294),r(3905));const i={id:"envvar",title:"EnvVar"},o=void 0,l={unversionedId:"api/middleware/envvar",id:"api/middleware/envvar",title:"EnvVar",description:"EnvVar middleware for Fiber that can be used to expose environment variables with various options.",source:"@site/docs/core/api/middleware/envvar.md",sourceDirName:"api/middleware",slug:"/api/middleware/envvar",permalink:"/next/api/middleware/envvar",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/envvar.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"envvar",title:"EnvVar"},sidebar:"tutorialSidebar",previous:{title:"Encrypt Cookie",permalink:"/next/api/middleware/encryptcookie"},next:{title:"ETag",permalink:"/next/api/middleware/etag"}},p={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Response",id:"response",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],c={toc:s},u="wrapper";function d(e){let{components:t,...r}=e;return(0,a.kt)(u,(0,n.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"EnvVar middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that can be used to expose environment variables with various options."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/envvar"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use("/expose/envvars", envvar.New())\n\n// Or extend your config for customization\napp.Use("/expose/envvars", envvar.New(\n envvar.Config{\n ExportVars: map[string]string{"testKey": "", "testDefaultKey": "testDefaultVal"},\n ExcludeVars: map[string]string{"excludeKey": ""},\n }),\n)\n')),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"You will need to provide a path to use the envvar middleware.")),(0,a.kt)("h2",{id:"response"},"Response"),(0,a.kt)("p",null,"Http response contract:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},'{\n "vars": {\n "someEnvVariable": "someValue",\n "anotherEnvVariable": "anotherValue",\n }\n}\n\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // ExportVars specifies the environment variables that should export\n ExportVars map[string]string\n // ExcludeVars specifies the environment variables that should not export\n ExcludeVars map[string]string\n}\n\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"Config{}\n")))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2248],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var p=n.createContext({}),s=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},c=function(e){var t=s(e.components);return n.createElement(p.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,p=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=s(r),f=a,m=u["".concat(p,".").concat(f)]||u[f]||d[f]||i;return r?n.createElement(m,o(o({ref:t},c),{},{components:r})):n.createElement(m,o({ref:t},c))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=f;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[u]="string"==typeof e?e:a,o[1]=l;for(var s=2;s{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var n=r(7462),a=(r(7294),r(3905));const i={id:"envvar",title:"EnvVar"},o=void 0,l={unversionedId:"api/middleware/envvar",id:"api/middleware/envvar",title:"EnvVar",description:"EnvVar middleware for Fiber that can be used to expose environment variables with various options.",source:"@site/docs/core/api/middleware/envvar.md",sourceDirName:"api/middleware",slug:"/api/middleware/envvar",permalink:"/next/api/middleware/envvar",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/envvar.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"envvar",title:"EnvVar"},sidebar:"tutorialSidebar",previous:{title:"Encrypt Cookie",permalink:"/next/api/middleware/encryptcookie"},next:{title:"ETag",permalink:"/next/api/middleware/etag"}},p={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Response",id:"response",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],c={toc:s},u="wrapper";function d(e){let{components:t,...r}=e;return(0,a.kt)(u,(0,n.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"EnvVar middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that can be used to expose environment variables with various options."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/envvar"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use("/expose/envvars", envvar.New())\n\n// Or extend your config for customization\napp.Use("/expose/envvars", envvar.New(\n envvar.Config{\n ExportVars: map[string]string{"testKey": "", "testDefaultKey": "testDefaultVal"},\n ExcludeVars: map[string]string{"excludeKey": ""},\n }),\n)\n')),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"You will need to provide a path to use the envvar middleware.")),(0,a.kt)("h2",{id:"response"},"Response"),(0,a.kt)("p",null,"Http response contract:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},'{\n "vars": {\n "someEnvVariable": "someValue",\n "anotherEnvVariable": "anotherValue",\n }\n}\n\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // ExportVars specifies the environment variables that should export\n ExportVars map[string]string\n // ExcludeVars specifies the environment variables that should not export\n ExcludeVars map[string]string\n}\n\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"Config{}\n")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1af20617.b7c00b46.js b/assets/js/1af20617.98ba9a9e.js similarity index 99% rename from assets/js/1af20617.b7c00b46.js rename to assets/js/1af20617.98ba9a9e.js index a608556ffd0..5453b0bd94b 100644 --- a/assets/js/1af20617.b7c00b46.js +++ b/assets/js/1af20617.98ba9a9e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[363],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},b=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,s=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),c=p(n),b=a,f=c["".concat(s,".").concat(b)]||c[b]||g[b]||l;return n?r.createElement(f,o(o({ref:t},u),{},{components:n})):r.createElement(f,o({ref:t},u))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,o=new Array(l);o[0]=b;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[c]="string"==typeof e?e:a,o[1]=i;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>g,frontMatter:()=>l,metadata:()=>i,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const l={id:"pebble",title:"Pebble"},o=void 0,i={unversionedId:"pebble/pebble",id:"pebble/pebble",title:"Pebble",description:"Release",source:"@site/docs/storage/pebble/README.md",sourceDirName:"pebble",slug:"/pebble/",permalink:"/storage/pebble/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/pebble/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"pebble",title:"Pebble"},sidebar:"tutorialSidebar",previous:{title:"MySQL",permalink:"/storage/mysql/"},next:{title:"Postgres",permalink:"/storage/postgres/"}},s={},p=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],u={toc:p},c="wrapper";function g(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=pebble*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-pebble.yml?label=Tests",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,a.kt)("p",null,"A fast key-value DB using ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/cockroachdb/pebble"},"cockroachdb/pebble")),(0,a.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,a.kt)("h3",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *badger.DB\n")),(0,a.kt)("h3",{id:"installation"},"Installation"),(0,a.kt)("p",null,"Pebble is tested on the 2 last ",(0,a.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,a.kt)("p",null,"Note: This step is only required if you don't have an existing module."),(0,a.kt)("p",null,"And then install the Pebble implementation:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/pebble\n")),(0,a.kt)("h3",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the storage package."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/pebble"\n')),(0,a.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := pebble.New()\n\n// Initialize custom config\nstore := pebble.New(pebble.Config{\n Path: "db",\n WriteOptions: &pebble.WriteOptions{},\n})\n')),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Database name\n //\n // Optional. Default is "./db"\n Path string\n\n // Pass write options during write operations\n //\n // Optional. Default is nil\n WriteOptions &pebble.WriteOptions{}\n}\n')),(0,a.kt)("h3",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Path: "db",\n WriteOptions: &pebble.WriteOptions{},\n}\n')))}g.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[363],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},b=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,s=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),c=p(n),b=a,f=c["".concat(s,".").concat(b)]||c[b]||g[b]||l;return n?r.createElement(f,o(o({ref:t},u),{},{components:n})):r.createElement(f,o({ref:t},u))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,o=new Array(l);o[0]=b;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[c]="string"==typeof e?e:a,o[1]=i;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>g,frontMatter:()=>l,metadata:()=>i,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const l={id:"pebble",title:"Pebble"},o=void 0,i={unversionedId:"pebble/pebble",id:"pebble/pebble",title:"Pebble",description:"Release",source:"@site/docs/storage/pebble/README.md",sourceDirName:"pebble",slug:"/pebble/",permalink:"/storage/pebble/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/pebble/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"pebble",title:"Pebble"},sidebar:"tutorialSidebar",previous:{title:"MySQL",permalink:"/storage/mysql/"},next:{title:"Postgres",permalink:"/storage/postgres/"}},s={},p=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],u={toc:p},c="wrapper";function g(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=pebble*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-pebble.yml?label=Tests",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,a.kt)("p",null,"A fast key-value DB using ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/cockroachdb/pebble"},"cockroachdb/pebble")),(0,a.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,a.kt)("h3",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *badger.DB\n")),(0,a.kt)("h3",{id:"installation"},"Installation"),(0,a.kt)("p",null,"Pebble is tested on the 2 last ",(0,a.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,a.kt)("p",null,"Note: This step is only required if you don't have an existing module."),(0,a.kt)("p",null,"And then install the Pebble implementation:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/pebble\n")),(0,a.kt)("h3",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the storage package."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/pebble"\n')),(0,a.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := pebble.New()\n\n// Initialize custom config\nstore := pebble.New(pebble.Config{\n Path: "db",\n WriteOptions: &pebble.WriteOptions{},\n})\n')),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Database name\n //\n // Optional. Default is "./db"\n Path string\n\n // Pass write options during write operations\n //\n // Optional. Default is nil\n WriteOptions &pebble.WriteOptions{}\n}\n')),(0,a.kt)("h3",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Path: "db",\n WriteOptions: &pebble.WriteOptions{},\n}\n')))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1b545511.1cee49e8.js b/assets/js/1b545511.c42c72dd.js similarity index 99% rename from assets/js/1b545511.1cee49e8.js rename to assets/js/1b545511.c42c72dd.js index 5d3be1f8407..bc6fb8f0111 100644 --- a/assets/js/1b545511.1cee49e8.js +++ b/assets/js/1b545511.c42c72dd.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1252],{3905:(e,n,t)=>{t.d(n,{Zo:()=>u,kt:()=>m});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=r.createContext({}),p=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},u=function(e){var n=p(e.components);return r.createElement(s.Provider,{value:n},e.children)},c="mdxType",f={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=p(t),d=i,m=c["".concat(s,".").concat(d)]||c[d]||f[d]||o;return t?r.createElement(m,a(a({ref:n},u),{},{components:t})):r.createElement(m,a({ref:n},u))}));function m(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var o=t.length,a=new Array(o);a[0]=d;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[c]="string"==typeof e?e:i,a[1]=l;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>a,default:()=>f,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var r=t(7462),i=(t(7294),t(3905));const o={id:"helmet",title:"Helmet"},a=void 0,l={unversionedId:"api/middleware/helmet",id:"api/middleware/helmet",title:"Helmet",description:"Helmet middleware helps secure your apps by setting various HTTP headers.",source:"@site/docs/core/api/middleware/helmet.md",sourceDirName:"api/middleware",slug:"/api/middleware/helmet",permalink:"/next/api/middleware/helmet",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/helmet.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"helmet",title:"Helmet"},sidebar:"tutorialSidebar",previous:{title:"FileSystem",permalink:"/next/api/middleware/filesystem"},next:{title:"Idempotency",permalink:"/next/api/middleware/idempotency"}},s={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],u={toc:p},c="wrapper";function f(e){let{components:n,...t}=e;return(0,i.kt)(c,(0,r.Z)({},u,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Helmet middleware helps secure your apps by setting various HTTP headers."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/helmet"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(helmet.New())\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome!")\n })\n\n app.Listen(":3000")\n}\n')),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Test:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-curl"},"curl -I http://localhost:3000\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // XSSProtection\n // Optional. Default value "0".\n XSSProtection string\n\n // ContentTypeNosniff\n // Optional. Default value "nosniff".\n ContentTypeNosniff string\n\n // XFrameOptions\n // Optional. Default value "SAMEORIGIN".\n // Possible values: "SAMEORIGIN", "DENY", "ALLOW-FROM uri"\n XFrameOptions string\n\n // HSTSMaxAge\n // Optional. Default value 0.\n HSTSMaxAge int\n\n // HSTSExcludeSubdomains\n // Optional. Default value false.\n HSTSExcludeSubdomains bool\n\n // ContentSecurityPolicy\n // Optional. Default value "".\n ContentSecurityPolicy string\n\n // CSPReportOnly\n // Optional. Default value false.\n CSPReportOnly bool\n\n // HSTSPreloadEnabled\n // Optional. Default value false.\n HSTSPreloadEnabled bool\n\n // ReferrerPolicy\n // Optional. Default value "ReferrerPolicy".\n ReferrerPolicy string\n\n // Permissions-Policy\n // Optional. Default value "".\n PermissionPolicy string\n\n // Cross-Origin-Embedder-Policy\n // Optional. Default value "require-corp".\n CrossOriginEmbedderPolicy string\n\n // Cross-Origin-Opener-Policy\n // Optional. Default value "same-origin".\n CrossOriginOpenerPolicy string\n\n // Cross-Origin-Resource-Policy\n // Optional. Default value "same-origin".\n CrossOriginResourcePolicy string\n\n // Origin-Agent-Cluster\n // Optional. Default value "?1".\n OriginAgentCluster string\n\n // X-DNS-Prefetch-Control\n // Optional. Default value "off".\n XDNSPrefetchControl string\n\n // X-Download-Options\n // Optional. Default value "noopen".\n XDownloadOptions string\n\n // X-Permitted-Cross-Domain-Policies\n // Optional. Default value "none".\n XPermittedCrossDomain string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n XSSProtection: "0",\n ContentTypeNosniff: "nosniff",\n XFrameOptions: "SAMEORIGIN",\n ReferrerPolicy: "no-referrer",\n CrossOriginEmbedderPolicy: "require-corp",\n CrossOriginOpenerPolicy: "same-origin",\n CrossOriginResourcePolicy: "same-origin",\n OriginAgentCluster: "?1",\n XDNSPrefetchControl: "off",\n XDownloadOptions: "noopen",\n XPermittedCrossDomain: "none",\n}\n')))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1252],{3905:(e,n,t)=>{t.d(n,{Zo:()=>u,kt:()=>m});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=r.createContext({}),p=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},u=function(e){var n=p(e.components);return r.createElement(s.Provider,{value:n},e.children)},c="mdxType",f={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=p(t),d=i,m=c["".concat(s,".").concat(d)]||c[d]||f[d]||o;return t?r.createElement(m,a(a({ref:n},u),{},{components:t})):r.createElement(m,a({ref:n},u))}));function m(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var o=t.length,a=new Array(o);a[0]=d;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[c]="string"==typeof e?e:i,a[1]=l;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>a,default:()=>f,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var r=t(7462),i=(t(7294),t(3905));const o={id:"helmet",title:"Helmet"},a=void 0,l={unversionedId:"api/middleware/helmet",id:"api/middleware/helmet",title:"Helmet",description:"Helmet middleware helps secure your apps by setting various HTTP headers.",source:"@site/docs/core/api/middleware/helmet.md",sourceDirName:"api/middleware",slug:"/api/middleware/helmet",permalink:"/next/api/middleware/helmet",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/helmet.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"helmet",title:"Helmet"},sidebar:"tutorialSidebar",previous:{title:"FileSystem",permalink:"/next/api/middleware/filesystem"},next:{title:"Idempotency",permalink:"/next/api/middleware/idempotency"}},s={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],u={toc:p},c="wrapper";function f(e){let{components:n,...t}=e;return(0,i.kt)(c,(0,r.Z)({},u,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Helmet middleware helps secure your apps by setting various HTTP headers."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/helmet"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(helmet.New())\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome!")\n })\n\n app.Listen(":3000")\n}\n')),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Test:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-curl"},"curl -I http://localhost:3000\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // XSSProtection\n // Optional. Default value "0".\n XSSProtection string\n\n // ContentTypeNosniff\n // Optional. Default value "nosniff".\n ContentTypeNosniff string\n\n // XFrameOptions\n // Optional. Default value "SAMEORIGIN".\n // Possible values: "SAMEORIGIN", "DENY", "ALLOW-FROM uri"\n XFrameOptions string\n\n // HSTSMaxAge\n // Optional. Default value 0.\n HSTSMaxAge int\n\n // HSTSExcludeSubdomains\n // Optional. Default value false.\n HSTSExcludeSubdomains bool\n\n // ContentSecurityPolicy\n // Optional. Default value "".\n ContentSecurityPolicy string\n\n // CSPReportOnly\n // Optional. Default value false.\n CSPReportOnly bool\n\n // HSTSPreloadEnabled\n // Optional. Default value false.\n HSTSPreloadEnabled bool\n\n // ReferrerPolicy\n // Optional. Default value "ReferrerPolicy".\n ReferrerPolicy string\n\n // Permissions-Policy\n // Optional. Default value "".\n PermissionPolicy string\n\n // Cross-Origin-Embedder-Policy\n // Optional. Default value "require-corp".\n CrossOriginEmbedderPolicy string\n\n // Cross-Origin-Opener-Policy\n // Optional. Default value "same-origin".\n CrossOriginOpenerPolicy string\n\n // Cross-Origin-Resource-Policy\n // Optional. Default value "same-origin".\n CrossOriginResourcePolicy string\n\n // Origin-Agent-Cluster\n // Optional. Default value "?1".\n OriginAgentCluster string\n\n // X-DNS-Prefetch-Control\n // Optional. Default value "off".\n XDNSPrefetchControl string\n\n // X-Download-Options\n // Optional. Default value "noopen".\n XDownloadOptions string\n\n // X-Permitted-Cross-Domain-Policies\n // Optional. Default value "none".\n XPermittedCrossDomain string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n XSSProtection: "0",\n ContentTypeNosniff: "nosniff",\n XFrameOptions: "SAMEORIGIN",\n ReferrerPolicy: "no-referrer",\n CrossOriginEmbedderPolicy: "require-corp",\n CrossOriginOpenerPolicy: "same-origin",\n CrossOriginResourcePolicy: "same-origin",\n OriginAgentCluster: "?1",\n XDNSPrefetchControl: "off",\n XDownloadOptions: "noopen",\n XPermittedCrossDomain: "none",\n}\n')))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1ed4c90d.318ba267.js b/assets/js/1ed4c90d.31934694.js similarity index 99% rename from assets/js/1ed4c90d.318ba267.js rename to assets/js/1ed4c90d.31934694.js index 4928f0db7d6..4f4435db719 100644 --- a/assets/js/1ed4c90d.318ba267.js +++ b/assets/js/1ed4c90d.31934694.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6570],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>f});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),u=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,l=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=u(r),d=a,f=c["".concat(s,".").concat(d)]||c[d]||m[d]||l;return r?n.createElement(f,i(i({ref:t},p),{},{components:r})):n.createElement(f,i({ref:t},p))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=r.length,i=new Array(l);i[0]=d;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[c]="string"==typeof e?e:a,i[1]=o;for(var u=2;u{r.d(t,{Z:()=>i});var n=r(7294),a=r(6010);const l={tabItem:"tabItem_Ymn6"};function i(e){let{children:t,hidden:r,className:i}=e;return n.createElement("div",{role:"tabpanel",className:(0,a.Z)(l.tabItem,i),hidden:r},t)}},4866:(e,t,r)=>{r.d(t,{Z:()=>N});var n=r(7462),a=r(7294),l=r(6010),i=r(2466),o=r(6550),s=r(1980),u=r(7392),p=r(12);function c(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}function m(e){const{values:t,children:r}=e;return(0,a.useMemo)((()=>{const e=t??c(r);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function d(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:r}=e;const n=(0,o.k6)(),l=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,s._X)(l),(0,a.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function b(e){const{defaultValue:t,queryString:r=!1,groupId:n}=e,l=m(e),[i,o]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!d({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:l}))),[s,u]=f({queryString:r,groupId:n}),[c,b]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,p.Nk)(r);return[n,(0,a.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:n}),g=(()=>{const e=s??c;return d({value:e,tabValues:l})?e:null})();(0,a.useLayoutEffect)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,a.useCallback)((e=>{if(!d({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),b(e)}),[u,b,l]),tabValues:l}}var g=r(2389);const h={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function v(e){let{className:t,block:r,selectedValue:o,selectValue:s,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.o5)(),m=e=>{const t=e.currentTarget,r=p.indexOf(t),n=u[r].value;n!==o&&(c(t),s(n))},d=e=>{let t=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const r=p.indexOf(e.currentTarget)+1;t=p[r]??p[0];break}case"ArrowLeft":{const r=p.indexOf(e.currentTarget)-1;t=p[r]??p[p.length-1];break}}t?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":r},t)},u.map((e=>{let{value:t,label:r,attributes:i}=e;return a.createElement("li",(0,n.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>p.push(e),onKeyDown:d,onClick:m},i,{className:(0,l.Z)("tabs__item",h.tabItem,i?.className,{"tabs__item--active":o===t})}),r??t)})))}function k(e){let{lazy:t,children:r,selectedValue:n}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===n));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function y(e){const t=b(e);return a.createElement("div",{className:(0,l.Z)("tabs-container",h.tabList)},a.createElement(v,(0,n.Z)({},e,t)),a.createElement(k,(0,n.Z)({},e,t)))}function N(e){const t=(0,g.Z)();return a.createElement(y,(0,n.Z)({key:String(t)},e))}},8426:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>f,frontMatter:()=>o,metadata:()=>u,toc:()=>c});var n=r(7462),a=(r(7294),r(3905)),l=r(4866),i=r(5162);const o={id:"templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",sidebar_position:3},s=void 0,u={unversionedId:"guide/templates",id:"version-v1.x/guide/templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",source:"@site/versioned_docs/version-v1.x/guide/templates.md",sourceDirName:"guide",slug:"/guide/templates",permalink:"/v1.x/guide/templates",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:3,frontMatter:{id:"templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\ud83c\udfad Grouping",permalink:"/v1.x/guide/grouping"},next:{title:"\ud83d\udd0e Validating",permalink:"/v1.x/guide/validating"}},p={},c=[{value:"Template interfaces",id:"template-interfaces",level:2},{value:"Engines",id:"engines",level:2}],m={toc:c},d="wrapper";function f(e){let{components:t,...r}=e;return(0,a.kt)(d,(0,n.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"template-interfaces"},"Template interfaces"),(0,a.kt)("p",null,"Fiber provides a Views interface to provide your own template engine:"),(0,a.kt)(l.Z,{mdxType:"Tabs"},(0,a.kt)(i.Z,{value:"views",label:"Views",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"type Views interface {\n Load() error\n Render(io.Writer, string, interface{}, ...string) error\n}\n")))),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Views")," interface contains a ",(0,a.kt)("inlineCode",{parentName:"p"},"Load")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"Render")," method, ",(0,a.kt)("inlineCode",{parentName:"p"},"Load")," is executed by Fiber on app initialization to load/parse the templates."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Pass engine to Fiber's Views Engine\napp := fiber.New(&fiber.Settings{\n Views: engine,\n})\n")),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"Render")," method is linked to the ",(0,a.kt)("a",{parentName:"p",href:"../api/ctx#render"},(0,a.kt)("strong",{parentName:"a"},"ctx.Render","(",")"))," function that accepts a template name and binding data."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/", func(c *fiber.Ctx) error {\n return c.Render("index", fiber.Map{\n "hello": "world",\n });\n})\n')),(0,a.kt)("h2",{id:"engines"},"Engines"),(0,a.kt)("p",null,"Fiber team maintains ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/template"},"templates")," package that provides wrappers for multiple template engines:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/html"},"html")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/ace"},"ace")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/amber"},"amber")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/django"},"django")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/handlebars"},"handlebars")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/jet"},"jet")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/mustache"},"mustache")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/pug"},"pug"))),(0,a.kt)(l.Z,{mdxType:"Tabs"},(0,a.kt)(i.Z,{value:"example",label:"Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber"\n "github.com/gofiber/template/html"\n)\n\nfunc main() {\n // Initialize standard Go html template engine\n engine := html.New("./views", ".html")\n\n app := fiber.New(&fiber.Settings{\n Views: engine,\n })\n app.Get("/", func(c *fiber.Ctx) {\n // Render index template\n _ = c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Listen(3000)\n}\n'))),(0,a.kt)(i.Z,{value:"index",label:"views/index.html",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-markup"},"\n\n

{{.Title}}

\n\n\n")))))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6570],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>f});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),u=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,l=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=u(r),d=a,f=c["".concat(s,".").concat(d)]||c[d]||m[d]||l;return r?n.createElement(f,i(i({ref:t},p),{},{components:r})):n.createElement(f,i({ref:t},p))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=r.length,i=new Array(l);i[0]=d;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[c]="string"==typeof e?e:a,i[1]=o;for(var u=2;u{r.d(t,{Z:()=>i});var n=r(7294),a=r(6010);const l={tabItem:"tabItem_Ymn6"};function i(e){let{children:t,hidden:r,className:i}=e;return n.createElement("div",{role:"tabpanel",className:(0,a.Z)(l.tabItem,i),hidden:r},t)}},4866:(e,t,r)=>{r.d(t,{Z:()=>N});var n=r(7462),a=r(7294),l=r(6010),i=r(2466),o=r(6550),s=r(1980),u=r(7392),p=r(12);function c(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}function m(e){const{values:t,children:r}=e;return(0,a.useMemo)((()=>{const e=t??c(r);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function d(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:r}=e;const n=(0,o.k6)(),l=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,s._X)(l),(0,a.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function b(e){const{defaultValue:t,queryString:r=!1,groupId:n}=e,l=m(e),[i,o]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!d({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:l}))),[s,u]=f({queryString:r,groupId:n}),[c,b]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,p.Nk)(r);return[n,(0,a.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:n}),g=(()=>{const e=s??c;return d({value:e,tabValues:l})?e:null})();(0,a.useLayoutEffect)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,a.useCallback)((e=>{if(!d({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),b(e)}),[u,b,l]),tabValues:l}}var g=r(2389);const h={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function v(e){let{className:t,block:r,selectedValue:o,selectValue:s,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.o5)(),m=e=>{const t=e.currentTarget,r=p.indexOf(t),n=u[r].value;n!==o&&(c(t),s(n))},d=e=>{let t=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const r=p.indexOf(e.currentTarget)+1;t=p[r]??p[0];break}case"ArrowLeft":{const r=p.indexOf(e.currentTarget)-1;t=p[r]??p[p.length-1];break}}t?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":r},t)},u.map((e=>{let{value:t,label:r,attributes:i}=e;return a.createElement("li",(0,n.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>p.push(e),onKeyDown:d,onClick:m},i,{className:(0,l.Z)("tabs__item",h.tabItem,i?.className,{"tabs__item--active":o===t})}),r??t)})))}function k(e){let{lazy:t,children:r,selectedValue:n}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===n));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function y(e){const t=b(e);return a.createElement("div",{className:(0,l.Z)("tabs-container",h.tabList)},a.createElement(v,(0,n.Z)({},e,t)),a.createElement(k,(0,n.Z)({},e,t)))}function N(e){const t=(0,g.Z)();return a.createElement(y,(0,n.Z)({key:String(t)},e))}},8426:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>f,frontMatter:()=>o,metadata:()=>u,toc:()=>c});var n=r(7462),a=(r(7294),r(3905)),l=r(4866),i=r(5162);const o={id:"templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",sidebar_position:3},s=void 0,u={unversionedId:"guide/templates",id:"version-v1.x/guide/templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",source:"@site/versioned_docs/version-v1.x/guide/templates.md",sourceDirName:"guide",slug:"/guide/templates",permalink:"/v1.x/guide/templates",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:3,frontMatter:{id:"templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\ud83c\udfad Grouping",permalink:"/v1.x/guide/grouping"},next:{title:"\ud83d\udd0e Validating",permalink:"/v1.x/guide/validating"}},p={},c=[{value:"Template interfaces",id:"template-interfaces",level:2},{value:"Engines",id:"engines",level:2}],m={toc:c},d="wrapper";function f(e){let{components:t,...r}=e;return(0,a.kt)(d,(0,n.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"template-interfaces"},"Template interfaces"),(0,a.kt)("p",null,"Fiber provides a Views interface to provide your own template engine:"),(0,a.kt)(l.Z,{mdxType:"Tabs"},(0,a.kt)(i.Z,{value:"views",label:"Views",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"type Views interface {\n Load() error\n Render(io.Writer, string, interface{}, ...string) error\n}\n")))),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Views")," interface contains a ",(0,a.kt)("inlineCode",{parentName:"p"},"Load")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"Render")," method, ",(0,a.kt)("inlineCode",{parentName:"p"},"Load")," is executed by Fiber on app initialization to load/parse the templates."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Pass engine to Fiber's Views Engine\napp := fiber.New(&fiber.Settings{\n Views: engine,\n})\n")),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"Render")," method is linked to the ",(0,a.kt)("a",{parentName:"p",href:"../api/ctx#render"},(0,a.kt)("strong",{parentName:"a"},"ctx.Render","(",")"))," function that accepts a template name and binding data."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/", func(c *fiber.Ctx) error {\n return c.Render("index", fiber.Map{\n "hello": "world",\n });\n})\n')),(0,a.kt)("h2",{id:"engines"},"Engines"),(0,a.kt)("p",null,"Fiber team maintains ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/template"},"templates")," package that provides wrappers for multiple template engines:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/html"},"html")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/ace"},"ace")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/amber"},"amber")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/django"},"django")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/handlebars"},"handlebars")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/jet"},"jet")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/mustache"},"mustache")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/pug"},"pug"))),(0,a.kt)(l.Z,{mdxType:"Tabs"},(0,a.kt)(i.Z,{value:"example",label:"Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber"\n "github.com/gofiber/template/html"\n)\n\nfunc main() {\n // Initialize standard Go html template engine\n engine := html.New("./views", ".html")\n\n app := fiber.New(&fiber.Settings{\n Views: engine,\n })\n app.Get("/", func(c *fiber.Ctx) {\n // Render index template\n _ = c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Listen(3000)\n}\n'))),(0,a.kt)(i.Z,{value:"index",label:"views/index.html",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-markup"},"\n\n

{{.Title}}

\n\n\n")))))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/20b2a36a.41882872.js b/assets/js/20b2a36a.a52134d3.js similarity index 99% rename from assets/js/20b2a36a.41882872.js rename to assets/js/20b2a36a.a52134d3.js index b9a305e0e59..7bd783e9e01 100644 --- a/assets/js/20b2a36a.41882872.js +++ b/assets/js/20b2a36a.a52134d3.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6050],{3905:(t,e,n)=>{n.d(e,{Zo:()=>s,kt:()=>k});var a=n(7294);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function o(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var p=a.createContext({}),d=function(t){var e=a.useContext(p),n=e;return t&&(n="function"==typeof t?t(e):o(o({},e),t)),n},s=function(t){var e=d(t.components);return a.createElement(p.Provider,{value:e},t.children)},c="mdxType",m={inlineCode:"code",wrapper:function(t){var e=t.children;return a.createElement(a.Fragment,{},e)}},u=a.forwardRef((function(t,e){var n=t.components,r=t.mdxType,i=t.originalType,p=t.parentName,s=l(t,["components","mdxType","originalType","parentName"]),c=d(n),u=r,k=c["".concat(p,".").concat(u)]||c[u]||m[u]||i;return n?a.createElement(k,o(o({ref:e},s),{},{components:n})):a.createElement(k,o({ref:e},s))}));function k(t,e){var n=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var i=n.length,o=new Array(i);o[0]=u;var l={};for(var p in e)hasOwnProperty.call(e,p)&&(l[p]=e[p]);l.originalType=t,l[c]="string"==typeof t?t:r,o[1]=l;for(var d=2;d{n.r(e),n.d(e,{assets:()=>p,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>d});var a=n(7462),r=(n(7294),n(3905));const i={id:"paseto",title:"Paseto"},o=void 0,l={unversionedId:"paseto/paseto",id:"paseto/paseto",title:"Paseto",description:"Release",source:"@site/docs/contrib/paseto/README.md",sourceDirName:"paseto",slug:"/paseto/",permalink:"/contrib/paseto/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/paseto/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"paseto",title:"Paseto"},sidebar:"tutorialSidebar",previous:{title:"Example",permalink:"/contrib/otelfiber/example/"},next:{title:"Swagger",permalink:"/contrib/swagger/"}},p={},d=[{value:"Install",id:"install",level:3},{value:"Signature",id:"signature",level:3},{value:"Config",id:"config",level:3},{value:"Instructions",id:"instructions",level:3}],s={toc:d},c="wrapper";function m(t){let{components:e,...n}=t;return(0,r.kt)(c,(0,a.Z)({},s,n,{components:e,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=paseto*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,r.kt)("p",null,"PASETO returns a Web Token (PASETO) auth middleware."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"For valid token, it sets the payload data in Ctx.Locals and calls next handler."),(0,r.kt)("li",{parentName:"ul"},'For invalid token, it returns "401 - Unauthorized" error.'),(0,r.kt)("li",{parentName:"ul"},'For missing token, it returns "400 - BadRequest" error.')),(0,r.kt)("h3",{id:"install"},"Install"),(0,r.kt)("p",null,"This middleware supports Fiber v2."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"go get -u github.com/gofiber/fiber/v2\ngo get -u github.com/gofiber/contrib/paseto\ngo get -u github.com/o1egl/paseto\n")),(0,r.kt)("h3",{id:"signature"},"Signature"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"pasetoware.New(config ...pasetoware.Config) func(*fiber.Ctx) error\n")),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"left"},"Property"),(0,r.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,r.kt)("th",{parentName:"tr",align:"left"},"Description"),(0,r.kt)("th",{parentName:"tr",align:"left"},"Default"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"Next"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"func(*Ctx) bool")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Defines a function to skip middleware"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"SuccessHandler"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) error")),(0,r.kt)("td",{parentName:"tr",align:"left"},"SuccessHandler defines a function which is executed for a valid token."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"c.Next()"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"ErrorHandler"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx, error) error")),(0,r.kt)("td",{parentName:"tr",align:"left"},"ErrorHandler defines a function which is executed for an invalid token."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"401 Invalid or expired PASETO"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"Validate"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"PayloadValidator")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Defines a function to validate if payload is valid. Optional. In case payload used is created using ",(0,r.kt)("inlineCode",{parentName:"td"},"CreateToken")," function. If token is created using another function, this function must be provided."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"SymmetricKey"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"[]byte")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Secret key to encrypt token. If present the middleware will generate local tokens."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"PrivateKey"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"ed25519.PrivateKey")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Secret key to sign the tokens. If present (along with its ",(0,r.kt)("inlineCode",{parentName:"td"},"PublicKey"),") the middleware will generate public tokens."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"PublicKey"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"crypto.PublicKey")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Public key to verify the tokens. If present (along with ",(0,r.kt)("inlineCode",{parentName:"td"},"PrivateKey"),") the middleware will generate public tokens."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"ContextKey"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Context key to store user information from the token into context."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},'"auth-token"'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"TokenLookup"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"[2]string")),(0,r.kt)("td",{parentName:"tr",align:"left"},"TokenLookup is a string slice with size 2, that is used to extract token from the request"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},'["header","Authorization"]'))))),(0,r.kt)("h3",{id:"instructions"},"Instructions"),(0,r.kt)("p",null,"When using this middleware, and creating a token for authentication, you can use the function pasetoware.CreateToken, that will create a token, encrypt or sign it and returns the PASETO token."),(0,r.kt)("p",null,"Passing a ",(0,r.kt)("inlineCode",{parentName:"p"},"SymmetricKey")," in the Config results in a local (encrypted) token, while passing a ",(0,r.kt)("inlineCode",{parentName:"p"},"PublicKey")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"PrivateKey")," results in a public (signed) token."),(0,r.kt)("p",null,"In case you want to use your own data structure, is needed to provide the ",(0,r.kt)("inlineCode",{parentName:"p"},"Validate")," function in ",(0,r.kt)("inlineCode",{parentName:"p"},"paseware.Config"),", that will return the data stored in the token, and a error."))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6050],{3905:(t,e,n)=>{n.d(e,{Zo:()=>s,kt:()=>k});var a=n(7294);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function o(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var p=a.createContext({}),d=function(t){var e=a.useContext(p),n=e;return t&&(n="function"==typeof t?t(e):o(o({},e),t)),n},s=function(t){var e=d(t.components);return a.createElement(p.Provider,{value:e},t.children)},c="mdxType",m={inlineCode:"code",wrapper:function(t){var e=t.children;return a.createElement(a.Fragment,{},e)}},u=a.forwardRef((function(t,e){var n=t.components,r=t.mdxType,i=t.originalType,p=t.parentName,s=l(t,["components","mdxType","originalType","parentName"]),c=d(n),u=r,k=c["".concat(p,".").concat(u)]||c[u]||m[u]||i;return n?a.createElement(k,o(o({ref:e},s),{},{components:n})):a.createElement(k,o({ref:e},s))}));function k(t,e){var n=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var i=n.length,o=new Array(i);o[0]=u;var l={};for(var p in e)hasOwnProperty.call(e,p)&&(l[p]=e[p]);l.originalType=t,l[c]="string"==typeof t?t:r,o[1]=l;for(var d=2;d{n.r(e),n.d(e,{assets:()=>p,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>d});var a=n(7462),r=(n(7294),n(3905));const i={id:"paseto",title:"Paseto"},o=void 0,l={unversionedId:"paseto/paseto",id:"paseto/paseto",title:"Paseto",description:"Release",source:"@site/docs/contrib/paseto/README.md",sourceDirName:"paseto",slug:"/paseto/",permalink:"/contrib/paseto/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/paseto/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"paseto",title:"Paseto"},sidebar:"tutorialSidebar",previous:{title:"Example",permalink:"/contrib/otelfiber/example/"},next:{title:"Swagger",permalink:"/contrib/swagger/"}},p={},d=[{value:"Install",id:"install",level:3},{value:"Signature",id:"signature",level:3},{value:"Config",id:"config",level:3},{value:"Instructions",id:"instructions",level:3}],s={toc:d},c="wrapper";function m(t){let{components:e,...n}=t;return(0,r.kt)(c,(0,a.Z)({},s,n,{components:e,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=paseto*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,r.kt)("p",null,"PASETO returns a Web Token (PASETO) auth middleware."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"For valid token, it sets the payload data in Ctx.Locals and calls next handler."),(0,r.kt)("li",{parentName:"ul"},'For invalid token, it returns "401 - Unauthorized" error.'),(0,r.kt)("li",{parentName:"ul"},'For missing token, it returns "400 - BadRequest" error.')),(0,r.kt)("h3",{id:"install"},"Install"),(0,r.kt)("p",null,"This middleware supports Fiber v2."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"go get -u github.com/gofiber/fiber/v2\ngo get -u github.com/gofiber/contrib/paseto\ngo get -u github.com/o1egl/paseto\n")),(0,r.kt)("h3",{id:"signature"},"Signature"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"pasetoware.New(config ...pasetoware.Config) func(*fiber.Ctx) error\n")),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:"left"},"Property"),(0,r.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,r.kt)("th",{parentName:"tr",align:"left"},"Description"),(0,r.kt)("th",{parentName:"tr",align:"left"},"Default"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"Next"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"func(*Ctx) bool")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Defines a function to skip middleware"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"SuccessHandler"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) error")),(0,r.kt)("td",{parentName:"tr",align:"left"},"SuccessHandler defines a function which is executed for a valid token."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"c.Next()"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"ErrorHandler"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx, error) error")),(0,r.kt)("td",{parentName:"tr",align:"left"},"ErrorHandler defines a function which is executed for an invalid token."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"401 Invalid or expired PASETO"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"Validate"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"PayloadValidator")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Defines a function to validate if payload is valid. Optional. In case payload used is created using ",(0,r.kt)("inlineCode",{parentName:"td"},"CreateToken")," function. If token is created using another function, this function must be provided."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"SymmetricKey"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"[]byte")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Secret key to encrypt token. If present the middleware will generate local tokens."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"PrivateKey"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"ed25519.PrivateKey")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Secret key to sign the tokens. If present (along with its ",(0,r.kt)("inlineCode",{parentName:"td"},"PublicKey"),") the middleware will generate public tokens."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"PublicKey"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"crypto.PublicKey")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Public key to verify the tokens. If present (along with ",(0,r.kt)("inlineCode",{parentName:"td"},"PrivateKey"),") the middleware will generate public tokens."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"ContextKey"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:"left"},"Context key to store user information from the token into context."),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},'"auth-token"'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:"left"},"TokenLookup"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},"[2]string")),(0,r.kt)("td",{parentName:"tr",align:"left"},"TokenLookup is a string slice with size 2, that is used to extract token from the request"),(0,r.kt)("td",{parentName:"tr",align:"left"},(0,r.kt)("inlineCode",{parentName:"td"},'["header","Authorization"]'))))),(0,r.kt)("h3",{id:"instructions"},"Instructions"),(0,r.kt)("p",null,"When using this middleware, and creating a token for authentication, you can use the function pasetoware.CreateToken, that will create a token, encrypt or sign it and returns the PASETO token."),(0,r.kt)("p",null,"Passing a ",(0,r.kt)("inlineCode",{parentName:"p"},"SymmetricKey")," in the Config results in a local (encrypted) token, while passing a ",(0,r.kt)("inlineCode",{parentName:"p"},"PublicKey")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"PrivateKey")," results in a public (signed) token."),(0,r.kt)("p",null,"In case you want to use your own data structure, is needed to provide the ",(0,r.kt)("inlineCode",{parentName:"p"},"Validate")," function in ",(0,r.kt)("inlineCode",{parentName:"p"},"paseware.Config"),", that will return the data stored in the token, and a error."))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/20e81fa7.34ed80bb.js b/assets/js/20e81fa7.a687e623.js similarity index 99% rename from assets/js/20e81fa7.34ed80bb.js rename to assets/js/20e81fa7.a687e623.js index 50d8e1ca1ca..2e7631b2ae6 100644 --- a/assets/js/20e81fa7.34ed80bb.js +++ b/assets/js/20e81fa7.a687e623.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7961],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>h});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),p=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},u=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=p(r),d=a,h=c["".concat(s,".").concat(d)]||c[d]||m[d]||o;return r?n.createElement(h,i(i({ref:t},u),{},{components:r})):n.createElement(h,i({ref:t},u))}));function h(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:a,i[1]=l;for(var p=2;p{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var n=r(7462),a=(r(7294),r(3905));const o={id:"faq",title:"\ud83e\udd14 FAQ",description:"List of frequently asked questions. Feel free to open an issue to add your question to this page.",sidebar_position:1},i=void 0,l={unversionedId:"extra/faq",id:"version-v2.x/extra/faq",title:"\ud83e\udd14 FAQ",description:"List of frequently asked questions. Feel free to open an issue to add your question to this page.",source:"@site/versioned_docs/version-v2.x/extra/faq.md",sourceDirName:"extra",slug:"/extra/faq",permalink:"/extra/faq",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{id:"faq",title:"\ud83e\udd14 FAQ",description:"List of frequently asked questions. Feel free to open an issue to add your question to this page.",sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Extra",permalink:"/category/extra"},next:{title:"\ud83d\udcca Benchmarks",permalink:"/extra/benchmarks"}},s={},p=[{value:"How should I structure my application?",id:"how-should-i-structure-my-application",level:2},{value:"How do I handle custom 404 responses?",id:"how-do-i-handle-custom-404-responses",level:2},{value:"How can i use live reload ?",id:"how-can-i-use-live-reload-",level:2},{value:"How do I set up an error handler?",id:"how-do-i-set-up-an-error-handler",level:2},{value:"Which template engines does Fiber support?",id:"which-template-engines-does-fiber-support",level:2},{value:"Does Fiber have a community chat?",id:"does-fiber-have-a-community-chat",level:2},{value:"Does fiber support sub domain routing ?",id:"does-fiber-support-sub-domain-routing-",level:2}],u={toc:p},c="wrapper";function m(e){let{components:t,...o}=e;return(0,a.kt)(c,(0,n.Z)({},u,o,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"how-should-i-structure-my-application"},"How should I structure my application?"),(0,a.kt)("p",null,"There is no definitive answer to this question. The answer depends on the scale of your application and the team that is involved. To be as flexible as possible, Fiber makes no assumptions in terms of structure."),(0,a.kt)("p",null,"Routes and other application-specific logic can live in as many files as you wish, in any directory structure you prefer. View the following examples for inspiration:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/boilerplate"},"gofiber/boilerplate")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/thomasvvugt/fiber-boilerplate"},"thomasvvugt/fiber-boilerplate")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://www.youtube.com/watch?v=Iq2qT0fRhAA"},"Youtube - Building a REST API using Gorm and Fiber")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/embedmode/fiberseed"},"embedmode/fiberseed"))),(0,a.kt)("h2",{id:"how-do-i-handle-custom-404-responses"},"How do I handle custom 404 responses?"),(0,a.kt)("p",null,"If you're using v2.32.0 or later, all you need to do is to implement a custom error handler. See below, or see a more detailed explanation at ",(0,a.kt)("a",{parentName:"p",href:"/guide/error-handling#custom-error-handler"},"Error Handling"),". "),(0,a.kt)("p",null,"If you're using v2.31.0 or earlier, the error handler will not capture 404 errors. Instead, you need to add a middleware function at the very bottom of the stack ","(","below all other functions",")"," to handle a 404 response:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Use(func(c *fiber.Ctx) error {\n return c.Status(fiber.StatusNotFound).SendString("Sorry can\'t find that!")\n})\n')),(0,a.kt)("h2",{id:"how-can-i-use-live-reload-"},"How can i use live reload ?"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/cosmtrek/air"},"Air")," is a handy tool that automatically restarts your Go applications whenever the source code changes, making your development process faster and more efficient."),(0,a.kt)("p",null,"To use Air in a Fiber project, follow these steps:"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Install Air by downloading the appropriate binary for your operating system from the GitHub release page or by building the tool directly from source."),(0,a.kt)("li",{parentName:"ol"},"Create a configuration file for Air in your project directory. This file can be named, for example, .air.toml or air.conf. Here's a sample configuration file that works with Fiber:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-toml"},'# .air.toml\nroot = "."\ntmp_dir = "tmp"\n[build]\n cmd = "go build -o ./tmp/main ."\n bin = "./tmp/main"\n delay = 1000 # ms\n exclude_dir = ["assets", "tmp", "vendor"]\n include_ext = ["go", "tpl", "tmpl", "html"]\n exclude_regex = ["_test\\\\.go"]\n')),(0,a.kt)("ol",{start:3},(0,a.kt)("li",{parentName:"ol"},"Start your Fiber application using Air by running the following command in the terminal:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"air\n")),(0,a.kt)("p",null,"As you make changes to your source code, Air will detect them and automatically restart the application."),(0,a.kt)("p",null,"A complete example demonstrating the use of Air with Fiber can be found in the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/recipes/tree/master/air"},"Fiber Recipes repository"),". This example shows how to configure and use Air in a Fiber project to create an efficient development environment."),(0,a.kt)("h2",{id:"how-do-i-set-up-an-error-handler"},"How do I set up an error handler?"),(0,a.kt)("p",null,"To override the default error handler, you can override the default when providing a ",(0,a.kt)("a",{parentName:"p",href:"/api/fiber#config"},"Config")," when initiating a new ",(0,a.kt)("a",{parentName:"p",href:"/api/fiber#new"},"Fiber instance"),"."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"app := fiber.New(fiber.Config{\n ErrorHandler: func(c *fiber.Ctx, err error) error {\n return c.Status(fiber.StatusInternalServerError).SendString(err.Error())\n },\n})\n")),(0,a.kt)("p",null,"We have a dedicated page explaining how error handling works in Fiber, see ",(0,a.kt)("a",{parentName:"p",href:"/guide/error-handling"},"Error Handling"),"."),(0,a.kt)("h2",{id:"which-template-engines-does-fiber-support"},"Which template engines does Fiber support?"),(0,a.kt)("p",null,"Fiber currently supports 8 template engines in our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/template"},"gofiber/template")," middleware:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/yosssi/ace"},"Ace")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/eknkc/amber"},"Amber")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/flosch/pongo2"},"Django")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/aymerick/raymond"},"Handlebars")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://pkg.go.dev/html/template/"},"HTML")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/CloudyKit/jet"},"Jet")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/cbroglie/mustache"},"Mustache")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/Joker/jade"},"Pug"))),(0,a.kt)("p",null,"To learn more about using Templates in Fiber, see ",(0,a.kt)("a",{parentName:"p",href:"/guide/templates"},"Templates"),"."),(0,a.kt)("h2",{id:"does-fiber-have-a-community-chat"},"Does Fiber have a community chat?"),(0,a.kt)("p",null,"Yes, we have our own ",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},"Discord "),"server, where we hang out. We have different rooms for every subject.",(0,a.kt)("br",{parentName:"p"}),"\n","If you have questions or just want to have a chat, feel free to join us via this ",(0,a.kt)("strong",{parentName:"p"},">")," ",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("strong",{parentName:"a"},"invite link"))," ",(0,a.kt)("strong",{parentName:"p"},"<"),"."),(0,a.kt)("p",null,(0,a.kt)("img",{src:r(408).Z,width:"243",height:"236"})),(0,a.kt)("h2",{id:"does-fiber-support-sub-domain-routing-"},"Does fiber support sub domain routing ?"),(0,a.kt)("p",null,"Yes we do, here are some examples:\nThis example works v2"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/logger"\n)\n\ntype Host struct {\n Fiber *fiber.App\n}\n\nfunc main() {\n // Hosts\n hosts := map[string]*Host{}\n //-----\n // API\n //-----\n api := fiber.New()\n api.Use(logger.New(logger.Config{\n Format: "[${ip}]:${port} ${status} - ${method} ${path}\\n",\n }))\n hosts["api.localhost:3000"] = &Host{api}\n api.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("API")\n })\n //------\n // Blog\n //------\n blog := fiber.New()\n blog.Use(logger.New(logger.Config{\n Format: "[${ip}]:${port} ${status} - ${method} ${path}\\n",\n }))\n hosts["blog.localhost:3000"] = &Host{blog}\n blog.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Blog")\n })\n //---------\n // Website\n //---------\n site := fiber.New()\n site.Use(logger.New(logger.Config{\n Format: "[${ip}]:${port} ${status} - ${method} ${path}\\n",\n }))\n\n hosts["localhost:3000"] = &Host{site}\n site.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Website")\n })\n // Server\n app := fiber.New()\n app.Use(func(c *fiber.Ctx) error {\n host := hosts[c.Hostname()]\n if host == nil {\n return c.SendStatus(fiber.StatusNotFound)\n } else {\n host.Fiber.Handler()(c.Context())\n return nil\n }\n })\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("p",null,"If more information is needed, please refer to this issue ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber/issues/750"},"#750")))}m.isMDXComponent=!0},408:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/support-discord-baf5f38231088813dfbc3ccdc6966634.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7961],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>h});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),p=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},u=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=p(r),d=a,h=c["".concat(s,".").concat(d)]||c[d]||m[d]||o;return r?n.createElement(h,i(i({ref:t},u),{},{components:r})):n.createElement(h,i({ref:t},u))}));function h(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:a,i[1]=l;for(var p=2;p{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var n=r(7462),a=(r(7294),r(3905));const o={id:"faq",title:"\ud83e\udd14 FAQ",description:"List of frequently asked questions. Feel free to open an issue to add your question to this page.",sidebar_position:1},i=void 0,l={unversionedId:"extra/faq",id:"version-v2.x/extra/faq",title:"\ud83e\udd14 FAQ",description:"List of frequently asked questions. Feel free to open an issue to add your question to this page.",source:"@site/versioned_docs/version-v2.x/extra/faq.md",sourceDirName:"extra",slug:"/extra/faq",permalink:"/extra/faq",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{id:"faq",title:"\ud83e\udd14 FAQ",description:"List of frequently asked questions. Feel free to open an issue to add your question to this page.",sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Extra",permalink:"/category/extra"},next:{title:"\ud83d\udcca Benchmarks",permalink:"/extra/benchmarks"}},s={},p=[{value:"How should I structure my application?",id:"how-should-i-structure-my-application",level:2},{value:"How do I handle custom 404 responses?",id:"how-do-i-handle-custom-404-responses",level:2},{value:"How can i use live reload ?",id:"how-can-i-use-live-reload-",level:2},{value:"How do I set up an error handler?",id:"how-do-i-set-up-an-error-handler",level:2},{value:"Which template engines does Fiber support?",id:"which-template-engines-does-fiber-support",level:2},{value:"Does Fiber have a community chat?",id:"does-fiber-have-a-community-chat",level:2},{value:"Does fiber support sub domain routing ?",id:"does-fiber-support-sub-domain-routing-",level:2}],u={toc:p},c="wrapper";function m(e){let{components:t,...o}=e;return(0,a.kt)(c,(0,n.Z)({},u,o,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"how-should-i-structure-my-application"},"How should I structure my application?"),(0,a.kt)("p",null,"There is no definitive answer to this question. The answer depends on the scale of your application and the team that is involved. To be as flexible as possible, Fiber makes no assumptions in terms of structure."),(0,a.kt)("p",null,"Routes and other application-specific logic can live in as many files as you wish, in any directory structure you prefer. View the following examples for inspiration:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/boilerplate"},"gofiber/boilerplate")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/thomasvvugt/fiber-boilerplate"},"thomasvvugt/fiber-boilerplate")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://www.youtube.com/watch?v=Iq2qT0fRhAA"},"Youtube - Building a REST API using Gorm and Fiber")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/embedmode/fiberseed"},"embedmode/fiberseed"))),(0,a.kt)("h2",{id:"how-do-i-handle-custom-404-responses"},"How do I handle custom 404 responses?"),(0,a.kt)("p",null,"If you're using v2.32.0 or later, all you need to do is to implement a custom error handler. See below, or see a more detailed explanation at ",(0,a.kt)("a",{parentName:"p",href:"/guide/error-handling#custom-error-handler"},"Error Handling"),". "),(0,a.kt)("p",null,"If you're using v2.31.0 or earlier, the error handler will not capture 404 errors. Instead, you need to add a middleware function at the very bottom of the stack ","(","below all other functions",")"," to handle a 404 response:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Use(func(c *fiber.Ctx) error {\n return c.Status(fiber.StatusNotFound).SendString("Sorry can\'t find that!")\n})\n')),(0,a.kt)("h2",{id:"how-can-i-use-live-reload-"},"How can i use live reload ?"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/cosmtrek/air"},"Air")," is a handy tool that automatically restarts your Go applications whenever the source code changes, making your development process faster and more efficient."),(0,a.kt)("p",null,"To use Air in a Fiber project, follow these steps:"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Install Air by downloading the appropriate binary for your operating system from the GitHub release page or by building the tool directly from source."),(0,a.kt)("li",{parentName:"ol"},"Create a configuration file for Air in your project directory. This file can be named, for example, .air.toml or air.conf. Here's a sample configuration file that works with Fiber:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-toml"},'# .air.toml\nroot = "."\ntmp_dir = "tmp"\n[build]\n cmd = "go build -o ./tmp/main ."\n bin = "./tmp/main"\n delay = 1000 # ms\n exclude_dir = ["assets", "tmp", "vendor"]\n include_ext = ["go", "tpl", "tmpl", "html"]\n exclude_regex = ["_test\\\\.go"]\n')),(0,a.kt)("ol",{start:3},(0,a.kt)("li",{parentName:"ol"},"Start your Fiber application using Air by running the following command in the terminal:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"air\n")),(0,a.kt)("p",null,"As you make changes to your source code, Air will detect them and automatically restart the application."),(0,a.kt)("p",null,"A complete example demonstrating the use of Air with Fiber can be found in the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/recipes/tree/master/air"},"Fiber Recipes repository"),". This example shows how to configure and use Air in a Fiber project to create an efficient development environment."),(0,a.kt)("h2",{id:"how-do-i-set-up-an-error-handler"},"How do I set up an error handler?"),(0,a.kt)("p",null,"To override the default error handler, you can override the default when providing a ",(0,a.kt)("a",{parentName:"p",href:"/api/fiber#config"},"Config")," when initiating a new ",(0,a.kt)("a",{parentName:"p",href:"/api/fiber#new"},"Fiber instance"),"."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"app := fiber.New(fiber.Config{\n ErrorHandler: func(c *fiber.Ctx, err error) error {\n return c.Status(fiber.StatusInternalServerError).SendString(err.Error())\n },\n})\n")),(0,a.kt)("p",null,"We have a dedicated page explaining how error handling works in Fiber, see ",(0,a.kt)("a",{parentName:"p",href:"/guide/error-handling"},"Error Handling"),"."),(0,a.kt)("h2",{id:"which-template-engines-does-fiber-support"},"Which template engines does Fiber support?"),(0,a.kt)("p",null,"Fiber currently supports 8 template engines in our ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/template"},"gofiber/template")," middleware:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/yosssi/ace"},"Ace")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/eknkc/amber"},"Amber")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/flosch/pongo2"},"Django")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/aymerick/raymond"},"Handlebars")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://pkg.go.dev/html/template/"},"HTML")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/CloudyKit/jet"},"Jet")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/cbroglie/mustache"},"Mustache")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/Joker/jade"},"Pug"))),(0,a.kt)("p",null,"To learn more about using Templates in Fiber, see ",(0,a.kt)("a",{parentName:"p",href:"/guide/templates"},"Templates"),"."),(0,a.kt)("h2",{id:"does-fiber-have-a-community-chat"},"Does Fiber have a community chat?"),(0,a.kt)("p",null,"Yes, we have our own ",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},"Discord "),"server, where we hang out. We have different rooms for every subject.",(0,a.kt)("br",{parentName:"p"}),"\n","If you have questions or just want to have a chat, feel free to join us via this ",(0,a.kt)("strong",{parentName:"p"},">")," ",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("strong",{parentName:"a"},"invite link"))," ",(0,a.kt)("strong",{parentName:"p"},"<"),"."),(0,a.kt)("p",null,(0,a.kt)("img",{src:r(408).Z,width:"243",height:"236"})),(0,a.kt)("h2",{id:"does-fiber-support-sub-domain-routing-"},"Does fiber support sub domain routing ?"),(0,a.kt)("p",null,"Yes we do, here are some examples:\nThis example works v2"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/logger"\n)\n\ntype Host struct {\n Fiber *fiber.App\n}\n\nfunc main() {\n // Hosts\n hosts := map[string]*Host{}\n //-----\n // API\n //-----\n api := fiber.New()\n api.Use(logger.New(logger.Config{\n Format: "[${ip}]:${port} ${status} - ${method} ${path}\\n",\n }))\n hosts["api.localhost:3000"] = &Host{api}\n api.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("API")\n })\n //------\n // Blog\n //------\n blog := fiber.New()\n blog.Use(logger.New(logger.Config{\n Format: "[${ip}]:${port} ${status} - ${method} ${path}\\n",\n }))\n hosts["blog.localhost:3000"] = &Host{blog}\n blog.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Blog")\n })\n //---------\n // Website\n //---------\n site := fiber.New()\n site.Use(logger.New(logger.Config{\n Format: "[${ip}]:${port} ${status} - ${method} ${path}\\n",\n }))\n\n hosts["localhost:3000"] = &Host{site}\n site.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Website")\n })\n // Server\n app := fiber.New()\n app.Use(func(c *fiber.Ctx) error {\n host := hosts[c.Hostname()]\n if host == nil {\n return c.SendStatus(fiber.StatusNotFound)\n } else {\n host.Fiber.Handler()(c.Context())\n return nil\n }\n })\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("p",null,"If more information is needed, please refer to this issue ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber/issues/750"},"#750")))}m.isMDXComponent=!0},408:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/support-discord-baf5f38231088813dfbc3ccdc6966634.png"}}]); \ No newline at end of file diff --git a/assets/js/2155a006.e5dce700.js b/assets/js/2155a006.df277a0b.js similarity index 99% rename from assets/js/2155a006.e5dce700.js rename to assets/js/2155a006.df277a0b.js index 78aa83e0889..e06e3a265d3 100644 --- a/assets/js/2155a006.e5dce700.js +++ b/assets/js/2155a006.df277a0b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1426],{3905:(e,n,t)=>{t.d(n,{Zo:()=>s,kt:()=>f});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var u=r.createContext({}),c=function(e){var n=r.useContext(u),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},s=function(e){var n=c(e.components);return r.createElement(u.Provider,{value:n},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},h=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,u=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),p=c(t),h=a,f=p["".concat(u,".").concat(h)]||p[h]||d[h]||i;return t?r.createElement(f,o(o({ref:n},s),{},{components:t})):r.createElement(f,o({ref:n},s))}));function f(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=h;var l={};for(var u in n)hasOwnProperty.call(n,u)&&(l[u]=n[u]);l.originalType=e,l[p]="string"==typeof e?e:a,o[1]=l;for(var c=2;c{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=t(7462),a=(t(7294),t(3905));const i={id:"keyauth",title:"Keyauth"},o=void 0,l={unversionedId:"api/middleware/keyauth",id:"version-v2.x/api/middleware/keyauth",title:"Keyauth",description:"Key auth middleware provides a key based authentication.",source:"@site/versioned_docs/version-v2.x/api/middleware/keyauth.md",sourceDirName:"api/middleware",slug:"/api/middleware/keyauth",permalink:"/api/middleware/keyauth",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"keyauth",title:"Keyauth"},sidebar:"tutorialSidebar",previous:{title:"Idempotency",permalink:"/api/middleware/idempotency"},next:{title:"Limiter",permalink:"/api/middleware/limiter"}},u={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Authenticate only certain endpoints",id:"authenticate-only-certain-endpoints",level:3},{value:"Specifying middleware in the handler",id:"specifying-middleware-in-the-handler",level:3},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],s={toc:c},p="wrapper";function d(e){let{components:n,...t}=e;return(0,a.kt)(p,(0,r.Z)({},s,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Key auth middleware provides a key based authentication."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n)\n\nvar (\n apiKey = "correct horse battery staple"\n)\n\nfunc validateAPIKey(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n}\n\nfunc main() {\n app := fiber.New()\n\n // note that the keyauth middleware needs to be defined before the routes are defined!\n app.Use(keyauth.New(keyauth.Config{\n KeyLookup: "cookie:access_token",\n Validator: validateAPIKey,\n }))\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Test:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# No api-key specified -> 400 missing \ncurl http://localhost:3000\n#> missing or malformed API Key\n\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000\n#> Successfully authenticated!\n\ncurl --cookie "access_token=Clearly A Wrong Key" http://localhost:3000\n#> missing or malformed API Key\n')),(0,a.kt)("p",null,"For a more detailed example, see also the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/recipes"},(0,a.kt)("inlineCode",{parentName:"a"},"github.com/gofiber/recipes"))," repository and specifically the ",(0,a.kt)("inlineCode",{parentName:"p"},"fiber-envoy-extauthz")," repository and the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/recipes/blob/master/fiber-envoy-extauthz/authz/main.go"},(0,a.kt)("inlineCode",{parentName:"a"},"keyauth example"))," code."),(0,a.kt)("h3",{id:"authenticate-only-certain-endpoints"},"Authenticate only certain endpoints"),(0,a.kt)("p",null,"If you want to authenticate only certain endpoints, you can use the ",(0,a.kt)("inlineCode",{parentName:"p"},"Config")," of keyauth and apply a filter function (eg. ",(0,a.kt)("inlineCode",{parentName:"p"},"authFilter"),") like so"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n "regexp"\n "strings"\n)\n\nvar (\n apiKey = "correct horse battery staple"\n protectedURLs = []*regexp.Regexp{\n regexp.MustCompile("^/authenticated$"),\n regexp.MustCompile("^/auth2$"),\n }\n)\n\nfunc validateAPIKey(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n}\n\nfunc authFilter(c *fiber.Ctx) bool {\n originalURL := strings.ToLower(c.OriginalURL())\n\n for _, pattern := range protectedURLs {\n if pattern.MatchString(originalURL) {\n return false\n }\n }\n return true\n}\n\nfunc main() {\n app := fiber.New()\n\n app.Use(keyauth.New(keyauth.Config{\n Next: authFilter,\n KeyLookup: "cookie:access_token",\n Validator: validateAPIKey,\n }))\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome")\n })\n app.Get("/authenticated", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n app.Get("/auth2", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated 2!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,"Which results in this"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# / does not need to be authenticated\ncurl http://localhost:3000\n#> Welcome\n\n# /authenticated needs to be authenticated\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000/authenticated\n#> Successfully authenticated!\n\n# /auth2 needs to be authenticated too\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000/auth2\n#> Successfully authenticated 2!\n')),(0,a.kt)("h3",{id:"specifying-middleware-in-the-handler"},"Specifying middleware in the handler"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n)\n\nconst (\n apiKey = "my-super-secret-key"\n)\n\nfunc main() {\n app := fiber.New()\n\n authMiddleware := keyauth.New(keyauth.Config{\n Validator: func(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n },\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome")\n })\n\n app.Get("/allowed", authMiddleware, func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,"Which results in this"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# / does not need to be authenticated\ncurl http://localhost:3000\n#> Welcome\n\n# /allowed needs to be authenticated too\ncurl --header "Authorization: Bearer my-super-secret-key" http://localhost:3000/allowed\n#> Successfully authenticated!\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // SuccessHandler defines a function which is executed for a valid key.\n // Optional. Default: nil\n SuccessHandler fiber.Handler\n\n // ErrorHandler defines a function which is executed for an invalid key.\n // It may be used to define a custom error.\n // Optional. Default: 401 Invalid or expired key\n ErrorHandler fiber.ErrorHandler\n\n // KeyLookup is a string in the form of ":" that is used\n // to extract key from the request.\n // Optional. Default value "header:Authorization".\n // Possible values:\n // - "header:"\n // - "query:"\n // - "form:"\n // - "param:"\n // - "cookie:"\n KeyLookup string\n\n // AuthScheme to be used in the Authorization header.\n // Optional. Default value "Bearer".\n AuthScheme string\n\n // Validator is a function to validate key.\n Validator func(*fiber.Ctx, string) (bool, error)\n\n // Context key to store the bearertoken from the token into context.\n // Optional. Default: "token".\n ContextKey string\n}\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n SuccessHandler: func(c *fiber.Ctx) error {\n return c.Next()\n },\n ErrorHandler: func(c *fiber.Ctx, err error) error {\n if err == ErrMissingOrMalformedAPIKey {\n return c.Status(fiber.StatusUnauthorized).SendString(err.Error())\n }\n return c.Status(fiber.StatusUnauthorized).SendString("Invalid or expired API Key")\n },\n KeyLookup: "header:" + fiber.HeaderAuthorization,\n AuthScheme: "Bearer",\n ContextKey: "token",\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1426],{3905:(e,n,t)=>{t.d(n,{Zo:()=>s,kt:()=>f});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var u=r.createContext({}),c=function(e){var n=r.useContext(u),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},s=function(e){var n=c(e.components);return r.createElement(u.Provider,{value:n},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},h=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,u=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),p=c(t),h=a,f=p["".concat(u,".").concat(h)]||p[h]||d[h]||i;return t?r.createElement(f,o(o({ref:n},s),{},{components:t})):r.createElement(f,o({ref:n},s))}));function f(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=h;var l={};for(var u in n)hasOwnProperty.call(n,u)&&(l[u]=n[u]);l.originalType=e,l[p]="string"==typeof e?e:a,o[1]=l;for(var c=2;c{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=t(7462),a=(t(7294),t(3905));const i={id:"keyauth",title:"Keyauth"},o=void 0,l={unversionedId:"api/middleware/keyauth",id:"version-v2.x/api/middleware/keyauth",title:"Keyauth",description:"Key auth middleware provides a key based authentication.",source:"@site/versioned_docs/version-v2.x/api/middleware/keyauth.md",sourceDirName:"api/middleware",slug:"/api/middleware/keyauth",permalink:"/api/middleware/keyauth",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"keyauth",title:"Keyauth"},sidebar:"tutorialSidebar",previous:{title:"Idempotency",permalink:"/api/middleware/idempotency"},next:{title:"Limiter",permalink:"/api/middleware/limiter"}},u={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Authenticate only certain endpoints",id:"authenticate-only-certain-endpoints",level:3},{value:"Specifying middleware in the handler",id:"specifying-middleware-in-the-handler",level:3},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],s={toc:c},p="wrapper";function d(e){let{components:n,...t}=e;return(0,a.kt)(p,(0,r.Z)({},s,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Key auth middleware provides a key based authentication."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n)\n\nvar (\n apiKey = "correct horse battery staple"\n)\n\nfunc validateAPIKey(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n}\n\nfunc main() {\n app := fiber.New()\n\n // note that the keyauth middleware needs to be defined before the routes are defined!\n app.Use(keyauth.New(keyauth.Config{\n KeyLookup: "cookie:access_token",\n Validator: validateAPIKey,\n }))\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Test:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# No api-key specified -> 400 missing \ncurl http://localhost:3000\n#> missing or malformed API Key\n\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000\n#> Successfully authenticated!\n\ncurl --cookie "access_token=Clearly A Wrong Key" http://localhost:3000\n#> missing or malformed API Key\n')),(0,a.kt)("p",null,"For a more detailed example, see also the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/recipes"},(0,a.kt)("inlineCode",{parentName:"a"},"github.com/gofiber/recipes"))," repository and specifically the ",(0,a.kt)("inlineCode",{parentName:"p"},"fiber-envoy-extauthz")," repository and the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/recipes/blob/master/fiber-envoy-extauthz/authz/main.go"},(0,a.kt)("inlineCode",{parentName:"a"},"keyauth example"))," code."),(0,a.kt)("h3",{id:"authenticate-only-certain-endpoints"},"Authenticate only certain endpoints"),(0,a.kt)("p",null,"If you want to authenticate only certain endpoints, you can use the ",(0,a.kt)("inlineCode",{parentName:"p"},"Config")," of keyauth and apply a filter function (eg. ",(0,a.kt)("inlineCode",{parentName:"p"},"authFilter"),") like so"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n "regexp"\n "strings"\n)\n\nvar (\n apiKey = "correct horse battery staple"\n protectedURLs = []*regexp.Regexp{\n regexp.MustCompile("^/authenticated$"),\n regexp.MustCompile("^/auth2$"),\n }\n)\n\nfunc validateAPIKey(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n}\n\nfunc authFilter(c *fiber.Ctx) bool {\n originalURL := strings.ToLower(c.OriginalURL())\n\n for _, pattern := range protectedURLs {\n if pattern.MatchString(originalURL) {\n return false\n }\n }\n return true\n}\n\nfunc main() {\n app := fiber.New()\n\n app.Use(keyauth.New(keyauth.Config{\n Next: authFilter,\n KeyLookup: "cookie:access_token",\n Validator: validateAPIKey,\n }))\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome")\n })\n app.Get("/authenticated", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n app.Get("/auth2", func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated 2!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,"Which results in this"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# / does not need to be authenticated\ncurl http://localhost:3000\n#> Welcome\n\n# /authenticated needs to be authenticated\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000/authenticated\n#> Successfully authenticated!\n\n# /auth2 needs to be authenticated too\ncurl --cookie "access_token=correct horse battery staple" http://localhost:3000/auth2\n#> Successfully authenticated 2!\n')),(0,a.kt)("h3",{id:"specifying-middleware-in-the-handler"},"Specifying middleware in the handler"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/sha256"\n "crypto/subtle"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/keyauth"\n)\n\nconst (\n apiKey = "my-super-secret-key"\n)\n\nfunc main() {\n app := fiber.New()\n\n authMiddleware := keyauth.New(keyauth.Config{\n Validator: func(c *fiber.Ctx, key string) (bool, error) {\n hashedAPIKey := sha256.Sum256([]byte(apiKey))\n hashedKey := sha256.Sum256([]byte(key))\n\n if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {\n return true, nil\n }\n return false, keyauth.ErrMissingOrMalformedAPIKey\n },\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome")\n })\n\n app.Get("/allowed", authMiddleware, func(c *fiber.Ctx) error {\n return c.SendString("Successfully authenticated!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("p",null,"Which results in this"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'# / does not need to be authenticated\ncurl http://localhost:3000\n#> Welcome\n\n# /allowed needs to be authenticated too\ncurl --header "Authorization: Bearer my-super-secret-key" http://localhost:3000/allowed\n#> Successfully authenticated!\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // SuccessHandler defines a function which is executed for a valid key.\n // Optional. Default: nil\n SuccessHandler fiber.Handler\n\n // ErrorHandler defines a function which is executed for an invalid key.\n // It may be used to define a custom error.\n // Optional. Default: 401 Invalid or expired key\n ErrorHandler fiber.ErrorHandler\n\n // KeyLookup is a string in the form of ":" that is used\n // to extract key from the request.\n // Optional. Default value "header:Authorization".\n // Possible values:\n // - "header:"\n // - "query:"\n // - "form:"\n // - "param:"\n // - "cookie:"\n KeyLookup string\n\n // AuthScheme to be used in the Authorization header.\n // Optional. Default value "Bearer".\n AuthScheme string\n\n // Validator is a function to validate key.\n Validator func(*fiber.Ctx, string) (bool, error)\n\n // Context key to store the bearertoken from the token into context.\n // Optional. Default: "token".\n ContextKey string\n}\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n SuccessHandler: func(c *fiber.Ctx) error {\n return c.Next()\n },\n ErrorHandler: func(c *fiber.Ctx, err error) error {\n if err == ErrMissingOrMalformedAPIKey {\n return c.Status(fiber.StatusUnauthorized).SendString(err.Error())\n }\n return c.Status(fiber.StatusUnauthorized).SendString("Invalid or expired API Key")\n },\n KeyLookup: "header:" + fiber.HeaderAuthorization,\n AuthScheme: "Bearer",\n ContextKey: "token",\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/21cbcfa4.fbc8202f.js b/assets/js/21cbcfa4.72a42134.js similarity index 99% rename from assets/js/21cbcfa4.fbc8202f.js rename to assets/js/21cbcfa4.72a42134.js index f571f5265ce..dd556265817 100644 --- a/assets/js/21cbcfa4.fbc8202f.js +++ b/assets/js/21cbcfa4.72a42134.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1681],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>h});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=r.createContext({}),s=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),p=s(n),f=a,h=p["".concat(l,".").concat(f)]||p[f]||d[f]||i;return n?r.createElement(h,o(o({ref:t},u),{},{components:n})):r.createElement(h,o({ref:t},u))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c[p]="string"==typeof e?e:a,o[1]=c;for(var s=2;s{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>c,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const i={id:"cache",title:"Cache"},o=void 0,c={unversionedId:"api/middleware/cache",id:"api/middleware/cache",title:"Cache",description:"Cache middleware for Fiber designed to intercept responses and cache them. This middleware will cache the Body, Content-Type and StatusCode using the c.Path() as unique identifier. Special thanks to @codemicro for creating this middleware for Fiber core!",source:"@site/docs/core/api/middleware/cache.md",sourceDirName:"api/middleware",slug:"/api/middleware/cache",permalink:"/next/api/middleware/cache",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/cache.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"cache",title:"Cache"},sidebar:"tutorialSidebar",previous:{title:"BasicAuth",permalink:"/next/api/middleware/basicauth"},next:{title:"Compress",permalink:"/next/api/middleware/compress"}},l={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],u={toc:s},p="wrapper";function d(e){let{components:t,...n}=e;return(0,a.kt)(p,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Cache middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," designed to intercept responses and cache them. This middleware will cache the ",(0,a.kt)("inlineCode",{parentName:"p"},"Body"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"Content-Type")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"StatusCode")," using the ",(0,a.kt)("inlineCode",{parentName:"p"},"c.Path()")," as unique identifier. Special thanks to ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/codemicro/fiber-cache"},"@codemicro")," for creating this middleware for Fiber core!"),(0,a.kt)("p",null,"Request Directives",(0,a.kt)("br",null),"\n",(0,a.kt)("inlineCode",{parentName:"p"},"Cache-Control: no-cache")," will return the up-to-date response but still caches it. You will always get a ",(0,a.kt)("inlineCode",{parentName:"p"},"miss")," cache status.",(0,a.kt)("br",null),"\n",(0,a.kt)("inlineCode",{parentName:"p"},"Cache-Control: no-store")," will refrain from caching. You will always get the up-to-date response."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/cache"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(cache.New())\n\n// Or extend your config for customization\napp.Use(cache.New(cache.Config{\n Next: func(c *fiber.Ctx) bool {\n return c.Query("refresh") == "true"\n },\n Expiration: 30 * time.Minute,\n CacheControl: true,\n}))\n')),(0,a.kt)("p",null,"Or you can custom key and expire time like this:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(cache.New(cache.Config{\n ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration {\n newCacheTime, _ := strconv.Atoi(c.GetRespHeader("Cache-Time", "600"))\n return time.Second * time.Duration(newCacheTime)\n },\n KeyGenerator: func(c *fiber.Ctx) string {\n return utils.CopyString(c.Path())\n },\n}))\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Response().Header.Add("Cache-Time", "6000")\n return c.SendString("hi")\n})\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Expiration is the time that an cached response will live\n //\n // Optional. Default: 1 * time.Minute\n Expiration time.Duration\n\n // CacheHeader header on response header, indicate cache status, with the following possible return value\n //\n // hit, miss, unreachable\n //\n // Optional. Default: X-Cache\n CacheHeader string\n\n // CacheControl enables client side caching if set to true\n //\n // Optional. Default: false\n CacheControl bool\n\n // Key allows you to generate custom keys, by default c.Path() is used\n //\n // Default: func(c *fiber.Ctx) string {\n // return utils.CopyString(c.Path())\n // }\n KeyGenerator func(*fiber.Ctx) string\n\n // allows you to generate custom Expiration Key By Key, default is Expiration (Optional)\n //\n // Default: nil\n ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration\n\n // Store is used to store the state of the middleware\n //\n // Default: an in memory store for this process only\n Storage fiber.Storage\n\n // allows you to store additional headers generated by next middlewares & handler\n //\n // Default: false\n StoreResponseHeaders bool\n\n // Max number of bytes of response bodies simultaneously stored in cache. When limit is reached,\n // entries with the nearest expiration are deleted to make room for new.\n // 0 means no limit\n //\n // Default: 0\n MaxBytes uint\n\n // You can specify HTTP methods to cache.\n // The middleware just caches the routes of its methods in this slice.\n //\n // Default: []string{fiber.MethodGet, fiber.MethodHead}\n Methods []string\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Expiration: 1 * time.Minute,\n CacheHeader: "X-Cache",\n CacheControl: false,\n KeyGenerator: func(c *fiber.Ctx) string {\n return utils.CopyString(c.Path())\n },\n ExpirationGenerator: nil,\n StoreResponseHeaders: false,\n Storage: nil,\n MaxBytes: 0,\n Methods: []string{fiber.MethodGet, fiber.MethodHead},\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1681],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>h});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=r.createContext({}),s=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),p=s(n),f=a,h=p["".concat(l,".").concat(f)]||p[f]||d[f]||i;return n?r.createElement(h,o(o({ref:t},u),{},{components:n})):r.createElement(h,o({ref:t},u))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c[p]="string"==typeof e?e:a,o[1]=c;for(var s=2;s{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>c,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const i={id:"cache",title:"Cache"},o=void 0,c={unversionedId:"api/middleware/cache",id:"api/middleware/cache",title:"Cache",description:"Cache middleware for Fiber designed to intercept responses and cache them. This middleware will cache the Body, Content-Type and StatusCode using the c.Path() as unique identifier. Special thanks to @codemicro for creating this middleware for Fiber core!",source:"@site/docs/core/api/middleware/cache.md",sourceDirName:"api/middleware",slug:"/api/middleware/cache",permalink:"/next/api/middleware/cache",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/cache.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"cache",title:"Cache"},sidebar:"tutorialSidebar",previous:{title:"BasicAuth",permalink:"/next/api/middleware/basicauth"},next:{title:"Compress",permalink:"/next/api/middleware/compress"}},l={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],u={toc:s},p="wrapper";function d(e){let{components:t,...n}=e;return(0,a.kt)(p,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Cache middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," designed to intercept responses and cache them. This middleware will cache the ",(0,a.kt)("inlineCode",{parentName:"p"},"Body"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"Content-Type")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"StatusCode")," using the ",(0,a.kt)("inlineCode",{parentName:"p"},"c.Path()")," as unique identifier. Special thanks to ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/codemicro/fiber-cache"},"@codemicro")," for creating this middleware for Fiber core!"),(0,a.kt)("p",null,"Request Directives",(0,a.kt)("br",null),"\n",(0,a.kt)("inlineCode",{parentName:"p"},"Cache-Control: no-cache")," will return the up-to-date response but still caches it. You will always get a ",(0,a.kt)("inlineCode",{parentName:"p"},"miss")," cache status.",(0,a.kt)("br",null),"\n",(0,a.kt)("inlineCode",{parentName:"p"},"Cache-Control: no-store")," will refrain from caching. You will always get the up-to-date response."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/cache"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(cache.New())\n\n// Or extend your config for customization\napp.Use(cache.New(cache.Config{\n Next: func(c *fiber.Ctx) bool {\n return c.Query("refresh") == "true"\n },\n Expiration: 30 * time.Minute,\n CacheControl: true,\n}))\n')),(0,a.kt)("p",null,"Or you can custom key and expire time like this:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(cache.New(cache.Config{\n ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration {\n newCacheTime, _ := strconv.Atoi(c.GetRespHeader("Cache-Time", "600"))\n return time.Second * time.Duration(newCacheTime)\n },\n KeyGenerator: func(c *fiber.Ctx) string {\n return utils.CopyString(c.Path())\n },\n}))\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Response().Header.Add("Cache-Time", "6000")\n return c.SendString("hi")\n})\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Expiration is the time that an cached response will live\n //\n // Optional. Default: 1 * time.Minute\n Expiration time.Duration\n\n // CacheHeader header on response header, indicate cache status, with the following possible return value\n //\n // hit, miss, unreachable\n //\n // Optional. Default: X-Cache\n CacheHeader string\n\n // CacheControl enables client side caching if set to true\n //\n // Optional. Default: false\n CacheControl bool\n\n // Key allows you to generate custom keys, by default c.Path() is used\n //\n // Default: func(c *fiber.Ctx) string {\n // return utils.CopyString(c.Path())\n // }\n KeyGenerator func(*fiber.Ctx) string\n\n // allows you to generate custom Expiration Key By Key, default is Expiration (Optional)\n //\n // Default: nil\n ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration\n\n // Store is used to store the state of the middleware\n //\n // Default: an in memory store for this process only\n Storage fiber.Storage\n\n // allows you to store additional headers generated by next middlewares & handler\n //\n // Default: false\n StoreResponseHeaders bool\n\n // Max number of bytes of response bodies simultaneously stored in cache. When limit is reached,\n // entries with the nearest expiration are deleted to make room for new.\n // 0 means no limit\n //\n // Default: 0\n MaxBytes uint\n\n // You can specify HTTP methods to cache.\n // The middleware just caches the routes of its methods in this slice.\n //\n // Default: []string{fiber.MethodGet, fiber.MethodHead}\n Methods []string\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Expiration: 1 * time.Minute,\n CacheHeader: "X-Cache",\n CacheControl: false,\n KeyGenerator: func(c *fiber.Ctx) string {\n return utils.CopyString(c.Path())\n },\n ExpirationGenerator: nil,\n StoreResponseHeaders: false,\n Storage: nil,\n MaxBytes: 0,\n Methods: []string{fiber.MethodGet, fiber.MethodHead},\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/24847ea2.8309ea55.js b/assets/js/24847ea2.02899d9b.js similarity index 99% rename from assets/js/24847ea2.8309ea55.js rename to assets/js/24847ea2.02899d9b.js index 0e3d592d8cd..f68b7496ed5 100644 --- a/assets/js/24847ea2.8309ea55.js +++ b/assets/js/24847ea2.02899d9b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1105],{3905:(e,n,t)=>{t.d(n,{Zo:()=>p,kt:()=>f});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function u(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var i=r.createContext({}),s=function(e){var n=r.useContext(i),t=n;return e&&(t="function"==typeof e?e(n):u(u({},n),e)),t},p=function(e){var n=s(e.components);return r.createElement(i.Provider,{value:n},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),c=s(t),d=a,f=c["".concat(i,".").concat(d)]||c[d]||m[d]||o;return t?r.createElement(f,u(u({ref:n},p),{},{components:t})):r.createElement(f,u({ref:n},p))}));function f(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var o=t.length,u=new Array(o);u[0]=d;var l={};for(var i in n)hasOwnProperty.call(n,i)&&(l[i]=n[i]);l.originalType=e,l[c]="string"==typeof e?e:a,u[1]=l;for(var s=2;s{t.d(n,{Z:()=>u});var r=t(7294),a=t(6010);const o={tabItem:"tabItem_Ymn6"};function u(e){let{children:n,hidden:t,className:u}=e;return r.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,u),hidden:t},n)}},4866:(e,n,t)=>{t.d(n,{Z:()=>N});var r=t(7462),a=t(7294),o=t(6010),u=t(2466),l=t(6550),i=t(1980),s=t(7392),p=t(12);function c(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:a}}=e;return{value:n,label:t,attributes:r,default:a}}))}function m(e){const{values:n,children:t}=e;return(0,a.useMemo)((()=>{const e=n??c(t);return function(e){const n=(0,s.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function d(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function f(e){let{queryString:n=!1,groupId:t}=e;const r=(0,l.k6)(),o=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(o),(0,a.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(r.location.search);n.set(o,e),r.replace({...r.location,search:n.toString()})}),[o,r])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,o=m(e),[u,l]=(0,a.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!d({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:o}))),[i,s]=f({queryString:t,groupId:r}),[c,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,o]=(0,p.Nk)(t);return[r,(0,a.useCallback)((e=>{t&&o.set(e)}),[t,o])]}({groupId:r}),h=(()=>{const e=i??c;return d({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{h&&l(h)}),[h]);return{selectedValue:u,selectValue:(0,a.useCallback)((e=>{if(!d({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);l(e),s(e),g(e)}),[s,g,o]),tabValues:o}}var h=t(2389);const k={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function b(e){let{className:n,block:t,selectedValue:l,selectValue:i,tabValues:s}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,u.o5)(),m=e=>{const n=e.currentTarget,t=p.indexOf(n),r=s[t].value;r!==l&&(c(n),i(r))},d=e=>{let n=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const t=p.indexOf(e.currentTarget)+1;n=p[t]??p[0];break}case"ArrowLeft":{const t=p.indexOf(e.currentTarget)-1;n=p[t]??p[p.length-1];break}}n?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},n)},s.map((e=>{let{value:n,label:t,attributes:u}=e;return a.createElement("li",(0,r.Z)({role:"tab",tabIndex:l===n?0:-1,"aria-selected":l===n,key:n,ref:e=>p.push(e),onKeyDown:d,onClick:m},u,{className:(0,o.Z)("tabs__item",k.tabItem,u?.className,{"tabs__item--active":l===n})}),t??n)})))}function O(e){let{lazy:n,children:t,selectedValue:r}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===r));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,n)=>(0,a.cloneElement)(e,{key:n,hidden:e.props.value!==r}))))}function v(e){const n=g(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",k.tabList)},a.createElement(b,(0,r.Z)({},e,n)),a.createElement(O,(0,r.Z)({},e,n)))}function N(e){const n=(0,h.Z)();return a.createElement(v,(0,r.Z)({key:String(n)},e))}},4330:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>i,default:()=>f,frontMatter:()=>l,metadata:()=>s,toc:()=>c});var r=t(7462),a=(t(7294),t(3905)),o=t(4866),u=t(5162);const l={id:"hooks",title:"\ud83e\ude9d Hooks",sidebar_position:6},i=void 0,s={unversionedId:"guide/hooks",id:"version-v2.x/guide/hooks",title:"\ud83e\ude9d Hooks",description:"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:",source:"@site/versioned_docs/version-v2.x/guide/hooks.md",sourceDirName:"guide",slug:"/guide/hooks",permalink:"/guide/hooks",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:6,frontMatter:{id:"hooks",title:"\ud83e\ude9d Hooks",sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0e Validation",permalink:"/guide/validation"},next:{title:"\u26a1 Make Fiber Faster",permalink:"/guide/faster-fiber"}},p={},c=[{value:"Constants",id:"constants",level:2},{value:"OnRoute",id:"onroute",level:2},{value:"OnName",id:"onname",level:2},{value:"OnGroup",id:"ongroup",level:2},{value:"OnGroupName",id:"ongroupname",level:2},{value:"OnListen",id:"onlisten",level:2},{value:"OnFork",id:"onfork",level:2},{value:"OnShutdown",id:"onshutdown",level:2},{value:"OnMount",id:"onmount",level:2}],m={toc:c},d="wrapper";function f(e){let{components:n,...t}=e;return(0,a.kt)(d,(0,r.Z)({},m,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onroute"},"OnRoute")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onname"},"OnName")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#ongroup"},"OnGroup")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#ongroupname"},"OnGroupName")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onlisten"},"OnListen")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onfork"},"OnFork")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onshutdown"},"OnShutdown")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onmount"},"OnMount"))),(0,a.kt)("h2",{id:"constants"},"Constants"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Handlers define a function to create hooks for Fiber.\ntype OnRouteHandler = func(Route) error\ntype OnNameHandler = OnRouteHandler\ntype OnGroupHandler = func(Group) error\ntype OnGroupNameHandler = OnGroupHandler\ntype OnListenHandler = func() error\ntype OnForkHandler = func(int) error\ntype OnShutdownHandler = OnListenHandler\ntype OnMountHandler = func(*App) error\n")),(0,a.kt)("h2",{id:"onroute"},"OnRoute"),(0,a.kt)("p",null,"OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by ",(0,a.kt)("strong",{parentName:"p"},"route")," parameter."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnRoute(handler ...OnRouteHandler)\n")),(0,a.kt)("h2",{id:"onname"},"OnName"),(0,a.kt)("p",null,"OnName is a hook to execute user functions on each route naming. Also you can get route properties by ",(0,a.kt)("strong",{parentName:"p"},"route")," parameter."),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnName only works with naming routes, not groups.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnName(handler ...OnNameHandler)\n")),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(u.Z,{value:"onname-example",label:"OnName Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n\n "github.com/gofiber/fiber/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("index")\n\n app.Hooks().OnName(func(r fiber.Route) error {\n fmt.Print("Name: " + r.Name + ", ")\n\n return nil\n })\n\n app.Hooks().OnName(func(r fiber.Route) error {\n fmt.Print("Method: " + r.Method + "\\n")\n\n return nil\n })\n\n app.Get("/add/user", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("addUser")\n\n app.Delete("/destroy/user", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("destroyUser")\n\n app.Listen(":5000")\n}\n\n// Results:\n// Name: addUser, Method: GET\n// Name: destroyUser, Method: DELETE\n')))),(0,a.kt)("h2",{id:"ongroup"},"OnGroup"),(0,a.kt)("p",null,"OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by ",(0,a.kt)("strong",{parentName:"p"},"group")," parameter."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnGroup(handler ...OnGroupHandler)\n")),(0,a.kt)("h2",{id:"ongroupname"},"OnGroupName"),(0,a.kt)("p",null,"OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by ",(0,a.kt)("strong",{parentName:"p"},"group")," parameter."),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnGroupName only works with naming groups, not routes.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnGroupName(handler ...OnGroupNameHandler)\n")),(0,a.kt)("h2",{id:"onlisten"},"OnListen"),(0,a.kt)("p",null,"OnListen is a hook to execute user functions on Listen, ListenTLS, Listener."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnListen(handler ...OnListenHandler)\n")),(0,a.kt)("h2",{id:"onfork"},"OnFork"),(0,a.kt)("p",null,"OnFork is a hook to execute user functions on Fork."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnFork(handler ...OnForkHandler)\n")),(0,a.kt)("h2",{id:"onshutdown"},"OnShutdown"),(0,a.kt)("p",null,"OnShutdown is a hook to execute user functions after Shutdown."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnShutdown(handler ...OnShutdownHandler)\n")),(0,a.kt)("h2",{id:"onmount"},"OnMount"),(0,a.kt)("p",null,"OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (h *Hooks) OnMount(handler ...OnMountHandler) \n")),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(u.Z,{value:"onmount-example",label:"OnMount Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n\n "github.com/gofiber/fiber/v2"\n)\n\nfunc main() {\n app := New()\n app.Get("/", testSimpleHandler).Name("x")\n\n subApp := New()\n subApp.Get("/test", testSimpleHandler)\n\n subApp.Hooks().OnMount(func(parent *fiber.App) error {\n fmt.Print("Mount path of parent app: "+parent.MountPath())\n // ...\n\n return nil\n })\n\n app.Mount("/sub", subApp)\n}\n\n// Result:\n// Mount path of parent app: \n')))),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.")))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1105],{3905:(e,n,t)=>{t.d(n,{Zo:()=>p,kt:()=>f});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function u(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var i=r.createContext({}),s=function(e){var n=r.useContext(i),t=n;return e&&(t="function"==typeof e?e(n):u(u({},n),e)),t},p=function(e){var n=s(e.components);return r.createElement(i.Provider,{value:n},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),c=s(t),d=a,f=c["".concat(i,".").concat(d)]||c[d]||m[d]||o;return t?r.createElement(f,u(u({ref:n},p),{},{components:t})):r.createElement(f,u({ref:n},p))}));function f(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var o=t.length,u=new Array(o);u[0]=d;var l={};for(var i in n)hasOwnProperty.call(n,i)&&(l[i]=n[i]);l.originalType=e,l[c]="string"==typeof e?e:a,u[1]=l;for(var s=2;s{t.d(n,{Z:()=>u});var r=t(7294),a=t(6010);const o={tabItem:"tabItem_Ymn6"};function u(e){let{children:n,hidden:t,className:u}=e;return r.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,u),hidden:t},n)}},4866:(e,n,t)=>{t.d(n,{Z:()=>N});var r=t(7462),a=t(7294),o=t(6010),u=t(2466),l=t(6550),i=t(1980),s=t(7392),p=t(12);function c(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:a}}=e;return{value:n,label:t,attributes:r,default:a}}))}function m(e){const{values:n,children:t}=e;return(0,a.useMemo)((()=>{const e=n??c(t);return function(e){const n=(0,s.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function d(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function f(e){let{queryString:n=!1,groupId:t}=e;const r=(0,l.k6)(),o=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(o),(0,a.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(r.location.search);n.set(o,e),r.replace({...r.location,search:n.toString()})}),[o,r])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,o=m(e),[u,l]=(0,a.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!d({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:o}))),[i,s]=f({queryString:t,groupId:r}),[c,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,o]=(0,p.Nk)(t);return[r,(0,a.useCallback)((e=>{t&&o.set(e)}),[t,o])]}({groupId:r}),h=(()=>{const e=i??c;return d({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{h&&l(h)}),[h]);return{selectedValue:u,selectValue:(0,a.useCallback)((e=>{if(!d({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);l(e),s(e),g(e)}),[s,g,o]),tabValues:o}}var h=t(2389);const k={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function b(e){let{className:n,block:t,selectedValue:l,selectValue:i,tabValues:s}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,u.o5)(),m=e=>{const n=e.currentTarget,t=p.indexOf(n),r=s[t].value;r!==l&&(c(n),i(r))},d=e=>{let n=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const t=p.indexOf(e.currentTarget)+1;n=p[t]??p[0];break}case"ArrowLeft":{const t=p.indexOf(e.currentTarget)-1;n=p[t]??p[p.length-1];break}}n?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},n)},s.map((e=>{let{value:n,label:t,attributes:u}=e;return a.createElement("li",(0,r.Z)({role:"tab",tabIndex:l===n?0:-1,"aria-selected":l===n,key:n,ref:e=>p.push(e),onKeyDown:d,onClick:m},u,{className:(0,o.Z)("tabs__item",k.tabItem,u?.className,{"tabs__item--active":l===n})}),t??n)})))}function O(e){let{lazy:n,children:t,selectedValue:r}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===r));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,n)=>(0,a.cloneElement)(e,{key:n,hidden:e.props.value!==r}))))}function v(e){const n=g(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",k.tabList)},a.createElement(b,(0,r.Z)({},e,n)),a.createElement(O,(0,r.Z)({},e,n)))}function N(e){const n=(0,h.Z)();return a.createElement(v,(0,r.Z)({key:String(n)},e))}},4330:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>i,default:()=>f,frontMatter:()=>l,metadata:()=>s,toc:()=>c});var r=t(7462),a=(t(7294),t(3905)),o=t(4866),u=t(5162);const l={id:"hooks",title:"\ud83e\ude9d Hooks",sidebar_position:6},i=void 0,s={unversionedId:"guide/hooks",id:"version-v2.x/guide/hooks",title:"\ud83e\ude9d Hooks",description:"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:",source:"@site/versioned_docs/version-v2.x/guide/hooks.md",sourceDirName:"guide",slug:"/guide/hooks",permalink:"/guide/hooks",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:6,frontMatter:{id:"hooks",title:"\ud83e\ude9d Hooks",sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0e Validation",permalink:"/guide/validation"},next:{title:"\u26a1 Make Fiber Faster",permalink:"/guide/faster-fiber"}},p={},c=[{value:"Constants",id:"constants",level:2},{value:"OnRoute",id:"onroute",level:2},{value:"OnName",id:"onname",level:2},{value:"OnGroup",id:"ongroup",level:2},{value:"OnGroupName",id:"ongroupname",level:2},{value:"OnListen",id:"onlisten",level:2},{value:"OnFork",id:"onfork",level:2},{value:"OnShutdown",id:"onshutdown",level:2},{value:"OnMount",id:"onmount",level:2}],m={toc:c},d="wrapper";function f(e){let{components:n,...t}=e;return(0,a.kt)(d,(0,r.Z)({},m,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onroute"},"OnRoute")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onname"},"OnName")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#ongroup"},"OnGroup")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#ongroupname"},"OnGroupName")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onlisten"},"OnListen")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onfork"},"OnFork")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onshutdown"},"OnShutdown")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onmount"},"OnMount"))),(0,a.kt)("h2",{id:"constants"},"Constants"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Handlers define a function to create hooks for Fiber.\ntype OnRouteHandler = func(Route) error\ntype OnNameHandler = OnRouteHandler\ntype OnGroupHandler = func(Group) error\ntype OnGroupNameHandler = OnGroupHandler\ntype OnListenHandler = func() error\ntype OnForkHandler = func(int) error\ntype OnShutdownHandler = OnListenHandler\ntype OnMountHandler = func(*App) error\n")),(0,a.kt)("h2",{id:"onroute"},"OnRoute"),(0,a.kt)("p",null,"OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by ",(0,a.kt)("strong",{parentName:"p"},"route")," parameter."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnRoute(handler ...OnRouteHandler)\n")),(0,a.kt)("h2",{id:"onname"},"OnName"),(0,a.kt)("p",null,"OnName is a hook to execute user functions on each route naming. Also you can get route properties by ",(0,a.kt)("strong",{parentName:"p"},"route")," parameter."),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnName only works with naming routes, not groups.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnName(handler ...OnNameHandler)\n")),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(u.Z,{value:"onname-example",label:"OnName Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n\n "github.com/gofiber/fiber/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("index")\n\n app.Hooks().OnName(func(r fiber.Route) error {\n fmt.Print("Name: " + r.Name + ", ")\n\n return nil\n })\n\n app.Hooks().OnName(func(r fiber.Route) error {\n fmt.Print("Method: " + r.Method + "\\n")\n\n return nil\n })\n\n app.Get("/add/user", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("addUser")\n\n app.Delete("/destroy/user", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("destroyUser")\n\n app.Listen(":5000")\n}\n\n// Results:\n// Name: addUser, Method: GET\n// Name: destroyUser, Method: DELETE\n')))),(0,a.kt)("h2",{id:"ongroup"},"OnGroup"),(0,a.kt)("p",null,"OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by ",(0,a.kt)("strong",{parentName:"p"},"group")," parameter."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnGroup(handler ...OnGroupHandler)\n")),(0,a.kt)("h2",{id:"ongroupname"},"OnGroupName"),(0,a.kt)("p",null,"OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by ",(0,a.kt)("strong",{parentName:"p"},"group")," parameter."),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnGroupName only works with naming groups, not routes.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnGroupName(handler ...OnGroupNameHandler)\n")),(0,a.kt)("h2",{id:"onlisten"},"OnListen"),(0,a.kt)("p",null,"OnListen is a hook to execute user functions on Listen, ListenTLS, Listener."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnListen(handler ...OnListenHandler)\n")),(0,a.kt)("h2",{id:"onfork"},"OnFork"),(0,a.kt)("p",null,"OnFork is a hook to execute user functions on Fork."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnFork(handler ...OnForkHandler)\n")),(0,a.kt)("h2",{id:"onshutdown"},"OnShutdown"),(0,a.kt)("p",null,"OnShutdown is a hook to execute user functions after Shutdown."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnShutdown(handler ...OnShutdownHandler)\n")),(0,a.kt)("h2",{id:"onmount"},"OnMount"),(0,a.kt)("p",null,"OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (h *Hooks) OnMount(handler ...OnMountHandler) \n")),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(u.Z,{value:"onmount-example",label:"OnMount Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n\n "github.com/gofiber/fiber/v2"\n)\n\nfunc main() {\n app := New()\n app.Get("/", testSimpleHandler).Name("x")\n\n subApp := New()\n subApp.Get("/test", testSimpleHandler)\n\n subApp.Hooks().OnMount(func(parent *fiber.App) error {\n fmt.Print("Mount path of parent app: "+parent.MountPath())\n // ...\n\n return nil\n })\n\n app.Mount("/sub", subApp)\n}\n\n// Result:\n// Mount path of parent app: \n')))),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.")))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/26257c43.b5244531.js b/assets/js/26257c43.f8727559.js similarity index 98% rename from assets/js/26257c43.b5244531.js rename to assets/js/26257c43.f8727559.js index 80591595b96..c75fd721d5b 100644 --- a/assets/js/26257c43.b5244531.js +++ b/assets/js/26257c43.f8727559.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5890],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>f});var r=t(7294);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function i(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var s=r.createContext({}),p=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},c=function(e){var n=p(e.components);return r.createElement(s.Provider,{value:n},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},u=r.forwardRef((function(e,n){var t=e.components,o=e.mdxType,a=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),d=p(t),u=o,f=d["".concat(s,".").concat(u)]||d[u]||m[u]||a;return t?r.createElement(f,i(i({ref:n},c),{},{components:t})):r.createElement(f,i({ref:n},c))}));function f(e,n){var t=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var a=t.length,i=new Array(a);i[0]=u;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[d]="string"==typeof e?e:o,i[1]=l;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>i,default:()=>m,frontMatter:()=>a,metadata:()=>l,toc:()=>p});var r=t(7462),o=(t(7294),t(3905));const a={id:"compress",title:"Compress"},i=void 0,l={unversionedId:"api/middleware/compress",id:"version-v2.x/api/middleware/compress",title:"Compress",description:"Compression middleware for Fiber that will compress the response using gzip, deflate and brotli compression depending on the Accept-Encoding header.",source:"@site/versioned_docs/version-v2.x/api/middleware/compress.md",sourceDirName:"api/middleware",slug:"/api/middleware/compress",permalink:"/api/middleware/compress",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"compress",title:"Compress"},sidebar:"tutorialSidebar",previous:{title:"Cache",permalink:"/api/middleware/cache"},next:{title:"CORS",permalink:"/api/middleware/cors"}},s={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Constants",id:"constants",level:2}],c={toc:p},d="wrapper";function m(e){let{components:n,...t}=e;return(0,o.kt)(d,(0,r.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"Compression middleware for ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that will compress the response using ",(0,o.kt)("inlineCode",{parentName:"p"},"gzip"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"deflate")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"brotli")," compression depending on the ",(0,o.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding"},"Accept-Encoding")," header."),(0,o.kt)("h2",{id:"signatures"},"Signatures"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,o.kt)("h2",{id:"examples"},"Examples"),(0,o.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/compress"\n)\n')),(0,o.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(compress.New())\n\n// Or extend your config for customization\napp.Use(compress.New(compress.Config{\n Level: compress.LevelBestSpeed, // 1\n}))\n\n// Skip middleware for specific routes\napp.Use(compress.New(compress.Config{\n Next: func(c *fiber.Ctx) bool {\n return c.Path() == "/dont_compress"\n },\n Level: compress.LevelBestSpeed, // 1\n}))\n')),(0,o.kt)("h2",{id:"config"},"Config"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Level determines the compression algoritm\n //\n // Optional. Default: LevelDefault\n // LevelDisabled: -1\n // LevelDefault: 0\n // LevelBestSpeed: 1\n // LevelBestCompression: 2\n Level int\n}\n")),(0,o.kt)("h2",{id:"default-config"},"Default Config"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n Level: LevelDefault,\n}\n")),(0,o.kt)("h2",{id:"constants"},"Constants"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"// Compression levels\nconst (\n LevelDisabled = -1\n LevelDefault = 0\n LevelBestSpeed = 1\n LevelBestCompression = 2\n)\n")))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5890],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>f});var r=t(7294);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function i(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var s=r.createContext({}),p=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},c=function(e){var n=p(e.components);return r.createElement(s.Provider,{value:n},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},u=r.forwardRef((function(e,n){var t=e.components,o=e.mdxType,a=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),d=p(t),u=o,f=d["".concat(s,".").concat(u)]||d[u]||m[u]||a;return t?r.createElement(f,i(i({ref:n},c),{},{components:t})):r.createElement(f,i({ref:n},c))}));function f(e,n){var t=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var a=t.length,i=new Array(a);i[0]=u;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[d]="string"==typeof e?e:o,i[1]=l;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>i,default:()=>m,frontMatter:()=>a,metadata:()=>l,toc:()=>p});var r=t(7462),o=(t(7294),t(3905));const a={id:"compress",title:"Compress"},i=void 0,l={unversionedId:"api/middleware/compress",id:"version-v2.x/api/middleware/compress",title:"Compress",description:"Compression middleware for Fiber that will compress the response using gzip, deflate and brotli compression depending on the Accept-Encoding header.",source:"@site/versioned_docs/version-v2.x/api/middleware/compress.md",sourceDirName:"api/middleware",slug:"/api/middleware/compress",permalink:"/api/middleware/compress",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"compress",title:"Compress"},sidebar:"tutorialSidebar",previous:{title:"Cache",permalink:"/api/middleware/cache"},next:{title:"CORS",permalink:"/api/middleware/cors"}},s={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Constants",id:"constants",level:2}],c={toc:p},d="wrapper";function m(e){let{components:n,...t}=e;return(0,o.kt)(d,(0,r.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"Compression middleware for ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that will compress the response using ",(0,o.kt)("inlineCode",{parentName:"p"},"gzip"),", ",(0,o.kt)("inlineCode",{parentName:"p"},"deflate")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"brotli")," compression depending on the ",(0,o.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding"},"Accept-Encoding")," header."),(0,o.kt)("h2",{id:"signatures"},"Signatures"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,o.kt)("h2",{id:"examples"},"Examples"),(0,o.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/compress"\n)\n')),(0,o.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(compress.New())\n\n// Or extend your config for customization\napp.Use(compress.New(compress.Config{\n Level: compress.LevelBestSpeed, // 1\n}))\n\n// Skip middleware for specific routes\napp.Use(compress.New(compress.Config{\n Next: func(c *fiber.Ctx) bool {\n return c.Path() == "/dont_compress"\n },\n Level: compress.LevelBestSpeed, // 1\n}))\n')),(0,o.kt)("h2",{id:"config"},"Config"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Level determines the compression algoritm\n //\n // Optional. Default: LevelDefault\n // LevelDisabled: -1\n // LevelDefault: 0\n // LevelBestSpeed: 1\n // LevelBestCompression: 2\n Level int\n}\n")),(0,o.kt)("h2",{id:"default-config"},"Default Config"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n Level: LevelDefault,\n}\n")),(0,o.kt)("h2",{id:"constants"},"Constants"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"// Compression levels\nconst (\n LevelDisabled = -1\n LevelDefault = 0\n LevelBestSpeed = 1\n LevelBestCompression = 2\n)\n")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2804f106.7bd4bea3.js b/assets/js/2804f106.52109486.js similarity index 99% rename from assets/js/2804f106.7bd4bea3.js rename to assets/js/2804f106.52109486.js index 266ef755b52..385234dda0c 100644 --- a/assets/js/2804f106.7bd4bea3.js +++ b/assets/js/2804f106.52109486.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5675],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>d});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=a.createContext({}),s=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},m=function(e){var t=s(e.components);return a.createElement(p.Provider,{value:t},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},g=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,p=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),u=s(n),g=r,d=u["".concat(p,".").concat(g)]||u[g]||c[g]||l;return n?a.createElement(d,i(i({ref:t},m),{},{components:n})):a.createElement(d,i({ref:t},m))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=g;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o[u]="string"==typeof e?e:r,i[1]=o;for(var s=2;s{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>i,default:()=>c,frontMatter:()=>l,metadata:()=>o,toc:()=>s});var a=n(7462),r=(n(7294),n(3905));const l={id:"ctx",title:"\ud83e\udde0 Ctx",description:"The Ctx struct represents the Context which hold the HTTP request and response. It has methods for the request query string, parameters, body, HTTP headers, and so on.",sidebar_position:3},i=void 0,o={unversionedId:"api/ctx",id:"api/ctx",title:"\ud83e\udde0 Ctx",description:"The Ctx struct represents the Context which hold the HTTP request and response. It has methods for the request query string, parameters, body, HTTP headers, and so on.",source:"@site/docs/core/api/ctx.md",sourceDirName:"api",slug:"/api/ctx",permalink:"/next/api/ctx",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/ctx.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:3,frontMatter:{id:"ctx",title:"\ud83e\udde0 Ctx",description:"The Ctx struct represents the Context which hold the HTTP request and response. It has methods for the request query string, parameters, body, HTTP headers, and so on.",sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\ud83d\ude80 App",permalink:"/next/api/app"},next:{title:"\ud83d\udccb Constants",permalink:"/next/api/constants"}},p={},s=[{value:"Accepts",id:"accepts",level:2},{value:"AllParams",id:"allparams",level:2},{value:"App",id:"app",level:2},{value:"Append",id:"append",level:2},{value:"Attachment",id:"attachment",level:2},{value:"BaseURL",id:"baseurl",level:2},{value:"Bind",id:"bind",level:2},{value:"Body",id:"body",level:2},{value:"BodyParser",id:"bodyparser",level:2},{value:"ClearCookie",id:"clearcookie",level:2},{value:"ClientHelloInfo",id:"clienthelloinfo",level:2},{value:"Context",id:"context",level:2},{value:"Cookie",id:"cookie",level:2},{value:"Cookies",id:"cookies",level:2},{value:"Download",id:"download",level:2},{value:"Format",id:"format",level:2},{value:"FormFile",id:"formfile",level:2},{value:"FormValue",id:"formvalue",level:2},{value:"Fresh",id:"fresh",level:2},{value:"Get",id:"get",level:2},{value:"GetReqHeaders",id:"getreqheaders",level:2},{value:"GetRespHeader",id:"getrespheader",level:2},{value:"GetRespHeaders",id:"getrespheaders",level:2},{value:"GetRouteURL",id:"getrouteurl",level:2},{value:"Hostname",id:"hostname",level:2},{value:"IP",id:"ip",level:2},{value:"IPs",id:"ips",level:2},{value:"Is",id:"is",level:2},{value:"IsFromLocal",id:"isfromlocal",level:2},{value:"JSON",id:"json",level:2},{value:"JSONP",id:"jsonp",level:2},{value:"Links",id:"links",level:2},{value:"Locals",id:"locals",level:2},{value:"Location",id:"location",level:2},{value:"Method",id:"method",level:2},{value:"MultipartForm",id:"multipartform",level:2},{value:"Next",id:"next",level:2},{value:"OriginalURL",id:"originalurl",level:2},{value:"Params",id:"params",level:2},{value:"ParamsInt",id:"paramsint",level:2},{value:"ParamsParser",id:"paramsparser",level:2},{value:"Path",id:"path",level:2},{value:"Protocol",id:"protocol",level:2},{value:"Queries",id:"queries",level:2},{value:"Query",id:"query",level:2},{value:"QueryBool",id:"querybool",level:2},{value:"QueryFloat",id:"queryfloat",level:2},{value:"QueryInt",id:"queryint",level:2},{value:"QueryParser",id:"queryparser",level:2},{value:"Range",id:"range",level:2},{value:"Redirect",id:"redirect",level:2},{value:"RedirectToRoute",id:"redirecttoroute",level:2},{value:"RedirectBack",id:"redirectback",level:2},{value:"Render",id:"render",level:2},{value:"Request",id:"request",level:2},{value:"ReqHeaderParser",id:"reqheaderparser",level:2},{value:"Response",id:"response",level:2},{value:"RestartRouting",id:"restartrouting",level:2},{value:"Route",id:"route",level:2},{value:"SaveFile",id:"savefile",level:2},{value:"SaveFileToStorage",id:"savefiletostorage",level:2},{value:"Secure",id:"secure",level:2},{value:"Send",id:"send",level:2},{value:"SendFile",id:"sendfile",level:2},{value:"SendStatus",id:"sendstatus",level:2},{value:"Set",id:"set",level:2},{value:"SetParserDecoder",id:"setparserdecoder",level:2},{value:"SetUserContext",id:"setusercontext",level:2},{value:"Stale",id:"stale",level:2},{value:"Status",id:"status",level:2},{value:"Subdomains",id:"subdomains",level:2},{value:"Type",id:"type",level:2},{value:"UserContext",id:"usercontext",level:2},{value:"Vary",id:"vary",level:2},{value:"Write",id:"write",level:2},{value:"Writef",id:"writef",level:2},{value:"WriteString",id:"writestring",level:2},{value:"XHR",id:"xhr",level:2},{value:"XML",id:"xml",level:2}],m={toc:s},u="wrapper";function c(e){let{components:t,...n}=e;return(0,r.kt)(u,(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"accepts"},"Accepts"),(0,r.kt)("p",null,"Checks, if the specified ",(0,r.kt)("strong",{parentName:"p"},"extensions")," or ",(0,r.kt)("strong",{parentName:"p"},"content")," ",(0,r.kt)("strong",{parentName:"p"},"types")," are acceptable."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Based on the request\u2019s ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept"},"Accept")," HTTP header.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Accepts(offers ...string) string\nfunc (c *Ctx) AcceptsCharsets(offers ...string) string\nfunc (c *Ctx) AcceptsEncodings(offers ...string) string\nfunc (c *Ctx) AcceptsLanguages(offers ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Accept: text/html, application/json; q=0.8, text/plain; q=0.5; charset="utf-8"\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Accepts("html") // "html"\n c.Accepts("text/html") // "text/html"\n c.Accepts("json", "text") // "json"\n c.Accepts("application/json") // "application/json"\n c.Accepts("text/plain", "application/json") // "application/json", due to quality\n c.Accepts("image/png") // ""\n c.Accepts("png") // ""\n // ...\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example 2"',title:'"Example','2"':!0},'// Accept: text/html, text/*, application/json, */*; q=0\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Accepts("text/plain", "application/json") // "application/json", due to specificity\n c.Accepts("application/json", "text/html") // "text/html", due to first match\n c.Accepts("image/png") // "", due to */* without q factor 0 is Not Acceptable\n // ...\n})\n')),(0,r.kt)("p",null,"Fiber provides similar functions for the other accept headers."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Accept-Charset: utf-8, iso-8859-1;q=0.2\n// Accept-Encoding: gzip, compress;q=0.2\n// Accept-Language: en;q=0.8, nl, ru\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.AcceptsCharsets("utf-16", "iso-8859-1") \n // "iso-8859-1"\n\n c.AcceptsEncodings("compress", "br") \n // "compress"\n\n c.AcceptsLanguages("pt", "nl", "ru") \n // "nl"\n // ...\n})\n')),(0,r.kt)("h2",{id:"allparams"},"AllParams"),(0,r.kt)("p",null,"Params is used to get all route parameters.\nUsing Params method to get params."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) AllParams() map[string]string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/user/fenny\napp.Get("/user/:name", func(c *fiber.Ctx) error {\n c.AllParams() // "{"name": "fenny"}"\n\n // ...\n})\n\n// GET http://example.com/user/fenny/123\napp.Get("/user/*", func(c *fiber.Ctx) error {\n c.AllParams() // "{"*1": "fenny/123"}"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"app"},"App"),(0,r.kt)("p",null,"Returns the ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},"*","App")," reference so you could easily access all application settings."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) App() *App\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/stack", func(c *fiber.Ctx) error {\n return c.JSON(c.App().Stack())\n})\n')),(0,r.kt)("h2",{id:"append"},"Append"),(0,r.kt)("p",null,"Appends the specified ",(0,r.kt)("strong",{parentName:"p"},"value")," to the HTTP response header field."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"If the header is ",(0,r.kt)("strong",{parentName:"p"},"not")," already set, it creates the header with the specified value.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Append(field string, values ...string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Append("Link", "http://google.com", "http://localhost")\n // => Link: http://localhost, http://google.com\n\n c.Append("Link", "Test")\n // => Link: http://localhost, http://google.com, Test\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"attachment"},"Attachment"),(0,r.kt)("p",null,"Sets the HTTP response ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition"},"Content-Disposition")," header field to ",(0,r.kt)("inlineCode",{parentName:"p"},"attachment"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Attachment(filename ...string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Attachment()\n // => Content-Disposition: attachment\n\n c.Attachment("./upload/images/logo.png")\n // => Content-Disposition: attachment; filename="logo.png"\n // => Content-Type: image/png\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"baseurl"},"BaseURL"),(0,r.kt)("p",null,"Returns the base URL ","(",(0,r.kt)("strong",{parentName:"p"},"protocol")," + ",(0,r.kt)("strong",{parentName:"p"},"host"),")"," as a ",(0,r.kt)("inlineCode",{parentName:"p"},"string"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) BaseURL() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET https://example.com/page#chapter-1\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.BaseURL() // https://example.com\n // ...\n})\n')),(0,r.kt)("h2",{id:"bind"},"Bind"),(0,r.kt)("p",null,"Add vars to default view var map binding to template engine.\nVariables are read by the Render method and may be overwritten."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Bind(vars Map) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Use(func(c *fiber.Ctx) error {\n c.Bind(fiber.Map{\n "Title": "Hello, World!",\n })\n})\n\napp.Get("/", func(c *fiber.Ctx) error {\n return c.Render("xxx.tmpl", fiber.Map{}) // Render will use Title variable\n})\n')),(0,r.kt)("h2",{id:"body"},"Body"),(0,r.kt)("p",null,"Returns the raw request ",(0,r.kt)("strong",{parentName:"p"},"body"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Body() []byte\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// curl -X POST http://localhost:8080 -d user=john\n\napp.Post("/", func(c *fiber.Ctx) error {\n // Get raw body from POST request:\n return c.Send(c.Body()) // []byte("user=john")\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"bodyparser"},"BodyParser"),(0,r.kt)("p",null,"Binds the request body to a struct."),(0,r.kt)("p",null,"It is important to specify the correct struct tag based on the content type to be parsed. For example, if you want to parse a JSON body with a field called Pass, you would use a struct field of ",(0,r.kt)("inlineCode",{parentName:"p"},'json:"pass"'),"."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"content-type"),(0,r.kt)("th",{parentName:"tr",align:null},"struct tag"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"application/x-www-form-urlencoded")),(0,r.kt)("td",{parentName:"tr",align:null},"form")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"multipart/form-data")),(0,r.kt)("td",{parentName:"tr",align:null},"form")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"application/json")),(0,r.kt)("td",{parentName:"tr",align:null},"json")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"application/xml")),(0,r.kt)("td",{parentName:"tr",align:null},"xml")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"text/xml")),(0,r.kt)("td",{parentName:"tr",align:null},"xml")))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) BodyParser(out interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Field names should start with an uppercase letter\ntype Person struct {\n Name string `json:"name" xml:"name" form:"name"`\n Pass string `json:"pass" xml:"pass" form:"pass"`\n}\n\napp.Post("/", func(c *fiber.Ctx) error {\n p := new(Person)\n\n if err := c.BodyParser(p); err != nil {\n return err\n }\n\n log.Println(p.Name) // john\n log.Println(p.Pass) // doe\n\n // ...\n})\n\n// Run tests with the following curl commands\n\n// curl -X POST -H "Content-Type: application/json" --data "{\\"name\\":\\"john\\",\\"pass\\":\\"doe\\"}" localhost:3000\n\n// curl -X POST -H "Content-Type: application/xml" --data "johndoe" localhost:3000\n\n// curl -X POST -H "Content-Type: application/x-www-form-urlencoded" --data "name=john&pass=doe" localhost:3000\n\n// curl -X POST -F name=john -F pass=doe http://localhost:3000\n\n// curl -X POST "http://localhost:3000/?name=john&pass=doe"\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"clearcookie"},"ClearCookie"),(0,r.kt)("p",null,"Expire a client cookie ","(",(0,r.kt)("em",{parentName:"p"},"or all cookies if left empty",")")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) ClearCookie(key ...string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // Clears all cookies:\n c.ClearCookie()\n\n // Expire specific cookie by name:\n c.ClearCookie("user")\n\n // Expire multiple cookies by names:\n c.ClearCookie("token", "session", "track_id", "version")\n // ...\n})\n')),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Web browsers and other compliant clients will only clear the cookie if the given options are identical to those when creating the cookie, excluding expires and maxAge. ClearCookie will not set these values for you - a technique similar to the one shown below should be used to ensure your cookie is deleted.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/set", func(c *fiber.Ctx) error {\n c.Cookie(&fiber.Cookie{\n Name: "token",\n Value: "randomvalue",\n Expires: time.Now().Add(24 * time.Hour),\n HTTPOnly: true,\n SameSite: "lax",\n })\n\n // ...\n})\n\napp.Get("/delete", func(c *fiber.Ctx) error {\n c.Cookie(&fiber.Cookie{\n Name: "token",\n // Set expiry date to the past\n Expires: time.Now().Add(-(time.Hour * 2)),\n HTTPOnly: true,\n SameSite: "lax",\n })\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"clienthelloinfo"},"ClientHelloInfo"),(0,r.kt)("p",null,"ClientHelloInfo contains information from a ClientHello message in order to guide application logic in the GetCertificate and GetConfigForClient callbacks.\nYou can refer to the ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/pkg/crypto/tls/#ClientHelloInfo"},"ClientHelloInfo")," struct documentation for more information on the returned struct."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) ClientHelloInfo() *tls.ClientHelloInfo\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/hello\napp.Get("/hello", func(c *fiber.Ctx) error {\n chi := c.ClientHelloInfo()\n // ...\n})\n')),(0,r.kt)("h2",{id:"context"},"Context"),(0,r.kt)("p",null,"Returns ",(0,r.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/valyala/fasthttp#RequestCtx"},"*","fasthttp.RequestCtx")," that is compatible with the context.Context interface that requires a deadline, a cancellation signal, and other values across API boundaries."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Context() *fasthttp.RequestCtx\n")),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Please read the ",(0,r.kt)("a",{parentName:"p",href:"https://pkg.go.dev/github.com/valyala/fasthttp?tab=doc"},"Fasthttp Documentation")," for more information.")),(0,r.kt)("h2",{id:"cookie"},"Cookie"),(0,r.kt)("p",null,"Set cookie"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Cookie(cookie *Cookie)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'type Cookie struct {\n Name string `json:"name"`\n Value string `json:"value"`\n Path string `json:"path"`\n Domain string `json:"domain"`\n MaxAge int `json:"max_age"`\n Expires time.Time `json:"expires"`\n Secure bool `json:"secure"`\n HTTPOnly bool `json:"http_only"`\n SameSite string `json:"same_site"`\n SessionOnly bool `json:"session_only"`\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // Create cookie\n cookie := new(fiber.Cookie)\n cookie.Name = "john"\n cookie.Value = "doe"\n cookie.Expires = time.Now().Add(24 * time.Hour)\n\n // Set cookie\n c.Cookie(cookie)\n // ...\n})\n')),(0,r.kt)("h2",{id:"cookies"},"Cookies"),(0,r.kt)("p",null,"Get cookie value by key, you could pass an optional default value that will be returned if the cookie key does not exist."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Cookies(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // Get cookie by key:\n c.Cookies("name") // "john"\n c.Cookies("empty", "doe") // "doe"\n // ...\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"download"},"Download"),(0,r.kt)("p",null,"Transfers the file from path as an ",(0,r.kt)("inlineCode",{parentName:"p"},"attachment"),"."),(0,r.kt)("p",null,"Typically, browsers will prompt the user to download. By default, the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition"},"Content-Disposition")," header ",(0,r.kt)("inlineCode",{parentName:"p"},"filename=")," parameter is the file path ","(",(0,r.kt)("em",{parentName:"p"},"this typically appears in the browser dialog"),")","."),(0,r.kt)("p",null,"Override this default with the ",(0,r.kt)("strong",{parentName:"p"},"filename")," parameter."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Download(file string, filename ...string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return c.Download("./files/report-12345.pdf");\n // => Download report-12345.pdf\n\n return c.Download("./files/report-12345.pdf", "report.pdf");\n // => Download report.pdf\n})\n')),(0,r.kt)("h2",{id:"format"},"Format"),(0,r.kt)("p",null,"Performs content-negotiation on the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept"},"Accept")," HTTP header. It uses ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#accepts"},"Accepts")," to select a proper format."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If the header is ",(0,r.kt)("strong",{parentName:"p"},"not")," specified or there is ",(0,r.kt)("strong",{parentName:"p"},"no")," proper format, ",(0,r.kt)("strong",{parentName:"p"},"text/plain")," is used.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Format(body interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // Accept: text/plain\n c.Format("Hello, World!")\n // => Hello, World!\n\n // Accept: text/html\n c.Format("Hello, World!")\n // =>

Hello, World!

\n\n // Accept: application/json\n c.Format("Hello, World!")\n // => "Hello, World!"\n // ..\n})\n')),(0,r.kt)("h2",{id:"formfile"},"FormFile"),(0,r.kt)("p",null,"MultipartForm files can be retrieved by name, the ",(0,r.kt)("strong",{parentName:"p"},"first")," file from the given key is returned."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) FormFile(key string) (*multipart.FileHeader, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n // Get first file from form field "document":\n file, err := c.FormFile("document")\n\n // Save file to root directory:\n return c.SaveFile(file, fmt.Sprintf("./%s", file.Filename))\n})\n')),(0,r.kt)("h2",{id:"formvalue"},"FormValue"),(0,r.kt)("p",null,"Any form values can be retrieved by name, the ",(0,r.kt)("strong",{parentName:"p"},"first")," value from the given key is returned."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) FormValue(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n // Get first value from form field "name":\n c.FormValue("name")\n // => "john" or "" if not exist\n\n // ..\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"fresh"},"Fresh"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://expressjs.com/en/4x/api.html#req.fresh"},"https://expressjs.com/en/4x/api.html","#","req.fresh")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Fresh() bool\n")),(0,r.kt)("h2",{id:"get"},"Get"),(0,r.kt)("p",null,"Returns the HTTP request header specified by the field."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"The match is ",(0,r.kt)("strong",{parentName:"p"},"case-insensitive"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Get(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Get("Content-Type") // "text/plain"\n c.Get("CoNtEnT-TypE") // "text/plain"\n c.Get("something", "john") // "john"\n // ..\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"getreqheaders"},"GetReqHeaders"),(0,r.kt)("p",null,"Returns the HTTP request headers."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) GetReqHeaders() map[string]string\n")),(0,r.kt)("h2",{id:"getrespheader"},"GetRespHeader"),(0,r.kt)("p",null,"Returns the HTTP response header specified by the field."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"The match is ",(0,r.kt)("strong",{parentName:"p"},"case-insensitive"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) GetRespHeader(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.GetRespHeader("X-Request-Id") // "8d7ad5e3-aaf3-450b-a241-2beb887efd54"\n c.GetRespHeader("Content-Type") // "text/plain"\n c.GetRespHeader("something", "john") // "john"\n // ..\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"getrespheaders"},"GetRespHeaders"),(0,r.kt)("p",null,"Returns the HTTP response headers."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) GetRespHeaders() map[string]string\n")),(0,r.kt)("h2",{id:"getrouteurl"},"GetRouteURL"),(0,r.kt)("p",null,'Generates URLs to named routes, with parameters. URLs are relative, for example: "/user/1831"'),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) GetRouteURL(routeName string, params Map) (string, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Home page")\n}).Name("home")\n\napp.Get("/user/:id", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("id"))\n}).Name("user.show")\n\napp.Get("/test", func(c *fiber.Ctx) error {\n location, _ := c.GetRouteURL("user.show", fiber.Map{"id": 1})\n return c.SendString(location)\n})\n\n// /test returns "/user/1"\n')),(0,r.kt)("h2",{id:"hostname"},"Hostname"),(0,r.kt)("p",null,"Returns the hostname derived from the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host"},"Host")," HTTP header."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Hostname() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://google.com/search\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Hostname() // "google.com"\n\n // ...\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"ip"},"IP"),(0,r.kt)("p",null,"Returns the remote IP address of the request."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) IP() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.IP() // "127.0.0.1"\n\n // ...\n})\n')),(0,r.kt)("p",null,"When registering the proxy request header in the fiber app, the ip address of the header is returned ",(0,r.kt)("a",{parentName:"p",href:"/next/api/fiber#config"},"(Fiber configuration)")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"app := fiber.New(fiber.Config{\n ProxyHeader: fiber.HeaderXForwardedFor,\n})\n")),(0,r.kt)("h2",{id:"ips"},"IPs"),(0,r.kt)("p",null,"Returns an array of IP addresses specified in the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For"},"X-Forwarded-For")," request header."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) IPs() []string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// X-Forwarded-For: proxy1, 127.0.0.1, proxy3\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.IPs() // ["proxy1", "127.0.0.1", "proxy3"]\n\n // ...\n})\n')),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Improper use of the X-Forwarded-For header can be a security risk. For details, see the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#security_and_privacy_concerns"},"Security and privacy concerns")," section.")),(0,r.kt)("h2",{id:"is"},"Is"),(0,r.kt)("p",null,"Returns the matching ",(0,r.kt)("strong",{parentName:"p"},"content type"),", if the incoming request\u2019s ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type"},"Content-Type")," HTTP header field matches the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/ru/docs/Web/HTTP/Basics_of_HTTP/MIME_types"},"MIME type")," specified by the type parameter."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If the request has ",(0,r.kt)("strong",{parentName:"p"},"no")," body, it returns ",(0,r.kt)("strong",{parentName:"p"},"false"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Is(extension string) bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Content-Type: text/html; charset=utf-8\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Is("html") // true\n c.Is(".html") // true\n c.Is("json") // false\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"isfromlocal"},"IsFromLocal"),(0,r.kt)("p",null,"Returns true if request came from localhost"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) IsFromLocal() bool {\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'\napp.Get("/", func(c *fiber.Ctx) error {\n // If request came from localhost, return true else return false\n c.IsFromLocal()\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"json"},"JSON"),(0,r.kt)("p",null,"Converts any ",(0,r.kt)("strong",{parentName:"p"},"interface")," or ",(0,r.kt)("strong",{parentName:"p"},"string")," to JSON using the ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/goccy/go-json"},"goccy/go-json")," package."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"JSON also sets the content header to ",(0,r.kt)("strong",{parentName:"p"},"application/json"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) JSON(data interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'type SomeStruct struct {\n Name string\n Age uint8\n}\n\napp.Get("/json", func(c *fiber.Ctx) error {\n // Create data struct:\n data := SomeStruct{\n Name: "Grame",\n Age: 20,\n }\n\n return c.JSON(data)\n // => Content-Type: application/json\n // => "{"Name": "Grame", "Age": 20}"\n\n return c.JSON(fiber.Map{\n "name": "Grame",\n "age": 20,\n })\n // => Content-Type: application/json\n // => "{"name": "Grame", "age": 20}"\n})\n')),(0,r.kt)("h2",{id:"jsonp"},"JSONP"),(0,r.kt)("p",null,"Sends a JSON response with JSONP support. This method is identical to ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#json"},"JSON"),", except that it opts-in to JSONP callback support. By default, the callback name is simply callback."),(0,r.kt)("p",null,"Override this by passing a ",(0,r.kt)("strong",{parentName:"p"},"named string")," in the method."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) JSONP(data interface{}, callback ...string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'type SomeStruct struct {\n name string\n age uint8\n}\n\napp.Get("/", func(c *fiber.Ctx) error {\n // Create data struct:\n data := SomeStruct{\n name: "Grame",\n age: 20,\n }\n\n return c.JSONP(data)\n // => callback({"name": "Grame", "age": 20})\n\n return c.JSONP(data, "customFunc")\n // => customFunc({"name": "Grame", "age": 20})\n})\n')),(0,r.kt)("h2",{id:"links"},"Links"),(0,r.kt)("p",null,"Joins the links followed by the property to populate the response\u2019s ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link"},"Link")," HTTP header field."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Links(link ...string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Links(\n "http://api.example.com/users?page=2", "next",\n "http://api.example.com/users?page=5", "last",\n )\n // Link: ; rel="next",\n // ; rel="last"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"locals"},"Locals"),(0,r.kt)("p",null,"A method that stores variables scoped to the request and, therefore, are available only to the routes that match the request."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"This is useful if you want to pass some ",(0,r.kt)("strong",{parentName:"p"},"specific")," data to the next middleware.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Locals(key interface{}, value ...interface{}) interface{}\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Use(func(c *fiber.Ctx) error {\n c.Locals("user", "admin")\n return c.Next()\n})\n\napp.Get("/admin", func(c *fiber.Ctx) error {\n if c.Locals("user") == "admin" {\n return c.Status(fiber.StatusOK).SendString("Welcome, admin!")\n }\n return c.SendStatus(fiber.StatusForbidden)\n\n})\n')),(0,r.kt)("h2",{id:"location"},"Location"),(0,r.kt)("p",null,"Sets the response ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/ru/docs/Web/HTTP/Headers/Location"},"Location")," HTTP header to the specified path parameter."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Location(path string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n c.Location("http://example.com")\n\n c.Location("/foo/bar")\n \n return nil\n})\n')),(0,r.kt)("h2",{id:"method"},"Method"),(0,r.kt)("p",null,"Returns a string corresponding to the HTTP method of the request: ",(0,r.kt)("inlineCode",{parentName:"p"},"GET"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"POST"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"PUT"),", and so on.",(0,r.kt)("br",{parentName:"p"}),"\n","Optionally, you could override the method by passing a string."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Method(override ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n c.Method() // "POST"\n\n c.Method("GET")\n c.Method() // GET\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"multipartform"},"MultipartForm"),(0,r.kt)("p",null,"To access multipart form entries, you can parse the binary with ",(0,r.kt)("inlineCode",{parentName:"p"},"MultipartForm()"),". This returns a ",(0,r.kt)("inlineCode",{parentName:"p"},"map[string][]string"),", so given a key, the value will be a string slice."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) MultipartForm() (*multipart.Form, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n // Parse the multipart form:\n if form, err := c.MultipartForm(); err == nil {\n // => *multipart.Form\n\n if token := form.Value["token"]; len(token) > 0 {\n // Get key value:\n fmt.Println(token[0])\n }\n\n // Get all files from "documents" key:\n files := form.File["documents"]\n // => []*multipart.FileHeader\n\n // Loop through files:\n for _, file := range files {\n fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])\n // => "tutorial.pdf" 360641 "application/pdf"\n\n // Save the files to disk:\n if err := c.SaveFile(file, fmt.Sprintf("./%s", file.Filename)); err != nil {\n return err\n }\n }\n }\n\n return err\n})\n')),(0,r.kt)("h2",{id:"next"},"Next"),(0,r.kt)("p",null,"When ",(0,r.kt)("strong",{parentName:"p"},"Next")," is called, it executes the next method in the stack that matches the current route. You can pass an error struct within the method that will end the chaining and call the ",(0,r.kt)("a",{parentName:"p",href:"https://docs.gofiber.io/guide/error-handling"},"error handler"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Next() error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n fmt.Println("1st route!")\n return c.Next()\n})\n\napp.Get("*", func(c *fiber.Ctx) error {\n fmt.Println("2nd route!")\n return c.Next()\n})\n\napp.Get("/", func(c *fiber.Ctx) error {\n fmt.Println("3rd route!")\n return c.SendString("Hello, World!")\n})\n')),(0,r.kt)("h2",{id:"originalurl"},"OriginalURL"),(0,r.kt)("p",null,"Returns the original request URL."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) OriginalURL() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/search?q=something\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.OriginalURL() // "/search?q=something"\n\n // ...\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"params"},"Params"),(0,r.kt)("p",null,"Method can be used to get the route parameters, you could pass an optional default value that will be returned if the param key does not exist."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Defaults to empty string ","(",(0,r.kt)("inlineCode",{parentName:"p"},'""'),")",", if the param ",(0,r.kt)("strong",{parentName:"p"},"doesn't")," exist.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Params(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/user/fenny\napp.Get("/user/:name", func(c *fiber.Ctx) error {\n c.Params("name") // "fenny"\n\n // ...\n})\n\n// GET http://example.com/user/fenny/123\napp.Get("/user/*", func(c *fiber.Ctx) error {\n c.Params("*") // "fenny/123"\n c.Params("*1") // "fenny/123"\n\n // ...\n})\n')),(0,r.kt)("p",null,"Unnamed route parameters","(","*",", +",")"," can be fetched by the ",(0,r.kt)("strong",{parentName:"p"},"character")," and the ",(0,r.kt)("strong",{parentName:"p"},"counter")," in the route."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// ROUTE: /v1/*/shop/*\n// GET: /v1/brand/4/shop/blue/xs\nc.Params("*1") // "brand/4"\nc.Params("*2") // "blue/xs"\n')),(0,r.kt)("p",null,"For reasons of ",(0,r.kt)("strong",{parentName:"p"},"downward compatibility"),", the first parameter segment for the parameter character can also be accessed without the counter."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/v1/*/shop/*", func(c *fiber.Ctx) error {\n c.Params("*") // outputs the values of the first wildcard segment\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"paramsint"},"ParamsInt"),(0,r.kt)("p",null,"Method can be used to get an integer from the route parameters.\nPlease note if that parameter is not in the request, zero\nwill be returned. If the parameter is NOT a number, zero and an error\nwill be returned"),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Defaults to the integer zero ","(",(0,r.kt)("inlineCode",{parentName:"p"},"0"),")",", if the param ",(0,r.kt)("strong",{parentName:"p"},"doesn't")," exist.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) ParamsInt(key string) (int, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/user/123\napp.Get("/user/:id", func(c *fiber.Ctx) error {\n id, err := c.ParamsInt("id") // int 123 and no error\n\n // ...\n})\n\n')),(0,r.kt)("p",null,"This method is equivalent of using ",(0,r.kt)("inlineCode",{parentName:"p"},"atoi")," with ctx.Params"),(0,r.kt)("h2",{id:"paramsparser"},"ParamsParser"),(0,r.kt)("p",null,'This method is similar to BodyParser, but for path parameters. It is important to use the struct tag "params". For example, if you want to parse a path parameter with a field called Pass, you would use a struct field of params:"pass"'),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) ParamsParser(out interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/user/111\napp.Get("/user/:id", func(c *fiber.Ctx) error {\n param := struct {ID uint `params:"id"`}{}\n \n c.ParamsParser(¶m) // "{"id": 111}"\n\n // ...\n})\n\n')),(0,r.kt)("h2",{id:"path"},"Path"),(0,r.kt)("p",null,"Contains the path part of the request URL. Optionally, you could override the path by passing a string. For internal redirects, you might want to call ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#restartrouting"},"RestartRouting")," instead of ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#next"},"Next"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Path(override ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/users?sort=desc\n\napp.Get("/users", func(c *fiber.Ctx) error {\n c.Path() // "/users"\n\n c.Path("/john")\n c.Path() // "/john"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"protocol"},"Protocol"),(0,r.kt)("p",null,"Contains the request protocol string: ",(0,r.kt)("inlineCode",{parentName:"p"},"http")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"https")," for ",(0,r.kt)("strong",{parentName:"p"},"TLS")," requests."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Protocol() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Protocol() // "http"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"queries"},"Queries"),(0,r.kt)("p",null,"Queries is a function that returns an object containing a property for each query string parameter in the route."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Queries() map[string]string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?name=alex&want_pizza=false&id=\n\napp.Get("/", func(c *fiber.Ctx) error {\n m := c.Queries()\n m["name"] // "alex"\n m["want_pizza"] // "false"\n m["id"] // ""\n // ...\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?field1=value1&field1=value2&field2=value3\n\napp.Get("/", func (c *fiber.Ctx) error {\n m := c.Queries()\n m["field1"] // "value2"\n m["field2"] // value3\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?list_a=1&list_a=2&list_a=3&list_b[]=1&list_b[]=2&list_b[]=3&list_c=1,2,3\n\napp.Get("/", func(c *fiber.Ctx) error {\n m := c.Queries()\n m["list_a"] // "3"\n m["list_b[]"] // "3"\n m["list_c"] // "1,2,3"\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET /api/posts?filters.author.name=John&filters.category.name=Technology\n\napp.Get("/", func(c *fiber.Ctx) error {\n m := c.Queries()\n m["filters.author.name"] // John\n m["filters.category.name"] // Technology\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET /api/posts?tags=apple,orange,banana&filters[tags]=apple,orange,banana&filters[category][name]=fruits&filters.tags=apple,orange,banana&filters.category.name=fruits\n\napp.Get("/", func(c *fiber.Ctx) error {\n m := c.Queries()\n m["tags"] // apple,orange,banana\n m["filters[tags]"] // apple,orange,banana\n m["filters[category][name]"] // fruits\n m["filters.tags"] // apple,orange,banana\n m["filters.category.name"] // fruits\n})\n')),(0,r.kt)("h2",{id:"query"},"Query"),(0,r.kt)("p",null,"This property is an object containing a property for each query string parameter in the route, you could pass an optional default value that will be returned if the query key does not exist."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If there is ",(0,r.kt)("strong",{parentName:"p"},"no")," query string, it returns an ",(0,r.kt)("strong",{parentName:"p"},"empty string"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Query(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?order=desc&brand=nike\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Query("order") // "desc"\n c.Query("brand") // "nike"\n c.Query("empty", "nike") // "nike"\n\n // ...\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"querybool"},"QueryBool"),(0,r.kt)("p",null,"This property is an object containing a property for each query boolean parameter in the route, you could pass an optional default value that will be returned if the query key does not exist."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Please note if that parameter is not in the request, false will be returned.\nIf the parameter is not a boolean, it is still tried to be converted and usually returned as false.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) QueryBool(key string, defaultValue ...bool) bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?name=alex&want_pizza=false&id=\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.QueryBool("want_pizza") // false\n c.QueryBool("want_pizza", true) // false\n c.QueryBool("name") // false\n c.QueryBool("name", true) // true\n c.QueryBool("id") // false\n c.QueryBool("id", true) // true\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"queryfloat"},"QueryFloat"),(0,r.kt)("p",null,"This property is an object containing a property for each query float64 parameter in the route, you could pass an optional default value that will be returned if the query key does not exist."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Please note if that parameter is not in the request, zero will be returned.\nIf the parameter is not a number, it is still tried to be converted and usually returned as 1.")),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Defaults to the float64 zero ","(",(0,r.kt)("inlineCode",{parentName:"p"},"0"),")",", if the param ",(0,r.kt)("strong",{parentName:"p"},"doesn't")," exist.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) QueryFloat(key string, defaultValue ...float64) float64\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?name=alex&amount=32.23&id=\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.QueryFloat("amount") // 32.23\n c.QueryFloat("amount", 3) // 32.23\n c.QueryFloat("name", 1) // 1\n c.QueryFloat("name") // 0\n c.QueryFloat("id", 3) // 3\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"queryint"},"QueryInt"),(0,r.kt)("p",null,"This property is an object containing a property for each query integer parameter in the route, you could pass an optional default value that will be returned if the query key does not exist."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Please note if that parameter is not in the request, zero will be returned.\nIf the parameter is not a number, it is still tried to be converted and usually returned as 1.")),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Defaults to the integer zero ","(",(0,r.kt)("inlineCode",{parentName:"p"},"0"),")",", if the param ",(0,r.kt)("strong",{parentName:"p"},"doesn't")," exist.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) QueryInt(key string, defaultValue ...int) int\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?name=alex&wanna_cake=2&id=\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.QueryInt("wanna_cake", 1) // 2\n c.QueryInt("name", 1) // 1\n c.QueryInt("id", 1) // 1\n c.QueryInt("id") // 0\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"queryparser"},"QueryParser"),(0,r.kt)("p",null,"This method is similar to ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#bodyparser"},"BodyParser"),', but for query parameters.\nIt is important to use the struct tag "query". For example, if you want to parse a query parameter with a field called Pass, you would use a struct field of ',(0,r.kt)("inlineCode",{parentName:"p"},'query:"pass"'),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) QueryParser(out interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Field names should start with an uppercase letter\ntype Person struct {\n Name string `query:"name"`\n Pass string `query:"pass"`\n Products []string `query:"products"`\n}\n\napp.Get("/", func(c *fiber.Ctx) error {\n p := new(Person)\n\n if err := c.QueryParser(p); err != nil {\n return err\n }\n\n log.Println(p.Name) // john\n log.Println(p.Pass) // doe\n log.Println(p.Products) // [shoe, hat]\n\n // ...\n})\n// Run tests with the following curl command\n\n// curl "http://localhost:3000/?name=john&pass=doe&products=shoe,hat"\n')),(0,r.kt)("h2",{id:"range"},"Range"),(0,r.kt)("p",null,"A struct containing the type and a slice of ranges will be returned."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Range(size int) (Range, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Range: bytes=500-700, 700-900\napp.Get("/", func(c *fiber.Ctx) error {\n b := c.Range(1000)\n if b.Type == "bytes" {\n for r := range r.Ranges {\n fmt.Println(r)\n // [500, 700]\n }\n }\n})\n')),(0,r.kt)("h2",{id:"redirect"},"Redirect"),(0,r.kt)("p",null,"Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If ",(0,r.kt)("strong",{parentName:"p"},"not")," specified, status defaults to ",(0,r.kt)("strong",{parentName:"p"},"302 Found"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Redirect(location string, status ...int) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/coffee", func(c *fiber.Ctx) error {\n return c.Redirect("/teapot")\n})\n\napp.Get("/teapot", func(c *fiber.Ctx) error {\n return c.Status(fiber.StatusTeapot).Send("\ud83c\udf75 short and stout \ud83c\udf75")\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="More examples"',title:'"More','examples"':!0},'app.Get("/", func(c *fiber.Ctx) error {\n return c.Redirect("/foo/bar")\n return c.Redirect("../login")\n return c.Redirect("http://example.com")\n return c.Redirect("http://example.com", 301)\n})\n')),(0,r.kt)("h2",{id:"redirecttoroute"},"RedirectToRoute"),(0,r.kt)("p",null,"Redirects to the specific route along with the parameters and with specified status, a positive integer that corresponds to an HTTP status code."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If ",(0,r.kt)("strong",{parentName:"p"},"not")," specified, status defaults to ",(0,r.kt)("strong",{parentName:"p"},"302 Found"),".")),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If you want to send queries to route, you must add ",(0,r.kt)("strong",{parentName:"p"},'"queries"')," key typed as ",(0,r.kt)("strong",{parentName:"p"},"map","[string]","string")," to params.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) RedirectToRoute(routeName string, params fiber.Map, status ...int) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // /user/fiber\n return c.RedirectToRoute("user", fiber.Map{\n "name": "fiber"\n })\n})\n\napp.Get("/with-queries", func(c *fiber.Ctx) error {\n // /user/fiber?data[0][name]=john&data[0][age]=10&test=doe\n return c.RedirectToRoute("user", fiber.Map{\n "name": "fiber",\n "queries": map[string]string{"data[0][name]": "john", "data[0][age]": "10", "test": "doe"},\n })\n})\n\napp.Get("/user/:name", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("name"))\n}).Name("user")\n')),(0,r.kt)("h2",{id:"redirectback"},"RedirectBack"),(0,r.kt)("p",null,"Redirects back to refer URL. It redirects to fallback URL if refer header doesn't exists, with specified status, a positive integer that corresponds to an HTTP status code."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If ",(0,r.kt)("strong",{parentName:"p"},"not")," specified, status defaults to ",(0,r.kt)("strong",{parentName:"p"},"302 Found"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) RedirectBack(fallback string, status ...int) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Home page")\n})\napp.Get("/test", func(c *fiber.Ctx) error {\n c.Set("Content-Type", "text/html")\n return c.SendString(`Back`)\n})\n\napp.Get("/back", func(c *fiber.Ctx) error {\n return c.RedirectBack("/")\n})\n')),(0,r.kt)("h2",{id:"render"},"Render"),(0,r.kt)("p",null,"Renders a view with data and sends a ",(0,r.kt)("inlineCode",{parentName:"p"},"text/html")," response. By default ",(0,r.kt)("inlineCode",{parentName:"p"},"Render")," uses the default ",(0,r.kt)("a",{parentName:"p",href:"https://pkg.go.dev/html/template/"},(0,r.kt)("strong",{parentName:"a"},"Go Template engine")),". If you want to use another View engine, please take a look at our ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/gofiber/template"},(0,r.kt)("strong",{parentName:"a"},"Template middleware")),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Render(name string, bind interface{}, layouts ...string) error\n")),(0,r.kt)("h2",{id:"request"},"Request"),(0,r.kt)("p",null,"Request return the ",(0,r.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/valyala/fasthttp#Request"},"*","fasthttp.Request")," pointer"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Request() *fasthttp.Request\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Request().Header.Method()\n // => []byte("GET")\n})\n')),(0,r.kt)("h2",{id:"reqheaderparser"},"ReqHeaderParser"),(0,r.kt)("p",null,"This method is similar to ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#bodyparser"},"BodyParser"),', but for request headers.\nIt is important to use the struct tag "reqHeader". For example, if you want to parse a request header with a field called Pass, you would use a struct field of ',(0,r.kt)("inlineCode",{parentName:"p"},'reqHeader:"pass"'),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) ReqHeaderParser(out interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Field names should start with an uppercase letter\ntype Person struct {\n Name string `reqHeader:"name"`\n Pass string `reqHeader:"pass"`\n Products []string `reqHeader:"products"`\n}\n\napp.Get("/", func(c *fiber.Ctx) error {\n p := new(Person)\n\n if err := c.ReqHeaderParser(p); err != nil {\n return err\n }\n\n log.Println(p.Name) // john\n log.Println(p.Pass) // doe\n log.Println(p.Products) // [shoe, hat]\n\n // ...\n})\n// Run tests with the following curl command\n\n// curl "http://localhost:3000/" -H "name: john" -H "pass: doe" -H "products: shoe,hat"\n')),(0,r.kt)("h2",{id:"response"},"Response"),(0,r.kt)("p",null,"Response return the ",(0,r.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/valyala/fasthttp#Response"},"*","fasthttp.Response")," pointer"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Response() *fasthttp.Response\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Response().BodyWriter().Write([]byte("Hello, World!"))\n // => "Hello, World!"\n return nil\n})\n')),(0,r.kt)("h2",{id:"restartrouting"},"RestartRouting"),(0,r.kt)("p",null,"Instead of executing the next method when calling ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#next"},"Next"),", ",(0,r.kt)("strong",{parentName:"p"},"RestartRouting")," restarts execution from the first method that matches the current route. This may be helpful after overriding the path, i. e. an internal redirect. Note that handlers might be executed again which could result in an infinite loop."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) RestartRouting() error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/new", func(c *fiber.Ctx) error {\n return c.SendString("From /new")\n})\n\napp.Get("/old", func(c *fiber.Ctx) error {\n c.Path("/new")\n return c.RestartRouting()\n})\n')),(0,r.kt)("h2",{id:"route"},"Route"),(0,r.kt)("p",null,"Returns the matched ",(0,r.kt)("a",{parentName:"p",href:"https://pkg.go.dev/github.com/gofiber/fiber?tab=doc#Route"},"Route")," struct."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Route() *Route\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// http://localhost:8080/hello\n\n\napp.Get("/hello/:name", func(c *fiber.Ctx) error {\n r := c.Route()\n fmt.Println(r.Method, r.Path, r.Params, r.Handlers)\n // GET /hello/:name handler [name] \n\n // ...\n})\n')),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Do not rely on ",(0,r.kt)("inlineCode",{parentName:"p"},"c.Route()")," in middlewares ",(0,r.kt)("strong",{parentName:"p"},"before")," calling ",(0,r.kt)("inlineCode",{parentName:"p"},"c.Next()")," - ",(0,r.kt)("inlineCode",{parentName:"p"},"c.Route()")," returns the ",(0,r.kt)("strong",{parentName:"p"},"last executed route"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"func MyMiddleware() fiber.Handler {\n return func(c *fiber.Ctx) error {\n beforeNext := c.Route().Path // Will be '/'\n err := c.Next()\n afterNext := c.Route().Path // Will be '/hello/:name'\n return err\n }\n}\n")),(0,r.kt)("h2",{id:"savefile"},"SaveFile"),(0,r.kt)("p",null,"Method is used to save ",(0,r.kt)("strong",{parentName:"p"},"any")," multipart file to disk."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) SaveFile(fh *multipart.FileHeader, path string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n // Parse the multipart form:\n if form, err := c.MultipartForm(); err == nil {\n // => *multipart.Form\n\n // Get all files from "documents" key:\n files := form.File["documents"]\n // => []*multipart.FileHeader\n\n // Loop through files:\n for _, file := range files {\n fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])\n // => "tutorial.pdf" 360641 "application/pdf"\n\n // Save the files to disk:\n if err := c.SaveFile(file, fmt.Sprintf("./%s", file.Filename)); err != nil {\n return err\n }\n }\n return err\n }\n})\n')),(0,r.kt)("h2",{id:"savefiletostorage"},"SaveFileToStorage"),(0,r.kt)("p",null,"Method is used to save ",(0,r.kt)("strong",{parentName:"p"},"any")," multipart file to an external storage system."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) SaveFileToStorage(fileheader *multipart.FileHeader, path string, storage Storage) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'storage := memory.New()\n\napp.Post("/", func(c *fiber.Ctx) error {\n // Parse the multipart form:\n if form, err := c.MultipartForm(); err == nil {\n // => *multipart.Form\n\n // Get all files from "documents" key:\n files := form.File["documents"]\n // => []*multipart.FileHeader\n\n // Loop through files:\n for _, file := range files {\n fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])\n // => "tutorial.pdf" 360641 "application/pdf"\n\n // Save the files to storage:\n if err := c.SaveFileToStorage(file, fmt.Sprintf("./%s", file.Filename), storage); err != nil {\n return err\n }\n }\n return err\n }\n})\n')),(0,r.kt)("h2",{id:"secure"},"Secure"),(0,r.kt)("p",null,"A boolean property that is ",(0,r.kt)("inlineCode",{parentName:"p"},"true")," , if a ",(0,r.kt)("strong",{parentName:"p"},"TLS")," connection is established."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Secure() bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Secure() method is equivalent to:\nc.Protocol() == "https"\n')),(0,r.kt)("h2",{id:"send"},"Send"),(0,r.kt)("p",null,"Sets the HTTP response body."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Send(body []byte) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return c.Send([]byte("Hello, World!")) // => "Hello, World!"\n})\n')),(0,r.kt)("p",null,"Fiber also provides ",(0,r.kt)("inlineCode",{parentName:"p"},"SendString")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"SendStream")," methods for raw inputs."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Use this if you ",(0,r.kt)("strong",{parentName:"p"},"don't need")," type assertion, recommended for ",(0,r.kt)("strong",{parentName:"p"},"faster")," performance.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) SendString(body string) error\nfunc (c *Ctx) SendStream(stream io.Reader, size ...int) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n // => "Hello, World!"\n\n return c.SendStream(bytes.NewReader([]byte("Hello, World!")))\n // => "Hello, World!"\n})\n')),(0,r.kt)("h2",{id:"sendfile"},"SendFile"),(0,r.kt)("p",null,"Transfers the file from the given path. Sets the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type"},"Content-Type")," response HTTP header field based on the ",(0,r.kt)("strong",{parentName:"p"},"filenames")," extension."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Method doesn\xb4t use ",(0,r.kt)("strong",{parentName:"p"},"gzipping")," by default, set it to ",(0,r.kt)("strong",{parentName:"p"},"true")," to enable.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature" title="Signature"',title:'"Signature"'},"func (c *Ctx) SendFile(file string, compress ...bool) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/not-found", func(c *fiber.Ctx) error {\n return c.SendFile("./public/404.html");\n\n // Disable compression\n return c.SendFile("./static/index.html", false);\n})\n')),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If the file contains an url specific character you have to escape it before passing the file path into the ",(0,r.kt)("inlineCode",{parentName:"p"},"sendFile")," function.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/file-with-url-chars", func(c *fiber.Ctx) error {\n return c.SendFile(url.PathEscape("hash_sign_#.txt"))\n})\n')),(0,r.kt)("h2",{id:"sendstatus"},"SendStatus"),(0,r.kt)("p",null,"Sets the status code and the correct status message in the body, if the response body is ",(0,r.kt)("strong",{parentName:"p"},"empty"),"."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"You can find all used status codes and messages ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber/blob/dffab20bcdf4f3597d2c74633a7705a517d2c8c2/utils.go#L183-L244"},"here"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) SendStatus(status int) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/not-found", func(c *fiber.Ctx) error {\n return c.SendStatus(415)\n // => 415 "Unsupported Media Type"\n\n c.SendString("Hello, World!")\n return c.SendStatus(415)\n // => 415 "Hello, World!"\n})\n')),(0,r.kt)("h2",{id:"set"},"Set"),(0,r.kt)("p",null,"Sets the response\u2019s HTTP header field to the specified ",(0,r.kt)("inlineCode",{parentName:"p"},"key"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"value"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Set(key string, val string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Set("Content-Type", "text/plain")\n // => "Content-type: text/plain"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"setparserdecoder"},"SetParserDecoder"),(0,r.kt)("p",null,"Allow you to config BodyParser/QueryParser decoder, base on schema's options, providing possibility to add custom type for parsing."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func SetParserDecoder(parserConfig fiber.ParserConfig{\n IgnoreUnknownKeys bool,\n ParserType []fiber.ParserType{\n Customtype interface{},\n Converter func(string) reflect.Value,\n },\n ZeroEmpty bool,\n SetAliasTag string,\n})\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'\ntype CustomTime time.Time\n\n// String() returns the time in string\nfunc (ct *CustomTime) String() string {\n t := time.Time(*ct).String()\n return t\n}\n\n// Register the converter for CustomTime type format as 2006-01-02\nvar timeConverter = func(value string) reflect.Value {\n fmt.Println("timeConverter", value)\n if v, err := time.Parse("2006-01-02", value); err == nil {\n return reflect.ValueOf(v)\n }\n return reflect.Value{}\n}\n\ncustomTime := fiber.ParserType{\n Customtype: CustomTime{},\n Converter: timeConverter,\n} \n\n// Add setting to the Decoder\nfiber.SetParserDecoder(fiber.ParserConfig{\n IgnoreUnknownKeys: true,\n ParserType: []fiber.ParserType{customTime},\n ZeroEmpty: true,\n})\n\n// Example to use CustomType, you pause custom time format not in RFC3339\ntype Demo struct {\n Date CustomTime `form:"date" query:"date"`\n Title string `form:"title" query:"title"`\n Body string `form:"body" query:"body"`\n}\n\napp.Post("/body", func(c *fiber.Ctx) error {\n var d Demo\n c.BodyParser(&d)\n fmt.Println("d.Date", d.Date.String())\n return c.JSON(d)\n})\n\napp.Get("/query", func(c *fiber.Ctx) error {\n var d Demo\n c.QueryParser(&d)\n fmt.Println("d.Date", d.Date.String())\n return c.JSON(d)\n})\n\n// curl -X POST -F title=title -F body=body -F date=2021-10-20 http://localhost:3000/body\n\n// curl -X GET "http://localhost:3000/query?title=title&body=body&date=2021-10-20"\n\n')),(0,r.kt)("h2",{id:"setusercontext"},"SetUserContext"),(0,r.kt)("p",null,"Sets the user specified implementation for context interface."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) SetUserContext(ctx context.Context)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n ctx := context.Background()\n c.SetUserContext(ctx)\n // Here ctx could be any context implementation\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"stale"},"Stale"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://expressjs.com/en/4x/api.html#req.stale"},"https://expressjs.com/en/4x/api.html","#","req.stale")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Stale() bool\n")),(0,r.kt)("h2",{id:"status"},"Status"),(0,r.kt)("p",null,"Sets the HTTP status for the response."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Method is a ",(0,r.kt)("strong",{parentName:"p"},"chainable"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Status(status int) *Ctx\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/fiber", func(c *fiber.Ctx) error {\n c.Status(fiber.StatusOK)\n return nil\n}\n\napp.Get("/hello", func(c *fiber.Ctx) error {\n return c.Status(fiber.StatusBadRequest).SendString("Bad Request")\n}\n\napp.Get("/world", func(c *fiber.Ctx) error {\n return c.Status(fiber.StatusNotFound).SendFile("./public/gopher.png")\n})\n')),(0,r.kt)("h2",{id:"subdomains"},"Subdomains"),(0,r.kt)("p",null,"Returns a string slice of subdomains in the domain name of the request."),(0,r.kt)("p",null,"The application property subdomain offset, which defaults to ",(0,r.kt)("inlineCode",{parentName:"p"},"2"),", is used for determining the beginning of the subdomain segments."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Subdomains(offset ...int) []string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Host: "tobi.ferrets.example.com"\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Subdomains() // ["ferrets", "tobi"]\n c.Subdomains(1) // ["tobi"]\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"type"},"Type"),(0,r.kt)("p",null,"Sets the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type"},"Content-Type")," HTTP header to the MIME type listed ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/nginx/nginx/blob/master/conf/mime.types"},"here")," specified by the file ",(0,r.kt)("strong",{parentName:"p"},"extension"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Type(ext string, charset ...string) *Ctx\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Type(".html") // => "text/html"\n c.Type("html") // => "text/html"\n c.Type("png") // => "image/png"\n\n c.Type("json", "utf-8") // => "application/json; charset=utf-8"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"usercontext"},"UserContext"),(0,r.kt)("p",null,"UserContext returns a context implementation that was set by user earlier\nor returns a non-nil, empty context, if it was not set earlier."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) UserContext() context.Context\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n ctx := c.UserContext()\n // ctx is context implementation set by user\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"vary"},"Vary"),(0,r.kt)("p",null,"Adds the given header field to the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary"},"Vary")," response header. This will append the header, if not already listed, otherwise leaves it listed in the current location."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Multiple fields are ",(0,r.kt)("strong",{parentName:"p"},"allowed"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Vary(fields ...string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Vary("Origin") // => Vary: Origin\n c.Vary("User-Agent") // => Vary: Origin, User-Agent\n\n // No duplicates\n c.Vary("Origin") // => Vary: Origin, User-Agent\n\n c.Vary("Accept-Encoding", "Accept")\n // => Vary: Origin, User-Agent, Accept-Encoding, Accept\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"write"},"Write"),(0,r.kt)("p",null,"Write adopts the Writer interface"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Write(p []byte) (n int, err error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Write([]byte("Hello, World!")) // => "Hello, World!"\n\n fmt.Fprintf(c, "%s\\n", "Hello, World!") // "Hello, World!Hello, World!"\n})\n')),(0,r.kt)("h2",{id:"writef"},"Writef"),(0,r.kt)("p",null,"Writef adopts the string with variables"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Writef(f string, a ...interface{}) (n int, err error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n world := "World!"\n c.Writef("Hello, %s", world) // => "Hello, World!"\n\n fmt.Fprintf(c, "%s\\n", "Hello, World!") // "Hello, World!Hello, World!"\n})\n')),(0,r.kt)("h2",{id:"writestring"},"WriteString"),(0,r.kt)("p",null,"WriteString adopts the string"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) WriteString(s string) (n int, err error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.WriteString("Hello, World!") // => "Hello, World!"\n\n fmt.Fprintf(c, "%s\\n", "Hello, World!") // "Hello, World!Hello, World!"\n})\n')),(0,r.kt)("h2",{id:"xhr"},"XHR"),(0,r.kt)("p",null,"A Boolean property, that is ",(0,r.kt)("inlineCode",{parentName:"p"},"true"),", if the request\u2019s ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers"},"X-Requested-With")," header field is ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest"},"XMLHttpRequest"),", indicating that the request was issued by a client library ","(","such as ",(0,r.kt)("a",{parentName:"p",href:"https://api.jquery.com/jQuery.ajax/"},"jQuery"),")","."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) XHR() bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// X-Requested-With: XMLHttpRequest\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.XHR() // true\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"xml"},"XML"),(0,r.kt)("p",null,"Converts any ",(0,r.kt)("strong",{parentName:"p"},"interface")," or ",(0,r.kt)("strong",{parentName:"p"},"string")," to XML using the standard ",(0,r.kt)("inlineCode",{parentName:"p"},"encoding/xml")," package."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"XML also sets the content header to ",(0,r.kt)("strong",{parentName:"p"},"application/xml"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) XML(data interface{}) error \n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'type SomeStruct struct {\n XMLName xml.Name `xml:"Fiber"`\n Name string `xml:"Name"`\n Age uint8 `xml:"Age"`\n}\n\napp.Get("/", func(c *fiber.Ctx) error {\n // Create data struct:\n data := SomeStruct{\n Name: "Grame",\n Age: 20,\n }\n\n return c.XML(data)\n // \n // Grame\n // 20\n // \n})\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5675],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>d});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=a.createContext({}),s=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},m=function(e){var t=s(e.components);return a.createElement(p.Provider,{value:t},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},g=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,p=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),u=s(n),g=r,d=u["".concat(p,".").concat(g)]||u[g]||c[g]||l;return n?a.createElement(d,i(i({ref:t},m),{},{components:n})):a.createElement(d,i({ref:t},m))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=g;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o[u]="string"==typeof e?e:r,i[1]=o;for(var s=2;s{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>i,default:()=>c,frontMatter:()=>l,metadata:()=>o,toc:()=>s});var a=n(7462),r=(n(7294),n(3905));const l={id:"ctx",title:"\ud83e\udde0 Ctx",description:"The Ctx struct represents the Context which hold the HTTP request and response. It has methods for the request query string, parameters, body, HTTP headers, and so on.",sidebar_position:3},i=void 0,o={unversionedId:"api/ctx",id:"api/ctx",title:"\ud83e\udde0 Ctx",description:"The Ctx struct represents the Context which hold the HTTP request and response. It has methods for the request query string, parameters, body, HTTP headers, and so on.",source:"@site/docs/core/api/ctx.md",sourceDirName:"api",slug:"/api/ctx",permalink:"/next/api/ctx",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/ctx.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:3,frontMatter:{id:"ctx",title:"\ud83e\udde0 Ctx",description:"The Ctx struct represents the Context which hold the HTTP request and response. It has methods for the request query string, parameters, body, HTTP headers, and so on.",sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\ud83d\ude80 App",permalink:"/next/api/app"},next:{title:"\ud83d\udccb Constants",permalink:"/next/api/constants"}},p={},s=[{value:"Accepts",id:"accepts",level:2},{value:"AllParams",id:"allparams",level:2},{value:"App",id:"app",level:2},{value:"Append",id:"append",level:2},{value:"Attachment",id:"attachment",level:2},{value:"BaseURL",id:"baseurl",level:2},{value:"Bind",id:"bind",level:2},{value:"Body",id:"body",level:2},{value:"BodyParser",id:"bodyparser",level:2},{value:"ClearCookie",id:"clearcookie",level:2},{value:"ClientHelloInfo",id:"clienthelloinfo",level:2},{value:"Context",id:"context",level:2},{value:"Cookie",id:"cookie",level:2},{value:"Cookies",id:"cookies",level:2},{value:"Download",id:"download",level:2},{value:"Format",id:"format",level:2},{value:"FormFile",id:"formfile",level:2},{value:"FormValue",id:"formvalue",level:2},{value:"Fresh",id:"fresh",level:2},{value:"Get",id:"get",level:2},{value:"GetReqHeaders",id:"getreqheaders",level:2},{value:"GetRespHeader",id:"getrespheader",level:2},{value:"GetRespHeaders",id:"getrespheaders",level:2},{value:"GetRouteURL",id:"getrouteurl",level:2},{value:"Hostname",id:"hostname",level:2},{value:"IP",id:"ip",level:2},{value:"IPs",id:"ips",level:2},{value:"Is",id:"is",level:2},{value:"IsFromLocal",id:"isfromlocal",level:2},{value:"JSON",id:"json",level:2},{value:"JSONP",id:"jsonp",level:2},{value:"Links",id:"links",level:2},{value:"Locals",id:"locals",level:2},{value:"Location",id:"location",level:2},{value:"Method",id:"method",level:2},{value:"MultipartForm",id:"multipartform",level:2},{value:"Next",id:"next",level:2},{value:"OriginalURL",id:"originalurl",level:2},{value:"Params",id:"params",level:2},{value:"ParamsInt",id:"paramsint",level:2},{value:"ParamsParser",id:"paramsparser",level:2},{value:"Path",id:"path",level:2},{value:"Protocol",id:"protocol",level:2},{value:"Queries",id:"queries",level:2},{value:"Query",id:"query",level:2},{value:"QueryBool",id:"querybool",level:2},{value:"QueryFloat",id:"queryfloat",level:2},{value:"QueryInt",id:"queryint",level:2},{value:"QueryParser",id:"queryparser",level:2},{value:"Range",id:"range",level:2},{value:"Redirect",id:"redirect",level:2},{value:"RedirectToRoute",id:"redirecttoroute",level:2},{value:"RedirectBack",id:"redirectback",level:2},{value:"Render",id:"render",level:2},{value:"Request",id:"request",level:2},{value:"ReqHeaderParser",id:"reqheaderparser",level:2},{value:"Response",id:"response",level:2},{value:"RestartRouting",id:"restartrouting",level:2},{value:"Route",id:"route",level:2},{value:"SaveFile",id:"savefile",level:2},{value:"SaveFileToStorage",id:"savefiletostorage",level:2},{value:"Secure",id:"secure",level:2},{value:"Send",id:"send",level:2},{value:"SendFile",id:"sendfile",level:2},{value:"SendStatus",id:"sendstatus",level:2},{value:"Set",id:"set",level:2},{value:"SetParserDecoder",id:"setparserdecoder",level:2},{value:"SetUserContext",id:"setusercontext",level:2},{value:"Stale",id:"stale",level:2},{value:"Status",id:"status",level:2},{value:"Subdomains",id:"subdomains",level:2},{value:"Type",id:"type",level:2},{value:"UserContext",id:"usercontext",level:2},{value:"Vary",id:"vary",level:2},{value:"Write",id:"write",level:2},{value:"Writef",id:"writef",level:2},{value:"WriteString",id:"writestring",level:2},{value:"XHR",id:"xhr",level:2},{value:"XML",id:"xml",level:2}],m={toc:s},u="wrapper";function c(e){let{components:t,...n}=e;return(0,r.kt)(u,(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"accepts"},"Accepts"),(0,r.kt)("p",null,"Checks, if the specified ",(0,r.kt)("strong",{parentName:"p"},"extensions")," or ",(0,r.kt)("strong",{parentName:"p"},"content")," ",(0,r.kt)("strong",{parentName:"p"},"types")," are acceptable."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Based on the request\u2019s ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept"},"Accept")," HTTP header.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Accepts(offers ...string) string\nfunc (c *Ctx) AcceptsCharsets(offers ...string) string\nfunc (c *Ctx) AcceptsEncodings(offers ...string) string\nfunc (c *Ctx) AcceptsLanguages(offers ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Accept: text/html, application/json; q=0.8, text/plain; q=0.5; charset="utf-8"\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Accepts("html") // "html"\n c.Accepts("text/html") // "text/html"\n c.Accepts("json", "text") // "json"\n c.Accepts("application/json") // "application/json"\n c.Accepts("text/plain", "application/json") // "application/json", due to quality\n c.Accepts("image/png") // ""\n c.Accepts("png") // ""\n // ...\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example 2"',title:'"Example','2"':!0},'// Accept: text/html, text/*, application/json, */*; q=0\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Accepts("text/plain", "application/json") // "application/json", due to specificity\n c.Accepts("application/json", "text/html") // "text/html", due to first match\n c.Accepts("image/png") // "", due to */* without q factor 0 is Not Acceptable\n // ...\n})\n')),(0,r.kt)("p",null,"Fiber provides similar functions for the other accept headers."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Accept-Charset: utf-8, iso-8859-1;q=0.2\n// Accept-Encoding: gzip, compress;q=0.2\n// Accept-Language: en;q=0.8, nl, ru\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.AcceptsCharsets("utf-16", "iso-8859-1") \n // "iso-8859-1"\n\n c.AcceptsEncodings("compress", "br") \n // "compress"\n\n c.AcceptsLanguages("pt", "nl", "ru") \n // "nl"\n // ...\n})\n')),(0,r.kt)("h2",{id:"allparams"},"AllParams"),(0,r.kt)("p",null,"Params is used to get all route parameters.\nUsing Params method to get params."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) AllParams() map[string]string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/user/fenny\napp.Get("/user/:name", func(c *fiber.Ctx) error {\n c.AllParams() // "{"name": "fenny"}"\n\n // ...\n})\n\n// GET http://example.com/user/fenny/123\napp.Get("/user/*", func(c *fiber.Ctx) error {\n c.AllParams() // "{"*1": "fenny/123"}"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"app"},"App"),(0,r.kt)("p",null,"Returns the ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},"*","App")," reference so you could easily access all application settings."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) App() *App\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/stack", func(c *fiber.Ctx) error {\n return c.JSON(c.App().Stack())\n})\n')),(0,r.kt)("h2",{id:"append"},"Append"),(0,r.kt)("p",null,"Appends the specified ",(0,r.kt)("strong",{parentName:"p"},"value")," to the HTTP response header field."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"If the header is ",(0,r.kt)("strong",{parentName:"p"},"not")," already set, it creates the header with the specified value.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Append(field string, values ...string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Append("Link", "http://google.com", "http://localhost")\n // => Link: http://localhost, http://google.com\n\n c.Append("Link", "Test")\n // => Link: http://localhost, http://google.com, Test\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"attachment"},"Attachment"),(0,r.kt)("p",null,"Sets the HTTP response ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition"},"Content-Disposition")," header field to ",(0,r.kt)("inlineCode",{parentName:"p"},"attachment"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Attachment(filename ...string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Attachment()\n // => Content-Disposition: attachment\n\n c.Attachment("./upload/images/logo.png")\n // => Content-Disposition: attachment; filename="logo.png"\n // => Content-Type: image/png\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"baseurl"},"BaseURL"),(0,r.kt)("p",null,"Returns the base URL ","(",(0,r.kt)("strong",{parentName:"p"},"protocol")," + ",(0,r.kt)("strong",{parentName:"p"},"host"),")"," as a ",(0,r.kt)("inlineCode",{parentName:"p"},"string"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) BaseURL() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET https://example.com/page#chapter-1\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.BaseURL() // https://example.com\n // ...\n})\n')),(0,r.kt)("h2",{id:"bind"},"Bind"),(0,r.kt)("p",null,"Add vars to default view var map binding to template engine.\nVariables are read by the Render method and may be overwritten."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Bind(vars Map) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Use(func(c *fiber.Ctx) error {\n c.Bind(fiber.Map{\n "Title": "Hello, World!",\n })\n})\n\napp.Get("/", func(c *fiber.Ctx) error {\n return c.Render("xxx.tmpl", fiber.Map{}) // Render will use Title variable\n})\n')),(0,r.kt)("h2",{id:"body"},"Body"),(0,r.kt)("p",null,"Returns the raw request ",(0,r.kt)("strong",{parentName:"p"},"body"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Body() []byte\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// curl -X POST http://localhost:8080 -d user=john\n\napp.Post("/", func(c *fiber.Ctx) error {\n // Get raw body from POST request:\n return c.Send(c.Body()) // []byte("user=john")\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"bodyparser"},"BodyParser"),(0,r.kt)("p",null,"Binds the request body to a struct."),(0,r.kt)("p",null,"It is important to specify the correct struct tag based on the content type to be parsed. For example, if you want to parse a JSON body with a field called Pass, you would use a struct field of ",(0,r.kt)("inlineCode",{parentName:"p"},'json:"pass"'),"."),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"content-type"),(0,r.kt)("th",{parentName:"tr",align:null},"struct tag"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"application/x-www-form-urlencoded")),(0,r.kt)("td",{parentName:"tr",align:null},"form")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"multipart/form-data")),(0,r.kt)("td",{parentName:"tr",align:null},"form")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"application/json")),(0,r.kt)("td",{parentName:"tr",align:null},"json")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"application/xml")),(0,r.kt)("td",{parentName:"tr",align:null},"xml")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"text/xml")),(0,r.kt)("td",{parentName:"tr",align:null},"xml")))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) BodyParser(out interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Field names should start with an uppercase letter\ntype Person struct {\n Name string `json:"name" xml:"name" form:"name"`\n Pass string `json:"pass" xml:"pass" form:"pass"`\n}\n\napp.Post("/", func(c *fiber.Ctx) error {\n p := new(Person)\n\n if err := c.BodyParser(p); err != nil {\n return err\n }\n\n log.Println(p.Name) // john\n log.Println(p.Pass) // doe\n\n // ...\n})\n\n// Run tests with the following curl commands\n\n// curl -X POST -H "Content-Type: application/json" --data "{\\"name\\":\\"john\\",\\"pass\\":\\"doe\\"}" localhost:3000\n\n// curl -X POST -H "Content-Type: application/xml" --data "johndoe" localhost:3000\n\n// curl -X POST -H "Content-Type: application/x-www-form-urlencoded" --data "name=john&pass=doe" localhost:3000\n\n// curl -X POST -F name=john -F pass=doe http://localhost:3000\n\n// curl -X POST "http://localhost:3000/?name=john&pass=doe"\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"clearcookie"},"ClearCookie"),(0,r.kt)("p",null,"Expire a client cookie ","(",(0,r.kt)("em",{parentName:"p"},"or all cookies if left empty",")")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) ClearCookie(key ...string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // Clears all cookies:\n c.ClearCookie()\n\n // Expire specific cookie by name:\n c.ClearCookie("user")\n\n // Expire multiple cookies by names:\n c.ClearCookie("token", "session", "track_id", "version")\n // ...\n})\n')),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Web browsers and other compliant clients will only clear the cookie if the given options are identical to those when creating the cookie, excluding expires and maxAge. ClearCookie will not set these values for you - a technique similar to the one shown below should be used to ensure your cookie is deleted.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/set", func(c *fiber.Ctx) error {\n c.Cookie(&fiber.Cookie{\n Name: "token",\n Value: "randomvalue",\n Expires: time.Now().Add(24 * time.Hour),\n HTTPOnly: true,\n SameSite: "lax",\n })\n\n // ...\n})\n\napp.Get("/delete", func(c *fiber.Ctx) error {\n c.Cookie(&fiber.Cookie{\n Name: "token",\n // Set expiry date to the past\n Expires: time.Now().Add(-(time.Hour * 2)),\n HTTPOnly: true,\n SameSite: "lax",\n })\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"clienthelloinfo"},"ClientHelloInfo"),(0,r.kt)("p",null,"ClientHelloInfo contains information from a ClientHello message in order to guide application logic in the GetCertificate and GetConfigForClient callbacks.\nYou can refer to the ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/pkg/crypto/tls/#ClientHelloInfo"},"ClientHelloInfo")," struct documentation for more information on the returned struct."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) ClientHelloInfo() *tls.ClientHelloInfo\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/hello\napp.Get("/hello", func(c *fiber.Ctx) error {\n chi := c.ClientHelloInfo()\n // ...\n})\n')),(0,r.kt)("h2",{id:"context"},"Context"),(0,r.kt)("p",null,"Returns ",(0,r.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/valyala/fasthttp#RequestCtx"},"*","fasthttp.RequestCtx")," that is compatible with the context.Context interface that requires a deadline, a cancellation signal, and other values across API boundaries."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Context() *fasthttp.RequestCtx\n")),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Please read the ",(0,r.kt)("a",{parentName:"p",href:"https://pkg.go.dev/github.com/valyala/fasthttp?tab=doc"},"Fasthttp Documentation")," for more information.")),(0,r.kt)("h2",{id:"cookie"},"Cookie"),(0,r.kt)("p",null,"Set cookie"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Cookie(cookie *Cookie)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'type Cookie struct {\n Name string `json:"name"`\n Value string `json:"value"`\n Path string `json:"path"`\n Domain string `json:"domain"`\n MaxAge int `json:"max_age"`\n Expires time.Time `json:"expires"`\n Secure bool `json:"secure"`\n HTTPOnly bool `json:"http_only"`\n SameSite string `json:"same_site"`\n SessionOnly bool `json:"session_only"`\n}\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // Create cookie\n cookie := new(fiber.Cookie)\n cookie.Name = "john"\n cookie.Value = "doe"\n cookie.Expires = time.Now().Add(24 * time.Hour)\n\n // Set cookie\n c.Cookie(cookie)\n // ...\n})\n')),(0,r.kt)("h2",{id:"cookies"},"Cookies"),(0,r.kt)("p",null,"Get cookie value by key, you could pass an optional default value that will be returned if the cookie key does not exist."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Cookies(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // Get cookie by key:\n c.Cookies("name") // "john"\n c.Cookies("empty", "doe") // "doe"\n // ...\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"download"},"Download"),(0,r.kt)("p",null,"Transfers the file from path as an ",(0,r.kt)("inlineCode",{parentName:"p"},"attachment"),"."),(0,r.kt)("p",null,"Typically, browsers will prompt the user to download. By default, the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition"},"Content-Disposition")," header ",(0,r.kt)("inlineCode",{parentName:"p"},"filename=")," parameter is the file path ","(",(0,r.kt)("em",{parentName:"p"},"this typically appears in the browser dialog"),")","."),(0,r.kt)("p",null,"Override this default with the ",(0,r.kt)("strong",{parentName:"p"},"filename")," parameter."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Download(file string, filename ...string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return c.Download("./files/report-12345.pdf");\n // => Download report-12345.pdf\n\n return c.Download("./files/report-12345.pdf", "report.pdf");\n // => Download report.pdf\n})\n')),(0,r.kt)("h2",{id:"format"},"Format"),(0,r.kt)("p",null,"Performs content-negotiation on the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept"},"Accept")," HTTP header. It uses ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#accepts"},"Accepts")," to select a proper format."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If the header is ",(0,r.kt)("strong",{parentName:"p"},"not")," specified or there is ",(0,r.kt)("strong",{parentName:"p"},"no")," proper format, ",(0,r.kt)("strong",{parentName:"p"},"text/plain")," is used.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Format(body interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // Accept: text/plain\n c.Format("Hello, World!")\n // => Hello, World!\n\n // Accept: text/html\n c.Format("Hello, World!")\n // =>

Hello, World!

\n\n // Accept: application/json\n c.Format("Hello, World!")\n // => "Hello, World!"\n // ..\n})\n')),(0,r.kt)("h2",{id:"formfile"},"FormFile"),(0,r.kt)("p",null,"MultipartForm files can be retrieved by name, the ",(0,r.kt)("strong",{parentName:"p"},"first")," file from the given key is returned."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) FormFile(key string) (*multipart.FileHeader, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n // Get first file from form field "document":\n file, err := c.FormFile("document")\n\n // Save file to root directory:\n return c.SaveFile(file, fmt.Sprintf("./%s", file.Filename))\n})\n')),(0,r.kt)("h2",{id:"formvalue"},"FormValue"),(0,r.kt)("p",null,"Any form values can be retrieved by name, the ",(0,r.kt)("strong",{parentName:"p"},"first")," value from the given key is returned."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) FormValue(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n // Get first value from form field "name":\n c.FormValue("name")\n // => "john" or "" if not exist\n\n // ..\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"fresh"},"Fresh"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://expressjs.com/en/4x/api.html#req.fresh"},"https://expressjs.com/en/4x/api.html","#","req.fresh")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Fresh() bool\n")),(0,r.kt)("h2",{id:"get"},"Get"),(0,r.kt)("p",null,"Returns the HTTP request header specified by the field."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"The match is ",(0,r.kt)("strong",{parentName:"p"},"case-insensitive"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Get(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Get("Content-Type") // "text/plain"\n c.Get("CoNtEnT-TypE") // "text/plain"\n c.Get("something", "john") // "john"\n // ..\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"getreqheaders"},"GetReqHeaders"),(0,r.kt)("p",null,"Returns the HTTP request headers."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) GetReqHeaders() map[string]string\n")),(0,r.kt)("h2",{id:"getrespheader"},"GetRespHeader"),(0,r.kt)("p",null,"Returns the HTTP response header specified by the field."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"The match is ",(0,r.kt)("strong",{parentName:"p"},"case-insensitive"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) GetRespHeader(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.GetRespHeader("X-Request-Id") // "8d7ad5e3-aaf3-450b-a241-2beb887efd54"\n c.GetRespHeader("Content-Type") // "text/plain"\n c.GetRespHeader("something", "john") // "john"\n // ..\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"getrespheaders"},"GetRespHeaders"),(0,r.kt)("p",null,"Returns the HTTP response headers."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) GetRespHeaders() map[string]string\n")),(0,r.kt)("h2",{id:"getrouteurl"},"GetRouteURL"),(0,r.kt)("p",null,'Generates URLs to named routes, with parameters. URLs are relative, for example: "/user/1831"'),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) GetRouteURL(routeName string, params Map) (string, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Home page")\n}).Name("home")\n\napp.Get("/user/:id", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("id"))\n}).Name("user.show")\n\napp.Get("/test", func(c *fiber.Ctx) error {\n location, _ := c.GetRouteURL("user.show", fiber.Map{"id": 1})\n return c.SendString(location)\n})\n\n// /test returns "/user/1"\n')),(0,r.kt)("h2",{id:"hostname"},"Hostname"),(0,r.kt)("p",null,"Returns the hostname derived from the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host"},"Host")," HTTP header."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Hostname() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://google.com/search\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Hostname() // "google.com"\n\n // ...\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"ip"},"IP"),(0,r.kt)("p",null,"Returns the remote IP address of the request."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) IP() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.IP() // "127.0.0.1"\n\n // ...\n})\n')),(0,r.kt)("p",null,"When registering the proxy request header in the fiber app, the ip address of the header is returned ",(0,r.kt)("a",{parentName:"p",href:"/next/api/fiber#config"},"(Fiber configuration)")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"app := fiber.New(fiber.Config{\n ProxyHeader: fiber.HeaderXForwardedFor,\n})\n")),(0,r.kt)("h2",{id:"ips"},"IPs"),(0,r.kt)("p",null,"Returns an array of IP addresses specified in the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For"},"X-Forwarded-For")," request header."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) IPs() []string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// X-Forwarded-For: proxy1, 127.0.0.1, proxy3\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.IPs() // ["proxy1", "127.0.0.1", "proxy3"]\n\n // ...\n})\n')),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Improper use of the X-Forwarded-For header can be a security risk. For details, see the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#security_and_privacy_concerns"},"Security and privacy concerns")," section.")),(0,r.kt)("h2",{id:"is"},"Is"),(0,r.kt)("p",null,"Returns the matching ",(0,r.kt)("strong",{parentName:"p"},"content type"),", if the incoming request\u2019s ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type"},"Content-Type")," HTTP header field matches the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/ru/docs/Web/HTTP/Basics_of_HTTP/MIME_types"},"MIME type")," specified by the type parameter."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If the request has ",(0,r.kt)("strong",{parentName:"p"},"no")," body, it returns ",(0,r.kt)("strong",{parentName:"p"},"false"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Is(extension string) bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Content-Type: text/html; charset=utf-8\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Is("html") // true\n c.Is(".html") // true\n c.Is("json") // false\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"isfromlocal"},"IsFromLocal"),(0,r.kt)("p",null,"Returns true if request came from localhost"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) IsFromLocal() bool {\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'\napp.Get("/", func(c *fiber.Ctx) error {\n // If request came from localhost, return true else return false\n c.IsFromLocal()\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"json"},"JSON"),(0,r.kt)("p",null,"Converts any ",(0,r.kt)("strong",{parentName:"p"},"interface")," or ",(0,r.kt)("strong",{parentName:"p"},"string")," to JSON using the ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/goccy/go-json"},"goccy/go-json")," package."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"JSON also sets the content header to ",(0,r.kt)("strong",{parentName:"p"},"application/json"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) JSON(data interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'type SomeStruct struct {\n Name string\n Age uint8\n}\n\napp.Get("/json", func(c *fiber.Ctx) error {\n // Create data struct:\n data := SomeStruct{\n Name: "Grame",\n Age: 20,\n }\n\n return c.JSON(data)\n // => Content-Type: application/json\n // => "{"Name": "Grame", "Age": 20}"\n\n return c.JSON(fiber.Map{\n "name": "Grame",\n "age": 20,\n })\n // => Content-Type: application/json\n // => "{"name": "Grame", "age": 20}"\n})\n')),(0,r.kt)("h2",{id:"jsonp"},"JSONP"),(0,r.kt)("p",null,"Sends a JSON response with JSONP support. This method is identical to ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#json"},"JSON"),", except that it opts-in to JSONP callback support. By default, the callback name is simply callback."),(0,r.kt)("p",null,"Override this by passing a ",(0,r.kt)("strong",{parentName:"p"},"named string")," in the method."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) JSONP(data interface{}, callback ...string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'type SomeStruct struct {\n name string\n age uint8\n}\n\napp.Get("/", func(c *fiber.Ctx) error {\n // Create data struct:\n data := SomeStruct{\n name: "Grame",\n age: 20,\n }\n\n return c.JSONP(data)\n // => callback({"name": "Grame", "age": 20})\n\n return c.JSONP(data, "customFunc")\n // => customFunc({"name": "Grame", "age": 20})\n})\n')),(0,r.kt)("h2",{id:"links"},"Links"),(0,r.kt)("p",null,"Joins the links followed by the property to populate the response\u2019s ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link"},"Link")," HTTP header field."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Links(link ...string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Links(\n "http://api.example.com/users?page=2", "next",\n "http://api.example.com/users?page=5", "last",\n )\n // Link: ; rel="next",\n // ; rel="last"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"locals"},"Locals"),(0,r.kt)("p",null,"A method that stores variables scoped to the request and, therefore, are available only to the routes that match the request."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"This is useful if you want to pass some ",(0,r.kt)("strong",{parentName:"p"},"specific")," data to the next middleware.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Locals(key interface{}, value ...interface{}) interface{}\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Use(func(c *fiber.Ctx) error {\n c.Locals("user", "admin")\n return c.Next()\n})\n\napp.Get("/admin", func(c *fiber.Ctx) error {\n if c.Locals("user") == "admin" {\n return c.Status(fiber.StatusOK).SendString("Welcome, admin!")\n }\n return c.SendStatus(fiber.StatusForbidden)\n\n})\n')),(0,r.kt)("h2",{id:"location"},"Location"),(0,r.kt)("p",null,"Sets the response ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/ru/docs/Web/HTTP/Headers/Location"},"Location")," HTTP header to the specified path parameter."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Location(path string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n c.Location("http://example.com")\n\n c.Location("/foo/bar")\n \n return nil\n})\n')),(0,r.kt)("h2",{id:"method"},"Method"),(0,r.kt)("p",null,"Returns a string corresponding to the HTTP method of the request: ",(0,r.kt)("inlineCode",{parentName:"p"},"GET"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"POST"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"PUT"),", and so on.",(0,r.kt)("br",{parentName:"p"}),"\n","Optionally, you could override the method by passing a string."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Method(override ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n c.Method() // "POST"\n\n c.Method("GET")\n c.Method() // GET\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"multipartform"},"MultipartForm"),(0,r.kt)("p",null,"To access multipart form entries, you can parse the binary with ",(0,r.kt)("inlineCode",{parentName:"p"},"MultipartForm()"),". This returns a ",(0,r.kt)("inlineCode",{parentName:"p"},"map[string][]string"),", so given a key, the value will be a string slice."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) MultipartForm() (*multipart.Form, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n // Parse the multipart form:\n if form, err := c.MultipartForm(); err == nil {\n // => *multipart.Form\n\n if token := form.Value["token"]; len(token) > 0 {\n // Get key value:\n fmt.Println(token[0])\n }\n\n // Get all files from "documents" key:\n files := form.File["documents"]\n // => []*multipart.FileHeader\n\n // Loop through files:\n for _, file := range files {\n fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])\n // => "tutorial.pdf" 360641 "application/pdf"\n\n // Save the files to disk:\n if err := c.SaveFile(file, fmt.Sprintf("./%s", file.Filename)); err != nil {\n return err\n }\n }\n }\n\n return err\n})\n')),(0,r.kt)("h2",{id:"next"},"Next"),(0,r.kt)("p",null,"When ",(0,r.kt)("strong",{parentName:"p"},"Next")," is called, it executes the next method in the stack that matches the current route. You can pass an error struct within the method that will end the chaining and call the ",(0,r.kt)("a",{parentName:"p",href:"https://docs.gofiber.io/guide/error-handling"},"error handler"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Next() error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n fmt.Println("1st route!")\n return c.Next()\n})\n\napp.Get("*", func(c *fiber.Ctx) error {\n fmt.Println("2nd route!")\n return c.Next()\n})\n\napp.Get("/", func(c *fiber.Ctx) error {\n fmt.Println("3rd route!")\n return c.SendString("Hello, World!")\n})\n')),(0,r.kt)("h2",{id:"originalurl"},"OriginalURL"),(0,r.kt)("p",null,"Returns the original request URL."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) OriginalURL() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/search?q=something\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.OriginalURL() // "/search?q=something"\n\n // ...\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"params"},"Params"),(0,r.kt)("p",null,"Method can be used to get the route parameters, you could pass an optional default value that will be returned if the param key does not exist."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Defaults to empty string ","(",(0,r.kt)("inlineCode",{parentName:"p"},'""'),")",", if the param ",(0,r.kt)("strong",{parentName:"p"},"doesn't")," exist.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Params(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/user/fenny\napp.Get("/user/:name", func(c *fiber.Ctx) error {\n c.Params("name") // "fenny"\n\n // ...\n})\n\n// GET http://example.com/user/fenny/123\napp.Get("/user/*", func(c *fiber.Ctx) error {\n c.Params("*") // "fenny/123"\n c.Params("*1") // "fenny/123"\n\n // ...\n})\n')),(0,r.kt)("p",null,"Unnamed route parameters","(","*",", +",")"," can be fetched by the ",(0,r.kt)("strong",{parentName:"p"},"character")," and the ",(0,r.kt)("strong",{parentName:"p"},"counter")," in the route."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// ROUTE: /v1/*/shop/*\n// GET: /v1/brand/4/shop/blue/xs\nc.Params("*1") // "brand/4"\nc.Params("*2") // "blue/xs"\n')),(0,r.kt)("p",null,"For reasons of ",(0,r.kt)("strong",{parentName:"p"},"downward compatibility"),", the first parameter segment for the parameter character can also be accessed without the counter."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/v1/*/shop/*", func(c *fiber.Ctx) error {\n c.Params("*") // outputs the values of the first wildcard segment\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"paramsint"},"ParamsInt"),(0,r.kt)("p",null,"Method can be used to get an integer from the route parameters.\nPlease note if that parameter is not in the request, zero\nwill be returned. If the parameter is NOT a number, zero and an error\nwill be returned"),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Defaults to the integer zero ","(",(0,r.kt)("inlineCode",{parentName:"p"},"0"),")",", if the param ",(0,r.kt)("strong",{parentName:"p"},"doesn't")," exist.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) ParamsInt(key string) (int, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/user/123\napp.Get("/user/:id", func(c *fiber.Ctx) error {\n id, err := c.ParamsInt("id") // int 123 and no error\n\n // ...\n})\n\n')),(0,r.kt)("p",null,"This method is equivalent of using ",(0,r.kt)("inlineCode",{parentName:"p"},"atoi")," with ctx.Params"),(0,r.kt)("h2",{id:"paramsparser"},"ParamsParser"),(0,r.kt)("p",null,'This method is similar to BodyParser, but for path parameters. It is important to use the struct tag "params". For example, if you want to parse a path parameter with a field called Pass, you would use a struct field of params:"pass"'),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) ParamsParser(out interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/user/111\napp.Get("/user/:id", func(c *fiber.Ctx) error {\n param := struct {ID uint `params:"id"`}{}\n \n c.ParamsParser(¶m) // "{"id": 111}"\n\n // ...\n})\n\n')),(0,r.kt)("h2",{id:"path"},"Path"),(0,r.kt)("p",null,"Contains the path part of the request URL. Optionally, you could override the path by passing a string. For internal redirects, you might want to call ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#restartrouting"},"RestartRouting")," instead of ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#next"},"Next"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Path(override ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/users?sort=desc\n\napp.Get("/users", func(c *fiber.Ctx) error {\n c.Path() // "/users"\n\n c.Path("/john")\n c.Path() // "/john"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"protocol"},"Protocol"),(0,r.kt)("p",null,"Contains the request protocol string: ",(0,r.kt)("inlineCode",{parentName:"p"},"http")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"https")," for ",(0,r.kt)("strong",{parentName:"p"},"TLS")," requests."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Protocol() string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Protocol() // "http"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"queries"},"Queries"),(0,r.kt)("p",null,"Queries is a function that returns an object containing a property for each query string parameter in the route."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Queries() map[string]string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?name=alex&want_pizza=false&id=\n\napp.Get("/", func(c *fiber.Ctx) error {\n m := c.Queries()\n m["name"] // "alex"\n m["want_pizza"] // "false"\n m["id"] // ""\n // ...\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?field1=value1&field1=value2&field2=value3\n\napp.Get("/", func (c *fiber.Ctx) error {\n m := c.Queries()\n m["field1"] // "value2"\n m["field2"] // value3\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?list_a=1&list_a=2&list_a=3&list_b[]=1&list_b[]=2&list_b[]=3&list_c=1,2,3\n\napp.Get("/", func(c *fiber.Ctx) error {\n m := c.Queries()\n m["list_a"] // "3"\n m["list_b[]"] // "3"\n m["list_c"] // "1,2,3"\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET /api/posts?filters.author.name=John&filters.category.name=Technology\n\napp.Get("/", func(c *fiber.Ctx) error {\n m := c.Queries()\n m["filters.author.name"] // John\n m["filters.category.name"] // Technology\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET /api/posts?tags=apple,orange,banana&filters[tags]=apple,orange,banana&filters[category][name]=fruits&filters.tags=apple,orange,banana&filters.category.name=fruits\n\napp.Get("/", func(c *fiber.Ctx) error {\n m := c.Queries()\n m["tags"] // apple,orange,banana\n m["filters[tags]"] // apple,orange,banana\n m["filters[category][name]"] // fruits\n m["filters.tags"] // apple,orange,banana\n m["filters.category.name"] // fruits\n})\n')),(0,r.kt)("h2",{id:"query"},"Query"),(0,r.kt)("p",null,"This property is an object containing a property for each query string parameter in the route, you could pass an optional default value that will be returned if the query key does not exist."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If there is ",(0,r.kt)("strong",{parentName:"p"},"no")," query string, it returns an ",(0,r.kt)("strong",{parentName:"p"},"empty string"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Query(key string, defaultValue ...string) string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?order=desc&brand=nike\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Query("order") // "desc"\n c.Query("brand") // "nike"\n c.Query("empty", "nike") // "nike"\n\n // ...\n})\n')),(0,r.kt)("blockquote",null,(0,r.kt)("p",{parentName:"blockquote"},(0,r.kt)("em",{parentName:"p"},"Returned value is only valid within the handler. Do not store any references.",(0,r.kt)("br",{parentName:"em"}),"Make copies or use the")," ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx"},(0,r.kt)("em",{parentName:"a"},(0,r.kt)("strong",{parentName:"em"},(0,r.kt)("inlineCode",{parentName:"strong"},"Immutable"))))," ",(0,r.kt)("em",{parentName:"p"},"setting instead.")," ",(0,r.kt)("a",{parentName:"p",href:"../#zero-allocation"},(0,r.kt)("em",{parentName:"a"},"Read more...")))),(0,r.kt)("h2",{id:"querybool"},"QueryBool"),(0,r.kt)("p",null,"This property is an object containing a property for each query boolean parameter in the route, you could pass an optional default value that will be returned if the query key does not exist."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Please note if that parameter is not in the request, false will be returned.\nIf the parameter is not a boolean, it is still tried to be converted and usually returned as false.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) QueryBool(key string, defaultValue ...bool) bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?name=alex&want_pizza=false&id=\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.QueryBool("want_pizza") // false\n c.QueryBool("want_pizza", true) // false\n c.QueryBool("name") // false\n c.QueryBool("name", true) // true\n c.QueryBool("id") // false\n c.QueryBool("id", true) // true\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"queryfloat"},"QueryFloat"),(0,r.kt)("p",null,"This property is an object containing a property for each query float64 parameter in the route, you could pass an optional default value that will be returned if the query key does not exist."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Please note if that parameter is not in the request, zero will be returned.\nIf the parameter is not a number, it is still tried to be converted and usually returned as 1.")),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Defaults to the float64 zero ","(",(0,r.kt)("inlineCode",{parentName:"p"},"0"),")",", if the param ",(0,r.kt)("strong",{parentName:"p"},"doesn't")," exist.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) QueryFloat(key string, defaultValue ...float64) float64\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?name=alex&amount=32.23&id=\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.QueryFloat("amount") // 32.23\n c.QueryFloat("amount", 3) // 32.23\n c.QueryFloat("name", 1) // 1\n c.QueryFloat("name") // 0\n c.QueryFloat("id", 3) // 3\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"queryint"},"QueryInt"),(0,r.kt)("p",null,"This property is an object containing a property for each query integer parameter in the route, you could pass an optional default value that will be returned if the query key does not exist."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Please note if that parameter is not in the request, zero will be returned.\nIf the parameter is not a number, it is still tried to be converted and usually returned as 1.")),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Defaults to the integer zero ","(",(0,r.kt)("inlineCode",{parentName:"p"},"0"),")",", if the param ",(0,r.kt)("strong",{parentName:"p"},"doesn't")," exist.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) QueryInt(key string, defaultValue ...int) int\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// GET http://example.com/?name=alex&wanna_cake=2&id=\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.QueryInt("wanna_cake", 1) // 2\n c.QueryInt("name", 1) // 1\n c.QueryInt("id", 1) // 1\n c.QueryInt("id") // 0\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"queryparser"},"QueryParser"),(0,r.kt)("p",null,"This method is similar to ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#bodyparser"},"BodyParser"),', but for query parameters.\nIt is important to use the struct tag "query". For example, if you want to parse a query parameter with a field called Pass, you would use a struct field of ',(0,r.kt)("inlineCode",{parentName:"p"},'query:"pass"'),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) QueryParser(out interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Field names should start with an uppercase letter\ntype Person struct {\n Name string `query:"name"`\n Pass string `query:"pass"`\n Products []string `query:"products"`\n}\n\napp.Get("/", func(c *fiber.Ctx) error {\n p := new(Person)\n\n if err := c.QueryParser(p); err != nil {\n return err\n }\n\n log.Println(p.Name) // john\n log.Println(p.Pass) // doe\n log.Println(p.Products) // [shoe, hat]\n\n // ...\n})\n// Run tests with the following curl command\n\n// curl "http://localhost:3000/?name=john&pass=doe&products=shoe,hat"\n')),(0,r.kt)("h2",{id:"range"},"Range"),(0,r.kt)("p",null,"A struct containing the type and a slice of ranges will be returned."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Range(size int) (Range, error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Range: bytes=500-700, 700-900\napp.Get("/", func(c *fiber.Ctx) error {\n b := c.Range(1000)\n if b.Type == "bytes" {\n for r := range r.Ranges {\n fmt.Println(r)\n // [500, 700]\n }\n }\n})\n')),(0,r.kt)("h2",{id:"redirect"},"Redirect"),(0,r.kt)("p",null,"Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If ",(0,r.kt)("strong",{parentName:"p"},"not")," specified, status defaults to ",(0,r.kt)("strong",{parentName:"p"},"302 Found"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Redirect(location string, status ...int) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/coffee", func(c *fiber.Ctx) error {\n return c.Redirect("/teapot")\n})\n\napp.Get("/teapot", func(c *fiber.Ctx) error {\n return c.Status(fiber.StatusTeapot).Send("\ud83c\udf75 short and stout \ud83c\udf75")\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="More examples"',title:'"More','examples"':!0},'app.Get("/", func(c *fiber.Ctx) error {\n return c.Redirect("/foo/bar")\n return c.Redirect("../login")\n return c.Redirect("http://example.com")\n return c.Redirect("http://example.com", 301)\n})\n')),(0,r.kt)("h2",{id:"redirecttoroute"},"RedirectToRoute"),(0,r.kt)("p",null,"Redirects to the specific route along with the parameters and with specified status, a positive integer that corresponds to an HTTP status code."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If ",(0,r.kt)("strong",{parentName:"p"},"not")," specified, status defaults to ",(0,r.kt)("strong",{parentName:"p"},"302 Found"),".")),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If you want to send queries to route, you must add ",(0,r.kt)("strong",{parentName:"p"},'"queries"')," key typed as ",(0,r.kt)("strong",{parentName:"p"},"map","[string]","string")," to params.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) RedirectToRoute(routeName string, params fiber.Map, status ...int) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // /user/fiber\n return c.RedirectToRoute("user", fiber.Map{\n "name": "fiber"\n })\n})\n\napp.Get("/with-queries", func(c *fiber.Ctx) error {\n // /user/fiber?data[0][name]=john&data[0][age]=10&test=doe\n return c.RedirectToRoute("user", fiber.Map{\n "name": "fiber",\n "queries": map[string]string{"data[0][name]": "john", "data[0][age]": "10", "test": "doe"},\n })\n})\n\napp.Get("/user/:name", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("name"))\n}).Name("user")\n')),(0,r.kt)("h2",{id:"redirectback"},"RedirectBack"),(0,r.kt)("p",null,"Redirects back to refer URL. It redirects to fallback URL if refer header doesn't exists, with specified status, a positive integer that corresponds to an HTTP status code."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If ",(0,r.kt)("strong",{parentName:"p"},"not")," specified, status defaults to ",(0,r.kt)("strong",{parentName:"p"},"302 Found"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) RedirectBack(fallback string, status ...int) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Home page")\n})\napp.Get("/test", func(c *fiber.Ctx) error {\n c.Set("Content-Type", "text/html")\n return c.SendString(`Back`)\n})\n\napp.Get("/back", func(c *fiber.Ctx) error {\n return c.RedirectBack("/")\n})\n')),(0,r.kt)("h2",{id:"render"},"Render"),(0,r.kt)("p",null,"Renders a view with data and sends a ",(0,r.kt)("inlineCode",{parentName:"p"},"text/html")," response. By default ",(0,r.kt)("inlineCode",{parentName:"p"},"Render")," uses the default ",(0,r.kt)("a",{parentName:"p",href:"https://pkg.go.dev/html/template/"},(0,r.kt)("strong",{parentName:"a"},"Go Template engine")),". If you want to use another View engine, please take a look at our ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/gofiber/template"},(0,r.kt)("strong",{parentName:"a"},"Template middleware")),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Render(name string, bind interface{}, layouts ...string) error\n")),(0,r.kt)("h2",{id:"request"},"Request"),(0,r.kt)("p",null,"Request return the ",(0,r.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/valyala/fasthttp#Request"},"*","fasthttp.Request")," pointer"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Request() *fasthttp.Request\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Request().Header.Method()\n // => []byte("GET")\n})\n')),(0,r.kt)("h2",{id:"reqheaderparser"},"ReqHeaderParser"),(0,r.kt)("p",null,"This method is similar to ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#bodyparser"},"BodyParser"),', but for request headers.\nIt is important to use the struct tag "reqHeader". For example, if you want to parse a request header with a field called Pass, you would use a struct field of ',(0,r.kt)("inlineCode",{parentName:"p"},'reqHeader:"pass"'),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) ReqHeaderParser(out interface{}) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Field names should start with an uppercase letter\ntype Person struct {\n Name string `reqHeader:"name"`\n Pass string `reqHeader:"pass"`\n Products []string `reqHeader:"products"`\n}\n\napp.Get("/", func(c *fiber.Ctx) error {\n p := new(Person)\n\n if err := c.ReqHeaderParser(p); err != nil {\n return err\n }\n\n log.Println(p.Name) // john\n log.Println(p.Pass) // doe\n log.Println(p.Products) // [shoe, hat]\n\n // ...\n})\n// Run tests with the following curl command\n\n// curl "http://localhost:3000/" -H "name: john" -H "pass: doe" -H "products: shoe,hat"\n')),(0,r.kt)("h2",{id:"response"},"Response"),(0,r.kt)("p",null,"Response return the ",(0,r.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/valyala/fasthttp#Response"},"*","fasthttp.Response")," pointer"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Response() *fasthttp.Response\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Response().BodyWriter().Write([]byte("Hello, World!"))\n // => "Hello, World!"\n return nil\n})\n')),(0,r.kt)("h2",{id:"restartrouting"},"RestartRouting"),(0,r.kt)("p",null,"Instead of executing the next method when calling ",(0,r.kt)("a",{parentName:"p",href:"/next/api/ctx#next"},"Next"),", ",(0,r.kt)("strong",{parentName:"p"},"RestartRouting")," restarts execution from the first method that matches the current route. This may be helpful after overriding the path, i. e. an internal redirect. Note that handlers might be executed again which could result in an infinite loop."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) RestartRouting() error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/new", func(c *fiber.Ctx) error {\n return c.SendString("From /new")\n})\n\napp.Get("/old", func(c *fiber.Ctx) error {\n c.Path("/new")\n return c.RestartRouting()\n})\n')),(0,r.kt)("h2",{id:"route"},"Route"),(0,r.kt)("p",null,"Returns the matched ",(0,r.kt)("a",{parentName:"p",href:"https://pkg.go.dev/github.com/gofiber/fiber?tab=doc#Route"},"Route")," struct."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Route() *Route\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// http://localhost:8080/hello\n\n\napp.Get("/hello/:name", func(c *fiber.Ctx) error {\n r := c.Route()\n fmt.Println(r.Method, r.Path, r.Params, r.Handlers)\n // GET /hello/:name handler [name] \n\n // ...\n})\n')),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Do not rely on ",(0,r.kt)("inlineCode",{parentName:"p"},"c.Route()")," in middlewares ",(0,r.kt)("strong",{parentName:"p"},"before")," calling ",(0,r.kt)("inlineCode",{parentName:"p"},"c.Next()")," - ",(0,r.kt)("inlineCode",{parentName:"p"},"c.Route()")," returns the ",(0,r.kt)("strong",{parentName:"p"},"last executed route"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"func MyMiddleware() fiber.Handler {\n return func(c *fiber.Ctx) error {\n beforeNext := c.Route().Path // Will be '/'\n err := c.Next()\n afterNext := c.Route().Path // Will be '/hello/:name'\n return err\n }\n}\n")),(0,r.kt)("h2",{id:"savefile"},"SaveFile"),(0,r.kt)("p",null,"Method is used to save ",(0,r.kt)("strong",{parentName:"p"},"any")," multipart file to disk."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) SaveFile(fh *multipart.FileHeader, path string) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Post("/", func(c *fiber.Ctx) error {\n // Parse the multipart form:\n if form, err := c.MultipartForm(); err == nil {\n // => *multipart.Form\n\n // Get all files from "documents" key:\n files := form.File["documents"]\n // => []*multipart.FileHeader\n\n // Loop through files:\n for _, file := range files {\n fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])\n // => "tutorial.pdf" 360641 "application/pdf"\n\n // Save the files to disk:\n if err := c.SaveFile(file, fmt.Sprintf("./%s", file.Filename)); err != nil {\n return err\n }\n }\n return err\n }\n})\n')),(0,r.kt)("h2",{id:"savefiletostorage"},"SaveFileToStorage"),(0,r.kt)("p",null,"Method is used to save ",(0,r.kt)("strong",{parentName:"p"},"any")," multipart file to an external storage system."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) SaveFileToStorage(fileheader *multipart.FileHeader, path string, storage Storage) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'storage := memory.New()\n\napp.Post("/", func(c *fiber.Ctx) error {\n // Parse the multipart form:\n if form, err := c.MultipartForm(); err == nil {\n // => *multipart.Form\n\n // Get all files from "documents" key:\n files := form.File["documents"]\n // => []*multipart.FileHeader\n\n // Loop through files:\n for _, file := range files {\n fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])\n // => "tutorial.pdf" 360641 "application/pdf"\n\n // Save the files to storage:\n if err := c.SaveFileToStorage(file, fmt.Sprintf("./%s", file.Filename), storage); err != nil {\n return err\n }\n }\n return err\n }\n})\n')),(0,r.kt)("h2",{id:"secure"},"Secure"),(0,r.kt)("p",null,"A boolean property that is ",(0,r.kt)("inlineCode",{parentName:"p"},"true")," , if a ",(0,r.kt)("strong",{parentName:"p"},"TLS")," connection is established."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Secure() bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Secure() method is equivalent to:\nc.Protocol() == "https"\n')),(0,r.kt)("h2",{id:"send"},"Send"),(0,r.kt)("p",null,"Sets the HTTP response body."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Send(body []byte) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return c.Send([]byte("Hello, World!")) // => "Hello, World!"\n})\n')),(0,r.kt)("p",null,"Fiber also provides ",(0,r.kt)("inlineCode",{parentName:"p"},"SendString")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"SendStream")," methods for raw inputs."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Use this if you ",(0,r.kt)("strong",{parentName:"p"},"don't need")," type assertion, recommended for ",(0,r.kt)("strong",{parentName:"p"},"faster")," performance.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) SendString(body string) error\nfunc (c *Ctx) SendStream(stream io.Reader, size ...int) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n // => "Hello, World!"\n\n return c.SendStream(bytes.NewReader([]byte("Hello, World!")))\n // => "Hello, World!"\n})\n')),(0,r.kt)("h2",{id:"sendfile"},"SendFile"),(0,r.kt)("p",null,"Transfers the file from the given path. Sets the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type"},"Content-Type")," response HTTP header field based on the ",(0,r.kt)("strong",{parentName:"p"},"filenames")," extension."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Method doesn\xb4t use ",(0,r.kt)("strong",{parentName:"p"},"gzipping")," by default, set it to ",(0,r.kt)("strong",{parentName:"p"},"true")," to enable.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature" title="Signature"',title:'"Signature"'},"func (c *Ctx) SendFile(file string, compress ...bool) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/not-found", func(c *fiber.Ctx) error {\n return c.SendFile("./public/404.html");\n\n // Disable compression\n return c.SendFile("./static/index.html", false);\n})\n')),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"If the file contains an url specific character you have to escape it before passing the file path into the ",(0,r.kt)("inlineCode",{parentName:"p"},"sendFile")," function.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/file-with-url-chars", func(c *fiber.Ctx) error {\n return c.SendFile(url.PathEscape("hash_sign_#.txt"))\n})\n')),(0,r.kt)("h2",{id:"sendstatus"},"SendStatus"),(0,r.kt)("p",null,"Sets the status code and the correct status message in the body, if the response body is ",(0,r.kt)("strong",{parentName:"p"},"empty"),"."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"You can find all used status codes and messages ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber/blob/dffab20bcdf4f3597d2c74633a7705a517d2c8c2/utils.go#L183-L244"},"here"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) SendStatus(status int) error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/not-found", func(c *fiber.Ctx) error {\n return c.SendStatus(415)\n // => 415 "Unsupported Media Type"\n\n c.SendString("Hello, World!")\n return c.SendStatus(415)\n // => 415 "Hello, World!"\n})\n')),(0,r.kt)("h2",{id:"set"},"Set"),(0,r.kt)("p",null,"Sets the response\u2019s HTTP header field to the specified ",(0,r.kt)("inlineCode",{parentName:"p"},"key"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"value"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Set(key string, val string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Set("Content-Type", "text/plain")\n // => "Content-type: text/plain"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"setparserdecoder"},"SetParserDecoder"),(0,r.kt)("p",null,"Allow you to config BodyParser/QueryParser decoder, base on schema's options, providing possibility to add custom type for parsing."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func SetParserDecoder(parserConfig fiber.ParserConfig{\n IgnoreUnknownKeys bool,\n ParserType []fiber.ParserType{\n Customtype interface{},\n Converter func(string) reflect.Value,\n },\n ZeroEmpty bool,\n SetAliasTag string,\n})\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'\ntype CustomTime time.Time\n\n// String() returns the time in string\nfunc (ct *CustomTime) String() string {\n t := time.Time(*ct).String()\n return t\n}\n\n// Register the converter for CustomTime type format as 2006-01-02\nvar timeConverter = func(value string) reflect.Value {\n fmt.Println("timeConverter", value)\n if v, err := time.Parse("2006-01-02", value); err == nil {\n return reflect.ValueOf(v)\n }\n return reflect.Value{}\n}\n\ncustomTime := fiber.ParserType{\n Customtype: CustomTime{},\n Converter: timeConverter,\n} \n\n// Add setting to the Decoder\nfiber.SetParserDecoder(fiber.ParserConfig{\n IgnoreUnknownKeys: true,\n ParserType: []fiber.ParserType{customTime},\n ZeroEmpty: true,\n})\n\n// Example to use CustomType, you pause custom time format not in RFC3339\ntype Demo struct {\n Date CustomTime `form:"date" query:"date"`\n Title string `form:"title" query:"title"`\n Body string `form:"body" query:"body"`\n}\n\napp.Post("/body", func(c *fiber.Ctx) error {\n var d Demo\n c.BodyParser(&d)\n fmt.Println("d.Date", d.Date.String())\n return c.JSON(d)\n})\n\napp.Get("/query", func(c *fiber.Ctx) error {\n var d Demo\n c.QueryParser(&d)\n fmt.Println("d.Date", d.Date.String())\n return c.JSON(d)\n})\n\n// curl -X POST -F title=title -F body=body -F date=2021-10-20 http://localhost:3000/body\n\n// curl -X GET "http://localhost:3000/query?title=title&body=body&date=2021-10-20"\n\n')),(0,r.kt)("h2",{id:"setusercontext"},"SetUserContext"),(0,r.kt)("p",null,"Sets the user specified implementation for context interface."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) SetUserContext(ctx context.Context)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n ctx := context.Background()\n c.SetUserContext(ctx)\n // Here ctx could be any context implementation\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"stale"},"Stale"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://expressjs.com/en/4x/api.html#req.stale"},"https://expressjs.com/en/4x/api.html","#","req.stale")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Stale() bool\n")),(0,r.kt)("h2",{id:"status"},"Status"),(0,r.kt)("p",null,"Sets the HTTP status for the response."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Method is a ",(0,r.kt)("strong",{parentName:"p"},"chainable"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Status(status int) *Ctx\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/fiber", func(c *fiber.Ctx) error {\n c.Status(fiber.StatusOK)\n return nil\n}\n\napp.Get("/hello", func(c *fiber.Ctx) error {\n return c.Status(fiber.StatusBadRequest).SendString("Bad Request")\n}\n\napp.Get("/world", func(c *fiber.Ctx) error {\n return c.Status(fiber.StatusNotFound).SendFile("./public/gopher.png")\n})\n')),(0,r.kt)("h2",{id:"subdomains"},"Subdomains"),(0,r.kt)("p",null,"Returns a string slice of subdomains in the domain name of the request."),(0,r.kt)("p",null,"The application property subdomain offset, which defaults to ",(0,r.kt)("inlineCode",{parentName:"p"},"2"),", is used for determining the beginning of the subdomain segments."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Subdomains(offset ...int) []string\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Host: "tobi.ferrets.example.com"\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Subdomains() // ["ferrets", "tobi"]\n c.Subdomains(1) // ["tobi"]\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"type"},"Type"),(0,r.kt)("p",null,"Sets the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type"},"Content-Type")," HTTP header to the MIME type listed ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/nginx/nginx/blob/master/conf/mime.types"},"here")," specified by the file ",(0,r.kt)("strong",{parentName:"p"},"extension"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Type(ext string, charset ...string) *Ctx\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Type(".html") // => "text/html"\n c.Type("html") // => "text/html"\n c.Type("png") // => "image/png"\n\n c.Type("json", "utf-8") // => "application/json; charset=utf-8"\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"usercontext"},"UserContext"),(0,r.kt)("p",null,"UserContext returns a context implementation that was set by user earlier\nor returns a non-nil, empty context, if it was not set earlier."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) UserContext() context.Context\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n ctx := c.UserContext()\n // ctx is context implementation set by user\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"vary"},"Vary"),(0,r.kt)("p",null,"Adds the given header field to the ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary"},"Vary")," response header. This will append the header, if not already listed, otherwise leaves it listed in the current location."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Multiple fields are ",(0,r.kt)("strong",{parentName:"p"},"allowed"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Vary(fields ...string)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Vary("Origin") // => Vary: Origin\n c.Vary("User-Agent") // => Vary: Origin, User-Agent\n\n // No duplicates\n c.Vary("Origin") // => Vary: Origin, User-Agent\n\n c.Vary("Accept-Encoding", "Accept")\n // => Vary: Origin, User-Agent, Accept-Encoding, Accept\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"write"},"Write"),(0,r.kt)("p",null,"Write adopts the Writer interface"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Write(p []byte) (n int, err error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.Write([]byte("Hello, World!")) // => "Hello, World!"\n\n fmt.Fprintf(c, "%s\\n", "Hello, World!") // "Hello, World!Hello, World!"\n})\n')),(0,r.kt)("h2",{id:"writef"},"Writef"),(0,r.kt)("p",null,"Writef adopts the string with variables"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) Writef(f string, a ...interface{}) (n int, err error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n world := "World!"\n c.Writef("Hello, %s", world) // => "Hello, World!"\n\n fmt.Fprintf(c, "%s\\n", "Hello, World!") // "Hello, World!Hello, World!"\n})\n')),(0,r.kt)("h2",{id:"writestring"},"WriteString"),(0,r.kt)("p",null,"WriteString adopts the string"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) WriteString(s string) (n int, err error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n c.WriteString("Hello, World!") // => "Hello, World!"\n\n fmt.Fprintf(c, "%s\\n", "Hello, World!") // "Hello, World!Hello, World!"\n})\n')),(0,r.kt)("h2",{id:"xhr"},"XHR"),(0,r.kt)("p",null,"A Boolean property, that is ",(0,r.kt)("inlineCode",{parentName:"p"},"true"),", if the request\u2019s ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers"},"X-Requested-With")," header field is ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest"},"XMLHttpRequest"),", indicating that the request was issued by a client library ","(","such as ",(0,r.kt)("a",{parentName:"p",href:"https://api.jquery.com/jQuery.ajax/"},"jQuery"),")","."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) XHR() bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// X-Requested-With: XMLHttpRequest\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.XHR() // true\n\n // ...\n})\n')),(0,r.kt)("h2",{id:"xml"},"XML"),(0,r.kt)("p",null,"Converts any ",(0,r.kt)("strong",{parentName:"p"},"interface")," or ",(0,r.kt)("strong",{parentName:"p"},"string")," to XML using the standard ",(0,r.kt)("inlineCode",{parentName:"p"},"encoding/xml")," package."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"XML also sets the content header to ",(0,r.kt)("strong",{parentName:"p"},"application/xml"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (c *Ctx) XML(data interface{}) error \n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'type SomeStruct struct {\n XMLName xml.Name `xml:"Fiber"`\n Name string `xml:"Name"`\n Age uint8 `xml:"Age"`\n}\n\napp.Get("/", func(c *fiber.Ctx) error {\n // Create data struct:\n data := SomeStruct{\n Name: "Grame",\n Age: 20,\n }\n\n return c.XML(data)\n // \n // Grame\n // 20\n // \n})\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2930693d.1be6c394.js b/assets/js/2930693d.c0846eb0.js similarity index 98% rename from assets/js/2930693d.1be6c394.js rename to assets/js/2930693d.c0846eb0.js index 16904ce5dd4..58dd63957cc 100644 --- a/assets/js/2930693d.1be6c394.js +++ b/assets/js/2930693d.c0846eb0.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1889],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>f});var o=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=o.createContext({}),g=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=g(e.components);return o.createElement(s.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},m=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),p=g(n),m=r,f=p["".concat(s,".").concat(m)]||p[m]||c[m]||a;return n?o.createElement(f,i(i({ref:t},u),{},{components:n})):o.createElement(f,i({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:r,i[1]=l;for(var g=2;g{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>c,frontMatter:()=>a,metadata:()=>l,toc:()=>g});var o=n(7462),r=(n(7294),n(3905));const a={id:"mongodb",title:"MongoDB"},i=void 0,l={unversionedId:"mongodb/mongodb",id:"mongodb/mongodb",title:"MongoDB",description:"Release",source:"@site/docs/storage/mongodb/README.md",sourceDirName:"mongodb",slug:"/mongodb/",permalink:"/storage/mongodb/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/mongodb/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"mongodb",title:"MongoDB"},sidebar:"tutorialSidebar",previous:{title:"Memory",permalink:"/storage/memory/"},next:{title:"MSSQL",permalink:"/storage/mssql/"}},s={},g=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],u={toc:g},p="wrapper";function c(e){let{components:t,...n}=e;return(0,r.kt)(p,(0,o.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=mongodb*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-mongodb.yml?label=Tests",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,r.kt)("p",null,"A MongoDB storage driver using ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/mongodb/mongo-go-driver"},"mongodb/mongo-go-driver"),"."),(0,r.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,r.kt)("h3",{id:"signatures"},"Signatures"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *mongo.Database\n")),(0,r.kt)("h3",{id:"installation"},"Installation"),(0,r.kt)("p",null,"MongoDB is tested on the 2 last ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,r.kt)("p",null,"And then install the mongodb implementation:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/mongodb\n")),(0,r.kt)("h3",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Import the storage package."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/mongodb"\n')),(0,r.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := mongodb.New()\n\n// Initialize custom config\nstore := mongodb.New(mongodb.Config{\n Host: "127.0.0.1",\n Port: 27017,\n Database: "fiber",\n Collection: "fiber_storage",\n Reset: false,\n})\n\n// Initialize custom config using connection string\nstore := mongodb.New(mongodb.Config{\n ConnectionURI: "mongodb://user:password@127.0.0.1:27017",\n Database: "fiber",\n Collection: "fiber_storage",\n Reset: false,\n})\n\n')),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Connection string to use for DB. Will override all other authentication values if used\n //\n // Optional. Default is ""\n ConnectionURI string\n\n // Host name where the DB is hosted\n //\n // Optional. Default is "127.0.0.1"\n Host string\n\n // Port where the DB is listening on\n //\n // Optional. Default is 27017\n Port int\n\n // Server username\n //\n // Optional. Default is ""\n Username string\n\n // Server password\n //\n // Optional. Default is ""\n Password string\n\n // Database name\n //\n // Optional. Default is "fiber"\n Database string\n\n // Collection name\n //\n // Optional. Default is "fiber_storage"\n Collection string\n\n // Reset clears any existing keys in existing Table\n //\n // Optional. Default is false\n Reset bool\n}\n')),(0,r.kt)("h3",{id:"default-config"},"Default Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n ConnectionURI: "",\n Host: "127.0.0.1",\n Port: 27017,\n Database: "fiber",\n Collection: "fiber_storage",\n Reset: false,\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1889],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>f});var o=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=o.createContext({}),g=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=g(e.components);return o.createElement(s.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},m=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),p=g(n),m=r,f=p["".concat(s,".").concat(m)]||p[m]||c[m]||a;return n?o.createElement(f,i(i({ref:t},u),{},{components:n})):o.createElement(f,i({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:r,i[1]=l;for(var g=2;g{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>c,frontMatter:()=>a,metadata:()=>l,toc:()=>g});var o=n(7462),r=(n(7294),n(3905));const a={id:"mongodb",title:"MongoDB"},i=void 0,l={unversionedId:"mongodb/mongodb",id:"mongodb/mongodb",title:"MongoDB",description:"Release",source:"@site/docs/storage/mongodb/README.md",sourceDirName:"mongodb",slug:"/mongodb/",permalink:"/storage/mongodb/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/mongodb/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"mongodb",title:"MongoDB"},sidebar:"tutorialSidebar",previous:{title:"Memory",permalink:"/storage/memory/"},next:{title:"MSSQL",permalink:"/storage/mssql/"}},s={},g=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],u={toc:g},p="wrapper";function c(e){let{components:t,...n}=e;return(0,r.kt)(p,(0,o.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=mongodb*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-mongodb.yml?label=Tests",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,r.kt)("p",null,"A MongoDB storage driver using ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/mongodb/mongo-go-driver"},"mongodb/mongo-go-driver"),"."),(0,r.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,r.kt)("h3",{id:"signatures"},"Signatures"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *mongo.Database\n")),(0,r.kt)("h3",{id:"installation"},"Installation"),(0,r.kt)("p",null,"MongoDB is tested on the 2 last ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,r.kt)("p",null,"And then install the mongodb implementation:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/mongodb\n")),(0,r.kt)("h3",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Import the storage package."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/mongodb"\n')),(0,r.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := mongodb.New()\n\n// Initialize custom config\nstore := mongodb.New(mongodb.Config{\n Host: "127.0.0.1",\n Port: 27017,\n Database: "fiber",\n Collection: "fiber_storage",\n Reset: false,\n})\n\n// Initialize custom config using connection string\nstore := mongodb.New(mongodb.Config{\n ConnectionURI: "mongodb://user:password@127.0.0.1:27017",\n Database: "fiber",\n Collection: "fiber_storage",\n Reset: false,\n})\n\n')),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Connection string to use for DB. Will override all other authentication values if used\n //\n // Optional. Default is ""\n ConnectionURI string\n\n // Host name where the DB is hosted\n //\n // Optional. Default is "127.0.0.1"\n Host string\n\n // Port where the DB is listening on\n //\n // Optional. Default is 27017\n Port int\n\n // Server username\n //\n // Optional. Default is ""\n Username string\n\n // Server password\n //\n // Optional. Default is ""\n Password string\n\n // Database name\n //\n // Optional. Default is "fiber"\n Database string\n\n // Collection name\n //\n // Optional. Default is "fiber_storage"\n Collection string\n\n // Reset clears any existing keys in existing Table\n //\n // Optional. Default is false\n Reset bool\n}\n')),(0,r.kt)("h3",{id:"default-config"},"Default Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n ConnectionURI: "",\n Host: "127.0.0.1",\n Port: 27017,\n Database: "fiber",\n Collection: "fiber_storage",\n Reset: false,\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/29b92cdb.3d4bbc8b.js b/assets/js/29b92cdb.c97a76be.js similarity index 98% rename from assets/js/29b92cdb.3d4bbc8b.js rename to assets/js/29b92cdb.c97a76be.js index af4606464a8..9966bb22e86 100644 --- a/assets/js/29b92cdb.3d4bbc8b.js +++ b/assets/js/29b92cdb.c97a76be.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[4118],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>d});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var p=n.createContext({}),s=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},c=function(e){var t=s(e.components);return n.createElement(p.Provider,{value:t},e.children)},u="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,p=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=s(r),m=o,d=u["".concat(p,".").concat(m)]||u[m]||f[m]||a;return r?n.createElement(d,i(i({ref:t},c),{},{components:r})):n.createElement(d,i({ref:t},c))}));function d(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=m;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[u]="string"==typeof e?e:o,i[1]=l;for(var s=2;s{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>i,default:()=>f,frontMatter:()=>a,metadata:()=>l,toc:()=>s});var n=r(7462),o=(r(7294),r(3905));const a={id:"otelfiber-example",title:"Example"},i=void 0,l={unversionedId:"otelfiber/example/otelfiber-example",id:"otelfiber/example/otelfiber-example",title:"Example",description:"An HTTP server using gofiber fiber and instrumentation. The server has a",source:"@site/docs/contrib/otelfiber/example/README.md",sourceDirName:"otelfiber/example",slug:"/otelfiber/example/",permalink:"/contrib/otelfiber/example/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/otelfiber/example/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"otelfiber-example",title:"Example"},sidebar:"tutorialSidebar",previous:{title:"Otelfiber",permalink:"/contrib/otelfiber/"},next:{title:"Paseto",permalink:"/contrib/paseto/"}},p={},s=[],c={toc:s},u="wrapper";function f(e){let{components:t,...r}=e;return(0,o.kt)(u,(0,n.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"An HTTP server using gofiber fiber and instrumentation. The server has a\n",(0,o.kt)("inlineCode",{parentName:"p"},"/users/:id")," endpoint. The server generates span information to\n",(0,o.kt)("inlineCode",{parentName:"p"},"stdout"),"."),(0,o.kt)("p",null,"These instructions expect you have\n",(0,o.kt)("a",{parentName:"p",href:"https://docs.docker.com/compose/"},"docker-compose")," installed."),(0,o.kt)("p",null,"Bring up the ",(0,o.kt)("inlineCode",{parentName:"p"},"fiber-server")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"fiber-client")," services to run the\nexample:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"docker-compose up --detach fiber-server fiber-client\n")),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"fiber-client")," service sends just one HTTP request to ",(0,o.kt)("inlineCode",{parentName:"p"},"fiber-server"),"\nand then exits. View the span generated by ",(0,o.kt)("inlineCode",{parentName:"p"},"fiber-server")," in the logs:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"docker-compose logs fiber-server\n")),(0,o.kt)("p",null,"Shut down the services when you are finished with the example:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"docker-compose down\n")))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[4118],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>d});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var p=n.createContext({}),s=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},c=function(e){var t=s(e.components);return n.createElement(p.Provider,{value:t},e.children)},u="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,p=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=s(r),m=o,d=u["".concat(p,".").concat(m)]||u[m]||f[m]||a;return r?n.createElement(d,i(i({ref:t},c),{},{components:r})):n.createElement(d,i({ref:t},c))}));function d(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=m;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[u]="string"==typeof e?e:o,i[1]=l;for(var s=2;s{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>i,default:()=>f,frontMatter:()=>a,metadata:()=>l,toc:()=>s});var n=r(7462),o=(r(7294),r(3905));const a={id:"otelfiber-example",title:"Example"},i=void 0,l={unversionedId:"otelfiber/example/otelfiber-example",id:"otelfiber/example/otelfiber-example",title:"Example",description:"An HTTP server using gofiber fiber and instrumentation. The server has a",source:"@site/docs/contrib/otelfiber/example/README.md",sourceDirName:"otelfiber/example",slug:"/otelfiber/example/",permalink:"/contrib/otelfiber/example/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/otelfiber/example/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"otelfiber-example",title:"Example"},sidebar:"tutorialSidebar",previous:{title:"Otelfiber",permalink:"/contrib/otelfiber/"},next:{title:"Paseto",permalink:"/contrib/paseto/"}},p={},s=[],c={toc:s},u="wrapper";function f(e){let{components:t,...r}=e;return(0,o.kt)(u,(0,n.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"An HTTP server using gofiber fiber and instrumentation. The server has a\n",(0,o.kt)("inlineCode",{parentName:"p"},"/users/:id")," endpoint. The server generates span information to\n",(0,o.kt)("inlineCode",{parentName:"p"},"stdout"),"."),(0,o.kt)("p",null,"These instructions expect you have\n",(0,o.kt)("a",{parentName:"p",href:"https://docs.docker.com/compose/"},"docker-compose")," installed."),(0,o.kt)("p",null,"Bring up the ",(0,o.kt)("inlineCode",{parentName:"p"},"fiber-server")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"fiber-client")," services to run the\nexample:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"docker-compose up --detach fiber-server fiber-client\n")),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"fiber-client")," service sends just one HTTP request to ",(0,o.kt)("inlineCode",{parentName:"p"},"fiber-server"),"\nand then exits. View the span generated by ",(0,o.kt)("inlineCode",{parentName:"p"},"fiber-server")," in the logs:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"docker-compose logs fiber-server\n")),(0,o.kt)("p",null,"Shut down the services when you are finished with the example:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"docker-compose down\n")))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2a83b683.1f64dab7.js b/assets/js/2a83b683.fd6ba795.js similarity index 99% rename from assets/js/2a83b683.1f64dab7.js rename to assets/js/2a83b683.fd6ba795.js index 70012ea468a..8675e1754ce 100644 --- a/assets/js/2a83b683.1f64dab7.js +++ b/assets/js/2a83b683.fd6ba795.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9801],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>d});var r=t(7294);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var l=r.createContext({}),u=function(e){var n=r.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},c=function(e){var n=u(e.components);return r.createElement(l.Provider,{value:n},e.children)},p="mdxType",f={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},m=r.forwardRef((function(e,n){var t=e.components,o=e.mdxType,s=e.originalType,l=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),p=u(t),m=o,d=p["".concat(l,".").concat(m)]||p[m]||f[m]||s;return t?r.createElement(d,a(a({ref:n},c),{},{components:t})):r.createElement(d,a({ref:n},c))}));function d(e,n){var t=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var s=t.length,a=new Array(s);a[0]=m;var i={};for(var l in n)hasOwnProperty.call(n,l)&&(i[l]=n[l]);i.originalType=e,i[p]="string"==typeof e?e:o,a[1]=i;for(var u=2;u{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>f,frontMatter:()=>s,metadata:()=>i,toc:()=>u});var r=t(7462),o=(t(7294),t(3905));const s={id:"session",title:"Session"},a=void 0,i={unversionedId:"api/middleware/session",id:"api/middleware/session",title:"Session",description:"Session middleware for Fiber.",source:"@site/docs/core/api/middleware/session.md",sourceDirName:"api/middleware",slug:"/api/middleware/session",permalink:"/next/api/middleware/session",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/session.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"session",title:"Session"},sidebar:"tutorialSidebar",previous:{title:"Rewrite",permalink:"/next/api/middleware/rewrite"},next:{title:"Skip",permalink:"/next/api/middleware/skip"}},l={},u=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Constants",id:"constants",level:2},{value:"Custom Storage/Database",id:"custom-storagedatabase",level:3}],c={toc:u},p="wrapper";function f(e){let{components:n,...t}=e;return(0,o.kt)(p,(0,r.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"Session middleware for ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber"),"."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"This middleware uses our ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage"},"Storage")," package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.")),(0,o.kt)("h2",{id:"signatures"},"Signatures"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) *Store\nfunc (s *Store) RegisterType(i interface{})\nfunc (s *Store) Get(c *fiber.Ctx) (*Session, error)\nfunc (s *Store) Reset() error\n\nfunc (s *Session) Get(key string) interface{}\nfunc (s *Session) Set(key string, val interface{})\nfunc (s *Session) Delete(key string)\nfunc (s *Session) Destroy() error\nfunc (s *Session) Regenerate() error\nfunc (s *Session) Save() error\nfunc (s *Session) Fresh() bool\nfunc (s *Session) ID() string\nfunc (s *Session) Keys() []string\n")),(0,o.kt)("admonition",{type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Storing ",(0,o.kt)("inlineCode",{parentName:"p"},"interface{}")," values are limited to built-ins Go types.")),(0,o.kt)("h2",{id:"examples"},"Examples"),(0,o.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/session"\n)\n')),(0,o.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\n// This stores all of your app\'s sessions\nstore := session.New()\n\napp.Get("/", func(c *fiber.Ctx) error {\n // Get session from storage\n sess, err := store.Get(c)\n if err != nil {\n panic(err)\n }\n\n // Get value\n name := sess.Get("name")\n\n // Set key/value\n sess.Set("name", "john")\n\n // Get all Keys\n keys := sess.Keys()\n\n // Delete key\n sess.Delete("name")\n\n // Destroy session\n if err := sess.Destroy(); err != nil {\n panic(err)\n }\n\n // Sets a specific expiration for this session\n sess.SetExpiry(time.Second * 2)\n\n // Save session\n if err := sess.Save(); err != nil {\n panic(err)\n }\n\n return c.SendString(fmt.Sprintf("Welcome %v", name))\n})\n')),(0,o.kt)("h2",{id:"config"},"Config"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Allowed session duration\n // Optional. Default value 24 * time.Hour\n Expiration time.Duration\n\n // Storage interface to store the session data\n // Optional. Default value memory.New()\n Storage fiber.Storage\n\n // KeyLookup is a string in the form of ":" that is used\n // to extract session id from the request.\n // Possible values: "header:", "query:" or "cookie:"\n // Optional. Default value "cookie:session_id".\n KeyLookup string\n\n // Domain of the CSRF cookie.\n // Optional. Default value "".\n CookieDomain string\n\n // Path of the CSRF cookie.\n // Optional. Default value "".\n CookiePath string\n\n // Indicates if CSRF cookie is secure.\n // Optional. Default value false.\n CookieSecure bool\n\n // Indicates if CSRF cookie is HTTP only.\n // Optional. Default value false.\n CookieHTTPOnly bool\n\n // Value of SameSite cookie.\n // Optional. Default value "Lax".\n CookieSameSite string\n\n // Decides whether cookie should last for only the browser sesison.\n // Ignores Expiration if set to true\n // Optional. Default value false.\n CookieSessionOnly bool\n\n // KeyGenerator generates the session key.\n // Optional. Default value utils.UUIDv4\n KeyGenerator func() string\n\n // Deprecated: Please use KeyLookup\n CookieName string\n\n // Source defines where to obtain the session id\n source Source\n\n // The session name\n sessionName string\n}\n')),(0,o.kt)("h2",{id:"default-config"},"Default Config"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Expiration: 24 * time.Hour,\n KeyLookup: "cookie:session_id",\n KeyGenerator: utils.UUIDv4,\n source: "cookie",\n sessionName: "session_id",\n}\n')),(0,o.kt)("h2",{id:"constants"},"Constants"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'const (\n SourceCookie Source = "cookie"\n SourceHeader Source = "header"\n SourceURLQuery Source = "query"\n)\n')),(0,o.kt)("h3",{id:"custom-storagedatabase"},"Custom Storage/Database"),(0,o.kt)("p",null,"You can use any storage from our ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage/"},"storage")," package."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3\nstore := session.New(session.Config{\n Storage: storage,\n})\n")),(0,o.kt)("p",null,"To use the store, see the ",(0,o.kt)("a",{parentName:"p",href:"#examples"},"Examples"),"."))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9801],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>d});var r=t(7294);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var l=r.createContext({}),u=function(e){var n=r.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},c=function(e){var n=u(e.components);return r.createElement(l.Provider,{value:n},e.children)},p="mdxType",f={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},m=r.forwardRef((function(e,n){var t=e.components,o=e.mdxType,s=e.originalType,l=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),p=u(t),m=o,d=p["".concat(l,".").concat(m)]||p[m]||f[m]||s;return t?r.createElement(d,a(a({ref:n},c),{},{components:t})):r.createElement(d,a({ref:n},c))}));function d(e,n){var t=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var s=t.length,a=new Array(s);a[0]=m;var i={};for(var l in n)hasOwnProperty.call(n,l)&&(i[l]=n[l]);i.originalType=e,i[p]="string"==typeof e?e:o,a[1]=i;for(var u=2;u{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>f,frontMatter:()=>s,metadata:()=>i,toc:()=>u});var r=t(7462),o=(t(7294),t(3905));const s={id:"session",title:"Session"},a=void 0,i={unversionedId:"api/middleware/session",id:"api/middleware/session",title:"Session",description:"Session middleware for Fiber.",source:"@site/docs/core/api/middleware/session.md",sourceDirName:"api/middleware",slug:"/api/middleware/session",permalink:"/next/api/middleware/session",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/session.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"session",title:"Session"},sidebar:"tutorialSidebar",previous:{title:"Rewrite",permalink:"/next/api/middleware/rewrite"},next:{title:"Skip",permalink:"/next/api/middleware/skip"}},l={},u=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Constants",id:"constants",level:2},{value:"Custom Storage/Database",id:"custom-storagedatabase",level:3}],c={toc:u},p="wrapper";function f(e){let{components:n,...t}=e;return(0,o.kt)(p,(0,r.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"Session middleware for ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber"),"."),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"This middleware uses our ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage"},"Storage")," package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.")),(0,o.kt)("h2",{id:"signatures"},"Signatures"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) *Store\nfunc (s *Store) RegisterType(i interface{})\nfunc (s *Store) Get(c *fiber.Ctx) (*Session, error)\nfunc (s *Store) Reset() error\n\nfunc (s *Session) Get(key string) interface{}\nfunc (s *Session) Set(key string, val interface{})\nfunc (s *Session) Delete(key string)\nfunc (s *Session) Destroy() error\nfunc (s *Session) Regenerate() error\nfunc (s *Session) Save() error\nfunc (s *Session) Fresh() bool\nfunc (s *Session) ID() string\nfunc (s *Session) Keys() []string\n")),(0,o.kt)("admonition",{type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"Storing ",(0,o.kt)("inlineCode",{parentName:"p"},"interface{}")," values are limited to built-ins Go types.")),(0,o.kt)("h2",{id:"examples"},"Examples"),(0,o.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/session"\n)\n')),(0,o.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\n// This stores all of your app\'s sessions\nstore := session.New()\n\napp.Get("/", func(c *fiber.Ctx) error {\n // Get session from storage\n sess, err := store.Get(c)\n if err != nil {\n panic(err)\n }\n\n // Get value\n name := sess.Get("name")\n\n // Set key/value\n sess.Set("name", "john")\n\n // Get all Keys\n keys := sess.Keys()\n\n // Delete key\n sess.Delete("name")\n\n // Destroy session\n if err := sess.Destroy(); err != nil {\n panic(err)\n }\n\n // Sets a specific expiration for this session\n sess.SetExpiry(time.Second * 2)\n\n // Save session\n if err := sess.Save(); err != nil {\n panic(err)\n }\n\n return c.SendString(fmt.Sprintf("Welcome %v", name))\n})\n')),(0,o.kt)("h2",{id:"config"},"Config"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Allowed session duration\n // Optional. Default value 24 * time.Hour\n Expiration time.Duration\n\n // Storage interface to store the session data\n // Optional. Default value memory.New()\n Storage fiber.Storage\n\n // KeyLookup is a string in the form of ":" that is used\n // to extract session id from the request.\n // Possible values: "header:", "query:" or "cookie:"\n // Optional. Default value "cookie:session_id".\n KeyLookup string\n\n // Domain of the CSRF cookie.\n // Optional. Default value "".\n CookieDomain string\n\n // Path of the CSRF cookie.\n // Optional. Default value "".\n CookiePath string\n\n // Indicates if CSRF cookie is secure.\n // Optional. Default value false.\n CookieSecure bool\n\n // Indicates if CSRF cookie is HTTP only.\n // Optional. Default value false.\n CookieHTTPOnly bool\n\n // Value of SameSite cookie.\n // Optional. Default value "Lax".\n CookieSameSite string\n\n // Decides whether cookie should last for only the browser sesison.\n // Ignores Expiration if set to true\n // Optional. Default value false.\n CookieSessionOnly bool\n\n // KeyGenerator generates the session key.\n // Optional. Default value utils.UUIDv4\n KeyGenerator func() string\n\n // Deprecated: Please use KeyLookup\n CookieName string\n\n // Source defines where to obtain the session id\n source Source\n\n // The session name\n sessionName string\n}\n')),(0,o.kt)("h2",{id:"default-config"},"Default Config"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Expiration: 24 * time.Hour,\n KeyLookup: "cookie:session_id",\n KeyGenerator: utils.UUIDv4,\n source: "cookie",\n sessionName: "session_id",\n}\n')),(0,o.kt)("h2",{id:"constants"},"Constants"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'const (\n SourceCookie Source = "cookie"\n SourceHeader Source = "header"\n SourceURLQuery Source = "query"\n)\n')),(0,o.kt)("h3",{id:"custom-storagedatabase"},"Custom Storage/Database"),(0,o.kt)("p",null,"You can use any storage from our ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage/"},"storage")," package."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3\nstore := session.New(session.Config{\n Storage: storage,\n})\n")),(0,o.kt)("p",null,"To use the store, see the ",(0,o.kt)("a",{parentName:"p",href:"#examples"},"Examples"),"."))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2ab216cb.38930db4.js b/assets/js/2ab216cb.621467ae.js similarity index 99% rename from assets/js/2ab216cb.38930db4.js rename to assets/js/2ab216cb.621467ae.js index af8660cf259..fd057a3ce75 100644 --- a/assets/js/2ab216cb.38930db4.js +++ b/assets/js/2ab216cb.621467ae.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[4435],{3905:(e,n,t)=>{t.d(n,{Zo:()=>p,kt:()=>f});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function u(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var i=r.createContext({}),s=function(e){var n=r.useContext(i),t=n;return e&&(t="function"==typeof e?e(n):u(u({},n),e)),t},p=function(e){var n=s(e.components);return r.createElement(i.Provider,{value:n},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),c=s(t),d=a,f=c["".concat(i,".").concat(d)]||c[d]||m[d]||o;return t?r.createElement(f,u(u({ref:n},p),{},{components:t})):r.createElement(f,u({ref:n},p))}));function f(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var o=t.length,u=new Array(o);u[0]=d;var l={};for(var i in n)hasOwnProperty.call(n,i)&&(l[i]=n[i]);l.originalType=e,l[c]="string"==typeof e?e:a,u[1]=l;for(var s=2;s{t.d(n,{Z:()=>u});var r=t(7294),a=t(6010);const o={tabItem:"tabItem_Ymn6"};function u(e){let{children:n,hidden:t,className:u}=e;return r.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,u),hidden:t},n)}},4866:(e,n,t)=>{t.d(n,{Z:()=>y});var r=t(7462),a=t(7294),o=t(6010),u=t(2466),l=t(6550),i=t(1980),s=t(7392),p=t(12);function c(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:a}}=e;return{value:n,label:t,attributes:r,default:a}}))}function m(e){const{values:n,children:t}=e;return(0,a.useMemo)((()=>{const e=n??c(t);return function(e){const n=(0,s.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function d(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function f(e){let{queryString:n=!1,groupId:t}=e;const r=(0,l.k6)(),o=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(o),(0,a.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(r.location.search);n.set(o,e),r.replace({...r.location,search:n.toString()})}),[o,r])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,o=m(e),[u,l]=(0,a.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!d({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:o}))),[i,s]=f({queryString:t,groupId:r}),[c,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,o]=(0,p.Nk)(t);return[r,(0,a.useCallback)((e=>{t&&o.set(e)}),[t,o])]}({groupId:r}),h=(()=>{const e=i??c;return d({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{h&&l(h)}),[h]);return{selectedValue:u,selectValue:(0,a.useCallback)((e=>{if(!d({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);l(e),s(e),g(e)}),[s,g,o]),tabValues:o}}var h=t(2389);const k={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function b(e){let{className:n,block:t,selectedValue:l,selectValue:i,tabValues:s}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,u.o5)(),m=e=>{const n=e.currentTarget,t=p.indexOf(n),r=s[t].value;r!==l&&(c(n),i(r))},d=e=>{let n=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const t=p.indexOf(e.currentTarget)+1;n=p[t]??p[0];break}case"ArrowLeft":{const t=p.indexOf(e.currentTarget)-1;n=p[t]??p[p.length-1];break}}n?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},n)},s.map((e=>{let{value:n,label:t,attributes:u}=e;return a.createElement("li",(0,r.Z)({role:"tab",tabIndex:l===n?0:-1,"aria-selected":l===n,key:n,ref:e=>p.push(e),onKeyDown:d,onClick:m},u,{className:(0,o.Z)("tabs__item",k.tabItem,u?.className,{"tabs__item--active":l===n})}),t??n)})))}function O(e){let{lazy:n,children:t,selectedValue:r}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===r));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,n)=>(0,a.cloneElement)(e,{key:n,hidden:e.props.value!==r}))))}function N(e){const n=g(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",k.tabList)},a.createElement(b,(0,r.Z)({},e,n)),a.createElement(O,(0,r.Z)({},e,n)))}function y(e){const n=(0,h.Z)();return a.createElement(N,(0,r.Z)({key:String(n)},e))}},9415:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>i,default:()=>f,frontMatter:()=>l,metadata:()=>s,toc:()=>c});var r=t(7462),a=(t(7294),t(3905)),o=t(4866),u=t(5162);const l={id:"hooks",title:"\ud83e\ude9d Hooks",sidebar_position:6},i=void 0,s={unversionedId:"guide/hooks",id:"guide/hooks",title:"\ud83e\ude9d Hooks",description:"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:",source:"@site/docs/core/guide/hooks.md",sourceDirName:"guide",slug:"/guide/hooks",permalink:"/next/guide/hooks",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/hooks.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:6,frontMatter:{id:"hooks",title:"\ud83e\ude9d Hooks",sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0e Validation",permalink:"/next/guide/validation"},next:{title:"\u26a1 Make Fiber Faster",permalink:"/next/guide/faster-fiber"}},p={},c=[{value:"Constants",id:"constants",level:2},{value:"OnRoute",id:"onroute",level:2},{value:"OnName",id:"onname",level:2},{value:"OnGroup",id:"ongroup",level:2},{value:"OnGroupName",id:"ongroupname",level:2},{value:"OnListen",id:"onlisten",level:2},{value:"OnFork",id:"onfork",level:2},{value:"OnShutdown",id:"onshutdown",level:2},{value:"OnMount",id:"onmount",level:2}],m={toc:c},d="wrapper";function f(e){let{components:n,...t}=e;return(0,a.kt)(d,(0,r.Z)({},m,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onroute"},"OnRoute")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onname"},"OnName")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#ongroup"},"OnGroup")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#ongroupname"},"OnGroupName")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onlisten"},"OnListen")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onfork"},"OnFork")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onshutdown"},"OnShutdown")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onmount"},"OnMount"))),(0,a.kt)("h2",{id:"constants"},"Constants"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Handlers define a function to create hooks for Fiber.\ntype OnRouteHandler = func(Route) error\ntype OnNameHandler = OnRouteHandler\ntype OnGroupHandler = func(Group) error\ntype OnGroupNameHandler = OnGroupHandler\ntype OnListenHandler = func(ListenData) error\ntype OnForkHandler = func(int) error\ntype OnShutdownHandler = func() error\ntype OnMountHandler = func(*App) error\n")),(0,a.kt)("h2",{id:"onroute"},"OnRoute"),(0,a.kt)("p",null,"OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by ",(0,a.kt)("strong",{parentName:"p"},"route")," parameter."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnRoute(handler ...OnRouteHandler)\n")),(0,a.kt)("h2",{id:"onname"},"OnName"),(0,a.kt)("p",null,"OnName is a hook to execute user functions on each route naming. Also you can get route properties by ",(0,a.kt)("strong",{parentName:"p"},"route")," parameter."),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnName only works with naming routes, not groups.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnName(handler ...OnNameHandler)\n")),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(u.Z,{value:"onname-example",label:"OnName Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n\n "github.com/gofiber/fiber/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("index")\n\n app.Hooks().OnName(func(r fiber.Route) error {\n fmt.Print("Name: " + r.Name + ", ")\n\n return nil\n })\n\n app.Hooks().OnName(func(r fiber.Route) error {\n fmt.Print("Method: " + r.Method + "\\n")\n\n return nil\n })\n\n app.Get("/add/user", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("addUser")\n\n app.Delete("/destroy/user", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("destroyUser")\n\n app.Listen(":5000")\n}\n\n// Results:\n// Name: addUser, Method: GET\n// Name: destroyUser, Method: DELETE\n')))),(0,a.kt)("h2",{id:"ongroup"},"OnGroup"),(0,a.kt)("p",null,"OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by ",(0,a.kt)("strong",{parentName:"p"},"group")," parameter."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnGroup(handler ...OnGroupHandler)\n")),(0,a.kt)("h2",{id:"ongroupname"},"OnGroupName"),(0,a.kt)("p",null,"OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by ",(0,a.kt)("strong",{parentName:"p"},"group")," parameter."),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnGroupName only works with naming groups, not routes.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnGroupName(handler ...OnGroupNameHandler)\n")),(0,a.kt)("h2",{id:"onlisten"},"OnListen"),(0,a.kt)("p",null,"OnListen is a hook to execute user functions on Listen, ListenTLS, Listener."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnListen(handler ...OnListenHandler)\n")),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(u.Z,{value:"onlisten-example",label:"OnListen Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app := fiber.New(fiber.Config{\n DisableStartupMessage: true,\n})\n\napp.Hooks().OnListen(func(listenData fiber.ListenData) error {\n if fiber.IsChild() {\n return nil\n }\n scheme := "http"\n if data.TLS {\n scheme = "https"\n }\n log.Println(scheme + "://" + listenData.Host + ":" + listenData.Port)\n return nil\n})\n\napp.Listen(":5000")\n')))),(0,a.kt)("h2",{id:"onfork"},"OnFork"),(0,a.kt)("p",null,"OnFork is a hook to execute user functions on Fork."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnFork(handler ...OnForkHandler)\n")),(0,a.kt)("h2",{id:"onshutdown"},"OnShutdown"),(0,a.kt)("p",null,"OnShutdown is a hook to execute user functions after Shutdown."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnShutdown(handler ...OnShutdownHandler)\n")),(0,a.kt)("h2",{id:"onmount"},"OnMount"),(0,a.kt)("p",null,"OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (h *Hooks) OnMount(handler ...OnMountHandler) \n")),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(u.Z,{value:"onmount-example",label:"OnMount Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n\n "github.com/gofiber/fiber/v2"\n)\n\nfunc main() {\n app := New()\n app.Get("/", testSimpleHandler).Name("x")\n\n subApp := New()\n subApp.Get("/test", testSimpleHandler)\n\n subApp.Hooks().OnMount(func(parent *fiber.App) error {\n fmt.Print("Mount path of parent app: "+parent.MountPath())\n // ...\n\n return nil\n })\n\n app.Mount("/sub", subApp)\n}\n\n// Result:\n// Mount path of parent app: \n')))),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.")))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[4435],{3905:(e,n,t)=>{t.d(n,{Zo:()=>p,kt:()=>f});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function u(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var i=r.createContext({}),s=function(e){var n=r.useContext(i),t=n;return e&&(t="function"==typeof e?e(n):u(u({},n),e)),t},p=function(e){var n=s(e.components);return r.createElement(i.Provider,{value:n},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),c=s(t),d=a,f=c["".concat(i,".").concat(d)]||c[d]||m[d]||o;return t?r.createElement(f,u(u({ref:n},p),{},{components:t})):r.createElement(f,u({ref:n},p))}));function f(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var o=t.length,u=new Array(o);u[0]=d;var l={};for(var i in n)hasOwnProperty.call(n,i)&&(l[i]=n[i]);l.originalType=e,l[c]="string"==typeof e?e:a,u[1]=l;for(var s=2;s{t.d(n,{Z:()=>u});var r=t(7294),a=t(6010);const o={tabItem:"tabItem_Ymn6"};function u(e){let{children:n,hidden:t,className:u}=e;return r.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,u),hidden:t},n)}},4866:(e,n,t)=>{t.d(n,{Z:()=>y});var r=t(7462),a=t(7294),o=t(6010),u=t(2466),l=t(6550),i=t(1980),s=t(7392),p=t(12);function c(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:a}}=e;return{value:n,label:t,attributes:r,default:a}}))}function m(e){const{values:n,children:t}=e;return(0,a.useMemo)((()=>{const e=n??c(t);return function(e){const n=(0,s.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function d(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function f(e){let{queryString:n=!1,groupId:t}=e;const r=(0,l.k6)(),o=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(o),(0,a.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(r.location.search);n.set(o,e),r.replace({...r.location,search:n.toString()})}),[o,r])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,o=m(e),[u,l]=(0,a.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!d({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:o}))),[i,s]=f({queryString:t,groupId:r}),[c,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,o]=(0,p.Nk)(t);return[r,(0,a.useCallback)((e=>{t&&o.set(e)}),[t,o])]}({groupId:r}),h=(()=>{const e=i??c;return d({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{h&&l(h)}),[h]);return{selectedValue:u,selectValue:(0,a.useCallback)((e=>{if(!d({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);l(e),s(e),g(e)}),[s,g,o]),tabValues:o}}var h=t(2389);const k={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function b(e){let{className:n,block:t,selectedValue:l,selectValue:i,tabValues:s}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,u.o5)(),m=e=>{const n=e.currentTarget,t=p.indexOf(n),r=s[t].value;r!==l&&(c(n),i(r))},d=e=>{let n=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const t=p.indexOf(e.currentTarget)+1;n=p[t]??p[0];break}case"ArrowLeft":{const t=p.indexOf(e.currentTarget)-1;n=p[t]??p[p.length-1];break}}n?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},n)},s.map((e=>{let{value:n,label:t,attributes:u}=e;return a.createElement("li",(0,r.Z)({role:"tab",tabIndex:l===n?0:-1,"aria-selected":l===n,key:n,ref:e=>p.push(e),onKeyDown:d,onClick:m},u,{className:(0,o.Z)("tabs__item",k.tabItem,u?.className,{"tabs__item--active":l===n})}),t??n)})))}function O(e){let{lazy:n,children:t,selectedValue:r}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===r));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,n)=>(0,a.cloneElement)(e,{key:n,hidden:e.props.value!==r}))))}function N(e){const n=g(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",k.tabList)},a.createElement(b,(0,r.Z)({},e,n)),a.createElement(O,(0,r.Z)({},e,n)))}function y(e){const n=(0,h.Z)();return a.createElement(N,(0,r.Z)({key:String(n)},e))}},9415:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>i,default:()=>f,frontMatter:()=>l,metadata:()=>s,toc:()=>c});var r=t(7462),a=(t(7294),t(3905)),o=t(4866),u=t(5162);const l={id:"hooks",title:"\ud83e\ude9d Hooks",sidebar_position:6},i=void 0,s={unversionedId:"guide/hooks",id:"guide/hooks",title:"\ud83e\ude9d Hooks",description:"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:",source:"@site/docs/core/guide/hooks.md",sourceDirName:"guide",slug:"/guide/hooks",permalink:"/next/guide/hooks",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/hooks.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:6,frontMatter:{id:"hooks",title:"\ud83e\ude9d Hooks",sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0e Validation",permalink:"/next/guide/validation"},next:{title:"\u26a1 Make Fiber Faster",permalink:"/next/guide/faster-fiber"}},p={},c=[{value:"Constants",id:"constants",level:2},{value:"OnRoute",id:"onroute",level:2},{value:"OnName",id:"onname",level:2},{value:"OnGroup",id:"ongroup",level:2},{value:"OnGroupName",id:"ongroupname",level:2},{value:"OnListen",id:"onlisten",level:2},{value:"OnFork",id:"onfork",level:2},{value:"OnShutdown",id:"onshutdown",level:2},{value:"OnMount",id:"onmount",level:2}],m={toc:c},d="wrapper";function f(e){let{components:n,...t}=e;return(0,a.kt)(d,(0,r.Z)({},m,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onroute"},"OnRoute")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onname"},"OnName")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#ongroup"},"OnGroup")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#ongroupname"},"OnGroupName")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onlisten"},"OnListen")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onfork"},"OnFork")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onshutdown"},"OnShutdown")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#onmount"},"OnMount"))),(0,a.kt)("h2",{id:"constants"},"Constants"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Handlers define a function to create hooks for Fiber.\ntype OnRouteHandler = func(Route) error\ntype OnNameHandler = OnRouteHandler\ntype OnGroupHandler = func(Group) error\ntype OnGroupNameHandler = OnGroupHandler\ntype OnListenHandler = func(ListenData) error\ntype OnForkHandler = func(int) error\ntype OnShutdownHandler = func() error\ntype OnMountHandler = func(*App) error\n")),(0,a.kt)("h2",{id:"onroute"},"OnRoute"),(0,a.kt)("p",null,"OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by ",(0,a.kt)("strong",{parentName:"p"},"route")," parameter."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnRoute(handler ...OnRouteHandler)\n")),(0,a.kt)("h2",{id:"onname"},"OnName"),(0,a.kt)("p",null,"OnName is a hook to execute user functions on each route naming. Also you can get route properties by ",(0,a.kt)("strong",{parentName:"p"},"route")," parameter."),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnName only works with naming routes, not groups.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnName(handler ...OnNameHandler)\n")),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(u.Z,{value:"onname-example",label:"OnName Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n\n "github.com/gofiber/fiber/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("index")\n\n app.Hooks().OnName(func(r fiber.Route) error {\n fmt.Print("Name: " + r.Name + ", ")\n\n return nil\n })\n\n app.Hooks().OnName(func(r fiber.Route) error {\n fmt.Print("Method: " + r.Method + "\\n")\n\n return nil\n })\n\n app.Get("/add/user", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("addUser")\n\n app.Delete("/destroy/user", func(c *fiber.Ctx) error {\n return c.SendString(c.Route().Name)\n }).Name("destroyUser")\n\n app.Listen(":5000")\n}\n\n// Results:\n// Name: addUser, Method: GET\n// Name: destroyUser, Method: DELETE\n')))),(0,a.kt)("h2",{id:"ongroup"},"OnGroup"),(0,a.kt)("p",null,"OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by ",(0,a.kt)("strong",{parentName:"p"},"group")," parameter."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnGroup(handler ...OnGroupHandler)\n")),(0,a.kt)("h2",{id:"ongroupname"},"OnGroupName"),(0,a.kt)("p",null,"OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by ",(0,a.kt)("strong",{parentName:"p"},"group")," parameter."),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnGroupName only works with naming groups, not routes.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnGroupName(handler ...OnGroupNameHandler)\n")),(0,a.kt)("h2",{id:"onlisten"},"OnListen"),(0,a.kt)("p",null,"OnListen is a hook to execute user functions on Listen, ListenTLS, Listener."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnListen(handler ...OnListenHandler)\n")),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(u.Z,{value:"onlisten-example",label:"OnListen Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app := fiber.New(fiber.Config{\n DisableStartupMessage: true,\n})\n\napp.Hooks().OnListen(func(listenData fiber.ListenData) error {\n if fiber.IsChild() {\n return nil\n }\n scheme := "http"\n if data.TLS {\n scheme = "https"\n }\n log.Println(scheme + "://" + listenData.Host + ":" + listenData.Port)\n return nil\n})\n\napp.Listen(":5000")\n')))),(0,a.kt)("h2",{id:"onfork"},"OnFork"),(0,a.kt)("p",null,"OnFork is a hook to execute user functions on Fork."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnFork(handler ...OnForkHandler)\n")),(0,a.kt)("h2",{id:"onshutdown"},"OnShutdown"),(0,a.kt)("p",null,"OnShutdown is a hook to execute user functions after Shutdown."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) OnShutdown(handler ...OnShutdownHandler)\n")),(0,a.kt)("h2",{id:"onmount"},"OnMount"),(0,a.kt)("p",null,"OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (h *Hooks) OnMount(handler ...OnMountHandler) \n")),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(u.Z,{value:"onmount-example",label:"OnMount Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n\n "github.com/gofiber/fiber/v2"\n)\n\nfunc main() {\n app := New()\n app.Get("/", testSimpleHandler).Name("x")\n\n subApp := New()\n subApp.Get("/test", testSimpleHandler)\n\n subApp.Hooks().OnMount(func(parent *fiber.App) error {\n fmt.Print("Mount path of parent app: "+parent.MountPath())\n // ...\n\n return nil\n })\n\n app.Mount("/sub", subApp)\n}\n\n// Result:\n// Mount path of parent app: \n')))),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.")))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2b43107e.3630b5dc.js b/assets/js/2b43107e.a1518b5f.js similarity index 99% rename from assets/js/2b43107e.3630b5dc.js rename to assets/js/2b43107e.a1518b5f.js index 18b153131c9..eb4732d24a9 100644 --- a/assets/js/2b43107e.3630b5dc.js +++ b/assets/js/2b43107e.a1518b5f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2707],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=p(n),f=i,m=u["".concat(s,".").concat(f)]||u[f]||d[f]||a;return n?r.createElement(m,o(o({ref:t},c),{},{components:n})):r.createElement(m,o({ref:t},c))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=f;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:i,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>p});var r=n(7462),i=(n(7294),n(3905));const a={id:"monitor",title:"Monitor"},o=void 0,l={unversionedId:"api/middleware/monitor",id:"api/middleware/monitor",title:"Monitor",description:"Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor",source:"@site/docs/core/api/middleware/monitor.md",sourceDirName:"api/middleware",slug:"/api/middleware/monitor",permalink:"/next/api/middleware/monitor",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/monitor.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"monitor",title:"Monitor"},sidebar:"tutorialSidebar",previous:{title:"Logger",permalink:"/next/api/middleware/logger"},next:{title:"Pprof",permalink:"/next/api/middleware/pprof"}},s={},p=[{value:"Signatures",id:"signatures",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],c={toc:p},u="wrapper";function d(e){let{components:t,...n}=e;return(0,i.kt)(u,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Monitor middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that reports server metrics, inspired by ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/RafalWilinski/express-status-monitor"},"express-status-monitor")),(0,i.kt)("admonition",{type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"Monitor is still in beta, API might change in the future!")),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://i.imgur.com/nHAtBpJ.gif",alt:null})),(0,i.kt)("h3",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New() fiber.Handler\n")),(0,i.kt)("h3",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/monitor"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config (Assign the middleware to /metrics)\napp.Get("/metrics", monitor.New())\n\n// Or extend your config for customization\n// Assign the middleware to /metrics\n// and change the Title to `MyService Metrics Page`\napp.Get("/metrics", monitor.New(monitor.Config{Title: "MyService Metrics Page"}))\n')),(0,i.kt)("p",null,"You can also access the API endpoint with\n",(0,i.kt)("inlineCode",{parentName:"p"},'curl -X GET -H "Accept: application/json" http://localhost:3000/metrics')," which returns:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'{"pid":{ "cpu":0.4568381746582226, "ram":20516864, "conns":3 },\n "os": { "cpu":8.759124087593099, "ram":3997155328, "conns":44,\n "total_ram":8245489664, "load_avg":0.51 }}\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Metrics page title\n //\n // Optional. Default: "Fiber Monitor"\n Title string\n\n // Refresh period\n //\n // Optional. Default: 3 seconds\n Refresh time.Duration\n\n // Whether the service should expose only the monitoring API.\n //\n // Optional. Default: false\n APIOnly bool\n\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Custom HTML Code to Head Section(Before End)\n //\n // Optional. Default: empty\n CustomHead string\n\n // FontURL for specify font resource path or URL . also you can use relative path\n //\n // Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap\n FontURL string\n\n // ChartJsURL for specify ChartJS library path or URL . also you can use relative path\n //\n // Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js\n ChartJsURL string\n\n index string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Title: defaultTitle,\n Refresh: defaultRefresh,\n FontURL: defaultFontURL,\n ChartJsURL: defaultChartJSURL,\n CustomHead: defaultCustomHead,\n APIOnly: false,\n Next: nil,\n index: newIndex(viewBag{\n defaultTitle,\n defaultRefresh,\n defaultFontURL,\n defaultChartJSURL,\n defaultCustomHead,\n }),\n}\n")))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2707],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=p(n),f=i,m=u["".concat(s,".").concat(f)]||u[f]||d[f]||a;return n?r.createElement(m,o(o({ref:t},c),{},{components:n})):r.createElement(m,o({ref:t},c))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=f;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:i,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>p});var r=n(7462),i=(n(7294),n(3905));const a={id:"monitor",title:"Monitor"},o=void 0,l={unversionedId:"api/middleware/monitor",id:"api/middleware/monitor",title:"Monitor",description:"Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor",source:"@site/docs/core/api/middleware/monitor.md",sourceDirName:"api/middleware",slug:"/api/middleware/monitor",permalink:"/next/api/middleware/monitor",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/monitor.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"monitor",title:"Monitor"},sidebar:"tutorialSidebar",previous:{title:"Logger",permalink:"/next/api/middleware/logger"},next:{title:"Pprof",permalink:"/next/api/middleware/pprof"}},s={},p=[{value:"Signatures",id:"signatures",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],c={toc:p},u="wrapper";function d(e){let{components:t,...n}=e;return(0,i.kt)(u,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Monitor middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that reports server metrics, inspired by ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/RafalWilinski/express-status-monitor"},"express-status-monitor")),(0,i.kt)("admonition",{type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"Monitor is still in beta, API might change in the future!")),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://i.imgur.com/nHAtBpJ.gif",alt:null})),(0,i.kt)("h3",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New() fiber.Handler\n")),(0,i.kt)("h3",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/monitor"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config (Assign the middleware to /metrics)\napp.Get("/metrics", monitor.New())\n\n// Or extend your config for customization\n// Assign the middleware to /metrics\n// and change the Title to `MyService Metrics Page`\napp.Get("/metrics", monitor.New(monitor.Config{Title: "MyService Metrics Page"}))\n')),(0,i.kt)("p",null,"You can also access the API endpoint with\n",(0,i.kt)("inlineCode",{parentName:"p"},'curl -X GET -H "Accept: application/json" http://localhost:3000/metrics')," which returns:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'{"pid":{ "cpu":0.4568381746582226, "ram":20516864, "conns":3 },\n "os": { "cpu":8.759124087593099, "ram":3997155328, "conns":44,\n "total_ram":8245489664, "load_avg":0.51 }}\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Metrics page title\n //\n // Optional. Default: "Fiber Monitor"\n Title string\n\n // Refresh period\n //\n // Optional. Default: 3 seconds\n Refresh time.Duration\n\n // Whether the service should expose only the monitoring API.\n //\n // Optional. Default: false\n APIOnly bool\n\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Custom HTML Code to Head Section(Before End)\n //\n // Optional. Default: empty\n CustomHead string\n\n // FontURL for specify font resource path or URL . also you can use relative path\n //\n // Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap\n FontURL string\n\n // ChartJsURL for specify ChartJS library path or URL . also you can use relative path\n //\n // Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js\n ChartJsURL string\n\n index string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Title: defaultTitle,\n Refresh: defaultRefresh,\n FontURL: defaultFontURL,\n ChartJsURL: defaultChartJSURL,\n CustomHead: defaultCustomHead,\n APIOnly: false,\n Next: nil,\n index: newIndex(viewBag{\n defaultTitle,\n defaultRefresh,\n defaultFontURL,\n defaultChartJSURL,\n defaultCustomHead,\n }),\n}\n")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2bc33efd.648add97.js b/assets/js/2bc33efd.41c78bdf.js similarity index 99% rename from assets/js/2bc33efd.648add97.js rename to assets/js/2bc33efd.41c78bdf.js index 7e185cf31d0..8150ffb0b94 100644 --- a/assets/js/2bc33efd.648add97.js +++ b/assets/js/2bc33efd.41c78bdf.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6208],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=p(n),f=i,m=u["".concat(s,".").concat(f)]||u[f]||d[f]||a;return n?r.createElement(m,o(o({ref:t},c),{},{components:n})):r.createElement(m,o({ref:t},c))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=f;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:i,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>p});var r=n(7462),i=(n(7294),n(3905));const a={id:"monitor",title:"Monitor"},o=void 0,l={unversionedId:"api/middleware/monitor",id:"version-v2.x/api/middleware/monitor",title:"Monitor",description:"Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor",source:"@site/versioned_docs/version-v2.x/api/middleware/monitor.md",sourceDirName:"api/middleware",slug:"/api/middleware/monitor",permalink:"/api/middleware/monitor",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"monitor",title:"Monitor"},sidebar:"tutorialSidebar",previous:{title:"Logger",permalink:"/api/middleware/logger"},next:{title:"Pprof",permalink:"/api/middleware/pprof"}},s={},p=[{value:"Signatures",id:"signatures",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],c={toc:p},u="wrapper";function d(e){let{components:t,...n}=e;return(0,i.kt)(u,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Monitor middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that reports server metrics, inspired by ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/RafalWilinski/express-status-monitor"},"express-status-monitor")),(0,i.kt)("admonition",{type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"Monitor is still in beta, API might change in the future!")),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://i.imgur.com/nHAtBpJ.gif",alt:null})),(0,i.kt)("h3",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New() fiber.Handler\n")),(0,i.kt)("h3",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/monitor"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config (Assign the middleware to /metrics)\napp.Get("/metrics", monitor.New())\n\n// Or extend your config for customization\n// Assign the middleware to /metrics\n// and change the Title to `MyService Metrics Page`\napp.Get("/metrics", monitor.New(monitor.Config{Title: "MyService Metrics Page"}))\n')),(0,i.kt)("p",null,"You can also access the API endpoint with\n",(0,i.kt)("inlineCode",{parentName:"p"},'curl -X GET -H "Accept: application/json" http://localhost:3000/metrics')," which returns:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'{"pid":{ "cpu":0.4568381746582226, "ram":20516864, "conns":3 },\n "os": { "cpu":8.759124087593099, "ram":3997155328, "conns":44,\n "total_ram":8245489664, "load_avg":0.51 }}\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Metrics page title\n //\n // Optional. Default: "Fiber Monitor"\n Title string\n\n // Refresh period\n //\n // Optional. Default: 3 seconds\n Refresh time.Duration\n\n // Whether the service should expose only the monitoring API.\n //\n // Optional. Default: false\n APIOnly bool\n\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Custom HTML Code to Head Section(Before End)\n //\n // Optional. Default: empty\n CustomHead string\n\n // FontURL for specify font resource path or URL . also you can use relative path\n //\n // Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap\n FontURL string\n\n // ChartJsURL for specify ChartJS library path or URL . also you can use relative path\n //\n // Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js\n ChartJsURL string\n\n index string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Title: defaultTitle,\n Refresh: defaultRefresh,\n FontURL: defaultFontURL,\n ChartJsURL: defaultChartJSURL,\n CustomHead: defaultCustomHead,\n APIOnly: false,\n Next: nil,\n index: newIndex(viewBag{\n defaultTitle,\n defaultRefresh,\n defaultFontURL,\n defaultChartJSURL,\n defaultCustomHead,\n }),\n}\n")))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6208],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=p(n),f=i,m=u["".concat(s,".").concat(f)]||u[f]||d[f]||a;return n?r.createElement(m,o(o({ref:t},c),{},{components:n})):r.createElement(m,o({ref:t},c))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=f;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:i,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>p});var r=n(7462),i=(n(7294),n(3905));const a={id:"monitor",title:"Monitor"},o=void 0,l={unversionedId:"api/middleware/monitor",id:"version-v2.x/api/middleware/monitor",title:"Monitor",description:"Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor",source:"@site/versioned_docs/version-v2.x/api/middleware/monitor.md",sourceDirName:"api/middleware",slug:"/api/middleware/monitor",permalink:"/api/middleware/monitor",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"monitor",title:"Monitor"},sidebar:"tutorialSidebar",previous:{title:"Logger",permalink:"/api/middleware/logger"},next:{title:"Pprof",permalink:"/api/middleware/pprof"}},s={},p=[{value:"Signatures",id:"signatures",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],c={toc:p},u="wrapper";function d(e){let{components:t,...n}=e;return(0,i.kt)(u,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Monitor middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that reports server metrics, inspired by ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/RafalWilinski/express-status-monitor"},"express-status-monitor")),(0,i.kt)("admonition",{type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"Monitor is still in beta, API might change in the future!")),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://i.imgur.com/nHAtBpJ.gif",alt:null})),(0,i.kt)("h3",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New() fiber.Handler\n")),(0,i.kt)("h3",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/monitor"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config (Assign the middleware to /metrics)\napp.Get("/metrics", monitor.New())\n\n// Or extend your config for customization\n// Assign the middleware to /metrics\n// and change the Title to `MyService Metrics Page`\napp.Get("/metrics", monitor.New(monitor.Config{Title: "MyService Metrics Page"}))\n')),(0,i.kt)("p",null,"You can also access the API endpoint with\n",(0,i.kt)("inlineCode",{parentName:"p"},'curl -X GET -H "Accept: application/json" http://localhost:3000/metrics')," which returns:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-json"},'{"pid":{ "cpu":0.4568381746582226, "ram":20516864, "conns":3 },\n "os": { "cpu":8.759124087593099, "ram":3997155328, "conns":44,\n "total_ram":8245489664, "load_avg":0.51 }}\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Metrics page title\n //\n // Optional. Default: "Fiber Monitor"\n Title string\n\n // Refresh period\n //\n // Optional. Default: 3 seconds\n Refresh time.Duration\n\n // Whether the service should expose only the monitoring API.\n //\n // Optional. Default: false\n APIOnly bool\n\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Custom HTML Code to Head Section(Before End)\n //\n // Optional. Default: empty\n CustomHead string\n\n // FontURL for specify font resource path or URL . also you can use relative path\n //\n // Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap\n FontURL string\n\n // ChartJsURL for specify ChartJS library path or URL . also you can use relative path\n //\n // Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js\n ChartJsURL string\n\n index string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Title: defaultTitle,\n Refresh: defaultRefresh,\n FontURL: defaultFontURL,\n ChartJsURL: defaultChartJSURL,\n CustomHead: defaultCustomHead,\n APIOnly: false,\n Next: nil,\n index: newIndex(viewBag{\n defaultTitle,\n defaultRefresh,\n defaultFontURL,\n defaultChartJSURL,\n defaultCustomHead,\n }),\n}\n")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/302308c6.c3a44bda.js b/assets/js/302308c6.a5fba1d1.js similarity index 99% rename from assets/js/302308c6.c3a44bda.js rename to assets/js/302308c6.a5fba1d1.js index 8f82d9fbe06..d85805c54e3 100644 --- a/assets/js/302308c6.c3a44bda.js +++ b/assets/js/302308c6.a5fba1d1.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9092],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>f});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=u(n),m=i,f=p["".concat(l,".").concat(m)]||p[m]||c[m]||a;return n?r.createElement(f,o(o({ref:t},d),{},{components:n})):r.createElement(f,o({ref:t},d))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:i,o[1]=s;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>c,frontMatter:()=>a,metadata:()=>s,toc:()=>u});var r=n(7462),i=(n(7294),n(3905));const a={id:"limiter",title:"Limiter"},o=void 0,s={unversionedId:"api/middleware/limiter",id:"api/middleware/limiter",title:"Limiter",description:"Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled.",source:"@site/docs/core/api/middleware/limiter.md",sourceDirName:"api/middleware",slug:"/api/middleware/limiter",permalink:"/next/api/middleware/limiter",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/limiter.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"limiter",title:"Limiter"},sidebar:"tutorialSidebar",previous:{title:"Keyauth",permalink:"/next/api/middleware/keyauth"},next:{title:"Logger",permalink:"/next/api/middleware/logger"}},l={},u=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Sliding window",id:"sliding-window",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Custom Storage/Database",id:"custom-storagedatabase",level:3}],d={toc:u},p="wrapper";function c(e){let{components:t,...n}=e;return(0,i.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Limiter middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This middleware uses our ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage"},"Storage")," package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This module does not share state with other processes/servers by default.")),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/limiter"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(limiter.New())\n\n// Or extend your config for customization\napp.Use(limiter.New(limiter.Config{\n Next: func(c *fiber.Ctx) bool {\n return c.IP() == "127.0.0.1"\n },\n Max: 20,\n Expiration: 30 * time.Second,\n KeyGenerator: func(c *fiber.Ctx) string {\n return c.Get("x-forwarded-for")\n },\n LimitReached: func(c *fiber.Ctx) error {\n return c.SendFile("./toofast.html")\n },\n Storage: myCustomStorage{},\n}))\n')),(0,i.kt)("h2",{id:"sliding-window"},"Sliding window"),(0,i.kt)("p",null,"Instead of using the standard fixed window algorithm, you can enable the ",(0,i.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Sliding_window_protocol"},"sliding window")," algorithm."),(0,i.kt)("p",null,"A example of such configuration is:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"app.Use(limiter.New(limiter.Config{\n Max: 20,\n Expiration: 30 * time.Second,\n LimiterMiddleware: limiter.SlidingWindow{},\n}))\n")),(0,i.kt)("p",null,"This means that every window will take into account the previous window(if there was any). The given formula for the rate is:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration)\nrate = weightOfPreviousWindpw + current window's amount request.\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Max number of recent connections during `Duration` seconds before sending a 429 response\n //\n // Default: 5\n Max int\n\n // KeyGenerator allows you to generate custom keys, by default c.IP() is used\n //\n // Default: func(c *fiber.Ctx) string {\n // return c.IP()\n // }\n KeyGenerator func(*fiber.Ctx) string\n\n // Expiration is the time on how long to keep records of requests in memory\n //\n // Default: 1 * time.Minute\n Expiration time.Duration\n\n // LimitReached is called when a request hits the limit\n //\n // Default: func(c *fiber.Ctx) error {\n // return c.SendStatus(fiber.StatusTooManyRequests)\n // }\n LimitReached fiber.Handler\n\n // When set to true, requests with StatusCode >= 400 won't be counted.\n //\n // Default: false\n SkipFailedRequests bool\n\n // When set to true, requests with StatusCode < 400 won't be counted.\n //\n // Default: false\n SkipSuccessfulRequests bool\n\n // Store is used to store the state of the middleware\n //\n // Default: an in memory store for this process only\n Storage fiber.Storage\n\n // LimiterMiddleware is the struct that implements limiter middleware.\n //\n // Default: a new Fixed Window Rate Limiter\n LimiterMiddleware LimiterHandler\n}\n")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"A custom store can be used if it implements the ",(0,i.kt)("inlineCode",{parentName:"p"},"Storage")," interface - more details and an example can be found in ",(0,i.kt)("inlineCode",{parentName:"p"},"store.go"),".")),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Max: 5,\n Expiration: 1 * time.Minute,\n KeyGenerator: func(c *fiber.Ctx) string {\n return c.IP()\n },\n LimitReached: func(c *fiber.Ctx) error {\n return c.SendStatus(fiber.StatusTooManyRequests)\n },\n SkipFailedRequests: false,\n SkipSuccessfulRequests: false,\n LimiterMiddleware: FixedWindow{},\n}\n")),(0,i.kt)("h3",{id:"custom-storagedatabase"},"Custom Storage/Database"),(0,i.kt)("p",null,"You can use any storage from our ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage/"},"storage")," package."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3\napp.Use(limiter.New(limiter.Config{\n Storage: storage,\n}))\n")))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9092],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>f});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=u(n),m=i,f=p["".concat(l,".").concat(m)]||p[m]||c[m]||a;return n?r.createElement(f,o(o({ref:t},d),{},{components:n})):r.createElement(f,o({ref:t},d))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:i,o[1]=s;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>c,frontMatter:()=>a,metadata:()=>s,toc:()=>u});var r=n(7462),i=(n(7294),n(3905));const a={id:"limiter",title:"Limiter"},o=void 0,s={unversionedId:"api/middleware/limiter",id:"api/middleware/limiter",title:"Limiter",description:"Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled.",source:"@site/docs/core/api/middleware/limiter.md",sourceDirName:"api/middleware",slug:"/api/middleware/limiter",permalink:"/next/api/middleware/limiter",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/limiter.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"limiter",title:"Limiter"},sidebar:"tutorialSidebar",previous:{title:"Keyauth",permalink:"/next/api/middleware/keyauth"},next:{title:"Logger",permalink:"/next/api/middleware/logger"}},l={},u=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Sliding window",id:"sliding-window",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Custom Storage/Database",id:"custom-storagedatabase",level:3}],d={toc:u},p="wrapper";function c(e){let{components:t,...n}=e;return(0,i.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Limiter middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This middleware uses our ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage"},"Storage")," package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This module does not share state with other processes/servers by default.")),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/limiter"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(limiter.New())\n\n// Or extend your config for customization\napp.Use(limiter.New(limiter.Config{\n Next: func(c *fiber.Ctx) bool {\n return c.IP() == "127.0.0.1"\n },\n Max: 20,\n Expiration: 30 * time.Second,\n KeyGenerator: func(c *fiber.Ctx) string {\n return c.Get("x-forwarded-for")\n },\n LimitReached: func(c *fiber.Ctx) error {\n return c.SendFile("./toofast.html")\n },\n Storage: myCustomStorage{},\n}))\n')),(0,i.kt)("h2",{id:"sliding-window"},"Sliding window"),(0,i.kt)("p",null,"Instead of using the standard fixed window algorithm, you can enable the ",(0,i.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Sliding_window_protocol"},"sliding window")," algorithm."),(0,i.kt)("p",null,"A example of such configuration is:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"app.Use(limiter.New(limiter.Config{\n Max: 20,\n Expiration: 30 * time.Second,\n LimiterMiddleware: limiter.SlidingWindow{},\n}))\n")),(0,i.kt)("p",null,"This means that every window will take into account the previous window(if there was any). The given formula for the rate is:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration)\nrate = weightOfPreviousWindpw + current window's amount request.\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Max number of recent connections during `Duration` seconds before sending a 429 response\n //\n // Default: 5\n Max int\n\n // KeyGenerator allows you to generate custom keys, by default c.IP() is used\n //\n // Default: func(c *fiber.Ctx) string {\n // return c.IP()\n // }\n KeyGenerator func(*fiber.Ctx) string\n\n // Expiration is the time on how long to keep records of requests in memory\n //\n // Default: 1 * time.Minute\n Expiration time.Duration\n\n // LimitReached is called when a request hits the limit\n //\n // Default: func(c *fiber.Ctx) error {\n // return c.SendStatus(fiber.StatusTooManyRequests)\n // }\n LimitReached fiber.Handler\n\n // When set to true, requests with StatusCode >= 400 won't be counted.\n //\n // Default: false\n SkipFailedRequests bool\n\n // When set to true, requests with StatusCode < 400 won't be counted.\n //\n // Default: false\n SkipSuccessfulRequests bool\n\n // Store is used to store the state of the middleware\n //\n // Default: an in memory store for this process only\n Storage fiber.Storage\n\n // LimiterMiddleware is the struct that implements limiter middleware.\n //\n // Default: a new Fixed Window Rate Limiter\n LimiterMiddleware LimiterHandler\n}\n")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"A custom store can be used if it implements the ",(0,i.kt)("inlineCode",{parentName:"p"},"Storage")," interface - more details and an example can be found in ",(0,i.kt)("inlineCode",{parentName:"p"},"store.go"),".")),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Max: 5,\n Expiration: 1 * time.Minute,\n KeyGenerator: func(c *fiber.Ctx) string {\n return c.IP()\n },\n LimitReached: func(c *fiber.Ctx) error {\n return c.SendStatus(fiber.StatusTooManyRequests)\n },\n SkipFailedRequests: false,\n SkipSuccessfulRequests: false,\n LimiterMiddleware: FixedWindow{},\n}\n")),(0,i.kt)("h3",{id:"custom-storagedatabase"},"Custom Storage/Database"),(0,i.kt)("p",null,"You can use any storage from our ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage/"},"storage")," package."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3\napp.Use(limiter.New(limiter.Config{\n Storage: storage,\n}))\n")))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/30f87c66.3389cfba.js b/assets/js/30f87c66.0e6ddfe1.js similarity index 98% rename from assets/js/30f87c66.3389cfba.js rename to assets/js/30f87c66.0e6ddfe1.js index 312cfbc2e51..3e873d36bb4 100644 --- a/assets/js/30f87c66.3389cfba.js +++ b/assets/js/30f87c66.0e6ddfe1.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9595],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),m=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=m(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=m(n),d=a,f=c["".concat(s,".").concat(d)]||c[d]||u[d]||i;return n?r.createElement(f,l(l({ref:t},p),{},{components:n})):r.createElement(f,l({ref:t},p))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,l=new Array(i);l[0]=d;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[c]="string"==typeof e?e:a,l[1]=o;for(var m=2;m{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>m});var r=n(7462),a=(n(7294),n(3905));const i={id:"slim",title:"Slim"},l=void 0,o={unversionedId:"slim/slim",id:"slim/slim",title:"Slim",description:"Release",source:"@site/docs/template/slim/README.md",sourceDirName:"slim",slug:"/slim/",permalink:"/template/slim/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/slim/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"slim",title:"Slim"},sidebar:"tutorialSidebar",previous:{title:"Pug",permalink:"/template/pug/"}},s={},m=[{value:"Basic Example",id:"basic-example",level:3}],p={toc:m},c="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Slim is a template engine created by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/mattn/go-slim"},"mattn"),", to see the original syntax documentation please ",(0,a.kt)("a",{parentName:"p",href:"https://rubydoc.info/gems/slim/frames"},"click here")),(0,a.kt)("h3",{id:"basic-example"},"Basic Example"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/index.slim"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},'== render("partials/header.slim")\n\nh1 = Title\n\n== render("partials/footer.slim")\n')),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/header.slim"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h2 = Header\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/footer.slim"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h2 = Footer\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/layouts/main.slim"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"doctype html\nhtml\n head\n title Main\n include ../partials/meta.slim\n body\n | {{embed}}\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/slim/v2"\n\n // "net/http" // embedded system\n)\n\nfunc main() {\n // Create a new engine\n engine := slim.New("./views", ".slim")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := slim.NewFileSystem(http.Dir("./views", ".slim"))\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9595],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),m=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=m(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=m(n),d=a,f=c["".concat(s,".").concat(d)]||c[d]||u[d]||i;return n?r.createElement(f,l(l({ref:t},p),{},{components:n})):r.createElement(f,l({ref:t},p))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,l=new Array(i);l[0]=d;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[c]="string"==typeof e?e:a,l[1]=o;for(var m=2;m{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>m});var r=n(7462),a=(n(7294),n(3905));const i={id:"slim",title:"Slim"},l=void 0,o={unversionedId:"slim/slim",id:"slim/slim",title:"Slim",description:"Release",source:"@site/docs/template/slim/README.md",sourceDirName:"slim",slug:"/slim/",permalink:"/template/slim/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/slim/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"slim",title:"Slim"},sidebar:"tutorialSidebar",previous:{title:"Pug",permalink:"/template/pug/"}},s={},m=[{value:"Basic Example",id:"basic-example",level:3}],p={toc:m},c="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Slim is a template engine created by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/mattn/go-slim"},"mattn"),", to see the original syntax documentation please ",(0,a.kt)("a",{parentName:"p",href:"https://rubydoc.info/gems/slim/frames"},"click here")),(0,a.kt)("h3",{id:"basic-example"},"Basic Example"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/index.slim"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},'== render("partials/header.slim")\n\nh1 = Title\n\n== render("partials/footer.slim")\n')),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/header.slim"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h2 = Header\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/footer.slim"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h2 = Footer\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/layouts/main.slim"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"doctype html\nhtml\n head\n title Main\n include ../partials/meta.slim\n body\n | {{embed}}\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/slim/v2"\n\n // "net/http" // embedded system\n)\n\nfunc main() {\n // Create a new engine\n engine := slim.New("./views", ".slim")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := slim.NewFileSystem(http.Dir("./views", ".slim"))\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/3109af4c.5b4d3f3d.js b/assets/js/3109af4c.d3491b4f.js similarity index 99% rename from assets/js/3109af4c.5b4d3f3d.js rename to assets/js/3109af4c.d3491b4f.js index e5a7dcdd059..37ffe81ded6 100644 --- a/assets/js/3109af4c.5b4d3f3d.js +++ b/assets/js/3109af4c.d3491b4f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6873],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>d});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),c=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=c(e.components);return r.createElement(l.Provider,{value:t},e.children)},f="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},b=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),f=c(n),b=i,d=f["".concat(l,".").concat(b)]||f[b]||u[b]||a;return n?r.createElement(d,o(o({ref:t},p),{},{components:n})):r.createElement(d,o({ref:t},p))}));function d(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=b;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[f]="string"==typeof e?e:i,o[1]=s;for(var c=2;c{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>s,toc:()=>c});var r=n(7462),i=(n(7294),n(3905));const a={id:"fibersentry",title:"Fibersentry"},o=void 0,s={unversionedId:"fibersentry/fibersentry",id:"fibersentry/fibersentry",title:"Fibersentry",description:"Release",source:"@site/docs/contrib/fibersentry/README.md",sourceDirName:"fibersentry",slug:"/fibersentry/",permalink:"/contrib/fibersentry/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/fibersentry/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"fibersentry",title:"Fibersentry"},sidebar:"tutorialSidebar",previous:{title:"Fibernewrelic",permalink:"/contrib/fibernewrelic/"},next:{title:"Fiberzap",permalink:"/contrib/fiberzap/"}},l={},c=[{value:"Install",id:"install",level:3},{value:"Signature",id:"signature",level:3},{value:"Config",id:"config",level:3},{value:"Usage",id:"usage",level:3},{value:"Accessing Context in BeforeSend callback",id:"accessing-context-in-beforesend-callback",level:3}],p={toc:c},f="wrapper";function u(e){let{components:t,...n}=e;return(0,i.kt)(f,(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=fibersentry*",alt:"Release"}),"\n",(0,i.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,i.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,i.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,i.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://sentry.io/"},"Sentry")," support for Fiber."),(0,i.kt)("h3",{id:"install"},"Install"),(0,i.kt)("p",null,"This middleware supports Fiber v2."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"go get -u github.com/gofiber/fiber/v2\ngo get -u github.com/gofiber/contrib/fibersentry\ngo get -u github.com/getsentry/sentry-go\n")),(0,i.kt)("h3",{id:"signature"},"Signature"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"fibersentry.New(config ...Config) fiber.Handler\n")),(0,i.kt)("h3",{id:"config"},"Config"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Property"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Default"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},"Repanic"),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"bool")),(0,i.kt)("td",{parentName:"tr",align:"left"},"Repanic configures whether Sentry should repanic after recovery. Set to true, if ",(0,i.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/tree/master/middleware/recover"},"Recover")," middleware is used."),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"false"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},"WaitForDelivery"),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"bool")),(0,i.kt)("td",{parentName:"tr",align:"left"},"WaitForDelivery configures whether you want to block the request before moving forward with the response. If ",(0,i.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/tree/master/middleware/recover"},"Recover")," middleware is used, it's safe to either skip this option or set it to false."),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"false"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},"Timeout"),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,i.kt)("td",{parentName:"tr",align:"left"},"Timeout for the event delivery requests."),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"time.Second * 2"))))),(0,i.kt)("h3",{id:"usage"},"Usage"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"fibersentry")," attaches an instance of ",(0,i.kt)("inlineCode",{parentName:"p"},"*sentry.Hub")," (",(0,i.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/getsentry/sentry-go#Hub"},"https://godoc.org/github.com/getsentry/sentry-go#Hub"),") to the request's context, which makes it available throughout the rest of the request's lifetime.\nYou can access it by using the ",(0,i.kt)("inlineCode",{parentName:"p"},"fibersentry.GetHubFromContext()")," method on the context itself in any of your proceeding middleware and routes.\nAnd it should be used instead of the global ",(0,i.kt)("inlineCode",{parentName:"p"},"sentry.CaptureMessage"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"sentry.CaptureException"),", or any other calls, as it keeps the separation of data between the requests."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Keep in mind that ",(0,i.kt)("inlineCode",{parentName:"strong"},"*sentry.Hub")," won't be available in middleware attached before to ",(0,i.kt)("inlineCode",{parentName:"strong"},"fibersentry"),"!")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n "log"\n\n "github.com/getsentry/sentry-go"\n "github.com/gofiber/contrib/fibersentry"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/utils"\n)\n\nfunc main() {\n _ = sentry.Init(sentry.ClientOptions{\n Dsn: "",\n BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {\n if hint.Context != nil {\n if c, ok := hint.Context.Value(sentry.RequestContextKey).(*fiber.Ctx); ok {\n // You have access to the original Context if it panicked\n fmt.Println(utils.ImmutableString(c.Hostname()))\n }\n }\n fmt.Println(event)\n return event\n },\n Debug: true,\n AttachStacktrace: true,\n })\n\n app := fiber.New()\n\n app.Use(fibersentry.New(fibersentry.Config{\n Repanic: true,\n WaitForDelivery: true,\n }))\n\n enhanceSentryEvent := func(c *fiber.Ctx) error {\n if hub := fibersentry.GetHubFromContext(c); hub != nil {\n hub.Scope().SetTag("someRandomTag", "maybeYouNeedIt")\n }\n return c.Next()\n }\n\n app.All("/foo", enhanceSentryEvent, func(c *fiber.Ctx) error {\n panic("y tho")\n })\n\n app.All("/", func(c *fiber.Ctx) error {\n if hub := fibersentry.GetHubFromContext(c); hub != nil {\n hub.WithScope(func(scope *sentry.Scope) {\n scope.SetExtra("unwantedQuery", "someQueryDataMaybe")\n hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")\n })\n }\n return c.SendStatus(fiber.StatusOK)\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,i.kt)("h3",{id:"accessing-context-in-beforesend-callback"},"Accessing Context in ",(0,i.kt)("inlineCode",{parentName:"h3"},"BeforeSend")," callback"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'sentry.Init(sentry.ClientOptions{\n Dsn: "your-public-dsn",\n BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {\n if hint.Context != nil {\n if c, ok := hint.Context.Value(sentry.RequestContextKey).(*fiber.Ctx); ok {\n // You have access to the original Context if it panicked\n fmt.Println(c.Hostname())\n }\n }\n return event\n },\n})\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6873],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>d});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),c=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=c(e.components);return r.createElement(l.Provider,{value:t},e.children)},f="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},b=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),f=c(n),b=i,d=f["".concat(l,".").concat(b)]||f[b]||u[b]||a;return n?r.createElement(d,o(o({ref:t},p),{},{components:n})):r.createElement(d,o({ref:t},p))}));function d(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=b;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[f]="string"==typeof e?e:i,o[1]=s;for(var c=2;c{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>s,toc:()=>c});var r=n(7462),i=(n(7294),n(3905));const a={id:"fibersentry",title:"Fibersentry"},o=void 0,s={unversionedId:"fibersentry/fibersentry",id:"fibersentry/fibersentry",title:"Fibersentry",description:"Release",source:"@site/docs/contrib/fibersentry/README.md",sourceDirName:"fibersentry",slug:"/fibersentry/",permalink:"/contrib/fibersentry/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/fibersentry/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"fibersentry",title:"Fibersentry"},sidebar:"tutorialSidebar",previous:{title:"Fibernewrelic",permalink:"/contrib/fibernewrelic/"},next:{title:"Fiberzap",permalink:"/contrib/fiberzap/"}},l={},c=[{value:"Install",id:"install",level:3},{value:"Signature",id:"signature",level:3},{value:"Config",id:"config",level:3},{value:"Usage",id:"usage",level:3},{value:"Accessing Context in BeforeSend callback",id:"accessing-context-in-beforesend-callback",level:3}],p={toc:c},f="wrapper";function u(e){let{components:t,...n}=e;return(0,i.kt)(f,(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,(0,i.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=fibersentry*",alt:"Release"}),"\n",(0,i.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,i.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,i.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,i.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,i.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://sentry.io/"},"Sentry")," support for Fiber."),(0,i.kt)("h3",{id:"install"},"Install"),(0,i.kt)("p",null,"This middleware supports Fiber v2."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"go get -u github.com/gofiber/fiber/v2\ngo get -u github.com/gofiber/contrib/fibersentry\ngo get -u github.com/getsentry/sentry-go\n")),(0,i.kt)("h3",{id:"signature"},"Signature"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"fibersentry.New(config ...Config) fiber.Handler\n")),(0,i.kt)("h3",{id:"config"},"Config"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Property"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Default"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},"Repanic"),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"bool")),(0,i.kt)("td",{parentName:"tr",align:"left"},"Repanic configures whether Sentry should repanic after recovery. Set to true, if ",(0,i.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/tree/master/middleware/recover"},"Recover")," middleware is used."),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"false"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},"WaitForDelivery"),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"bool")),(0,i.kt)("td",{parentName:"tr",align:"left"},"WaitForDelivery configures whether you want to block the request before moving forward with the response. If ",(0,i.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/tree/master/middleware/recover"},"Recover")," middleware is used, it's safe to either skip this option or set it to false."),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"false"))),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},"Timeout"),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,i.kt)("td",{parentName:"tr",align:"left"},"Timeout for the event delivery requests."),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"time.Second * 2"))))),(0,i.kt)("h3",{id:"usage"},"Usage"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"fibersentry")," attaches an instance of ",(0,i.kt)("inlineCode",{parentName:"p"},"*sentry.Hub")," (",(0,i.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/getsentry/sentry-go#Hub"},"https://godoc.org/github.com/getsentry/sentry-go#Hub"),") to the request's context, which makes it available throughout the rest of the request's lifetime.\nYou can access it by using the ",(0,i.kt)("inlineCode",{parentName:"p"},"fibersentry.GetHubFromContext()")," method on the context itself in any of your proceeding middleware and routes.\nAnd it should be used instead of the global ",(0,i.kt)("inlineCode",{parentName:"p"},"sentry.CaptureMessage"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"sentry.CaptureException"),", or any other calls, as it keeps the separation of data between the requests."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Keep in mind that ",(0,i.kt)("inlineCode",{parentName:"strong"},"*sentry.Hub")," won't be available in middleware attached before to ",(0,i.kt)("inlineCode",{parentName:"strong"},"fibersentry"),"!")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n "log"\n\n "github.com/getsentry/sentry-go"\n "github.com/gofiber/contrib/fibersentry"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/utils"\n)\n\nfunc main() {\n _ = sentry.Init(sentry.ClientOptions{\n Dsn: "",\n BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {\n if hint.Context != nil {\n if c, ok := hint.Context.Value(sentry.RequestContextKey).(*fiber.Ctx); ok {\n // You have access to the original Context if it panicked\n fmt.Println(utils.ImmutableString(c.Hostname()))\n }\n }\n fmt.Println(event)\n return event\n },\n Debug: true,\n AttachStacktrace: true,\n })\n\n app := fiber.New()\n\n app.Use(fibersentry.New(fibersentry.Config{\n Repanic: true,\n WaitForDelivery: true,\n }))\n\n enhanceSentryEvent := func(c *fiber.Ctx) error {\n if hub := fibersentry.GetHubFromContext(c); hub != nil {\n hub.Scope().SetTag("someRandomTag", "maybeYouNeedIt")\n }\n return c.Next()\n }\n\n app.All("/foo", enhanceSentryEvent, func(c *fiber.Ctx) error {\n panic("y tho")\n })\n\n app.All("/", func(c *fiber.Ctx) error {\n if hub := fibersentry.GetHubFromContext(c); hub != nil {\n hub.WithScope(func(scope *sentry.Scope) {\n scope.SetExtra("unwantedQuery", "someQueryDataMaybe")\n hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")\n })\n }\n return c.SendStatus(fiber.StatusOK)\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,i.kt)("h3",{id:"accessing-context-in-beforesend-callback"},"Accessing Context in ",(0,i.kt)("inlineCode",{parentName:"h3"},"BeforeSend")," callback"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'sentry.Init(sentry.ClientOptions{\n Dsn: "your-public-dsn",\n BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {\n if hint.Context != nil {\n if c, ok := hint.Context.Value(sentry.RequestContextKey).(*fiber.Ctx); ok {\n // You have access to the original Context if it panicked\n fmt.Println(c.Hostname())\n }\n }\n return event\n },\n})\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/32e68b93.aac19a73.js b/assets/js/32e68b93.70ccf828.js similarity index 98% rename from assets/js/32e68b93.aac19a73.js rename to assets/js/32e68b93.70ccf828.js index 218a0ad9ee2..4605e646e56 100644 --- a/assets/js/32e68b93.aac19a73.js +++ b/assets/js/32e68b93.70ccf828.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6494],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>f});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),u=s(r),d=o,f=u["".concat(l,".").concat(d)]||u[d]||m[d]||a;return r?n.createElement(f,i(i({ref:t},p),{},{components:r})):n.createElement(f,i({ref:t},p))}));function f(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c[u]="string"==typeof e?e:o,i[1]=c;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>m,frontMatter:()=>a,metadata:()=>c,toc:()=>s});var n=r(7462),o=(r(7294),r(3905));const a={id:"faster-fiber",title:"\u26a1 Make Fiber Faster",sidebar_position:7},i=void 0,c={unversionedId:"guide/faster-fiber",id:"guide/faster-fiber",title:"\u26a1 Make Fiber Faster",description:"Custom JSON Encoder/Decoder",source:"@site/docs/core/guide/faster-fiber.md",sourceDirName:"guide",slug:"/guide/faster-fiber",permalink:"/next/guide/faster-fiber",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/faster-fiber.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:7,frontMatter:{id:"faster-fiber",title:"\u26a1 Make Fiber Faster",sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"\ud83e\ude9d Hooks",permalink:"/next/guide/hooks"},next:{title:"Extra",permalink:"/next/category/extra"}},l={},s=[{value:"Custom JSON Encoder/Decoder",id:"custom-json-encoderdecoder",level:2},{value:"References",id:"references",level:3}],p={toc:s},u="wrapper";function m(e){let{components:t,...r}=e;return(0,o.kt)(u,(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"custom-json-encoderdecoder"},"Custom JSON Encoder/Decoder"),(0,o.kt)("p",null,"Since Fiber v2.32.0, we use ",(0,o.kt)("strong",{parentName:"p"},"encoding/json")," as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of ",(0,o.kt)("strong",{parentName:"p"},"encoding/json"),", we recommend you to use these libraries:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/goccy/go-json"},"goccy/go-json")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/bytedance/sonic"},"bytedance/sonic")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/segmentio/encoding"},"segmentio/encoding")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/mailru/easyjson"},"mailru/easyjson")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/minio/simdjson-go"},"minio/simdjson-go")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/wI2L/jettison"},"wI2L/jettison"))),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'package main\n\nimport "github.com/gofiber/fiber/v2"\nimport "github.com/goccy/go-json"\n\nfunc main() {\n app := fiber.New(fiber.Config{\n JSONEncoder: json.Marshal,\n JSONDecoder: json.Unmarshal,\n })\n\n # ...\n}\n')),(0,o.kt)("h3",{id:"references"},"References"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/next/api/client#jsonencoder"},"Set custom JSON encoder for client")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/next/api/client#jsondecoder"},"Set custom JSON decoder for client")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/next/api/fiber#config"},"Set custom JSON encoder for application")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/next/api/fiber#config"},"Set custom JSON decoder for application"))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6494],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>f});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),u=s(r),d=o,f=u["".concat(l,".").concat(d)]||u[d]||m[d]||a;return r?n.createElement(f,i(i({ref:t},p),{},{components:r})):n.createElement(f,i({ref:t},p))}));function f(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c[u]="string"==typeof e?e:o,i[1]=c;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>m,frontMatter:()=>a,metadata:()=>c,toc:()=>s});var n=r(7462),o=(r(7294),r(3905));const a={id:"faster-fiber",title:"\u26a1 Make Fiber Faster",sidebar_position:7},i=void 0,c={unversionedId:"guide/faster-fiber",id:"guide/faster-fiber",title:"\u26a1 Make Fiber Faster",description:"Custom JSON Encoder/Decoder",source:"@site/docs/core/guide/faster-fiber.md",sourceDirName:"guide",slug:"/guide/faster-fiber",permalink:"/next/guide/faster-fiber",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/faster-fiber.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:7,frontMatter:{id:"faster-fiber",title:"\u26a1 Make Fiber Faster",sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"\ud83e\ude9d Hooks",permalink:"/next/guide/hooks"},next:{title:"Extra",permalink:"/next/category/extra"}},l={},s=[{value:"Custom JSON Encoder/Decoder",id:"custom-json-encoderdecoder",level:2},{value:"References",id:"references",level:3}],p={toc:s},u="wrapper";function m(e){let{components:t,...r}=e;return(0,o.kt)(u,(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"custom-json-encoderdecoder"},"Custom JSON Encoder/Decoder"),(0,o.kt)("p",null,"Since Fiber v2.32.0, we use ",(0,o.kt)("strong",{parentName:"p"},"encoding/json")," as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of ",(0,o.kt)("strong",{parentName:"p"},"encoding/json"),", we recommend you to use these libraries:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/goccy/go-json"},"goccy/go-json")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/bytedance/sonic"},"bytedance/sonic")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/segmentio/encoding"},"segmentio/encoding")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/mailru/easyjson"},"mailru/easyjson")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/minio/simdjson-go"},"minio/simdjson-go")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/wI2L/jettison"},"wI2L/jettison"))),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'package main\n\nimport "github.com/gofiber/fiber/v2"\nimport "github.com/goccy/go-json"\n\nfunc main() {\n app := fiber.New(fiber.Config{\n JSONEncoder: json.Marshal,\n JSONDecoder: json.Unmarshal,\n })\n\n # ...\n}\n')),(0,o.kt)("h3",{id:"references"},"References"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/next/api/client#jsonencoder"},"Set custom JSON encoder for client")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/next/api/client#jsondecoder"},"Set custom JSON decoder for client")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/next/api/fiber#config"},"Set custom JSON encoder for application")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/next/api/fiber#config"},"Set custom JSON decoder for application"))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/354823c1.fabb7265.js b/assets/js/354823c1.ce8c9cbc.js similarity index 99% rename from assets/js/354823c1.fabb7265.js rename to assets/js/354823c1.ce8c9cbc.js index 8d495b7780f..bfbfda3bfdf 100644 --- a/assets/js/354823c1.fabb7265.js +++ b/assets/js/354823c1.ce8c9cbc.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6831],{3905:(e,t,r)=>{r.d(t,{Zo:()=>m,kt:()=>f});var n=r(7294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s=n.createContext({}),p=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},m=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),d=p(r),c=i,f=d["".concat(s,".").concat(c)]||d[c]||u[c]||a;return r?n.createElement(f,o(o({ref:t},m),{},{components:r})):n.createElement(f,o({ref:t},m))}));function f(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=r.length,o=new Array(a);o[0]=c;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:i,o[1]=l;for(var p=2;p{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>p});var n=r(7462),i=(r(7294),r(3905));const a={id:"middleware",title:"\ud83e\uddec Middleware",description:"Middleware is a function chained in the HTTP request cycle with access to the Context which it uses to perform a specific action, for example, logging every request or enabling CORS.",sidebar_position:3},o=void 0,l={unversionedId:"api/middleware",id:"version-v1.x/api/middleware",title:"\ud83e\uddec Middleware",description:"Middleware is a function chained in the HTTP request cycle with access to the Context which it uses to perform a specific action, for example, logging every request or enabling CORS.",source:"@site/versioned_docs/version-v1.x/api/middleware.md",sourceDirName:"api",slug:"/api/middleware",permalink:"/v1.x/api/middleware",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:3,frontMatter:{id:"middleware",title:"\ud83e\uddec Middleware",description:"Middleware is a function chained in the HTTP request cycle with access to the Context which it uses to perform a specific action, for example, logging every request or enabling CORS.",sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\ud83e\udde0 Ctx",permalink:"/v1.x/api/ctx"},next:{title:"Guide",permalink:"/v1.x/category/guide"}},s={},p=[{value:"Compress",id:"compress",level:2},{value:"Skipping middleware execution",id:"skipping-middleware-execution",level:2},{value:"FileSystem",id:"filesystem",level:2},{value:"Favicon",id:"favicon",level:2}],m={toc:p},d="wrapper";function u(e){let{components:t,...r}=e;return(0,i.kt)(d,(0,n.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Fiber ships with multiple middleware modules by default:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber"\n "github.com/gofiber/fiber/middleware"\n)\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"*","*","*","*",(0,i.kt)("a",{parentName:"li",href:"#compress"},(0,i.kt)("strong",{parentName:"a"},"Compress"))," Compress middleware that supports ",(0,i.kt)("inlineCode",{parentName:"li"},"deflate"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"gzip")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"brotli")," compression."),(0,i.kt)("li",{parentName:"ul"},"*","*","*","*",(0,i.kt)("a",{parentName:"li",href:"#filesystem"},(0,i.kt)("strong",{parentName:"a"},"FileSystem"))," FileSystem middleware for Fiber, special thanks and credits to Alireza Salary"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Favicon")," Ignore favicon from logs or serve from memory if a file path is provided."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Logger")," HTTP request/response logger."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Pprof")," HTTP server runtime profiling"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Recover")," Recover middleware recovers from panics anywhere in the stack chain and handles the control to the centralized",(0,i.kt)("a",{parentName:"li",href:"../guide/error-handling"}," ErrorHandler"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"RequestID")," Request ID middleware generates a unique id for a request."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Timeout")," A wrapper function for handlers which will raise an error if the handler takes longer than a set amount of time to return")),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Fiber also maintains external middleware modules, these have to be installed separately:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber"\n "github.com/gofiber/"\n)\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/adaptor")," Converter for net/http handlers to/from Fiber request handlers."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/basicauth")," Basic auth middleware provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized for missing or invalid credentials."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/cors")," Enable cross-origin resource sharing ","(","CORS",")"," with various options."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/csrf")," Protect from CSRF exploits."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/helmet")," Helps secure your apps by setting various HTTP headers."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/jwt")," JWT returns a JSON Web Token ","(","JWT",")"," auth middleware."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/keyauth")," Key auth middleware provides a key-based authentication."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/limiter")," Rate-limiting middleware for Fiber. Use to limit repeated requests to public APIs and/or endpoints such as password reset."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/rewrite")," Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/session")," This session middleware is built on top of fasthttp/session by @savsgio MIT. Special thanks to "),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/template")," This package contains 8 template engines"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/websocket")," Based on Gorilla WebSocket for Fiber")),(0,i.kt)("h2",{id:"compress"},"Compress"),(0,i.kt)("p",null,"Compress middleware for with support for ",(0,i.kt)("inlineCode",{parentName:"p"},"deflate"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"gzip")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"brotli"),"compression.",(0,i.kt)("br",{parentName:"p"}),"\n","It will use the fastest compression method depending on the request header ",(0,i.kt)("inlineCode",{parentName:"p"},"Accept-Encoding"),"value."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func Compress(options ...interface{}) fiber.Handler {}\n")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Config"',title:'"Config"'},"type CompressConfig struct {\n // Next defines a function to skip this middleware.\n // Default: nil\n Next func(*fiber.Ctx) bool\n\n // Compression level for brotli, gzip and deflate\n // CompressLevelDisabled = -1\n // CompressLevelDefault = 0\n // CompressLevelBestSpeed = 1\n // CompressLevelBestCompression = 2\n // Default: CompressLevelDefault\n Level int\n}\n")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Compression handler with default settings\napp.Use(middleware.Compress())\n\n// Provide a custom compression level\napp.Use(middleware.Compress(2))\n\n// Pass a next function to skip specific requests\napp.Use(middleware.Compress(func(c *fiber.Ctx) bool {\n return c.Path() == "/dontcompress"\n}))\n\n// Provide a full Config\napp.Use(middleware.Compress(middleware.CompressConfig{\n Next: func(c *fiber.Ctx) bool {\n return c.Path() == "/dontcompress"\n },\n Level: CompressLevelDefault,\n})\n')),(0,i.kt)("h2",{id:"skipping-middleware-execution"},"Skipping middleware execution"),(0,i.kt)("p",null,"When adding middleware to your application, you can also specify when the middleware should be activated and when it should not through a function passed when initialising the middleware using a function passed in the configuration for the middleware."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (*fiber.Ctx) bool\n")),(0,i.kt)("p",null,"This function should return ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," if the middleware should be deactivated. For example, if you would like admin users to be exempt from rate-limiting, you could do something like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"app.Use(limiter.New(limiter.Config{\n Timeout: 10,\n Max: 3,\n Filter: func (c *fiber.Ctx) bool {\n var isUserAdmin bool\n // Your logic here\n return isUserAdmin\n }\n}))\n")),(0,i.kt)("admonition",{type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"If you are using middleware that is included with Fiber by default ","(","for example Compress or Logger",")",", you should use the ",(0,i.kt)("inlineCode",{parentName:"p"},"Next")," field instead of the ",(0,i.kt)("inlineCode",{parentName:"p"},"Filter")," field. For example:"),(0,i.kt)("pre",{parentName:"admonition"},(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Use(middleware.Logger(middleware.LoggerConfig{\n Format: "${time} ${method} ${path}",\n TimeFormat: "15:04:05",\n TimeZone: "Asia/Chongqing",\n Next: func (c *fiber.Ctx) bool {\n var isUserAdmin bool\n // Your logic here\n return isUserAdmin\n }\n}))\n'))),(0,i.kt)("h2",{id:"filesystem"},"FileSystem"),(0,i.kt)("h2",{id:"favicon"},"Favicon"))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6831],{3905:(e,t,r)=>{r.d(t,{Zo:()=>m,kt:()=>f});var n=r(7294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s=n.createContext({}),p=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},m=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),d=p(r),c=i,f=d["".concat(s,".").concat(c)]||d[c]||u[c]||a;return r?n.createElement(f,o(o({ref:t},m),{},{components:r})):n.createElement(f,o({ref:t},m))}));function f(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=r.length,o=new Array(a);o[0]=c;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:i,o[1]=l;for(var p=2;p{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>p});var n=r(7462),i=(r(7294),r(3905));const a={id:"middleware",title:"\ud83e\uddec Middleware",description:"Middleware is a function chained in the HTTP request cycle with access to the Context which it uses to perform a specific action, for example, logging every request or enabling CORS.",sidebar_position:3},o=void 0,l={unversionedId:"api/middleware",id:"version-v1.x/api/middleware",title:"\ud83e\uddec Middleware",description:"Middleware is a function chained in the HTTP request cycle with access to the Context which it uses to perform a specific action, for example, logging every request or enabling CORS.",source:"@site/versioned_docs/version-v1.x/api/middleware.md",sourceDirName:"api",slug:"/api/middleware",permalink:"/v1.x/api/middleware",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:3,frontMatter:{id:"middleware",title:"\ud83e\uddec Middleware",description:"Middleware is a function chained in the HTTP request cycle with access to the Context which it uses to perform a specific action, for example, logging every request or enabling CORS.",sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\ud83e\udde0 Ctx",permalink:"/v1.x/api/ctx"},next:{title:"Guide",permalink:"/v1.x/category/guide"}},s={},p=[{value:"Compress",id:"compress",level:2},{value:"Skipping middleware execution",id:"skipping-middleware-execution",level:2},{value:"FileSystem",id:"filesystem",level:2},{value:"Favicon",id:"favicon",level:2}],m={toc:p},d="wrapper";function u(e){let{components:t,...r}=e;return(0,i.kt)(d,(0,n.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Fiber ships with multiple middleware modules by default:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber"\n "github.com/gofiber/fiber/middleware"\n)\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"*","*","*","*",(0,i.kt)("a",{parentName:"li",href:"#compress"},(0,i.kt)("strong",{parentName:"a"},"Compress"))," Compress middleware that supports ",(0,i.kt)("inlineCode",{parentName:"li"},"deflate"),", ",(0,i.kt)("inlineCode",{parentName:"li"},"gzip")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"brotli")," compression."),(0,i.kt)("li",{parentName:"ul"},"*","*","*","*",(0,i.kt)("a",{parentName:"li",href:"#filesystem"},(0,i.kt)("strong",{parentName:"a"},"FileSystem"))," FileSystem middleware for Fiber, special thanks and credits to Alireza Salary"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Favicon")," Ignore favicon from logs or serve from memory if a file path is provided."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Logger")," HTTP request/response logger."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Pprof")," HTTP server runtime profiling"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Recover")," Recover middleware recovers from panics anywhere in the stack chain and handles the control to the centralized",(0,i.kt)("a",{parentName:"li",href:"../guide/error-handling"}," ErrorHandler"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"RequestID")," Request ID middleware generates a unique id for a request."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Timeout")," A wrapper function for handlers which will raise an error if the handler takes longer than a set amount of time to return")),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Fiber also maintains external middleware modules, these have to be installed separately:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber"\n "github.com/gofiber/"\n)\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/adaptor")," Converter for net/http handlers to/from Fiber request handlers."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/basicauth")," Basic auth middleware provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized for missing or invalid credentials."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/cors")," Enable cross-origin resource sharing ","(","CORS",")"," with various options."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/csrf")," Protect from CSRF exploits."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/helmet")," Helps secure your apps by setting various HTTP headers."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/jwt")," JWT returns a JSON Web Token ","(","JWT",")"," auth middleware."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/keyauth")," Key auth middleware provides a key-based authentication."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/limiter")," Rate-limiting middleware for Fiber. Use to limit repeated requests to public APIs and/or endpoints such as password reset."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/rewrite")," Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/session")," This session middleware is built on top of fasthttp/session by @savsgio MIT. Special thanks to "),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/template")," This package contains 8 template engines"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"gofiber/websocket")," Based on Gorilla WebSocket for Fiber")),(0,i.kt)("h2",{id:"compress"},"Compress"),(0,i.kt)("p",null,"Compress middleware for with support for ",(0,i.kt)("inlineCode",{parentName:"p"},"deflate"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"gzip")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"brotli"),"compression.",(0,i.kt)("br",{parentName:"p"}),"\n","It will use the fastest compression method depending on the request header ",(0,i.kt)("inlineCode",{parentName:"p"},"Accept-Encoding"),"value."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func Compress(options ...interface{}) fiber.Handler {}\n")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Config"',title:'"Config"'},"type CompressConfig struct {\n // Next defines a function to skip this middleware.\n // Default: nil\n Next func(*fiber.Ctx) bool\n\n // Compression level for brotli, gzip and deflate\n // CompressLevelDisabled = -1\n // CompressLevelDefault = 0\n // CompressLevelBestSpeed = 1\n // CompressLevelBestCompression = 2\n // Default: CompressLevelDefault\n Level int\n}\n")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Compression handler with default settings\napp.Use(middleware.Compress())\n\n// Provide a custom compression level\napp.Use(middleware.Compress(2))\n\n// Pass a next function to skip specific requests\napp.Use(middleware.Compress(func(c *fiber.Ctx) bool {\n return c.Path() == "/dontcompress"\n}))\n\n// Provide a full Config\napp.Use(middleware.Compress(middleware.CompressConfig{\n Next: func(c *fiber.Ctx) bool {\n return c.Path() == "/dontcompress"\n },\n Level: CompressLevelDefault,\n})\n')),(0,i.kt)("h2",{id:"skipping-middleware-execution"},"Skipping middleware execution"),(0,i.kt)("p",null,"When adding middleware to your application, you can also specify when the middleware should be activated and when it should not through a function passed when initialising the middleware using a function passed in the configuration for the middleware."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (*fiber.Ctx) bool\n")),(0,i.kt)("p",null,"This function should return ",(0,i.kt)("inlineCode",{parentName:"p"},"true")," if the middleware should be deactivated. For example, if you would like admin users to be exempt from rate-limiting, you could do something like this:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"app.Use(limiter.New(limiter.Config{\n Timeout: 10,\n Max: 3,\n Filter: func (c *fiber.Ctx) bool {\n var isUserAdmin bool\n // Your logic here\n return isUserAdmin\n }\n}))\n")),(0,i.kt)("admonition",{type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"If you are using middleware that is included with Fiber by default ","(","for example Compress or Logger",")",", you should use the ",(0,i.kt)("inlineCode",{parentName:"p"},"Next")," field instead of the ",(0,i.kt)("inlineCode",{parentName:"p"},"Filter")," field. For example:"),(0,i.kt)("pre",{parentName:"admonition"},(0,i.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Use(middleware.Logger(middleware.LoggerConfig{\n Format: "${time} ${method} ${path}",\n TimeFormat: "15:04:05",\n TimeZone: "Asia/Chongqing",\n Next: func (c *fiber.Ctx) bool {\n var isUserAdmin bool\n // Your logic here\n return isUserAdmin\n }\n}))\n'))),(0,i.kt)("h2",{id:"filesystem"},"FileSystem"),(0,i.kt)("h2",{id:"favicon"},"Favicon"))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/354efaa7.d2c58f13.js b/assets/js/354efaa7.1c1174f4.js similarity index 99% rename from assets/js/354efaa7.d2c58f13.js rename to assets/js/354efaa7.1c1174f4.js index 667335b57d4..3f0203dafc1 100644 --- a/assets/js/354efaa7.d2c58f13.js +++ b/assets/js/354efaa7.1c1174f4.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8244],{3905:(e,t,n)=>{n.d(t,{Zo:()=>g,kt:()=>m});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),u=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},g=function(e){var t=u(e.components);return a.createElement(l.Provider,{value:t},e.children)},c="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},f=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,s=e.originalType,l=e.parentName,g=i(e,["components","mdxType","originalType","parentName"]),c=u(n),f=r,m=c["".concat(l,".").concat(f)]||c[f]||p[f]||s;return n?a.createElement(m,o(o({ref:t},g),{},{components:n})):a.createElement(m,o({ref:t},g))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var s=n.length,o=new Array(s);o[0]=f;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i[c]="string"==typeof e?e:r,o[1]=i;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>s,metadata:()=>i,toc:()=>u});var a=n(7462),r=(n(7294),n(3905));const s={id:"mssql",title:"MSSQL"},o=void 0,i={unversionedId:"mssql/mssql",id:"mssql/mssql",title:"MSSQL",description:"Release",source:"@site/docs/storage/mssql/README.md",sourceDirName:"mssql",slug:"/mssql/",permalink:"/storage/mssql/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/mssql/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"mssql",title:"MSSQL"},sidebar:"tutorialSidebar",previous:{title:"MongoDB",permalink:"/storage/mongodb/"},next:{title:"MySQL",permalink:"/storage/mysql/"}},l={},u=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],g={toc:u},c="wrapper";function p(e){let{components:t,...n}=e;return(0,r.kt)(c,(0,a.Z)({},g,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=mssql*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-mssql.yml?label=Tests",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,r.kt)("p",null,"A MSSQL storage driver using ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/microsoft/go-mssqldb"},"microsoft/go-mssqldb"),"."),(0,r.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,r.kt)("h3",{id:"signatures"},"Signatures"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *sql.DB\n")),(0,r.kt)("h3",{id:"installation"},"Installation"),(0,r.kt)("p",null,"MSSQL is tested on the 2 last ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,r.kt)("p",null,"And then install the mssql implementation:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/mssql\n")),(0,r.kt)("h3",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Import the storage package."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/mssql"\n')),(0,r.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := mssql.New()\n\n// Initialize custom config\nstore := mssql.New(mssql.Config{\n Host: "127.0.0.1",\n Port: 1433,\n Database: "fiber",\n Table: "fiber_storage",\n Reset: false,\n GCInterval: 10 * time.Second,\n SslMode: "disable",\n})\n\n// Initialize custom config using connection string\nstore := mssql.New(mssql.Config{\n ConnectionURI: "sqlserver://user:password@localhost:1433?database=fiber"\n Reset: false,\n GCInterval: 10 * time.Second,\n})\n')),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for storage.\ntype Config struct {\n // Connection string to use for DB. Will override all other authentication values if used\n //\n // Optional. Default is ""\n ConnectionURI string\n\n // Host name where the DB is hosted\n //\n // Optional. Default is "127.0.0.1"\n Host string\n\n // Port where the DB is listening on\n //\n // Optional. Default is 1433\n Port int\n\n // Server username\n //\n // Optional. Default is ""\n Username string\n\n // Server password\n //\n // Optional. Default is ""\n Password string\n\n // Instance name\n //\n // Optional. Default is ""\n Instance string\n \n // Database name\n //\n // Optional. Default is "fiber"\n Database string\n\n // Table name\n //\n // Optional. Default is "fiber_storage"\n Table string\n\n // Reset clears any existing keys in existing Table\n //\n // Optional. Default is false\n Reset bool\n\n // Time before deleting expired keys\n //\n // Optional. Default is 10 * time.Second\n GCInterval time.Duration\n\n // The SSL mode for the connection\n //\n // Optional. Default is "disable"\n SslMode string\n}\n')),(0,r.kt)("h3",{id:"default-config"},"Default Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n ConnectionURI: "",\n Host: "127.0.0.1",\n Port: 1433,\n Database: "fiber",\n Table: "fiber_storage",\n Reset: false,\n GCInterval: 10 * time.Second,\n SslMode: "disable",\n}\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8244],{3905:(e,t,n)=>{n.d(t,{Zo:()=>g,kt:()=>m});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),u=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},g=function(e){var t=u(e.components);return a.createElement(l.Provider,{value:t},e.children)},c="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},f=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,s=e.originalType,l=e.parentName,g=i(e,["components","mdxType","originalType","parentName"]),c=u(n),f=r,m=c["".concat(l,".").concat(f)]||c[f]||p[f]||s;return n?a.createElement(m,o(o({ref:t},g),{},{components:n})):a.createElement(m,o({ref:t},g))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var s=n.length,o=new Array(s);o[0]=f;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i[c]="string"==typeof e?e:r,o[1]=i;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>s,metadata:()=>i,toc:()=>u});var a=n(7462),r=(n(7294),n(3905));const s={id:"mssql",title:"MSSQL"},o=void 0,i={unversionedId:"mssql/mssql",id:"mssql/mssql",title:"MSSQL",description:"Release",source:"@site/docs/storage/mssql/README.md",sourceDirName:"mssql",slug:"/mssql/",permalink:"/storage/mssql/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/mssql/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"mssql",title:"MSSQL"},sidebar:"tutorialSidebar",previous:{title:"MongoDB",permalink:"/storage/mongodb/"},next:{title:"MySQL",permalink:"/storage/mysql/"}},l={},u=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],g={toc:u},c="wrapper";function p(e){let{components:t,...n}=e;return(0,r.kt)(c,(0,a.Z)({},g,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=mssql*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-mssql.yml?label=Tests",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,r.kt)("p",null,"A MSSQL storage driver using ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/microsoft/go-mssqldb"},"microsoft/go-mssqldb"),"."),(0,r.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,r.kt)("h3",{id:"signatures"},"Signatures"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *sql.DB\n")),(0,r.kt)("h3",{id:"installation"},"Installation"),(0,r.kt)("p",null,"MSSQL is tested on the 2 last ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,r.kt)("p",null,"And then install the mssql implementation:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/mssql\n")),(0,r.kt)("h3",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Import the storage package."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/mssql"\n')),(0,r.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := mssql.New()\n\n// Initialize custom config\nstore := mssql.New(mssql.Config{\n Host: "127.0.0.1",\n Port: 1433,\n Database: "fiber",\n Table: "fiber_storage",\n Reset: false,\n GCInterval: 10 * time.Second,\n SslMode: "disable",\n})\n\n// Initialize custom config using connection string\nstore := mssql.New(mssql.Config{\n ConnectionURI: "sqlserver://user:password@localhost:1433?database=fiber"\n Reset: false,\n GCInterval: 10 * time.Second,\n})\n')),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for storage.\ntype Config struct {\n // Connection string to use for DB. Will override all other authentication values if used\n //\n // Optional. Default is ""\n ConnectionURI string\n\n // Host name where the DB is hosted\n //\n // Optional. Default is "127.0.0.1"\n Host string\n\n // Port where the DB is listening on\n //\n // Optional. Default is 1433\n Port int\n\n // Server username\n //\n // Optional. Default is ""\n Username string\n\n // Server password\n //\n // Optional. Default is ""\n Password string\n\n // Instance name\n //\n // Optional. Default is ""\n Instance string\n \n // Database name\n //\n // Optional. Default is "fiber"\n Database string\n\n // Table name\n //\n // Optional. Default is "fiber_storage"\n Table string\n\n // Reset clears any existing keys in existing Table\n //\n // Optional. Default is false\n Reset bool\n\n // Time before deleting expired keys\n //\n // Optional. Default is 10 * time.Second\n GCInterval time.Duration\n\n // The SSL mode for the connection\n //\n // Optional. Default is "disable"\n SslMode string\n}\n')),(0,r.kt)("h3",{id:"default-config"},"Default Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n ConnectionURI: "",\n Host: "127.0.0.1",\n Port: 1433,\n Database: "fiber",\n Table: "fiber_storage",\n Reset: false,\n GCInterval: 10 * time.Second,\n SslMode: "disable",\n}\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/3724ddc1.268ab58c.js b/assets/js/3724ddc1.77a264bb.js similarity index 99% rename from assets/js/3724ddc1.268ab58c.js rename to assets/js/3724ddc1.77a264bb.js index 7cffce9a56b..31669b86f8d 100644 --- a/assets/js/3724ddc1.268ab58c.js +++ b/assets/js/3724ddc1.77a264bb.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9449],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>h});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=r.createContext({}),s=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(p.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,p=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),c=s(n),d=a,h=c["".concat(p,".").concat(d)]||c[d]||m[d]||o;return n?r.createElement(h,l(l({ref:t},u),{},{components:n})):r.createElement(h,l({ref:t},u))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,l=new Array(o);l[0]=d;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i[c]="string"==typeof e?e:a,l[1]=i;for(var s=2;s{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>m,frontMatter:()=>o,metadata:()=>i,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const o={slug:"/",id:"welcome",title:"\ud83d\udc4b Welcome",sidebar_position:1},l=void 0,i={unversionedId:"welcome",id:"welcome",title:"\ud83d\udc4b Welcome",description:"An online API documentation with examples so you can start building web apps with Fiber right away!",source:"@site/docs/core/intro.md",sourceDirName:".",slug:"/",permalink:"/next/",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/intro.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{slug:"/",id:"welcome",title:"\ud83d\udc4b Welcome",sidebar_position:1},sidebar:"tutorialSidebar",next:{title:"API",permalink:"/next/category/api"}},p={},s=[{value:"Installation",id:"installation",level:3},{value:"Zero Allocation",id:"zero-allocation",level:3},{value:"Hello, World!",id:"hello-world",level:3},{value:"Basic routing",id:"basic-routing",level:3},{value:"Static files",id:"static-files",level:3},{value:"Note",id:"note",level:3}],u={toc:s},c="wrapper";function m(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"An online API documentation with examples so you can start building web apps with Fiber right away!"),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Fiber")," is an ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/expressjs/express"},"Express")," inspired ",(0,a.kt)("strong",{parentName:"p"},"web framework")," built on top of ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/valyala/fasthttp"},"Fasthttp"),", the ",(0,a.kt)("strong",{parentName:"p"},"fastest")," HTTP engine for ",(0,a.kt)("a",{parentName:"p",href:"https://go.dev/doc/"},"Go"),". Designed to ",(0,a.kt)("strong",{parentName:"p"},"ease")," things up for ",(0,a.kt)("strong",{parentName:"p"},"fast")," development with ",(0,a.kt)("strong",{parentName:"p"},"zero memory allocation")," and ",(0,a.kt)("strong",{parentName:"p"},"performance")," in mind."),(0,a.kt)("p",null,"These docs are for ",(0,a.kt)("strong",{parentName:"p"},"Fiber v2"),", which was released on ",(0,a.kt)("strong",{parentName:"p"},"September 15th, 2020"),"."),(0,a.kt)("h3",{id:"installation"},"Installation"),(0,a.kt)("p",null,"First of all, ",(0,a.kt)("a",{parentName:"p",href:"https://go.dev/dl/"},"download")," and install Go. ",(0,a.kt)("inlineCode",{parentName:"p"},"1.17")," or higher is required."),(0,a.kt)("p",null,"Installation is done using the ",(0,a.kt)("a",{parentName:"p",href:"https://pkg.go.dev/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them"},(0,a.kt)("inlineCode",{parentName:"a"},"go get"))," command:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/fiber/v2\n")),(0,a.kt)("h3",{id:"zero-allocation"},"Zero Allocation"),(0,a.kt)("p",null,"Some values returned from ","*",(0,a.kt)("strong",{parentName:"p"},"fiber.Ctx")," are ",(0,a.kt)("strong",{parentName:"p"},"not")," immutable by default."),(0,a.kt)("p",null,"Because fiber is optimized for ",(0,a.kt)("strong",{parentName:"p"},"high-performance"),", values returned from ",(0,a.kt)("strong",{parentName:"p"},"fiber.Ctx")," are ",(0,a.kt)("strong",{parentName:"p"},"not")," immutable by default and ",(0,a.kt)("strong",{parentName:"p"},"will")," be re-used across requests. As a rule of thumb, you ",(0,a.kt)("strong",{parentName:"p"},"must")," only use context values within the handler, and you ",(0,a.kt)("strong",{parentName:"p"},"must not")," keep any references. As soon as you return from the handler, any values you have obtained from the context will be re-used in future requests and will change below your feet. Here is an example:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func handler(c *fiber.Ctx) error {\n // Variable is only valid within this handler\n result := c.Params("foo") \n\n // ...\n}\n')),(0,a.kt)("p",null,"If you need to persist such values outside the handler, make copies of their ",(0,a.kt)("strong",{parentName:"p"},"underlying buffer")," using the ",(0,a.kt)("a",{parentName:"p",href:"https://pkg.go.dev/builtin/#copy"},"copy")," builtin. Here is an example for persisting a string:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func handler(c *fiber.Ctx) error {\n // Variable is only valid within this handler\n result := c.Params("foo")\n\n // Make a copy\n buffer := make([]byte, len(result))\n copy(buffer, result)\n resultCopy := string(buffer) \n // Variable is now valid forever\n\n // ...\n}\n')),(0,a.kt)("p",null,"We created a custom ",(0,a.kt)("inlineCode",{parentName:"p"},"CopyString")," function that does the above and is available under ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber/tree/master/utils"},"gofiber/utils"),"."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/:foo", func(c *fiber.Ctx) error {\n // Variable is now immutable\n result := utils.CopyString(c.Params("foo")) \n\n // ...\n})\n')),(0,a.kt)("p",null,"Alternatively, you can also use the ",(0,a.kt)("inlineCode",{parentName:"p"},"Immutable")," setting. It will make all values returned from the context immutable, allowing you to persist them anywhere. Of course, this comes at the cost of performance."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"app := fiber.New(fiber.Config{\n Immutable: true,\n})\n")),(0,a.kt)("p",null,"For more information, please check ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber/issues/426"},(0,a.kt)("strong",{parentName:"a"},"#","426"))," and ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber/issues/185"},(0,a.kt)("strong",{parentName:"a"},"#","185")),"."),(0,a.kt)("h3",{id:"hello-world"},"Hello, World!"),(0,a.kt)("p",null,"Embedded below is essentially the most straightforward ",(0,a.kt)("strong",{parentName:"p"},"Fiber")," app you can create:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport "github.com/gofiber/fiber/v2"\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-text"},"go run server.go\n")),(0,a.kt)("p",null,"Browse to ",(0,a.kt)("inlineCode",{parentName:"p"},"http://localhost:3000")," and you should see ",(0,a.kt)("inlineCode",{parentName:"p"},"Hello, World!")," on the page."),(0,a.kt)("h3",{id:"basic-routing"},"Basic routing"),(0,a.kt)("p",null,"Routing refers to determining how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (",(0,a.kt)("inlineCode",{parentName:"p"},"GET"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"PUT"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"POST"),", etc.)."),(0,a.kt)("p",null,"Each route can have ",(0,a.kt)("strong",{parentName:"p"},"multiple handler functions")," that are executed when the route is matched."),(0,a.kt)("p",null,"Route definition takes the following structures:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Function signature\napp.Method(path string, ...func(*fiber.Ctx) error)\n")),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"app")," is an instance of ",(0,a.kt)("strong",{parentName:"li"},"Fiber")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Method")," is an ",(0,a.kt)("a",{parentName:"li",href:"https://docs.gofiber.io/api/app#route-handlers"},"HTTP request method"),": ",(0,a.kt)("inlineCode",{parentName:"li"},"GET"),", ",(0,a.kt)("inlineCode",{parentName:"li"},"PUT"),", ",(0,a.kt)("inlineCode",{parentName:"li"},"POST"),", etc."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"path")," is a virtual path on the server"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"func(*fiber.Ctx) error")," is a callback function containing the ",(0,a.kt)("a",{parentName:"li",href:"https://docs.gofiber.io/api/ctx"},"Context")," executed when the route is matched")),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Simple route")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Respond with "Hello, World!" on root path, "/"\napp.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n})\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Parameters")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// GET http://localhost:8080/hello%20world\n\napp.Get("/:value", func(c *fiber.Ctx) error {\n return c.SendString("value: " + c.Params("value"))\n // => Get request with value: hello world\n})\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Optional parameter")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// GET http://localhost:3000/john\n\napp.Get("/:name?", func(c *fiber.Ctx) error {\n if c.Params("name") != "" {\n return c.SendString("Hello " + c.Params("name"))\n // => Hello john\n }\n return c.SendString("Where is john?")\n})\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Wildcards")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// GET http://localhost:3000/api/user/john\n\napp.Get("/api/*", func(c *fiber.Ctx) error {\n return c.SendString("API path: " + c.Params("*"))\n // => API path: user/john\n})\n')),(0,a.kt)("h3",{id:"static-files"},"Static files"),(0,a.kt)("p",null,"To serve static files such as ",(0,a.kt)("strong",{parentName:"p"},"images"),", ",(0,a.kt)("strong",{parentName:"p"},"CSS"),", and ",(0,a.kt)("strong",{parentName:"p"},"JavaScript")," files, replace your function handler with a file or directory string."),(0,a.kt)("p",null,"Function signature:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"app.Static(prefix, root string, config ...Static)\n")),(0,a.kt)("p",null,"Use the following code to serve files in a directory named ",(0,a.kt)("inlineCode",{parentName:"p"},"./public"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app := fiber.New()\n\napp.Static("/", "./public") \n\napp.Listen(":3000")\n')),(0,a.kt)("p",null,"Now, you can load the files that are in the ",(0,a.kt)("inlineCode",{parentName:"p"},"./public")," directory:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"http://localhost:8080/hello.html\nhttp://localhost:8080/js/jquery.js\nhttp://localhost:8080/css/style.css\n")),(0,a.kt)("h3",{id:"note"},"Note"),(0,a.kt)("p",null,"For more information on how to build APIs in Go with Fiber, please check out this excellent article\n",(0,a.kt)("a",{parentName:"p",href:"https://blog.logrocket.com/express-style-api-go-fiber/"},"on building an express-style API in Go with Fiber"),"."))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9449],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>h});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=r.createContext({}),s=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(p.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,p=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),c=s(n),d=a,h=c["".concat(p,".").concat(d)]||c[d]||m[d]||o;return n?r.createElement(h,l(l({ref:t},u),{},{components:n})):r.createElement(h,l({ref:t},u))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,l=new Array(o);l[0]=d;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i[c]="string"==typeof e?e:a,l[1]=i;for(var s=2;s{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>m,frontMatter:()=>o,metadata:()=>i,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const o={slug:"/",id:"welcome",title:"\ud83d\udc4b Welcome",sidebar_position:1},l=void 0,i={unversionedId:"welcome",id:"welcome",title:"\ud83d\udc4b Welcome",description:"An online API documentation with examples so you can start building web apps with Fiber right away!",source:"@site/docs/core/intro.md",sourceDirName:".",slug:"/",permalink:"/next/",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/intro.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{slug:"/",id:"welcome",title:"\ud83d\udc4b Welcome",sidebar_position:1},sidebar:"tutorialSidebar",next:{title:"API",permalink:"/next/category/api"}},p={},s=[{value:"Installation",id:"installation",level:3},{value:"Zero Allocation",id:"zero-allocation",level:3},{value:"Hello, World!",id:"hello-world",level:3},{value:"Basic routing",id:"basic-routing",level:3},{value:"Static files",id:"static-files",level:3},{value:"Note",id:"note",level:3}],u={toc:s},c="wrapper";function m(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"An online API documentation with examples so you can start building web apps with Fiber right away!"),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Fiber")," is an ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/expressjs/express"},"Express")," inspired ",(0,a.kt)("strong",{parentName:"p"},"web framework")," built on top of ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/valyala/fasthttp"},"Fasthttp"),", the ",(0,a.kt)("strong",{parentName:"p"},"fastest")," HTTP engine for ",(0,a.kt)("a",{parentName:"p",href:"https://go.dev/doc/"},"Go"),". Designed to ",(0,a.kt)("strong",{parentName:"p"},"ease")," things up for ",(0,a.kt)("strong",{parentName:"p"},"fast")," development with ",(0,a.kt)("strong",{parentName:"p"},"zero memory allocation")," and ",(0,a.kt)("strong",{parentName:"p"},"performance")," in mind."),(0,a.kt)("p",null,"These docs are for ",(0,a.kt)("strong",{parentName:"p"},"Fiber v2"),", which was released on ",(0,a.kt)("strong",{parentName:"p"},"September 15th, 2020"),"."),(0,a.kt)("h3",{id:"installation"},"Installation"),(0,a.kt)("p",null,"First of all, ",(0,a.kt)("a",{parentName:"p",href:"https://go.dev/dl/"},"download")," and install Go. ",(0,a.kt)("inlineCode",{parentName:"p"},"1.17")," or higher is required."),(0,a.kt)("p",null,"Installation is done using the ",(0,a.kt)("a",{parentName:"p",href:"https://pkg.go.dev/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them"},(0,a.kt)("inlineCode",{parentName:"a"},"go get"))," command:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/fiber/v2\n")),(0,a.kt)("h3",{id:"zero-allocation"},"Zero Allocation"),(0,a.kt)("p",null,"Some values returned from ","*",(0,a.kt)("strong",{parentName:"p"},"fiber.Ctx")," are ",(0,a.kt)("strong",{parentName:"p"},"not")," immutable by default."),(0,a.kt)("p",null,"Because fiber is optimized for ",(0,a.kt)("strong",{parentName:"p"},"high-performance"),", values returned from ",(0,a.kt)("strong",{parentName:"p"},"fiber.Ctx")," are ",(0,a.kt)("strong",{parentName:"p"},"not")," immutable by default and ",(0,a.kt)("strong",{parentName:"p"},"will")," be re-used across requests. As a rule of thumb, you ",(0,a.kt)("strong",{parentName:"p"},"must")," only use context values within the handler, and you ",(0,a.kt)("strong",{parentName:"p"},"must not")," keep any references. As soon as you return from the handler, any values you have obtained from the context will be re-used in future requests and will change below your feet. Here is an example:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func handler(c *fiber.Ctx) error {\n // Variable is only valid within this handler\n result := c.Params("foo") \n\n // ...\n}\n')),(0,a.kt)("p",null,"If you need to persist such values outside the handler, make copies of their ",(0,a.kt)("strong",{parentName:"p"},"underlying buffer")," using the ",(0,a.kt)("a",{parentName:"p",href:"https://pkg.go.dev/builtin/#copy"},"copy")," builtin. Here is an example for persisting a string:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func handler(c *fiber.Ctx) error {\n // Variable is only valid within this handler\n result := c.Params("foo")\n\n // Make a copy\n buffer := make([]byte, len(result))\n copy(buffer, result)\n resultCopy := string(buffer) \n // Variable is now valid forever\n\n // ...\n}\n')),(0,a.kt)("p",null,"We created a custom ",(0,a.kt)("inlineCode",{parentName:"p"},"CopyString")," function that does the above and is available under ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber/tree/master/utils"},"gofiber/utils"),"."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/:foo", func(c *fiber.Ctx) error {\n // Variable is now immutable\n result := utils.CopyString(c.Params("foo")) \n\n // ...\n})\n')),(0,a.kt)("p",null,"Alternatively, you can also use the ",(0,a.kt)("inlineCode",{parentName:"p"},"Immutable")," setting. It will make all values returned from the context immutable, allowing you to persist them anywhere. Of course, this comes at the cost of performance."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"app := fiber.New(fiber.Config{\n Immutable: true,\n})\n")),(0,a.kt)("p",null,"For more information, please check ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber/issues/426"},(0,a.kt)("strong",{parentName:"a"},"#","426"))," and ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber/issues/185"},(0,a.kt)("strong",{parentName:"a"},"#","185")),"."),(0,a.kt)("h3",{id:"hello-world"},"Hello, World!"),(0,a.kt)("p",null,"Embedded below is essentially the most straightforward ",(0,a.kt)("strong",{parentName:"p"},"Fiber")," app you can create:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport "github.com/gofiber/fiber/v2"\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n })\n\n app.Listen(":3000")\n}\n')),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-text"},"go run server.go\n")),(0,a.kt)("p",null,"Browse to ",(0,a.kt)("inlineCode",{parentName:"p"},"http://localhost:3000")," and you should see ",(0,a.kt)("inlineCode",{parentName:"p"},"Hello, World!")," on the page."),(0,a.kt)("h3",{id:"basic-routing"},"Basic routing"),(0,a.kt)("p",null,"Routing refers to determining how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (",(0,a.kt)("inlineCode",{parentName:"p"},"GET"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"PUT"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"POST"),", etc.)."),(0,a.kt)("p",null,"Each route can have ",(0,a.kt)("strong",{parentName:"p"},"multiple handler functions")," that are executed when the route is matched."),(0,a.kt)("p",null,"Route definition takes the following structures:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Function signature\napp.Method(path string, ...func(*fiber.Ctx) error)\n")),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"app")," is an instance of ",(0,a.kt)("strong",{parentName:"li"},"Fiber")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"Method")," is an ",(0,a.kt)("a",{parentName:"li",href:"https://docs.gofiber.io/api/app#route-handlers"},"HTTP request method"),": ",(0,a.kt)("inlineCode",{parentName:"li"},"GET"),", ",(0,a.kt)("inlineCode",{parentName:"li"},"PUT"),", ",(0,a.kt)("inlineCode",{parentName:"li"},"POST"),", etc."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"path")," is a virtual path on the server"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"func(*fiber.Ctx) error")," is a callback function containing the ",(0,a.kt)("a",{parentName:"li",href:"https://docs.gofiber.io/api/ctx"},"Context")," executed when the route is matched")),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Simple route")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Respond with "Hello, World!" on root path, "/"\napp.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n})\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Parameters")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// GET http://localhost:8080/hello%20world\n\napp.Get("/:value", func(c *fiber.Ctx) error {\n return c.SendString("value: " + c.Params("value"))\n // => Get request with value: hello world\n})\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Optional parameter")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// GET http://localhost:3000/john\n\napp.Get("/:name?", func(c *fiber.Ctx) error {\n if c.Params("name") != "" {\n return c.SendString("Hello " + c.Params("name"))\n // => Hello john\n }\n return c.SendString("Where is john?")\n})\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Wildcards")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// GET http://localhost:3000/api/user/john\n\napp.Get("/api/*", func(c *fiber.Ctx) error {\n return c.SendString("API path: " + c.Params("*"))\n // => API path: user/john\n})\n')),(0,a.kt)("h3",{id:"static-files"},"Static files"),(0,a.kt)("p",null,"To serve static files such as ",(0,a.kt)("strong",{parentName:"p"},"images"),", ",(0,a.kt)("strong",{parentName:"p"},"CSS"),", and ",(0,a.kt)("strong",{parentName:"p"},"JavaScript")," files, replace your function handler with a file or directory string."),(0,a.kt)("p",null,"Function signature:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"app.Static(prefix, root string, config ...Static)\n")),(0,a.kt)("p",null,"Use the following code to serve files in a directory named ",(0,a.kt)("inlineCode",{parentName:"p"},"./public"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app := fiber.New()\n\napp.Static("/", "./public") \n\napp.Listen(":3000")\n')),(0,a.kt)("p",null,"Now, you can load the files that are in the ",(0,a.kt)("inlineCode",{parentName:"p"},"./public")," directory:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"http://localhost:8080/hello.html\nhttp://localhost:8080/js/jquery.js\nhttp://localhost:8080/css/style.css\n")),(0,a.kt)("h3",{id:"note"},"Note"),(0,a.kt)("p",null,"For more information on how to build APIs in Go with Fiber, please check out this excellent article\n",(0,a.kt)("a",{parentName:"p",href:"https://blog.logrocket.com/express-style-api-go-fiber/"},"on building an express-style API in Go with Fiber"),"."))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/37662bdc.585f23dd.js b/assets/js/37662bdc.cbc38765.js similarity index 99% rename from assets/js/37662bdc.585f23dd.js rename to assets/js/37662bdc.cbc38765.js index 5ac888fbdef..80fc0a90b37 100644 --- a/assets/js/37662bdc.585f23dd.js +++ b/assets/js/37662bdc.cbc38765.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5886],{3905:(e,t,n)=>{n.d(t,{Zo:()=>g,kt:()=>s});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=a.createContext({}),d=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},g=function(e){var t=d(e.components);return a.createElement(p.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},c=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,p=e.parentName,g=o(e,["components","mdxType","originalType","parentName"]),u=d(n),c=r,s=u["".concat(p,".").concat(c)]||u[c]||m[c]||i;return n?a.createElement(s,l(l({ref:t},g),{},{components:n})):a.createElement(s,l({ref:t},g))}));function s(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=c;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o[u]="string"==typeof e?e:r,l[1]=o;for(var d=2;d{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>m,frontMatter:()=>i,metadata:()=>o,toc:()=>d});var a=n(7462),r=(n(7294),n(3905));const i={id:"fiberi18n",title:"Fiberi18n"},l=void 0,o={unversionedId:"fiberi18n/fiberi18n",id:"fiberi18n/fiberi18n",title:"Fiberi18n",description:"Release",source:"@site/docs/contrib/fiberi18n/README.md",sourceDirName:"fiberi18n",slug:"/fiberi18n/",permalink:"/contrib/fiberi18n/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/fiberi18n/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"fiberi18n",title:"Fiberi18n"},sidebar:"tutorialSidebar",previous:{title:"Casbin",permalink:"/contrib/casbin/"},next:{title:"Fibernewrelic",permalink:"/contrib/fibernewrelic/"}},p={},d=[{value:"Install",id:"install",level:3},{value:"Signature",id:"signature",level:3},{value:"Config",id:"config",level:3},{value:"Example",id:"example",level:3}],g={toc:d},u="wrapper";function m(e){let{components:t,...n}=e;return(0,r.kt)(u,(0,a.Z)({},g,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=fiberi18n*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://github.com/nicksnyder/go-i18n"},"go-i18n")," support for Fiber."),(0,r.kt)("h3",{id:"install"},"Install"),(0,r.kt)("p",null,"This middleware supports Fiber v2."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"go get -u github.com/gofiber/fiber/v2\ngo get -u github.com/gofiber/contrib/fiberi18n\n")),(0,r.kt)("h3",{id:"signature"},"Signature"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"fiberi18n.New(config ...*Config) fiber.Handler\n")),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Property"),(0,r.kt)("th",{parentName:"tr",align:null},"Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Next"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"func(c *fiber.Ctx) bool")),(0,r.kt)("td",{parentName:"tr",align:null},"A function to skip this middleware when returned ",(0,r.kt)("inlineCode",{parentName:"td"},"true"),"."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"RootPath"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The i18n template folder path."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'"./example/localize"'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"AcceptLanguages"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]language.Tag")),(0,r.kt)("td",{parentName:"tr",align:null},"A collection of languages that can be processed."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]language.Tag{language.Chinese, language.English}"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"FormatBundleFile"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The type of the template file."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'"yaml"'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DefaultLanguage"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"language.Tag")),(0,r.kt)("td",{parentName:"tr",align:null},"The default returned language type."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"language.English"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Loader"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"Loader")),(0,r.kt)("td",{parentName:"tr",align:null},"The implementation of the Loader interface, which defines how to read the file. We provide both os.ReadFile and embed.FS.ReadFile."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"LoaderFunc(os.ReadFile)"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"UnmarshalFunc"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"i18n.UnmarshalFunc")),(0,r.kt)("td",{parentName:"tr",align:null},"The function used for decoding template files."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"yaml.Unmarshal"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"LangHandler"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"func(ctx *fiber.Ctx, defaultLang string) string")),(0,r.kt)("td",{parentName:"tr",align:null},"Used to get the kind of language handled by *fiber.Ctx and defaultLang."),(0,r.kt)("td",{parentName:"tr",align:null},"Retrieved from the request header ",(0,r.kt)("inlineCode",{parentName:"td"},"Accept-Language")," or query parameter ",(0,r.kt)("inlineCode",{parentName:"td"},"lang"),".")))),(0,r.kt)("h3",{id:"example"},"Example"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/contrib/fiberi18n"\n "github.com/gofiber/fiber/v2"\n "github.com/nicksnyder/go-i18n/v2/i18n"\n "golang.org/x/text/language"\n)\n\nfunc main() {\n app := fiber.New()\n app.Use(\n fiberi18n.New(&fiberi18n.Config{\n RootPath: "./example/localize",\n AcceptLanguages: []language.Tag{language.Chinese, language.English},\n DefaultLanguage: language.Chinese,\n }),\n )\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString(fiberi18n.MustGetMessage("welcome"))\n })\n app.Get("/:name", func(ctx *fiber.Ctx) error {\n return ctx.SendString(fiberi18n.MustGetMessage(&i18n.LocalizeConfig{\n MessageID: "welcomeWithName",\n TemplateData: map[string]string{\n "name": ctx.Params("name"),\n },\n }))\n })\n app.Listen("127.0.0.1:3000")\n}\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5886],{3905:(e,t,n)=>{n.d(t,{Zo:()=>g,kt:()=>s});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=a.createContext({}),d=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},g=function(e){var t=d(e.components);return a.createElement(p.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},c=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,p=e.parentName,g=o(e,["components","mdxType","originalType","parentName"]),u=d(n),c=r,s=u["".concat(p,".").concat(c)]||u[c]||m[c]||i;return n?a.createElement(s,l(l({ref:t},g),{},{components:n})):a.createElement(s,l({ref:t},g))}));function s(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=c;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o[u]="string"==typeof e?e:r,l[1]=o;for(var d=2;d{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>m,frontMatter:()=>i,metadata:()=>o,toc:()=>d});var a=n(7462),r=(n(7294),n(3905));const i={id:"fiberi18n",title:"Fiberi18n"},l=void 0,o={unversionedId:"fiberi18n/fiberi18n",id:"fiberi18n/fiberi18n",title:"Fiberi18n",description:"Release",source:"@site/docs/contrib/fiberi18n/README.md",sourceDirName:"fiberi18n",slug:"/fiberi18n/",permalink:"/contrib/fiberi18n/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/fiberi18n/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"fiberi18n",title:"Fiberi18n"},sidebar:"tutorialSidebar",previous:{title:"Casbin",permalink:"/contrib/casbin/"},next:{title:"Fibernewrelic",permalink:"/contrib/fibernewrelic/"}},p={},d=[{value:"Install",id:"install",level:3},{value:"Signature",id:"signature",level:3},{value:"Config",id:"config",level:3},{value:"Example",id:"example",level:3}],g={toc:d},u="wrapper";function m(e){let{components:t,...n}=e;return(0,r.kt)(u,(0,a.Z)({},g,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=fiberi18n*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://github.com/nicksnyder/go-i18n"},"go-i18n")," support for Fiber."),(0,r.kt)("h3",{id:"install"},"Install"),(0,r.kt)("p",null,"This middleware supports Fiber v2."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"go get -u github.com/gofiber/fiber/v2\ngo get -u github.com/gofiber/contrib/fiberi18n\n")),(0,r.kt)("h3",{id:"signature"},"Signature"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"fiberi18n.New(config ...*Config) fiber.Handler\n")),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Property"),(0,r.kt)("th",{parentName:"tr",align:null},"Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Next"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"func(c *fiber.Ctx) bool")),(0,r.kt)("td",{parentName:"tr",align:null},"A function to skip this middleware when returned ",(0,r.kt)("inlineCode",{parentName:"td"},"true"),"."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"RootPath"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The i18n template folder path."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'"./example/localize"'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"AcceptLanguages"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]language.Tag")),(0,r.kt)("td",{parentName:"tr",align:null},"A collection of languages that can be processed."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]language.Tag{language.Chinese, language.English}"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"FormatBundleFile"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"The type of the template file."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'"yaml"'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DefaultLanguage"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"language.Tag")),(0,r.kt)("td",{parentName:"tr",align:null},"The default returned language type."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"language.English"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Loader"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"Loader")),(0,r.kt)("td",{parentName:"tr",align:null},"The implementation of the Loader interface, which defines how to read the file. We provide both os.ReadFile and embed.FS.ReadFile."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"LoaderFunc(os.ReadFile)"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"UnmarshalFunc"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"i18n.UnmarshalFunc")),(0,r.kt)("td",{parentName:"tr",align:null},"The function used for decoding template files."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"yaml.Unmarshal"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"LangHandler"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"func(ctx *fiber.Ctx, defaultLang string) string")),(0,r.kt)("td",{parentName:"tr",align:null},"Used to get the kind of language handled by *fiber.Ctx and defaultLang."),(0,r.kt)("td",{parentName:"tr",align:null},"Retrieved from the request header ",(0,r.kt)("inlineCode",{parentName:"td"},"Accept-Language")," or query parameter ",(0,r.kt)("inlineCode",{parentName:"td"},"lang"),".")))),(0,r.kt)("h3",{id:"example"},"Example"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/contrib/fiberi18n"\n "github.com/gofiber/fiber/v2"\n "github.com/nicksnyder/go-i18n/v2/i18n"\n "golang.org/x/text/language"\n)\n\nfunc main() {\n app := fiber.New()\n app.Use(\n fiberi18n.New(&fiberi18n.Config{\n RootPath: "./example/localize",\n AcceptLanguages: []language.Tag{language.Chinese, language.English},\n DefaultLanguage: language.Chinese,\n }),\n )\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString(fiberi18n.MustGetMessage("welcome"))\n })\n app.Get("/:name", func(ctx *fiber.Ctx) error {\n return ctx.SendString(fiberi18n.MustGetMessage(&i18n.LocalizeConfig{\n MessageID: "welcomeWithName",\n TemplateData: map[string]string{\n "name": ctx.Params("name"),\n },\n }))\n })\n app.Listen("127.0.0.1:3000")\n}\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/3a6391d4.283c9326.js b/assets/js/3a6391d4.961660fa.js similarity index 98% rename from assets/js/3a6391d4.283c9326.js rename to assets/js/3a6391d4.961660fa.js index 42295627add..14113286690 100644 --- a/assets/js/3a6391d4.283c9326.js +++ b/assets/js/3a6391d4.961660fa.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6811],{3905:(e,r,t)=>{t.d(r,{Zo:()=>p,kt:()=>m});var n=t(7294);function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var c=n.createContext({}),d=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):o(o({},r),e)),t},p=function(e){var r=d(e.components);return n.createElement(c.Provider,{value:r},e.children)},s="mdxType",u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),s=d(t),f=i,m=s["".concat(c,".").concat(f)]||s[f]||u[f]||a;return t?n.createElement(m,o(o({ref:r},p),{},{components:t})):n.createElement(m,o({ref:r},p))}));function m(e,r){var t=arguments,i=r&&r.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=f;var l={};for(var c in r)hasOwnProperty.call(r,c)&&(l[c]=r[c]);l.originalType=e,l[s]="string"==typeof e?e:i,o[1]=l;for(var d=2;d{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>d});var n=t(7462),i=(t(7294),t(3905));const a={id:"redirect",title:"Redirect"},o=void 0,l={unversionedId:"api/middleware/redirect",id:"api/middleware/redirect",title:"Redirect",description:"Redirection middleware for Fiber.",source:"@site/docs/core/api/middleware/redirect.md",sourceDirName:"api/middleware",slug:"/api/middleware/redirect",permalink:"/next/api/middleware/redirect",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/redirect.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"redirect",title:"Redirect"},sidebar:"tutorialSidebar",previous:{title:"Recover",permalink:"/next/api/middleware/recover"},next:{title:"RequestID",permalink:"/next/api/middleware/requestid"}},c={},d=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],p={toc:d},s="wrapper";function u(e){let{components:r,...t}=e;return(0,i.kt)(s,(0,n.Z)({},p,t,{components:r,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Redirection middleware for Fiber."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/redirect"\n)\n\nfunc main() {\n app := fiber.New()\n \n app.Use(redirect.New(redirect.Config{\n Rules: map[string]string{\n "/old": "/new",\n "/old/*": "/new/$1",\n },\n StatusCode: 301,\n }))\n \n app.Get("/new", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n })\n app.Get("/new/*", func(c *fiber.Ctx) error {\n return c.SendString("Wildcard: " + c.Params("*"))\n })\n \n app.Listen(":3000")\n}\n')),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Test:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-curl"},"curl http://localhost:3000/old\ncurl http://localhost:3000/old/hello\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Filter defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // Rules defines the URL path rewrite rules. The values captured in asterisk can be\n // retrieved by index e.g. $1, $2 and so on.\n // Required. Example:\n // "/old": "/new",\n // "/api/*": "/$1",\n // "/js/*": "/public/javascripts/$1",\n // "/users/*/orders/*": "/user/$1/order/$2",\n Rules map[string]string\n\n // The status code when redirecting\n // This is ignored if Redirect is disabled\n // Optional. Default: 302 (fiber.StatusFound)\n StatusCode int\n\n rulesRegex map[*regexp.Regexp]string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n StatusCode: fiber.StatusFound,\n}\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6811],{3905:(e,r,t)=>{t.d(r,{Zo:()=>p,kt:()=>m});var n=t(7294);function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var c=n.createContext({}),d=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):o(o({},r),e)),t},p=function(e){var r=d(e.components);return n.createElement(c.Provider,{value:r},e.children)},s="mdxType",u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),s=d(t),f=i,m=s["".concat(c,".").concat(f)]||s[f]||u[f]||a;return t?n.createElement(m,o(o({ref:r},p),{},{components:t})):n.createElement(m,o({ref:r},p))}));function m(e,r){var t=arguments,i=r&&r.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=f;var l={};for(var c in r)hasOwnProperty.call(r,c)&&(l[c]=r[c]);l.originalType=e,l[s]="string"==typeof e?e:i,o[1]=l;for(var d=2;d{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>d});var n=t(7462),i=(t(7294),t(3905));const a={id:"redirect",title:"Redirect"},o=void 0,l={unversionedId:"api/middleware/redirect",id:"api/middleware/redirect",title:"Redirect",description:"Redirection middleware for Fiber.",source:"@site/docs/core/api/middleware/redirect.md",sourceDirName:"api/middleware",slug:"/api/middleware/redirect",permalink:"/next/api/middleware/redirect",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/redirect.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"redirect",title:"Redirect"},sidebar:"tutorialSidebar",previous:{title:"Recover",permalink:"/next/api/middleware/recover"},next:{title:"RequestID",permalink:"/next/api/middleware/requestid"}},c={},d=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],p={toc:d},s="wrapper";function u(e){let{components:r,...t}=e;return(0,i.kt)(s,(0,n.Z)({},p,t,{components:r,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Redirection middleware for Fiber."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/redirect"\n)\n\nfunc main() {\n app := fiber.New()\n \n app.Use(redirect.New(redirect.Config{\n Rules: map[string]string{\n "/old": "/new",\n "/old/*": "/new/$1",\n },\n StatusCode: 301,\n }))\n \n app.Get("/new", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n })\n app.Get("/new/*", func(c *fiber.Ctx) error {\n return c.SendString("Wildcard: " + c.Params("*"))\n })\n \n app.Listen(":3000")\n}\n')),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Test:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-curl"},"curl http://localhost:3000/old\ncurl http://localhost:3000/old/hello\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Filter defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // Rules defines the URL path rewrite rules. The values captured in asterisk can be\n // retrieved by index e.g. $1, $2 and so on.\n // Required. Example:\n // "/old": "/new",\n // "/api/*": "/$1",\n // "/js/*": "/public/javascripts/$1",\n // "/users/*/orders/*": "/user/$1/order/$2",\n Rules map[string]string\n\n // The status code when redirecting\n // This is ignored if Redirect is disabled\n // Optional. Default: 302 (fiber.StatusFound)\n StatusCode int\n\n rulesRegex map[*regexp.Regexp]string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n StatusCode: fiber.StatusFound,\n}\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/3b70e89f.3eaad028.js b/assets/js/3b70e89f.9d433cd0.js similarity index 99% rename from assets/js/3b70e89f.3eaad028.js rename to assets/js/3b70e89f.9d433cd0.js index 70fed97a93c..24cdc6848c7 100644 --- a/assets/js/3b70e89f.3eaad028.js +++ b/assets/js/3b70e89f.9d433cd0.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[41],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>f});var o=n(7294);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}var g=o.createContext({}),s=function(e){var t=o.useContext(g),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},u=function(e){var t=s(e.components);return o.createElement(g.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},d=o.forwardRef((function(e,t){var n=e.components,l=e.mdxType,r=e.originalType,g=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),p=s(n),d=l,f=p["".concat(g,".").concat(d)]||p[d]||c[d]||r;return n?o.createElement(f,a(a({ref:t},u),{},{components:n})):o.createElement(f,a({ref:t},u))}));function f(e,t){var n=arguments,l=t&&t.mdxType;if("string"==typeof e||l){var r=n.length,a=new Array(r);a[0]=d;var i={};for(var g in t)hasOwnProperty.call(t,g)&&(i[g]=t[g]);i.originalType=e,i[p]="string"==typeof e?e:l,a[1]=i;for(var s=2;s{n.r(t),n.d(t,{assets:()=>g,contentTitle:()=>a,default:()=>c,frontMatter:()=>r,metadata:()=>i,toc:()=>s});var o=n(7462),l=(n(7294),n(3905));const r={id:"log",title:"Log",description:"Fiber's built-in log package",sidebar_position:8},a=void 0,i={unversionedId:"api/log",id:"api/log",title:"Log",description:"Fiber's built-in log package",source:"@site/docs/core/api/log.md",sourceDirName:"api",slug:"/api/log",permalink:"/next/api/log",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/log.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:8,frontMatter:{id:"log",title:"Log",description:"Fiber's built-in log package",sidebar_position:8},sidebar:"tutorialSidebar",previous:{title:"Timeout",permalink:"/next/api/middleware/timeout"},next:{title:"Guide",permalink:"/next/category/guide"}},g={},s=[{value:"Log",id:"log",level:2},{value:"Log levels",id:"log-levels",level:2},{value:"Custom log",id:"custom-log",level:2},{value:"Print log",id:"print-log",level:2},{value:"Global log",id:"global-log",level:2},{value:"Set Level",id:"set-level",level:2},{value:"Set output",id:"set-output",level:2},{value:"Bind context",id:"bind-context",level:2}],u={toc:s},p="wrapper";function c(e){let{components:t,...n}=e;return(0,l.kt)(p,(0,o.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("h2",{id:"log"},"Log"),(0,l.kt)("p",null,"We can use logs to observe program behavior, diagnose problems, or configure corresponding alarms.\nAnd defining a well structured log can improve search efficiency and facilitate handling of problems."),(0,l.kt)("p",null,"Fiber provides a default way to print logs in the standard output.\nIt also provides several global functions, such as ",(0,l.kt)("inlineCode",{parentName:"p"},"log.Info"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"log.Errorf"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"log.Warnw"),", etc. "),(0,l.kt)("h2",{id:"log-levels"},"Log levels"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},"const (\n LevelTrace Level = iota\n LevelDebug\n LevelInfo\n LevelWarn\n LevelError\n LevelFatal\n LevelPanic\n)\n")),(0,l.kt)("h2",{id:"custom-log"},"Custom log"),(0,l.kt)("p",null,"Fiber provides the ",(0,l.kt)("inlineCode",{parentName:"p"},"AllLogger")," interface for adapting the various log libraries."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},"type CommonLogger interface {\n Logger\n FormatLogger\n WithLogger\n}\n\ntype AllLogger interface {\n CommonLogger\n ControlLogger\n WithLogger\n}\n")),(0,l.kt)("h2",{id:"print-log"},"Print log"),(0,l.kt)("p",null,"Note: The method of calling the Fatal level will interrupt the program running after printing the log, please use it with caution.\nDirectly print logs of different levels, which will be entered into messageKey, the default is msg."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'log.Info("Hello, World!")\nlog.Debug("Are you OK?")\nlog.Info("42 is the answer to life, the universe, and everything")\nlog.Warn("We are under attack!")\nlog.Error("Houston, we have a problem.")\nlog.Fatal("So Long, and Thanks for All the Fislog.")\nlog.Panic("The system is down.")\n')),(0,l.kt)("p",null,"Format and print logs of different levels, all methods end with f"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'log.Debugf("Hello %s", "boy")\nlog.Infof("%d is the answer to life, the universe, and everything", 233)\nlog.Warnf("We are under attack %s!", "boss")\nlog.Errorf("%s, we have a problem.", "Master Shifu")\nlog.Fatalf("So Long, and Thanks for All the %s.", "banana")\n')),(0,l.kt)("p",null,"Print a message with the key and value, or ",(0,l.kt)("inlineCode",{parentName:"p"},"KEYVALS UNPAIRED")," if the key and value are not a pair."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'log.Debugw("", "Hello", "boy")\nlog.Infow("", "number", 233)\nlog.Warnw("", "job", "boss")\nlog.Errorw("", "name", "Master Shifu")\nlog.Fatalw("", "fruit", "banana")\n')),(0,l.kt)("h2",{id:"global-log"},"Global log"),(0,l.kt)("p",null,"If you are in a project and just want to use a simple log function that can be printed at any time in the global, we provide a global log."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/fiber/v2/log"\n\nlog.Info("info")\nlog.Warn("warn")\n')),(0,l.kt)("p",null,"The above is using the default ",(0,l.kt)("inlineCode",{parentName:"p"},"log.DefaultLogger")," standard output.\nYou can also find an already implemented adaptation under contrib, or use your own implemented Logger and use ",(0,l.kt)("inlineCode",{parentName:"p"},"log.SetLogger")," to set the global log logger."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "log"\n fiberlog "github.com/gofiber/fiber/v2/log"\n)\n\nvar _ log.AllLogger = (*customLogger)(nil)\n\ntype customLogger struct {\n stdlog *log.Logger\n}\n\n// ...\n// inject your custom logger\nfiberlog.SetLogger(customLogger)\n')),(0,l.kt)("h2",{id:"set-level"},"Set Level"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"log.SetLevel")," sets the level of logs below which logs will not be output.\nThe default logger is LevelTrace."),(0,l.kt)("p",null,"Note that this method is not ",(0,l.kt)("strong",{parentName:"p"},"concurrent-safe"),"."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/fiber/v2/log"\n\nlog.SetLevel(log.LevelInfo)\n')),(0,l.kt)("h2",{id:"set-output"},"Set output"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"log.SetOutput")," sets the output destination of the logger. The default logger types the log in the console."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'var logger AllLogger = &defaultLogger{\n stdlog: log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile|log.Lmicroseconds),\n depth: 4,\n}\n')),(0,l.kt)("p",null,"Set the output destination to the file."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'// Output to ./test.log file\nf, err := os.OpenFile("test.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)\nif err != nil {\n return\n}\nlog.SetOutput(f)\n')),(0,l.kt)("p",null,"Set the output destination to the console and file."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'// Output to ./test.log file\nfile, _ := os.OpenFile("test.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)\niw := io.MultiWriter(os.Stdout, file)\nlog.SetOutput(iw)\n')),(0,l.kt)("h2",{id:"bind-context"},"Bind context"),(0,l.kt)("p",null,"Set the context, using the following method will return a ",(0,l.kt)("inlineCode",{parentName:"p"},"CommonLogger")," instance bound to the specified context"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'commonLogger := log.WithContext(ctx)\ncommonLogger.Info("info")\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[41],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>f});var o=n(7294);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}var g=o.createContext({}),s=function(e){var t=o.useContext(g),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},u=function(e){var t=s(e.components);return o.createElement(g.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},d=o.forwardRef((function(e,t){var n=e.components,l=e.mdxType,r=e.originalType,g=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),p=s(n),d=l,f=p["".concat(g,".").concat(d)]||p[d]||c[d]||r;return n?o.createElement(f,a(a({ref:t},u),{},{components:n})):o.createElement(f,a({ref:t},u))}));function f(e,t){var n=arguments,l=t&&t.mdxType;if("string"==typeof e||l){var r=n.length,a=new Array(r);a[0]=d;var i={};for(var g in t)hasOwnProperty.call(t,g)&&(i[g]=t[g]);i.originalType=e,i[p]="string"==typeof e?e:l,a[1]=i;for(var s=2;s{n.r(t),n.d(t,{assets:()=>g,contentTitle:()=>a,default:()=>c,frontMatter:()=>r,metadata:()=>i,toc:()=>s});var o=n(7462),l=(n(7294),n(3905));const r={id:"log",title:"Log",description:"Fiber's built-in log package",sidebar_position:8},a=void 0,i={unversionedId:"api/log",id:"api/log",title:"Log",description:"Fiber's built-in log package",source:"@site/docs/core/api/log.md",sourceDirName:"api",slug:"/api/log",permalink:"/next/api/log",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/log.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:8,frontMatter:{id:"log",title:"Log",description:"Fiber's built-in log package",sidebar_position:8},sidebar:"tutorialSidebar",previous:{title:"Timeout",permalink:"/next/api/middleware/timeout"},next:{title:"Guide",permalink:"/next/category/guide"}},g={},s=[{value:"Log",id:"log",level:2},{value:"Log levels",id:"log-levels",level:2},{value:"Custom log",id:"custom-log",level:2},{value:"Print log",id:"print-log",level:2},{value:"Global log",id:"global-log",level:2},{value:"Set Level",id:"set-level",level:2},{value:"Set output",id:"set-output",level:2},{value:"Bind context",id:"bind-context",level:2}],u={toc:s},p="wrapper";function c(e){let{components:t,...n}=e;return(0,l.kt)(p,(0,o.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("h2",{id:"log"},"Log"),(0,l.kt)("p",null,"We can use logs to observe program behavior, diagnose problems, or configure corresponding alarms.\nAnd defining a well structured log can improve search efficiency and facilitate handling of problems."),(0,l.kt)("p",null,"Fiber provides a default way to print logs in the standard output.\nIt also provides several global functions, such as ",(0,l.kt)("inlineCode",{parentName:"p"},"log.Info"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"log.Errorf"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"log.Warnw"),", etc. "),(0,l.kt)("h2",{id:"log-levels"},"Log levels"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},"const (\n LevelTrace Level = iota\n LevelDebug\n LevelInfo\n LevelWarn\n LevelError\n LevelFatal\n LevelPanic\n)\n")),(0,l.kt)("h2",{id:"custom-log"},"Custom log"),(0,l.kt)("p",null,"Fiber provides the ",(0,l.kt)("inlineCode",{parentName:"p"},"AllLogger")," interface for adapting the various log libraries."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},"type CommonLogger interface {\n Logger\n FormatLogger\n WithLogger\n}\n\ntype AllLogger interface {\n CommonLogger\n ControlLogger\n WithLogger\n}\n")),(0,l.kt)("h2",{id:"print-log"},"Print log"),(0,l.kt)("p",null,"Note: The method of calling the Fatal level will interrupt the program running after printing the log, please use it with caution.\nDirectly print logs of different levels, which will be entered into messageKey, the default is msg."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'log.Info("Hello, World!")\nlog.Debug("Are you OK?")\nlog.Info("42 is the answer to life, the universe, and everything")\nlog.Warn("We are under attack!")\nlog.Error("Houston, we have a problem.")\nlog.Fatal("So Long, and Thanks for All the Fislog.")\nlog.Panic("The system is down.")\n')),(0,l.kt)("p",null,"Format and print logs of different levels, all methods end with f"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'log.Debugf("Hello %s", "boy")\nlog.Infof("%d is the answer to life, the universe, and everything", 233)\nlog.Warnf("We are under attack %s!", "boss")\nlog.Errorf("%s, we have a problem.", "Master Shifu")\nlog.Fatalf("So Long, and Thanks for All the %s.", "banana")\n')),(0,l.kt)("p",null,"Print a message with the key and value, or ",(0,l.kt)("inlineCode",{parentName:"p"},"KEYVALS UNPAIRED")," if the key and value are not a pair."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'log.Debugw("", "Hello", "boy")\nlog.Infow("", "number", 233)\nlog.Warnw("", "job", "boss")\nlog.Errorw("", "name", "Master Shifu")\nlog.Fatalw("", "fruit", "banana")\n')),(0,l.kt)("h2",{id:"global-log"},"Global log"),(0,l.kt)("p",null,"If you are in a project and just want to use a simple log function that can be printed at any time in the global, we provide a global log."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/fiber/v2/log"\n\nlog.Info("info")\nlog.Warn("warn")\n')),(0,l.kt)("p",null,"The above is using the default ",(0,l.kt)("inlineCode",{parentName:"p"},"log.DefaultLogger")," standard output.\nYou can also find an already implemented adaptation under contrib, or use your own implemented Logger and use ",(0,l.kt)("inlineCode",{parentName:"p"},"log.SetLogger")," to set the global log logger."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "log"\n fiberlog "github.com/gofiber/fiber/v2/log"\n)\n\nvar _ log.AllLogger = (*customLogger)(nil)\n\ntype customLogger struct {\n stdlog *log.Logger\n}\n\n// ...\n// inject your custom logger\nfiberlog.SetLogger(customLogger)\n')),(0,l.kt)("h2",{id:"set-level"},"Set Level"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"log.SetLevel")," sets the level of logs below which logs will not be output.\nThe default logger is LevelTrace."),(0,l.kt)("p",null,"Note that this method is not ",(0,l.kt)("strong",{parentName:"p"},"concurrent-safe"),"."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/fiber/v2/log"\n\nlog.SetLevel(log.LevelInfo)\n')),(0,l.kt)("h2",{id:"set-output"},"Set output"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"log.SetOutput")," sets the output destination of the logger. The default logger types the log in the console."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'var logger AllLogger = &defaultLogger{\n stdlog: log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile|log.Lmicroseconds),\n depth: 4,\n}\n')),(0,l.kt)("p",null,"Set the output destination to the file."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'// Output to ./test.log file\nf, err := os.OpenFile("test.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)\nif err != nil {\n return\n}\nlog.SetOutput(f)\n')),(0,l.kt)("p",null,"Set the output destination to the console and file."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'// Output to ./test.log file\nfile, _ := os.OpenFile("test.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)\niw := io.MultiWriter(os.Stdout, file)\nlog.SetOutput(iw)\n')),(0,l.kt)("h2",{id:"bind-context"},"Bind context"),(0,l.kt)("p",null,"Set the context, using the following method will return a ",(0,l.kt)("inlineCode",{parentName:"p"},"CommonLogger")," instance bound to the specified context"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},'commonLogger := log.WithContext(ctx)\ncommonLogger.Info("info")\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/3d13e7fb.ef6449a5.js b/assets/js/3d13e7fb.7ec7128b.js similarity index 98% rename from assets/js/3d13e7fb.ef6449a5.js rename to assets/js/3d13e7fb.7ec7128b.js index 420308a61d3..f8e90df9aca 100644 --- a/assets/js/3d13e7fb.ef6449a5.js +++ b/assets/js/3d13e7fb.7ec7128b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7245],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>g});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},d="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=c(n),u=a,g=d["".concat(s,".").concat(u)]||d[u]||f[u]||i;return n?r.createElement(g,o(o({ref:t},p),{},{components:n})):r.createElement(g,o({ref:t},p))}));function g(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=u;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:a,o[1]=l;for(var c=2;c{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>f,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=n(7462),a=(n(7294),n(3905));const i={id:"etag",title:"ETag"},o=void 0,l={unversionedId:"api/middleware/etag",id:"api/middleware/etag",title:"ETag",description:"ETag middleware for Fiber that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.",source:"@site/docs/core/api/middleware/etag.md",sourceDirName:"api/middleware",slug:"/api/middleware/etag",permalink:"/next/api/middleware/etag",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/etag.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"etag",title:"ETag"},sidebar:"tutorialSidebar",previous:{title:"EnvVar",permalink:"/next/api/middleware/envvar"},next:{title:"ExpVar",permalink:"/next/api/middleware/expvar"}},s={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],p={toc:c},d="wrapper";function f(e){let{components:t,...n}=e;return(0,a.kt)(d,(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"ETag middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/etag"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(etag.New())\n\n// Get / receives Etag: "13-1831710635" in response header\napp.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n})\n\n// Or extend your config for customization\napp.Use(etag.New(etag.Config{\n Weak: true,\n}))\n\n// Get / receives Etag: "W/"13-1831710635" in response header\napp.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n})\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Weak indicates that a weak validator is used. Weak etags are easy\n // to generate, but are far less useful for comparisons. Strong\n // validators are ideal for comparisons but can be very difficult\n // to generate efficiently. Weak ETag values of two representations\n // of the same resources might be semantically equivalent, but not\n // byte-for-byte identical. This means weak etags prevent caching\n // when byte range requests are used, but strong etags mean range\n // requests can still be cached.\n Weak bool\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n Weak: false,\n}\n")))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7245],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>g});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},d="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=c(n),u=a,g=d["".concat(s,".").concat(u)]||d[u]||f[u]||i;return n?r.createElement(g,o(o({ref:t},p),{},{components:n})):r.createElement(g,o({ref:t},p))}));function g(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=u;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:a,o[1]=l;for(var c=2;c{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>f,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=n(7462),a=(n(7294),n(3905));const i={id:"etag",title:"ETag"},o=void 0,l={unversionedId:"api/middleware/etag",id:"api/middleware/etag",title:"ETag",description:"ETag middleware for Fiber that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.",source:"@site/docs/core/api/middleware/etag.md",sourceDirName:"api/middleware",slug:"/api/middleware/etag",permalink:"/next/api/middleware/etag",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/etag.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"etag",title:"ETag"},sidebar:"tutorialSidebar",previous:{title:"EnvVar",permalink:"/next/api/middleware/envvar"},next:{title:"ExpVar",permalink:"/next/api/middleware/expvar"}},s={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],p={toc:c},d="wrapper";function f(e){let{components:t,...n}=e;return(0,a.kt)(d,(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"ETag middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/etag"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(etag.New())\n\n// Get / receives Etag: "13-1831710635" in response header\napp.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n})\n\n// Or extend your config for customization\napp.Use(etag.New(etag.Config{\n Weak: true,\n}))\n\n// Get / receives Etag: "W/"13-1831710635" in response header\napp.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n})\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Weak indicates that a weak validator is used. Weak etags are easy\n // to generate, but are far less useful for comparisons. Strong\n // validators are ideal for comparisons but can be very difficult\n // to generate efficiently. Weak ETag values of two representations\n // of the same resources might be semantically equivalent, but not\n // byte-for-byte identical. This means weak etags prevent caching\n // when byte range requests are used, but strong etags mean range\n // requests can still be cached.\n Weak bool\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n Weak: false,\n}\n")))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/41a4aef8.f062ed12.js b/assets/js/41a4aef8.be23b4a0.js similarity index 99% rename from assets/js/41a4aef8.f062ed12.js rename to assets/js/41a4aef8.be23b4a0.js index 38686e6ff33..bc21c9fa7d9 100644 --- a/assets/js/41a4aef8.f062ed12.js +++ b/assets/js/41a4aef8.be23b4a0.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[513,7554],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>h});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),p=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=p(e.components);return a.createElement(s.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),c=p(n),m=r,h=c["".concat(s,".").concat(m)]||c[m]||d[m]||o;return n?a.createElement(h,l(l({ref:t},u),{},{components:n})):a.createElement(h,l({ref:t},u))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,l=new Array(o);l[0]=m;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[c]="string"==typeof e?e:r,l[1]=i;for(var p=2;p{n.d(t,{Z:()=>l});var a=n(7294),r=n(6010);const o={tabItem:"tabItem_Ymn6"};function l(e){let{children:t,hidden:n,className:l}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,l),hidden:n},t)}},4866:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(7462),r=n(7294),o=n(6010),l=n(2466),i=n(6550),s=n(1980),p=n(7392),u=n(12);function c(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function d(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??c(n);return function(e){const t=(0,p.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const a=(0,i.k6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,s._X)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function g(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=d(e),[l,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:o}))),[s,p]=h({queryString:n,groupId:a}),[c,g]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,u.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),f=(()=>{const e=s??c;return m({value:e,tabValues:o})?e:null})();(0,r.useLayoutEffect)((()=>{f&&i(f)}),[f]);return{selectedValue:l,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),p(e),g(e)}),[p,g,o]),tabValues:o}}var f=n(2389);const k={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function b(e){let{className:t,block:n,selectedValue:i,selectValue:s,tabValues:p}=e;const u=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),d=e=>{const t=e.currentTarget,n=u.indexOf(t),a=p[n].value;a!==i&&(c(t),s(a))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=u.indexOf(e.currentTarget)+1;t=u[n]??u[0];break}case"ArrowLeft":{const n=u.indexOf(e.currentTarget)-1;t=u[n]??u[u.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":n},t)},p.map((e=>{let{value:t,label:n,attributes:l}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>u.push(e),onKeyDown:m,onClick:d},l,{className:(0,o.Z)("tabs__item",k.tabItem,l?.className,{"tabs__item--active":i===t})}),n??t)})))}function N(e){let{lazy:t,children:n,selectedValue:a}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function v(e){const t=g(e);return r.createElement("div",{className:(0,o.Z)("tabs-container",k.tabList)},r.createElement(b,(0,a.Z)({},e,t)),r.createElement(N,(0,a.Z)({},e,t)))}function y(e){const t=(0,f.Z)();return r.createElement(v,(0,a.Z)({key:String(t)},e))}},9835:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>p,default:()=>g,frontMatter:()=>s,metadata:()=>u,toc:()=>d});var a=n(7462),r=(n(7294),n(3905)),o=n(4866),l=n(5162),i=n(6074);const s={id:"routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",sidebar_position:1},p=void 0,u={unversionedId:"guide/routing",id:"version-v2.x/guide/routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",source:"@site/versioned_docs/version-v2.x/guide/routing.md",sourceDirName:"guide",slug:"/guide/routing",permalink:"/guide/routing",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{id:"routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Guide",permalink:"/category/guide"},next:{title:"\ud83c\udfad Grouping",permalink:"/guide/grouping"}},c={},d=[{value:"Handlers",id:"handlers",level:2},{value:"Paths",id:"paths",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Constraints",id:"constraints",level:3},{value:"Middleware",id:"middleware",level:2},{value:"Grouping",id:"grouping",level:2}],m={toc:d},h="wrapper";function g(e){let{components:t,...n}=e;return(0,r.kt)(h,(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"handlers"},"Handlers"),(0,r.kt)(i.default,{mdxType:"RoutingHandler"}),(0,r.kt)("h2",{id:"paths"},"Paths"),(0,r.kt)("p",null,"Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be ",(0,r.kt)("strong",{parentName:"p"},"strings")," or ",(0,r.kt)("strong",{parentName:"p"},"string patterns"),"."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Examples of route paths based on strings")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// This route path will match requests to the root route, "/":\napp.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("root")\n})\n\n// This route path will match requests to "/about":\napp.Get("/about", func(c *fiber.Ctx) error {\n return c.SendString("about")\n})\n\n// This route path will match requests to "/random.txt":\napp.Get("/random.txt", func(c *fiber.Ctx) error {\n return c.SendString("random.txt")\n})\n')),(0,r.kt)("p",null,"As with the expressJs framework, the order of the route declaration plays a role.\nWhen a request is received, the routes are checked in the order in which they are declared."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"So please be careful to write routes with variable parameters after the routes that contain fixed parts, so that these variable parts do not match instead and unexpected behavior occurs.")),(0,r.kt)("h2",{id:"parameters"},"Parameters"),(0,r.kt)("p",null,"Route parameters are dynamic elements in the route, which are ",(0,r.kt)("strong",{parentName:"p"},"named")," or ",(0,r.kt)("strong",{parentName:"p"},"not named segments"),". This segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the ",(0,r.kt)("a",{parentName:"p",href:"https://fiber.wiki/context#params"},"Params")," function, with the name of the route parameter specified in the path as their respective keys or for unnamed parameters the character","(","*",", +",")"," and the counter of this."),(0,r.kt)("p",null,"The characters :, +, and ","*"," are characters that introduce a parameter."),(0,r.kt)("p",null,"Greedy parameters are indicated by wildcard","(","*",")"," or plus","(","+",")"," signs."),(0,r.kt)("p",null,'The routing also offers the possibility to use optional parameters, for the named parameters these are marked with a final "?", unlike the plus sign which is not optional, you can use the wildcard character for a parameter range which is optional and greedy.'),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Example of define routes with route parameters")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Parameters\napp.Get("/user/:name/books/:title", func(c *fiber.Ctx) error {\n fmt.Fprintf(c, "%s\\n", c.Params("name"))\n fmt.Fprintf(c, "%s\\n", c.Params("title"))\n return nil\n})\n// Plus - greedy - not optional\napp.Get("/user/+", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("+"))\n})\n\n// Optional parameter\napp.Get("/user/:name?", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("name"))\n})\n\n// Wildcard - greedy - optional\napp.Get("/user/*", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("*"))\n})\n\n// This route path will match requests to "/v1/some/resource/name:customVerb", since the parameter character is escaped\napp.Get("/v1/some/resource/name\\\\:customVerb", func(c *fiber.Ctx) error {\n return c.SendString("Hello, Community")\n})\n')),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Since the hyphen ","(",(0,r.kt)("inlineCode",{parentName:"p"},"-"),")"," and the dot ","(",(0,r.kt)("inlineCode",{parentName:"p"},"."),")"," are interpreted literally, they can be used along with route parameters for useful purposes.")),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"All special parameter characters can also be escaped with ",(0,r.kt)("inlineCode",{parentName:"p"},'"\\\\"')," and lose their value, so you can use them in the route if you want, like in the custom methods of the ",(0,r.kt)("a",{parentName:"p",href:"https://cloud.google.com/apis/design/custom_methods"},"google api design guide"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// http://localhost:3000/plantae/prunus.persica\napp.Get("/plantae/:genus.:species", func(c *fiber.Ctx) error {\n fmt.Fprintf(c, "%s.%s\\n", c.Params("genus"), c.Params("species"))\n return nil // prunus.persica\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// http://localhost:3000/flights/LAX-SFO\napp.Get("/flights/:from-:to", func(c *fiber.Ctx) error {\n fmt.Fprintf(c, "%s-%s\\n", c.Params("from"), c.Params("to"))\n return nil // LAX-SFO\n})\n')),(0,r.kt)("p",null,"Our intelligent router recognizes that the introductory parameter characters should be part of the request route in this case and can process them as such."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// http://localhost:3000/shop/product/color:blue/size:xs\napp.Get("/shop/product/color::color/size::size", func(c *fiber.Ctx) error {\n fmt.Fprintf(c, "%s:%s\\n", c.Params("color"), c.Params("size"))\n return nil // blue:xs\n})\n')),(0,r.kt)("p",null,"In addition, several parameters in a row and several unnamed parameter characters in the route, such as the wildcard or plus character, are possible, which greatly expands the possibilities of the router for the user."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// GET /@v1\n// Params: "sign" -> "@", "param" -> "v1"\napp.Get("/:sign:param", handler)\n\n// GET /api-v1\n// Params: "name" -> "v1" \napp.Get("/api-:name", handler)\n\n// GET /customer/v1/cart/proxy\n// Params: "*1" -> "customer/", "*2" -> "/cart"\napp.Get("/*v1*/proxy", handler)\n\n// GET /v1/brand/4/shop/blue/xs\n// Params: "*1" -> "brand/4", "*2" -> "blue/xs"\napp.Get("/v1/*/shop/*", handler)\n')),(0,r.kt)("p",null,"We have adapted the routing strongly to the express routing, but currently without the possibility of the regular expressions, because they are quite slow. The possibilities can be tested with version 0.1.7 ","(","express 4",")"," in the online ",(0,r.kt)("a",{parentName:"p",href:"http://forbeslindesay.github.io/express-route-tester/"},"Express route tester"),"."),(0,r.kt)("h3",{id:"constraints"},"Constraints"),(0,r.kt)("p",null,"Route constraints execute when a match has occurred to the incoming URL and the URL path is tokenized into route values by parameters. The feature was intorduced in ",(0,r.kt)("inlineCode",{parentName:"p"},"v2.37.0")," and inspired by ",(0,r.kt)("a",{parentName:"p",href:"https://docs.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-6.0#route-constraints"},".NET Core"),"."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Constraints aren't validation for parameters. If constraint aren't valid for parameter value, Fiber returns ",(0,r.kt)("strong",{parentName:"p"},"404 handler"),".")),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Constraint"),(0,r.kt)("th",{parentName:"tr",align:null},"Example"),(0,r.kt)("th",{parentName:"tr",align:null},"Example matches"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"int"),(0,r.kt)("td",{parentName:"tr",align:null},":id"),(0,r.kt)("td",{parentName:"tr",align:null},"123456789, -123456789")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"bool"),(0,r.kt)("td",{parentName:"tr",align:null},":active"),(0,r.kt)("td",{parentName:"tr",align:null},"true,false")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"guid"),(0,r.kt)("td",{parentName:"tr",align:null},":id"),(0,r.kt)("td",{parentName:"tr",align:null},"CD2C1638-1638-72D5-1638-DEADBEEF1638")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"float"),(0,r.kt)("td",{parentName:"tr",align:null},":weight"),(0,r.kt)("td",{parentName:"tr",align:null},"1.234, -1,001.01e8")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"minLen(value)"),(0,r.kt)("td",{parentName:"tr",align:null},":username"),(0,r.kt)("td",{parentName:"tr",align:null},"Test (must be at least 4 characters)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"maxLen(value)"),(0,r.kt)("td",{parentName:"tr",align:null},":filename"),(0,r.kt)("td",{parentName:"tr",align:null},"MyFile (must be no more than 8 characters")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"len(length)"),(0,r.kt)("td",{parentName:"tr",align:null},":filename"),(0,r.kt)("td",{parentName:"tr",align:null},"somefile.txt (exactly 12 characters)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"min(value)"),(0,r.kt)("td",{parentName:"tr",align:null},":age"),(0,r.kt)("td",{parentName:"tr",align:null},"19 (Integer value must be at least 18)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"max(value)"),(0,r.kt)("td",{parentName:"tr",align:null},":age"),(0,r.kt)("td",{parentName:"tr",align:null},"91 (Integer value must be no more than 120)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"range(min,max)"),(0,r.kt)("td",{parentName:"tr",align:null},":age"),(0,r.kt)("td",{parentName:"tr",align:null},"91 (Integer value must be at least 18 but no more than 120)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"alpha"),(0,r.kt)("td",{parentName:"tr",align:null},":name"),(0,r.kt)("td",{parentName:"tr",align:null},"Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"datetime"),(0,r.kt)("td",{parentName:"tr",align:null},":dob"),(0,r.kt)("td",{parentName:"tr",align:null},"2005-11-01")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"regex(expression)"),(0,r.kt)("td",{parentName:"tr",align:null},":date"),(0,r.kt)("td",{parentName:"tr",align:null},"2022-08-27 (Must match regular expression)")))),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Examples")),(0,r.kt)(o.Z,{mdxType:"Tabs"},(0,r.kt)(l.Z,{value:"single-constraint",label:"Single Constraint",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/:test", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("test"))\n})\n\n// curl -X GET http://localhost:3000/12\n// 12\n\n// curl -X GET http://localhost:3000/1\n// Cannot GET /1\n'))),(0,r.kt)(l.Z,{value:"multiple-constraints",label:"Multiple Constraints",mdxType:"TabItem"},(0,r.kt)("p",null,"You can use ",(0,r.kt)("inlineCode",{parentName:"p"},";")," for multiple constraints."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/:test", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("test"))\n})\n\n// curl -X GET http://localhost:3000/120000\n// Cannot GET /120000\n\n// curl -X GET http://localhost:3000/1\n// Cannot GET /1\n\n// curl -X GET http://localhost:3000/250\n// 250\n'))),(0,r.kt)(l.Z,{value:"regex-constraint",label:"Regex Constraint",mdxType:"TabItem"},(0,r.kt)("p",null,"Fiber precompiles regex query when to register routes. So there're no performance overhead for regex constraint."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/:date", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("date"))\n})\n\n// curl -X GET http://localhost:3000/125\n// Cannot GET /125\n\n// curl -X GET http://localhost:3000/test\n// Cannot GET /test\n\n// curl -X GET http://localhost:3000/2022-08-27\n// 2022-08-27\n')))),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"You should use ",(0,r.kt)("inlineCode",{parentName:"p"},"\\\\")," before routing-specific characters when to use datetime constraint (",(0,r.kt)("inlineCode",{parentName:"p"},"*"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"+"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"?"),", ",(0,r.kt)("inlineCode",{parentName:"p"},":"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"/"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"<"),", ",(0,r.kt)("inlineCode",{parentName:"p"},">"),", ",(0,r.kt)("inlineCode",{parentName:"p"},";"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"("),", ",(0,r.kt)("inlineCode",{parentName:"p"},")"),"), to avoid wrong parsing.")),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Optional Parameter Example")),(0,r.kt)("p",null,"You can impose constraints on optional parameters as well."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/:test?", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("test"))\n})\n// curl -X GET http://localhost:3000/42\n// 42\n// curl -X GET http://localhost:3000/\n//\n// curl -X GET http://localhost:3000/7.0\n// Cannot GET /7.0\n')),(0,r.kt)("h2",{id:"middleware"},"Middleware"),(0,r.kt)("p",null,"Functions that are designed to make changes to the request or response are called ",(0,r.kt)("strong",{parentName:"p"},"middleware functions"),". The ",(0,r.kt)("a",{parentName:"p",href:"/api/ctx#next"},"Next")," is a ",(0,r.kt)("strong",{parentName:"p"},"Fiber")," router function, when called, executes the ",(0,r.kt)("strong",{parentName:"p"},"next")," function that ",(0,r.kt)("strong",{parentName:"p"},"matches")," the current route."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Example of a middleware function")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(func(c *fiber.Ctx) error {\n // Set a custom header on all responses:\n c.Set("X-Custom-Header", "Hello, World")\n\n // Go to next middleware:\n return c.Next()\n})\n\napp.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n})\n')),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"Use")," method path is a ",(0,r.kt)("strong",{parentName:"p"},"mount"),", or ",(0,r.kt)("strong",{parentName:"p"},"prefix")," path, and limits middleware to only apply to any paths requested that begin with it."),(0,r.kt)("h2",{id:"grouping"},"Grouping"),(0,r.kt)("p",null,"If you have many endpoints, you can organize your routes using ",(0,r.kt)("inlineCode",{parentName:"p"},"Group"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", middleware) // /api\n\n v1 := api.Group("/v1", middleware) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", middleware) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("p",null,"More information about this in our ",(0,r.kt)("a",{parentName:"p",href:"/guide/grouping"},"Grouping Guide")))}g.isMDXComponent=!0},6074:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>o,metadata:()=>i,toc:()=>p});var a=n(7462),r=(n(7294),n(3905));const o={id:"route-handlers",title:"Route Handlers"},l=void 0,i={unversionedId:"partials/routing/route-handlers",id:"version-v2.x/partials/routing/route-handlers",title:"Route Handlers",description:"Registers a route bound to a specific HTTP method.",source:"@site/versioned_docs/version-v2.x/partials/routing/handler.md",sourceDirName:"partials/routing",slug:"/partials/routing/route-handlers",permalink:"/partials/routing/route-handlers",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"route-handlers",title:"Route Handlers"}},s={},p=[],u={toc:p},c="wrapper";function d(e){let{components:t,...n}=e;return(0,r.kt)(c,(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Registers a route bound to a specific ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods"},"HTTP method"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signatures"',title:'"Signatures"'},"// HTTP methods\nfunc (app *App) Get(path string, handlers ...Handler) Router\nfunc (app *App) Head(path string, handlers ...Handler) Router\nfunc (app *App) Post(path string, handlers ...Handler) Router\nfunc (app *App) Put(path string, handlers ...Handler) Router\nfunc (app *App) Delete(path string, handlers ...Handler) Router\nfunc (app *App) Connect(path string, handlers ...Handler) Router\nfunc (app *App) Options(path string, handlers ...Handler) Router\nfunc (app *App) Trace(path string, handlers ...Handler) Router\nfunc (app *App) Patch(path string, handlers ...Handler) Router\n\n// Add allows you to specifiy a method as value\nfunc (app *App) Add(method, path string, handlers ...Handler) Router\n\n// All will register the route on all HTTP methods\n// Almost the same as app.Use but not bound to prefixes\nfunc (app *App) All(path string, handlers ...Handler) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Simple GET handler\napp.Get("/api/list", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a GET request!")\n})\n\n// Simple POST handler\napp.Post("/api/register", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a POST request!")\n})\n')),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Use")," can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. ",(0,r.kt)("inlineCode",{parentName:"p"},"/john")," will match ",(0,r.kt)("inlineCode",{parentName:"p"},"/john/doe"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"/johnnnnn")," etc"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Use(args ...interface{}) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Match any request\napp.Use(func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match request starting with /api\napp.Use("/api", func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match requests starting with /api or /home (multiple-prefix support)\napp.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Attach multiple handlers \napp.Use("/api", func(c *fiber.Ctx) error {\n c.Set("X-Custom-Header", random.String(32))\n return c.Next()\n}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[513,7554],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>h});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),p=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=p(e.components);return a.createElement(s.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),c=p(n),m=r,h=c["".concat(s,".").concat(m)]||c[m]||d[m]||o;return n?a.createElement(h,l(l({ref:t},u),{},{components:n})):a.createElement(h,l({ref:t},u))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,l=new Array(o);l[0]=m;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[c]="string"==typeof e?e:r,l[1]=i;for(var p=2;p{n.d(t,{Z:()=>l});var a=n(7294),r=n(6010);const o={tabItem:"tabItem_Ymn6"};function l(e){let{children:t,hidden:n,className:l}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,l),hidden:n},t)}},4866:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(7462),r=n(7294),o=n(6010),l=n(2466),i=n(6550),s=n(1980),p=n(7392),u=n(12);function c(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function d(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??c(n);return function(e){const t=(0,p.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const a=(0,i.k6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,s._X)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function g(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=d(e),[l,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:o}))),[s,p]=h({queryString:n,groupId:a}),[c,g]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,u.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),f=(()=>{const e=s??c;return m({value:e,tabValues:o})?e:null})();(0,r.useLayoutEffect)((()=>{f&&i(f)}),[f]);return{selectedValue:l,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),p(e),g(e)}),[p,g,o]),tabValues:o}}var f=n(2389);const k={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function b(e){let{className:t,block:n,selectedValue:i,selectValue:s,tabValues:p}=e;const u=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),d=e=>{const t=e.currentTarget,n=u.indexOf(t),a=p[n].value;a!==i&&(c(t),s(a))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=u.indexOf(e.currentTarget)+1;t=u[n]??u[0];break}case"ArrowLeft":{const n=u.indexOf(e.currentTarget)-1;t=u[n]??u[u.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":n},t)},p.map((e=>{let{value:t,label:n,attributes:l}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>u.push(e),onKeyDown:m,onClick:d},l,{className:(0,o.Z)("tabs__item",k.tabItem,l?.className,{"tabs__item--active":i===t})}),n??t)})))}function N(e){let{lazy:t,children:n,selectedValue:a}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function v(e){const t=g(e);return r.createElement("div",{className:(0,o.Z)("tabs-container",k.tabList)},r.createElement(b,(0,a.Z)({},e,t)),r.createElement(N,(0,a.Z)({},e,t)))}function y(e){const t=(0,f.Z)();return r.createElement(v,(0,a.Z)({key:String(t)},e))}},9835:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>p,default:()=>g,frontMatter:()=>s,metadata:()=>u,toc:()=>d});var a=n(7462),r=(n(7294),n(3905)),o=n(4866),l=n(5162),i=n(6074);const s={id:"routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",sidebar_position:1},p=void 0,u={unversionedId:"guide/routing",id:"version-v2.x/guide/routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",source:"@site/versioned_docs/version-v2.x/guide/routing.md",sourceDirName:"guide",slug:"/guide/routing",permalink:"/guide/routing",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{id:"routing",title:"\ud83d\udd0c Routing",description:"Routing refers to how an application's endpoints (URIs) respond to client requests.",sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Guide",permalink:"/category/guide"},next:{title:"\ud83c\udfad Grouping",permalink:"/guide/grouping"}},c={},d=[{value:"Handlers",id:"handlers",level:2},{value:"Paths",id:"paths",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Constraints",id:"constraints",level:3},{value:"Middleware",id:"middleware",level:2},{value:"Grouping",id:"grouping",level:2}],m={toc:d},h="wrapper";function g(e){let{components:t,...n}=e;return(0,r.kt)(h,(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"handlers"},"Handlers"),(0,r.kt)(i.default,{mdxType:"RoutingHandler"}),(0,r.kt)("h2",{id:"paths"},"Paths"),(0,r.kt)("p",null,"Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be ",(0,r.kt)("strong",{parentName:"p"},"strings")," or ",(0,r.kt)("strong",{parentName:"p"},"string patterns"),"."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Examples of route paths based on strings")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// This route path will match requests to the root route, "/":\napp.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("root")\n})\n\n// This route path will match requests to "/about":\napp.Get("/about", func(c *fiber.Ctx) error {\n return c.SendString("about")\n})\n\n// This route path will match requests to "/random.txt":\napp.Get("/random.txt", func(c *fiber.Ctx) error {\n return c.SendString("random.txt")\n})\n')),(0,r.kt)("p",null,"As with the expressJs framework, the order of the route declaration plays a role.\nWhen a request is received, the routes are checked in the order in which they are declared."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"So please be careful to write routes with variable parameters after the routes that contain fixed parts, so that these variable parts do not match instead and unexpected behavior occurs.")),(0,r.kt)("h2",{id:"parameters"},"Parameters"),(0,r.kt)("p",null,"Route parameters are dynamic elements in the route, which are ",(0,r.kt)("strong",{parentName:"p"},"named")," or ",(0,r.kt)("strong",{parentName:"p"},"not named segments"),". This segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the ",(0,r.kt)("a",{parentName:"p",href:"https://fiber.wiki/context#params"},"Params")," function, with the name of the route parameter specified in the path as their respective keys or for unnamed parameters the character","(","*",", +",")"," and the counter of this."),(0,r.kt)("p",null,"The characters :, +, and ","*"," are characters that introduce a parameter."),(0,r.kt)("p",null,"Greedy parameters are indicated by wildcard","(","*",")"," or plus","(","+",")"," signs."),(0,r.kt)("p",null,'The routing also offers the possibility to use optional parameters, for the named parameters these are marked with a final "?", unlike the plus sign which is not optional, you can use the wildcard character for a parameter range which is optional and greedy.'),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Example of define routes with route parameters")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Parameters\napp.Get("/user/:name/books/:title", func(c *fiber.Ctx) error {\n fmt.Fprintf(c, "%s\\n", c.Params("name"))\n fmt.Fprintf(c, "%s\\n", c.Params("title"))\n return nil\n})\n// Plus - greedy - not optional\napp.Get("/user/+", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("+"))\n})\n\n// Optional parameter\napp.Get("/user/:name?", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("name"))\n})\n\n// Wildcard - greedy - optional\napp.Get("/user/*", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("*"))\n})\n\n// This route path will match requests to "/v1/some/resource/name:customVerb", since the parameter character is escaped\napp.Get("/v1/some/resource/name\\\\:customVerb", func(c *fiber.Ctx) error {\n return c.SendString("Hello, Community")\n})\n')),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Since the hyphen ","(",(0,r.kt)("inlineCode",{parentName:"p"},"-"),")"," and the dot ","(",(0,r.kt)("inlineCode",{parentName:"p"},"."),")"," are interpreted literally, they can be used along with route parameters for useful purposes.")),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"All special parameter characters can also be escaped with ",(0,r.kt)("inlineCode",{parentName:"p"},'"\\\\"')," and lose their value, so you can use them in the route if you want, like in the custom methods of the ",(0,r.kt)("a",{parentName:"p",href:"https://cloud.google.com/apis/design/custom_methods"},"google api design guide"),".")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// http://localhost:3000/plantae/prunus.persica\napp.Get("/plantae/:genus.:species", func(c *fiber.Ctx) error {\n fmt.Fprintf(c, "%s.%s\\n", c.Params("genus"), c.Params("species"))\n return nil // prunus.persica\n})\n')),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// http://localhost:3000/flights/LAX-SFO\napp.Get("/flights/:from-:to", func(c *fiber.Ctx) error {\n fmt.Fprintf(c, "%s-%s\\n", c.Params("from"), c.Params("to"))\n return nil // LAX-SFO\n})\n')),(0,r.kt)("p",null,"Our intelligent router recognizes that the introductory parameter characters should be part of the request route in this case and can process them as such."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// http://localhost:3000/shop/product/color:blue/size:xs\napp.Get("/shop/product/color::color/size::size", func(c *fiber.Ctx) error {\n fmt.Fprintf(c, "%s:%s\\n", c.Params("color"), c.Params("size"))\n return nil // blue:xs\n})\n')),(0,r.kt)("p",null,"In addition, several parameters in a row and several unnamed parameter characters in the route, such as the wildcard or plus character, are possible, which greatly expands the possibilities of the router for the user."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// GET /@v1\n// Params: "sign" -> "@", "param" -> "v1"\napp.Get("/:sign:param", handler)\n\n// GET /api-v1\n// Params: "name" -> "v1" \napp.Get("/api-:name", handler)\n\n// GET /customer/v1/cart/proxy\n// Params: "*1" -> "customer/", "*2" -> "/cart"\napp.Get("/*v1*/proxy", handler)\n\n// GET /v1/brand/4/shop/blue/xs\n// Params: "*1" -> "brand/4", "*2" -> "blue/xs"\napp.Get("/v1/*/shop/*", handler)\n')),(0,r.kt)("p",null,"We have adapted the routing strongly to the express routing, but currently without the possibility of the regular expressions, because they are quite slow. The possibilities can be tested with version 0.1.7 ","(","express 4",")"," in the online ",(0,r.kt)("a",{parentName:"p",href:"http://forbeslindesay.github.io/express-route-tester/"},"Express route tester"),"."),(0,r.kt)("h3",{id:"constraints"},"Constraints"),(0,r.kt)("p",null,"Route constraints execute when a match has occurred to the incoming URL and the URL path is tokenized into route values by parameters. The feature was intorduced in ",(0,r.kt)("inlineCode",{parentName:"p"},"v2.37.0")," and inspired by ",(0,r.kt)("a",{parentName:"p",href:"https://docs.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-6.0#route-constraints"},".NET Core"),"."),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"Constraints aren't validation for parameters. If constraint aren't valid for parameter value, Fiber returns ",(0,r.kt)("strong",{parentName:"p"},"404 handler"),".")),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Constraint"),(0,r.kt)("th",{parentName:"tr",align:null},"Example"),(0,r.kt)("th",{parentName:"tr",align:null},"Example matches"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"int"),(0,r.kt)("td",{parentName:"tr",align:null},":id"),(0,r.kt)("td",{parentName:"tr",align:null},"123456789, -123456789")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"bool"),(0,r.kt)("td",{parentName:"tr",align:null},":active"),(0,r.kt)("td",{parentName:"tr",align:null},"true,false")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"guid"),(0,r.kt)("td",{parentName:"tr",align:null},":id"),(0,r.kt)("td",{parentName:"tr",align:null},"CD2C1638-1638-72D5-1638-DEADBEEF1638")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"float"),(0,r.kt)("td",{parentName:"tr",align:null},":weight"),(0,r.kt)("td",{parentName:"tr",align:null},"1.234, -1,001.01e8")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"minLen(value)"),(0,r.kt)("td",{parentName:"tr",align:null},":username"),(0,r.kt)("td",{parentName:"tr",align:null},"Test (must be at least 4 characters)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"maxLen(value)"),(0,r.kt)("td",{parentName:"tr",align:null},":filename"),(0,r.kt)("td",{parentName:"tr",align:null},"MyFile (must be no more than 8 characters")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"len(length)"),(0,r.kt)("td",{parentName:"tr",align:null},":filename"),(0,r.kt)("td",{parentName:"tr",align:null},"somefile.txt (exactly 12 characters)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"min(value)"),(0,r.kt)("td",{parentName:"tr",align:null},":age"),(0,r.kt)("td",{parentName:"tr",align:null},"19 (Integer value must be at least 18)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"max(value)"),(0,r.kt)("td",{parentName:"tr",align:null},":age"),(0,r.kt)("td",{parentName:"tr",align:null},"91 (Integer value must be no more than 120)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"range(min,max)"),(0,r.kt)("td",{parentName:"tr",align:null},":age"),(0,r.kt)("td",{parentName:"tr",align:null},"91 (Integer value must be at least 18 but no more than 120)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"alpha"),(0,r.kt)("td",{parentName:"tr",align:null},":name"),(0,r.kt)("td",{parentName:"tr",align:null},"Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive)")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"datetime"),(0,r.kt)("td",{parentName:"tr",align:null},":dob"),(0,r.kt)("td",{parentName:"tr",align:null},"2005-11-01")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"regex(expression)"),(0,r.kt)("td",{parentName:"tr",align:null},":date"),(0,r.kt)("td",{parentName:"tr",align:null},"2022-08-27 (Must match regular expression)")))),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Examples")),(0,r.kt)(o.Z,{mdxType:"Tabs"},(0,r.kt)(l.Z,{value:"single-constraint",label:"Single Constraint",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/:test", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("test"))\n})\n\n// curl -X GET http://localhost:3000/12\n// 12\n\n// curl -X GET http://localhost:3000/1\n// Cannot GET /1\n'))),(0,r.kt)(l.Z,{value:"multiple-constraints",label:"Multiple Constraints",mdxType:"TabItem"},(0,r.kt)("p",null,"You can use ",(0,r.kt)("inlineCode",{parentName:"p"},";")," for multiple constraints."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/:test", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("test"))\n})\n\n// curl -X GET http://localhost:3000/120000\n// Cannot GET /120000\n\n// curl -X GET http://localhost:3000/1\n// Cannot GET /1\n\n// curl -X GET http://localhost:3000/250\n// 250\n'))),(0,r.kt)(l.Z,{value:"regex-constraint",label:"Regex Constraint",mdxType:"TabItem"},(0,r.kt)("p",null,"Fiber precompiles regex query when to register routes. So there're no performance overhead for regex constraint."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/:date", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("date"))\n})\n\n// curl -X GET http://localhost:3000/125\n// Cannot GET /125\n\n// curl -X GET http://localhost:3000/test\n// Cannot GET /test\n\n// curl -X GET http://localhost:3000/2022-08-27\n// 2022-08-27\n')))),(0,r.kt)("admonition",{type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"You should use ",(0,r.kt)("inlineCode",{parentName:"p"},"\\\\")," before routing-specific characters when to use datetime constraint (",(0,r.kt)("inlineCode",{parentName:"p"},"*"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"+"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"?"),", ",(0,r.kt)("inlineCode",{parentName:"p"},":"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"/"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"<"),", ",(0,r.kt)("inlineCode",{parentName:"p"},">"),", ",(0,r.kt)("inlineCode",{parentName:"p"},";"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"("),", ",(0,r.kt)("inlineCode",{parentName:"p"},")"),"), to avoid wrong parsing.")),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Optional Parameter Example")),(0,r.kt)("p",null,"You can impose constraints on optional parameters as well."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/:test?", func(c *fiber.Ctx) error {\n return c.SendString(c.Params("test"))\n})\n// curl -X GET http://localhost:3000/42\n// 42\n// curl -X GET http://localhost:3000/\n//\n// curl -X GET http://localhost:3000/7.0\n// Cannot GET /7.0\n')),(0,r.kt)("h2",{id:"middleware"},"Middleware"),(0,r.kt)("p",null,"Functions that are designed to make changes to the request or response are called ",(0,r.kt)("strong",{parentName:"p"},"middleware functions"),". The ",(0,r.kt)("a",{parentName:"p",href:"/api/ctx#next"},"Next")," is a ",(0,r.kt)("strong",{parentName:"p"},"Fiber")," router function, when called, executes the ",(0,r.kt)("strong",{parentName:"p"},"next")," function that ",(0,r.kt)("strong",{parentName:"p"},"matches")," the current route."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Example of a middleware function")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(func(c *fiber.Ctx) error {\n // Set a custom header on all responses:\n c.Set("X-Custom-Header", "Hello, World")\n\n // Go to next middleware:\n return c.Next()\n})\n\napp.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n})\n')),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"Use")," method path is a ",(0,r.kt)("strong",{parentName:"p"},"mount"),", or ",(0,r.kt)("strong",{parentName:"p"},"prefix")," path, and limits middleware to only apply to any paths requested that begin with it."),(0,r.kt)("h2",{id:"grouping"},"Grouping"),(0,r.kt)("p",null,"If you have many endpoints, you can organize your routes using ",(0,r.kt)("inlineCode",{parentName:"p"},"Group"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", middleware) // /api\n\n v1 := api.Group("/v1", middleware) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", middleware) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("p",null,"More information about this in our ",(0,r.kt)("a",{parentName:"p",href:"/guide/grouping"},"Grouping Guide")))}g.isMDXComponent=!0},6074:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>o,metadata:()=>i,toc:()=>p});var a=n(7462),r=(n(7294),n(3905));const o={id:"route-handlers",title:"Route Handlers"},l=void 0,i={unversionedId:"partials/routing/route-handlers",id:"version-v2.x/partials/routing/route-handlers",title:"Route Handlers",description:"Registers a route bound to a specific HTTP method.",source:"@site/versioned_docs/version-v2.x/partials/routing/handler.md",sourceDirName:"partials/routing",slug:"/partials/routing/route-handlers",permalink:"/partials/routing/route-handlers",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"route-handlers",title:"Route Handlers"}},s={},p=[],u={toc:p},c="wrapper";function d(e){let{components:t,...n}=e;return(0,r.kt)(c,(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Registers a route bound to a specific ",(0,r.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods"},"HTTP method"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signatures"',title:'"Signatures"'},"// HTTP methods\nfunc (app *App) Get(path string, handlers ...Handler) Router\nfunc (app *App) Head(path string, handlers ...Handler) Router\nfunc (app *App) Post(path string, handlers ...Handler) Router\nfunc (app *App) Put(path string, handlers ...Handler) Router\nfunc (app *App) Delete(path string, handlers ...Handler) Router\nfunc (app *App) Connect(path string, handlers ...Handler) Router\nfunc (app *App) Options(path string, handlers ...Handler) Router\nfunc (app *App) Trace(path string, handlers ...Handler) Router\nfunc (app *App) Patch(path string, handlers ...Handler) Router\n\n// Add allows you to specifiy a method as value\nfunc (app *App) Add(method, path string, handlers ...Handler) Router\n\n// All will register the route on all HTTP methods\n// Almost the same as app.Use but not bound to prefixes\nfunc (app *App) All(path string, handlers ...Handler) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Simple GET handler\napp.Get("/api/list", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a GET request!")\n})\n\n// Simple POST handler\napp.Post("/api/register", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a POST request!")\n})\n')),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Use")," can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. ",(0,r.kt)("inlineCode",{parentName:"p"},"/john")," will match ",(0,r.kt)("inlineCode",{parentName:"p"},"/john/doe"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"/johnnnnn")," etc"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Use(args ...interface{}) Router\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Match any request\napp.Use(func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match request starting with /api\napp.Use("/api", func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match requests starting with /api or /home (multiple-prefix support)\napp.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Attach multiple handlers \napp.Use("/api", func(c *fiber.Ctx) error {\n c.Set("X-Custom-Header", random.String(32))\n return c.Next()\n}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/48c6cc07.12cecbda.js b/assets/js/48c6cc07.c9ca9d61.js similarity index 99% rename from assets/js/48c6cc07.12cecbda.js rename to assets/js/48c6cc07.c9ca9d61.js index 0a685ad659b..86e646b4180 100644 --- a/assets/js/48c6cc07.12cecbda.js +++ b/assets/js/48c6cc07.c9ca9d61.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6843],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>R});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var d=n.createContext({}),c=function(e){var t=n.useContext(d),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},u=function(e){var t=c(e.components);return n.createElement(d.Provider,{value:t},e.children)},l="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},C=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,d=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),l=c(r),C=a,R=l["".concat(d,".").concat(C)]||l[C]||p[C]||o;return r?n.createElement(R,i(i({ref:t},u),{},{components:r})):n.createElement(R,i({ref:t},u))}));function R(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=C;var s={};for(var d in t)hasOwnProperty.call(t,d)&&(s[d]=t[d]);s.originalType=e,s[l]="string"==typeof e?e:a,i[1]=s;for(var c=2;c{r.r(t),r.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>p,frontMatter:()=>o,metadata:()=>s,toc:()=>c});var n=r(7462),a=(r(7294),r(3905));const o={id:"constants",title:"\ud83d\udccb Constants",description:"Some constants for Fiber.",sidebar_position:4},i=void 0,s={unversionedId:"api/constants",id:"version-v2.x/api/constants",title:"\ud83d\udccb Constants",description:"Some constants for Fiber.",source:"@site/versioned_docs/version-v2.x/api/constants.md",sourceDirName:"api",slug:"/api/constants",permalink:"/api/constants",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:4,frontMatter:{id:"constants",title:"\ud83d\udccb Constants",description:"Some constants for Fiber.",sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\ud83e\udde0 Ctx",permalink:"/api/ctx"},next:{title:"\ud83c\udf0e Client",permalink:"/api/client"}},d={},c=[],u={toc:c},l="wrapper";function p(e){let{components:t,...r}=e;return(0,a.kt)(l,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"HTTP methods were copied from net/http."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const (\n MethodGet = "GET" // RFC 7231, 4.3.1\n MethodHead = "HEAD" // RFC 7231, 4.3.2\n MethodPost = "POST" // RFC 7231, 4.3.3\n MethodPut = "PUT" // RFC 7231, 4.3.4\n MethodPatch = "PATCH" // RFC 5789\n MethodDelete = "DELETE" // RFC 7231, 4.3.5\n MethodConnect = "CONNECT" // RFC 7231, 4.3.6\n MethodOptions = "OPTIONS" // RFC 7231, 4.3.7\n MethodTrace = "TRACE" // RFC 7231, 4.3.8\n methodUse = "USE"\n)\n')),(0,a.kt)("p",null,"MIME types that are commonly used"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const (\n MIMETextXML = "text/xml"\n MIMETextHTML = "text/html"\n MIMETextPlain = "text/plain"\n MIMEApplicationXML = "application/xml"\n MIMEApplicationJSON = "application/json"\n MIMEApplicationJavaScript = "application/javascript"\n MIMEApplicationForm = "application/x-www-form-urlencoded"\n MIMEOctetStream = "application/octet-stream"\n MIMEMultipartForm = "multipart/form-data"\n\n MIMETextXMLCharsetUTF8 = "text/xml; charset=utf-8"\n MIMETextHTMLCharsetUTF8 = "text/html; charset=utf-8"\n MIMETextPlainCharsetUTF8 = "text/plain; charset=utf-8"\n MIMEApplicationXMLCharsetUTF8 = "application/xml; charset=utf-8"\n MIMEApplicationJSONCharsetUTF8 = "application/json; charset=utf-8"\n MIMEApplicationJavaScriptCharsetUTF8 = "application/javascript; charset=utf-8"\n)\n')),(0,a.kt)("p",null,"HTTP status codes were copied from net/http."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"const (\n StatusContinue = 100 // RFC 7231, 6.2.1\n StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2\n StatusProcessing = 102 // RFC 2518, 10.1\n StatusEarlyHints = 103 // RFC 8297\n StatusOK = 200 // RFC 7231, 6.3.1\n StatusCreated = 201 // RFC 7231, 6.3.2\n StatusAccepted = 202 // RFC 7231, 6.3.3\n StatusNonAuthoritativeInformation = 203 // RFC 7231, 6.3.4\n StatusNoContent = 204 // RFC 7231, 6.3.5\n StatusResetContent = 205 // RFC 7231, 6.3.6\n StatusPartialContent = 206 // RFC 7233, 4.1\n StatusMultiStatus = 207 // RFC 4918, 11.1\n StatusAlreadyReported = 208 // RFC 5842, 7.1\n StatusIMUsed = 226 // RFC 3229, 10.4.1\n StatusMultipleChoices = 300 // RFC 7231, 6.4.1\n StatusMovedPermanently = 301 // RFC 7231, 6.4.2\n StatusFound = 302 // RFC 7231, 6.4.3\n StatusSeeOther = 303 // RFC 7231, 6.4.4\n StatusNotModified = 304 // RFC 7232, 4.1\n StatusUseProxy = 305 // RFC 7231, 6.4.5\n StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7\n StatusPermanentRedirect = 308 // RFC 7538, 3\n StatusBadRequest = 400 // RFC 7231, 6.5.1\n StatusUnauthorized = 401 // RFC 7235, 3.1\n StatusPaymentRequired = 402 // RFC 7231, 6.5.2\n StatusForbidden = 403 // RFC 7231, 6.5.3\n StatusNotFound = 404 // RFC 7231, 6.5.4\n StatusMethodNotAllowed = 405 // RFC 7231, 6.5.5\n StatusNotAcceptable = 406 // RFC 7231, 6.5.6\n StatusProxyAuthRequired = 407 // RFC 7235, 3.2\n StatusRequestTimeout = 408 // RFC 7231, 6.5.7\n StatusConflict = 409 // RFC 7231, 6.5.8\n StatusGone = 410 // RFC 7231, 6.5.9\n StatusLengthRequired = 411 // RFC 7231, 6.5.10\n StatusPreconditionFailed = 412 // RFC 7232, 4.2\n StatusRequestEntityTooLarge = 413 // RFC 7231, 6.5.11\n StatusRequestURITooLong = 414 // RFC 7231, 6.5.12\n StatusUnsupportedMediaType = 415 // RFC 7231, 6.5.13\n StatusRequestedRangeNotSatisfiable = 416 // RFC 7233, 4.4\n StatusExpectationFailed = 417 // RFC 7231, 6.5.14\n StatusTeapot = 418 // RFC 7168, 2.3.3\n StatusMisdirectedRequest = 421 // RFC 7540, 9.1.2\n StatusUnprocessableEntity = 422 // RFC 4918, 11.2\n StatusLocked = 423 // RFC 4918, 11.3\n StatusFailedDependency = 424 // RFC 4918, 11.4\n StatusTooEarly = 425 // RFC 8470, 5.2.\n StatusUpgradeRequired = 426 // RFC 7231, 6.5.15\n StatusPreconditionRequired = 428 // RFC 6585, 3\n StatusTooManyRequests = 429 // RFC 6585, 4\n StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5\n StatusUnavailableForLegalReasons = 451 // RFC 7725, 3\n StatusInternalServerError = 500 // RFC 7231, 6.6.1\n StatusNotImplemented = 501 // RFC 7231, 6.6.2\n StatusBadGateway = 502 // RFC 7231, 6.6.3\n StatusServiceUnavailable = 503 // RFC 7231, 6.6.4\n StatusGatewayTimeout = 504 // RFC 7231, 6.6.5\n StatusHTTPVersionNotSupported = 505 // RFC 7231, 6.6.6\n StatusVariantAlsoNegotiates = 506 // RFC 2295, 8.1\n StatusInsufficientStorage = 507 // RFC 4918, 11.5\n StatusLoopDetected = 508 // RFC 5842, 7.2\n StatusNotExtended = 510 // RFC 2774, 7\n StatusNetworkAuthenticationRequired = 511 // RFC 6585, 6\n)\n")),(0,a.kt)("p",null,"Errors"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var (\n ErrBadRequest = NewError(StatusBadRequest) // RFC 7231, 6.5.1\n ErrUnauthorized = NewError(StatusUnauthorized) // RFC 7235, 3.1\n ErrPaymentRequired = NewError(StatusPaymentRequired) // RFC 7231, 6.5.2\n ErrForbidden = NewError(StatusForbidden) // RFC 7231, 6.5.3\n ErrNotFound = NewError(StatusNotFound) // RFC 7231, 6.5.4\n ErrMethodNotAllowed = NewError(StatusMethodNotAllowed) // RFC 7231, 6.5.5\n ErrNotAcceptable = NewError(StatusNotAcceptable) // RFC 7231, 6.5.6\n ErrProxyAuthRequired = NewError(StatusProxyAuthRequired) // RFC 7235, 3.2\n ErrRequestTimeout = NewError(StatusRequestTimeout) // RFC 7231, 6.5.7\n ErrConflict = NewError(StatusConflict) // RFC 7231, 6.5.8\n ErrGone = NewError(StatusGone) // RFC 7231, 6.5.9\n ErrLengthRequired = NewError(StatusLengthRequired) // RFC 7231, 6.5.10\n ErrPreconditionFailed = NewError(StatusPreconditionFailed) // RFC 7232, 4.2\n ErrRequestEntityTooLarge = NewError(StatusRequestEntityTooLarge) // RFC 7231, 6.5.11\n ErrRequestURITooLong = NewError(StatusRequestURITooLong) // RFC 7231, 6.5.12\n ErrUnsupportedMediaType = NewError(StatusUnsupportedMediaType) // RFC 7231, 6.5.13\n ErrRequestedRangeNotSatisfiable = NewError(StatusRequestedRangeNotSatisfiable) // RFC 7233, 4.4\n ErrExpectationFailed = NewError(StatusExpectationFailed) // RFC 7231, 6.5.14\n ErrTeapot = NewError(StatusTeapot) // RFC 7168, 2.3.3\n ErrMisdirectedRequest = NewError(StatusMisdirectedRequest) // RFC 7540, 9.1.2\n ErrUnprocessableEntity = NewError(StatusUnprocessableEntity) // RFC 4918, 11.2\n ErrLocked = NewError(StatusLocked) // RFC 4918, 11.3\n ErrFailedDependency = NewError(StatusFailedDependency) // RFC 4918, 11.4\n ErrTooEarly = NewError(StatusTooEarly) // RFC 8470, 5.2.\n ErrUpgradeRequired = NewError(StatusUpgradeRequired) // RFC 7231, 6.5.15\n ErrPreconditionRequired = NewError(StatusPreconditionRequired) // RFC 6585, 3\n ErrTooManyRequests = NewError(StatusTooManyRequests) // RFC 6585, 4\n ErrRequestHeaderFieldsTooLarge = NewError(StatusRequestHeaderFieldsTooLarge) // RFC 6585, 5\n ErrUnavailableForLegalReasons = NewError(StatusUnavailableForLegalReasons) // RFC 7725, 3\n ErrInternalServerError = NewError(StatusInternalServerError) // RFC 7231, 6.6.1\n ErrNotImplemented = NewError(StatusNotImplemented) // RFC 7231, 6.6.2\n ErrBadGateway = NewError(StatusBadGateway) // RFC 7231, 6.6.3\n ErrServiceUnavailable = NewError(StatusServiceUnavailable) // RFC 7231, 6.6.4\n ErrGatewayTimeout = NewError(StatusGatewayTimeout) // RFC 7231, 6.6.5\n ErrHTTPVersionNotSupported = NewError(StatusHTTPVersionNotSupported) // RFC 7231, 6.6.6\n ErrVariantAlsoNegotiates = NewError(StatusVariantAlsoNegotiates) // RFC 2295, 8.1\n ErrInsufficientStorage = NewError(StatusInsufficientStorage) // RFC 4918, 11.5\n ErrLoopDetected = NewError(StatusLoopDetected) // RFC 5842, 7.2\n ErrNotExtended = NewError(StatusNotExtended) // RFC 2774, 7\n ErrNetworkAuthenticationRequired = NewError(StatusNetworkAuthenticationRequired) // RFC 6585, 6\n)\n")),(0,a.kt)("p",null,"HTTP Headers were copied from net/http."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const (\n HeaderAuthorization = "Authorization"\n HeaderProxyAuthenticate = "Proxy-Authenticate"\n HeaderProxyAuthorization = "Proxy-Authorization"\n HeaderWWWAuthenticate = "WWW-Authenticate"\n HeaderAge = "Age"\n HeaderCacheControl = "Cache-Control"\n HeaderClearSiteData = "Clear-Site-Data"\n HeaderExpires = "Expires"\n HeaderPragma = "Pragma"\n HeaderWarning = "Warning"\n HeaderAcceptCH = "Accept-CH"\n HeaderAcceptCHLifetime = "Accept-CH-Lifetime"\n HeaderContentDPR = "Content-DPR"\n HeaderDPR = "DPR"\n HeaderEarlyData = "Early-Data"\n HeaderSaveData = "Save-Data"\n HeaderViewportWidth = "Viewport-Width"\n HeaderWidth = "Width"\n HeaderETag = "ETag"\n HeaderIfMatch = "If-Match"\n HeaderIfModifiedSince = "If-Modified-Since"\n HeaderIfNoneMatch = "If-None-Match"\n HeaderIfUnmodifiedSince = "If-Unmodified-Since"\n HeaderLastModified = "Last-Modified"\n HeaderVary = "Vary"\n HeaderConnection = "Connection"\n HeaderKeepAlive = "Keep-Alive"\n HeaderAccept = "Accept"\n HeaderAcceptCharset = "Accept-Charset"\n HeaderAcceptEncoding = "Accept-Encoding"\n HeaderAcceptLanguage = "Accept-Language"\n HeaderCookie = "Cookie"\n HeaderExpect = "Expect"\n HeaderMaxForwards = "Max-Forwards"\n HeaderSetCookie = "Set-Cookie"\n HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials"\n HeaderAccessControlAllowHeaders = "Access-Control-Allow-Headers"\n HeaderAccessControlAllowMethods = "Access-Control-Allow-Methods"\n HeaderAccessControlAllowOrigin = "Access-Control-Allow-Origin"\n HeaderAccessControlExposeHeaders = "Access-Control-Expose-Headers"\n HeaderAccessControlMaxAge = "Access-Control-Max-Age"\n HeaderAccessControlRequestHeaders = "Access-Control-Request-Headers"\n HeaderAccessControlRequestMethod = "Access-Control-Request-Method"\n HeaderOrigin = "Origin"\n HeaderTimingAllowOrigin = "Timing-Allow-Origin"\n HeaderXPermittedCrossDomainPolicies = "X-Permitted-Cross-Domain-Policies"\n HeaderDNT = "DNT"\n HeaderTk = "Tk"\n HeaderContentDisposition = "Content-Disposition"\n HeaderContentEncoding = "Content-Encoding"\n HeaderContentLanguage = "Content-Language"\n HeaderContentLength = "Content-Length"\n HeaderContentLocation = "Content-Location"\n HeaderContentType = "Content-Type"\n HeaderForwarded = "Forwarded"\n HeaderVia = "Via"\n HeaderXForwardedFor = "X-Forwarded-For"\n HeaderXForwardedHost = "X-Forwarded-Host"\n HeaderXForwardedProto = "X-Forwarded-Proto"\n HeaderXForwardedProtocol = "X-Forwarded-Protocol"\n HeaderXForwardedSsl = "X-Forwarded-Ssl"\n HeaderXUrlScheme = "X-Url-Scheme"\n HeaderLocation = "Location"\n HeaderFrom = "From"\n HeaderHost = "Host"\n HeaderReferer = "Referer"\n HeaderReferrerPolicy = "Referrer-Policy"\n HeaderUserAgent = "User-Agent"\n HeaderAllow = "Allow"\n HeaderServer = "Server"\n HeaderAcceptRanges = "Accept-Ranges"\n HeaderContentRange = "Content-Range"\n HeaderIfRange = "If-Range"\n HeaderRange = "Range"\n HeaderContentSecurityPolicy = "Content-Security-Policy"\n HeaderContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"\n HeaderCrossOriginResourcePolicy = "Cross-Origin-Resource-Policy"\n HeaderExpectCT = "Expect-CT"\n HeaderFeaturePolicy = "Feature-Policy"\n HeaderPublicKeyPins = "Public-Key-Pins"\n HeaderPublicKeyPinsReportOnly = "Public-Key-Pins-Report-Only"\n HeaderStrictTransportSecurity = "Strict-Transport-Security"\n HeaderUpgradeInsecureRequests = "Upgrade-Insecure-Requests"\n HeaderXContentTypeOptions = "X-Content-Type-Options"\n HeaderXDownloadOptions = "X-Download-Options"\n HeaderXFrameOptions = "X-Frame-Options"\n HeaderXPoweredBy = "X-Powered-By"\n HeaderXXSSProtection = "X-XSS-Protection"\n HeaderLastEventID = "Last-Event-ID"\n HeaderNEL = "NEL"\n HeaderPingFrom = "Ping-From"\n HeaderPingTo = "Ping-To"\n HeaderReportTo = "Report-To"\n HeaderTE = "TE"\n HeaderTrailer = "Trailer"\n HeaderTransferEncoding = "Transfer-Encoding"\n HeaderSecWebSocketAccept = "Sec-WebSocket-Accept"\n HeaderSecWebSocketExtensions = "Sec-WebSocket-Extensions"\n HeaderSecWebSocketKey = "Sec-WebSocket-Key"\n HeaderSecWebSocketProtocol = "Sec-WebSocket-Protocol"\n HeaderSecWebSocketVersion = "Sec-WebSocket-Version"\n HeaderAcceptPatch = "Accept-Patch"\n HeaderAcceptPushPolicy = "Accept-Push-Policy"\n HeaderAcceptSignature = "Accept-Signature"\n HeaderAltSvc = "Alt-Svc"\n HeaderDate = "Date"\n HeaderIndex = "Index"\n HeaderLargeAllocation = "Large-Allocation"\n HeaderLink = "Link"\n HeaderPushPolicy = "Push-Policy"\n HeaderRetryAfter = "Retry-After"\n HeaderServerTiming = "Server-Timing"\n HeaderSignature = "Signature"\n HeaderSignedHeaders = "Signed-Headers"\n HeaderSourceMap = "SourceMap"\n HeaderUpgrade = "Upgrade"\n HeaderXDNSPrefetchControl = "X-DNS-Prefetch-Control"\n HeaderXPingback = "X-Pingback"\n HeaderXRequestID = "X-Request-ID"\n HeaderXRequestedWith = "X-Requested-With"\n HeaderXRobotsTag = "X-Robots-Tag"\n HeaderXUACompatible = "X-UA-Compatible"\n)\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6843],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>R});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var d=n.createContext({}),c=function(e){var t=n.useContext(d),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},u=function(e){var t=c(e.components);return n.createElement(d.Provider,{value:t},e.children)},l="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},C=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,d=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),l=c(r),C=a,R=l["".concat(d,".").concat(C)]||l[C]||p[C]||o;return r?n.createElement(R,i(i({ref:t},u),{},{components:r})):n.createElement(R,i({ref:t},u))}));function R(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=C;var s={};for(var d in t)hasOwnProperty.call(t,d)&&(s[d]=t[d]);s.originalType=e,s[l]="string"==typeof e?e:a,i[1]=s;for(var c=2;c{r.r(t),r.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>p,frontMatter:()=>o,metadata:()=>s,toc:()=>c});var n=r(7462),a=(r(7294),r(3905));const o={id:"constants",title:"\ud83d\udccb Constants",description:"Some constants for Fiber.",sidebar_position:4},i=void 0,s={unversionedId:"api/constants",id:"version-v2.x/api/constants",title:"\ud83d\udccb Constants",description:"Some constants for Fiber.",source:"@site/versioned_docs/version-v2.x/api/constants.md",sourceDirName:"api",slug:"/api/constants",permalink:"/api/constants",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:4,frontMatter:{id:"constants",title:"\ud83d\udccb Constants",description:"Some constants for Fiber.",sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\ud83e\udde0 Ctx",permalink:"/api/ctx"},next:{title:"\ud83c\udf0e Client",permalink:"/api/client"}},d={},c=[],u={toc:c},l="wrapper";function p(e){let{components:t,...r}=e;return(0,a.kt)(l,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"HTTP methods were copied from net/http."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const (\n MethodGet = "GET" // RFC 7231, 4.3.1\n MethodHead = "HEAD" // RFC 7231, 4.3.2\n MethodPost = "POST" // RFC 7231, 4.3.3\n MethodPut = "PUT" // RFC 7231, 4.3.4\n MethodPatch = "PATCH" // RFC 5789\n MethodDelete = "DELETE" // RFC 7231, 4.3.5\n MethodConnect = "CONNECT" // RFC 7231, 4.3.6\n MethodOptions = "OPTIONS" // RFC 7231, 4.3.7\n MethodTrace = "TRACE" // RFC 7231, 4.3.8\n methodUse = "USE"\n)\n')),(0,a.kt)("p",null,"MIME types that are commonly used"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const (\n MIMETextXML = "text/xml"\n MIMETextHTML = "text/html"\n MIMETextPlain = "text/plain"\n MIMEApplicationXML = "application/xml"\n MIMEApplicationJSON = "application/json"\n MIMEApplicationJavaScript = "application/javascript"\n MIMEApplicationForm = "application/x-www-form-urlencoded"\n MIMEOctetStream = "application/octet-stream"\n MIMEMultipartForm = "multipart/form-data"\n\n MIMETextXMLCharsetUTF8 = "text/xml; charset=utf-8"\n MIMETextHTMLCharsetUTF8 = "text/html; charset=utf-8"\n MIMETextPlainCharsetUTF8 = "text/plain; charset=utf-8"\n MIMEApplicationXMLCharsetUTF8 = "application/xml; charset=utf-8"\n MIMEApplicationJSONCharsetUTF8 = "application/json; charset=utf-8"\n MIMEApplicationJavaScriptCharsetUTF8 = "application/javascript; charset=utf-8"\n)\n')),(0,a.kt)("p",null,"HTTP status codes were copied from net/http."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"const (\n StatusContinue = 100 // RFC 7231, 6.2.1\n StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2\n StatusProcessing = 102 // RFC 2518, 10.1\n StatusEarlyHints = 103 // RFC 8297\n StatusOK = 200 // RFC 7231, 6.3.1\n StatusCreated = 201 // RFC 7231, 6.3.2\n StatusAccepted = 202 // RFC 7231, 6.3.3\n StatusNonAuthoritativeInformation = 203 // RFC 7231, 6.3.4\n StatusNoContent = 204 // RFC 7231, 6.3.5\n StatusResetContent = 205 // RFC 7231, 6.3.6\n StatusPartialContent = 206 // RFC 7233, 4.1\n StatusMultiStatus = 207 // RFC 4918, 11.1\n StatusAlreadyReported = 208 // RFC 5842, 7.1\n StatusIMUsed = 226 // RFC 3229, 10.4.1\n StatusMultipleChoices = 300 // RFC 7231, 6.4.1\n StatusMovedPermanently = 301 // RFC 7231, 6.4.2\n StatusFound = 302 // RFC 7231, 6.4.3\n StatusSeeOther = 303 // RFC 7231, 6.4.4\n StatusNotModified = 304 // RFC 7232, 4.1\n StatusUseProxy = 305 // RFC 7231, 6.4.5\n StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7\n StatusPermanentRedirect = 308 // RFC 7538, 3\n StatusBadRequest = 400 // RFC 7231, 6.5.1\n StatusUnauthorized = 401 // RFC 7235, 3.1\n StatusPaymentRequired = 402 // RFC 7231, 6.5.2\n StatusForbidden = 403 // RFC 7231, 6.5.3\n StatusNotFound = 404 // RFC 7231, 6.5.4\n StatusMethodNotAllowed = 405 // RFC 7231, 6.5.5\n StatusNotAcceptable = 406 // RFC 7231, 6.5.6\n StatusProxyAuthRequired = 407 // RFC 7235, 3.2\n StatusRequestTimeout = 408 // RFC 7231, 6.5.7\n StatusConflict = 409 // RFC 7231, 6.5.8\n StatusGone = 410 // RFC 7231, 6.5.9\n StatusLengthRequired = 411 // RFC 7231, 6.5.10\n StatusPreconditionFailed = 412 // RFC 7232, 4.2\n StatusRequestEntityTooLarge = 413 // RFC 7231, 6.5.11\n StatusRequestURITooLong = 414 // RFC 7231, 6.5.12\n StatusUnsupportedMediaType = 415 // RFC 7231, 6.5.13\n StatusRequestedRangeNotSatisfiable = 416 // RFC 7233, 4.4\n StatusExpectationFailed = 417 // RFC 7231, 6.5.14\n StatusTeapot = 418 // RFC 7168, 2.3.3\n StatusMisdirectedRequest = 421 // RFC 7540, 9.1.2\n StatusUnprocessableEntity = 422 // RFC 4918, 11.2\n StatusLocked = 423 // RFC 4918, 11.3\n StatusFailedDependency = 424 // RFC 4918, 11.4\n StatusTooEarly = 425 // RFC 8470, 5.2.\n StatusUpgradeRequired = 426 // RFC 7231, 6.5.15\n StatusPreconditionRequired = 428 // RFC 6585, 3\n StatusTooManyRequests = 429 // RFC 6585, 4\n StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5\n StatusUnavailableForLegalReasons = 451 // RFC 7725, 3\n StatusInternalServerError = 500 // RFC 7231, 6.6.1\n StatusNotImplemented = 501 // RFC 7231, 6.6.2\n StatusBadGateway = 502 // RFC 7231, 6.6.3\n StatusServiceUnavailable = 503 // RFC 7231, 6.6.4\n StatusGatewayTimeout = 504 // RFC 7231, 6.6.5\n StatusHTTPVersionNotSupported = 505 // RFC 7231, 6.6.6\n StatusVariantAlsoNegotiates = 506 // RFC 2295, 8.1\n StatusInsufficientStorage = 507 // RFC 4918, 11.5\n StatusLoopDetected = 508 // RFC 5842, 7.2\n StatusNotExtended = 510 // RFC 2774, 7\n StatusNetworkAuthenticationRequired = 511 // RFC 6585, 6\n)\n")),(0,a.kt)("p",null,"Errors"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var (\n ErrBadRequest = NewError(StatusBadRequest) // RFC 7231, 6.5.1\n ErrUnauthorized = NewError(StatusUnauthorized) // RFC 7235, 3.1\n ErrPaymentRequired = NewError(StatusPaymentRequired) // RFC 7231, 6.5.2\n ErrForbidden = NewError(StatusForbidden) // RFC 7231, 6.5.3\n ErrNotFound = NewError(StatusNotFound) // RFC 7231, 6.5.4\n ErrMethodNotAllowed = NewError(StatusMethodNotAllowed) // RFC 7231, 6.5.5\n ErrNotAcceptable = NewError(StatusNotAcceptable) // RFC 7231, 6.5.6\n ErrProxyAuthRequired = NewError(StatusProxyAuthRequired) // RFC 7235, 3.2\n ErrRequestTimeout = NewError(StatusRequestTimeout) // RFC 7231, 6.5.7\n ErrConflict = NewError(StatusConflict) // RFC 7231, 6.5.8\n ErrGone = NewError(StatusGone) // RFC 7231, 6.5.9\n ErrLengthRequired = NewError(StatusLengthRequired) // RFC 7231, 6.5.10\n ErrPreconditionFailed = NewError(StatusPreconditionFailed) // RFC 7232, 4.2\n ErrRequestEntityTooLarge = NewError(StatusRequestEntityTooLarge) // RFC 7231, 6.5.11\n ErrRequestURITooLong = NewError(StatusRequestURITooLong) // RFC 7231, 6.5.12\n ErrUnsupportedMediaType = NewError(StatusUnsupportedMediaType) // RFC 7231, 6.5.13\n ErrRequestedRangeNotSatisfiable = NewError(StatusRequestedRangeNotSatisfiable) // RFC 7233, 4.4\n ErrExpectationFailed = NewError(StatusExpectationFailed) // RFC 7231, 6.5.14\n ErrTeapot = NewError(StatusTeapot) // RFC 7168, 2.3.3\n ErrMisdirectedRequest = NewError(StatusMisdirectedRequest) // RFC 7540, 9.1.2\n ErrUnprocessableEntity = NewError(StatusUnprocessableEntity) // RFC 4918, 11.2\n ErrLocked = NewError(StatusLocked) // RFC 4918, 11.3\n ErrFailedDependency = NewError(StatusFailedDependency) // RFC 4918, 11.4\n ErrTooEarly = NewError(StatusTooEarly) // RFC 8470, 5.2.\n ErrUpgradeRequired = NewError(StatusUpgradeRequired) // RFC 7231, 6.5.15\n ErrPreconditionRequired = NewError(StatusPreconditionRequired) // RFC 6585, 3\n ErrTooManyRequests = NewError(StatusTooManyRequests) // RFC 6585, 4\n ErrRequestHeaderFieldsTooLarge = NewError(StatusRequestHeaderFieldsTooLarge) // RFC 6585, 5\n ErrUnavailableForLegalReasons = NewError(StatusUnavailableForLegalReasons) // RFC 7725, 3\n ErrInternalServerError = NewError(StatusInternalServerError) // RFC 7231, 6.6.1\n ErrNotImplemented = NewError(StatusNotImplemented) // RFC 7231, 6.6.2\n ErrBadGateway = NewError(StatusBadGateway) // RFC 7231, 6.6.3\n ErrServiceUnavailable = NewError(StatusServiceUnavailable) // RFC 7231, 6.6.4\n ErrGatewayTimeout = NewError(StatusGatewayTimeout) // RFC 7231, 6.6.5\n ErrHTTPVersionNotSupported = NewError(StatusHTTPVersionNotSupported) // RFC 7231, 6.6.6\n ErrVariantAlsoNegotiates = NewError(StatusVariantAlsoNegotiates) // RFC 2295, 8.1\n ErrInsufficientStorage = NewError(StatusInsufficientStorage) // RFC 4918, 11.5\n ErrLoopDetected = NewError(StatusLoopDetected) // RFC 5842, 7.2\n ErrNotExtended = NewError(StatusNotExtended) // RFC 2774, 7\n ErrNetworkAuthenticationRequired = NewError(StatusNetworkAuthenticationRequired) // RFC 6585, 6\n)\n")),(0,a.kt)("p",null,"HTTP Headers were copied from net/http."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const (\n HeaderAuthorization = "Authorization"\n HeaderProxyAuthenticate = "Proxy-Authenticate"\n HeaderProxyAuthorization = "Proxy-Authorization"\n HeaderWWWAuthenticate = "WWW-Authenticate"\n HeaderAge = "Age"\n HeaderCacheControl = "Cache-Control"\n HeaderClearSiteData = "Clear-Site-Data"\n HeaderExpires = "Expires"\n HeaderPragma = "Pragma"\n HeaderWarning = "Warning"\n HeaderAcceptCH = "Accept-CH"\n HeaderAcceptCHLifetime = "Accept-CH-Lifetime"\n HeaderContentDPR = "Content-DPR"\n HeaderDPR = "DPR"\n HeaderEarlyData = "Early-Data"\n HeaderSaveData = "Save-Data"\n HeaderViewportWidth = "Viewport-Width"\n HeaderWidth = "Width"\n HeaderETag = "ETag"\n HeaderIfMatch = "If-Match"\n HeaderIfModifiedSince = "If-Modified-Since"\n HeaderIfNoneMatch = "If-None-Match"\n HeaderIfUnmodifiedSince = "If-Unmodified-Since"\n HeaderLastModified = "Last-Modified"\n HeaderVary = "Vary"\n HeaderConnection = "Connection"\n HeaderKeepAlive = "Keep-Alive"\n HeaderAccept = "Accept"\n HeaderAcceptCharset = "Accept-Charset"\n HeaderAcceptEncoding = "Accept-Encoding"\n HeaderAcceptLanguage = "Accept-Language"\n HeaderCookie = "Cookie"\n HeaderExpect = "Expect"\n HeaderMaxForwards = "Max-Forwards"\n HeaderSetCookie = "Set-Cookie"\n HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials"\n HeaderAccessControlAllowHeaders = "Access-Control-Allow-Headers"\n HeaderAccessControlAllowMethods = "Access-Control-Allow-Methods"\n HeaderAccessControlAllowOrigin = "Access-Control-Allow-Origin"\n HeaderAccessControlExposeHeaders = "Access-Control-Expose-Headers"\n HeaderAccessControlMaxAge = "Access-Control-Max-Age"\n HeaderAccessControlRequestHeaders = "Access-Control-Request-Headers"\n HeaderAccessControlRequestMethod = "Access-Control-Request-Method"\n HeaderOrigin = "Origin"\n HeaderTimingAllowOrigin = "Timing-Allow-Origin"\n HeaderXPermittedCrossDomainPolicies = "X-Permitted-Cross-Domain-Policies"\n HeaderDNT = "DNT"\n HeaderTk = "Tk"\n HeaderContentDisposition = "Content-Disposition"\n HeaderContentEncoding = "Content-Encoding"\n HeaderContentLanguage = "Content-Language"\n HeaderContentLength = "Content-Length"\n HeaderContentLocation = "Content-Location"\n HeaderContentType = "Content-Type"\n HeaderForwarded = "Forwarded"\n HeaderVia = "Via"\n HeaderXForwardedFor = "X-Forwarded-For"\n HeaderXForwardedHost = "X-Forwarded-Host"\n HeaderXForwardedProto = "X-Forwarded-Proto"\n HeaderXForwardedProtocol = "X-Forwarded-Protocol"\n HeaderXForwardedSsl = "X-Forwarded-Ssl"\n HeaderXUrlScheme = "X-Url-Scheme"\n HeaderLocation = "Location"\n HeaderFrom = "From"\n HeaderHost = "Host"\n HeaderReferer = "Referer"\n HeaderReferrerPolicy = "Referrer-Policy"\n HeaderUserAgent = "User-Agent"\n HeaderAllow = "Allow"\n HeaderServer = "Server"\n HeaderAcceptRanges = "Accept-Ranges"\n HeaderContentRange = "Content-Range"\n HeaderIfRange = "If-Range"\n HeaderRange = "Range"\n HeaderContentSecurityPolicy = "Content-Security-Policy"\n HeaderContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"\n HeaderCrossOriginResourcePolicy = "Cross-Origin-Resource-Policy"\n HeaderExpectCT = "Expect-CT"\n HeaderFeaturePolicy = "Feature-Policy"\n HeaderPublicKeyPins = "Public-Key-Pins"\n HeaderPublicKeyPinsReportOnly = "Public-Key-Pins-Report-Only"\n HeaderStrictTransportSecurity = "Strict-Transport-Security"\n HeaderUpgradeInsecureRequests = "Upgrade-Insecure-Requests"\n HeaderXContentTypeOptions = "X-Content-Type-Options"\n HeaderXDownloadOptions = "X-Download-Options"\n HeaderXFrameOptions = "X-Frame-Options"\n HeaderXPoweredBy = "X-Powered-By"\n HeaderXXSSProtection = "X-XSS-Protection"\n HeaderLastEventID = "Last-Event-ID"\n HeaderNEL = "NEL"\n HeaderPingFrom = "Ping-From"\n HeaderPingTo = "Ping-To"\n HeaderReportTo = "Report-To"\n HeaderTE = "TE"\n HeaderTrailer = "Trailer"\n HeaderTransferEncoding = "Transfer-Encoding"\n HeaderSecWebSocketAccept = "Sec-WebSocket-Accept"\n HeaderSecWebSocketExtensions = "Sec-WebSocket-Extensions"\n HeaderSecWebSocketKey = "Sec-WebSocket-Key"\n HeaderSecWebSocketProtocol = "Sec-WebSocket-Protocol"\n HeaderSecWebSocketVersion = "Sec-WebSocket-Version"\n HeaderAcceptPatch = "Accept-Patch"\n HeaderAcceptPushPolicy = "Accept-Push-Policy"\n HeaderAcceptSignature = "Accept-Signature"\n HeaderAltSvc = "Alt-Svc"\n HeaderDate = "Date"\n HeaderIndex = "Index"\n HeaderLargeAllocation = "Large-Allocation"\n HeaderLink = "Link"\n HeaderPushPolicy = "Push-Policy"\n HeaderRetryAfter = "Retry-After"\n HeaderServerTiming = "Server-Timing"\n HeaderSignature = "Signature"\n HeaderSignedHeaders = "Signed-Headers"\n HeaderSourceMap = "SourceMap"\n HeaderUpgrade = "Upgrade"\n HeaderXDNSPrefetchControl = "X-DNS-Prefetch-Control"\n HeaderXPingback = "X-Pingback"\n HeaderXRequestID = "X-Request-ID"\n HeaderXRequestedWith = "X-Requested-With"\n HeaderXRobotsTag = "X-Robots-Tag"\n HeaderXUACompatible = "X-UA-Compatible"\n)\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/4a6d765c.491fe0f9.js b/assets/js/4a6d765c.d589ba59.js similarity index 99% rename from assets/js/4a6d765c.491fe0f9.js rename to assets/js/4a6d765c.d589ba59.js index 50550a8f9f9..cb0de2a0499 100644 --- a/assets/js/4a6d765c.491fe0f9.js +++ b/assets/js/4a6d765c.d589ba59.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[3729],{3905:(e,n,t)=>{t.d(n,{Zo:()=>u,kt:()=>m});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=r.createContext({}),p=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},u=function(e){var n=p(e.components);return r.createElement(s.Provider,{value:n},e.children)},c="mdxType",f={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=p(t),d=i,m=c["".concat(s,".").concat(d)]||c[d]||f[d]||o;return t?r.createElement(m,a(a({ref:n},u),{},{components:t})):r.createElement(m,a({ref:n},u))}));function m(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var o=t.length,a=new Array(o);a[0]=d;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[c]="string"==typeof e?e:i,a[1]=l;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>a,default:()=>f,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var r=t(7462),i=(t(7294),t(3905));const o={id:"helmet",title:"Helmet"},a=void 0,l={unversionedId:"api/middleware/helmet",id:"version-v2.x/api/middleware/helmet",title:"Helmet",description:"Helmet middleware helps secure your apps by setting various HTTP headers.",source:"@site/versioned_docs/version-v2.x/api/middleware/helmet.md",sourceDirName:"api/middleware",slug:"/api/middleware/helmet",permalink:"/api/middleware/helmet",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"helmet",title:"Helmet"},sidebar:"tutorialSidebar",previous:{title:"FileSystem",permalink:"/api/middleware/filesystem"},next:{title:"Idempotency",permalink:"/api/middleware/idempotency"}},s={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],u={toc:p},c="wrapper";function f(e){let{components:n,...t}=e;return(0,i.kt)(c,(0,r.Z)({},u,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Helmet middleware helps secure your apps by setting various HTTP headers."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/helmet"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(helmet.New())\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome!")\n })\n\n app.Listen(":3000")\n}\n')),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Test:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-curl"},"curl -I http://localhost:3000\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // XSSProtection\n // Optional. Default value "0".\n XSSProtection string\n\n // ContentTypeNosniff\n // Optional. Default value "nosniff".\n ContentTypeNosniff string\n\n // XFrameOptions\n // Optional. Default value "SAMEORIGIN".\n // Possible values: "SAMEORIGIN", "DENY", "ALLOW-FROM uri"\n XFrameOptions string\n\n // HSTSMaxAge\n // Optional. Default value 0.\n HSTSMaxAge int\n\n // HSTSExcludeSubdomains\n // Optional. Default value false.\n HSTSExcludeSubdomains bool\n\n // ContentSecurityPolicy\n // Optional. Default value "".\n ContentSecurityPolicy string\n\n // CSPReportOnly\n // Optional. Default value false.\n CSPReportOnly bool\n\n // HSTSPreloadEnabled\n // Optional. Default value false.\n HSTSPreloadEnabled bool\n\n // ReferrerPolicy\n // Optional. Default value "ReferrerPolicy".\n ReferrerPolicy string\n\n // Permissions-Policy\n // Optional. Default value "".\n PermissionPolicy string\n\n // Cross-Origin-Embedder-Policy\n // Optional. Default value "require-corp".\n CrossOriginEmbedderPolicy string\n\n // Cross-Origin-Opener-Policy\n // Optional. Default value "same-origin".\n CrossOriginOpenerPolicy string\n\n // Cross-Origin-Resource-Policy\n // Optional. Default value "same-origin".\n CrossOriginResourcePolicy string\n\n // Origin-Agent-Cluster\n // Optional. Default value "?1".\n OriginAgentCluster string\n\n // X-DNS-Prefetch-Control\n // Optional. Default value "off".\n XDNSPrefetchControl string\n\n // X-Download-Options\n // Optional. Default value "noopen".\n XDownloadOptions string\n\n // X-Permitted-Cross-Domain-Policies\n // Optional. Default value "none".\n XPermittedCrossDomain string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n XSSProtection: "0",\n ContentTypeNosniff: "nosniff",\n XFrameOptions: "SAMEORIGIN",\n ReferrerPolicy: "no-referrer",\n CrossOriginEmbedderPolicy: "require-corp",\n CrossOriginOpenerPolicy: "same-origin",\n CrossOriginResourcePolicy: "same-origin",\n OriginAgentCluster: "?1",\n XDNSPrefetchControl: "off",\n XDownloadOptions: "noopen",\n XPermittedCrossDomain: "none",\n}\n')))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[3729],{3905:(e,n,t)=>{t.d(n,{Zo:()=>u,kt:()=>m});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=r.createContext({}),p=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},u=function(e){var n=p(e.components);return r.createElement(s.Provider,{value:n},e.children)},c="mdxType",f={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=p(t),d=i,m=c["".concat(s,".").concat(d)]||c[d]||f[d]||o;return t?r.createElement(m,a(a({ref:n},u),{},{components:t})):r.createElement(m,a({ref:n},u))}));function m(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var o=t.length,a=new Array(o);a[0]=d;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[c]="string"==typeof e?e:i,a[1]=l;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>a,default:()=>f,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var r=t(7462),i=(t(7294),t(3905));const o={id:"helmet",title:"Helmet"},a=void 0,l={unversionedId:"api/middleware/helmet",id:"version-v2.x/api/middleware/helmet",title:"Helmet",description:"Helmet middleware helps secure your apps by setting various HTTP headers.",source:"@site/versioned_docs/version-v2.x/api/middleware/helmet.md",sourceDirName:"api/middleware",slug:"/api/middleware/helmet",permalink:"/api/middleware/helmet",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"helmet",title:"Helmet"},sidebar:"tutorialSidebar",previous:{title:"FileSystem",permalink:"/api/middleware/filesystem"},next:{title:"Idempotency",permalink:"/api/middleware/idempotency"}},s={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],u={toc:p},c="wrapper";function f(e){let{components:n,...t}=e;return(0,i.kt)(c,(0,r.Z)({},u,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Helmet middleware helps secure your apps by setting various HTTP headers."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/helmet"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(helmet.New())\n\n app.Get("/", func(c *fiber.Ctx) error {\n return c.SendString("Welcome!")\n })\n\n app.Listen(":3000")\n}\n')),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Test:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-curl"},"curl -I http://localhost:3000\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // XSSProtection\n // Optional. Default value "0".\n XSSProtection string\n\n // ContentTypeNosniff\n // Optional. Default value "nosniff".\n ContentTypeNosniff string\n\n // XFrameOptions\n // Optional. Default value "SAMEORIGIN".\n // Possible values: "SAMEORIGIN", "DENY", "ALLOW-FROM uri"\n XFrameOptions string\n\n // HSTSMaxAge\n // Optional. Default value 0.\n HSTSMaxAge int\n\n // HSTSExcludeSubdomains\n // Optional. Default value false.\n HSTSExcludeSubdomains bool\n\n // ContentSecurityPolicy\n // Optional. Default value "".\n ContentSecurityPolicy string\n\n // CSPReportOnly\n // Optional. Default value false.\n CSPReportOnly bool\n\n // HSTSPreloadEnabled\n // Optional. Default value false.\n HSTSPreloadEnabled bool\n\n // ReferrerPolicy\n // Optional. Default value "ReferrerPolicy".\n ReferrerPolicy string\n\n // Permissions-Policy\n // Optional. Default value "".\n PermissionPolicy string\n\n // Cross-Origin-Embedder-Policy\n // Optional. Default value "require-corp".\n CrossOriginEmbedderPolicy string\n\n // Cross-Origin-Opener-Policy\n // Optional. Default value "same-origin".\n CrossOriginOpenerPolicy string\n\n // Cross-Origin-Resource-Policy\n // Optional. Default value "same-origin".\n CrossOriginResourcePolicy string\n\n // Origin-Agent-Cluster\n // Optional. Default value "?1".\n OriginAgentCluster string\n\n // X-DNS-Prefetch-Control\n // Optional. Default value "off".\n XDNSPrefetchControl string\n\n // X-Download-Options\n // Optional. Default value "noopen".\n XDownloadOptions string\n\n // X-Permitted-Cross-Domain-Policies\n // Optional. Default value "none".\n XPermittedCrossDomain string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n XSSProtection: "0",\n ContentTypeNosniff: "nosniff",\n XFrameOptions: "SAMEORIGIN",\n ReferrerPolicy: "no-referrer",\n CrossOriginEmbedderPolicy: "require-corp",\n CrossOriginOpenerPolicy: "same-origin",\n CrossOriginResourcePolicy: "same-origin",\n OriginAgentCluster: "?1",\n XDNSPrefetchControl: "off",\n XDownloadOptions: "noopen",\n XPermittedCrossDomain: "none",\n}\n')))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/4b0c4837.20531852.js b/assets/js/4b0c4837.a6151aed.js similarity index 99% rename from assets/js/4b0c4837.20531852.js rename to assets/js/4b0c4837.a6151aed.js index 7f729b94989..130e4eff5e5 100644 --- a/assets/js/4b0c4837.20531852.js +++ b/assets/js/4b0c4837.a6151aed.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[3261],{3905:(e,t,a)=>{a.d(t,{Zo:()=>u,kt:()=>m});var r=a(7294);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function l(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var s=r.createContext({}),d=function(e){var t=r.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},u=function(e){var t=d(e.components);return r.createElement(s.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),p=d(a),f=n,m=p["".concat(s,".").concat(f)]||p[f]||c[f]||o;return a?r.createElement(m,l(l({ref:t},u),{},{components:a})):r.createElement(m,l({ref:t},u))}));function m(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=a.length,l=new Array(o);l[0]=f;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[p]="string"==typeof e?e:n,l[1]=i;for(var d=2;d{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>c,frontMatter:()=>o,metadata:()=>i,toc:()=>d});var r=a(7462),n=(a(7294),a(3905));const o={id:"earlydata",title:"EarlyData"},l=void 0,i={unversionedId:"api/middleware/earlydata",id:"api/middleware/earlydata",title:"EarlyData",description:'The Early Data middleware for Fiber adds support for TLS 1.3\'s early data ("0-RTT") feature.',source:"@site/docs/core/api/middleware/earlydata.md",sourceDirName:"api/middleware",slug:"/api/middleware/earlydata",permalink:"/next/api/middleware/earlydata",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/earlydata.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"earlydata",title:"EarlyData"},sidebar:"tutorialSidebar",previous:{title:"CSRF",permalink:"/next/api/middleware/csrf"},next:{title:"Encrypt Cookie",permalink:"/next/api/middleware/encryptcookie"}},s={},d=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Constants",id:"constants",level:2}],u={toc:d},p="wrapper";function c(e){let{components:t,...a}=e;return(0,n.kt)(p,(0,r.Z)({},u,a,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,"The Early Data middleware for ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber"),' adds support for TLS 1.3\'s early data ("0-RTT") feature.\nCiting ',(0,n.kt)("a",{parentName:"p",href:"https://datatracker.ietf.org/doc/html/rfc8446#section-2-3"},"RFC 8446"),', when a client and server share a PSK, TLS 1.3 allows clients to send data on the first flight ("early data") to speed up the request, effectively reducing the regular 1-RTT request to a 0-RTT request.'),(0,n.kt)("p",null,"Make sure to enable fiber's ",(0,n.kt)("inlineCode",{parentName:"p"},"EnableTrustedProxyCheck")," config option before using this middleware in order to not trust bogus HTTP request headers of the client."),(0,n.kt)("p",null,"Also be aware that enabling support for early data in your reverse proxy (e.g. nginx, as done with a simple ",(0,n.kt)("inlineCode",{parentName:"p"},"ssl_early_data on;"),") makes requests replayable. Refer to the following documents before continuing:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://datatracker.ietf.org/doc/html/rfc8446#section-8"},"https://datatracker.ietf.org/doc/html/rfc8446#section-8")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://blog.trailofbits.com/2019/03/25/what-application-developers-need-to-know-about-tls-early-data-0rtt/"},"https://blog.trailofbits.com/2019/03/25/what-application-developers-need-to-know-about-tls-early-data-0rtt/"))),(0,n.kt)("p",null,"By default, this middleware allows early data requests on safe HTTP request methods only and rejects the request otherwise, i.e. aborts the request before executing your handler. This behavior can be controlled by the ",(0,n.kt)("inlineCode",{parentName:"p"},"AllowEarlyData")," config option.\nSafe HTTP methods \u2014 ",(0,n.kt)("inlineCode",{parentName:"p"},"GET"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"HEAD"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"OPTIONS")," and ",(0,n.kt)("inlineCode",{parentName:"p"},"TRACE")," \u2014 should not modify a state on the server."),(0,n.kt)("h2",{id:"signatures"},"Signatures"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,n.kt)("h2",{id:"examples"},"Examples"),(0,n.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/earlydata"\n)\n')),(0,n.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"// Initialize default config\napp.Use(earlydata.New())\n\n// Or extend your config for customization\napp.Use(earlydata.New(earlydata.Config{\n Error: fiber.ErrTooEarly,\n // ...\n}))\n")),(0,n.kt)("h2",{id:"config"},"Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // IsEarlyData returns whether the request is an early-data request.\n //\n // Optional. Default: a function which checks if the "Early-Data" request header equals "1".\n IsEarlyData func(c *fiber.Ctx) bool\n\n // AllowEarlyData returns whether the early-data request should be allowed or rejected.\n //\n // Optional. Default: a function which rejects the request on unsafe and allows the request on safe HTTP request methods.\n AllowEarlyData func(c *fiber.Ctx) bool\n\n // Error is returned in case an early-data request is rejected.\n //\n // Optional. Default: fiber.ErrTooEarly.\n Error error\n}\n')),(0,n.kt)("h2",{id:"default-config"},"Default Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n IsEarlyData: func(c *fiber.Ctx) bool {\n return c.Get(DefaultHeaderName) == DefaultHeaderTrueValue\n },\n\n AllowEarlyData: func(c *fiber.Ctx) bool {\n return fiber.IsMethodSafe(c.Method())\n },\n\n Error: fiber.ErrTooEarly,\n}\n")),(0,n.kt)("h2",{id:"constants"},"Constants"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'const (\n DefaultHeaderName = "Early-Data"\n DefaultHeaderTrueValue = "1"\n)\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[3261],{3905:(e,t,a)=>{a.d(t,{Zo:()=>u,kt:()=>m});var r=a(7294);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function l(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var s=r.createContext({}),d=function(e){var t=r.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},u=function(e){var t=d(e.components);return r.createElement(s.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),p=d(a),f=n,m=p["".concat(s,".").concat(f)]||p[f]||c[f]||o;return a?r.createElement(m,l(l({ref:t},u),{},{components:a})):r.createElement(m,l({ref:t},u))}));function m(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=a.length,l=new Array(o);l[0]=f;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[p]="string"==typeof e?e:n,l[1]=i;for(var d=2;d{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>c,frontMatter:()=>o,metadata:()=>i,toc:()=>d});var r=a(7462),n=(a(7294),a(3905));const o={id:"earlydata",title:"EarlyData"},l=void 0,i={unversionedId:"api/middleware/earlydata",id:"api/middleware/earlydata",title:"EarlyData",description:'The Early Data middleware for Fiber adds support for TLS 1.3\'s early data ("0-RTT") feature.',source:"@site/docs/core/api/middleware/earlydata.md",sourceDirName:"api/middleware",slug:"/api/middleware/earlydata",permalink:"/next/api/middleware/earlydata",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/earlydata.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"earlydata",title:"EarlyData"},sidebar:"tutorialSidebar",previous:{title:"CSRF",permalink:"/next/api/middleware/csrf"},next:{title:"Encrypt Cookie",permalink:"/next/api/middleware/encryptcookie"}},s={},d=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Constants",id:"constants",level:2}],u={toc:d},p="wrapper";function c(e){let{components:t,...a}=e;return(0,n.kt)(p,(0,r.Z)({},u,a,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,"The Early Data middleware for ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber"),' adds support for TLS 1.3\'s early data ("0-RTT") feature.\nCiting ',(0,n.kt)("a",{parentName:"p",href:"https://datatracker.ietf.org/doc/html/rfc8446#section-2-3"},"RFC 8446"),', when a client and server share a PSK, TLS 1.3 allows clients to send data on the first flight ("early data") to speed up the request, effectively reducing the regular 1-RTT request to a 0-RTT request.'),(0,n.kt)("p",null,"Make sure to enable fiber's ",(0,n.kt)("inlineCode",{parentName:"p"},"EnableTrustedProxyCheck")," config option before using this middleware in order to not trust bogus HTTP request headers of the client."),(0,n.kt)("p",null,"Also be aware that enabling support for early data in your reverse proxy (e.g. nginx, as done with a simple ",(0,n.kt)("inlineCode",{parentName:"p"},"ssl_early_data on;"),") makes requests replayable. Refer to the following documents before continuing:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://datatracker.ietf.org/doc/html/rfc8446#section-8"},"https://datatracker.ietf.org/doc/html/rfc8446#section-8")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"https://blog.trailofbits.com/2019/03/25/what-application-developers-need-to-know-about-tls-early-data-0rtt/"},"https://blog.trailofbits.com/2019/03/25/what-application-developers-need-to-know-about-tls-early-data-0rtt/"))),(0,n.kt)("p",null,"By default, this middleware allows early data requests on safe HTTP request methods only and rejects the request otherwise, i.e. aborts the request before executing your handler. This behavior can be controlled by the ",(0,n.kt)("inlineCode",{parentName:"p"},"AllowEarlyData")," config option.\nSafe HTTP methods \u2014 ",(0,n.kt)("inlineCode",{parentName:"p"},"GET"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"HEAD"),", ",(0,n.kt)("inlineCode",{parentName:"p"},"OPTIONS")," and ",(0,n.kt)("inlineCode",{parentName:"p"},"TRACE")," \u2014 should not modify a state on the server."),(0,n.kt)("h2",{id:"signatures"},"Signatures"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,n.kt)("h2",{id:"examples"},"Examples"),(0,n.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/earlydata"\n)\n')),(0,n.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"// Initialize default config\napp.Use(earlydata.New())\n\n// Or extend your config for customization\napp.Use(earlydata.New(earlydata.Config{\n Error: fiber.ErrTooEarly,\n // ...\n}))\n")),(0,n.kt)("h2",{id:"config"},"Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // IsEarlyData returns whether the request is an early-data request.\n //\n // Optional. Default: a function which checks if the "Early-Data" request header equals "1".\n IsEarlyData func(c *fiber.Ctx) bool\n\n // AllowEarlyData returns whether the early-data request should be allowed or rejected.\n //\n // Optional. Default: a function which rejects the request on unsafe and allows the request on safe HTTP request methods.\n AllowEarlyData func(c *fiber.Ctx) bool\n\n // Error is returned in case an early-data request is rejected.\n //\n // Optional. Default: fiber.ErrTooEarly.\n Error error\n}\n')),(0,n.kt)("h2",{id:"default-config"},"Default Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n IsEarlyData: func(c *fiber.Ctx) bool {\n return c.Get(DefaultHeaderName) == DefaultHeaderTrueValue\n },\n\n AllowEarlyData: func(c *fiber.Ctx) bool {\n return fiber.IsMethodSafe(c.Method())\n },\n\n Error: fiber.ErrTooEarly,\n}\n")),(0,n.kt)("h2",{id:"constants"},"Constants"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'const (\n DefaultHeaderName = "Early-Data"\n DefaultHeaderTrueValue = "1"\n)\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/4b47f78b.bff35553.js b/assets/js/4b47f78b.fb413b0e.js similarity index 99% rename from assets/js/4b47f78b.bff35553.js rename to assets/js/4b47f78b.fb413b0e.js index eb6473ec923..90b0a395848 100644 --- a/assets/js/4b47f78b.bff35553.js +++ b/assets/js/4b47f78b.fb413b0e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6858],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>h});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=r.createContext({}),s=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),p=s(n),f=a,h=p["".concat(l,".").concat(f)]||p[f]||d[f]||i;return n?r.createElement(h,o(o({ref:t},u),{},{components:n})):r.createElement(h,o({ref:t},u))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c[p]="string"==typeof e?e:a,o[1]=c;for(var s=2;s{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>c,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const i={id:"cache",title:"Cache"},o=void 0,c={unversionedId:"api/middleware/cache",id:"version-v2.x/api/middleware/cache",title:"Cache",description:"Cache middleware for Fiber designed to intercept responses and cache them. This middleware will cache the Body, Content-Type and StatusCode using the c.Path() as unique identifier. Special thanks to @codemicro for creating this middleware for Fiber core!",source:"@site/versioned_docs/version-v2.x/api/middleware/cache.md",sourceDirName:"api/middleware",slug:"/api/middleware/cache",permalink:"/api/middleware/cache",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"cache",title:"Cache"},sidebar:"tutorialSidebar",previous:{title:"BasicAuth",permalink:"/api/middleware/basicauth"},next:{title:"Compress",permalink:"/api/middleware/compress"}},l={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],u={toc:s},p="wrapper";function d(e){let{components:t,...n}=e;return(0,a.kt)(p,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Cache middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," designed to intercept responses and cache them. This middleware will cache the ",(0,a.kt)("inlineCode",{parentName:"p"},"Body"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"Content-Type")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"StatusCode")," using the ",(0,a.kt)("inlineCode",{parentName:"p"},"c.Path()")," as unique identifier. Special thanks to ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/codemicro/fiber-cache"},"@codemicro")," for creating this middleware for Fiber core!"),(0,a.kt)("p",null,"Request Directives",(0,a.kt)("br",null),"\n",(0,a.kt)("inlineCode",{parentName:"p"},"Cache-Control: no-cache")," will return the up-to-date response but still caches it. You will always get a ",(0,a.kt)("inlineCode",{parentName:"p"},"miss")," cache status.",(0,a.kt)("br",null),"\n",(0,a.kt)("inlineCode",{parentName:"p"},"Cache-Control: no-store")," will refrain from caching. You will always get the up-to-date response."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/cache"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(cache.New())\n\n// Or extend your config for customization\napp.Use(cache.New(cache.Config{\n Next: func(c *fiber.Ctx) bool {\n return c.Query("refresh") == "true"\n },\n Expiration: 30 * time.Minute,\n CacheControl: true,\n}))\n')),(0,a.kt)("p",null,"Or you can custom key and expire time like this:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(cache.New(cache.Config{\n ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration {\n newCacheTime, _ := strconv.Atoi(c.GetRespHeader("Cache-Time", "600"))\n return time.Second * time.Duration(newCacheTime)\n },\n KeyGenerator: func(c *fiber.Ctx) string {\n return utils.CopyString(c.Path())\n },\n}))\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Response().Header.Add("Cache-Time", "6000")\n return c.SendString("hi")\n})\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Expiration is the time that an cached response will live\n //\n // Optional. Default: 1 * time.Minute\n Expiration time.Duration\n\n // CacheHeader header on response header, indicate cache status, with the following possible return value\n //\n // hit, miss, unreachable\n //\n // Optional. Default: X-Cache\n CacheHeader string\n\n // CacheControl enables client side caching if set to true\n //\n // Optional. Default: false\n CacheControl bool\n\n // Key allows you to generate custom keys, by default c.Path() is used\n //\n // Default: func(c *fiber.Ctx) string {\n // return utils.CopyString(c.Path())\n // }\n KeyGenerator func(*fiber.Ctx) string\n\n // allows you to generate custom Expiration Key By Key, default is Expiration (Optional)\n //\n // Default: nil\n ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration\n\n // Store is used to store the state of the middleware\n //\n // Default: an in memory store for this process only\n Storage fiber.Storage\n\n // allows you to store additional headers generated by next middlewares & handler\n //\n // Default: false\n StoreResponseHeaders bool\n\n // Max number of bytes of response bodies simultaneously stored in cache. When limit is reached,\n // entries with the nearest expiration are deleted to make room for new.\n // 0 means no limit\n //\n // Default: 0\n MaxBytes uint\n\n // You can specify HTTP methods to cache.\n // The middleware just caches the routes of its methods in this slice.\n //\n // Default: []string{fiber.MethodGet, fiber.MethodHead}\n Methods []string\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Expiration: 1 * time.Minute,\n CacheHeader: "X-Cache",\n CacheControl: false,\n KeyGenerator: func(c *fiber.Ctx) string {\n return utils.CopyString(c.Path())\n },\n ExpirationGenerator: nil,\n StoreResponseHeaders: false,\n Storage: nil,\n MaxBytes: 0,\n Methods: []string{fiber.MethodGet, fiber.MethodHead},\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6858],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>h});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=r.createContext({}),s=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),p=s(n),f=a,h=p["".concat(l,".").concat(f)]||p[f]||d[f]||i;return n?r.createElement(h,o(o({ref:t},u),{},{components:n})):r.createElement(h,o({ref:t},u))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c[p]="string"==typeof e?e:a,o[1]=c;for(var s=2;s{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>c,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const i={id:"cache",title:"Cache"},o=void 0,c={unversionedId:"api/middleware/cache",id:"version-v2.x/api/middleware/cache",title:"Cache",description:"Cache middleware for Fiber designed to intercept responses and cache them. This middleware will cache the Body, Content-Type and StatusCode using the c.Path() as unique identifier. Special thanks to @codemicro for creating this middleware for Fiber core!",source:"@site/versioned_docs/version-v2.x/api/middleware/cache.md",sourceDirName:"api/middleware",slug:"/api/middleware/cache",permalink:"/api/middleware/cache",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"cache",title:"Cache"},sidebar:"tutorialSidebar",previous:{title:"BasicAuth",permalink:"/api/middleware/basicauth"},next:{title:"Compress",permalink:"/api/middleware/compress"}},l={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],u={toc:s},p="wrapper";function d(e){let{components:t,...n}=e;return(0,a.kt)(p,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Cache middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," designed to intercept responses and cache them. This middleware will cache the ",(0,a.kt)("inlineCode",{parentName:"p"},"Body"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"Content-Type")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"StatusCode")," using the ",(0,a.kt)("inlineCode",{parentName:"p"},"c.Path()")," as unique identifier. Special thanks to ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/codemicro/fiber-cache"},"@codemicro")," for creating this middleware for Fiber core!"),(0,a.kt)("p",null,"Request Directives",(0,a.kt)("br",null),"\n",(0,a.kt)("inlineCode",{parentName:"p"},"Cache-Control: no-cache")," will return the up-to-date response but still caches it. You will always get a ",(0,a.kt)("inlineCode",{parentName:"p"},"miss")," cache status.",(0,a.kt)("br",null),"\n",(0,a.kt)("inlineCode",{parentName:"p"},"Cache-Control: no-store")," will refrain from caching. You will always get the up-to-date response."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/cache"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(cache.New())\n\n// Or extend your config for customization\napp.Use(cache.New(cache.Config{\n Next: func(c *fiber.Ctx) bool {\n return c.Query("refresh") == "true"\n },\n Expiration: 30 * time.Minute,\n CacheControl: true,\n}))\n')),(0,a.kt)("p",null,"Or you can custom key and expire time like this:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(cache.New(cache.Config{\n ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration {\n newCacheTime, _ := strconv.Atoi(c.GetRespHeader("Cache-Time", "600"))\n return time.Second * time.Duration(newCacheTime)\n },\n KeyGenerator: func(c *fiber.Ctx) string {\n return utils.CopyString(c.Path())\n },\n}))\n\napp.Get("/", func(c *fiber.Ctx) error {\n c.Response().Header.Add("Cache-Time", "6000")\n return c.SendString("hi")\n})\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Expiration is the time that an cached response will live\n //\n // Optional. Default: 1 * time.Minute\n Expiration time.Duration\n\n // CacheHeader header on response header, indicate cache status, with the following possible return value\n //\n // hit, miss, unreachable\n //\n // Optional. Default: X-Cache\n CacheHeader string\n\n // CacheControl enables client side caching if set to true\n //\n // Optional. Default: false\n CacheControl bool\n\n // Key allows you to generate custom keys, by default c.Path() is used\n //\n // Default: func(c *fiber.Ctx) string {\n // return utils.CopyString(c.Path())\n // }\n KeyGenerator func(*fiber.Ctx) string\n\n // allows you to generate custom Expiration Key By Key, default is Expiration (Optional)\n //\n // Default: nil\n ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration\n\n // Store is used to store the state of the middleware\n //\n // Default: an in memory store for this process only\n Storage fiber.Storage\n\n // allows you to store additional headers generated by next middlewares & handler\n //\n // Default: false\n StoreResponseHeaders bool\n\n // Max number of bytes of response bodies simultaneously stored in cache. When limit is reached,\n // entries with the nearest expiration are deleted to make room for new.\n // 0 means no limit\n //\n // Default: 0\n MaxBytes uint\n\n // You can specify HTTP methods to cache.\n // The middleware just caches the routes of its methods in this slice.\n //\n // Default: []string{fiber.MethodGet, fiber.MethodHead}\n Methods []string\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Expiration: 1 * time.Minute,\n CacheHeader: "X-Cache",\n CacheControl: false,\n KeyGenerator: func(c *fiber.Ctx) string {\n return utils.CopyString(c.Path())\n },\n ExpirationGenerator: nil,\n StoreResponseHeaders: false,\n Storage: nil,\n MaxBytes: 0,\n Methods: []string{fiber.MethodGet, fiber.MethodHead},\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5229ce75.60838400.js b/assets/js/5229ce75.c9b940d7.js similarity index 98% rename from assets/js/5229ce75.60838400.js rename to assets/js/5229ce75.c9b940d7.js index 5282661775e..9f61f06de24 100644 --- a/assets/js/5229ce75.60838400.js +++ b/assets/js/5229ce75.c9b940d7.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8048],{3905:(e,r,t)=>{t.d(r,{Zo:()=>d,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var c=n.createContext({}),p=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):o(o({},r),e)),t},d=function(e){var r=p(e.components);return n.createElement(c.Provider,{value:r},e.children)},f="mdxType",u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},s=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),f=p(t),s=a,m=f["".concat(c,".").concat(s)]||f[s]||u[s]||i;return t?n.createElement(m,o(o({ref:r},d),{},{components:t})):n.createElement(m,o({ref:r},d))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=s;var l={};for(var c in r)hasOwnProperty.call(r,c)&&(l[c]=r[c]);l.originalType=e,l[f]="string"==typeof e?e:a,o[1]=l;for(var p=2;p{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var n=t(7462),a=(t(7294),t(3905));const i={id:"recover",title:"Recover"},o=void 0,l={unversionedId:"api/middleware/recover",id:"version-v2.x/api/middleware/recover",title:"Recover",description:"Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.",source:"@site/versioned_docs/version-v2.x/api/middleware/recover.md",sourceDirName:"api/middleware",slug:"/api/middleware/recover",permalink:"/api/middleware/recover",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"recover",title:"Recover"},sidebar:"tutorialSidebar",previous:{title:"Proxy",permalink:"/api/middleware/proxy"},next:{title:"Redirect",permalink:"/api/middleware/redirect"}},c={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],d={toc:p},f="wrapper";function u(e){let{components:r,...t}=e;return(0,a.kt)(f,(0,n.Z)({},d,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Recover middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that recovers from panics anywhere in the stack chain and handles the control to the centralized ",(0,a.kt)("a",{parentName:"p",href:"https://docs.gofiber.io/error-handling"},"ErrorHandler"),"."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/recover"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(recover.New())\n\n// This panic will be caught by the middleware\napp.Get("/", func(c *fiber.Ctx) error {\n panic("I\'m an error")\n})\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // EnableStackTrace enables handling stack trace\n //\n // Optional. Default: false\n EnableStackTrace bool\n\n // StackTraceHandler defines a function to handle stack trace\n //\n // Optional. Default: defaultStackTraceHandler\n StackTraceHandler func(c *fiber.Ctx, e interface{})\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n EnableStackTrace: false,\n StackTraceHandler: defaultStackTraceHandler,\n}\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8048],{3905:(e,r,t)=>{t.d(r,{Zo:()=>d,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var c=n.createContext({}),p=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):o(o({},r),e)),t},d=function(e){var r=p(e.components);return n.createElement(c.Provider,{value:r},e.children)},f="mdxType",u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},s=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),f=p(t),s=a,m=f["".concat(c,".").concat(s)]||f[s]||u[s]||i;return t?n.createElement(m,o(o({ref:r},d),{},{components:t})):n.createElement(m,o({ref:r},d))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=s;var l={};for(var c in r)hasOwnProperty.call(r,c)&&(l[c]=r[c]);l.originalType=e,l[f]="string"==typeof e?e:a,o[1]=l;for(var p=2;p{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var n=t(7462),a=(t(7294),t(3905));const i={id:"recover",title:"Recover"},o=void 0,l={unversionedId:"api/middleware/recover",id:"version-v2.x/api/middleware/recover",title:"Recover",description:"Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.",source:"@site/versioned_docs/version-v2.x/api/middleware/recover.md",sourceDirName:"api/middleware",slug:"/api/middleware/recover",permalink:"/api/middleware/recover",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"recover",title:"Recover"},sidebar:"tutorialSidebar",previous:{title:"Proxy",permalink:"/api/middleware/proxy"},next:{title:"Redirect",permalink:"/api/middleware/redirect"}},c={},p=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],d={toc:p},f="wrapper";function u(e){let{components:r,...t}=e;return(0,a.kt)(f,(0,n.Z)({},d,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Recover middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that recovers from panics anywhere in the stack chain and handles the control to the centralized ",(0,a.kt)("a",{parentName:"p",href:"https://docs.gofiber.io/error-handling"},"ErrorHandler"),"."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/recover"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(recover.New())\n\n// This panic will be caught by the middleware\napp.Get("/", func(c *fiber.Ctx) error {\n panic("I\'m an error")\n})\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // EnableStackTrace enables handling stack trace\n //\n // Optional. Default: false\n EnableStackTrace bool\n\n // StackTraceHandler defines a function to handle stack trace\n //\n // Optional. Default: defaultStackTraceHandler\n StackTraceHandler func(c *fiber.Ctx, e interface{})\n}\n")),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Next: nil,\n EnableStackTrace: false,\n StackTraceHandler: defaultStackTraceHandler,\n}\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/56cc377d.3d522e68.js b/assets/js/56cc377d.8294ff9d.js similarity index 99% rename from assets/js/56cc377d.3d522e68.js rename to assets/js/56cc377d.8294ff9d.js index 6ce1712bdda..0f5080f71ba 100644 --- a/assets/js/56cc377d.3d522e68.js +++ b/assets/js/56cc377d.8294ff9d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1184],{3905:(e,r,t)=>{t.d(r,{Zo:()=>c,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=n.createContext({}),u=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):l(l({},r),e)),t},c=function(e){var r=u(e.components);return n.createElement(s.Provider,{value:r},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),d=u(t),f=a,m=d["".concat(s,".").concat(f)]||d[f]||p[f]||o;return t?n.createElement(m,l(l({ref:r},c),{},{components:t})):n.createElement(m,l({ref:r},c))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var o=t.length,l=new Array(o);l[0]=f;var i={};for(var s in r)hasOwnProperty.call(r,s)&&(i[s]=r[s]);i.originalType=e,i[d]="string"==typeof e?e:a,l[1]=i;for(var u=2;u{t.d(r,{Z:()=>l});var n=t(7294),a=t(6010);const o={tabItem:"tabItem_Ymn6"};function l(e){let{children:r,hidden:t,className:l}=e;return n.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,l),hidden:t},r)}},4866:(e,r,t)=>{t.d(r,{Z:()=>E});var n=t(7462),a=t(7294),o=t(6010),l=t(2466),i=t(6550),s=t(1980),u=t(7392),c=t(12);function d(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:r,label:t,attributes:n,default:a}}=e;return{value:r,label:t,attributes:n,default:a}}))}function p(e){const{values:r,children:t}=e;return(0,a.useMemo)((()=>{const e=r??d(t);return function(e){const r=(0,u.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,t])}function f(e){let{value:r,tabValues:t}=e;return t.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:t}=e;const n=(0,i.k6)(),o=function(e){let{queryString:r=!1,groupId:t}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:r,groupId:t});return[(0,s._X)(o),(0,a.useCallback)((e=>{if(!o)return;const r=new URLSearchParams(n.location.search);r.set(o,e),n.replace({...n.location,search:r.toString()})}),[o,n])]}function h(e){const{defaultValue:r,queryString:t=!1,groupId:n}=e,o=p(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:r,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!f({value:r,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const n=t.find((e=>e.default))??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:r,tabValues:o}))),[s,u]=m({queryString:t,groupId:n}),[d,h]=function(e){let{groupId:r}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(r),[n,o]=(0,c.Nk)(t);return[n,(0,a.useCallback)((e=>{t&&o.set(e)}),[t,o])]}({groupId:n}),b=(()=>{const e=s??d;return f({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!f({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),h(e)}),[u,h,o]),tabValues:o}}var b=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function v(e){let{className:r,block:t,selectedValue:i,selectValue:s,tabValues:u}=e;const c=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.o5)(),p=e=>{const r=e.currentTarget,t=c.indexOf(r),n=u[t].value;n!==i&&(d(r),s(n))},f=e=>{let r=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const t=c.indexOf(e.currentTarget)+1;r=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(e.currentTarget)-1;r=c[t]??c[c.length-1];break}}r?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},r)},u.map((e=>{let{value:r,label:t,attributes:l}=e;return a.createElement("li",(0,n.Z)({role:"tab",tabIndex:i===r?0:-1,"aria-selected":i===r,key:r,ref:e=>c.push(e),onKeyDown:f,onClick:p},l,{className:(0,o.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":i===r})}),t??r)})))}function y(e){let{lazy:r,children:t,selectedValue:n}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(r){const e=o.find((e=>e.props.value===n));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,r)=>(0,a.cloneElement)(e,{key:r,hidden:e.props.value!==n}))))}function k(e){const r=h(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",g.tabList)},a.createElement(v,(0,n.Z)({},e,r)),a.createElement(y,(0,n.Z)({},e,r)))}function E(e){const r=(0,b.Z)();return a.createElement(k,(0,n.Z)({key:String(r)},e))}},2579:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>s,default:()=>m,frontMatter:()=>i,metadata:()=>u,toc:()=>d});var n=t(7462),a=(t(7294),t(3905)),o=t(4866),l=t(5162);const i={id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:4},s=void 0,u={unversionedId:"guide/error-handling",id:"guide/error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",source:"@site/docs/core/guide/error-handling.md",sourceDirName:"guide",slug:"/guide/error-handling",permalink:"/next/guide/error-handling",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/error-handling.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:4,frontMatter:{id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udcdd Templates",permalink:"/next/guide/templates"},next:{title:"\ud83d\udd0e Validation",permalink:"/next/guide/validation"}},c={},d=[{value:"Catching Errors",id:"catching-errors",level:2},{value:"Default Error Handler",id:"default-error-handler",level:2},{value:"Custom Error Handler",id:"custom-error-handler",level:2}],p={toc:d},f="wrapper";function m(e){let{components:r,...t}=e;return(0,a.kt)(f,(0,n.Z)({},p,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"catching-errors"},"Catching Errors"),(0,a.kt)("p",null,"It\u2019s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them."),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(l.Z,{value:"example",label:"Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/", func(c *fiber.Ctx) error {\n // Pass error to Fiber\n return c.SendFile("file-does-not-exist")\n})\n')))),(0,a.kt)("p",null,"Fiber does not handle ",(0,a.kt)("a",{parentName:"p",href:"https://go.dev/blog/defer-panic-and-recover"},"panics")," by default. To recover from a panic thrown by any handler in the stack, you need to include the ",(0,a.kt)("inlineCode",{parentName:"p"},"Recover")," middleware below:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/recover"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(recover.New())\n\n app.Get("/", func(c *fiber.Ctx) error {\n panic("This panic is caught by fiber")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("p",null,"You could use Fiber's custom error struct to pass an additional ",(0,a.kt)("inlineCode",{parentName:"p"},"status code")," using ",(0,a.kt)("inlineCode",{parentName:"p"},"fiber.NewError()"),". It's optional to pass a message; if this is left empty, it will default to the status code message ","(",(0,a.kt)("inlineCode",{parentName:"p"},"404")," equals ",(0,a.kt)("inlineCode",{parentName:"p"},"Not Found"),")","."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // 503 Service Unavailable\n return fiber.ErrServiceUnavailable\n\n // 503 On vacation!\n return fiber.NewError(fiber.StatusServiceUnavailable, "On vacation!")\n})\n')),(0,a.kt)("h2",{id:"default-error-handler"},"Default Error Handler"),(0,a.kt)("p",null,"Fiber provides an error handler by default. For a standard error, the response is sent as ",(0,a.kt)("strong",{parentName:"p"},"500 Internal Server Error"),". If the error is of type ",(0,a.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/gofiber/fiber#Error"},"fiber.Error"),", the response is sent with the provided status code and message."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"// Default error handler\nvar DefaultErrorHandler = func(c *fiber.Ctx, err error) error {\n // Status code defaults to 500\n code := fiber.StatusInternalServerError\n\n // Retrieve the custom status code if it's a *fiber.Error\n var e *fiber.Error\n if errors.As(err, &e) {\n code = e.Code\n }\n\n // Set Content-Type: text/plain; charset=utf-8\n c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)\n\n // Return status code with error message\n return c.Status(code).SendString(err.Error())\n}\n")),(0,a.kt)("h2",{id:"custom-error-handler"},"Custom Error Handler"),(0,a.kt)("p",null,"A custom error handler can be set using a ",(0,a.kt)("a",{parentName:"p",href:"/next/api/fiber#config"},"Config "),"when initializing a ",(0,a.kt)("a",{parentName:"p",href:"/next/api/fiber#new"},"Fiber instance"),"."),(0,a.kt)("p",null,"In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response."),(0,a.kt)("p",null,"The following example shows how to display error pages for different types of errors."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Create a new fiber instance with custom config\napp := fiber.New(fiber.Config{\n // Override default error handler\n ErrorHandler: func(ctx *fiber.Ctx, err error) error {\n // Status code defaults to 500\n code := fiber.StatusInternalServerError\n\n // Retrieve the custom status code if it\'s a *fiber.Error\n var e *fiber.Error\n if errors.As(err, &e) {\n code = e.Code\n }\n\n // Send custom error page\n err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))\n if err != nil {\n // In case the SendFile fails\n return ctx.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")\n }\n\n // Return from handler\n return nil\n },\n})\n\n// ...\n')),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},"Special thanks to the ",(0,a.kt)("a",{parentName:"p",href:"https://echo.labstack.com/"},"Echo")," & ",(0,a.kt)("a",{parentName:"p",href:"https://expressjs.com/"},"Express")," framework for inspiration regarding error handling.")))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1184],{3905:(e,r,t)=>{t.d(r,{Zo:()=>c,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=n.createContext({}),u=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):l(l({},r),e)),t},c=function(e){var r=u(e.components);return n.createElement(s.Provider,{value:r},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),d=u(t),f=a,m=d["".concat(s,".").concat(f)]||d[f]||p[f]||o;return t?n.createElement(m,l(l({ref:r},c),{},{components:t})):n.createElement(m,l({ref:r},c))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var o=t.length,l=new Array(o);l[0]=f;var i={};for(var s in r)hasOwnProperty.call(r,s)&&(i[s]=r[s]);i.originalType=e,i[d]="string"==typeof e?e:a,l[1]=i;for(var u=2;u{t.d(r,{Z:()=>l});var n=t(7294),a=t(6010);const o={tabItem:"tabItem_Ymn6"};function l(e){let{children:r,hidden:t,className:l}=e;return n.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,l),hidden:t},r)}},4866:(e,r,t)=>{t.d(r,{Z:()=>E});var n=t(7462),a=t(7294),o=t(6010),l=t(2466),i=t(6550),s=t(1980),u=t(7392),c=t(12);function d(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:r,label:t,attributes:n,default:a}}=e;return{value:r,label:t,attributes:n,default:a}}))}function p(e){const{values:r,children:t}=e;return(0,a.useMemo)((()=>{const e=r??d(t);return function(e){const r=(0,u.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,t])}function f(e){let{value:r,tabValues:t}=e;return t.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:t}=e;const n=(0,i.k6)(),o=function(e){let{queryString:r=!1,groupId:t}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:r,groupId:t});return[(0,s._X)(o),(0,a.useCallback)((e=>{if(!o)return;const r=new URLSearchParams(n.location.search);r.set(o,e),n.replace({...n.location,search:r.toString()})}),[o,n])]}function h(e){const{defaultValue:r,queryString:t=!1,groupId:n}=e,o=p(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:r,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!f({value:r,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const n=t.find((e=>e.default))??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:r,tabValues:o}))),[s,u]=m({queryString:t,groupId:n}),[d,h]=function(e){let{groupId:r}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(r),[n,o]=(0,c.Nk)(t);return[n,(0,a.useCallback)((e=>{t&&o.set(e)}),[t,o])]}({groupId:n}),b=(()=>{const e=s??d;return f({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!f({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),h(e)}),[u,h,o]),tabValues:o}}var b=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function v(e){let{className:r,block:t,selectedValue:i,selectValue:s,tabValues:u}=e;const c=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.o5)(),p=e=>{const r=e.currentTarget,t=c.indexOf(r),n=u[t].value;n!==i&&(d(r),s(n))},f=e=>{let r=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const t=c.indexOf(e.currentTarget)+1;r=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(e.currentTarget)-1;r=c[t]??c[c.length-1];break}}r?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},r)},u.map((e=>{let{value:r,label:t,attributes:l}=e;return a.createElement("li",(0,n.Z)({role:"tab",tabIndex:i===r?0:-1,"aria-selected":i===r,key:r,ref:e=>c.push(e),onKeyDown:f,onClick:p},l,{className:(0,o.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":i===r})}),t??r)})))}function y(e){let{lazy:r,children:t,selectedValue:n}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(r){const e=o.find((e=>e.props.value===n));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,r)=>(0,a.cloneElement)(e,{key:r,hidden:e.props.value!==n}))))}function k(e){const r=h(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",g.tabList)},a.createElement(v,(0,n.Z)({},e,r)),a.createElement(y,(0,n.Z)({},e,r)))}function E(e){const r=(0,b.Z)();return a.createElement(k,(0,n.Z)({key:String(r)},e))}},2579:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>s,default:()=>m,frontMatter:()=>i,metadata:()=>u,toc:()=>d});var n=t(7462),a=(t(7294),t(3905)),o=t(4866),l=t(5162);const i={id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:4},s=void 0,u={unversionedId:"guide/error-handling",id:"guide/error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",source:"@site/docs/core/guide/error-handling.md",sourceDirName:"guide",slug:"/guide/error-handling",permalink:"/next/guide/error-handling",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/error-handling.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:4,frontMatter:{id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udcdd Templates",permalink:"/next/guide/templates"},next:{title:"\ud83d\udd0e Validation",permalink:"/next/guide/validation"}},c={},d=[{value:"Catching Errors",id:"catching-errors",level:2},{value:"Default Error Handler",id:"default-error-handler",level:2},{value:"Custom Error Handler",id:"custom-error-handler",level:2}],p={toc:d},f="wrapper";function m(e){let{components:r,...t}=e;return(0,a.kt)(f,(0,n.Z)({},p,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"catching-errors"},"Catching Errors"),(0,a.kt)("p",null,"It\u2019s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them."),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(l.Z,{value:"example",label:"Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/", func(c *fiber.Ctx) error {\n // Pass error to Fiber\n return c.SendFile("file-does-not-exist")\n})\n')))),(0,a.kt)("p",null,"Fiber does not handle ",(0,a.kt)("a",{parentName:"p",href:"https://go.dev/blog/defer-panic-and-recover"},"panics")," by default. To recover from a panic thrown by any handler in the stack, you need to include the ",(0,a.kt)("inlineCode",{parentName:"p"},"Recover")," middleware below:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/recover"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(recover.New())\n\n app.Get("/", func(c *fiber.Ctx) error {\n panic("This panic is caught by fiber")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("p",null,"You could use Fiber's custom error struct to pass an additional ",(0,a.kt)("inlineCode",{parentName:"p"},"status code")," using ",(0,a.kt)("inlineCode",{parentName:"p"},"fiber.NewError()"),". It's optional to pass a message; if this is left empty, it will default to the status code message ","(",(0,a.kt)("inlineCode",{parentName:"p"},"404")," equals ",(0,a.kt)("inlineCode",{parentName:"p"},"Not Found"),")","."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n // 503 Service Unavailable\n return fiber.ErrServiceUnavailable\n\n // 503 On vacation!\n return fiber.NewError(fiber.StatusServiceUnavailable, "On vacation!")\n})\n')),(0,a.kt)("h2",{id:"default-error-handler"},"Default Error Handler"),(0,a.kt)("p",null,"Fiber provides an error handler by default. For a standard error, the response is sent as ",(0,a.kt)("strong",{parentName:"p"},"500 Internal Server Error"),". If the error is of type ",(0,a.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/gofiber/fiber#Error"},"fiber.Error"),", the response is sent with the provided status code and message."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"// Default error handler\nvar DefaultErrorHandler = func(c *fiber.Ctx, err error) error {\n // Status code defaults to 500\n code := fiber.StatusInternalServerError\n\n // Retrieve the custom status code if it's a *fiber.Error\n var e *fiber.Error\n if errors.As(err, &e) {\n code = e.Code\n }\n\n // Set Content-Type: text/plain; charset=utf-8\n c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)\n\n // Return status code with error message\n return c.Status(code).SendString(err.Error())\n}\n")),(0,a.kt)("h2",{id:"custom-error-handler"},"Custom Error Handler"),(0,a.kt)("p",null,"A custom error handler can be set using a ",(0,a.kt)("a",{parentName:"p",href:"/next/api/fiber#config"},"Config "),"when initializing a ",(0,a.kt)("a",{parentName:"p",href:"/next/api/fiber#new"},"Fiber instance"),"."),(0,a.kt)("p",null,"In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response."),(0,a.kt)("p",null,"The following example shows how to display error pages for different types of errors."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Create a new fiber instance with custom config\napp := fiber.New(fiber.Config{\n // Override default error handler\n ErrorHandler: func(ctx *fiber.Ctx, err error) error {\n // Status code defaults to 500\n code := fiber.StatusInternalServerError\n\n // Retrieve the custom status code if it\'s a *fiber.Error\n var e *fiber.Error\n if errors.As(err, &e) {\n code = e.Code\n }\n\n // Send custom error page\n err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))\n if err != nil {\n // In case the SendFile fails\n return ctx.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")\n }\n\n // Return from handler\n return nil\n },\n})\n\n// ...\n')),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},"Special thanks to the ",(0,a.kt)("a",{parentName:"p",href:"https://echo.labstack.com/"},"Echo")," & ",(0,a.kt)("a",{parentName:"p",href:"https://expressjs.com/"},"Express")," framework for inspiration regarding error handling.")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5aebd6e8.260e5eae.js b/assets/js/5aebd6e8.671c1cbc.js similarity index 98% rename from assets/js/5aebd6e8.260e5eae.js rename to assets/js/5aebd6e8.671c1cbc.js index 0ab6a70cdde..a109b542419 100644 --- a/assets/js/5aebd6e8.260e5eae.js +++ b/assets/js/5aebd6e8.671c1cbc.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2342],{3905:(e,r,t)=>{t.d(r,{Zo:()=>u,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=n.createContext({}),d=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):o(o({},r),e)),t},u=function(e){var r=d(e.components);return n.createElement(s.Provider,{value:r},e.children)},c="mdxType",p={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},g=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=d(t),g=a,m=c["".concat(s,".").concat(g)]||c[g]||p[g]||i;return t?n.createElement(m,o(o({ref:r},u),{},{components:t})):n.createElement(m,o({ref:r},u))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=g;var l={};for(var s in r)hasOwnProperty.call(r,s)&&(l[s]=r[s]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var d=2;d{t.r(r),t.d(r,{assets:()=>s,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>l,toc:()=>d});var n=t(7462),a=(t(7294),t(3905));const i={id:"validating",title:"\ud83d\udd0e Validating",sidebar_position:4},o=void 0,l={unversionedId:"guide/validating",id:"version-v1.x/guide/validating",title:"\ud83d\udd0e Validating",description:"Validator package",source:"@site/versioned_docs/version-v1.x/guide/validating.md",sourceDirName:"guide",slug:"/guide/validating",permalink:"/v1.x/guide/validating",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:4,frontMatter:{id:"validating",title:"\ud83d\udd0e Validating",sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udcdd Templates",permalink:"/v1.x/guide/templates"},next:{title:"\ud83d\udc1b Error Handling",permalink:"/v1.x/guide/error-handling"}},s={},d=[{value:"Validator package",id:"validator-package",level:2}],u={toc:d},c="wrapper";function p(e){let{components:r,...t}=e;return(0,a.kt)(c,(0,n.Z)({},u,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"validator-package"},"Validator package"),(0,a.kt)("p",null,"Fiber can make ",(0,a.kt)("em",{parentName:"p"},"great")," use of the validator package to ensure correct validation of data to store."),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/go-playground/validator"},"Official validator Github page ","(","Installation, use, examples..",")","."))),(0,a.kt)("p",null,"You can find the detailed descriptions of the ",(0,a.kt)("em",{parentName:"p"},"validations")," used in the fields contained on the structs below:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://pkg.go.dev/github.com/go-playground/validator?tab=doc"},"Detailed docs"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Validation Example"',title:'"Validation','Example"':!0},'type Job struct{\n Type string `validate:"required,min=3,max=32"`\n Salary int `validate:"required,number"`\n}\n\ntype User struct{\n Name string `validate:"required,min=3,max=32"`\n IsActive bool `validate:"required,eq=True|eq=False"`\n Email string `validate:"required,email,min=6,max=32"`\n Job Job `validate:"dive"`\n}\n\ntype ErrorResponse struct {\n FailedField string\n Tag string\n Value string\n}\n\nfunc ValidateStruct(user User) []*ErrorResponse {\n var errors []*ErrorResponse\n validate = validator.New()\n err := validate.Struct(user)\n if err != nil {\n for _, err := range err.(validator.ValidationErrors) {\n var element ErrorResponse\n element.FailedField = err.StructNamespace()\n element.Tag = err.Tag()\n element.Value = err.Param()\n errors = append(errors, &element)\n }\n }\n return errors\n}\n\nfunc AddUser(c *fiber.Ctx) {\n //Connect to database\n user := new(User)\n if err := c.BodyParser(user); err != nil {\n errors := ValidateStruct()\n if errors != nil {\n c.JSON(errors)\n return\n }\n }\n //Do something else here\n\n //Return user\n c.JSON(user)\n}\n\n// Running a test with the following curl commands\n\n// curl -X POST -H "Content-Type: application/json" --data "{\\"name\\":\\"john\\",\\"isactive\\":\\"True\\"}" http://localhost:8080/register/user\n\n// Results in \n\n// [{"FailedField":"User.Email","Tag":"required","Value":""},{"FailedField":"User.Job.Salary","Tag":"required","Value":""},{"FailedField":"User.Job.Type","Tag":"required","Value":""}]\u23ce\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2342],{3905:(e,r,t)=>{t.d(r,{Zo:()=>u,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=n.createContext({}),d=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):o(o({},r),e)),t},u=function(e){var r=d(e.components);return n.createElement(s.Provider,{value:r},e.children)},c="mdxType",p={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},g=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=d(t),g=a,m=c["".concat(s,".").concat(g)]||c[g]||p[g]||i;return t?n.createElement(m,o(o({ref:r},u),{},{components:t})):n.createElement(m,o({ref:r},u))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=g;var l={};for(var s in r)hasOwnProperty.call(r,s)&&(l[s]=r[s]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var d=2;d{t.r(r),t.d(r,{assets:()=>s,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>l,toc:()=>d});var n=t(7462),a=(t(7294),t(3905));const i={id:"validating",title:"\ud83d\udd0e Validating",sidebar_position:4},o=void 0,l={unversionedId:"guide/validating",id:"version-v1.x/guide/validating",title:"\ud83d\udd0e Validating",description:"Validator package",source:"@site/versioned_docs/version-v1.x/guide/validating.md",sourceDirName:"guide",slug:"/guide/validating",permalink:"/v1.x/guide/validating",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:4,frontMatter:{id:"validating",title:"\ud83d\udd0e Validating",sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udcdd Templates",permalink:"/v1.x/guide/templates"},next:{title:"\ud83d\udc1b Error Handling",permalink:"/v1.x/guide/error-handling"}},s={},d=[{value:"Validator package",id:"validator-package",level:2}],u={toc:d},c="wrapper";function p(e){let{components:r,...t}=e;return(0,a.kt)(c,(0,n.Z)({},u,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"validator-package"},"Validator package"),(0,a.kt)("p",null,"Fiber can make ",(0,a.kt)("em",{parentName:"p"},"great")," use of the validator package to ensure correct validation of data to store."),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/go-playground/validator"},"Official validator Github page ","(","Installation, use, examples..",")","."))),(0,a.kt)("p",null,"You can find the detailed descriptions of the ",(0,a.kt)("em",{parentName:"p"},"validations")," used in the fields contained on the structs below:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://pkg.go.dev/github.com/go-playground/validator?tab=doc"},"Detailed docs"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Validation Example"',title:'"Validation','Example"':!0},'type Job struct{\n Type string `validate:"required,min=3,max=32"`\n Salary int `validate:"required,number"`\n}\n\ntype User struct{\n Name string `validate:"required,min=3,max=32"`\n IsActive bool `validate:"required,eq=True|eq=False"`\n Email string `validate:"required,email,min=6,max=32"`\n Job Job `validate:"dive"`\n}\n\ntype ErrorResponse struct {\n FailedField string\n Tag string\n Value string\n}\n\nfunc ValidateStruct(user User) []*ErrorResponse {\n var errors []*ErrorResponse\n validate = validator.New()\n err := validate.Struct(user)\n if err != nil {\n for _, err := range err.(validator.ValidationErrors) {\n var element ErrorResponse\n element.FailedField = err.StructNamespace()\n element.Tag = err.Tag()\n element.Value = err.Param()\n errors = append(errors, &element)\n }\n }\n return errors\n}\n\nfunc AddUser(c *fiber.Ctx) {\n //Connect to database\n user := new(User)\n if err := c.BodyParser(user); err != nil {\n errors := ValidateStruct()\n if errors != nil {\n c.JSON(errors)\n return\n }\n }\n //Do something else here\n\n //Return user\n c.JSON(user)\n}\n\n// Running a test with the following curl commands\n\n// curl -X POST -H "Content-Type: application/json" --data "{\\"name\\":\\"john\\",\\"isactive\\":\\"True\\"}" http://localhost:8080/register/user\n\n// Results in \n\n// [{"FailedField":"User.Email","Tag":"required","Value":""},{"FailedField":"User.Job.Salary","Tag":"required","Value":""},{"FailedField":"User.Job.Type","Tag":"required","Value":""}]\u23ce\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5f49a855.e94d31de.js b/assets/js/5f49a855.f1ee6a8c.js similarity index 98% rename from assets/js/5f49a855.e94d31de.js rename to assets/js/5f49a855.f1ee6a8c.js index 2f1f2842353..4fa6752bd14 100644 --- a/assets/js/5f49a855.e94d31de.js +++ b/assets/js/5f49a855.f1ee6a8c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7554],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},u=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,p=e.originalType,l=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),c=s(r),f=a,m=c["".concat(l,".").concat(f)]||c[f]||d[f]||p;return r?n.createElement(m,o(o({ref:t},u),{},{components:r})):n.createElement(m,o({ref:t},u))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var p=r.length,o=new Array(p);o[0]=f;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i[c]="string"==typeof e?e:a,o[1]=i;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>p,metadata:()=>i,toc:()=>s});var n=r(7462),a=(r(7294),r(3905));const p={id:"route-handlers",title:"Route Handlers"},o=void 0,i={unversionedId:"partials/routing/route-handlers",id:"version-v2.x/partials/routing/route-handlers",title:"Route Handlers",description:"Registers a route bound to a specific HTTP method.",source:"@site/versioned_docs/version-v2.x/partials/routing/handler.md",sourceDirName:"partials/routing",slug:"/partials/routing/route-handlers",permalink:"/partials/routing/route-handlers",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"route-handlers",title:"Route Handlers"}},l={},s=[],u={toc:s},c="wrapper";function d(e){let{components:t,...r}=e;return(0,a.kt)(c,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Registers a route bound to a specific ",(0,a.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods"},"HTTP method"),"."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signatures"',title:'"Signatures"'},"// HTTP methods\nfunc (app *App) Get(path string, handlers ...Handler) Router\nfunc (app *App) Head(path string, handlers ...Handler) Router\nfunc (app *App) Post(path string, handlers ...Handler) Router\nfunc (app *App) Put(path string, handlers ...Handler) Router\nfunc (app *App) Delete(path string, handlers ...Handler) Router\nfunc (app *App) Connect(path string, handlers ...Handler) Router\nfunc (app *App) Options(path string, handlers ...Handler) Router\nfunc (app *App) Trace(path string, handlers ...Handler) Router\nfunc (app *App) Patch(path string, handlers ...Handler) Router\n\n// Add allows you to specifiy a method as value\nfunc (app *App) Add(method, path string, handlers ...Handler) Router\n\n// All will register the route on all HTTP methods\n// Almost the same as app.Use but not bound to prefixes\nfunc (app *App) All(path string, handlers ...Handler) Router\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Simple GET handler\napp.Get("/api/list", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a GET request!")\n})\n\n// Simple POST handler\napp.Post("/api/register", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a POST request!")\n})\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Use")," can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. ",(0,a.kt)("inlineCode",{parentName:"p"},"/john")," will match ",(0,a.kt)("inlineCode",{parentName:"p"},"/john/doe"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"/johnnnnn")," etc"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Use(args ...interface{}) Router\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Match any request\napp.Use(func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match request starting with /api\napp.Use("/api", func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match requests starting with /api or /home (multiple-prefix support)\napp.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Attach multiple handlers \napp.Use("/api", func(c *fiber.Ctx) error {\n c.Set("X-Custom-Header", random.String(32))\n return c.Next()\n}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7554],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},u=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,p=e.originalType,l=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),c=s(r),f=a,m=c["".concat(l,".").concat(f)]||c[f]||d[f]||p;return r?n.createElement(m,o(o({ref:t},u),{},{components:r})):n.createElement(m,o({ref:t},u))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var p=r.length,o=new Array(p);o[0]=f;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i[c]="string"==typeof e?e:a,o[1]=i;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>p,metadata:()=>i,toc:()=>s});var n=r(7462),a=(r(7294),r(3905));const p={id:"route-handlers",title:"Route Handlers"},o=void 0,i={unversionedId:"partials/routing/route-handlers",id:"version-v2.x/partials/routing/route-handlers",title:"Route Handlers",description:"Registers a route bound to a specific HTTP method.",source:"@site/versioned_docs/version-v2.x/partials/routing/handler.md",sourceDirName:"partials/routing",slug:"/partials/routing/route-handlers",permalink:"/partials/routing/route-handlers",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"route-handlers",title:"Route Handlers"}},l={},s=[],u={toc:s},c="wrapper";function d(e){let{components:t,...r}=e;return(0,a.kt)(c,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Registers a route bound to a specific ",(0,a.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods"},"HTTP method"),"."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signatures"',title:'"Signatures"'},"// HTTP methods\nfunc (app *App) Get(path string, handlers ...Handler) Router\nfunc (app *App) Head(path string, handlers ...Handler) Router\nfunc (app *App) Post(path string, handlers ...Handler) Router\nfunc (app *App) Put(path string, handlers ...Handler) Router\nfunc (app *App) Delete(path string, handlers ...Handler) Router\nfunc (app *App) Connect(path string, handlers ...Handler) Router\nfunc (app *App) Options(path string, handlers ...Handler) Router\nfunc (app *App) Trace(path string, handlers ...Handler) Router\nfunc (app *App) Patch(path string, handlers ...Handler) Router\n\n// Add allows you to specifiy a method as value\nfunc (app *App) Add(method, path string, handlers ...Handler) Router\n\n// All will register the route on all HTTP methods\n// Almost the same as app.Use but not bound to prefixes\nfunc (app *App) All(path string, handlers ...Handler) Router\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Simple GET handler\napp.Get("/api/list", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a GET request!")\n})\n\n// Simple POST handler\napp.Post("/api/register", func(c *fiber.Ctx) error {\n return c.SendString("I\'m a POST request!")\n})\n')),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"Use")," can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. ",(0,a.kt)("inlineCode",{parentName:"p"},"/john")," will match ",(0,a.kt)("inlineCode",{parentName:"p"},"/john/doe"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"/johnnnnn")," etc"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (app *App) Use(args ...interface{}) Router\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Examples"',title:'"Examples"'},'// Match any request\napp.Use(func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match request starting with /api\napp.Use("/api", func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Match requests starting with /api or /home (multiple-prefix support)\napp.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n\n// Attach multiple handlers \napp.Use("/api", func(c *fiber.Ctx) error {\n c.Set("X-Custom-Header", random.String(32))\n return c.Next()\n}, func(c *fiber.Ctx) error {\n return c.Next()\n})\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/61265387.f47ab1ca.js b/assets/js/61265387.ab5c3ca2.js similarity index 99% rename from assets/js/61265387.f47ab1ca.js rename to assets/js/61265387.ab5c3ca2.js index a133d5d154f..1730d85c2d9 100644 --- a/assets/js/61265387.f47ab1ca.js +++ b/assets/js/61265387.ab5c3ca2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5708],{3905:(e,n,r)=>{r.d(n,{Zo:()=>u,kt:()=>g});var t=r(7294);function a(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function i(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function o(e){for(var n=1;n=0||(a[r]=e[r]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=t.createContext({}),d=function(e){var n=t.useContext(s),r=n;return e&&(r="function"==typeof e?e(n):o(o({},n),e)),r},u=function(e){var n=d(e.components);return t.createElement(s.Provider,{value:n},e.children)},c="mdxType",p={inlineCode:"code",wrapper:function(e){var n=e.children;return t.createElement(t.Fragment,{},n)}},m=t.forwardRef((function(e,n){var r=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=d(r),m=a,g=c["".concat(s,".").concat(m)]||c[m]||p[m]||i;return r?t.createElement(g,o(o({ref:n},u),{},{components:r})):t.createElement(g,o({ref:n},u))}));function g(e,n){var r=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=m;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var d=2;d{r.r(n),r.d(n,{assets:()=>s,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>l,toc:()=>d});var t=r(7462),a=(r(7294),r(3905));const i={id:"validation",title:"\ud83d\udd0e Validation",sidebar_position:5},o=void 0,l={unversionedId:"guide/validation",id:"guide/validation",title:"\ud83d\udd0e Validation",description:"Validator package",source:"@site/docs/core/guide/validation.md",sourceDirName:"guide",slug:"/guide/validation",permalink:"/next/guide/validation",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/validation.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:5,frontMatter:{id:"validation",title:"\ud83d\udd0e Validation",sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udc1b Error Handling",permalink:"/next/guide/error-handling"},next:{title:"\ud83e\ude9d Hooks",permalink:"/next/guide/hooks"}},s={},d=[{value:"Validator package",id:"validator-package",level:2}],u={toc:d},c="wrapper";function p(e){let{components:n,...r}=e;return(0,a.kt)(c,(0,t.Z)({},u,r,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"validator-package"},"Validator package"),(0,a.kt)("p",null,"Fiber can make ",(0,a.kt)("em",{parentName:"p"},"great")," use of the validator package to ensure correct validation of data to store."),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/go-playground/validator"},"Official validator Github page ","(","Installation, use, examples..",")","."))),(0,a.kt)("p",null,"You can find the detailed descriptions of the ",(0,a.kt)("em",{parentName:"p"},"validations")," used in the fields contained on the structs below:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://pkg.go.dev/github.com/go-playground/validator?tab=doc"},"Detailed docs"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Validation Example"',title:'"Validation','Example"':!0},'package main\n\nimport (\n "fmt"\n "log"\n "strings"\n\n "github.com/go-playground/validator/v10"\n "github.com/gofiber/fiber/v2"\n)\n\ntype (\n User struct {\n Name string `validate:"required,min=5,max=20"` // Required field, min 5 char long max 20\n Age int `validate:"required,teener"` // Required field, and client needs to implement our \'teener\' tag format which we\'ll see later\n }\n\n ErrorResponse struct {\n Error bool\n FailedField string\n Tag string\n Value interface{}\n }\n\n XValidator struct {\n validator *validator.Validate\n }\n\n GlobalErrorHandlerResp struct {\n Success bool `json:"success"`\n Message string `json:"message"`\n }\n)\n\n// This is the validator instance\n// for more information see: https://github.com/go-playground/validator\nvar validate = validator.New()\n\nfunc (v XValidator) Validate(data interface{}) []ErrorResponse {\n validationErrors := []ErrorResponse{}\n\n errs := validate.Struct(data)\n if errs != nil {\n for _, err := range errs.(validator.ValidationErrors) {\n // In this case data object is actually holding the User struct\n var elem ErrorResponse\n\n elem.FailedField = err.Field() // Export struct field name\n elem.Tag = err.Tag() // Export struct tag\n elem.Value = err.Value() // Export field value\n elem.Error = true\n\n validationErrors = append(validationErrors, elem)\n }\n }\n\n return validationErrors\n}\n\nfunc main() {\n myValidator := &XValidator{\n validator: validate,\n }\n\n app := fiber.New(fiber.Config{\n // Global custom error handler\n ErrorHandler: func(c *fiber.Ctx, err error) error {\n return c.Status(fiber.StatusBadRequest).JSON(GlobalErrorHandlerResp{\n Success: false,\n Message: err.Error(),\n })\n },\n })\n\n // Custom struct validation tag format\n myValidator.validator.RegisterValidation("teener", func(fl validator.FieldLevel) bool {\n // User.Age needs to fit our needs, 12-18 years old.\n return fl.Field().Int() >= 12 && fl.Field().Int() <= 18\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n user := &User{\n Name: c.Query("name"),\n Age: c.QueryInt("age"),\n }\n\n // Validation\n if errs := myValidator.Validate(user); len(errs) > 0 && errs[0].Error {\n errMsgs := make([]string, 0)\n\n for _, err := range errs {\n errMsgs = append(errMsgs, fmt.Sprintf(\n "[%s]: \'%v\' | Needs to implement \'%s\'",\n err.FailedField,\n err.Value,\n err.Tag,\n ))\n }\n\n return &fiber.Error{\n Code: fiber.ErrBadRequest.Code,\n Message: strings.Join(errMsgs, " and "),\n }\n }\n\n // Logic, validated with success\n return c.SendString("Hello, World!")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n/**\nOUTPUT\n\n[1]\nRequest:\n\nGET http://127.0.0.1:3000/\n\nResponse:\n\n{"success":false,"message":"[Name]: \'\' | Needs to implement \'required\' and [Age]: \'0\' | Needs to implement \'required\'"}\n\n[2]\nRequest:\n\nGET http://127.0.0.1:3000/?name=efdal&age=9\n\nResponse:\n{"success":false,"message":"[Age]: \'9\' | Needs to implement \'teener\'"}\n\n[3]\nRequest:\n\nGET http://127.0.0.1:3000/?name=efdal&age=\n\nResponse:\n{"success":false,"message":"[Age]: \'0\' | Needs to implement \'required\'"}\n\n[4]\nRequest:\n\nGET http://127.0.0.1:3000/?name=efdal&age=18\n\nResponse:\nHello, World!\n\n**/\n\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5708],{3905:(e,n,r)=>{r.d(n,{Zo:()=>u,kt:()=>g});var t=r(7294);function a(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function i(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function o(e){for(var n=1;n=0||(a[r]=e[r]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=t.createContext({}),d=function(e){var n=t.useContext(s),r=n;return e&&(r="function"==typeof e?e(n):o(o({},n),e)),r},u=function(e){var n=d(e.components);return t.createElement(s.Provider,{value:n},e.children)},c="mdxType",p={inlineCode:"code",wrapper:function(e){var n=e.children;return t.createElement(t.Fragment,{},n)}},m=t.forwardRef((function(e,n){var r=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=d(r),m=a,g=c["".concat(s,".").concat(m)]||c[m]||p[m]||i;return r?t.createElement(g,o(o({ref:n},u),{},{components:r})):t.createElement(g,o({ref:n},u))}));function g(e,n){var r=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=m;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var d=2;d{r.r(n),r.d(n,{assets:()=>s,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>l,toc:()=>d});var t=r(7462),a=(r(7294),r(3905));const i={id:"validation",title:"\ud83d\udd0e Validation",sidebar_position:5},o=void 0,l={unversionedId:"guide/validation",id:"guide/validation",title:"\ud83d\udd0e Validation",description:"Validator package",source:"@site/docs/core/guide/validation.md",sourceDirName:"guide",slug:"/guide/validation",permalink:"/next/guide/validation",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/validation.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:5,frontMatter:{id:"validation",title:"\ud83d\udd0e Validation",sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udc1b Error Handling",permalink:"/next/guide/error-handling"},next:{title:"\ud83e\ude9d Hooks",permalink:"/next/guide/hooks"}},s={},d=[{value:"Validator package",id:"validator-package",level:2}],u={toc:d},c="wrapper";function p(e){let{components:n,...r}=e;return(0,a.kt)(c,(0,t.Z)({},u,r,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"validator-package"},"Validator package"),(0,a.kt)("p",null,"Fiber can make ",(0,a.kt)("em",{parentName:"p"},"great")," use of the validator package to ensure correct validation of data to store."),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/go-playground/validator"},"Official validator Github page ","(","Installation, use, examples..",")","."))),(0,a.kt)("p",null,"You can find the detailed descriptions of the ",(0,a.kt)("em",{parentName:"p"},"validations")," used in the fields contained on the structs below:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://pkg.go.dev/github.com/go-playground/validator?tab=doc"},"Detailed docs"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Validation Example"',title:'"Validation','Example"':!0},'package main\n\nimport (\n "fmt"\n "log"\n "strings"\n\n "github.com/go-playground/validator/v10"\n "github.com/gofiber/fiber/v2"\n)\n\ntype (\n User struct {\n Name string `validate:"required,min=5,max=20"` // Required field, min 5 char long max 20\n Age int `validate:"required,teener"` // Required field, and client needs to implement our \'teener\' tag format which we\'ll see later\n }\n\n ErrorResponse struct {\n Error bool\n FailedField string\n Tag string\n Value interface{}\n }\n\n XValidator struct {\n validator *validator.Validate\n }\n\n GlobalErrorHandlerResp struct {\n Success bool `json:"success"`\n Message string `json:"message"`\n }\n)\n\n// This is the validator instance\n// for more information see: https://github.com/go-playground/validator\nvar validate = validator.New()\n\nfunc (v XValidator) Validate(data interface{}) []ErrorResponse {\n validationErrors := []ErrorResponse{}\n\n errs := validate.Struct(data)\n if errs != nil {\n for _, err := range errs.(validator.ValidationErrors) {\n // In this case data object is actually holding the User struct\n var elem ErrorResponse\n\n elem.FailedField = err.Field() // Export struct field name\n elem.Tag = err.Tag() // Export struct tag\n elem.Value = err.Value() // Export field value\n elem.Error = true\n\n validationErrors = append(validationErrors, elem)\n }\n }\n\n return validationErrors\n}\n\nfunc main() {\n myValidator := &XValidator{\n validator: validate,\n }\n\n app := fiber.New(fiber.Config{\n // Global custom error handler\n ErrorHandler: func(c *fiber.Ctx, err error) error {\n return c.Status(fiber.StatusBadRequest).JSON(GlobalErrorHandlerResp{\n Success: false,\n Message: err.Error(),\n })\n },\n })\n\n // Custom struct validation tag format\n myValidator.validator.RegisterValidation("teener", func(fl validator.FieldLevel) bool {\n // User.Age needs to fit our needs, 12-18 years old.\n return fl.Field().Int() >= 12 && fl.Field().Int() <= 18\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n user := &User{\n Name: c.Query("name"),\n Age: c.QueryInt("age"),\n }\n\n // Validation\n if errs := myValidator.Validate(user); len(errs) > 0 && errs[0].Error {\n errMsgs := make([]string, 0)\n\n for _, err := range errs {\n errMsgs = append(errMsgs, fmt.Sprintf(\n "[%s]: \'%v\' | Needs to implement \'%s\'",\n err.FailedField,\n err.Value,\n err.Tag,\n ))\n }\n\n return &fiber.Error{\n Code: fiber.ErrBadRequest.Code,\n Message: strings.Join(errMsgs, " and "),\n }\n }\n\n // Logic, validated with success\n return c.SendString("Hello, World!")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n/**\nOUTPUT\n\n[1]\nRequest:\n\nGET http://127.0.0.1:3000/\n\nResponse:\n\n{"success":false,"message":"[Name]: \'\' | Needs to implement \'required\' and [Age]: \'0\' | Needs to implement \'required\'"}\n\n[2]\nRequest:\n\nGET http://127.0.0.1:3000/?name=efdal&age=9\n\nResponse:\n{"success":false,"message":"[Age]: \'9\' | Needs to implement \'teener\'"}\n\n[3]\nRequest:\n\nGET http://127.0.0.1:3000/?name=efdal&age=\n\nResponse:\n{"success":false,"message":"[Age]: \'0\' | Needs to implement \'required\'"}\n\n[4]\nRequest:\n\nGET http://127.0.0.1:3000/?name=efdal&age=18\n\nResponse:\nHello, World!\n\n**/\n\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/61f05610.43c5bf76.js b/assets/js/61f05610.eb4d18cb.js similarity index 99% rename from assets/js/61f05610.43c5bf76.js rename to assets/js/61f05610.eb4d18cb.js index 9d2a3a1056b..0b52510fbba 100644 --- a/assets/js/61f05610.43c5bf76.js +++ b/assets/js/61f05610.eb4d18cb.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[387],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),u=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=u(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=u(n),d=a,f=c["".concat(s,".").concat(d)]||c[d]||m[d]||l;return n?r.createElement(f,i(i({ref:t},p),{},{components:n})):r.createElement(f,i({ref:t},p))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,i=new Array(l);i[0]=d;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[c]="string"==typeof e?e:a,i[1]=o;for(var u=2;u{n.d(t,{Z:()=>i});var r=n(7294),a=n(6010);const l={tabItem:"tabItem_Ymn6"};function i(e){let{children:t,hidden:n,className:i}=e;return r.createElement("div",{role:"tabpanel",className:(0,a.Z)(l.tabItem,i),hidden:n},t)}},4866:(e,t,n)=>{n.d(t,{Z:()=>w});var r=n(7462),a=n(7294),l=n(6010),i=n(2466),o=n(6550),s=n(1980),u=n(7392),p=n(12);function c(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}function m(e){const{values:t,children:n}=e;return(0,a.useMemo)((()=>{const e=t??c(n);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function d(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const r=(0,o.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,s._X)(l),(0,a.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(r.location.search);t.set(l,e),r.replace({...r.location,search:t.toString()})}),[l,r])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,l=m(e),[i,o]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!d({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[s,u]=f({queryString:n,groupId:r}),[c,b]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,l]=(0,p.Nk)(n);return[r,(0,a.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:r}),g=(()=>{const e=s??c;return d({value:e,tabValues:l})?e:null})();(0,a.useLayoutEffect)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,a.useCallback)((e=>{if(!d({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),b(e)}),[u,b,l]),tabValues:l}}var g=n(2389);const h={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function v(e){let{className:t,block:n,selectedValue:o,selectValue:s,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.o5)(),m=e=>{const t=e.currentTarget,n=p.indexOf(t),r=u[n].value;r!==o&&(c(t),s(r))},d=e=>{let t=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const n=p.indexOf(e.currentTarget)+1;t=p[n]??p[0];break}case"ArrowLeft":{const n=p.indexOf(e.currentTarget)-1;t=p[n]??p[p.length-1];break}}t?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":n},t)},u.map((e=>{let{value:t,label:n,attributes:i}=e;return a.createElement("li",(0,r.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>p.push(e),onKeyDown:d,onClick:m},i,{className:(0,l.Z)("tabs__item",h.tabItem,i?.className,{"tabs__item--active":o===t})}),n??t)})))}function k(e){let{lazy:t,children:n,selectedValue:r}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===r));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==r}))))}function y(e){const t=b(e);return a.createElement("div",{className:(0,l.Z)("tabs-container",h.tabList)},a.createElement(v,(0,r.Z)({},e,t)),a.createElement(k,(0,r.Z)({},e,t)))}function w(e){const t=(0,g.Z)();return a.createElement(y,(0,r.Z)({key:String(t)},e))}},9323:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>f,frontMatter:()=>o,metadata:()=>u,toc:()=>c});var r=n(7462),a=(n(7294),n(3905)),l=n(4866),i=n(5162);const o={id:"templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",sidebar_position:3},s=void 0,u={unversionedId:"guide/templates",id:"guide/templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",source:"@site/docs/core/guide/templates.md",sourceDirName:"guide",slug:"/guide/templates",permalink:"/next/guide/templates",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/templates.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:3,frontMatter:{id:"templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\ud83c\udfad Grouping",permalink:"/next/guide/grouping"},next:{title:"\ud83d\udc1b Error Handling",permalink:"/next/guide/error-handling"}},p={},c=[{value:"Template interfaces",id:"template-interfaces",level:2},{value:"Engines",id:"engines",level:2}],m={toc:c},d="wrapper";function f(e){let{components:t,...n}=e;return(0,a.kt)(d,(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"template-interfaces"},"Template interfaces"),(0,a.kt)("p",null,"Fiber provides a Views interface to provide your own template engine:"),(0,a.kt)(l.Z,{mdxType:"Tabs"},(0,a.kt)(i.Z,{value:"views",label:"Views",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"type Views interface {\n Load() error\n Render(io.Writer, string, interface{}, ...string) error\n}\n")))),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Views")," interface contains a ",(0,a.kt)("inlineCode",{parentName:"p"},"Load")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"Render")," method, ",(0,a.kt)("inlineCode",{parentName:"p"},"Load")," is executed by Fiber on app initialization to load/parse the templates."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Pass engine to Fiber\'s Views Engine\napp := fiber.New(fiber.Config{\n Views: engine,\n // Views Layout is the global layout for all template render until override on Render function.\n ViewsLayout: "layouts/main"\n})\n')),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"Render")," method is linked to the ",(0,a.kt)("a",{parentName:"p",href:"/next/api/ctx#render"},(0,a.kt)("strong",{parentName:"a"},"ctx.Render","(",")"))," function that accepts a template name and binding data. It will use global layout if layout is not being defined in ",(0,a.kt)("inlineCode",{parentName:"p"},"Render")," function.\nIf the Fiber config option ",(0,a.kt)("inlineCode",{parentName:"p"},"PassLocalsToViews")," is enabled, then all locals set using ",(0,a.kt)("inlineCode",{parentName:"p"},"ctx.Locals(key, value)")," will be passed to the template."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/", func(c *fiber.Ctx) error {\n return c.Render("index", fiber.Map{\n "hello": "world",\n });\n})\n')),(0,a.kt)("h2",{id:"engines"},"Engines"),(0,a.kt)("p",null,"Fiber team maintains ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/template"},"templates")," package that provides wrappers for multiple template engines:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/html"},"html")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/ace"},"ace")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/amber"},"amber")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/django"},"django")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/handlebars"},"handlebars")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/jet"},"jet")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/mustache"},"mustache")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/pug"},"pug"))),(0,a.kt)(l.Z,{mdxType:"Tabs"},(0,a.kt)(i.Z,{value:"example",label:"Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/html/v2"\n)\n\nfunc main() {\n // Initialize standard Go html template engine\n engine := html.New("./views", ".html")\n // If you want other engine, just replace with following\n // Create a new engine with django\n // engine := django.New("./views", ".django")\n\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index template\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n'))),(0,a.kt)(i.Z,{value:"index",label:"views/index.html",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-markup"},"\n\n

{{.Title}}

\n\n\n")))))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[387],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),u=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=u(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=u(n),d=a,f=c["".concat(s,".").concat(d)]||c[d]||m[d]||l;return n?r.createElement(f,i(i({ref:t},p),{},{components:n})):r.createElement(f,i({ref:t},p))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,i=new Array(l);i[0]=d;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[c]="string"==typeof e?e:a,i[1]=o;for(var u=2;u{n.d(t,{Z:()=>i});var r=n(7294),a=n(6010);const l={tabItem:"tabItem_Ymn6"};function i(e){let{children:t,hidden:n,className:i}=e;return r.createElement("div",{role:"tabpanel",className:(0,a.Z)(l.tabItem,i),hidden:n},t)}},4866:(e,t,n)=>{n.d(t,{Z:()=>w});var r=n(7462),a=n(7294),l=n(6010),i=n(2466),o=n(6550),s=n(1980),u=n(7392),p=n(12);function c(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}function m(e){const{values:t,children:n}=e;return(0,a.useMemo)((()=>{const e=t??c(n);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function d(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const r=(0,o.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,s._X)(l),(0,a.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(r.location.search);t.set(l,e),r.replace({...r.location,search:t.toString()})}),[l,r])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,l=m(e),[i,o]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!d({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[s,u]=f({queryString:n,groupId:r}),[c,b]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,l]=(0,p.Nk)(n);return[r,(0,a.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:r}),g=(()=>{const e=s??c;return d({value:e,tabValues:l})?e:null})();(0,a.useLayoutEffect)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,a.useCallback)((e=>{if(!d({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),b(e)}),[u,b,l]),tabValues:l}}var g=n(2389);const h={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function v(e){let{className:t,block:n,selectedValue:o,selectValue:s,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.o5)(),m=e=>{const t=e.currentTarget,n=p.indexOf(t),r=u[n].value;r!==o&&(c(t),s(r))},d=e=>{let t=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const n=p.indexOf(e.currentTarget)+1;t=p[n]??p[0];break}case"ArrowLeft":{const n=p.indexOf(e.currentTarget)-1;t=p[n]??p[p.length-1];break}}t?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":n},t)},u.map((e=>{let{value:t,label:n,attributes:i}=e;return a.createElement("li",(0,r.Z)({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,key:t,ref:e=>p.push(e),onKeyDown:d,onClick:m},i,{className:(0,l.Z)("tabs__item",h.tabItem,i?.className,{"tabs__item--active":o===t})}),n??t)})))}function k(e){let{lazy:t,children:n,selectedValue:r}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===r));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==r}))))}function y(e){const t=b(e);return a.createElement("div",{className:(0,l.Z)("tabs-container",h.tabList)},a.createElement(v,(0,r.Z)({},e,t)),a.createElement(k,(0,r.Z)({},e,t)))}function w(e){const t=(0,g.Z)();return a.createElement(y,(0,r.Z)({key:String(t)},e))}},9323:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>f,frontMatter:()=>o,metadata:()=>u,toc:()=>c});var r=n(7462),a=(n(7294),n(3905)),l=n(4866),i=n(5162);const o={id:"templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",sidebar_position:3},s=void 0,u={unversionedId:"guide/templates",id:"guide/templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",source:"@site/docs/core/guide/templates.md",sourceDirName:"guide",slug:"/guide/templates",permalink:"/next/guide/templates",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/guide/templates.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:3,frontMatter:{id:"templates",title:"\ud83d\udcdd Templates",description:"Fiber supports server-side template engines.",sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"\ud83c\udfad Grouping",permalink:"/next/guide/grouping"},next:{title:"\ud83d\udc1b Error Handling",permalink:"/next/guide/error-handling"}},p={},c=[{value:"Template interfaces",id:"template-interfaces",level:2},{value:"Engines",id:"engines",level:2}],m={toc:c},d="wrapper";function f(e){let{components:t,...n}=e;return(0,a.kt)(d,(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"template-interfaces"},"Template interfaces"),(0,a.kt)("p",null,"Fiber provides a Views interface to provide your own template engine:"),(0,a.kt)(l.Z,{mdxType:"Tabs"},(0,a.kt)(i.Z,{value:"views",label:"Views",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"type Views interface {\n Load() error\n Render(io.Writer, string, interface{}, ...string) error\n}\n")))),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Views")," interface contains a ",(0,a.kt)("inlineCode",{parentName:"p"},"Load")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"Render")," method, ",(0,a.kt)("inlineCode",{parentName:"p"},"Load")," is executed by Fiber on app initialization to load/parse the templates."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Pass engine to Fiber\'s Views Engine\napp := fiber.New(fiber.Config{\n Views: engine,\n // Views Layout is the global layout for all template render until override on Render function.\n ViewsLayout: "layouts/main"\n})\n')),(0,a.kt)("p",null,"The ",(0,a.kt)("inlineCode",{parentName:"p"},"Render")," method is linked to the ",(0,a.kt)("a",{parentName:"p",href:"/next/api/ctx#render"},(0,a.kt)("strong",{parentName:"a"},"ctx.Render","(",")"))," function that accepts a template name and binding data. It will use global layout if layout is not being defined in ",(0,a.kt)("inlineCode",{parentName:"p"},"Render")," function.\nIf the Fiber config option ",(0,a.kt)("inlineCode",{parentName:"p"},"PassLocalsToViews")," is enabled, then all locals set using ",(0,a.kt)("inlineCode",{parentName:"p"},"ctx.Locals(key, value)")," will be passed to the template."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/", func(c *fiber.Ctx) error {\n return c.Render("index", fiber.Map{\n "hello": "world",\n });\n})\n')),(0,a.kt)("h2",{id:"engines"},"Engines"),(0,a.kt)("p",null,"Fiber team maintains ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/template"},"templates")," package that provides wrappers for multiple template engines:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/html"},"html")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/ace"},"ace")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/amber"},"amber")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/django"},"django")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/handlebars"},"handlebars")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/jet"},"jet")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/mustache"},"mustache")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/tree/master/pug"},"pug"))),(0,a.kt)(l.Z,{mdxType:"Tabs"},(0,a.kt)(i.Z,{value:"example",label:"Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/html/v2"\n)\n\nfunc main() {\n // Initialize standard Go html template engine\n engine := html.New("./views", ".html")\n // If you want other engine, just replace with following\n // Create a new engine with django\n // engine := django.New("./views", ".django")\n\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index template\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n'))),(0,a.kt)(i.Z,{value:"index",label:"views/index.html",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-markup"},"\n\n

{{.Title}}

\n\n\n")))))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/683903ba.cfcdd8f0.js b/assets/js/683903ba.ec7e6079.js similarity index 98% rename from assets/js/683903ba.cfcdd8f0.js rename to assets/js/683903ba.ec7e6079.js index ffa7000f340..487c3ecc8ef 100644 --- a/assets/js/683903ba.cfcdd8f0.js +++ b/assets/js/683903ba.ec7e6079.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6042],{3905:(e,n,t)=>{t.d(n,{Zo:()=>s,kt:()=>g});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function p(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var u=r.createContext({}),l=function(e){var n=r.useContext(u),t=n;return e&&(t="function"==typeof e?e(n):p(p({},n),e)),t},s=function(e){var n=l(e.components);return r.createElement(u.Provider,{value:n},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},v=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,u=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),c=l(t),v=a,g=c["".concat(u,".").concat(v)]||c[v]||d[v]||i;return t?r.createElement(g,p(p({ref:n},s),{},{components:t})):r.createElement(g,p({ref:n},s))}));function g(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,p=new Array(i);p[0]=v;var o={};for(var u in n)hasOwnProperty.call(n,u)&&(o[u]=n[u]);o.originalType=e,o[c]="string"==typeof e?e:a,p[1]=o;for(var l=2;l{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>p,default:()=>d,frontMatter:()=>i,metadata:()=>o,toc:()=>l});var r=t(7462),a=(t(7294),t(3905));const i={id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},p=void 0,o={unversionedId:"guide/grouping",id:"version-v1.x/guide/grouping",title:"\ud83c\udfad Grouping",description:"Paths",source:"@site/versioned_docs/version-v1.x/guide/grouping.md",sourceDirName:"guide",slug:"/guide/grouping",permalink:"/v1.x/guide/grouping",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:2,frontMatter:{id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0c Routing",permalink:"/v1.x/guide/routing"},next:{title:"\ud83d\udcdd Templates",permalink:"/v1.x/guide/templates"}},u={},l=[{value:"Paths",id:"paths",level:2},{value:"Group Handlers",id:"group-handlers",level:2}],s={toc:l},c="wrapper";function d(e){let{components:n,...t}=e;return(0,a.kt)(c,(0,r.Z)({},s,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"paths"},"Paths"),(0,a.kt)("p",null,"Like ",(0,a.kt)("strong",{parentName:"p"},"Routing"),", groups can also have paths that belong to a cluster."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", cors()) // /api\n\n v1 := api.Group("/v1", mysql()) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", mongodb()) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n app.Listen(3000)\n}\n')),(0,a.kt)("p",null,"A ",(0,a.kt)("strong",{parentName:"p"},"Group")," of paths can have an optional handler."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1") // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2") // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n app.Listen(3000)\n}\n')),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"Running ",(0,a.kt)("strong",{parentName:"p"},"/api"),", ",(0,a.kt)("strong",{parentName:"p"},"/v1")," or ",(0,a.kt)("strong",{parentName:"p"},"/v2")," will result in ",(0,a.kt)("strong",{parentName:"p"},"404")," error, make sure you have the errors set.")),(0,a.kt)("h2",{id:"group-handlers"},"Group Handlers"),(0,a.kt)("p",null,"Group handlers can also be used as a routing path but they must have ",(0,a.kt)("strong",{parentName:"p"},"Next")," added to them so that the flow can continue."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1", func(c *fiber.Ctx) {\n c.JSON(fiber.Map{\n "message": "v1",\n })\n c.Next()\n }) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n app.Listen(3000)\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6042],{3905:(e,n,t)=>{t.d(n,{Zo:()=>s,kt:()=>g});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function p(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var u=r.createContext({}),l=function(e){var n=r.useContext(u),t=n;return e&&(t="function"==typeof e?e(n):p(p({},n),e)),t},s=function(e){var n=l(e.components);return r.createElement(u.Provider,{value:n},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},v=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,u=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),c=l(t),v=a,g=c["".concat(u,".").concat(v)]||c[v]||d[v]||i;return t?r.createElement(g,p(p({ref:n},s),{},{components:t})):r.createElement(g,p({ref:n},s))}));function g(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,p=new Array(i);p[0]=v;var o={};for(var u in n)hasOwnProperty.call(n,u)&&(o[u]=n[u]);o.originalType=e,o[c]="string"==typeof e?e:a,p[1]=o;for(var l=2;l{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>p,default:()=>d,frontMatter:()=>i,metadata:()=>o,toc:()=>l});var r=t(7462),a=(t(7294),t(3905));const i={id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},p=void 0,o={unversionedId:"guide/grouping",id:"version-v1.x/guide/grouping",title:"\ud83c\udfad Grouping",description:"Paths",source:"@site/versioned_docs/version-v1.x/guide/grouping.md",sourceDirName:"guide",slug:"/guide/grouping",permalink:"/v1.x/guide/grouping",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:2,frontMatter:{id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0c Routing",permalink:"/v1.x/guide/routing"},next:{title:"\ud83d\udcdd Templates",permalink:"/v1.x/guide/templates"}},u={},l=[{value:"Paths",id:"paths",level:2},{value:"Group Handlers",id:"group-handlers",level:2}],s={toc:l},c="wrapper";function d(e){let{components:n,...t}=e;return(0,a.kt)(c,(0,r.Z)({},s,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"paths"},"Paths"),(0,a.kt)("p",null,"Like ",(0,a.kt)("strong",{parentName:"p"},"Routing"),", groups can also have paths that belong to a cluster."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", cors()) // /api\n\n v1 := api.Group("/v1", mysql()) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", mongodb()) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n app.Listen(3000)\n}\n')),(0,a.kt)("p",null,"A ",(0,a.kt)("strong",{parentName:"p"},"Group")," of paths can have an optional handler."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1") // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2") // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n app.Listen(3000)\n}\n')),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"Running ",(0,a.kt)("strong",{parentName:"p"},"/api"),", ",(0,a.kt)("strong",{parentName:"p"},"/v1")," or ",(0,a.kt)("strong",{parentName:"p"},"/v2")," will result in ",(0,a.kt)("strong",{parentName:"p"},"404")," error, make sure you have the errors set.")),(0,a.kt)("h2",{id:"group-handlers"},"Group Handlers"),(0,a.kt)("p",null,"Group handlers can also be used as a routing path but they must have ",(0,a.kt)("strong",{parentName:"p"},"Next")," added to them so that the flow can continue."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1", func(c *fiber.Ctx) {\n c.JSON(fiber.Map{\n "message": "v1",\n })\n c.Next()\n }) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n app.Listen(3000)\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/696e1f87.b830bf21.js b/assets/js/696e1f87.2b083586.js similarity index 99% rename from assets/js/696e1f87.b830bf21.js rename to assets/js/696e1f87.2b083586.js index aa56896ba8f..bc226f6c187 100644 --- a/assets/js/696e1f87.b830bf21.js +++ b/assets/js/696e1f87.2b083586.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1586],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>d});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=a.createContext({}),g=function(e){var t=a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=g(e.components);return a.createElement(o.Provider,{value:t},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},c=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,o=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=g(n),c=r,d=p["".concat(o,".").concat(c)]||p[c]||m[c]||l;return n?a.createElement(d,i(i({ref:t},u),{},{components:n})):a.createElement(d,i({ref:t},u))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=c;var s={};for(var o in t)hasOwnProperty.call(t,o)&&(s[o]=t[o]);s.originalType=e,s[p]="string"==typeof e?e:r,i[1]=s;for(var g=2;g{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>s,toc:()=>g});var a=n(7462),r=(n(7294),n(3905));const l={id:"client",title:"\ud83c\udf0e Client",description:"The Client struct represents the Fiber HTTP Client.",sidebar_position:5},i=void 0,s={unversionedId:"api/client",id:"version-v2.x/api/client",title:"\ud83c\udf0e Client",description:"The Client struct represents the Fiber HTTP Client.",source:"@site/versioned_docs/version-v2.x/api/client.md",sourceDirName:"api",slug:"/api/client",permalink:"/api/client",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:5,frontMatter:{id:"client",title:"\ud83c\udf0e Client",description:"The Client struct represents the Fiber HTTP Client.",sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udccb Constants",permalink:"/api/constants"},next:{title:"\ud83e\uddec Middleware",permalink:"/category/-middleware"}},o={},g=[{value:"Start request",id:"start-request",level:2},{value:"\u2728 Agent",id:"-agent",level:2},{value:"Parse",id:"parse",level:3},{value:"Set",id:"set",level:3},{value:"Add",id:"add",level:3},{value:"ConnectionClose",id:"connectionclose",level:3},{value:"UserAgent",id:"useragent",level:3},{value:"Cookie",id:"cookie",level:3},{value:"Referer",id:"referer",level:3},{value:"ContentType",id:"contenttype",level:3},{value:"Host",id:"host",level:3},{value:"QueryString",id:"querystring",level:3},{value:"BasicAuth",id:"basicauth",level:3},{value:"Body",id:"body",level:3},{value:"JSON",id:"json",level:3},{value:"XML",id:"xml",level:3},{value:"Form",id:"form",level:3},{value:"MultipartForm",id:"multipartform",level:3},{value:"Boundary",id:"boundary",level:4},{value:"SendFile(s)",id:"sendfiles",level:4},{value:"FileData",id:"filedata",level:4},{value:"Debug",id:"debug",level:3},{value:"Timeout",id:"timeout",level:3},{value:"Reuse",id:"reuse",level:3},{value:"InsecureSkipVerify",id:"insecureskipverify",level:3},{value:"TLSConfig",id:"tlsconfig",level:3},{value:"MaxRedirectsCount",id:"maxredirectscount",level:3},{value:"JSONEncoder",id:"jsonencoder",level:3},{value:"JSONDecoder",id:"jsondecoder",level:3},{value:"Request",id:"request",level:3},{value:"SetResponse",id:"setresponse",level:3},{value:"Dest",id:"dest",level:3},{value:"Bytes",id:"bytes",level:3},{value:"String",id:"string",level:3},{value:"Struct",id:"struct",level:3},{value:"RetryIf",id:"retryif",level:3}],u={toc:g},p="wrapper";function m(e){let{components:t,...n}=e;return(0,r.kt)(p,(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"start-request"},"Start request"),(0,r.kt)("p",null,"Start a http request with http method and url."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signatures"',title:'"Signatures"'},"// Client http methods\nfunc (c *Client) Get(url string) *Agent\nfunc (c *Client) Head(url string) *Agent\nfunc (c *Client) Post(url string) *Agent\nfunc (c *Client) Put(url string) *Agent\nfunc (c *Client) Patch(url string) *Agent\nfunc (c *Client) Delete(url string) *Agent\n")),(0,r.kt)("h2",{id:"-agent"},"\u2728 Agent"),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"Agent")," is built on top of FastHTTP's ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/valyala/fasthttp/blob/master/client.go#L603"},(0,r.kt)("inlineCode",{parentName:"a"},"HostClient"))," which has lots of convenient helper methods such as dedicated methods for request methods."),(0,r.kt)("h3",{id:"parse"},"Parse"),(0,r.kt)("p",null,"Parse initializes a HostClient."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Parse"',title:'"Parse"'},'a := AcquireAgent()\nreq := a.Request()\nreq.Header.SetMethod(MethodGet)\nreq.SetRequestURI("http://example.com")\n\nif err := a.Parse(); err != nil {\n panic(err)\n}\n\ncode, body, errs := a.Bytes() // ...\n')),(0,r.kt)("h3",{id:"set"},"Set"),(0,r.kt)("p",null,"Set sets the given ",(0,r.kt)("inlineCode",{parentName:"p"},"key: value")," header."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Set(k, v string) *Agent\nfunc (a *Agent) SetBytesK(k []byte, v string) *Agent\nfunc (a *Agent) SetBytesV(k string, v []byte) *Agent\nfunc (a *Agent) SetBytesKV(k []byte, v []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Set("k1", "v1").\n SetBytesK([]byte("k1"), "v1").\n SetBytesV("k1", []byte("v1")).\n SetBytesKV([]byte("k2"), []byte("v2"))\n// ...\n')),(0,r.kt)("h3",{id:"add"},"Add"),(0,r.kt)("p",null,"Add adds the given ",(0,r.kt)("inlineCode",{parentName:"p"},"key: value")," header. Multiple headers with the same key may be added with this function."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Add(k, v string) *Agent\nfunc (a *Agent) AddBytesK(k []byte, v string) *Agent\nfunc (a *Agent) AddBytesV(k string, v []byte) *Agent\nfunc (a *Agent) AddBytesKV(k []byte, v []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Add("k1", "v1").\n AddBytesK([]byte("k1"), "v1").\n AddBytesV("k1", []byte("v1")).\n AddBytesKV([]byte("k2"), []byte("v2"))\n// Headers:\n// K1: v1\n// K1: v1\n// K1: v1\n// K2: v2\n')),(0,r.kt)("h3",{id:"connectionclose"},"ConnectionClose"),(0,r.kt)("p",null,"ConnectionClose adds the ",(0,r.kt)("inlineCode",{parentName:"p"},"Connection: close")," header."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) ConnectionClose() *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.ConnectionClose()\n// ...\n")),(0,r.kt)("h3",{id:"useragent"},"UserAgent"),(0,r.kt)("p",null,"UserAgent sets ",(0,r.kt)("inlineCode",{parentName:"p"},"User-Agent")," header value."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) UserAgent(userAgent string) *Agent\nfunc (a *Agent) UserAgentBytes(userAgent []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.UserAgent("fiber")\n// ...\n')),(0,r.kt)("h3",{id:"cookie"},"Cookie"),(0,r.kt)("p",null,"Cookie sets a cookie in ",(0,r.kt)("inlineCode",{parentName:"p"},"key: value")," form. ",(0,r.kt)("inlineCode",{parentName:"p"},"Cookies")," can be used to set multiple cookies."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Cookie(key, value string) *Agent\nfunc (a *Agent) CookieBytesK(key []byte, value string) *Agent\nfunc (a *Agent) CookieBytesKV(key, value []byte) *Agent\nfunc (a *Agent) Cookies(kv ...string) *Agent\nfunc (a *Agent) CookiesBytesKV(kv ...[]byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Cookie("k", "v")\nagent.Cookies("k1", "v1", "k2", "v2")\n// ...\n')),(0,r.kt)("h3",{id:"referer"},"Referer"),(0,r.kt)("p",null,"Referer sets the Referer header value."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Referer(referer string) *Agent\nfunc (a *Agent) RefererBytes(referer []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Referer("https://docs.gofiber.io")\n// ...\n')),(0,r.kt)("h3",{id:"contenttype"},"ContentType"),(0,r.kt)("p",null,"ContentType sets Content-Type header value."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) ContentType(contentType string) *Agent\nfunc (a *Agent) ContentTypeBytes(contentType []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.ContentType("custom-type")\n// ...\n')),(0,r.kt)("h3",{id:"host"},"Host"),(0,r.kt)("p",null,"Host sets the Host header."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Host(host string) *Agent\nfunc (a *Agent) HostBytes(host []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Host("example.com")\n// ...\n')),(0,r.kt)("h3",{id:"querystring"},"QueryString"),(0,r.kt)("p",null,"QueryString sets the URI query string."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) QueryString(queryString string) *Agent\nfunc (a *Agent) QueryStringBytes(queryString []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.QueryString("foo=bar")\n// ...\n')),(0,r.kt)("h3",{id:"basicauth"},"BasicAuth"),(0,r.kt)("p",null,"BasicAuth sets the URI username and password using HTTP Basic Auth."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) BasicAuth(username, password string) *Agent\nfunc (a *Agent) BasicAuthBytes(username, password []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.BasicAuth("foo", "bar")\n// ...\n')),(0,r.kt)("h3",{id:"body"},"Body"),(0,r.kt)("p",null,"There are several ways to set request body."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) BodyString(bodyString string) *Agent\nfunc (a *Agent) Body(body []byte) *Agent\n\n// BodyStream sets request body stream and, optionally body size.\n//\n// If bodySize is >= 0, then the bodyStream must provide exactly bodySize bytes\n// before returning io.EOF.\n//\n// If bodySize < 0, then bodyStream is read until io.EOF.\n//\n// bodyStream.Close() is called after finishing reading all body data\n// if it implements io.Closer.\n//\n// Note that GET and HEAD requests cannot have body.\nfunc (a *Agent) BodyStream(bodyStream io.Reader, bodySize int) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.BodyString("foo=bar")\nagent.Body([]byte("bar=baz"))\nagent.BodyStream(strings.NewReader("body=stream"), -1)\n// ...\n')),(0,r.kt)("h3",{id:"json"},"JSON"),(0,r.kt)("p",null,"JSON sends a JSON request by setting the Content-Type header to ",(0,r.kt)("inlineCode",{parentName:"p"},"application/json"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) JSON(v interface{}) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.JSON(fiber.Map{"success": true})\n// ...\n')),(0,r.kt)("h3",{id:"xml"},"XML"),(0,r.kt)("p",null,"XML sends an XML request by setting the Content-Type header to ",(0,r.kt)("inlineCode",{parentName:"p"},"application/xml"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) XML(v interface{}) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.XML(fiber.Map{"success": true})\n// ...\n')),(0,r.kt)("h3",{id:"form"},"Form"),(0,r.kt)("p",null,"Form sends a form request by setting the Content-Type header to ",(0,r.kt)("inlineCode",{parentName:"p"},"application/x-www-form-urlencoded"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"// Form sends form request with body if args is non-nil.\n//\n// It is recommended obtaining args via AcquireArgs and release it\n// manually in performance-critical code.\nfunc (a *Agent) Form(args *Args) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'args := AcquireArgs()\nargs.Set("foo", "bar")\n\nagent.Form(args)\n// ...\nReleaseArgs(args)\n')),(0,r.kt)("h3",{id:"multipartform"},"MultipartForm"),(0,r.kt)("p",null,"MultipartForm sends multipart form request by setting the Content-Type header to ",(0,r.kt)("inlineCode",{parentName:"p"},"multipart/form-data"),". These requests can include key-value's and files."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"// MultipartForm sends multipart form request with k-v and files.\n//\n// It is recommended to obtain args via AcquireArgs and release it\n// manually in performance-critical code.\nfunc (a *Agent) MultipartForm(args *Args) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'args := AcquireArgs()\nargs.Set("foo", "bar")\n\nagent.MultipartForm(args)\n// ...\nReleaseArgs(args)\n')),(0,r.kt)("p",null,"Fiber provides several methods for sending files. Note that they must be called before ",(0,r.kt)("inlineCode",{parentName:"p"},"MultipartForm"),"."),(0,r.kt)("h4",{id:"boundary"},"Boundary"),(0,r.kt)("p",null,"Boundary sets boundary for multipart form request."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Boundary(boundary string) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Boundary("myBoundary")\n .MultipartForm(nil)\n// ...\n')),(0,r.kt)("h4",{id:"sendfiles"},"SendFile","(","s",")"),(0,r.kt)("p",null,"SendFile read a file and appends it to a multipart form request. Sendfiles can be used to append multiple files."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) SendFile(filename string, fieldname ...string) *Agent\nfunc (a *Agent) SendFiles(filenamesAndFieldnames ...string) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.SendFile("f", "field name")\n .SendFiles("f1", "field name1", "f2").\n .MultipartForm(nil)\n// ...\n')),(0,r.kt)("h4",{id:"filedata"},"FileData"),(0,r.kt)("p",null,"FileData appends file data for multipart form request."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"// FormFile represents multipart form file\ntype FormFile struct {\n // Fieldname is form file's field name\n Fieldname string\n // Name is form file's name\n Name string\n // Content is form file's content\n Content []byte\n}\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"// FileData appends files for multipart form request.\n//\n// It is recommended obtaining formFile via AcquireFormFile and release it\n// manually in performance-critical code.\nfunc (a *Agent) FileData(formFiles ...*FormFile) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'ff1 := &FormFile{"filename1", "field name1", []byte("content")}\nff2 := &FormFile{"filename2", "field name2", []byte("content")}\nagent.FileData(ff1, ff2).\n MultipartForm(nil)\n// ...\n')),(0,r.kt)("h3",{id:"debug"},"Debug"),(0,r.kt)("p",null,"Debug mode enables logging request and response detail to ",(0,r.kt)("inlineCode",{parentName:"p"},"io.writer"),"(","default is ",(0,r.kt)("inlineCode",{parentName:"p"},"os.Stdout"),")","."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Debug(w ...io.Writer) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.Debug()\n// ...\n")),(0,r.kt)("h3",{id:"timeout"},"Timeout"),(0,r.kt)("p",null,"Timeout sets request timeout duration."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Timeout(timeout time.Duration) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.Timeout(time.Second)\n// ...\n")),(0,r.kt)("h3",{id:"reuse"},"Reuse"),(0,r.kt)("p",null,"Reuse enables the Agent instance to be used again after one request. If agent is reusable, then it should be released manually when it is no longer used."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Reuse() *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.Reuse()\n// ...\n")),(0,r.kt)("h3",{id:"insecureskipverify"},"InsecureSkipVerify"),(0,r.kt)("p",null,"InsecureSkipVerify controls whether the Agent verifies the server certificate chain and host name."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) InsecureSkipVerify() *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.InsecureSkipVerify()\n// ...\n")),(0,r.kt)("h3",{id:"tlsconfig"},"TLSConfig"),(0,r.kt)("p",null,"TLSConfig sets tls config."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) TLSConfig(config *tls.Config) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Create tls certificate\ncer, _ := tls.LoadX509KeyPair("pem", "key")\n\nconfig := &tls.Config{\n Certificates: []tls.Certificate{cer},\n}\n\nagent.TLSConfig(config)\n// ...\n')),(0,r.kt)("h3",{id:"maxredirectscount"},"MaxRedirectsCount"),(0,r.kt)("p",null,"MaxRedirectsCount sets max redirect count for GET and HEAD."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) MaxRedirectsCount(count int) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.MaxRedirectsCount(7)\n// ...\n")),(0,r.kt)("h3",{id:"jsonencoder"},"JSONEncoder"),(0,r.kt)("p",null,"JSONEncoder sets custom json encoder."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) JSONEncoder(jsonEncoder utils.JSONMarshal) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.JSONEncoder(json.Marshal)\n// ...\n")),(0,r.kt)("h3",{id:"jsondecoder"},"JSONDecoder"),(0,r.kt)("p",null,"JSONDecoder sets custom json decoder."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) JSONDecoder(jsonDecoder utils.JSONUnmarshal) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.JSONDecoder(json.Unmarshal)\n// ...\n")),(0,r.kt)("h3",{id:"request"},"Request"),(0,r.kt)("p",null,"Request returns Agent request instance."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Request() *Request\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"req := agent.Request()\n// ...\n")),(0,r.kt)("h3",{id:"setresponse"},"SetResponse"),(0,r.kt)("p",null,"SetResponse sets custom response for the Agent instance. It is recommended obtaining custom response via AcquireResponse and release it manually in performance-critical code."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) SetResponse(customResp *Response) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"resp := AcquireResponse()\nagent.SetResponse(resp)\n// ...\nReleaseResponse(resp)\n")),(0,r.kt)("h3",{id:"dest"},"Dest"),(0,r.kt)("p",null,"Dest sets custom dest. The contents of dest will be replaced by the response body, if the dest is too small a new slice will be allocated."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Dest(dest []byte) *Agent {\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.Dest(nil)\n// ...\n")),(0,r.kt)("h3",{id:"bytes"},"Bytes"),(0,r.kt)("p",null,"Bytes returns the status code, bytes body and errors of url."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Bytes() (code int, body []byte, errs []error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"code, body, errs := agent.Bytes()\n// ...\n")),(0,r.kt)("h3",{id:"string"},"String"),(0,r.kt)("p",null,"String returns the status code, string body and errors of url."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) String() (int, string, []error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"code, body, errs := agent.String()\n// ...\n")),(0,r.kt)("h3",{id:"struct"},"Struct"),(0,r.kt)("p",null,"Struct returns the status code, bytes body and errors of url. And bytes body will be unmarshalled to given v."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Struct(v interface{}) (code int, body []byte, errs []error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"var d data\ncode, body, errs := agent.Struct(&d)\n// ...\n")),(0,r.kt)("h3",{id:"retryif"},"RetryIf"),(0,r.kt)("p",null,"RetryIf controls whether a retry should be attempted after an error.\nBy default, will use isIdempotent function from fasthttp"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) RetryIf(retryIf RetryIfFunc) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Get("https://example.com").RetryIf(func (req *fiber.Request) bool {\n return req.URI() == "https://example.com"\n})\n// ...\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1586],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>d});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=a.createContext({}),g=function(e){var t=a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=g(e.components);return a.createElement(o.Provider,{value:t},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},c=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,o=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=g(n),c=r,d=p["".concat(o,".").concat(c)]||p[c]||m[c]||l;return n?a.createElement(d,i(i({ref:t},u),{},{components:n})):a.createElement(d,i({ref:t},u))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=c;var s={};for(var o in t)hasOwnProperty.call(t,o)&&(s[o]=t[o]);s.originalType=e,s[p]="string"==typeof e?e:r,i[1]=s;for(var g=2;g{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>s,toc:()=>g});var a=n(7462),r=(n(7294),n(3905));const l={id:"client",title:"\ud83c\udf0e Client",description:"The Client struct represents the Fiber HTTP Client.",sidebar_position:5},i=void 0,s={unversionedId:"api/client",id:"version-v2.x/api/client",title:"\ud83c\udf0e Client",description:"The Client struct represents the Fiber HTTP Client.",source:"@site/versioned_docs/version-v2.x/api/client.md",sourceDirName:"api",slug:"/api/client",permalink:"/api/client",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:5,frontMatter:{id:"client",title:"\ud83c\udf0e Client",description:"The Client struct represents the Fiber HTTP Client.",sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udccb Constants",permalink:"/api/constants"},next:{title:"\ud83e\uddec Middleware",permalink:"/category/-middleware"}},o={},g=[{value:"Start request",id:"start-request",level:2},{value:"\u2728 Agent",id:"-agent",level:2},{value:"Parse",id:"parse",level:3},{value:"Set",id:"set",level:3},{value:"Add",id:"add",level:3},{value:"ConnectionClose",id:"connectionclose",level:3},{value:"UserAgent",id:"useragent",level:3},{value:"Cookie",id:"cookie",level:3},{value:"Referer",id:"referer",level:3},{value:"ContentType",id:"contenttype",level:3},{value:"Host",id:"host",level:3},{value:"QueryString",id:"querystring",level:3},{value:"BasicAuth",id:"basicauth",level:3},{value:"Body",id:"body",level:3},{value:"JSON",id:"json",level:3},{value:"XML",id:"xml",level:3},{value:"Form",id:"form",level:3},{value:"MultipartForm",id:"multipartform",level:3},{value:"Boundary",id:"boundary",level:4},{value:"SendFile(s)",id:"sendfiles",level:4},{value:"FileData",id:"filedata",level:4},{value:"Debug",id:"debug",level:3},{value:"Timeout",id:"timeout",level:3},{value:"Reuse",id:"reuse",level:3},{value:"InsecureSkipVerify",id:"insecureskipverify",level:3},{value:"TLSConfig",id:"tlsconfig",level:3},{value:"MaxRedirectsCount",id:"maxredirectscount",level:3},{value:"JSONEncoder",id:"jsonencoder",level:3},{value:"JSONDecoder",id:"jsondecoder",level:3},{value:"Request",id:"request",level:3},{value:"SetResponse",id:"setresponse",level:3},{value:"Dest",id:"dest",level:3},{value:"Bytes",id:"bytes",level:3},{value:"String",id:"string",level:3},{value:"Struct",id:"struct",level:3},{value:"RetryIf",id:"retryif",level:3}],u={toc:g},p="wrapper";function m(e){let{components:t,...n}=e;return(0,r.kt)(p,(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"start-request"},"Start request"),(0,r.kt)("p",null,"Start a http request with http method and url."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signatures"',title:'"Signatures"'},"// Client http methods\nfunc (c *Client) Get(url string) *Agent\nfunc (c *Client) Head(url string) *Agent\nfunc (c *Client) Post(url string) *Agent\nfunc (c *Client) Put(url string) *Agent\nfunc (c *Client) Patch(url string) *Agent\nfunc (c *Client) Delete(url string) *Agent\n")),(0,r.kt)("h2",{id:"-agent"},"\u2728 Agent"),(0,r.kt)("p",null,(0,r.kt)("inlineCode",{parentName:"p"},"Agent")," is built on top of FastHTTP's ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/valyala/fasthttp/blob/master/client.go#L603"},(0,r.kt)("inlineCode",{parentName:"a"},"HostClient"))," which has lots of convenient helper methods such as dedicated methods for request methods."),(0,r.kt)("h3",{id:"parse"},"Parse"),(0,r.kt)("p",null,"Parse initializes a HostClient."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Parse"',title:'"Parse"'},'a := AcquireAgent()\nreq := a.Request()\nreq.Header.SetMethod(MethodGet)\nreq.SetRequestURI("http://example.com")\n\nif err := a.Parse(); err != nil {\n panic(err)\n}\n\ncode, body, errs := a.Bytes() // ...\n')),(0,r.kt)("h3",{id:"set"},"Set"),(0,r.kt)("p",null,"Set sets the given ",(0,r.kt)("inlineCode",{parentName:"p"},"key: value")," header."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Set(k, v string) *Agent\nfunc (a *Agent) SetBytesK(k []byte, v string) *Agent\nfunc (a *Agent) SetBytesV(k string, v []byte) *Agent\nfunc (a *Agent) SetBytesKV(k []byte, v []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Set("k1", "v1").\n SetBytesK([]byte("k1"), "v1").\n SetBytesV("k1", []byte("v1")).\n SetBytesKV([]byte("k2"), []byte("v2"))\n// ...\n')),(0,r.kt)("h3",{id:"add"},"Add"),(0,r.kt)("p",null,"Add adds the given ",(0,r.kt)("inlineCode",{parentName:"p"},"key: value")," header. Multiple headers with the same key may be added with this function."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Add(k, v string) *Agent\nfunc (a *Agent) AddBytesK(k []byte, v string) *Agent\nfunc (a *Agent) AddBytesV(k string, v []byte) *Agent\nfunc (a *Agent) AddBytesKV(k []byte, v []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Add("k1", "v1").\n AddBytesK([]byte("k1"), "v1").\n AddBytesV("k1", []byte("v1")).\n AddBytesKV([]byte("k2"), []byte("v2"))\n// Headers:\n// K1: v1\n// K1: v1\n// K1: v1\n// K2: v2\n')),(0,r.kt)("h3",{id:"connectionclose"},"ConnectionClose"),(0,r.kt)("p",null,"ConnectionClose adds the ",(0,r.kt)("inlineCode",{parentName:"p"},"Connection: close")," header."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) ConnectionClose() *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.ConnectionClose()\n// ...\n")),(0,r.kt)("h3",{id:"useragent"},"UserAgent"),(0,r.kt)("p",null,"UserAgent sets ",(0,r.kt)("inlineCode",{parentName:"p"},"User-Agent")," header value."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) UserAgent(userAgent string) *Agent\nfunc (a *Agent) UserAgentBytes(userAgent []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.UserAgent("fiber")\n// ...\n')),(0,r.kt)("h3",{id:"cookie"},"Cookie"),(0,r.kt)("p",null,"Cookie sets a cookie in ",(0,r.kt)("inlineCode",{parentName:"p"},"key: value")," form. ",(0,r.kt)("inlineCode",{parentName:"p"},"Cookies")," can be used to set multiple cookies."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Cookie(key, value string) *Agent\nfunc (a *Agent) CookieBytesK(key []byte, value string) *Agent\nfunc (a *Agent) CookieBytesKV(key, value []byte) *Agent\nfunc (a *Agent) Cookies(kv ...string) *Agent\nfunc (a *Agent) CookiesBytesKV(kv ...[]byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Cookie("k", "v")\nagent.Cookies("k1", "v1", "k2", "v2")\n// ...\n')),(0,r.kt)("h3",{id:"referer"},"Referer"),(0,r.kt)("p",null,"Referer sets the Referer header value."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Referer(referer string) *Agent\nfunc (a *Agent) RefererBytes(referer []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Referer("https://docs.gofiber.io")\n// ...\n')),(0,r.kt)("h3",{id:"contenttype"},"ContentType"),(0,r.kt)("p",null,"ContentType sets Content-Type header value."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) ContentType(contentType string) *Agent\nfunc (a *Agent) ContentTypeBytes(contentType []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.ContentType("custom-type")\n// ...\n')),(0,r.kt)("h3",{id:"host"},"Host"),(0,r.kt)("p",null,"Host sets the Host header."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Host(host string) *Agent\nfunc (a *Agent) HostBytes(host []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Host("example.com")\n// ...\n')),(0,r.kt)("h3",{id:"querystring"},"QueryString"),(0,r.kt)("p",null,"QueryString sets the URI query string."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) QueryString(queryString string) *Agent\nfunc (a *Agent) QueryStringBytes(queryString []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.QueryString("foo=bar")\n// ...\n')),(0,r.kt)("h3",{id:"basicauth"},"BasicAuth"),(0,r.kt)("p",null,"BasicAuth sets the URI username and password using HTTP Basic Auth."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) BasicAuth(username, password string) *Agent\nfunc (a *Agent) BasicAuthBytes(username, password []byte) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.BasicAuth("foo", "bar")\n// ...\n')),(0,r.kt)("h3",{id:"body"},"Body"),(0,r.kt)("p",null,"There are several ways to set request body."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) BodyString(bodyString string) *Agent\nfunc (a *Agent) Body(body []byte) *Agent\n\n// BodyStream sets request body stream and, optionally body size.\n//\n// If bodySize is >= 0, then the bodyStream must provide exactly bodySize bytes\n// before returning io.EOF.\n//\n// If bodySize < 0, then bodyStream is read until io.EOF.\n//\n// bodyStream.Close() is called after finishing reading all body data\n// if it implements io.Closer.\n//\n// Note that GET and HEAD requests cannot have body.\nfunc (a *Agent) BodyStream(bodyStream io.Reader, bodySize int) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.BodyString("foo=bar")\nagent.Body([]byte("bar=baz"))\nagent.BodyStream(strings.NewReader("body=stream"), -1)\n// ...\n')),(0,r.kt)("h3",{id:"json"},"JSON"),(0,r.kt)("p",null,"JSON sends a JSON request by setting the Content-Type header to ",(0,r.kt)("inlineCode",{parentName:"p"},"application/json"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) JSON(v interface{}) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.JSON(fiber.Map{"success": true})\n// ...\n')),(0,r.kt)("h3",{id:"xml"},"XML"),(0,r.kt)("p",null,"XML sends an XML request by setting the Content-Type header to ",(0,r.kt)("inlineCode",{parentName:"p"},"application/xml"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) XML(v interface{}) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.XML(fiber.Map{"success": true})\n// ...\n')),(0,r.kt)("h3",{id:"form"},"Form"),(0,r.kt)("p",null,"Form sends a form request by setting the Content-Type header to ",(0,r.kt)("inlineCode",{parentName:"p"},"application/x-www-form-urlencoded"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"// Form sends form request with body if args is non-nil.\n//\n// It is recommended obtaining args via AcquireArgs and release it\n// manually in performance-critical code.\nfunc (a *Agent) Form(args *Args) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'args := AcquireArgs()\nargs.Set("foo", "bar")\n\nagent.Form(args)\n// ...\nReleaseArgs(args)\n')),(0,r.kt)("h3",{id:"multipartform"},"MultipartForm"),(0,r.kt)("p",null,"MultipartForm sends multipart form request by setting the Content-Type header to ",(0,r.kt)("inlineCode",{parentName:"p"},"multipart/form-data"),". These requests can include key-value's and files."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"// MultipartForm sends multipart form request with k-v and files.\n//\n// It is recommended to obtain args via AcquireArgs and release it\n// manually in performance-critical code.\nfunc (a *Agent) MultipartForm(args *Args) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'args := AcquireArgs()\nargs.Set("foo", "bar")\n\nagent.MultipartForm(args)\n// ...\nReleaseArgs(args)\n')),(0,r.kt)("p",null,"Fiber provides several methods for sending files. Note that they must be called before ",(0,r.kt)("inlineCode",{parentName:"p"},"MultipartForm"),"."),(0,r.kt)("h4",{id:"boundary"},"Boundary"),(0,r.kt)("p",null,"Boundary sets boundary for multipart form request."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Boundary(boundary string) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Boundary("myBoundary")\n .MultipartForm(nil)\n// ...\n')),(0,r.kt)("h4",{id:"sendfiles"},"SendFile","(","s",")"),(0,r.kt)("p",null,"SendFile read a file and appends it to a multipart form request. Sendfiles can be used to append multiple files."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) SendFile(filename string, fieldname ...string) *Agent\nfunc (a *Agent) SendFiles(filenamesAndFieldnames ...string) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.SendFile("f", "field name")\n .SendFiles("f1", "field name1", "f2").\n .MultipartForm(nil)\n// ...\n')),(0,r.kt)("h4",{id:"filedata"},"FileData"),(0,r.kt)("p",null,"FileData appends file data for multipart form request."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"// FormFile represents multipart form file\ntype FormFile struct {\n // Fieldname is form file's field name\n Fieldname string\n // Name is form file's name\n Name string\n // Content is form file's content\n Content []byte\n}\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"// FileData appends files for multipart form request.\n//\n// It is recommended obtaining formFile via AcquireFormFile and release it\n// manually in performance-critical code.\nfunc (a *Agent) FileData(formFiles ...*FormFile) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'ff1 := &FormFile{"filename1", "field name1", []byte("content")}\nff2 := &FormFile{"filename2", "field name2", []byte("content")}\nagent.FileData(ff1, ff2).\n MultipartForm(nil)\n// ...\n')),(0,r.kt)("h3",{id:"debug"},"Debug"),(0,r.kt)("p",null,"Debug mode enables logging request and response detail to ",(0,r.kt)("inlineCode",{parentName:"p"},"io.writer"),"(","default is ",(0,r.kt)("inlineCode",{parentName:"p"},"os.Stdout"),")","."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Debug(w ...io.Writer) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.Debug()\n// ...\n")),(0,r.kt)("h3",{id:"timeout"},"Timeout"),(0,r.kt)("p",null,"Timeout sets request timeout duration."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Timeout(timeout time.Duration) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.Timeout(time.Second)\n// ...\n")),(0,r.kt)("h3",{id:"reuse"},"Reuse"),(0,r.kt)("p",null,"Reuse enables the Agent instance to be used again after one request. If agent is reusable, then it should be released manually when it is no longer used."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Reuse() *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.Reuse()\n// ...\n")),(0,r.kt)("h3",{id:"insecureskipverify"},"InsecureSkipVerify"),(0,r.kt)("p",null,"InsecureSkipVerify controls whether the Agent verifies the server certificate chain and host name."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) InsecureSkipVerify() *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.InsecureSkipVerify()\n// ...\n")),(0,r.kt)("h3",{id:"tlsconfig"},"TLSConfig"),(0,r.kt)("p",null,"TLSConfig sets tls config."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) TLSConfig(config *tls.Config) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Create tls certificate\ncer, _ := tls.LoadX509KeyPair("pem", "key")\n\nconfig := &tls.Config{\n Certificates: []tls.Certificate{cer},\n}\n\nagent.TLSConfig(config)\n// ...\n')),(0,r.kt)("h3",{id:"maxredirectscount"},"MaxRedirectsCount"),(0,r.kt)("p",null,"MaxRedirectsCount sets max redirect count for GET and HEAD."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) MaxRedirectsCount(count int) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.MaxRedirectsCount(7)\n// ...\n")),(0,r.kt)("h3",{id:"jsonencoder"},"JSONEncoder"),(0,r.kt)("p",null,"JSONEncoder sets custom json encoder."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) JSONEncoder(jsonEncoder utils.JSONMarshal) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.JSONEncoder(json.Marshal)\n// ...\n")),(0,r.kt)("h3",{id:"jsondecoder"},"JSONDecoder"),(0,r.kt)("p",null,"JSONDecoder sets custom json decoder."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) JSONDecoder(jsonDecoder utils.JSONUnmarshal) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.JSONDecoder(json.Unmarshal)\n// ...\n")),(0,r.kt)("h3",{id:"request"},"Request"),(0,r.kt)("p",null,"Request returns Agent request instance."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Request() *Request\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"req := agent.Request()\n// ...\n")),(0,r.kt)("h3",{id:"setresponse"},"SetResponse"),(0,r.kt)("p",null,"SetResponse sets custom response for the Agent instance. It is recommended obtaining custom response via AcquireResponse and release it manually in performance-critical code."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) SetResponse(customResp *Response) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"resp := AcquireResponse()\nagent.SetResponse(resp)\n// ...\nReleaseResponse(resp)\n")),(0,r.kt)("h3",{id:"dest"},"Dest"),(0,r.kt)("p",null,"Dest sets custom dest. The contents of dest will be replaced by the response body, if the dest is too small a new slice will be allocated."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Dest(dest []byte) *Agent {\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"agent.Dest(nil)\n// ...\n")),(0,r.kt)("h3",{id:"bytes"},"Bytes"),(0,r.kt)("p",null,"Bytes returns the status code, bytes body and errors of url."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Bytes() (code int, body []byte, errs []error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"code, body, errs := agent.Bytes()\n// ...\n")),(0,r.kt)("h3",{id:"string"},"String"),(0,r.kt)("p",null,"String returns the status code, string body and errors of url."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) String() (int, string, []error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"code, body, errs := agent.String()\n// ...\n")),(0,r.kt)("h3",{id:"struct"},"Struct"),(0,r.kt)("p",null,"Struct returns the status code, bytes body and errors of url. And bytes body will be unmarshalled to given v."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) Struct(v interface{}) (code int, body []byte, errs []error)\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"var d data\ncode, body, errs := agent.Struct(&d)\n// ...\n")),(0,r.kt)("h3",{id:"retryif"},"RetryIf"),(0,r.kt)("p",null,"RetryIf controls whether a retry should be attempted after an error.\nBy default, will use isIdempotent function from fasthttp"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func (a *Agent) RetryIf(retryIf RetryIfFunc) *Agent\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'agent.Get("https://example.com").RetryIf(func (req *fiber.Request) bool {\n return req.URI() == "https://example.com"\n})\n// ...\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6b69f1ff.52342e9c.js b/assets/js/6b69f1ff.074e951f.js similarity index 99% rename from assets/js/6b69f1ff.52342e9c.js rename to assets/js/6b69f1ff.074e951f.js index 6a4432dad35..0d1033bcd01 100644 --- a/assets/js/6b69f1ff.52342e9c.js +++ b/assets/js/6b69f1ff.074e951f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9673],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),g=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=g(e.components);return r.createElement(s.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},c=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),p=g(n),c=a,m=p["".concat(s,".").concat(c)]||p[c]||d[c]||o;return n?r.createElement(m,i(i({ref:t},u),{},{components:n})):r.createElement(m,i({ref:t},u))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=c;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:a,i[1]=l;for(var g=2;g{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>g});var r=n(7462),a=(n(7294),n(3905));const o={id:"logger",title:"Logger"},i=void 0,l={unversionedId:"api/middleware/logger",id:"version-v2.x/api/middleware/logger",title:"Logger",description:"Logger middleware for Fiber that logs HTTP request/response details.",source:"@site/versioned_docs/version-v2.x/api/middleware/logger.md",sourceDirName:"api/middleware",slug:"/api/middleware/logger",permalink:"/api/middleware/logger",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"logger",title:"Logger"},sidebar:"tutorialSidebar",previous:{title:"Limiter",permalink:"/api/middleware/limiter"},next:{title:"Monitor",permalink:"/api/middleware/monitor"}},s={},g=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Constants",id:"constants",level:2}],u={toc:g},p="wrapper";function d(e){let{components:t,...n}=e;return(0,a.kt)(p,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Logger middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that logs HTTP request/response details."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/logger"\n)\n')),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"The order of registration plays a role. Only all routes that are registered after this one will be logged.\nThe middleware should therefore be one of the first to be registered.")),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(logger.New())\n\n// Or extend your config for customization\n// Logging remote IP and Port\napp.Use(logger.New(logger.Config{\n Format: "[${ip}]:${port} ${status} - ${method} ${path}\\n",\n}))\n\n// Logging Request ID\napp.Use(requestid.New())\napp.Use(logger.New(logger.Config{\n // For more options, see the Config section\n Format: "${pid} ${locals:requestid} ${status} - ${method} ${path}\u200b\\n",\n}))\n\n// Changing TimeZone & TimeFormat\napp.Use(logger.New(logger.Config{\n Format: "${pid} ${status} - ${method} ${path}\\n",\n TimeFormat: "02-Jan-2006",\n TimeZone: "America/New_York",\n}))\n\n// Custom File Writer\nfile, err := os.OpenFile("./123.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)\nif err != nil {\n log.Fatalf("error opening file: %v", err)\n}\ndefer file.Close()\napp.Use(logger.New(logger.Config{\n Output: file,\n}))\n\n// Add Custom Tags\napp.Use(logger.New(logger.Config{\n CustomTags: map[string]logger.LogFunc{\n "custom_tag": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) {\n return output.WriteString("it is a custom tag")\n },\n },\n}))\n\n// Callback after log is written\napp.Use(logger.New(logger.Config{\n TimeFormat: time.RFC3339Nano,\n TimeZone: "Asia/Shanghai",\n Done: func(c *fiber.Ctx, logString []byte) {\n if c.Response().StatusCode() != fiber.StatusOK {\n reporter.SendToSlack(logString) \n }\n },\n}))\n\n// Disable colors when outputting to default format\napp.Use(logger.New(logger.Config{\n DisableColors: true,\n}))\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n \n // Done is a function that is called after the log string for a request is written to Output,\n // and pass the log string as parameter.\n //\n // Optional. Default: nil\n Done func(c *fiber.Ctx, logString []byte)\n \n // tagFunctions defines the custom tag action\n //\n // Optional. Default: map[string]LogFunc\n CustomTags map[string]LogFunc\n \n // Format defines the logging tags\n //\n // Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\\n\n Format string\n \n // TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html\n //\n // Optional. Default: 15:04:05\n TimeFormat string\n \n // TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc\n //\n // Optional. Default: "Local"\n TimeZone string\n \n // TimeInterval is the delay before the timestamp is updated\n //\n // Optional. Default: 500 * time.Millisecond\n TimeInterval time.Duration\n \n // Output is a writer where logs are written\n //\n // Default: os.Stdout\n Output io.Writer\n \n // DisableColors defines if the logs output should be colorized\n //\n // Default: false\n DisableColors bool\n \n enableColors bool\n enableLatency bool\n timeZoneLocation *time.Location\n}\ntype LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Done: nil,\n Format: "[${time}] ${status} - ${latency} ${method} ${path}\\n",\n TimeFormat: "15:04:05",\n TimeZone: "Local",\n TimeInterval: 500 * time.Millisecond,\n Output: os.Stdout,\n DisableColors: true,\n}\n')),(0,a.kt)("h2",{id:"constants"},"Constants"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Logger variables\nconst (\n TagPid = "pid"\n TagTime = "time"\n TagReferer = "referer"\n TagProtocol = "protocol"\n TagPort = "port"\n TagIP = "ip"\n TagIPs = "ips"\n TagHost = "host"\n TagMethod = "method"\n TagPath = "path"\n TagURL = "url"\n TagUA = "ua"\n TagLatency = "latency"\n TagStatus = "status" // response status\n TagResBody = "resBody" // response body\n TagReqHeaders = "reqHeaders"\n TagQueryStringParams = "queryParams" // request query parameters\n TagBody = "body" // request body\n TagBytesSent = "bytesSent"\n TagBytesReceived = "bytesReceived"\n TagRoute = "route"\n TagError = "error"\n // DEPRECATED: Use TagReqHeader instead\n TagHeader = "header:" // request header\n TagReqHeader = "reqHeader:" // request header\n TagRespHeader = "respHeader:" // response header\n TagQuery = "query:" // request query\n TagForm = "form:" // request form\n TagCookie = "cookie:" // request cookie\n TagLocals = "locals:"\n // colors\n TagBlack = "black"\n TagRed = "red"\n TagGreen = "green"\n TagYellow = "yellow"\n TagBlue = "blue"\n TagMagenta = "magenta"\n TagCyan = "cyan"\n TagWhite = "white"\n TagReset = "reset"\n)\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9673],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),g=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=g(e.components);return r.createElement(s.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},c=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),p=g(n),c=a,m=p["".concat(s,".").concat(c)]||p[c]||d[c]||o;return n?r.createElement(m,i(i({ref:t},u),{},{components:n})):r.createElement(m,i({ref:t},u))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=c;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:a,i[1]=l;for(var g=2;g{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>g});var r=n(7462),a=(n(7294),n(3905));const o={id:"logger",title:"Logger"},i=void 0,l={unversionedId:"api/middleware/logger",id:"version-v2.x/api/middleware/logger",title:"Logger",description:"Logger middleware for Fiber that logs HTTP request/response details.",source:"@site/versioned_docs/version-v2.x/api/middleware/logger.md",sourceDirName:"api/middleware",slug:"/api/middleware/logger",permalink:"/api/middleware/logger",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"logger",title:"Logger"},sidebar:"tutorialSidebar",previous:{title:"Limiter",permalink:"/api/middleware/limiter"},next:{title:"Monitor",permalink:"/api/middleware/monitor"}},s={},g=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Constants",id:"constants",level:2}],u={toc:g},p="wrapper";function d(e){let{components:t,...n}=e;return(0,a.kt)(p,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Logger middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that logs HTTP request/response details."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/logger"\n)\n')),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"The order of registration plays a role. Only all routes that are registered after this one will be logged.\nThe middleware should therefore be one of the first to be registered.")),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(logger.New())\n\n// Or extend your config for customization\n// Logging remote IP and Port\napp.Use(logger.New(logger.Config{\n Format: "[${ip}]:${port} ${status} - ${method} ${path}\\n",\n}))\n\n// Logging Request ID\napp.Use(requestid.New())\napp.Use(logger.New(logger.Config{\n // For more options, see the Config section\n Format: "${pid} ${locals:requestid} ${status} - ${method} ${path}\u200b\\n",\n}))\n\n// Changing TimeZone & TimeFormat\napp.Use(logger.New(logger.Config{\n Format: "${pid} ${status} - ${method} ${path}\\n",\n TimeFormat: "02-Jan-2006",\n TimeZone: "America/New_York",\n}))\n\n// Custom File Writer\nfile, err := os.OpenFile("./123.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)\nif err != nil {\n log.Fatalf("error opening file: %v", err)\n}\ndefer file.Close()\napp.Use(logger.New(logger.Config{\n Output: file,\n}))\n\n// Add Custom Tags\napp.Use(logger.New(logger.Config{\n CustomTags: map[string]logger.LogFunc{\n "custom_tag": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) {\n return output.WriteString("it is a custom tag")\n },\n },\n}))\n\n// Callback after log is written\napp.Use(logger.New(logger.Config{\n TimeFormat: time.RFC3339Nano,\n TimeZone: "Asia/Shanghai",\n Done: func(c *fiber.Ctx, logString []byte) {\n if c.Response().StatusCode() != fiber.StatusOK {\n reporter.SendToSlack(logString) \n }\n },\n}))\n\n// Disable colors when outputting to default format\napp.Use(logger.New(logger.Config{\n DisableColors: true,\n}))\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n \n // Done is a function that is called after the log string for a request is written to Output,\n // and pass the log string as parameter.\n //\n // Optional. Default: nil\n Done func(c *fiber.Ctx, logString []byte)\n \n // tagFunctions defines the custom tag action\n //\n // Optional. Default: map[string]LogFunc\n CustomTags map[string]LogFunc\n \n // Format defines the logging tags\n //\n // Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\\n\n Format string\n \n // TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html\n //\n // Optional. Default: 15:04:05\n TimeFormat string\n \n // TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc\n //\n // Optional. Default: "Local"\n TimeZone string\n \n // TimeInterval is the delay before the timestamp is updated\n //\n // Optional. Default: 500 * time.Millisecond\n TimeInterval time.Duration\n \n // Output is a writer where logs are written\n //\n // Default: os.Stdout\n Output io.Writer\n \n // DisableColors defines if the logs output should be colorized\n //\n // Default: false\n DisableColors bool\n \n enableColors bool\n enableLatency bool\n timeZoneLocation *time.Location\n}\ntype LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Done: nil,\n Format: "[${time}] ${status} - ${latency} ${method} ${path}\\n",\n TimeFormat: "15:04:05",\n TimeZone: "Local",\n TimeInterval: 500 * time.Millisecond,\n Output: os.Stdout,\n DisableColors: true,\n}\n')),(0,a.kt)("h2",{id:"constants"},"Constants"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Logger variables\nconst (\n TagPid = "pid"\n TagTime = "time"\n TagReferer = "referer"\n TagProtocol = "protocol"\n TagPort = "port"\n TagIP = "ip"\n TagIPs = "ips"\n TagHost = "host"\n TagMethod = "method"\n TagPath = "path"\n TagURL = "url"\n TagUA = "ua"\n TagLatency = "latency"\n TagStatus = "status" // response status\n TagResBody = "resBody" // response body\n TagReqHeaders = "reqHeaders"\n TagQueryStringParams = "queryParams" // request query parameters\n TagBody = "body" // request body\n TagBytesSent = "bytesSent"\n TagBytesReceived = "bytesReceived"\n TagRoute = "route"\n TagError = "error"\n // DEPRECATED: Use TagReqHeader instead\n TagHeader = "header:" // request header\n TagReqHeader = "reqHeader:" // request header\n TagRespHeader = "respHeader:" // response header\n TagQuery = "query:" // request query\n TagForm = "form:" // request form\n TagCookie = "cookie:" // request cookie\n TagLocals = "locals:"\n // colors\n TagBlack = "black"\n TagRed = "red"\n TagGreen = "green"\n TagYellow = "yellow"\n TagBlue = "blue"\n TagMagenta = "magenta"\n TagCyan = "cyan"\n TagWhite = "white"\n TagReset = "reset"\n)\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6d7ca528.1de486dc.js b/assets/js/6d7ca528.8ab0503d.js similarity index 99% rename from assets/js/6d7ca528.1de486dc.js rename to assets/js/6d7ca528.8ab0503d.js index 3d890b28050..3a0511a64b0 100644 --- a/assets/js/6d7ca528.1de486dc.js +++ b/assets/js/6d7ca528.8ab0503d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[787],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),u=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=u(e.components);return n.createElement(l.Provider,{value:t},e.children)},c="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},g=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),c=u(r),g=a,m=c["".concat(l,".").concat(g)]||c[g]||f[g]||o;return r?n.createElement(m,i(i({ref:t},p),{},{components:r})):n.createElement(m,i({ref:t},p))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=g;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:a,i[1]=s;for(var u=2;u{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>f,frontMatter:()=>o,metadata:()=>s,toc:()=>u});var n=r(7462),a=(r(7294),r(3905));const o={id:"ristretto",title:"Ristretto"},i=void 0,s={unversionedId:"ristretto/ristretto",id:"ristretto/ristretto",title:"Ristretto",description:"Release",source:"@site/docs/storage/ristretto/README.md",sourceDirName:"ristretto",slug:"/ristretto/",permalink:"/storage/ristretto/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/ristretto/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"ristretto",title:"Ristretto"},sidebar:"tutorialSidebar",previous:{title:"Redis",permalink:"/storage/redis/"},next:{title:"S3",permalink:"/storage/s3/"}},l={},u=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],p={toc:u},c="wrapper";function f(e){let{components:t,...r}=e;return(0,a.kt)(c,(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=ristretto*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-ristretto.yml?label=Tests",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,a.kt)("p",null,"A Memory-bound storage driver using ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/dgraph-io/ristretto"},(0,a.kt)("inlineCode",{parentName:"a"},"dgraph-io/ristretto")),"."),(0,a.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,a.kt)("h3",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *ristretto.Cache\n")),(0,a.kt)("h3",{id:"installation"},"Installation"),(0,a.kt)("p",null,"Ristretto is tested on the 2 last ",(0,a.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,a.kt)("p",null,"And then install the ristretto implementation:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/ristretto\n")),(0,a.kt)("h3",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the storage package."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/ristretto"\n')),(0,a.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Initialize default config\nstore := ristretto.New()\n\n// Initialize custom config\nstore := ristretto.New(ristretto.Config{\n NumCounters: 1e7, // number of keys to track frequency of (10M).\n MaxCost: 1 << 30, // maximum cost of cache (1GB).\n BufferItems: 64, // number of keys per Get buffer.\n})\n")),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"type Config struct {\n // NumCounters number of keys to track frequency of (10M).\n NumCounters int64\n\n // MaxCost maximum cost of cache (1GB).\n MaxCost int64\n\n // BufferItems number of keys per Get buffer.\n BufferItems int64\n}\n")),(0,a.kt)("h3",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n NumCounters: 1e7,\n MaxCost: 1 << 30,\n BufferItems: 64,\n DefaultCost: 1,\n}\n")))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[787],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),u=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=u(e.components);return n.createElement(l.Provider,{value:t},e.children)},c="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},g=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),c=u(r),g=a,m=c["".concat(l,".").concat(g)]||c[g]||f[g]||o;return r?n.createElement(m,i(i({ref:t},p),{},{components:r})):n.createElement(m,i({ref:t},p))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=g;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:a,i[1]=s;for(var u=2;u{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>f,frontMatter:()=>o,metadata:()=>s,toc:()=>u});var n=r(7462),a=(r(7294),r(3905));const o={id:"ristretto",title:"Ristretto"},i=void 0,s={unversionedId:"ristretto/ristretto",id:"ristretto/ristretto",title:"Ristretto",description:"Release",source:"@site/docs/storage/ristretto/README.md",sourceDirName:"ristretto",slug:"/ristretto/",permalink:"/storage/ristretto/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/ristretto/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"ristretto",title:"Ristretto"},sidebar:"tutorialSidebar",previous:{title:"Redis",permalink:"/storage/redis/"},next:{title:"S3",permalink:"/storage/s3/"}},l={},u=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],p={toc:u},c="wrapper";function f(e){let{components:t,...r}=e;return(0,a.kt)(c,(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=ristretto*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-ristretto.yml?label=Tests",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,a.kt)("p",null,"A Memory-bound storage driver using ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/dgraph-io/ristretto"},(0,a.kt)("inlineCode",{parentName:"a"},"dgraph-io/ristretto")),"."),(0,a.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,a.kt)("h3",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *ristretto.Cache\n")),(0,a.kt)("h3",{id:"installation"},"Installation"),(0,a.kt)("p",null,"Ristretto is tested on the 2 last ",(0,a.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,a.kt)("p",null,"And then install the ristretto implementation:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/ristretto\n")),(0,a.kt)("h3",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the storage package."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/ristretto"\n')),(0,a.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Initialize default config\nstore := ristretto.New()\n\n// Initialize custom config\nstore := ristretto.New(ristretto.Config{\n NumCounters: 1e7, // number of keys to track frequency of (10M).\n MaxCost: 1 << 30, // maximum cost of cache (1GB).\n BufferItems: 64, // number of keys per Get buffer.\n})\n")),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"type Config struct {\n // NumCounters number of keys to track frequency of (10M).\n NumCounters int64\n\n // MaxCost maximum cost of cache (1GB).\n MaxCost int64\n\n // BufferItems number of keys per Get buffer.\n BufferItems int64\n}\n")),(0,a.kt)("h3",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n NumCounters: 1e7,\n MaxCost: 1 << 30,\n BufferItems: 64,\n DefaultCost: 1,\n}\n")))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6e0f0a87.b9837daa.js b/assets/js/6e0f0a87.7cb9fbab.js similarity index 99% rename from assets/js/6e0f0a87.b9837daa.js rename to assets/js/6e0f0a87.7cb9fbab.js index 995ba0dec03..ddd98eb1d27 100644 --- a/assets/js/6e0f0a87.b9837daa.js +++ b/assets/js/6e0f0a87.7cb9fbab.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5979],{3905:(e,n,t)=>{t.d(n,{Zo:()=>p,kt:()=>g});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=r.createContext({}),c=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},p=function(e){var n=c(e.components);return r.createElement(s.Provider,{value:n},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},f=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(t),f=i,g=u["".concat(s,".").concat(f)]||u[f]||d[f]||a;return t?r.createElement(g,o(o({ref:n},p),{},{components:t})):r.createElement(g,o({ref:n},p))}));function g(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=f;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[u]="string"==typeof e?e:i,o[1]=l;for(var c=2;c{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>o,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var r=t(7462),i=(t(7294),t(3905));const a={id:"cors",title:"CORS"},o=void 0,l={unversionedId:"api/middleware/cors",id:"api/middleware/cors",title:"CORS",description:"CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.",source:"@site/docs/core/api/middleware/cors.md",sourceDirName:"api/middleware",slug:"/api/middleware/cors",permalink:"/next/api/middleware/cors",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/cors.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"cors",title:"CORS"},sidebar:"tutorialSidebar",previous:{title:"Compress",permalink:"/next/api/middleware/compress"},next:{title:"CSRF",permalink:"/next/api/middleware/csrf"}},s={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],p={toc:c},u="wrapper";function d(e){let{components:n,...t}=e;return(0,i.kt)(u,(0,r.Z)({},p,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"CORS middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that can be used to enable ",(0,i.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS"},"Cross-Origin Resource Sharing")," with various options."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/cors"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(cors.New())\n\n// Or extend your config for customization\napp.Use(cors.New(cors.Config{\n AllowOrigins: "https://gofiber.io, https://gofiber.net",\n AllowHeaders: "Origin, Content-Type, Accept",\n}))\n')),(0,i.kt)("p",null,"Using the ",(0,i.kt)("inlineCode",{parentName:"p"},"AllowOriginsFunc")," function. In this example any origin will be allowed via CORS."),(0,i.kt)("p",null,"For example, if a browser running on ",(0,i.kt)("inlineCode",{parentName:"p"},"http://localhost:3000")," sends a request, this will be accepted and the ",(0,i.kt)("inlineCode",{parentName:"p"},"access-control-allow-origin")," response header will be set to ",(0,i.kt)("inlineCode",{parentName:"p"},"http://localhost:3000"),"."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via ",(0,i.kt)("inlineCode",{parentName:"strong"},"AllowOrigins"),".")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(cors.New())\n\napp.Use(cors.New(cors.Config{\n AllowOriginsFunc: func(origin string) bool {\n return os.Getenv("ENVIRONMENT") == "development"\n },\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // AllowOriginsFunc defines a function that will set the \'access-control-allow-origin\'\n // response header to the \'origin\' request header when returned true.\n // \n // Note: Using this feature is discouraged in production and it\'s best practice to explicitly\n // set CORS origins via \'AllowOrigins\'\n //\n // Optional. Default: nil\n AllowOriginsFunc func(origin string) bool\n\n // AllowOrigin defines a list of origins that may access the resource.\n //\n // Optional. Default value "*"\n AllowOrigins string\n\n // AllowMethods defines a list methods allowed when accessing the resource.\n // This is used in response to a preflight request.\n //\n // Optional. Default value "GET,POST,HEAD,PUT,DELETE,PATCH"\n AllowMethods string\n\n // AllowHeaders defines a list of request headers that can be used when\n // making the actual request. This is in response to a preflight request.\n //\n // Optional. Default value "".\n AllowHeaders string\n\n // AllowCredentials indicates whether or not the response to the request\n // can be exposed when the credentials flag is true. When used as part of\n // a response to a preflight request, this indicates whether or not the\n // actual request can be made using credentials.\n //\n // Optional. Default value false.\n AllowCredentials bool\n\n // ExposeHeaders defines a whitelist headers that clients are allowed to\n // access.\n //\n // Optional. Default value "".\n ExposeHeaders string\n\n // MaxAge indicates how long (in seconds) the results of a preflight request\n // can be cached.\n //\n // Optional. Default value 0.\n MaxAge int\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n AllowOriginsFunc: nil,\n AllowOrigins: "*",\n AllowMethods: strings.Join([]string{\n fiber.MethodGet,\n fiber.MethodPost,\n fiber.MethodHead,\n fiber.MethodPut,\n fiber.MethodDelete,\n fiber.MethodPatch,\n }, ","),\n AllowHeaders: "",\n AllowCredentials: false,\n ExposeHeaders: "",\n MaxAge: 0,\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5979],{3905:(e,n,t)=>{t.d(n,{Zo:()=>p,kt:()=>g});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=r.createContext({}),c=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},p=function(e){var n=c(e.components);return r.createElement(s.Provider,{value:n},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},f=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(t),f=i,g=u["".concat(s,".").concat(f)]||u[f]||d[f]||a;return t?r.createElement(g,o(o({ref:n},p),{},{components:t})):r.createElement(g,o({ref:n},p))}));function g(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=f;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[u]="string"==typeof e?e:i,o[1]=l;for(var c=2;c{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>o,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var r=t(7462),i=(t(7294),t(3905));const a={id:"cors",title:"CORS"},o=void 0,l={unversionedId:"api/middleware/cors",id:"api/middleware/cors",title:"CORS",description:"CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.",source:"@site/docs/core/api/middleware/cors.md",sourceDirName:"api/middleware",slug:"/api/middleware/cors",permalink:"/next/api/middleware/cors",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/cors.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"cors",title:"CORS"},sidebar:"tutorialSidebar",previous:{title:"Compress",permalink:"/next/api/middleware/compress"},next:{title:"CSRF",permalink:"/next/api/middleware/csrf"}},s={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],p={toc:c},u="wrapper";function d(e){let{components:n,...t}=e;return(0,i.kt)(u,(0,r.Z)({},p,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"CORS middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that can be used to enable ",(0,i.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS"},"Cross-Origin Resource Sharing")," with various options."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/cors"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(cors.New())\n\n// Or extend your config for customization\napp.Use(cors.New(cors.Config{\n AllowOrigins: "https://gofiber.io, https://gofiber.net",\n AllowHeaders: "Origin, Content-Type, Accept",\n}))\n')),(0,i.kt)("p",null,"Using the ",(0,i.kt)("inlineCode",{parentName:"p"},"AllowOriginsFunc")," function. In this example any origin will be allowed via CORS."),(0,i.kt)("p",null,"For example, if a browser running on ",(0,i.kt)("inlineCode",{parentName:"p"},"http://localhost:3000")," sends a request, this will be accepted and the ",(0,i.kt)("inlineCode",{parentName:"p"},"access-control-allow-origin")," response header will be set to ",(0,i.kt)("inlineCode",{parentName:"p"},"http://localhost:3000"),"."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via ",(0,i.kt)("inlineCode",{parentName:"strong"},"AllowOrigins"),".")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(cors.New())\n\napp.Use(cors.New(cors.Config{\n AllowOriginsFunc: func(origin string) bool {\n return os.Getenv("ENVIRONMENT") == "development"\n },\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // AllowOriginsFunc defines a function that will set the \'access-control-allow-origin\'\n // response header to the \'origin\' request header when returned true.\n // \n // Note: Using this feature is discouraged in production and it\'s best practice to explicitly\n // set CORS origins via \'AllowOrigins\'\n //\n // Optional. Default: nil\n AllowOriginsFunc func(origin string) bool\n\n // AllowOrigin defines a list of origins that may access the resource.\n //\n // Optional. Default value "*"\n AllowOrigins string\n\n // AllowMethods defines a list methods allowed when accessing the resource.\n // This is used in response to a preflight request.\n //\n // Optional. Default value "GET,POST,HEAD,PUT,DELETE,PATCH"\n AllowMethods string\n\n // AllowHeaders defines a list of request headers that can be used when\n // making the actual request. This is in response to a preflight request.\n //\n // Optional. Default value "".\n AllowHeaders string\n\n // AllowCredentials indicates whether or not the response to the request\n // can be exposed when the credentials flag is true. When used as part of\n // a response to a preflight request, this indicates whether or not the\n // actual request can be made using credentials.\n //\n // Optional. Default value false.\n AllowCredentials bool\n\n // ExposeHeaders defines a whitelist headers that clients are allowed to\n // access.\n //\n // Optional. Default value "".\n ExposeHeaders string\n\n // MaxAge indicates how long (in seconds) the results of a preflight request\n // can be cached.\n //\n // Optional. Default value 0.\n MaxAge int\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n AllowOriginsFunc: nil,\n AllowOrigins: "*",\n AllowMethods: strings.Join([]string{\n fiber.MethodGet,\n fiber.MethodPost,\n fiber.MethodHead,\n fiber.MethodPut,\n fiber.MethodDelete,\n fiber.MethodPatch,\n }, ","),\n AllowHeaders: "",\n AllowCredentials: false,\n ExposeHeaders: "",\n MaxAge: 0,\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6f9f0f49.7435912c.js b/assets/js/6f9f0f49.5a84496e.js similarity index 99% rename from assets/js/6f9f0f49.7435912c.js rename to assets/js/6f9f0f49.5a84496e.js index ba8ada17a1c..be88c1d68d6 100644 --- a/assets/js/6f9f0f49.7435912c.js +++ b/assets/js/6f9f0f49.5a84496e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1773],{3905:(e,n,t)=>{t.d(n,{Zo:()=>f,kt:()=>m});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var c=r.createContext({}),s=function(e){var n=r.useContext(c),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},f=function(e){var n=s(e.components);return r.createElement(c.Provider,{value:n},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,f=l(e,["components","mdxType","originalType","parentName"]),p=s(t),d=i,m=p["".concat(c,".").concat(d)]||p[d]||u[d]||a;return t?r.createElement(m,o(o({ref:n},f),{},{components:t})):r.createElement(m,o({ref:n},f))}));function m(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=d;var l={};for(var c in n)hasOwnProperty.call(n,c)&&(l[c]=n[c]);l.originalType=e,l[p]="string"==typeof e?e:i,o[1]=l;for(var s=2;s{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>s});var r=t(7462),i=(t(7294),t(3905));const a={id:"favicon",title:"Favicon"},o=void 0,l={unversionedId:"api/middleware/favicon",id:"version-v2.x/api/middleware/favicon",title:"Favicon",description:"Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware.",source:"@site/versioned_docs/version-v2.x/api/middleware/favicon.md",sourceDirName:"api/middleware",slug:"/api/middleware/favicon",permalink:"/api/middleware/favicon",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"favicon",title:"Favicon"},sidebar:"tutorialSidebar",previous:{title:"ExpVar",permalink:"/api/middleware/expvar"},next:{title:"FileSystem",permalink:"/api/middleware/filesystem"}},c={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],f={toc:s},p="wrapper";function u(e){let{components:n,...t}=e;return(0,i.kt)(p,(0,r.Z)({},f,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Favicon middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or ",(0,i.kt)("a",{parentName:"p",href:"#config"},"custom favicon URL"),".")),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/favicon"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(favicon.New())\n\n// Or extend your config for customization\napp.Use(favicon.New(favicon.Config{\n File: "./favicon.ico",\n URL: "/favicon.ico",\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // File holds the path to an actual favicon that will be cached\n //\n // Optional. Default: ""\n File string\n \n // URL for favicon handler\n //\n // Optional. Default: "/favicon.ico"\n URL string\n\n // FileSystem is an optional alternate filesystem to search for the favicon in.\n // An example of this could be an embedded or network filesystem\n //\n // Optional. Default: nil\n FileSystem http.FileSystem\n\n // CacheControl defines how the Cache-Control header in the response should be set\n //\n // Optional. Default: "public, max-age=31536000"\n CacheControl string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n File: "",\n URL: fPath,\n CacheControl: "public, max-age=31536000",\n}\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1773],{3905:(e,n,t)=>{t.d(n,{Zo:()=>f,kt:()=>m});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var c=r.createContext({}),s=function(e){var n=r.useContext(c),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},f=function(e){var n=s(e.components);return r.createElement(c.Provider,{value:n},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,f=l(e,["components","mdxType","originalType","parentName"]),p=s(t),d=i,m=p["".concat(c,".").concat(d)]||p[d]||u[d]||a;return t?r.createElement(m,o(o({ref:n},f),{},{components:t})):r.createElement(m,o({ref:n},f))}));function m(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=d;var l={};for(var c in n)hasOwnProperty.call(n,c)&&(l[c]=n[c]);l.originalType=e,l[p]="string"==typeof e?e:i,o[1]=l;for(var s=2;s{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>s});var r=t(7462),i=(t(7294),t(3905));const a={id:"favicon",title:"Favicon"},o=void 0,l={unversionedId:"api/middleware/favicon",id:"version-v2.x/api/middleware/favicon",title:"Favicon",description:"Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware.",source:"@site/versioned_docs/version-v2.x/api/middleware/favicon.md",sourceDirName:"api/middleware",slug:"/api/middleware/favicon",permalink:"/api/middleware/favicon",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"favicon",title:"Favicon"},sidebar:"tutorialSidebar",previous:{title:"ExpVar",permalink:"/api/middleware/expvar"},next:{title:"FileSystem",permalink:"/api/middleware/filesystem"}},c={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],f={toc:s},p="wrapper";function u(e){let{components:n,...t}=e;return(0,i.kt)(p,(0,r.Z)({},f,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Favicon middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or ",(0,i.kt)("a",{parentName:"p",href:"#config"},"custom favicon URL"),".")),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/favicon"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(favicon.New())\n\n// Or extend your config for customization\napp.Use(favicon.New(favicon.Config{\n File: "./favicon.ico",\n URL: "/favicon.ico",\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // File holds the path to an actual favicon that will be cached\n //\n // Optional. Default: ""\n File string\n \n // URL for favicon handler\n //\n // Optional. Default: "/favicon.ico"\n URL string\n\n // FileSystem is an optional alternate filesystem to search for the favicon in.\n // An example of this could be an embedded or network filesystem\n //\n // Optional. Default: nil\n FileSystem http.FileSystem\n\n // CacheControl defines how the Cache-Control header in the response should be set\n //\n // Optional. Default: "public, max-age=31536000"\n CacheControl string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n File: "",\n URL: fPath,\n CacheControl: "public, max-age=31536000",\n}\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/70908c7a.25aa2b77.js b/assets/js/70908c7a.6ab84482.js similarity index 99% rename from assets/js/70908c7a.25aa2b77.js rename to assets/js/70908c7a.6ab84482.js index 5979955f2c4..532d391a43b 100644 --- a/assets/js/70908c7a.25aa2b77.js +++ b/assets/js/70908c7a.6ab84482.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2565],{3905:(e,t,n)=>{n.d(t,{Zo:()=>f,kt:()=>b});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var d=r.createContext({}),o=function(e){var t=r.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):p(p({},t),e)),n},f=function(e){var t=o(e.components);return r.createElement(d.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,d=e.parentName,f=l(e,["components","mdxType","originalType","parentName"]),c=o(n),u=a,b=c["".concat(d,".").concat(u)]||c[u]||m[u]||i;return n?r.createElement(b,p(p({ref:t},f),{},{components:n})):r.createElement(b,p({ref:t},f))}));function b(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,p=new Array(i);p[0]=u;var l={};for(var d in t)hasOwnProperty.call(t,d)&&(l[d]=t[d]);l.originalType=e,l[c]="string"==typeof e?e:a,p[1]=l;for(var o=2;o{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>p,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>o});var r=n(7462),a=(n(7294),n(3905));const i={id:"adaptor",title:"Adaptor"},p=void 0,l={unversionedId:"api/middleware/adaptor",id:"version-v2.x/api/middleware/adaptor",title:"Adaptor",description:"Converter for net/http handlers to/from Fiber request handlers, special thanks to @arsmn!",source:"@site/versioned_docs/version-v2.x/api/middleware/adaptor.md",sourceDirName:"api/middleware",slug:"/api/middleware/adaptor",permalink:"/api/middleware/adaptor",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"adaptor",title:"Adaptor"},sidebar:"tutorialSidebar",previous:{title:"\ud83e\uddec Middleware",permalink:"/category/-middleware"},next:{title:"BasicAuth",permalink:"/api/middleware/basicauth"}},d={},o=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"net/http to Fiber",id:"nethttp-to-fiber",level:3},{value:"net/http middleware to Fiber",id:"nethttp-middleware-to-fiber",level:3},{value:"Fiber Handler to net/http",id:"fiber-handler-to-nethttp",level:3},{value:"Fiber App to net/http",id:"fiber-app-to-nethttp",level:3},{value:"Fiber Context to (net/http).Request",id:"fiber-context-to-nethttprequest",level:3}],f={toc:o},c="wrapper";function m(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},f,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Converter for net/http handlers to/from Fiber request handlers, special thanks to ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/arsmn"},"@arsmn"),"!"),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Signature"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"HTTPHandler"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"HTTPHandler(h http.Handler) fiber.Handler")),(0,a.kt)("td",{parentName:"tr",align:"left"},"http.Handler -> fiber.Handler")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"HTTPHandlerFunc"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"HTTPHandlerFunc(h http.HandlerFunc) fiber.Handler")),(0,a.kt)("td",{parentName:"tr",align:"left"},"http.HandlerFunc -> fiber.Handler")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"HTTPMiddleware"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"HTTPHandlerFunc(mw func(http.Handler) http.Handler) fiber.Handler")),(0,a.kt)("td",{parentName:"tr",align:"left"},"func(http.Handler) http.Handler -> fiber.Handler")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"FiberHandler"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"FiberHandler(h fiber.Handler) http.Handler")),(0,a.kt)("td",{parentName:"tr",align:"left"},"fiber.Handler -> http.Handler")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"FiberHandlerFunc"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"FiberHandlerFunc(h fiber.Handler) http.HandlerFunc")),(0,a.kt)("td",{parentName:"tr",align:"left"},"fiber.Handler -> http.HandlerFunc")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"FiberApp"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"FiberApp(app *fiber.App) http.HandlerFunc")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Fiber app -> http.HandlerFunc")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"ConvertRequest"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"ConvertRequest(c *fiber.Ctx, forServer bool) (*http.Request, error)")),(0,a.kt)("td",{parentName:"tr",align:"left"},"fiber.Ctx -> http.Request")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"CopyContextToFiberContext"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"CopyContextToFiberContext(context interface{}, requestContext *fasthttp.RequestCtx)")),(0,a.kt)("td",{parentName:"tr",align:"left"},"context.Context -> fasthttp.RequestCtx")))),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("h3",{id:"nethttp-to-fiber"},"net/http to Fiber"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/adaptor"\n)\n\nfunc main() {\n // New fiber app\n app := fiber.New()\n\n // http.Handler -> fiber.Handler\n app.Get("/", adaptor.HTTPHandler(handler(greet)))\n\n // http.HandlerFunc -> fiber.Handler\n app.Get("/func", adaptor.HTTPHandlerFunc(greet))\n\n // Listen on port 3000\n app.Listen(":3000")\n}\n\nfunc handler(f http.HandlerFunc) http.Handler {\n return http.HandlerFunc(f)\n}\n\nfunc greet(w http.ResponseWriter, r *http.Request) {\n fmt.Fprint(w, "Hello World!")\n}\n')),(0,a.kt)("h3",{id:"nethttp-middleware-to-fiber"},"net/http middleware to Fiber"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/adaptor"\n)\n\nfunc main() {\n // New fiber app\n app := fiber.New()\n\n // http middleware -> fiber.Handler\n app.Use(adaptor.HTTPMiddleware(logMiddleware))\n\n // Listen on port 3000\n app.Listen(":3000")\n}\n\nfunc logMiddleware(next http.Handler) http.Handler {\n return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n log.Println("log middleware")\n next.ServeHTTP(w, r)\n })\n}\n')),(0,a.kt)("h3",{id:"fiber-handler-to-nethttp"},"Fiber Handler to net/http"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/adaptor"\n)\n\nfunc main() {\n // fiber.Handler -> http.Handler\n http.Handle("/", adaptor.FiberHandler(greet))\n\n // fiber.Handler -> http.HandlerFunc\n http.HandleFunc("/func", adaptor.FiberHandlerFunc(greet))\n\n // Listen on port 3000\n http.ListenAndServe(":3000", nil)\n}\n\nfunc greet(c *fiber.Ctx) error {\n return c.SendString("Hello World!")\n}\n')),(0,a.kt)("h3",{id:"fiber-app-to-nethttp"},"Fiber App to net/http"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/adaptor"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/greet", greet)\n\n // Listen on port 3000\n http.ListenAndServe(":3000", adaptor.FiberApp(app))\n}\n\nfunc greet(c *fiber.Ctx) error {\n return c.SendString("Hello World!")\n}\n')),(0,a.kt)("h3",{id:"fiber-context-to-nethttprequest"},"Fiber Context to (net/http).Request"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/adaptor"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/greet", greetWithHTTPReq)\n\n // Listen on port 3000\n http.ListenAndServe(":3000", adaptor.FiberApp(app))\n}\n\nfunc greetWithHTTPReq(c *fiber.Ctx) error {\n httpReq, err := adaptor.ConvertRequest(c, false)\n if err != nil {\n return err\n }\n\n return c.SendString("Request URL: " + httpReq.URL.String())\n}\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2565],{3905:(e,t,n)=>{n.d(t,{Zo:()=>f,kt:()=>b});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var d=r.createContext({}),o=function(e){var t=r.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):p(p({},t),e)),n},f=function(e){var t=o(e.components);return r.createElement(d.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,d=e.parentName,f=l(e,["components","mdxType","originalType","parentName"]),c=o(n),u=a,b=c["".concat(d,".").concat(u)]||c[u]||m[u]||i;return n?r.createElement(b,p(p({ref:t},f),{},{components:n})):r.createElement(b,p({ref:t},f))}));function b(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,p=new Array(i);p[0]=u;var l={};for(var d in t)hasOwnProperty.call(t,d)&&(l[d]=t[d]);l.originalType=e,l[c]="string"==typeof e?e:a,p[1]=l;for(var o=2;o{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>p,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>o});var r=n(7462),a=(n(7294),n(3905));const i={id:"adaptor",title:"Adaptor"},p=void 0,l={unversionedId:"api/middleware/adaptor",id:"version-v2.x/api/middleware/adaptor",title:"Adaptor",description:"Converter for net/http handlers to/from Fiber request handlers, special thanks to @arsmn!",source:"@site/versioned_docs/version-v2.x/api/middleware/adaptor.md",sourceDirName:"api/middleware",slug:"/api/middleware/adaptor",permalink:"/api/middleware/adaptor",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"adaptor",title:"Adaptor"},sidebar:"tutorialSidebar",previous:{title:"\ud83e\uddec Middleware",permalink:"/category/-middleware"},next:{title:"BasicAuth",permalink:"/api/middleware/basicauth"}},d={},o=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"net/http to Fiber",id:"nethttp-to-fiber",level:3},{value:"net/http middleware to Fiber",id:"nethttp-middleware-to-fiber",level:3},{value:"Fiber Handler to net/http",id:"fiber-handler-to-nethttp",level:3},{value:"Fiber App to net/http",id:"fiber-app-to-nethttp",level:3},{value:"Fiber Context to (net/http).Request",id:"fiber-context-to-nethttprequest",level:3}],f={toc:o},c="wrapper";function m(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},f,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Converter for net/http handlers to/from Fiber request handlers, special thanks to ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/arsmn"},"@arsmn"),"!"),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Signature"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"HTTPHandler"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"HTTPHandler(h http.Handler) fiber.Handler")),(0,a.kt)("td",{parentName:"tr",align:"left"},"http.Handler -> fiber.Handler")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"HTTPHandlerFunc"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"HTTPHandlerFunc(h http.HandlerFunc) fiber.Handler")),(0,a.kt)("td",{parentName:"tr",align:"left"},"http.HandlerFunc -> fiber.Handler")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"HTTPMiddleware"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"HTTPHandlerFunc(mw func(http.Handler) http.Handler) fiber.Handler")),(0,a.kt)("td",{parentName:"tr",align:"left"},"func(http.Handler) http.Handler -> fiber.Handler")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"FiberHandler"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"FiberHandler(h fiber.Handler) http.Handler")),(0,a.kt)("td",{parentName:"tr",align:"left"},"fiber.Handler -> http.Handler")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"FiberHandlerFunc"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"FiberHandlerFunc(h fiber.Handler) http.HandlerFunc")),(0,a.kt)("td",{parentName:"tr",align:"left"},"fiber.Handler -> http.HandlerFunc")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"FiberApp"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"FiberApp(app *fiber.App) http.HandlerFunc")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Fiber app -> http.HandlerFunc")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"ConvertRequest"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"ConvertRequest(c *fiber.Ctx, forServer bool) (*http.Request, error)")),(0,a.kt)("td",{parentName:"tr",align:"left"},"fiber.Ctx -> http.Request")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"CopyContextToFiberContext"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"CopyContextToFiberContext(context interface{}, requestContext *fasthttp.RequestCtx)")),(0,a.kt)("td",{parentName:"tr",align:"left"},"context.Context -> fasthttp.RequestCtx")))),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("h3",{id:"nethttp-to-fiber"},"net/http to Fiber"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/adaptor"\n)\n\nfunc main() {\n // New fiber app\n app := fiber.New()\n\n // http.Handler -> fiber.Handler\n app.Get("/", adaptor.HTTPHandler(handler(greet)))\n\n // http.HandlerFunc -> fiber.Handler\n app.Get("/func", adaptor.HTTPHandlerFunc(greet))\n\n // Listen on port 3000\n app.Listen(":3000")\n}\n\nfunc handler(f http.HandlerFunc) http.Handler {\n return http.HandlerFunc(f)\n}\n\nfunc greet(w http.ResponseWriter, r *http.Request) {\n fmt.Fprint(w, "Hello World!")\n}\n')),(0,a.kt)("h3",{id:"nethttp-middleware-to-fiber"},"net/http middleware to Fiber"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/adaptor"\n)\n\nfunc main() {\n // New fiber app\n app := fiber.New()\n\n // http middleware -> fiber.Handler\n app.Use(adaptor.HTTPMiddleware(logMiddleware))\n\n // Listen on port 3000\n app.Listen(":3000")\n}\n\nfunc logMiddleware(next http.Handler) http.Handler {\n return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n log.Println("log middleware")\n next.ServeHTTP(w, r)\n })\n}\n')),(0,a.kt)("h3",{id:"fiber-handler-to-nethttp"},"Fiber Handler to net/http"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/adaptor"\n)\n\nfunc main() {\n // fiber.Handler -> http.Handler\n http.Handle("/", adaptor.FiberHandler(greet))\n\n // fiber.Handler -> http.HandlerFunc\n http.HandleFunc("/func", adaptor.FiberHandlerFunc(greet))\n\n // Listen on port 3000\n http.ListenAndServe(":3000", nil)\n}\n\nfunc greet(c *fiber.Ctx) error {\n return c.SendString("Hello World!")\n}\n')),(0,a.kt)("h3",{id:"fiber-app-to-nethttp"},"Fiber App to net/http"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/adaptor"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/greet", greet)\n\n // Listen on port 3000\n http.ListenAndServe(":3000", adaptor.FiberApp(app))\n}\n\nfunc greet(c *fiber.Ctx) error {\n return c.SendString("Hello World!")\n}\n')),(0,a.kt)("h3",{id:"fiber-context-to-nethttprequest"},"Fiber Context to (net/http).Request"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/adaptor"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Get("/greet", greetWithHTTPReq)\n\n // Listen on port 3000\n http.ListenAndServe(":3000", adaptor.FiberApp(app))\n}\n\nfunc greetWithHTTPReq(c *fiber.Ctx) error {\n httpReq, err := adaptor.ConvertRequest(c, false)\n if err != nil {\n return err\n }\n\n return c.SendString("Request URL: " + httpReq.URL.String())\n}\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/70bddfb7.d9f3b3ce.js b/assets/js/70bddfb7.ef5b69d8.js similarity index 99% rename from assets/js/70bddfb7.d9f3b3ce.js rename to assets/js/70bddfb7.ef5b69d8.js index be00c1da553..5bf07c3e9a4 100644 --- a/assets/js/70bddfb7.d9f3b3ce.js +++ b/assets/js/70bddfb7.ef5b69d8.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[542],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>N});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var d=a.createContext({}),p=function(e){var t=a.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},m=function(e){var t=p(e.components);return a.createElement(d.Provider,{value:t},e.children)},s="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},k=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,d=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),s=p(n),k=r,N=s["".concat(d,".").concat(k)]||s[k]||u[k]||l;return n?a.createElement(N,i(i({ref:t},m),{},{components:n})):a.createElement(N,i({ref:t},m))}));function N(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=k;var o={};for(var d in t)hasOwnProperty.call(t,d)&&(o[d]=t[d]);o.originalType=e,o[s]="string"==typeof e?e:r,i[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var a=n(7462),r=(n(7294),n(3905));const l={id:"fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",sidebar_position:1},i=void 0,o={unversionedId:"api/fiber",id:"api/fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",source:"@site/docs/core/api/fiber.md",sourceDirName:"api",slug:"/api/fiber",permalink:"/next/api/fiber",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/fiber.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{id:"fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"API",permalink:"/next/category/api"},next:{title:"\ud83d\ude80 App",permalink:"/next/api/app"}},d={},p=[{value:"New",id:"new",level:2},{value:"Config",id:"config",level:2},{value:"NewError",id:"newerror",level:2},{value:"IsChild",id:"ischild",level:2}],m={toc:p},s="wrapper";function u(e){let{components:t,...n}=e;return(0,r.kt)(s,(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"new"},"New"),(0,r.kt)("p",null,"This method creates a new ",(0,r.kt)("strong",{parentName:"p"},"App")," named instance. You can pass optional ",(0,r.kt)("a",{parentName:"p",href:"#config"},"config "),"when creating a new instance."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func New(config ...Config) *App\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"// Default config\napp := fiber.New()\n\n// ...\n")),(0,r.kt)("h2",{id:"config"},"Config"),(0,r.kt)("p",null,"You can pass an optional Config when creating a new Fiber instance."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Custom config\napp := fiber.New(fiber.Config{\n Prefork: true,\n CaseSensitive: true,\n StrictRouting: true,\n ServerHeader: "Fiber",\n AppName: "Test App v1.0.1",\n})\n\n// ...\n')),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Config fields")),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Property"),(0,r.kt)("th",{parentName:"tr",align:null},"Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"AppName"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"This allows to setup app name for the app"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"BodyLimit"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends ",(0,r.kt)("inlineCode",{parentName:"td"},"413 - Request Entity Too Large")," response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4 * 1024 * 1024"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"CaseSensitive"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, ",(0,r.kt)("inlineCode",{parentName:"td"},"/Foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," are different routes. When disabled, ",(0,r.kt)("inlineCode",{parentName:"td"},"/Foo"),"and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," are treated the same."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ColorScheme"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/blob/master/color.go"},(0,r.kt)("inlineCode",{parentName:"a"},"Colors"))),(0,r.kt)("td",{parentName:"tr",align:null},"You can define custom color scheme. They'll be used for startup message, route list and some middlewares."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/blob/master/color.go"},(0,r.kt)("inlineCode",{parentName:"a"},"DefaultColors")))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"CompressedFileSuffix"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Adds a suffix to the original file name and tries saving the resulting compressed file under the new file name."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'".fiber.gz"'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Concurrency"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Maximum number of concurrent connections."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"256 * 1024"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableDefaultContentType"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, causes the default Content-Type header to be excluded from the Response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableDefaultDate"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true causes the default date header to be excluded from the response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableHeaderNormalizing"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"By default all header names are normalized: conteNT-tYPE -",">"," Content-Type"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableKeepalive"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Disable keep-alive connections, the server will close incoming connections after sending the first response to the client"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisablePreParseMultipartForm"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Will not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableStartupMessage"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, it will not print out debug information"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ETag"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method ","(","CRC-32",")",". Weak ETags are the default when enabled."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnableIPValidation"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"If set to true, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IPs()")," will validate IP addresses before returning them. Also, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will return only the first valid IP rather than just the raw header value that may be a comma seperated string.",(0,r.kt)("br",null),(0,r.kt)("br",null),(0,r.kt)("strong",{parentName:"td"},"WARNING:")," There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnablePrintRoutes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"EnablePrintRoutes enables print all routes with their method, path, name and handler.."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnableTrustedProxyCheck"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, fiber will check whether proxy is trusted, using TrustedProxies list. ",(0,r.kt)("br",null),(0,r.kt)("br",null),"By default ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()")," will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will get value from ",(0,r.kt)("inlineCode",{parentName:"td"},"ProxyHeader")," header, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will get value from X-Forwarded-Host header. ",(0,r.kt)("br",null)," If ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," is true, and ",(0,r.kt)("inlineCode",{parentName:"td"},"RemoteIP")," is in the list of ",(0,r.kt)("inlineCode",{parentName:"td"},"TrustedProxies")," ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()"),", ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()"),", and ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will have the same behaviour when ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," disabled, if ",(0,r.kt)("inlineCode",{parentName:"td"},"RemoteIP")," isn't in the list, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()")," will return https in case when tls connection is handled by the app, or http otherwise, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will return RemoteIP() from fasthttp context, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will return ",(0,r.kt)("inlineCode",{parentName:"td"},"fasthttp.Request.URI().Host()")),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ErrorHandler"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"ErrorHandler")),(0,r.kt)("td",{parentName:"tr",align:null},"ErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"DefaultErrorHandler"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"GETOnly"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Rejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"IdleTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Immutable"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue ",(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/issues/185"},"#","185"),"."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"JSONDecoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.JSONUnmarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another json library for decoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"json.Unmarshal"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"JSONEncoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.JSONMarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another json library for encoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"json.Marshal"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Network"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},'Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only)',(0,r.kt)("br",null),(0,r.kt)("br",null),(0,r.kt)("strong",{parentName:"td"},"WARNING:"),' When prefork is set to true, only "tcp4" and "tcp6" can be chosen.'),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"NetworkTCP4"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"PassLocalsToViews"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"PassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Prefork"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Enables use of the",(0,r.kt)("a",{parentName:"td",href:"https://lwn.net/Articles/542629/"},(0,r.kt)("inlineCode",{parentName:"a"},"SO_REUSEPORT")),"socket option. This will spawn multiple Go processes listening on the same port. learn more about ",(0,r.kt)("a",{parentName:"td",href:"https://www.nginx.com/blog/socket-sharding-nginx-release-1-9-1/"},"socket sharding"),". ",(0,r.kt)("strong",{parentName:"td"},"NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with ",(0,r.kt)("inlineCode",{parentName:"strong"},"CMD ./app")," or ",(0,r.kt)("inlineCode",{parentName:"strong"},'CMD ["sh", "-c", "/app"]'),". For more info, see")," ",(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/issues/1021#issuecomment-730537971"},(0,r.kt)("strong",{parentName:"a"},"this"))," ",(0,r.kt)("strong",{parentName:"td"},"issue comment.")),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ProxyHeader"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"This will enable ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," to return the value of the given header key. By default ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()"),"will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. ",(0,r.kt)("em",{parentName:"td"},"X-Forwarded-","*"),"."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ReadBufferSize"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"per-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers ","(","for example, BIG cookies",")","."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4096"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ReadTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The amount of time allowed to read the full request, including the body. The default timeout is unlimited."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"RequestMethods"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string")),(0,r.kt)("td",{parentName:"tr",align:null},"RequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"DefaultMethods"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ServerHeader"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Enables the ",(0,r.kt)("inlineCode",{parentName:"td"},"Server")," HTTP header with the given value."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"StreamRequestBody"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"StreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"StrictRouting"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, the router treats ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo/")," as different. Otherwise, the router treats ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo/")," as the same."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"TrustedProxies"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string")),(0,r.kt)("td",{parentName:"tr",align:null},"Contains the list of trusted proxy IP's. Look at ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," doc. ",(0,r.kt)("br",null)," ",(0,r.kt)("br",null)," It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string*__*"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"UnescapePath"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Converts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special characters"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Views"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"Views")),(0,r.kt)("td",{parentName:"tr",align:null},"Views is the interface that wraps the Render function. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ViewsLayout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Views Layout is the global layout for all template render until override on Render function. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"WriteBufferSize"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Per-connection buffer size for responses' writing."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4096"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"WriteTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum duration before timing out writes of the response. The default timeout is unlimited."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"XMLEncoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.XMLMarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another XML library for encoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"xml.Marshal"))))),(0,r.kt)("h2",{id:"newerror"},"NewError"),(0,r.kt)("p",null,"NewError creates a new HTTPError instance with an optional message."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func NewError(code int, message ...string) *Error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return fiber.NewError(782, "Custom error message")\n})\n')),(0,r.kt)("h2",{id:"ischild"},"IsChild"),(0,r.kt)("p",null,"IsChild determines if the current process is a result of Prefork."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func IsChild() bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Prefork will spawn child processes\napp := fiber.New(fiber.Config{\n Prefork: true,\n})\n\nif !fiber.IsChild() {\n fmt.Println("I\'m the parent process")\n} else {\n fmt.Println("I\'m a child process")\n}\n\n// ...\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[542],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>N});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var d=a.createContext({}),p=function(e){var t=a.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},m=function(e){var t=p(e.components);return a.createElement(d.Provider,{value:t},e.children)},s="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},k=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,d=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),s=p(n),k=r,N=s["".concat(d,".").concat(k)]||s[k]||u[k]||l;return n?a.createElement(N,i(i({ref:t},m),{},{components:n})):a.createElement(N,i({ref:t},m))}));function N(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=k;var o={};for(var d in t)hasOwnProperty.call(t,d)&&(o[d]=t[d]);o.originalType=e,o[s]="string"==typeof e?e:r,i[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var a=n(7462),r=(n(7294),n(3905));const l={id:"fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",sidebar_position:1},i=void 0,o={unversionedId:"api/fiber",id:"api/fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",source:"@site/docs/core/api/fiber.md",sourceDirName:"api",slug:"/api/fiber",permalink:"/next/api/fiber",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/fiber.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{id:"fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"API",permalink:"/next/category/api"},next:{title:"\ud83d\ude80 App",permalink:"/next/api/app"}},d={},p=[{value:"New",id:"new",level:2},{value:"Config",id:"config",level:2},{value:"NewError",id:"newerror",level:2},{value:"IsChild",id:"ischild",level:2}],m={toc:p},s="wrapper";function u(e){let{components:t,...n}=e;return(0,r.kt)(s,(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"new"},"New"),(0,r.kt)("p",null,"This method creates a new ",(0,r.kt)("strong",{parentName:"p"},"App")," named instance. You can pass optional ",(0,r.kt)("a",{parentName:"p",href:"#config"},"config "),"when creating a new instance."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func New(config ...Config) *App\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"// Default config\napp := fiber.New()\n\n// ...\n")),(0,r.kt)("h2",{id:"config"},"Config"),(0,r.kt)("p",null,"You can pass an optional Config when creating a new Fiber instance."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Custom config\napp := fiber.New(fiber.Config{\n Prefork: true,\n CaseSensitive: true,\n StrictRouting: true,\n ServerHeader: "Fiber",\n AppName: "Test App v1.0.1",\n})\n\n// ...\n')),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Config fields")),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Property"),(0,r.kt)("th",{parentName:"tr",align:null},"Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"AppName"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"This allows to setup app name for the app"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"BodyLimit"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends ",(0,r.kt)("inlineCode",{parentName:"td"},"413 - Request Entity Too Large")," response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4 * 1024 * 1024"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"CaseSensitive"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, ",(0,r.kt)("inlineCode",{parentName:"td"},"/Foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," are different routes. When disabled, ",(0,r.kt)("inlineCode",{parentName:"td"},"/Foo"),"and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," are treated the same."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ColorScheme"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/blob/master/color.go"},(0,r.kt)("inlineCode",{parentName:"a"},"Colors"))),(0,r.kt)("td",{parentName:"tr",align:null},"You can define custom color scheme. They'll be used for startup message, route list and some middlewares."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/blob/master/color.go"},(0,r.kt)("inlineCode",{parentName:"a"},"DefaultColors")))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"CompressedFileSuffix"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Adds a suffix to the original file name and tries saving the resulting compressed file under the new file name."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'".fiber.gz"'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Concurrency"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Maximum number of concurrent connections."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"256 * 1024"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableDefaultContentType"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, causes the default Content-Type header to be excluded from the Response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableDefaultDate"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true causes the default date header to be excluded from the response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableHeaderNormalizing"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"By default all header names are normalized: conteNT-tYPE -",">"," Content-Type"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableKeepalive"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Disable keep-alive connections, the server will close incoming connections after sending the first response to the client"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisablePreParseMultipartForm"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Will not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableStartupMessage"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, it will not print out debug information"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ETag"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method ","(","CRC-32",")",". Weak ETags are the default when enabled."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnableIPValidation"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"If set to true, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IPs()")," will validate IP addresses before returning them. Also, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will return only the first valid IP rather than just the raw header value that may be a comma seperated string.",(0,r.kt)("br",null),(0,r.kt)("br",null),(0,r.kt)("strong",{parentName:"td"},"WARNING:")," There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnablePrintRoutes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"EnablePrintRoutes enables print all routes with their method, path, name and handler.."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnableTrustedProxyCheck"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, fiber will check whether proxy is trusted, using TrustedProxies list. ",(0,r.kt)("br",null),(0,r.kt)("br",null),"By default ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()")," will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will get value from ",(0,r.kt)("inlineCode",{parentName:"td"},"ProxyHeader")," header, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will get value from X-Forwarded-Host header. ",(0,r.kt)("br",null)," If ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," is true, and ",(0,r.kt)("inlineCode",{parentName:"td"},"RemoteIP")," is in the list of ",(0,r.kt)("inlineCode",{parentName:"td"},"TrustedProxies")," ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()"),", ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()"),", and ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will have the same behaviour when ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," disabled, if ",(0,r.kt)("inlineCode",{parentName:"td"},"RemoteIP")," isn't in the list, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()")," will return https in case when tls connection is handled by the app, or http otherwise, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will return RemoteIP() from fasthttp context, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will return ",(0,r.kt)("inlineCode",{parentName:"td"},"fasthttp.Request.URI().Host()")),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ErrorHandler"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"ErrorHandler")),(0,r.kt)("td",{parentName:"tr",align:null},"ErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"DefaultErrorHandler"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"GETOnly"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Rejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"IdleTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Immutable"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue ",(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/issues/185"},"#","185"),"."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"JSONDecoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.JSONUnmarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another json library for decoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"json.Unmarshal"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"JSONEncoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.JSONMarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another json library for encoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"json.Marshal"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Network"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},'Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only)',(0,r.kt)("br",null),(0,r.kt)("br",null),(0,r.kt)("strong",{parentName:"td"},"WARNING:"),' When prefork is set to true, only "tcp4" and "tcp6" can be chosen.'),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"NetworkTCP4"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"PassLocalsToViews"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"PassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Prefork"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Enables use of the",(0,r.kt)("a",{parentName:"td",href:"https://lwn.net/Articles/542629/"},(0,r.kt)("inlineCode",{parentName:"a"},"SO_REUSEPORT")),"socket option. This will spawn multiple Go processes listening on the same port. learn more about ",(0,r.kt)("a",{parentName:"td",href:"https://www.nginx.com/blog/socket-sharding-nginx-release-1-9-1/"},"socket sharding"),". ",(0,r.kt)("strong",{parentName:"td"},"NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with ",(0,r.kt)("inlineCode",{parentName:"strong"},"CMD ./app")," or ",(0,r.kt)("inlineCode",{parentName:"strong"},'CMD ["sh", "-c", "/app"]'),". For more info, see")," ",(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/issues/1021#issuecomment-730537971"},(0,r.kt)("strong",{parentName:"a"},"this"))," ",(0,r.kt)("strong",{parentName:"td"},"issue comment.")),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ProxyHeader"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"This will enable ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," to return the value of the given header key. By default ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()"),"will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. ",(0,r.kt)("em",{parentName:"td"},"X-Forwarded-","*"),"."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ReadBufferSize"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"per-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers ","(","for example, BIG cookies",")","."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4096"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ReadTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The amount of time allowed to read the full request, including the body. The default timeout is unlimited."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"RequestMethods"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string")),(0,r.kt)("td",{parentName:"tr",align:null},"RequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"DefaultMethods"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ServerHeader"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Enables the ",(0,r.kt)("inlineCode",{parentName:"td"},"Server")," HTTP header with the given value."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"StreamRequestBody"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"StreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"StrictRouting"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, the router treats ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo/")," as different. Otherwise, the router treats ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo/")," as the same."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"TrustedProxies"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string")),(0,r.kt)("td",{parentName:"tr",align:null},"Contains the list of trusted proxy IP's. Look at ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," doc. ",(0,r.kt)("br",null)," ",(0,r.kt)("br",null)," It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string*__*"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"UnescapePath"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Converts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special characters"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Views"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"Views")),(0,r.kt)("td",{parentName:"tr",align:null},"Views is the interface that wraps the Render function. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ViewsLayout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Views Layout is the global layout for all template render until override on Render function. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"WriteBufferSize"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Per-connection buffer size for responses' writing."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4096"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"WriteTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum duration before timing out writes of the response. The default timeout is unlimited."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"XMLEncoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.XMLMarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another XML library for encoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"xml.Marshal"))))),(0,r.kt)("h2",{id:"newerror"},"NewError"),(0,r.kt)("p",null,"NewError creates a new HTTPError instance with an optional message."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func NewError(code int, message ...string) *Error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return fiber.NewError(782, "Custom error message")\n})\n')),(0,r.kt)("h2",{id:"ischild"},"IsChild"),(0,r.kt)("p",null,"IsChild determines if the current process is a result of Prefork."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func IsChild() bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Prefork will spawn child processes\napp := fiber.New(fiber.Config{\n Prefork: true,\n})\n\nif !fiber.IsChild() {\n fmt.Println("I\'m the parent process")\n} else {\n fmt.Println("I\'m a child process")\n}\n\n// ...\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/7307607e.1315447c.js b/assets/js/7307607e.c91da44a.js similarity index 98% rename from assets/js/7307607e.1315447c.js rename to assets/js/7307607e.c91da44a.js index b3d5b9755bb..c17732939fc 100644 --- a/assets/js/7307607e.1315447c.js +++ b/assets/js/7307607e.c91da44a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9310],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>m});var n=r(7294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},c=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,c=p(e,["components","mdxType","originalType","parentName"]),d=s(r),f=i,m=d["".concat(l,".").concat(f)]||d[f]||u[f]||a;return r?n.createElement(m,o(o({ref:t},c),{},{components:r})):n.createElement(m,o({ref:t},c))}));function m(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=r.length,o=new Array(a);o[0]=f;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p[d]="string"==typeof e?e:i,o[1]=p;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>p,toc:()=>s});var n=r(7462),i=(r(7294),r(3905));const a={id:"skip",title:"Skip"},o=void 0,p={unversionedId:"api/middleware/skip",id:"api/middleware/skip",title:"Skip",description:"Skip middleware for Fiber that skips a wrapped handler if a predicate is true.",source:"@site/docs/core/api/middleware/skip.md",sourceDirName:"api/middleware",slug:"/api/middleware/skip",permalink:"/next/api/middleware/skip",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/skip.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"skip",title:"Skip"},sidebar:"tutorialSidebar",previous:{title:"Session",permalink:"/next/api/middleware/session"},next:{title:"Timeout",permalink:"/next/api/middleware/timeout"}},l={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2}],c={toc:s},d="wrapper";function u(e){let{components:t,...r}=e;return(0,i.kt)(d,(0,n.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Skip middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that skips a wrapped handler if a predicate is true."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/skip"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool {\n return ctx.Method() == fiber.MethodGet\n }))\n\n app.Get("/", func(ctx *fiber.Ctx) error {\n return ctx.SendString("It was a GET request!")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\nfunc BasicHandler(ctx *fiber.Ctx) error {\n return ctx.SendString("It was not a GET request!")\n}\n')),(0,i.kt)("admonition",{type:"tip"},(0,i.kt)("p",{parentName:"admonition"},"app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.")))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9310],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>m});var n=r(7294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},c=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,c=p(e,["components","mdxType","originalType","parentName"]),d=s(r),f=i,m=d["".concat(l,".").concat(f)]||d[f]||u[f]||a;return r?n.createElement(m,o(o({ref:t},c),{},{components:r})):n.createElement(m,o({ref:t},c))}));function m(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=r.length,o=new Array(a);o[0]=f;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p[d]="string"==typeof e?e:i,o[1]=p;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>p,toc:()=>s});var n=r(7462),i=(r(7294),r(3905));const a={id:"skip",title:"Skip"},o=void 0,p={unversionedId:"api/middleware/skip",id:"api/middleware/skip",title:"Skip",description:"Skip middleware for Fiber that skips a wrapped handler if a predicate is true.",source:"@site/docs/core/api/middleware/skip.md",sourceDirName:"api/middleware",slug:"/api/middleware/skip",permalink:"/next/api/middleware/skip",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/skip.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"skip",title:"Skip"},sidebar:"tutorialSidebar",previous:{title:"Session",permalink:"/next/api/middleware/session"},next:{title:"Timeout",permalink:"/next/api/middleware/timeout"}},l={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2}],c={toc:s},d="wrapper";function u(e){let{components:t,...r}=e;return(0,i.kt)(d,(0,n.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Skip middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that skips a wrapped handler if a predicate is true."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/skip"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool {\n return ctx.Method() == fiber.MethodGet\n }))\n\n app.Get("/", func(ctx *fiber.Ctx) error {\n return ctx.SendString("It was a GET request!")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\nfunc BasicHandler(ctx *fiber.Ctx) error {\n return ctx.SendString("It was not a GET request!")\n}\n')),(0,i.kt)("admonition",{type:"tip"},(0,i.kt)("p",{parentName:"admonition"},"app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/73b0bf71.bb3ee241.js b/assets/js/73b0bf71.b20d00b7.js similarity index 99% rename from assets/js/73b0bf71.bb3ee241.js rename to assets/js/73b0bf71.b20d00b7.js index 43e8c0ae0ae..ec73ab211d5 100644 --- a/assets/js/73b0bf71.bb3ee241.js +++ b/assets/js/73b0bf71.b20d00b7.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[784],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>h});var r=a(7294);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function s(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function p(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var o=r.createContext({}),l=function(e){var t=r.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):p(p({},t),e)),a},c=function(e){var t=l(e.components);return r.createElement(o.Provider,{value:t},e.children)},m="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,s=e.originalType,o=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),m=l(a),g=n,h=m["".concat(o,".").concat(g)]||m[g]||d[g]||s;return a?r.createElement(h,p(p({ref:t},c),{},{components:a})):r.createElement(h,p({ref:t},c))}));function h(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var s=a.length,p=new Array(s);p[0]=g;var i={};for(var o in t)hasOwnProperty.call(t,o)&&(i[o]=t[o]);i.originalType=e,i[m]="string"==typeof e?e:n,p[1]=i;for(var l=2;l{a.r(t),a.d(t,{assets:()=>o,contentTitle:()=>p,default:()=>d,frontMatter:()=>s,metadata:()=>i,toc:()=>l});var r=a(7462),n=(a(7294),a(3905));const s={id:"benchmarks",title:"\ud83d\udcca Benchmarks",description:"These benchmarks aim to compare the performance of Fiber and other web frameworks.",sidebar_position:2},p=void 0,i={unversionedId:"extra/benchmarks",id:"extra/benchmarks",title:"\ud83d\udcca Benchmarks",description:"These benchmarks aim to compare the performance of Fiber and other web frameworks.",source:"@site/docs/core/extra/benchmarks.md",sourceDirName:"extra",slug:"/extra/benchmarks",permalink:"/next/extra/benchmarks",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/extra/benchmarks.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:2,frontMatter:{id:"benchmarks",title:"\ud83d\udcca Benchmarks",description:"These benchmarks aim to compare the performance of Fiber and other web frameworks.",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\ud83e\udd14 FAQ",permalink:"/next/extra/faq"}},o={},l=[{value:"TechEmpower",id:"techempower",level:2},{value:"Plaintext",id:"plaintext",level:3},{value:"Data Updates",id:"data-updates",level:3},{value:"Multiple Queries",id:"multiple-queries",level:3},{value:"Single Query",id:"single-query",level:3},{value:"JSON Serialization",id:"json-serialization",level:3},{value:"Go web framework benchmark",id:"go-web-framework-benchmark",level:2}],c={toc:l},m="wrapper";function d(e){let{components:t,...s}=e;return(0,n.kt)(m,(0,r.Z)({},c,s,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h2",{id:"techempower"},"TechEmpower"),(0,n.kt)("p",null,(0,n.kt)("a",{parentName:"p",href:"https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=composite"},"TechEmpower")," provides a performance comparison of many web application frameworks executing fundamental tasks such as JSON serialization, database access, and server-side template composition."),(0,n.kt)("p",null,"Each framework is operating in a realistic production configuration. Results are captured on cloud instances and on physical hardware. The test implementations are largely community-contributed and all source is available at the ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/TechEmpower/FrameworkBenchmarks"},"GitHub repository"),"."),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Fiber ",(0,n.kt)("inlineCode",{parentName:"li"},"v1.10.0")),(0,n.kt)("li",{parentName:"ul"},"28 HT Cores Intel","(","R",")"," Xeon","(","R",")"," Gold 5120 CPU @ 2.20GHz"),(0,n.kt)("li",{parentName:"ul"},"32GB RAM"),(0,n.kt)("li",{parentName:"ul"},"Ubuntu 18.04.3 4.15.0-88-generic"),(0,n.kt)("li",{parentName:"ul"},"Dedicated Cisco 10-Gbit Ethernet switch.")),(0,n.kt)("h3",{id:"plaintext"},"Plaintext"),(0,n.kt)("p",null,"The Plaintext test is an exercise of the request-routing fundamentals only, designed to demonstrate the capacity of high-performance platforms in particular. Requests will be sent using HTTP pipelining. The response payload is still small, meaning good performance is still necessary in order to saturate the gigabit Ethernet of the test environment."),(0,n.kt)("p",null,"See ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#single-database-query"},"Plaintext requirements")),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Fiber")," - ",(0,n.kt)("strong",{parentName:"p"},"6,162,556")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"2.0")," ms.",(0,n.kt)("br",{parentName:"p"}),"\n",(0,n.kt)("strong",{parentName:"p"},"Express")," - ",(0,n.kt)("strong",{parentName:"p"},"367,069")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"354.1")," ms."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(2137).Z,width:"1130",height:"473"})),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fiber vs Express",src:a(7093).Z,width:"1130",height:"179"})),(0,n.kt)("h3",{id:"data-updates"},"Data Updates"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Fiber")," handled ",(0,n.kt)("strong",{parentName:"p"},"11,846")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"42.8")," ms.",(0,n.kt)("br",{parentName:"p"}),"\n",(0,n.kt)("strong",{parentName:"p"},"Express")," handled ",(0,n.kt)("strong",{parentName:"p"},"2,066")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"390.44")," ms."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(6551).Z,width:"1132",height:"727"})),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fiber vs Express",src:a(7792).Z,width:"1130",height:"243"})),(0,n.kt)("h3",{id:"multiple-queries"},"Multiple Queries"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Fiber")," handled ",(0,n.kt)("strong",{parentName:"p"},"19,664")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"25.7")," ms.",(0,n.kt)("br",{parentName:"p"}),"\n",(0,n.kt)("strong",{parentName:"p"},"Express")," handled ",(0,n.kt)("strong",{parentName:"p"},"4,302")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"117.2")," ms."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(2600).Z,width:"1131",height:"746"})),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fiber vs Express",src:a(1146).Z,width:"1131",height:"242"})),(0,n.kt)("h3",{id:"single-query"},"Single Query"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Fiber")," handled ",(0,n.kt)("strong",{parentName:"p"},"368,647")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"0.7")," ms.",(0,n.kt)("br",{parentName:"p"}),"\n",(0,n.kt)("strong",{parentName:"p"},"Express")," handled ",(0,n.kt)("strong",{parentName:"p"},"57,880")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"4.4")," ms."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(6802).Z,width:"1131",height:"746"})),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fiber vs Express",src:a(2256).Z,width:"1129",height:"241"})),(0,n.kt)("h3",{id:"json-serialization"},"JSON Serialization"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Fiber")," handled ",(0,n.kt)("strong",{parentName:"p"},"1,146,667")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"0.4")," ms.",(0,n.kt)("br",{parentName:"p"}),"\n",(0,n.kt)("strong",{parentName:"p"},"Express")," handled ",(0,n.kt)("strong",{parentName:"p"},"244,847")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"1.1")," ms."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(7960).Z,width:"1131",height:"601"})),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fiber vs Express",src:a(3316).Z,width:"1129",height:"179"})),(0,n.kt)("h2",{id:"go-web-framework-benchmark"},"Go web framework benchmark"),(0,n.kt)("p",null,"\ud83d\udd17 ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/smallnest/go-web-framework-benchmark"},"https://github.com/smallnest/go-web-framework-benchmark")),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("strong",{parentName:"li"},"CPU")," Intel","(","R",")"," Xeon","(","R",")"," Gold 6140 CPU @ 2.30GHz"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("strong",{parentName:"li"},"MEM")," 4GB"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("strong",{parentName:"li"},"GO")," go1.13.6 linux/amd64"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("strong",{parentName:"li"},"OS")," Linux")),(0,n.kt)("p",null,"The first test case is to mock ",(0,n.kt)("strong",{parentName:"p"},"0 ms"),", ",(0,n.kt)("strong",{parentName:"p"},"10 ms"),", ",(0,n.kt)("strong",{parentName:"p"},"100 ms"),", ",(0,n.kt)("strong",{parentName:"p"},"500 ms")," processing time in handlers."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(8281).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"The concurrency clients are ",(0,n.kt)("strong",{parentName:"p"},"5000"),"."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(8132).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"Latency is the time of real processing time by web servers. ",(0,n.kt)("em",{parentName:"p"},"The smaller is the better.")),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(8248).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"Allocs is the heap allocations by web servers when test is running. The unit is MB. ",(0,n.kt)("em",{parentName:"p"},"The smaller is the better.")),(0,n.kt)("p",null,"If we enable ",(0,n.kt)("strong",{parentName:"p"},"http pipelining"),", test result as below:"),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(3065).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"Concurrency test in ",(0,n.kt)("strong",{parentName:"p"},"30 ms")," processing time, the test result for ",(0,n.kt)("strong",{parentName:"p"},"100"),", ",(0,n.kt)("strong",{parentName:"p"},"1000"),", ",(0,n.kt)("strong",{parentName:"p"},"5000")," clients is:"),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(8767).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(1652).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(6235).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"If we enable ",(0,n.kt)("strong",{parentName:"p"},"http pipelining"),", test result as below:"),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(9951).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"Dependency graph for ",(0,n.kt)("inlineCode",{parentName:"p"},"v1.9.0")),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(3209).Z,width:"1307",height:"520"})))}d.isMDXComponent=!0},3065:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/benchmark-pipeline-b49cbb1db36293acdfb0e6c96d844e1a.png"},8281:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/benchmark-18e23fcf42afc7f5e12ea23aceb27885.png"},8248:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/benchmark_alloc-dec96faa96e07bcec84f40a4dfc8d187.png"},8132:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/benchmark_latency-b67a470cf1b261c3092b80cbf42ef16b.png"},9951:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/concurrency-pipeline-b0d3c211d9c7cb5474fd191223a41241.png"},8767:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/concurrency-1307e1d23c01a561a4b2a0f5bdd7e1bc.png"},6235:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/concurrency_alloc-6f2d485576803f7de2fe0a1deca21a09.png"},1652:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/concurrency_latency-5a223848a8bee8df21cc02451f0db2b6.png"},6551:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/data_updates-3be85c418d6971091854c5086af9ed10.png"},7792:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/data_updates_express-2f55d1b0975ec391d29d823b48faf617.png"},3209:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/graph-afbd400b1c3e1c6f137dae3cfc1890ce.svg"},7960:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/json-62868f61b34e3790f3a8b3b52b1a3a3b.png"},3316:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/json_express-aa631b2de86808970aa4bb7c9c9d3edf.png"},2600:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/multiple_queries-2c2e81674208b90b9aeb1cb791a3f0dc.png"},1146:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/multiple_queries_express-ec4dc8013e85dc2a2fa4f5eeb55ce8dd.png"},2137:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/plaintext-e25d187f782d18fdd35b84e3d7c625eb.png"},7093:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/plaintext_express-ef6522843412bb5b14b3c6b6a4f032de.png"},6802:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/single_query-4f7782d3c3ff91e92ac27e382b09f6ac.png"},2256:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/single_query_express-d8e41422b4f5c0a9496272e4a66a97c4.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[784],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>h});var r=a(7294);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function s(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function p(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var o=r.createContext({}),l=function(e){var t=r.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):p(p({},t),e)),a},c=function(e){var t=l(e.components);return r.createElement(o.Provider,{value:t},e.children)},m="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,s=e.originalType,o=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),m=l(a),g=n,h=m["".concat(o,".").concat(g)]||m[g]||d[g]||s;return a?r.createElement(h,p(p({ref:t},c),{},{components:a})):r.createElement(h,p({ref:t},c))}));function h(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var s=a.length,p=new Array(s);p[0]=g;var i={};for(var o in t)hasOwnProperty.call(t,o)&&(i[o]=t[o]);i.originalType=e,i[m]="string"==typeof e?e:n,p[1]=i;for(var l=2;l{a.r(t),a.d(t,{assets:()=>o,contentTitle:()=>p,default:()=>d,frontMatter:()=>s,metadata:()=>i,toc:()=>l});var r=a(7462),n=(a(7294),a(3905));const s={id:"benchmarks",title:"\ud83d\udcca Benchmarks",description:"These benchmarks aim to compare the performance of Fiber and other web frameworks.",sidebar_position:2},p=void 0,i={unversionedId:"extra/benchmarks",id:"extra/benchmarks",title:"\ud83d\udcca Benchmarks",description:"These benchmarks aim to compare the performance of Fiber and other web frameworks.",source:"@site/docs/core/extra/benchmarks.md",sourceDirName:"extra",slug:"/extra/benchmarks",permalink:"/next/extra/benchmarks",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/extra/benchmarks.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:2,frontMatter:{id:"benchmarks",title:"\ud83d\udcca Benchmarks",description:"These benchmarks aim to compare the performance of Fiber and other web frameworks.",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\ud83e\udd14 FAQ",permalink:"/next/extra/faq"}},o={},l=[{value:"TechEmpower",id:"techempower",level:2},{value:"Plaintext",id:"plaintext",level:3},{value:"Data Updates",id:"data-updates",level:3},{value:"Multiple Queries",id:"multiple-queries",level:3},{value:"Single Query",id:"single-query",level:3},{value:"JSON Serialization",id:"json-serialization",level:3},{value:"Go web framework benchmark",id:"go-web-framework-benchmark",level:2}],c={toc:l},m="wrapper";function d(e){let{components:t,...s}=e;return(0,n.kt)(m,(0,r.Z)({},c,s,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h2",{id:"techempower"},"TechEmpower"),(0,n.kt)("p",null,(0,n.kt)("a",{parentName:"p",href:"https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=composite"},"TechEmpower")," provides a performance comparison of many web application frameworks executing fundamental tasks such as JSON serialization, database access, and server-side template composition."),(0,n.kt)("p",null,"Each framework is operating in a realistic production configuration. Results are captured on cloud instances and on physical hardware. The test implementations are largely community-contributed and all source is available at the ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/TechEmpower/FrameworkBenchmarks"},"GitHub repository"),"."),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Fiber ",(0,n.kt)("inlineCode",{parentName:"li"},"v1.10.0")),(0,n.kt)("li",{parentName:"ul"},"28 HT Cores Intel","(","R",")"," Xeon","(","R",")"," Gold 5120 CPU @ 2.20GHz"),(0,n.kt)("li",{parentName:"ul"},"32GB RAM"),(0,n.kt)("li",{parentName:"ul"},"Ubuntu 18.04.3 4.15.0-88-generic"),(0,n.kt)("li",{parentName:"ul"},"Dedicated Cisco 10-Gbit Ethernet switch.")),(0,n.kt)("h3",{id:"plaintext"},"Plaintext"),(0,n.kt)("p",null,"The Plaintext test is an exercise of the request-routing fundamentals only, designed to demonstrate the capacity of high-performance platforms in particular. Requests will be sent using HTTP pipelining. The response payload is still small, meaning good performance is still necessary in order to saturate the gigabit Ethernet of the test environment."),(0,n.kt)("p",null,"See ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#single-database-query"},"Plaintext requirements")),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Fiber")," - ",(0,n.kt)("strong",{parentName:"p"},"6,162,556")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"2.0")," ms.",(0,n.kt)("br",{parentName:"p"}),"\n",(0,n.kt)("strong",{parentName:"p"},"Express")," - ",(0,n.kt)("strong",{parentName:"p"},"367,069")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"354.1")," ms."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(2137).Z,width:"1130",height:"473"})),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fiber vs Express",src:a(7093).Z,width:"1130",height:"179"})),(0,n.kt)("h3",{id:"data-updates"},"Data Updates"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Fiber")," handled ",(0,n.kt)("strong",{parentName:"p"},"11,846")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"42.8")," ms.",(0,n.kt)("br",{parentName:"p"}),"\n",(0,n.kt)("strong",{parentName:"p"},"Express")," handled ",(0,n.kt)("strong",{parentName:"p"},"2,066")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"390.44")," ms."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(6551).Z,width:"1132",height:"727"})),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fiber vs Express",src:a(7792).Z,width:"1130",height:"243"})),(0,n.kt)("h3",{id:"multiple-queries"},"Multiple Queries"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Fiber")," handled ",(0,n.kt)("strong",{parentName:"p"},"19,664")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"25.7")," ms.",(0,n.kt)("br",{parentName:"p"}),"\n",(0,n.kt)("strong",{parentName:"p"},"Express")," handled ",(0,n.kt)("strong",{parentName:"p"},"4,302")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"117.2")," ms."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(2600).Z,width:"1131",height:"746"})),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fiber vs Express",src:a(1146).Z,width:"1131",height:"242"})),(0,n.kt)("h3",{id:"single-query"},"Single Query"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Fiber")," handled ",(0,n.kt)("strong",{parentName:"p"},"368,647")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"0.7")," ms.",(0,n.kt)("br",{parentName:"p"}),"\n",(0,n.kt)("strong",{parentName:"p"},"Express")," handled ",(0,n.kt)("strong",{parentName:"p"},"57,880")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"4.4")," ms."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(6802).Z,width:"1131",height:"746"})),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fiber vs Express",src:a(2256).Z,width:"1129",height:"241"})),(0,n.kt)("h3",{id:"json-serialization"},"JSON Serialization"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Fiber")," handled ",(0,n.kt)("strong",{parentName:"p"},"1,146,667")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"0.4")," ms.",(0,n.kt)("br",{parentName:"p"}),"\n",(0,n.kt)("strong",{parentName:"p"},"Express")," handled ",(0,n.kt)("strong",{parentName:"p"},"244,847")," responses per second with an average latency of ",(0,n.kt)("strong",{parentName:"p"},"1.1")," ms."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(7960).Z,width:"1131",height:"601"})),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fiber vs Express",src:a(3316).Z,width:"1129",height:"179"})),(0,n.kt)("h2",{id:"go-web-framework-benchmark"},"Go web framework benchmark"),(0,n.kt)("p",null,"\ud83d\udd17 ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/smallnest/go-web-framework-benchmark"},"https://github.com/smallnest/go-web-framework-benchmark")),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("strong",{parentName:"li"},"CPU")," Intel","(","R",")"," Xeon","(","R",")"," Gold 6140 CPU @ 2.30GHz"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("strong",{parentName:"li"},"MEM")," 4GB"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("strong",{parentName:"li"},"GO")," go1.13.6 linux/amd64"),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("strong",{parentName:"li"},"OS")," Linux")),(0,n.kt)("p",null,"The first test case is to mock ",(0,n.kt)("strong",{parentName:"p"},"0 ms"),", ",(0,n.kt)("strong",{parentName:"p"},"10 ms"),", ",(0,n.kt)("strong",{parentName:"p"},"100 ms"),", ",(0,n.kt)("strong",{parentName:"p"},"500 ms")," processing time in handlers."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(8281).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"The concurrency clients are ",(0,n.kt)("strong",{parentName:"p"},"5000"),"."),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(8132).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"Latency is the time of real processing time by web servers. ",(0,n.kt)("em",{parentName:"p"},"The smaller is the better.")),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(8248).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"Allocs is the heap allocations by web servers when test is running. The unit is MB. ",(0,n.kt)("em",{parentName:"p"},"The smaller is the better.")),(0,n.kt)("p",null,"If we enable ",(0,n.kt)("strong",{parentName:"p"},"http pipelining"),", test result as below:"),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(3065).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"Concurrency test in ",(0,n.kt)("strong",{parentName:"p"},"30 ms")," processing time, the test result for ",(0,n.kt)("strong",{parentName:"p"},"100"),", ",(0,n.kt)("strong",{parentName:"p"},"1000"),", ",(0,n.kt)("strong",{parentName:"p"},"5000")," clients is:"),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(8767).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(1652).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(6235).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"If we enable ",(0,n.kt)("strong",{parentName:"p"},"http pipelining"),", test result as below:"),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(9951).Z,width:"1024",height:"600"})),(0,n.kt)("p",null,"Dependency graph for ",(0,n.kt)("inlineCode",{parentName:"p"},"v1.9.0")),(0,n.kt)("p",null,(0,n.kt)("img",{src:a(3209).Z,width:"1307",height:"520"})))}d.isMDXComponent=!0},3065:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/benchmark-pipeline-b49cbb1db36293acdfb0e6c96d844e1a.png"},8281:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/benchmark-18e23fcf42afc7f5e12ea23aceb27885.png"},8248:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/benchmark_alloc-dec96faa96e07bcec84f40a4dfc8d187.png"},8132:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/benchmark_latency-b67a470cf1b261c3092b80cbf42ef16b.png"},9951:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/concurrency-pipeline-b0d3c211d9c7cb5474fd191223a41241.png"},8767:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/concurrency-1307e1d23c01a561a4b2a0f5bdd7e1bc.png"},6235:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/concurrency_alloc-6f2d485576803f7de2fe0a1deca21a09.png"},1652:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/concurrency_latency-5a223848a8bee8df21cc02451f0db2b6.png"},6551:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/data_updates-3be85c418d6971091854c5086af9ed10.png"},7792:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/data_updates_express-2f55d1b0975ec391d29d823b48faf617.png"},3209:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/graph-afbd400b1c3e1c6f137dae3cfc1890ce.svg"},7960:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/json-62868f61b34e3790f3a8b3b52b1a3a3b.png"},3316:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/json_express-aa631b2de86808970aa4bb7c9c9d3edf.png"},2600:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/multiple_queries-2c2e81674208b90b9aeb1cb791a3f0dc.png"},1146:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/multiple_queries_express-ec4dc8013e85dc2a2fa4f5eeb55ce8dd.png"},2137:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/plaintext-e25d187f782d18fdd35b84e3d7c625eb.png"},7093:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/plaintext_express-ef6522843412bb5b14b3c6b6a4f032de.png"},6802:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/single_query-4f7782d3c3ff91e92ac27e382b09f6ac.png"},2256:(e,t,a)=>{a.d(t,{Z:()=>r});const r=a.p+"assets/images/single_query_express-d8e41422b4f5c0a9496272e4a66a97c4.png"}}]); \ No newline at end of file diff --git a/assets/js/7449d9ed.ef4d0dea.js b/assets/js/7449d9ed.8927871d.js similarity index 99% rename from assets/js/7449d9ed.ef4d0dea.js rename to assets/js/7449d9ed.8927871d.js index 7faaa7478ac..bb69531bd34 100644 --- a/assets/js/7449d9ed.ef4d0dea.js +++ b/assets/js/7449d9ed.8927871d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[974],{3905:(e,n,t)=>{t.d(n,{Zo:()=>p,kt:()=>g});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=r.createContext({}),c=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},p=function(e){var n=c(e.components);return r.createElement(s.Provider,{value:n},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},f=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,o=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(t),f=i,g=u["".concat(s,".").concat(f)]||u[f]||d[f]||o;return t?r.createElement(g,a(a({ref:n},p),{},{components:t})):r.createElement(g,a({ref:n},p))}));function g(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var o=t.length,a=new Array(o);a[0]=f;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[u]="string"==typeof e?e:i,a[1]=l;for(var c=2;c{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>a,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>c});var r=t(7462),i=(t(7294),t(3905));const o={id:"cors",title:"CORS"},a=void 0,l={unversionedId:"api/middleware/cors",id:"version-v2.x/api/middleware/cors",title:"CORS",description:"CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.",source:"@site/versioned_docs/version-v2.x/api/middleware/cors.md",sourceDirName:"api/middleware",slug:"/api/middleware/cors",permalink:"/api/middleware/cors",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"cors",title:"CORS"},sidebar:"tutorialSidebar",previous:{title:"Compress",permalink:"/api/middleware/compress"},next:{title:"CSRF",permalink:"/api/middleware/csrf"}},s={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],p={toc:c},u="wrapper";function d(e){let{components:n,...t}=e;return(0,i.kt)(u,(0,r.Z)({},p,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"CORS middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that can be used to enable ",(0,i.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS"},"Cross-Origin Resource Sharing")," with various options."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/cors"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(cors.New())\n\n// Or extend your config for customization\napp.Use(cors.New(cors.Config{\n AllowOrigins: "https://gofiber.io, https://gofiber.net",\n AllowHeaders: "Origin, Content-Type, Accept",\n}))\n')),(0,i.kt)("p",null,"Using the ",(0,i.kt)("inlineCode",{parentName:"p"},"AllowOriginsFunc")," function. In this example any origin will be allowed via CORS."),(0,i.kt)("p",null,"For example, if a browser running on ",(0,i.kt)("inlineCode",{parentName:"p"},"http://localhost:3000")," sends a request, this will be accepted and the ",(0,i.kt)("inlineCode",{parentName:"p"},"access-control-allow-origin")," response header will be set to ",(0,i.kt)("inlineCode",{parentName:"p"},"http://localhost:3000"),"."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via ",(0,i.kt)("inlineCode",{parentName:"strong"},"AllowOrigins"),".")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(cors.New())\n\napp.Use(cors.New(cors.Config{\n AllowOriginsFunc: func(origin string) bool {\n return os.Getenv("ENVIRONMENT") == "development"\n },\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // AllowOriginsFunc defines a function that will set the \'access-control-allow-origin\'\n // response header to the \'origin\' request header when returned true.\n // \n // Note: Using this feature is discouraged in production and it\'s best practice to explicitly\n // set CORS origins via \'AllowOrigins\'\n //\n // Optional. Default: nil\n AllowOriginsFunc func(origin string) bool\n\n // AllowOrigin defines a list of origins that may access the resource.\n //\n // Optional. Default value "*"\n AllowOrigins string\n\n // AllowMethods defines a list methods allowed when accessing the resource.\n // This is used in response to a preflight request.\n //\n // Optional. Default value "GET,POST,HEAD,PUT,DELETE,PATCH"\n AllowMethods string\n\n // AllowHeaders defines a list of request headers that can be used when\n // making the actual request. This is in response to a preflight request.\n //\n // Optional. Default value "".\n AllowHeaders string\n\n // AllowCredentials indicates whether or not the response to the request\n // can be exposed when the credentials flag is true. When used as part of\n // a response to a preflight request, this indicates whether or not the\n // actual request can be made using credentials.\n //\n // Optional. Default value false.\n AllowCredentials bool\n\n // ExposeHeaders defines a whitelist headers that clients are allowed to\n // access.\n //\n // Optional. Default value "".\n ExposeHeaders string\n\n // MaxAge indicates how long (in seconds) the results of a preflight request\n // can be cached.\n //\n // Optional. Default value 0.\n MaxAge int\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n AllowOriginsFunc: nil,\n AllowOrigins: "*",\n AllowMethods: strings.Join([]string{\n fiber.MethodGet,\n fiber.MethodPost,\n fiber.MethodHead,\n fiber.MethodPut,\n fiber.MethodDelete,\n fiber.MethodPatch,\n }, ","),\n AllowHeaders: "",\n AllowCredentials: false,\n ExposeHeaders: "",\n MaxAge: 0,\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[974],{3905:(e,n,t)=>{t.d(n,{Zo:()=>p,kt:()=>g});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=r.createContext({}),c=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},p=function(e){var n=c(e.components);return r.createElement(s.Provider,{value:n},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},f=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,o=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(t),f=i,g=u["".concat(s,".").concat(f)]||u[f]||d[f]||o;return t?r.createElement(g,a(a({ref:n},p),{},{components:t})):r.createElement(g,a({ref:n},p))}));function g(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var o=t.length,a=new Array(o);a[0]=f;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[u]="string"==typeof e?e:i,a[1]=l;for(var c=2;c{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>a,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>c});var r=t(7462),i=(t(7294),t(3905));const o={id:"cors",title:"CORS"},a=void 0,l={unversionedId:"api/middleware/cors",id:"version-v2.x/api/middleware/cors",title:"CORS",description:"CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.",source:"@site/versioned_docs/version-v2.x/api/middleware/cors.md",sourceDirName:"api/middleware",slug:"/api/middleware/cors",permalink:"/api/middleware/cors",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"cors",title:"CORS"},sidebar:"tutorialSidebar",previous:{title:"Compress",permalink:"/api/middleware/compress"},next:{title:"CSRF",permalink:"/api/middleware/csrf"}},s={},c=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],p={toc:c},u="wrapper";function d(e){let{components:n,...t}=e;return(0,i.kt)(u,(0,r.Z)({},p,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"CORS middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that can be used to enable ",(0,i.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS"},"Cross-Origin Resource Sharing")," with various options."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/cors"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(cors.New())\n\n// Or extend your config for customization\napp.Use(cors.New(cors.Config{\n AllowOrigins: "https://gofiber.io, https://gofiber.net",\n AllowHeaders: "Origin, Content-Type, Accept",\n}))\n')),(0,i.kt)("p",null,"Using the ",(0,i.kt)("inlineCode",{parentName:"p"},"AllowOriginsFunc")," function. In this example any origin will be allowed via CORS."),(0,i.kt)("p",null,"For example, if a browser running on ",(0,i.kt)("inlineCode",{parentName:"p"},"http://localhost:3000")," sends a request, this will be accepted and the ",(0,i.kt)("inlineCode",{parentName:"p"},"access-control-allow-origin")," response header will be set to ",(0,i.kt)("inlineCode",{parentName:"p"},"http://localhost:3000"),"."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via ",(0,i.kt)("inlineCode",{parentName:"strong"},"AllowOrigins"),".")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'app.Use(cors.New())\n\napp.Use(cors.New(cors.Config{\n AllowOriginsFunc: func(origin string) bool {\n return os.Getenv("ENVIRONMENT") == "development"\n },\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // AllowOriginsFunc defines a function that will set the \'access-control-allow-origin\'\n // response header to the \'origin\' request header when returned true.\n // \n // Note: Using this feature is discouraged in production and it\'s best practice to explicitly\n // set CORS origins via \'AllowOrigins\'\n //\n // Optional. Default: nil\n AllowOriginsFunc func(origin string) bool\n\n // AllowOrigin defines a list of origins that may access the resource.\n //\n // Optional. Default value "*"\n AllowOrigins string\n\n // AllowMethods defines a list methods allowed when accessing the resource.\n // This is used in response to a preflight request.\n //\n // Optional. Default value "GET,POST,HEAD,PUT,DELETE,PATCH"\n AllowMethods string\n\n // AllowHeaders defines a list of request headers that can be used when\n // making the actual request. This is in response to a preflight request.\n //\n // Optional. Default value "".\n AllowHeaders string\n\n // AllowCredentials indicates whether or not the response to the request\n // can be exposed when the credentials flag is true. When used as part of\n // a response to a preflight request, this indicates whether or not the\n // actual request can be made using credentials.\n //\n // Optional. Default value false.\n AllowCredentials bool\n\n // ExposeHeaders defines a whitelist headers that clients are allowed to\n // access.\n //\n // Optional. Default value "".\n ExposeHeaders string\n\n // MaxAge indicates how long (in seconds) the results of a preflight request\n // can be cached.\n //\n // Optional. Default value 0.\n MaxAge int\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n AllowOriginsFunc: nil,\n AllowOrigins: "*",\n AllowMethods: strings.Join([]string{\n fiber.MethodGet,\n fiber.MethodPost,\n fiber.MethodHead,\n fiber.MethodPut,\n fiber.MethodDelete,\n fiber.MethodPatch,\n }, ","),\n AllowHeaders: "",\n AllowCredentials: false,\n ExposeHeaders: "",\n MaxAge: 0,\n}\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/7506f0f5.5e479ec2.js b/assets/js/7506f0f5.df2e65e9.js similarity index 99% rename from assets/js/7506f0f5.5e479ec2.js rename to assets/js/7506f0f5.df2e65e9.js index 13c5da30b62..19bddb3a0f8 100644 --- a/assets/js/7506f0f5.5e479ec2.js +++ b/assets/js/7506f0f5.df2e65e9.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9752],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>d});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),g=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=g(e.components);return a.createElement(s.Provider,{value:t},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},f=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=g(n),f=r,d=u["".concat(s,".").concat(f)]||u[f]||c[f]||o;return n?a.createElement(d,i(i({ref:t},p),{},{components:n})):a.createElement(d,i({ref:t},p))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=f;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:r,i[1]=l;for(var g=2;g{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>c,frontMatter:()=>o,metadata:()=>l,toc:()=>g});var a=n(7462),r=(n(7294),n(3905));const o={id:"arangodb",title:"ArangoDB"},i=void 0,l={unversionedId:"arangodb/arangodb",id:"arangodb/arangodb",title:"ArangoDB",description:"Release",source:"@site/docs/storage/arangodb/README.md",sourceDirName:"arangodb",slug:"/arangodb/",permalink:"/storage/arangodb/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/arangodb/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"arangodb",title:"ArangoDB"},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udc4b Welcome",permalink:"/storage/"},next:{title:"Azure Blob",permalink:"/storage/azureblob/"}},s={},g=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],p={toc:g},u="wrapper";function c(e){let{components:t,...n}=e;return(0,r.kt)(u,(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=arangodb*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-arangodb.yml?label=Tests",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,r.kt)("p",null,"A ArangoDB storage driver using ",(0,r.kt)("inlineCode",{parentName:"p"},"arangodb/go-driver")," and ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/arangodb/go-driver"},"arangodb/go-driver"),"."),(0,r.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,r.kt)("h3",{id:"signatures"},"Signatures"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() driver.Client\n")),(0,r.kt)("h3",{id:"installation"},"Installation"),(0,r.kt)("p",null,"ArangoDB is tested on the 2 last (1.14/1.15) ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,r.kt)("p",null,"And then install the mysql implementation:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/arangodb\n")),(0,r.kt)("h3",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Import the storage package."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/arangodb"\n')),(0,r.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := arangodb.New()\n\n// Initialize custom config\nstore := arangodb.New(arangodb.Config{\n Host: "http://127.0.0.1",\n Port: 8529,\n Database: "fiber",\n Collection: "fiber_storage",\n Reset: false,\n GCInterval: 10 * time.Second,\n})\n')),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Host name where the DB is hosted\n //\n // Optional. Default is "http://127.0.0.1"\n Host string\n\n // Port where the DB is listening on\n //\n // Optional. Default is 8529\n Port int\n\n // Server username\n //\n // Optional. Default is ""\n Username string\n\n // Server password\n //\n // Optional. Default is ""\n Password string\n\n // Database name\n //\n // Optional. Default is "fiber"\n Database string\n\n // Collection name\n //\n // Optional. Default is "fiber_storage"\n Collection string\n\n // Reset clears any existing keys in existing collection\n //\n // Optional. Default is false\n Reset bool\n // Time before deleting expired keys\n //\n // Optional. Default is 10 * time.Second\n GCInterval time.Duration\n}\n')),(0,r.kt)("h3",{id:"default-config"},"Default Config"),(0,r.kt)("p",null,"Used only for optional fields"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Host: "http://127.0.0.1",\n Port: 8529,\n Database: "fiber",\n Collection: "fiber_storage",\n Reset: false,\n GCInterval: 10 * time.Second,\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9752],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>d});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),g=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=g(e.components);return a.createElement(s.Provider,{value:t},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},f=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=g(n),f=r,d=u["".concat(s,".").concat(f)]||u[f]||c[f]||o;return n?a.createElement(d,i(i({ref:t},p),{},{components:n})):a.createElement(d,i({ref:t},p))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=f;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:r,i[1]=l;for(var g=2;g{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>c,frontMatter:()=>o,metadata:()=>l,toc:()=>g});var a=n(7462),r=(n(7294),n(3905));const o={id:"arangodb",title:"ArangoDB"},i=void 0,l={unversionedId:"arangodb/arangodb",id:"arangodb/arangodb",title:"ArangoDB",description:"Release",source:"@site/docs/storage/arangodb/README.md",sourceDirName:"arangodb",slug:"/arangodb/",permalink:"/storage/arangodb/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/arangodb/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"arangodb",title:"ArangoDB"},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udc4b Welcome",permalink:"/storage/"},next:{title:"Azure Blob",permalink:"/storage/azureblob/"}},s={},g=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],p={toc:g},u="wrapper";function c(e){let{components:t,...n}=e;return(0,r.kt)(u,(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=arangodb*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-arangodb.yml?label=Tests",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,r.kt)("p",null,"A ArangoDB storage driver using ",(0,r.kt)("inlineCode",{parentName:"p"},"arangodb/go-driver")," and ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/arangodb/go-driver"},"arangodb/go-driver"),"."),(0,r.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,r.kt)("h3",{id:"signatures"},"Signatures"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() driver.Client\n")),(0,r.kt)("h3",{id:"installation"},"Installation"),(0,r.kt)("p",null,"ArangoDB is tested on the 2 last (1.14/1.15) ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,r.kt)("p",null,"And then install the mysql implementation:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/arangodb\n")),(0,r.kt)("h3",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Import the storage package."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/arangodb"\n')),(0,r.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := arangodb.New()\n\n// Initialize custom config\nstore := arangodb.New(arangodb.Config{\n Host: "http://127.0.0.1",\n Port: 8529,\n Database: "fiber",\n Collection: "fiber_storage",\n Reset: false,\n GCInterval: 10 * time.Second,\n})\n')),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Host name where the DB is hosted\n //\n // Optional. Default is "http://127.0.0.1"\n Host string\n\n // Port where the DB is listening on\n //\n // Optional. Default is 8529\n Port int\n\n // Server username\n //\n // Optional. Default is ""\n Username string\n\n // Server password\n //\n // Optional. Default is ""\n Password string\n\n // Database name\n //\n // Optional. Default is "fiber"\n Database string\n\n // Collection name\n //\n // Optional. Default is "fiber_storage"\n Collection string\n\n // Reset clears any existing keys in existing collection\n //\n // Optional. Default is false\n Reset bool\n // Time before deleting expired keys\n //\n // Optional. Default is 10 * time.Second\n GCInterval time.Duration\n}\n')),(0,r.kt)("h3",{id:"default-config"},"Default Config"),(0,r.kt)("p",null,"Used only for optional fields"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Host: "http://127.0.0.1",\n Port: 8529,\n Database: "fiber",\n Collection: "fiber_storage",\n Reset: false,\n GCInterval: 10 * time.Second,\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/75542ae5.034a0932.js b/assets/js/75542ae5.b4790f88.js similarity index 99% rename from assets/js/75542ae5.034a0932.js rename to assets/js/75542ae5.b4790f88.js index ced445aab33..ba27d2a701e 100644 --- a/assets/js/75542ae5.034a0932.js +++ b/assets/js/75542ae5.b4790f88.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[4193],{3905:(e,t,r)=>{r.d(t,{Zo:()=>m,kt:()=>f});var a=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function i(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),c=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},m=function(e){var t=c(e.components);return a.createElement(s.Provider,{value:t},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},g=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),p=c(r),g=n,f=p["".concat(s,".").concat(g)]||p[g]||u[g]||o;return r?a.createElement(f,i(i({ref:t},m),{},{components:r})):a.createElement(f,i({ref:t},m))}));function f(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,i=new Array(o);i[0]=g;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:n,i[1]=l;for(var c=2;c{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>l,toc:()=>c});var a=r(7462),n=(r(7294),r(3905));const o={id:"memcache",title:"Memcache"},i=void 0,l={unversionedId:"memcache/memcache",id:"memcache/memcache",title:"Memcache",description:"Release",source:"@site/docs/storage/memcache/README.md",sourceDirName:"memcache",slug:"/memcache/",permalink:"/storage/memcache/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/memcache/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"memcache",title:"Memcache"},sidebar:"tutorialSidebar",previous:{title:"Etcd",permalink:"/storage/etcd/"},next:{title:"Memory",permalink:"/storage/memory/"}},s={},c=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],m={toc:c},p="wrapper";function u(e){let{components:t,...r}=e;return(0,n.kt)(p,(0,a.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=memcache*",alt:"Release"}),"\n",(0,n.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,n.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-memcache.yml?label=Tests",alt:"Test"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,n.kt)("p",null,"A Memcache storage driver using ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/bradfitz/gomemcache"},(0,n.kt)("inlineCode",{parentName:"a"},"bradfitz/gomemcache")),"."),(0,n.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,n.kt)("h3",{id:"signatures"},"Signatures"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *mc.Client\n")),(0,n.kt)("h3",{id:"installation"},"Installation"),(0,n.kt)("p",null,"Memory is tested on the 2 last ",(0,n.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,n.kt)("p",null,"And then install the memory implementation:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/memory\n")),(0,n.kt)("h3",{id:"examples"},"Examples"),(0,n.kt)("p",null,"Import the storage package."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/memcache"\n')),(0,n.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := memcache.New()\n\n// Initialize custom config\nstore := memcache.New(memcache.Config{\n Servers: "localhost:11211",\n})\n')),(0,n.kt)("h3",{id:"config"},"Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Server list divided by ,\n // i.e. server1:11211, server2:11212\n //\n // Optional. Default is "127.0.0.1:11211"\n Servers string\n\n // Reset clears any existing keys in existing Table\n //\n // Optional. Default is false\n Reset bool\n}\n')),(0,n.kt)("h3",{id:"default-config"},"Default Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Servers: "127.0.0.1:11211",\n}\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[4193],{3905:(e,t,r)=>{r.d(t,{Zo:()=>m,kt:()=>f});var a=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function i(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),c=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},m=function(e){var t=c(e.components);return a.createElement(s.Provider,{value:t},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},g=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),p=c(r),g=n,f=p["".concat(s,".").concat(g)]||p[g]||u[g]||o;return r?a.createElement(f,i(i({ref:t},m),{},{components:r})):a.createElement(f,i({ref:t},m))}));function f(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,i=new Array(o);i[0]=g;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:n,i[1]=l;for(var c=2;c{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>l,toc:()=>c});var a=r(7462),n=(r(7294),r(3905));const o={id:"memcache",title:"Memcache"},i=void 0,l={unversionedId:"memcache/memcache",id:"memcache/memcache",title:"Memcache",description:"Release",source:"@site/docs/storage/memcache/README.md",sourceDirName:"memcache",slug:"/memcache/",permalink:"/storage/memcache/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/memcache/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"memcache",title:"Memcache"},sidebar:"tutorialSidebar",previous:{title:"Etcd",permalink:"/storage/etcd/"},next:{title:"Memory",permalink:"/storage/memory/"}},s={},c=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],m={toc:c},p="wrapper";function u(e){let{components:t,...r}=e;return(0,n.kt)(p,(0,a.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=memcache*",alt:"Release"}),"\n",(0,n.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,n.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-memcache.yml?label=Tests",alt:"Test"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,n.kt)("p",null,"A Memcache storage driver using ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/bradfitz/gomemcache"},(0,n.kt)("inlineCode",{parentName:"a"},"bradfitz/gomemcache")),"."),(0,n.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,n.kt)("h3",{id:"signatures"},"Signatures"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *mc.Client\n")),(0,n.kt)("h3",{id:"installation"},"Installation"),(0,n.kt)("p",null,"Memory is tested on the 2 last ",(0,n.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,n.kt)("p",null,"And then install the memory implementation:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/memory\n")),(0,n.kt)("h3",{id:"examples"},"Examples"),(0,n.kt)("p",null,"Import the storage package."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/memcache"\n')),(0,n.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := memcache.New()\n\n// Initialize custom config\nstore := memcache.New(memcache.Config{\n Servers: "localhost:11211",\n})\n')),(0,n.kt)("h3",{id:"config"},"Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'type Config struct {\n // Server list divided by ,\n // i.e. server1:11211, server2:11212\n //\n // Optional. Default is "127.0.0.1:11211"\n Servers string\n\n // Reset clears any existing keys in existing Table\n //\n // Optional. Default is false\n Reset bool\n}\n')),(0,n.kt)("h3",{id:"default-config"},"Default Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Servers: "127.0.0.1:11211",\n}\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/78d978a7.53c10629.js b/assets/js/78d978a7.52e1e357.js similarity index 98% rename from assets/js/78d978a7.53c10629.js rename to assets/js/78d978a7.52e1e357.js index 30149eb8ca0..743563c2c81 100644 --- a/assets/js/78d978a7.53c10629.js +++ b/assets/js/78d978a7.52e1e357.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6131],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=r.createContext({}),s=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},m=function(e){var t=s(e.components);return r.createElement(p.Provider,{value:t},e.children)},c="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,p=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),c=s(n),d=a,f=c["".concat(p,".").concat(d)]||c[d]||u[d]||i;return n?r.createElement(f,l(l({ref:t},m),{},{components:n})):r.createElement(f,l({ref:t},m))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,l=new Array(i);l[0]=d;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o[c]="string"==typeof e?e:a,l[1]=o;for(var s=2;s{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const i={id:"jet",title:"Jet"},l=void 0,o={unversionedId:"jet/jet",id:"jet/jet",title:"Jet",description:"Release",source:"@site/docs/template/jet/README.md",sourceDirName:"jet",slug:"/jet/",permalink:"/template/jet/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/jet/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"jet",title:"Jet"},sidebar:"tutorialSidebar",previous:{title:"Golang Templates Cheatsheet",permalink:"/template/html/TEMPLATES_CHEATSHEET"},next:{title:"Mustache",permalink:"/template/mustache/"}},p={},s=[{value:"Basic Example",id:"basic-example",level:3}],m={toc:s},c="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Jet is a template engine create by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/CloudyKit/jet"},"cloudykit"),", to see the original syntax documentation please ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/CloudyKit/jet/wiki/3.-Jet-template-syntax"},"click here")),(0,a.kt)("h3",{id:"basic-example"},"Basic Example"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/index.jet"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},'{{include "partials/header"}}\n\n

{{ Title }}

\n\n{{include "partials/footer"}}\n')),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/header.jet"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"

Header

\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/footer.jet"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"

Footer

\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/layouts/main.jet"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"\n\n\n\n Title\n\n\n\n {{ embed() }}\n\n\n\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n \n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/jet/v2"\n)\n\nfunc main() {\n // Create a new engine\n engine := jet.New("./views", ".jet")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := jet.NewFileSystem(http.Dir("./views", ".jet"))\n\n // Pass the engine to the views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6131],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=r.createContext({}),s=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},m=function(e){var t=s(e.components);return r.createElement(p.Provider,{value:t},e.children)},c="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,p=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),c=s(n),d=a,f=c["".concat(p,".").concat(d)]||c[d]||u[d]||i;return n?r.createElement(f,l(l({ref:t},m),{},{components:n})):r.createElement(f,l({ref:t},m))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,l=new Array(i);l[0]=d;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o[c]="string"==typeof e?e:a,l[1]=o;for(var s=2;s{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const i={id:"jet",title:"Jet"},l=void 0,o={unversionedId:"jet/jet",id:"jet/jet",title:"Jet",description:"Release",source:"@site/docs/template/jet/README.md",sourceDirName:"jet",slug:"/jet/",permalink:"/template/jet/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/jet/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"jet",title:"Jet"},sidebar:"tutorialSidebar",previous:{title:"Golang Templates Cheatsheet",permalink:"/template/html/TEMPLATES_CHEATSHEET"},next:{title:"Mustache",permalink:"/template/mustache/"}},p={},s=[{value:"Basic Example",id:"basic-example",level:3}],m={toc:s},c="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Jet is a template engine create by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/CloudyKit/jet"},"cloudykit"),", to see the original syntax documentation please ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/CloudyKit/jet/wiki/3.-Jet-template-syntax"},"click here")),(0,a.kt)("h3",{id:"basic-example"},"Basic Example"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/index.jet"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},'{{include "partials/header"}}\n\n

{{ Title }}

\n\n{{include "partials/footer"}}\n')),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/header.jet"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"

Header

\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/footer.jet"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"

Footer

\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/layouts/main.jet"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"\n\n\n\n Title\n\n\n\n {{ embed() }}\n\n\n\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n \n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/jet/v2"\n)\n\nfunc main() {\n // Create a new engine\n engine := jet.New("./views", ".jet")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := jet.NewFileSystem(http.Dir("./views", ".jet"))\n\n // Pass the engine to the views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/7bb2c503.f43c2202.js b/assets/js/7bb2c503.844cbef5.js similarity index 98% rename from assets/js/7bb2c503.f43c2202.js rename to assets/js/7bb2c503.844cbef5.js index 566d6507595..eaf013c2633 100644 --- a/assets/js/7bb2c503.f43c2202.js +++ b/assets/js/7bb2c503.844cbef5.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1750],{3905:(e,r,t)=>{t.d(r,{Zo:()=>p,kt:()=>m});var n=t(7294);function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var c=n.createContext({}),d=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):o(o({},r),e)),t},p=function(e){var r=d(e.components);return n.createElement(c.Provider,{value:r},e.children)},s="mdxType",u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),s=d(t),f=i,m=s["".concat(c,".").concat(f)]||s[f]||u[f]||a;return t?n.createElement(m,o(o({ref:r},p),{},{components:t})):n.createElement(m,o({ref:r},p))}));function m(e,r){var t=arguments,i=r&&r.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=f;var l={};for(var c in r)hasOwnProperty.call(r,c)&&(l[c]=r[c]);l.originalType=e,l[s]="string"==typeof e?e:i,o[1]=l;for(var d=2;d{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>d});var n=t(7462),i=(t(7294),t(3905));const a={id:"redirect",title:"Redirect"},o=void 0,l={unversionedId:"api/middleware/redirect",id:"version-v2.x/api/middleware/redirect",title:"Redirect",description:"Redirection middleware for Fiber.",source:"@site/versioned_docs/version-v2.x/api/middleware/redirect.md",sourceDirName:"api/middleware",slug:"/api/middleware/redirect",permalink:"/api/middleware/redirect",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"redirect",title:"Redirect"},sidebar:"tutorialSidebar",previous:{title:"Recover",permalink:"/api/middleware/recover"},next:{title:"RequestID",permalink:"/api/middleware/requestid"}},c={},d=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],p={toc:d},s="wrapper";function u(e){let{components:r,...t}=e;return(0,i.kt)(s,(0,n.Z)({},p,t,{components:r,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Redirection middleware for Fiber."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/redirect"\n)\n\nfunc main() {\n app := fiber.New()\n \n app.Use(redirect.New(redirect.Config{\n Rules: map[string]string{\n "/old": "/new",\n "/old/*": "/new/$1",\n },\n StatusCode: 301,\n }))\n \n app.Get("/new", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n })\n app.Get("/new/*", func(c *fiber.Ctx) error {\n return c.SendString("Wildcard: " + c.Params("*"))\n })\n \n app.Listen(":3000")\n}\n')),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Test:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-curl"},"curl http://localhost:3000/old\ncurl http://localhost:3000/old/hello\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Filter defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // Rules defines the URL path rewrite rules. The values captured in asterisk can be\n // retrieved by index e.g. $1, $2 and so on.\n // Required. Example:\n // "/old": "/new",\n // "/api/*": "/$1",\n // "/js/*": "/public/javascripts/$1",\n // "/users/*/orders/*": "/user/$1/order/$2",\n Rules map[string]string\n\n // The status code when redirecting\n // This is ignored if Redirect is disabled\n // Optional. Default: 302 (fiber.StatusFound)\n StatusCode int\n\n rulesRegex map[*regexp.Regexp]string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n StatusCode: fiber.StatusFound,\n}\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1750],{3905:(e,r,t)=>{t.d(r,{Zo:()=>p,kt:()=>m});var n=t(7294);function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var c=n.createContext({}),d=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):o(o({},r),e)),t},p=function(e){var r=d(e.components);return n.createElement(c.Provider,{value:r},e.children)},s="mdxType",u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),s=d(t),f=i,m=s["".concat(c,".").concat(f)]||s[f]||u[f]||a;return t?n.createElement(m,o(o({ref:r},p),{},{components:t})):n.createElement(m,o({ref:r},p))}));function m(e,r){var t=arguments,i=r&&r.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=f;var l={};for(var c in r)hasOwnProperty.call(r,c)&&(l[c]=r[c]);l.originalType=e,l[s]="string"==typeof e?e:i,o[1]=l;for(var d=2;d{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>d});var n=t(7462),i=(t(7294),t(3905));const a={id:"redirect",title:"Redirect"},o=void 0,l={unversionedId:"api/middleware/redirect",id:"version-v2.x/api/middleware/redirect",title:"Redirect",description:"Redirection middleware for Fiber.",source:"@site/versioned_docs/version-v2.x/api/middleware/redirect.md",sourceDirName:"api/middleware",slug:"/api/middleware/redirect",permalink:"/api/middleware/redirect",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"redirect",title:"Redirect"},sidebar:"tutorialSidebar",previous:{title:"Recover",permalink:"/api/middleware/recover"},next:{title:"RequestID",permalink:"/api/middleware/requestid"}},c={},d=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],p={toc:d},s="wrapper";function u(e){let{components:r,...t}=e;return(0,i.kt)(s,(0,n.Z)({},p,t,{components:r,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Redirection middleware for Fiber."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/redirect"\n)\n\nfunc main() {\n app := fiber.New()\n \n app.Use(redirect.New(redirect.Config{\n Rules: map[string]string{\n "/old": "/new",\n "/old/*": "/new/$1",\n },\n StatusCode: 301,\n }))\n \n app.Get("/new", func(c *fiber.Ctx) error {\n return c.SendString("Hello, World!")\n })\n app.Get("/new/*", func(c *fiber.Ctx) error {\n return c.SendString("Wildcard: " + c.Params("*"))\n })\n \n app.Listen(":3000")\n}\n')),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Test:")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-curl"},"curl http://localhost:3000/old\ncurl http://localhost:3000/old/hello\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Filter defines a function to skip middleware.\n // Optional. Default: nil\n Next func(*fiber.Ctx) bool\n\n // Rules defines the URL path rewrite rules. The values captured in asterisk can be\n // retrieved by index e.g. $1, $2 and so on.\n // Required. Example:\n // "/old": "/new",\n // "/api/*": "/$1",\n // "/js/*": "/public/javascripts/$1",\n // "/users/*/orders/*": "/user/$1/order/$2",\n Rules map[string]string\n\n // The status code when redirecting\n // This is ignored if Redirect is disabled\n // Optional. Default: 302 (fiber.StatusFound)\n StatusCode int\n\n rulesRegex map[*regexp.Regexp]string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n StatusCode: fiber.StatusFound,\n}\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/7d5a5238.77c20edb.js b/assets/js/7d5a5238.04968e2c.js similarity index 99% rename from assets/js/7d5a5238.77c20edb.js rename to assets/js/7d5a5238.04968e2c.js index ce6c28b0a89..ee92f6aa4df 100644 --- a/assets/js/7d5a5238.77c20edb.js +++ b/assets/js/7d5a5238.04968e2c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1059],{3905:(e,n,t)=>{t.d(n,{Zo:()=>m,kt:()=>u});var a=t(7294);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function o(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=a.createContext({}),p=function(e){var n=a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},m=function(e){var n=p(e.components);return a.createElement(s.Provider,{value:n},e.children)},d="mdxType",g={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},c=a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),d=p(t),c=r,u=d["".concat(s,".").concat(c)]||d[c]||g[c]||i;return t?a.createElement(u,o(o({ref:n},m),{},{components:t})):a.createElement(u,o({ref:n},m))}));function u(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var i=t.length,o=new Array(i);o[0]=c;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[d]="string"==typeof e?e:r,o[1]=l;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>o,default:()=>g,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var a=t(7462),r=(t(7294),t(3905));const i={id:"django",title:"Django"},o=void 0,l={unversionedId:"django/django",id:"django/django",title:"Django",description:"Release",source:"@site/docs/template/django/README.md",sourceDirName:"django",slug:"/django/",permalink:"/template/django/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/django/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"django",title:"Django"},sidebar:"tutorialSidebar",previous:{title:"Amber",permalink:"/template/amber/"},next:{title:"Handlebars",permalink:"/template/handlebars/"}},s={},p=[{value:"Basic Example",id:"basic-example",level:3},{value:"Using embedded file system (1.16+ only)",id:"using-embedded-file-system-116-only",level:3},{value:"Register and use custom functions",id:"register-and-use-custom-functions",level:3}],m={toc:p},d="wrapper";function g(e){let{components:n,...t}=e;return(0,r.kt)(d,(0,a.Z)({},m,t,{components:n,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,r.kt)("p",null,"Django is a template engine create by ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/flosch/pongo2"},"flosch"),", to see the original syntax documentation please ",(0,r.kt)("a",{parentName:"p",href:"https://docs.djangoproject.com/en/dev/topics/templates/"},"click here")),(0,r.kt)("h3",{id:"basic-example"},"Basic Example"),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/index.django"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},'{% include "partials/header.django" %}\n\n

{{ Title }}

\n\n{% include "partials/footer.django" %}\n')),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/partials/header.django"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

Header

\n")),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/partials/footer.django"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

Footer

\n")),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/layouts/main.django"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"\n\n\n\n Main\n\n\n\n {{embed}}\n\n\n\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/django/v3"\n)\n\nfunc main() {\n // Create a new engine\n engine := django.New("./views", ".django")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := html.NewFileSystem(http.Dir("./views", ".django"))\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')),(0,r.kt)("h3",{id:"using-embedded-file-system-116-only"},"Using embedded file system (1.16+ only)"),(0,r.kt)("p",null,"When using the ",(0,r.kt)("inlineCode",{parentName:"p"},"// go:embed")," directive, resolution of inherited templates using django's ",(0,r.kt)("inlineCode",{parentName:"p"},"{% extend '' %}")," keyword fails when instantiating the template engine with ",(0,r.kt)("inlineCode",{parentName:"p"},"django.NewFileSystem()"),". In that case, use the ",(0,r.kt)("inlineCode",{parentName:"p"},"django.NewPathForwardingFileSystem()")," function to instantiate the template engine. "),(0,r.kt)("p",null,"This function provides the proper configuration for resolving inherited templates."),(0,r.kt)("p",null,"Assume you have the following files:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/blob/master/django/views/ancestor.django"},"views/ancenstor.django")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/blob/master/django/views/descendant.django"},"views/descendant.djando"))),(0,r.kt)("p",null,"then"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n "embed"\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/django/v3"\n)\n\n//go:embed views\nvar viewsAsssets embed.FS\n\nfunc main() {\n // Create a new engine\n engine := NewPathForwardingFileSystem(http.FS(viewsAsssets), "/views", ".django")\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render descendant\n return c.Render("descendant", fiber.Map{\n "greeting": "World",\n })\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')),(0,r.kt)("h3",{id:"register-and-use-custom-functions"},"Register and use custom functions"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// My custom function\nfunc Nl2brHtml(value interface{}) string {\n if str, ok := value.(string); ok {\n return strings.Replace(str, "\\n", "
", -1)\n }\n return ""\n}\n\n// Create a new engine\nengine := django.New("./views", ".django")\n\n// register functions\nengine.AddFunc("nl2br", Nl2brHtml)\n\n// Pass the engine to the Views\napp := fiber.New(fiber.Config{Views: engine})\n')),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"in the handler"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'c.Render("index", fiber.Map{\n "Fiber": "Hello, World!\\n\\nGreetings from Fiber Team",\n})\n')),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/index.django"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},'\n\n\n\n{{ nl2br(Fiber) }}\n\n\n')),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Output:")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},'\n\n\n\nHello, World!

Greetings from Fiber Team\n\n\n')))}g.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1059],{3905:(e,n,t)=>{t.d(n,{Zo:()=>m,kt:()=>u});var a=t(7294);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function o(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=a.createContext({}),p=function(e){var n=a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},m=function(e){var n=p(e.components);return a.createElement(s.Provider,{value:n},e.children)},d="mdxType",g={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},c=a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),d=p(t),c=r,u=d["".concat(s,".").concat(c)]||d[c]||g[c]||i;return t?a.createElement(u,o(o({ref:n},m),{},{components:t})):a.createElement(u,o({ref:n},m))}));function u(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var i=t.length,o=new Array(i);o[0]=c;var l={};for(var s in n)hasOwnProperty.call(n,s)&&(l[s]=n[s]);l.originalType=e,l[d]="string"==typeof e?e:r,o[1]=l;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>o,default:()=>g,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var a=t(7462),r=(t(7294),t(3905));const i={id:"django",title:"Django"},o=void 0,l={unversionedId:"django/django",id:"django/django",title:"Django",description:"Release",source:"@site/docs/template/django/README.md",sourceDirName:"django",slug:"/django/",permalink:"/template/django/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/django/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"django",title:"Django"},sidebar:"tutorialSidebar",previous:{title:"Amber",permalink:"/template/amber/"},next:{title:"Handlebars",permalink:"/template/handlebars/"}},s={},p=[{value:"Basic Example",id:"basic-example",level:3},{value:"Using embedded file system (1.16+ only)",id:"using-embedded-file-system-116-only",level:3},{value:"Register and use custom functions",id:"register-and-use-custom-functions",level:3}],m={toc:p},d="wrapper";function g(e){let{components:n,...t}=e;return(0,r.kt)(d,(0,a.Z)({},m,t,{components:n,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,r.kt)("p",null,"Django is a template engine create by ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/flosch/pongo2"},"flosch"),", to see the original syntax documentation please ",(0,r.kt)("a",{parentName:"p",href:"https://docs.djangoproject.com/en/dev/topics/templates/"},"click here")),(0,r.kt)("h3",{id:"basic-example"},"Basic Example"),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/index.django"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},'{% include "partials/header.django" %}\n\n

{{ Title }}

\n\n{% include "partials/footer.django" %}\n')),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/partials/header.django"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

Header

\n")),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/partials/footer.django"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

Footer

\n")),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/layouts/main.django"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"\n\n\n\n Main\n\n\n\n {{embed}}\n\n\n\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/django/v3"\n)\n\nfunc main() {\n // Create a new engine\n engine := django.New("./views", ".django")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := html.NewFileSystem(http.Dir("./views", ".django"))\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')),(0,r.kt)("h3",{id:"using-embedded-file-system-116-only"},"Using embedded file system (1.16+ only)"),(0,r.kt)("p",null,"When using the ",(0,r.kt)("inlineCode",{parentName:"p"},"// go:embed")," directive, resolution of inherited templates using django's ",(0,r.kt)("inlineCode",{parentName:"p"},"{% extend '' %}")," keyword fails when instantiating the template engine with ",(0,r.kt)("inlineCode",{parentName:"p"},"django.NewFileSystem()"),". In that case, use the ",(0,r.kt)("inlineCode",{parentName:"p"},"django.NewPathForwardingFileSystem()")," function to instantiate the template engine. "),(0,r.kt)("p",null,"This function provides the proper configuration for resolving inherited templates."),(0,r.kt)("p",null,"Assume you have the following files:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/blob/master/django/views/ancestor.django"},"views/ancenstor.django")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"https://github.com/gofiber/template/blob/master/django/views/descendant.django"},"views/descendant.djando"))),(0,r.kt)("p",null,"then"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n "embed"\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/django/v3"\n)\n\n//go:embed views\nvar viewsAsssets embed.FS\n\nfunc main() {\n // Create a new engine\n engine := NewPathForwardingFileSystem(http.FS(viewsAsssets), "/views", ".django")\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render descendant\n return c.Render("descendant", fiber.Map{\n "greeting": "World",\n })\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')),(0,r.kt)("h3",{id:"register-and-use-custom-functions"},"Register and use custom functions"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// My custom function\nfunc Nl2brHtml(value interface{}) string {\n if str, ok := value.(string); ok {\n return strings.Replace(str, "\\n", "
", -1)\n }\n return ""\n}\n\n// Create a new engine\nengine := django.New("./views", ".django")\n\n// register functions\nengine.AddFunc("nl2br", Nl2brHtml)\n\n// Pass the engine to the Views\napp := fiber.New(fiber.Config{Views: engine})\n')),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"in the handler"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'c.Render("index", fiber.Map{\n "Fiber": "Hello, World!\\n\\nGreetings from Fiber Team",\n})\n')),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/index.django"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},'\n\n\n\n{{ nl2br(Fiber) }}\n\n\n')),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Output:")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},'\n\n\n\nHello, World!

Greetings from Fiber Team\n\n\n')))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/7d7ae710.bd143ddc.js b/assets/js/7d7ae710.c0f1b419.js similarity index 99% rename from assets/js/7d7ae710.bd143ddc.js rename to assets/js/7d7ae710.c0f1b419.js index 983ff9aaf63..512deed08bb 100644 --- a/assets/js/7d7ae710.bd143ddc.js +++ b/assets/js/7d7ae710.c0f1b419.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2042],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>b});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),u=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},p=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},c="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},g=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),c=u(a),g=r,b=c["".concat(s,".").concat(g)]||c[g]||f[g]||o;return a?n.createElement(b,l(l({ref:t},p),{},{components:a})):n.createElement(b,l({ref:t},p))}));function b(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=a.length,l=new Array(o);l[0]=g;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[c]="string"==typeof e?e:r,l[1]=i;for(var u=2;u{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>f,frontMatter:()=>o,metadata:()=>i,toc:()=>u});var n=a(7462),r=(a(7294),a(3905));const o={id:"bbolt",title:"Bbolt"},l=void 0,i={unversionedId:"bbolt/bbolt",id:"bbolt/bbolt",title:"Bbolt",description:"Release",source:"@site/docs/storage/bbolt/README.md",sourceDirName:"bbolt",slug:"/bbolt/",permalink:"/storage/bbolt/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/bbolt/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"bbolt",title:"Bbolt"},sidebar:"tutorialSidebar",previous:{title:"Badger",permalink:"/storage/badger/"},next:{title:"Couchbase",permalink:"/storage/couchbase/"}},s={},u=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],p={toc:u},c="wrapper";function f(e){let{components:t,...a}=e;return(0,r.kt)(c,(0,n.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=bbolt*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-bbolt.yml?label=Tests",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,r.kt)("p",null,"A Bbolt storage driver using ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/etcd-io/bbolt"},"etcd-io/bbolt"),". Bolt is a pure Go key/value store inspired by ",(0,r.kt)("a",{parentName:"p",href:"https://twitter.com/hyc_symas"},"Howard Chu's")," ",(0,r.kt)("a",{parentName:"p",href:"https://www.symas.com/symas-embedded-database-lmdb"},"LMDB project"),". The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL."),(0,r.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,r.kt)("h3",{id:"signatures"},"Signatures"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *bbolt.DB\n")),(0,r.kt)("h3",{id:"installation"},"Installation"),(0,r.kt)("p",null,"Bbolt is tested on the 2 last ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,r.kt)("p",null,"And then install the s3 implementation:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/bbolt\n")),(0,r.kt)("h3",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Import the storage package."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/bbolt"\n')),(0,r.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := bbolt.New()\n\n// Initialize custom config\nstore := bbolt.New(bbolt.Config{\n Database: "my_database.db",\n Bucket: "my-bucket",\n Reset: false,\n})\n')),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for storage.\ntype Config struct {\n // Database path\n //\n // Optional. Default is "fiber.db"\n Database string\n\n // Bbolt bucket name\n //\n // Optional. Default is "fiber_storage"\n Bucket string\n\n // Timeout is the amount of time to wait to obtain a file lock.\n // Only available on Darwin and Linux.\n //\n // Optional. Default is 60 * time.Second.\n Timeout time.Duration\n\n // Open database in read-only mode.\n //\n // Optional. Default is false\n ReadOnly bool\n\n // Reset clears any existing keys in existing Bucket\n //\n // Optional. Default is false\n Reset bool\n}\n')),(0,r.kt)("h3",{id:"default-config"},"Default Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// ConfigDefault is the default config\nvar ConfigDefault = Config{\n Database: "fiber.db",\n Bucket: "fiber_storage",\n Timeout: 60 * time.Second,\n ReadOnly: false,\n Reset: false,\n}\n')))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2042],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>b});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),u=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},p=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},c="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},g=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),c=u(a),g=r,b=c["".concat(s,".").concat(g)]||c[g]||f[g]||o;return a?n.createElement(b,l(l({ref:t},p),{},{components:a})):n.createElement(b,l({ref:t},p))}));function b(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=a.length,l=new Array(o);l[0]=g;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[c]="string"==typeof e?e:r,l[1]=i;for(var u=2;u{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>f,frontMatter:()=>o,metadata:()=>i,toc:()=>u});var n=a(7462),r=(a(7294),a(3905));const o={id:"bbolt",title:"Bbolt"},l=void 0,i={unversionedId:"bbolt/bbolt",id:"bbolt/bbolt",title:"Bbolt",description:"Release",source:"@site/docs/storage/bbolt/README.md",sourceDirName:"bbolt",slug:"/bbolt/",permalink:"/storage/bbolt/",draft:!1,editUrl:"https://github.com/gofiber/storage/edit/main/bbolt/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"bbolt",title:"Bbolt"},sidebar:"tutorialSidebar",previous:{title:"Badger",permalink:"/storage/badger/"},next:{title:"Couchbase",permalink:"/storage/couchbase/"}},s={},u=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Installation",id:"installation",level:3},{value:"Examples",id:"examples",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config",level:3}],p={toc:u},c="wrapper";function f(e){let{components:t,...a}=e;return(0,r.kt)(c,(0,n.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/storage?filter=bbolt*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-bbolt.yml?label=Tests",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter",alt:"Linter"})),(0,r.kt)("p",null,"A Bbolt storage driver using ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/etcd-io/bbolt"},"etcd-io/bbolt"),". Bolt is a pure Go key/value store inspired by ",(0,r.kt)("a",{parentName:"p",href:"https://twitter.com/hyc_symas"},"Howard Chu's")," ",(0,r.kt)("a",{parentName:"p",href:"https://www.symas.com/symas-embedded-database-lmdb"},"LMDB project"),". The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL."),(0,r.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#installation"},"Installation")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#examples"},"Examples")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#config"},"Config")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"#default-config"},"Default Config"))),(0,r.kt)("h3",{id:"signatures"},"Signatures"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) Storage\nfunc (s *Storage) Get(key string) ([]byte, error)\nfunc (s *Storage) Set(key string, val []byte, exp time.Duration) error\nfunc (s *Storage) Delete(key string) error\nfunc (s *Storage) Reset() error\nfunc (s *Storage) Close() error\nfunc (s *Storage) Conn() *bbolt.DB\n")),(0,r.kt)("h3",{id:"installation"},"Installation"),(0,r.kt)("p",null,"Bbolt is tested on the 2 last ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/dl/"},"Go versions")," with support for modules. So make sure to initialize one first if you didn't do that yet:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go mod init github.com//\n")),(0,r.kt)("p",null,"And then install the s3 implementation:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go get github.com/gofiber/storage/bbolt\n")),(0,r.kt)("h3",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Import the storage package."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'import "github.com/gofiber/storage/bbolt"\n')),(0,r.kt)("p",null,"You can use the following possibilities to create a storage:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\nstore := bbolt.New()\n\n// Initialize custom config\nstore := bbolt.New(bbolt.Config{\n Database: "my_database.db",\n Bucket: "my-bucket",\n Reset: false,\n})\n')),(0,r.kt)("h3",{id:"config"},"Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for storage.\ntype Config struct {\n // Database path\n //\n // Optional. Default is "fiber.db"\n Database string\n\n // Bbolt bucket name\n //\n // Optional. Default is "fiber_storage"\n Bucket string\n\n // Timeout is the amount of time to wait to obtain a file lock.\n // Only available on Darwin and Linux.\n //\n // Optional. Default is 60 * time.Second.\n Timeout time.Duration\n\n // Open database in read-only mode.\n //\n // Optional. Default is false\n ReadOnly bool\n\n // Reset clears any existing keys in existing Bucket\n //\n // Optional. Default is false\n Reset bool\n}\n')),(0,r.kt)("h3",{id:"default-config"},"Default Config"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// ConfigDefault is the default config\nvar ConfigDefault = Config{\n Database: "fiber.db",\n Bucket: "fiber_storage",\n Timeout: 60 * time.Second,\n ReadOnly: false,\n Reset: false,\n}\n')))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/7e307fec.497beffe.js b/assets/js/7e307fec.f9da0633.js similarity index 99% rename from assets/js/7e307fec.497beffe.js rename to assets/js/7e307fec.f9da0633.js index 0d3bf188e56..4730eaf759e 100644 --- a/assets/js/7e307fec.497beffe.js +++ b/assets/js/7e307fec.f9da0633.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6453],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>f});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=u(n),m=i,f=p["".concat(l,".").concat(m)]||p[m]||c[m]||a;return n?r.createElement(f,o(o({ref:t},d),{},{components:n})):r.createElement(f,o({ref:t},d))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:i,o[1]=s;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>c,frontMatter:()=>a,metadata:()=>s,toc:()=>u});var r=n(7462),i=(n(7294),n(3905));const a={id:"limiter",title:"Limiter"},o=void 0,s={unversionedId:"api/middleware/limiter",id:"version-v2.x/api/middleware/limiter",title:"Limiter",description:"Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled.",source:"@site/versioned_docs/version-v2.x/api/middleware/limiter.md",sourceDirName:"api/middleware",slug:"/api/middleware/limiter",permalink:"/api/middleware/limiter",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"limiter",title:"Limiter"},sidebar:"tutorialSidebar",previous:{title:"Keyauth",permalink:"/api/middleware/keyauth"},next:{title:"Logger",permalink:"/api/middleware/logger"}},l={},u=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Sliding window",id:"sliding-window",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Custom Storage/Database",id:"custom-storagedatabase",level:3}],d={toc:u},p="wrapper";function c(e){let{components:t,...n}=e;return(0,i.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Limiter middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This middleware uses our ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage"},"Storage")," package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This module does not share state with other processes/servers by default.")),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/limiter"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(limiter.New())\n\n// Or extend your config for customization\napp.Use(limiter.New(limiter.Config{\n Next: func(c *fiber.Ctx) bool {\n return c.IP() == "127.0.0.1"\n },\n Max: 20,\n Expiration: 30 * time.Second,\n KeyGenerator: func(c *fiber.Ctx) string {\n return c.Get("x-forwarded-for")\n },\n LimitReached: func(c *fiber.Ctx) error {\n return c.SendFile("./toofast.html")\n },\n Storage: myCustomStorage{},\n}))\n')),(0,i.kt)("h2",{id:"sliding-window"},"Sliding window"),(0,i.kt)("p",null,"Instead of using the standard fixed window algorithm, you can enable the ",(0,i.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Sliding_window_protocol"},"sliding window")," algorithm."),(0,i.kt)("p",null,"A example of such configuration is:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"app.Use(limiter.New(limiter.Config{\n Max: 20,\n Expiration: 30 * time.Second,\n LimiterMiddleware: limiter.SlidingWindow{},\n}))\n")),(0,i.kt)("p",null,"This means that every window will take into account the previous window(if there was any). The given formula for the rate is:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration)\nrate = weightOfPreviousWindpw + current window's amount request.\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Max number of recent connections during `Duration` seconds before sending a 429 response\n //\n // Default: 5\n Max int\n\n // KeyGenerator allows you to generate custom keys, by default c.IP() is used\n //\n // Default: func(c *fiber.Ctx) string {\n // return c.IP()\n // }\n KeyGenerator func(*fiber.Ctx) string\n\n // Expiration is the time on how long to keep records of requests in memory\n //\n // Default: 1 * time.Minute\n Expiration time.Duration\n\n // LimitReached is called when a request hits the limit\n //\n // Default: func(c *fiber.Ctx) error {\n // return c.SendStatus(fiber.StatusTooManyRequests)\n // }\n LimitReached fiber.Handler\n\n // When set to true, requests with StatusCode >= 400 won't be counted.\n //\n // Default: false\n SkipFailedRequests bool\n\n // When set to true, requests with StatusCode < 400 won't be counted.\n //\n // Default: false\n SkipSuccessfulRequests bool\n\n // Store is used to store the state of the middleware\n //\n // Default: an in memory store for this process only\n Storage fiber.Storage\n\n // LimiterMiddleware is the struct that implements limiter middleware.\n //\n // Default: a new Fixed Window Rate Limiter\n LimiterMiddleware LimiterHandler\n}\n")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"A custom store can be used if it implements the ",(0,i.kt)("inlineCode",{parentName:"p"},"Storage")," interface - more details and an example can be found in ",(0,i.kt)("inlineCode",{parentName:"p"},"store.go"),".")),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Max: 5,\n Expiration: 1 * time.Minute,\n KeyGenerator: func(c *fiber.Ctx) string {\n return c.IP()\n },\n LimitReached: func(c *fiber.Ctx) error {\n return c.SendStatus(fiber.StatusTooManyRequests)\n },\n SkipFailedRequests: false,\n SkipSuccessfulRequests: false,\n LimiterMiddleware: FixedWindow{},\n}\n")),(0,i.kt)("h3",{id:"custom-storagedatabase"},"Custom Storage/Database"),(0,i.kt)("p",null,"You can use any storage from our ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage/"},"storage")," package."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3\napp.Use(limiter.New(limiter.Config{\n Storage: storage,\n}))\n")))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6453],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>f});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=u(n),m=i,f=p["".concat(l,".").concat(m)]||p[m]||c[m]||a;return n?r.createElement(f,o(o({ref:t},d),{},{components:n})):r.createElement(f,o({ref:t},d))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:i,o[1]=s;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>c,frontMatter:()=>a,metadata:()=>s,toc:()=>u});var r=n(7462),i=(n(7294),n(3905));const a={id:"limiter",title:"Limiter"},o=void 0,s={unversionedId:"api/middleware/limiter",id:"version-v2.x/api/middleware/limiter",title:"Limiter",description:"Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled.",source:"@site/versioned_docs/version-v2.x/api/middleware/limiter.md",sourceDirName:"api/middleware",slug:"/api/middleware/limiter",permalink:"/api/middleware/limiter",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"limiter",title:"Limiter"},sidebar:"tutorialSidebar",previous:{title:"Keyauth",permalink:"/api/middleware/keyauth"},next:{title:"Logger",permalink:"/api/middleware/logger"}},l={},u=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Sliding window",id:"sliding-window",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Custom Storage/Database",id:"custom-storagedatabase",level:3}],d={toc:u},p="wrapper";function c(e){let{components:t,...n}=e;return(0,i.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Limiter middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This middleware uses our ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage"},"Storage")," package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This module does not share state with other processes/servers by default.")),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/limiter"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(limiter.New())\n\n// Or extend your config for customization\napp.Use(limiter.New(limiter.Config{\n Next: func(c *fiber.Ctx) bool {\n return c.IP() == "127.0.0.1"\n },\n Max: 20,\n Expiration: 30 * time.Second,\n KeyGenerator: func(c *fiber.Ctx) string {\n return c.Get("x-forwarded-for")\n },\n LimitReached: func(c *fiber.Ctx) error {\n return c.SendFile("./toofast.html")\n },\n Storage: myCustomStorage{},\n}))\n')),(0,i.kt)("h2",{id:"sliding-window"},"Sliding window"),(0,i.kt)("p",null,"Instead of using the standard fixed window algorithm, you can enable the ",(0,i.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Sliding_window_protocol"},"sliding window")," algorithm."),(0,i.kt)("p",null,"A example of such configuration is:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"app.Use(limiter.New(limiter.Config{\n Max: 20,\n Expiration: 30 * time.Second,\n LimiterMiddleware: limiter.SlidingWindow{},\n}))\n")),(0,i.kt)("p",null,"This means that every window will take into account the previous window(if there was any). The given formula for the rate is:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration)\nrate = weightOfPreviousWindpw + current window's amount request.\n")),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Max number of recent connections during `Duration` seconds before sending a 429 response\n //\n // Default: 5\n Max int\n\n // KeyGenerator allows you to generate custom keys, by default c.IP() is used\n //\n // Default: func(c *fiber.Ctx) string {\n // return c.IP()\n // }\n KeyGenerator func(*fiber.Ctx) string\n\n // Expiration is the time on how long to keep records of requests in memory\n //\n // Default: 1 * time.Minute\n Expiration time.Duration\n\n // LimitReached is called when a request hits the limit\n //\n // Default: func(c *fiber.Ctx) error {\n // return c.SendStatus(fiber.StatusTooManyRequests)\n // }\n LimitReached fiber.Handler\n\n // When set to true, requests with StatusCode >= 400 won't be counted.\n //\n // Default: false\n SkipFailedRequests bool\n\n // When set to true, requests with StatusCode < 400 won't be counted.\n //\n // Default: false\n SkipSuccessfulRequests bool\n\n // Store is used to store the state of the middleware\n //\n // Default: an in memory store for this process only\n Storage fiber.Storage\n\n // LimiterMiddleware is the struct that implements limiter middleware.\n //\n // Default: a new Fixed Window Rate Limiter\n LimiterMiddleware LimiterHandler\n}\n")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"A custom store can be used if it implements the ",(0,i.kt)("inlineCode",{parentName:"p"},"Storage")," interface - more details and an example can be found in ",(0,i.kt)("inlineCode",{parentName:"p"},"store.go"),".")),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"var ConfigDefault = Config{\n Max: 5,\n Expiration: 1 * time.Minute,\n KeyGenerator: func(c *fiber.Ctx) string {\n return c.IP()\n },\n LimitReached: func(c *fiber.Ctx) error {\n return c.SendStatus(fiber.StatusTooManyRequests)\n },\n SkipFailedRequests: false,\n SkipSuccessfulRequests: false,\n LimiterMiddleware: FixedWindow{},\n}\n")),(0,i.kt)("h3",{id:"custom-storagedatabase"},"Custom Storage/Database"),(0,i.kt)("p",null,"You can use any storage from our ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/storage/"},"storage")," package."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3\napp.Use(limiter.New(limiter.Config{\n Storage: storage,\n}))\n")))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/7e6c0027.fa2c31c1.js b/assets/js/7e6c0027.983f41fe.js similarity index 99% rename from assets/js/7e6c0027.fa2c31c1.js rename to assets/js/7e6c0027.983f41fe.js index 5604928ef02..cdc877d4e0c 100644 --- a/assets/js/7e6c0027.fa2c31c1.js +++ b/assets/js/7e6c0027.983f41fe.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[628],{3905:(t,e,r)=>{r.d(e,{Zo:()=>b,kt:()=>u});var i=r(7294);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t){for(var e=1;e=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var l=i.createContext({}),c=function(t){var e=i.useContext(l),r=e;return t&&(r="function"==typeof t?t(e):n(n({},e),t)),r},b=function(t){var e=c(t.components);return i.createElement(l.Provider,{value:e},t.children)},m="mdxType",f={inlineCode:"code",wrapper:function(t){var e=t.children;return i.createElement(i.Fragment,{},e)}},p=i.forwardRef((function(t,e){var r=t.components,o=t.mdxType,a=t.originalType,l=t.parentName,b=s(t,["components","mdxType","originalType","parentName"]),m=c(r),p=o,u=m["".concat(l,".").concat(p)]||m[p]||f[p]||a;return r?i.createElement(u,n(n({ref:e},b),{},{components:r})):i.createElement(u,n({ref:e},b))}));function u(t,e){var r=arguments,o=e&&e.mdxType;if("string"==typeof t||o){var a=r.length,n=new Array(a);n[0]=p;var s={};for(var l in e)hasOwnProperty.call(e,l)&&(s[l]=e[l]);s.originalType=t,s[m]="string"==typeof t?t:o,n[1]=s;for(var c=2;c{r.r(e),r.d(e,{assets:()=>l,contentTitle:()=>n,default:()=>f,frontMatter:()=>a,metadata:()=>s,toc:()=>c});var i=r(7462),o=(r(7294),r(3905));const a={title:"\ud83d\udc4b Welcome",sidebar_position:1},n=void 0,s={unversionedId:"README",id:"README",title:"\ud83d\udc4b Welcome",description:"Discord",source:"@site/docs/contrib/README.md",sourceDirName:".",slug:"/",permalink:"/contrib/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{title:"\ud83d\udc4b Welcome",sidebar_position:1},sidebar:"tutorialSidebar",next:{title:"Casbin",permalink:"/contrib/casbin/"}},l={},c=[{value:"\ud83d\udcd1 Middleware Implementations",id:"-middleware-implementations",level:2}],b={toc:c},m="wrapper";function f(t){let{components:e,...r}=t;return(0,o.kt)(m,(0,i.Z)({},b,r,{components:e,mdxType:"MDXLayout"}),(0,o.kt)("p",{align:"center"},(0,o.kt)("picture",null,(0,o.kt)("source",{height:"125",media:"(prefers-color-scheme: dark)",srcset:"https://raw.githubusercontent.com/gofiber/contrib/master/.github/logo-dark.svg"}),(0,o.kt)("img",{height:"125",alt:"Fiber",src:"https://raw.githubusercontent.com/gofiber/contrib/master/.github/logo.svg"})),(0,o.kt)("br",null),(0,o.kt)("h1",{id:"contrib"},"Contrib"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,o.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,o.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,o.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,o.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,o.kt)("p",null,"Repository for third party middlewares with dependencies.")),(0,o.kt)("h2",{id:"-middleware-implementations"},"\ud83d\udcd1 Middleware Implementations"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/casbin/"},"Casbin")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/fiberi18n/"},"Fiberi18n")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/fibersentry/"},"Fibersentry")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/fiberzap/"},"Fiberzap")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/fiberzerolog/"},"Fiberzerolog")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/jwt/"},"JWT")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/fibernewrelic/"},"NewRelic")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/opafiber/"},"Open Policy Agent")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/otelfiber/"},"Otelfiber (OpenTelemetry)")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/paseto/"},"Paseto")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/swagger/"},"Swagger")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/websocket/"},"Websocket")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," "))))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[628],{3905:(t,e,r)=>{r.d(e,{Zo:()=>b,kt:()=>u});var i=r(7294);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t){for(var e=1;e=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var l=i.createContext({}),c=function(t){var e=i.useContext(l),r=e;return t&&(r="function"==typeof t?t(e):n(n({},e),t)),r},b=function(t){var e=c(t.components);return i.createElement(l.Provider,{value:e},t.children)},m="mdxType",f={inlineCode:"code",wrapper:function(t){var e=t.children;return i.createElement(i.Fragment,{},e)}},p=i.forwardRef((function(t,e){var r=t.components,o=t.mdxType,a=t.originalType,l=t.parentName,b=s(t,["components","mdxType","originalType","parentName"]),m=c(r),p=o,u=m["".concat(l,".").concat(p)]||m[p]||f[p]||a;return r?i.createElement(u,n(n({ref:e},b),{},{components:r})):i.createElement(u,n({ref:e},b))}));function u(t,e){var r=arguments,o=e&&e.mdxType;if("string"==typeof t||o){var a=r.length,n=new Array(a);n[0]=p;var s={};for(var l in e)hasOwnProperty.call(e,l)&&(s[l]=e[l]);s.originalType=t,s[m]="string"==typeof t?t:o,n[1]=s;for(var c=2;c{r.r(e),r.d(e,{assets:()=>l,contentTitle:()=>n,default:()=>f,frontMatter:()=>a,metadata:()=>s,toc:()=>c});var i=r(7462),o=(r(7294),r(3905));const a={title:"\ud83d\udc4b Welcome",sidebar_position:1},n=void 0,s={unversionedId:"README",id:"README",title:"\ud83d\udc4b Welcome",description:"Discord",source:"@site/docs/contrib/README.md",sourceDirName:".",slug:"/",permalink:"/contrib/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{title:"\ud83d\udc4b Welcome",sidebar_position:1},sidebar:"tutorialSidebar",next:{title:"Casbin",permalink:"/contrib/casbin/"}},l={},c=[{value:"\ud83d\udcd1 Middleware Implementations",id:"-middleware-implementations",level:2}],b={toc:c},m="wrapper";function f(t){let{components:e,...r}=t;return(0,o.kt)(m,(0,i.Z)({},b,r,{components:e,mdxType:"MDXLayout"}),(0,o.kt)("p",{align:"center"},(0,o.kt)("picture",null,(0,o.kt)("source",{height:"125",media:"(prefers-color-scheme: dark)",srcset:"https://raw.githubusercontent.com/gofiber/contrib/master/.github/logo-dark.svg"}),(0,o.kt)("img",{height:"125",alt:"Fiber",src:"https://raw.githubusercontent.com/gofiber/contrib/master/.github/logo.svg"})),(0,o.kt)("br",null),(0,o.kt)("h1",{id:"contrib"},"Contrib"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,o.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,o.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,o.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,o.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,o.kt)("p",null,"Repository for third party middlewares with dependencies.")),(0,o.kt)("h2",{id:"-middleware-implementations"},"\ud83d\udcd1 Middleware Implementations"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/casbin/"},"Casbin")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/fiberi18n/"},"Fiberi18n")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/fibersentry/"},"Fibersentry")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/fiberzap/"},"Fiberzap")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/fiberzerolog/"},"Fiberzerolog")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/jwt/"},"JWT")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/fibernewrelic/"},"NewRelic")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/opafiber/"},"Open Policy Agent")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/otelfiber/"},"Otelfiber (OpenTelemetry)")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/paseto/"},"Paseto")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/swagger/"},"Swagger")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," ")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/contrib/websocket/"},"Websocket")," ",(0,o.kt)("a",{href:"https://github.com/gofiber/contrib/actions?query=workflow%3A%22Tests%22"}," ",(0,o.kt)("img",{src:"https://img.shields.io/github/actions/workflow/status/gofiber/contrib/test.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"})," "))))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/8231ac58.07c9ac1e.js b/assets/js/8231ac58.86f07421.js similarity index 99% rename from assets/js/8231ac58.07c9ac1e.js rename to assets/js/8231ac58.86f07421.js index 923f629bcd9..de924e35e62 100644 --- a/assets/js/8231ac58.07c9ac1e.js +++ b/assets/js/8231ac58.86f07421.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[3197],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>g});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},u=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},d="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},v=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),d=s(r),v=a,g=d["".concat(l,".").concat(v)]||d[v]||c[v]||i;return r?n.createElement(g,o(o({ref:t},u),{},{components:r})):n.createElement(g,o({ref:t},u))}));function g(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=v;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p[d]="string"==typeof e?e:a,o[1]=p;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>c,frontMatter:()=>i,metadata:()=>p,toc:()=>s});var n=r(7462),a=(r(7294),r(3905));const i={id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},o=void 0,p={unversionedId:"guide/grouping",id:"version-v2.x/guide/grouping",title:"\ud83c\udfad Grouping",description:"In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.",source:"@site/versioned_docs/version-v2.x/guide/grouping.md",sourceDirName:"guide",slug:"/guide/grouping",permalink:"/guide/grouping",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:2,frontMatter:{id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0c Routing",permalink:"/guide/routing"},next:{title:"\ud83d\udcdd Templates",permalink:"/guide/templates"}},l={},s=[{value:"Paths",id:"paths",level:2},{value:"Group Handlers",id:"group-handlers",level:2}],u={toc:s},d="wrapper";function c(e){let{components:t,...r}=e;return(0,a.kt)(d,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.")),(0,a.kt)("h2",{id:"paths"},"Paths"),(0,a.kt)("p",null,"Like ",(0,a.kt)("strong",{parentName:"p"},"Routing"),", groups can also have paths that belong to a cluster."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", middleware) // /api\n\n v1 := api.Group("/v1", middleware) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", middleware) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("p",null,"A ",(0,a.kt)("strong",{parentName:"p"},"Group")," of paths can have an optional handler."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1") // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2") // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"Running ",(0,a.kt)("strong",{parentName:"p"},"/api"),", ",(0,a.kt)("strong",{parentName:"p"},"/v1")," or ",(0,a.kt)("strong",{parentName:"p"},"/v2")," will result in ",(0,a.kt)("strong",{parentName:"p"},"404")," error, make sure you have the errors set.")),(0,a.kt)("h2",{id:"group-handlers"},"Group Handlers"),(0,a.kt)("p",null,"Group handlers can also be used as a routing path but they must have ",(0,a.kt)("strong",{parentName:"p"},"Next")," added to them so that the flow can continue."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n handler := func(c *fiber.Ctx) error {\n return c.SendStatus(fiber.StatusOK)\n }\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1", func(c *fiber.Ctx) error { // middleware for /api/v1\n c.Set("Version", "v1")\n return c.Next()\n })\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[3197],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>g});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},u=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},d="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},v=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),d=s(r),v=a,g=d["".concat(l,".").concat(v)]||d[v]||c[v]||i;return r?n.createElement(g,o(o({ref:t},u),{},{components:r})):n.createElement(g,o({ref:t},u))}));function g(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=v;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p[d]="string"==typeof e?e:a,o[1]=p;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>c,frontMatter:()=>i,metadata:()=>p,toc:()=>s});var n=r(7462),a=(r(7294),r(3905));const i={id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},o=void 0,p={unversionedId:"guide/grouping",id:"version-v2.x/guide/grouping",title:"\ud83c\udfad Grouping",description:"In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.",source:"@site/versioned_docs/version-v2.x/guide/grouping.md",sourceDirName:"guide",slug:"/guide/grouping",permalink:"/guide/grouping",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:2,frontMatter:{id:"grouping",title:"\ud83c\udfad Grouping",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0c Routing",permalink:"/guide/routing"},next:{title:"\ud83d\udcdd Templates",permalink:"/guide/templates"}},l={},s=[{value:"Paths",id:"paths",level:2},{value:"Group Handlers",id:"group-handlers",level:2}],u={toc:s},d="wrapper";function c(e){let{components:t,...r}=e;return(0,a.kt)(d,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.")),(0,a.kt)("h2",{id:"paths"},"Paths"),(0,a.kt)("p",null,"Like ",(0,a.kt)("strong",{parentName:"p"},"Routing"),", groups can also have paths that belong to a cluster."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api", middleware) // /api\n\n v1 := api.Group("/v1", middleware) // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2", middleware) // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("p",null,"A ",(0,a.kt)("strong",{parentName:"p"},"Group")," of paths can have an optional handler."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1") // /api/v1\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n v2 := api.Group("/v2") // /api/v2\n v2.Get("/list", handler) // /api/v2/list\n v2.Get("/user", handler) // /api/v2/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,a.kt)("admonition",{type:"caution"},(0,a.kt)("p",{parentName:"admonition"},"Running ",(0,a.kt)("strong",{parentName:"p"},"/api"),", ",(0,a.kt)("strong",{parentName:"p"},"/v1")," or ",(0,a.kt)("strong",{parentName:"p"},"/v2")," will result in ",(0,a.kt)("strong",{parentName:"p"},"404")," error, make sure you have the errors set.")),(0,a.kt)("h2",{id:"group-handlers"},"Group Handlers"),(0,a.kt)("p",null,"Group handlers can also be used as a routing path but they must have ",(0,a.kt)("strong",{parentName:"p"},"Next")," added to them so that the flow can continue."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'func main() {\n app := fiber.New()\n\n handler := func(c *fiber.Ctx) error {\n return c.SendStatus(fiber.StatusOK)\n }\n api := app.Group("/api") // /api\n\n v1 := api.Group("/v1", func(c *fiber.Ctx) error { // middleware for /api/v1\n c.Set("Version", "v1")\n return c.Next()\n })\n v1.Get("/list", handler) // /api/v1/list\n v1.Get("/user", handler) // /api/v1/user\n\n log.Fatal(app.Listen(":3000"))\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/82a52177.8927f077.js b/assets/js/82a52177.5bdcae65.js similarity index 99% rename from assets/js/82a52177.8927f077.js rename to assets/js/82a52177.5bdcae65.js index 71cc18b38e6..376cd7ab3aa 100644 --- a/assets/js/82a52177.8927f077.js +++ b/assets/js/82a52177.5bdcae65.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2331],{3905:(e,r,t)=>{t.d(r,{Zo:()=>c,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=n.createContext({}),u=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):l(l({},r),e)),t},c=function(e){var r=u(e.components);return n.createElement(s.Provider,{value:r},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),d=u(t),f=a,m=d["".concat(s,".").concat(f)]||d[f]||p[f]||o;return t?n.createElement(m,l(l({ref:r},c),{},{components:t})):n.createElement(m,l({ref:r},c))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var o=t.length,l=new Array(o);l[0]=f;var i={};for(var s in r)hasOwnProperty.call(r,s)&&(i[s]=r[s]);i.originalType=e,i[d]="string"==typeof e?e:a,l[1]=i;for(var u=2;u{t.d(r,{Z:()=>l});var n=t(7294),a=t(6010);const o={tabItem:"tabItem_Ymn6"};function l(e){let{children:r,hidden:t,className:l}=e;return n.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,l),hidden:t},r)}},4866:(e,r,t)=>{t.d(r,{Z:()=>E});var n=t(7462),a=t(7294),o=t(6010),l=t(2466),i=t(6550),s=t(1980),u=t(7392),c=t(12);function d(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:r,label:t,attributes:n,default:a}}=e;return{value:r,label:t,attributes:n,default:a}}))}function p(e){const{values:r,children:t}=e;return(0,a.useMemo)((()=>{const e=r??d(t);return function(e){const r=(0,u.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,t])}function f(e){let{value:r,tabValues:t}=e;return t.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:t}=e;const n=(0,i.k6)(),o=function(e){let{queryString:r=!1,groupId:t}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:r,groupId:t});return[(0,s._X)(o),(0,a.useCallback)((e=>{if(!o)return;const r=new URLSearchParams(n.location.search);r.set(o,e),n.replace({...n.location,search:r.toString()})}),[o,n])]}function h(e){const{defaultValue:r,queryString:t=!1,groupId:n}=e,o=p(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:r,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!f({value:r,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const n=t.find((e=>e.default))??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:r,tabValues:o}))),[s,u]=m({queryString:t,groupId:n}),[d,h]=function(e){let{groupId:r}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(r),[n,o]=(0,c.Nk)(t);return[n,(0,a.useCallback)((e=>{t&&o.set(e)}),[t,o])]}({groupId:n}),b=(()=>{const e=s??d;return f({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!f({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),h(e)}),[u,h,o]),tabValues:o}}var b=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function v(e){let{className:r,block:t,selectedValue:i,selectValue:s,tabValues:u}=e;const c=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.o5)(),p=e=>{const r=e.currentTarget,t=c.indexOf(r),n=u[t].value;n!==i&&(d(r),s(n))},f=e=>{let r=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const t=c.indexOf(e.currentTarget)+1;r=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(e.currentTarget)-1;r=c[t]??c[c.length-1];break}}r?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},r)},u.map((e=>{let{value:r,label:t,attributes:l}=e;return a.createElement("li",(0,n.Z)({role:"tab",tabIndex:i===r?0:-1,"aria-selected":i===r,key:r,ref:e=>c.push(e),onKeyDown:f,onClick:p},l,{className:(0,o.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":i===r})}),t??r)})))}function y(e){let{lazy:r,children:t,selectedValue:n}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(r){const e=o.find((e=>e.props.value===n));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,r)=>(0,a.cloneElement)(e,{key:r,hidden:e.props.value!==n}))))}function k(e){const r=h(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",g.tabList)},a.createElement(v,(0,n.Z)({},e,r)),a.createElement(y,(0,n.Z)({},e,r)))}function E(e){const r=(0,b.Z)();return a.createElement(k,(0,n.Z)({key:String(r)},e))}},5943:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>s,default:()=>m,frontMatter:()=>i,metadata:()=>u,toc:()=>d});var n=t(7462),a=(t(7294),t(3905)),o=t(4866),l=t(5162);const i={id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:5},s=void 0,u={unversionedId:"guide/error-handling",id:"version-v1.x/guide/error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",source:"@site/versioned_docs/version-v1.x/guide/error-handling.md",sourceDirName:"guide",slug:"/guide/error-handling",permalink:"/v1.x/guide/error-handling",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:5,frontMatter:{id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0e Validating",permalink:"/v1.x/guide/validating"},next:{title:"Misc",permalink:"/v1.x/category/misc"}},c={},d=[{value:"Catching Errors",id:"catching-errors",level:2},{value:"Default Error Handler",id:"default-error-handler",level:2},{value:"Custom Error Handler",id:"custom-error-handler",level:2}],p={toc:d},f="wrapper";function m(e){let{components:r,...t}=e;return(0,a.kt)(f,(0,n.Z)({},p,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"catching-errors"},"Catching Errors"),(0,a.kt)("p",null,"It\u2019s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them."),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(l.Z,{value:"example",label:"Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/", func(c *fiber.Ctx) {\n err := c.SendFile("file-does-not-exist")\n\n if err != nil {\n c.Next(err) // Pass error to Fiber\n }\n})\n')))),(0,a.kt)("p",null,"Fiber does not handle ",(0,a.kt)("a",{parentName:"p",href:"https://blog.golang.org/defer-panic-and-recover"},"panics")," by default. To recover from a panic thrown by any handler in the stack, you need to include the ",(0,a.kt)("inlineCode",{parentName:"p"},"Recover")," middleware below:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'package main\n\nimport (\n "github.com/gofiber/fiber"\n "github.com/gofiber/fiber/middleware"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(middleware.Recover())\n\n app.Get("/", func(c *fiber.Ctx) {\n panic("This panic is catched by the ErrorHandler")\n })\n\n log.Fatal(app.Listen(3000))\n}\n')),(0,a.kt)("p",null,"Because ",(0,a.kt)("inlineCode",{parentName:"p"},"ctx.Next()")," accepts an ",(0,a.kt)("inlineCode",{parentName:"p"},"error")," interface, you could use Fiber's custom error struct to pass an additional ",(0,a.kt)("inlineCode",{parentName:"p"},"status code")," using ",(0,a.kt)("inlineCode",{parentName:"p"},"fiber.NewError()"),". It's optional to pass a message; if this is left empty, it will default to the status code message ","(",(0,a.kt)("inlineCode",{parentName:"p"},"404")," equals ",(0,a.kt)("inlineCode",{parentName:"p"},"Not Found"),")","."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) {\n err := fiber.NewError(503)\n c.Next(err) // 503 Service Unavailable\n\n err := fiber.NewError(404, "Sorry, not found!")\n c.Next(err) // 404 Sorry, not found!\n})\n')),(0,a.kt)("h2",{id:"default-error-handler"},"Default Error Handler"),(0,a.kt)("p",null,"Fiber provides an error handler by default. For a standard error, the response is sent as ",(0,a.kt)("strong",{parentName:"p"},"500 Internal Server Error"),". If error is of type ",(0,a.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/gofiber/fiber#Error"},"fiber","*","Error"),", response is sent with the provided status code and message."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"// Default error handler\napp.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) {\n // Statuscode defaults to 500\n code := fiber.StatusInternalServerError\n\n // Check if it's an fiber.Error type\n if e, ok := err.(*fiber.Error); ok {\n code = e.Code\n }\n\n // Return HTTP response\n ctx.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)\n ctx.Status(code).SendString(err.Error())\n}\n")),(0,a.kt)("h2",{id:"custom-error-handler"},"Custom Error Handler"),(0,a.kt)("p",null,"A custom error handler can be set via ",(0,a.kt)("inlineCode",{parentName:"p"},"app.Settings.ErrorHandler")),(0,a.kt)("p",null,"In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response."),(0,a.kt)("p",null,"The following example shows how to display error pages for different types of errors."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app := fiber.New()\n\n// Custom error handler\napp.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) {\n // Statuscode defaults to 500\n code := fiber.StatusInternalServerError\n\n // Retrieve the custom statuscode if it\'s an fiber.*Error\n if e, ok := err.(*fiber.Error); ok {\n code = e.Code\n }\n\n // Send custom error page\n err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))\n if err != nil {\n ctx.Status(500).SendString("Internal Server Error")\n }\n}\n')),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},"Special thanks to the ",(0,a.kt)("a",{parentName:"p",href:"https://echo.labstack.com/"},"Echo")," & ",(0,a.kt)("a",{parentName:"p",href:"https://expressjs.com/"},"Express")," framework for inspiration regarding error handling.")))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2331],{3905:(e,r,t)=>{t.d(r,{Zo:()=>c,kt:()=>m});var n=t(7294);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=n.createContext({}),u=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):l(l({},r),e)),t},c=function(e){var r=u(e.components);return n.createElement(s.Provider,{value:r},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),d=u(t),f=a,m=d["".concat(s,".").concat(f)]||d[f]||p[f]||o;return t?n.createElement(m,l(l({ref:r},c),{},{components:t})):n.createElement(m,l({ref:r},c))}));function m(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var o=t.length,l=new Array(o);l[0]=f;var i={};for(var s in r)hasOwnProperty.call(r,s)&&(i[s]=r[s]);i.originalType=e,i[d]="string"==typeof e?e:a,l[1]=i;for(var u=2;u{t.d(r,{Z:()=>l});var n=t(7294),a=t(6010);const o={tabItem:"tabItem_Ymn6"};function l(e){let{children:r,hidden:t,className:l}=e;return n.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,l),hidden:t},r)}},4866:(e,r,t)=>{t.d(r,{Z:()=>E});var n=t(7462),a=t(7294),o=t(6010),l=t(2466),i=t(6550),s=t(1980),u=t(7392),c=t(12);function d(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:r,label:t,attributes:n,default:a}}=e;return{value:r,label:t,attributes:n,default:a}}))}function p(e){const{values:r,children:t}=e;return(0,a.useMemo)((()=>{const e=r??d(t);return function(e){const r=(0,u.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,t])}function f(e){let{value:r,tabValues:t}=e;return t.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:t}=e;const n=(0,i.k6)(),o=function(e){let{queryString:r=!1,groupId:t}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:r,groupId:t});return[(0,s._X)(o),(0,a.useCallback)((e=>{if(!o)return;const r=new URLSearchParams(n.location.search);r.set(o,e),n.replace({...n.location,search:r.toString()})}),[o,n])]}function h(e){const{defaultValue:r,queryString:t=!1,groupId:n}=e,o=p(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:r,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!f({value:r,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const n=t.find((e=>e.default))??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:r,tabValues:o}))),[s,u]=m({queryString:t,groupId:n}),[d,h]=function(e){let{groupId:r}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(r),[n,o]=(0,c.Nk)(t);return[n,(0,a.useCallback)((e=>{t&&o.set(e)}),[t,o])]}({groupId:n}),b=(()=>{const e=s??d;return f({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!f({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),h(e)}),[u,h,o]),tabValues:o}}var b=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function v(e){let{className:r,block:t,selectedValue:i,selectValue:s,tabValues:u}=e;const c=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.o5)(),p=e=>{const r=e.currentTarget,t=c.indexOf(r),n=u[t].value;n!==i&&(d(r),s(n))},f=e=>{let r=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const t=c.indexOf(e.currentTarget)+1;r=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(e.currentTarget)-1;r=c[t]??c[c.length-1];break}}r?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},r)},u.map((e=>{let{value:r,label:t,attributes:l}=e;return a.createElement("li",(0,n.Z)({role:"tab",tabIndex:i===r?0:-1,"aria-selected":i===r,key:r,ref:e=>c.push(e),onKeyDown:f,onClick:p},l,{className:(0,o.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":i===r})}),t??r)})))}function y(e){let{lazy:r,children:t,selectedValue:n}=e;const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(r){const e=o.find((e=>e.props.value===n));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,r)=>(0,a.cloneElement)(e,{key:r,hidden:e.props.value!==n}))))}function k(e){const r=h(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",g.tabList)},a.createElement(v,(0,n.Z)({},e,r)),a.createElement(y,(0,n.Z)({},e,r)))}function E(e){const r=(0,b.Z)();return a.createElement(k,(0,n.Z)({key:String(r)},e))}},5943:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>s,default:()=>m,frontMatter:()=>i,metadata:()=>u,toc:()=>d});var n=t(7462),a=(t(7294),t(3905)),o=t(4866),l=t(5162);const i={id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:5},s=void 0,u={unversionedId:"guide/error-handling",id:"version-v1.x/guide/error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",source:"@site/versioned_docs/version-v1.x/guide/error-handling.md",sourceDirName:"guide",slug:"/guide/error-handling",permalink:"/v1.x/guide/error-handling",draft:!1,tags:[],version:"v1.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:5,frontMatter:{id:"error-handling",title:"\ud83d\udc1b Error Handling",description:"Fiber supports centralized error handling by returning an error to the handler which allows you to log errors to external services or send a customized HTTP response to the client.",sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udd0e Validating",permalink:"/v1.x/guide/validating"},next:{title:"Misc",permalink:"/v1.x/category/misc"}},c={},d=[{value:"Catching Errors",id:"catching-errors",level:2},{value:"Default Error Handler",id:"default-error-handler",level:2},{value:"Custom Error Handler",id:"custom-error-handler",level:2}],p={toc:d},f="wrapper";function m(e){let{components:r,...t}=e;return(0,a.kt)(f,(0,n.Z)({},p,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"catching-errors"},"Catching Errors"),(0,a.kt)("p",null,"It\u2019s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them."),(0,a.kt)(o.Z,{mdxType:"Tabs"},(0,a.kt)(l.Z,{value:"example",label:"Example",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'app.Get("/", func(c *fiber.Ctx) {\n err := c.SendFile("file-does-not-exist")\n\n if err != nil {\n c.Next(err) // Pass error to Fiber\n }\n})\n')))),(0,a.kt)("p",null,"Fiber does not handle ",(0,a.kt)("a",{parentName:"p",href:"https://blog.golang.org/defer-panic-and-recover"},"panics")," by default. To recover from a panic thrown by any handler in the stack, you need to include the ",(0,a.kt)("inlineCode",{parentName:"p"},"Recover")," middleware below:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'package main\n\nimport (\n "github.com/gofiber/fiber"\n "github.com/gofiber/fiber/middleware"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(middleware.Recover())\n\n app.Get("/", func(c *fiber.Ctx) {\n panic("This panic is catched by the ErrorHandler")\n })\n\n log.Fatal(app.Listen(3000))\n}\n')),(0,a.kt)("p",null,"Because ",(0,a.kt)("inlineCode",{parentName:"p"},"ctx.Next()")," accepts an ",(0,a.kt)("inlineCode",{parentName:"p"},"error")," interface, you could use Fiber's custom error struct to pass an additional ",(0,a.kt)("inlineCode",{parentName:"p"},"status code")," using ",(0,a.kt)("inlineCode",{parentName:"p"},"fiber.NewError()"),". It's optional to pass a message; if this is left empty, it will default to the status code message ","(",(0,a.kt)("inlineCode",{parentName:"p"},"404")," equals ",(0,a.kt)("inlineCode",{parentName:"p"},"Not Found"),")","."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) {\n err := fiber.NewError(503)\n c.Next(err) // 503 Service Unavailable\n\n err := fiber.NewError(404, "Sorry, not found!")\n c.Next(err) // 404 Sorry, not found!\n})\n')),(0,a.kt)("h2",{id:"default-error-handler"},"Default Error Handler"),(0,a.kt)("p",null,"Fiber provides an error handler by default. For a standard error, the response is sent as ",(0,a.kt)("strong",{parentName:"p"},"500 Internal Server Error"),". If error is of type ",(0,a.kt)("a",{parentName:"p",href:"https://godoc.org/github.com/gofiber/fiber#Error"},"fiber","*","Error"),", response is sent with the provided status code and message."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"// Default error handler\napp.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) {\n // Statuscode defaults to 500\n code := fiber.StatusInternalServerError\n\n // Check if it's an fiber.Error type\n if e, ok := err.(*fiber.Error); ok {\n code = e.Code\n }\n\n // Return HTTP response\n ctx.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)\n ctx.Status(code).SendString(err.Error())\n}\n")),(0,a.kt)("h2",{id:"custom-error-handler"},"Custom Error Handler"),(0,a.kt)("p",null,"A custom error handler can be set via ",(0,a.kt)("inlineCode",{parentName:"p"},"app.Settings.ErrorHandler")),(0,a.kt)("p",null,"In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response."),(0,a.kt)("p",null,"The following example shows how to display error pages for different types of errors."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app := fiber.New()\n\n// Custom error handler\napp.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) {\n // Statuscode defaults to 500\n code := fiber.StatusInternalServerError\n\n // Retrieve the custom statuscode if it\'s an fiber.*Error\n if e, ok := err.(*fiber.Error); ok {\n code = e.Code\n }\n\n // Send custom error page\n err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))\n if err != nil {\n ctx.Status(500).SendString("Internal Server Error")\n }\n}\n')),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},"Special thanks to the ",(0,a.kt)("a",{parentName:"p",href:"https://echo.labstack.com/"},"Echo")," & ",(0,a.kt)("a",{parentName:"p",href:"https://expressjs.com/"},"Express")," framework for inspiration regarding error handling.")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/8498b8c7.dc6093a6.js b/assets/js/8498b8c7.bc49482e.js similarity index 99% rename from assets/js/8498b8c7.dc6093a6.js rename to assets/js/8498b8c7.bc49482e.js index 62b81314efa..d361a81d3cc 100644 --- a/assets/js/8498b8c7.dc6093a6.js +++ b/assets/js/8498b8c7.bc49482e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5363],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),g=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=g(e.components);return r.createElement(s.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},c=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),p=g(n),c=a,m=p["".concat(s,".").concat(c)]||p[c]||d[c]||o;return n?r.createElement(m,i(i({ref:t},u),{},{components:n})):r.createElement(m,i({ref:t},u))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=c;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:a,i[1]=l;for(var g=2;g{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>g});var r=n(7462),a=(n(7294),n(3905));const o={id:"logger",title:"Logger"},i=void 0,l={unversionedId:"api/middleware/logger",id:"api/middleware/logger",title:"Logger",description:"Logger middleware for Fiber that logs HTTP request/response details.",source:"@site/docs/core/api/middleware/logger.md",sourceDirName:"api/middleware",slug:"/api/middleware/logger",permalink:"/next/api/middleware/logger",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/logger.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"logger",title:"Logger"},sidebar:"tutorialSidebar",previous:{title:"Limiter",permalink:"/next/api/middleware/limiter"},next:{title:"Monitor",permalink:"/next/api/middleware/monitor"}},s={},g=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Constants",id:"constants",level:2}],u={toc:g},p="wrapper";function d(e){let{components:t,...n}=e;return(0,a.kt)(p,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Logger middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that logs HTTP request/response details."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/logger"\n)\n')),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"The order of registration plays a role. Only all routes that are registered after this one will be logged.\nThe middleware should therefore be one of the first to be registered.")),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(logger.New())\n\n// Or extend your config for customization\n// Logging remote IP and Port\napp.Use(logger.New(logger.Config{\n Format: "[${ip}]:${port} ${status} - ${method} ${path}\\n",\n}))\n\n// Logging Request ID\napp.Use(requestid.New())\napp.Use(logger.New(logger.Config{\n // For more options, see the Config section\n Format: "${pid} ${locals:requestid} ${status} - ${method} ${path}\u200b\\n",\n}))\n\n// Changing TimeZone & TimeFormat\napp.Use(logger.New(logger.Config{\n Format: "${pid} ${status} - ${method} ${path}\\n",\n TimeFormat: "02-Jan-2006",\n TimeZone: "America/New_York",\n}))\n\n// Custom File Writer\nfile, err := os.OpenFile("./123.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)\nif err != nil {\n log.Fatalf("error opening file: %v", err)\n}\ndefer file.Close()\napp.Use(logger.New(logger.Config{\n Output: file,\n}))\n\n// Add Custom Tags\napp.Use(logger.New(logger.Config{\n CustomTags: map[string]logger.LogFunc{\n "custom_tag": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) {\n return output.WriteString("it is a custom tag")\n },\n },\n}))\n\n// Callback after log is written\napp.Use(logger.New(logger.Config{\n TimeFormat: time.RFC3339Nano,\n TimeZone: "Asia/Shanghai",\n Done: func(c *fiber.Ctx, logString []byte) {\n if c.Response().StatusCode() != fiber.StatusOK {\n reporter.SendToSlack(logString) \n }\n },\n}))\n\n// Disable colors when outputting to default format\napp.Use(logger.New(logger.Config{\n DisableColors: true,\n}))\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n \n // Done is a function that is called after the log string for a request is written to Output,\n // and pass the log string as parameter.\n //\n // Optional. Default: nil\n Done func(c *fiber.Ctx, logString []byte)\n \n // tagFunctions defines the custom tag action\n //\n // Optional. Default: map[string]LogFunc\n CustomTags map[string]LogFunc\n \n // Format defines the logging tags\n //\n // Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\\n\n Format string\n \n // TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html\n //\n // Optional. Default: 15:04:05\n TimeFormat string\n \n // TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc\n //\n // Optional. Default: "Local"\n TimeZone string\n \n // TimeInterval is the delay before the timestamp is updated\n //\n // Optional. Default: 500 * time.Millisecond\n TimeInterval time.Duration\n \n // Output is a writer where logs are written\n //\n // Default: os.Stdout\n Output io.Writer\n \n // DisableColors defines if the logs output should be colorized\n //\n // Default: false\n DisableColors bool\n \n enableColors bool\n enableLatency bool\n timeZoneLocation *time.Location\n}\ntype LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Done: nil,\n Format: "[${time}] ${status} - ${latency} ${method} ${path}\\n",\n TimeFormat: "15:04:05",\n TimeZone: "Local",\n TimeInterval: 500 * time.Millisecond,\n Output: os.Stdout,\n DisableColors: false,\n}\n')),(0,a.kt)("h2",{id:"constants"},"Constants"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Logger variables\nconst (\n TagPid = "pid"\n TagTime = "time"\n TagReferer = "referer"\n TagProtocol = "protocol"\n TagPort = "port"\n TagIP = "ip"\n TagIPs = "ips"\n TagHost = "host"\n TagMethod = "method"\n TagPath = "path"\n TagURL = "url"\n TagUA = "ua"\n TagLatency = "latency"\n TagStatus = "status" // response status\n TagResBody = "resBody" // response body\n TagReqHeaders = "reqHeaders"\n TagQueryStringParams = "queryParams" // request query parameters\n TagBody = "body" // request body\n TagBytesSent = "bytesSent"\n TagBytesReceived = "bytesReceived"\n TagRoute = "route"\n TagError = "error"\n // DEPRECATED: Use TagReqHeader instead\n TagHeader = "header:" // request header\n TagReqHeader = "reqHeader:" // request header\n TagRespHeader = "respHeader:" // response header\n TagQuery = "query:" // request query\n TagForm = "form:" // request form\n TagCookie = "cookie:" // request cookie\n TagLocals = "locals:"\n // colors\n TagBlack = "black"\n TagRed = "red"\n TagGreen = "green"\n TagYellow = "yellow"\n TagBlue = "blue"\n TagMagenta = "magenta"\n TagCyan = "cyan"\n TagWhite = "white"\n TagReset = "reset"\n)\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5363],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),g=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=g(e.components);return r.createElement(s.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},c=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),p=g(n),c=a,m=p["".concat(s,".").concat(c)]||p[c]||d[c]||o;return n?r.createElement(m,i(i({ref:t},u),{},{components:n})):r.createElement(m,i({ref:t},u))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=c;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:a,i[1]=l;for(var g=2;g{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>g});var r=n(7462),a=(n(7294),n(3905));const o={id:"logger",title:"Logger"},i=void 0,l={unversionedId:"api/middleware/logger",id:"api/middleware/logger",title:"Logger",description:"Logger middleware for Fiber that logs HTTP request/response details.",source:"@site/docs/core/api/middleware/logger.md",sourceDirName:"api/middleware",slug:"/api/middleware/logger",permalink:"/next/api/middleware/logger",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/logger.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"logger",title:"Logger"},sidebar:"tutorialSidebar",previous:{title:"Limiter",permalink:"/next/api/middleware/limiter"},next:{title:"Monitor",permalink:"/next/api/middleware/monitor"}},s={},g=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2},{value:"Constants",id:"constants",level:2}],u={toc:g},p="wrapper";function d(e){let{components:t,...n}=e;return(0,a.kt)(p,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Logger middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that logs HTTP request/response details."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/logger"\n)\n')),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"The order of registration plays a role. Only all routes that are registered after this one will be logged.\nThe middleware should therefore be one of the first to be registered.")),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(logger.New())\n\n// Or extend your config for customization\n// Logging remote IP and Port\napp.Use(logger.New(logger.Config{\n Format: "[${ip}]:${port} ${status} - ${method} ${path}\\n",\n}))\n\n// Logging Request ID\napp.Use(requestid.New())\napp.Use(logger.New(logger.Config{\n // For more options, see the Config section\n Format: "${pid} ${locals:requestid} ${status} - ${method} ${path}\u200b\\n",\n}))\n\n// Changing TimeZone & TimeFormat\napp.Use(logger.New(logger.Config{\n Format: "${pid} ${status} - ${method} ${path}\\n",\n TimeFormat: "02-Jan-2006",\n TimeZone: "America/New_York",\n}))\n\n// Custom File Writer\nfile, err := os.OpenFile("./123.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)\nif err != nil {\n log.Fatalf("error opening file: %v", err)\n}\ndefer file.Close()\napp.Use(logger.New(logger.Config{\n Output: file,\n}))\n\n// Add Custom Tags\napp.Use(logger.New(logger.Config{\n CustomTags: map[string]logger.LogFunc{\n "custom_tag": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) {\n return output.WriteString("it is a custom tag")\n },\n },\n}))\n\n// Callback after log is written\napp.Use(logger.New(logger.Config{\n TimeFormat: time.RFC3339Nano,\n TimeZone: "Asia/Shanghai",\n Done: func(c *fiber.Ctx, logString []byte) {\n if c.Response().StatusCode() != fiber.StatusOK {\n reporter.SendToSlack(logString) \n }\n },\n}))\n\n// Disable colors when outputting to default format\napp.Use(logger.New(logger.Config{\n DisableColors: true,\n}))\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n \n // Done is a function that is called after the log string for a request is written to Output,\n // and pass the log string as parameter.\n //\n // Optional. Default: nil\n Done func(c *fiber.Ctx, logString []byte)\n \n // tagFunctions defines the custom tag action\n //\n // Optional. Default: map[string]LogFunc\n CustomTags map[string]LogFunc\n \n // Format defines the logging tags\n //\n // Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\\n\n Format string\n \n // TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html\n //\n // Optional. Default: 15:04:05\n TimeFormat string\n \n // TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc\n //\n // Optional. Default: "Local"\n TimeZone string\n \n // TimeInterval is the delay before the timestamp is updated\n //\n // Optional. Default: 500 * time.Millisecond\n TimeInterval time.Duration\n \n // Output is a writer where logs are written\n //\n // Default: os.Stdout\n Output io.Writer\n \n // DisableColors defines if the logs output should be colorized\n //\n // Default: false\n DisableColors bool\n \n enableColors bool\n enableLatency bool\n timeZoneLocation *time.Location\n}\ntype LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Done: nil,\n Format: "[${time}] ${status} - ${latency} ${method} ${path}\\n",\n TimeFormat: "15:04:05",\n TimeZone: "Local",\n TimeInterval: 500 * time.Millisecond,\n Output: os.Stdout,\n DisableColors: false,\n}\n')),(0,a.kt)("h2",{id:"constants"},"Constants"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Logger variables\nconst (\n TagPid = "pid"\n TagTime = "time"\n TagReferer = "referer"\n TagProtocol = "protocol"\n TagPort = "port"\n TagIP = "ip"\n TagIPs = "ips"\n TagHost = "host"\n TagMethod = "method"\n TagPath = "path"\n TagURL = "url"\n TagUA = "ua"\n TagLatency = "latency"\n TagStatus = "status" // response status\n TagResBody = "resBody" // response body\n TagReqHeaders = "reqHeaders"\n TagQueryStringParams = "queryParams" // request query parameters\n TagBody = "body" // request body\n TagBytesSent = "bytesSent"\n TagBytesReceived = "bytesReceived"\n TagRoute = "route"\n TagError = "error"\n // DEPRECATED: Use TagReqHeader instead\n TagHeader = "header:" // request header\n TagReqHeader = "reqHeader:" // request header\n TagRespHeader = "respHeader:" // response header\n TagQuery = "query:" // request query\n TagForm = "form:" // request form\n TagCookie = "cookie:" // request cookie\n TagLocals = "locals:"\n // colors\n TagBlack = "black"\n TagRed = "red"\n TagGreen = "green"\n TagYellow = "yellow"\n TagBlue = "blue"\n TagMagenta = "magenta"\n TagCyan = "cyan"\n TagWhite = "white"\n TagReset = "reset"\n)\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/85ea1211.41cb3742.js b/assets/js/85ea1211.0ef0165f.js similarity index 99% rename from assets/js/85ea1211.41cb3742.js rename to assets/js/85ea1211.0ef0165f.js index 78cc4ccee82..e2a046a4e5b 100644 --- a/assets/js/85ea1211.41cb3742.js +++ b/assets/js/85ea1211.0ef0165f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7039],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>b});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var c=r.createContext({}),p=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=p(e.components);return r.createElement(c.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),d=p(n),u=a,b=d["".concat(c,".").concat(u)]||d[u]||m[u]||i;return n?r.createElement(b,o(o({ref:t},s),{},{components:n})):r.createElement(b,o({ref:t},s))}));function b(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=u;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l[d]="string"==typeof e?e:a,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const i={id:"casbin",title:"Casbin"},o=void 0,l={unversionedId:"casbin/casbin",id:"casbin/casbin",title:"Casbin",description:"Release",source:"@site/docs/contrib/casbin/README.md",sourceDirName:"casbin",slug:"/casbin/",permalink:"/contrib/casbin/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/casbin/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"casbin",title:"Casbin"},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udc4b Welcome",permalink:"/contrib/"},next:{title:"Fiberi18n",permalink:"/contrib/fiberi18n/"}},c={},p=[{value:"Install",id:"install",level:3},{value:"Signature",id:"signature",level:3},{value:"Config",id:"config",level:3},{value:"Examples",id:"examples",level:3},{value:"CustomPermission",id:"custompermission",level:3},{value:"RoutePermission",id:"routepermission",level:3},{value:"RoleAuthorization",id:"roleauthorization",level:3}],s={toc:p},d="wrapper";function m(e){let{components:t,...n}=e;return(0,a.kt)(d,(0,r.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=casbin*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Casbin middleware for Fiber."),(0,a.kt)("h3",{id:"install"},"Install"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"go get -u github.com/gofiber/fiber/v2\ngo get -u github.com/gofiber/contrib/casbin\n")),(0,a.kt)("p",null,"choose an adapter from ",(0,a.kt)("a",{parentName:"p",href:"https://casbin.org/docs/en/adapters"},"here")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"go get -u github.com/casbin/xorm-adapter\n")),(0,a.kt)("h3",{id:"signature"},"Signature"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"casbin.New(config ...casbin.Config) *casbin.Middleware\n")),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Property"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Description"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Default"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"ModelFilePath"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Model file path"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},'"./model.conf"'))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"PolicyAdapter"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"persist.Adapter")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Database adapter for policies"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"./policy.csv"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Enforcer"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"*casbin.Enforcer")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Custom casbin enforcer"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Middleware generated enforcer using ModelFilePath & PolicyAdapter"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Lookup"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Look up for current subject"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},'""'))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Unauthorized"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) error")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Response body for unauthorized responses"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Unauthorized"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Forbidden"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) error")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Response body for forbidden responses"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Forbidden"))))),(0,a.kt)("h3",{id:"examples"},"Examples"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/svcg/-fiber_casbin_demo"},"Gorm Adapter")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/contrib/casbin/tree/master/example"},"File Adapter"))),(0,a.kt)("h3",{id:"custompermission"},"CustomPermission"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/contrib/casbin"\n _ "github.com/go-sql-driver/mysql"\n "github.com/casbin/xorm-adapter/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n authz := casbin.New(casbin.Config{\n ModelFilePath: "path/to/rbac_model.conf",\n PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),\n Lookup: func(c *fiber.Ctx) string {\n // fetch authenticated user subject\n },\n })\n\n app.Post("/blog",\n authz.RequiresPermissions([]string{"blog:create"}, casbin.WithValidationRule(casbin.MatchAllRule)),\n func(c *fiber.Ctx) error {\n // your handler\n },\n )\n \n app.Delete("/blog/:id",\n authz.RequiresPermissions([]string{"blog:create", "blog:delete"}, casbin.WithValidationRule(casbin.AtLeastOneRule)),\n func(c *fiber.Ctx) error {\n // your handler\n },\n )\n\n app.Listen(":8080")\n}\n')),(0,a.kt)("h3",{id:"routepermission"},"RoutePermission"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/contrib/casbin"\n _ "github.com/go-sql-driver/mysql"\n "github.com/casbin/xorm-adapter/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n authz := casbin.New(casbin.Config{\n ModelFilePath: "path/to/rbac_model.conf",\n PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),\n Lookup: func(c *fiber.Ctx) string {\n // fetch authenticated user subject\n },\n })\n\n // check permission with Method and Path\n app.Post("/blog",\n authz.RoutePermission(),\n func(c *fiber.Ctx) error {\n // your handler\n },\n )\n\n app.Listen(":8080")\n}\n')),(0,a.kt)("h3",{id:"roleauthorization"},"RoleAuthorization"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/contrib/casbin"\n _ "github.com/go-sql-driver/mysql"\n "github.com/casbin/xorm-adapter/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n authz := casbin.New(casbin.Config{\n ModelFilePath: "path/to/rbac_model.conf",\n PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),\n Lookup: func(c *fiber.Ctx) string {\n // fetch authenticated user subject\n },\n })\n \n app.Put("/blog/:id",\n authz.RequiresRoles([]string{"admin"}),\n func(c *fiber.Ctx) error {\n // your handler\n },\n )\n\n app.Listen(":8080")\n}\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[7039],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>b});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var c=r.createContext({}),p=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=p(e.components);return r.createElement(c.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),d=p(n),u=a,b=d["".concat(c,".").concat(u)]||d[u]||m[u]||i;return n?r.createElement(b,o(o({ref:t},s),{},{components:n})):r.createElement(b,o({ref:t},s))}));function b(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=u;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l[d]="string"==typeof e?e:a,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const i={id:"casbin",title:"Casbin"},o=void 0,l={unversionedId:"casbin/casbin",id:"casbin/casbin",title:"Casbin",description:"Release",source:"@site/docs/contrib/casbin/README.md",sourceDirName:"casbin",slug:"/casbin/",permalink:"/contrib/casbin/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/casbin/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"casbin",title:"Casbin"},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udc4b Welcome",permalink:"/contrib/"},next:{title:"Fiberi18n",permalink:"/contrib/fiberi18n/"}},c={},p=[{value:"Install",id:"install",level:3},{value:"Signature",id:"signature",level:3},{value:"Config",id:"config",level:3},{value:"Examples",id:"examples",level:3},{value:"CustomPermission",id:"custompermission",level:3},{value:"RoutePermission",id:"routepermission",level:3},{value:"RoleAuthorization",id:"roleauthorization",level:3}],s={toc:p},d="wrapper";function m(e){let{components:t,...n}=e;return(0,a.kt)(d,(0,r.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=casbin*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Casbin middleware for Fiber."),(0,a.kt)("h3",{id:"install"},"Install"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"go get -u github.com/gofiber/fiber/v2\ngo get -u github.com/gofiber/contrib/casbin\n")),(0,a.kt)("p",null,"choose an adapter from ",(0,a.kt)("a",{parentName:"p",href:"https://casbin.org/docs/en/adapters"},"here")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"go get -u github.com/casbin/xorm-adapter\n")),(0,a.kt)("h3",{id:"signature"},"Signature"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"casbin.New(config ...casbin.Config) *casbin.Middleware\n")),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Property"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Description"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Default"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"ModelFilePath"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Model file path"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},'"./model.conf"'))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"PolicyAdapter"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"persist.Adapter")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Database adapter for policies"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"./policy.csv"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Enforcer"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"*casbin.Enforcer")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Custom casbin enforcer"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Middleware generated enforcer using ModelFilePath & PolicyAdapter"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Lookup"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Look up for current subject"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},'""'))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Unauthorized"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) error")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Response body for unauthorized responses"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Unauthorized"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Forbidden"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) error")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Response body for forbidden responses"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Forbidden"))))),(0,a.kt)("h3",{id:"examples"},"Examples"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/svcg/-fiber_casbin_demo"},"Gorm Adapter")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/gofiber/contrib/casbin/tree/master/example"},"File Adapter"))),(0,a.kt)("h3",{id:"custompermission"},"CustomPermission"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/contrib/casbin"\n _ "github.com/go-sql-driver/mysql"\n "github.com/casbin/xorm-adapter/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n authz := casbin.New(casbin.Config{\n ModelFilePath: "path/to/rbac_model.conf",\n PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),\n Lookup: func(c *fiber.Ctx) string {\n // fetch authenticated user subject\n },\n })\n\n app.Post("/blog",\n authz.RequiresPermissions([]string{"blog:create"}, casbin.WithValidationRule(casbin.MatchAllRule)),\n func(c *fiber.Ctx) error {\n // your handler\n },\n )\n \n app.Delete("/blog/:id",\n authz.RequiresPermissions([]string{"blog:create", "blog:delete"}, casbin.WithValidationRule(casbin.AtLeastOneRule)),\n func(c *fiber.Ctx) error {\n // your handler\n },\n )\n\n app.Listen(":8080")\n}\n')),(0,a.kt)("h3",{id:"routepermission"},"RoutePermission"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/contrib/casbin"\n _ "github.com/go-sql-driver/mysql"\n "github.com/casbin/xorm-adapter/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n authz := casbin.New(casbin.Config{\n ModelFilePath: "path/to/rbac_model.conf",\n PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),\n Lookup: func(c *fiber.Ctx) string {\n // fetch authenticated user subject\n },\n })\n\n // check permission with Method and Path\n app.Post("/blog",\n authz.RoutePermission(),\n func(c *fiber.Ctx) error {\n // your handler\n },\n )\n\n app.Listen(":8080")\n}\n')),(0,a.kt)("h3",{id:"roleauthorization"},"RoleAuthorization"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/contrib/casbin"\n _ "github.com/go-sql-driver/mysql"\n "github.com/casbin/xorm-adapter/v2"\n)\n\nfunc main() {\n app := fiber.New()\n\n authz := casbin.New(casbin.Config{\n ModelFilePath: "path/to/rbac_model.conf",\n PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),\n Lookup: func(c *fiber.Ctx) string {\n // fetch authenticated user subject\n },\n })\n \n app.Put("/blog/:id",\n authz.RequiresRoles([]string{"admin"}),\n func(c *fiber.Ctx) error {\n // your handler\n },\n )\n\n app.Listen(":8080")\n}\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/8613e059.4f1c2537.js b/assets/js/8613e059.ecc2df38.js similarity index 99% rename from assets/js/8613e059.4f1c2537.js rename to assets/js/8613e059.ecc2df38.js index ee1313b71bb..9cc623eb759 100644 --- a/assets/js/8613e059.4f1c2537.js +++ b/assets/js/8613e059.ecc2df38.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8622],{3905:(e,n,t)=>{t.d(n,{Zo:()=>f,kt:()=>m});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var c=r.createContext({}),s=function(e){var n=r.useContext(c),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},f=function(e){var n=s(e.components);return r.createElement(c.Provider,{value:n},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,f=l(e,["components","mdxType","originalType","parentName"]),p=s(t),d=i,m=p["".concat(c,".").concat(d)]||p[d]||u[d]||a;return t?r.createElement(m,o(o({ref:n},f),{},{components:t})):r.createElement(m,o({ref:n},f))}));function m(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=d;var l={};for(var c in n)hasOwnProperty.call(n,c)&&(l[c]=n[c]);l.originalType=e,l[p]="string"==typeof e?e:i,o[1]=l;for(var s=2;s{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>s});var r=t(7462),i=(t(7294),t(3905));const a={id:"favicon",title:"Favicon"},o=void 0,l={unversionedId:"api/middleware/favicon",id:"api/middleware/favicon",title:"Favicon",description:"Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware.",source:"@site/docs/core/api/middleware/favicon.md",sourceDirName:"api/middleware",slug:"/api/middleware/favicon",permalink:"/next/api/middleware/favicon",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/favicon.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"favicon",title:"Favicon"},sidebar:"tutorialSidebar",previous:{title:"ExpVar",permalink:"/next/api/middleware/expvar"},next:{title:"FileSystem",permalink:"/next/api/middleware/filesystem"}},c={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],f={toc:s},p="wrapper";function u(e){let{components:n,...t}=e;return(0,i.kt)(p,(0,r.Z)({},f,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Favicon middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or ",(0,i.kt)("a",{parentName:"p",href:"#config"},"custom favicon URL"),".")),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/favicon"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(favicon.New())\n\n// Or extend your config for customization\napp.Use(favicon.New(favicon.Config{\n File: "./favicon.ico",\n URL: "/favicon.ico",\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // File holds the path to an actual favicon that will be cached\n //\n // Optional. Default: ""\n File string\n \n // URL for favicon handler\n //\n // Optional. Default: "/favicon.ico"\n URL string\n\n // FileSystem is an optional alternate filesystem to search for the favicon in.\n // An example of this could be an embedded or network filesystem\n //\n // Optional. Default: nil\n FileSystem http.FileSystem\n\n // CacheControl defines how the Cache-Control header in the response should be set\n //\n // Optional. Default: "public, max-age=31536000"\n CacheControl string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n File: "",\n URL: fPath,\n CacheControl: "public, max-age=31536000",\n}\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8622],{3905:(e,n,t)=>{t.d(n,{Zo:()=>f,kt:()=>m});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var c=r.createContext({}),s=function(e){var n=r.useContext(c),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},f=function(e){var n=s(e.components);return r.createElement(c.Provider,{value:n},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,f=l(e,["components","mdxType","originalType","parentName"]),p=s(t),d=i,m=p["".concat(c,".").concat(d)]||p[d]||u[d]||a;return t?r.createElement(m,o(o({ref:n},f),{},{components:t})):r.createElement(m,o({ref:n},f))}));function m(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=d;var l={};for(var c in n)hasOwnProperty.call(n,c)&&(l[c]=n[c]);l.originalType=e,l[p]="string"==typeof e?e:i,o[1]=l;for(var s=2;s{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>s});var r=t(7462),i=(t(7294),t(3905));const a={id:"favicon",title:"Favicon"},o=void 0,l={unversionedId:"api/middleware/favicon",id:"api/middleware/favicon",title:"Favicon",description:"Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware.",source:"@site/docs/core/api/middleware/favicon.md",sourceDirName:"api/middleware",slug:"/api/middleware/favicon",permalink:"/next/api/middleware/favicon",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/favicon.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"favicon",title:"Favicon"},sidebar:"tutorialSidebar",previous:{title:"ExpVar",permalink:"/next/api/middleware/expvar"},next:{title:"FileSystem",permalink:"/next/api/middleware/filesystem"}},c={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],f={toc:s},p="wrapper";function u(e){let{components:n,...t}=e;return(0,i.kt)(p,(0,r.Z)({},f,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Favicon middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or ",(0,i.kt)("a",{parentName:"p",href:"#config"},"custom favicon URL"),".")),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/favicon"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(favicon.New())\n\n// Or extend your config for customization\napp.Use(favicon.New(favicon.Config{\n File: "./favicon.ico",\n URL: "/favicon.ico",\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // File holds the path to an actual favicon that will be cached\n //\n // Optional. Default: ""\n File string\n \n // URL for favicon handler\n //\n // Optional. Default: "/favicon.ico"\n URL string\n\n // FileSystem is an optional alternate filesystem to search for the favicon in.\n // An example of this could be an embedded or network filesystem\n //\n // Optional. Default: nil\n FileSystem http.FileSystem\n\n // CacheControl defines how the Cache-Control header in the response should be set\n //\n // Optional. Default: "public, max-age=31536000"\n CacheControl string\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n File: "",\n URL: fPath,\n CacheControl: "public, max-age=31536000",\n}\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/89cfd5bc.b9731d01.js b/assets/js/89cfd5bc.b8908d7d.js similarity index 98% rename from assets/js/89cfd5bc.b9731d01.js rename to assets/js/89cfd5bc.b8908d7d.js index eb0ebea4289..7ecf0fa9938 100644 --- a/assets/js/89cfd5bc.b9731d01.js +++ b/assets/js/89cfd5bc.b8908d7d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1374],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>d});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var o=r.createContext({}),s=function(e){var t=r.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):p(p({},t),e)),n},m=function(e){var t=s(e.components);return r.createElement(o.Provider,{value:t},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),u=s(n),g=a,d=u["".concat(o,".").concat(g)]||u[g]||c[g]||i;return n?r.createElement(d,p(p({ref:t},m),{},{components:n})):r.createElement(d,p({ref:t},m))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,p=new Array(i);p[0]=g;var l={};for(var o in t)hasOwnProperty.call(t,o)&&(l[o]=t[o]);l.originalType=e,l[u]="string"==typeof e?e:a,p[1]=l;for(var s=2;s{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>p,default:()=>c,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const i={id:"pug",title:"Pug"},p=void 0,l={unversionedId:"pug/pug",id:"pug/pug",title:"Pug",description:"Release",source:"@site/docs/template/pug/README.md",sourceDirName:"pug",slug:"/pug/",permalink:"/template/pug/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/pug/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"pug",title:"Pug"},sidebar:"tutorialSidebar",previous:{title:"Mustache",permalink:"/template/mustache/"},next:{title:"Slim",permalink:"/template/slim/"}},o={},s=[{value:"Basic Example",id:"basic-example",level:3}],m={toc:s},u="wrapper";function c(e){let{components:t,...n}=e;return(0,a.kt)(u,(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Pug is a template engine create by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/Joker/jade"},"joker"),", to see the original syntax documentation please ",(0,a.kt)("a",{parentName:"p",href:"https://pugjs.org/language/tags.html"},"click here")),(0,a.kt)("h3",{id:"basic-example"},"Basic Example"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/index.pug"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"include partials/header.pug\n\nh1 #{.Title}\n\ninclude partials/footer.pug\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/header.pug"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h2 Header\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/footer.pug"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h2 Footer\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/layouts/main.pug"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"doctype html\nhtml\n head\n title Main\n include ../partials/meta.pug\n body\n | {{embed}}\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/pug/v2"\n\n // "net/http" // embedded system\n)\n\nfunc main() {\n // Create a new engine\n engine := pug.New("./views", ".pug")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := pug.NewFileSystem(http.Dir("./views", ".pug"))\n\n // Pass the engine to the views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[1374],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>d});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var o=r.createContext({}),s=function(e){var t=r.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):p(p({},t),e)),n},m=function(e){var t=s(e.components);return r.createElement(o.Provider,{value:t},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),u=s(n),g=a,d=u["".concat(o,".").concat(g)]||u[g]||c[g]||i;return n?r.createElement(d,p(p({ref:t},m),{},{components:n})):r.createElement(d,p({ref:t},m))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,p=new Array(i);p[0]=g;var l={};for(var o in t)hasOwnProperty.call(t,o)&&(l[o]=t[o]);l.originalType=e,l[u]="string"==typeof e?e:a,p[1]=l;for(var s=2;s{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>p,default:()=>c,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const i={id:"pug",title:"Pug"},p=void 0,l={unversionedId:"pug/pug",id:"pug/pug",title:"Pug",description:"Release",source:"@site/docs/template/pug/README.md",sourceDirName:"pug",slug:"/pug/",permalink:"/template/pug/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/pug/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"pug",title:"Pug"},sidebar:"tutorialSidebar",previous:{title:"Mustache",permalink:"/template/mustache/"},next:{title:"Slim",permalink:"/template/slim/"}},o={},s=[{value:"Basic Example",id:"basic-example",level:3}],m={toc:s},u="wrapper";function c(e){let{components:t,...n}=e;return(0,a.kt)(u,(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Pug is a template engine create by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/Joker/jade"},"joker"),", to see the original syntax documentation please ",(0,a.kt)("a",{parentName:"p",href:"https://pugjs.org/language/tags.html"},"click here")),(0,a.kt)("h3",{id:"basic-example"},"Basic Example"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/index.pug"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"include partials/header.pug\n\nh1 #{.Title}\n\ninclude partials/footer.pug\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/header.pug"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h2 Header\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/footer.pug"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h2 Footer\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/layouts/main.pug"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"doctype html\nhtml\n head\n title Main\n include ../partials/meta.pug\n body\n | {{embed}}\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/pug/v2"\n\n // "net/http" // embedded system\n)\n\nfunc main() {\n // Create a new engine\n engine := pug.New("./views", ".pug")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := pug.NewFileSystem(http.Dir("./views", ".pug"))\n\n // Pass the engine to the views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/8ec8555c.028e8846.js b/assets/js/8ec8555c.d553c476.js similarity index 99% rename from assets/js/8ec8555c.028e8846.js rename to assets/js/8ec8555c.d553c476.js index 9ab56b75150..328e7bfe0d8 100644 --- a/assets/js/8ec8555c.028e8846.js +++ b/assets/js/8ec8555c.d553c476.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2149],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>N});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var d=a.createContext({}),p=function(e){var t=a.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},m=function(e){var t=p(e.components);return a.createElement(d.Provider,{value:t},e.children)},s="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},k=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,d=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),s=p(n),k=r,N=s["".concat(d,".").concat(k)]||s[k]||u[k]||l;return n?a.createElement(N,i(i({ref:t},m),{},{components:n})):a.createElement(N,i({ref:t},m))}));function N(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=k;var o={};for(var d in t)hasOwnProperty.call(t,d)&&(o[d]=t[d]);o.originalType=e,o[s]="string"==typeof e?e:r,i[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var a=n(7462),r=(n(7294),n(3905));const l={id:"fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",sidebar_position:1},i=void 0,o={unversionedId:"api/fiber",id:"version-v2.x/api/fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",source:"@site/versioned_docs/version-v2.x/api/fiber.md",sourceDirName:"api",slug:"/api/fiber",permalink:"/api/fiber",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{id:"fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"API",permalink:"/category/api"},next:{title:"\ud83d\ude80 App",permalink:"/api/app"}},d={},p=[{value:"New",id:"new",level:2},{value:"Config",id:"config",level:2},{value:"NewError",id:"newerror",level:2},{value:"IsChild",id:"ischild",level:2}],m={toc:p},s="wrapper";function u(e){let{components:t,...n}=e;return(0,r.kt)(s,(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"new"},"New"),(0,r.kt)("p",null,"This method creates a new ",(0,r.kt)("strong",{parentName:"p"},"App")," named instance. You can pass optional ",(0,r.kt)("a",{parentName:"p",href:"#config"},"config "),"when creating a new instance."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func New(config ...Config) *App\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"// Default config\napp := fiber.New()\n\n// ...\n")),(0,r.kt)("h2",{id:"config"},"Config"),(0,r.kt)("p",null,"You can pass an optional Config when creating a new Fiber instance."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Custom config\napp := fiber.New(fiber.Config{\n Prefork: true,\n CaseSensitive: true,\n StrictRouting: true,\n ServerHeader: "Fiber",\n AppName: "Test App v1.0.1"\n})\n\n// ...\n')),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Config fields")),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Property"),(0,r.kt)("th",{parentName:"tr",align:null},"Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"AppName"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"This allows to setup app name for the app"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"BodyLimit"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends ",(0,r.kt)("inlineCode",{parentName:"td"},"413 - Request Entity Too Large")," response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4 * 1024 * 1024"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"CaseSensitive"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, ",(0,r.kt)("inlineCode",{parentName:"td"},"/Foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," are different routes. When disabled, ",(0,r.kt)("inlineCode",{parentName:"td"},"/Foo"),"and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," are treated the same."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ColorScheme"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/blob/master/color.go"},(0,r.kt)("inlineCode",{parentName:"a"},"Colors"))),(0,r.kt)("td",{parentName:"tr",align:null},"You can define custom color scheme. They'll be used for startup message, route list and some middlewares."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/blob/master/color.go"},(0,r.kt)("inlineCode",{parentName:"a"},"DefaultColors")))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"CompressedFileSuffix"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Adds a suffix to the original file name and tries saving the resulting compressed file under the new file name."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'".fiber.gz"'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Concurrency"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Maximum number of concurrent connections."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"256 * 1024"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableDefaultContentType"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, causes the default Content-Type header to be excluded from the Response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableDefaultDate"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true causes the default date header to be excluded from the response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableHeaderNormalizing"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"By default all header names are normalized: conteNT-tYPE -",">"," Content-Type"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableKeepalive"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Disable keep-alive connections, the server will close incoming connections after sending the first response to the client"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisablePreParseMultipartForm"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Will not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableStartupMessage"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, it will not print out debug information"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ETag"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method ","(","CRC-32",")",". Weak ETags are the default when enabled."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnableIPValidation"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"If set to true, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IPs()")," will validate IP addresses before returning them. Also, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will return only the first valid IP rather than just the raw header value that may be a comma seperated string.",(0,r.kt)("br",null),(0,r.kt)("br",null),(0,r.kt)("strong",{parentName:"td"},"WARNING:")," There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnablePrintRoutes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"EnablePrintRoutes enables print all routes with their method, path, name and handler.."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnableTrustedProxyCheck"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, fiber will check whether proxy is trusted, using TrustedProxies list. ",(0,r.kt)("br",null),(0,r.kt)("br",null),"By default ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()")," will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will get value from ",(0,r.kt)("inlineCode",{parentName:"td"},"ProxyHeader")," header, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will get value from X-Forwarded-Host header. ",(0,r.kt)("br",null)," If ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," is true, and ",(0,r.kt)("inlineCode",{parentName:"td"},"RemoteIP")," is in the list of ",(0,r.kt)("inlineCode",{parentName:"td"},"TrustedProxies")," ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()"),", ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()"),", and ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will have the same behaviour when ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," disabled, if ",(0,r.kt)("inlineCode",{parentName:"td"},"RemoteIP")," isn't in the list, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()")," will return https in case when tls connection is handled by the app, or http otherwise, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will return RemoteIP() from fasthttp context, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will return ",(0,r.kt)("inlineCode",{parentName:"td"},"fasthttp.Request.URI().Host()")),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ErrorHandler"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"ErrorHandler")),(0,r.kt)("td",{parentName:"tr",align:null},"ErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"DefaultErrorHandler"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"GETOnly"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Rejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"IdleTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Immutable"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue ",(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/issues/185"},"#","185"),"."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"JSONDecoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.JSONUnmarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another json library for decoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"json.Unmarshal"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"JSONEncoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.JSONMarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another json library for encoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"json.Marshal"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Network"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},'Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only)',(0,r.kt)("br",null),(0,r.kt)("br",null),(0,r.kt)("strong",{parentName:"td"},"WARNING:"),' When prefork is set to true, only "tcp4" and "tcp6" can be chosen.'),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"NetworkTCP4"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"PassLocalsToViews"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"PassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Prefork"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Enables use of the",(0,r.kt)("a",{parentName:"td",href:"https://lwn.net/Articles/542629/"},(0,r.kt)("inlineCode",{parentName:"a"},"SO_REUSEPORT")),"socket option. This will spawn multiple Go processes listening on the same port. learn more about ",(0,r.kt)("a",{parentName:"td",href:"https://www.nginx.com/blog/socket-sharding-nginx-release-1-9-1/"},"socket sharding"),". ",(0,r.kt)("strong",{parentName:"td"},"NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with ",(0,r.kt)("inlineCode",{parentName:"strong"},"CMD ./app")," or ",(0,r.kt)("inlineCode",{parentName:"strong"},'CMD ["sh", "-c", "/app"]'),". For more info, see")," ",(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/issues/1021#issuecomment-730537971"},(0,r.kt)("strong",{parentName:"a"},"this"))," ",(0,r.kt)("strong",{parentName:"td"},"issue comment.")),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ProxyHeader"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"This will enable ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," to return the value of the given header key. By default ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()"),"will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. ",(0,r.kt)("em",{parentName:"td"},"X-Forwarded-","*"),"."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ReadBufferSize"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"per-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers ","(","for example, BIG cookies",")","."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4096"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ReadTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The amount of time allowed to read the full request, including the body. The default timeout is unlimited."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"RequestMethods"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string")),(0,r.kt)("td",{parentName:"tr",align:null},"RequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"DefaultMethods"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ServerHeader"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Enables the ",(0,r.kt)("inlineCode",{parentName:"td"},"Server")," HTTP header with the given value."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"StreamRequestBody"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"StreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"StrictRouting"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, the router treats ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo/")," as different. Otherwise, the router treats ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo/")," as the same."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"TrustedProxies"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string")),(0,r.kt)("td",{parentName:"tr",align:null},"Contains the list of trusted proxy IP's. Look at ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," doc. ",(0,r.kt)("br",null)," ",(0,r.kt)("br",null)," It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string*__*"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"UnescapePath"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Converts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special characters"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Views"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"Views")),(0,r.kt)("td",{parentName:"tr",align:null},"Views is the interface that wraps the Render function. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ViewsLayout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Views Layout is the global layout for all template render until override on Render function. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"WriteBufferSize"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Per-connection buffer size for responses' writing."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4096"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"WriteTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum duration before timing out writes of the response. The default timeout is unlimited."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"XMLEncoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.XMLMarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another XML library for encoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"xml.Marshal"))))),(0,r.kt)("h2",{id:"newerror"},"NewError"),(0,r.kt)("p",null,"NewError creates a new HTTPError instance with an optional message."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func NewError(code int, message ...string) *Error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return fiber.NewError(782, "Custom error message")\n})\n')),(0,r.kt)("h2",{id:"ischild"},"IsChild"),(0,r.kt)("p",null,"IsChild determines if the current process is a result of Prefork."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func IsChild() bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Prefork will spawn child processes\napp := fiber.New(fiber.Config{\n Prefork: true,\n})\n\nif !fiber.IsChild() {\n fmt.Println("I\'m the parent process")\n} else {\n fmt.Println("I\'m a child process")\n}\n\n// ...\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[2149],{3905:(e,t,n)=>{n.d(t,{Zo:()=>m,kt:()=>N});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var d=a.createContext({}),p=function(e){var t=a.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},m=function(e){var t=p(e.components);return a.createElement(d.Provider,{value:t},e.children)},s="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},k=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,d=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),s=p(n),k=r,N=s["".concat(d,".").concat(k)]||s[k]||u[k]||l;return n?a.createElement(N,i(i({ref:t},m),{},{components:n})):a.createElement(N,i({ref:t},m))}));function N(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=k;var o={};for(var d in t)hasOwnProperty.call(t,d)&&(o[d]=t[d]);o.originalType=e,o[s]="string"==typeof e?e:r,i[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var a=n(7462),r=(n(7294),n(3905));const l={id:"fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",sidebar_position:1},i=void 0,o={unversionedId:"api/fiber",id:"version-v2.x/api/fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",source:"@site/versioned_docs/version-v2.x/api/fiber.md",sourceDirName:"api",slug:"/api/fiber",permalink:"/api/fiber",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:1,frontMatter:{id:"fiber",title:"\ud83d\udce6 Fiber",description:"Fiber represents the fiber package where you start to create an instance.",sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"API",permalink:"/category/api"},next:{title:"\ud83d\ude80 App",permalink:"/api/app"}},d={},p=[{value:"New",id:"new",level:2},{value:"Config",id:"config",level:2},{value:"NewError",id:"newerror",level:2},{value:"IsChild",id:"ischild",level:2}],m={toc:p},s="wrapper";function u(e){let{components:t,...n}=e;return(0,r.kt)(s,(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"new"},"New"),(0,r.kt)("p",null,"This method creates a new ",(0,r.kt)("strong",{parentName:"p"},"App")," named instance. You can pass optional ",(0,r.kt)("a",{parentName:"p",href:"#config"},"config "),"when creating a new instance."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func New(config ...Config) *App\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},"// Default config\napp := fiber.New()\n\n// ...\n")),(0,r.kt)("h2",{id:"config"},"Config"),(0,r.kt)("p",null,"You can pass an optional Config when creating a new Fiber instance."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Custom config\napp := fiber.New(fiber.Config{\n Prefork: true,\n CaseSensitive: true,\n StrictRouting: true,\n ServerHeader: "Fiber",\n AppName: "Test App v1.0.1"\n})\n\n// ...\n')),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Config fields")),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"Property"),(0,r.kt)("th",{parentName:"tr",align:null},"Type"),(0,r.kt)("th",{parentName:"tr",align:null},"Description"),(0,r.kt)("th",{parentName:"tr",align:null},"Default"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"AppName"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"This allows to setup app name for the app"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"BodyLimit"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends ",(0,r.kt)("inlineCode",{parentName:"td"},"413 - Request Entity Too Large")," response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4 * 1024 * 1024"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"CaseSensitive"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, ",(0,r.kt)("inlineCode",{parentName:"td"},"/Foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," are different routes. When disabled, ",(0,r.kt)("inlineCode",{parentName:"td"},"/Foo"),"and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," are treated the same."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ColorScheme"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/blob/master/color.go"},(0,r.kt)("inlineCode",{parentName:"a"},"Colors"))),(0,r.kt)("td",{parentName:"tr",align:null},"You can define custom color scheme. They'll be used for startup message, route list and some middlewares."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/blob/master/color.go"},(0,r.kt)("inlineCode",{parentName:"a"},"DefaultColors")))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"CompressedFileSuffix"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Adds a suffix to the original file name and tries saving the resulting compressed file under the new file name."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'".fiber.gz"'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Concurrency"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Maximum number of concurrent connections."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"256 * 1024"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableDefaultContentType"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, causes the default Content-Type header to be excluded from the Response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableDefaultDate"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true causes the default date header to be excluded from the response."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableHeaderNormalizing"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"By default all header names are normalized: conteNT-tYPE -",">"," Content-Type"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableKeepalive"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Disable keep-alive connections, the server will close incoming connections after sending the first response to the client"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisablePreParseMultipartForm"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Will not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"DisableStartupMessage"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, it will not print out debug information"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ETag"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method ","(","CRC-32",")",". Weak ETags are the default when enabled."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnableIPValidation"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"If set to true, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IPs()")," will validate IP addresses before returning them. Also, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will return only the first valid IP rather than just the raw header value that may be a comma seperated string.",(0,r.kt)("br",null),(0,r.kt)("br",null),(0,r.kt)("strong",{parentName:"td"},"WARNING:")," There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnablePrintRoutes"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"EnablePrintRoutes enables print all routes with their method, path, name and handler.."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"EnableTrustedProxyCheck"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When set to true, fiber will check whether proxy is trusted, using TrustedProxies list. ",(0,r.kt)("br",null),(0,r.kt)("br",null),"By default ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()")," will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will get value from ",(0,r.kt)("inlineCode",{parentName:"td"},"ProxyHeader")," header, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will get value from X-Forwarded-Host header. ",(0,r.kt)("br",null)," If ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," is true, and ",(0,r.kt)("inlineCode",{parentName:"td"},"RemoteIP")," is in the list of ",(0,r.kt)("inlineCode",{parentName:"td"},"TrustedProxies")," ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()"),", ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()"),", and ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will have the same behaviour when ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," disabled, if ",(0,r.kt)("inlineCode",{parentName:"td"},"RemoteIP")," isn't in the list, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Protocol()")," will return https in case when tls connection is handled by the app, or http otherwise, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," will return RemoteIP() from fasthttp context, ",(0,r.kt)("inlineCode",{parentName:"td"},"c.Hostname()")," will return ",(0,r.kt)("inlineCode",{parentName:"td"},"fasthttp.Request.URI().Host()")),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ErrorHandler"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"ErrorHandler")),(0,r.kt)("td",{parentName:"tr",align:null},"ErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"DefaultErrorHandler"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"GETOnly"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Rejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"IdleTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Immutable"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue ",(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/issues/185"},"#","185"),"."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"JSONDecoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.JSONUnmarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another json library for decoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"json.Unmarshal"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"JSONEncoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.JSONMarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another json library for encoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"json.Marshal"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Network"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},'Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only)',(0,r.kt)("br",null),(0,r.kt)("br",null),(0,r.kt)("strong",{parentName:"td"},"WARNING:"),' When prefork is set to true, only "tcp4" and "tcp6" can be chosen.'),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"NetworkTCP4"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"PassLocalsToViews"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"PassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Prefork"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Enables use of the",(0,r.kt)("a",{parentName:"td",href:"https://lwn.net/Articles/542629/"},(0,r.kt)("inlineCode",{parentName:"a"},"SO_REUSEPORT")),"socket option. This will spawn multiple Go processes listening on the same port. learn more about ",(0,r.kt)("a",{parentName:"td",href:"https://www.nginx.com/blog/socket-sharding-nginx-release-1-9-1/"},"socket sharding"),". ",(0,r.kt)("strong",{parentName:"td"},"NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with ",(0,r.kt)("inlineCode",{parentName:"strong"},"CMD ./app")," or ",(0,r.kt)("inlineCode",{parentName:"strong"},'CMD ["sh", "-c", "/app"]'),". For more info, see")," ",(0,r.kt)("a",{parentName:"td",href:"https://github.com/gofiber/fiber/issues/1021#issuecomment-730537971"},(0,r.kt)("strong",{parentName:"a"},"this"))," ",(0,r.kt)("strong",{parentName:"td"},"issue comment.")),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ProxyHeader"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"This will enable ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()")," to return the value of the given header key. By default ",(0,r.kt)("inlineCode",{parentName:"td"},"c.IP()"),"will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. ",(0,r.kt)("em",{parentName:"td"},"X-Forwarded-","*"),"."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ReadBufferSize"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"per-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers ","(","for example, BIG cookies",")","."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4096"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ReadTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The amount of time allowed to read the full request, including the body. The default timeout is unlimited."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"RequestMethods"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string")),(0,r.kt)("td",{parentName:"tr",align:null},"RequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"DefaultMethods"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ServerHeader"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Enables the ",(0,r.kt)("inlineCode",{parentName:"td"},"Server")," HTTP header with the given value."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"StreamRequestBody"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"StreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"StrictRouting"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"When enabled, the router treats ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo/")," as different. Otherwise, the router treats ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo")," and ",(0,r.kt)("inlineCode",{parentName:"td"},"/foo/")," as the same."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"TrustedProxies"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string")),(0,r.kt)("td",{parentName:"tr",align:null},"Contains the list of trusted proxy IP's. Look at ",(0,r.kt)("inlineCode",{parentName:"td"},"EnableTrustedProxyCheck")," doc. ",(0,r.kt)("br",null)," ",(0,r.kt)("br",null)," It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"[]string*__*"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"UnescapePath"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"bool")),(0,r.kt)("td",{parentName:"tr",align:null},"Converts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special characters"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"false"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"Views"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"Views")),(0,r.kt)("td",{parentName:"tr",align:null},"Views is the interface that wraps the Render function. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"ViewsLayout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"string")),(0,r.kt)("td",{parentName:"tr",align:null},"Views Layout is the global layout for all template render until override on Render function. See our ",(0,r.kt)("strong",{parentName:"td"},"Template Middleware")," for supported engines."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},'""'))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"WriteBufferSize"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"int")),(0,r.kt)("td",{parentName:"tr",align:null},"Per-connection buffer size for responses' writing."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"4096"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"WriteTimeout"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"time.Duration")),(0,r.kt)("td",{parentName:"tr",align:null},"The maximum duration before timing out writes of the response. The default timeout is unlimited."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"nil"))),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"XMLEncoder"),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"utils.XMLMarshal")),(0,r.kt)("td",{parentName:"tr",align:null},"Allowing for flexibility in using another XML library for encoding."),(0,r.kt)("td",{parentName:"tr",align:null},(0,r.kt)("inlineCode",{parentName:"td"},"xml.Marshal"))))),(0,r.kt)("h2",{id:"newerror"},"NewError"),(0,r.kt)("p",null,"NewError creates a new HTTPError instance with an optional message."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func NewError(code int, message ...string) *Error\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'app.Get("/", func(c *fiber.Ctx) error {\n return fiber.NewError(782, "Custom error message")\n})\n')),(0,r.kt)("h2",{id:"ischild"},"IsChild"),(0,r.kt)("p",null,"IsChild determines if the current process is a result of Prefork."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Signature"',title:'"Signature"'},"func IsChild() bool\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'// Prefork will spawn child processes\napp := fiber.New(fiber.Config{\n Prefork: true,\n})\n\nif !fiber.IsChild() {\n fmt.Println("I\'m the parent process")\n} else {\n fmt.Println("I\'m a child process")\n}\n\n// ...\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/8ffdbf67.740a7c05.js b/assets/js/8ffdbf67.05ebcf2a.js similarity index 98% rename from assets/js/8ffdbf67.740a7c05.js rename to assets/js/8ffdbf67.05ebcf2a.js index 4f90b46d52e..b36cffb087f 100644 --- a/assets/js/8ffdbf67.740a7c05.js +++ b/assets/js/8ffdbf67.05ebcf2a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5614],{3905:(e,t,r)=>{r.d(t,{Zo:()=>d,kt:()=>m});var n=r(7294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var u=n.createContext({}),s=function(e){var t=n.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},d=function(e){var t=s(e.components);return n.createElement(u.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,a=e.originalType,u=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),p=s(r),f=i,m=p["".concat(u,".").concat(f)]||p[f]||c[f]||a;return r?n.createElement(m,o(o({ref:t},d),{},{components:r})):n.createElement(m,o({ref:t},d))}));function m(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=r.length,o=new Array(a);o[0]=f;var l={};for(var u in t)hasOwnProperty.call(t,u)&&(l[u]=t[u]);l.originalType=e,l[p]="string"==typeof e?e:i,o[1]=l;for(var s=2;s{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>o,default:()=>c,frontMatter:()=>a,metadata:()=>l,toc:()=>s});var n=r(7462),i=(r(7294),r(3905));const a={id:"requestid",title:"RequestID"},o=void 0,l={unversionedId:"api/middleware/requestid",id:"api/middleware/requestid",title:"RequestID",description:"RequestID middleware for Fiber that adds an indentifier to the response.",source:"@site/docs/core/api/middleware/requestid.md",sourceDirName:"api/middleware",slug:"/api/middleware/requestid",permalink:"/next/api/middleware/requestid",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/requestid.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"requestid",title:"RequestID"},sidebar:"tutorialSidebar",previous:{title:"Redirect",permalink:"/next/api/middleware/redirect"},next:{title:"Rewrite",permalink:"/next/api/middleware/rewrite"}},u={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],d={toc:s},p="wrapper";function c(e){let{components:t,...r}=e;return(0,i.kt)(p,(0,n.Z)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"RequestID middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that adds an indentifier to the response."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/requestid"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(requestid.New())\n\n// Or extend your config for customization\napp.Use(requestid.New(requestid.Config{\n Header: "X-Custom-Header",\n Generator: func() string {\n return "static-id"\n },\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Header is the header key where to get/set the unique request ID\n //\n // Optional. Default: "X-Request-ID"\n Header string\n\n // Generator defines a function to generate the unique identifier.\n //\n // Optional. Default: utils.UUID\n Generator func() string\n\n // ContextKey defines the key used when storing the request ID in\n // the locals for a specific request.\n //\n // Optional. Default: requestid\n ContextKey interface{}\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("p",null,"The default config uses a fast UUID generator which will expose the number of\nrequests made to the server. To conceal this value for better privacy, use the\n",(0,i.kt)("inlineCode",{parentName:"p"},"utils.UUIDv4")," generator."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Header: fiber.HeaderXRequestID,\n Generator: utils.UUID,\n ContextKey: "requestid",\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[5614],{3905:(e,t,r)=>{r.d(t,{Zo:()=>d,kt:()=>m});var n=r(7294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var u=n.createContext({}),s=function(e){var t=n.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},d=function(e){var t=s(e.components);return n.createElement(u.Provider,{value:t},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,a=e.originalType,u=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),p=s(r),f=i,m=p["".concat(u,".").concat(f)]||p[f]||c[f]||a;return r?n.createElement(m,o(o({ref:t},d),{},{components:r})):n.createElement(m,o({ref:t},d))}));function m(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=r.length,o=new Array(a);o[0]=f;var l={};for(var u in t)hasOwnProperty.call(t,u)&&(l[u]=t[u]);l.originalType=e,l[p]="string"==typeof e?e:i,o[1]=l;for(var s=2;s{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>o,default:()=>c,frontMatter:()=>a,metadata:()=>l,toc:()=>s});var n=r(7462),i=(r(7294),r(3905));const a={id:"requestid",title:"RequestID"},o=void 0,l={unversionedId:"api/middleware/requestid",id:"api/middleware/requestid",title:"RequestID",description:"RequestID middleware for Fiber that adds an indentifier to the response.",source:"@site/docs/core/api/middleware/requestid.md",sourceDirName:"api/middleware",slug:"/api/middleware/requestid",permalink:"/next/api/middleware/requestid",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/requestid.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"requestid",title:"RequestID"},sidebar:"tutorialSidebar",previous:{title:"Redirect",permalink:"/next/api/middleware/redirect"},next:{title:"Rewrite",permalink:"/next/api/middleware/rewrite"}},u={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],d={toc:s},p="wrapper";function c(e){let{components:t,...r}=e;return(0,i.kt)(p,(0,n.Z)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"RequestID middleware for ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that adds an indentifier to the response."),(0,i.kt)("h2",{id:"signatures"},"Signatures"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/requestid"\n)\n')),(0,i.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Initialize default config\napp.Use(requestid.New())\n\n// Or extend your config for customization\napp.Use(requestid.New(requestid.Config{\n Header: "X-Custom-Header",\n Generator: func() string {\n return "static-id"\n },\n}))\n')),(0,i.kt)("h2",{id:"config"},"Config"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Header is the header key where to get/set the unique request ID\n //\n // Optional. Default: "X-Request-ID"\n Header string\n\n // Generator defines a function to generate the unique identifier.\n //\n // Optional. Default: utils.UUID\n Generator func() string\n\n // ContextKey defines the key used when storing the request ID in\n // the locals for a specific request.\n //\n // Optional. Default: requestid\n ContextKey interface{}\n}\n')),(0,i.kt)("h2",{id:"default-config"},"Default Config"),(0,i.kt)("p",null,"The default config uses a fast UUID generator which will expose the number of\nrequests made to the server. To conceal this value for better privacy, use the\n",(0,i.kt)("inlineCode",{parentName:"p"},"utils.UUIDv4")," generator."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Header: fiber.HeaderXRequestID,\n Generator: utils.UUID,\n ContextKey: "requestid",\n}\n')))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/9150d950.bae0706f.js b/assets/js/9150d950.ee863121.js similarity index 97% rename from assets/js/9150d950.bae0706f.js rename to assets/js/9150d950.ee863121.js index 7af6caf644f..8affb20fad8 100644 --- a/assets/js/9150d950.bae0706f.js +++ b/assets/js/9150d950.ee863121.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[746],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>m});var a=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function i(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),g=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},c=function(e){var t=g(e.components);return a.createElement(s.Provider,{value:t},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},f=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),p=g(r),f=n,m=p["".concat(s,".").concat(f)]||p[f]||u[f]||o;return r?a.createElement(m,i(i({ref:t},c),{},{components:r})):a.createElement(m,i({ref:t},c))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,i=new Array(o);i[0]=f;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:n,i[1]=l;for(var g=2;g{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>l,toc:()=>g});var a=r(7462),n=(r(7294),r(3905));const o={id:"swagger",title:"Swagger"},i=void 0,l={unversionedId:"swagger/swagger",id:"swagger/swagger",title:"Swagger",description:"Release",source:"@site/docs/contrib/swagger/README.md",sourceDirName:"swagger",slug:"/swagger/",permalink:"/contrib/swagger/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/swagger/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"swagger",title:"Swagger"},sidebar:"tutorialSidebar",previous:{title:"Paseto",permalink:"/contrib/paseto/"},next:{title:"Websocket",permalink:"/contrib/websocket/"}},s={},g=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Examples",id:"examples",level:3},{value:"Default Config",id:"default-config",level:3},{value:"Custom Config",id:"custom-config",level:3}],c={toc:g},p="wrapper";function u(e){let{components:t,...r}=e;return(0,n.kt)(p,(0,a.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=swagger*",alt:"Release"}),"\n",(0,n.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,n.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,n.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,n.kt)("p",null,"Swagger middleware for ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber"),". The middleware handles Swagger UI. "),(0,n.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#examples"},"Examples"))),(0,n.kt)("h3",{id:"signatures"},"Signatures"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,n.kt)("h3",{id:"examples"},"Examples"),(0,n.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/contrib/swagger"\n)\n')),(0,n.kt)("p",null,"Then create a Fiber app with app := fiber.New()."),(0,n.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,n.kt)("h3",{id:"default-config"},"Default Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"app.Use(swagger.New(cfg))\n")),(0,n.kt)("h3",{id:"custom-config"},"Custom Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'cfg := swagger.Config{\n BasePath: "/", //swagger ui base path\n FilePath: "./docs/swagger.json",\n}\n\napp.Use(swagger.New(cfg))\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[746],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>m});var a=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function i(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),g=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},c=function(e){var t=g(e.components);return a.createElement(s.Provider,{value:t},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},f=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),p=g(r),f=n,m=p["".concat(s,".").concat(f)]||p[f]||u[f]||o;return r?a.createElement(m,i(i({ref:t},c),{},{components:r})):a.createElement(m,i({ref:t},c))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,i=new Array(o);i[0]=f;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:n,i[1]=l;for(var g=2;g{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>l,toc:()=>g});var a=r(7462),n=(r(7294),r(3905));const o={id:"swagger",title:"Swagger"},i=void 0,l={unversionedId:"swagger/swagger",id:"swagger/swagger",title:"Swagger",description:"Release",source:"@site/docs/contrib/swagger/README.md",sourceDirName:"swagger",slug:"/swagger/",permalink:"/contrib/swagger/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/swagger/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"swagger",title:"Swagger"},sidebar:"tutorialSidebar",previous:{title:"Paseto",permalink:"/contrib/paseto/"},next:{title:"Websocket",permalink:"/contrib/websocket/"}},s={},g=[{value:"Table of Contents",id:"table-of-contents",level:3},{value:"Signatures",id:"signatures",level:3},{value:"Examples",id:"examples",level:3},{value:"Default Config",id:"default-config",level:3},{value:"Custom Config",id:"custom-config",level:3}],c={toc:g},p="wrapper";function u(e){let{components:t,...r}=e;return(0,n.kt)(p,(0,a.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,(0,n.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=swagger*",alt:"Release"}),"\n",(0,n.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,n.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,n.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,n.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,n.kt)("p",null,"Swagger middleware for ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber"),". The middleware handles Swagger UI. "),(0,n.kt)("h3",{id:"table-of-contents"},"Table of Contents"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#signatures"},"Signatures")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"#examples"},"Examples"))),(0,n.kt)("h3",{id:"signatures"},"Signatures"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,n.kt)("h3",{id:"examples"},"Examples"),(0,n.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/contrib/swagger"\n)\n')),(0,n.kt)("p",null,"Then create a Fiber app with app := fiber.New()."),(0,n.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,n.kt)("h3",{id:"default-config"},"Default Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},"app.Use(swagger.New(cfg))\n")),(0,n.kt)("h3",{id:"custom-config"},"Custom Config"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-go"},'cfg := swagger.Config{\n BasePath: "/", //swagger ui base path\n FilePath: "./docs/swagger.json",\n}\n\napp.Use(swagger.New(cfg))\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/9169002b.76549c1a.js b/assets/js/9169002b.f02a67c7.js similarity index 99% rename from assets/js/9169002b.76549c1a.js rename to assets/js/9169002b.f02a67c7.js index 044ce23943f..86ff9469ade 100644 --- a/assets/js/9169002b.76549c1a.js +++ b/assets/js/9169002b.f02a67c7.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9911],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var d=r.createContext({}),s=function(e){var t=r.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=s(e.components);return r.createElement(d.Provider,{value:t},e.children)},c="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,d=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),c=s(n),u=a,m=c["".concat(d,".").concat(u)]||c[u]||f[u]||i;return n?r.createElement(m,o(o({ref:t},p),{},{components:n})):r.createElement(m,o({ref:t},p))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=u;var l={};for(var d in t)hasOwnProperty.call(t,d)&&(l[d]=t[d]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var s=2;s{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>o,default:()=>f,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const i={id:"idempotency",title:"Idempotency"},o=void 0,l={unversionedId:"api/middleware/idempotency",id:"version-v2.x/api/middleware/idempotency",title:"Idempotency",description:"Idempotency middleware for Fiber allows for fault-tolerant APIs where duplicate requests \u2014 for example due to networking issues on the client-side \u2014 do not erroneously cause the same action performed multiple times on the server-side.",source:"@site/versioned_docs/version-v2.x/api/middleware/idempotency.md",sourceDirName:"api/middleware",slug:"/api/middleware/idempotency",permalink:"/api/middleware/idempotency",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"idempotency",title:"Idempotency"},sidebar:"tutorialSidebar",previous:{title:"Helmet",permalink:"/api/middleware/helmet"},next:{title:"Keyauth",permalink:"/api/middleware/keyauth"}},d={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Default Config",id:"default-config",level:3},{value:"Custom Config",id:"custom-config",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config-1",level:2}],p={toc:s},c="wrapper";function f(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Idempotency middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," allows for fault-tolerant APIs where duplicate requests \u2014 for example due to networking issues on the client-side \u2014 do not erroneously cause the same action performed multiple times on the server-side."),(0,a.kt)("p",null,"Refer to ",(0,a.kt)("a",{parentName:"p",href:"https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02"},"https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02")," for a better understanding."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/idempotency"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("h3",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"app.Use(idempotency.New())\n")),(0,a.kt)("h3",{id:"custom-config"},"Custom Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"app.Use(idempotency.New(idempotency.Config{\n Lifetime: 42 * time.Minute,\n // ...\n}))\n")),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: a function which skips the middleware on safe HTTP request method.\n Next func(c *fiber.Ctx) bool\n\n // Lifetime is the maximum lifetime of an idempotency key.\n //\n // Optional. Default: 30 * time.Minute\n Lifetime time.Duration\n\n // KeyHeader is the name of the header that contains the idempotency key.\n //\n // Optional. Default: X-Idempotency-Key\n KeyHeader string\n // KeyHeaderValidate defines a function to validate the syntax of the idempotency header.\n //\n // Optional. Default: a function which ensures the header is 36 characters long (the size of an UUID).\n KeyHeaderValidate func(string) error\n\n // KeepResponseHeaders is a list of headers that should be kept from the original response.\n //\n // Optional. Default: nil (to keep all headers)\n KeepResponseHeaders []string\n\n // Lock locks an idempotency key.\n //\n // Optional. Default: an in-memory locker for this process only.\n Lock Locker\n\n // Storage stores response data by idempotency key.\n //\n // Optional. Default: an in-memory storage for this process only.\n Storage fiber.Storage\n}\n")),(0,a.kt)("h2",{id:"default-config-1"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: func(c *fiber.Ctx) bool {\n // Skip middleware if the request was done using a safe HTTP method\n return fiber.IsMethodSafe(c.Method())\n },\n\n Lifetime: 30 * time.Minute,\n\n KeyHeader: "X-Idempotency-Key",\n KeyHeaderValidate: func(k string) error {\n if l, wl := len(k), 36; l != wl { // UUID length is 36 chars\n return fmt.Errorf("%w: invalid length: %d != %d", ErrInvalidIdempotencyKey, l, wl)\n }\n\n return nil\n },\n\n KeepResponseHeaders: nil,\n\n Lock: nil, // Set in configDefault so we don\'t allocate data here.\n\n Storage: nil, // Set in configDefault so we don\'t allocate data here.\n}\n')))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[9911],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var d=r.createContext({}),s=function(e){var t=r.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=s(e.components);return r.createElement(d.Provider,{value:t},e.children)},c="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,d=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),c=s(n),u=a,m=c["".concat(d,".").concat(u)]||c[u]||f[u]||i;return n?r.createElement(m,o(o({ref:t},p),{},{components:n})):r.createElement(m,o({ref:t},p))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=u;var l={};for(var d in t)hasOwnProperty.call(t,d)&&(l[d]=t[d]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var s=2;s{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>o,default:()=>f,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var r=n(7462),a=(n(7294),n(3905));const i={id:"idempotency",title:"Idempotency"},o=void 0,l={unversionedId:"api/middleware/idempotency",id:"version-v2.x/api/middleware/idempotency",title:"Idempotency",description:"Idempotency middleware for Fiber allows for fault-tolerant APIs where duplicate requests \u2014 for example due to networking issues on the client-side \u2014 do not erroneously cause the same action performed multiple times on the server-side.",source:"@site/versioned_docs/version-v2.x/api/middleware/idempotency.md",sourceDirName:"api/middleware",slug:"/api/middleware/idempotency",permalink:"/api/middleware/idempotency",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"idempotency",title:"Idempotency"},sidebar:"tutorialSidebar",previous:{title:"Helmet",permalink:"/api/middleware/helmet"},next:{title:"Keyauth",permalink:"/api/middleware/keyauth"}},d={},s=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Default Config",id:"default-config",level:3},{value:"Custom Config",id:"custom-config",level:3},{value:"Config",id:"config",level:3},{value:"Default Config",id:"default-config-1",level:2}],p={toc:s},c="wrapper";function f(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Idempotency middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," allows for fault-tolerant APIs where duplicate requests \u2014 for example due to networking issues on the client-side \u2014 do not erroneously cause the same action performed multiple times on the server-side."),(0,a.kt)("p",null,"Refer to ",(0,a.kt)("a",{parentName:"p",href:"https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02"},"https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02")," for a better understanding."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config ...Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/idempotency"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("h3",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"app.Use(idempotency.New())\n")),(0,a.kt)("h3",{id:"custom-config"},"Custom Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"app.Use(idempotency.New(idempotency.Config{\n Lifetime: 42 * time.Minute,\n // ...\n}))\n")),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: a function which skips the middleware on safe HTTP request method.\n Next func(c *fiber.Ctx) bool\n\n // Lifetime is the maximum lifetime of an idempotency key.\n //\n // Optional. Default: 30 * time.Minute\n Lifetime time.Duration\n\n // KeyHeader is the name of the header that contains the idempotency key.\n //\n // Optional. Default: X-Idempotency-Key\n KeyHeader string\n // KeyHeaderValidate defines a function to validate the syntax of the idempotency header.\n //\n // Optional. Default: a function which ensures the header is 36 characters long (the size of an UUID).\n KeyHeaderValidate func(string) error\n\n // KeepResponseHeaders is a list of headers that should be kept from the original response.\n //\n // Optional. Default: nil (to keep all headers)\n KeepResponseHeaders []string\n\n // Lock locks an idempotency key.\n //\n // Optional. Default: an in-memory locker for this process only.\n Lock Locker\n\n // Storage stores response data by idempotency key.\n //\n // Optional. Default: an in-memory storage for this process only.\n Storage fiber.Storage\n}\n")),(0,a.kt)("h2",{id:"default-config-1"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: func(c *fiber.Ctx) bool {\n // Skip middleware if the request was done using a safe HTTP method\n return fiber.IsMethodSafe(c.Method())\n },\n\n Lifetime: 30 * time.Minute,\n\n KeyHeader: "X-Idempotency-Key",\n KeyHeaderValidate: func(k string) error {\n if l, wl := len(k), 36; l != wl { // UUID length is 36 chars\n return fmt.Errorf("%w: invalid length: %d != %d", ErrInvalidIdempotencyKey, l, wl)\n }\n\n return nil\n },\n\n KeepResponseHeaders: nil,\n\n Lock: nil, // Set in configDefault so we don\'t allocate data here.\n\n Storage: nil, // Set in configDefault so we don\'t allocate data here.\n}\n')))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/96cc6114.9be8cbd2.js b/assets/js/96cc6114.3b4ac593.js similarity index 99% rename from assets/js/96cc6114.9be8cbd2.js rename to assets/js/96cc6114.3b4ac593.js index 71dbb2dae3b..0928ec71297 100644 --- a/assets/js/96cc6114.9be8cbd2.js +++ b/assets/js/96cc6114.3b4ac593.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[3e3],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>g});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),c=p(n),m=a,g=c["".concat(s,".").concat(m)]||c[m]||u[m]||i;return n?r.createElement(g,o(o({ref:t},d),{},{components:n})):r.createElement(g,o({ref:t},d))}));function g(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const i={id:"jwt",title:"JWT"},o=void 0,l={unversionedId:"jwt/jwt",id:"jwt/jwt",title:"JWT",description:"Release",source:"@site/docs/contrib/jwt/README.md",sourceDirName:"jwt",slug:"/jwt/",permalink:"/contrib/jwt/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/jwt/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"jwt",title:"JWT"},sidebar:"tutorialSidebar",previous:{title:"Fiberzerolog",permalink:"/contrib/fiberzerolog/"},next:{title:"Opafiber",permalink:"/contrib/opafiber/"}},s={},p=[{value:"Install",id:"install",level:3},{value:"Signature",id:"signature",level:3},{value:"Config",id:"config",level:3},{value:"HS256 Example",id:"hs256-example",level:3},{value:"HS256 Test",id:"hs256-test",level:3},{value:"RS256 Example",id:"rs256-example",level:3},{value:"RS256 Test",id:"rs256-test",level:3},{value:"JWK Set Test",id:"jwk-set-test",level:3},{value:"Custom KeyFunc example",id:"custom-keyfunc-example",level:3}],d={toc:p},c="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=jwt*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,'JWT returns a JSON Web Token (JWT) auth middleware.\nFor valid token, it sets the user in Ctx.Locals and calls next handler.\nFor invalid token, it returns "401 - Unauthorized" error.\nFor missing token, it returns "400 - Bad Request" error.'),(0,a.kt)("p",null,"Special thanks and credits to ",(0,a.kt)("a",{parentName:"p",href:"https://echo.labstack.com/middleware/jwt"},"Echo")),(0,a.kt)("h3",{id:"install"},"Install"),(0,a.kt)("p",null,"This middleware supports Fiber v1 & v2, install accordingly."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"go get -u github.com/gofiber/fiber/v2\ngo get -u github.com/gofiber/contrib/jwt\ngo get -u github.com/golang-jwt/jwt/v5\n")),(0,a.kt)("h3",{id:"signature"},"Signature"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"jwtware.New(config ...jwtware.Config) func(*fiber.Ctx) error\n")),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Property"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Description"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Default"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Filter"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) bool")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Defines a function to skip middleware"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"nil"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"SuccessHandler"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) error")),(0,a.kt)("td",{parentName:"tr",align:"left"},"SuccessHandler defines a function which is executed for a valid token."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"nil"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"ErrorHandler"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx, error) error")),(0,a.kt)("td",{parentName:"tr",align:"left"},"ErrorHandler defines a function which is executed for an invalid token."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"401 Invalid or expired JWT"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"SigningKey"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"interface{}")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Signing key to validate token. Used as fallback if SigningKeys has length 0."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"nil"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"SigningKeys"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"map[string]interface{}")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Map of signing keys to validate token with kid field usage."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"nil"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"ContextKey"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Context key to store user information from the token into context."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},'"user"'))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Claims"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"jwt.Claim")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Claims are extendable claims data defining token content."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"jwt.MapClaims{}"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"TokenLookup"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"TokenLookup is a string in the form of ",(0,a.kt)("inlineCode",{parentName:"td"},":")," that is used"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},'"header:Authorization"'))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"AuthScheme"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"AuthScheme to be used in the Authorization header. The default value (",(0,a.kt)("inlineCode",{parentName:"td"},'"Bearer"'),") will only be used in conjuction with the default ",(0,a.kt)("inlineCode",{parentName:"td"},"TokenLookup")," value."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},'"Bearer"'))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"KeyFunc"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func() jwt.Keyfunc")),(0,a.kt)("td",{parentName:"tr",align:"left"},"KeyFunc defines a user-defined function that supplies the public key for a token validation."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"jwtKeyFunc"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"JWKSetURLs"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"[]string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"A slice of unique JSON Web Key (JWK) Set URLs to used to parse JWTs."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"nil"))))),(0,a.kt)("h3",{id:"hs256-example"},"HS256 Example"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "time"\n\n "github.com/gofiber/fiber/v2"\n\n jwtware "github.com/gofiber/contrib/jwt"\n "github.com/golang-jwt/jwt/v5"\n)\n\nfunc main() {\n app := fiber.New()\n\n // Login route\n app.Post("/login", login)\n\n // Unauthenticated route\n app.Get("/", accessible)\n\n // JWT Middleware\n app.Use(jwtware.New(jwtware.Config{\n SigningKey: jwtware.SigningKey{Key: []byte("secret")},\n }))\n\n // Restricted Routes\n app.Get("/restricted", restricted)\n\n app.Listen(":3000")\n}\n\nfunc login(c *fiber.Ctx) error {\n user := c.FormValue("user")\n pass := c.FormValue("pass")\n\n // Throws Unauthorized error\n if user != "john" || pass != "doe" {\n return c.SendStatus(fiber.StatusUnauthorized)\n }\n\n // Create the Claims\n claims := jwt.MapClaims{\n "name": "John Doe",\n "admin": true,\n "exp": time.Now().Add(time.Hour * 72).Unix(),\n }\n\n // Create token\n token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)\n\n // Generate encoded token and send it as response.\n t, err := token.SignedString([]byte("secret"))\n if err != nil {\n return c.SendStatus(fiber.StatusInternalServerError)\n }\n\n return c.JSON(fiber.Map{"token": t})\n}\n\nfunc accessible(c *fiber.Ctx) error {\n return c.SendString("Accessible")\n}\n\nfunc restricted(c *fiber.Ctx) error {\n user := c.Locals("user").(*jwt.Token)\n claims := user.Claims.(jwt.MapClaims)\n name := claims["name"].(string)\n return c.SendString("Welcome " + name)\n}\n\n')),(0,a.kt)("h3",{id:"hs256-test"},"HS256 Test"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},"Login using username and password to retrieve a token.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},'curl --data "user=john&pass=doe" http://localhost:3000/login\n')),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},"Response")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-json"},'{\n "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NjE5NTcxMzZ9.RB3arc4-OyzASAaUhC2W3ReWaXAt_z2Fd3BN4aWTgEY"\n}\n')),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},"Request a restricted resource using the token in Authorization request header.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},'curl localhost:3000/restricted -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NjE5NTcxMzZ9.RB3arc4-OyzASAaUhC2W3ReWaXAt_z2Fd3BN4aWTgEY"\n')),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},"Response")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Welcome John Doe\n")),(0,a.kt)("h3",{id:"rs256-example"},"RS256 Example"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/rand"\n "crypto/rsa"\n "log"\n "time"\n\n "github.com/gofiber/fiber/v2"\n\n "github.com/golang-jwt/jwt/v5"\n\n jwtware "github.com/gofiber/contrib/jwt"\n)\n\nvar (\n // Obviously, this is just a test example. Do not do this in production.\n // In production, you would have the private key and public key pair generated\n // in advance. NEVER add a private key to any GitHub repo.\n privateKey *rsa.PrivateKey\n)\n\nfunc main() {\n app := fiber.New()\n\n // Just as a demo, generate a new private/public key pair on each run. See note above.\n rng := rand.Reader\n var err error\n privateKey, err = rsa.GenerateKey(rng, 2048)\n if err != nil {\n log.Fatalf("rsa.GenerateKey: %v", err)\n }\n\n // Login route\n app.Post("/login", login)\n\n // Unauthenticated route\n app.Get("/", accessible)\n\n // JWT Middleware\n app.Use(jwtware.New(jwtware.Config{\n SigningKey: jwtware.SigningKey{\n JWTAlg: jwtware.RS256,\n Key: privateKey.Public(),\n },\n }))\n\n // Restricted Routes\n app.Get("/restricted", restricted)\n\n app.Listen(":3000")\n}\n\nfunc login(c *fiber.Ctx) error {\n user := c.FormValue("user")\n pass := c.FormValue("pass")\n\n // Throws Unauthorized error\n if user != "john" || pass != "doe" {\n return c.SendStatus(fiber.StatusUnauthorized)\n }\n\n // Create the Claims\n claims := jwt.MapClaims{\n "name": "John Doe",\n "admin": true,\n "exp": time.Now().Add(time.Hour * 72).Unix(),\n }\n\n // Create token\n token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims)\n\n // Generate encoded token and send it as response.\n t, err := token.SignedString(privateKey)\n if err != nil {\n log.Printf("token.SignedString: %v", err)\n return c.SendStatus(fiber.StatusInternalServerError)\n }\n\n return c.JSON(fiber.Map{"token": t})\n}\n\nfunc accessible(c *fiber.Ctx) error {\n return c.SendString("Accessible")\n}\n\nfunc restricted(c *fiber.Ctx) error {\n user := c.Locals("user").(*jwt.Token)\n claims := user.Claims.(jwt.MapClaims)\n name := claims["name"].(string)\n return c.SendString("Welcome " + name)\n}\n')),(0,a.kt)("h3",{id:"rs256-test"},"RS256 Test"),(0,a.kt)("p",null,"The RS256 is actually identical to the HS256 test above."),(0,a.kt)("h3",{id:"jwk-set-test"},"JWK Set Test"),(0,a.kt)("p",null,"The tests are identical to basic ",(0,a.kt)("inlineCode",{parentName:"p"},"JWT")," tests above, with exception that ",(0,a.kt)("inlineCode",{parentName:"p"},"JWKSetURLs")," to valid public keys collection in JSON Web Key (JWK) Set format should be supplied. See ",(0,a.kt)("a",{parentName:"p",href:"https://www.rfc-editor.org/rfc/rfc7517"},"RFC 7517"),"."),(0,a.kt)("h3",{id:"custom-keyfunc-example"},"Custom KeyFunc example"),(0,a.kt)("p",null,"KeyFunc defines a user-defined function that supplies the public key for a token validation.\nThe function shall take care of verifying the signing algorithm and selecting the proper key.\nA user-defined KeyFunc can be useful if tokens are issued by an external party."),(0,a.kt)("p",null,"When a user-defined KeyFunc is provided, SigningKey, SigningKeys, and SigningMethod are ignored.\nThis is one of the three options to provide a token validation key.\nThe order of precedence is a user-defined KeyFunc, SigningKeys and SigningKey.\nRequired if neither SigningKeys nor SigningKey is provided.\nDefault to an internal implementation verifying the signing algorithm and selecting the proper key."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n "github.com/gofiber/fiber/v2"\n\n jwtware "github.com/gofiber/contrib/jwt"\n "github.com/golang-jwt/jwt/v5"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(jwtware.New(jwtware.Config{\n KeyFunc: customKeyFunc(),\n }))\n\n app.Get("/ok", func(c *fiber.Ctx) error {\n return c.SendString("OK")\n })\n}\n\nfunc customKeyFunc() jwt.Keyfunc {\n return func(t *jwt.Token) (interface{}, error) {\n // Always check the signing method\n if t.Method.Alg() != jwtware.HS256 {\n return nil, fmt.Errorf("Unexpected jwt signing method=%v", t.Header["alg"])\n }\n\n // TODO custom implementation of loading signing key like from a database\n signingKey := "secret"\n\n return []byte(signingKey), nil\n }\n}\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[3e3],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>g});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),c=p(n),m=a,g=c["".concat(s,".").concat(m)]||c[m]||u[m]||i;return n?r.createElement(g,o(o({ref:t},d),{},{components:n})):r.createElement(g,o({ref:t},d))}));function g(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const i={id:"jwt",title:"JWT"},o=void 0,l={unversionedId:"jwt/jwt",id:"jwt/jwt",title:"JWT",description:"Release",source:"@site/docs/contrib/jwt/README.md",sourceDirName:"jwt",slug:"/jwt/",permalink:"/contrib/jwt/",draft:!1,editUrl:"https://github.com/gofiber/contrib/edit/main/jwt/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"jwt",title:"JWT"},sidebar:"tutorialSidebar",previous:{title:"Fiberzerolog",permalink:"/contrib/fiberzerolog/"},next:{title:"Opafiber",permalink:"/contrib/opafiber/"}},s={},p=[{value:"Install",id:"install",level:3},{value:"Signature",id:"signature",level:3},{value:"Config",id:"config",level:3},{value:"HS256 Example",id:"hs256-example",level:3},{value:"HS256 Test",id:"hs256-test",level:3},{value:"RS256 Example",id:"rs256-example",level:3},{value:"RS256 Test",id:"rs256-test",level:3},{value:"JWK Set Test",id:"jwk-set-test",level:3},{value:"Custom KeyFunc example",id:"custom-keyfunc-example",level:3}],d={toc:p},c="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/contrib?filter=jwt*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/contrib/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,'JWT returns a JSON Web Token (JWT) auth middleware.\nFor valid token, it sets the user in Ctx.Locals and calls next handler.\nFor invalid token, it returns "401 - Unauthorized" error.\nFor missing token, it returns "400 - Bad Request" error.'),(0,a.kt)("p",null,"Special thanks and credits to ",(0,a.kt)("a",{parentName:"p",href:"https://echo.labstack.com/middleware/jwt"},"Echo")),(0,a.kt)("h3",{id:"install"},"Install"),(0,a.kt)("p",null,"This middleware supports Fiber v1 & v2, install accordingly."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"go get -u github.com/gofiber/fiber/v2\ngo get -u github.com/gofiber/contrib/jwt\ngo get -u github.com/golang-jwt/jwt/v5\n")),(0,a.kt)("h3",{id:"signature"},"Signature"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"jwtware.New(config ...jwtware.Config) func(*fiber.Ctx) error\n")),(0,a.kt)("h3",{id:"config"},"Config"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Property"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Description"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Default"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Filter"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) bool")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Defines a function to skip middleware"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"nil"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"SuccessHandler"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx) error")),(0,a.kt)("td",{parentName:"tr",align:"left"},"SuccessHandler defines a function which is executed for a valid token."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"nil"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"ErrorHandler"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func(*fiber.Ctx, error) error")),(0,a.kt)("td",{parentName:"tr",align:"left"},"ErrorHandler defines a function which is executed for an invalid token."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"401 Invalid or expired JWT"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"SigningKey"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"interface{}")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Signing key to validate token. Used as fallback if SigningKeys has length 0."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"nil"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"SigningKeys"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"map[string]interface{}")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Map of signing keys to validate token with kid field usage."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"nil"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"ContextKey"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Context key to store user information from the token into context."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},'"user"'))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"Claims"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"jwt.Claim")),(0,a.kt)("td",{parentName:"tr",align:"left"},"Claims are extendable claims data defining token content."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"jwt.MapClaims{}"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"TokenLookup"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"TokenLookup is a string in the form of ",(0,a.kt)("inlineCode",{parentName:"td"},":")," that is used"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},'"header:Authorization"'))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"AuthScheme"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"AuthScheme to be used in the Authorization header. The default value (",(0,a.kt)("inlineCode",{parentName:"td"},'"Bearer"'),") will only be used in conjuction with the default ",(0,a.kt)("inlineCode",{parentName:"td"},"TokenLookup")," value."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},'"Bearer"'))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"KeyFunc"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"func() jwt.Keyfunc")),(0,a.kt)("td",{parentName:"tr",align:"left"},"KeyFunc defines a user-defined function that supplies the public key for a token validation."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"jwtKeyFunc"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},"JWKSetURLs"),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"[]string")),(0,a.kt)("td",{parentName:"tr",align:"left"},"A slice of unique JSON Web Key (JWK) Set URLs to used to parse JWTs."),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"nil"))))),(0,a.kt)("h3",{id:"hs256-example"},"HS256 Example"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "time"\n\n "github.com/gofiber/fiber/v2"\n\n jwtware "github.com/gofiber/contrib/jwt"\n "github.com/golang-jwt/jwt/v5"\n)\n\nfunc main() {\n app := fiber.New()\n\n // Login route\n app.Post("/login", login)\n\n // Unauthenticated route\n app.Get("/", accessible)\n\n // JWT Middleware\n app.Use(jwtware.New(jwtware.Config{\n SigningKey: jwtware.SigningKey{Key: []byte("secret")},\n }))\n\n // Restricted Routes\n app.Get("/restricted", restricted)\n\n app.Listen(":3000")\n}\n\nfunc login(c *fiber.Ctx) error {\n user := c.FormValue("user")\n pass := c.FormValue("pass")\n\n // Throws Unauthorized error\n if user != "john" || pass != "doe" {\n return c.SendStatus(fiber.StatusUnauthorized)\n }\n\n // Create the Claims\n claims := jwt.MapClaims{\n "name": "John Doe",\n "admin": true,\n "exp": time.Now().Add(time.Hour * 72).Unix(),\n }\n\n // Create token\n token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)\n\n // Generate encoded token and send it as response.\n t, err := token.SignedString([]byte("secret"))\n if err != nil {\n return c.SendStatus(fiber.StatusInternalServerError)\n }\n\n return c.JSON(fiber.Map{"token": t})\n}\n\nfunc accessible(c *fiber.Ctx) error {\n return c.SendString("Accessible")\n}\n\nfunc restricted(c *fiber.Ctx) error {\n user := c.Locals("user").(*jwt.Token)\n claims := user.Claims.(jwt.MapClaims)\n name := claims["name"].(string)\n return c.SendString("Welcome " + name)\n}\n\n')),(0,a.kt)("h3",{id:"hs256-test"},"HS256 Test"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},"Login using username and password to retrieve a token.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},'curl --data "user=john&pass=doe" http://localhost:3000/login\n')),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},"Response")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-json"},'{\n "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NjE5NTcxMzZ9.RB3arc4-OyzASAaUhC2W3ReWaXAt_z2Fd3BN4aWTgEY"\n}\n')),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},"Request a restricted resource using the token in Authorization request header.")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},'curl localhost:3000/restricted -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NjE5NTcxMzZ9.RB3arc4-OyzASAaUhC2W3ReWaXAt_z2Fd3BN4aWTgEY"\n')),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},"Response")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"Welcome John Doe\n")),(0,a.kt)("h3",{id:"rs256-example"},"RS256 Example"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "crypto/rand"\n "crypto/rsa"\n "log"\n "time"\n\n "github.com/gofiber/fiber/v2"\n\n "github.com/golang-jwt/jwt/v5"\n\n jwtware "github.com/gofiber/contrib/jwt"\n)\n\nvar (\n // Obviously, this is just a test example. Do not do this in production.\n // In production, you would have the private key and public key pair generated\n // in advance. NEVER add a private key to any GitHub repo.\n privateKey *rsa.PrivateKey\n)\n\nfunc main() {\n app := fiber.New()\n\n // Just as a demo, generate a new private/public key pair on each run. See note above.\n rng := rand.Reader\n var err error\n privateKey, err = rsa.GenerateKey(rng, 2048)\n if err != nil {\n log.Fatalf("rsa.GenerateKey: %v", err)\n }\n\n // Login route\n app.Post("/login", login)\n\n // Unauthenticated route\n app.Get("/", accessible)\n\n // JWT Middleware\n app.Use(jwtware.New(jwtware.Config{\n SigningKey: jwtware.SigningKey{\n JWTAlg: jwtware.RS256,\n Key: privateKey.Public(),\n },\n }))\n\n // Restricted Routes\n app.Get("/restricted", restricted)\n\n app.Listen(":3000")\n}\n\nfunc login(c *fiber.Ctx) error {\n user := c.FormValue("user")\n pass := c.FormValue("pass")\n\n // Throws Unauthorized error\n if user != "john" || pass != "doe" {\n return c.SendStatus(fiber.StatusUnauthorized)\n }\n\n // Create the Claims\n claims := jwt.MapClaims{\n "name": "John Doe",\n "admin": true,\n "exp": time.Now().Add(time.Hour * 72).Unix(),\n }\n\n // Create token\n token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims)\n\n // Generate encoded token and send it as response.\n t, err := token.SignedString(privateKey)\n if err != nil {\n log.Printf("token.SignedString: %v", err)\n return c.SendStatus(fiber.StatusInternalServerError)\n }\n\n return c.JSON(fiber.Map{"token": t})\n}\n\nfunc accessible(c *fiber.Ctx) error {\n return c.SendString("Accessible")\n}\n\nfunc restricted(c *fiber.Ctx) error {\n user := c.Locals("user").(*jwt.Token)\n claims := user.Claims.(jwt.MapClaims)\n name := claims["name"].(string)\n return c.SendString("Welcome " + name)\n}\n')),(0,a.kt)("h3",{id:"rs256-test"},"RS256 Test"),(0,a.kt)("p",null,"The RS256 is actually identical to the HS256 test above."),(0,a.kt)("h3",{id:"jwk-set-test"},"JWK Set Test"),(0,a.kt)("p",null,"The tests are identical to basic ",(0,a.kt)("inlineCode",{parentName:"p"},"JWT")," tests above, with exception that ",(0,a.kt)("inlineCode",{parentName:"p"},"JWKSetURLs")," to valid public keys collection in JSON Web Key (JWK) Set format should be supplied. See ",(0,a.kt)("a",{parentName:"p",href:"https://www.rfc-editor.org/rfc/rfc7517"},"RFC 7517"),"."),(0,a.kt)("h3",{id:"custom-keyfunc-example"},"Custom KeyFunc example"),(0,a.kt)("p",null,"KeyFunc defines a user-defined function that supplies the public key for a token validation.\nThe function shall take care of verifying the signing algorithm and selecting the proper key.\nA user-defined KeyFunc can be useful if tokens are issued by an external party."),(0,a.kt)("p",null,"When a user-defined KeyFunc is provided, SigningKey, SigningKeys, and SigningMethod are ignored.\nThis is one of the three options to provide a token validation key.\nThe order of precedence is a user-defined KeyFunc, SigningKeys and SigningKey.\nRequired if neither SigningKeys nor SigningKey is provided.\nDefault to an internal implementation verifying the signing algorithm and selecting the proper key."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "fmt"\n "github.com/gofiber/fiber/v2"\n\n jwtware "github.com/gofiber/contrib/jwt"\n "github.com/golang-jwt/jwt/v5"\n)\n\nfunc main() {\n app := fiber.New()\n\n app.Use(jwtware.New(jwtware.Config{\n KeyFunc: customKeyFunc(),\n }))\n\n app.Get("/ok", func(c *fiber.Ctx) error {\n return c.SendString("OK")\n })\n}\n\nfunc customKeyFunc() jwt.Keyfunc {\n return func(t *jwt.Token) (interface{}, error) {\n // Always check the signing method\n if t.Method.Alg() != jwtware.HS256 {\n return nil, fmt.Errorf("Unexpected jwt signing method=%v", t.Header["alg"])\n }\n\n // TODO custom implementation of loading signing key like from a database\n signingKey := "secret"\n\n return []byte(signingKey), nil\n }\n}\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/9717e045.56d847ce.js b/assets/js/9717e045.0217e75f.js similarity index 98% rename from assets/js/9717e045.56d847ce.js rename to assets/js/9717e045.0217e75f.js index 96d343dfc5b..3c29bcdea54 100644 --- a/assets/js/9717e045.56d847ce.js +++ b/assets/js/9717e045.0217e75f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8030],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>f});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),u=s(r),d=o,f=u["".concat(l,".").concat(d)]||u[d]||m[d]||a;return r?n.createElement(f,i(i({ref:t},p),{},{components:r})):n.createElement(f,i({ref:t},p))}));function f(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c[u]="string"==typeof e?e:o,i[1]=c;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>m,frontMatter:()=>a,metadata:()=>c,toc:()=>s});var n=r(7462),o=(r(7294),r(3905));const a={id:"faster-fiber",title:"\u26a1 Make Fiber Faster",sidebar_position:7},i=void 0,c={unversionedId:"guide/faster-fiber",id:"version-v2.x/guide/faster-fiber",title:"\u26a1 Make Fiber Faster",description:"Custom JSON Encoder/Decoder",source:"@site/versioned_docs/version-v2.x/guide/faster-fiber.md",sourceDirName:"guide",slug:"/guide/faster-fiber",permalink:"/guide/faster-fiber",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:7,frontMatter:{id:"faster-fiber",title:"\u26a1 Make Fiber Faster",sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"\ud83e\ude9d Hooks",permalink:"/guide/hooks"},next:{title:"Extra",permalink:"/category/extra"}},l={},s=[{value:"Custom JSON Encoder/Decoder",id:"custom-json-encoderdecoder",level:2},{value:"References",id:"references",level:3}],p={toc:s},u="wrapper";function m(e){let{components:t,...r}=e;return(0,o.kt)(u,(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"custom-json-encoderdecoder"},"Custom JSON Encoder/Decoder"),(0,o.kt)("p",null,"Since Fiber v2.32.0, we use ",(0,o.kt)("strong",{parentName:"p"},"encoding/json")," as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of ",(0,o.kt)("strong",{parentName:"p"},"encoding/json"),", we recommend you to use these libraries:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/goccy/go-json"},"goccy/go-json")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/bytedance/sonic"},"bytedance/sonic")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/segmentio/encoding"},"segmentio/encoding")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/mailru/easyjson"},"mailru/easyjson")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/minio/simdjson-go"},"minio/simdjson-go")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/wI2L/jettison"},"wI2L/jettison"))),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'package main\n\nimport "github.com/gofiber/fiber/v2"\nimport "github.com/goccy/go-json"\n\nfunc main() {\n app := fiber.New(fiber.Config{\n JSONEncoder: json.Marshal,\n JSONDecoder: json.Unmarshal,\n })\n\n # ...\n}\n')),(0,o.kt)("h3",{id:"references"},"References"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/api/client#jsonencoder"},"Set custom JSON encoder for client")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/api/client#jsondecoder"},"Set custom JSON decoder for client")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/api/fiber#config"},"Set custom JSON encoder for application")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/api/fiber#config"},"Set custom JSON decoder for application"))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8030],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>f});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),u=s(r),d=o,f=u["".concat(l,".").concat(d)]||u[d]||m[d]||a;return r?n.createElement(f,i(i({ref:t},p),{},{components:r})):n.createElement(f,i({ref:t},p))}));function f(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c[u]="string"==typeof e?e:o,i[1]=c;for(var s=2;s{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>m,frontMatter:()=>a,metadata:()=>c,toc:()=>s});var n=r(7462),o=(r(7294),r(3905));const a={id:"faster-fiber",title:"\u26a1 Make Fiber Faster",sidebar_position:7},i=void 0,c={unversionedId:"guide/faster-fiber",id:"version-v2.x/guide/faster-fiber",title:"\u26a1 Make Fiber Faster",description:"Custom JSON Encoder/Decoder",source:"@site/versioned_docs/version-v2.x/guide/faster-fiber.md",sourceDirName:"guide",slug:"/guide/faster-fiber",permalink:"/guide/faster-fiber",draft:!1,tags:[],version:"v2.x",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",sidebarPosition:7,frontMatter:{id:"faster-fiber",title:"\u26a1 Make Fiber Faster",sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"\ud83e\ude9d Hooks",permalink:"/guide/hooks"},next:{title:"Extra",permalink:"/category/extra"}},l={},s=[{value:"Custom JSON Encoder/Decoder",id:"custom-json-encoderdecoder",level:2},{value:"References",id:"references",level:3}],p={toc:s},u="wrapper";function m(e){let{components:t,...r}=e;return(0,o.kt)(u,(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"custom-json-encoderdecoder"},"Custom JSON Encoder/Decoder"),(0,o.kt)("p",null,"Since Fiber v2.32.0, we use ",(0,o.kt)("strong",{parentName:"p"},"encoding/json")," as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of ",(0,o.kt)("strong",{parentName:"p"},"encoding/json"),", we recommend you to use these libraries:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/goccy/go-json"},"goccy/go-json")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/bytedance/sonic"},"bytedance/sonic")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/segmentio/encoding"},"segmentio/encoding")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/mailru/easyjson"},"mailru/easyjson")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/minio/simdjson-go"},"minio/simdjson-go")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/wI2L/jettison"},"wI2L/jettison"))),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go",metastring:'title="Example"',title:'"Example"'},'package main\n\nimport "github.com/gofiber/fiber/v2"\nimport "github.com/goccy/go-json"\n\nfunc main() {\n app := fiber.New(fiber.Config{\n JSONEncoder: json.Marshal,\n JSONDecoder: json.Unmarshal,\n })\n\n # ...\n}\n')),(0,o.kt)("h3",{id:"references"},"References"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/api/client#jsonencoder"},"Set custom JSON encoder for client")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/api/client#jsondecoder"},"Set custom JSON decoder for client")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/api/fiber#config"},"Set custom JSON encoder for application")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/api/fiber#config"},"Set custom JSON decoder for application"))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/98ce83f7.f6b99736.js b/assets/js/98ce83f7.bfa27ff1.js similarity index 99% rename from assets/js/98ce83f7.f6b99736.js rename to assets/js/98ce83f7.bfa27ff1.js index a8c70ed7050..e309ec62eb4 100644 --- a/assets/js/98ce83f7.f6b99736.js +++ b/assets/js/98ce83f7.bfa27ff1.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[3779],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>u});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=a.createContext({}),m=function(e){var t=a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},s=function(e){var t=m(e.components);return a.createElement(o.Provider,{value:t},e.children)},c="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,o=e.parentName,s=p(e,["components","mdxType","originalType","parentName"]),c=m(n),d=r,u=c["".concat(o,".").concat(d)]||c[d]||h[d]||l;return n?a.createElement(u,i(i({ref:t},s),{},{components:n})):a.createElement(u,i({ref:t},s))}));function u(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=d;var p={};for(var o in t)hasOwnProperty.call(t,o)&&(p[o]=t[o]);p.originalType=e,p[c]="string"==typeof e?e:r,i[1]=p;for(var m=2;m{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>i,default:()=>h,frontMatter:()=>l,metadata:()=>p,toc:()=>m});var a=n(7462),r=(n(7294),n(3905));const l={id:"html",title:"HTML"},i=void 0,p={unversionedId:"html/html",id:"html/html",title:"HTML",description:"Release",source:"@site/docs/template/html/README.md",sourceDirName:"html",slug:"/html/",permalink:"/template/html/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/html/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"html",title:"HTML"},sidebar:"tutorialSidebar",previous:{title:"Handlebars",permalink:"/template/handlebars/"},next:{title:"Golang Templates Cheatsheet",permalink:"/template/html/TEMPLATES_CHEATSHEET"}},o={},m=[{value:"Basic Example",id:"basic-example",level:3},{value:"Example with embed.FS",id:"example-with-embedfs",level:3},{value:"Example with innerHTML",id:"example-with-innerhtml",level:3}],s={toc:m},c="wrapper";function h(e){let{components:t,...n}=e;return(0,r.kt)(c,(0,a.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,r.kt)("p",null,"HTML is the official Go template engine ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/pkg/html/template/"},"html/template"),", to see the original syntax documentation please ",(0,r.kt)("a",{parentName:"p",href:"/template/html/TEMPLATES_CHEATSHEET"},"click here")),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Info:")),(0,r.kt)("p",null,"All templates within the specified view directory are analyzed and compiled at the beginning to increase the performance when using them.\nThus it should be noted that no ",(0,r.kt)("inlineCode",{parentName:"p"},"definition")," with the same name should exist, otherwise they will overwrite each other.\nFor templating the ",(0,r.kt)("inlineCode",{parentName:"p"},"{{embed}}")," tag should be used"),(0,r.kt)("h3",{id:"basic-example"},"Basic Example"),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/index.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},'{{template "partials/header" .}}\n\n

{{.Title}}

\n\n{{template "partials/footer" .}}\n')),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/partials/header.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

Header

\n")),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/partials/footer.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

Footer

\n")),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/layouts/main.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"\n\n \n Main\n \n\n \n {{embed}}\n \n\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/html/v2"\n)\n\nfunc main() {\n // Create a new engine\n engine := html.New("./views", ".html")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := html.NewFileSystem(http.Dir("./views", ".html"))\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')),(0,r.kt)("h3",{id:"example-with-embedfs"},"Example with embed.FS"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n "net/http"\n "embed"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/html"\n)\n\n//go:embed views/*\nvar viewsfs embed.FS\n\nfunc main() {\n engine := html.NewFileSystem(http.FS(viewsfs), ".html")\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index - start with views directory\n return c.Render("views/index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("p",null,"and change the starting point to the views directory"),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/index.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},'{{template "views/partials/header" .}}\n\n

{{.Title}}

\n\n{{template "views/partials/footer" .}}\n')),(0,r.kt)("h3",{id:"example-with-innerhtml"},"Example with innerHTML"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "embed"\n "html/template"\n "log"\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/html"\n)\n\n//go:embed views/*\nvar viewsfs embed.FS\n\nfunc main() {\n engine := html.NewFileSystem(http.FS(viewsfs), ".html")\n engine.AddFunc(\n // add unescape function\n "unescape", func(s string) template.HTML {\n return template.HTML(s)\n },\n )\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{Views: engine})\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("views/index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("p",null,"and change the starting point to the views directory"),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/index.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

{{ unescape .Title}}

\n")),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"html output")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

Hello, World!

\n")))}h.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[3779],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>u});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=a.createContext({}),m=function(e){var t=a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},s=function(e){var t=m(e.components);return a.createElement(o.Provider,{value:t},e.children)},c="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,o=e.parentName,s=p(e,["components","mdxType","originalType","parentName"]),c=m(n),d=r,u=c["".concat(o,".").concat(d)]||c[d]||h[d]||l;return n?a.createElement(u,i(i({ref:t},s),{},{components:n})):a.createElement(u,i({ref:t},s))}));function u(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=d;var p={};for(var o in t)hasOwnProperty.call(t,o)&&(p[o]=t[o]);p.originalType=e,p[c]="string"==typeof e?e:r,i[1]=p;for(var m=2;m{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>i,default:()=>h,frontMatter:()=>l,metadata:()=>p,toc:()=>m});var a=n(7462),r=(n(7294),n(3905));const l={id:"html",title:"HTML"},i=void 0,p={unversionedId:"html/html",id:"html/html",title:"HTML",description:"Release",source:"@site/docs/template/html/README.md",sourceDirName:"html",slug:"/html/",permalink:"/template/html/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/html/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"html",title:"HTML"},sidebar:"tutorialSidebar",previous:{title:"Handlebars",permalink:"/template/handlebars/"},next:{title:"Golang Templates Cheatsheet",permalink:"/template/html/TEMPLATES_CHEATSHEET"}},o={},m=[{value:"Basic Example",id:"basic-example",level:3},{value:"Example with embed.FS",id:"example-with-embedfs",level:3},{value:"Example with innerHTML",id:"example-with-innerhtml",level:3}],s={toc:m},c="wrapper";function h(e){let{components:t,...n}=e;return(0,r.kt)(c,(0,a.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,(0,r.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=django*",alt:"Release"}),"\n",(0,r.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,r.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,r.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,r.kt)("p",null,"HTML is the official Go template engine ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/pkg/html/template/"},"html/template"),", to see the original syntax documentation please ",(0,r.kt)("a",{parentName:"p",href:"/template/html/TEMPLATES_CHEATSHEET"},"click here")),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Info:")),(0,r.kt)("p",null,"All templates within the specified view directory are analyzed and compiled at the beginning to increase the performance when using them.\nThus it should be noted that no ",(0,r.kt)("inlineCode",{parentName:"p"},"definition")," with the same name should exist, otherwise they will overwrite each other.\nFor templating the ",(0,r.kt)("inlineCode",{parentName:"p"},"{{embed}}")," tag should be used"),(0,r.kt)("h3",{id:"basic-example"},"Basic Example"),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/index.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},'{{template "partials/header" .}}\n\n

{{.Title}}

\n\n{{template "partials/footer" .}}\n')),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/partials/header.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

Header

\n")),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/partials/footer.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

Footer

\n")),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/layouts/main.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"\n\n \n Main\n \n\n \n {{embed}}\n \n\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/html/v2"\n)\n\nfunc main() {\n // Create a new engine\n engine := html.New("./views", ".html")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := html.NewFileSystem(http.Dir("./views", ".html"))\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')),(0,r.kt)("h3",{id:"example-with-embedfs"},"Example with embed.FS"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n "net/http"\n "embed"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/html"\n)\n\n//go:embed views/*\nvar viewsfs embed.FS\n\nfunc main() {\n engine := html.NewFileSystem(http.FS(viewsfs), ".html")\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index - start with views directory\n return c.Render("views/index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("p",null,"and change the starting point to the views directory"),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/index.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},'{{template "views/partials/header" .}}\n\n

{{.Title}}

\n\n{{template "views/partials/footer" .}}\n')),(0,r.kt)("h3",{id:"example-with-innerhtml"},"Example with innerHTML"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "embed"\n "html/template"\n "log"\n "net/http"\n\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/html"\n)\n\n//go:embed views/*\nvar viewsfs embed.FS\n\nfunc main() {\n engine := html.NewFileSystem(http.FS(viewsfs), ".html")\n engine.AddFunc(\n // add unescape function\n "unescape", func(s string) template.HTML {\n return template.HTML(s)\n },\n )\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{Views: engine})\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("views/index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n')),(0,r.kt)("p",null,"and change the starting point to the views directory"),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},(0,r.kt)("strong",{parentName:"em"},"./views/index.html"))),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

{{ unescape .Title}}

\n")),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"html output")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-html"},"

Hello, World!

\n")))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/99c84a64.4d700083.js b/assets/js/99c84a64.90813a0c.js similarity index 98% rename from assets/js/99c84a64.4d700083.js rename to assets/js/99c84a64.90813a0c.js index beab45c031d..ceebe66b948 100644 --- a/assets/js/99c84a64.4d700083.js +++ b/assets/js/99c84a64.90813a0c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6426],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=r.createContext({}),c=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=c(e.components);return r.createElement(p.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,p=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),m=c(n),d=a,f=m["".concat(p,".").concat(d)]||m[d]||u[d]||i;return n?r.createElement(f,o(o({ref:t},s),{},{components:n})):r.createElement(f,o({ref:t},s))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=d;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[m]="string"==typeof e?e:a,o[1]=l;for(var c=2;c{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=n(7462),a=(n(7294),n(3905));const i={id:"ace",title:"Ace"},o=void 0,l={unversionedId:"ace/ace",id:"ace/ace",title:"Ace",description:"Release",source:"@site/docs/template/ace/README.md",sourceDirName:"ace",slug:"/ace/",permalink:"/template/ace/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/ace/README.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"ace",title:"Ace"},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udc4b Welcome",permalink:"/template/"},next:{title:"Amber",permalink:"/template/amber/"}},p={},c=[{value:"Basic Example",id:"basic-example",level:3}],s={toc:c},m="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(m,(0,r.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=ace*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Ace is a template engine create by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/yosssi/ace"},"yossi"),", to see the original syntax documentation please ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/yosssi/ace/blob/master/documentation/syntax.md"},"click here")),(0,a.kt)("h3",{id:"basic-example"},"Basic Example"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/index.ace"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"= include ./views/partials/header .\n\nh1 {{.Title}}\n\n= include ./views/partials/footer .\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/header.ace"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h1 Header\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/footer.ace"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h1 Footer\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/layouts/main.ace"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"= doctype html\nhtml\n head\n title Main\n body\n {{embed}}\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n \n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/ace/v2"\n)\n\nfunc main() {\n // Create a new engine\n engine := ace.New("./views", ".ace")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := html.NewFileSystem(http.Dir("./views", ".ace"))\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[6426],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>f});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=r.createContext({}),c=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=c(e.components);return r.createElement(p.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,p=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),m=c(n),d=a,f=m["".concat(p,".").concat(d)]||m[d]||u[d]||i;return n?r.createElement(f,o(o({ref:t},s),{},{components:n})):r.createElement(f,o({ref:t},s))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=d;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[m]="string"==typeof e?e:a,o[1]=l;for(var c=2;c{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=n(7462),a=(n(7294),n(3905));const i={id:"ace",title:"Ace"},o=void 0,l={unversionedId:"ace/ace",id:"ace/ace",title:"Ace",description:"Release",source:"@site/docs/template/ace/README.md",sourceDirName:"ace",slug:"/ace/",permalink:"/template/ace/",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/ace/README.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"ace",title:"Ace"},sidebar:"tutorialSidebar",previous:{title:"\ud83d\udc4b Welcome",permalink:"/template/"},next:{title:"Amber",permalink:"/template/amber/"}},p={},c=[{value:"Basic Example",id:"basic-example",level:3}],s={toc:c},m="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(m,(0,r.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,(0,a.kt)("img",{parentName:"p",src:"https://img.shields.io/github/v/tag/gofiber/template?filter=ace*",alt:"Release"}),"\n",(0,a.kt)("a",{parentName:"p",href:"https://gofiber.io/discord"},(0,a.kt)("img",{parentName:"a",src:"https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7",alt:"Discord"})),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Tests/badge.svg",alt:"Test"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Security/badge.svg",alt:"Security"}),"\n",(0,a.kt)("img",{parentName:"p",src:"https://github.com/gofiber/template/workflows/Linter/badge.svg",alt:"Linter"})),(0,a.kt)("p",null,"Ace is a template engine create by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/yosssi/ace"},"yossi"),", to see the original syntax documentation please ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/yosssi/ace/blob/master/documentation/syntax.md"},"click here")),(0,a.kt)("h3",{id:"basic-example"},"Basic Example"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/index.ace"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"= include ./views/partials/header .\n\nh1 {{.Title}}\n\n= include ./views/partials/footer .\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/header.ace"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h1 Header\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/partials/footer.ace"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"h1 Footer\n")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},(0,a.kt)("strong",{parentName:"em"},"./views/layouts/main.ace"))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},"= doctype html\nhtml\n head\n title Main\n body\n {{embed}}\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "log"\n \n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/template/ace/v2"\n)\n\nfunc main() {\n // Create a new engine\n engine := ace.New("./views", ".ace")\n\n // Or from an embedded system\n // See github.com/gofiber/embed for examples\n // engine := html.NewFileSystem(http.Dir("./views", ".ace"))\n\n // Pass the engine to the Views\n app := fiber.New(fiber.Config{\n Views: engine,\n })\n\n app.Get("/", func(c *fiber.Ctx) error {\n // Render index\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n })\n })\n\n app.Get("/layout", func(c *fiber.Ctx) error {\n // Render index within layouts/main\n return c.Render("index", fiber.Map{\n "Title": "Hello, World!",\n }, "layouts/main")\n })\n\n log.Fatal(app.Listen(":3000"))\n}\n\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/99d23504.5f4c6a63.js b/assets/js/99d23504.8dcb390c.js similarity index 99% rename from assets/js/99d23504.5f4c6a63.js rename to assets/js/99d23504.8dcb390c.js index 08599b90b68..04f91fe573b 100644 --- a/assets/js/99d23504.5f4c6a63.js +++ b/assets/js/99d23504.8dcb390c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8103],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),d=u(n),f=a,m=d["".concat(l,".").concat(f)]||d[f]||p[f]||i;return n?r.createElement(m,o(o({ref:t},c),{},{components:n})):r.createElement(m,o({ref:t},c))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=f;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[d]="string"==typeof e?e:a,o[1]=s;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>s,toc:()=>u});var r=n(7462),a=(n(7294),n(3905));const i={id:"basicauth",title:"BasicAuth"},o=void 0,s={unversionedId:"api/middleware/basicauth",id:"api/middleware/basicauth",title:"BasicAuth",description:"Basic Authentication middleware for Fiber that provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized or a custom response for missing or invalid credentials.",source:"@site/docs/core/api/middleware/basicauth.md",sourceDirName:"api/middleware",slug:"/api/middleware/basicauth",permalink:"/next/api/middleware/basicauth",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/basicauth.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"basicauth",title:"BasicAuth"},sidebar:"tutorialSidebar",previous:{title:"Adaptor",permalink:"/next/api/middleware/adaptor"},next:{title:"Cache",permalink:"/next/api/middleware/cache"}},l={},u=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],c={toc:u},d="wrapper";function p(e){let{components:t,...n}=e;return(0,a.kt)(d,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Basic Authentication middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that provides an HTTP basic authentication. It calls the next handler for valid credentials and ",(0,a.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401"},"401 Unauthorized")," or a custom response for missing or invalid credentials."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/basicauth"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Provide a minimal config\napp.Use(basicauth.New(basicauth.Config{\n Users: map[string]string{\n "john": "doe",\n "admin": "123456",\n },\n}))\n\n// Or extend your config for customization\napp.Use(basicauth.New(basicauth.Config{\n Users: map[string]string{\n "john": "doe",\n "admin": "123456",\n },\n Realm: "Forbidden",\n Authorizer: func(user, pass string) bool {\n if user == "john" && pass == "doe" {\n return true\n }\n if user == "admin" && pass == "123456" {\n return true\n }\n return false\n },\n Unauthorized: func(c *fiber.Ctx) error {\n return c.SendFile("./unauthorized.html")\n },\n ContextUsername: "_user",\n ContextPassword: "_pass",\n}))\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Users defines the allowed credentials\n //\n // Required. Default: map[string]string{}\n Users map[string]string\n\n // Realm is a string to define realm attribute of BasicAuth.\n // the realm identifies the system to authenticate against\n // and can be used by clients to save credentials\n //\n // Optional. Default: "Restricted".\n Realm string\n\n // Authorizer defines a function you can pass\n // to check the credentials however you want.\n // It will be called with a username and password\n // and is expected to return true or false to indicate\n // that the credentials were approved or not.\n //\n // Optional. Default: nil.\n Authorizer func(string, string) bool\n\n // Unauthorized defines the response body for unauthorized responses.\n // By default it will return with a 401 Unauthorized and the correct WWW-Auth header\n //\n // Optional. Default: nil\n Unauthorized fiber.Handler\n\n // ContextUser is the key to store the username in Locals\n //\n // Optional. Default: "username"\n ContextUsername string\n\n // ContextPass is the key to store the password in Locals\n //\n // Optional. Default: "password"\n ContextPassword string\n}\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Users: map[string]string{},\n Realm: "Restricted",\n Authorizer: nil,\n Unauthorized: nil,\n ContextUsername: "username",\n ContextPassword: "password",\n}\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[8103],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),d=u(n),f=a,m=d["".concat(l,".").concat(f)]||d[f]||p[f]||i;return n?r.createElement(m,o(o({ref:t},c),{},{components:n})):r.createElement(m,o({ref:t},c))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=f;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[d]="string"==typeof e?e:a,o[1]=s;for(var u=2;u{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>s,toc:()=>u});var r=n(7462),a=(n(7294),n(3905));const i={id:"basicauth",title:"BasicAuth"},o=void 0,s={unversionedId:"api/middleware/basicauth",id:"api/middleware/basicauth",title:"BasicAuth",description:"Basic Authentication middleware for Fiber that provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized or a custom response for missing or invalid credentials.",source:"@site/docs/core/api/middleware/basicauth.md",sourceDirName:"api/middleware",slug:"/api/middleware/basicauth",permalink:"/next/api/middleware/basicauth",draft:!1,editUrl:"https://github.com/gofiber/fiber/edit/master/docs/api/middleware/basicauth.md",tags:[],version:"current",lastUpdatedAt:1688843515,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{id:"basicauth",title:"BasicAuth"},sidebar:"tutorialSidebar",previous:{title:"Adaptor",permalink:"/next/api/middleware/adaptor"},next:{title:"Cache",permalink:"/next/api/middleware/cache"}},l={},u=[{value:"Signatures",id:"signatures",level:2},{value:"Examples",id:"examples",level:2},{value:"Config",id:"config",level:2},{value:"Default Config",id:"default-config",level:2}],c={toc:u},d="wrapper";function p(e){let{components:t,...n}=e;return(0,a.kt)(d,(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Basic Authentication middleware for ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/gofiber/fiber"},"Fiber")," that provides an HTTP basic authentication. It calls the next handler for valid credentials and ",(0,a.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401"},"401 Unauthorized")," or a custom response for missing or invalid credentials."),(0,a.kt)("h2",{id:"signatures"},"Signatures"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"func New(config Config) fiber.Handler\n")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("p",null,"Import the middleware package that is part of the Fiber web framework"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'import (\n "github.com/gofiber/fiber/v2"\n "github.com/gofiber/fiber/v2/middleware/basicauth"\n)\n')),(0,a.kt)("p",null,"After you initiate your Fiber app, you can use the following possibilities:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Provide a minimal config\napp.Use(basicauth.New(basicauth.Config{\n Users: map[string]string{\n "john": "doe",\n "admin": "123456",\n },\n}))\n\n// Or extend your config for customization\napp.Use(basicauth.New(basicauth.Config{\n Users: map[string]string{\n "john": "doe",\n "admin": "123456",\n },\n Realm: "Forbidden",\n Authorizer: func(user, pass string) bool {\n if user == "john" && pass == "doe" {\n return true\n }\n if user == "admin" && pass == "123456" {\n return true\n }\n return false\n },\n Unauthorized: func(c *fiber.Ctx) error {\n return c.SendFile("./unauthorized.html")\n },\n ContextUsername: "_user",\n ContextPassword: "_pass",\n}))\n')),(0,a.kt)("h2",{id:"config"},"Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Config defines the config for middleware.\ntype Config struct {\n // Next defines a function to skip this middleware when returned true.\n //\n // Optional. Default: nil\n Next func(c *fiber.Ctx) bool\n\n // Users defines the allowed credentials\n //\n // Required. Default: map[string]string{}\n Users map[string]string\n\n // Realm is a string to define realm attribute of BasicAuth.\n // the realm identifies the system to authenticate against\n // and can be used by clients to save credentials\n //\n // Optional. Default: "Restricted".\n Realm string\n\n // Authorizer defines a function you can pass\n // to check the credentials however you want.\n // It will be called with a username and password\n // and is expected to return true or false to indicate\n // that the credentials were approved or not.\n //\n // Optional. Default: nil.\n Authorizer func(string, string) bool\n\n // Unauthorized defines the response body for unauthorized responses.\n // By default it will return with a 401 Unauthorized and the correct WWW-Auth header\n //\n // Optional. Default: nil\n Unauthorized fiber.Handler\n\n // ContextUser is the key to store the username in Locals\n //\n // Optional. Default: "username"\n ContextUsername string\n\n // ContextPass is the key to store the password in Locals\n //\n // Optional. Default: "password"\n ContextPassword string\n}\n')),(0,a.kt)("h2",{id:"default-config"},"Default Config"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'var ConfigDefault = Config{\n Next: nil,\n Users: map[string]string{},\n Realm: "Restricted",\n Authorizer: nil,\n Unauthorized: nil,\n ContextUsername: "username",\n ContextPassword: "password",\n}\n')))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/9a4187db.f1382ca0.js b/assets/js/9a4187db.b187515f.js similarity index 99% rename from assets/js/9a4187db.f1382ca0.js rename to assets/js/9a4187db.b187515f.js index 1c9154b6a4f..3c696e9a047 100644 --- a/assets/js/9a4187db.f1382ca0.js +++ b/assets/js/9a4187db.b187515f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfiber_docs=self.webpackChunkfiber_docs||[]).push([[4809],{3905:(e,t,a)=>{a.d(t,{Zo:()=>m,kt:()=>d});var n=a(7294);function l(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function r(e){for(var t=1;t=0||(l[a]=e[a]);return l}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(l[a]=e[a])}return l}var o=n.createContext({}),p=function(e){var t=n.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):r(r({},t),e)),a},m=function(e){var t=p(e.components);return n.createElement(o.Provider,{value:t},e.children)},u="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var a=e.components,l=e.mdxType,i=e.originalType,o=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),u=p(a),c=l,d=u["".concat(o,".").concat(c)]||u[c]||h[c]||i;return a?n.createElement(d,r(r({ref:t},m),{},{components:a})):n.createElement(d,r({ref:t},m))}));function d(e,t){var a=arguments,l=t&&t.mdxType;if("string"==typeof e||l){var i=a.length,r=new Array(i);r[0]=c;var s={};for(var o in t)hasOwnProperty.call(t,o)&&(s[o]=t[o]);s.originalType=e,s[u]="string"==typeof e?e:l,r[1]=s;for(var p=2;p{a.r(t),a.d(t,{assets:()=>o,contentTitle:()=>r,default:()=>h,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var n=a(7462),l=(a(7294),a(3905));const i={},r="Golang Templates Cheatsheet",s={unversionedId:"html/TEMPLATES_CHEATSHEET",id:"html/TEMPLATES_CHEATSHEET",title:"Golang Templates Cheatsheet",description:"The Go standard library provides a set of packages to generate output. The text/template package implements templates for generating text output, while the html/template package implements templates for generating HTML output that is safe against certain attacks. Both packages use the same interface but the following examples of the core features are directed towards HTML applications.",source:"@site/docs/template/html/TEMPLATES_CHEATSHEET.md",sourceDirName:"html",slug:"/html/TEMPLATES_CHEATSHEET",permalink:"/template/html/TEMPLATES_CHEATSHEET",draft:!1,editUrl:"https://github.com/gofiber/template/edit/main/html/TEMPLATES_CHEATSHEET.md",tags:[],version:"current",lastUpdatedAt:1688843056,formattedLastUpdatedAt:"Jul 8, 2023",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"HTML",permalink:"/template/html/"},next:{title:"Jet",permalink:"/template/jet/"}},o={},p=[{value:"Table of Contents",id:"table-of-contents",level:2},{value:"Parsing and Creating Templates",id:"parsing-and-creating-templates",level:2},{value:"Naming Templates",id:"naming-templates",level:4},{value:"Creating a Template",id:"creating-a-template",level:4},{value:"Parsing Multiple Templates",id:"parsing-multiple-templates",level:4},{value:"Executing Templates",id:"executing-templates",level:2},{value:"Execute a Single Template",id:"execute-a-single-template",level:4},{value:"Executing a Named Template",id:"executing-a-named-template",level:4},{value:"Template Encoding and HTML",id:"template-encoding-and-html",level:2},{value:"Contextual Encoding",id:"contextual-encoding",level:4},{value:"Safe Strings and HTML Comments",id:"safe-strings-and-html-comments",level:4},{value:"Template Variables",id:"template-variables",level:2},{value:"The dot character (.)",id:"the-dot-character-",level:4},{value:"Variables in Templates",id:"variables-in-templates",level:4},{value:"Template Actions",id:"template-actions",level:2},{value:"If/Else Statements",id:"ifelse-statements",level:4},{value:"Removing Whitespace",id:"removing-whitespace",level:4},{value:"Range Blocks",id:"range-blocks",level:4},{value:"Template Functions",id:"template-functions",level:2},{value:"Indexing structures in Templates",id:"indexing-structures-in-templates",level:4},{value:"The and Function",id:"the-and-function",level:4},{value:"The or Function",id:"the-or-function",level:4},{value:"The not Function",id:"the-not-function",level:4},{value:"Template Comparison Functions",id:"template-comparison-functions",level:2},{value:"Comparisons",id:"comparisons",level:4},{value:"Nested Templates and Layouts",id:"nested-templates-and-layouts",level:2},{value:"Nesting Templates",id:"nesting-templates",level:4},{value:"Passing Variables between Templates",id:"passing-variables-between-templates",level:4},{value:"Creating Layouts",id:"creating-layouts",level:4},{value:"Templates Calling Functions",id:"templates-calling-functions",level:2},{value:"Function Variables (calling struct methods)",id:"function-variables-calling-struct-methods",level:4},{value:"Function Variables (call)",id:"function-variables-call",level:4},{value:"Custom Functions",id:"custom-functions",level:4},{value:"Custom Functions (Globally)",id:"custom-functions-globally",level:4}],m={toc:p},u="wrapper";function h(e){let{components:t,...a}=e;return(0,l.kt)(u,(0,n.Z)({},m,a,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("h1",{id:"golang-templates-cheatsheet"},"Golang Templates Cheatsheet"),(0,l.kt)("p",null,"The Go standard library provides a set of packages to generate output. The ",(0,l.kt)("a",{parentName:"p",href:"https://archive.is/o/2HksZ/https://golang.org/pkg/text/template/"},"text/template")," package implements templates for generating text output, while the ",(0,l.kt)("a",{parentName:"p",href:"https://archive.is/o/2HksZ/https://golang.org/pkg/html/template/"},"html/template")," package implements templates for generating HTML output that is safe against certain attacks. Both packages use the same interface but the following examples of the core features are directed towards HTML applications."),(0,l.kt)("hr",null),(0,l.kt)("h2",{id:"table-of-contents"},"Table of Contents"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"#parsing-and-creating-templates"},"Parsing and Creating Templates")),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"#executing-templates"},"Executing Templates")),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"#template-encoding-and-html"},"Template Encoding and HTML")),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"#template-variables"},"Template Variables")),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"#template-actions"},"Template Actions")),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"#template-functions"},"Template Functions")),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"#template-comparison-functions"},"Template Comparison Functions")),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"#nested-templates-and-layouts"},"Nested Templates and Layouts")),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"#templates-calling-functions"},"Templates Calling Functions"))),(0,l.kt)("hr",null),(0,l.kt)("h2",{id:"parsing-and-creating-templates"},"Parsing and Creating Templates"),(0,l.kt)("h4",{id:"naming-templates"},"Naming Templates"),(0,l.kt)("p",null,"There is no defined file extension for Go templates. One of the most popular is ",(0,l.kt)("inlineCode",{parentName:"p"},".tmpl")," supported by vim-go and ",(0,l.kt)("a",{parentName:"p",href:"https://archive.is/o/2HksZ/golang.org/pkg/text/template/%23example_Template_helpers"},"referenced in the text/template godocs"),". The extension ",(0,l.kt)("inlineCode",{parentName:"p"},".gohtml")," supports syntax highlighting in both Atom and GoSublime editors. Finally analysis of large Go codebases finds that ",(0,l.kt)("inlineCode",{parentName:"p"},".tpl")," is often used by developers. While the extension is not important it is still good to be consistent within a project for clarity."),(0,l.kt)("hr",null),(0,l.kt)("h4",{id:"creating-a-template"},"Creating a Template"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"tpl, err := template.Parse(filename)")," will get the template at filename and store it in tpl. tpl can then be executed to show the template."),(0,l.kt)("hr",null),(0,l.kt)("h4",{id:"parsing-multiple-templates"},"Parsing Multiple Templates"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"template.ParseFiles(filenames)")," takes a list of filenames and stores all templates. ",(0,l.kt)("inlineCode",{parentName:"p"},"template.ParseGlob(pattern)")," will find all templates matching the pattern and store the templates."),(0,l.kt)("hr",null),(0,l.kt)("h2",{id:"executing-templates"},"Executing Templates"),(0,l.kt)("h4",{id:"execute-a-single-template"},"Execute a Single Template"),(0,l.kt)("p",null,"Once a template has been parsed there are two options to execute them. A single template ",(0,l.kt)("inlineCode",{parentName:"p"},"tpl")," can be executed using ",(0,l.kt)("inlineCode",{parentName:"p"},"tpl.Execute(io.Writer, data)"),". The content of tpl will be written to the io.Writer. Data is an interface passed to the template that will be useable in the template."),(0,l.kt)("hr",null),(0,l.kt)("h4",{id:"executing-a-named-template"},"Executing a Named Template"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"tpl.ExecuteTemplate(io.Writer, name, data)")," works the same as execute but allows for a string name of the template the user wants to execute."),(0,l.kt)("hr",null),(0,l.kt)("h2",{id:"template-encoding-and-html"},"Template Encoding and HTML"),(0,l.kt)("h4",{id:"contextual-encoding"},"Contextual Encoding"),(0,l.kt)("p",null,"Go\u2019s html/template package does encoding based on the context of the code. As a result, html/template encodes any characters that need encoding to be rendered correctly."),(0,l.kt)("p",null,"For example the < and > in ",(0,l.kt)("inlineCode",{parentName:"p"},'"

A header!

"')," will be encoded as ",(0,l.kt)("inlineCode",{parentName:"p"},"<h1>A header!</h1>")," ."),(0,l.kt)("p",null,"Type ",(0,l.kt)("inlineCode",{parentName:"p"},"template.HTML")," can be used to skip encoding by telling Go the string is safe. ",(0,l.kt)("inlineCode",{parentName:"p"},'template.HTML("

A Safe header

")')," will then be ",(0,l.kt)("inlineCode",{parentName:"p"},"

A Safe header

")," . Using this type with user input is dangerous and leaves the application vulnerable."),(0,l.kt)("p",null,"The go ",(0,l.kt)("inlineCode",{parentName:"p"},"html/template")," package is aware of attributes within the template and will encode values differently based on the attribute."),(0,l.kt)("p",null,"Go templates can also be used with javascript. Structs and maps will be expanded into JSON objects and quotes will be added to strings for use in function parameters and as variable values."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-go"},' // Go\n type Cat struct {\n Name string\n Age int\n }\n\n kitten := Cat{"Sam", 12}\n')),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-html"},"// Template\n
Version: v2.x

🧬 Middleware

Middleware is a function chained in the HTTP request cycle with access to the Context which it uses to perform a specific action, for example, logging every request or enabling CORS.

- - + + \ No newline at end of file diff --git a/category/api/index.html b/category/api/index.html index 872e329df09..6ad1c5332a3 100644 --- a/category/api/index.html +++ b/category/api/index.html @@ -6,13 +6,13 @@ API | Fiber - - + + - - + + \ No newline at end of file diff --git a/category/extra/index.html b/category/extra/index.html index 89885a6b924..9cf83c3cc5d 100644 --- a/category/extra/index.html +++ b/category/extra/index.html @@ -6,13 +6,13 @@ Extra | Fiber - - + + - - + + \ No newline at end of file diff --git a/category/guide/index.html b/category/guide/index.html index f6ef3ce8642..17f002d310b 100644 --- a/category/guide/index.html +++ b/category/guide/index.html @@ -6,13 +6,13 @@ Guide | Fiber - - + +
- - + + \ No newline at end of file diff --git a/contrib/casbin/index.html b/contrib/casbin/index.html index 0a6f94857d9..c7229537ec0 100644 --- a/contrib/casbin/index.html +++ b/contrib/casbin/index.html @@ -6,8 +6,8 @@ Casbin | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Casbin middleware for Fiber.

Install​

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/casbin

choose an adapter from here

go get -u github.com/casbin/xorm-adapter

Signature​

casbin.New(config ...casbin.Config) *casbin.Middleware

Config​

PropertyTypeDescriptionDefault
ModelFilePathstringModel file path"./model.conf"
PolicyAdapterpersist.AdapterDatabase adapter for policies./policy.csv
Enforcer*casbin.EnforcerCustom casbin enforcerMiddleware generated enforcer using ModelFilePath & PolicyAdapter
Lookupfunc(*fiber.Ctx) stringLook up for current subject""
Unauthorizedfunc(*fiber.Ctx) errorResponse body for unauthorized responsesUnauthorized
Forbiddenfunc(*fiber.Ctx) errorResponse body for forbidden responsesForbidden

Examples​

CustomPermission​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/casbin"
_ "github.com/go-sql-driver/mysql"
"github.com/casbin/xorm-adapter/v2"
)

func main() {
app := fiber.New()

authz := casbin.New(casbin.Config{
ModelFilePath: "path/to/rbac_model.conf",
PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),
Lookup: func(c *fiber.Ctx) string {
// fetch authenticated user subject
},
})

app.Post("/blog",
authz.RequiresPermissions([]string{"blog:create"}, casbin.WithValidationRule(casbin.MatchAllRule)),
func(c *fiber.Ctx) error {
// your handler
},
)

app.Delete("/blog/:id",
authz.RequiresPermissions([]string{"blog:create", "blog:delete"}, casbin.WithValidationRule(casbin.AtLeastOneRule)),
func(c *fiber.Ctx) error {
// your handler
},
)

app.Listen(":8080")
}

RoutePermission​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/casbin"
_ "github.com/go-sql-driver/mysql"
"github.com/casbin/xorm-adapter/v2"
)

func main() {
app := fiber.New()

authz := casbin.New(casbin.Config{
ModelFilePath: "path/to/rbac_model.conf",
PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),
Lookup: func(c *fiber.Ctx) string {
// fetch authenticated user subject
},
})

// check permission with Method and Path
app.Post("/blog",
authz.RoutePermission(),
func(c *fiber.Ctx) error {
// your handler
},
)

app.Listen(":8080")
}

RoleAuthorization​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/casbin"
_ "github.com/go-sql-driver/mysql"
"github.com/casbin/xorm-adapter/v2"
)

func main() {
app := fiber.New()

authz := casbin.New(casbin.Config{
ModelFilePath: "path/to/rbac_model.conf",
PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),
Lookup: func(c *fiber.Ctx) string {
// fetch authenticated user subject
},
})

app.Put("/blog/:id",
authz.RequiresRoles([]string{"admin"}),
func(c *fiber.Ctx) error {
// your handler
},
)

app.Listen(":8080")
}
- - +Linter

Casbin middleware for Fiber.

Install​

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/casbin

choose an adapter from here

go get -u github.com/casbin/xorm-adapter

Signature​

casbin.New(config ...casbin.Config) *casbin.Middleware

Config​

PropertyTypeDescriptionDefault
ModelFilePathstringModel file path"./model.conf"
PolicyAdapterpersist.AdapterDatabase adapter for policies./policy.csv
Enforcer*casbin.EnforcerCustom casbin enforcerMiddleware generated enforcer using ModelFilePath & PolicyAdapter
Lookupfunc(*fiber.Ctx) stringLook up for current subject""
Unauthorizedfunc(*fiber.Ctx) errorResponse body for unauthorized responsesUnauthorized
Forbiddenfunc(*fiber.Ctx) errorResponse body for forbidden responsesForbidden

Examples​

CustomPermission​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/casbin"
_ "github.com/go-sql-driver/mysql"
"github.com/casbin/xorm-adapter/v2"
)

func main() {
app := fiber.New()

authz := casbin.New(casbin.Config{
ModelFilePath: "path/to/rbac_model.conf",
PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),
Lookup: func(c *fiber.Ctx) string {
// fetch authenticated user subject
},
})

app.Post("/blog",
authz.RequiresPermissions([]string{"blog:create"}, casbin.WithValidationRule(casbin.MatchAllRule)),
func(c *fiber.Ctx) error {
// your handler
},
)

app.Delete("/blog/:id",
authz.RequiresPermissions([]string{"blog:create", "blog:delete"}, casbin.WithValidationRule(casbin.AtLeastOneRule)),
func(c *fiber.Ctx) error {
// your handler
},
)

app.Listen(":8080")
}

RoutePermission​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/casbin"
_ "github.com/go-sql-driver/mysql"
"github.com/casbin/xorm-adapter/v2"
)

func main() {
app := fiber.New()

authz := casbin.New(casbin.Config{
ModelFilePath: "path/to/rbac_model.conf",
PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),
Lookup: func(c *fiber.Ctx) string {
// fetch authenticated user subject
},
})

// check permission with Method and Path
app.Post("/blog",
authz.RoutePermission(),
func(c *fiber.Ctx) error {
// your handler
},
)

app.Listen(":8080")
}

RoleAuthorization​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/casbin"
_ "github.com/go-sql-driver/mysql"
"github.com/casbin/xorm-adapter/v2"
)

func main() {
app := fiber.New()

authz := casbin.New(casbin.Config{
ModelFilePath: "path/to/rbac_model.conf",
PolicyAdapter: xormadapter.NewAdapter("mysql", "root:@tcp(127.0.0.1:3306)/"),
Lookup: func(c *fiber.Ctx) string {
// fetch authenticated user subject
},
})

app.Put("/blog/:id",
authz.RequiresRoles([]string{"admin"}),
func(c *fiber.Ctx) error {
// your handler
},
)

app.Listen(":8080")
}
+ + \ No newline at end of file diff --git a/contrib/fiberi18n/index.html b/contrib/fiberi18n/index.html index be162749c2e..1184d5065fb 100644 --- a/contrib/fiberi18n/index.html +++ b/contrib/fiberi18n/index.html @@ -6,8 +6,8 @@ Fiberi18n | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

go-i18n support for Fiber.

Install​

This middleware supports Fiber v2.

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/fiberi18n

Signature​

fiberi18n.New(config ...*Config) fiber.Handler

Config​

PropertyTypeDescriptionDefault
Nextfunc(c *fiber.Ctx) boolA function to skip this middleware when returned true.nil
RootPathstringThe i18n template folder path."./example/localize"
AcceptLanguages[]language.TagA collection of languages that can be processed.[]language.Tag{language.Chinese, language.English}
FormatBundleFilestringThe type of the template file."yaml"
DefaultLanguagelanguage.TagThe default returned language type.language.English
LoaderLoaderThe implementation of the Loader interface, which defines how to read the file. We provide both os.ReadFile and embed.FS.ReadFile.LoaderFunc(os.ReadFile)
UnmarshalFunci18n.UnmarshalFuncThe function used for decoding template files.yaml.Unmarshal
LangHandlerfunc(ctx *fiber.Ctx, defaultLang string) stringUsed to get the kind of language handled by *fiber.Ctx and defaultLang.Retrieved from the request header Accept-Language or query parameter lang.

Example​

package main

import (
"github.com/gofiber/contrib/fiberi18n"
"github.com/gofiber/fiber/v2"
"github.com/nicksnyder/go-i18n/v2/i18n"
"golang.org/x/text/language"
)

func main() {
app := fiber.New()
app.Use(
fiberi18n.New(&fiberi18n.Config{
RootPath: "./example/localize",
AcceptLanguages: []language.Tag{language.Chinese, language.English},
DefaultLanguage: language.Chinese,
}),
)
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString(fiberi18n.MustGetMessage("welcome"))
})
app.Get("/:name", func(ctx *fiber.Ctx) error {
return ctx.SendString(fiberi18n.MustGetMessage(&i18n.LocalizeConfig{
MessageID: "welcomeWithName",
TemplateData: map[string]string{
"name": ctx.Params("name"),
},
}))
})
app.Listen("127.0.0.1:3000")
}
- - +Linter

go-i18n support for Fiber.

Install​

This middleware supports Fiber v2.

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/fiberi18n

Signature​

fiberi18n.New(config ...*Config) fiber.Handler

Config​

PropertyTypeDescriptionDefault
Nextfunc(c *fiber.Ctx) boolA function to skip this middleware when returned true.nil
RootPathstringThe i18n template folder path."./example/localize"
AcceptLanguages[]language.TagA collection of languages that can be processed.[]language.Tag{language.Chinese, language.English}
FormatBundleFilestringThe type of the template file."yaml"
DefaultLanguagelanguage.TagThe default returned language type.language.English
LoaderLoaderThe implementation of the Loader interface, which defines how to read the file. We provide both os.ReadFile and embed.FS.ReadFile.LoaderFunc(os.ReadFile)
UnmarshalFunci18n.UnmarshalFuncThe function used for decoding template files.yaml.Unmarshal
LangHandlerfunc(ctx *fiber.Ctx, defaultLang string) stringUsed to get the kind of language handled by *fiber.Ctx and defaultLang.Retrieved from the request header Accept-Language or query parameter lang.

Example​

package main

import (
"github.com/gofiber/contrib/fiberi18n"
"github.com/gofiber/fiber/v2"
"github.com/nicksnyder/go-i18n/v2/i18n"
"golang.org/x/text/language"
)

func main() {
app := fiber.New()
app.Use(
fiberi18n.New(&fiberi18n.Config{
RootPath: "./example/localize",
AcceptLanguages: []language.Tag{language.Chinese, language.English},
DefaultLanguage: language.Chinese,
}),
)
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString(fiberi18n.MustGetMessage("welcome"))
})
app.Get("/:name", func(ctx *fiber.Ctx) error {
return ctx.SendString(fiberi18n.MustGetMessage(&i18n.LocalizeConfig{
MessageID: "welcomeWithName",
TemplateData: map[string]string{
"name": ctx.Params("name"),
},
}))
})
app.Listen("127.0.0.1:3000")
}
+ + \ No newline at end of file diff --git a/contrib/fibernewrelic/index.html b/contrib/fibernewrelic/index.html index 48340b9a7f4..0c1a80ea55c 100644 --- a/contrib/fibernewrelic/index.html +++ b/contrib/fibernewrelic/index.html @@ -6,8 +6,8 @@ Fibernewrelic | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

NewRelic support for Fiber.

Install​

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/fibernewrelic

Signature​

fibernewrelic.New(config fibernewrelic.Config) fiber.Handler

Config​

PropertyTypeDescriptionDefault
LicensestringRequired - New Relic License Key""
AppNamestringNew Relic Application Namefiber-api
EnabledboolEnable/Disable New Relicfalse
TransportTypestringCan be HTTP or HTTPS (Deprecated)"HTTP"
ApplicationApplicationExisting New Relic Appnil
ErrorStatusCodeHandlerfunc(c *fiber.Ctx, err error) intIf you want to change newrelic status code, you can use it.DefaultErrorStatusCodeHandler

Usage​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/fibernewrelic"
)

func main() {
app := fiber.New()

app.Get("/", func(ctx *fiber.Ctx) error {
return ctx.SendStatus(200)
})

cfg := fibernewrelic.Config{
License: "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
AppName: "MyCustomApi",
Enabled: true,
}

app.Use(fibernewrelic.New(cfg))

app.Listen(":8080")
}

Usage with existing New Relic application​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/fibernewrelic"
"github.com/newrelic/go-agent/v3/newrelic"
)

func main() {
newrelicApp, err := newrelic.NewApplication(
newrelic.ConfigAppName("MyCustomApi"),
newrelic.ConfigLicense("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
newrelic.ConfigEnabled(true),
)

app := fiber.New()

app.Get("/", func(ctx *fiber.Ctx) error {
return ctx.SendStatus(200)
})

cfg := fibernewrelic.Config{
Application: newrelicApp
}

app.Use(fibernewrelic.New(cfg))

app.Listen(":8080")
}
- - +Linter

NewRelic support for Fiber.

Install​

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/fibernewrelic

Signature​

fibernewrelic.New(config fibernewrelic.Config) fiber.Handler

Config​

PropertyTypeDescriptionDefault
LicensestringRequired - New Relic License Key""
AppNamestringNew Relic Application Namefiber-api
EnabledboolEnable/Disable New Relicfalse
TransportTypestringCan be HTTP or HTTPS (Deprecated)"HTTP"
ApplicationApplicationExisting New Relic Appnil
ErrorStatusCodeHandlerfunc(c *fiber.Ctx, err error) intIf you want to change newrelic status code, you can use it.DefaultErrorStatusCodeHandler

Usage​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/fibernewrelic"
)

func main() {
app := fiber.New()

app.Get("/", func(ctx *fiber.Ctx) error {
return ctx.SendStatus(200)
})

cfg := fibernewrelic.Config{
License: "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
AppName: "MyCustomApi",
Enabled: true,
}

app.Use(fibernewrelic.New(cfg))

app.Listen(":8080")
}

Usage with existing New Relic application​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/fibernewrelic"
"github.com/newrelic/go-agent/v3/newrelic"
)

func main() {
newrelicApp, err := newrelic.NewApplication(
newrelic.ConfigAppName("MyCustomApi"),
newrelic.ConfigLicense("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
newrelic.ConfigEnabled(true),
)

app := fiber.New()

app.Get("/", func(ctx *fiber.Ctx) error {
return ctx.SendStatus(200)
})

cfg := fibernewrelic.Config{
Application: newrelicApp
}

app.Use(fibernewrelic.New(cfg))

app.Listen(":8080")
}
+ + \ No newline at end of file diff --git a/contrib/fibersentry/index.html b/contrib/fibersentry/index.html index 1f6fdedad2c..8ef5549bcc2 100644 --- a/contrib/fibersentry/index.html +++ b/contrib/fibersentry/index.html @@ -6,8 +6,8 @@ Fibersentry | Fiber - - + +
@@ -17,8 +17,8 @@ Security Linter

Sentry support for Fiber.

Install​

This middleware supports Fiber v2.

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/fibersentry
go get -u github.com/getsentry/sentry-go

Signature​

fibersentry.New(config ...Config) fiber.Handler

Config​

PropertyTypeDescriptionDefault
RepanicboolRepanic configures whether Sentry should repanic after recovery. Set to true, if Recover middleware is used.false
WaitForDeliveryboolWaitForDelivery configures whether you want to block the request before moving forward with the response. If Recover middleware is used, it's safe to either skip this option or set it to false.false
Timeouttime.DurationTimeout for the event delivery requests.time.Second * 2

Usage​

fibersentry attaches an instance of *sentry.Hub (https://godoc.org/github.com/getsentry/sentry-go#Hub) to the request's context, which makes it available throughout the rest of the request's lifetime. You can access it by using the fibersentry.GetHubFromContext() method on the context itself in any of your proceeding middleware and routes. -And it should be used instead of the global sentry.CaptureMessage, sentry.CaptureException, or any other calls, as it keeps the separation of data between the requests.

Keep in mind that *sentry.Hub won't be available in middleware attached before to fibersentry!

package main

import (
"fmt"
"log"

"github.com/getsentry/sentry-go"
"github.com/gofiber/contrib/fibersentry"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
)

func main() {
_ = sentry.Init(sentry.ClientOptions{
Dsn: "",
BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {
if hint.Context != nil {
if c, ok := hint.Context.Value(sentry.RequestContextKey).(*fiber.Ctx); ok {
// You have access to the original Context if it panicked
fmt.Println(utils.ImmutableString(c.Hostname()))
}
}
fmt.Println(event)
return event
},
Debug: true,
AttachStacktrace: true,
})

app := fiber.New()

app.Use(fibersentry.New(fibersentry.Config{
Repanic: true,
WaitForDelivery: true,
}))

enhanceSentryEvent := func(c *fiber.Ctx) error {
if hub := fibersentry.GetHubFromContext(c); hub != nil {
hub.Scope().SetTag("someRandomTag", "maybeYouNeedIt")
}
return c.Next()
}

app.All("/foo", enhanceSentryEvent, func(c *fiber.Ctx) error {
panic("y tho")
})

app.All("/", func(c *fiber.Ctx) error {
if hub := fibersentry.GetHubFromContext(c); hub != nil {
hub.WithScope(func(scope *sentry.Scope) {
scope.SetExtra("unwantedQuery", "someQueryDataMaybe")
hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")
})
}
return c.SendStatus(fiber.StatusOK)
})

log.Fatal(app.Listen(":3000"))
}

Accessing Context in BeforeSend callback​

sentry.Init(sentry.ClientOptions{
Dsn: "your-public-dsn",
BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {
if hint.Context != nil {
if c, ok := hint.Context.Value(sentry.RequestContextKey).(*fiber.Ctx); ok {
// You have access to the original Context if it panicked
fmt.Println(c.Hostname())
}
}
return event
},
})
- - +And it should be used instead of the global sentry.CaptureMessage, sentry.CaptureException, or any other calls, as it keeps the separation of data between the requests.

Keep in mind that *sentry.Hub won't be available in middleware attached before to fibersentry!

package main

import (
"fmt"
"log"

"github.com/getsentry/sentry-go"
"github.com/gofiber/contrib/fibersentry"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
)

func main() {
_ = sentry.Init(sentry.ClientOptions{
Dsn: "",
BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {
if hint.Context != nil {
if c, ok := hint.Context.Value(sentry.RequestContextKey).(*fiber.Ctx); ok {
// You have access to the original Context if it panicked
fmt.Println(utils.ImmutableString(c.Hostname()))
}
}
fmt.Println(event)
return event
},
Debug: true,
AttachStacktrace: true,
})

app := fiber.New()

app.Use(fibersentry.New(fibersentry.Config{
Repanic: true,
WaitForDelivery: true,
}))

enhanceSentryEvent := func(c *fiber.Ctx) error {
if hub := fibersentry.GetHubFromContext(c); hub != nil {
hub.Scope().SetTag("someRandomTag", "maybeYouNeedIt")
}
return c.Next()
}

app.All("/foo", enhanceSentryEvent, func(c *fiber.Ctx) error {
panic("y tho")
})

app.All("/", func(c *fiber.Ctx) error {
if hub := fibersentry.GetHubFromContext(c); hub != nil {
hub.WithScope(func(scope *sentry.Scope) {
scope.SetExtra("unwantedQuery", "someQueryDataMaybe")
hub.CaptureMessage("User provided unwanted query string, but we recovered just fine")
})
}
return c.SendStatus(fiber.StatusOK)
})

log.Fatal(app.Listen(":3000"))
}

Accessing Context in BeforeSend callback​

sentry.Init(sentry.ClientOptions{
Dsn: "your-public-dsn",
BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {
if hint.Context != nil {
if c, ok := hint.Context.Value(sentry.RequestContextKey).(*fiber.Ctx); ok {
// You have access to the original Context if it panicked
fmt.Println(c.Hostname())
}
}
return event
},
})
+ + \ No newline at end of file diff --git a/contrib/fiberzap/index.html b/contrib/fiberzap/index.html index 4d89dca04db..e2838e9d70c 100644 --- a/contrib/fiberzap/index.html +++ b/contrib/fiberzap/index.html @@ -6,8 +6,8 @@ Fiberzap | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Zap logging support for Fiber.

Install​

This middleware supports Fiber v2.

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/fiberzap
go get -u go.uber.org/zap

Signature​

fiberzap.New(config ...Config) fiber.Handler

Config​

PropertyTypeDescriptionDefault
Nextfunc(*Ctx) boolDefine a function to skip this middleware when returned truenil
Logger*zap.LoggerAdd custom zap logger.zap.NewDevelopment()
Fields[]stringAdd fields what you want see.[]string{"latency", "status", "method", "url"}
Messages[]stringCustom response messages.[]string{"Server error", "Client error", "Success"}
Levels[]zapcore.LevelCustom response levels.[]zapcore.Level{zapcore.ErrorLevel, zapcore.WarnLevel, zapcore.InfoLevel}
SkipURIs[]stringSkip logging these URI.[]string{}
GetResBodyfunc(c *fiber.Ctx) []byteDefine a function to get response body when return non-nil.
eg: When use compress middleware, resBody is unreadable. you can set GetResBody func to get readable resBody.
nil

Example​

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/fiberzap"
"go.uber.org/zap"
)

func main() {
app := fiber.New()
logger, _ := zap.NewProduction()

app.Use(fiberzap.New(fiberzap.Config{
Logger: logger,
}))

app.Get("/", func (c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

log.Fatal(app.Listen(":3000"))
}
- - +Linter

Zap logging support for Fiber.

Install​

This middleware supports Fiber v2.

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/fiberzap
go get -u go.uber.org/zap

Signature​

fiberzap.New(config ...Config) fiber.Handler

Config​

PropertyTypeDescriptionDefault
Nextfunc(*Ctx) boolDefine a function to skip this middleware when returned truenil
Logger*zap.LoggerAdd custom zap logger.zap.NewDevelopment()
Fields[]stringAdd fields what you want see.[]string{"latency", "status", "method", "url"}
Messages[]stringCustom response messages.[]string{"Server error", "Client error", "Success"}
Levels[]zapcore.LevelCustom response levels.[]zapcore.Level{zapcore.ErrorLevel, zapcore.WarnLevel, zapcore.InfoLevel}
SkipURIs[]stringSkip logging these URI.[]string{}
GetResBodyfunc(c *fiber.Ctx) []byteDefine a function to get response body when return non-nil.
eg: When use compress middleware, resBody is unreadable. you can set GetResBody func to get readable resBody.
nil

Example​

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/fiberzap"
"go.uber.org/zap"
)

func main() {
app := fiber.New()
logger, _ := zap.NewProduction()

app.Use(fiberzap.New(fiberzap.Config{
Logger: logger,
}))

app.Get("/", func (c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

log.Fatal(app.Listen(":3000"))
}
+ + \ No newline at end of file diff --git a/contrib/fiberzerolog/index.html b/contrib/fiberzerolog/index.html index 2fe9a9a3447..357af1090e5 100644 --- a/contrib/fiberzerolog/index.html +++ b/contrib/fiberzerolog/index.html @@ -6,8 +6,8 @@ Fiberzerolog | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Zerolog logging support for Fiber.

Install​

This middleware supports Fiber v2.

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/fiberzerolog
go get -u github.com/rs/zerolog/log

Signature​

fiberzerolog.New(config ...Config) fiber.Handler

Config​

PropertyTypeDescriptionDefault
Nextfunc(*Ctx) boolDefine a function to skip this middleware when returned truenil
Logger*zerolog.LoggerAdd custom zerolog logger.zerolog.New(os.Stderr).With().Timestamp().Logger()
GetLoggerfunc(*fiber.Ctx) zerolog.LoggerGet custom zerolog logger, if it's defined the returned logger will replace the Logger value.nil
Fields[]stringAdd fields what you want see.[]string{"latency", "status", "method", "url", "error"}
Messages[]stringCustom response messages.[]string{"Server error", "Client error", "Success"}
Levels[]zerolog.LevelCustom response levels.[]zerolog.Level{zerolog.ErrorLevel, zerolog.WarnLevel, zerolog.InfoLevel}
SkipURIs[]stringSkip logging these URI.[]string{}
GetResBodyfunc(c *fiber.Ctx) []byteDefine a function to get response body when return non-nil.
eg: When use compress middleware, resBody is unreadable. you can set GetResBody func to get readable resBody.
nil

Example​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/fiberzerolog"
"github.com/rs/zerolog"
)

func main() {
app := fiber.New()
logger := zerolog.New(os.Stderr).With().Timestamp().Logger()

app.Use(fiberzerolog.New(fiberzerolog.Config{
Logger: &logger,
}))

app.Get("/", func (c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

if err := app.Listen(":3000"); err != nil {
logger.Fatal().Err(err).Msg("Fiber app error")
}
}
- - +Linter

Zerolog logging support for Fiber.

Install​

This middleware supports Fiber v2.

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/fiberzerolog
go get -u github.com/rs/zerolog/log

Signature​

fiberzerolog.New(config ...Config) fiber.Handler

Config​

PropertyTypeDescriptionDefault
Nextfunc(*Ctx) boolDefine a function to skip this middleware when returned truenil
Logger*zerolog.LoggerAdd custom zerolog logger.zerolog.New(os.Stderr).With().Timestamp().Logger()
GetLoggerfunc(*fiber.Ctx) zerolog.LoggerGet custom zerolog logger, if it's defined the returned logger will replace the Logger value.nil
Fields[]stringAdd fields what you want see.[]string{"latency", "status", "method", "url", "error"}
Messages[]stringCustom response messages.[]string{"Server error", "Client error", "Success"}
Levels[]zerolog.LevelCustom response levels.[]zerolog.Level{zerolog.ErrorLevel, zerolog.WarnLevel, zerolog.InfoLevel}
SkipURIs[]stringSkip logging these URI.[]string{}
GetResBodyfunc(c *fiber.Ctx) []byteDefine a function to get response body when return non-nil.
eg: When use compress middleware, resBody is unreadable. you can set GetResBody func to get readable resBody.
nil

Example​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/fiberzerolog"
"github.com/rs/zerolog"
)

func main() {
app := fiber.New()
logger := zerolog.New(os.Stderr).With().Timestamp().Logger()

app.Use(fiberzerolog.New(fiberzerolog.Config{
Logger: &logger,
}))

app.Get("/", func (c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

if err := app.Listen(":3000"); err != nil {
logger.Fatal().Err(err).Msg("Fiber app error")
}
}
+ + \ No newline at end of file diff --git a/contrib/index.html b/contrib/index.html index 248da8e90ea..cc1980bc166 100644 --- a/contrib/index.html +++ b/contrib/index.html @@ -6,16 +6,16 @@ πŸ‘‹ Welcome | Fiber - - + + - - +Linter

Repository for third party middlewares with dependencies.

πŸ“‘ Middleware Implementations​

+ + \ No newline at end of file diff --git a/contrib/jwt/index.html b/contrib/jwt/index.html index 25b14dbb429..16efbbb110c 100644 --- a/contrib/jwt/index.html +++ b/contrib/jwt/index.html @@ -6,8 +6,8 @@ JWT | Fiber - - + +
@@ -24,8 +24,8 @@ This is one of the three options to provide a token validation key. The order of precedence is a user-defined KeyFunc, SigningKeys and SigningKey. Required if neither SigningKeys nor SigningKey is provided. -Default to an internal implementation verifying the signing algorithm and selecting the proper key.

package main

import (
"fmt"
"github.com/gofiber/fiber/v2"

jwtware "github.com/gofiber/contrib/jwt"
"github.com/golang-jwt/jwt/v5"
)

func main() {
app := fiber.New()

app.Use(jwtware.New(jwtware.Config{
KeyFunc: customKeyFunc(),
}))

app.Get("/ok", func(c *fiber.Ctx) error {
return c.SendString("OK")
})
}

func customKeyFunc() jwt.Keyfunc {
return func(t *jwt.Token) (interface{}, error) {
// Always check the signing method
if t.Method.Alg() != jwtware.HS256 {
return nil, fmt.Errorf("Unexpected jwt signing method=%v", t.Header["alg"])
}

// TODO custom implementation of loading signing key like from a database
signingKey := "secret"

return []byte(signingKey), nil
}
}
- - +Default to an internal implementation verifying the signing algorithm and selecting the proper key.

package main

import (
"fmt"
"github.com/gofiber/fiber/v2"

jwtware "github.com/gofiber/contrib/jwt"
"github.com/golang-jwt/jwt/v5"
)

func main() {
app := fiber.New()

app.Use(jwtware.New(jwtware.Config{
KeyFunc: customKeyFunc(),
}))

app.Get("/ok", func(c *fiber.Ctx) error {
return c.SendString("OK")
})
}

func customKeyFunc() jwt.Keyfunc {
return func(t *jwt.Token) (interface{}, error) {
// Always check the signing method
if t.Method.Alg() != jwtware.HS256 {
return nil, fmt.Errorf("Unexpected jwt signing method=%v", t.Header["alg"])
}

// TODO custom implementation of loading signing key like from a database
signingKey := "secret"

return []byte(signingKey), nil
}
}
+ + \ No newline at end of file diff --git a/contrib/opafiber/index.html b/contrib/opafiber/index.html index 85167a1d522..dd6258d6ceb 100644 --- a/contrib/opafiber/index.html +++ b/contrib/opafiber/index.html @@ -6,8 +6,8 @@ Opafiber | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Open Policy Agent support for Fiber.

Note: Requires Go 1.18 and above

Install​

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/opafiber

Signature​

opafiber.New(config opafiber.Config) fiber.Handler

Config​

PropertyTypeDescriptionDefault
RegoQuerystringRequired - Rego query-
RegoPolicyio.ReaderRequired - Rego policy-
IncludeQueryStringboolInclude query string as input to rego policyfalse
DeniedStatusCodeintHttp status code to return when policy denies request400
DeniedResponseMessagestringHttp response body text to return when policy denies request""
IncludeHeaders[]stringInclude headers as input to rego policy-
InputCreationMethodInputCreationFuncUse your own function to provide input for OPAfunc defaultInput(ctx *fiber.Ctx) (map[string]interface{}, error)

Types​

type InputCreationFunc func(c *fiber.Ctx) (map[string]interface{}, error)

Usage​

OPA Fiber middleware sends the following example data to the policy engine as input:

{
"method": "GET",
"path": "/somePath",
"query": {
"name": ["John Doe"]
},
"headers": {
"Accept": "application/json",
"Content-Type": "application/json"
}
}
package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/opafiber"
)

func main() {
app := fiber.New()
module := `
package example.authz

default allow := false

allow {
input.method == "GET"
}
`

cfg := opafiber.Config{
RegoQuery: "data.example.authz.allow",
RegoPolicy: bytes.NewBufferString(module),
IncludeQueryString: true,
DeniedStatusCode: fiber.StatusForbidden,
DeniedResponseMessage: "status forbidden",
IncludeHeaders: []string{"Authorization"},
InputCreationMethod: func (ctx *fiber.Ctx) (map[string]interface{}, error) {
return map[string]interface{}{
"method": ctx.Method(),
"path": ctx.Path(),
}, nil
},
}
app.Use(opafiber.New(cfg))

app.Get("/", func(ctx *fiber.Ctx) error {
return ctx.SendStatus(200)
})

app.Listen(":8080")
}
- - +Linter

Open Policy Agent support for Fiber.

Note: Requires Go 1.18 and above

Install​

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/opafiber

Signature​

opafiber.New(config opafiber.Config) fiber.Handler

Config​

PropertyTypeDescriptionDefault
RegoQuerystringRequired - Rego query-
RegoPolicyio.ReaderRequired - Rego policy-
IncludeQueryStringboolInclude query string as input to rego policyfalse
DeniedStatusCodeintHttp status code to return when policy denies request400
DeniedResponseMessagestringHttp response body text to return when policy denies request""
IncludeHeaders[]stringInclude headers as input to rego policy-
InputCreationMethodInputCreationFuncUse your own function to provide input for OPAfunc defaultInput(ctx *fiber.Ctx) (map[string]interface{}, error)

Types​

type InputCreationFunc func(c *fiber.Ctx) (map[string]interface{}, error)

Usage​

OPA Fiber middleware sends the following example data to the policy engine as input:

{
"method": "GET",
"path": "/somePath",
"query": {
"name": ["John Doe"]
},
"headers": {
"Accept": "application/json",
"Content-Type": "application/json"
}
}
package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/opafiber"
)

func main() {
app := fiber.New()
module := `
package example.authz

default allow := false

allow {
input.method == "GET"
}
`

cfg := opafiber.Config{
RegoQuery: "data.example.authz.allow",
RegoPolicy: bytes.NewBufferString(module),
IncludeQueryString: true,
DeniedStatusCode: fiber.StatusForbidden,
DeniedResponseMessage: "status forbidden",
IncludeHeaders: []string{"Authorization"},
InputCreationMethod: func (ctx *fiber.Ctx) (map[string]interface{}, error) {
return map[string]interface{}{
"method": ctx.Method(),
"path": ctx.Path(),
}, nil
},
}
app.Use(opafiber.New(cfg))

app.Get("/", func(ctx *fiber.Ctx) error {
return ctx.SendStatus(200)
})

app.Listen(":8080")
}
+ + \ No newline at end of file diff --git a/contrib/otelfiber/example/index.html b/contrib/otelfiber/example/index.html index 893a0d349b0..ec7290d0bdb 100644 --- a/contrib/otelfiber/example/index.html +++ b/contrib/otelfiber/example/index.html @@ -6,8 +6,8 @@ Example | Fiber - - + +
@@ -16,8 +16,8 @@ stdout.

These instructions expect you have docker-compose installed.

Bring up the fiber-server and fiber-client services to run the example:

docker-compose up --detach fiber-server fiber-client

The fiber-client service sends just one HTTP request to fiber-server -and then exits. View the span generated by fiber-server in the logs:

docker-compose logs fiber-server

Shut down the services when you are finished with the example:

docker-compose down
- - +and then exits. View the span generated by fiber-server in the logs:

docker-compose logs fiber-server

Shut down the services when you are finished with the example:

docker-compose down
+ + \ No newline at end of file diff --git a/contrib/otelfiber/index.html b/contrib/otelfiber/index.html index 078b1112853..1ec110b8fb9 100644 --- a/contrib/otelfiber/index.html +++ b/contrib/otelfiber/index.html @@ -6,8 +6,8 @@ Otelfiber | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

OpenTelemetry support for Fiber.

Can be found on OpenTelemetry Registry.

Install​

This middleware supports Fiber v2.

go get -u github.com/gofiber/contrib/otelfiber

Signature​

otelfiber.Middleware(opts ...Option) fiber.Handler

Config​

PropertyTypeDescriptionDefault
Nextfunc(*fiber.Ctx) boolDefine a function to skip this middleware when returned trueRequired - Rego quernil
TracerProvideroteltrace.TracerProviderSpecifies a tracer provider to use for creating a tracernil - the global tracer provider is used
MeterProviderotelmetric.MeterProviderSpecifies a meter provider to use for reportingnil - the global meter provider is used
Port*intSpecifies the value to use when setting the net.host.port attribute on metrics/spansRequired: If not default (80 for http, 443 for https)
Propagatorspropagation.TextMapPropagatorSpecifies propagators to use for extracting information from the HTTP requestsIf none are specified, global ones will be used
ServerName*stringspecifies the value to use when setting the http.server_name attribute on metrics/spans-
SpanNameFormatterfunc(*fiber.Ctx) stringTakes a function that will be called on every request and the returned string will become the Span Namedefault formatter returns the route pathRaw

Usage​

Please refer to example

Example​

package main

import (
"context"
"errors"
"log"

"go.opentelemetry.io/otel/sdk/resource"

"github.com/gofiber/fiber/v2"

"github.com/gofiber/contrib/otelfiber"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
stdout "go.opentelemetry.io/otel/exporters/stdout/stdouttrace"

//"go.opentelemetry.io/otel/exporters/jaeger"
"go.opentelemetry.io/otel/propagation"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
oteltrace "go.opentelemetry.io/otel/trace"
)

var tracer = otel.Tracer("fiber-server")

func main() {
tp := initTracer()
defer func() {
if err := tp.Shutdown(context.Background()); err != nil {
log.Printf("Error shutting down tracer provider: %v", err)
}
}()

app := fiber.New()

app.Use(otelfiber.Middleware())

app.Get("/error", func(ctx *fiber.Ctx) error {
return errors.New("abc")
})

app.Get("/users/:id", func(c *fiber.Ctx) error {
id := c.Params("id")
name := getUser(c.UserContext(), id)
return c.JSON(fiber.Map{"id": id, name: name})
})

log.Fatal(app.Listen(":3000"))
}

func initTracer() *sdktrace.TracerProvider {
exporter, err := stdout.New(stdout.WithPrettyPrint())
if err != nil {
log.Fatal(err)
}
tp := sdktrace.NewTracerProvider(
sdktrace.WithSampler(sdktrace.AlwaysSample()),
sdktrace.WithBatcher(exporter),
sdktrace.WithResource(
resource.NewWithAttributes(
semconv.SchemaURL,
semconv.ServiceNameKey.String("my-service"),
)),
)
otel.SetTracerProvider(tp)
otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
return tp
}

func getUser(ctx context.Context, id string) string {
_, span := tracer.Start(ctx, "getUser", oteltrace.WithAttributes(attribute.String("id", id)))
defer span.End()
if id == "123" {
return "otelfiber tester"
}
return "unknown"
}
- - +Linter

OpenTelemetry support for Fiber.

Can be found on OpenTelemetry Registry.

Install​

This middleware supports Fiber v2.

go get -u github.com/gofiber/contrib/otelfiber

Signature​

otelfiber.Middleware(opts ...Option) fiber.Handler

Config​

PropertyTypeDescriptionDefault
Nextfunc(*fiber.Ctx) boolDefine a function to skip this middleware when returned trueRequired - Rego quernil
TracerProvideroteltrace.TracerProviderSpecifies a tracer provider to use for creating a tracernil - the global tracer provider is used
MeterProviderotelmetric.MeterProviderSpecifies a meter provider to use for reportingnil - the global meter provider is used
Port*intSpecifies the value to use when setting the net.host.port attribute on metrics/spansRequired: If not default (80 for http, 443 for https)
Propagatorspropagation.TextMapPropagatorSpecifies propagators to use for extracting information from the HTTP requestsIf none are specified, global ones will be used
ServerName*stringspecifies the value to use when setting the http.server_name attribute on metrics/spans-
SpanNameFormatterfunc(*fiber.Ctx) stringTakes a function that will be called on every request and the returned string will become the Span Namedefault formatter returns the route pathRaw

Usage​

Please refer to example

Example​

package main

import (
"context"
"errors"
"log"

"go.opentelemetry.io/otel/sdk/resource"

"github.com/gofiber/fiber/v2"

"github.com/gofiber/contrib/otelfiber"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
stdout "go.opentelemetry.io/otel/exporters/stdout/stdouttrace"

//"go.opentelemetry.io/otel/exporters/jaeger"
"go.opentelemetry.io/otel/propagation"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
oteltrace "go.opentelemetry.io/otel/trace"
)

var tracer = otel.Tracer("fiber-server")

func main() {
tp := initTracer()
defer func() {
if err := tp.Shutdown(context.Background()); err != nil {
log.Printf("Error shutting down tracer provider: %v", err)
}
}()

app := fiber.New()

app.Use(otelfiber.Middleware())

app.Get("/error", func(ctx *fiber.Ctx) error {
return errors.New("abc")
})

app.Get("/users/:id", func(c *fiber.Ctx) error {
id := c.Params("id")
name := getUser(c.UserContext(), id)
return c.JSON(fiber.Map{"id": id, name: name})
})

log.Fatal(app.Listen(":3000"))
}

func initTracer() *sdktrace.TracerProvider {
exporter, err := stdout.New(stdout.WithPrettyPrint())
if err != nil {
log.Fatal(err)
}
tp := sdktrace.NewTracerProvider(
sdktrace.WithSampler(sdktrace.AlwaysSample()),
sdktrace.WithBatcher(exporter),
sdktrace.WithResource(
resource.NewWithAttributes(
semconv.SchemaURL,
semconv.ServiceNameKey.String("my-service"),
)),
)
otel.SetTracerProvider(tp)
otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
return tp
}

func getUser(ctx context.Context, id string) string {
_, span := tracer.Start(ctx, "getUser", oteltrace.WithAttributes(attribute.String("id", id)))
defer span.End()
if id == "123" {
return "otelfiber tester"
}
return "unknown"
}
+ + \ No newline at end of file diff --git a/contrib/paseto/index.html b/contrib/paseto/index.html index 8f09fdd421e..7c4a288fe18 100644 --- a/contrib/paseto/index.html +++ b/contrib/paseto/index.html @@ -6,8 +6,8 @@ Paseto | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

PASETO returns a Web Token (PASETO) auth middleware.

  • For valid token, it sets the payload data in Ctx.Locals and calls next handler.
  • For invalid token, it returns "401 - Unauthorized" error.
  • For missing token, it returns "400 - BadRequest" error.

Install​

This middleware supports Fiber v2.

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/paseto
go get -u github.com/o1egl/paseto

Signature​

pasetoware.New(config ...pasetoware.Config) func(*fiber.Ctx) error

Config​

PropertyTypeDescriptionDefault
Nextfunc(*Ctx) boolDefines a function to skip middlewarenil
SuccessHandlerfunc(*fiber.Ctx) errorSuccessHandler defines a function which is executed for a valid token.c.Next()
ErrorHandlerfunc(*fiber.Ctx, error) errorErrorHandler defines a function which is executed for an invalid token.401 Invalid or expired PASETO
ValidatePayloadValidatorDefines a function to validate if payload is valid. Optional. In case payload used is created using CreateToken function. If token is created using another function, this function must be provided.nil
SymmetricKey[]byteSecret key to encrypt token. If present the middleware will generate local tokens.nil
PrivateKeyed25519.PrivateKeySecret key to sign the tokens. If present (along with its PublicKey) the middleware will generate public tokens.nil
PublicKeycrypto.PublicKeyPublic key to verify the tokens. If present (along with PrivateKey) the middleware will generate public tokens.nil
ContextKeystringContext key to store user information from the token into context."auth-token"
TokenLookup[2]stringTokenLookup is a string slice with size 2, that is used to extract token from the request["header","Authorization"]

Instructions​

When using this middleware, and creating a token for authentication, you can use the function pasetoware.CreateToken, that will create a token, encrypt or sign it and returns the PASETO token.

Passing a SymmetricKey in the Config results in a local (encrypted) token, while passing a PublicKey and PrivateKey results in a public (signed) token.

In case you want to use your own data structure, is needed to provide the Validate function in paseware.Config, that will return the data stored in the token, and a error.

- - +Linter

PASETO returns a Web Token (PASETO) auth middleware.

  • For valid token, it sets the payload data in Ctx.Locals and calls next handler.
  • For invalid token, it returns "401 - Unauthorized" error.
  • For missing token, it returns "400 - BadRequest" error.

Install​

This middleware supports Fiber v2.

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/paseto
go get -u github.com/o1egl/paseto

Signature​

pasetoware.New(config ...pasetoware.Config) func(*fiber.Ctx) error

Config​

PropertyTypeDescriptionDefault
Nextfunc(*Ctx) boolDefines a function to skip middlewarenil
SuccessHandlerfunc(*fiber.Ctx) errorSuccessHandler defines a function which is executed for a valid token.c.Next()
ErrorHandlerfunc(*fiber.Ctx, error) errorErrorHandler defines a function which is executed for an invalid token.401 Invalid or expired PASETO
ValidatePayloadValidatorDefines a function to validate if payload is valid. Optional. In case payload used is created using CreateToken function. If token is created using another function, this function must be provided.nil
SymmetricKey[]byteSecret key to encrypt token. If present the middleware will generate local tokens.nil
PrivateKeyed25519.PrivateKeySecret key to sign the tokens. If present (along with its PublicKey) the middleware will generate public tokens.nil
PublicKeycrypto.PublicKeyPublic key to verify the tokens. If present (along with PrivateKey) the middleware will generate public tokens.nil
ContextKeystringContext key to store user information from the token into context."auth-token"
TokenLookup[2]stringTokenLookup is a string slice with size 2, that is used to extract token from the request["header","Authorization"]

Instructions​

When using this middleware, and creating a token for authentication, you can use the function pasetoware.CreateToken, that will create a token, encrypt or sign it and returns the PASETO token.

Passing a SymmetricKey in the Config results in a local (encrypted) token, while passing a PublicKey and PrivateKey results in a public (signed) token.

In case you want to use your own data structure, is needed to provide the Validate function in paseware.Config, that will return the data stored in the token, and a error.

+ + \ No newline at end of file diff --git a/contrib/swagger/index.html b/contrib/swagger/index.html index f29c37fdfb3..0c030a9d116 100644 --- a/contrib/swagger/index.html +++ b/contrib/swagger/index.html @@ -6,8 +6,8 @@ Swagger | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Swagger middleware for Fiber. The middleware handles Swagger UI.

Table of Contents​

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/swagger"
)

Then create a Fiber app with app := fiber.New().

After you initiate your Fiber app, you can use the following possibilities:

Default Config​

app.Use(swagger.New(cfg))

Custom Config​

cfg := swagger.Config{
BasePath: "/", //swagger ui base path
FilePath: "./docs/swagger.json",
}

app.Use(swagger.New(cfg))
- - +Linter

Swagger middleware for Fiber. The middleware handles Swagger UI.

Table of Contents​

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/swagger"
)

Then create a Fiber app with app := fiber.New().

After you initiate your Fiber app, you can use the following possibilities:

Default Config​

app.Use(swagger.New(cfg))

Custom Config​

cfg := swagger.Config{
BasePath: "/", //swagger ui base path
FilePath: "./docs/swagger.json",
}

app.Use(swagger.New(cfg))
+ + \ No newline at end of file diff --git a/contrib/websocket/index.html b/contrib/websocket/index.html index 479d3a7eaa5..69eea43a7ad 100644 --- a/contrib/websocket/index.html +++ b/contrib/websocket/index.html @@ -6,8 +6,8 @@ Websocket | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Based on Fasthttp WebSocket for Fiber with available *fiber.Ctx methods like Locals, Params, Query and Cookies.

Install​

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/websocket

Example​

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/websocket"
)

func main() {
app := fiber.New()

app.Use("/ws", func(c *fiber.Ctx) error {
// IsWebSocketUpgrade returns true if the client
// requested upgrade to the WebSocket protocol.
if websocket.IsWebSocketUpgrade(c) {
c.Locals("allowed", true)
return c.Next()
}
return fiber.ErrUpgradeRequired
})

app.Get("/ws/:id", websocket.New(func(c *websocket.Conn) {
// c.Locals is added to the *websocket.Conn
log.Println(c.Locals("allowed")) // true
log.Println(c.Params("id")) // 123
log.Println(c.Query("v")) // 1.0
log.Println(c.Cookies("session")) // ""

// websocket.Conn bindings https://pkg.go.dev/github.com/fasthttp/websocket?tab=doc#pkg-index
var (
mt int
msg []byte
err error
)
for {
if mt, msg, err = c.ReadMessage(); err != nil {
log.Println("read:", err)
break
}
log.Printf("recv: %s", msg)

if err = c.WriteMessage(mt, msg); err != nil {
log.Println("write:", err)
break
}
}

}))

log.Fatal(app.Listen(":3000"))
// Access the websocket server: ws://localhost:3000/ws/123?v=1.0
// https://www.websocket.org/echo.html
}

Note with cache middleware​

If you get the error websocket: bad handshake when using the cache middleware, please use config.Next to skip websocket path.

app := fiber.New()
app.Use(cache.New(cache.Config{
Next: func(c *fiber.Ctx) bool {
return strings.Contains(c.Route().Path, "/ws")
},
}))

app.Get("/ws/:id", websocket.New(func(c *websocket.Conn) {}))
- - +Linter

Based on Fasthttp WebSocket for Fiber with available *fiber.Ctx methods like Locals, Params, Query and Cookies.

Install​

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/contrib/websocket

Example​

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/contrib/websocket"
)

func main() {
app := fiber.New()

app.Use("/ws", func(c *fiber.Ctx) error {
// IsWebSocketUpgrade returns true if the client
// requested upgrade to the WebSocket protocol.
if websocket.IsWebSocketUpgrade(c) {
c.Locals("allowed", true)
return c.Next()
}
return fiber.ErrUpgradeRequired
})

app.Get("/ws/:id", websocket.New(func(c *websocket.Conn) {
// c.Locals is added to the *websocket.Conn
log.Println(c.Locals("allowed")) // true
log.Println(c.Params("id")) // 123
log.Println(c.Query("v")) // 1.0
log.Println(c.Cookies("session")) // ""

// websocket.Conn bindings https://pkg.go.dev/github.com/fasthttp/websocket?tab=doc#pkg-index
var (
mt int
msg []byte
err error
)
for {
if mt, msg, err = c.ReadMessage(); err != nil {
log.Println("read:", err)
break
}
log.Printf("recv: %s", msg)

if err = c.WriteMessage(mt, msg); err != nil {
log.Println("write:", err)
break
}
}

}))

log.Fatal(app.Listen(":3000"))
// Access the websocket server: ws://localhost:3000/ws/123?v=1.0
// https://www.websocket.org/echo.html
}

Note with cache middleware​

If you get the error websocket: bad handshake when using the cache middleware, please use config.Next to skip websocket path.

app := fiber.New()
app.Use(cache.New(cache.Config{
Next: func(c *fiber.Ctx) bool {
return strings.Contains(c.Route().Path, "/ws")
},
}))

app.Get("/ws/:id", websocket.New(func(c *websocket.Conn) {}))
+ + \ No newline at end of file diff --git a/extra/benchmarks/index.html b/extra/benchmarks/index.html index 84e71c43c1c..216840c36b2 100644 --- a/extra/benchmarks/index.html +++ b/extra/benchmarks/index.html @@ -6,8 +6,8 @@ πŸ“Š Benchmarks | Fiber - - + +
@@ -16,8 +16,8 @@ Express handled 2,066 responses per second with an average latency of 390.44 ms.

Fiber vs Express

Multiple Queries​

Fiber handled 19,664 responses per second with an average latency of 25.7 ms.
Express handled 4,302 responses per second with an average latency of 117.2 ms.

Fiber vs Express

Single Query​

Fiber handled 368,647 responses per second with an average latency of 0.7 ms.
Express handled 57,880 responses per second with an average latency of 4.4 ms.

Fiber vs Express

JSON Serialization​

Fiber handled 1,146,667 responses per second with an average latency of 0.4 ms.
-Express handled 244,847 responses per second with an average latency of 1.1 ms.

Fiber vs Express

Go web framework benchmark​

πŸ”— https://github.com/smallnest/go-web-framework-benchmark

  • CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
  • MEM 4GB
  • GO go1.13.6 linux/amd64
  • OS Linux

The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers.

The concurrency clients are 5000.

Latency is the time of real processing time by web servers. The smaller is the better.

Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better.

If we enable http pipelining, test result as below:

Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is:

If we enable http pipelining, test result as below:

Dependency graph for v1.9.0

- - +Express handled 244,847 responses per second with an average latency of 1.1 ms.

Fiber vs Express

Go web framework benchmark​

πŸ”— https://github.com/smallnest/go-web-framework-benchmark

  • CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
  • MEM 4GB
  • GO go1.13.6 linux/amd64
  • OS Linux

The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers.

The concurrency clients are 5000.

Latency is the time of real processing time by web servers. The smaller is the better.

Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better.

If we enable http pipelining, test result as below:

Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is:

If we enable http pipelining, test result as below:

Dependency graph for v1.9.0

+ + \ No newline at end of file diff --git a/extra/faq/index.html b/extra/faq/index.html index 904c9a6ef28..1b741e0f224 100644 --- a/extra/faq/index.html +++ b/extra/faq/index.html @@ -6,15 +6,15 @@ πŸ€” FAQ | Fiber - - + +
Version: v2.x

πŸ€” FAQ

How should I structure my application?​

There is no definitive answer to this question. The answer depends on the scale of your application and the team that is involved. To be as flexible as possible, Fiber makes no assumptions in terms of structure.

Routes and other application-specific logic can live in as many files as you wish, in any directory structure you prefer. View the following examples for inspiration:

How do I handle custom 404 responses?​

If you're using v2.32.0 or later, all you need to do is to implement a custom error handler. See below, or see a more detailed explanation at Error Handling.

If you're using v2.31.0 or earlier, the error handler will not capture 404 errors. Instead, you need to add a middleware function at the very bottom of the stack (below all other functions) to handle a 404 response:

Example
app.Use(func(c *fiber.Ctx) error {
return c.Status(fiber.StatusNotFound).SendString("Sorry can't find that!")
})

How can i use live reload ?​

Air is a handy tool that automatically restarts your Go applications whenever the source code changes, making your development process faster and more efficient.

To use Air in a Fiber project, follow these steps:

  1. Install Air by downloading the appropriate binary for your operating system from the GitHub release page or by building the tool directly from source.
  2. Create a configuration file for Air in your project directory. This file can be named, for example, .air.toml or air.conf. Here's a sample configuration file that works with Fiber:
# .air.toml
root = "."
tmp_dir = "tmp"
[build]
cmd = "go build -o ./tmp/main ."
bin = "./tmp/main"
delay = 1000 # ms
exclude_dir = ["assets", "tmp", "vendor"]
include_ext = ["go", "tpl", "tmpl", "html"]
exclude_regex = ["_test\\.go"]
  1. Start your Fiber application using Air by running the following command in the terminal:
air

As you make changes to your source code, Air will detect them and automatically restart the application.

A complete example demonstrating the use of Air with Fiber can be found in the Fiber Recipes repository. This example shows how to configure and use Air in a Fiber project to create an efficient development environment.

How do I set up an error handler?​

To override the default error handler, you can override the default when providing a Config when initiating a new Fiber instance.

Example
app := fiber.New(fiber.Config{
ErrorHandler: func(c *fiber.Ctx, err error) error {
return c.Status(fiber.StatusInternalServerError).SendString(err.Error())
},
})

We have a dedicated page explaining how error handling works in Fiber, see Error Handling.

Which template engines does Fiber support?​

Fiber currently supports 8 template engines in our gofiber/template middleware:

To learn more about using Templates in Fiber, see Templates.

Does Fiber have a community chat?​

Yes, we have our own Discord server, where we hang out. We have different rooms for every subject.
If you have questions or just want to have a chat, feel free to join us via this > invite link <.

Does fiber support sub domain routing ?​

Yes we do, here are some examples: -This example works v2

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
)

type Host struct {
Fiber *fiber.App
}

func main() {
// Hosts
hosts := map[string]*Host{}
//-----
// API
//-----
api := fiber.New()
api.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))
hosts["api.localhost:3000"] = &Host{api}
api.Get("/", func(c *fiber.Ctx) error {
return c.SendString("API")
})
//------
// Blog
//------
blog := fiber.New()
blog.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))
hosts["blog.localhost:3000"] = &Host{blog}
blog.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Blog")
})
//---------
// Website
//---------
site := fiber.New()
site.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))

hosts["localhost:3000"] = &Host{site}
site.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Website")
})
// Server
app := fiber.New()
app.Use(func(c *fiber.Ctx) error {
host := hosts[c.Hostname()]
if host == nil {
return c.SendStatus(fiber.StatusNotFound)
} else {
host.Fiber.Handler()(c.Context())
return nil
}
})
log.Fatal(app.Listen(":3000"))
}

If more information is needed, please refer to this issue #750

- - +This example works v2

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
)

type Host struct {
Fiber *fiber.App
}

func main() {
// Hosts
hosts := map[string]*Host{}
//-----
// API
//-----
api := fiber.New()
api.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))
hosts["api.localhost:3000"] = &Host{api}
api.Get("/", func(c *fiber.Ctx) error {
return c.SendString("API")
})
//------
// Blog
//------
blog := fiber.New()
blog.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))
hosts["blog.localhost:3000"] = &Host{blog}
blog.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Blog")
})
//---------
// Website
//---------
site := fiber.New()
site.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))

hosts["localhost:3000"] = &Host{site}
site.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Website")
})
// Server
app := fiber.New()
app.Use(func(c *fiber.Ctx) error {
host := hosts[c.Hostname()]
if host == nil {
return c.SendStatus(fiber.StatusNotFound)
} else {
host.Fiber.Handler()(c.Context())
return nil
}
})
log.Fatal(app.Listen(":3000"))
}

If more information is needed, please refer to this issue #750

+ + \ No newline at end of file diff --git a/guide/error-handling/index.html b/guide/error-handling/index.html index b616e208759..a786e7d0dc6 100644 --- a/guide/error-handling/index.html +++ b/guide/error-handling/index.html @@ -6,13 +6,13 @@ πŸ› Error Handling | Fiber - - + +
-
Version: v2.x

πŸ› Error Handling

Catching Errors​

It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them.

app.Get("/", func(c *fiber.Ctx) error {
// Pass error to Fiber
return c.SendFile("file-does-not-exist")
})

Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below:

Example
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
)

func main() {
app := fiber.New()

app.Use(recover.New())

app.Get("/", func(c *fiber.Ctx) error {
panic("This panic is caught by fiber")
})

log.Fatal(app.Listen(":3000"))
}

You could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found).

Example
app.Get("/", func(c *fiber.Ctx) error {
// 503 Service Unavailable
return fiber.ErrServiceUnavailable

// 503 On vacation!
return fiber.NewError(fiber.StatusServiceUnavailable, "On vacation!")
})

Default Error Handler​

Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If the error is of type fiber.Error, the response is sent with the provided status code and message.

Example
// Default error handler
var DefaultErrorHandler = func(c *fiber.Ctx, err error) error {
// Status code defaults to 500
code := fiber.StatusInternalServerError

// Retrieve the custom status code if it's a *fiber.Error
var e *fiber.Error
if errors.As(err, &e) {
code = e.Code
}

// Set Content-Type: text/plain; charset=utf-8
c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)

// Return status code with error message
return c.Status(code).SendString(err.Error())
}

Custom Error Handler​

A custom error handler can be set using a Config when initializing a Fiber instance.

In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response.

The following example shows how to display error pages for different types of errors.

Example
// Create a new fiber instance with custom config
app := fiber.New(fiber.Config{
// Override default error handler
ErrorHandler: func(ctx *fiber.Ctx, err error) error {
// Status code defaults to 500
code := fiber.StatusInternalServerError

// Retrieve the custom status code if it's a *fiber.Error
var e *fiber.Error
if errors.As(err, &e) {
code = e.Code
}

// Send custom error page
err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))
if err != nil {
// In case the SendFile fails
return ctx.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")
}

// Return from handler
return nil
},
})

// ...

Special thanks to the Echo & Express framework for inspiration regarding error handling.

- - +
Version: v2.x

πŸ› Error Handling

Catching Errors​

It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them.

app.Get("/", func(c *fiber.Ctx) error {
// Pass error to Fiber
return c.SendFile("file-does-not-exist")
})

Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below:

Example
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
)

func main() {
app := fiber.New()

app.Use(recover.New())

app.Get("/", func(c *fiber.Ctx) error {
panic("This panic is caught by fiber")
})

log.Fatal(app.Listen(":3000"))
}

You could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found).

Example
app.Get("/", func(c *fiber.Ctx) error {
// 503 Service Unavailable
return fiber.ErrServiceUnavailable

// 503 On vacation!
return fiber.NewError(fiber.StatusServiceUnavailable, "On vacation!")
})

Default Error Handler​

Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If the error is of type fiber.Error, the response is sent with the provided status code and message.

Example
// Default error handler
var DefaultErrorHandler = func(c *fiber.Ctx, err error) error {
// Status code defaults to 500
code := fiber.StatusInternalServerError

// Retrieve the custom status code if it's a *fiber.Error
var e *fiber.Error
if errors.As(err, &e) {
code = e.Code
}

// Set Content-Type: text/plain; charset=utf-8
c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)

// Return status code with error message
return c.Status(code).SendString(err.Error())
}

Custom Error Handler​

A custom error handler can be set using a Config when initializing a Fiber instance.

In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response.

The following example shows how to display error pages for different types of errors.

Example
// Create a new fiber instance with custom config
app := fiber.New(fiber.Config{
// Override default error handler
ErrorHandler: func(ctx *fiber.Ctx, err error) error {
// Status code defaults to 500
code := fiber.StatusInternalServerError

// Retrieve the custom status code if it's a *fiber.Error
var e *fiber.Error
if errors.As(err, &e) {
code = e.Code
}

// Send custom error page
err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))
if err != nil {
// In case the SendFile fails
return ctx.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")
}

// Return from handler
return nil
},
})

// ...

Special thanks to the Echo & Express framework for inspiration regarding error handling.

+ + \ No newline at end of file diff --git a/guide/faster-fiber/index.html b/guide/faster-fiber/index.html index 80afd6b7637..6a703f01846 100644 --- a/guide/faster-fiber/index.html +++ b/guide/faster-fiber/index.html @@ -6,13 +6,13 @@ ⚑ Make Fiber Faster | Fiber - - + +
-
Version: v2.x

⚑ Make Fiber Faster

Custom JSON Encoder/Decoder​

Since Fiber v2.32.0, we use encoding/json as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of encoding/json, we recommend you to use these libraries:

Example
package main

import "github.com/gofiber/fiber/v2"
import "github.com/goccy/go-json"

func main() {
app := fiber.New(fiber.Config{
JSONEncoder: json.Marshal,
JSONDecoder: json.Unmarshal,
})

# ...
}

References​

- - +
Version: v2.x

⚑ Make Fiber Faster

Custom JSON Encoder/Decoder​

Since Fiber v2.32.0, we use encoding/json as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of encoding/json, we recommend you to use these libraries:

Example
package main

import "github.com/gofiber/fiber/v2"
import "github.com/goccy/go-json"

func main() {
app := fiber.New(fiber.Config{
JSONEncoder: json.Marshal,
JSONDecoder: json.Unmarshal,
})

# ...
}

References​

+ + \ No newline at end of file diff --git a/guide/grouping/index.html b/guide/grouping/index.html index 86a83e60de8..ee4d9b53542 100644 --- a/guide/grouping/index.html +++ b/guide/grouping/index.html @@ -6,13 +6,13 @@ 🎭 Grouping | Fiber - - + +
-
Version: v2.x

🎭 Grouping

info

In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.

Paths​

Like Routing, groups can also have paths that belong to a cluster.

func main() {
app := fiber.New()

api := app.Group("/api", middleware) // /api

v1 := api.Group("/v1", middleware) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", middleware) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

A Group of paths can have an optional handler.

func main() {
app := fiber.New()

api := app.Group("/api") // /api

v1 := api.Group("/v1") // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2") // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}
caution

Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.

Group Handlers​

Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue.

func main() {
app := fiber.New()

handler := func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK)
}
api := app.Group("/api") // /api

v1 := api.Group("/v1", func(c *fiber.Ctx) error { // middleware for /api/v1
c.Set("Version", "v1")
return c.Next()
})
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

log.Fatal(app.Listen(":3000"))
}
- - +
Version: v2.x

🎭 Grouping

info

In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.

Paths​

Like Routing, groups can also have paths that belong to a cluster.

func main() {
app := fiber.New()

api := app.Group("/api", middleware) // /api

v1 := api.Group("/v1", middleware) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", middleware) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

A Group of paths can have an optional handler.

func main() {
app := fiber.New()

api := app.Group("/api") // /api

v1 := api.Group("/v1") // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2") // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}
caution

Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.

Group Handlers​

Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue.

func main() {
app := fiber.New()

handler := func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK)
}
api := app.Group("/api") // /api

v1 := api.Group("/v1", func(c *fiber.Ctx) error { // middleware for /api/v1
c.Set("Version", "v1")
return c.Next()
})
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

log.Fatal(app.Listen(":3000"))
}
+ + \ No newline at end of file diff --git a/guide/hooks/index.html b/guide/hooks/index.html index c27124a8257..a60215d21e2 100644 --- a/guide/hooks/index.html +++ b/guide/hooks/index.html @@ -6,13 +6,13 @@ πŸͺ Hooks | Fiber - - + +
-
Version: v2.x

πŸͺ Hooks

With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:

Constants​

// Handlers define a function to create hooks for Fiber.
type OnRouteHandler = func(Route) error
type OnNameHandler = OnRouteHandler
type OnGroupHandler = func(Group) error
type OnGroupNameHandler = OnGroupHandler
type OnListenHandler = func() error
type OnForkHandler = func(int) error
type OnShutdownHandler = OnListenHandler
type OnMountHandler = func(*App) error

OnRoute​

OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by route parameter.

Signature
func (app *App) OnRoute(handler ...OnRouteHandler)

OnName​

OnName is a hook to execute user functions on each route naming. Also you can get route properties by route parameter.

caution

OnName only works with naming routes, not groups.

Signature
func (app *App) OnName(handler ...OnNameHandler)
package main

import (
"fmt"

"github.com/gofiber/fiber/v2"
)

func main() {
app := fiber.New()

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("index")

app.Hooks().OnName(func(r fiber.Route) error {
fmt.Print("Name: " + r.Name + ", ")

return nil
})

app.Hooks().OnName(func(r fiber.Route) error {
fmt.Print("Method: " + r.Method + "\n")

return nil
})

app.Get("/add/user", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("addUser")

app.Delete("/destroy/user", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("destroyUser")

app.Listen(":5000")
}

// Results:
// Name: addUser, Method: GET
// Name: destroyUser, Method: DELETE

OnGroup​

OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by group parameter.

Signature
func (app *App) OnGroup(handler ...OnGroupHandler)

OnGroupName​

OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by group parameter.

caution

OnGroupName only works with naming groups, not routes.

Signature
func (app *App) OnGroupName(handler ...OnGroupNameHandler)

OnListen​

OnListen is a hook to execute user functions on Listen, ListenTLS, Listener.

Signature
func (app *App) OnListen(handler ...OnListenHandler)

OnFork​

OnFork is a hook to execute user functions on Fork.

Signature
func (app *App) OnFork(handler ...OnForkHandler)

OnShutdown​

OnShutdown is a hook to execute user functions after Shutdown.

Signature
func (app *App) OnShutdown(handler ...OnShutdownHandler)

OnMount​

OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting.

Signature
func (h *Hooks) OnMount(handler ...OnMountHandler) 
package main

import (
"fmt"

"github.com/gofiber/fiber/v2"
)

func main() {
app := New()
app.Get("/", testSimpleHandler).Name("x")

subApp := New()
subApp.Get("/test", testSimpleHandler)

subApp.Hooks().OnMount(func(parent *fiber.App) error {
fmt.Print("Mount path of parent app: "+parent.MountPath())
// ...

return nil
})

app.Mount("/sub", subApp)
}

// Result:
// Mount path of parent app:
caution

OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.

- - +
Version: v2.x

πŸͺ Hooks

With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:

Constants​

// Handlers define a function to create hooks for Fiber.
type OnRouteHandler = func(Route) error
type OnNameHandler = OnRouteHandler
type OnGroupHandler = func(Group) error
type OnGroupNameHandler = OnGroupHandler
type OnListenHandler = func() error
type OnForkHandler = func(int) error
type OnShutdownHandler = OnListenHandler
type OnMountHandler = func(*App) error

OnRoute​

OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by route parameter.

Signature
func (app *App) OnRoute(handler ...OnRouteHandler)

OnName​

OnName is a hook to execute user functions on each route naming. Also you can get route properties by route parameter.

caution

OnName only works with naming routes, not groups.

Signature
func (app *App) OnName(handler ...OnNameHandler)
package main

import (
"fmt"

"github.com/gofiber/fiber/v2"
)

func main() {
app := fiber.New()

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("index")

app.Hooks().OnName(func(r fiber.Route) error {
fmt.Print("Name: " + r.Name + ", ")

return nil
})

app.Hooks().OnName(func(r fiber.Route) error {
fmt.Print("Method: " + r.Method + "\n")

return nil
})

app.Get("/add/user", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("addUser")

app.Delete("/destroy/user", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("destroyUser")

app.Listen(":5000")
}

// Results:
// Name: addUser, Method: GET
// Name: destroyUser, Method: DELETE

OnGroup​

OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by group parameter.

Signature
func (app *App) OnGroup(handler ...OnGroupHandler)

OnGroupName​

OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by group parameter.

caution

OnGroupName only works with naming groups, not routes.

Signature
func (app *App) OnGroupName(handler ...OnGroupNameHandler)

OnListen​

OnListen is a hook to execute user functions on Listen, ListenTLS, Listener.

Signature
func (app *App) OnListen(handler ...OnListenHandler)

OnFork​

OnFork is a hook to execute user functions on Fork.

Signature
func (app *App) OnFork(handler ...OnForkHandler)

OnShutdown​

OnShutdown is a hook to execute user functions after Shutdown.

Signature
func (app *App) OnShutdown(handler ...OnShutdownHandler)

OnMount​

OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting.

Signature
func (h *Hooks) OnMount(handler ...OnMountHandler) 
package main

import (
"fmt"

"github.com/gofiber/fiber/v2"
)

func main() {
app := New()
app.Get("/", testSimpleHandler).Name("x")

subApp := New()
subApp.Get("/test", testSimpleHandler)

subApp.Hooks().OnMount(func(parent *fiber.App) error {
fmt.Print("Mount path of parent app: "+parent.MountPath())
// ...

return nil
})

app.Mount("/sub", subApp)
}

// Result:
// Mount path of parent app:
caution

OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.

+ + \ No newline at end of file diff --git a/guide/routing/index.html b/guide/routing/index.html index 84baf3d717d..929bc4048fe 100644 --- a/guide/routing/index.html +++ b/guide/routing/index.html @@ -6,14 +6,14 @@ πŸ”Œ Routing | Fiber - - + +
Version: v2.x

πŸ”Œ Routing

Handlers​

Registers a route bound to a specific HTTP method.

Signatures
// HTTP methods
func (app *App) Get(path string, handlers ...Handler) Router
func (app *App) Head(path string, handlers ...Handler) Router
func (app *App) Post(path string, handlers ...Handler) Router
func (app *App) Put(path string, handlers ...Handler) Router
func (app *App) Delete(path string, handlers ...Handler) Router
func (app *App) Connect(path string, handlers ...Handler) Router
func (app *App) Options(path string, handlers ...Handler) Router
func (app *App) Trace(path string, handlers ...Handler) Router
func (app *App) Patch(path string, handlers ...Handler) Router

// Add allows you to specifiy a method as value
func (app *App) Add(method, path string, handlers ...Handler) Router

// All will register the route on all HTTP methods
// Almost the same as app.Use but not bound to prefixes
func (app *App) All(path string, handlers ...Handler) Router
Examples
// Simple GET handler
app.Get("/api/list", func(c *fiber.Ctx) error {
return c.SendString("I'm a GET request!")
})

// Simple POST handler
app.Post("/api/register", func(c *fiber.Ctx) error {
return c.SendString("I'm a POST request!")
})

Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc

Signature
func (app *App) Use(args ...interface{}) Router
Examples
// Match any request
app.Use(func(c *fiber.Ctx) error {
return c.Next()
})

// Match request starting with /api
app.Use("/api", func(c *fiber.Ctx) error {
return c.Next()
})

// Match requests starting with /api or /home (multiple-prefix support)
app.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {
return c.Next()
})

// Attach multiple handlers
app.Use("/api", func(c *fiber.Ctx) error {
c.Set("X-Custom-Header", random.String(32))
return c.Next()
}, func(c *fiber.Ctx) error {
return c.Next()
})

Paths​

Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns.

Examples of route paths based on strings

// This route path will match requests to the root route, "/":
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("root")
})

// This route path will match requests to "/about":
app.Get("/about", func(c *fiber.Ctx) error {
return c.SendString("about")
})

// This route path will match requests to "/random.txt":
app.Get("/random.txt", func(c *fiber.Ctx) error {
return c.SendString("random.txt")
})

As with the expressJs framework, the order of the route declaration plays a role. -When a request is received, the routes are checked in the order in which they are declared.

info

So please be careful to write routes with variable parameters after the routes that contain fixed parts, so that these variable parts do not match instead and unexpected behavior occurs.

Parameters​

Route parameters are dynamic elements in the route, which are named or not named segments. This segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys or for unnamed parameters the character(*, +) and the counter of this.

The characters :, +, and * are characters that introduce a parameter.

Greedy parameters are indicated by wildcard(*) or plus(+) signs.

The routing also offers the possibility to use optional parameters, for the named parameters these are marked with a final "?", unlike the plus sign which is not optional, you can use the wildcard character for a parameter range which is optional and greedy.

Example of define routes with route parameters

// Parameters
app.Get("/user/:name/books/:title", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s\n", c.Params("name"))
fmt.Fprintf(c, "%s\n", c.Params("title"))
return nil
})
// Plus - greedy - not optional
app.Get("/user/+", func(c *fiber.Ctx) error {
return c.SendString(c.Params("+"))
})

// Optional parameter
app.Get("/user/:name?", func(c *fiber.Ctx) error {
return c.SendString(c.Params("name"))
})

// Wildcard - greedy - optional
app.Get("/user/*", func(c *fiber.Ctx) error {
return c.SendString(c.Params("*"))
})

// This route path will match requests to "/v1/some/resource/name:customVerb", since the parameter character is escaped
app.Get("/v1/some/resource/name\\:customVerb", func(c *fiber.Ctx) error {
return c.SendString("Hello, Community")
})
info

Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes.

info

All special parameter characters can also be escaped with "\\" and lose their value, so you can use them in the route if you want, like in the custom methods of the google api design guide.

// http://localhost:3000/plantae/prunus.persica
app.Get("/plantae/:genus.:species", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s.%s\n", c.Params("genus"), c.Params("species"))
return nil // prunus.persica
})
// http://localhost:3000/flights/LAX-SFO
app.Get("/flights/:from-:to", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s-%s\n", c.Params("from"), c.Params("to"))
return nil // LAX-SFO
})

Our intelligent router recognizes that the introductory parameter characters should be part of the request route in this case and can process them as such.

// http://localhost:3000/shop/product/color:blue/size:xs
app.Get("/shop/product/color::color/size::size", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s:%s\n", c.Params("color"), c.Params("size"))
return nil // blue:xs
})

In addition, several parameters in a row and several unnamed parameter characters in the route, such as the wildcard or plus character, are possible, which greatly expands the possibilities of the router for the user.

// GET /@v1
// Params: "sign" -> "@", "param" -> "v1"
app.Get("/:sign:param", handler)

// GET /api-v1
// Params: "name" -> "v1"
app.Get("/api-:name", handler)

// GET /customer/v1/cart/proxy
// Params: "*1" -> "customer/", "*2" -> "/cart"
app.Get("/*v1*/proxy", handler)

// GET /v1/brand/4/shop/blue/xs
// Params: "*1" -> "brand/4", "*2" -> "blue/xs"
app.Get("/v1/*/shop/*", handler)

We have adapted the routing strongly to the express routing, but currently without the possibility of the regular expressions, because they are quite slow. The possibilities can be tested with version 0.1.7 (express 4) in the online Express route tester.

Constraints​

Route constraints execute when a match has occurred to the incoming URL and the URL path is tokenized into route values by parameters. The feature was intorduced in v2.37.0 and inspired by .NET Core.

caution

Constraints aren't validation for parameters. If constraint aren't valid for parameter value, Fiber returns 404 handler.

ConstraintExampleExample matches
int:id<int>123456789, -123456789
bool:active<bool>true,false
guid:id<guid>CD2C1638-1638-72D5-1638-DEADBEEF1638
float:weight<float>1.234, -1,001.01e8
minLen(value):username<minLen(4)>Test (must be at least 4 characters)
maxLen(value):filename<maxLen(8)>MyFile (must be no more than 8 characters
len(length):filename<len(12)>somefile.txt (exactly 12 characters)
min(value):age<min(18)>19 (Integer value must be at least 18)
max(value):age<max(120)>91 (Integer value must be no more than 120)
range(min,max):age<range(18,120)>91 (Integer value must be at least 18 but no more than 120)
alpha:name<alpha>Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive)
datetime:dob<datetime(2006\\-01\\-02)>2005-11-01
regex(expression):date<regex(\d{4}-\d{2}-\d{2})}>2022-08-27 (Must match regular expression)

Examples

app.Get("/:test<min(5)>", func(c *fiber.Ctx) error {
return c.SendString(c.Params("test"))
})

// curl -X GET http://localhost:3000/12
// 12

// curl -X GET http://localhost:3000/1
// Cannot GET /1
caution

You should use \\ before routing-specific characters when to use datetime constraint (*, +, ?, :, /, <, >, ;, (, )), to avoid wrong parsing.

Optional Parameter Example

You can impose constraints on optional parameters as well.

app.Get("/:test<int>?", func(c *fiber.Ctx) error {
return c.SendString(c.Params("test"))
})
// curl -X GET http://localhost:3000/42
// 42
// curl -X GET http://localhost:3000/
//
// curl -X GET http://localhost:3000/7.0
// Cannot GET /7.0

Middleware​

Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route.

Example of a middleware function

app.Use(func(c *fiber.Ctx) error {
// Set a custom header on all responses:
c.Set("X-Custom-Header", "Hello, World")

// Go to next middleware:
return c.Next()
})

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.

Grouping​

If you have many endpoints, you can organize your routes using Group.

func main() {
app := fiber.New()

api := app.Group("/api", middleware) // /api

v1 := api.Group("/v1", middleware) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", middleware) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

More information about this in our Grouping Guide

- - +When a request is received, the routes are checked in the order in which they are declared.

info

So please be careful to write routes with variable parameters after the routes that contain fixed parts, so that these variable parts do not match instead and unexpected behavior occurs.

Parameters​

Route parameters are dynamic elements in the route, which are named or not named segments. This segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys or for unnamed parameters the character(*, +) and the counter of this.

The characters :, +, and * are characters that introduce a parameter.

Greedy parameters are indicated by wildcard(*) or plus(+) signs.

The routing also offers the possibility to use optional parameters, for the named parameters these are marked with a final "?", unlike the plus sign which is not optional, you can use the wildcard character for a parameter range which is optional and greedy.

Example of define routes with route parameters

// Parameters
app.Get("/user/:name/books/:title", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s\n", c.Params("name"))
fmt.Fprintf(c, "%s\n", c.Params("title"))
return nil
})
// Plus - greedy - not optional
app.Get("/user/+", func(c *fiber.Ctx) error {
return c.SendString(c.Params("+"))
})

// Optional parameter
app.Get("/user/:name?", func(c *fiber.Ctx) error {
return c.SendString(c.Params("name"))
})

// Wildcard - greedy - optional
app.Get("/user/*", func(c *fiber.Ctx) error {
return c.SendString(c.Params("*"))
})

// This route path will match requests to "/v1/some/resource/name:customVerb", since the parameter character is escaped
app.Get("/v1/some/resource/name\\:customVerb", func(c *fiber.Ctx) error {
return c.SendString("Hello, Community")
})
info

Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes.

info

All special parameter characters can also be escaped with "\\" and lose their value, so you can use them in the route if you want, like in the custom methods of the google api design guide.

// http://localhost:3000/plantae/prunus.persica
app.Get("/plantae/:genus.:species", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s.%s\n", c.Params("genus"), c.Params("species"))
return nil // prunus.persica
})
// http://localhost:3000/flights/LAX-SFO
app.Get("/flights/:from-:to", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s-%s\n", c.Params("from"), c.Params("to"))
return nil // LAX-SFO
})

Our intelligent router recognizes that the introductory parameter characters should be part of the request route in this case and can process them as such.

// http://localhost:3000/shop/product/color:blue/size:xs
app.Get("/shop/product/color::color/size::size", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s:%s\n", c.Params("color"), c.Params("size"))
return nil // blue:xs
})

In addition, several parameters in a row and several unnamed parameter characters in the route, such as the wildcard or plus character, are possible, which greatly expands the possibilities of the router for the user.

// GET /@v1
// Params: "sign" -> "@", "param" -> "v1"
app.Get("/:sign:param", handler)

// GET /api-v1
// Params: "name" -> "v1"
app.Get("/api-:name", handler)

// GET /customer/v1/cart/proxy
// Params: "*1" -> "customer/", "*2" -> "/cart"
app.Get("/*v1*/proxy", handler)

// GET /v1/brand/4/shop/blue/xs
// Params: "*1" -> "brand/4", "*2" -> "blue/xs"
app.Get("/v1/*/shop/*", handler)

We have adapted the routing strongly to the express routing, but currently without the possibility of the regular expressions, because they are quite slow. The possibilities can be tested with version 0.1.7 (express 4) in the online Express route tester.

Constraints​

Route constraints execute when a match has occurred to the incoming URL and the URL path is tokenized into route values by parameters. The feature was intorduced in v2.37.0 and inspired by .NET Core.

caution

Constraints aren't validation for parameters. If constraint aren't valid for parameter value, Fiber returns 404 handler.

ConstraintExampleExample matches
int:id<int>123456789, -123456789
bool:active<bool>true,false
guid:id<guid>CD2C1638-1638-72D5-1638-DEADBEEF1638
float:weight<float>1.234, -1,001.01e8
minLen(value):username<minLen(4)>Test (must be at least 4 characters)
maxLen(value):filename<maxLen(8)>MyFile (must be no more than 8 characters
len(length):filename<len(12)>somefile.txt (exactly 12 characters)
min(value):age<min(18)>19 (Integer value must be at least 18)
max(value):age<max(120)>91 (Integer value must be no more than 120)
range(min,max):age<range(18,120)>91 (Integer value must be at least 18 but no more than 120)
alpha:name<alpha>Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive)
datetime:dob<datetime(2006\\-01\\-02)>2005-11-01
regex(expression):date<regex(\d{4}-\d{2}-\d{2})}>2022-08-27 (Must match regular expression)

Examples

app.Get("/:test<min(5)>", func(c *fiber.Ctx) error {
return c.SendString(c.Params("test"))
})

// curl -X GET http://localhost:3000/12
// 12

// curl -X GET http://localhost:3000/1
// Cannot GET /1
caution

You should use \\ before routing-specific characters when to use datetime constraint (*, +, ?, :, /, <, >, ;, (, )), to avoid wrong parsing.

Optional Parameter Example

You can impose constraints on optional parameters as well.

app.Get("/:test<int>?", func(c *fiber.Ctx) error {
return c.SendString(c.Params("test"))
})
// curl -X GET http://localhost:3000/42
// 42
// curl -X GET http://localhost:3000/
//
// curl -X GET http://localhost:3000/7.0
// Cannot GET /7.0

Middleware​

Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route.

Example of a middleware function

app.Use(func(c *fiber.Ctx) error {
// Set a custom header on all responses:
c.Set("X-Custom-Header", "Hello, World")

// Go to next middleware:
return c.Next()
})

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.

Grouping​

If you have many endpoints, you can organize your routes using Group.

func main() {
app := fiber.New()

api := app.Group("/api", middleware) // /api

v1 := api.Group("/v1", middleware) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", middleware) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

More information about this in our Grouping Guide

+ + \ No newline at end of file diff --git a/guide/templates/index.html b/guide/templates/index.html index bcf59c6c5a4..72a4b785171 100644 --- a/guide/templates/index.html +++ b/guide/templates/index.html @@ -6,14 +6,14 @@ πŸ“ Templates | Fiber - - + +
Version: v2.x

πŸ“ Templates

Template interfaces​

Fiber provides a Views interface to provide your own template engine:

type Views interface {
Load() error
Render(io.Writer, string, interface{}, ...string) error
}

Views interface contains a Load and Render method, Load is executed by Fiber on app initialization to load/parse the templates.

// Pass engine to Fiber's Views Engine
app := fiber.New(fiber.Config{
Views: engine,
// Views Layout is the global layout for all template render until override on Render function.
ViewsLayout: "layouts/main"
})

The Render method is linked to the ctx.Render() function that accepts a template name and binding data. It will use global layout if layout is not being defined in Render function. -If the Fiber config option PassLocalsToViews is enabled, then all locals set using ctx.Locals(key, value) will be passed to the template.

app.Get("/", func(c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
"hello": "world",
});
})

Engines​

Fiber team maintains templates package that provides wrappers for multiple template engines:

package main

import (
"log"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html/v2"
)

func main() {
// Initialize standard Go html template engine
engine := html.New("./views", ".html")
// If you want other engine, just replace with following
// Create a new engine with django
// engine := django.New("./views", ".django")

app := fiber.New(fiber.Config{
Views: engine,
})
app.Get("/", func(c *fiber.Ctx) error {
// Render index template
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

log.Fatal(app.Listen(":3000"))
}
- - +If the Fiber config option PassLocalsToViews is enabled, then all locals set using ctx.Locals(key, value) will be passed to the template.

app.Get("/", func(c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
"hello": "world",
});
})

Engines​

Fiber team maintains templates package that provides wrappers for multiple template engines:

package main

import (
"log"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html/v2"
)

func main() {
// Initialize standard Go html template engine
engine := html.New("./views", ".html")
// If you want other engine, just replace with following
// Create a new engine with django
// engine := django.New("./views", ".django")

app := fiber.New(fiber.Config{
Views: engine,
})
app.Get("/", func(c *fiber.Ctx) error {
// Render index template
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

log.Fatal(app.Listen(":3000"))
}
+ + \ No newline at end of file diff --git a/guide/validation/index.html b/guide/validation/index.html index 5a21ff7e9a5..fa9749b328f 100644 --- a/guide/validation/index.html +++ b/guide/validation/index.html @@ -6,13 +6,13 @@ πŸ”Ž Validation | Fiber - - + +
-
Version: v2.x

πŸ”Ž Validation

Validator package​

Fiber can make great use of the validator package to ensure correct validation of data to store.

You can find the detailed descriptions of the validations used in the fields contained on the structs below:

Validation Example
type Job struct{
Type string `validate:"required,min=3,max=32"`
Salary int `validate:"required,number"`
}

type User struct{
Name string `validate:"required,min=3,max=32"`
// use `*bool` here otherwise the validation will fail for `false` values
// Ref: https://github.com/go-playground/validator/issues/319#issuecomment-339222389
IsActive *bool `validate:"required"`
Email string `validate:"required,email,min=6,max=32"`
Job Job `validate:"dive"`
}

type ErrorResponse struct {
FailedField string
Tag string
Value string
}

var validate = validator.New()
func ValidateStruct(user User) []*ErrorResponse {
var errors []*ErrorResponse
err := validate.Struct(user)
if err != nil {
for _, err := range err.(validator.ValidationErrors) {
var element ErrorResponse
element.FailedField = err.StructNamespace()
element.Tag = err.Tag()
element.Value = err.Param()
errors = append(errors, &element)
}
}
return errors
}

func AddUser(c *fiber.Ctx) error {
//Connect to database

user := new(User)

if err := c.BodyParser(user); err != nil {
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"message": err.Error(),
})

}

errors := ValidateStruct(*user)
if errors != nil {
return c.Status(fiber.StatusBadRequest).JSON(errors)

}

//Do something else here

//Return user
return c.JSON(user)
}

// Running a test with the following curl commands
// curl -X POST -H "Content-Type: application/json" --data "{\"name\":\"john\",\"isactive\":\"True\"}" http://localhost:8080/register/user

// Results in
// [{"FailedField":"User.Email","Tag":"required","Value":""},{"FailedField":"User.Job.Salary","Tag":"required","Value":""},{"FailedField":"User.Job.Type","Tag":"required","Value":""}]⏎
- - +
Version: v2.x

πŸ”Ž Validation

Validator package​

Fiber can make great use of the validator package to ensure correct validation of data to store.

You can find the detailed descriptions of the validations used in the fields contained on the structs below:

Validation Example
type Job struct{
Type string `validate:"required,min=3,max=32"`
Salary int `validate:"required,number"`
}

type User struct{
Name string `validate:"required,min=3,max=32"`
// use `*bool` here otherwise the validation will fail for `false` values
// Ref: https://github.com/go-playground/validator/issues/319#issuecomment-339222389
IsActive *bool `validate:"required"`
Email string `validate:"required,email,min=6,max=32"`
Job Job `validate:"dive"`
}

type ErrorResponse struct {
FailedField string
Tag string
Value string
}

var validate = validator.New()
func ValidateStruct(user User) []*ErrorResponse {
var errors []*ErrorResponse
err := validate.Struct(user)
if err != nil {
for _, err := range err.(validator.ValidationErrors) {
var element ErrorResponse
element.FailedField = err.StructNamespace()
element.Tag = err.Tag()
element.Value = err.Param()
errors = append(errors, &element)
}
}
return errors
}

func AddUser(c *fiber.Ctx) error {
//Connect to database

user := new(User)

if err := c.BodyParser(user); err != nil {
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"message": err.Error(),
})

}

errors := ValidateStruct(*user)
if errors != nil {
return c.Status(fiber.StatusBadRequest).JSON(errors)

}

//Do something else here

//Return user
return c.JSON(user)
}

// Running a test with the following curl commands
// curl -X POST -H "Content-Type: application/json" --data "{\"name\":\"john\",\"isactive\":\"True\"}" http://localhost:8080/register/user

// Results in
// [{"FailedField":"User.Email","Tag":"required","Value":""},{"FailedField":"User.Job.Salary","Tag":"required","Value":""},{"FailedField":"User.Job.Type","Tag":"required","Value":""}]⏎
+ + \ No newline at end of file diff --git a/index.html b/index.html index 6ee12cbcc4a..83f9ef24309 100644 --- a/index.html +++ b/index.html @@ -6,14 +6,14 @@ πŸ‘‹ Welcome | Fiber - - + +
Version: v2.x

πŸ‘‹ Welcome

An online API documentation with examples so you can start building web apps with Fiber right away!

Fiber is an Express inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development with zero memory allocation and performance in mind.

These docs are for Fiber v2, which was released on September 15th, 2020.

Installation​

First of all, download and install Go. 1.17 or higher is required.

Installation is done using the go get command:

go get github.com/gofiber/fiber/v2

Zero Allocation​

Some values returned from *fiber.Ctx are not immutable by default.

Because fiber is optimized for high-performance, values returned from fiber.Ctx are not immutable by default and will be re-used across requests. As a rule of thumb, you must only use context values within the handler, and you must not keep any references. As soon as you return from the handler, any values you have obtained from the context will be re-used in future requests and will change below your feet. Here is an example:

func handler(c *fiber.Ctx) error {
// Variable is only valid within this handler
result := c.Params("foo")

// ...
}

If you need to persist such values outside the handler, make copies of their underlying buffer using the copy builtin. Here is an example for persisting a string:

func handler(c *fiber.Ctx) error {
// Variable is only valid within this handler
result := c.Params("foo")

// Make a copy
buffer := make([]byte, len(result))
copy(buffer, result)
resultCopy := string(buffer)
// Variable is now valid forever

// ...
}

We created a custom CopyString function that does the above and is available under gofiber/utils.

app.Get("/:foo", func(c *fiber.Ctx) error {
// Variable is now immutable
result := utils.CopyString(c.Params("foo"))

// ...
})

Alternatively, you can also use the Immutable setting. It will make all values returned from the context immutable, allowing you to persist them anywhere. Of course, this comes at the cost of performance.

app := fiber.New(fiber.Config{
Immutable: true,
})

For more information, please check #426 and #185.

Hello, World!​

Embedded below is essentially the most straightforward Fiber app you can create:

package main

import "github.com/gofiber/fiber/v2"

func main() {
app := fiber.New()

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

app.Listen(":3000")
}
go run server.go

Browse to http://localhost:3000 and you should see Hello, World! on the page.

Basic routing​

Routing refers to determining how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (GET, PUT, POST, etc.).

Each route can have multiple handler functions that are executed when the route is matched.

Route definition takes the following structures:

// Function signature
app.Method(path string, ...func(*fiber.Ctx) error)
  • app is an instance of Fiber
  • Method is an HTTP request method: GET, PUT, POST, etc.
  • path is a virtual path on the server
  • func(*fiber.Ctx) error is a callback function containing the Context executed when the route is matched

Simple route

// Respond with "Hello, World!" on root path, "/"
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

Parameters

// GET http://localhost:8080/hello%20world

app.Get("/:value", func(c *fiber.Ctx) error {
return c.SendString("value: " + c.Params("value"))
// => Get request with value: hello world
})

Optional parameter

// GET http://localhost:3000/john

app.Get("/:name?", func(c *fiber.Ctx) error {
if c.Params("name") != "" {
return c.SendString("Hello " + c.Params("name"))
// => Hello john
}
return c.SendString("Where is john?")
})

Wildcards

// GET http://localhost:3000/api/user/john

app.Get("/api/*", func(c *fiber.Ctx) error {
return c.SendString("API path: " + c.Params("*"))
// => API path: user/john
})

Static files​

To serve static files such as images, CSS, and JavaScript files, replace your function handler with a file or directory string.

Function signature:

app.Static(prefix, root string, config ...Static)

Use the following code to serve files in a directory named ./public:

app := fiber.New()

app.Static("/", "./public")

app.Listen(":3000")

Now, you can load the files that are in the ./public directory:

http://localhost:8080/hello.html
http://localhost:8080/js/jquery.js
http://localhost:8080/css/style.css

Note​

For more information on how to build APIs in Go with Fiber, please check out this excellent article -on building an express-style API in Go with Fiber.

- - +on building an express-style API in Go with Fiber.

+ + \ No newline at end of file diff --git a/next/api/app/index.html b/next/api/app/index.html index b068c36f9db..937d96e2084 100644 --- a/next/api/app/index.html +++ b/next/api/app/index.html @@ -6,13 +6,13 @@ πŸš€ App | Fiber - - + +
-
Version: Next

πŸš€ App

Static​

Use the Static method to serve static files such as images, CSS, and JavaScript.

info

By default, Static will serve index.html files in response to a request on a directory.

Signature
func (app *App) Static(prefix, root string, config ...Static) Router

Use the following code to serve files in a directory named ./public

app.Static("/", "./public")

// => http://localhost:3000/hello.html
// => http://localhost:3000/js/jquery.js
// => http://localhost:3000/css/style.css
Examples
// Serve files from multiple directories
app.Static("/", "./public")

// Serve files from "./files" directory:
app.Static("/", "./files")

You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below:

Examples
app.Static("/static", "./public")

// => http://localhost:3000/static/hello.html
// => http://localhost:3000/static/js/jquery.js
// => http://localhost:3000/static/css/style.css

If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings.

fiber.Static{}
// Static defines configuration options when defining static assets.
type Static struct {
// When set to true, the server tries minimizing CPU usage by caching compressed files.
// This works differently than the github.com/gofiber/compression middleware.
// Optional. Default value false
Compress bool `json:"compress"`

// When set to true, enables byte range requests.
// Optional. Default value false
ByteRange bool `json:"byte_range"`

// When set to true, enables directory browsing.
// Optional. Default value false.
Browse bool `json:"browse"`

// When set to true, enables direct download.
// Optional. Default value false.
Download bool `json:"download"`

// The name of the index file for serving a directory.
// Optional. Default value "index.html".
Index string `json:"index"`

// Expiration duration for inactive file handlers.
// Use a negative time.Duration to disable it.
//
// Optional. Default value 10 * time.Second.
CacheDuration time.Duration `json:"cache_duration"`

// The value for the Cache-Control HTTP-header
// that is set on the file response. MaxAge is defined in seconds.
//
// Optional. Default value 0.
MaxAge int `json:"max_age"`

// ModifyResponse defines a function that allows you to alter the response.
//
// Optional. Default: nil
ModifyResponse Handler

// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *Ctx) bool
}
Example
// Custom config
app.Static("/", "./public", fiber.Static{
Compress: true,
ByteRange: true,
Browse: true,
Index: "john.html",
CacheDuration: 10 * time.Second,
MaxAge: 3600,
})

Route Handlers​

Registers a route bound to a specific HTTP method.

Signatures
// HTTP methods
func (app *App) Get(path string, handlers ...Handler) Router
func (app *App) Head(path string, handlers ...Handler) Router
func (app *App) Post(path string, handlers ...Handler) Router
func (app *App) Put(path string, handlers ...Handler) Router
func (app *App) Delete(path string, handlers ...Handler) Router
func (app *App) Connect(path string, handlers ...Handler) Router
func (app *App) Options(path string, handlers ...Handler) Router
func (app *App) Trace(path string, handlers ...Handler) Router
func (app *App) Patch(path string, handlers ...Handler) Router

// Add allows you to specifiy a method as value
func (app *App) Add(method, path string, handlers ...Handler) Router

// All will register the route on all HTTP methods
// Almost the same as app.Use but not bound to prefixes
func (app *App) All(path string, handlers ...Handler) Router
Examples
// Simple GET handler
app.Get("/api/list", func(c *fiber.Ctx) error {
return c.SendString("I'm a GET request!")
})

// Simple POST handler
app.Post("/api/register", func(c *fiber.Ctx) error {
return c.SendString("I'm a POST request!")
})

Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc

Signature
func (app *App) Use(args ...interface{}) Router
Examples
// Match any request
app.Use(func(c *fiber.Ctx) error {
return c.Next()
})

// Match request starting with /api
app.Use("/api", func(c *fiber.Ctx) error {
return c.Next()
})

// Match requests starting with /api or /home (multiple-prefix support)
app.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {
return c.Next()
})

// Attach multiple handlers
app.Use("/api", func(c *fiber.Ctx) error {
c.Set("X-Custom-Header", random.String(32))
return c.Next()
}, func(c *fiber.Ctx) error {
return c.Next()
})

Mount​

You can Mount Fiber instance by creating a *Mount

Signature
func (a *App) Mount(prefix string, app *App) Router
Examples
func main() {
app := fiber.New()
micro := fiber.New()
app.Mount("/john", micro) // GET /john/doe -> 200 OK

micro.Get("/doe", func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK)
})

log.Fatal(app.Listen(":3000"))
}

MountPath​

The MountPath property contains one or more path patterns on which a sub-app was mounted.

Signature
func (app *App) MountPath() string
Examples
func main() {
app := fiber.New()
one := fiber.New()
two := fiber.New()
three := fiber.New()

two.Mount("/three", three)
one.Mount("/two", two)
app.Mount("/one", one)

one.MountPath() // "/one"
two.MountPath() // "/one/two"
three.MountPath() // "/one/two/three"
app.MountPath() // ""
}
caution

Mounting order is important for MountPath. If you want to get mount paths properly, you should start mounting from the deepest app.

Group​

You can group routes by creating a *Group struct.

Signature
func (app *App) Group(prefix string, handlers ...Handler) Router
Examples
func main() {
app := fiber.New()

api := app.Group("/api", handler) // /api

v1 := api.Group("/v1", handler) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", handler) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

Route​

You can define routes with a common prefix inside the common function.

Signature
func (app *App) Route(prefix string, fn func(router Router), name ...string) Router
Examples
func main() {
app := fiber.New()

app.Route("/test", func(api fiber.Router) {
api.Get("/foo", handler).Name("foo") // /test/foo (name: test.foo)
api.Get("/bar", handler).Name("bar") // /test/bar (name: test.bar)
}, "test.")

log.Fatal(app.Listen(":3000"))
}

Server​

Server returns the underlying fasthttp server

Signature
func (app *App) Server() *fasthttp.Server
Examples
func main() {
app := fiber.New()

app.Server().MaxConnsPerIP = 1

// ...
}

Server Shutdown​

Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners and then waits indefinitely for all connections to return to idle before shutting down.

ShutdownWithTimeout will forcefully close any active connections after the timeout expires.

ShutdownWithContext shuts down the server including by force if the context's deadline is exceeded.

func (app *App) Shutdown() error
func (app *App) ShutdownWithTimeout(timeout time.Duration) error
func (app *App) ShutdownWithContext(ctx context.Context) error

HandlersCount​

This method returns the amount of registered handlers.

Signature
func (app *App) HandlersCount() uint32

Stack​

This method returns the original router stack

Signature
func (app *App) Stack() [][]*Route
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/john/:age", handler)
app.Post("/register", handler)

data, _ := json.MarshalIndent(app.Stack(), "", " ")
fmt.Println(string(data))

app.Listen(":3000")
}
Result
[
[
{
"method": "GET",
"path": "/john/:age",
"params": [
"age"
]
}
],
[
{
"method": "HEAD",
"path": "/john/:age",
"params": [
"age"
]
}
],
[
{
"method": "POST",
"path": "/register",
"params": null
}
]
]

Name​

This method assigns the name of latest created route.

Signature
func (app *App) Name(name string) Router
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/", handler)
app.Name("index")

app.Get("/doe", handler).Name("home")

app.Trace("/tracer", handler).Name("tracert")

app.Delete("/delete", handler).Name("delete")

a := app.Group("/a")
a.Name("fd.")

a.Get("/test", handler).Name("test")

data, _ := json.MarshalIndent(app.Stack(), "", " ")
fmt.Print(string(data))

app.Listen(":3000")

}
Result
[
[
{
"method": "GET",
"name": "index",
"path": "/",
"params": null
},
{
"method": "GET",
"name": "home",
"path": "/doe",
"params": null
},
{
"method": "GET",
"name": "fd.test",
"path": "/a/test",
"params": null
}
],
[
{
"method": "HEAD",
"name": "",
"path": "/",
"params": null
},
{
"method": "HEAD",
"name": "",
"path": "/doe",
"params": null
},
{
"method": "HEAD",
"name": "",
"path": "/a/test",
"params": null
}
],
null,
null,
[
{
"method": "DELETE",
"name": "delete",
"path": "/delete",
"params": null
}
],
null,
null,
[
{
"method": "TRACE",
"name": "tracert",
"path": "/tracer",
"params": null
}
],
null
]

GetRoute​

This method gets the route by name.

Signature
func (app *App) GetRoute(name string) Route
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/", handler).Name("index")

data, _ := json.MarshalIndent(app.GetRoute("index"), "", " ")
fmt.Print(string(data))


app.Listen(":3000")

}
Result
{
"method": "GET",
"name": "index",
"path": "/",
"params": null
}

GetRoutes​

This method gets all routes.

Signature
func (app *App) GetRoutes(filterUseOption ...bool) []Route

When filterUseOption equal to true, it will filter the routes registered by the middleware.

Examples
func main() {
app := fiber.New()
app.Post("/", func (c *fiber.Ctx) error {
return c.SendString("Hello, World!")
}).Name("index")
data, _ := json.MarshalIndent(app.GetRoutes(true), "", " ")
fmt.Print(string(data))
}
Result
[
{
"method": "POST",
"name": "index",
"path": "/",
"params": null
}
]

Config​

Config returns the app config as value ( read-only ).

Signature
func (app *App) Config() Config

Handler​

Handler returns the server handler that can be used to serve custom *fasthttp.RequestCtx requests.

Signature
func (app *App) Handler() fasthttp.RequestHandler

Listen​

Listen serves HTTP requests from the given address.

Signature
func (app *App) Listen(addr string) error
Examples
// Listen on port :8080 
app.Listen(":8080")

// Custom host
app.Listen("127.0.0.1:8080")

ListenTLS​

ListenTLS serves HTTPs requests from the given address using certFile and keyFile paths to as TLS certificate and key file.

Signature
func (app *App) ListenTLS(addr, certFile, keyFile string) error
Examples
app.ListenTLS(":443", "./cert.pem", "./cert.key");

Using ListenTLS defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
Certificates: []tls.Certificate{
cert,
},
}

ListenTLSWithCertificate​

Signature
func (app *App) ListenTLS(addr string, cert tls.Certificate) error
Examples
app.ListenTLSWithCertificate(":443", cert);

Using ListenTLSWithCertificate defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
Certificates: []tls.Certificate{
cert,
},
}

ListenMutualTLS​

ListenMutualTLS serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file

Signature
func (app *App) ListenMutualTLS(addr, certFile, keyFile, clientCertFile string) error
Examples
app.ListenMutualTLS(":443", "./cert.pem", "./cert.key", "./ca-chain-cert.pem");

Using ListenMutualTLS defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: clientCertPool,
Certificates: []tls.Certificate{
cert,
},
}

ListenMutualTLSWithCertificate​

ListenMutualTLSWithCertificate serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file

Signature
func (app *App) ListenMutualTLSWithCertificate(addr string, cert tls.Certificate, clientCertPool *x509.CertPool) error
Examples
app.ListenMutualTLSWithCertificate(":443", cert, clientCertPool);

Using ListenMutualTLSWithCertificate defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: clientCertPool,
Certificates: []tls.Certificate{
cert,
},
}

Listener​

You can pass your own net.Listener using the Listener method. This method can be used to enable TLS/HTTPS with a custom tls.Config.

Signature
func (app *App) Listener(ln net.Listener) error
Examples
ln, _ := net.Listen("tcp", ":3000")

cer, _:= tls.LoadX509KeyPair("server.crt", "server.key")

ln = tls.NewListener(ln, &tls.Config{Certificates: []tls.Certificate{cer}})

app.Listener(ln)

Test​

Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 1s if you want to disable a timeout altogether, pass -1 as a second argument.

Signature
func (app *App) Test(req *http.Request, msTimeout ...int) (*http.Response, error)
Examples
// Create route with GET method for test:
app.Get("/", func(c *fiber.Ctx) error {
fmt.Println(c.BaseURL()) // => http://google.com
fmt.Println(c.Get("X-Custom-Header")) // => hi

return c.SendString("hello, World!")
})

// http.Request
req := httptest.NewRequest("GET", "http://google.com", nil)
req.Header.Set("X-Custom-Header", "hi")

// http.Response
resp, _ := app.Test(req)

// Do something with results:
if resp.StatusCode == fiber.StatusOK {
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body)) // => Hello, World!
}

Hooks​

Hooks is a method to return hooks property.

Signature
func (app *App) Hooks() *Hooks
- - +
Version: Next

πŸš€ App

Static​

Use the Static method to serve static files such as images, CSS, and JavaScript.

info

By default, Static will serve index.html files in response to a request on a directory.

Signature
func (app *App) Static(prefix, root string, config ...Static) Router

Use the following code to serve files in a directory named ./public

app.Static("/", "./public")

// => http://localhost:3000/hello.html
// => http://localhost:3000/js/jquery.js
// => http://localhost:3000/css/style.css
Examples
// Serve files from multiple directories
app.Static("/", "./public")

// Serve files from "./files" directory:
app.Static("/", "./files")

You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below:

Examples
app.Static("/static", "./public")

// => http://localhost:3000/static/hello.html
// => http://localhost:3000/static/js/jquery.js
// => http://localhost:3000/static/css/style.css

If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings.

fiber.Static{}
// Static defines configuration options when defining static assets.
type Static struct {
// When set to true, the server tries minimizing CPU usage by caching compressed files.
// This works differently than the github.com/gofiber/compression middleware.
// Optional. Default value false
Compress bool `json:"compress"`

// When set to true, enables byte range requests.
// Optional. Default value false
ByteRange bool `json:"byte_range"`

// When set to true, enables directory browsing.
// Optional. Default value false.
Browse bool `json:"browse"`

// When set to true, enables direct download.
// Optional. Default value false.
Download bool `json:"download"`

// The name of the index file for serving a directory.
// Optional. Default value "index.html".
Index string `json:"index"`

// Expiration duration for inactive file handlers.
// Use a negative time.Duration to disable it.
//
// Optional. Default value 10 * time.Second.
CacheDuration time.Duration `json:"cache_duration"`

// The value for the Cache-Control HTTP-header
// that is set on the file response. MaxAge is defined in seconds.
//
// Optional. Default value 0.
MaxAge int `json:"max_age"`

// ModifyResponse defines a function that allows you to alter the response.
//
// Optional. Default: nil
ModifyResponse Handler

// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *Ctx) bool
}
Example
// Custom config
app.Static("/", "./public", fiber.Static{
Compress: true,
ByteRange: true,
Browse: true,
Index: "john.html",
CacheDuration: 10 * time.Second,
MaxAge: 3600,
})

Route Handlers​

Registers a route bound to a specific HTTP method.

Signatures
// HTTP methods
func (app *App) Get(path string, handlers ...Handler) Router
func (app *App) Head(path string, handlers ...Handler) Router
func (app *App) Post(path string, handlers ...Handler) Router
func (app *App) Put(path string, handlers ...Handler) Router
func (app *App) Delete(path string, handlers ...Handler) Router
func (app *App) Connect(path string, handlers ...Handler) Router
func (app *App) Options(path string, handlers ...Handler) Router
func (app *App) Trace(path string, handlers ...Handler) Router
func (app *App) Patch(path string, handlers ...Handler) Router

// Add allows you to specifiy a method as value
func (app *App) Add(method, path string, handlers ...Handler) Router

// All will register the route on all HTTP methods
// Almost the same as app.Use but not bound to prefixes
func (app *App) All(path string, handlers ...Handler) Router
Examples
// Simple GET handler
app.Get("/api/list", func(c *fiber.Ctx) error {
return c.SendString("I'm a GET request!")
})

// Simple POST handler
app.Post("/api/register", func(c *fiber.Ctx) error {
return c.SendString("I'm a POST request!")
})

Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc

Signature
func (app *App) Use(args ...interface{}) Router
Examples
// Match any request
app.Use(func(c *fiber.Ctx) error {
return c.Next()
})

// Match request starting with /api
app.Use("/api", func(c *fiber.Ctx) error {
return c.Next()
})

// Match requests starting with /api or /home (multiple-prefix support)
app.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {
return c.Next()
})

// Attach multiple handlers
app.Use("/api", func(c *fiber.Ctx) error {
c.Set("X-Custom-Header", random.String(32))
return c.Next()
}, func(c *fiber.Ctx) error {
return c.Next()
})

Mount​

You can Mount Fiber instance by creating a *Mount

Signature
func (a *App) Mount(prefix string, app *App) Router
Examples
func main() {
app := fiber.New()
micro := fiber.New()
app.Mount("/john", micro) // GET /john/doe -> 200 OK

micro.Get("/doe", func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK)
})

log.Fatal(app.Listen(":3000"))
}

MountPath​

The MountPath property contains one or more path patterns on which a sub-app was mounted.

Signature
func (app *App) MountPath() string
Examples
func main() {
app := fiber.New()
one := fiber.New()
two := fiber.New()
three := fiber.New()

two.Mount("/three", three)
one.Mount("/two", two)
app.Mount("/one", one)

one.MountPath() // "/one"
two.MountPath() // "/one/two"
three.MountPath() // "/one/two/three"
app.MountPath() // ""
}
caution

Mounting order is important for MountPath. If you want to get mount paths properly, you should start mounting from the deepest app.

Group​

You can group routes by creating a *Group struct.

Signature
func (app *App) Group(prefix string, handlers ...Handler) Router
Examples
func main() {
app := fiber.New()

api := app.Group("/api", handler) // /api

v1 := api.Group("/v1", handler) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", handler) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

Route​

You can define routes with a common prefix inside the common function.

Signature
func (app *App) Route(prefix string, fn func(router Router), name ...string) Router
Examples
func main() {
app := fiber.New()

app.Route("/test", func(api fiber.Router) {
api.Get("/foo", handler).Name("foo") // /test/foo (name: test.foo)
api.Get("/bar", handler).Name("bar") // /test/bar (name: test.bar)
}, "test.")

log.Fatal(app.Listen(":3000"))
}

Server​

Server returns the underlying fasthttp server

Signature
func (app *App) Server() *fasthttp.Server
Examples
func main() {
app := fiber.New()

app.Server().MaxConnsPerIP = 1

// ...
}

Server Shutdown​

Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners and then waits indefinitely for all connections to return to idle before shutting down.

ShutdownWithTimeout will forcefully close any active connections after the timeout expires.

ShutdownWithContext shuts down the server including by force if the context's deadline is exceeded.

func (app *App) Shutdown() error
func (app *App) ShutdownWithTimeout(timeout time.Duration) error
func (app *App) ShutdownWithContext(ctx context.Context) error

HandlersCount​

This method returns the amount of registered handlers.

Signature
func (app *App) HandlersCount() uint32

Stack​

This method returns the original router stack

Signature
func (app *App) Stack() [][]*Route
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/john/:age", handler)
app.Post("/register", handler)

data, _ := json.MarshalIndent(app.Stack(), "", " ")
fmt.Println(string(data))

app.Listen(":3000")
}
Result
[
[
{
"method": "GET",
"path": "/john/:age",
"params": [
"age"
]
}
],
[
{
"method": "HEAD",
"path": "/john/:age",
"params": [
"age"
]
}
],
[
{
"method": "POST",
"path": "/register",
"params": null
}
]
]

Name​

This method assigns the name of latest created route.

Signature
func (app *App) Name(name string) Router
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/", handler)
app.Name("index")

app.Get("/doe", handler).Name("home")

app.Trace("/tracer", handler).Name("tracert")

app.Delete("/delete", handler).Name("delete")

a := app.Group("/a")
a.Name("fd.")

a.Get("/test", handler).Name("test")

data, _ := json.MarshalIndent(app.Stack(), "", " ")
fmt.Print(string(data))

app.Listen(":3000")

}
Result
[
[
{
"method": "GET",
"name": "index",
"path": "/",
"params": null
},
{
"method": "GET",
"name": "home",
"path": "/doe",
"params": null
},
{
"method": "GET",
"name": "fd.test",
"path": "/a/test",
"params": null
}
],
[
{
"method": "HEAD",
"name": "",
"path": "/",
"params": null
},
{
"method": "HEAD",
"name": "",
"path": "/doe",
"params": null
},
{
"method": "HEAD",
"name": "",
"path": "/a/test",
"params": null
}
],
null,
null,
[
{
"method": "DELETE",
"name": "delete",
"path": "/delete",
"params": null
}
],
null,
null,
[
{
"method": "TRACE",
"name": "tracert",
"path": "/tracer",
"params": null
}
],
null
]

GetRoute​

This method gets the route by name.

Signature
func (app *App) GetRoute(name string) Route
Examples
var handler = func(c *fiber.Ctx) error { return nil }

func main() {
app := fiber.New()

app.Get("/", handler).Name("index")

data, _ := json.MarshalIndent(app.GetRoute("index"), "", " ")
fmt.Print(string(data))


app.Listen(":3000")

}
Result
{
"method": "GET",
"name": "index",
"path": "/",
"params": null
}

GetRoutes​

This method gets all routes.

Signature
func (app *App) GetRoutes(filterUseOption ...bool) []Route

When filterUseOption equal to true, it will filter the routes registered by the middleware.

Examples
func main() {
app := fiber.New()
app.Post("/", func (c *fiber.Ctx) error {
return c.SendString("Hello, World!")
}).Name("index")
data, _ := json.MarshalIndent(app.GetRoutes(true), "", " ")
fmt.Print(string(data))
}
Result
[
{
"method": "POST",
"name": "index",
"path": "/",
"params": null
}
]

Config​

Config returns the app config as value ( read-only ).

Signature
func (app *App) Config() Config

Handler​

Handler returns the server handler that can be used to serve custom *fasthttp.RequestCtx requests.

Signature
func (app *App) Handler() fasthttp.RequestHandler

Listen​

Listen serves HTTP requests from the given address.

Signature
func (app *App) Listen(addr string) error
Examples
// Listen on port :8080 
app.Listen(":8080")

// Custom host
app.Listen("127.0.0.1:8080")

ListenTLS​

ListenTLS serves HTTPs requests from the given address using certFile and keyFile paths to as TLS certificate and key file.

Signature
func (app *App) ListenTLS(addr, certFile, keyFile string) error
Examples
app.ListenTLS(":443", "./cert.pem", "./cert.key");

Using ListenTLS defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
Certificates: []tls.Certificate{
cert,
},
}

ListenTLSWithCertificate​

Signature
func (app *App) ListenTLS(addr string, cert tls.Certificate) error
Examples
app.ListenTLSWithCertificate(":443", cert);

Using ListenTLSWithCertificate defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
Certificates: []tls.Certificate{
cert,
},
}

ListenMutualTLS​

ListenMutualTLS serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file

Signature
func (app *App) ListenMutualTLS(addr, certFile, keyFile, clientCertFile string) error
Examples
app.ListenMutualTLS(":443", "./cert.pem", "./cert.key", "./ca-chain-cert.pem");

Using ListenMutualTLS defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: clientCertPool,
Certificates: []tls.Certificate{
cert,
},
}

ListenMutualTLSWithCertificate​

ListenMutualTLSWithCertificate serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file

Signature
func (app *App) ListenMutualTLSWithCertificate(addr string, cert tls.Certificate, clientCertPool *x509.CertPool) error
Examples
app.ListenMutualTLSWithCertificate(":443", cert, clientCertPool);

Using ListenMutualTLSWithCertificate defaults to the following config ( use Listener to provide your own config )

Default *tls.Config
&tls.Config{
MinVersion: tls.VersionTLS12,
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: clientCertPool,
Certificates: []tls.Certificate{
cert,
},
}

Listener​

You can pass your own net.Listener using the Listener method. This method can be used to enable TLS/HTTPS with a custom tls.Config.

Signature
func (app *App) Listener(ln net.Listener) error
Examples
ln, _ := net.Listen("tcp", ":3000")

cer, _:= tls.LoadX509KeyPair("server.crt", "server.key")

ln = tls.NewListener(ln, &tls.Config{Certificates: []tls.Certificate{cer}})

app.Listener(ln)

Test​

Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 1s if you want to disable a timeout altogether, pass -1 as a second argument.

Signature
func (app *App) Test(req *http.Request, msTimeout ...int) (*http.Response, error)
Examples
// Create route with GET method for test:
app.Get("/", func(c *fiber.Ctx) error {
fmt.Println(c.BaseURL()) // => http://google.com
fmt.Println(c.Get("X-Custom-Header")) // => hi

return c.SendString("hello, World!")
})

// http.Request
req := httptest.NewRequest("GET", "http://google.com", nil)
req.Header.Set("X-Custom-Header", "hi")

// http.Response
resp, _ := app.Test(req)

// Do something with results:
if resp.StatusCode == fiber.StatusOK {
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body)) // => Hello, World!
}

Hooks​

Hooks is a method to return hooks property.

Signature
func (app *App) Hooks() *Hooks
+ + \ No newline at end of file diff --git a/next/api/client/index.html b/next/api/client/index.html index 7c5674bd284..1318825f5c5 100644 --- a/next/api/client/index.html +++ b/next/api/client/index.html @@ -6,14 +6,14 @@ 🌎 Client | Fiber - - + +
Version: Next

🌎 Client

Start request​

Start a http request with http method and url.

Signatures
// Client http methods
func (c *Client) Get(url string) *Agent
func (c *Client) Head(url string) *Agent
func (c *Client) Post(url string) *Agent
func (c *Client) Put(url string) *Agent
func (c *Client) Patch(url string) *Agent
func (c *Client) Delete(url string) *Agent

✨ Agent​

Agent is built on top of FastHTTP's HostClient which has lots of convenient helper methods such as dedicated methods for request methods.

Parse​

Parse initializes a HostClient.

Parse
a := AcquireAgent()
req := a.Request()
req.Header.SetMethod(MethodGet)
req.SetRequestURI("http://example.com")

if err := a.Parse(); err != nil {
panic(err)
}

code, body, errs := a.Bytes() // ...

Set​

Set sets the given key: value header.

Signature
func (a *Agent) Set(k, v string) *Agent
func (a *Agent) SetBytesK(k []byte, v string) *Agent
func (a *Agent) SetBytesV(k string, v []byte) *Agent
func (a *Agent) SetBytesKV(k []byte, v []byte) *Agent
Example
agent.Set("k1", "v1").
SetBytesK([]byte("k1"), "v1").
SetBytesV("k1", []byte("v1")).
SetBytesKV([]byte("k2"), []byte("v2"))
// ...

Add​

Add adds the given key: value header. Multiple headers with the same key may be added with this function.

Signature
func (a *Agent) Add(k, v string) *Agent
func (a *Agent) AddBytesK(k []byte, v string) *Agent
func (a *Agent) AddBytesV(k string, v []byte) *Agent
func (a *Agent) AddBytesKV(k []byte, v []byte) *Agent
Example
agent.Add("k1", "v1").
AddBytesK([]byte("k1"), "v1").
AddBytesV("k1", []byte("v1")).
AddBytesKV([]byte("k2"), []byte("v2"))
// Headers:
// K1: v1
// K1: v1
// K1: v1
// K2: v2

ConnectionClose​

ConnectionClose adds the Connection: close header.

Signature
func (a *Agent) ConnectionClose() *Agent
Example
agent.ConnectionClose()
// ...

UserAgent​

UserAgent sets User-Agent header value.

Signature
func (a *Agent) UserAgent(userAgent string) *Agent
func (a *Agent) UserAgentBytes(userAgent []byte) *Agent
Example
agent.UserAgent("fiber")
// ...

Cookie sets a cookie in key: value form. Cookies can be used to set multiple cookies.

Signature
func (a *Agent) Cookie(key, value string) *Agent
func (a *Agent) CookieBytesK(key []byte, value string) *Agent
func (a *Agent) CookieBytesKV(key, value []byte) *Agent
func (a *Agent) Cookies(kv ...string) *Agent
func (a *Agent) CookiesBytesKV(kv ...[]byte) *Agent
Example
agent.Cookie("k", "v")
agent.Cookies("k1", "v1", "k2", "v2")
// ...

Referer​

Referer sets the Referer header value.

Signature
func (a *Agent) Referer(referer string) *Agent
func (a *Agent) RefererBytes(referer []byte) *Agent
Example
agent.Referer("https://docs.gofiber.io")
// ...

ContentType​

ContentType sets Content-Type header value.

Signature
func (a *Agent) ContentType(contentType string) *Agent
func (a *Agent) ContentTypeBytes(contentType []byte) *Agent
Example
agent.ContentType("custom-type")
// ...

Host​

Host sets the Host header.

Signature
func (a *Agent) Host(host string) *Agent
func (a *Agent) HostBytes(host []byte) *Agent
Example
agent.Host("example.com")
// ...

QueryString​

QueryString sets the URI query string.

Signature
func (a *Agent) QueryString(queryString string) *Agent
func (a *Agent) QueryStringBytes(queryString []byte) *Agent
Example
agent.QueryString("foo=bar")
// ...

BasicAuth​

BasicAuth sets the URI username and password using HTTP Basic Auth.

Signature
func (a *Agent) BasicAuth(username, password string) *Agent
func (a *Agent) BasicAuthBytes(username, password []byte) *Agent
Example
agent.BasicAuth("foo", "bar")
// ...

Body​

There are several ways to set request body.

Signature
func (a *Agent) BodyString(bodyString string) *Agent
func (a *Agent) Body(body []byte) *Agent

// BodyStream sets request body stream and, optionally body size.
//
// If bodySize is >= 0, then the bodyStream must provide exactly bodySize bytes
// before returning io.EOF.
//
// If bodySize < 0, then bodyStream is read until io.EOF.
//
// bodyStream.Close() is called after finishing reading all body data
// if it implements io.Closer.
//
// Note that GET and HEAD requests cannot have body.
func (a *Agent) BodyStream(bodyStream io.Reader, bodySize int) *Agent
Example
agent.BodyString("foo=bar")
agent.Body([]byte("bar=baz"))
agent.BodyStream(strings.NewReader("body=stream"), -1)
// ...

JSON​

JSON sends a JSON request by setting the Content-Type header to application/json.

Signature
func (a *Agent) JSON(v interface{}) *Agent
Example
agent.JSON(fiber.Map{"success": true})
// ...

XML​

XML sends an XML request by setting the Content-Type header to application/xml.

Signature
func (a *Agent) XML(v interface{}) *Agent
Example
agent.XML(fiber.Map{"success": true})
// ...

Form​

Form sends a form request by setting the Content-Type header to application/x-www-form-urlencoded.

Signature
// Form sends form request with body if args is non-nil.
//
// It is recommended obtaining args via AcquireArgs and release it
// manually in performance-critical code.
func (a *Agent) Form(args *Args) *Agent
Example
args := AcquireArgs()
args.Set("foo", "bar")

agent.Form(args)
// ...
ReleaseArgs(args)

MultipartForm​

MultipartForm sends multipart form request by setting the Content-Type header to multipart/form-data. These requests can include key-value's and files.

Signature
// MultipartForm sends multipart form request with k-v and files.
//
// It is recommended to obtain args via AcquireArgs and release it
// manually in performance-critical code.
func (a *Agent) MultipartForm(args *Args) *Agent
Example
args := AcquireArgs()
args.Set("foo", "bar")

agent.MultipartForm(args)
// ...
ReleaseArgs(args)

Fiber provides several methods for sending files. Note that they must be called before MultipartForm.

Boundary​

Boundary sets boundary for multipart form request.

Signature
func (a *Agent) Boundary(boundary string) *Agent
Example
agent.Boundary("myBoundary")
.MultipartForm(nil)
// ...

SendFile(s)​

SendFile read a file and appends it to a multipart form request. Sendfiles can be used to append multiple files.

Signature
func (a *Agent) SendFile(filename string, fieldname ...string) *Agent
func (a *Agent) SendFiles(filenamesAndFieldnames ...string) *Agent
Example
agent.SendFile("f", "field name")
.SendFiles("f1", "field name1", "f2").
.MultipartForm(nil)
// ...

FileData​

FileData appends file data for multipart form request.

// FormFile represents multipart form file
type FormFile struct {
// Fieldname is form file's field name
Fieldname string
// Name is form file's name
Name string
// Content is form file's content
Content []byte
}
Signature
// FileData appends files for multipart form request.
//
// It is recommended obtaining formFile via AcquireFormFile and release it
// manually in performance-critical code.
func (a *Agent) FileData(formFiles ...*FormFile) *Agent
Example
ff1 := &FormFile{"filename1", "field name1", []byte("content")}
ff2 := &FormFile{"filename2", "field name2", []byte("content")}
agent.FileData(ff1, ff2).
MultipartForm(nil)
// ...

Debug​

Debug mode enables logging request and response detail to io.writer(default is os.Stdout).

Signature
func (a *Agent) Debug(w ...io.Writer) *Agent
Example
agent.Debug()
// ...

Timeout​

Timeout sets request timeout duration.

Signature
func (a *Agent) Timeout(timeout time.Duration) *Agent
Example
agent.Timeout(time.Second)
// ...

Reuse​

Reuse enables the Agent instance to be used again after one request. If agent is reusable, then it should be released manually when it is no longer used.

Signature
func (a *Agent) Reuse() *Agent
Example
agent.Reuse()
// ...

InsecureSkipVerify​

InsecureSkipVerify controls whether the Agent verifies the server certificate chain and host name.

Signature
func (a *Agent) InsecureSkipVerify() *Agent
Example
agent.InsecureSkipVerify()
// ...

TLSConfig​

TLSConfig sets tls config.

Signature
func (a *Agent) TLSConfig(config *tls.Config) *Agent
Example
// Create tls certificate
cer, _ := tls.LoadX509KeyPair("pem", "key")

config := &tls.Config{
Certificates: []tls.Certificate{cer},
}

agent.TLSConfig(config)
// ...

MaxRedirectsCount​

MaxRedirectsCount sets max redirect count for GET and HEAD.

Signature
func (a *Agent) MaxRedirectsCount(count int) *Agent
Example
agent.MaxRedirectsCount(7)
// ...

JSONEncoder​

JSONEncoder sets custom json encoder.

Signature
func (a *Agent) JSONEncoder(jsonEncoder utils.JSONMarshal) *Agent
Example
agent.JSONEncoder(json.Marshal)
// ...

JSONDecoder​

JSONDecoder sets custom json decoder.

Signature
func (a *Agent) JSONDecoder(jsonDecoder utils.JSONUnmarshal) *Agent
Example
agent.JSONDecoder(json.Unmarshal)
// ...

Request​

Request returns Agent request instance.

Signature
func (a *Agent) Request() *Request
Example
req := agent.Request()
// ...

SetResponse​

SetResponse sets custom response for the Agent instance. It is recommended obtaining custom response via AcquireResponse and release it manually in performance-critical code.

Signature
func (a *Agent) SetResponse(customResp *Response) *Agent
Example
resp := AcquireResponse()
agent.SetResponse(resp)
// ...
ReleaseResponse(resp)

Dest​

Dest sets custom dest. The contents of dest will be replaced by the response body, if the dest is too small a new slice will be allocated.

Signature
func (a *Agent) Dest(dest []byte) *Agent {
Example
agent.Dest(nil)
// ...

Bytes​

Bytes returns the status code, bytes body and errors of url.

Signature
func (a *Agent) Bytes() (code int, body []byte, errs []error)
Example
code, body, errs := agent.Bytes()
// ...

String​

String returns the status code, string body and errors of url.

Signature
func (a *Agent) String() (int, string, []error)
Example
code, body, errs := agent.String()
// ...

Struct​

Struct returns the status code, bytes body and errors of url. And bytes body will be unmarshalled to given v.

Signature
func (a *Agent) Struct(v interface{}) (code int, body []byte, errs []error)
Example
var d data
code, body, errs := agent.Struct(&d)
// ...

RetryIf​

RetryIf controls whether a retry should be attempted after an error. -By default, will use isIdempotent function from fasthttp

Signature
func (a *Agent) RetryIf(retryIf RetryIfFunc) *Agent
Example
agent.Get("https://example.com").RetryIf(func (req *fiber.Request) bool {
return req.URI() == "https://example.com"
})
// ...
- - +By default, will use isIdempotent function from fasthttp

Signature
func (a *Agent) RetryIf(retryIf RetryIfFunc) *Agent
Example
agent.Get("https://example.com").RetryIf(func (req *fiber.Request) bool {
return req.URI() == "https://example.com"
})
// ...
+ + \ No newline at end of file diff --git a/next/api/constants/index.html b/next/api/constants/index.html index 8b5dc31f938..f8068e047be 100644 --- a/next/api/constants/index.html +++ b/next/api/constants/index.html @@ -6,13 +6,13 @@ πŸ“‹ Constants | Fiber - - + +
-
Version: Next

πŸ“‹ Constants

HTTP methods were copied from net/http.

const (
MethodGet = "GET" // RFC 7231, 4.3.1
MethodHead = "HEAD" // RFC 7231, 4.3.2
MethodPost = "POST" // RFC 7231, 4.3.3
MethodPut = "PUT" // RFC 7231, 4.3.4
MethodPatch = "PATCH" // RFC 5789
MethodDelete = "DELETE" // RFC 7231, 4.3.5
MethodConnect = "CONNECT" // RFC 7231, 4.3.6
MethodOptions = "OPTIONS" // RFC 7231, 4.3.7
MethodTrace = "TRACE" // RFC 7231, 4.3.8
methodUse = "USE"
)

MIME types that are commonly used

const (
MIMETextXML = "text/xml"
MIMETextHTML = "text/html"
MIMETextPlain = "text/plain"
MIMEApplicationXML = "application/xml"
MIMEApplicationJSON = "application/json"
MIMEApplicationJavaScript = "application/javascript"
MIMEApplicationForm = "application/x-www-form-urlencoded"
MIMEOctetStream = "application/octet-stream"
MIMEMultipartForm = "multipart/form-data"

MIMETextXMLCharsetUTF8 = "text/xml; charset=utf-8"
MIMETextHTMLCharsetUTF8 = "text/html; charset=utf-8"
MIMETextPlainCharsetUTF8 = "text/plain; charset=utf-8"
MIMEApplicationXMLCharsetUTF8 = "application/xml; charset=utf-8"
MIMEApplicationJSONCharsetUTF8 = "application/json; charset=utf-8"
MIMEApplicationJavaScriptCharsetUTF8 = "application/javascript; charset=utf-8"
)

HTTP status codes were copied from net/http.

const (
StatusContinue = 100 // RFC 7231, 6.2.1
StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2
StatusProcessing = 102 // RFC 2518, 10.1
StatusEarlyHints = 103 // RFC 8297
StatusOK = 200 // RFC 7231, 6.3.1
StatusCreated = 201 // RFC 7231, 6.3.2
StatusAccepted = 202 // RFC 7231, 6.3.3
StatusNonAuthoritativeInformation = 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
StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7
StatusPermanentRedirect = 308 // RFC 7538, 3
StatusBadRequest = 400 // RFC 7231, 6.5.1
StatusUnauthorized = 401 // RFC 7235, 3.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
StatusMisdirectedRequest = 421 // RFC 7540, 9.1.2
StatusUnprocessableEntity = 422 // RFC 4918, 11.2
StatusLocked = 423 // RFC 4918, 11.3
StatusFailedDependency = 424 // RFC 4918, 11.4
StatusTooEarly = 425 // RFC 8470, 5.2.
StatusUpgradeRequired = 426 // RFC 7231, 6.5.15
StatusPreconditionRequired = 428 // RFC 6585, 3
StatusTooManyRequests = 429 // RFC 6585, 4
StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5
StatusUnavailableForLegalReasons = 451 // RFC 7725, 3
StatusInternalServerError = 500 // RFC 7231, 6.6.1
StatusNotImplemented = 501 // RFC 7231, 6.6.2
StatusBadGateway = 502 // RFC 7231, 6.6.3
StatusServiceUnavailable = 503 // RFC 7231, 6.6.4
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
)

Errors

var (
ErrBadRequest = NewError(StatusBadRequest) // RFC 7231, 6.5.1
ErrUnauthorized = NewError(StatusUnauthorized) // RFC 7235, 3.1
ErrPaymentRequired = NewError(StatusPaymentRequired) // RFC 7231, 6.5.2
ErrForbidden = NewError(StatusForbidden) // RFC 7231, 6.5.3
ErrNotFound = NewError(StatusNotFound) // RFC 7231, 6.5.4
ErrMethodNotAllowed = NewError(StatusMethodNotAllowed) // RFC 7231, 6.5.5
ErrNotAcceptable = NewError(StatusNotAcceptable) // RFC 7231, 6.5.6
ErrProxyAuthRequired = NewError(StatusProxyAuthRequired) // RFC 7235, 3.2
ErrRequestTimeout = NewError(StatusRequestTimeout) // RFC 7231, 6.5.7
ErrConflict = NewError(StatusConflict) // RFC 7231, 6.5.8
ErrGone = NewError(StatusGone) // RFC 7231, 6.5.9
ErrLengthRequired = NewError(StatusLengthRequired) // RFC 7231, 6.5.10
ErrPreconditionFailed = NewError(StatusPreconditionFailed) // RFC 7232, 4.2
ErrRequestEntityTooLarge = NewError(StatusRequestEntityTooLarge) // RFC 7231, 6.5.11
ErrRequestURITooLong = NewError(StatusRequestURITooLong) // RFC 7231, 6.5.12
ErrUnsupportedMediaType = NewError(StatusUnsupportedMediaType) // RFC 7231, 6.5.13
ErrRequestedRangeNotSatisfiable = NewError(StatusRequestedRangeNotSatisfiable) // RFC 7233, 4.4
ErrExpectationFailed = NewError(StatusExpectationFailed) // RFC 7231, 6.5.14
ErrTeapot = NewError(StatusTeapot) // RFC 7168, 2.3.3
ErrMisdirectedRequest = NewError(StatusMisdirectedRequest) // RFC 7540, 9.1.2
ErrUnprocessableEntity = NewError(StatusUnprocessableEntity) // RFC 4918, 11.2
ErrLocked = NewError(StatusLocked) // RFC 4918, 11.3
ErrFailedDependency = NewError(StatusFailedDependency) // RFC 4918, 11.4
ErrTooEarly = NewError(StatusTooEarly) // RFC 8470, 5.2.
ErrUpgradeRequired = NewError(StatusUpgradeRequired) // RFC 7231, 6.5.15
ErrPreconditionRequired = NewError(StatusPreconditionRequired) // RFC 6585, 3
ErrTooManyRequests = NewError(StatusTooManyRequests) // RFC 6585, 4
ErrRequestHeaderFieldsTooLarge = NewError(StatusRequestHeaderFieldsTooLarge) // RFC 6585, 5
ErrUnavailableForLegalReasons = NewError(StatusUnavailableForLegalReasons) // RFC 7725, 3
ErrInternalServerError = NewError(StatusInternalServerError) // RFC 7231, 6.6.1
ErrNotImplemented = NewError(StatusNotImplemented) // RFC 7231, 6.6.2
ErrBadGateway = NewError(StatusBadGateway) // RFC 7231, 6.6.3
ErrServiceUnavailable = NewError(StatusServiceUnavailable) // RFC 7231, 6.6.4
ErrGatewayTimeout = NewError(StatusGatewayTimeout) // RFC 7231, 6.6.5
ErrHTTPVersionNotSupported = NewError(StatusHTTPVersionNotSupported) // RFC 7231, 6.6.6
ErrVariantAlsoNegotiates = NewError(StatusVariantAlsoNegotiates) // RFC 2295, 8.1
ErrInsufficientStorage = NewError(StatusInsufficientStorage) // RFC 4918, 11.5
ErrLoopDetected = NewError(StatusLoopDetected) // RFC 5842, 7.2
ErrNotExtended = NewError(StatusNotExtended) // RFC 2774, 7
ErrNetworkAuthenticationRequired = NewError(StatusNetworkAuthenticationRequired) // RFC 6585, 6
)

HTTP Headers were copied from net/http.

const (
HeaderAuthorization = "Authorization"
HeaderProxyAuthenticate = "Proxy-Authenticate"
HeaderProxyAuthorization = "Proxy-Authorization"
HeaderWWWAuthenticate = "WWW-Authenticate"
HeaderAge = "Age"
HeaderCacheControl = "Cache-Control"
HeaderClearSiteData = "Clear-Site-Data"
HeaderExpires = "Expires"
HeaderPragma = "Pragma"
HeaderWarning = "Warning"
HeaderAcceptCH = "Accept-CH"
HeaderAcceptCHLifetime = "Accept-CH-Lifetime"
HeaderContentDPR = "Content-DPR"
HeaderDPR = "DPR"
HeaderEarlyData = "Early-Data"
HeaderSaveData = "Save-Data"
HeaderViewportWidth = "Viewport-Width"
HeaderWidth = "Width"
HeaderETag = "ETag"
HeaderIfMatch = "If-Match"
HeaderIfModifiedSince = "If-Modified-Since"
HeaderIfNoneMatch = "If-None-Match"
HeaderIfUnmodifiedSince = "If-Unmodified-Since"
HeaderLastModified = "Last-Modified"
HeaderVary = "Vary"
HeaderConnection = "Connection"
HeaderKeepAlive = "Keep-Alive"
HeaderAccept = "Accept"
HeaderAcceptCharset = "Accept-Charset"
HeaderAcceptEncoding = "Accept-Encoding"
HeaderAcceptLanguage = "Accept-Language"
HeaderCookie = "Cookie"
HeaderExpect = "Expect"
HeaderMaxForwards = "Max-Forwards"
HeaderSetCookie = "Set-Cookie"
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"
HeaderOrigin = "Origin"
HeaderTimingAllowOrigin = "Timing-Allow-Origin"
HeaderXPermittedCrossDomainPolicies = "X-Permitted-Cross-Domain-Policies"
HeaderDNT = "DNT"
HeaderTk = "Tk"
HeaderContentDisposition = "Content-Disposition"
HeaderContentEncoding = "Content-Encoding"
HeaderContentLanguage = "Content-Language"
HeaderContentLength = "Content-Length"
HeaderContentLocation = "Content-Location"
HeaderContentType = "Content-Type"
HeaderForwarded = "Forwarded"
HeaderVia = "Via"
HeaderXForwardedFor = "X-Forwarded-For"
HeaderXForwardedHost = "X-Forwarded-Host"
HeaderXForwardedProto = "X-Forwarded-Proto"
HeaderXForwardedProtocol = "X-Forwarded-Protocol"
HeaderXForwardedSsl = "X-Forwarded-Ssl"
HeaderXUrlScheme = "X-Url-Scheme"
HeaderLocation = "Location"
HeaderFrom = "From"
HeaderHost = "Host"
HeaderReferer = "Referer"
HeaderReferrerPolicy = "Referrer-Policy"
HeaderUserAgent = "User-Agent"
HeaderAllow = "Allow"
HeaderServer = "Server"
HeaderAcceptRanges = "Accept-Ranges"
HeaderContentRange = "Content-Range"
HeaderIfRange = "If-Range"
HeaderRange = "Range"
HeaderContentSecurityPolicy = "Content-Security-Policy"
HeaderContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"
HeaderCrossOriginResourcePolicy = "Cross-Origin-Resource-Policy"
HeaderExpectCT = "Expect-CT"
HeaderFeaturePolicy = "Feature-Policy"
HeaderPublicKeyPins = "Public-Key-Pins"
HeaderPublicKeyPinsReportOnly = "Public-Key-Pins-Report-Only"
HeaderStrictTransportSecurity = "Strict-Transport-Security"
HeaderUpgradeInsecureRequests = "Upgrade-Insecure-Requests"
HeaderXContentTypeOptions = "X-Content-Type-Options"
HeaderXDownloadOptions = "X-Download-Options"
HeaderXFrameOptions = "X-Frame-Options"
HeaderXPoweredBy = "X-Powered-By"
HeaderXXSSProtection = "X-XSS-Protection"
HeaderLastEventID = "Last-Event-ID"
HeaderNEL = "NEL"
HeaderPingFrom = "Ping-From"
HeaderPingTo = "Ping-To"
HeaderReportTo = "Report-To"
HeaderTE = "TE"
HeaderTrailer = "Trailer"
HeaderTransferEncoding = "Transfer-Encoding"
HeaderSecWebSocketAccept = "Sec-WebSocket-Accept"
HeaderSecWebSocketExtensions = "Sec-WebSocket-Extensions"
HeaderSecWebSocketKey = "Sec-WebSocket-Key"
HeaderSecWebSocketProtocol = "Sec-WebSocket-Protocol"
HeaderSecWebSocketVersion = "Sec-WebSocket-Version"
HeaderAcceptPatch = "Accept-Patch"
HeaderAcceptPushPolicy = "Accept-Push-Policy"
HeaderAcceptSignature = "Accept-Signature"
HeaderAltSvc = "Alt-Svc"
HeaderDate = "Date"
HeaderIndex = "Index"
HeaderLargeAllocation = "Large-Allocation"
HeaderLink = "Link"
HeaderPushPolicy = "Push-Policy"
HeaderRetryAfter = "Retry-After"
HeaderServerTiming = "Server-Timing"
HeaderSignature = "Signature"
HeaderSignedHeaders = "Signed-Headers"
HeaderSourceMap = "SourceMap"
HeaderUpgrade = "Upgrade"
HeaderXDNSPrefetchControl = "X-DNS-Prefetch-Control"
HeaderXPingback = "X-Pingback"
HeaderXRequestID = "X-Request-ID"
HeaderXRequestedWith = "X-Requested-With"
HeaderXRobotsTag = "X-Robots-Tag"
HeaderXUACompatible = "X-UA-Compatible"
)
- - +
Version: Next

πŸ“‹ Constants

HTTP methods were copied from net/http.

const (
MethodGet = "GET" // RFC 7231, 4.3.1
MethodHead = "HEAD" // RFC 7231, 4.3.2
MethodPost = "POST" // RFC 7231, 4.3.3
MethodPut = "PUT" // RFC 7231, 4.3.4
MethodPatch = "PATCH" // RFC 5789
MethodDelete = "DELETE" // RFC 7231, 4.3.5
MethodConnect = "CONNECT" // RFC 7231, 4.3.6
MethodOptions = "OPTIONS" // RFC 7231, 4.3.7
MethodTrace = "TRACE" // RFC 7231, 4.3.8
methodUse = "USE"
)

MIME types that are commonly used

const (
MIMETextXML = "text/xml"
MIMETextHTML = "text/html"
MIMETextPlain = "text/plain"
MIMEApplicationXML = "application/xml"
MIMEApplicationJSON = "application/json"
MIMEApplicationJavaScript = "application/javascript"
MIMEApplicationForm = "application/x-www-form-urlencoded"
MIMEOctetStream = "application/octet-stream"
MIMEMultipartForm = "multipart/form-data"

MIMETextXMLCharsetUTF8 = "text/xml; charset=utf-8"
MIMETextHTMLCharsetUTF8 = "text/html; charset=utf-8"
MIMETextPlainCharsetUTF8 = "text/plain; charset=utf-8"
MIMEApplicationXMLCharsetUTF8 = "application/xml; charset=utf-8"
MIMEApplicationJSONCharsetUTF8 = "application/json; charset=utf-8"
MIMEApplicationJavaScriptCharsetUTF8 = "application/javascript; charset=utf-8"
)

HTTP status codes were copied from net/http.

const (
StatusContinue = 100 // RFC 7231, 6.2.1
StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2
StatusProcessing = 102 // RFC 2518, 10.1
StatusEarlyHints = 103 // RFC 8297
StatusOK = 200 // RFC 7231, 6.3.1
StatusCreated = 201 // RFC 7231, 6.3.2
StatusAccepted = 202 // RFC 7231, 6.3.3
StatusNonAuthoritativeInformation = 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
StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7
StatusPermanentRedirect = 308 // RFC 7538, 3
StatusBadRequest = 400 // RFC 7231, 6.5.1
StatusUnauthorized = 401 // RFC 7235, 3.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
StatusMisdirectedRequest = 421 // RFC 7540, 9.1.2
StatusUnprocessableEntity = 422 // RFC 4918, 11.2
StatusLocked = 423 // RFC 4918, 11.3
StatusFailedDependency = 424 // RFC 4918, 11.4
StatusTooEarly = 425 // RFC 8470, 5.2.
StatusUpgradeRequired = 426 // RFC 7231, 6.5.15
StatusPreconditionRequired = 428 // RFC 6585, 3
StatusTooManyRequests = 429 // RFC 6585, 4
StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5
StatusUnavailableForLegalReasons = 451 // RFC 7725, 3
StatusInternalServerError = 500 // RFC 7231, 6.6.1
StatusNotImplemented = 501 // RFC 7231, 6.6.2
StatusBadGateway = 502 // RFC 7231, 6.6.3
StatusServiceUnavailable = 503 // RFC 7231, 6.6.4
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
)

Errors

var (
ErrBadRequest = NewError(StatusBadRequest) // RFC 7231, 6.5.1
ErrUnauthorized = NewError(StatusUnauthorized) // RFC 7235, 3.1
ErrPaymentRequired = NewError(StatusPaymentRequired) // RFC 7231, 6.5.2
ErrForbidden = NewError(StatusForbidden) // RFC 7231, 6.5.3
ErrNotFound = NewError(StatusNotFound) // RFC 7231, 6.5.4
ErrMethodNotAllowed = NewError(StatusMethodNotAllowed) // RFC 7231, 6.5.5
ErrNotAcceptable = NewError(StatusNotAcceptable) // RFC 7231, 6.5.6
ErrProxyAuthRequired = NewError(StatusProxyAuthRequired) // RFC 7235, 3.2
ErrRequestTimeout = NewError(StatusRequestTimeout) // RFC 7231, 6.5.7
ErrConflict = NewError(StatusConflict) // RFC 7231, 6.5.8
ErrGone = NewError(StatusGone) // RFC 7231, 6.5.9
ErrLengthRequired = NewError(StatusLengthRequired) // RFC 7231, 6.5.10
ErrPreconditionFailed = NewError(StatusPreconditionFailed) // RFC 7232, 4.2
ErrRequestEntityTooLarge = NewError(StatusRequestEntityTooLarge) // RFC 7231, 6.5.11
ErrRequestURITooLong = NewError(StatusRequestURITooLong) // RFC 7231, 6.5.12
ErrUnsupportedMediaType = NewError(StatusUnsupportedMediaType) // RFC 7231, 6.5.13
ErrRequestedRangeNotSatisfiable = NewError(StatusRequestedRangeNotSatisfiable) // RFC 7233, 4.4
ErrExpectationFailed = NewError(StatusExpectationFailed) // RFC 7231, 6.5.14
ErrTeapot = NewError(StatusTeapot) // RFC 7168, 2.3.3
ErrMisdirectedRequest = NewError(StatusMisdirectedRequest) // RFC 7540, 9.1.2
ErrUnprocessableEntity = NewError(StatusUnprocessableEntity) // RFC 4918, 11.2
ErrLocked = NewError(StatusLocked) // RFC 4918, 11.3
ErrFailedDependency = NewError(StatusFailedDependency) // RFC 4918, 11.4
ErrTooEarly = NewError(StatusTooEarly) // RFC 8470, 5.2.
ErrUpgradeRequired = NewError(StatusUpgradeRequired) // RFC 7231, 6.5.15
ErrPreconditionRequired = NewError(StatusPreconditionRequired) // RFC 6585, 3
ErrTooManyRequests = NewError(StatusTooManyRequests) // RFC 6585, 4
ErrRequestHeaderFieldsTooLarge = NewError(StatusRequestHeaderFieldsTooLarge) // RFC 6585, 5
ErrUnavailableForLegalReasons = NewError(StatusUnavailableForLegalReasons) // RFC 7725, 3
ErrInternalServerError = NewError(StatusInternalServerError) // RFC 7231, 6.6.1
ErrNotImplemented = NewError(StatusNotImplemented) // RFC 7231, 6.6.2
ErrBadGateway = NewError(StatusBadGateway) // RFC 7231, 6.6.3
ErrServiceUnavailable = NewError(StatusServiceUnavailable) // RFC 7231, 6.6.4
ErrGatewayTimeout = NewError(StatusGatewayTimeout) // RFC 7231, 6.6.5
ErrHTTPVersionNotSupported = NewError(StatusHTTPVersionNotSupported) // RFC 7231, 6.6.6
ErrVariantAlsoNegotiates = NewError(StatusVariantAlsoNegotiates) // RFC 2295, 8.1
ErrInsufficientStorage = NewError(StatusInsufficientStorage) // RFC 4918, 11.5
ErrLoopDetected = NewError(StatusLoopDetected) // RFC 5842, 7.2
ErrNotExtended = NewError(StatusNotExtended) // RFC 2774, 7
ErrNetworkAuthenticationRequired = NewError(StatusNetworkAuthenticationRequired) // RFC 6585, 6
)

HTTP Headers were copied from net/http.

const (
HeaderAuthorization = "Authorization"
HeaderProxyAuthenticate = "Proxy-Authenticate"
HeaderProxyAuthorization = "Proxy-Authorization"
HeaderWWWAuthenticate = "WWW-Authenticate"
HeaderAge = "Age"
HeaderCacheControl = "Cache-Control"
HeaderClearSiteData = "Clear-Site-Data"
HeaderExpires = "Expires"
HeaderPragma = "Pragma"
HeaderWarning = "Warning"
HeaderAcceptCH = "Accept-CH"
HeaderAcceptCHLifetime = "Accept-CH-Lifetime"
HeaderContentDPR = "Content-DPR"
HeaderDPR = "DPR"
HeaderEarlyData = "Early-Data"
HeaderSaveData = "Save-Data"
HeaderViewportWidth = "Viewport-Width"
HeaderWidth = "Width"
HeaderETag = "ETag"
HeaderIfMatch = "If-Match"
HeaderIfModifiedSince = "If-Modified-Since"
HeaderIfNoneMatch = "If-None-Match"
HeaderIfUnmodifiedSince = "If-Unmodified-Since"
HeaderLastModified = "Last-Modified"
HeaderVary = "Vary"
HeaderConnection = "Connection"
HeaderKeepAlive = "Keep-Alive"
HeaderAccept = "Accept"
HeaderAcceptCharset = "Accept-Charset"
HeaderAcceptEncoding = "Accept-Encoding"
HeaderAcceptLanguage = "Accept-Language"
HeaderCookie = "Cookie"
HeaderExpect = "Expect"
HeaderMaxForwards = "Max-Forwards"
HeaderSetCookie = "Set-Cookie"
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"
HeaderOrigin = "Origin"
HeaderTimingAllowOrigin = "Timing-Allow-Origin"
HeaderXPermittedCrossDomainPolicies = "X-Permitted-Cross-Domain-Policies"
HeaderDNT = "DNT"
HeaderTk = "Tk"
HeaderContentDisposition = "Content-Disposition"
HeaderContentEncoding = "Content-Encoding"
HeaderContentLanguage = "Content-Language"
HeaderContentLength = "Content-Length"
HeaderContentLocation = "Content-Location"
HeaderContentType = "Content-Type"
HeaderForwarded = "Forwarded"
HeaderVia = "Via"
HeaderXForwardedFor = "X-Forwarded-For"
HeaderXForwardedHost = "X-Forwarded-Host"
HeaderXForwardedProto = "X-Forwarded-Proto"
HeaderXForwardedProtocol = "X-Forwarded-Protocol"
HeaderXForwardedSsl = "X-Forwarded-Ssl"
HeaderXUrlScheme = "X-Url-Scheme"
HeaderLocation = "Location"
HeaderFrom = "From"
HeaderHost = "Host"
HeaderReferer = "Referer"
HeaderReferrerPolicy = "Referrer-Policy"
HeaderUserAgent = "User-Agent"
HeaderAllow = "Allow"
HeaderServer = "Server"
HeaderAcceptRanges = "Accept-Ranges"
HeaderContentRange = "Content-Range"
HeaderIfRange = "If-Range"
HeaderRange = "Range"
HeaderContentSecurityPolicy = "Content-Security-Policy"
HeaderContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"
HeaderCrossOriginResourcePolicy = "Cross-Origin-Resource-Policy"
HeaderExpectCT = "Expect-CT"
HeaderFeaturePolicy = "Feature-Policy"
HeaderPublicKeyPins = "Public-Key-Pins"
HeaderPublicKeyPinsReportOnly = "Public-Key-Pins-Report-Only"
HeaderStrictTransportSecurity = "Strict-Transport-Security"
HeaderUpgradeInsecureRequests = "Upgrade-Insecure-Requests"
HeaderXContentTypeOptions = "X-Content-Type-Options"
HeaderXDownloadOptions = "X-Download-Options"
HeaderXFrameOptions = "X-Frame-Options"
HeaderXPoweredBy = "X-Powered-By"
HeaderXXSSProtection = "X-XSS-Protection"
HeaderLastEventID = "Last-Event-ID"
HeaderNEL = "NEL"
HeaderPingFrom = "Ping-From"
HeaderPingTo = "Ping-To"
HeaderReportTo = "Report-To"
HeaderTE = "TE"
HeaderTrailer = "Trailer"
HeaderTransferEncoding = "Transfer-Encoding"
HeaderSecWebSocketAccept = "Sec-WebSocket-Accept"
HeaderSecWebSocketExtensions = "Sec-WebSocket-Extensions"
HeaderSecWebSocketKey = "Sec-WebSocket-Key"
HeaderSecWebSocketProtocol = "Sec-WebSocket-Protocol"
HeaderSecWebSocketVersion = "Sec-WebSocket-Version"
HeaderAcceptPatch = "Accept-Patch"
HeaderAcceptPushPolicy = "Accept-Push-Policy"
HeaderAcceptSignature = "Accept-Signature"
HeaderAltSvc = "Alt-Svc"
HeaderDate = "Date"
HeaderIndex = "Index"
HeaderLargeAllocation = "Large-Allocation"
HeaderLink = "Link"
HeaderPushPolicy = "Push-Policy"
HeaderRetryAfter = "Retry-After"
HeaderServerTiming = "Server-Timing"
HeaderSignature = "Signature"
HeaderSignedHeaders = "Signed-Headers"
HeaderSourceMap = "SourceMap"
HeaderUpgrade = "Upgrade"
HeaderXDNSPrefetchControl = "X-DNS-Prefetch-Control"
HeaderXPingback = "X-Pingback"
HeaderXRequestID = "X-Request-ID"
HeaderXRequestedWith = "X-Requested-With"
HeaderXRobotsTag = "X-Robots-Tag"
HeaderXUACompatible = "X-UA-Compatible"
)
+ + \ No newline at end of file diff --git a/next/api/ctx/index.html b/next/api/ctx/index.html index 3c9f8a4c9c9..a9caa80f4a8 100644 --- a/next/api/ctx/index.html +++ b/next/api/ctx/index.html @@ -6,8 +6,8 @@ 🧠 Ctx | Fiber - - + +
@@ -24,8 +24,8 @@ If the parameter is not a number, it is still tried to be converted and usually returned as 1.

info

Defaults to the integer zero (0), if the param doesn't exist.

Signature
func (c *Ctx) QueryInt(key string, defaultValue ...int) int
Example
// GET http://example.com/?name=alex&wanna_cake=2&id=

app.Get("/", func(c *fiber.Ctx) error {
c.QueryInt("wanna_cake", 1) // 2
c.QueryInt("name", 1) // 1
c.QueryInt("id", 1) // 1
c.QueryInt("id") // 0

// ...
})

QueryParser​

This method is similar to BodyParser, but for query parameters. It is important to use the struct tag "query". For example, if you want to parse a query parameter with a field called Pass, you would use a struct field of query:"pass".

Signature
func (c *Ctx) QueryParser(out interface{}) error
Example
// Field names should start with an uppercase letter
type Person struct {
Name string `query:"name"`
Pass string `query:"pass"`
Products []string `query:"products"`
}

app.Get("/", func(c *fiber.Ctx) error {
p := new(Person)

if err := c.QueryParser(p); err != nil {
return err
}

log.Println(p.Name) // john
log.Println(p.Pass) // doe
log.Println(p.Products) // [shoe, hat]

// ...
})
// Run tests with the following curl command

// curl "http://localhost:3000/?name=john&pass=doe&products=shoe,hat"

Range​

A struct containing the type and a slice of ranges will be returned.

Signature
func (c *Ctx) Range(size int) (Range, error)
Example
// Range: bytes=500-700, 700-900
app.Get("/", func(c *fiber.Ctx) error {
b := c.Range(1000)
if b.Type == "bytes" {
for r := range r.Ranges {
fmt.Println(r)
// [500, 700]
}
}
})

Redirect​

Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code.

info

If not specified, status defaults to 302 Found.

Signature
func (c *Ctx) Redirect(location string, status ...int) error
Example
app.Get("/coffee", func(c *fiber.Ctx) error {
return c.Redirect("/teapot")
})

app.Get("/teapot", func(c *fiber.Ctx) error {
return c.Status(fiber.StatusTeapot).Send("🍡 short and stout 🍡")
})
More examples
app.Get("/", func(c *fiber.Ctx) error {
return c.Redirect("/foo/bar")
return c.Redirect("../login")
return c.Redirect("http://example.com")
return c.Redirect("http://example.com", 301)
})

RedirectToRoute​

Redirects to the specific route along with the parameters and with specified status, a positive integer that corresponds to an HTTP status code.

info

If not specified, status defaults to 302 Found.

info

If you want to send queries to route, you must add "queries" key typed as map[string]string to params.

Signature
func (c *Ctx) RedirectToRoute(routeName string, params fiber.Map, status ...int) error
Example
app.Get("/", func(c *fiber.Ctx) error {
// /user/fiber
return c.RedirectToRoute("user", fiber.Map{
"name": "fiber"
})
})

app.Get("/with-queries", func(c *fiber.Ctx) error {
// /user/fiber?data[0][name]=john&data[0][age]=10&test=doe
return c.RedirectToRoute("user", fiber.Map{
"name": "fiber",
"queries": map[string]string{"data[0][name]": "john", "data[0][age]": "10", "test": "doe"},
})
})

app.Get("/user/:name", func(c *fiber.Ctx) error {
return c.SendString(c.Params("name"))
}).Name("user")

RedirectBack​

Redirects back to refer URL. It redirects to fallback URL if refer header doesn't exists, with specified status, a positive integer that corresponds to an HTTP status code.

info

If not specified, status defaults to 302 Found.

Signature
func (c *Ctx) RedirectBack(fallback string, status ...int) error
Example
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Home page")
})
app.Get("/test", func(c *fiber.Ctx) error {
c.Set("Content-Type", "text/html")
return c.SendString(`<a href="/back">Back</a>`)
})

app.Get("/back", func(c *fiber.Ctx) error {
return c.RedirectBack("/")
})

Render​

Renders a view with data and sends a text/html response. By default Render uses the default Go Template engine. If you want to use another View engine, please take a look at our Template middleware.

Signature
func (c *Ctx) Render(name string, bind interface{}, layouts ...string) error

Request​

Request return the *fasthttp.Request pointer

Signature
func (c *Ctx) Request() *fasthttp.Request
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Request().Header.Method()
// => []byte("GET")
})

ReqHeaderParser​

This method is similar to BodyParser, but for request headers. It is important to use the struct tag "reqHeader". For example, if you want to parse a request header with a field called Pass, you would use a struct field of reqHeader:"pass".

Signature
func (c *Ctx) ReqHeaderParser(out interface{}) error
Example
// Field names should start with an uppercase letter
type Person struct {
Name string `reqHeader:"name"`
Pass string `reqHeader:"pass"`
Products []string `reqHeader:"products"`
}

app.Get("/", func(c *fiber.Ctx) error {
p := new(Person)

if err := c.ReqHeaderParser(p); err != nil {
return err
}

log.Println(p.Name) // john
log.Println(p.Pass) // doe
log.Println(p.Products) // [shoe, hat]

// ...
})
// Run tests with the following curl command

// curl "http://localhost:3000/" -H "name: john" -H "pass: doe" -H "products: shoe,hat"

Response​

Response return the *fasthttp.Response pointer

Signature
func (c *Ctx) Response() *fasthttp.Response
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Response().BodyWriter().Write([]byte("Hello, World!"))
// => "Hello, World!"
return nil
})

RestartRouting​

Instead of executing the next method when calling Next, RestartRouting restarts execution from the first method that matches the current route. This may be helpful after overriding the path, i. e. an internal redirect. Note that handlers might be executed again which could result in an infinite loop.

Signature
func (c *Ctx) RestartRouting() error
Example
app.Get("/new", func(c *fiber.Ctx) error {
return c.SendString("From /new")
})

app.Get("/old", func(c *fiber.Ctx) error {
c.Path("/new")
return c.RestartRouting()
})

Route​

Returns the matched Route struct.

Signature
func (c *Ctx) Route() *Route
Example
// http://localhost:8080/hello


app.Get("/hello/:name", func(c *fiber.Ctx) error {
r := c.Route()
fmt.Println(r.Method, r.Path, r.Params, r.Handlers)
// GET /hello/:name handler [name]

// ...
})
caution

Do not rely on c.Route() in middlewares before calling c.Next() - c.Route() returns the last executed route.

Example
func MyMiddleware() fiber.Handler {
return func(c *fiber.Ctx) error {
beforeNext := c.Route().Path // Will be '/'
err := c.Next()
afterNext := c.Route().Path // Will be '/hello/:name'
return err
}
}

SaveFile​

Method is used to save any multipart file to disk.

Signature
func (c *Ctx) SaveFile(fh *multipart.FileHeader, path string) error
Example
app.Post("/", func(c *fiber.Ctx) error {
// Parse the multipart form:
if form, err := c.MultipartForm(); err == nil {
// => *multipart.Form

// Get all files from "documents" key:
files := form.File["documents"]
// => []*multipart.FileHeader

// Loop through files:
for _, file := range files {
fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])
// => "tutorial.pdf" 360641 "application/pdf"

// Save the files to disk:
if err := c.SaveFile(file, fmt.Sprintf("./%s", file.Filename)); err != nil {
return err
}
}
return err
}
})

SaveFileToStorage​

Method is used to save any multipart file to an external storage system.

Signature
func (c *Ctx) SaveFileToStorage(fileheader *multipart.FileHeader, path string, storage Storage) error
Example
storage := memory.New()

app.Post("/", func(c *fiber.Ctx) error {
// Parse the multipart form:
if form, err := c.MultipartForm(); err == nil {
// => *multipart.Form

// Get all files from "documents" key:
files := form.File["documents"]
// => []*multipart.FileHeader

// Loop through files:
for _, file := range files {
fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])
// => "tutorial.pdf" 360641 "application/pdf"

// Save the files to storage:
if err := c.SaveFileToStorage(file, fmt.Sprintf("./%s", file.Filename), storage); err != nil {
return err
}
}
return err
}
})

Secure​

A boolean property that is true , if a TLS connection is established.

Signature
func (c *Ctx) Secure() bool
Example
// Secure() method is equivalent to:
c.Protocol() == "https"

Send​

Sets the HTTP response body.

Signature
func (c *Ctx) Send(body []byte) error
Example
app.Get("/", func(c *fiber.Ctx) error {
return c.Send([]byte("Hello, World!")) // => "Hello, World!"
})

Fiber also provides SendString and SendStream methods for raw inputs.

tip

Use this if you don't need type assertion, recommended for faster performance.

Signature
func (c *Ctx) SendString(body string) error
func (c *Ctx) SendStream(stream io.Reader, size ...int) error
Example
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
// => "Hello, World!"

return c.SendStream(bytes.NewReader([]byte("Hello, World!")))
// => "Hello, World!"
})

SendFile​

Transfers the file from the given path. Sets the Content-Type response HTTP header field based on the filenames extension.

caution

Method doesnΒ΄t use gzipping by default, set it to true to enable.

Signature
func (c *Ctx) SendFile(file string, compress ...bool) error
Example
app.Get("/not-found", func(c *fiber.Ctx) error {
return c.SendFile("./public/404.html");

// Disable compression
return c.SendFile("./static/index.html", false);
})
info

If the file contains an url specific character you have to escape it before passing the file path into the sendFile function.

Example
app.Get("/file-with-url-chars", func(c *fiber.Ctx) error {
return c.SendFile(url.PathEscape("hash_sign_#.txt"))
})

SendStatus​

Sets the status code and the correct status message in the body, if the response body is empty.

tip

You can find all used status codes and messages here.

Signature
func (c *Ctx) SendStatus(status int) error
Example
app.Get("/not-found", func(c *fiber.Ctx) error {
return c.SendStatus(415)
// => 415 "Unsupported Media Type"

c.SendString("Hello, World!")
return c.SendStatus(415)
// => 415 "Hello, World!"
})

Set​

Sets the response’s HTTP header field to the specified key, value.

Signature
func (c *Ctx) Set(key string, val string)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Set("Content-Type", "text/plain")
// => "Content-type: text/plain"

// ...
})

SetParserDecoder​

Allow you to config BodyParser/QueryParser decoder, base on schema's options, providing possibility to add custom type for parsing.

Signature
func SetParserDecoder(parserConfig fiber.ParserConfig{
IgnoreUnknownKeys bool,
ParserType []fiber.ParserType{
Customtype interface{},
Converter func(string) reflect.Value,
},
ZeroEmpty bool,
SetAliasTag string,
})
Example

type CustomTime time.Time

// String() returns the time in string
func (ct *CustomTime) String() string {
t := time.Time(*ct).String()
return t
}

// Register the converter for CustomTime type format as 2006-01-02
var timeConverter = func(value string) reflect.Value {
fmt.Println("timeConverter", value)
if v, err := time.Parse("2006-01-02", value); err == nil {
return reflect.ValueOf(v)
}
return reflect.Value{}
}

customTime := fiber.ParserType{
Customtype: CustomTime{},
Converter: timeConverter,
}

// Add setting to the Decoder
fiber.SetParserDecoder(fiber.ParserConfig{
IgnoreUnknownKeys: true,
ParserType: []fiber.ParserType{customTime},
ZeroEmpty: true,
})

// Example to use CustomType, you pause custom time format not in RFC3339
type Demo struct {
Date CustomTime `form:"date" query:"date"`
Title string `form:"title" query:"title"`
Body string `form:"body" query:"body"`
}

app.Post("/body", func(c *fiber.Ctx) error {
var d Demo
c.BodyParser(&d)
fmt.Println("d.Date", d.Date.String())
return c.JSON(d)
})

app.Get("/query", func(c *fiber.Ctx) error {
var d Demo
c.QueryParser(&d)
fmt.Println("d.Date", d.Date.String())
return c.JSON(d)
})

// curl -X POST -F title=title -F body=body -F date=2021-10-20 http://localhost:3000/body

// curl -X GET "http://localhost:3000/query?title=title&body=body&date=2021-10-20"

SetUserContext​

Sets the user specified implementation for context interface.

Signature
func (c *Ctx) SetUserContext(ctx context.Context)
Example
app.Get("/", func(c *fiber.Ctx) error {
ctx := context.Background()
c.SetUserContext(ctx)
// Here ctx could be any context implementation

// ...
})

Stale​

https://expressjs.com/en/4x/api.html#req.stale

Signature
func (c *Ctx) Stale() bool

Status​

Sets the HTTP status for the response.

info

Method is a chainable.

Signature
func (c *Ctx) Status(status int) *Ctx
Example
app.Get("/fiber", func(c *fiber.Ctx) error {
c.Status(fiber.StatusOK)
return nil
}

app.Get("/hello", func(c *fiber.Ctx) error {
return c.Status(fiber.StatusBadRequest).SendString("Bad Request")
}

app.Get("/world", func(c *fiber.Ctx) error {
return c.Status(fiber.StatusNotFound).SendFile("./public/gopher.png")
})

Subdomains​

Returns a string slice of subdomains in the domain name of the request.

The application property subdomain offset, which defaults to 2, is used for determining the beginning of the subdomain segments.

Signature
func (c *Ctx) Subdomains(offset ...int) []string
Example
// Host: "tobi.ferrets.example.com"

app.Get("/", func(c *fiber.Ctx) error {
c.Subdomains() // ["ferrets", "tobi"]
c.Subdomains(1) // ["tobi"]

// ...
})

Type​

Sets the Content-Type HTTP header to the MIME type listed here specified by the file extension.

Signature
func (c *Ctx) Type(ext string, charset ...string) *Ctx
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Type(".html") // => "text/html"
c.Type("html") // => "text/html"
c.Type("png") // => "image/png"

c.Type("json", "utf-8") // => "application/json; charset=utf-8"

// ...
})

UserContext​

UserContext returns a context implementation that was set by user earlier -or returns a non-nil, empty context, if it was not set earlier.

Signature
func (c *Ctx) UserContext() context.Context
Example
app.Get("/", func(c *fiber.Ctx) error {
ctx := c.UserContext()
// ctx is context implementation set by user

// ...
})

Vary​

Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location.

info

Multiple fields are allowed.

Signature
func (c *Ctx) Vary(fields ...string)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Vary("Origin") // => Vary: Origin
c.Vary("User-Agent") // => Vary: Origin, User-Agent

// No duplicates
c.Vary("Origin") // => Vary: Origin, User-Agent

c.Vary("Accept-Encoding", "Accept")
// => Vary: Origin, User-Agent, Accept-Encoding, Accept

// ...
})

Write​

Write adopts the Writer interface

Signature
func (c *Ctx) Write(p []byte) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Write([]byte("Hello, World!")) // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

Writef​

Writef adopts the string with variables

Signature
func (c *Ctx) Writef(f string, a ...interface{}) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
world := "World!"
c.Writef("Hello, %s", world) // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

WriteString​

WriteString adopts the string

Signature
func (c *Ctx) WriteString(s string) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.WriteString("Hello, World!") // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

XHR​

A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery).

Signature
func (c *Ctx) XHR() bool
Example
// X-Requested-With: XMLHttpRequest

app.Get("/", func(c *fiber.Ctx) error {
c.XHR() // true

// ...
})

XML​

Converts any interface or string to XML using the standard encoding/xml package.

info

XML also sets the content header to application/xml.

Signature
func (c *Ctx) XML(data interface{}) error 
Example
type SomeStruct struct {
XMLName xml.Name `xml:"Fiber"`
Name string `xml:"Name"`
Age uint8 `xml:"Age"`
}

app.Get("/", func(c *fiber.Ctx) error {
// Create data struct:
data := SomeStruct{
Name: "Grame",
Age: 20,
}

return c.XML(data)
// <Fiber>
// <Name>Grame</Name>
// <Age>20</Age>
// </Fiber>
})
- - +or returns a non-nil, empty context, if it was not set earlier.

Signature
func (c *Ctx) UserContext() context.Context
Example
app.Get("/", func(c *fiber.Ctx) error {
ctx := c.UserContext()
// ctx is context implementation set by user

// ...
})

Vary​

Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location.

info

Multiple fields are allowed.

Signature
func (c *Ctx) Vary(fields ...string)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Vary("Origin") // => Vary: Origin
c.Vary("User-Agent") // => Vary: Origin, User-Agent

// No duplicates
c.Vary("Origin") // => Vary: Origin, User-Agent

c.Vary("Accept-Encoding", "Accept")
// => Vary: Origin, User-Agent, Accept-Encoding, Accept

// ...
})

Write​

Write adopts the Writer interface

Signature
func (c *Ctx) Write(p []byte) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.Write([]byte("Hello, World!")) // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

Writef​

Writef adopts the string with variables

Signature
func (c *Ctx) Writef(f string, a ...interface{}) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
world := "World!"
c.Writef("Hello, %s", world) // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

WriteString​

WriteString adopts the string

Signature
func (c *Ctx) WriteString(s string) (n int, err error)
Example
app.Get("/", func(c *fiber.Ctx) error {
c.WriteString("Hello, World!") // => "Hello, World!"

fmt.Fprintf(c, "%s\n", "Hello, World!") // "Hello, World!Hello, World!"
})

XHR​

A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery).

Signature
func (c *Ctx) XHR() bool
Example
// X-Requested-With: XMLHttpRequest

app.Get("/", func(c *fiber.Ctx) error {
c.XHR() // true

// ...
})

XML​

Converts any interface or string to XML using the standard encoding/xml package.

info

XML also sets the content header to application/xml.

Signature
func (c *Ctx) XML(data interface{}) error 
Example
type SomeStruct struct {
XMLName xml.Name `xml:"Fiber"`
Name string `xml:"Name"`
Age uint8 `xml:"Age"`
}

app.Get("/", func(c *fiber.Ctx) error {
// Create data struct:
data := SomeStruct{
Name: "Grame",
Age: 20,
}

return c.XML(data)
// <Fiber>
// <Name>Grame</Name>
// <Age>20</Age>
// </Fiber>
})
+ + \ No newline at end of file diff --git a/next/api/fiber/index.html b/next/api/fiber/index.html index 687cd2633a6..250cdbdc2a2 100644 --- a/next/api/fiber/index.html +++ b/next/api/fiber/index.html @@ -6,13 +6,13 @@ πŸ“¦ Fiber | Fiber - - + +
-
Version: Next

πŸ“¦ Fiber

New​

This method creates a new App named instance. You can pass optional config when creating a new instance.

Signature
func New(config ...Config) *App
Example
// Default config
app := fiber.New()

// ...

Config​

You can pass an optional Config when creating a new Fiber instance.

Example
// Custom config
app := fiber.New(fiber.Config{
Prefork: true,
CaseSensitive: true,
StrictRouting: true,
ServerHeader: "Fiber",
AppName: "Test App v1.0.1",
})

// ...

Config fields

PropertyTypeDescriptionDefault
AppNamestringThis allows to setup app name for the app""
BodyLimitintSets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response.4 * 1024 * 1024
CaseSensitiveboolWhen enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same.false
ColorSchemeColorsYou can define custom color scheme. They'll be used for startup message, route list and some middlewares.DefaultColors
CompressedFileSuffixstringAdds a suffix to the original file name and tries saving the resulting compressed file under the new file name.".fiber.gz"
ConcurrencyintMaximum number of concurrent connections.256 * 1024
DisableDefaultContentTypeboolWhen set to true, causes the default Content-Type header to be excluded from the Response.false
DisableDefaultDateboolWhen set to true causes the default date header to be excluded from the response.false
DisableHeaderNormalizingboolBy default all header names are normalized: conteNT-tYPE -> Content-Typefalse
DisableKeepaliveboolDisable keep-alive connections, the server will close incoming connections after sending the first response to the clientfalse
DisablePreParseMultipartFormboolWill not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data.false
DisableStartupMessageboolWhen set to true, it will not print out debug informationfalse
ETagboolEnable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled.false
EnableIPValidationboolIf set to true, c.IP() and c.IPs() will validate IP addresses before returning them. Also, c.IP() will return only the first valid IP rather than just the raw header value that may be a comma seperated string.

WARNING: There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header.
false
EnablePrintRoutesboolEnablePrintRoutes enables print all routes with their method, path, name and handler..false
EnableTrustedProxyCheckboolWhen set to true, fiber will check whether proxy is trusted, using TrustedProxies list.

By default c.Protocol() will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, c.IP() will get value from ProxyHeader header, c.Hostname() will get value from X-Forwarded-Host header.
If EnableTrustedProxyCheck is true, and RemoteIP is in the list of TrustedProxies c.Protocol(), c.IP(), and c.Hostname() will have the same behaviour when EnableTrustedProxyCheck disabled, if RemoteIP isn't in the list, c.Protocol() will return https in case when tls connection is handled by the app, or http otherwise, c.IP() will return RemoteIP() from fasthttp context, c.Hostname() will return fasthttp.Request.URI().Host()
false
ErrorHandlerErrorHandlerErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests.DefaultErrorHandler
GETOnlyboolRejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set.false
IdleTimeouttime.DurationThe maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used.nil
ImmutableboolWhen enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue #185.false
JSONDecoderutils.JSONUnmarshalAllowing for flexibility in using another json library for decoding.json.Unmarshal
JSONEncoderutils.JSONMarshalAllowing for flexibility in using another json library for encoding.json.Marshal
NetworkstringKnown networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only)

WARNING: When prefork is set to true, only "tcp4" and "tcp6" can be chosen.
NetworkTCP4
PassLocalsToViewsboolPassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our Template Middleware for supported engines.false
PreforkboolEnables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding. NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with CMD ./app or CMD ["sh", "-c", "/app"]. For more info, see this issue comment.false
ProxyHeaderstringThis will enable c.IP() to return the value of the given header key. By default c.IP()will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. X-Forwarded-*.""
ReadBufferSizeintper-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies).4096
ReadTimeouttime.DurationThe amount of time allowed to read the full request, including the body. The default timeout is unlimited.nil
RequestMethods[]stringRequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish.DefaultMethods
ServerHeaderstringEnables the Server HTTP header with the given value.""
StreamRequestBodyboolStreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit.false
StrictRoutingboolWhen enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same.false
TrustedProxies[]stringContains the list of trusted proxy IP's. Look at EnableTrustedProxyCheck doc.

It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses.
[]string*__*
UnescapePathboolConverts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special charactersfalse
ViewsViewsViews is the interface that wraps the Render function. See our Template Middleware for supported engines.nil
ViewsLayoutstringViews Layout is the global layout for all template render until override on Render function. See our Template Middleware for supported engines.""
WriteBufferSizeintPer-connection buffer size for responses' writing.4096
WriteTimeouttime.DurationThe maximum duration before timing out writes of the response. The default timeout is unlimited.nil
XMLEncoderutils.XMLMarshalAllowing for flexibility in using another XML library for encoding.xml.Marshal

NewError​

NewError creates a new HTTPError instance with an optional message.

Signature
func NewError(code int, message ...string) *Error
Example
app.Get("/", func(c *fiber.Ctx) error {
return fiber.NewError(782, "Custom error message")
})

IsChild​

IsChild determines if the current process is a result of Prefork.

Signature
func IsChild() bool
Example
// Prefork will spawn child processes
app := fiber.New(fiber.Config{
Prefork: true,
})

if !fiber.IsChild() {
fmt.Println("I'm the parent process")
} else {
fmt.Println("I'm a child process")
}

// ...
- - +
Version: Next

πŸ“¦ Fiber

New​

This method creates a new App named instance. You can pass optional config when creating a new instance.

Signature
func New(config ...Config) *App
Example
// Default config
app := fiber.New()

// ...

Config​

You can pass an optional Config when creating a new Fiber instance.

Example
// Custom config
app := fiber.New(fiber.Config{
Prefork: true,
CaseSensitive: true,
StrictRouting: true,
ServerHeader: "Fiber",
AppName: "Test App v1.0.1",
})

// ...

Config fields

PropertyTypeDescriptionDefault
AppNamestringThis allows to setup app name for the app""
BodyLimitintSets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response.4 * 1024 * 1024
CaseSensitiveboolWhen enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same.false
ColorSchemeColorsYou can define custom color scheme. They'll be used for startup message, route list and some middlewares.DefaultColors
CompressedFileSuffixstringAdds a suffix to the original file name and tries saving the resulting compressed file under the new file name.".fiber.gz"
ConcurrencyintMaximum number of concurrent connections.256 * 1024
DisableDefaultContentTypeboolWhen set to true, causes the default Content-Type header to be excluded from the Response.false
DisableDefaultDateboolWhen set to true causes the default date header to be excluded from the response.false
DisableHeaderNormalizingboolBy default all header names are normalized: conteNT-tYPE -> Content-Typefalse
DisableKeepaliveboolDisable keep-alive connections, the server will close incoming connections after sending the first response to the clientfalse
DisablePreParseMultipartFormboolWill not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data.false
DisableStartupMessageboolWhen set to true, it will not print out debug informationfalse
ETagboolEnable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled.false
EnableIPValidationboolIf set to true, c.IP() and c.IPs() will validate IP addresses before returning them. Also, c.IP() will return only the first valid IP rather than just the raw header value that may be a comma seperated string.

WARNING: There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header.
false
EnablePrintRoutesboolEnablePrintRoutes enables print all routes with their method, path, name and handler..false
EnableTrustedProxyCheckboolWhen set to true, fiber will check whether proxy is trusted, using TrustedProxies list.

By default c.Protocol() will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, c.IP() will get value from ProxyHeader header, c.Hostname() will get value from X-Forwarded-Host header.
If EnableTrustedProxyCheck is true, and RemoteIP is in the list of TrustedProxies c.Protocol(), c.IP(), and c.Hostname() will have the same behaviour when EnableTrustedProxyCheck disabled, if RemoteIP isn't in the list, c.Protocol() will return https in case when tls connection is handled by the app, or http otherwise, c.IP() will return RemoteIP() from fasthttp context, c.Hostname() will return fasthttp.Request.URI().Host()
false
ErrorHandlerErrorHandlerErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests.DefaultErrorHandler
GETOnlyboolRejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set.false
IdleTimeouttime.DurationThe maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used.nil
ImmutableboolWhen enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue #185.false
JSONDecoderutils.JSONUnmarshalAllowing for flexibility in using another json library for decoding.json.Unmarshal
JSONEncoderutils.JSONMarshalAllowing for flexibility in using another json library for encoding.json.Marshal
NetworkstringKnown networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only)

WARNING: When prefork is set to true, only "tcp4" and "tcp6" can be chosen.
NetworkTCP4
PassLocalsToViewsboolPassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our Template Middleware for supported engines.false
PreforkboolEnables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding. NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with CMD ./app or CMD ["sh", "-c", "/app"]. For more info, see this issue comment.false
ProxyHeaderstringThis will enable c.IP() to return the value of the given header key. By default c.IP()will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. X-Forwarded-*.""
ReadBufferSizeintper-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies).4096
ReadTimeouttime.DurationThe amount of time allowed to read the full request, including the body. The default timeout is unlimited.nil
RequestMethods[]stringRequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish.DefaultMethods
ServerHeaderstringEnables the Server HTTP header with the given value.""
StreamRequestBodyboolStreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit.false
StrictRoutingboolWhen enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same.false
TrustedProxies[]stringContains the list of trusted proxy IP's. Look at EnableTrustedProxyCheck doc.

It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses.
[]string*__*
UnescapePathboolConverts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special charactersfalse
ViewsViewsViews is the interface that wraps the Render function. See our Template Middleware for supported engines.nil
ViewsLayoutstringViews Layout is the global layout for all template render until override on Render function. See our Template Middleware for supported engines.""
WriteBufferSizeintPer-connection buffer size for responses' writing.4096
WriteTimeouttime.DurationThe maximum duration before timing out writes of the response. The default timeout is unlimited.nil
XMLEncoderutils.XMLMarshalAllowing for flexibility in using another XML library for encoding.xml.Marshal

NewError​

NewError creates a new HTTPError instance with an optional message.

Signature
func NewError(code int, message ...string) *Error
Example
app.Get("/", func(c *fiber.Ctx) error {
return fiber.NewError(782, "Custom error message")
})

IsChild​

IsChild determines if the current process is a result of Prefork.

Signature
func IsChild() bool
Example
// Prefork will spawn child processes
app := fiber.New(fiber.Config{
Prefork: true,
})

if !fiber.IsChild() {
fmt.Println("I'm the parent process")
} else {
fmt.Println("I'm a child process")
}

// ...
+ + \ No newline at end of file diff --git a/next/api/log/index.html b/next/api/log/index.html index 24e4f989464..d7e773139e4 100644 --- a/next/api/log/index.html +++ b/next/api/log/index.html @@ -6,8 +6,8 @@ Log | Fiber - - + +
@@ -16,8 +16,8 @@ It also provides several global functions, such as log.Info, log.Errorf, log.Warnw, etc.

Log levels​

const (
LevelTrace Level = iota
LevelDebug
LevelInfo
LevelWarn
LevelError
LevelFatal
LevelPanic
)

Custom log​

Fiber provides the AllLogger interface for adapting the various log libraries.

type CommonLogger interface {
Logger
FormatLogger
WithLogger
}

type AllLogger interface {
CommonLogger
ControlLogger
WithLogger
}

Note: The method of calling the Fatal level will interrupt the program running after printing the log, please use it with caution. Directly print logs of different levels, which will be entered into messageKey, the default is msg.

log.Info("Hello, World!")
log.Debug("Are you OK?")
log.Info("42 is the answer to life, the universe, and everything")
log.Warn("We are under attack!")
log.Error("Houston, we have a problem.")
log.Fatal("So Long, and Thanks for All the Fislog.")
log.Panic("The system is down.")

Format and print logs of different levels, all methods end with f

log.Debugf("Hello %s", "boy")
log.Infof("%d is the answer to life, the universe, and everything", 233)
log.Warnf("We are under attack %s!", "boss")
log.Errorf("%s, we have a problem.", "Master Shifu")
log.Fatalf("So Long, and Thanks for All the %s.", "banana")

Print a message with the key and value, or KEYVALS UNPAIRED if the key and value are not a pair.

log.Debugw("", "Hello", "boy")
log.Infow("", "number", 233)
log.Warnw("", "job", "boss")
log.Errorw("", "name", "Master Shifu")
log.Fatalw("", "fruit", "banana")

Global log​

If you are in a project and just want to use a simple log function that can be printed at any time in the global, we provide a global log.

import "github.com/gofiber/fiber/v2/log"

log.Info("info")
log.Warn("warn")

The above is using the default log.DefaultLogger standard output. You can also find an already implemented adaptation under contrib, or use your own implemented Logger and use log.SetLogger to set the global log logger.

import (
"log"
fiberlog "github.com/gofiber/fiber/v2/log"
)

var _ log.AllLogger = (*customLogger)(nil)

type customLogger struct {
stdlog *log.Logger
}

// ...
// inject your custom logger
fiberlog.SetLogger(customLogger)

Set Level​

log.SetLevel sets the level of logs below which logs will not be output. -The default logger is LevelTrace.

Note that this method is not concurrent-safe.

import "github.com/gofiber/fiber/v2/log"

log.SetLevel(log.LevelInfo)

Set output​

log.SetOutput sets the output destination of the logger. The default logger types the log in the console.

var logger AllLogger = &defaultLogger{
stdlog: log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile|log.Lmicroseconds),
depth: 4,
}

Set the output destination to the file.

// Output to ./test.log file
f, err := os.OpenFile("test.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
return
}
log.SetOutput(f)

Set the output destination to the console and file.

// Output to ./test.log file
file, _ := os.OpenFile("test.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
iw := io.MultiWriter(os.Stdout, file)
log.SetOutput(iw)

Bind context​

Set the context, using the following method will return a CommonLogger instance bound to the specified context

commonLogger := log.WithContext(ctx)
commonLogger.Info("info")
- - +The default logger is LevelTrace.

Note that this method is not concurrent-safe.

import "github.com/gofiber/fiber/v2/log"

log.SetLevel(log.LevelInfo)

Set output​

log.SetOutput sets the output destination of the logger. The default logger types the log in the console.

var logger AllLogger = &defaultLogger{
stdlog: log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile|log.Lmicroseconds),
depth: 4,
}

Set the output destination to the file.

// Output to ./test.log file
f, err := os.OpenFile("test.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
return
}
log.SetOutput(f)

Set the output destination to the console and file.

// Output to ./test.log file
file, _ := os.OpenFile("test.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
iw := io.MultiWriter(os.Stdout, file)
log.SetOutput(iw)

Bind context​

Set the context, using the following method will return a CommonLogger instance bound to the specified context

commonLogger := log.WithContext(ctx)
commonLogger.Info("info")
+ + \ No newline at end of file diff --git a/next/api/middleware/adaptor/index.html b/next/api/middleware/adaptor/index.html index be2743772fb..2af8151bb97 100644 --- a/next/api/middleware/adaptor/index.html +++ b/next/api/middleware/adaptor/index.html @@ -6,13 +6,13 @@ Adaptor | Fiber - - + +
-
Version: Next

Adaptor

Converter for net/http handlers to/from Fiber request handlers, special thanks to @arsmn!

Signatures​

NameSignatureDescription
HTTPHandlerHTTPHandler(h http.Handler) fiber.Handlerhttp.Handler -> fiber.Handler
HTTPHandlerFuncHTTPHandlerFunc(h http.HandlerFunc) fiber.Handlerhttp.HandlerFunc -> fiber.Handler
HTTPMiddlewareHTTPHandlerFunc(mw func(http.Handler) http.Handler) fiber.Handlerfunc(http.Handler) http.Handler -> fiber.Handler
FiberHandlerFiberHandler(h fiber.Handler) http.Handlerfiber.Handler -> http.Handler
FiberHandlerFuncFiberHandlerFunc(h fiber.Handler) http.HandlerFuncfiber.Handler -> http.HandlerFunc
FiberAppFiberApp(app *fiber.App) http.HandlerFuncFiber app -> http.HandlerFunc
ConvertRequestConvertRequest(c *fiber.Ctx, forServer bool) (*http.Request, error)fiber.Ctx -> http.Request
CopyContextToFiberContextCopyContextToFiberContext(context interface{}, requestContext *fasthttp.RequestCtx)context.Context -> fasthttp.RequestCtx

Examples​

net/http to Fiber​

package main

import (
"fmt"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// New fiber app
app := fiber.New()

// http.Handler -> fiber.Handler
app.Get("/", adaptor.HTTPHandler(handler(greet)))

// http.HandlerFunc -> fiber.Handler
app.Get("/func", adaptor.HTTPHandlerFunc(greet))

// Listen on port 3000
app.Listen(":3000")
}

func handler(f http.HandlerFunc) http.Handler {
return http.HandlerFunc(f)
}

func greet(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello World!")
}

net/http middleware to Fiber​

package main

import (
"log"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// New fiber app
app := fiber.New()

// http middleware -> fiber.Handler
app.Use(adaptor.HTTPMiddleware(logMiddleware))

// Listen on port 3000
app.Listen(":3000")
}

func logMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
log.Println("log middleware")
next.ServeHTTP(w, r)
})
}

Fiber Handler to net/http​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// fiber.Handler -> http.Handler
http.Handle("/", adaptor.FiberHandler(greet))

// fiber.Handler -> http.HandlerFunc
http.HandleFunc("/func", adaptor.FiberHandlerFunc(greet))

// Listen on port 3000
http.ListenAndServe(":3000", nil)
}

func greet(c *fiber.Ctx) error {
return c.SendString("Hello World!")
}

Fiber App to net/http​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
app := fiber.New()

app.Get("/greet", greet)

// Listen on port 3000
http.ListenAndServe(":3000", adaptor.FiberApp(app))
}

func greet(c *fiber.Ctx) error {
return c.SendString("Hello World!")
}

Fiber Context to (net/http).Request​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
app := fiber.New()

app.Get("/greet", greetWithHTTPReq)

// Listen on port 3000
http.ListenAndServe(":3000", adaptor.FiberApp(app))
}

func greetWithHTTPReq(c *fiber.Ctx) error {
httpReq, err := adaptor.ConvertRequest(c, false)
if err != nil {
return err
}

return c.SendString("Request URL: " + httpReq.URL.String())
}
- - +
Version: Next

Adaptor

Converter for net/http handlers to/from Fiber request handlers, special thanks to @arsmn!

Signatures​

NameSignatureDescription
HTTPHandlerHTTPHandler(h http.Handler) fiber.Handlerhttp.Handler -> fiber.Handler
HTTPHandlerFuncHTTPHandlerFunc(h http.HandlerFunc) fiber.Handlerhttp.HandlerFunc -> fiber.Handler
HTTPMiddlewareHTTPHandlerFunc(mw func(http.Handler) http.Handler) fiber.Handlerfunc(http.Handler) http.Handler -> fiber.Handler
FiberHandlerFiberHandler(h fiber.Handler) http.Handlerfiber.Handler -> http.Handler
FiberHandlerFuncFiberHandlerFunc(h fiber.Handler) http.HandlerFuncfiber.Handler -> http.HandlerFunc
FiberAppFiberApp(app *fiber.App) http.HandlerFuncFiber app -> http.HandlerFunc
ConvertRequestConvertRequest(c *fiber.Ctx, forServer bool) (*http.Request, error)fiber.Ctx -> http.Request
CopyContextToFiberContextCopyContextToFiberContext(context interface{}, requestContext *fasthttp.RequestCtx)context.Context -> fasthttp.RequestCtx

Examples​

net/http to Fiber​

package main

import (
"fmt"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// New fiber app
app := fiber.New()

// http.Handler -> fiber.Handler
app.Get("/", adaptor.HTTPHandler(handler(greet)))

// http.HandlerFunc -> fiber.Handler
app.Get("/func", adaptor.HTTPHandlerFunc(greet))

// Listen on port 3000
app.Listen(":3000")
}

func handler(f http.HandlerFunc) http.Handler {
return http.HandlerFunc(f)
}

func greet(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello World!")
}

net/http middleware to Fiber​

package main

import (
"log"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// New fiber app
app := fiber.New()

// http middleware -> fiber.Handler
app.Use(adaptor.HTTPMiddleware(logMiddleware))

// Listen on port 3000
app.Listen(":3000")
}

func logMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
log.Println("log middleware")
next.ServeHTTP(w, r)
})
}

Fiber Handler to net/http​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
// fiber.Handler -> http.Handler
http.Handle("/", adaptor.FiberHandler(greet))

// fiber.Handler -> http.HandlerFunc
http.HandleFunc("/func", adaptor.FiberHandlerFunc(greet))

// Listen on port 3000
http.ListenAndServe(":3000", nil)
}

func greet(c *fiber.Ctx) error {
return c.SendString("Hello World!")
}

Fiber App to net/http​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
app := fiber.New()

app.Get("/greet", greet)

// Listen on port 3000
http.ListenAndServe(":3000", adaptor.FiberApp(app))
}

func greet(c *fiber.Ctx) error {
return c.SendString("Hello World!")
}

Fiber Context to (net/http).Request​

package main

import (
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/adaptor"
)

func main() {
app := fiber.New()

app.Get("/greet", greetWithHTTPReq)

// Listen on port 3000
http.ListenAndServe(":3000", adaptor.FiberApp(app))
}

func greetWithHTTPReq(c *fiber.Ctx) error {
httpReq, err := adaptor.ConvertRequest(c, false)
if err != nil {
return err
}

return c.SendString("Request URL: " + httpReq.URL.String())
}
+ + \ No newline at end of file diff --git a/next/api/middleware/basicauth/index.html b/next/api/middleware/basicauth/index.html index 5469a770e3b..7d3a0f0f639 100644 --- a/next/api/middleware/basicauth/index.html +++ b/next/api/middleware/basicauth/index.html @@ -6,13 +6,13 @@ BasicAuth | Fiber - - + +
-
Version: Next

BasicAuth

Basic Authentication middleware for Fiber that provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized or a custom response for missing or invalid credentials.

Signatures​

func New(config Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/basicauth"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
app.Use(basicauth.New(basicauth.Config{
Users: map[string]string{
"john": "doe",
"admin": "123456",
},
}))

// Or extend your config for customization
app.Use(basicauth.New(basicauth.Config{
Users: map[string]string{
"john": "doe",
"admin": "123456",
},
Realm: "Forbidden",
Authorizer: func(user, pass string) bool {
if user == "john" && pass == "doe" {
return true
}
if user == "admin" && pass == "123456" {
return true
}
return false
},
Unauthorized: func(c *fiber.Ctx) error {
return c.SendFile("./unauthorized.html")
},
ContextUsername: "_user",
ContextPassword: "_pass",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Users defines the allowed credentials
//
// Required. Default: map[string]string{}
Users map[string]string

// Realm is a string to define realm attribute of BasicAuth.
// the realm identifies the system to authenticate against
// and can be used by clients to save credentials
//
// Optional. Default: "Restricted".
Realm string

// Authorizer defines a function you can pass
// to check the credentials however you want.
// It will be called with a username and password
// and is expected to return true or false to indicate
// that the credentials were approved or not.
//
// Optional. Default: nil.
Authorizer func(string, string) bool

// Unauthorized defines the response body for unauthorized responses.
// By default it will return with a 401 Unauthorized and the correct WWW-Auth header
//
// Optional. Default: nil
Unauthorized fiber.Handler

// ContextUser is the key to store the username in Locals
//
// Optional. Default: "username"
ContextUsername string

// ContextPass is the key to store the password in Locals
//
// Optional. Default: "password"
ContextPassword string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Users: map[string]string{},
Realm: "Restricted",
Authorizer: nil,
Unauthorized: nil,
ContextUsername: "username",
ContextPassword: "password",
}
- - +
Version: Next

BasicAuth

Basic Authentication middleware for Fiber that provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized or a custom response for missing or invalid credentials.

Signatures​

func New(config Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/basicauth"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
app.Use(basicauth.New(basicauth.Config{
Users: map[string]string{
"john": "doe",
"admin": "123456",
},
}))

// Or extend your config for customization
app.Use(basicauth.New(basicauth.Config{
Users: map[string]string{
"john": "doe",
"admin": "123456",
},
Realm: "Forbidden",
Authorizer: func(user, pass string) bool {
if user == "john" && pass == "doe" {
return true
}
if user == "admin" && pass == "123456" {
return true
}
return false
},
Unauthorized: func(c *fiber.Ctx) error {
return c.SendFile("./unauthorized.html")
},
ContextUsername: "_user",
ContextPassword: "_pass",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Users defines the allowed credentials
//
// Required. Default: map[string]string{}
Users map[string]string

// Realm is a string to define realm attribute of BasicAuth.
// the realm identifies the system to authenticate against
// and can be used by clients to save credentials
//
// Optional. Default: "Restricted".
Realm string

// Authorizer defines a function you can pass
// to check the credentials however you want.
// It will be called with a username and password
// and is expected to return true or false to indicate
// that the credentials were approved or not.
//
// Optional. Default: nil.
Authorizer func(string, string) bool

// Unauthorized defines the response body for unauthorized responses.
// By default it will return with a 401 Unauthorized and the correct WWW-Auth header
//
// Optional. Default: nil
Unauthorized fiber.Handler

// ContextUser is the key to store the username in Locals
//
// Optional. Default: "username"
ContextUsername string

// ContextPass is the key to store the password in Locals
//
// Optional. Default: "password"
ContextPassword string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Users: map[string]string{},
Realm: "Restricted",
Authorizer: nil,
Unauthorized: nil,
ContextUsername: "username",
ContextPassword: "password",
}
+ + \ No newline at end of file diff --git a/next/api/middleware/cache/index.html b/next/api/middleware/cache/index.html index 716e704f388..8aa7cf618dd 100644 --- a/next/api/middleware/cache/index.html +++ b/next/api/middleware/cache/index.html @@ -6,15 +6,15 @@ Cache | Fiber - - + +
Version: Next

Cache

Cache middleware for Fiber designed to intercept responses and cache them. This middleware will cache the Body, Content-Type and StatusCode using the c.Path() as unique identifier. Special thanks to @codemicro for creating this middleware for Fiber core!

Request Directives
Cache-Control: no-cache will return the up-to-date response but still caches it. You will always get a miss cache status.
-Cache-Control: no-store will refrain from caching. You will always get the up-to-date response.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cache"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(cache.New())

// Or extend your config for customization
app.Use(cache.New(cache.Config{
Next: func(c *fiber.Ctx) bool {
return c.Query("refresh") == "true"
},
Expiration: 30 * time.Minute,
CacheControl: true,
}))

Or you can custom key and expire time like this:

app.Use(cache.New(cache.Config{
ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration {
newCacheTime, _ := strconv.Atoi(c.GetRespHeader("Cache-Time", "600"))
return time.Second * time.Duration(newCacheTime)
},
KeyGenerator: func(c *fiber.Ctx) string {
return utils.CopyString(c.Path())
},
}))

app.Get("/", func(c *fiber.Ctx) error {
c.Response().Header.Add("Cache-Time", "6000")
return c.SendString("hi")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Expiration is the time that an cached response will live
//
// Optional. Default: 1 * time.Minute
Expiration time.Duration

// CacheHeader header on response header, indicate cache status, with the following possible return value
//
// hit, miss, unreachable
//
// Optional. Default: X-Cache
CacheHeader string

// CacheControl enables client side caching if set to true
//
// Optional. Default: false
CacheControl bool

// Key allows you to generate custom keys, by default c.Path() is used
//
// Default: func(c *fiber.Ctx) string {
// return utils.CopyString(c.Path())
// }
KeyGenerator func(*fiber.Ctx) string

// allows you to generate custom Expiration Key By Key, default is Expiration (Optional)
//
// Default: nil
ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration

// Store is used to store the state of the middleware
//
// Default: an in memory store for this process only
Storage fiber.Storage

// allows you to store additional headers generated by next middlewares & handler
//
// Default: false
StoreResponseHeaders bool

// Max number of bytes of response bodies simultaneously stored in cache. When limit is reached,
// entries with the nearest expiration are deleted to make room for new.
// 0 means no limit
//
// Default: 0
MaxBytes uint

// You can specify HTTP methods to cache.
// The middleware just caches the routes of its methods in this slice.
//
// Default: []string{fiber.MethodGet, fiber.MethodHead}
Methods []string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Expiration: 1 * time.Minute,
CacheHeader: "X-Cache",
CacheControl: false,
KeyGenerator: func(c *fiber.Ctx) string {
return utils.CopyString(c.Path())
},
ExpirationGenerator: nil,
StoreResponseHeaders: false,
Storage: nil,
MaxBytes: 0,
Methods: []string{fiber.MethodGet, fiber.MethodHead},
}
- - +Cache-Control: no-store will refrain from caching. You will always get the up-to-date response.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cache"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(cache.New())

// Or extend your config for customization
app.Use(cache.New(cache.Config{
Next: func(c *fiber.Ctx) bool {
return c.Query("refresh") == "true"
},
Expiration: 30 * time.Minute,
CacheControl: true,
}))

Or you can custom key and expire time like this:

app.Use(cache.New(cache.Config{
ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration {
newCacheTime, _ := strconv.Atoi(c.GetRespHeader("Cache-Time", "600"))
return time.Second * time.Duration(newCacheTime)
},
KeyGenerator: func(c *fiber.Ctx) string {
return utils.CopyString(c.Path())
},
}))

app.Get("/", func(c *fiber.Ctx) error {
c.Response().Header.Add("Cache-Time", "6000")
return c.SendString("hi")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Expiration is the time that an cached response will live
//
// Optional. Default: 1 * time.Minute
Expiration time.Duration

// CacheHeader header on response header, indicate cache status, with the following possible return value
//
// hit, miss, unreachable
//
// Optional. Default: X-Cache
CacheHeader string

// CacheControl enables client side caching if set to true
//
// Optional. Default: false
CacheControl bool

// Key allows you to generate custom keys, by default c.Path() is used
//
// Default: func(c *fiber.Ctx) string {
// return utils.CopyString(c.Path())
// }
KeyGenerator func(*fiber.Ctx) string

// allows you to generate custom Expiration Key By Key, default is Expiration (Optional)
//
// Default: nil
ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration

// Store is used to store the state of the middleware
//
// Default: an in memory store for this process only
Storage fiber.Storage

// allows you to store additional headers generated by next middlewares & handler
//
// Default: false
StoreResponseHeaders bool

// Max number of bytes of response bodies simultaneously stored in cache. When limit is reached,
// entries with the nearest expiration are deleted to make room for new.
// 0 means no limit
//
// Default: 0
MaxBytes uint

// You can specify HTTP methods to cache.
// The middleware just caches the routes of its methods in this slice.
//
// Default: []string{fiber.MethodGet, fiber.MethodHead}
Methods []string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Expiration: 1 * time.Minute,
CacheHeader: "X-Cache",
CacheControl: false,
KeyGenerator: func(c *fiber.Ctx) string {
return utils.CopyString(c.Path())
},
ExpirationGenerator: nil,
StoreResponseHeaders: false,
Storage: nil,
MaxBytes: 0,
Methods: []string{fiber.MethodGet, fiber.MethodHead},
}
+ + \ No newline at end of file diff --git a/next/api/middleware/compress/index.html b/next/api/middleware/compress/index.html index f84c9c51849..66eb7dd3653 100644 --- a/next/api/middleware/compress/index.html +++ b/next/api/middleware/compress/index.html @@ -6,13 +6,13 @@ Compress | Fiber - - + +
-
Version: Next

Compress

Compression middleware for Fiber that will compress the response using gzip, deflate and brotli compression depending on the Accept-Encoding header.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/compress"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(compress.New())

// Or extend your config for customization
app.Use(compress.New(compress.Config{
Level: compress.LevelBestSpeed, // 1
}))

// Skip middleware for specific routes
app.Use(compress.New(compress.Config{
Next: func(c *fiber.Ctx) bool {
return c.Path() == "/dont_compress"
},
Level: compress.LevelBestSpeed, // 1
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Level determines the compression algoritm
//
// Optional. Default: LevelDefault
// LevelDisabled: -1
// LevelDefault: 0
// LevelBestSpeed: 1
// LevelBestCompression: 2
Level int
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Level: LevelDefault,
}

Constants​

// Compression levels
const (
LevelDisabled = -1
LevelDefault = 0
LevelBestSpeed = 1
LevelBestCompression = 2
)
- - +
Version: Next

Compress

Compression middleware for Fiber that will compress the response using gzip, deflate and brotli compression depending on the Accept-Encoding header.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/compress"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(compress.New())

// Or extend your config for customization
app.Use(compress.New(compress.Config{
Level: compress.LevelBestSpeed, // 1
}))

// Skip middleware for specific routes
app.Use(compress.New(compress.Config{
Next: func(c *fiber.Ctx) bool {
return c.Path() == "/dont_compress"
},
Level: compress.LevelBestSpeed, // 1
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Level determines the compression algoritm
//
// Optional. Default: LevelDefault
// LevelDisabled: -1
// LevelDefault: 0
// LevelBestSpeed: 1
// LevelBestCompression: 2
Level int
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Level: LevelDefault,
}

Constants​

// Compression levels
const (
LevelDisabled = -1
LevelDefault = 0
LevelBestSpeed = 1
LevelBestCompression = 2
)
+ + \ No newline at end of file diff --git a/next/api/middleware/cors/index.html b/next/api/middleware/cors/index.html index ce7f2343cf0..01366b698e3 100644 --- a/next/api/middleware/cors/index.html +++ b/next/api/middleware/cors/index.html @@ -6,13 +6,13 @@ CORS | Fiber - - + +
-
Version: Next

CORS

CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(cors.New())

// Or extend your config for customization
app.Use(cors.New(cors.Config{
AllowOrigins: "https://gofiber.io, https://gofiber.net",
AllowHeaders: "Origin, Content-Type, Accept",
}))

Using the AllowOriginsFunc function. In this example any origin will be allowed via CORS.

For example, if a browser running on http://localhost:3000 sends a request, this will be accepted and the access-control-allow-origin response header will be set to http://localhost:3000.

Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via AllowOrigins.

app.Use(cors.New())

app.Use(cors.New(cors.Config{
AllowOriginsFunc: func(origin string) bool {
return os.Getenv("ENVIRONMENT") == "development"
},
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// AllowOriginsFunc defines a function that will set the 'access-control-allow-origin'
// response header to the 'origin' request header when returned true.
//
// Note: Using this feature is discouraged in production and it's best practice to explicitly
// set CORS origins via 'AllowOrigins'
//
// Optional. Default: nil
AllowOriginsFunc func(origin string) bool

// AllowOrigin defines a list of origins that may access the resource.
//
// Optional. Default value "*"
AllowOrigins string

// AllowMethods defines a list methods allowed when accessing the resource.
// This is used in response to a preflight request.
//
// Optional. Default value "GET,POST,HEAD,PUT,DELETE,PATCH"
AllowMethods string

// AllowHeaders defines a list of request headers that can be used when
// making the actual request. This is in response to a preflight request.
//
// Optional. Default value "".
AllowHeaders string

// AllowCredentials indicates whether or not the response to the request
// can be exposed when the credentials flag is true. When used as part of
// a response to a preflight request, this indicates whether or not the
// actual request can be made using credentials.
//
// Optional. Default value false.
AllowCredentials bool

// ExposeHeaders defines a whitelist headers that clients are allowed to
// access.
//
// Optional. Default value "".
ExposeHeaders string

// MaxAge indicates how long (in seconds) the results of a preflight request
// can be cached.
//
// Optional. Default value 0.
MaxAge int
}

Default Config​

var ConfigDefault = Config{
Next: nil,
AllowOriginsFunc: nil,
AllowOrigins: "*",
AllowMethods: strings.Join([]string{
fiber.MethodGet,
fiber.MethodPost,
fiber.MethodHead,
fiber.MethodPut,
fiber.MethodDelete,
fiber.MethodPatch,
}, ","),
AllowHeaders: "",
AllowCredentials: false,
ExposeHeaders: "",
MaxAge: 0,
}
- - +
Version: Next

CORS

CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(cors.New())

// Or extend your config for customization
app.Use(cors.New(cors.Config{
AllowOrigins: "https://gofiber.io, https://gofiber.net",
AllowHeaders: "Origin, Content-Type, Accept",
}))

Using the AllowOriginsFunc function. In this example any origin will be allowed via CORS.

For example, if a browser running on http://localhost:3000 sends a request, this will be accepted and the access-control-allow-origin response header will be set to http://localhost:3000.

Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via AllowOrigins.

app.Use(cors.New())

app.Use(cors.New(cors.Config{
AllowOriginsFunc: func(origin string) bool {
return os.Getenv("ENVIRONMENT") == "development"
},
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// AllowOriginsFunc defines a function that will set the 'access-control-allow-origin'
// response header to the 'origin' request header when returned true.
//
// Note: Using this feature is discouraged in production and it's best practice to explicitly
// set CORS origins via 'AllowOrigins'
//
// Optional. Default: nil
AllowOriginsFunc func(origin string) bool

// AllowOrigin defines a list of origins that may access the resource.
//
// Optional. Default value "*"
AllowOrigins string

// AllowMethods defines a list methods allowed when accessing the resource.
// This is used in response to a preflight request.
//
// Optional. Default value "GET,POST,HEAD,PUT,DELETE,PATCH"
AllowMethods string

// AllowHeaders defines a list of request headers that can be used when
// making the actual request. This is in response to a preflight request.
//
// Optional. Default value "".
AllowHeaders string

// AllowCredentials indicates whether or not the response to the request
// can be exposed when the credentials flag is true. When used as part of
// a response to a preflight request, this indicates whether or not the
// actual request can be made using credentials.
//
// Optional. Default value false.
AllowCredentials bool

// ExposeHeaders defines a whitelist headers that clients are allowed to
// access.
//
// Optional. Default value "".
ExposeHeaders string

// MaxAge indicates how long (in seconds) the results of a preflight request
// can be cached.
//
// Optional. Default value 0.
MaxAge int
}

Default Config​

var ConfigDefault = Config{
Next: nil,
AllowOriginsFunc: nil,
AllowOrigins: "*",
AllowMethods: strings.Join([]string{
fiber.MethodGet,
fiber.MethodPost,
fiber.MethodHead,
fiber.MethodPut,
fiber.MethodDelete,
fiber.MethodPatch,
}, ","),
AllowHeaders: "",
AllowCredentials: false,
ExposeHeaders: "",
MaxAge: 0,
}
+ + \ No newline at end of file diff --git a/next/api/middleware/csrf/index.html b/next/api/middleware/csrf/index.html index 2a842eefef8..f5e32ac5ffc 100644 --- a/next/api/middleware/csrf/index.html +++ b/next/api/middleware/csrf/index.html @@ -6,13 +6,13 @@ CSRF | Fiber - - + +
-
Version: Next

CSRF

CSRF middleware for Fiber that provides Cross-site request forgery protection by passing a csrf token via cookies. This cookie value will be used to compare against the client csrf token on requests, other than those defined as "safe" by RFC7231 (GET, HEAD, OPTIONS, or TRACE). When the csrf token is invalid, this middleware will return the fiber.ErrForbidden error.

CSRF Tokens are generated on GET requests. You can retrieve the CSRF token with c.Locals(contextKey), where contextKey is the string you set in the config (see Custom Config below).

When no csrf_ cookie is set, or the token has expired, a new token will be generated and csrf_ cookie set.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/csrf"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(csrf.New())

// Or extend your config for customization
app.Use(csrf.New(csrf.Config{
KeyLookup: "header:X-Csrf-Token",
CookieName: "csrf_",
CookieSameSite: "Lax",
Expiration: 1 * time.Hour,
KeyGenerator: utils.UUID,
Extractor: func(c *fiber.Ctx) (string, error) { ... },
}))
note

KeyLookup will be ignored if Extractor is explicitly set.

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// KeyLookup is a string in the form of "<source>:<key>" that is used
// to create an Extractor that extracts the token from the request.
// Possible values:
// - "header:<name>"
// - "query:<name>"
// - "param:<name>"
// - "form:<name>"
// - "cookie:<name>"
//
// Ignored if an Extractor is explicitly set.
//
// Optional. Default: "header:X-CSRF-Token"
KeyLookup string

// Name of the session cookie. This cookie will store session key.
// Optional. Default value "csrf_".
CookieName string

// Domain of the CSRF cookie.
// Optional. Default value "".
CookieDomain string

// Path of the CSRF cookie.
// Optional. Default value "".
CookiePath string

// Indicates if CSRF cookie is secure.
// Optional. Default value false.
CookieSecure bool

// Indicates if CSRF cookie is HTTP only.
// Optional. Default value false.
CookieHTTPOnly bool

// Indicates if CSRF cookie is requested by SameSite.
// Optional. Default value "Lax".
CookieSameSite string

// Decides whether cookie should last for only the browser sesison.
// Ignores Expiration if set to true
CookieSessionOnly bool

// Expiration is the duration before csrf token will expire
//
// Optional. Default: 1 * time.Hour
Expiration time.Duration

// Store is used to store the state of the middleware
//
// Optional. Default: memory.New()
Storage fiber.Storage

// Context key to store generated CSRF token into context.
// If left empty, token will not be stored in context.
//
// Optional. Default: ""
ContextKey string

// KeyGenerator creates a new CSRF token
//
// Optional. Default: utils.UUID
KeyGenerator func() string

// Extractor returns the csrf token
//
// If set this will be used in place of an Extractor based on KeyLookup.
//
// Optional. Default will create an Extractor based on KeyLookup.
Extractor func(c *fiber.Ctx) (string, error)
}

Default Config​

var ConfigDefault = Config{
KeyLookup: "header:" + HeaderName,
CookieName: "csrf_",
CookieSameSite: "Lax",
Expiration: 1 * time.Hour,
KeyGenerator: utils.UUID,
ErrorHandler: defaultErrorHandler,
Extractor: CsrfFromHeader(HeaderName),
}

Constants​

const (
HeaderName = "X-Csrf-Token"
)

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
app.Use(csrf.New(csrf.Config{
Storage: storage,
}))
- - +
Version: Next

CSRF

CSRF middleware for Fiber that provides Cross-site request forgery protection by passing a csrf token via cookies. This cookie value will be used to compare against the client csrf token on requests, other than those defined as "safe" by RFC7231 (GET, HEAD, OPTIONS, or TRACE). When the csrf token is invalid, this middleware will return the fiber.ErrForbidden error.

CSRF Tokens are generated on GET requests. You can retrieve the CSRF token with c.Locals(contextKey), where contextKey is the string you set in the config (see Custom Config below).

When no csrf_ cookie is set, or the token has expired, a new token will be generated and csrf_ cookie set.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/csrf"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(csrf.New())

// Or extend your config for customization
app.Use(csrf.New(csrf.Config{
KeyLookup: "header:X-Csrf-Token",
CookieName: "csrf_",
CookieSameSite: "Lax",
Expiration: 1 * time.Hour,
KeyGenerator: utils.UUID,
Extractor: func(c *fiber.Ctx) (string, error) { ... },
}))
note

KeyLookup will be ignored if Extractor is explicitly set.

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// KeyLookup is a string in the form of "<source>:<key>" that is used
// to create an Extractor that extracts the token from the request.
// Possible values:
// - "header:<name>"
// - "query:<name>"
// - "param:<name>"
// - "form:<name>"
// - "cookie:<name>"
//
// Ignored if an Extractor is explicitly set.
//
// Optional. Default: "header:X-CSRF-Token"
KeyLookup string

// Name of the session cookie. This cookie will store session key.
// Optional. Default value "csrf_".
CookieName string

// Domain of the CSRF cookie.
// Optional. Default value "".
CookieDomain string

// Path of the CSRF cookie.
// Optional. Default value "".
CookiePath string

// Indicates if CSRF cookie is secure.
// Optional. Default value false.
CookieSecure bool

// Indicates if CSRF cookie is HTTP only.
// Optional. Default value false.
CookieHTTPOnly bool

// Indicates if CSRF cookie is requested by SameSite.
// Optional. Default value "Lax".
CookieSameSite string

// Decides whether cookie should last for only the browser sesison.
// Ignores Expiration if set to true
CookieSessionOnly bool

// Expiration is the duration before csrf token will expire
//
// Optional. Default: 1 * time.Hour
Expiration time.Duration

// Store is used to store the state of the middleware
//
// Optional. Default: memory.New()
Storage fiber.Storage

// Context key to store generated CSRF token into context.
// If left empty, token will not be stored in context.
//
// Optional. Default: ""
ContextKey string

// KeyGenerator creates a new CSRF token
//
// Optional. Default: utils.UUID
KeyGenerator func() string

// Extractor returns the csrf token
//
// If set this will be used in place of an Extractor based on KeyLookup.
//
// Optional. Default will create an Extractor based on KeyLookup.
Extractor func(c *fiber.Ctx) (string, error)
}

Default Config​

var ConfigDefault = Config{
KeyLookup: "header:" + HeaderName,
CookieName: "csrf_",
CookieSameSite: "Lax",
Expiration: 1 * time.Hour,
KeyGenerator: utils.UUID,
ErrorHandler: defaultErrorHandler,
Extractor: CsrfFromHeader(HeaderName),
}

Constants​

const (
HeaderName = "X-Csrf-Token"
)

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
app.Use(csrf.New(csrf.Config{
Storage: storage,
}))
+ + \ No newline at end of file diff --git a/next/api/middleware/earlydata/index.html b/next/api/middleware/earlydata/index.html index ff5dcd47bed..141ca07ebc5 100644 --- a/next/api/middleware/earlydata/index.html +++ b/next/api/middleware/earlydata/index.html @@ -6,15 +6,15 @@ EarlyData | Fiber - - + +
Version: Next

EarlyData

The Early Data middleware for Fiber adds support for TLS 1.3's early data ("0-RTT") feature. Citing RFC 8446, when a client and server share a PSK, TLS 1.3 allows clients to send data on the first flight ("early data") to speed up the request, effectively reducing the regular 1-RTT request to a 0-RTT request.

Make sure to enable fiber's EnableTrustedProxyCheck config option before using this middleware in order to not trust bogus HTTP request headers of the client.

Also be aware that enabling support for early data in your reverse proxy (e.g. nginx, as done with a simple ssl_early_data on;) makes requests replayable. Refer to the following documents before continuing:

By default, this middleware allows early data requests on safe HTTP request methods only and rejects the request otherwise, i.e. aborts the request before executing your handler. This behavior can be controlled by the AllowEarlyData config option. -Safe HTTP methods β€” GET, HEAD, OPTIONS and TRACE β€” should not modify a state on the server.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/earlydata"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(earlydata.New())

// Or extend your config for customization
app.Use(earlydata.New(earlydata.Config{
Error: fiber.ErrTooEarly,
// ...
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// IsEarlyData returns whether the request is an early-data request.
//
// Optional. Default: a function which checks if the "Early-Data" request header equals "1".
IsEarlyData func(c *fiber.Ctx) bool

// AllowEarlyData returns whether the early-data request should be allowed or rejected.
//
// Optional. Default: a function which rejects the request on unsafe and allows the request on safe HTTP request methods.
AllowEarlyData func(c *fiber.Ctx) bool

// Error is returned in case an early-data request is rejected.
//
// Optional. Default: fiber.ErrTooEarly.
Error error
}

Default Config​

var ConfigDefault = Config{
IsEarlyData: func(c *fiber.Ctx) bool {
return c.Get(DefaultHeaderName) == DefaultHeaderTrueValue
},

AllowEarlyData: func(c *fiber.Ctx) bool {
return fiber.IsMethodSafe(c.Method())
},

Error: fiber.ErrTooEarly,
}

Constants​

const (
DefaultHeaderName = "Early-Data"
DefaultHeaderTrueValue = "1"
)
- - +Safe HTTP methods β€” GET, HEAD, OPTIONS and TRACE β€” should not modify a state on the server.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/earlydata"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(earlydata.New())

// Or extend your config for customization
app.Use(earlydata.New(earlydata.Config{
Error: fiber.ErrTooEarly,
// ...
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// IsEarlyData returns whether the request is an early-data request.
//
// Optional. Default: a function which checks if the "Early-Data" request header equals "1".
IsEarlyData func(c *fiber.Ctx) bool

// AllowEarlyData returns whether the early-data request should be allowed or rejected.
//
// Optional. Default: a function which rejects the request on unsafe and allows the request on safe HTTP request methods.
AllowEarlyData func(c *fiber.Ctx) bool

// Error is returned in case an early-data request is rejected.
//
// Optional. Default: fiber.ErrTooEarly.
Error error
}

Default Config​

var ConfigDefault = Config{
IsEarlyData: func(c *fiber.Ctx) bool {
return c.Get(DefaultHeaderName) == DefaultHeaderTrueValue
},

AllowEarlyData: func(c *fiber.Ctx) bool {
return fiber.IsMethodSafe(c.Method())
},

Error: fiber.ErrTooEarly,
}

Constants​

const (
DefaultHeaderName = "Early-Data"
DefaultHeaderTrueValue = "1"
)
+ + \ No newline at end of file diff --git a/next/api/middleware/encryptcookie/index.html b/next/api/middleware/encryptcookie/index.html index eaef1af0c8c..cda5b5aca80 100644 --- a/next/api/middleware/encryptcookie/index.html +++ b/next/api/middleware/encryptcookie/index.html @@ -6,13 +6,13 @@ Encrypt Cookie | Fiber - - + +
-
Version: Next

Encrypt Cookie

Encrypt middleware for Fiber which encrypts cookie values. Note: this middleware does not encrypt cookie names.

Signatures​

// Intitializes the middleware
func New(config ...Config) fiber.Handler

// Returns a random 32 character long string
func GenerateKey() string

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/encryptcookie"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
// `Key` must be a 32 character string. It's used to encrypt the values, so make sure it is random and keep it secret.
// You can run `openssl rand -base64 32` or call `encryptcookie.GenerateKey()` to create a random key for you.
// Make sure not to set `Key` to `encryptcookie.GenerateKey()` because that will create a new key every run.
app.Use(encryptcookie.New(encryptcookie.Config{
Key: "secret-thirty-2-character-string",
}))

// Get / reading out the encrypted cookie
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("value=" + c.Cookies("test"))
})

// Post / create the encrypted cookie
app.Post("/", func(c *fiber.Ctx) error {
c.Cookie(&fiber.Cookie{
Name: "test",
Value: "SomeThing",
})
return nil
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Array of cookie keys that should not be encrypted.
//
// Optional. Default: ["csrf_"]
Except []string

// Base64 encoded unique key to encode & decode cookies.
//
// Required. The key should be 32 bytes of random data in base64-encoded form.
// You may run `openssl rand -base64 32` or use `encryptcookie.GenerateKey()` to generate a new key.
Key string

// Custom function to encrypt cookies.
//
// Optional. Default: EncryptCookie
Encryptor func(decryptedString, key string) (string, error)

// Custom function to decrypt cookies.
//
// Optional. Default: DecryptCookie
Decryptor func(encryptedString, key string) (string, error)
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Except: []string{"csrf_"},
Key: "",
Encryptor: EncryptCookie,
Decryptor: DecryptCookie,
}

Normally, encryptcookie middleware skips csrf_ cookies. However, it won't work when you use custom cookie names for CSRF. You should update Except config to avoid this problem. For example:

app.Use(encryptcookie.New(encryptcookie.Config{
Key: "secret-thirty-2-character-string",
Except: []string{"csrf_1"}, // exclude CSRF cookie
}))
app.Use(csrf.New(csrf.Config{
KeyLookup: "form:test",
CookieName: "csrf_1",
CookieHTTPOnly: true,
}))
- - +
Version: Next

Encrypt Cookie

Encrypt middleware for Fiber which encrypts cookie values. Note: this middleware does not encrypt cookie names.

Signatures​

// Intitializes the middleware
func New(config ...Config) fiber.Handler

// Returns a random 32 character long string
func GenerateKey() string

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/encryptcookie"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
// `Key` must be a 32 character string. It's used to encrypt the values, so make sure it is random and keep it secret.
// You can run `openssl rand -base64 32` or call `encryptcookie.GenerateKey()` to create a random key for you.
// Make sure not to set `Key` to `encryptcookie.GenerateKey()` because that will create a new key every run.
app.Use(encryptcookie.New(encryptcookie.Config{
Key: "secret-thirty-2-character-string",
}))

// Get / reading out the encrypted cookie
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("value=" + c.Cookies("test"))
})

// Post / create the encrypted cookie
app.Post("/", func(c *fiber.Ctx) error {
c.Cookie(&fiber.Cookie{
Name: "test",
Value: "SomeThing",
})
return nil
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Array of cookie keys that should not be encrypted.
//
// Optional. Default: ["csrf_"]
Except []string

// Base64 encoded unique key to encode & decode cookies.
//
// Required. The key should be 32 bytes of random data in base64-encoded form.
// You may run `openssl rand -base64 32` or use `encryptcookie.GenerateKey()` to generate a new key.
Key string

// Custom function to encrypt cookies.
//
// Optional. Default: EncryptCookie
Encryptor func(decryptedString, key string) (string, error)

// Custom function to decrypt cookies.
//
// Optional. Default: DecryptCookie
Decryptor func(encryptedString, key string) (string, error)
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Except: []string{"csrf_"},
Key: "",
Encryptor: EncryptCookie,
Decryptor: DecryptCookie,
}

Normally, encryptcookie middleware skips csrf_ cookies. However, it won't work when you use custom cookie names for CSRF. You should update Except config to avoid this problem. For example:

app.Use(encryptcookie.New(encryptcookie.Config{
Key: "secret-thirty-2-character-string",
Except: []string{"csrf_1"}, // exclude CSRF cookie
}))
app.Use(csrf.New(csrf.Config{
KeyLookup: "form:test",
CookieName: "csrf_1",
CookieHTTPOnly: true,
}))
+ + \ No newline at end of file diff --git a/next/api/middleware/envvar/index.html b/next/api/middleware/envvar/index.html index b2961cc79e9..7bb2fb0052f 100644 --- a/next/api/middleware/envvar/index.html +++ b/next/api/middleware/envvar/index.html @@ -6,13 +6,13 @@ EnvVar | Fiber - - + +
-
Version: Next

EnvVar

EnvVar middleware for Fiber that can be used to expose environment variables with various options.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/envvar"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use("/expose/envvars", envvar.New())

// Or extend your config for customization
app.Use("/expose/envvars", envvar.New(
envvar.Config{
ExportVars: map[string]string{"testKey": "", "testDefaultKey": "testDefaultVal"},
ExcludeVars: map[string]string{"excludeKey": ""},
}),
)
note

You will need to provide a path to use the envvar middleware.

Response​

Http response contract:

{
"vars": {
"someEnvVariable": "someValue",
"anotherEnvVariable": "anotherValue",
}
}

Config​

// Config defines the config for middleware.
type Config struct {
// ExportVars specifies the environment variables that should export
ExportVars map[string]string
// ExcludeVars specifies the environment variables that should not export
ExcludeVars map[string]string
}

Default Config​

Config{}
- - +
Version: Next

EnvVar

EnvVar middleware for Fiber that can be used to expose environment variables with various options.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/envvar"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use("/expose/envvars", envvar.New())

// Or extend your config for customization
app.Use("/expose/envvars", envvar.New(
envvar.Config{
ExportVars: map[string]string{"testKey": "", "testDefaultKey": "testDefaultVal"},
ExcludeVars: map[string]string{"excludeKey": ""},
}),
)
note

You will need to provide a path to use the envvar middleware.

Response​

Http response contract:

{
"vars": {
"someEnvVariable": "someValue",
"anotherEnvVariable": "anotherValue",
}
}

Config​

// Config defines the config for middleware.
type Config struct {
// ExportVars specifies the environment variables that should export
ExportVars map[string]string
// ExcludeVars specifies the environment variables that should not export
ExcludeVars map[string]string
}

Default Config​

Config{}
+ + \ No newline at end of file diff --git a/next/api/middleware/etag/index.html b/next/api/middleware/etag/index.html index 2ec13c56125..e9b2072ca26 100644 --- a/next/api/middleware/etag/index.html +++ b/next/api/middleware/etag/index.html @@ -6,13 +6,13 @@ ETag | Fiber - - + +
-
Version: Next

ETag

ETag middleware for Fiber that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/etag"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(etag.New())

// Get / receives Etag: "13-1831710635" in response header
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

// Or extend your config for customization
app.Use(etag.New(etag.Config{
Weak: true,
}))

// Get / receives Etag: "W/"13-1831710635" in response header
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Weak indicates that a weak validator is used. Weak etags are easy
// to generate, but are far less useful for comparisons. Strong
// validators are ideal for comparisons but can be very difficult
// to generate efficiently. Weak ETag values of two representations
// of the same resources might be semantically equivalent, but not
// byte-for-byte identical. This means weak etags prevent caching
// when byte range requests are used, but strong etags mean range
// requests can still be cached.
Weak bool
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Weak: false,
}
- - +
Version: Next

ETag

ETag middleware for Fiber that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/etag"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(etag.New())

// Get / receives Etag: "13-1831710635" in response header
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

// Or extend your config for customization
app.Use(etag.New(etag.Config{
Weak: true,
}))

// Get / receives Etag: "W/"13-1831710635" in response header
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Weak indicates that a weak validator is used. Weak etags are easy
// to generate, but are far less useful for comparisons. Strong
// validators are ideal for comparisons but can be very difficult
// to generate efficiently. Weak ETag values of two representations
// of the same resources might be semantically equivalent, but not
// byte-for-byte identical. This means weak etags prevent caching
// when byte range requests are used, but strong etags mean range
// requests can still be cached.
Weak bool
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Weak: false,
}
+ + \ No newline at end of file diff --git a/next/api/middleware/expvar/index.html b/next/api/middleware/expvar/index.html index 6ac06c1e3fe..9caacf6680b 100644 --- a/next/api/middleware/expvar/index.html +++ b/next/api/middleware/expvar/index.html @@ -6,13 +6,13 @@ ExpVar | Fiber - - + +
-
Version: Next

ExpVar

Expvar middleware for Fiber that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is /debug/vars.

Signatures​

func New() fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
expvarmw "github.com/gofiber/fiber/v2/middleware/expvar"
)

After you initiate your Fiber app, you can use the following possibilities:

var count = expvar.NewInt("count")

app.Use(expvarmw.New())
app.Get("/", func(c *fiber.Ctx) error {
count.Add(1)

return c.SendString(fmt.Sprintf("hello expvar count %d", count.Value()))
})

Visit path /debug/vars to see all vars and use query r=key to filter exposed variables.

curl 127.0.0.1:3000
hello expvar count 1

curl 127.0.0.1:3000/debug/vars
{
"cmdline": ["xxx"],
"count": 1,
"expvarHandlerCalls": 33,
"expvarRegexpErrors": 0,
"memstats": {...}
}

curl 127.0.0.1:3000/debug/vars?r=c
{
"cmdline": ["xxx"],
"count": 1
}

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool
}

Default Config​

var ConfigDefault = Config{
Next: nil,
}
- - +
Version: Next

ExpVar

Expvar middleware for Fiber that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is /debug/vars.

Signatures​

func New() fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
expvarmw "github.com/gofiber/fiber/v2/middleware/expvar"
)

After you initiate your Fiber app, you can use the following possibilities:

var count = expvar.NewInt("count")

app.Use(expvarmw.New())
app.Get("/", func(c *fiber.Ctx) error {
count.Add(1)

return c.SendString(fmt.Sprintf("hello expvar count %d", count.Value()))
})

Visit path /debug/vars to see all vars and use query r=key to filter exposed variables.

curl 127.0.0.1:3000
hello expvar count 1

curl 127.0.0.1:3000/debug/vars
{
"cmdline": ["xxx"],
"count": 1,
"expvarHandlerCalls": 33,
"expvarRegexpErrors": 0,
"memstats": {...}
}

curl 127.0.0.1:3000/debug/vars?r=c
{
"cmdline": ["xxx"],
"count": 1
}

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool
}

Default Config​

var ConfigDefault = Config{
Next: nil,
}
+ + \ No newline at end of file diff --git a/next/api/middleware/favicon/index.html b/next/api/middleware/favicon/index.html index b0731381449..b5ebf9905c4 100644 --- a/next/api/middleware/favicon/index.html +++ b/next/api/middleware/favicon/index.html @@ -6,13 +6,13 @@ Favicon | Fiber - - + +
-
Version: Next

Favicon

Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware.

note

This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or custom favicon URL.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/favicon"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(favicon.New())

// Or extend your config for customization
app.Use(favicon.New(favicon.Config{
File: "./favicon.ico",
URL: "/favicon.ico",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// File holds the path to an actual favicon that will be cached
//
// Optional. Default: ""
File string

// URL for favicon handler
//
// Optional. Default: "/favicon.ico"
URL string

// FileSystem is an optional alternate filesystem to search for the favicon in.
// An example of this could be an embedded or network filesystem
//
// Optional. Default: nil
FileSystem http.FileSystem

// CacheControl defines how the Cache-Control header in the response should be set
//
// Optional. Default: "public, max-age=31536000"
CacheControl string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
File: "",
URL: fPath,
CacheControl: "public, max-age=31536000",
}
- - +
Version: Next

Favicon

Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware.

note

This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or custom favicon URL.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/favicon"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(favicon.New())

// Or extend your config for customization
app.Use(favicon.New(favicon.Config{
File: "./favicon.ico",
URL: "/favicon.ico",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// File holds the path to an actual favicon that will be cached
//
// Optional. Default: ""
File string

// URL for favicon handler
//
// Optional. Default: "/favicon.ico"
URL string

// FileSystem is an optional alternate filesystem to search for the favicon in.
// An example of this could be an embedded or network filesystem
//
// Optional. Default: nil
FileSystem http.FileSystem

// CacheControl defines how the Cache-Control header in the response should be set
//
// Optional. Default: "public, max-age=31536000"
CacheControl string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
File: "",
URL: fPath,
CacheControl: "public, max-age=31536000",
}
+ + \ No newline at end of file diff --git a/next/api/middleware/filesystem/index.html b/next/api/middleware/filesystem/index.html index 2fb7fa45321..0dd724300f4 100644 --- a/next/api/middleware/filesystem/index.html +++ b/next/api/middleware/filesystem/index.html @@ -6,13 +6,13 @@ FileSystem | Fiber - - + +
-
Version: Next

FileSystem

Filesystem middleware for Fiber that enables you to serve files from a directory.

caution

:params & :optionals? within the prefix path are not supported!

To handle paths with spaces (or other url encoded values) make sure to set fiber.Config{ UnescapePath: true }

Signatures​

func New(config Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
app.Use(filesystem.New(filesystem.Config{
Root: http.Dir("./assets"),
}))

// Or extend your config for customization
app.Use(filesystem.New(filesystem.Config{
Root: http.Dir("./assets"),
Browse: true,
Index: "index.html",
NotFoundFile: "404.html",
MaxAge: 3600,
}))

If your environment (Go 1.16+) supports it, we recommend using Go Embed instead of the other solutions listed as this one is native to Go and the easiest to use.

embed​

Embed is the native method to embed files in a Golang excecutable. Introduced in Go 1.16.

package main

import (
"embed"
"io/fs"
"log"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)

// Embed a single file
//go:embed index.html
var f embed.FS

// Embed a directory
//go:embed static/*
var embedDirStatic embed.FS

func main() {
app := fiber.New()

app.Use("/", filesystem.New(filesystem.Config{
Root: http.FS(f),
}))

// Access file "image.png" under `static/` directory via URL: `http://<server>/static/image.png`.
// Without `PathPrefix`, you have to access it via URL:
// `http://<server>/static/static/image.png`.
app.Use("/static", filesystem.New(filesystem.Config{
Root: http.FS(embedDirStatic),
PathPrefix: "static",
Browse: true,
}))

log.Fatal(app.Listen(":3000"))
}

pkger​

https://github.com/markbates/pkger

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/markbates/pkger"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: pkger.Dir("/assets"),
}))

log.Fatal(app.Listen(":3000"))
}

packr​

https://github.com/gobuffalo/packr

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/gobuffalo/packr/v2"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: packr.New("Assets Box", "/assets"),
}))

log.Fatal(app.Listen(":3000"))
}

go.rice​

https://github.com/GeertJohan/go.rice

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/GeertJohan/go.rice"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: rice.MustFindBox("assets").HTTPBox(),
}))

log.Fatal(app.Listen(":3000"))
}

fileb0x​

https://github.com/UnnoTed/fileb0x

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"<Your go module>/myEmbeddedFiles"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: myEmbeddedFiles.HTTP,
}))

log.Fatal(app.Listen(":3000"))
}

statik​

https://github.com/rakyll/statik

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

// Use blank to invoke init function and register data to statik
_ "<Your go module>/statik"
"github.com/rakyll/statik/fs"
)

func main() {
statikFS, err := fs.New()
if err != nil {
panic(err)
}

app := fiber.New()

app.Use("/", filesystem.New(filesystem.Config{
Root: statikFS,
}))

log.Fatal(app.Listen(":3000"))
}

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Root is a FileSystem that provides access
// to a collection of files and directories.
//
// Required. Default: nil
Root http.FileSystem `json:"-"`

// PathPrefix defines a prefix to be added to a filepath when
// reading a file from the FileSystem.
//
// Use when using Go 1.16 embed.FS
//
// Optional. Default ""
PathPrefix string `json:"path_prefix"`

// Enable directory browsing.
//
// Optional. Default: false
Browse bool `json:"browse"`

// Index file for serving a directory.
//
// Optional. Default: "index.html"
Index string `json:"index"`

// The value for the Cache-Control HTTP-header
// that is set on the file response. MaxAge is defined in seconds.
//
// Optional. Default value 0.
MaxAge int `json:"max_age"`

// File to return if path is not found. Useful for SPA's.
//
// Optional. Default: ""
NotFoundFile string `json:"not_found_file"`

// The value for the Content-Type HTTP-header
// that is set on the file response
//
// Optional. Default: ""
ContentTypeCharset string `json:"content_type_charset"`
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Root: nil,
PathPrefix: "",
Browse: false,
Index: "/index.html",
MaxAge: 0,
ContentTypeCharset: "",
}
- - +
Version: Next

FileSystem

Filesystem middleware for Fiber that enables you to serve files from a directory.

caution

:params & :optionals? within the prefix path are not supported!

To handle paths with spaces (or other url encoded values) make sure to set fiber.Config{ UnescapePath: true }

Signatures​

func New(config Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)

After you initiate your Fiber app, you can use the following possibilities:

// Provide a minimal config
app.Use(filesystem.New(filesystem.Config{
Root: http.Dir("./assets"),
}))

// Or extend your config for customization
app.Use(filesystem.New(filesystem.Config{
Root: http.Dir("./assets"),
Browse: true,
Index: "index.html",
NotFoundFile: "404.html",
MaxAge: 3600,
}))

If your environment (Go 1.16+) supports it, we recommend using Go Embed instead of the other solutions listed as this one is native to Go and the easiest to use.

embed​

Embed is the native method to embed files in a Golang excecutable. Introduced in Go 1.16.

package main

import (
"embed"
"io/fs"
"log"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)

// Embed a single file
//go:embed index.html
var f embed.FS

// Embed a directory
//go:embed static/*
var embedDirStatic embed.FS

func main() {
app := fiber.New()

app.Use("/", filesystem.New(filesystem.Config{
Root: http.FS(f),
}))

// Access file "image.png" under `static/` directory via URL: `http://<server>/static/image.png`.
// Without `PathPrefix`, you have to access it via URL:
// `http://<server>/static/static/image.png`.
app.Use("/static", filesystem.New(filesystem.Config{
Root: http.FS(embedDirStatic),
PathPrefix: "static",
Browse: true,
}))

log.Fatal(app.Listen(":3000"))
}

pkger​

https://github.com/markbates/pkger

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/markbates/pkger"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: pkger.Dir("/assets"),
}))

log.Fatal(app.Listen(":3000"))
}

packr​

https://github.com/gobuffalo/packr

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/gobuffalo/packr/v2"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: packr.New("Assets Box", "/assets"),
}))

log.Fatal(app.Listen(":3000"))
}

go.rice​

https://github.com/GeertJohan/go.rice

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"github.com/GeertJohan/go.rice"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: rice.MustFindBox("assets").HTTPBox(),
}))

log.Fatal(app.Listen(":3000"))
}

fileb0x​

https://github.com/UnnoTed/fileb0x

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

"<Your go module>/myEmbeddedFiles"
)

func main() {
app := fiber.New()

app.Use("/assets", filesystem.New(filesystem.Config{
Root: myEmbeddedFiles.HTTP,
}))

log.Fatal(app.Listen(":3000"))
}

statik​

https://github.com/rakyll/statik

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"

// Use blank to invoke init function and register data to statik
_ "<Your go module>/statik"
"github.com/rakyll/statik/fs"
)

func main() {
statikFS, err := fs.New()
if err != nil {
panic(err)
}

app := fiber.New()

app.Use("/", filesystem.New(filesystem.Config{
Root: statikFS,
}))

log.Fatal(app.Listen(":3000"))
}

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Root is a FileSystem that provides access
// to a collection of files and directories.
//
// Required. Default: nil
Root http.FileSystem `json:"-"`

// PathPrefix defines a prefix to be added to a filepath when
// reading a file from the FileSystem.
//
// Use when using Go 1.16 embed.FS
//
// Optional. Default ""
PathPrefix string `json:"path_prefix"`

// Enable directory browsing.
//
// Optional. Default: false
Browse bool `json:"browse"`

// Index file for serving a directory.
//
// Optional. Default: "index.html"
Index string `json:"index"`

// The value for the Cache-Control HTTP-header
// that is set on the file response. MaxAge is defined in seconds.
//
// Optional. Default value 0.
MaxAge int `json:"max_age"`

// File to return if path is not found. Useful for SPA's.
//
// Optional. Default: ""
NotFoundFile string `json:"not_found_file"`

// The value for the Content-Type HTTP-header
// that is set on the file response
//
// Optional. Default: ""
ContentTypeCharset string `json:"content_type_charset"`
}

Default Config​

var ConfigDefault = Config{
Next: nil,
Root: nil,
PathPrefix: "",
Browse: false,
Index: "/index.html",
MaxAge: 0,
ContentTypeCharset: "",
}
+ + \ No newline at end of file diff --git a/next/api/middleware/helmet/index.html b/next/api/middleware/helmet/index.html index 87bb750785a..ff820c36719 100644 --- a/next/api/middleware/helmet/index.html +++ b/next/api/middleware/helmet/index.html @@ -6,13 +6,13 @@ Helmet | Fiber - - + +
-
Version: Next

Helmet

Helmet middleware helps secure your apps by setting various HTTP headers.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/helmet"
)

func main() {
app := fiber.New()

app.Use(helmet.New())

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome!")
})

app.Listen(":3000")
}

Test:

curl -I http://localhost:3000

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// XSSProtection
// Optional. Default value "0".
XSSProtection string

// ContentTypeNosniff
// Optional. Default value "nosniff".
ContentTypeNosniff string

// XFrameOptions
// Optional. Default value "SAMEORIGIN".
// Possible values: "SAMEORIGIN", "DENY", "ALLOW-FROM uri"
XFrameOptions string

// HSTSMaxAge
// Optional. Default value 0.
HSTSMaxAge int

// HSTSExcludeSubdomains
// Optional. Default value false.
HSTSExcludeSubdomains bool

// ContentSecurityPolicy
// Optional. Default value "".
ContentSecurityPolicy string

// CSPReportOnly
// Optional. Default value false.
CSPReportOnly bool

// HSTSPreloadEnabled
// Optional. Default value false.
HSTSPreloadEnabled bool

// ReferrerPolicy
// Optional. Default value "ReferrerPolicy".
ReferrerPolicy string

// Permissions-Policy
// Optional. Default value "".
PermissionPolicy string

// Cross-Origin-Embedder-Policy
// Optional. Default value "require-corp".
CrossOriginEmbedderPolicy string

// Cross-Origin-Opener-Policy
// Optional. Default value "same-origin".
CrossOriginOpenerPolicy string

// Cross-Origin-Resource-Policy
// Optional. Default value "same-origin".
CrossOriginResourcePolicy string

// Origin-Agent-Cluster
// Optional. Default value "?1".
OriginAgentCluster string

// X-DNS-Prefetch-Control
// Optional. Default value "off".
XDNSPrefetchControl string

// X-Download-Options
// Optional. Default value "noopen".
XDownloadOptions string

// X-Permitted-Cross-Domain-Policies
// Optional. Default value "none".
XPermittedCrossDomain string
}

Default Config​

var ConfigDefault = Config{
XSSProtection: "0",
ContentTypeNosniff: "nosniff",
XFrameOptions: "SAMEORIGIN",
ReferrerPolicy: "no-referrer",
CrossOriginEmbedderPolicy: "require-corp",
CrossOriginOpenerPolicy: "same-origin",
CrossOriginResourcePolicy: "same-origin",
OriginAgentCluster: "?1",
XDNSPrefetchControl: "off",
XDownloadOptions: "noopen",
XPermittedCrossDomain: "none",
}
- - +
Version: Next

Helmet

Helmet middleware helps secure your apps by setting various HTTP headers.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/helmet"
)

func main() {
app := fiber.New()

app.Use(helmet.New())

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome!")
})

app.Listen(":3000")
}

Test:

curl -I http://localhost:3000

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// XSSProtection
// Optional. Default value "0".
XSSProtection string

// ContentTypeNosniff
// Optional. Default value "nosniff".
ContentTypeNosniff string

// XFrameOptions
// Optional. Default value "SAMEORIGIN".
// Possible values: "SAMEORIGIN", "DENY", "ALLOW-FROM uri"
XFrameOptions string

// HSTSMaxAge
// Optional. Default value 0.
HSTSMaxAge int

// HSTSExcludeSubdomains
// Optional. Default value false.
HSTSExcludeSubdomains bool

// ContentSecurityPolicy
// Optional. Default value "".
ContentSecurityPolicy string

// CSPReportOnly
// Optional. Default value false.
CSPReportOnly bool

// HSTSPreloadEnabled
// Optional. Default value false.
HSTSPreloadEnabled bool

// ReferrerPolicy
// Optional. Default value "ReferrerPolicy".
ReferrerPolicy string

// Permissions-Policy
// Optional. Default value "".
PermissionPolicy string

// Cross-Origin-Embedder-Policy
// Optional. Default value "require-corp".
CrossOriginEmbedderPolicy string

// Cross-Origin-Opener-Policy
// Optional. Default value "same-origin".
CrossOriginOpenerPolicy string

// Cross-Origin-Resource-Policy
// Optional. Default value "same-origin".
CrossOriginResourcePolicy string

// Origin-Agent-Cluster
// Optional. Default value "?1".
OriginAgentCluster string

// X-DNS-Prefetch-Control
// Optional. Default value "off".
XDNSPrefetchControl string

// X-Download-Options
// Optional. Default value "noopen".
XDownloadOptions string

// X-Permitted-Cross-Domain-Policies
// Optional. Default value "none".
XPermittedCrossDomain string
}

Default Config​

var ConfigDefault = Config{
XSSProtection: "0",
ContentTypeNosniff: "nosniff",
XFrameOptions: "SAMEORIGIN",
ReferrerPolicy: "no-referrer",
CrossOriginEmbedderPolicy: "require-corp",
CrossOriginOpenerPolicy: "same-origin",
CrossOriginResourcePolicy: "same-origin",
OriginAgentCluster: "?1",
XDNSPrefetchControl: "off",
XDownloadOptions: "noopen",
XPermittedCrossDomain: "none",
}
+ + \ No newline at end of file diff --git a/next/api/middleware/idempotency/index.html b/next/api/middleware/idempotency/index.html index 8c06594ee46..37fa4d8635f 100644 --- a/next/api/middleware/idempotency/index.html +++ b/next/api/middleware/idempotency/index.html @@ -6,13 +6,13 @@ Idempotency | Fiber - - + +
-
Version: Next

Idempotency

Idempotency middleware for Fiber allows for fault-tolerant APIs where duplicate requests β€” for example due to networking issues on the client-side β€” do not erroneously cause the same action performed multiple times on the server-side.

Refer to https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02 for a better understanding.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/idempotency"
)

After you initiate your Fiber app, you can use the following possibilities:

Default Config​

app.Use(idempotency.New())

Custom Config​

app.Use(idempotency.New(idempotency.Config{
Lifetime: 42 * time.Minute,
// ...
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: a function which skips the middleware on safe HTTP request method.
Next func(c *fiber.Ctx) bool

// Lifetime is the maximum lifetime of an idempotency key.
//
// Optional. Default: 30 * time.Minute
Lifetime time.Duration

// KeyHeader is the name of the header that contains the idempotency key.
//
// Optional. Default: X-Idempotency-Key
KeyHeader string
// KeyHeaderValidate defines a function to validate the syntax of the idempotency header.
//
// Optional. Default: a function which ensures the header is 36 characters long (the size of an UUID).
KeyHeaderValidate func(string) error

// KeepResponseHeaders is a list of headers that should be kept from the original response.
//
// Optional. Default: nil (to keep all headers)
KeepResponseHeaders []string

// Lock locks an idempotency key.
//
// Optional. Default: an in-memory locker for this process only.
Lock Locker

// Storage stores response data by idempotency key.
//
// Optional. Default: an in-memory storage for this process only.
Storage fiber.Storage
}

Default Config​

var ConfigDefault = Config{
Next: func(c *fiber.Ctx) bool {
// Skip middleware if the request was done using a safe HTTP method
return fiber.IsMethodSafe(c.Method())
},

Lifetime: 30 * time.Minute,

KeyHeader: "X-Idempotency-Key",
KeyHeaderValidate: func(k string) error {
if l, wl := len(k), 36; l != wl { // UUID length is 36 chars
return fmt.Errorf("%w: invalid length: %d != %d", ErrInvalidIdempotencyKey, l, wl)
}

return nil
},

KeepResponseHeaders: nil,

Lock: nil, // Set in configDefault so we don't allocate data here.

Storage: nil, // Set in configDefault so we don't allocate data here.
}
- - +
Version: Next

Idempotency

Idempotency middleware for Fiber allows for fault-tolerant APIs where duplicate requests β€” for example due to networking issues on the client-side β€” do not erroneously cause the same action performed multiple times on the server-side.

Refer to https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02 for a better understanding.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/idempotency"
)

After you initiate your Fiber app, you can use the following possibilities:

Default Config​

app.Use(idempotency.New())

Custom Config​

app.Use(idempotency.New(idempotency.Config{
Lifetime: 42 * time.Minute,
// ...
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: a function which skips the middleware on safe HTTP request method.
Next func(c *fiber.Ctx) bool

// Lifetime is the maximum lifetime of an idempotency key.
//
// Optional. Default: 30 * time.Minute
Lifetime time.Duration

// KeyHeader is the name of the header that contains the idempotency key.
//
// Optional. Default: X-Idempotency-Key
KeyHeader string
// KeyHeaderValidate defines a function to validate the syntax of the idempotency header.
//
// Optional. Default: a function which ensures the header is 36 characters long (the size of an UUID).
KeyHeaderValidate func(string) error

// KeepResponseHeaders is a list of headers that should be kept from the original response.
//
// Optional. Default: nil (to keep all headers)
KeepResponseHeaders []string

// Lock locks an idempotency key.
//
// Optional. Default: an in-memory locker for this process only.
Lock Locker

// Storage stores response data by idempotency key.
//
// Optional. Default: an in-memory storage for this process only.
Storage fiber.Storage
}

Default Config​

var ConfigDefault = Config{
Next: func(c *fiber.Ctx) bool {
// Skip middleware if the request was done using a safe HTTP method
return fiber.IsMethodSafe(c.Method())
},

Lifetime: 30 * time.Minute,

KeyHeader: "X-Idempotency-Key",
KeyHeaderValidate: func(k string) error {
if l, wl := len(k), 36; l != wl { // UUID length is 36 chars
return fmt.Errorf("%w: invalid length: %d != %d", ErrInvalidIdempotencyKey, l, wl)
}

return nil
},

KeepResponseHeaders: nil,

Lock: nil, // Set in configDefault so we don't allocate data here.

Storage: nil, // Set in configDefault so we don't allocate data here.
}
+ + \ No newline at end of file diff --git a/next/api/middleware/keyauth/index.html b/next/api/middleware/keyauth/index.html index 5e73bdabd78..dd1b3fce71a 100644 --- a/next/api/middleware/keyauth/index.html +++ b/next/api/middleware/keyauth/index.html @@ -6,13 +6,13 @@ Keyauth | Fiber - - + +
-
Version: Next

Keyauth

Key auth middleware provides a key based authentication.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
)

var (
apiKey = "correct horse battery staple"
)

func validateAPIKey(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
}

func main() {
app := fiber.New()

// note that the keyauth middleware needs to be defined before the routes are defined!
app.Use(keyauth.New(keyauth.Config{
KeyLookup: "cookie:access_token",
Validator: validateAPIKey,
}))

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})

app.Listen(":3000")
}

Test:

# No api-key specified -> 400 missing 
curl http://localhost:3000
#> missing or malformed API Key

curl --cookie "access_token=correct horse battery staple" http://localhost:3000
#> Successfully authenticated!

curl --cookie "access_token=Clearly A Wrong Key" http://localhost:3000
#> missing or malformed API Key

For a more detailed example, see also the github.com/gofiber/recipes repository and specifically the fiber-envoy-extauthz repository and the keyauth example code.

Authenticate only certain endpoints​

If you want to authenticate only certain endpoints, you can use the Config of keyauth and apply a filter function (eg. authFilter) like so

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
"regexp"
"strings"
)

var (
apiKey = "correct horse battery staple"
protectedURLs = []*regexp.Regexp{
regexp.MustCompile("^/authenticated$"),
regexp.MustCompile("^/auth2$"),
}
)

func validateAPIKey(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
}

func authFilter(c *fiber.Ctx) bool {
originalURL := strings.ToLower(c.OriginalURL())

for _, pattern := range protectedURLs {
if pattern.MatchString(originalURL) {
return false
}
}
return true
}

func main() {
app := fiber.New()

app.Use(keyauth.New(keyauth.Config{
Next: authFilter,
KeyLookup: "cookie:access_token",
Validator: validateAPIKey,
}))

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome")
})
app.Get("/authenticated", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})
app.Get("/auth2", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated 2!")
})

app.Listen(":3000")
}

Which results in this

# / does not need to be authenticated
curl http://localhost:3000
#> Welcome

# /authenticated needs to be authenticated
curl --cookie "access_token=correct horse battery staple" http://localhost:3000/authenticated
#> Successfully authenticated!

# /auth2 needs to be authenticated too
curl --cookie "access_token=correct horse battery staple" http://localhost:3000/auth2
#> Successfully authenticated 2!

Specifying middleware in the handler​

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
)

const (
apiKey = "my-super-secret-key"
)

func main() {
app := fiber.New()

authMiddleware := keyauth.New(keyauth.Config{
Validator: func(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
},
})

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome")
})

app.Get("/allowed", authMiddleware, func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})

app.Listen(":3000")
}

Which results in this

# / does not need to be authenticated
curl http://localhost:3000
#> Welcome

# /allowed needs to be authenticated too
curl --header "Authorization: Bearer my-super-secret-key" http://localhost:3000/allowed
#> Successfully authenticated!

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// SuccessHandler defines a function which is executed for a valid key.
// Optional. Default: nil
SuccessHandler fiber.Handler

// ErrorHandler defines a function which is executed for an invalid key.
// It may be used to define a custom error.
// Optional. Default: 401 Invalid or expired key
ErrorHandler fiber.ErrorHandler

// KeyLookup is a string in the form of "<source>:<name>" that is used
// to extract key from the request.
// Optional. Default value "header:Authorization".
// Possible values:
// - "header:<name>"
// - "query:<name>"
// - "form:<name>"
// - "param:<name>"
// - "cookie:<name>"
KeyLookup string

// AuthScheme to be used in the Authorization header.
// Optional. Default value "Bearer".
AuthScheme string

// Validator is a function to validate key.
Validator func(*fiber.Ctx, string) (bool, error)

// Context key to store the bearertoken from the token into context.
// Optional. Default: "token".
ContextKey string
}

Default Config​

var ConfigDefault = Config{
SuccessHandler: func(c *fiber.Ctx) error {
return c.Next()
},
ErrorHandler: func(c *fiber.Ctx, err error) error {
if err == ErrMissingOrMalformedAPIKey {
return c.Status(fiber.StatusUnauthorized).SendString(err.Error())
}
return c.Status(fiber.StatusUnauthorized).SendString("Invalid or expired API Key")
},
KeyLookup: "header:" + fiber.HeaderAuthorization,
AuthScheme: "Bearer",
ContextKey: "token",
}
- - +
Version: Next

Keyauth

Key auth middleware provides a key based authentication.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
)

var (
apiKey = "correct horse battery staple"
)

func validateAPIKey(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
}

func main() {
app := fiber.New()

// note that the keyauth middleware needs to be defined before the routes are defined!
app.Use(keyauth.New(keyauth.Config{
KeyLookup: "cookie:access_token",
Validator: validateAPIKey,
}))

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})

app.Listen(":3000")
}

Test:

# No api-key specified -> 400 missing 
curl http://localhost:3000
#> missing or malformed API Key

curl --cookie "access_token=correct horse battery staple" http://localhost:3000
#> Successfully authenticated!

curl --cookie "access_token=Clearly A Wrong Key" http://localhost:3000
#> missing or malformed API Key

For a more detailed example, see also the github.com/gofiber/recipes repository and specifically the fiber-envoy-extauthz repository and the keyauth example code.

Authenticate only certain endpoints​

If you want to authenticate only certain endpoints, you can use the Config of keyauth and apply a filter function (eg. authFilter) like so

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
"regexp"
"strings"
)

var (
apiKey = "correct horse battery staple"
protectedURLs = []*regexp.Regexp{
regexp.MustCompile("^/authenticated$"),
regexp.MustCompile("^/auth2$"),
}
)

func validateAPIKey(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
}

func authFilter(c *fiber.Ctx) bool {
originalURL := strings.ToLower(c.OriginalURL())

for _, pattern := range protectedURLs {
if pattern.MatchString(originalURL) {
return false
}
}
return true
}

func main() {
app := fiber.New()

app.Use(keyauth.New(keyauth.Config{
Next: authFilter,
KeyLookup: "cookie:access_token",
Validator: validateAPIKey,
}))

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome")
})
app.Get("/authenticated", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})
app.Get("/auth2", func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated 2!")
})

app.Listen(":3000")
}

Which results in this

# / does not need to be authenticated
curl http://localhost:3000
#> Welcome

# /authenticated needs to be authenticated
curl --cookie "access_token=correct horse battery staple" http://localhost:3000/authenticated
#> Successfully authenticated!

# /auth2 needs to be authenticated too
curl --cookie "access_token=correct horse battery staple" http://localhost:3000/auth2
#> Successfully authenticated 2!

Specifying middleware in the handler​

package main

import (
"crypto/sha256"
"crypto/subtle"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/keyauth"
)

const (
apiKey = "my-super-secret-key"
)

func main() {
app := fiber.New()

authMiddleware := keyauth.New(keyauth.Config{
Validator: func(c *fiber.Ctx, key string) (bool, error) {
hashedAPIKey := sha256.Sum256([]byte(apiKey))
hashedKey := sha256.Sum256([]byte(key))

if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 {
return true, nil
}
return false, keyauth.ErrMissingOrMalformedAPIKey
},
})

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Welcome")
})

app.Get("/allowed", authMiddleware, func(c *fiber.Ctx) error {
return c.SendString("Successfully authenticated!")
})

app.Listen(":3000")
}

Which results in this

# / does not need to be authenticated
curl http://localhost:3000
#> Welcome

# /allowed needs to be authenticated too
curl --header "Authorization: Bearer my-super-secret-key" http://localhost:3000/allowed
#> Successfully authenticated!

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// SuccessHandler defines a function which is executed for a valid key.
// Optional. Default: nil
SuccessHandler fiber.Handler

// ErrorHandler defines a function which is executed for an invalid key.
// It may be used to define a custom error.
// Optional. Default: 401 Invalid or expired key
ErrorHandler fiber.ErrorHandler

// KeyLookup is a string in the form of "<source>:<name>" that is used
// to extract key from the request.
// Optional. Default value "header:Authorization".
// Possible values:
// - "header:<name>"
// - "query:<name>"
// - "form:<name>"
// - "param:<name>"
// - "cookie:<name>"
KeyLookup string

// AuthScheme to be used in the Authorization header.
// Optional. Default value "Bearer".
AuthScheme string

// Validator is a function to validate key.
Validator func(*fiber.Ctx, string) (bool, error)

// Context key to store the bearertoken from the token into context.
// Optional. Default: "token".
ContextKey string
}

Default Config​

var ConfigDefault = Config{
SuccessHandler: func(c *fiber.Ctx) error {
return c.Next()
},
ErrorHandler: func(c *fiber.Ctx, err error) error {
if err == ErrMissingOrMalformedAPIKey {
return c.Status(fiber.StatusUnauthorized).SendString(err.Error())
}
return c.Status(fiber.StatusUnauthorized).SendString("Invalid or expired API Key")
},
KeyLookup: "header:" + fiber.HeaderAuthorization,
AuthScheme: "Bearer",
ContextKey: "token",
}
+ + \ No newline at end of file diff --git a/next/api/middleware/limiter/index.html b/next/api/middleware/limiter/index.html index 36b837c0cb7..ddaf2cef564 100644 --- a/next/api/middleware/limiter/index.html +++ b/next/api/middleware/limiter/index.html @@ -6,13 +6,13 @@ Limiter | Fiber - - + +
-
Version: Next

Limiter

Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

note

This module does not share state with other processes/servers by default.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/limiter"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(limiter.New())

// Or extend your config for customization
app.Use(limiter.New(limiter.Config{
Next: func(c *fiber.Ctx) bool {
return c.IP() == "127.0.0.1"
},
Max: 20,
Expiration: 30 * time.Second,
KeyGenerator: func(c *fiber.Ctx) string {
return c.Get("x-forwarded-for")
},
LimitReached: func(c *fiber.Ctx) error {
return c.SendFile("./toofast.html")
},
Storage: myCustomStorage{},
}))

Sliding window​

Instead of using the standard fixed window algorithm, you can enable the sliding window algorithm.

A example of such configuration is:

app.Use(limiter.New(limiter.Config{
Max: 20,
Expiration: 30 * time.Second,
LimiterMiddleware: limiter.SlidingWindow{},
}))

This means that every window will take into account the previous window(if there was any). The given formula for the rate is:

weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration)
rate = weightOfPreviousWindpw + current window's amount request.

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Max number of recent connections during `Duration` seconds before sending a 429 response
//
// Default: 5
Max int

// KeyGenerator allows you to generate custom keys, by default c.IP() is used
//
// Default: func(c *fiber.Ctx) string {
// return c.IP()
// }
KeyGenerator func(*fiber.Ctx) string

// Expiration is the time on how long to keep records of requests in memory
//
// Default: 1 * time.Minute
Expiration time.Duration

// LimitReached is called when a request hits the limit
//
// Default: func(c *fiber.Ctx) error {
// return c.SendStatus(fiber.StatusTooManyRequests)
// }
LimitReached fiber.Handler

// When set to true, requests with StatusCode >= 400 won't be counted.
//
// Default: false
SkipFailedRequests bool

// When set to true, requests with StatusCode < 400 won't be counted.
//
// Default: false
SkipSuccessfulRequests bool

// Store is used to store the state of the middleware
//
// Default: an in memory store for this process only
Storage fiber.Storage

// LimiterMiddleware is the struct that implements limiter middleware.
//
// Default: a new Fixed Window Rate Limiter
LimiterMiddleware LimiterHandler
}
note

A custom store can be used if it implements the Storage interface - more details and an example can be found in store.go.

Default Config​

var ConfigDefault = Config{
Max: 5,
Expiration: 1 * time.Minute,
KeyGenerator: func(c *fiber.Ctx) string {
return c.IP()
},
LimitReached: func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusTooManyRequests)
},
SkipFailedRequests: false,
SkipSuccessfulRequests: false,
LimiterMiddleware: FixedWindow{},
}

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
app.Use(limiter.New(limiter.Config{
Storage: storage,
}))
- - +
Version: Next

Limiter

Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

note

This module does not share state with other processes/servers by default.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/limiter"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(limiter.New())

// Or extend your config for customization
app.Use(limiter.New(limiter.Config{
Next: func(c *fiber.Ctx) bool {
return c.IP() == "127.0.0.1"
},
Max: 20,
Expiration: 30 * time.Second,
KeyGenerator: func(c *fiber.Ctx) string {
return c.Get("x-forwarded-for")
},
LimitReached: func(c *fiber.Ctx) error {
return c.SendFile("./toofast.html")
},
Storage: myCustomStorage{},
}))

Sliding window​

Instead of using the standard fixed window algorithm, you can enable the sliding window algorithm.

A example of such configuration is:

app.Use(limiter.New(limiter.Config{
Max: 20,
Expiration: 30 * time.Second,
LimiterMiddleware: limiter.SlidingWindow{},
}))

This means that every window will take into account the previous window(if there was any). The given formula for the rate is:

weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration)
rate = weightOfPreviousWindpw + current window's amount request.

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Max number of recent connections during `Duration` seconds before sending a 429 response
//
// Default: 5
Max int

// KeyGenerator allows you to generate custom keys, by default c.IP() is used
//
// Default: func(c *fiber.Ctx) string {
// return c.IP()
// }
KeyGenerator func(*fiber.Ctx) string

// Expiration is the time on how long to keep records of requests in memory
//
// Default: 1 * time.Minute
Expiration time.Duration

// LimitReached is called when a request hits the limit
//
// Default: func(c *fiber.Ctx) error {
// return c.SendStatus(fiber.StatusTooManyRequests)
// }
LimitReached fiber.Handler

// When set to true, requests with StatusCode >= 400 won't be counted.
//
// Default: false
SkipFailedRequests bool

// When set to true, requests with StatusCode < 400 won't be counted.
//
// Default: false
SkipSuccessfulRequests bool

// Store is used to store the state of the middleware
//
// Default: an in memory store for this process only
Storage fiber.Storage

// LimiterMiddleware is the struct that implements limiter middleware.
//
// Default: a new Fixed Window Rate Limiter
LimiterMiddleware LimiterHandler
}
note

A custom store can be used if it implements the Storage interface - more details and an example can be found in store.go.

Default Config​

var ConfigDefault = Config{
Max: 5,
Expiration: 1 * time.Minute,
KeyGenerator: func(c *fiber.Ctx) string {
return c.IP()
},
LimitReached: func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusTooManyRequests)
},
SkipFailedRequests: false,
SkipSuccessfulRequests: false,
LimiterMiddleware: FixedWindow{},
}

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
app.Use(limiter.New(limiter.Config{
Storage: storage,
}))
+ + \ No newline at end of file diff --git a/next/api/middleware/logger/index.html b/next/api/middleware/logger/index.html index 3e58642ef16..44ba8ad638e 100644 --- a/next/api/middleware/logger/index.html +++ b/next/api/middleware/logger/index.html @@ -6,14 +6,14 @@ Logger | Fiber - - + +
Version: Next

Logger

Logger middleware for Fiber that logs HTTP request/response details.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
)
tip

The order of registration plays a role. Only all routes that are registered after this one will be logged. -The middleware should therefore be one of the first to be registered.

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(logger.New())

// Or extend your config for customization
// Logging remote IP and Port
app.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))

// Logging Request ID
app.Use(requestid.New())
app.Use(logger.New(logger.Config{
// For more options, see the Config section
Format: "${pid} ${locals:requestid} ${status} - ${method} ${path}​\n",
}))

// Changing TimeZone & TimeFormat
app.Use(logger.New(logger.Config{
Format: "${pid} ${status} - ${method} ${path}\n",
TimeFormat: "02-Jan-2006",
TimeZone: "America/New_York",
}))

// Custom File Writer
file, err := os.OpenFile("./123.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
log.Fatalf("error opening file: %v", err)
}
defer file.Close()
app.Use(logger.New(logger.Config{
Output: file,
}))

// Add Custom Tags
app.Use(logger.New(logger.Config{
CustomTags: map[string]logger.LogFunc{
"custom_tag": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) {
return output.WriteString("it is a custom tag")
},
},
}))

// Callback after log is written
app.Use(logger.New(logger.Config{
TimeFormat: time.RFC3339Nano,
TimeZone: "Asia/Shanghai",
Done: func(c *fiber.Ctx, logString []byte) {
if c.Response().StatusCode() != fiber.StatusOK {
reporter.SendToSlack(logString)
}
},
}))

// Disable colors when outputting to default format
app.Use(logger.New(logger.Config{
DisableColors: true,
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Done is a function that is called after the log string for a request is written to Output,
// and pass the log string as parameter.
//
// Optional. Default: nil
Done func(c *fiber.Ctx, logString []byte)

// tagFunctions defines the custom tag action
//
// Optional. Default: map[string]LogFunc
CustomTags map[string]LogFunc

// Format defines the logging tags
//
// Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\n
Format string

// TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html
//
// Optional. Default: 15:04:05
TimeFormat string

// TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc
//
// Optional. Default: "Local"
TimeZone string

// TimeInterval is the delay before the timestamp is updated
//
// Optional. Default: 500 * time.Millisecond
TimeInterval time.Duration

// Output is a writer where logs are written
//
// Default: os.Stdout
Output io.Writer

// DisableColors defines if the logs output should be colorized
//
// Default: false
DisableColors bool

enableColors bool
enableLatency bool
timeZoneLocation *time.Location
}
type LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)

Default Config​

var ConfigDefault = Config{
Next: nil,
Done: nil,
Format: "[${time}] ${status} - ${latency} ${method} ${path}\n",
TimeFormat: "15:04:05",
TimeZone: "Local",
TimeInterval: 500 * time.Millisecond,
Output: os.Stdout,
DisableColors: false,
}

Constants​

// Logger variables
const (
TagPid = "pid"
TagTime = "time"
TagReferer = "referer"
TagProtocol = "protocol"
TagPort = "port"
TagIP = "ip"
TagIPs = "ips"
TagHost = "host"
TagMethod = "method"
TagPath = "path"
TagURL = "url"
TagUA = "ua"
TagLatency = "latency"
TagStatus = "status" // response status
TagResBody = "resBody" // response body
TagReqHeaders = "reqHeaders"
TagQueryStringParams = "queryParams" // request query parameters
TagBody = "body" // request body
TagBytesSent = "bytesSent"
TagBytesReceived = "bytesReceived"
TagRoute = "route"
TagError = "error"
// DEPRECATED: Use TagReqHeader instead
TagHeader = "header:" // request header
TagReqHeader = "reqHeader:" // request header
TagRespHeader = "respHeader:" // response header
TagQuery = "query:" // request query
TagForm = "form:" // request form
TagCookie = "cookie:" // request cookie
TagLocals = "locals:"
// colors
TagBlack = "black"
TagRed = "red"
TagGreen = "green"
TagYellow = "yellow"
TagBlue = "blue"
TagMagenta = "magenta"
TagCyan = "cyan"
TagWhite = "white"
TagReset = "reset"
)
- - +The middleware should therefore be one of the first to be registered.

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(logger.New())

// Or extend your config for customization
// Logging remote IP and Port
app.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))

// Logging Request ID
app.Use(requestid.New())
app.Use(logger.New(logger.Config{
// For more options, see the Config section
Format: "${pid} ${locals:requestid} ${status} - ${method} ${path}​\n",
}))

// Changing TimeZone & TimeFormat
app.Use(logger.New(logger.Config{
Format: "${pid} ${status} - ${method} ${path}\n",
TimeFormat: "02-Jan-2006",
TimeZone: "America/New_York",
}))

// Custom File Writer
file, err := os.OpenFile("./123.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
log.Fatalf("error opening file: %v", err)
}
defer file.Close()
app.Use(logger.New(logger.Config{
Output: file,
}))

// Add Custom Tags
app.Use(logger.New(logger.Config{
CustomTags: map[string]logger.LogFunc{
"custom_tag": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) {
return output.WriteString("it is a custom tag")
},
},
}))

// Callback after log is written
app.Use(logger.New(logger.Config{
TimeFormat: time.RFC3339Nano,
TimeZone: "Asia/Shanghai",
Done: func(c *fiber.Ctx, logString []byte) {
if c.Response().StatusCode() != fiber.StatusOK {
reporter.SendToSlack(logString)
}
},
}))

// Disable colors when outputting to default format
app.Use(logger.New(logger.Config{
DisableColors: true,
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Done is a function that is called after the log string for a request is written to Output,
// and pass the log string as parameter.
//
// Optional. Default: nil
Done func(c *fiber.Ctx, logString []byte)

// tagFunctions defines the custom tag action
//
// Optional. Default: map[string]LogFunc
CustomTags map[string]LogFunc

// Format defines the logging tags
//
// Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\n
Format string

// TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html
//
// Optional. Default: 15:04:05
TimeFormat string

// TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc
//
// Optional. Default: "Local"
TimeZone string

// TimeInterval is the delay before the timestamp is updated
//
// Optional. Default: 500 * time.Millisecond
TimeInterval time.Duration

// Output is a writer where logs are written
//
// Default: os.Stdout
Output io.Writer

// DisableColors defines if the logs output should be colorized
//
// Default: false
DisableColors bool

enableColors bool
enableLatency bool
timeZoneLocation *time.Location
}
type LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)

Default Config​

var ConfigDefault = Config{
Next: nil,
Done: nil,
Format: "[${time}] ${status} - ${latency} ${method} ${path}\n",
TimeFormat: "15:04:05",
TimeZone: "Local",
TimeInterval: 500 * time.Millisecond,
Output: os.Stdout,
DisableColors: false,
}

Constants​

// Logger variables
const (
TagPid = "pid"
TagTime = "time"
TagReferer = "referer"
TagProtocol = "protocol"
TagPort = "port"
TagIP = "ip"
TagIPs = "ips"
TagHost = "host"
TagMethod = "method"
TagPath = "path"
TagURL = "url"
TagUA = "ua"
TagLatency = "latency"
TagStatus = "status" // response status
TagResBody = "resBody" // response body
TagReqHeaders = "reqHeaders"
TagQueryStringParams = "queryParams" // request query parameters
TagBody = "body" // request body
TagBytesSent = "bytesSent"
TagBytesReceived = "bytesReceived"
TagRoute = "route"
TagError = "error"
// DEPRECATED: Use TagReqHeader instead
TagHeader = "header:" // request header
TagReqHeader = "reqHeader:" // request header
TagRespHeader = "respHeader:" // response header
TagQuery = "query:" // request query
TagForm = "form:" // request form
TagCookie = "cookie:" // request cookie
TagLocals = "locals:"
// colors
TagBlack = "black"
TagRed = "red"
TagGreen = "green"
TagYellow = "yellow"
TagBlue = "blue"
TagMagenta = "magenta"
TagCyan = "cyan"
TagWhite = "white"
TagReset = "reset"
)
+ + \ No newline at end of file diff --git a/next/api/middleware/monitor/index.html b/next/api/middleware/monitor/index.html index 76916320a97..5404e135380 100644 --- a/next/api/middleware/monitor/index.html +++ b/next/api/middleware/monitor/index.html @@ -6,14 +6,14 @@ Monitor | Fiber - - + +
Version: Next

Monitor

Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor

caution

Monitor is still in beta, API might change in the future!

Signatures​

func New() fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/monitor"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config (Assign the middleware to /metrics)
app.Get("/metrics", monitor.New())

// Or extend your config for customization
// Assign the middleware to /metrics
// and change the Title to `MyService Metrics Page`
app.Get("/metrics", monitor.New(monitor.Config{Title: "MyService Metrics Page"}))

You can also access the API endpoint with -curl -X GET -H "Accept: application/json" http://localhost:3000/metrics which returns:

{"pid":{ "cpu":0.4568381746582226, "ram":20516864,   "conns":3 },
"os": { "cpu":8.759124087593099, "ram":3997155328, "conns":44,
"total_ram":8245489664, "load_avg":0.51 }}

Config​

// Config defines the config for middleware.
type Config struct {
// Metrics page title
//
// Optional. Default: "Fiber Monitor"
Title string

// Refresh period
//
// Optional. Default: 3 seconds
Refresh time.Duration

// Whether the service should expose only the monitoring API.
//
// Optional. Default: false
APIOnly bool

// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Custom HTML Code to Head Section(Before End)
//
// Optional. Default: empty
CustomHead string

// FontURL for specify font resource path or URL . also you can use relative path
//
// Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap
FontURL string

// ChartJsURL for specify ChartJS library path or URL . also you can use relative path
//
// Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js
ChartJsURL string

index string
}

Default Config​

var ConfigDefault = Config{
Title: defaultTitle,
Refresh: defaultRefresh,
FontURL: defaultFontURL,
ChartJsURL: defaultChartJSURL,
CustomHead: defaultCustomHead,
APIOnly: false,
Next: nil,
index: newIndex(viewBag{
defaultTitle,
defaultRefresh,
defaultFontURL,
defaultChartJSURL,
defaultCustomHead,
}),
}
- - +curl -X GET -H "Accept: application/json" http://localhost:3000/metrics which returns:

{"pid":{ "cpu":0.4568381746582226, "ram":20516864,   "conns":3 },
"os": { "cpu":8.759124087593099, "ram":3997155328, "conns":44,
"total_ram":8245489664, "load_avg":0.51 }}

Config​

// Config defines the config for middleware.
type Config struct {
// Metrics page title
//
// Optional. Default: "Fiber Monitor"
Title string

// Refresh period
//
// Optional. Default: 3 seconds
Refresh time.Duration

// Whether the service should expose only the monitoring API.
//
// Optional. Default: false
APIOnly bool

// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Custom HTML Code to Head Section(Before End)
//
// Optional. Default: empty
CustomHead string

// FontURL for specify font resource path or URL . also you can use relative path
//
// Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap
FontURL string

// ChartJsURL for specify ChartJS library path or URL . also you can use relative path
//
// Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js
ChartJsURL string

index string
}

Default Config​

var ConfigDefault = Config{
Title: defaultTitle,
Refresh: defaultRefresh,
FontURL: defaultFontURL,
ChartJsURL: defaultChartJSURL,
CustomHead: defaultCustomHead,
APIOnly: false,
Next: nil,
index: newIndex(viewBag{
defaultTitle,
defaultRefresh,
defaultFontURL,
defaultChartJSURL,
defaultCustomHead,
}),
}
+ + \ No newline at end of file diff --git a/next/api/middleware/pprof/index.html b/next/api/middleware/pprof/index.html index 11d49921576..742b772b25e 100644 --- a/next/api/middleware/pprof/index.html +++ b/next/api/middleware/pprof/index.html @@ -6,13 +6,13 @@ Pprof | Fiber - - + +
-
Version: Next

Pprof

Pprof middleware for Fiber that serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/.

Signatures​

func New() fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/pprof"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(pprof.New())

// Or extend your config for customization

// For example, in systems where you have multiple ingress endpoints, it is common to add a URL prefix, like so:
app.Use(pprof.New(pprof.Config{Prefix: "/endpoint-prefix"}))

// This prefix will be added to the default path of "/debug/pprof/", for a resulting URL of: "/endpoint-prefix/debug/pprof/".

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Prefix defines a URL prefix added before "/debug/pprof".
// Note that it should start with (but not end with) a slash.
// Example: "/federated-fiber"
//
// Optional. Default: ""
Prefix string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
}
- - +
Version: Next

Pprof

Pprof middleware for Fiber that serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/.

Signatures​

func New() fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/pprof"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(pprof.New())

// Or extend your config for customization

// For example, in systems where you have multiple ingress endpoints, it is common to add a URL prefix, like so:
app.Use(pprof.New(pprof.Config{Prefix: "/endpoint-prefix"}))

// This prefix will be added to the default path of "/debug/pprof/", for a resulting URL of: "/endpoint-prefix/debug/pprof/".

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Prefix defines a URL prefix added before "/debug/pprof".
// Note that it should start with (but not end with) a slash.
// Example: "/federated-fiber"
//
// Optional. Default: ""
Prefix string
}

Default Config​

var ConfigDefault = Config{
Next: nil,
}
+ + \ No newline at end of file diff --git a/next/api/middleware/proxy/index.html b/next/api/middleware/proxy/index.html index ed35bd8dab1..83ace9c22c4 100644 --- a/next/api/middleware/proxy/index.html +++ b/next/api/middleware/proxy/index.html @@ -6,13 +6,13 @@ Proxy | Fiber - - + +
-
Version: Next

Proxy

Proxy middleware for Fiber that allows you to proxy requests to multiple servers.

Signatures​

// Balancer create a load balancer among multiple upstrem servers.
func Balancer(config Config) fiber.Handler
// Forward performs the given http request and fills the given http response.
func Forward(addr string, clients ...*fasthttp.Client) fiber.Handler
// Do performs the given http request and fills the given http response.
func Do(c *fiber.Ctx, addr string, clients ...*fasthttp.Client) error
// DoRedirects performs the given http request and fills the given http response while following up to maxRedirectsCount redirects.
func DoRedirects(c *fiber.Ctx, addr string, maxRedirectsCount int, clients ...*fasthttp.Client) error
// DoDeadline performs the given request and waits for response until the given deadline.
func DoDeadline(c *fiber.Ctx, addr string, deadline time.Time, clients ...*fasthttp.Client) error
// DoTimeout performs the given request and waits for response during the given timeout duration.
func DoTimeout(c *fiber.Ctx, addr string, timeout time.Duration, clients ...*fasthttp.Client) error
// DomainForward the given http request based on the given domain and fills the given http response
func DomainForward(hostname string, addr string, clients ...*fasthttp.Client) fiber.Handler
// BalancerForward performs the given http request based round robin balancer and fills the given http response
func BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/proxy"
)

After you initiate your Fiber app, you can use the following possibilities:

// if target https site uses a self-signed certificate, you should
// call WithTlsConfig before Do and Forward
proxy.WithTlsConfig(&tls.Config{
InsecureSkipVerify: true,
})
// if you need to use global self-custom client, you should use proxy.WithClient.
proxy.WithClient(&fasthttp.Client{
NoDefaultUserAgentHeader: true,
DisablePathNormalizing: true,
})

// Forward to url
app.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif"))

// If you want to forward with a specific domain. You have to use proxy.DomainForward.
app.Get("/payments", proxy.DomainForward("docs.gofiber.io", "http://localhost:8000"))

// Forward to url with local custom client
app.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif", &fasthttp.Client{
NoDefaultUserAgentHeader: true,
DisablePathNormalizing: true,
}))

// Make request within handler
app.Get("/:id", func(c *fiber.Ctx) error {
url := "https://i.imgur.com/"+c.Params("id")+".gif"
if err := proxy.Do(c, url); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests while following redirects
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoRedirects(c, "http://google.com", 3); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests and wait up to 5 seconds before timing out
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoTimeout(c, "http://localhost:3000", time.Second * 5); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests, timeout a minute from now
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoDeadline(c, "http://localhost", time.Now().Add(time.Minute)); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Minimal round robin balancer
app.Use(proxy.Balancer(proxy.Config{
Servers: []string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
},
}))

// Or extend your balancer for customization
app.Use(proxy.Balancer(proxy.Config{
Servers: []string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
},
ModifyRequest: func(c *fiber.Ctx) error {
c.Request().Header.Add("X-Real-IP", c.IP())
return nil
},
ModifyResponse: func(c *fiber.Ctx) error {
c.Response().Header.Del(fiber.HeaderServer)
return nil
},
}))

// Or this way if the balancer is using https and the destination server is only using http.
app.Use(proxy.BalancerForward([]string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Servers defines a list of <scheme>://<host> HTTP servers,
//
// which are used in a round-robin manner.
// i.e.: "https://foobar.com, http://www.foobar.com"
//
// Required
Servers []string

// ModifyRequest allows you to alter the request
//
// Optional. Default: nil
ModifyRequest fiber.Handler

// ModifyResponse allows you to alter the response
//
// Optional. Default: nil
ModifyResponse fiber.Handler

// Timeout is the request timeout used when calling the proxy client
//
// Optional. Default: 1 second
Timeout time.Duration

// Per-connection buffer size for requests' reading.
// This also limits the maximum header size.
// Increase this buffer if your clients send multi-KB RequestURIs
// and/or multi-KB headers (for example, BIG cookies).
ReadBufferSize int

// Per-connection buffer size for responses' writing.
WriteBufferSize int

// tls config for the http client.
TlsConfig *tls.Config

// Client is custom client when client config is complex.
// Note that Servers, Timeout, WriteBufferSize, ReadBufferSize and TlsConfig
// will not be used if the client are set.
Client *fasthttp.LBClient
}

Default Config​

var ConfigDefault = Config{
Next: nil,
ModifyRequest: nil,
ModifyResponse: nil,
Timeout: fasthttp.DefaultLBClientTimeout,
}
- - +
Version: Next

Proxy

Proxy middleware for Fiber that allows you to proxy requests to multiple servers.

Signatures​

// Balancer create a load balancer among multiple upstrem servers.
func Balancer(config Config) fiber.Handler
// Forward performs the given http request and fills the given http response.
func Forward(addr string, clients ...*fasthttp.Client) fiber.Handler
// Do performs the given http request and fills the given http response.
func Do(c *fiber.Ctx, addr string, clients ...*fasthttp.Client) error
// DoRedirects performs the given http request and fills the given http response while following up to maxRedirectsCount redirects.
func DoRedirects(c *fiber.Ctx, addr string, maxRedirectsCount int, clients ...*fasthttp.Client) error
// DoDeadline performs the given request and waits for response until the given deadline.
func DoDeadline(c *fiber.Ctx, addr string, deadline time.Time, clients ...*fasthttp.Client) error
// DoTimeout performs the given request and waits for response during the given timeout duration.
func DoTimeout(c *fiber.Ctx, addr string, timeout time.Duration, clients ...*fasthttp.Client) error
// DomainForward the given http request based on the given domain and fills the given http response
func DomainForward(hostname string, addr string, clients ...*fasthttp.Client) fiber.Handler
// BalancerForward performs the given http request based round robin balancer and fills the given http response
func BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/proxy"
)

After you initiate your Fiber app, you can use the following possibilities:

// if target https site uses a self-signed certificate, you should
// call WithTlsConfig before Do and Forward
proxy.WithTlsConfig(&tls.Config{
InsecureSkipVerify: true,
})
// if you need to use global self-custom client, you should use proxy.WithClient.
proxy.WithClient(&fasthttp.Client{
NoDefaultUserAgentHeader: true,
DisablePathNormalizing: true,
})

// Forward to url
app.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif"))

// If you want to forward with a specific domain. You have to use proxy.DomainForward.
app.Get("/payments", proxy.DomainForward("docs.gofiber.io", "http://localhost:8000"))

// Forward to url with local custom client
app.Get("/gif", proxy.Forward("https://i.imgur.com/IWaBepg.gif", &fasthttp.Client{
NoDefaultUserAgentHeader: true,
DisablePathNormalizing: true,
}))

// Make request within handler
app.Get("/:id", func(c *fiber.Ctx) error {
url := "https://i.imgur.com/"+c.Params("id")+".gif"
if err := proxy.Do(c, url); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests while following redirects
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoRedirects(c, "http://google.com", 3); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests and wait up to 5 seconds before timing out
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoTimeout(c, "http://localhost:3000", time.Second * 5); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Make proxy requests, timeout a minute from now
app.Get("/proxy", func(c *fiber.Ctx) error {
if err := proxy.DoDeadline(c, "http://localhost", time.Now().Add(time.Minute)); err != nil {
return err
}
// Remove Server header from response
c.Response().Header.Del(fiber.HeaderServer)
return nil
})

// Minimal round robin balancer
app.Use(proxy.Balancer(proxy.Config{
Servers: []string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
},
}))

// Or extend your balancer for customization
app.Use(proxy.Balancer(proxy.Config{
Servers: []string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
},
ModifyRequest: func(c *fiber.Ctx) error {
c.Request().Header.Add("X-Real-IP", c.IP())
return nil
},
ModifyResponse: func(c *fiber.Ctx) error {
c.Response().Header.Del(fiber.HeaderServer)
return nil
},
}))

// Or this way if the balancer is using https and the destination server is only using http.
app.Use(proxy.BalancerForward([]string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Servers defines a list of <scheme>://<host> HTTP servers,
//
// which are used in a round-robin manner.
// i.e.: "https://foobar.com, http://www.foobar.com"
//
// Required
Servers []string

// ModifyRequest allows you to alter the request
//
// Optional. Default: nil
ModifyRequest fiber.Handler

// ModifyResponse allows you to alter the response
//
// Optional. Default: nil
ModifyResponse fiber.Handler

// Timeout is the request timeout used when calling the proxy client
//
// Optional. Default: 1 second
Timeout time.Duration

// Per-connection buffer size for requests' reading.
// This also limits the maximum header size.
// Increase this buffer if your clients send multi-KB RequestURIs
// and/or multi-KB headers (for example, BIG cookies).
ReadBufferSize int

// Per-connection buffer size for responses' writing.
WriteBufferSize int

// tls config for the http client.
TlsConfig *tls.Config

// Client is custom client when client config is complex.
// Note that Servers, Timeout, WriteBufferSize, ReadBufferSize and TlsConfig
// will not be used if the client are set.
Client *fasthttp.LBClient
}

Default Config​

var ConfigDefault = Config{
Next: nil,
ModifyRequest: nil,
ModifyResponse: nil,
Timeout: fasthttp.DefaultLBClientTimeout,
}
+ + \ No newline at end of file diff --git a/next/api/middleware/recover/index.html b/next/api/middleware/recover/index.html index f4fad8caef3..67d09fb1cdb 100644 --- a/next/api/middleware/recover/index.html +++ b/next/api/middleware/recover/index.html @@ -6,13 +6,13 @@ Recover | Fiber - - + +
-
Version: Next

Recover

Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(recover.New())

// This panic will be caught by the middleware
app.Get("/", func(c *fiber.Ctx) error {
panic("I'm an error")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// EnableStackTrace enables handling stack trace
//
// Optional. Default: false
EnableStackTrace bool

// StackTraceHandler defines a function to handle stack trace
//
// Optional. Default: defaultStackTraceHandler
StackTraceHandler func(c *fiber.Ctx, e interface{})
}

Default Config​

var ConfigDefault = Config{
Next: nil,
EnableStackTrace: false,
StackTraceHandler: defaultStackTraceHandler,
}
- - +
Version: Next

Recover

Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(recover.New())

// This panic will be caught by the middleware
app.Get("/", func(c *fiber.Ctx) error {
panic("I'm an error")
})

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// EnableStackTrace enables handling stack trace
//
// Optional. Default: false
EnableStackTrace bool

// StackTraceHandler defines a function to handle stack trace
//
// Optional. Default: defaultStackTraceHandler
StackTraceHandler func(c *fiber.Ctx, e interface{})
}

Default Config​

var ConfigDefault = Config{
Next: nil,
EnableStackTrace: false,
StackTraceHandler: defaultStackTraceHandler,
}
+ + \ No newline at end of file diff --git a/next/api/middleware/redirect/index.html b/next/api/middleware/redirect/index.html index 2803e636570..4f463a520e8 100644 --- a/next/api/middleware/redirect/index.html +++ b/next/api/middleware/redirect/index.html @@ -6,13 +6,13 @@ Redirect | Fiber - - + +
-
Version: Next

Redirect

Redirection middleware for Fiber.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/redirect"
)

func main() {
app := fiber.New()

app.Use(redirect.New(redirect.Config{
Rules: map[string]string{
"/old": "/new",
"/old/*": "/new/$1",
},
StatusCode: 301,
}))

app.Get("/new", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})
app.Get("/new/*", func(c *fiber.Ctx) error {
return c.SendString("Wildcard: " + c.Params("*"))
})

app.Listen(":3000")
}

Test:

curl http://localhost:3000/old
curl http://localhost:3000/old/hello

Config​

// Config defines the config for middleware.
type Config struct {
// Filter defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// Rules defines the URL path rewrite rules. The values captured in asterisk can be
// retrieved by index e.g. $1, $2 and so on.
// Required. Example:
// "/old": "/new",
// "/api/*": "/$1",
// "/js/*": "/public/javascripts/$1",
// "/users/*/orders/*": "/user/$1/order/$2",
Rules map[string]string

// The status code when redirecting
// This is ignored if Redirect is disabled
// Optional. Default: 302 (fiber.StatusFound)
StatusCode int

rulesRegex map[*regexp.Regexp]string
}

Default Config​

var ConfigDefault = Config{
StatusCode: fiber.StatusFound,
}
- - +
Version: Next

Redirect

Redirection middleware for Fiber.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/redirect"
)

func main() {
app := fiber.New()

app.Use(redirect.New(redirect.Config{
Rules: map[string]string{
"/old": "/new",
"/old/*": "/new/$1",
},
StatusCode: 301,
}))

app.Get("/new", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})
app.Get("/new/*", func(c *fiber.Ctx) error {
return c.SendString("Wildcard: " + c.Params("*"))
})

app.Listen(":3000")
}

Test:

curl http://localhost:3000/old
curl http://localhost:3000/old/hello

Config​

// Config defines the config for middleware.
type Config struct {
// Filter defines a function to skip middleware.
// Optional. Default: nil
Next func(*fiber.Ctx) bool

// Rules defines the URL path rewrite rules. The values captured in asterisk can be
// retrieved by index e.g. $1, $2 and so on.
// Required. Example:
// "/old": "/new",
// "/api/*": "/$1",
// "/js/*": "/public/javascripts/$1",
// "/users/*/orders/*": "/user/$1/order/$2",
Rules map[string]string

// The status code when redirecting
// This is ignored if Redirect is disabled
// Optional. Default: 302 (fiber.StatusFound)
StatusCode int

rulesRegex map[*regexp.Regexp]string
}

Default Config​

var ConfigDefault = Config{
StatusCode: fiber.StatusFound,
}
+ + \ No newline at end of file diff --git a/next/api/middleware/requestid/index.html b/next/api/middleware/requestid/index.html index b74c24acfaa..b824af68403 100644 --- a/next/api/middleware/requestid/index.html +++ b/next/api/middleware/requestid/index.html @@ -6,15 +6,15 @@ RequestID | Fiber - - + +
Version: Next

RequestID

RequestID middleware for Fiber that adds an indentifier to the response.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/requestid"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
app.Use(requestid.New())

// Or extend your config for customization
app.Use(requestid.New(requestid.Config{
Header: "X-Custom-Header",
Generator: func() string {
return "static-id"
},
}))

Config​

// Config defines the config for middleware.
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c *fiber.Ctx) bool

// Header is the header key where to get/set the unique request ID
//
// Optional. Default: "X-Request-ID"
Header string

// Generator defines a function to generate the unique identifier.
//
// Optional. Default: utils.UUID
Generator func() string

// ContextKey defines the key used when storing the request ID in
// the locals for a specific request.
//
// Optional. Default: requestid
ContextKey interface{}
}

Default Config​

The default config uses a fast UUID generator which will expose the number of requests made to the server. To conceal this value for better privacy, use the -utils.UUIDv4 generator.

var ConfigDefault = Config{
Next: nil,
Header: fiber.HeaderXRequestID,
Generator: utils.UUID,
ContextKey: "requestid",
}
- - +utils.UUIDv4 generator.

var ConfigDefault = Config{
Next: nil,
Header: fiber.HeaderXRequestID,
Generator: utils.UUID,
ContextKey: "requestid",
}
+ + \ No newline at end of file diff --git a/next/api/middleware/rewrite/index.html b/next/api/middleware/rewrite/index.html index a0fb6a40c15..0586af47507 100644 --- a/next/api/middleware/rewrite/index.html +++ b/next/api/middleware/rewrite/index.html @@ -6,13 +6,13 @@ Rewrite | Fiber - - + +
-
Version: Next

Rewrite

Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/rewrite"
)

func main() {
app := fiber.New()

app.Use(rewrite.New(rewrite.Config{
Rules: map[string]string{
"/old": "/new",
"/old/*": "/new/$1",
},
}))

app.Get("/new", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})
app.Get("/new/*", func(c *fiber.Ctx) error {
return c.SendString("Wildcard: " + c.Params("*"))
})

app.Listen(":3000")
}

Test:

curl http://localhost:3000/old
curl http://localhost:3000/old/hello
- - +
Version: Next

Rewrite

Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links.

Signatures​

func New(config ...Config) fiber.Handler

Examples​

package main

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/rewrite"
)

func main() {
app := fiber.New()

app.Use(rewrite.New(rewrite.Config{
Rules: map[string]string{
"/old": "/new",
"/old/*": "/new/$1",
},
}))

app.Get("/new", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})
app.Get("/new/*", func(c *fiber.Ctx) error {
return c.SendString("Wildcard: " + c.Params("*"))
})

app.Listen(":3000")
}

Test:

curl http://localhost:3000/old
curl http://localhost:3000/old/hello
+ + \ No newline at end of file diff --git a/next/api/middleware/session/index.html b/next/api/middleware/session/index.html index 436b320a30d..79a490204de 100644 --- a/next/api/middleware/session/index.html +++ b/next/api/middleware/session/index.html @@ -6,13 +6,13 @@ Session | Fiber - - + +
-
Version: Next

Session

Session middleware for Fiber.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

Signatures​

func New(config ...Config) *Store
func (s *Store) RegisterType(i interface{})
func (s *Store) Get(c *fiber.Ctx) (*Session, error)
func (s *Store) Reset() error

func (s *Session) Get(key string) interface{}
func (s *Session) Set(key string, val interface{})
func (s *Session) Delete(key string)
func (s *Session) Destroy() error
func (s *Session) Regenerate() error
func (s *Session) Save() error
func (s *Session) Fresh() bool
func (s *Session) ID() string
func (s *Session) Keys() []string
caution

Storing interface{} values are limited to built-ins Go types.

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/session"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
// This stores all of your app's sessions
store := session.New()

app.Get("/", func(c *fiber.Ctx) error {
// Get session from storage
sess, err := store.Get(c)
if err != nil {
panic(err)
}

// Get value
name := sess.Get("name")

// Set key/value
sess.Set("name", "john")

// Get all Keys
keys := sess.Keys()

// Delete key
sess.Delete("name")

// Destroy session
if err := sess.Destroy(); err != nil {
panic(err)
}

// Sets a specific expiration for this session
sess.SetExpiry(time.Second * 2)

// Save session
if err := sess.Save(); err != nil {
panic(err)
}

return c.SendString(fmt.Sprintf("Welcome %v", name))
})

Config​

// Config defines the config for middleware.
type Config struct {
// Allowed session duration
// Optional. Default value 24 * time.Hour
Expiration time.Duration

// Storage interface to store the session data
// Optional. Default value memory.New()
Storage fiber.Storage

// KeyLookup is a string in the form of "<source>:<name>" that is used
// to extract session id from the request.
// Possible values: "header:<name>", "query:<name>" or "cookie:<name>"
// Optional. Default value "cookie:session_id".
KeyLookup string

// Domain of the CSRF cookie.
// Optional. Default value "".
CookieDomain string

// Path of the CSRF cookie.
// Optional. Default value "".
CookiePath string

// Indicates if CSRF cookie is secure.
// Optional. Default value false.
CookieSecure bool

// Indicates if CSRF cookie is HTTP only.
// Optional. Default value false.
CookieHTTPOnly bool

// Value of SameSite cookie.
// Optional. Default value "Lax".
CookieSameSite string

// Decides whether cookie should last for only the browser sesison.
// Ignores Expiration if set to true
// Optional. Default value false.
CookieSessionOnly bool

// KeyGenerator generates the session key.
// Optional. Default value utils.UUIDv4
KeyGenerator func() string

// Deprecated: Please use KeyLookup
CookieName string

// Source defines where to obtain the session id
source Source

// The session name
sessionName string
}

Default Config​

var ConfigDefault = Config{
Expiration: 24 * time.Hour,
KeyLookup: "cookie:session_id",
KeyGenerator: utils.UUIDv4,
source: "cookie",
sessionName: "session_id",
}

Constants​

const (
SourceCookie Source = "cookie"
SourceHeader Source = "header"
SourceURLQuery Source = "query"
)

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
store := session.New(session.Config{
Storage: storage,
})

To use the store, see the Examples.

- - +
Version: Next

Session

Session middleware for Fiber.

note

This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.

Signatures​

func New(config ...Config) *Store
func (s *Store) RegisterType(i interface{})
func (s *Store) Get(c *fiber.Ctx) (*Session, error)
func (s *Store) Reset() error

func (s *Session) Get(key string) interface{}
func (s *Session) Set(key string, val interface{})
func (s *Session) Delete(key string)
func (s *Session) Destroy() error
func (s *Session) Regenerate() error
func (s *Session) Save() error
func (s *Session) Fresh() bool
func (s *Session) ID() string
func (s *Session) Keys() []string
caution

Storing interface{} values are limited to built-ins Go types.

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/session"
)

After you initiate your Fiber app, you can use the following possibilities:

// Initialize default config
// This stores all of your app's sessions
store := session.New()

app.Get("/", func(c *fiber.Ctx) error {
// Get session from storage
sess, err := store.Get(c)
if err != nil {
panic(err)
}

// Get value
name := sess.Get("name")

// Set key/value
sess.Set("name", "john")

// Get all Keys
keys := sess.Keys()

// Delete key
sess.Delete("name")

// Destroy session
if err := sess.Destroy(); err != nil {
panic(err)
}

// Sets a specific expiration for this session
sess.SetExpiry(time.Second * 2)

// Save session
if err := sess.Save(); err != nil {
panic(err)
}

return c.SendString(fmt.Sprintf("Welcome %v", name))
})

Config​

// Config defines the config for middleware.
type Config struct {
// Allowed session duration
// Optional. Default value 24 * time.Hour
Expiration time.Duration

// Storage interface to store the session data
// Optional. Default value memory.New()
Storage fiber.Storage

// KeyLookup is a string in the form of "<source>:<name>" that is used
// to extract session id from the request.
// Possible values: "header:<name>", "query:<name>" or "cookie:<name>"
// Optional. Default value "cookie:session_id".
KeyLookup string

// Domain of the CSRF cookie.
// Optional. Default value "".
CookieDomain string

// Path of the CSRF cookie.
// Optional. Default value "".
CookiePath string

// Indicates if CSRF cookie is secure.
// Optional. Default value false.
CookieSecure bool

// Indicates if CSRF cookie is HTTP only.
// Optional. Default value false.
CookieHTTPOnly bool

// Value of SameSite cookie.
// Optional. Default value "Lax".
CookieSameSite string

// Decides whether cookie should last for only the browser sesison.
// Ignores Expiration if set to true
// Optional. Default value false.
CookieSessionOnly bool

// KeyGenerator generates the session key.
// Optional. Default value utils.UUIDv4
KeyGenerator func() string

// Deprecated: Please use KeyLookup
CookieName string

// Source defines where to obtain the session id
source Source

// The session name
sessionName string
}

Default Config​

var ConfigDefault = Config{
Expiration: 24 * time.Hour,
KeyLookup: "cookie:session_id",
KeyGenerator: utils.UUIDv4,
source: "cookie",
sessionName: "session_id",
}

Constants​

const (
SourceCookie Source = "cookie"
SourceHeader Source = "header"
SourceURLQuery Source = "query"
)

Custom Storage/Database​

You can use any storage from our storage package.

storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3
store := session.New(session.Config{
Storage: storage,
})

To use the store, see the Examples.

+ + \ No newline at end of file diff --git a/next/api/middleware/skip/index.html b/next/api/middleware/skip/index.html index 54adf86c0e7..61e8389d186 100644 --- a/next/api/middleware/skip/index.html +++ b/next/api/middleware/skip/index.html @@ -6,13 +6,13 @@ Skip | Fiber - - + +
-
Version: Next

Skip

Skip middleware for Fiber that skips a wrapped handler if a predicate is true.

Signatures​

func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/skip"
)

After you initiate your Fiber app, you can use the following possibilities:

func main() {
app := fiber.New()

app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool {
return ctx.Method() == fiber.MethodGet
}))

app.Get("/", func(ctx *fiber.Ctx) error {
return ctx.SendString("It was a GET request!")
})

log.Fatal(app.Listen(":3000"))
}

func BasicHandler(ctx *fiber.Ctx) error {
return ctx.SendString("It was not a GET request!")
}
tip

app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.

- - +
Version: Next

Skip

Skip middleware for Fiber that skips a wrapped handler if a predicate is true.

Signatures​

func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/skip"
)

After you initiate your Fiber app, you can use the following possibilities:

func main() {
app := fiber.New()

app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool {
return ctx.Method() == fiber.MethodGet
}))

app.Get("/", func(ctx *fiber.Ctx) error {
return ctx.SendString("It was a GET request!")
})

log.Fatal(app.Listen(":3000"))
}

func BasicHandler(ctx *fiber.Ctx) error {
return ctx.SendString("It was not a GET request!")
}
tip

app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.

+ + \ No newline at end of file diff --git a/next/api/middleware/timeout/index.html b/next/api/middleware/timeout/index.html index a10838c9ff8..73f0c8c5cbe 100644 --- a/next/api/middleware/timeout/index.html +++ b/next/api/middleware/timeout/index.html @@ -6,13 +6,13 @@ Timeout | Fiber - - + +
-
Version: Next

Timeout

There exist two distinct implementations of timeout middleware Fiber.

New

Wraps a fiber.Handler with a timeout. If the handler takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler.

caution

This has been deprecated since it raises race conditions.

NewWithContext

As a fiber.Handler wrapper, it creates a context with context.WithTimeout and pass it in UserContext.

If the context passed executions (eg. DB ops, Http calls) takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler.

It does not cancel long running executions. Underlying executions must handle timeout by using context.Context parameter.

Signatures​

func New(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler
func NewWithContext(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/timeout"
)

After you initiate your Fiber app, you can use the following possibilities:

func main() {
app := fiber.New()

h := func(c *fiber.Ctx) error {
sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")
if err := sleepWithContext(c.UserContext(), sleepTime); err != nil {
return fmt.Errorf("%w: execution error", err)
}
return nil
}

app.Get("/foo/:sleepTime", timeout.New(h, 2*time.Second))
log.Fatal(app.Listen(":3000"))
}

func sleepWithContext(ctx context.Context, d time.Duration) error {
timer := time.NewTimer(d)

select {
case <-ctx.Done():
if !timer.Stop() {
<-timer.C
}
return context.DeadlineExceeded
case <-timer.C:
}
return nil
}

Test http 200 with curl:

curl --location -I --request GET 'http://localhost:3000/foo/1000' 

Test http 408 with curl:

curl --location -I --request GET 'http://localhost:3000/foo/3000' 

Use with custom error:

var ErrFooTimeOut = errors.New("foo context canceled")

func main() {
app := fiber.New()
h := func(c *fiber.Ctx) error {
sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")
if err := sleepWithContextWithCustomError(c.UserContext(), sleepTime); err != nil {
return fmt.Errorf("%w: execution error", err)
}
return nil
}

app.Get("/foo/:sleepTime", timeout.NewWithContext(h, 2*time.Second, ErrFooTimeOut))
log.Fatal(app.Listen(":3000"))
}

func sleepWithContextWithCustomError(ctx context.Context, d time.Duration) error {
timer := time.NewTimer(d)
select {
case <-ctx.Done():
if !timer.Stop() {
<-timer.C
}
return ErrFooTimeOut
case <-timer.C:
}
return nil
}

Sample usage with a DB call:

func main() {
app := fiber.New()
db, _ := gorm.Open(postgres.Open("postgres://localhost/foodb"), &gorm.Config{})

handler := func(ctx *fiber.Ctx) error {
tran := db.WithContext(ctx.UserContext()).Begin()

if tran = tran.Exec("SELECT pg_sleep(50)"); tran.Error != nil {
return tran.Error
}

if tran = tran.Commit(); tran.Error != nil {
return tran.Error
}

return nil
}

app.Get("/foo", timeout.NewWithContext(handler, 10*time.Second))
log.Fatal(app.Listen(":3000"))
}
- - +
Version: Next

Timeout

There exist two distinct implementations of timeout middleware Fiber.

New

Wraps a fiber.Handler with a timeout. If the handler takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler.

caution

This has been deprecated since it raises race conditions.

NewWithContext

As a fiber.Handler wrapper, it creates a context with context.WithTimeout and pass it in UserContext.

If the context passed executions (eg. DB ops, Http calls) takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler.

It does not cancel long running executions. Underlying executions must handle timeout by using context.Context parameter.

Signatures​

func New(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler
func NewWithContext(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler

Examples​

Import the middleware package that is part of the Fiber web framework

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/timeout"
)

After you initiate your Fiber app, you can use the following possibilities:

func main() {
app := fiber.New()

h := func(c *fiber.Ctx) error {
sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")
if err := sleepWithContext(c.UserContext(), sleepTime); err != nil {
return fmt.Errorf("%w: execution error", err)
}
return nil
}

app.Get("/foo/:sleepTime", timeout.New(h, 2*time.Second))
log.Fatal(app.Listen(":3000"))
}

func sleepWithContext(ctx context.Context, d time.Duration) error {
timer := time.NewTimer(d)

select {
case <-ctx.Done():
if !timer.Stop() {
<-timer.C
}
return context.DeadlineExceeded
case <-timer.C:
}
return nil
}

Test http 200 with curl:

curl --location -I --request GET 'http://localhost:3000/foo/1000' 

Test http 408 with curl:

curl --location -I --request GET 'http://localhost:3000/foo/3000' 

Use with custom error:

var ErrFooTimeOut = errors.New("foo context canceled")

func main() {
app := fiber.New()
h := func(c *fiber.Ctx) error {
sleepTime, _ := time.ParseDuration(c.Params("sleepTime") + "ms")
if err := sleepWithContextWithCustomError(c.UserContext(), sleepTime); err != nil {
return fmt.Errorf("%w: execution error", err)
}
return nil
}

app.Get("/foo/:sleepTime", timeout.NewWithContext(h, 2*time.Second, ErrFooTimeOut))
log.Fatal(app.Listen(":3000"))
}

func sleepWithContextWithCustomError(ctx context.Context, d time.Duration) error {
timer := time.NewTimer(d)
select {
case <-ctx.Done():
if !timer.Stop() {
<-timer.C
}
return ErrFooTimeOut
case <-timer.C:
}
return nil
}

Sample usage with a DB call:

func main() {
app := fiber.New()
db, _ := gorm.Open(postgres.Open("postgres://localhost/foodb"), &gorm.Config{})

handler := func(ctx *fiber.Ctx) error {
tran := db.WithContext(ctx.UserContext()).Begin()

if tran = tran.Exec("SELECT pg_sleep(50)"); tran.Error != nil {
return tran.Error
}

if tran = tran.Commit(); tran.Error != nil {
return tran.Error
}

return nil
}

app.Get("/foo", timeout.NewWithContext(handler, 10*time.Second))
log.Fatal(app.Listen(":3000"))
}
+ + \ No newline at end of file diff --git a/next/category/-middleware/index.html b/next/category/-middleware/index.html index 74c583670ee..c428008a59a 100644 --- a/next/category/-middleware/index.html +++ b/next/category/-middleware/index.html @@ -6,13 +6,13 @@ 🧬 Middleware | Fiber - - + +
Version: Next

🧬 Middleware

Middleware is a function chained in the HTTP request cycle with access to the Context which it uses to perform a specific action, for example, logging every request or enabling CORS.

- - + + \ No newline at end of file diff --git a/next/category/api/index.html b/next/category/api/index.html index 05affdbd67e..4192f69e47d 100644 --- a/next/category/api/index.html +++ b/next/category/api/index.html @@ -6,13 +6,13 @@ API | Fiber - - + + - - + + \ No newline at end of file diff --git a/next/category/extra/index.html b/next/category/extra/index.html index 2be28404e87..cba2e26096a 100644 --- a/next/category/extra/index.html +++ b/next/category/extra/index.html @@ -6,13 +6,13 @@ Extra | Fiber - - + + - - + + \ No newline at end of file diff --git a/next/category/guide/index.html b/next/category/guide/index.html index fc88775f798..75b40699895 100644 --- a/next/category/guide/index.html +++ b/next/category/guide/index.html @@ -6,13 +6,13 @@ Guide | Fiber - - + +
- - + + \ No newline at end of file diff --git a/next/extra/benchmarks/index.html b/next/extra/benchmarks/index.html index f727dee4882..173833437cf 100644 --- a/next/extra/benchmarks/index.html +++ b/next/extra/benchmarks/index.html @@ -6,8 +6,8 @@ πŸ“Š Benchmarks | Fiber - - + +
@@ -16,8 +16,8 @@ Express handled 2,066 responses per second with an average latency of 390.44 ms.

Fiber vs Express

Multiple Queries​

Fiber handled 19,664 responses per second with an average latency of 25.7 ms.
Express handled 4,302 responses per second with an average latency of 117.2 ms.

Fiber vs Express

Single Query​

Fiber handled 368,647 responses per second with an average latency of 0.7 ms.
Express handled 57,880 responses per second with an average latency of 4.4 ms.

Fiber vs Express

JSON Serialization​

Fiber handled 1,146,667 responses per second with an average latency of 0.4 ms.
-Express handled 244,847 responses per second with an average latency of 1.1 ms.

Fiber vs Express

Go web framework benchmark​

πŸ”— https://github.com/smallnest/go-web-framework-benchmark

  • CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
  • MEM 4GB
  • GO go1.13.6 linux/amd64
  • OS Linux

The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers.

The concurrency clients are 5000.

Latency is the time of real processing time by web servers. The smaller is the better.

Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better.

If we enable http pipelining, test result as below:

Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is:

If we enable http pipelining, test result as below:

Dependency graph for v1.9.0

- - +Express handled 244,847 responses per second with an average latency of 1.1 ms.

Fiber vs Express

Go web framework benchmark​

πŸ”— https://github.com/smallnest/go-web-framework-benchmark

  • CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
  • MEM 4GB
  • GO go1.13.6 linux/amd64
  • OS Linux

The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers.

The concurrency clients are 5000.

Latency is the time of real processing time by web servers. The smaller is the better.

Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better.

If we enable http pipelining, test result as below:

Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is:

If we enable http pipelining, test result as below:

Dependency graph for v1.9.0

+ + \ No newline at end of file diff --git a/next/extra/faq/index.html b/next/extra/faq/index.html index f8a1dd99b7a..9a37e85bae6 100644 --- a/next/extra/faq/index.html +++ b/next/extra/faq/index.html @@ -6,15 +6,15 @@ πŸ€” FAQ | Fiber - - + +
Version: Next

πŸ€” FAQ

How should I structure my application?​

There is no definitive answer to this question. The answer depends on the scale of your application and the team that is involved. To be as flexible as possible, Fiber makes no assumptions in terms of structure.

Routes and other application-specific logic can live in as many files as you wish, in any directory structure you prefer. View the following examples for inspiration:

How do I handle custom 404 responses?​

If you're using v2.32.0 or later, all you need to do is to implement a custom error handler. See below, or see a more detailed explanation at Error Handling.

If you're using v2.31.0 or earlier, the error handler will not capture 404 errors. Instead, you need to add a middleware function at the very bottom of the stack (below all other functions) to handle a 404 response:

Example
app.Use(func(c *fiber.Ctx) error {
return c.Status(fiber.StatusNotFound).SendString("Sorry can't find that!")
})

How can i use live reload ?​

Air is a handy tool that automatically restarts your Go applications whenever the source code changes, making your development process faster and more efficient.

To use Air in a Fiber project, follow these steps:

  1. Install Air by downloading the appropriate binary for your operating system from the GitHub release page or by building the tool directly from source.
  2. Create a configuration file for Air in your project directory. This file can be named, for example, .air.toml or air.conf. Here's a sample configuration file that works with Fiber:
# .air.toml
root = "."
tmp_dir = "tmp"
[build]
cmd = "go build -o ./tmp/main ."
bin = "./tmp/main"
delay = 1000 # ms
exclude_dir = ["assets", "tmp", "vendor"]
include_ext = ["go", "tpl", "tmpl", "html"]
exclude_regex = ["_test\\.go"]
  1. Start your Fiber application using Air by running the following command in the terminal:
air

As you make changes to your source code, Air will detect them and automatically restart the application.

A complete example demonstrating the use of Air with Fiber can be found in the Fiber Recipes repository. This example shows how to configure and use Air in a Fiber project to create an efficient development environment.

How do I set up an error handler?​

To override the default error handler, you can override the default when providing a Config when initiating a new Fiber instance.

Example
app := fiber.New(fiber.Config{
ErrorHandler: func(c *fiber.Ctx, err error) error {
return c.Status(fiber.StatusInternalServerError).SendString(err.Error())
},
})

We have a dedicated page explaining how error handling works in Fiber, see Error Handling.

Which template engines does Fiber support?​

Fiber currently supports 8 template engines in our gofiber/template middleware:

To learn more about using Templates in Fiber, see Templates.

Does Fiber have a community chat?​

Yes, we have our own Discord server, where we hang out. We have different rooms for every subject.
If you have questions or just want to have a chat, feel free to join us via this > invite link <.

Does fiber support sub domain routing ?​

Yes we do, here are some examples: -This example works v2

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
)

type Host struct {
Fiber *fiber.App
}

func main() {
// Hosts
hosts := map[string]*Host{}
//-----
// API
//-----
api := fiber.New()
api.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))
hosts["api.localhost:3000"] = &Host{api}
api.Get("/", func(c *fiber.Ctx) error {
return c.SendString("API")
})
//------
// Blog
//------
blog := fiber.New()
blog.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))
hosts["blog.localhost:3000"] = &Host{blog}
blog.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Blog")
})
//---------
// Website
//---------
site := fiber.New()
site.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))

hosts["localhost:3000"] = &Host{site}
site.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Website")
})
// Server
app := fiber.New()
app.Use(func(c *fiber.Ctx) error {
host := hosts[c.Hostname()]
if host == nil {
return c.SendStatus(fiber.StatusNotFound)
} else {
host.Fiber.Handler()(c.Context())
return nil
}
})
log.Fatal(app.Listen(":3000"))
}

If more information is needed, please refer to this issue #750

- - +This example works v2

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
)

type Host struct {
Fiber *fiber.App
}

func main() {
// Hosts
hosts := map[string]*Host{}
//-----
// API
//-----
api := fiber.New()
api.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))
hosts["api.localhost:3000"] = &Host{api}
api.Get("/", func(c *fiber.Ctx) error {
return c.SendString("API")
})
//------
// Blog
//------
blog := fiber.New()
blog.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))
hosts["blog.localhost:3000"] = &Host{blog}
blog.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Blog")
})
//---------
// Website
//---------
site := fiber.New()
site.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))

hosts["localhost:3000"] = &Host{site}
site.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Website")
})
// Server
app := fiber.New()
app.Use(func(c *fiber.Ctx) error {
host := hosts[c.Hostname()]
if host == nil {
return c.SendStatus(fiber.StatusNotFound)
} else {
host.Fiber.Handler()(c.Context())
return nil
}
})
log.Fatal(app.Listen(":3000"))
}

If more information is needed, please refer to this issue #750

+ + \ No newline at end of file diff --git a/next/guide/error-handling/index.html b/next/guide/error-handling/index.html index 7945428d055..879b44e11fd 100644 --- a/next/guide/error-handling/index.html +++ b/next/guide/error-handling/index.html @@ -6,13 +6,13 @@ πŸ› Error Handling | Fiber - - + +
-
Version: Next

πŸ› Error Handling

Catching Errors​

It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them.

app.Get("/", func(c *fiber.Ctx) error {
// Pass error to Fiber
return c.SendFile("file-does-not-exist")
})

Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below:

Example
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
)

func main() {
app := fiber.New()

app.Use(recover.New())

app.Get("/", func(c *fiber.Ctx) error {
panic("This panic is caught by fiber")
})

log.Fatal(app.Listen(":3000"))
}

You could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found).

Example
app.Get("/", func(c *fiber.Ctx) error {
// 503 Service Unavailable
return fiber.ErrServiceUnavailable

// 503 On vacation!
return fiber.NewError(fiber.StatusServiceUnavailable, "On vacation!")
})

Default Error Handler​

Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If the error is of type fiber.Error, the response is sent with the provided status code and message.

Example
// Default error handler
var DefaultErrorHandler = func(c *fiber.Ctx, err error) error {
// Status code defaults to 500
code := fiber.StatusInternalServerError

// Retrieve the custom status code if it's a *fiber.Error
var e *fiber.Error
if errors.As(err, &e) {
code = e.Code
}

// Set Content-Type: text/plain; charset=utf-8
c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)

// Return status code with error message
return c.Status(code).SendString(err.Error())
}

Custom Error Handler​

A custom error handler can be set using a Config when initializing a Fiber instance.

In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response.

The following example shows how to display error pages for different types of errors.

Example
// Create a new fiber instance with custom config
app := fiber.New(fiber.Config{
// Override default error handler
ErrorHandler: func(ctx *fiber.Ctx, err error) error {
// Status code defaults to 500
code := fiber.StatusInternalServerError

// Retrieve the custom status code if it's a *fiber.Error
var e *fiber.Error
if errors.As(err, &e) {
code = e.Code
}

// Send custom error page
err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))
if err != nil {
// In case the SendFile fails
return ctx.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")
}

// Return from handler
return nil
},
})

// ...

Special thanks to the Echo & Express framework for inspiration regarding error handling.

- - +
Version: Next

πŸ› Error Handling

Catching Errors​

It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them.

app.Get("/", func(c *fiber.Ctx) error {
// Pass error to Fiber
return c.SendFile("file-does-not-exist")
})

Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below:

Example
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
)

func main() {
app := fiber.New()

app.Use(recover.New())

app.Get("/", func(c *fiber.Ctx) error {
panic("This panic is caught by fiber")
})

log.Fatal(app.Listen(":3000"))
}

You could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found).

Example
app.Get("/", func(c *fiber.Ctx) error {
// 503 Service Unavailable
return fiber.ErrServiceUnavailable

// 503 On vacation!
return fiber.NewError(fiber.StatusServiceUnavailable, "On vacation!")
})

Default Error Handler​

Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If the error is of type fiber.Error, the response is sent with the provided status code and message.

Example
// Default error handler
var DefaultErrorHandler = func(c *fiber.Ctx, err error) error {
// Status code defaults to 500
code := fiber.StatusInternalServerError

// Retrieve the custom status code if it's a *fiber.Error
var e *fiber.Error
if errors.As(err, &e) {
code = e.Code
}

// Set Content-Type: text/plain; charset=utf-8
c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)

// Return status code with error message
return c.Status(code).SendString(err.Error())
}

Custom Error Handler​

A custom error handler can be set using a Config when initializing a Fiber instance.

In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response.

The following example shows how to display error pages for different types of errors.

Example
// Create a new fiber instance with custom config
app := fiber.New(fiber.Config{
// Override default error handler
ErrorHandler: func(ctx *fiber.Ctx, err error) error {
// Status code defaults to 500
code := fiber.StatusInternalServerError

// Retrieve the custom status code if it's a *fiber.Error
var e *fiber.Error
if errors.As(err, &e) {
code = e.Code
}

// Send custom error page
err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))
if err != nil {
// In case the SendFile fails
return ctx.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")
}

// Return from handler
return nil
},
})

// ...

Special thanks to the Echo & Express framework for inspiration regarding error handling.

+ + \ No newline at end of file diff --git a/next/guide/faster-fiber/index.html b/next/guide/faster-fiber/index.html index fdfaac5397d..5ff0b522077 100644 --- a/next/guide/faster-fiber/index.html +++ b/next/guide/faster-fiber/index.html @@ -6,13 +6,13 @@ ⚑ Make Fiber Faster | Fiber - - + +
-
Version: Next

⚑ Make Fiber Faster

Custom JSON Encoder/Decoder​

Since Fiber v2.32.0, we use encoding/json as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of encoding/json, we recommend you to use these libraries:

Example
package main

import "github.com/gofiber/fiber/v2"
import "github.com/goccy/go-json"

func main() {
app := fiber.New(fiber.Config{
JSONEncoder: json.Marshal,
JSONDecoder: json.Unmarshal,
})

# ...
}

References​

- - +
Version: Next

⚑ Make Fiber Faster

Custom JSON Encoder/Decoder​

Since Fiber v2.32.0, we use encoding/json as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of encoding/json, we recommend you to use these libraries:

Example
package main

import "github.com/gofiber/fiber/v2"
import "github.com/goccy/go-json"

func main() {
app := fiber.New(fiber.Config{
JSONEncoder: json.Marshal,
JSONDecoder: json.Unmarshal,
})

# ...
}

References​

+ + \ No newline at end of file diff --git a/next/guide/grouping/index.html b/next/guide/grouping/index.html index 51dda57c84f..ab931a0382d 100644 --- a/next/guide/grouping/index.html +++ b/next/guide/grouping/index.html @@ -6,13 +6,13 @@ 🎭 Grouping | Fiber - - + +
-
Version: Next

🎭 Grouping

info

In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.

Paths​

Like Routing, groups can also have paths that belong to a cluster.

func main() {
app := fiber.New()

api := app.Group("/api", middleware) // /api

v1 := api.Group("/v1", middleware) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", middleware) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

A Group of paths can have an optional handler.

func main() {
app := fiber.New()

api := app.Group("/api") // /api

v1 := api.Group("/v1") // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2") // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}
caution

Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.

Group Handlers​

Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue.

func main() {
app := fiber.New()

handler := func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK)
}
api := app.Group("/api") // /api

v1 := api.Group("/v1", func(c *fiber.Ctx) error { // middleware for /api/v1
c.Set("Version", "v1")
return c.Next()
})
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

log.Fatal(app.Listen(":3000"))
}
- - +
Version: Next

🎭 Grouping

info

In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.

Paths​

Like Routing, groups can also have paths that belong to a cluster.

func main() {
app := fiber.New()

api := app.Group("/api", middleware) // /api

v1 := api.Group("/v1", middleware) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", middleware) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

A Group of paths can have an optional handler.

func main() {
app := fiber.New()

api := app.Group("/api") // /api

v1 := api.Group("/v1") // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2") // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}
caution

Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.

Group Handlers​

Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue.

func main() {
app := fiber.New()

handler := func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK)
}
api := app.Group("/api") // /api

v1 := api.Group("/v1", func(c *fiber.Ctx) error { // middleware for /api/v1
c.Set("Version", "v1")
return c.Next()
})
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

log.Fatal(app.Listen(":3000"))
}
+ + \ No newline at end of file diff --git a/next/guide/hooks/index.html b/next/guide/hooks/index.html index 6dca8e636ca..74c5222c0a0 100644 --- a/next/guide/hooks/index.html +++ b/next/guide/hooks/index.html @@ -6,13 +6,13 @@ πŸͺ Hooks | Fiber - - + +
-
Version: Next

πŸͺ Hooks

With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:

Constants​

// Handlers define a function to create hooks for Fiber.
type OnRouteHandler = func(Route) error
type OnNameHandler = OnRouteHandler
type OnGroupHandler = func(Group) error
type OnGroupNameHandler = OnGroupHandler
type OnListenHandler = func(ListenData) error
type OnForkHandler = func(int) error
type OnShutdownHandler = func() error
type OnMountHandler = func(*App) error

OnRoute​

OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by route parameter.

Signature
func (app *App) OnRoute(handler ...OnRouteHandler)

OnName​

OnName is a hook to execute user functions on each route naming. Also you can get route properties by route parameter.

caution

OnName only works with naming routes, not groups.

Signature
func (app *App) OnName(handler ...OnNameHandler)
package main

import (
"fmt"

"github.com/gofiber/fiber/v2"
)

func main() {
app := fiber.New()

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("index")

app.Hooks().OnName(func(r fiber.Route) error {
fmt.Print("Name: " + r.Name + ", ")

return nil
})

app.Hooks().OnName(func(r fiber.Route) error {
fmt.Print("Method: " + r.Method + "\n")

return nil
})

app.Get("/add/user", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("addUser")

app.Delete("/destroy/user", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("destroyUser")

app.Listen(":5000")
}

// Results:
// Name: addUser, Method: GET
// Name: destroyUser, Method: DELETE

OnGroup​

OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by group parameter.

Signature
func (app *App) OnGroup(handler ...OnGroupHandler)

OnGroupName​

OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by group parameter.

caution

OnGroupName only works with naming groups, not routes.

Signature
func (app *App) OnGroupName(handler ...OnGroupNameHandler)

OnListen​

OnListen is a hook to execute user functions on Listen, ListenTLS, Listener.

Signature
func (app *App) OnListen(handler ...OnListenHandler)
app := fiber.New(fiber.Config{
DisableStartupMessage: true,
})

app.Hooks().OnListen(func(listenData fiber.ListenData) error {
if fiber.IsChild() {
return nil
}
scheme := "http"
if data.TLS {
scheme = "https"
}
log.Println(scheme + "://" + listenData.Host + ":" + listenData.Port)
return nil
})

app.Listen(":5000")

OnFork​

OnFork is a hook to execute user functions on Fork.

Signature
func (app *App) OnFork(handler ...OnForkHandler)

OnShutdown​

OnShutdown is a hook to execute user functions after Shutdown.

Signature
func (app *App) OnShutdown(handler ...OnShutdownHandler)

OnMount​

OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting.

Signature
func (h *Hooks) OnMount(handler ...OnMountHandler) 
package main

import (
"fmt"

"github.com/gofiber/fiber/v2"
)

func main() {
app := New()
app.Get("/", testSimpleHandler).Name("x")

subApp := New()
subApp.Get("/test", testSimpleHandler)

subApp.Hooks().OnMount(func(parent *fiber.App) error {
fmt.Print("Mount path of parent app: "+parent.MountPath())
// ...

return nil
})

app.Mount("/sub", subApp)
}

// Result:
// Mount path of parent app:
caution

OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.

- - +
Version: Next

πŸͺ Hooks

With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:

Constants​

// Handlers define a function to create hooks for Fiber.
type OnRouteHandler = func(Route) error
type OnNameHandler = OnRouteHandler
type OnGroupHandler = func(Group) error
type OnGroupNameHandler = OnGroupHandler
type OnListenHandler = func(ListenData) error
type OnForkHandler = func(int) error
type OnShutdownHandler = func() error
type OnMountHandler = func(*App) error

OnRoute​

OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by route parameter.

Signature
func (app *App) OnRoute(handler ...OnRouteHandler)

OnName​

OnName is a hook to execute user functions on each route naming. Also you can get route properties by route parameter.

caution

OnName only works with naming routes, not groups.

Signature
func (app *App) OnName(handler ...OnNameHandler)
package main

import (
"fmt"

"github.com/gofiber/fiber/v2"
)

func main() {
app := fiber.New()

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("index")

app.Hooks().OnName(func(r fiber.Route) error {
fmt.Print("Name: " + r.Name + ", ")

return nil
})

app.Hooks().OnName(func(r fiber.Route) error {
fmt.Print("Method: " + r.Method + "\n")

return nil
})

app.Get("/add/user", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("addUser")

app.Delete("/destroy/user", func(c *fiber.Ctx) error {
return c.SendString(c.Route().Name)
}).Name("destroyUser")

app.Listen(":5000")
}

// Results:
// Name: addUser, Method: GET
// Name: destroyUser, Method: DELETE

OnGroup​

OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by group parameter.

Signature
func (app *App) OnGroup(handler ...OnGroupHandler)

OnGroupName​

OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by group parameter.

caution

OnGroupName only works with naming groups, not routes.

Signature
func (app *App) OnGroupName(handler ...OnGroupNameHandler)

OnListen​

OnListen is a hook to execute user functions on Listen, ListenTLS, Listener.

Signature
func (app *App) OnListen(handler ...OnListenHandler)
app := fiber.New(fiber.Config{
DisableStartupMessage: true,
})

app.Hooks().OnListen(func(listenData fiber.ListenData) error {
if fiber.IsChild() {
return nil
}
scheme := "http"
if data.TLS {
scheme = "https"
}
log.Println(scheme + "://" + listenData.Host + ":" + listenData.Port)
return nil
})

app.Listen(":5000")

OnFork​

OnFork is a hook to execute user functions on Fork.

Signature
func (app *App) OnFork(handler ...OnForkHandler)

OnShutdown​

OnShutdown is a hook to execute user functions after Shutdown.

Signature
func (app *App) OnShutdown(handler ...OnShutdownHandler)

OnMount​

OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting.

Signature
func (h *Hooks) OnMount(handler ...OnMountHandler) 
package main

import (
"fmt"

"github.com/gofiber/fiber/v2"
)

func main() {
app := New()
app.Get("/", testSimpleHandler).Name("x")

subApp := New()
subApp.Get("/test", testSimpleHandler)

subApp.Hooks().OnMount(func(parent *fiber.App) error {
fmt.Print("Mount path of parent app: "+parent.MountPath())
// ...

return nil
})

app.Mount("/sub", subApp)
}

// Result:
// Mount path of parent app:
caution

OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.

+ + \ No newline at end of file diff --git a/next/guide/routing/index.html b/next/guide/routing/index.html index a763411c633..f42a9363a7e 100644 --- a/next/guide/routing/index.html +++ b/next/guide/routing/index.html @@ -6,14 +6,14 @@ πŸ”Œ Routing | Fiber - - + +
Version: Next

πŸ”Œ Routing

Handlers​

Registers a route bound to a specific HTTP method.

Signatures
// HTTP methods
func (app *App) Get(path string, handlers ...Handler) Router
func (app *App) Head(path string, handlers ...Handler) Router
func (app *App) Post(path string, handlers ...Handler) Router
func (app *App) Put(path string, handlers ...Handler) Router
func (app *App) Delete(path string, handlers ...Handler) Router
func (app *App) Connect(path string, handlers ...Handler) Router
func (app *App) Options(path string, handlers ...Handler) Router
func (app *App) Trace(path string, handlers ...Handler) Router
func (app *App) Patch(path string, handlers ...Handler) Router

// Add allows you to specifiy a method as value
func (app *App) Add(method, path string, handlers ...Handler) Router

// All will register the route on all HTTP methods
// Almost the same as app.Use but not bound to prefixes
func (app *App) All(path string, handlers ...Handler) Router
Examples
// Simple GET handler
app.Get("/api/list", func(c *fiber.Ctx) error {
return c.SendString("I'm a GET request!")
})

// Simple POST handler
app.Post("/api/register", func(c *fiber.Ctx) error {
return c.SendString("I'm a POST request!")
})

Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc

Signature
func (app *App) Use(args ...interface{}) Router
Examples
// Match any request
app.Use(func(c *fiber.Ctx) error {
return c.Next()
})

// Match request starting with /api
app.Use("/api", func(c *fiber.Ctx) error {
return c.Next()
})

// Match requests starting with /api or /home (multiple-prefix support)
app.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {
return c.Next()
})

// Attach multiple handlers
app.Use("/api", func(c *fiber.Ctx) error {
c.Set("X-Custom-Header", random.String(32))
return c.Next()
}, func(c *fiber.Ctx) error {
return c.Next()
})

Paths​

Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns.

Examples of route paths based on strings

// This route path will match requests to the root route, "/":
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("root")
})

// This route path will match requests to "/about":
app.Get("/about", func(c *fiber.Ctx) error {
return c.SendString("about")
})

// This route path will match requests to "/random.txt":
app.Get("/random.txt", func(c *fiber.Ctx) error {
return c.SendString("random.txt")
})

As with the expressJs framework, the order of the route declaration plays a role. -When a request is received, the routes are checked in the order in which they are declared.

info

So please be careful to write routes with variable parameters after the routes that contain fixed parts, so that these variable parts do not match instead and unexpected behavior occurs.

Parameters​

Route parameters are dynamic elements in the route, which are named or not named segments. This segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys or for unnamed parameters the character(*, +) and the counter of this.

The characters :, +, and * are characters that introduce a parameter.

Greedy parameters are indicated by wildcard(*) or plus(+) signs.

The routing also offers the possibility to use optional parameters, for the named parameters these are marked with a final "?", unlike the plus sign which is not optional, you can use the wildcard character for a parameter range which is optional and greedy.

Example of define routes with route parameters

// Parameters
app.Get("/user/:name/books/:title", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s\n", c.Params("name"))
fmt.Fprintf(c, "%s\n", c.Params("title"))
return nil
})
// Plus - greedy - not optional
app.Get("/user/+", func(c *fiber.Ctx) error {
return c.SendString(c.Params("+"))
})

// Optional parameter
app.Get("/user/:name?", func(c *fiber.Ctx) error {
return c.SendString(c.Params("name"))
})

// Wildcard - greedy - optional
app.Get("/user/*", func(c *fiber.Ctx) error {
return c.SendString(c.Params("*"))
})

// This route path will match requests to "/v1/some/resource/name:customVerb", since the parameter character is escaped
app.Get("/v1/some/resource/name\\:customVerb", func(c *fiber.Ctx) error {
return c.SendString("Hello, Community")
})
info

Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes.

info

All special parameter characters can also be escaped with "\\" and lose their value, so you can use them in the route if you want, like in the custom methods of the google api design guide.

// http://localhost:3000/plantae/prunus.persica
app.Get("/plantae/:genus.:species", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s.%s\n", c.Params("genus"), c.Params("species"))
return nil // prunus.persica
})
// http://localhost:3000/flights/LAX-SFO
app.Get("/flights/:from-:to", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s-%s\n", c.Params("from"), c.Params("to"))
return nil // LAX-SFO
})

Our intelligent router recognizes that the introductory parameter characters should be part of the request route in this case and can process them as such.

// http://localhost:3000/shop/product/color:blue/size:xs
app.Get("/shop/product/color::color/size::size", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s:%s\n", c.Params("color"), c.Params("size"))
return nil // blue:xs
})

In addition, several parameters in a row and several unnamed parameter characters in the route, such as the wildcard or plus character, are possible, which greatly expands the possibilities of the router for the user.

// GET /@v1
// Params: "sign" -> "@", "param" -> "v1"
app.Get("/:sign:param", handler)

// GET /api-v1
// Params: "name" -> "v1"
app.Get("/api-:name", handler)

// GET /customer/v1/cart/proxy
// Params: "*1" -> "customer/", "*2" -> "/cart"
app.Get("/*v1*/proxy", handler)

// GET /v1/brand/4/shop/blue/xs
// Params: "*1" -> "brand/4", "*2" -> "blue/xs"
app.Get("/v1/*/shop/*", handler)

We have adapted the routing strongly to the express routing, but currently without the possibility of the regular expressions, because they are quite slow. The possibilities can be tested with version 0.1.7 (express 4) in the online Express route tester.

Constraints​

Route constraints execute when a match has occurred to the incoming URL and the URL path is tokenized into route values by parameters. The feature was intorduced in v2.37.0 and inspired by .NET Core.

caution

Constraints aren't validation for parameters. If constraint aren't valid for parameter value, Fiber returns 404 handler.

ConstraintExampleExample matches
int:id<int>123456789, -123456789
bool:active<bool>true,false
guid:id<guid>CD2C1638-1638-72D5-1638-DEADBEEF1638
float:weight<float>1.234, -1,001.01e8
minLen(value):username<minLen(4)>Test (must be at least 4 characters)
maxLen(value):filename<maxLen(8)>MyFile (must be no more than 8 characters
len(length):filename<len(12)>somefile.txt (exactly 12 characters)
min(value):age<min(18)>19 (Integer value must be at least 18)
max(value):age<max(120)>91 (Integer value must be no more than 120)
range(min,max):age<range(18,120)>91 (Integer value must be at least 18 but no more than 120)
alpha:name<alpha>Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive)
datetime:dob<datetime(2006\\-01\\-02)>2005-11-01
regex(expression):date<regex(\d{4}-\d{2}-\d{2})}>2022-08-27 (Must match regular expression)

Examples

app.Get("/:test<min(5)>", func(c *fiber.Ctx) error {
return c.SendString(c.Params("test"))
})

// curl -X GET http://localhost:3000/12
// 12

// curl -X GET http://localhost:3000/1
// Cannot GET /1
caution

You should use \\ before routing-specific characters when to use datetime constraint (*, +, ?, :, /, <, >, ;, (, )), to avoid wrong parsing.

Optional Parameter Example

You can impose constraints on optional parameters as well.

app.Get("/:test<int>?", func(c *fiber.Ctx) error {
return c.SendString(c.Params("test"))
})
// curl -X GET http://localhost:3000/42
// 42
// curl -X GET http://localhost:3000/
//
// curl -X GET http://localhost:3000/7.0
// Cannot GET /7.0

Middleware​

Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route.

Example of a middleware function

app.Use(func(c *fiber.Ctx) error {
// Set a custom header on all responses:
c.Set("X-Custom-Header", "Hello, World")

// Go to next middleware:
return c.Next()
})

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.

Grouping​

If you have many endpoints, you can organize your routes using Group.

func main() {
app := fiber.New()

api := app.Group("/api", middleware) // /api

v1 := api.Group("/v1", middleware) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", middleware) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

More information about this in our Grouping Guide

- - +When a request is received, the routes are checked in the order in which they are declared.

info

So please be careful to write routes with variable parameters after the routes that contain fixed parts, so that these variable parts do not match instead and unexpected behavior occurs.

Parameters​

Route parameters are dynamic elements in the route, which are named or not named segments. This segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys or for unnamed parameters the character(*, +) and the counter of this.

The characters :, +, and * are characters that introduce a parameter.

Greedy parameters are indicated by wildcard(*) or plus(+) signs.

The routing also offers the possibility to use optional parameters, for the named parameters these are marked with a final "?", unlike the plus sign which is not optional, you can use the wildcard character for a parameter range which is optional and greedy.

Example of define routes with route parameters

// Parameters
app.Get("/user/:name/books/:title", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s\n", c.Params("name"))
fmt.Fprintf(c, "%s\n", c.Params("title"))
return nil
})
// Plus - greedy - not optional
app.Get("/user/+", func(c *fiber.Ctx) error {
return c.SendString(c.Params("+"))
})

// Optional parameter
app.Get("/user/:name?", func(c *fiber.Ctx) error {
return c.SendString(c.Params("name"))
})

// Wildcard - greedy - optional
app.Get("/user/*", func(c *fiber.Ctx) error {
return c.SendString(c.Params("*"))
})

// This route path will match requests to "/v1/some/resource/name:customVerb", since the parameter character is escaped
app.Get("/v1/some/resource/name\\:customVerb", func(c *fiber.Ctx) error {
return c.SendString("Hello, Community")
})
info

Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes.

info

All special parameter characters can also be escaped with "\\" and lose their value, so you can use them in the route if you want, like in the custom methods of the google api design guide.

// http://localhost:3000/plantae/prunus.persica
app.Get("/plantae/:genus.:species", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s.%s\n", c.Params("genus"), c.Params("species"))
return nil // prunus.persica
})
// http://localhost:3000/flights/LAX-SFO
app.Get("/flights/:from-:to", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s-%s\n", c.Params("from"), c.Params("to"))
return nil // LAX-SFO
})

Our intelligent router recognizes that the introductory parameter characters should be part of the request route in this case and can process them as such.

// http://localhost:3000/shop/product/color:blue/size:xs
app.Get("/shop/product/color::color/size::size", func(c *fiber.Ctx) error {
fmt.Fprintf(c, "%s:%s\n", c.Params("color"), c.Params("size"))
return nil // blue:xs
})

In addition, several parameters in a row and several unnamed parameter characters in the route, such as the wildcard or plus character, are possible, which greatly expands the possibilities of the router for the user.

// GET /@v1
// Params: "sign" -> "@", "param" -> "v1"
app.Get("/:sign:param", handler)

// GET /api-v1
// Params: "name" -> "v1"
app.Get("/api-:name", handler)

// GET /customer/v1/cart/proxy
// Params: "*1" -> "customer/", "*2" -> "/cart"
app.Get("/*v1*/proxy", handler)

// GET /v1/brand/4/shop/blue/xs
// Params: "*1" -> "brand/4", "*2" -> "blue/xs"
app.Get("/v1/*/shop/*", handler)

We have adapted the routing strongly to the express routing, but currently without the possibility of the regular expressions, because they are quite slow. The possibilities can be tested with version 0.1.7 (express 4) in the online Express route tester.

Constraints​

Route constraints execute when a match has occurred to the incoming URL and the URL path is tokenized into route values by parameters. The feature was intorduced in v2.37.0 and inspired by .NET Core.

caution

Constraints aren't validation for parameters. If constraint aren't valid for parameter value, Fiber returns 404 handler.

ConstraintExampleExample matches
int:id<int>123456789, -123456789
bool:active<bool>true,false
guid:id<guid>CD2C1638-1638-72D5-1638-DEADBEEF1638
float:weight<float>1.234, -1,001.01e8
minLen(value):username<minLen(4)>Test (must be at least 4 characters)
maxLen(value):filename<maxLen(8)>MyFile (must be no more than 8 characters
len(length):filename<len(12)>somefile.txt (exactly 12 characters)
min(value):age<min(18)>19 (Integer value must be at least 18)
max(value):age<max(120)>91 (Integer value must be no more than 120)
range(min,max):age<range(18,120)>91 (Integer value must be at least 18 but no more than 120)
alpha:name<alpha>Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive)
datetime:dob<datetime(2006\\-01\\-02)>2005-11-01
regex(expression):date<regex(\d{4}-\d{2}-\d{2})}>2022-08-27 (Must match regular expression)

Examples

app.Get("/:test<min(5)>", func(c *fiber.Ctx) error {
return c.SendString(c.Params("test"))
})

// curl -X GET http://localhost:3000/12
// 12

// curl -X GET http://localhost:3000/1
// Cannot GET /1
caution

You should use \\ before routing-specific characters when to use datetime constraint (*, +, ?, :, /, <, >, ;, (, )), to avoid wrong parsing.

Optional Parameter Example

You can impose constraints on optional parameters as well.

app.Get("/:test<int>?", func(c *fiber.Ctx) error {
return c.SendString(c.Params("test"))
})
// curl -X GET http://localhost:3000/42
// 42
// curl -X GET http://localhost:3000/
//
// curl -X GET http://localhost:3000/7.0
// Cannot GET /7.0

Middleware​

Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route.

Example of a middleware function

app.Use(func(c *fiber.Ctx) error {
// Set a custom header on all responses:
c.Set("X-Custom-Header", "Hello, World")

// Go to next middleware:
return c.Next()
})

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.

Grouping​

If you have many endpoints, you can organize your routes using Group.

func main() {
app := fiber.New()

api := app.Group("/api", middleware) // /api

v1 := api.Group("/v1", middleware) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", middleware) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

log.Fatal(app.Listen(":3000"))
}

More information about this in our Grouping Guide

+ + \ No newline at end of file diff --git a/next/guide/templates/index.html b/next/guide/templates/index.html index bfa4e579d91..fe82a70c0c9 100644 --- a/next/guide/templates/index.html +++ b/next/guide/templates/index.html @@ -6,14 +6,14 @@ πŸ“ Templates | Fiber - - + +
Version: Next

πŸ“ Templates

Template interfaces​

Fiber provides a Views interface to provide your own template engine:

type Views interface {
Load() error
Render(io.Writer, string, interface{}, ...string) error
}

Views interface contains a Load and Render method, Load is executed by Fiber on app initialization to load/parse the templates.

// Pass engine to Fiber's Views Engine
app := fiber.New(fiber.Config{
Views: engine,
// Views Layout is the global layout for all template render until override on Render function.
ViewsLayout: "layouts/main"
})

The Render method is linked to the ctx.Render() function that accepts a template name and binding data. It will use global layout if layout is not being defined in Render function. -If the Fiber config option PassLocalsToViews is enabled, then all locals set using ctx.Locals(key, value) will be passed to the template.

app.Get("/", func(c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
"hello": "world",
});
})

Engines​

Fiber team maintains templates package that provides wrappers for multiple template engines:

package main

import (
"log"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html/v2"
)

func main() {
// Initialize standard Go html template engine
engine := html.New("./views", ".html")
// If you want other engine, just replace with following
// Create a new engine with django
// engine := django.New("./views", ".django")

app := fiber.New(fiber.Config{
Views: engine,
})
app.Get("/", func(c *fiber.Ctx) error {
// Render index template
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

log.Fatal(app.Listen(":3000"))
}
- - +If the Fiber config option PassLocalsToViews is enabled, then all locals set using ctx.Locals(key, value) will be passed to the template.

app.Get("/", func(c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
"hello": "world",
});
})

Engines​

Fiber team maintains templates package that provides wrappers for multiple template engines:

package main

import (
"log"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html/v2"
)

func main() {
// Initialize standard Go html template engine
engine := html.New("./views", ".html")
// If you want other engine, just replace with following
// Create a new engine with django
// engine := django.New("./views", ".django")

app := fiber.New(fiber.Config{
Views: engine,
})
app.Get("/", func(c *fiber.Ctx) error {
// Render index template
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

log.Fatal(app.Listen(":3000"))
}
+ + \ No newline at end of file diff --git a/next/guide/validation/index.html b/next/guide/validation/index.html index 795f9f8a4eb..88167e7c1df 100644 --- a/next/guide/validation/index.html +++ b/next/guide/validation/index.html @@ -6,13 +6,13 @@ πŸ”Ž Validation | Fiber - - + +
-
Version: Next

πŸ”Ž Validation

Validator package​

Fiber can make great use of the validator package to ensure correct validation of data to store.

You can find the detailed descriptions of the validations used in the fields contained on the structs below:

Validation Example
package main

import (
"fmt"
"log"
"strings"

"github.com/go-playground/validator/v10"
"github.com/gofiber/fiber/v2"
)

type (
User struct {
Name string `validate:"required,min=5,max=20"` // Required field, min 5 char long max 20
Age int `validate:"required,teener"` // Required field, and client needs to implement our 'teener' tag format which we'll see later
}

ErrorResponse struct {
Error bool
FailedField string
Tag string
Value interface{}
}

XValidator struct {
validator *validator.Validate
}

GlobalErrorHandlerResp struct {
Success bool `json:"success"`
Message string `json:"message"`
}
)

// This is the validator instance
// for more information see: https://github.com/go-playground/validator
var validate = validator.New()

func (v XValidator) Validate(data interface{}) []ErrorResponse {
validationErrors := []ErrorResponse{}

errs := validate.Struct(data)
if errs != nil {
for _, err := range errs.(validator.ValidationErrors) {
// In this case data object is actually holding the User struct
var elem ErrorResponse

elem.FailedField = err.Field() // Export struct field name
elem.Tag = err.Tag() // Export struct tag
elem.Value = err.Value() // Export field value
elem.Error = true

validationErrors = append(validationErrors, elem)
}
}

return validationErrors
}

func main() {
myValidator := &XValidator{
validator: validate,
}

app := fiber.New(fiber.Config{
// Global custom error handler
ErrorHandler: func(c *fiber.Ctx, err error) error {
return c.Status(fiber.StatusBadRequest).JSON(GlobalErrorHandlerResp{
Success: false,
Message: err.Error(),
})
},
})

// Custom struct validation tag format
myValidator.validator.RegisterValidation("teener", func(fl validator.FieldLevel) bool {
// User.Age needs to fit our needs, 12-18 years old.
return fl.Field().Int() >= 12 && fl.Field().Int() <= 18
})

app.Get("/", func(c *fiber.Ctx) error {
user := &User{
Name: c.Query("name"),
Age: c.QueryInt("age"),
}

// Validation
if errs := myValidator.Validate(user); len(errs) > 0 && errs[0].Error {
errMsgs := make([]string, 0)

for _, err := range errs {
errMsgs = append(errMsgs, fmt.Sprintf(
"[%s]: '%v' | Needs to implement '%s'",
err.FailedField,
err.Value,
err.Tag,
))
}

return &fiber.Error{
Code: fiber.ErrBadRequest.Code,
Message: strings.Join(errMsgs, " and "),
}
}

// Logic, validated with success
return c.SendString("Hello, World!")
})

log.Fatal(app.Listen(":3000"))
}

/**
OUTPUT

[1]
Request:

GET http://127.0.0.1:3000/

Response:

{"success":false,"message":"[Name]: '' | Needs to implement 'required' and [Age]: '0' | Needs to implement 'required'"}

[2]
Request:

GET http://127.0.0.1:3000/?name=efdal&age=9

Response:
{"success":false,"message":"[Age]: '9' | Needs to implement 'teener'"}

[3]
Request:

GET http://127.0.0.1:3000/?name=efdal&age=

Response:
{"success":false,"message":"[Age]: '0' | Needs to implement 'required'"}

[4]
Request:

GET http://127.0.0.1:3000/?name=efdal&age=18

Response:
Hello, World!

**/

- - +
Version: Next

πŸ”Ž Validation

Validator package​

Fiber can make great use of the validator package to ensure correct validation of data to store.

You can find the detailed descriptions of the validations used in the fields contained on the structs below:

Validation Example
package main

import (
"fmt"
"log"
"strings"

"github.com/go-playground/validator/v10"
"github.com/gofiber/fiber/v2"
)

type (
User struct {
Name string `validate:"required,min=5,max=20"` // Required field, min 5 char long max 20
Age int `validate:"required,teener"` // Required field, and client needs to implement our 'teener' tag format which we'll see later
}

ErrorResponse struct {
Error bool
FailedField string
Tag string
Value interface{}
}

XValidator struct {
validator *validator.Validate
}

GlobalErrorHandlerResp struct {
Success bool `json:"success"`
Message string `json:"message"`
}
)

// This is the validator instance
// for more information see: https://github.com/go-playground/validator
var validate = validator.New()

func (v XValidator) Validate(data interface{}) []ErrorResponse {
validationErrors := []ErrorResponse{}

errs := validate.Struct(data)
if errs != nil {
for _, err := range errs.(validator.ValidationErrors) {
// In this case data object is actually holding the User struct
var elem ErrorResponse

elem.FailedField = err.Field() // Export struct field name
elem.Tag = err.Tag() // Export struct tag
elem.Value = err.Value() // Export field value
elem.Error = true

validationErrors = append(validationErrors, elem)
}
}

return validationErrors
}

func main() {
myValidator := &XValidator{
validator: validate,
}

app := fiber.New(fiber.Config{
// Global custom error handler
ErrorHandler: func(c *fiber.Ctx, err error) error {
return c.Status(fiber.StatusBadRequest).JSON(GlobalErrorHandlerResp{
Success: false,
Message: err.Error(),
})
},
})

// Custom struct validation tag format
myValidator.validator.RegisterValidation("teener", func(fl validator.FieldLevel) bool {
// User.Age needs to fit our needs, 12-18 years old.
return fl.Field().Int() >= 12 && fl.Field().Int() <= 18
})

app.Get("/", func(c *fiber.Ctx) error {
user := &User{
Name: c.Query("name"),
Age: c.QueryInt("age"),
}

// Validation
if errs := myValidator.Validate(user); len(errs) > 0 && errs[0].Error {
errMsgs := make([]string, 0)

for _, err := range errs {
errMsgs = append(errMsgs, fmt.Sprintf(
"[%s]: '%v' | Needs to implement '%s'",
err.FailedField,
err.Value,
err.Tag,
))
}

return &fiber.Error{
Code: fiber.ErrBadRequest.Code,
Message: strings.Join(errMsgs, " and "),
}
}

// Logic, validated with success
return c.SendString("Hello, World!")
})

log.Fatal(app.Listen(":3000"))
}

/**
OUTPUT

[1]
Request:

GET http://127.0.0.1:3000/

Response:

{"success":false,"message":"[Name]: '' | Needs to implement 'required' and [Age]: '0' | Needs to implement 'required'"}

[2]
Request:

GET http://127.0.0.1:3000/?name=efdal&age=9

Response:
{"success":false,"message":"[Age]: '9' | Needs to implement 'teener'"}

[3]
Request:

GET http://127.0.0.1:3000/?name=efdal&age=

Response:
{"success":false,"message":"[Age]: '0' | Needs to implement 'required'"}

[4]
Request:

GET http://127.0.0.1:3000/?name=efdal&age=18

Response:
Hello, World!

**/

+ + \ No newline at end of file diff --git a/next/index.html b/next/index.html index cf34522e61f..600c0078441 100644 --- a/next/index.html +++ b/next/index.html @@ -6,14 +6,14 @@ πŸ‘‹ Welcome | Fiber - - + +
Version: Next

πŸ‘‹ Welcome

An online API documentation with examples so you can start building web apps with Fiber right away!

Fiber is an Express inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development with zero memory allocation and performance in mind.

These docs are for Fiber v2, which was released on September 15th, 2020.

Installation​

First of all, download and install Go. 1.17 or higher is required.

Installation is done using the go get command:

go get github.com/gofiber/fiber/v2

Zero Allocation​

Some values returned from *fiber.Ctx are not immutable by default.

Because fiber is optimized for high-performance, values returned from fiber.Ctx are not immutable by default and will be re-used across requests. As a rule of thumb, you must only use context values within the handler, and you must not keep any references. As soon as you return from the handler, any values you have obtained from the context will be re-used in future requests and will change below your feet. Here is an example:

func handler(c *fiber.Ctx) error {
// Variable is only valid within this handler
result := c.Params("foo")

// ...
}

If you need to persist such values outside the handler, make copies of their underlying buffer using the copy builtin. Here is an example for persisting a string:

func handler(c *fiber.Ctx) error {
// Variable is only valid within this handler
result := c.Params("foo")

// Make a copy
buffer := make([]byte, len(result))
copy(buffer, result)
resultCopy := string(buffer)
// Variable is now valid forever

// ...
}

We created a custom CopyString function that does the above and is available under gofiber/utils.

app.Get("/:foo", func(c *fiber.Ctx) error {
// Variable is now immutable
result := utils.CopyString(c.Params("foo"))

// ...
})

Alternatively, you can also use the Immutable setting. It will make all values returned from the context immutable, allowing you to persist them anywhere. Of course, this comes at the cost of performance.

app := fiber.New(fiber.Config{
Immutable: true,
})

For more information, please check #426 and #185.

Hello, World!​

Embedded below is essentially the most straightforward Fiber app you can create:

package main

import "github.com/gofiber/fiber/v2"

func main() {
app := fiber.New()

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

app.Listen(":3000")
}
go run server.go

Browse to http://localhost:3000 and you should see Hello, World! on the page.

Basic routing​

Routing refers to determining how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (GET, PUT, POST, etc.).

Each route can have multiple handler functions that are executed when the route is matched.

Route definition takes the following structures:

// Function signature
app.Method(path string, ...func(*fiber.Ctx) error)
  • app is an instance of Fiber
  • Method is an HTTP request method: GET, PUT, POST, etc.
  • path is a virtual path on the server
  • func(*fiber.Ctx) error is a callback function containing the Context executed when the route is matched

Simple route

// Respond with "Hello, World!" on root path, "/"
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})

Parameters

// GET http://localhost:8080/hello%20world

app.Get("/:value", func(c *fiber.Ctx) error {
return c.SendString("value: " + c.Params("value"))
// => Get request with value: hello world
})

Optional parameter

// GET http://localhost:3000/john

app.Get("/:name?", func(c *fiber.Ctx) error {
if c.Params("name") != "" {
return c.SendString("Hello " + c.Params("name"))
// => Hello john
}
return c.SendString("Where is john?")
})

Wildcards

// GET http://localhost:3000/api/user/john

app.Get("/api/*", func(c *fiber.Ctx) error {
return c.SendString("API path: " + c.Params("*"))
// => API path: user/john
})

Static files​

To serve static files such as images, CSS, and JavaScript files, replace your function handler with a file or directory string.

Function signature:

app.Static(prefix, root string, config ...Static)

Use the following code to serve files in a directory named ./public:

app := fiber.New()

app.Static("/", "./public")

app.Listen(":3000")

Now, you can load the files that are in the ./public directory:

http://localhost:8080/hello.html
http://localhost:8080/js/jquery.js
http://localhost:8080/css/style.css

Note​

For more information on how to build APIs in Go with Fiber, please check out this excellent article -on building an express-style API in Go with Fiber.

- - +on building an express-style API in Go with Fiber.

+ + \ No newline at end of file diff --git a/next/partials/routing/route-handlers/index.html b/next/partials/routing/route-handlers/index.html index bfb4c1544af..8a4846765cf 100644 --- a/next/partials/routing/route-handlers/index.html +++ b/next/partials/routing/route-handlers/index.html @@ -6,13 +6,13 @@ Route Handlers | Fiber - - + +
-
Version: Next

Route Handlers

Registers a route bound to a specific HTTP method.

Signatures
// HTTP methods
func (app *App) Get(path string, handlers ...Handler) Router
func (app *App) Head(path string, handlers ...Handler) Router
func (app *App) Post(path string, handlers ...Handler) Router
func (app *App) Put(path string, handlers ...Handler) Router
func (app *App) Delete(path string, handlers ...Handler) Router
func (app *App) Connect(path string, handlers ...Handler) Router
func (app *App) Options(path string, handlers ...Handler) Router
func (app *App) Trace(path string, handlers ...Handler) Router
func (app *App) Patch(path string, handlers ...Handler) Router

// Add allows you to specifiy a method as value
func (app *App) Add(method, path string, handlers ...Handler) Router

// All will register the route on all HTTP methods
// Almost the same as app.Use but not bound to prefixes
func (app *App) All(path string, handlers ...Handler) Router
Examples
// Simple GET handler
app.Get("/api/list", func(c *fiber.Ctx) error {
return c.SendString("I'm a GET request!")
})

// Simple POST handler
app.Post("/api/register", func(c *fiber.Ctx) error {
return c.SendString("I'm a POST request!")
})

Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc

Signature
func (app *App) Use(args ...interface{}) Router
Examples
// Match any request
app.Use(func(c *fiber.Ctx) error {
return c.Next()
})

// Match request starting with /api
app.Use("/api", func(c *fiber.Ctx) error {
return c.Next()
})

// Match requests starting with /api or /home (multiple-prefix support)
app.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {
return c.Next()
})

// Attach multiple handlers
app.Use("/api", func(c *fiber.Ctx) error {
c.Set("X-Custom-Header", random.String(32))
return c.Next()
}, func(c *fiber.Ctx) error {
return c.Next()
})
- - +
Version: Next

Route Handlers

Registers a route bound to a specific HTTP method.

Signatures
// HTTP methods
func (app *App) Get(path string, handlers ...Handler) Router
func (app *App) Head(path string, handlers ...Handler) Router
func (app *App) Post(path string, handlers ...Handler) Router
func (app *App) Put(path string, handlers ...Handler) Router
func (app *App) Delete(path string, handlers ...Handler) Router
func (app *App) Connect(path string, handlers ...Handler) Router
func (app *App) Options(path string, handlers ...Handler) Router
func (app *App) Trace(path string, handlers ...Handler) Router
func (app *App) Patch(path string, handlers ...Handler) Router

// Add allows you to specifiy a method as value
func (app *App) Add(method, path string, handlers ...Handler) Router

// All will register the route on all HTTP methods
// Almost the same as app.Use but not bound to prefixes
func (app *App) All(path string, handlers ...Handler) Router
Examples
// Simple GET handler
app.Get("/api/list", func(c *fiber.Ctx) error {
return c.SendString("I'm a GET request!")
})

// Simple POST handler
app.Post("/api/register", func(c *fiber.Ctx) error {
return c.SendString("I'm a POST request!")
})

Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc

Signature
func (app *App) Use(args ...interface{}) Router
Examples
// Match any request
app.Use(func(c *fiber.Ctx) error {
return c.Next()
})

// Match request starting with /api
app.Use("/api", func(c *fiber.Ctx) error {
return c.Next()
})

// Match requests starting with /api or /home (multiple-prefix support)
app.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {
return c.Next()
})

// Attach multiple handlers
app.Use("/api", func(c *fiber.Ctx) error {
c.Set("X-Custom-Header", random.String(32))
return c.Next()
}, func(c *fiber.Ctx) error {
return c.Next()
})
+ + \ No newline at end of file diff --git a/next/search-index.json b/next/search-index.json index 8e890c89660..be3e8bff0e7 100644 --- a/next/search-index.json +++ b/next/search-index.json @@ -1 +1 @@ -[{"documents":[{"i":1,"t":"πŸ‘‹ Welcome","u":"/next/","b":["🏠 Home"]},{"i":15,"t":"🌎 Client","u":"/next/api/client","b":["🏠 Home","API"]},{"i":82,"t":"πŸ“‹ Constants","u":"/next/api/constants","b":["🏠 Home","API"]},{"i":84,"t":"πŸš€ App","u":"/next/api/app","b":["🏠 Home","API"]},{"i":131,"t":"πŸ“¦ Fiber","u":"/next/api/fiber","b":["🏠 Home","API"]},{"i":140,"t":"Log","u":"/next/api/log","b":["🏠 Home","API"]},{"i":156,"t":"Adaptor","u":"/next/api/middleware/adaptor","b":["🏠 Home","API","🧬 Middleware"]},{"i":171,"t":"BasicAuth","u":"/next/api/middleware/basicauth","b":["🏠 Home","API","🧬 Middleware"]},{"i":181,"t":"Cache","u":"/next/api/middleware/cache","b":["🏠 Home","API","🧬 Middleware"]},{"i":191,"t":"Compress","u":"/next/api/middleware/compress","b":["🏠 Home","API","🧬 Middleware"]},{"i":203,"t":"CORS","u":"/next/api/middleware/cors","b":["🏠 Home","API","🧬 Middleware"]},{"i":213,"t":"CSRF","u":"/next/api/middleware/csrf","b":["🏠 Home","API","🧬 Middleware"]},{"i":227,"t":"EarlyData","u":"/next/api/middleware/earlydata","b":["🏠 Home","API","🧬 Middleware"]},{"i":239,"t":"EnvVar","u":"/next/api/middleware/envvar","b":["🏠 Home","API","🧬 Middleware"]},{"i":251,"t":"Encrypt Cookie","u":"/next/api/middleware/encryptcookie","b":["🏠 Home","API","🧬 Middleware"]},{"i":263,"t":"ETag","u":"/next/api/middleware/etag","b":["🏠 Home","API","🧬 Middleware"]},{"i":273,"t":"ExpVar","u":"/next/api/middleware/expvar","b":["🏠 Home","API","🧬 Middleware"]},{"i":283,"t":"Favicon","u":"/next/api/middleware/favicon","b":["🏠 Home","API","🧬 Middleware"]},{"i":293,"t":"FileSystem","u":"/next/api/middleware/filesystem","b":["🏠 Home","API","🧬 Middleware"]},{"i":315,"t":"Helmet","u":"/next/api/middleware/helmet","b":["🏠 Home","API","🧬 Middleware"]},{"i":325,"t":"Idempotency","u":"/next/api/middleware/idempotency","b":["🏠 Home","API","🧬 Middleware"]},{"i":339,"t":"Keyauth","u":"/next/api/middleware/keyauth","b":["🏠 Home","API","🧬 Middleware"]},{"i":353,"t":"Limiter","u":"/next/api/middleware/limiter","b":["🏠 Home","API","🧬 Middleware"]},{"i":367,"t":"Logger","u":"/next/api/middleware/logger","b":["🏠 Home","API","🧬 Middleware"]},{"i":379,"t":"Monitor","u":"/next/api/middleware/monitor","b":["🏠 Home","API","🧬 Middleware"]},{"i":389,"t":"Pprof","u":"/next/api/middleware/pprof","b":["🏠 Home","API","🧬 Middleware"]},{"i":399,"t":"Proxy","u":"/next/api/middleware/proxy","b":["🏠 Home","API","🧬 Middleware"]},{"i":409,"t":"Recover","u":"/next/api/middleware/recover","b":["🏠 Home","API","🧬 Middleware"]},{"i":419,"t":"Redirect","u":"/next/api/middleware/redirect","b":["🏠 Home","API","🧬 Middleware"]},{"i":429,"t":"RequestID","u":"/next/api/middleware/requestid","b":["🏠 Home","API","🧬 Middleware"]},{"i":439,"t":"Rewrite","u":"/next/api/middleware/rewrite","b":["🏠 Home","API","🧬 Middleware"]},{"i":445,"t":"Session","u":"/next/api/middleware/session","b":["🏠 Home","API","🧬 Middleware"]},{"i":459,"t":"Skip","u":"/next/api/middleware/skip","b":["🏠 Home","API","🧬 Middleware"]},{"i":465,"t":"Timeout","u":"/next/api/middleware/timeout","b":["🏠 Home","API","🧬 Middleware"]},{"i":471,"t":"πŸ“Š Benchmarks","u":"/next/extra/benchmarks","b":["🏠 Home","Extra"]},{"i":486,"t":"πŸ€” FAQ","u":"/next/extra/faq","b":["🏠 Home","Extra"]},{"i":501,"t":"πŸ› Error Handling","u":"/next/guide/error-handling","b":["🏠 Home","Guide"]},{"i":508,"t":"⚑ Make Fiber Faster","u":"/next/guide/faster-fiber","b":["🏠 Home","Guide"]},{"i":513,"t":"🎭 Grouping","u":"/next/guide/grouping","b":["🏠 Home","Guide"]},{"i":519,"t":"πŸͺ Hooks","u":"/next/guide/hooks","b":["🏠 Home","Guide"]},{"i":539,"t":"πŸ”Œ Routing","u":"/next/guide/routing","b":["🏠 Home","Guide"]},{"i":552,"t":"πŸ“ Templates","u":"/next/guide/templates","b":["🏠 Home","Guide"]},{"i":557,"t":"πŸ”Ž Validation","u":"/next/guide/validation","b":["🏠 Home","Guide"]},{"i":560,"t":"Route Handlers","u":"/next/partials/routing/route-handlers","b":[]},{"i":562,"t":"🧠 Ctx","u":"/next/api/ctx","b":["🏠 Home","API"]}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/1",[0,0.94,1,2.958]],["t/15",[0,0.94,2,2.958]],["t/82",[0,0.94,3,2.958]],["t/84",[0,0.94,4,2.958]],["t/131",[0,0.94,5,2.516]],["t/140",[6,3.916]],["t/156",[7,3.916]],["t/171",[8,3.916]],["t/181",[9,3.916]],["t/191",[10,3.916]],["t/203",[11,3.916]],["t/213",[12,3.916]],["t/227",[13,3.916]],["t/239",[14,3.916]],["t/251",[15,2.958,16,2.958]],["t/263",[17,3.916]],["t/273",[18,3.916]],["t/283",[19,3.916]],["t/293",[20,3.916]],["t/315",[21,3.916]],["t/325",[22,3.916]],["t/339",[23,3.916]],["t/353",[24,3.916]],["t/367",[25,3.916]],["t/379",[26,3.916]],["t/389",[27,3.916]],["t/399",[28,3.916]],["t/409",[29,3.916]],["t/419",[30,3.916]],["t/429",[31,3.916]],["t/439",[32,3.916]],["t/445",[33,3.916]],["t/459",[34,3.916]],["t/465",[35,3.916]],["t/471",[0,0.94,36,2.958]],["t/486",[0,0.94,37,2.958]],["t/501",[0,0.755,38,2.376,39,2.376]],["t/508",[0,0.631,5,1.69,40,1.986,41,1.986]],["t/513",[0,0.94,42,2.958]],["t/519",[0,0.94,43,2.958]],["t/539",[0,0.94,44,2.516]],["t/552",[0,0.94,45,2.958]],["t/557",[0,0.94,46,2.958]],["t/560",[44,2.516,47,2.958]],["t/562",[0,0.94,48,2.958]]],"invertedIndex":[["",{"_index":0,"t":{"1":{"position":[[0,2]]},"15":{"position":[[0,2]]},"82":{"position":[[0,2]]},"84":{"position":[[0,2]]},"131":{"position":[[0,2]]},"471":{"position":[[0,2]]},"486":{"position":[[0,2]]},"501":{"position":[[0,2]]},"508":{"position":[[0,1]]},"513":{"position":[[0,2]]},"519":{"position":[[0,2]]},"539":{"position":[[0,2]]},"552":{"position":[[0,2]]},"557":{"position":[[0,2]]},"562":{"position":[[0,2]]}}}],["adaptor",{"_index":7,"t":{"156":{"position":[[0,7]]}}}],["app",{"_index":4,"t":{"84":{"position":[[3,3]]}}}],["basicauth",{"_index":8,"t":{"171":{"position":[[0,9]]}}}],["benchmark",{"_index":36,"t":{"471":{"position":[[3,10]]}}}],["cach",{"_index":9,"t":{"181":{"position":[[0,5]]}}}],["client",{"_index":2,"t":{"15":{"position":[[3,6]]}}}],["compress",{"_index":10,"t":{"191":{"position":[[0,8]]}}}],["constant",{"_index":3,"t":{"82":{"position":[[3,9]]}}}],["cooki",{"_index":16,"t":{"251":{"position":[[8,6]]}}}],["cor",{"_index":11,"t":{"203":{"position":[[0,4]]}}}],["csrf",{"_index":12,"t":{"213":{"position":[[0,4]]}}}],["ctx",{"_index":48,"t":{"562":{"position":[[3,3]]}}}],["earlydata",{"_index":13,"t":{"227":{"position":[[0,9]]}}}],["encrypt",{"_index":15,"t":{"251":{"position":[[0,7]]}}}],["envvar",{"_index":14,"t":{"239":{"position":[[0,6]]}}}],["error",{"_index":38,"t":{"501":{"position":[[3,5]]}}}],["etag",{"_index":17,"t":{"263":{"position":[[0,4]]}}}],["expvar",{"_index":18,"t":{"273":{"position":[[0,6]]}}}],["faq",{"_index":37,"t":{"486":{"position":[[3,3]]}}}],["faster",{"_index":41,"t":{"508":{"position":[[13,6]]}}}],["favicon",{"_index":19,"t":{"283":{"position":[[0,7]]}}}],["fiber",{"_index":5,"t":{"131":{"position":[[3,5]]},"508":{"position":[[7,5]]}}}],["filesystem",{"_index":20,"t":{"293":{"position":[[0,10]]}}}],["group",{"_index":42,"t":{"513":{"position":[[3,8]]}}}],["handl",{"_index":39,"t":{"501":{"position":[[9,8]]}}}],["handler",{"_index":47,"t":{"560":{"position":[[6,8]]}}}],["helmet",{"_index":21,"t":{"315":{"position":[[0,6]]}}}],["hook",{"_index":43,"t":{"519":{"position":[[3,5]]}}}],["idempot",{"_index":22,"t":{"325":{"position":[[0,11]]}}}],["keyauth",{"_index":23,"t":{"339":{"position":[[0,7]]}}}],["limit",{"_index":24,"t":{"353":{"position":[[0,7]]}}}],["log",{"_index":6,"t":{"140":{"position":[[0,3]]}}}],["logger",{"_index":25,"t":{"367":{"position":[[0,6]]}}}],["make",{"_index":40,"t":{"508":{"position":[[2,4]]}}}],["monitor",{"_index":26,"t":{"379":{"position":[[0,7]]}}}],["pprof",{"_index":27,"t":{"389":{"position":[[0,5]]}}}],["proxi",{"_index":28,"t":{"399":{"position":[[0,5]]}}}],["recov",{"_index":29,"t":{"409":{"position":[[0,7]]}}}],["redirect",{"_index":30,"t":{"419":{"position":[[0,8]]}}}],["requestid",{"_index":31,"t":{"429":{"position":[[0,9]]}}}],["rewrit",{"_index":32,"t":{"439":{"position":[[0,7]]}}}],["rout",{"_index":44,"t":{"539":{"position":[[3,7]]},"560":{"position":[[0,5]]}}}],["session",{"_index":33,"t":{"445":{"position":[[0,7]]}}}],["skip",{"_index":34,"t":{"459":{"position":[[0,4]]}}}],["templat",{"_index":45,"t":{"552":{"position":[[3,9]]}}}],["timeout",{"_index":35,"t":{"465":{"position":[[0,7]]}}}],["valid",{"_index":46,"t":{"557":{"position":[[3,10]]}}}],["welcom",{"_index":1,"t":{"1":{"position":[[3,7]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":3,"t":"Installation","u":"/next/","h":"#installation","p":1},{"i":5,"t":"Zero Allocation","u":"/next/","h":"#zero-allocation","p":1},{"i":7,"t":"Hello, World!","u":"/next/","h":"#hello-world","p":1},{"i":9,"t":"Basic routing","u":"/next/","h":"#basic-routing","p":1},{"i":11,"t":"Static files","u":"/next/","h":"#static-files","p":1},{"i":13,"t":"Note","u":"/next/","h":"#note","p":1},{"i":16,"t":"Start request","u":"/next/api/client","h":"#start-request","p":15},{"i":18,"t":"✨ Agent","u":"/next/api/client","h":"#-agent","p":15},{"i":20,"t":"Parse","u":"/next/api/client","h":"#parse","p":15},{"i":22,"t":"Set","u":"/next/api/client","h":"#set","p":15},{"i":24,"t":"Add","u":"/next/api/client","h":"#add","p":15},{"i":26,"t":"ConnectionClose","u":"/next/api/client","h":"#connectionclose","p":15},{"i":28,"t":"UserAgent","u":"/next/api/client","h":"#useragent","p":15},{"i":30,"t":"Cookie","u":"/next/api/client","h":"#cookie","p":15},{"i":32,"t":"Referer","u":"/next/api/client","h":"#referer","p":15},{"i":34,"t":"ContentType","u":"/next/api/client","h":"#contenttype","p":15},{"i":36,"t":"Host","u":"/next/api/client","h":"#host","p":15},{"i":38,"t":"QueryString","u":"/next/api/client","h":"#querystring","p":15},{"i":40,"t":"BasicAuth","u":"/next/api/client","h":"#basicauth","p":15},{"i":42,"t":"Body","u":"/next/api/client","h":"#body","p":15},{"i":44,"t":"JSON","u":"/next/api/client","h":"#json","p":15},{"i":46,"t":"XML","u":"/next/api/client","h":"#xml","p":15},{"i":48,"t":"Form","u":"/next/api/client","h":"#form","p":15},{"i":50,"t":"MultipartForm","u":"/next/api/client","h":"#multipartform","p":15},{"i":52,"t":"Debug","u":"/next/api/client","h":"#debug","p":15},{"i":54,"t":"Timeout","u":"/next/api/client","h":"#timeout","p":15},{"i":56,"t":"Reuse","u":"/next/api/client","h":"#reuse","p":15},{"i":58,"t":"InsecureSkipVerify","u":"/next/api/client","h":"#insecureskipverify","p":15},{"i":60,"t":"TLSConfig","u":"/next/api/client","h":"#tlsconfig","p":15},{"i":62,"t":"MaxRedirectsCount","u":"/next/api/client","h":"#maxredirectscount","p":15},{"i":64,"t":"JSONEncoder","u":"/next/api/client","h":"#jsonencoder","p":15},{"i":66,"t":"JSONDecoder","u":"/next/api/client","h":"#jsondecoder","p":15},{"i":68,"t":"Request","u":"/next/api/client","h":"#request","p":15},{"i":70,"t":"SetResponse","u":"/next/api/client","h":"#setresponse","p":15},{"i":72,"t":"Dest","u":"/next/api/client","h":"#dest","p":15},{"i":74,"t":"Bytes","u":"/next/api/client","h":"#bytes","p":15},{"i":76,"t":"String","u":"/next/api/client","h":"#string","p":15},{"i":78,"t":"Struct","u":"/next/api/client","h":"#struct","p":15},{"i":80,"t":"RetryIf","u":"/next/api/client","h":"#retryif","p":15},{"i":85,"t":"Static","u":"/next/api/app","h":"#static","p":84},{"i":87,"t":"Route Handlers","u":"/next/api/app","h":"#route-handlers","p":84},{"i":89,"t":"Mount","u":"/next/api/app","h":"#mount","p":84},{"i":91,"t":"MountPath","u":"/next/api/app","h":"#mountpath","p":84},{"i":93,"t":"Group","u":"/next/api/app","h":"#group","p":84},{"i":95,"t":"Route","u":"/next/api/app","h":"#route","p":84},{"i":97,"t":"Server","u":"/next/api/app","h":"#server","p":84},{"i":99,"t":"Server Shutdown","u":"/next/api/app","h":"#server-shutdown","p":84},{"i":101,"t":"HandlersCount","u":"/next/api/app","h":"#handlerscount","p":84},{"i":103,"t":"Stack","u":"/next/api/app","h":"#stack","p":84},{"i":105,"t":"Name","u":"/next/api/app","h":"#name","p":84},{"i":107,"t":"GetRoute","u":"/next/api/app","h":"#getroute","p":84},{"i":109,"t":"GetRoutes","u":"/next/api/app","h":"#getroutes","p":84},{"i":111,"t":"Config","u":"/next/api/app","h":"#config","p":84},{"i":113,"t":"Handler","u":"/next/api/app","h":"#handler","p":84},{"i":115,"t":"Listen","u":"/next/api/app","h":"#listen","p":84},{"i":117,"t":"ListenTLS","u":"/next/api/app","h":"#listentls","p":84},{"i":119,"t":"ListenTLSWithCertificate","u":"/next/api/app","h":"#listentlswithcertificate","p":84},{"i":121,"t":"ListenMutualTLS","u":"/next/api/app","h":"#listenmutualtls","p":84},{"i":123,"t":"ListenMutualTLSWithCertificate","u":"/next/api/app","h":"#listenmutualtlswithcertificate","p":84},{"i":125,"t":"Listener","u":"/next/api/app","h":"#listener","p":84},{"i":127,"t":"Test","u":"/next/api/app","h":"#test","p":84},{"i":129,"t":"Hooks","u":"/next/api/app","h":"#hooks","p":84},{"i":132,"t":"New","u":"/next/api/fiber","h":"#new","p":131},{"i":134,"t":"Config","u":"/next/api/fiber","h":"#config","p":131},{"i":136,"t":"NewError","u":"/next/api/fiber","h":"#newerror","p":131},{"i":138,"t":"IsChild","u":"/next/api/fiber","h":"#ischild","p":131},{"i":142,"t":"Log levels","u":"/next/api/log","h":"#log-levels","p":140},{"i":144,"t":"Custom log","u":"/next/api/log","h":"#custom-log","p":140},{"i":146,"t":"Print log","u":"/next/api/log","h":"#print-log","p":140},{"i":148,"t":"Global log","u":"/next/api/log","h":"#global-log","p":140},{"i":150,"t":"Set Level","u":"/next/api/log","h":"#set-level","p":140},{"i":152,"t":"Set output","u":"/next/api/log","h":"#set-output","p":140},{"i":154,"t":"Bind context","u":"/next/api/log","h":"#bind-context","p":140},{"i":158,"t":"Signatures","u":"/next/api/middleware/adaptor","h":"#signatures","p":156},{"i":160,"t":"Examples","u":"/next/api/middleware/adaptor","h":"#examples","p":156},{"i":161,"t":"net/http to Fiber","u":"/next/api/middleware/adaptor","h":"#nethttp-to-fiber","p":156},{"i":163,"t":"net/http middleware to Fiber","u":"/next/api/middleware/adaptor","h":"#nethttp-middleware-to-fiber","p":156},{"i":165,"t":"Fiber Handler to net/http","u":"/next/api/middleware/adaptor","h":"#fiber-handler-to-nethttp","p":156},{"i":167,"t":"Fiber App to net/http","u":"/next/api/middleware/adaptor","h":"#fiber-app-to-nethttp","p":156},{"i":169,"t":"Fiber Context to (net/http).Request","u":"/next/api/middleware/adaptor","h":"#fiber-context-to-nethttprequest","p":156},{"i":173,"t":"Signatures","u":"/next/api/middleware/basicauth","h":"#signatures","p":171},{"i":175,"t":"Examples","u":"/next/api/middleware/basicauth","h":"#examples","p":171},{"i":177,"t":"Config","u":"/next/api/middleware/basicauth","h":"#config","p":171},{"i":179,"t":"Default Config","u":"/next/api/middleware/basicauth","h":"#default-config","p":171},{"i":183,"t":"Signatures","u":"/next/api/middleware/cache","h":"#signatures","p":181},{"i":185,"t":"Examples","u":"/next/api/middleware/cache","h":"#examples","p":181},{"i":187,"t":"Config","u":"/next/api/middleware/cache","h":"#config","p":181},{"i":189,"t":"Default Config","u":"/next/api/middleware/cache","h":"#default-config","p":181},{"i":193,"t":"Signatures","u":"/next/api/middleware/compress","h":"#signatures","p":191},{"i":195,"t":"Examples","u":"/next/api/middleware/compress","h":"#examples","p":191},{"i":197,"t":"Config","u":"/next/api/middleware/compress","h":"#config","p":191},{"i":199,"t":"Default Config","u":"/next/api/middleware/compress","h":"#default-config","p":191},{"i":201,"t":"Constants","u":"/next/api/middleware/compress","h":"#constants","p":191},{"i":205,"t":"Signatures","u":"/next/api/middleware/cors","h":"#signatures","p":203},{"i":207,"t":"Examples","u":"/next/api/middleware/cors","h":"#examples","p":203},{"i":209,"t":"Config","u":"/next/api/middleware/cors","h":"#config","p":203},{"i":211,"t":"Default Config","u":"/next/api/middleware/cors","h":"#default-config","p":203},{"i":215,"t":"Signatures","u":"/next/api/middleware/csrf","h":"#signatures","p":213},{"i":217,"t":"Examples","u":"/next/api/middleware/csrf","h":"#examples","p":213},{"i":219,"t":"Config","u":"/next/api/middleware/csrf","h":"#config","p":213},{"i":221,"t":"Default Config","u":"/next/api/middleware/csrf","h":"#default-config","p":213},{"i":223,"t":"Constants","u":"/next/api/middleware/csrf","h":"#constants","p":213},{"i":225,"t":"Custom Storage/Database","u":"/next/api/middleware/csrf","h":"#custom-storagedatabase","p":213},{"i":229,"t":"Signatures","u":"/next/api/middleware/earlydata","h":"#signatures","p":227},{"i":231,"t":"Examples","u":"/next/api/middleware/earlydata","h":"#examples","p":227},{"i":233,"t":"Config","u":"/next/api/middleware/earlydata","h":"#config","p":227},{"i":235,"t":"Default Config","u":"/next/api/middleware/earlydata","h":"#default-config","p":227},{"i":237,"t":"Constants","u":"/next/api/middleware/earlydata","h":"#constants","p":227},{"i":241,"t":"Signatures","u":"/next/api/middleware/envvar","h":"#signatures","p":239},{"i":243,"t":"Examples","u":"/next/api/middleware/envvar","h":"#examples","p":239},{"i":245,"t":"Response","u":"/next/api/middleware/envvar","h":"#response","p":239},{"i":247,"t":"Config","u":"/next/api/middleware/envvar","h":"#config","p":239},{"i":249,"t":"Default Config","u":"/next/api/middleware/envvar","h":"#default-config","p":239},{"i":253,"t":"Signatures","u":"/next/api/middleware/encryptcookie","h":"#signatures","p":251},{"i":255,"t":"Examples","u":"/next/api/middleware/encryptcookie","h":"#examples","p":251},{"i":257,"t":"Config","u":"/next/api/middleware/encryptcookie","h":"#config","p":251},{"i":259,"t":"Default Config","u":"/next/api/middleware/encryptcookie","h":"#default-config","p":251},{"i":261,"t":"Usage of CSRF and Encryptcookie Middlewares with Custom Cookie Names","u":"/next/api/middleware/encryptcookie","h":"#usage-of-csrf-and-encryptcookie-middlewares-with-custom-cookie-names","p":251},{"i":265,"t":"Signatures","u":"/next/api/middleware/etag","h":"#signatures","p":263},{"i":267,"t":"Examples","u":"/next/api/middleware/etag","h":"#examples","p":263},{"i":269,"t":"Config","u":"/next/api/middleware/etag","h":"#config","p":263},{"i":271,"t":"Default Config","u":"/next/api/middleware/etag","h":"#default-config","p":263},{"i":275,"t":"Signatures","u":"/next/api/middleware/expvar","h":"#signatures","p":273},{"i":277,"t":"Examples","u":"/next/api/middleware/expvar","h":"#examples","p":273},{"i":279,"t":"Config","u":"/next/api/middleware/expvar","h":"#config","p":273},{"i":281,"t":"Default Config","u":"/next/api/middleware/expvar","h":"#default-config","p":273},{"i":285,"t":"Signatures","u":"/next/api/middleware/favicon","h":"#signatures","p":283},{"i":287,"t":"Examples","u":"/next/api/middleware/favicon","h":"#examples","p":283},{"i":289,"t":"Config","u":"/next/api/middleware/favicon","h":"#config","p":283},{"i":291,"t":"Default Config","u":"/next/api/middleware/favicon","h":"#default-config","p":283},{"i":295,"t":"Signatures","u":"/next/api/middleware/filesystem","h":"#signatures","p":293},{"i":297,"t":"Examples","u":"/next/api/middleware/filesystem","h":"#examples","p":293},{"i":299,"t":"embed","u":"/next/api/middleware/filesystem","h":"#embed","p":293},{"i":301,"t":"pkger","u":"/next/api/middleware/filesystem","h":"#pkger","p":293},{"i":303,"t":"packr","u":"/next/api/middleware/filesystem","h":"#packr","p":293},{"i":305,"t":"go.rice","u":"/next/api/middleware/filesystem","h":"#gorice","p":293},{"i":307,"t":"fileb0x","u":"/next/api/middleware/filesystem","h":"#fileb0x","p":293},{"i":309,"t":"statik","u":"/next/api/middleware/filesystem","h":"#statik","p":293},{"i":311,"t":"Config","u":"/next/api/middleware/filesystem","h":"#config","p":293},{"i":313,"t":"Default Config","u":"/next/api/middleware/filesystem","h":"#default-config","p":293},{"i":317,"t":"Signatures","u":"/next/api/middleware/helmet","h":"#signatures","p":315},{"i":319,"t":"Examples","u":"/next/api/middleware/helmet","h":"#examples","p":315},{"i":321,"t":"Config","u":"/next/api/middleware/helmet","h":"#config","p":315},{"i":323,"t":"Default Config","u":"/next/api/middleware/helmet","h":"#default-config","p":315},{"i":327,"t":"Signatures","u":"/next/api/middleware/idempotency","h":"#signatures","p":325},{"i":329,"t":"Examples","u":"/next/api/middleware/idempotency","h":"#examples","p":325},{"i":331,"t":"Default Config","u":"/next/api/middleware/idempotency","h":"#default-config","p":325},{"i":333,"t":"Custom Config","u":"/next/api/middleware/idempotency","h":"#custom-config","p":325},{"i":335,"t":"Config","u":"/next/api/middleware/idempotency","h":"#config","p":325},{"i":337,"t":"Default Config","u":"/next/api/middleware/idempotency","h":"#default-config-1","p":325},{"i":341,"t":"Signatures","u":"/next/api/middleware/keyauth","h":"#signatures","p":339},{"i":343,"t":"Examples","u":"/next/api/middleware/keyauth","h":"#examples","p":339},{"i":345,"t":"Authenticate only certain endpoints","u":"/next/api/middleware/keyauth","h":"#authenticate-only-certain-endpoints","p":339},{"i":347,"t":"Specifying middleware in the handler","u":"/next/api/middleware/keyauth","h":"#specifying-middleware-in-the-handler","p":339},{"i":349,"t":"Config","u":"/next/api/middleware/keyauth","h":"#config","p":339},{"i":351,"t":"Default Config","u":"/next/api/middleware/keyauth","h":"#default-config","p":339},{"i":355,"t":"Signatures","u":"/next/api/middleware/limiter","h":"#signatures","p":353},{"i":357,"t":"Examples","u":"/next/api/middleware/limiter","h":"#examples","p":353},{"i":359,"t":"Sliding window","u":"/next/api/middleware/limiter","h":"#sliding-window","p":353},{"i":361,"t":"Config","u":"/next/api/middleware/limiter","h":"#config","p":353},{"i":363,"t":"Default Config","u":"/next/api/middleware/limiter","h":"#default-config","p":353},{"i":365,"t":"Custom Storage/Database","u":"/next/api/middleware/limiter","h":"#custom-storagedatabase","p":353},{"i":369,"t":"Signatures","u":"/next/api/middleware/logger","h":"#signatures","p":367},{"i":371,"t":"Examples","u":"/next/api/middleware/logger","h":"#examples","p":367},{"i":373,"t":"Config","u":"/next/api/middleware/logger","h":"#config","p":367},{"i":375,"t":"Default Config","u":"/next/api/middleware/logger","h":"#default-config","p":367},{"i":377,"t":"Constants","u":"/next/api/middleware/logger","h":"#constants","p":367},{"i":381,"t":"Signatures","u":"/next/api/middleware/monitor","h":"#signatures","p":379},{"i":383,"t":"Examples","u":"/next/api/middleware/monitor","h":"#examples","p":379},{"i":385,"t":"Config","u":"/next/api/middleware/monitor","h":"#config","p":379},{"i":387,"t":"Default Config","u":"/next/api/middleware/monitor","h":"#default-config","p":379},{"i":391,"t":"Signatures","u":"/next/api/middleware/pprof","h":"#signatures","p":389},{"i":393,"t":"Examples","u":"/next/api/middleware/pprof","h":"#examples","p":389},{"i":395,"t":"Config","u":"/next/api/middleware/pprof","h":"#config","p":389},{"i":397,"t":"Default Config","u":"/next/api/middleware/pprof","h":"#default-config","p":389},{"i":401,"t":"Signatures","u":"/next/api/middleware/proxy","h":"#signatures","p":399},{"i":403,"t":"Examples","u":"/next/api/middleware/proxy","h":"#examples","p":399},{"i":405,"t":"Config","u":"/next/api/middleware/proxy","h":"#config","p":399},{"i":407,"t":"Default Config","u":"/next/api/middleware/proxy","h":"#default-config","p":399},{"i":411,"t":"Signatures","u":"/next/api/middleware/recover","h":"#signatures","p":409},{"i":413,"t":"Examples","u":"/next/api/middleware/recover","h":"#examples","p":409},{"i":415,"t":"Config","u":"/next/api/middleware/recover","h":"#config","p":409},{"i":417,"t":"Default Config","u":"/next/api/middleware/recover","h":"#default-config","p":409},{"i":421,"t":"Signatures","u":"/next/api/middleware/redirect","h":"#signatures","p":419},{"i":423,"t":"Examples","u":"/next/api/middleware/redirect","h":"#examples","p":419},{"i":425,"t":"Config","u":"/next/api/middleware/redirect","h":"#config","p":419},{"i":427,"t":"Default Config","u":"/next/api/middleware/redirect","h":"#default-config","p":419},{"i":431,"t":"Signatures","u":"/next/api/middleware/requestid","h":"#signatures","p":429},{"i":433,"t":"Examples","u":"/next/api/middleware/requestid","h":"#examples","p":429},{"i":435,"t":"Config","u":"/next/api/middleware/requestid","h":"#config","p":429},{"i":437,"t":"Default Config","u":"/next/api/middleware/requestid","h":"#default-config","p":429},{"i":441,"t":"Signatures","u":"/next/api/middleware/rewrite","h":"#signatures","p":439},{"i":443,"t":"Examples","u":"/next/api/middleware/rewrite","h":"#examples","p":439},{"i":447,"t":"Signatures","u":"/next/api/middleware/session","h":"#signatures","p":445},{"i":449,"t":"Examples","u":"/next/api/middleware/session","h":"#examples","p":445},{"i":451,"t":"Config","u":"/next/api/middleware/session","h":"#config","p":445},{"i":453,"t":"Default Config","u":"/next/api/middleware/session","h":"#default-config","p":445},{"i":455,"t":"Constants","u":"/next/api/middleware/session","h":"#constants","p":445},{"i":457,"t":"Custom Storage/Database","u":"/next/api/middleware/session","h":"#custom-storagedatabase","p":445},{"i":461,"t":"Signatures","u":"/next/api/middleware/skip","h":"#signatures","p":459},{"i":463,"t":"Examples","u":"/next/api/middleware/skip","h":"#examples","p":459},{"i":467,"t":"Signatures","u":"/next/api/middleware/timeout","h":"#signatures","p":465},{"i":469,"t":"Examples","u":"/next/api/middleware/timeout","h":"#examples","p":465},{"i":472,"t":"TechEmpower","u":"/next/extra/benchmarks","h":"#techempower","p":471},{"i":474,"t":"Plaintext","u":"/next/extra/benchmarks","h":"#plaintext","p":471},{"i":476,"t":"Data Updates","u":"/next/extra/benchmarks","h":"#data-updates","p":471},{"i":478,"t":"Multiple Queries","u":"/next/extra/benchmarks","h":"#multiple-queries","p":471},{"i":480,"t":"Single Query","u":"/next/extra/benchmarks","h":"#single-query","p":471},{"i":482,"t":"JSON Serialization","u":"/next/extra/benchmarks","h":"#json-serialization","p":471},{"i":484,"t":"Go web framework benchmark","u":"/next/extra/benchmarks","h":"#go-web-framework-benchmark","p":471},{"i":487,"t":"How should I structure my application?","u":"/next/extra/faq","h":"#how-should-i-structure-my-application","p":486},{"i":489,"t":"How do I handle custom 404 responses?","u":"/next/extra/faq","h":"#how-do-i-handle-custom-404-responses","p":486},{"i":491,"t":"How can i use live reload ?","u":"/next/extra/faq","h":"#how-can-i-use-live-reload-","p":486},{"i":493,"t":"How do I set up an error handler?","u":"/next/extra/faq","h":"#how-do-i-set-up-an-error-handler","p":486},{"i":495,"t":"Which template engines does Fiber support?","u":"/next/extra/faq","h":"#which-template-engines-does-fiber-support","p":486},{"i":497,"t":"Does Fiber have a community chat?","u":"/next/extra/faq","h":"#does-fiber-have-a-community-chat","p":486},{"i":499,"t":"Does fiber support sub domain routing ?","u":"/next/extra/faq","h":"#does-fiber-support-sub-domain-routing-","p":486},{"i":502,"t":"Catching Errors","u":"/next/guide/error-handling","h":"#catching-errors","p":501},{"i":504,"t":"Default Error Handler","u":"/next/guide/error-handling","h":"#default-error-handler","p":501},{"i":506,"t":"Custom Error Handler","u":"/next/guide/error-handling","h":"#custom-error-handler","p":501},{"i":509,"t":"Custom JSON Encoder/Decoder","u":"/next/guide/faster-fiber","h":"#custom-json-encoderdecoder","p":508},{"i":511,"t":"References","u":"/next/guide/faster-fiber","h":"#references","p":508},{"i":515,"t":"Paths","u":"/next/guide/grouping","h":"#paths","p":513},{"i":517,"t":"Group Handlers","u":"/next/guide/grouping","h":"#group-handlers","p":513},{"i":521,"t":"Constants","u":"/next/guide/hooks","h":"#constants","p":519},{"i":523,"t":"OnRoute","u":"/next/guide/hooks","h":"#onroute","p":519},{"i":525,"t":"OnName","u":"/next/guide/hooks","h":"#onname","p":519},{"i":527,"t":"OnGroup","u":"/next/guide/hooks","h":"#ongroup","p":519},{"i":529,"t":"OnGroupName","u":"/next/guide/hooks","h":"#ongroupname","p":519},{"i":531,"t":"OnListen","u":"/next/guide/hooks","h":"#onlisten","p":519},{"i":533,"t":"OnFork","u":"/next/guide/hooks","h":"#onfork","p":519},{"i":535,"t":"OnShutdown","u":"/next/guide/hooks","h":"#onshutdown","p":519},{"i":537,"t":"OnMount","u":"/next/guide/hooks","h":"#onmount","p":519},{"i":540,"t":"Handlers","u":"/next/guide/routing","h":"#handlers","p":539},{"i":542,"t":"Paths","u":"/next/guide/routing","h":"#paths","p":539},{"i":544,"t":"Parameters","u":"/next/guide/routing","h":"#parameters","p":539},{"i":546,"t":"Constraints","u":"/next/guide/routing","h":"#constraints","p":539},{"i":548,"t":"Middleware","u":"/next/guide/routing","h":"#middleware","p":539},{"i":550,"t":"Grouping","u":"/next/guide/routing","h":"#grouping","p":539},{"i":553,"t":"Template interfaces","u":"/next/guide/templates","h":"#template-interfaces","p":552},{"i":555,"t":"Engines","u":"/next/guide/templates","h":"#engines","p":552},{"i":558,"t":"Validator package","u":"/next/guide/validation","h":"#validator-package","p":557},{"i":563,"t":"Accepts","u":"/next/api/ctx","h":"#accepts","p":562},{"i":565,"t":"AllParams","u":"/next/api/ctx","h":"#allparams","p":562},{"i":567,"t":"App","u":"/next/api/ctx","h":"#app","p":562},{"i":569,"t":"Append","u":"/next/api/ctx","h":"#append","p":562},{"i":571,"t":"Attachment","u":"/next/api/ctx","h":"#attachment","p":562},{"i":573,"t":"BaseURL","u":"/next/api/ctx","h":"#baseurl","p":562},{"i":575,"t":"Bind","u":"/next/api/ctx","h":"#bind","p":562},{"i":577,"t":"Body","u":"/next/api/ctx","h":"#body","p":562},{"i":579,"t":"BodyParser","u":"/next/api/ctx","h":"#bodyparser","p":562},{"i":581,"t":"ClearCookie","u":"/next/api/ctx","h":"#clearcookie","p":562},{"i":583,"t":"ClientHelloInfo","u":"/next/api/ctx","h":"#clienthelloinfo","p":562},{"i":585,"t":"Context","u":"/next/api/ctx","h":"#context","p":562},{"i":587,"t":"Cookie","u":"/next/api/ctx","h":"#cookie","p":562},{"i":589,"t":"Cookies","u":"/next/api/ctx","h":"#cookies","p":562},{"i":591,"t":"Download","u":"/next/api/ctx","h":"#download","p":562},{"i":593,"t":"Format","u":"/next/api/ctx","h":"#format","p":562},{"i":595,"t":"FormFile","u":"/next/api/ctx","h":"#formfile","p":562},{"i":597,"t":"FormValue","u":"/next/api/ctx","h":"#formvalue","p":562},{"i":599,"t":"Fresh","u":"/next/api/ctx","h":"#fresh","p":562},{"i":601,"t":"Get","u":"/next/api/ctx","h":"#get","p":562},{"i":603,"t":"GetReqHeaders","u":"/next/api/ctx","h":"#getreqheaders","p":562},{"i":605,"t":"GetRespHeader","u":"/next/api/ctx","h":"#getrespheader","p":562},{"i":607,"t":"GetRespHeaders","u":"/next/api/ctx","h":"#getrespheaders","p":562},{"i":609,"t":"GetRouteURL","u":"/next/api/ctx","h":"#getrouteurl","p":562},{"i":611,"t":"Hostname","u":"/next/api/ctx","h":"#hostname","p":562},{"i":613,"t":"IP","u":"/next/api/ctx","h":"#ip","p":562},{"i":615,"t":"IPs","u":"/next/api/ctx","h":"#ips","p":562},{"i":617,"t":"Is","u":"/next/api/ctx","h":"#is","p":562},{"i":619,"t":"IsFromLocal","u":"/next/api/ctx","h":"#isfromlocal","p":562},{"i":621,"t":"JSON","u":"/next/api/ctx","h":"#json","p":562},{"i":623,"t":"JSONP","u":"/next/api/ctx","h":"#jsonp","p":562},{"i":625,"t":"Links","u":"/next/api/ctx","h":"#links","p":562},{"i":627,"t":"Locals","u":"/next/api/ctx","h":"#locals","p":562},{"i":629,"t":"Location","u":"/next/api/ctx","h":"#location","p":562},{"i":631,"t":"Method","u":"/next/api/ctx","h":"#method","p":562},{"i":633,"t":"MultipartForm","u":"/next/api/ctx","h":"#multipartform","p":562},{"i":635,"t":"Next","u":"/next/api/ctx","h":"#next","p":562},{"i":637,"t":"OriginalURL","u":"/next/api/ctx","h":"#originalurl","p":562},{"i":639,"t":"Params","u":"/next/api/ctx","h":"#params","p":562},{"i":641,"t":"ParamsInt","u":"/next/api/ctx","h":"#paramsint","p":562},{"i":643,"t":"ParamsParser","u":"/next/api/ctx","h":"#paramsparser","p":562},{"i":645,"t":"Path","u":"/next/api/ctx","h":"#path","p":562},{"i":647,"t":"Protocol","u":"/next/api/ctx","h":"#protocol","p":562},{"i":649,"t":"Queries","u":"/next/api/ctx","h":"#queries","p":562},{"i":651,"t":"Query","u":"/next/api/ctx","h":"#query","p":562},{"i":653,"t":"QueryBool","u":"/next/api/ctx","h":"#querybool","p":562},{"i":655,"t":"QueryFloat","u":"/next/api/ctx","h":"#queryfloat","p":562},{"i":657,"t":"QueryInt","u":"/next/api/ctx","h":"#queryint","p":562},{"i":659,"t":"QueryParser","u":"/next/api/ctx","h":"#queryparser","p":562},{"i":661,"t":"Range","u":"/next/api/ctx","h":"#range","p":562},{"i":663,"t":"Redirect","u":"/next/api/ctx","h":"#redirect","p":562},{"i":665,"t":"RedirectToRoute","u":"/next/api/ctx","h":"#redirecttoroute","p":562},{"i":667,"t":"RedirectBack","u":"/next/api/ctx","h":"#redirectback","p":562},{"i":669,"t":"Render","u":"/next/api/ctx","h":"#render","p":562},{"i":671,"t":"Request","u":"/next/api/ctx","h":"#request","p":562},{"i":673,"t":"ReqHeaderParser","u":"/next/api/ctx","h":"#reqheaderparser","p":562},{"i":675,"t":"Response","u":"/next/api/ctx","h":"#response","p":562},{"i":677,"t":"RestartRouting","u":"/next/api/ctx","h":"#restartrouting","p":562},{"i":679,"t":"Route","u":"/next/api/ctx","h":"#route","p":562},{"i":681,"t":"SaveFile","u":"/next/api/ctx","h":"#savefile","p":562},{"i":683,"t":"SaveFileToStorage","u":"/next/api/ctx","h":"#savefiletostorage","p":562},{"i":685,"t":"Secure","u":"/next/api/ctx","h":"#secure","p":562},{"i":687,"t":"Send","u":"/next/api/ctx","h":"#send","p":562},{"i":689,"t":"SendFile","u":"/next/api/ctx","h":"#sendfile","p":562},{"i":691,"t":"SendStatus","u":"/next/api/ctx","h":"#sendstatus","p":562},{"i":693,"t":"Set","u":"/next/api/ctx","h":"#set","p":562},{"i":695,"t":"SetParserDecoder","u":"/next/api/ctx","h":"#setparserdecoder","p":562},{"i":697,"t":"SetUserContext","u":"/next/api/ctx","h":"#setusercontext","p":562},{"i":699,"t":"Stale","u":"/next/api/ctx","h":"#stale","p":562},{"i":701,"t":"Status","u":"/next/api/ctx","h":"#status","p":562},{"i":703,"t":"Subdomains","u":"/next/api/ctx","h":"#subdomains","p":562},{"i":705,"t":"Type","u":"/next/api/ctx","h":"#type","p":562},{"i":707,"t":"UserContext","u":"/next/api/ctx","h":"#usercontext","p":562},{"i":709,"t":"Vary","u":"/next/api/ctx","h":"#vary","p":562},{"i":711,"t":"Write","u":"/next/api/ctx","h":"#write","p":562},{"i":713,"t":"Writef","u":"/next/api/ctx","h":"#writef","p":562},{"i":715,"t":"WriteString","u":"/next/api/ctx","h":"#writestring","p":562},{"i":717,"t":"XHR","u":"/next/api/ctx","h":"#xhr","p":562},{"i":719,"t":"XML","u":"/next/api/ctx","h":"#xml","p":562}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/3",[0,5.942]],["t/5",[1,4.415,2,4.415]],["t/7",[3,4.415,4,4.415]],["t/9",[5,4.415,6,3.346]],["t/11",[7,3.995,8,4.415]],["t/13",[9,5.942]],["t/16",[10,4.415,11,3.718]],["t/18",[12,3.718,13,4.415]],["t/20",[14,5.942]],["t/22",[15,4.504]],["t/24",[16,5.942]],["t/26",[17,5.942]],["t/28",[18,5.942]],["t/30",[19,4.726]],["t/32",[20,5.377]],["t/34",[21,5.942]],["t/36",[22,5.942]],["t/38",[23,5.942]],["t/40",[24,5.942]],["t/42",[25,5.377]],["t/44",[26,4.726]],["t/46",[27,5.377]],["t/48",[28,5.942]],["t/50",[29,5.377]],["t/52",[30,5.942]],["t/54",[31,5.942]],["t/56",[32,5.942]],["t/58",[33,5.942]],["t/60",[34,5.942]],["t/62",[35,5.942]],["t/64",[36,5.942]],["t/66",[37,5.942]],["t/68",[11,5.004]],["t/70",[38,5.942]],["t/72",[39,5.942]],["t/74",[40,5.942]],["t/76",[41,5.942]],["t/78",[42,5.942]],["t/80",[43,5.942]],["t/85",[7,5.377]],["t/87",[6,3.346,44,2.897]],["t/89",[45,5.942]],["t/91",[46,5.942]],["t/93",[47,5.004]],["t/95",[6,4.504]],["t/97",[48,5.377]],["t/99",[48,3.995,49,4.415]],["t/101",[50,5.942]],["t/103",[51,5.942]],["t/105",[52,5.377]],["t/107",[53,5.377]],["t/109",[53,5.377]],["t/111",[54,2.007]],["t/113",[44,3.899]],["t/115",[55,5.377]],["t/117",[56,5.942]],["t/119",[57,5.942]],["t/121",[58,5.942]],["t/123",[59,5.942]],["t/125",[55,5.377]],["t/127",[60,5.942]],["t/129",[61,5.942]],["t/132",[62,5.942]],["t/134",[54,2.007]],["t/136",[63,5.942]],["t/138",[64,5.942]],["t/142",[65,3.511,66,3.995]],["t/144",[65,3.511,67,2.897]],["t/146",[65,3.511,68,4.415]],["t/148",[65,3.511,69,4.415]],["t/150",[15,3.346,66,3.995]],["t/152",[15,3.346,70,4.415]],["t/154",[71,3.995,72,3.718]],["t/158",[73,2.683]],["t/160",[74,2.683]],["t/161",[75,3.511,76,2.988]],["t/163",[75,2.793,76,2.377,77,2.793]],["t/165",[44,2.304,75,2.793,76,2.377]],["t/167",[75,2.793,76,2.377,78,3.178]],["t/169",[72,2.958,76,2.377,79,3.512]],["t/173",[73,2.683]],["t/175",[74,2.683]],["t/177",[54,2.007]],["t/179",[54,1.491,80,2.053]],["t/183",[73,2.683]],["t/185",[74,2.683]],["t/187",[54,2.007]],["t/189",[54,1.491,80,2.053]],["t/193",[73,2.683]],["t/195",[74,2.683]],["t/197",[54,2.007]],["t/199",[54,1.491,80,2.053]],["t/201",[81,4.319]],["t/205",[73,2.683]],["t/207",[74,2.683]],["t/209",[54,2.007]],["t/211",[54,1.491,80,2.053]],["t/215",[73,2.683]],["t/217",[74,2.683]],["t/219",[54,2.007]],["t/221",[54,1.491,80,2.053]],["t/223",[81,4.319]],["t/225",[67,2.897,82,3.718]],["t/229",[73,2.683]],["t/231",[74,2.683]],["t/233",[54,2.007]],["t/235",[54,1.491,80,2.053]],["t/237",[81,4.319]],["t/241",[73,2.683]],["t/243",[74,2.683]],["t/245",[83,5.004]],["t/247",[54,2.007]],["t/249",[54,1.491,80,2.053]],["t/253",[73,2.683]],["t/255",[74,2.683]],["t/257",[54,2.007]],["t/259",[54,1.491,80,2.053]],["t/261",[19,1.536,52,1.748,67,1.268,77,1.536,84,1.932,85,1.932,86,1.932]],["t/265",[73,2.683]],["t/267",[74,2.683]],["t/269",[54,2.007]],["t/271",[54,1.491,80,2.053]],["t/275",[73,2.683]],["t/277",[74,2.683]],["t/279",[54,2.007]],["t/281",[54,1.491,80,2.053]],["t/285",[73,2.683]],["t/287",[74,2.683]],["t/289",[54,2.007]],["t/291",[54,1.491,80,2.053]],["t/295",[73,2.683]],["t/297",[74,2.683]],["t/299",[87,5.942]],["t/301",[88,5.942]],["t/303",[89,5.942]],["t/305",[90,5.942]],["t/307",[91,5.942]],["t/309",[92,5.942]],["t/311",[54,2.007]],["t/313",[54,1.491,80,2.053]],["t/317",[73,2.683]],["t/319",[74,2.683]],["t/321",[54,2.007]],["t/323",[54,1.491,80,2.053]],["t/327",[73,2.683]],["t/329",[74,2.683]],["t/331",[54,1.491,80,2.053]],["t/333",[54,1.491,67,2.897]],["t/335",[54,2.007]],["t/337",[54,1.491,80,2.053]],["t/341",[73,2.683]],["t/343",[74,2.683]],["t/345",[93,3.512,94,3.512,95,3.512]],["t/347",[44,2.304,77,2.793,96,3.512]],["t/349",[54,2.007]],["t/351",[54,1.491,80,2.053]],["t/355",[73,2.683]],["t/357",[74,2.683]],["t/359",[97,4.415,98,4.415]],["t/361",[54,2.007]],["t/363",[54,1.491,80,2.053]],["t/365",[67,2.897,82,3.718]],["t/369",[73,2.683]],["t/371",[74,2.683]],["t/373",[54,2.007]],["t/375",[54,1.491,80,2.053]],["t/377",[81,4.319]],["t/381",[73,2.683]],["t/383",[74,2.683]],["t/385",[54,2.007]],["t/387",[54,1.491,80,2.053]],["t/391",[73,2.683]],["t/393",[74,2.683]],["t/395",[54,2.007]],["t/397",[54,1.491,80,2.053]],["t/401",[73,2.683]],["t/403",[74,2.683]],["t/405",[54,2.007]],["t/407",[54,1.491,80,2.053]],["t/411",[73,2.683]],["t/413",[74,2.683]],["t/415",[54,2.007]],["t/417",[54,1.491,80,2.053]],["t/421",[73,2.683]],["t/423",[74,2.683]],["t/425",[54,2.007]],["t/427",[54,1.491,80,2.053]],["t/431",[73,2.683]],["t/433",[74,2.683]],["t/435",[54,2.007]],["t/437",[54,1.491,80,2.053]],["t/441",[73,2.683]],["t/443",[74,2.683]],["t/447",[73,2.683]],["t/449",[74,2.683]],["t/451",[54,2.007]],["t/453",[54,1.491,80,2.053]],["t/455",[81,4.319]],["t/457",[67,2.897,82,3.718]],["t/461",[73,2.683]],["t/463",[74,2.683]],["t/467",[73,2.683]],["t/469",[74,2.683]],["t/472",[99,5.942]],["t/474",[100,5.942]],["t/476",[101,4.415,102,4.415]],["t/478",[103,4.415,104,3.511]],["t/480",[104,3.511,105,4.415]],["t/482",[26,3.511,106,4.415]],["t/484",[107,2.916,108,2.916,109,2.916,110,2.916]],["t/487",[111,4.415,112,4.415]],["t/489",[67,1.913,83,2.455,113,2.916,114,2.916]],["t/491",[12,2.455,115,2.916,116,2.916,117,2.916]],["t/493",[15,2.21,44,1.913,118,2.916,119,2.319]],["t/495",[76,1.974,120,2.638,121,2.638,122,2.638]],["t/497",[76,2.377,123,3.512,124,3.512]],["t/499",[6,1.65,12,1.833,76,1.473,122,1.969,125,2.176,126,2.176]],["t/502",[119,3.511,127,4.415]],["t/504",[44,2.304,80,1.633,119,2.793]],["t/506",[44,2.304,67,2.304,119,2.793]],["t/509",[26,2.793,67,2.304,128,3.512]],["t/511",[20,5.377]],["t/515",[129,5.004]],["t/517",[44,2.897,47,3.718]],["t/521",[81,4.319]],["t/523",[130,5.942]],["t/525",[131,5.942]],["t/527",[132,5.942]],["t/529",[133,5.942]],["t/531",[134,5.942]],["t/533",[135,5.942]],["t/535",[136,5.942]],["t/537",[137,5.942]],["t/540",[44,3.899]],["t/542",[129,5.004]],["t/544",[138,5.942]],["t/546",[139,5.942]],["t/548",[77,4.726]],["t/550",[47,5.004]],["t/553",[120,3.995,140,4.415]],["t/555",[121,5.377]],["t/558",[141,4.415,142,4.415]],["t/563",[143,5.942]],["t/565",[144,5.942]],["t/567",[78,5.377]],["t/569",[145,5.942]],["t/571",[146,5.942]],["t/573",[147,5.942]],["t/575",[71,5.377]],["t/577",[25,5.377]],["t/579",[148,5.942]],["t/581",[149,5.942]],["t/583",[150,5.942]],["t/585",[72,5.004]],["t/587",[19,4.726]],["t/589",[19,4.726]],["t/591",[151,5.942]],["t/593",[152,5.942]],["t/595",[153,5.942]],["t/597",[154,5.942]],["t/599",[155,5.942]],["t/601",[]],["t/603",[156,5.942]],["t/605",[157,5.377]],["t/607",[157,5.377]],["t/609",[158,5.942]],["t/611",[159,5.942]],["t/613",[160,5.377]],["t/615",[160,5.377]],["t/617",[]],["t/619",[161,5.942]],["t/621",[26,4.726]],["t/623",[162,5.942]],["t/625",[163,5.942]],["t/627",[164,5.942]],["t/629",[165,5.942]],["t/631",[166,5.942]],["t/633",[29,5.377]],["t/635",[167,5.942]],["t/637",[168,5.942]],["t/639",[169,5.942]],["t/641",[170,5.942]],["t/643",[171,5.942]],["t/645",[129,5.004]],["t/647",[172,5.942]],["t/649",[104,4.726]],["t/651",[104,4.726]],["t/653",[173,5.942]],["t/655",[174,5.942]],["t/657",[175,5.942]],["t/659",[176,5.942]],["t/661",[177,5.942]],["t/663",[178,5.942]],["t/665",[179,5.942]],["t/667",[180,5.942]],["t/669",[181,5.942]],["t/671",[11,5.004]],["t/673",[182,5.942]],["t/675",[83,5.004]],["t/677",[183,5.942]],["t/679",[6,4.504]],["t/681",[184,5.942]],["t/683",[185,5.942]],["t/685",[186,5.942]],["t/687",[187,5.942]],["t/689",[188,5.942]],["t/691",[189,5.942]],["t/693",[15,4.504]],["t/695",[190,5.942]],["t/697",[191,5.942]],["t/699",[192,5.942]],["t/701",[193,5.942]],["t/703",[194,5.942]],["t/705",[195,5.942]],["t/707",[196,5.942]],["t/709",[197,5.942]],["t/711",[198,5.942]],["t/713",[199,5.942]],["t/715",[200,5.942]],["t/717",[201,5.942]],["t/719",[27,5.377]]],"invertedIndex":[["",{"_index":12,"t":{"18":{"position":[[0,1]]},"491":{"position":[[26,1]]},"499":{"position":[[38,1]]}}}],["404",{"_index":114,"t":{"489":{"position":[[23,3]]}}}],["accept",{"_index":143,"t":{"563":{"position":[[0,7]]}}}],["add",{"_index":16,"t":{"24":{"position":[[0,3]]}}}],["agent",{"_index":13,"t":{"18":{"position":[[2,5]]}}}],["alloc",{"_index":2,"t":{"5":{"position":[[5,10]]}}}],["allparam",{"_index":144,"t":{"565":{"position":[[0,9]]}}}],["app",{"_index":78,"t":{"167":{"position":[[6,3]]},"567":{"position":[[0,3]]}}}],["append",{"_index":145,"t":{"569":{"position":[[0,6]]}}}],["applic",{"_index":112,"t":{"487":{"position":[[26,12]]}}}],["attach",{"_index":146,"t":{"571":{"position":[[0,10]]}}}],["authent",{"_index":93,"t":{"345":{"position":[[0,12]]}}}],["baseurl",{"_index":147,"t":{"573":{"position":[[0,7]]}}}],["basic",{"_index":5,"t":{"9":{"position":[[0,5]]}}}],["basicauth",{"_index":24,"t":{"40":{"position":[[0,9]]}}}],["benchmark",{"_index":110,"t":{"484":{"position":[[17,9]]}}}],["bind",{"_index":71,"t":{"154":{"position":[[0,4]]},"575":{"position":[[0,4]]}}}],["bodi",{"_index":25,"t":{"42":{"position":[[0,4]]},"577":{"position":[[0,4]]}}}],["bodypars",{"_index":148,"t":{"579":{"position":[[0,10]]}}}],["byte",{"_index":40,"t":{"74":{"position":[[0,5]]}}}],["catch",{"_index":127,"t":{"502":{"position":[[0,8]]}}}],["certain",{"_index":94,"t":{"345":{"position":[[18,7]]}}}],["chat",{"_index":124,"t":{"497":{"position":[[28,5]]}}}],["clearcooki",{"_index":149,"t":{"581":{"position":[[0,11]]}}}],["clienthelloinfo",{"_index":150,"t":{"583":{"position":[[0,15]]}}}],["commun",{"_index":123,"t":{"497":{"position":[[18,9]]}}}],["config",{"_index":54,"t":{"111":{"position":[[0,6]]},"134":{"position":[[0,6]]},"177":{"position":[[0,6]]},"179":{"position":[[8,6]]},"187":{"position":[[0,6]]},"189":{"position":[[8,6]]},"197":{"position":[[0,6]]},"199":{"position":[[8,6]]},"209":{"position":[[0,6]]},"211":{"position":[[8,6]]},"219":{"position":[[0,6]]},"221":{"position":[[8,6]]},"233":{"position":[[0,6]]},"235":{"position":[[8,6]]},"247":{"position":[[0,6]]},"249":{"position":[[8,6]]},"257":{"position":[[0,6]]},"259":{"position":[[8,6]]},"269":{"position":[[0,6]]},"271":{"position":[[8,6]]},"279":{"position":[[0,6]]},"281":{"position":[[8,6]]},"289":{"position":[[0,6]]},"291":{"position":[[8,6]]},"311":{"position":[[0,6]]},"313":{"position":[[8,6]]},"321":{"position":[[0,6]]},"323":{"position":[[8,6]]},"331":{"position":[[8,6]]},"333":{"position":[[7,6]]},"335":{"position":[[0,6]]},"337":{"position":[[8,6]]},"349":{"position":[[0,6]]},"351":{"position":[[8,6]]},"361":{"position":[[0,6]]},"363":{"position":[[8,6]]},"373":{"position":[[0,6]]},"375":{"position":[[8,6]]},"385":{"position":[[0,6]]},"387":{"position":[[8,6]]},"395":{"position":[[0,6]]},"397":{"position":[[8,6]]},"405":{"position":[[0,6]]},"407":{"position":[[8,6]]},"415":{"position":[[0,6]]},"417":{"position":[[8,6]]},"425":{"position":[[0,6]]},"427":{"position":[[8,6]]},"435":{"position":[[0,6]]},"437":{"position":[[8,6]]},"451":{"position":[[0,6]]},"453":{"position":[[8,6]]}}}],["connectionclos",{"_index":17,"t":{"26":{"position":[[0,15]]}}}],["constant",{"_index":81,"t":{"201":{"position":[[0,9]]},"223":{"position":[[0,9]]},"237":{"position":[[0,9]]},"377":{"position":[[0,9]]},"455":{"position":[[0,9]]},"521":{"position":[[0,9]]}}}],["constraint",{"_index":139,"t":{"546":{"position":[[0,11]]}}}],["contenttyp",{"_index":21,"t":{"34":{"position":[[0,11]]}}}],["context",{"_index":72,"t":{"154":{"position":[[5,7]]},"169":{"position":[[6,7]]},"585":{"position":[[0,7]]}}}],["cooki",{"_index":19,"t":{"30":{"position":[[0,6]]},"261":{"position":[[56,6]]},"587":{"position":[[0,6]]},"589":{"position":[[0,7]]}}}],["csrf",{"_index":85,"t":{"261":{"position":[[9,4]]}}}],["custom",{"_index":67,"t":{"144":{"position":[[0,6]]},"225":{"position":[[0,6]]},"261":{"position":[[49,6]]},"333":{"position":[[0,6]]},"365":{"position":[[0,6]]},"457":{"position":[[0,6]]},"489":{"position":[[16,6]]},"506":{"position":[[0,6]]},"509":{"position":[[0,6]]}}}],["data",{"_index":101,"t":{"476":{"position":[[0,4]]}}}],["debug",{"_index":30,"t":{"52":{"position":[[0,5]]}}}],["default",{"_index":80,"t":{"179":{"position":[[0,7]]},"189":{"position":[[0,7]]},"199":{"position":[[0,7]]},"211":{"position":[[0,7]]},"221":{"position":[[0,7]]},"235":{"position":[[0,7]]},"249":{"position":[[0,7]]},"259":{"position":[[0,7]]},"271":{"position":[[0,7]]},"281":{"position":[[0,7]]},"291":{"position":[[0,7]]},"313":{"position":[[0,7]]},"323":{"position":[[0,7]]},"331":{"position":[[0,7]]},"337":{"position":[[0,7]]},"351":{"position":[[0,7]]},"363":{"position":[[0,7]]},"375":{"position":[[0,7]]},"387":{"position":[[0,7]]},"397":{"position":[[0,7]]},"407":{"position":[[0,7]]},"417":{"position":[[0,7]]},"427":{"position":[[0,7]]},"437":{"position":[[0,7]]},"453":{"position":[[0,7]]},"504":{"position":[[0,7]]}}}],["dest",{"_index":39,"t":{"72":{"position":[[0,4]]}}}],["domain",{"_index":126,"t":{"499":{"position":[[23,6]]}}}],["download",{"_index":151,"t":{"591":{"position":[[0,8]]}}}],["emb",{"_index":87,"t":{"299":{"position":[[0,5]]}}}],["encoder/decod",{"_index":128,"t":{"509":{"position":[[12,15]]}}}],["encryptcooki",{"_index":86,"t":{"261":{"position":[[18,13]]}}}],["endpoint",{"_index":95,"t":{"345":{"position":[[26,9]]}}}],["engin",{"_index":121,"t":{"495":{"position":[[15,7]]},"555":{"position":[[0,7]]}}}],["error",{"_index":119,"t":{"493":{"position":[[19,5]]},"502":{"position":[[9,6]]},"504":{"position":[[8,5]]},"506":{"position":[[7,5]]}}}],["exampl",{"_index":74,"t":{"160":{"position":[[0,8]]},"175":{"position":[[0,8]]},"185":{"position":[[0,8]]},"195":{"position":[[0,8]]},"207":{"position":[[0,8]]},"217":{"position":[[0,8]]},"231":{"position":[[0,8]]},"243":{"position":[[0,8]]},"255":{"position":[[0,8]]},"267":{"position":[[0,8]]},"277":{"position":[[0,8]]},"287":{"position":[[0,8]]},"297":{"position":[[0,8]]},"319":{"position":[[0,8]]},"329":{"position":[[0,8]]},"343":{"position":[[0,8]]},"357":{"position":[[0,8]]},"371":{"position":[[0,8]]},"383":{"position":[[0,8]]},"393":{"position":[[0,8]]},"403":{"position":[[0,8]]},"413":{"position":[[0,8]]},"423":{"position":[[0,8]]},"433":{"position":[[0,8]]},"443":{"position":[[0,8]]},"449":{"position":[[0,8]]},"463":{"position":[[0,8]]},"469":{"position":[[0,8]]}}}],["fiber",{"_index":76,"t":{"161":{"position":[[12,5]]},"163":{"position":[[23,5]]},"165":{"position":[[0,5]]},"167":{"position":[[0,5]]},"169":{"position":[[0,5]]},"495":{"position":[[28,5]]},"497":{"position":[[5,5]]},"499":{"position":[[5,5]]}}}],["file",{"_index":8,"t":{"11":{"position":[[7,5]]}}}],["fileb0x",{"_index":91,"t":{"307":{"position":[[0,7]]}}}],["form",{"_index":28,"t":{"48":{"position":[[0,4]]}}}],["format",{"_index":152,"t":{"593":{"position":[[0,6]]}}}],["formfil",{"_index":153,"t":{"595":{"position":[[0,8]]}}}],["formvalu",{"_index":154,"t":{"597":{"position":[[0,9]]}}}],["framework",{"_index":109,"t":{"484":{"position":[[7,9]]}}}],["fresh",{"_index":155,"t":{"599":{"position":[[0,5]]}}}],["getreqhead",{"_index":156,"t":{"603":{"position":[[0,13]]}}}],["getresphead",{"_index":157,"t":{"605":{"position":[[0,13]]},"607":{"position":[[0,14]]}}}],["getrout",{"_index":53,"t":{"107":{"position":[[0,8]]},"109":{"position":[[0,9]]}}}],["getrouteurl",{"_index":158,"t":{"609":{"position":[[0,11]]}}}],["global",{"_index":69,"t":{"148":{"position":[[0,6]]}}}],["go",{"_index":107,"t":{"484":{"position":[[0,2]]}}}],["go.ric",{"_index":90,"t":{"305":{"position":[[0,7]]}}}],["group",{"_index":47,"t":{"93":{"position":[[0,5]]},"517":{"position":[[0,5]]},"550":{"position":[[0,8]]}}}],["handl",{"_index":113,"t":{"489":{"position":[[9,6]]}}}],["handler",{"_index":44,"t":{"87":{"position":[[6,8]]},"113":{"position":[[0,7]]},"165":{"position":[[6,7]]},"347":{"position":[[29,7]]},"493":{"position":[[25,8]]},"504":{"position":[[14,7]]},"506":{"position":[[13,7]]},"517":{"position":[[6,8]]},"540":{"position":[[0,8]]}}}],["handlerscount",{"_index":50,"t":{"101":{"position":[[0,13]]}}}],["hello",{"_index":3,"t":{"7":{"position":[[0,6]]}}}],["hook",{"_index":61,"t":{"129":{"position":[[0,5]]}}}],["host",{"_index":22,"t":{"36":{"position":[[0,4]]}}}],["hostnam",{"_index":159,"t":{"611":{"position":[[0,8]]}}}],["insecureskipverifi",{"_index":33,"t":{"58":{"position":[[0,18]]}}}],["instal",{"_index":0,"t":{"3":{"position":[[0,12]]}}}],["interfac",{"_index":140,"t":{"553":{"position":[[9,10]]}}}],["ip",{"_index":160,"t":{"613":{"position":[[0,2]]},"615":{"position":[[0,3]]}}}],["ischild",{"_index":64,"t":{"138":{"position":[[0,7]]}}}],["isfromloc",{"_index":161,"t":{"619":{"position":[[0,11]]}}}],["json",{"_index":26,"t":{"44":{"position":[[0,4]]},"482":{"position":[[0,4]]},"509":{"position":[[7,4]]},"621":{"position":[[0,4]]}}}],["jsondecod",{"_index":37,"t":{"66":{"position":[[0,11]]}}}],["jsonencod",{"_index":36,"t":{"64":{"position":[[0,11]]}}}],["jsonp",{"_index":162,"t":{"623":{"position":[[0,5]]}}}],["level",{"_index":66,"t":{"142":{"position":[[4,6]]},"150":{"position":[[4,5]]}}}],["link",{"_index":163,"t":{"625":{"position":[[0,5]]}}}],["listen",{"_index":55,"t":{"115":{"position":[[0,6]]},"125":{"position":[[0,8]]}}}],["listenmutualtl",{"_index":58,"t":{"121":{"position":[[0,15]]}}}],["listenmutualtlswithcertif",{"_index":59,"t":{"123":{"position":[[0,30]]}}}],["listentl",{"_index":56,"t":{"117":{"position":[[0,9]]}}}],["listentlswithcertif",{"_index":57,"t":{"119":{"position":[[0,24]]}}}],["live",{"_index":116,"t":{"491":{"position":[[14,4]]}}}],["local",{"_index":164,"t":{"627":{"position":[[0,6]]}}}],["locat",{"_index":165,"t":{"629":{"position":[[0,8]]}}}],["log",{"_index":65,"t":{"142":{"position":[[0,3]]},"144":{"position":[[7,3]]},"146":{"position":[[6,3]]},"148":{"position":[[7,3]]}}}],["maxredirectscount",{"_index":35,"t":{"62":{"position":[[0,17]]}}}],["method",{"_index":166,"t":{"631":{"position":[[0,6]]}}}],["middlewar",{"_index":77,"t":{"163":{"position":[[9,10]]},"261":{"position":[[32,11]]},"347":{"position":[[11,10]]},"548":{"position":[[0,10]]}}}],["mount",{"_index":45,"t":{"89":{"position":[[0,5]]}}}],["mountpath",{"_index":46,"t":{"91":{"position":[[0,9]]}}}],["multipartform",{"_index":29,"t":{"50":{"position":[[0,13]]},"633":{"position":[[0,13]]}}}],["multipl",{"_index":103,"t":{"478":{"position":[[0,8]]}}}],["name",{"_index":52,"t":{"105":{"position":[[0,4]]},"261":{"position":[[63,5]]}}}],["net/http",{"_index":75,"t":{"161":{"position":[[0,8]]},"163":{"position":[[0,8]]},"165":{"position":[[17,8]]},"167":{"position":[[13,8]]}}}],["net/http).request",{"_index":79,"t":{"169":{"position":[[17,18]]}}}],["new",{"_index":62,"t":{"132":{"position":[[0,3]]}}}],["newerror",{"_index":63,"t":{"136":{"position":[[0,8]]}}}],["next",{"_index":167,"t":{"635":{"position":[[0,4]]}}}],["note",{"_index":9,"t":{"13":{"position":[[0,4]]}}}],["onfork",{"_index":135,"t":{"533":{"position":[[0,6]]}}}],["ongroup",{"_index":132,"t":{"527":{"position":[[0,7]]}}}],["ongroupnam",{"_index":133,"t":{"529":{"position":[[0,11]]}}}],["onlisten",{"_index":134,"t":{"531":{"position":[[0,8]]}}}],["onmount",{"_index":137,"t":{"537":{"position":[[0,7]]}}}],["onnam",{"_index":131,"t":{"525":{"position":[[0,6]]}}}],["onrout",{"_index":130,"t":{"523":{"position":[[0,7]]}}}],["onshutdown",{"_index":136,"t":{"535":{"position":[[0,10]]}}}],["originalurl",{"_index":168,"t":{"637":{"position":[[0,11]]}}}],["output",{"_index":70,"t":{"152":{"position":[[4,6]]}}}],["packag",{"_index":142,"t":{"558":{"position":[[10,7]]}}}],["packr",{"_index":89,"t":{"303":{"position":[[0,5]]}}}],["param",{"_index":169,"t":{"639":{"position":[[0,6]]}}}],["paramet",{"_index":138,"t":{"544":{"position":[[0,10]]}}}],["paramsint",{"_index":170,"t":{"641":{"position":[[0,9]]}}}],["paramspars",{"_index":171,"t":{"643":{"position":[[0,12]]}}}],["pars",{"_index":14,"t":{"20":{"position":[[0,5]]}}}],["path",{"_index":129,"t":{"515":{"position":[[0,5]]},"542":{"position":[[0,5]]},"645":{"position":[[0,4]]}}}],["pkger",{"_index":88,"t":{"301":{"position":[[0,5]]}}}],["plaintext",{"_index":100,"t":{"474":{"position":[[0,9]]}}}],["print",{"_index":68,"t":{"146":{"position":[[0,5]]}}}],["protocol",{"_index":172,"t":{"647":{"position":[[0,8]]}}}],["queri",{"_index":104,"t":{"478":{"position":[[9,7]]},"480":{"position":[[7,5]]},"649":{"position":[[0,7]]},"651":{"position":[[0,5]]}}}],["querybool",{"_index":173,"t":{"653":{"position":[[0,9]]}}}],["queryfloat",{"_index":174,"t":{"655":{"position":[[0,10]]}}}],["queryint",{"_index":175,"t":{"657":{"position":[[0,8]]}}}],["querypars",{"_index":176,"t":{"659":{"position":[[0,11]]}}}],["querystr",{"_index":23,"t":{"38":{"position":[[0,11]]}}}],["rang",{"_index":177,"t":{"661":{"position":[[0,5]]}}}],["redirect",{"_index":178,"t":{"663":{"position":[[0,8]]}}}],["redirectback",{"_index":180,"t":{"667":{"position":[[0,12]]}}}],["redirecttorout",{"_index":179,"t":{"665":{"position":[[0,15]]}}}],["refer",{"_index":20,"t":{"32":{"position":[[0,7]]},"511":{"position":[[0,10]]}}}],["reload",{"_index":117,"t":{"491":{"position":[[19,6]]}}}],["render",{"_index":181,"t":{"669":{"position":[[0,6]]}}}],["reqheaderpars",{"_index":182,"t":{"673":{"position":[[0,15]]}}}],["request",{"_index":11,"t":{"16":{"position":[[6,7]]},"68":{"position":[[0,7]]},"671":{"position":[[0,7]]}}}],["respons",{"_index":83,"t":{"245":{"position":[[0,8]]},"489":{"position":[[27,10]]},"675":{"position":[[0,8]]}}}],["restartrout",{"_index":183,"t":{"677":{"position":[[0,14]]}}}],["retryif",{"_index":43,"t":{"80":{"position":[[0,7]]}}}],["reus",{"_index":32,"t":{"56":{"position":[[0,5]]}}}],["rout",{"_index":6,"t":{"9":{"position":[[6,7]]},"87":{"position":[[0,5]]},"95":{"position":[[0,5]]},"499":{"position":[[30,7]]},"679":{"position":[[0,5]]}}}],["savefil",{"_index":184,"t":{"681":{"position":[[0,8]]}}}],["savefiletostorag",{"_index":185,"t":{"683":{"position":[[0,17]]}}}],["secur",{"_index":186,"t":{"685":{"position":[[0,6]]}}}],["send",{"_index":187,"t":{"687":{"position":[[0,4]]}}}],["sendfil",{"_index":188,"t":{"689":{"position":[[0,8]]}}}],["sendstatu",{"_index":189,"t":{"691":{"position":[[0,10]]}}}],["serial",{"_index":106,"t":{"482":{"position":[[5,13]]}}}],["server",{"_index":48,"t":{"97":{"position":[[0,6]]},"99":{"position":[[0,6]]}}}],["set",{"_index":15,"t":{"22":{"position":[[0,3]]},"150":{"position":[[0,3]]},"152":{"position":[[0,3]]},"493":{"position":[[9,3]]},"693":{"position":[[0,3]]}}}],["setparserdecod",{"_index":190,"t":{"695":{"position":[[0,16]]}}}],["setrespons",{"_index":38,"t":{"70":{"position":[[0,11]]}}}],["setusercontext",{"_index":191,"t":{"697":{"position":[[0,14]]}}}],["shutdown",{"_index":49,"t":{"99":{"position":[[7,8]]}}}],["signatur",{"_index":73,"t":{"158":{"position":[[0,10]]},"173":{"position":[[0,10]]},"183":{"position":[[0,10]]},"193":{"position":[[0,10]]},"205":{"position":[[0,10]]},"215":{"position":[[0,10]]},"229":{"position":[[0,10]]},"241":{"position":[[0,10]]},"253":{"position":[[0,10]]},"265":{"position":[[0,10]]},"275":{"position":[[0,10]]},"285":{"position":[[0,10]]},"295":{"position":[[0,10]]},"317":{"position":[[0,10]]},"327":{"position":[[0,10]]},"341":{"position":[[0,10]]},"355":{"position":[[0,10]]},"369":{"position":[[0,10]]},"381":{"position":[[0,10]]},"391":{"position":[[0,10]]},"401":{"position":[[0,10]]},"411":{"position":[[0,10]]},"421":{"position":[[0,10]]},"431":{"position":[[0,10]]},"441":{"position":[[0,10]]},"447":{"position":[[0,10]]},"461":{"position":[[0,10]]},"467":{"position":[[0,10]]}}}],["singl",{"_index":105,"t":{"480":{"position":[[0,6]]}}}],["slide",{"_index":97,"t":{"359":{"position":[[0,7]]}}}],["specifi",{"_index":96,"t":{"347":{"position":[[0,10]]}}}],["stack",{"_index":51,"t":{"103":{"position":[[0,5]]}}}],["stale",{"_index":192,"t":{"699":{"position":[[0,5]]}}}],["start",{"_index":10,"t":{"16":{"position":[[0,5]]}}}],["static",{"_index":7,"t":{"11":{"position":[[0,6]]},"85":{"position":[[0,6]]}}}],["statik",{"_index":92,"t":{"309":{"position":[[0,6]]}}}],["statu",{"_index":193,"t":{"701":{"position":[[0,6]]}}}],["storage/databas",{"_index":82,"t":{"225":{"position":[[7,16]]},"365":{"position":[[7,16]]},"457":{"position":[[7,16]]}}}],["string",{"_index":41,"t":{"76":{"position":[[0,6]]}}}],["struct",{"_index":42,"t":{"78":{"position":[[0,6]]}}}],["structur",{"_index":111,"t":{"487":{"position":[[13,9]]}}}],["sub",{"_index":125,"t":{"499":{"position":[[19,3]]}}}],["subdomain",{"_index":194,"t":{"703":{"position":[[0,10]]}}}],["support",{"_index":122,"t":{"495":{"position":[[34,8]]},"499":{"position":[[11,7]]}}}],["techempow",{"_index":99,"t":{"472":{"position":[[0,11]]}}}],["templat",{"_index":120,"t":{"495":{"position":[[6,8]]},"553":{"position":[[0,8]]}}}],["test",{"_index":60,"t":{"127":{"position":[[0,4]]}}}],["timeout",{"_index":31,"t":{"54":{"position":[[0,7]]}}}],["tlsconfig",{"_index":34,"t":{"60":{"position":[[0,9]]}}}],["type",{"_index":195,"t":{"705":{"position":[[0,4]]}}}],["up",{"_index":118,"t":{"493":{"position":[[13,2]]}}}],["updat",{"_index":102,"t":{"476":{"position":[[5,7]]}}}],["us",{"_index":115,"t":{"491":{"position":[[10,3]]}}}],["usag",{"_index":84,"t":{"261":{"position":[[0,5]]}}}],["userag",{"_index":18,"t":{"28":{"position":[[0,9]]}}}],["usercontext",{"_index":196,"t":{"707":{"position":[[0,11]]}}}],["valid",{"_index":141,"t":{"558":{"position":[[0,9]]}}}],["vari",{"_index":197,"t":{"709":{"position":[[0,4]]}}}],["web",{"_index":108,"t":{"484":{"position":[[3,3]]}}}],["window",{"_index":98,"t":{"359":{"position":[[8,6]]}}}],["world",{"_index":4,"t":{"7":{"position":[[7,6]]}}}],["write",{"_index":198,"t":{"711":{"position":[[0,5]]}}}],["writef",{"_index":199,"t":{"713":{"position":[[0,6]]}}}],["writestr",{"_index":200,"t":{"715":{"position":[[0,11]]}}}],["xhr",{"_index":201,"t":{"717":{"position":[[0,3]]}}}],["xml",{"_index":27,"t":{"46":{"position":[[0,3]]},"719":{"position":[[0,3]]}}}],["zero",{"_index":1,"t":{"5":{"position":[[0,4]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":2,"t":"An online API documentation with examples so you can start building web apps with Fiber right away! Fiber is an Express inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development with zero memory allocation and performance in mind. These docs are for Fiber v2, which was released on September 15th, 2020.","s":"πŸ‘‹ Welcome","u":"/next/","h":"","p":1},{"i":4,"t":"First of all, download and install Go. 1.17 or higher is required. Installation is done using the go get command: go get github.com/gofiber/fiber/v2","s":"Installation","u":"/next/","h":"#installation","p":1},{"i":6,"t":"Some values returned from *fiber.Ctx are not immutable by default. Because fiber is optimized for high-performance, values returned from fiber.Ctx are not immutable by default and will be re-used across requests. As a rule of thumb, you must only use context values within the handler, and you must not keep any references. As soon as you return from the handler, any values you have obtained from the context will be re-used in future requests and will change below your feet. Here is an example: func handler(c *fiber.Ctx) error { // Variable is only valid within this handler result := c.Params(\"foo\") // ... } If you need to persist such values outside the handler, make copies of their underlying buffer using the copy builtin. Here is an example for persisting a string: func handler(c *fiber.Ctx) error { // Variable is only valid within this handler result := c.Params(\"foo\") // Make a copy buffer := make([]byte, len(result)) copy(buffer, result) resultCopy := string(buffer) // Variable is now valid forever // ... } We created a custom CopyString function that does the above and is available under gofiber/utils. app.Get(\"/:foo\", func(c *fiber.Ctx) error { // Variable is now immutable result := utils.CopyString(c.Params(\"foo\")) // ... }) Alternatively, you can also use the Immutable setting. It will make all values returned from the context immutable, allowing you to persist them anywhere. Of course, this comes at the cost of performance. app := fiber.New(fiber.Config{ Immutable: true, }) For more information, please check #426 and #185.","s":"Zero Allocation","u":"/next/","h":"#zero-allocation","p":1},{"i":8,"t":"Embedded below is essentially the most straightforward Fiber app you can create: package main import \"github.com/gofiber/fiber/v2\" func main() { app := fiber.New() app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) app.Listen(\":3000\") } go run server.go Browse to http://localhost:3000 and you should see Hello, World! on the page.","s":"Hello, World!","u":"/next/","h":"#hello-world","p":1},{"i":10,"t":"Routing refers to determining how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (GET, PUT, POST, etc.). Each route can have multiple handler functions that are executed when the route is matched. Route definition takes the following structures: // Function signature app.Method(path string, ...func(*fiber.Ctx) error) app is an instance of Fiber Method is an HTTP request method: GET, PUT, POST, etc. path is a virtual path on the server func(*fiber.Ctx) error is a callback function containing the Context executed when the route is matched Simple route // Respond with \"Hello, World!\" on root path, \"/\" app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) Parameters // GET http://localhost:8080/hello%20world app.Get(\"/:value\", func(c *fiber.Ctx) error { return c.SendString(\"value: \" + c.Params(\"value\")) // => Get request with value: hello world }) Optional parameter // GET http://localhost:3000/john app.Get(\"/:name?\", func(c *fiber.Ctx) error { if c.Params(\"name\") != \"\" { return c.SendString(\"Hello \" + c.Params(\"name\")) // => Hello john } return c.SendString(\"Where is john?\") }) Wildcards // GET http://localhost:3000/api/user/john app.Get(\"/api/*\", func(c *fiber.Ctx) error { return c.SendString(\"API path: \" + c.Params(\"*\")) // => API path: user/john })","s":"Basic routing","u":"/next/","h":"#basic-routing","p":1},{"i":12,"t":"To serve static files such as images, CSS, and JavaScript files, replace your function handler with a file or directory string. Function signature: app.Static(prefix, root string, config ...Static) Use the following code to serve files in a directory named ./public: app := fiber.New() app.Static(\"/\", \"./public\") app.Listen(\":3000\") Now, you can load the files that are in the ./public directory: http://localhost:8080/hello.html http://localhost:8080/js/jquery.js http://localhost:8080/css/style.css","s":"Static files","u":"/next/","h":"#static-files","p":1},{"i":14,"t":"For more information on how to build APIs in Go with Fiber, please check out this excellent article on building an express-style API in Go with Fiber.","s":"Note","u":"/next/","h":"#note","p":1},{"i":17,"t":"Start a http request with http method and url. Signatures // Client http methods func (c *Client) Get(url string) *Agent func (c *Client) Head(url string) *Agent func (c *Client) Post(url string) *Agent func (c *Client) Put(url string) *Agent func (c *Client) Patch(url string) *Agent func (c *Client) Delete(url string) *Agent","s":"Start request","u":"/next/api/client","h":"#start-request","p":15},{"i":19,"t":"Agent is built on top of FastHTTP's HostClient which has lots of convenient helper methods such as dedicated methods for request methods.","s":"✨ Agent","u":"/next/api/client","h":"#-agent","p":15},{"i":21,"t":"Parse initializes a HostClient. Parse a := AcquireAgent() req := a.Request() req.Header.SetMethod(MethodGet) req.SetRequestURI(\"http://example.com\") if err := a.Parse(); err != nil { panic(err) } code, body, errs := a.Bytes() // ...","s":"Parse","u":"/next/api/client","h":"#parse","p":15},{"i":23,"t":"Set sets the given key: value header. Signature func (a *Agent) Set(k, v string) *Agent func (a *Agent) SetBytesK(k []byte, v string) *Agent func (a *Agent) SetBytesV(k string, v []byte) *Agent func (a *Agent) SetBytesKV(k []byte, v []byte) *Agent Example agent.Set(\"k1\", \"v1\"). SetBytesK([]byte(\"k1\"), \"v1\"). SetBytesV(\"k1\", []byte(\"v1\")). SetBytesKV([]byte(\"k2\"), []byte(\"v2\")) // ...","s":"Set","u":"/next/api/client","h":"#set","p":15},{"i":25,"t":"Add adds the given key: value header. Multiple headers with the same key may be added with this function. Signature func (a *Agent) Add(k, v string) *Agent func (a *Agent) AddBytesK(k []byte, v string) *Agent func (a *Agent) AddBytesV(k string, v []byte) *Agent func (a *Agent) AddBytesKV(k []byte, v []byte) *Agent Example agent.Add(\"k1\", \"v1\"). AddBytesK([]byte(\"k1\"), \"v1\"). AddBytesV(\"k1\", []byte(\"v1\")). AddBytesKV([]byte(\"k2\"), []byte(\"v2\")) // Headers: // K1: v1 // K1: v1 // K1: v1 // K2: v2","s":"Add","u":"/next/api/client","h":"#add","p":15},{"i":27,"t":"ConnectionClose adds the Connection: close header. Signature func (a *Agent) ConnectionClose() *Agent Example agent.ConnectionClose() // ...","s":"ConnectionClose","u":"/next/api/client","h":"#connectionclose","p":15},{"i":29,"t":"UserAgent sets User-Agent header value. Signature func (a *Agent) UserAgent(userAgent string) *Agent func (a *Agent) UserAgentBytes(userAgent []byte) *Agent Example agent.UserAgent(\"fiber\") // ...","s":"UserAgent","u":"/next/api/client","h":"#useragent","p":15},{"i":31,"t":"Cookie sets a cookie in key: value form. Cookies can be used to set multiple cookies. Signature func (a *Agent) Cookie(key, value string) *Agent func (a *Agent) CookieBytesK(key []byte, value string) *Agent func (a *Agent) CookieBytesKV(key, value []byte) *Agent func (a *Agent) Cookies(kv ...string) *Agent func (a *Agent) CookiesBytesKV(kv ...[]byte) *Agent Example agent.Cookie(\"k\", \"v\") agent.Cookies(\"k1\", \"v1\", \"k2\", \"v2\") // ...","s":"Cookie","u":"/next/api/client","h":"#cookie","p":15},{"i":33,"t":"Referer sets the Referer header value. Signature func (a *Agent) Referer(referer string) *Agent func (a *Agent) RefererBytes(referer []byte) *Agent Example agent.Referer(\"https://docs.gofiber.io\") // ...","s":"Referer","u":"/next/api/client","h":"#referer","p":15},{"i":35,"t":"ContentType sets Content-Type header value. Signature func (a *Agent) ContentType(contentType string) *Agent func (a *Agent) ContentTypeBytes(contentType []byte) *Agent Example agent.ContentType(\"custom-type\") // ...","s":"ContentType","u":"/next/api/client","h":"#contenttype","p":15},{"i":37,"t":"Host sets the Host header. Signature func (a *Agent) Host(host string) *Agent func (a *Agent) HostBytes(host []byte) *Agent Example agent.Host(\"example.com\") // ...","s":"Host","u":"/next/api/client","h":"#host","p":15},{"i":39,"t":"QueryString sets the URI query string. Signature func (a *Agent) QueryString(queryString string) *Agent func (a *Agent) QueryStringBytes(queryString []byte) *Agent Example agent.QueryString(\"foo=bar\") // ...","s":"QueryString","u":"/next/api/client","h":"#querystring","p":15},{"i":41,"t":"BasicAuth sets the URI username and password using HTTP Basic Auth. Signature func (a *Agent) BasicAuth(username, password string) *Agent func (a *Agent) BasicAuthBytes(username, password []byte) *Agent Example agent.BasicAuth(\"foo\", \"bar\") // ...","s":"BasicAuth","u":"/next/api/client","h":"#basicauth","p":15},{"i":43,"t":"There are several ways to set request body. Signature func (a *Agent) BodyString(bodyString string) *Agent func (a *Agent) Body(body []byte) *Agent // BodyStream sets request body stream and, optionally body size. // // If bodySize is >= 0, then the bodyStream must provide exactly bodySize bytes // before returning io.EOF. // // If bodySize < 0, then bodyStream is read until io.EOF. // // bodyStream.Close() is called after finishing reading all body data // if it implements io.Closer. // // Note that GET and HEAD requests cannot have body. func (a *Agent) BodyStream(bodyStream io.Reader, bodySize int) *Agent Example agent.BodyString(\"foo=bar\") agent.Body([]byte(\"bar=baz\")) agent.BodyStream(strings.NewReader(\"body=stream\"), -1) // ...","s":"Body","u":"/next/api/client","h":"#body","p":15},{"i":45,"t":"JSON sends a JSON request by setting the Content-Type header to application/json. Signature func (a *Agent) JSON(v interface{}) *Agent Example agent.JSON(fiber.Map{\"success\": true}) // ...","s":"JSON","u":"/next/api/client","h":"#json","p":15},{"i":47,"t":"XML sends an XML request by setting the Content-Type header to application/xml. Signature func (a *Agent) XML(v interface{}) *Agent Example agent.XML(fiber.Map{\"success\": true}) // ...","s":"XML","u":"/next/api/client","h":"#xml","p":15},{"i":49,"t":"Form sends a form request by setting the Content-Type header to application/x-www-form-urlencoded. Signature // Form sends form request with body if args is non-nil. // // It is recommended obtaining args via AcquireArgs and release it // manually in performance-critical code. func (a *Agent) Form(args *Args) *Agent Example args := AcquireArgs() args.Set(\"foo\", \"bar\") agent.Form(args) // ... ReleaseArgs(args)","s":"Form","u":"/next/api/client","h":"#form","p":15},{"i":51,"t":"MultipartForm sends multipart form request by setting the Content-Type header to multipart/form-data. These requests can include key-value's and files. Signature // MultipartForm sends multipart form request with k-v and files. // // It is recommended to obtain args via AcquireArgs and release it // manually in performance-critical code. func (a *Agent) MultipartForm(args *Args) *Agent Example args := AcquireArgs() args.Set(\"foo\", \"bar\") agent.MultipartForm(args) // ... ReleaseArgs(args) Fiber provides several methods for sending files. Note that they must be called before MultipartForm. Boundary​ Boundary sets boundary for multipart form request. Signature func (a *Agent) Boundary(boundary string) *Agent Example agent.Boundary(\"myBoundary\") .MultipartForm(nil) // ... SendFile(s)​ SendFile read a file and appends it to a multipart form request. Sendfiles can be used to append multiple files. Signature func (a *Agent) SendFile(filename string, fieldname ...string) *Agent func (a *Agent) SendFiles(filenamesAndFieldnames ...string) *Agent Example agent.SendFile(\"f\", \"field name\") .SendFiles(\"f1\", \"field name1\", \"f2\"). .MultipartForm(nil) // ... FileData​ FileData appends file data for multipart form request. // FormFile represents multipart form file type FormFile struct { // Fieldname is form file's field name Fieldname string // Name is form file's name Name string // Content is form file's content Content []byte } Signature // FileData appends files for multipart form request. // // It is recommended obtaining formFile via AcquireFormFile and release it // manually in performance-critical code. func (a *Agent) FileData(formFiles ...*FormFile) *Agent Example ff1 := &FormFile{\"filename1\", \"field name1\", []byte(\"content\")} ff2 := &FormFile{\"filename2\", \"field name2\", []byte(\"content\")} agent.FileData(ff1, ff2). MultipartForm(nil) // ...","s":"MultipartForm","u":"/next/api/client","h":"#multipartform","p":15},{"i":53,"t":"Debug mode enables logging request and response detail to io.writer(default is os.Stdout). Signature func (a *Agent) Debug(w ...io.Writer) *Agent Example agent.Debug() // ...","s":"Debug","u":"/next/api/client","h":"#debug","p":15},{"i":55,"t":"Timeout sets request timeout duration. Signature func (a *Agent) Timeout(timeout time.Duration) *Agent Example agent.Timeout(time.Second) // ...","s":"Timeout","u":"/next/api/client","h":"#timeout","p":15},{"i":57,"t":"Reuse enables the Agent instance to be used again after one request. If agent is reusable, then it should be released manually when it is no longer used. Signature func (a *Agent) Reuse() *Agent Example agent.Reuse() // ...","s":"Reuse","u":"/next/api/client","h":"#reuse","p":15},{"i":59,"t":"InsecureSkipVerify controls whether the Agent verifies the server certificate chain and host name. Signature func (a *Agent) InsecureSkipVerify() *Agent Example agent.InsecureSkipVerify() // ...","s":"InsecureSkipVerify","u":"/next/api/client","h":"#insecureskipverify","p":15},{"i":61,"t":"TLSConfig sets tls config. Signature func (a *Agent) TLSConfig(config *tls.Config) *Agent Example // Create tls certificate cer, _ := tls.LoadX509KeyPair(\"pem\", \"key\") config := &tls.Config{ Certificates: []tls.Certificate{cer}, } agent.TLSConfig(config) // ...","s":"TLSConfig","u":"/next/api/client","h":"#tlsconfig","p":15},{"i":63,"t":"MaxRedirectsCount sets max redirect count for GET and HEAD. Signature func (a *Agent) MaxRedirectsCount(count int) *Agent Example agent.MaxRedirectsCount(7) // ...","s":"MaxRedirectsCount","u":"/next/api/client","h":"#maxredirectscount","p":15},{"i":65,"t":"JSONEncoder sets custom json encoder. Signature func (a *Agent) JSONEncoder(jsonEncoder utils.JSONMarshal) *Agent Example agent.JSONEncoder(json.Marshal) // ...","s":"JSONEncoder","u":"/next/api/client","h":"#jsonencoder","p":15},{"i":67,"t":"JSONDecoder sets custom json decoder. Signature func (a *Agent) JSONDecoder(jsonDecoder utils.JSONUnmarshal) *Agent Example agent.JSONDecoder(json.Unmarshal) // ...","s":"JSONDecoder","u":"/next/api/client","h":"#jsondecoder","p":15},{"i":69,"t":"Request returns Agent request instance. Signature func (a *Agent) Request() *Request Example req := agent.Request() // ...","s":"Request","u":"/next/api/client","h":"#request","p":15},{"i":71,"t":"SetResponse sets custom response for the Agent instance. It is recommended obtaining custom response via AcquireResponse and release it manually in performance-critical code. Signature func (a *Agent) SetResponse(customResp *Response) *Agent Example resp := AcquireResponse() agent.SetResponse(resp) // ... ReleaseResponse(resp)","s":"SetResponse","u":"/next/api/client","h":"#setresponse","p":15},{"i":73,"t":"Dest sets custom dest. The contents of dest will be replaced by the response body, if the dest is too small a new slice will be allocated. Signature func (a *Agent) Dest(dest []byte) *Agent { Example agent.Dest(nil) // ...","s":"Dest","u":"/next/api/client","h":"#dest","p":15},{"i":75,"t":"Bytes returns the status code, bytes body and errors of url. Signature func (a *Agent) Bytes() (code int, body []byte, errs []error) Example code, body, errs := agent.Bytes() // ...","s":"Bytes","u":"/next/api/client","h":"#bytes","p":15},{"i":77,"t":"String returns the status code, string body and errors of url. Signature func (a *Agent) String() (int, string, []error) Example code, body, errs := agent.String() // ...","s":"String","u":"/next/api/client","h":"#string","p":15},{"i":79,"t":"Struct returns the status code, bytes body and errors of url. And bytes body will be unmarshalled to given v. Signature func (a *Agent) Struct(v interface{}) (code int, body []byte, errs []error) Example var d data code, body, errs := agent.Struct(&d) // ...","s":"Struct","u":"/next/api/client","h":"#struct","p":15},{"i":81,"t":"RetryIf controls whether a retry should be attempted after an error. By default, will use isIdempotent function from fasthttp Signature func (a *Agent) RetryIf(retryIf RetryIfFunc) *Agent Example agent.Get(\"https://example.com\").RetryIf(func (req *fiber.Request) bool { return req.URI() == \"https://example.com\" }) // ...","s":"RetryIf","u":"/next/api/client","h":"#retryif","p":15},{"i":83,"t":"HTTP methods were copied from net/http. const ( MethodGet = \"GET\" // RFC 7231, 4.3.1 MethodHead = \"HEAD\" // RFC 7231, 4.3.2 MethodPost = \"POST\" // RFC 7231, 4.3.3 MethodPut = \"PUT\" // RFC 7231, 4.3.4 MethodPatch = \"PATCH\" // RFC 5789 MethodDelete = \"DELETE\" // RFC 7231, 4.3.5 MethodConnect = \"CONNECT\" // RFC 7231, 4.3.6 MethodOptions = \"OPTIONS\" // RFC 7231, 4.3.7 MethodTrace = \"TRACE\" // RFC 7231, 4.3.8 methodUse = \"USE\" ) MIME types that are commonly used const ( MIMETextXML = \"text/xml\" MIMETextHTML = \"text/html\" MIMETextPlain = \"text/plain\" MIMEApplicationXML = \"application/xml\" MIMEApplicationJSON = \"application/json\" MIMEApplicationJavaScript = \"application/javascript\" MIMEApplicationForm = \"application/x-www-form-urlencoded\" MIMEOctetStream = \"application/octet-stream\" MIMEMultipartForm = \"multipart/form-data\" MIMETextXMLCharsetUTF8 = \"text/xml; charset=utf-8\" MIMETextHTMLCharsetUTF8 = \"text/html; charset=utf-8\" MIMETextPlainCharsetUTF8 = \"text/plain; charset=utf-8\" MIMEApplicationXMLCharsetUTF8 = \"application/xml; charset=utf-8\" MIMEApplicationJSONCharsetUTF8 = \"application/json; charset=utf-8\" MIMEApplicationJavaScriptCharsetUTF8 = \"application/javascript; charset=utf-8\" ) HTTP status codes were copied from net/http. const ( StatusContinue = 100 // RFC 7231, 6.2.1 StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2 StatusProcessing = 102 // RFC 2518, 10.1 StatusEarlyHints = 103 // RFC 8297 StatusOK = 200 // RFC 7231, 6.3.1 StatusCreated = 201 // RFC 7231, 6.3.2 StatusAccepted = 202 // RFC 7231, 6.3.3 StatusNonAuthoritativeInformation = 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 StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7 StatusPermanentRedirect = 308 // RFC 7538, 3 StatusBadRequest = 400 // RFC 7231, 6.5.1 StatusUnauthorized = 401 // RFC 7235, 3.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 StatusMisdirectedRequest = 421 // RFC 7540, 9.1.2 StatusUnprocessableEntity = 422 // RFC 4918, 11.2 StatusLocked = 423 // RFC 4918, 11.3 StatusFailedDependency = 424 // RFC 4918, 11.4 StatusTooEarly = 425 // RFC 8470, 5.2. StatusUpgradeRequired = 426 // RFC 7231, 6.5.15 StatusPreconditionRequired = 428 // RFC 6585, 3 StatusTooManyRequests = 429 // RFC 6585, 4 StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5 StatusUnavailableForLegalReasons = 451 // RFC 7725, 3 StatusInternalServerError = 500 // RFC 7231, 6.6.1 StatusNotImplemented = 501 // RFC 7231, 6.6.2 StatusBadGateway = 502 // RFC 7231, 6.6.3 StatusServiceUnavailable = 503 // RFC 7231, 6.6.4 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 ) Errors var ( ErrBadRequest = NewError(StatusBadRequest) // RFC 7231, 6.5.1 ErrUnauthorized = NewError(StatusUnauthorized) // RFC 7235, 3.1 ErrPaymentRequired = NewError(StatusPaymentRequired) // RFC 7231, 6.5.2 ErrForbidden = NewError(StatusForbidden) // RFC 7231, 6.5.3 ErrNotFound = NewError(StatusNotFound) // RFC 7231, 6.5.4 ErrMethodNotAllowed = NewError(StatusMethodNotAllowed) // RFC 7231, 6.5.5 ErrNotAcceptable = NewError(StatusNotAcceptable) // RFC 7231, 6.5.6 ErrProxyAuthRequired = NewError(StatusProxyAuthRequired) // RFC 7235, 3.2 ErrRequestTimeout = NewError(StatusRequestTimeout) // RFC 7231, 6.5.7 ErrConflict = NewError(StatusConflict) // RFC 7231, 6.5.8 ErrGone = NewError(StatusGone) // RFC 7231, 6.5.9 ErrLengthRequired = NewError(StatusLengthRequired) // RFC 7231, 6.5.10 ErrPreconditionFailed = NewError(StatusPreconditionFailed) // RFC 7232, 4.2 ErrRequestEntityTooLarge = NewError(StatusRequestEntityTooLarge) // RFC 7231, 6.5.11 ErrRequestURITooLong = NewError(StatusRequestURITooLong) // RFC 7231, 6.5.12 ErrUnsupportedMediaType = NewError(StatusUnsupportedMediaType) // RFC 7231, 6.5.13 ErrRequestedRangeNotSatisfiable = NewError(StatusRequestedRangeNotSatisfiable) // RFC 7233, 4.4 ErrExpectationFailed = NewError(StatusExpectationFailed) // RFC 7231, 6.5.14 ErrTeapot = NewError(StatusTeapot) // RFC 7168, 2.3.3 ErrMisdirectedRequest = NewError(StatusMisdirectedRequest) // RFC 7540, 9.1.2 ErrUnprocessableEntity = NewError(StatusUnprocessableEntity) // RFC 4918, 11.2 ErrLocked = NewError(StatusLocked) // RFC 4918, 11.3 ErrFailedDependency = NewError(StatusFailedDependency) // RFC 4918, 11.4 ErrTooEarly = NewError(StatusTooEarly) // RFC 8470, 5.2. ErrUpgradeRequired = NewError(StatusUpgradeRequired) // RFC 7231, 6.5.15 ErrPreconditionRequired = NewError(StatusPreconditionRequired) // RFC 6585, 3 ErrTooManyRequests = NewError(StatusTooManyRequests) // RFC 6585, 4 ErrRequestHeaderFieldsTooLarge = NewError(StatusRequestHeaderFieldsTooLarge) // RFC 6585, 5 ErrUnavailableForLegalReasons = NewError(StatusUnavailableForLegalReasons) // RFC 7725, 3 ErrInternalServerError = NewError(StatusInternalServerError) // RFC 7231, 6.6.1 ErrNotImplemented = NewError(StatusNotImplemented) // RFC 7231, 6.6.2 ErrBadGateway = NewError(StatusBadGateway) // RFC 7231, 6.6.3 ErrServiceUnavailable = NewError(StatusServiceUnavailable) // RFC 7231, 6.6.4 ErrGatewayTimeout = NewError(StatusGatewayTimeout) // RFC 7231, 6.6.5 ErrHTTPVersionNotSupported = NewError(StatusHTTPVersionNotSupported) // RFC 7231, 6.6.6 ErrVariantAlsoNegotiates = NewError(StatusVariantAlsoNegotiates) // RFC 2295, 8.1 ErrInsufficientStorage = NewError(StatusInsufficientStorage) // RFC 4918, 11.5 ErrLoopDetected = NewError(StatusLoopDetected) // RFC 5842, 7.2 ErrNotExtended = NewError(StatusNotExtended) // RFC 2774, 7 ErrNetworkAuthenticationRequired = NewError(StatusNetworkAuthenticationRequired) // RFC 6585, 6 ) HTTP Headers were copied from net/http. const ( HeaderAuthorization = \"Authorization\" HeaderProxyAuthenticate = \"Proxy-Authenticate\" HeaderProxyAuthorization = \"Proxy-Authorization\" HeaderWWWAuthenticate = \"WWW-Authenticate\" HeaderAge = \"Age\" HeaderCacheControl = \"Cache-Control\" HeaderClearSiteData = \"Clear-Site-Data\" HeaderExpires = \"Expires\" HeaderPragma = \"Pragma\" HeaderWarning = \"Warning\" HeaderAcceptCH = \"Accept-CH\" HeaderAcceptCHLifetime = \"Accept-CH-Lifetime\" HeaderContentDPR = \"Content-DPR\" HeaderDPR = \"DPR\" HeaderEarlyData = \"Early-Data\" HeaderSaveData = \"Save-Data\" HeaderViewportWidth = \"Viewport-Width\" HeaderWidth = \"Width\" HeaderETag = \"ETag\" HeaderIfMatch = \"If-Match\" HeaderIfModifiedSince = \"If-Modified-Since\" HeaderIfNoneMatch = \"If-None-Match\" HeaderIfUnmodifiedSince = \"If-Unmodified-Since\" HeaderLastModified = \"Last-Modified\" HeaderVary = \"Vary\" HeaderConnection = \"Connection\" HeaderKeepAlive = \"Keep-Alive\" HeaderAccept = \"Accept\" HeaderAcceptCharset = \"Accept-Charset\" HeaderAcceptEncoding = \"Accept-Encoding\" HeaderAcceptLanguage = \"Accept-Language\" HeaderCookie = \"Cookie\" HeaderExpect = \"Expect\" HeaderMaxForwards = \"Max-Forwards\" HeaderSetCookie = \"Set-Cookie\" 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\" HeaderOrigin = \"Origin\" HeaderTimingAllowOrigin = \"Timing-Allow-Origin\" HeaderXPermittedCrossDomainPolicies = \"X-Permitted-Cross-Domain-Policies\" HeaderDNT = \"DNT\" HeaderTk = \"Tk\" HeaderContentDisposition = \"Content-Disposition\" HeaderContentEncoding = \"Content-Encoding\" HeaderContentLanguage = \"Content-Language\" HeaderContentLength = \"Content-Length\" HeaderContentLocation = \"Content-Location\" HeaderContentType = \"Content-Type\" HeaderForwarded = \"Forwarded\" HeaderVia = \"Via\" HeaderXForwardedFor = \"X-Forwarded-For\" HeaderXForwardedHost = \"X-Forwarded-Host\" HeaderXForwardedProto = \"X-Forwarded-Proto\" HeaderXForwardedProtocol = \"X-Forwarded-Protocol\" HeaderXForwardedSsl = \"X-Forwarded-Ssl\" HeaderXUrlScheme = \"X-Url-Scheme\" HeaderLocation = \"Location\" HeaderFrom = \"From\" HeaderHost = \"Host\" HeaderReferer = \"Referer\" HeaderReferrerPolicy = \"Referrer-Policy\" HeaderUserAgent = \"User-Agent\" HeaderAllow = \"Allow\" HeaderServer = \"Server\" HeaderAcceptRanges = \"Accept-Ranges\" HeaderContentRange = \"Content-Range\" HeaderIfRange = \"If-Range\" HeaderRange = \"Range\" HeaderContentSecurityPolicy = \"Content-Security-Policy\" HeaderContentSecurityPolicyReportOnly = \"Content-Security-Policy-Report-Only\" HeaderCrossOriginResourcePolicy = \"Cross-Origin-Resource-Policy\" HeaderExpectCT = \"Expect-CT\" HeaderFeaturePolicy = \"Feature-Policy\" HeaderPublicKeyPins = \"Public-Key-Pins\" HeaderPublicKeyPinsReportOnly = \"Public-Key-Pins-Report-Only\" HeaderStrictTransportSecurity = \"Strict-Transport-Security\" HeaderUpgradeInsecureRequests = \"Upgrade-Insecure-Requests\" HeaderXContentTypeOptions = \"X-Content-Type-Options\" HeaderXDownloadOptions = \"X-Download-Options\" HeaderXFrameOptions = \"X-Frame-Options\" HeaderXPoweredBy = \"X-Powered-By\" HeaderXXSSProtection = \"X-XSS-Protection\" HeaderLastEventID = \"Last-Event-ID\" HeaderNEL = \"NEL\" HeaderPingFrom = \"Ping-From\" HeaderPingTo = \"Ping-To\" HeaderReportTo = \"Report-To\" HeaderTE = \"TE\" HeaderTrailer = \"Trailer\" HeaderTransferEncoding = \"Transfer-Encoding\" HeaderSecWebSocketAccept = \"Sec-WebSocket-Accept\" HeaderSecWebSocketExtensions = \"Sec-WebSocket-Extensions\" HeaderSecWebSocketKey = \"Sec-WebSocket-Key\" HeaderSecWebSocketProtocol = \"Sec-WebSocket-Protocol\" HeaderSecWebSocketVersion = \"Sec-WebSocket-Version\" HeaderAcceptPatch = \"Accept-Patch\" HeaderAcceptPushPolicy = \"Accept-Push-Policy\" HeaderAcceptSignature = \"Accept-Signature\" HeaderAltSvc = \"Alt-Svc\" HeaderDate = \"Date\" HeaderIndex = \"Index\" HeaderLargeAllocation = \"Large-Allocation\" HeaderLink = \"Link\" HeaderPushPolicy = \"Push-Policy\" HeaderRetryAfter = \"Retry-After\" HeaderServerTiming = \"Server-Timing\" HeaderSignature = \"Signature\" HeaderSignedHeaders = \"Signed-Headers\" HeaderSourceMap = \"SourceMap\" HeaderUpgrade = \"Upgrade\" HeaderXDNSPrefetchControl = \"X-DNS-Prefetch-Control\" HeaderXPingback = \"X-Pingback\" HeaderXRequestID = \"X-Request-ID\" HeaderXRequestedWith = \"X-Requested-With\" HeaderXRobotsTag = \"X-Robots-Tag\" HeaderXUACompatible = \"X-UA-Compatible\" )","s":"πŸ“‹ Constants","u":"/next/api/constants","h":"","p":82},{"i":86,"t":"Use the Static method to serve static files such as images, CSS, and JavaScript. info By default, Static will serve index.html files in response to a request on a directory. Signature func (app *App) Static(prefix, root string, config ...Static) Router Use the following code to serve files in a directory named ./public app.Static(\"/\", \"./public\") // => http://localhost:3000/hello.html // => http://localhost:3000/js/jquery.js // => http://localhost:3000/css/style.css Examples // Serve files from multiple directories app.Static(\"/\", \"./public\") // Serve files from \"./files\" directory: app.Static(\"/\", \"./files\") You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below: Examples app.Static(\"/static\", \"./public\") // => http://localhost:3000/static/hello.html // => http://localhost:3000/static/js/jquery.js // => http://localhost:3000/static/css/style.css If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings. fiber.Static{} // Static defines configuration options when defining static assets. type Static struct { // When set to true, the server tries minimizing CPU usage by caching compressed files. // This works differently than the github.com/gofiber/compression middleware. // Optional. Default value false Compress bool `json:\"compress\"` // When set to true, enables byte range requests. // Optional. Default value false ByteRange bool `json:\"byte_range\"` // When set to true, enables directory browsing. // Optional. Default value false. Browse bool `json:\"browse\"` // When set to true, enables direct download. // Optional. Default value false. Download bool `json:\"download\"` // The name of the index file for serving a directory. // Optional. Default value \"index.html\". Index string `json:\"index\"` // Expiration duration for inactive file handlers. // Use a negative time.Duration to disable it. // // Optional. Default value 10 * time.Second. CacheDuration time.Duration `json:\"cache_duration\"` // The value for the Cache-Control HTTP-header // that is set on the file response. MaxAge is defined in seconds. // // Optional. Default value 0. MaxAge int `json:\"max_age\"` // ModifyResponse defines a function that allows you to alter the response. // // Optional. Default: nil ModifyResponse Handler // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *Ctx) bool } Example // Custom config app.Static(\"/\", \"./public\", fiber.Static{ Compress: true, ByteRange: true, Browse: true, Index: \"john.html\", CacheDuration: 10 * time.Second, MaxAge: 3600, })","s":"Static","u":"/next/api/app","h":"#static","p":84},{"i":88,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Route Handlers","u":"/next/api/app","h":"#route-handlers","p":84},{"i":90,"t":"You can Mount Fiber instance by creating a *Mount Signature func (a *App) Mount(prefix string, app *App) Router Examples func main() { app := fiber.New() micro := fiber.New() app.Mount(\"/john\", micro) // GET /john/doe -> 200 OK micro.Get(\"/doe\", func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusOK) }) log.Fatal(app.Listen(\":3000\")) }","s":"Mount","u":"/next/api/app","h":"#mount","p":84},{"i":92,"t":"The MountPath property contains one or more path patterns on which a sub-app was mounted. Signature func (app *App) MountPath() string Examples func main() { app := fiber.New() one := fiber.New() two := fiber.New() three := fiber.New() two.Mount(\"/three\", three) one.Mount(\"/two\", two) app.Mount(\"/one\", one) one.MountPath() // \"/one\" two.MountPath() // \"/one/two\" three.MountPath() // \"/one/two/three\" app.MountPath() // \"\" } caution Mounting order is important for MountPath. If you want to get mount paths properly, you should start mounting from the deepest app.","s":"MountPath","u":"/next/api/app","h":"#mountpath","p":84},{"i":94,"t":"You can group routes by creating a *Group struct. Signature func (app *App) Group(prefix string, handlers ...Handler) Router Examples func main() { app := fiber.New() api := app.Group(\"/api\", handler) // /api v1 := api.Group(\"/v1\", handler) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", handler) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) }","s":"Group","u":"/next/api/app","h":"#group","p":84},{"i":96,"t":"You can define routes with a common prefix inside the common function. Signature func (app *App) Route(prefix string, fn func(router Router), name ...string) Router Examples func main() { app := fiber.New() app.Route(\"/test\", func(api fiber.Router) { api.Get(\"/foo\", handler).Name(\"foo\") // /test/foo (name: test.foo) api.Get(\"/bar\", handler).Name(\"bar\") // /test/bar (name: test.bar) }, \"test.\") log.Fatal(app.Listen(\":3000\")) }","s":"Route","u":"/next/api/app","h":"#route","p":84},{"i":98,"t":"Server returns the underlying fasthttp server Signature func (app *App) Server() *fasthttp.Server Examples func main() { app := fiber.New() app.Server().MaxConnsPerIP = 1 // ... }","s":"Server","u":"/next/api/app","h":"#server","p":84},{"i":100,"t":"Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners and then waits indefinitely for all connections to return to idle before shutting down. ShutdownWithTimeout will forcefully close any active connections after the timeout expires. ShutdownWithContext shuts down the server including by force if the context's deadline is exceeded. func (app *App) Shutdown() error func (app *App) ShutdownWithTimeout(timeout time.Duration) error func (app *App) ShutdownWithContext(ctx context.Context) error","s":"Server Shutdown","u":"/next/api/app","h":"#server-shutdown","p":84},{"i":102,"t":"This method returns the amount of registered handlers. Signature func (app *App) HandlersCount() uint32","s":"HandlersCount","u":"/next/api/app","h":"#handlerscount","p":84},{"i":104,"t":"This method returns the original router stack Signature func (app *App) Stack() [][]*Route Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/john/:age\", handler) app.Post(\"/register\", handler) data, _ := json.MarshalIndent(app.Stack(), \"\", \" \") fmt.Println(string(data)) app.Listen(\":3000\") } Result [ [ { \"method\": \"GET\", \"path\": \"/john/:age\", \"params\": [ \"age\" ] } ], [ { \"method\": \"HEAD\", \"path\": \"/john/:age\", \"params\": [ \"age\" ] } ], [ { \"method\": \"POST\", \"path\": \"/register\", \"params\": null } ] ]","s":"Stack","u":"/next/api/app","h":"#stack","p":84},{"i":106,"t":"This method assigns the name of latest created route. Signature func (app *App) Name(name string) Router Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/\", handler) app.Name(\"index\") app.Get(\"/doe\", handler).Name(\"home\") app.Trace(\"/tracer\", handler).Name(\"tracert\") app.Delete(\"/delete\", handler).Name(\"delete\") a := app.Group(\"/a\") a.Name(\"fd.\") a.Get(\"/test\", handler).Name(\"test\") data, _ := json.MarshalIndent(app.Stack(), \"\", \" \") fmt.Print(string(data)) app.Listen(\":3000\") } Result [ [ { \"method\": \"GET\", \"name\": \"index\", \"path\": \"/\", \"params\": null }, { \"method\": \"GET\", \"name\": \"home\", \"path\": \"/doe\", \"params\": null }, { \"method\": \"GET\", \"name\": \"fd.test\", \"path\": \"/a/test\", \"params\": null } ], [ { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/\", \"params\": null }, { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/doe\", \"params\": null }, { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/a/test\", \"params\": null } ], null, null, [ { \"method\": \"DELETE\", \"name\": \"delete\", \"path\": \"/delete\", \"params\": null } ], null, null, [ { \"method\": \"TRACE\", \"name\": \"tracert\", \"path\": \"/tracer\", \"params\": null } ], null ]","s":"Name","u":"/next/api/app","h":"#name","p":84},{"i":108,"t":"This method gets the route by name. Signature func (app *App) GetRoute(name string) Route Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/\", handler).Name(\"index\") data, _ := json.MarshalIndent(app.GetRoute(\"index\"), \"\", \" \") fmt.Print(string(data)) app.Listen(\":3000\") } Result { \"method\": \"GET\", \"name\": \"index\", \"path\": \"/\", \"params\": null }","s":"GetRoute","u":"/next/api/app","h":"#getroute","p":84},{"i":110,"t":"This method gets all routes. Signature func (app *App) GetRoutes(filterUseOption ...bool) []Route When filterUseOption equal to true, it will filter the routes registered by the middleware. Examples func main() { app := fiber.New() app.Post(\"/\", func (c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }).Name(\"index\") data, _ := json.MarshalIndent(app.GetRoutes(true), \"\", \" \") fmt.Print(string(data)) } Result [ { \"method\": \"POST\", \"name\": \"index\", \"path\": \"/\", \"params\": null } ]","s":"GetRoutes","u":"/next/api/app","h":"#getroutes","p":84},{"i":112,"t":"Config returns the app config as value ( read-only ). Signature func (app *App) Config() Config","s":"Config","u":"/next/api/app","h":"#config","p":84},{"i":114,"t":"Handler returns the server handler that can be used to serve custom *fasthttp.RequestCtx requests. Signature func (app *App) Handler() fasthttp.RequestHandler","s":"Handler","u":"/next/api/app","h":"#handler","p":84},{"i":116,"t":"Listen serves HTTP requests from the given address. Signature func (app *App) Listen(addr string) error Examples // Listen on port :8080 app.Listen(\":8080\") // Custom host app.Listen(\"127.0.0.1:8080\")","s":"Listen","u":"/next/api/app","h":"#listen","p":84},{"i":118,"t":"ListenTLS serves HTTPs requests from the given address using certFile and keyFile paths to as TLS certificate and key file. Signature func (app *App) ListenTLS(addr, certFile, keyFile string) error Examples app.ListenTLS(\":443\", \"./cert.pem\", \"./cert.key\"); Using ListenTLS defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, Certificates: []tls.Certificate{ cert, }, }","s":"ListenTLS","u":"/next/api/app","h":"#listentls","p":84},{"i":120,"t":"Signature func (app *App) ListenTLS(addr string, cert tls.Certificate) error Examples app.ListenTLSWithCertificate(\":443\", cert); Using ListenTLSWithCertificate defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, Certificates: []tls.Certificate{ cert, }, }","s":"ListenTLSWithCertificate","u":"/next/api/app","h":"#listentlswithcertificate","p":84},{"i":122,"t":"ListenMutualTLS serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file Signature func (app *App) ListenMutualTLS(addr, certFile, keyFile, clientCertFile string) error Examples app.ListenMutualTLS(\":443\", \"./cert.pem\", \"./cert.key\", \"./ca-chain-cert.pem\"); Using ListenMutualTLS defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, ClientAuth: tls.RequireAndVerifyClientCert, ClientCAs: clientCertPool, Certificates: []tls.Certificate{ cert, }, }","s":"ListenMutualTLS","u":"/next/api/app","h":"#listenmutualtls","p":84},{"i":124,"t":"ListenMutualTLSWithCertificate serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file Signature func (app *App) ListenMutualTLSWithCertificate(addr string, cert tls.Certificate, clientCertPool *x509.CertPool) error Examples app.ListenMutualTLSWithCertificate(\":443\", cert, clientCertPool); Using ListenMutualTLSWithCertificate defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, ClientAuth: tls.RequireAndVerifyClientCert, ClientCAs: clientCertPool, Certificates: []tls.Certificate{ cert, }, }","s":"ListenMutualTLSWithCertificate","u":"/next/api/app","h":"#listenmutualtlswithcertificate","p":84},{"i":126,"t":"You can pass your own net.Listener using the Listener method. This method can be used to enable TLS/HTTPS with a custom tls.Config. Signature func (app *App) Listener(ln net.Listener) error Examples ln, _ := net.Listen(\"tcp\", \":3000\") cer, _:= tls.LoadX509KeyPair(\"server.crt\", \"server.key\") ln = tls.NewListener(ln, &tls.Config{Certificates: []tls.Certificate{cer}}) app.Listener(ln)","s":"Listener","u":"/next/api/app","h":"#listener","p":84},{"i":128,"t":"Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 1s if you want to disable a timeout altogether, pass -1 as a second argument. Signature func (app *App) Test(req *http.Request, msTimeout ...int) (*http.Response, error) Examples // Create route with GET method for test: app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(c.BaseURL()) // => http://google.com fmt.Println(c.Get(\"X-Custom-Header\")) // => hi return c.SendString(\"hello, World!\") }) // http.Request req := httptest.NewRequest(\"GET\", \"http://google.com\", nil) req.Header.Set(\"X-Custom-Header\", \"hi\") // http.Response resp, _ := app.Test(req) // Do something with results: if resp.StatusCode == fiber.StatusOK { body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) // => Hello, World! }","s":"Test","u":"/next/api/app","h":"#test","p":84},{"i":130,"t":"Hooks is a method to return hooks property. Signature func (app *App) Hooks() *Hooks","s":"Hooks","u":"/next/api/app","h":"#hooks","p":84},{"i":133,"t":"This method creates a new App named instance. You can pass optional config when creating a new instance. Signature func New(config ...Config) *App Example // Default config app := fiber.New() // ...","s":"New","u":"/next/api/fiber","h":"#new","p":131},{"i":135,"t":"You can pass an optional Config when creating a new Fiber instance. Example // Custom config app := fiber.New(fiber.Config{ Prefork: true, CaseSensitive: true, StrictRouting: true, ServerHeader: \"Fiber\", AppName: \"Test App v1.0.1\", }) // ... Config fields Property Type Description Default AppName string This allows to setup app name for the app \"\" BodyLimit int Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response. 4 * 1024 * 1024 CaseSensitive bool When enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same. false ColorScheme Colors You can define custom color scheme. They'll be used for startup message, route list and some middlewares. DefaultColors CompressedFileSuffix string Adds a suffix to the original file name and tries saving the resulting compressed file under the new file name. \".fiber.gz\" Concurrency int Maximum number of concurrent connections. 256 * 1024 DisableDefaultContentType bool When set to true, causes the default Content-Type header to be excluded from the Response. false DisableDefaultDate bool When set to true causes the default date header to be excluded from the response. false DisableHeaderNormalizing bool By default all header names are normalized: conteNT-tYPE -> Content-Type false DisableKeepalive bool Disable keep-alive connections, the server will close incoming connections after sending the first response to the client false DisablePreParseMultipartForm bool Will not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data. false DisableStartupMessage bool When set to true, it will not print out debug information false ETag bool Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled. false EnableIPValidation bool If set to true, c.IP() and c.IPs() will validate IP addresses before returning them. Also, c.IP() will return only the first valid IP rather than just the raw header value that may be a comma seperated string. WARNING: There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header. false EnablePrintRoutes bool EnablePrintRoutes enables print all routes with their method, path, name and handler.. false EnableTrustedProxyCheck bool When set to true, fiber will check whether proxy is trusted, using TrustedProxies list. By default c.Protocol() will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, c.IP() will get value from ProxyHeader header, c.Hostname() will get value from X-Forwarded-Host header. If EnableTrustedProxyCheck is true, and RemoteIP is in the list of TrustedProxies c.Protocol(), c.IP(), and c.Hostname() will have the same behaviour when EnableTrustedProxyCheck disabled, if RemoteIP isn't in the list, c.Protocol() will return https in case when tls connection is handled by the app, or http otherwise, c.IP() will return RemoteIP() from fasthttp context, c.Hostname() will return fasthttp.Request.URI().Host() false ErrorHandler ErrorHandler ErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests. DefaultErrorHandler GETOnly bool Rejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set. false IdleTimeout time.Duration The maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used. nil Immutable bool When enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue #185. false JSONDecoder utils.JSONUnmarshal Allowing for flexibility in using another json library for decoding. json.Unmarshal JSONEncoder utils.JSONMarshal Allowing for flexibility in using another json library for encoding. json.Marshal Network string Known networks are \"tcp\", \"tcp4\" (IPv4-only), \"tcp6\" (IPv6-only) WARNING: When prefork is set to true, only \"tcp4\" and \"tcp6\" can be chosen. NetworkTCP4 PassLocalsToViews bool PassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our Template Middleware for supported engines. false Prefork bool Enables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding. NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with CMD ./app or CMD [\"sh\", \"-c\", \"/app\"]. For more info, see this issue comment. false ProxyHeader string This will enable c.IP() to return the value of the given header key. By default c.IP()will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. X-Forwarded-*. \"\" ReadBufferSize int per-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies). 4096 ReadTimeout time.Duration The amount of time allowed to read the full request, including the body. The default timeout is unlimited. nil RequestMethods []string RequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish. DefaultMethods ServerHeader string Enables the Server HTTP header with the given value. \"\" StreamRequestBody bool StreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit. false StrictRouting bool When enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same. false TrustedProxies []string Contains the list of trusted proxy IP's. Look at EnableTrustedProxyCheck doc. It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses. []string*__* UnescapePath bool Converts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special characters false Views Views Views is the interface that wraps the Render function. See our Template Middleware for supported engines. nil ViewsLayout string Views Layout is the global layout for all template render until override on Render function. See our Template Middleware for supported engines. \"\" WriteBufferSize int Per-connection buffer size for responses' writing. 4096 WriteTimeout time.Duration The maximum duration before timing out writes of the response. The default timeout is unlimited. nil XMLEncoder utils.XMLMarshal Allowing for flexibility in using another XML library for encoding. xml.Marshal","s":"Config","u":"/next/api/fiber","h":"#config","p":131},{"i":137,"t":"NewError creates a new HTTPError instance with an optional message. Signature func NewError(code int, message ...string) *Error Example app.Get(\"/\", func(c *fiber.Ctx) error { return fiber.NewError(782, \"Custom error message\") })","s":"NewError","u":"/next/api/fiber","h":"#newerror","p":131},{"i":139,"t":"IsChild determines if the current process is a result of Prefork. Signature func IsChild() bool Example // Prefork will spawn child processes app := fiber.New(fiber.Config{ Prefork: true, }) if !fiber.IsChild() { fmt.Println(\"I'm the parent process\") } else { fmt.Println(\"I'm a child process\") } // ...","s":"IsChild","u":"/next/api/fiber","h":"#ischild","p":131},{"i":141,"t":"We can use logs to observe program behavior, diagnose problems, or configure corresponding alarms. And defining a well structured log can improve search efficiency and facilitate handling of problems. Fiber provides a default way to print logs in the standard output. It also provides several global functions, such as log.Info, log.Errorf, log.Warnw, etc.","s":"Log","u":"/next/api/log","h":"#log","p":140},{"i":143,"t":"const ( LevelTrace Level = iota LevelDebug LevelInfo LevelWarn LevelError LevelFatal LevelPanic )","s":"Log levels","u":"/next/api/log","h":"#log-levels","p":140},{"i":145,"t":"Fiber provides the AllLogger interface for adapting the various log libraries. type CommonLogger interface { Logger FormatLogger WithLogger } type AllLogger interface { CommonLogger ControlLogger WithLogger }","s":"Custom log","u":"/next/api/log","h":"#custom-log","p":140},{"i":147,"t":"Note: The method of calling the Fatal level will interrupt the program running after printing the log, please use it with caution. Directly print logs of different levels, which will be entered into messageKey, the default is msg. log.Info(\"Hello, World!\") log.Debug(\"Are you OK?\") log.Info(\"42 is the answer to life, the universe, and everything\") log.Warn(\"We are under attack!\") log.Error(\"Houston, we have a problem.\") log.Fatal(\"So Long, and Thanks for All the Fislog.\") log.Panic(\"The system is down.\") Format and print logs of different levels, all methods end with f log.Debugf(\"Hello %s\", \"boy\") log.Infof(\"%d is the answer to life, the universe, and everything\", 233) log.Warnf(\"We are under attack %s!\", \"boss\") log.Errorf(\"%s, we have a problem.\", \"Master Shifu\") log.Fatalf(\"So Long, and Thanks for All the %s.\", \"banana\") Print a message with the key and value, or KEYVALS UNPAIRED if the key and value are not a pair. log.Debugw(\"\", \"Hello\", \"boy\") log.Infow(\"\", \"number\", 233) log.Warnw(\"\", \"job\", \"boss\") log.Errorw(\"\", \"name\", \"Master Shifu\") log.Fatalw(\"\", \"fruit\", \"banana\")","s":"Print log","u":"/next/api/log","h":"#print-log","p":140},{"i":149,"t":"If you are in a project and just want to use a simple log function that can be printed at any time in the global, we provide a global log. import \"github.com/gofiber/fiber/v2/log\" log.Info(\"info\") log.Warn(\"warn\") The above is using the default log.DefaultLogger standard output. You can also find an already implemented adaptation under contrib, or use your own implemented Logger and use log.SetLogger to set the global log logger. import ( \"log\" fiberlog \"github.com/gofiber/fiber/v2/log\" ) var _ log.AllLogger = (*customLogger)(nil) type customLogger struct { stdlog *log.Logger } // ... // inject your custom logger fiberlog.SetLogger(customLogger)","s":"Global log","u":"/next/api/log","h":"#global-log","p":140},{"i":151,"t":"log.SetLevel sets the level of logs below which logs will not be output. The default logger is LevelTrace. Note that this method is not concurrent-safe. import \"github.com/gofiber/fiber/v2/log\" log.SetLevel(log.LevelInfo)","s":"Set Level","u":"/next/api/log","h":"#set-level","p":140},{"i":153,"t":"log.SetOutput sets the output destination of the logger. The default logger types the log in the console. var logger AllLogger = &defaultLogger{ stdlog: log.New(os.Stderr, \"\", log.LstdFlags|log.Lshortfile|log.Lmicroseconds), depth: 4, } Set the output destination to the file. // Output to ./test.log file f, err := os.OpenFile(\"test.log\", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) if err != nil { return } log.SetOutput(f) Set the output destination to the console and file. // Output to ./test.log file file, _ := os.OpenFile(\"test.log\", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) iw := io.MultiWriter(os.Stdout, file) log.SetOutput(iw)","s":"Set output","u":"/next/api/log","h":"#set-output","p":140},{"i":155,"t":"Set the context, using the following method will return a CommonLogger instance bound to the specified context commonLogger := log.WithContext(ctx) commonLogger.Info(\"info\")","s":"Bind context","u":"/next/api/log","h":"#bind-context","p":140},{"i":157,"t":"Converter for net/http handlers to/from Fiber request handlers, special thanks to @arsmn!","s":"Adaptor","u":"/next/api/middleware/adaptor","h":"","p":156},{"i":159,"t":"Name Signature Description HTTPHandler HTTPHandler(h http.Handler) fiber.Handler http.Handler -> fiber.Handler HTTPHandlerFunc HTTPHandlerFunc(h http.HandlerFunc) fiber.Handler http.HandlerFunc -> fiber.Handler HTTPMiddleware HTTPHandlerFunc(mw func(http.Handler) http.Handler) fiber.Handler func(http.Handler) http.Handler -> fiber.Handler FiberHandler FiberHandler(h fiber.Handler) http.Handler fiber.Handler -> http.Handler FiberHandlerFunc FiberHandlerFunc(h fiber.Handler) http.HandlerFunc fiber.Handler -> http.HandlerFunc FiberApp FiberApp(app *fiber.App) http.HandlerFunc Fiber app -> http.HandlerFunc ConvertRequest ConvertRequest(c *fiber.Ctx, forServer bool) (*http.Request, error) fiber.Ctx -> http.Request CopyContextToFiberContext CopyContextToFiberContext(context interface{}, requestContext *fasthttp.RequestCtx) context.Context -> fasthttp.RequestCtx","s":"Signatures","u":"/next/api/middleware/adaptor","h":"#signatures","p":156},{"i":162,"t":"package main import ( \"fmt\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // New fiber app app := fiber.New() // http.Handler -> fiber.Handler app.Get(\"/\", adaptor.HTTPHandler(handler(greet))) // http.HandlerFunc -> fiber.Handler app.Get(\"/func\", adaptor.HTTPHandlerFunc(greet)) // Listen on port 3000 app.Listen(\":3000\") } func handler(f http.HandlerFunc) http.Handler { return http.HandlerFunc(f) } func greet(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, \"Hello World!\") }","s":"net/http to Fiber","u":"/next/api/middleware/adaptor","h":"#nethttp-to-fiber","p":156},{"i":164,"t":"package main import ( \"log\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // New fiber app app := fiber.New() // http middleware -> fiber.Handler app.Use(adaptor.HTTPMiddleware(logMiddleware)) // Listen on port 3000 app.Listen(\":3000\") } func logMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { log.Println(\"log middleware\") next.ServeHTTP(w, r) }) }","s":"net/http middleware to Fiber","u":"/next/api/middleware/adaptor","h":"#nethttp-middleware-to-fiber","p":156},{"i":166,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // fiber.Handler -> http.Handler http.Handle(\"/\", adaptor.FiberHandler(greet)) // fiber.Handler -> http.HandlerFunc http.HandleFunc(\"/func\", adaptor.FiberHandlerFunc(greet)) // Listen on port 3000 http.ListenAndServe(\":3000\", nil) } func greet(c *fiber.Ctx) error { return c.SendString(\"Hello World!\") }","s":"Fiber Handler to net/http","u":"/next/api/middleware/adaptor","h":"#fiber-handler-to-nethttp","p":156},{"i":168,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { app := fiber.New() app.Get(\"/greet\", greet) // Listen on port 3000 http.ListenAndServe(\":3000\", adaptor.FiberApp(app)) } func greet(c *fiber.Ctx) error { return c.SendString(\"Hello World!\") }","s":"Fiber App to net/http","u":"/next/api/middleware/adaptor","h":"#fiber-app-to-nethttp","p":156},{"i":170,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { app := fiber.New() app.Get(\"/greet\", greetWithHTTPReq) // Listen on port 3000 http.ListenAndServe(\":3000\", adaptor.FiberApp(app)) } func greetWithHTTPReq(c *fiber.Ctx) error { httpReq, err := adaptor.ConvertRequest(c, false) if err != nil { return err } return c.SendString(\"Request URL: \" + httpReq.URL.String()) }","s":"Fiber Context to (net/http).Request","u":"/next/api/middleware/adaptor","h":"#fiber-context-to-nethttprequest","p":156},{"i":172,"t":"Basic Authentication middleware for Fiber that provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized or a custom response for missing or invalid credentials.","s":"BasicAuth","u":"/next/api/middleware/basicauth","h":"","p":171},{"i":174,"t":"func New(config Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/basicauth","h":"#signatures","p":171},{"i":176,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/basicauth\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config app.Use(basicauth.New(basicauth.Config{ Users: map[string]string{ \"john\": \"doe\", \"admin\": \"123456\", }, })) // Or extend your config for customization app.Use(basicauth.New(basicauth.Config{ Users: map[string]string{ \"john\": \"doe\", \"admin\": \"123456\", }, Realm: \"Forbidden\", Authorizer: func(user, pass string) bool { if user == \"john\" && pass == \"doe\" { return true } if user == \"admin\" && pass == \"123456\" { return true } return false }, Unauthorized: func(c *fiber.Ctx) error { return c.SendFile(\"./unauthorized.html\") }, ContextUsername: \"_user\", ContextPassword: \"_pass\", }))","s":"Examples","u":"/next/api/middleware/basicauth","h":"#examples","p":171},{"i":178,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Users defines the allowed credentials // // Required. Default: map[string]string{} Users map[string]string // Realm is a string to define realm attribute of BasicAuth. // the realm identifies the system to authenticate against // and can be used by clients to save credentials // // Optional. Default: \"Restricted\". Realm string // Authorizer defines a function you can pass // to check the credentials however you want. // It will be called with a username and password // and is expected to return true or false to indicate // that the credentials were approved or not. // // Optional. Default: nil. Authorizer func(string, string) bool // Unauthorized defines the response body for unauthorized responses. // By default it will return with a 401 Unauthorized and the correct WWW-Auth header // // Optional. Default: nil Unauthorized fiber.Handler // ContextUser is the key to store the username in Locals // // Optional. Default: \"username\" ContextUsername string // ContextPass is the key to store the password in Locals // // Optional. Default: \"password\" ContextPassword string }","s":"Config","u":"/next/api/middleware/basicauth","h":"#config","p":171},{"i":180,"t":"var ConfigDefault = Config{ Next: nil, Users: map[string]string{}, Realm: \"Restricted\", Authorizer: nil, Unauthorized: nil, ContextUsername: \"username\", ContextPassword: \"password\", }","s":"Default Config","u":"/next/api/middleware/basicauth","h":"#default-config","p":171},{"i":182,"t":"Cache middleware for Fiber designed to intercept responses and cache them. This middleware will cache the Body, Content-Type and StatusCode using the c.Path() as unique identifier. Special thanks to @codemicro for creating this middleware for Fiber core! Request Directives Cache-Control: no-cache will return the up-to-date response but still caches it. You will always get a miss cache status. Cache-Control: no-store will refrain from caching. You will always get the up-to-date response.","s":"Cache","u":"/next/api/middleware/cache","h":"","p":181},{"i":184,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/cache","h":"#signatures","p":181},{"i":186,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/cache\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(cache.New()) // Or extend your config for customization app.Use(cache.New(cache.Config{ Next: func(c *fiber.Ctx) bool { return c.Query(\"refresh\") == \"true\" }, Expiration: 30 * time.Minute, CacheControl: true, })) Or you can custom key and expire time like this: app.Use(cache.New(cache.Config{ ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration { newCacheTime, _ := strconv.Atoi(c.GetRespHeader(\"Cache-Time\", \"600\")) return time.Second * time.Duration(newCacheTime) }, KeyGenerator: func(c *fiber.Ctx) string { return utils.CopyString(c.Path()) }, })) app.Get(\"/\", func(c *fiber.Ctx) error { c.Response().Header.Add(\"Cache-Time\", \"6000\") return c.SendString(\"hi\") })","s":"Examples","u":"/next/api/middleware/cache","h":"#examples","p":181},{"i":188,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Expiration is the time that an cached response will live // // Optional. Default: 1 * time.Minute Expiration time.Duration // CacheHeader header on response header, indicate cache status, with the following possible return value // // hit, miss, unreachable // // Optional. Default: X-Cache CacheHeader string // CacheControl enables client side caching if set to true // // Optional. Default: false CacheControl bool // Key allows you to generate custom keys, by default c.Path() is used // // Default: func(c *fiber.Ctx) string { // return utils.CopyString(c.Path()) // } KeyGenerator func(*fiber.Ctx) string // allows you to generate custom Expiration Key By Key, default is Expiration (Optional) // // Default: nil ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration // Store is used to store the state of the middleware // // Default: an in memory store for this process only Storage fiber.Storage // allows you to store additional headers generated by next middlewares & handler // // Default: false StoreResponseHeaders bool // Max number of bytes of response bodies simultaneously stored in cache. When limit is reached, // entries with the nearest expiration are deleted to make room for new. // 0 means no limit // // Default: 0 MaxBytes uint // You can specify HTTP methods to cache. // The middleware just caches the routes of its methods in this slice. // // Default: []string{fiber.MethodGet, fiber.MethodHead} Methods []string }","s":"Config","u":"/next/api/middleware/cache","h":"#config","p":181},{"i":190,"t":"var ConfigDefault = Config{ Next: nil, Expiration: 1 * time.Minute, CacheHeader: \"X-Cache\", CacheControl: false, KeyGenerator: func(c *fiber.Ctx) string { return utils.CopyString(c.Path()) }, ExpirationGenerator: nil, StoreResponseHeaders: false, Storage: nil, MaxBytes: 0, Methods: []string{fiber.MethodGet, fiber.MethodHead}, }","s":"Default Config","u":"/next/api/middleware/cache","h":"#default-config","p":181},{"i":192,"t":"Compression middleware for Fiber that will compress the response using gzip, deflate and brotli compression depending on the Accept-Encoding header.","s":"Compress","u":"/next/api/middleware/compress","h":"","p":191},{"i":194,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/compress","h":"#signatures","p":191},{"i":196,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/compress\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(compress.New()) // Or extend your config for customization app.Use(compress.New(compress.Config{ Level: compress.LevelBestSpeed, // 1 })) // Skip middleware for specific routes app.Use(compress.New(compress.Config{ Next: func(c *fiber.Ctx) bool { return c.Path() == \"/dont_compress\" }, Level: compress.LevelBestSpeed, // 1 }))","s":"Examples","u":"/next/api/middleware/compress","h":"#examples","p":191},{"i":198,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Level determines the compression algoritm // // Optional. Default: LevelDefault // LevelDisabled: -1 // LevelDefault: 0 // LevelBestSpeed: 1 // LevelBestCompression: 2 Level int }","s":"Config","u":"/next/api/middleware/compress","h":"#config","p":191},{"i":200,"t":"var ConfigDefault = Config{ Next: nil, Level: LevelDefault, }","s":"Default Config","u":"/next/api/middleware/compress","h":"#default-config","p":191},{"i":202,"t":"// Compression levels const ( LevelDisabled = -1 LevelDefault = 0 LevelBestSpeed = 1 LevelBestCompression = 2 )","s":"Constants","u":"/next/api/middleware/compress","h":"#constants","p":191},{"i":204,"t":"CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.","s":"CORS","u":"/next/api/middleware/cors","h":"","p":203},{"i":206,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/cors","h":"#signatures","p":203},{"i":208,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/cors\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(cors.New()) // Or extend your config for customization app.Use(cors.New(cors.Config{ AllowOrigins: \"https://gofiber.io, https://gofiber.net\", AllowHeaders: \"Origin, Content-Type, Accept\", })) Using the AllowOriginsFunc function. In this example any origin will be allowed via CORS. For example, if a browser running on http://localhost:3000 sends a request, this will be accepted and the access-control-allow-origin response header will be set to http://localhost:3000. Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via AllowOrigins. app.Use(cors.New()) app.Use(cors.New(cors.Config{ AllowOriginsFunc: func(origin string) bool { return os.Getenv(\"ENVIRONMENT\") == \"development\" }, }))","s":"Examples","u":"/next/api/middleware/cors","h":"#examples","p":203},{"i":210,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // AllowOriginsFunc defines a function that will set the 'access-control-allow-origin' // response header to the 'origin' request header when returned true. // // Note: Using this feature is discouraged in production and it's best practice to explicitly // set CORS origins via 'AllowOrigins' // // Optional. Default: nil AllowOriginsFunc func(origin string) bool // AllowOrigin defines a list of origins that may access the resource. // // Optional. Default value \"*\" AllowOrigins string // AllowMethods defines a list methods allowed when accessing the resource. // This is used in response to a preflight request. // // Optional. Default value \"GET,POST,HEAD,PUT,DELETE,PATCH\" AllowMethods string // AllowHeaders defines a list of request headers that can be used when // making the actual request. This is in response to a preflight request. // // Optional. Default value \"\". AllowHeaders string // AllowCredentials indicates whether or not the response to the request // can be exposed when the credentials flag is true. When used as part of // a response to a preflight request, this indicates whether or not the // actual request can be made using credentials. // // Optional. Default value false. AllowCredentials bool // ExposeHeaders defines a whitelist headers that clients are allowed to // access. // // Optional. Default value \"\". ExposeHeaders string // MaxAge indicates how long (in seconds) the results of a preflight request // can be cached. // // Optional. Default value 0. MaxAge int }","s":"Config","u":"/next/api/middleware/cors","h":"#config","p":203},{"i":212,"t":"var ConfigDefault = Config{ Next: nil, AllowOriginsFunc: nil, AllowOrigins: \"*\", AllowMethods: strings.Join([]string{ fiber.MethodGet, fiber.MethodPost, fiber.MethodHead, fiber.MethodPut, fiber.MethodDelete, fiber.MethodPatch, }, \",\"), AllowHeaders: \"\", AllowCredentials: false, ExposeHeaders: \"\", MaxAge: 0, }","s":"Default Config","u":"/next/api/middleware/cors","h":"#default-config","p":203},{"i":214,"t":"CSRF middleware for Fiber that provides Cross-site request forgery protection by passing a csrf token via cookies. This cookie value will be used to compare against the client csrf token on requests, other than those defined as \"safe\" by RFC7231 (GET, HEAD, OPTIONS, or TRACE). When the csrf token is invalid, this middleware will return the fiber.ErrForbidden error. CSRF Tokens are generated on GET requests. You can retrieve the CSRF token with c.Locals(contextKey), where contextKey is the string you set in the config (see Custom Config below). When no csrf_ cookie is set, or the token has expired, a new token will be generated and csrf_ cookie set. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.","s":"CSRF","u":"/next/api/middleware/csrf","h":"","p":213},{"i":216,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/csrf","h":"#signatures","p":213},{"i":218,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/csrf\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(csrf.New()) // Or extend your config for customization app.Use(csrf.New(csrf.Config{ KeyLookup: \"header:X-Csrf-Token\", CookieName: \"csrf_\", CookieSameSite: \"Lax\", Expiration: 1 * time.Hour, KeyGenerator: utils.UUID, Extractor: func(c *fiber.Ctx) (string, error) { ... }, })) note KeyLookup will be ignored if Extractor is explicitly set.","s":"Examples","u":"/next/api/middleware/csrf","h":"#examples","p":213},{"i":220,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // KeyLookup is a string in the form of \":\" that is used // to create an Extractor that extracts the token from the request. // Possible values: // - \"header:\" // - \"query:\" // - \"param:\" // - \"form:\" // - \"cookie:\" // // Ignored if an Extractor is explicitly set. // // Optional. Default: \"header:X-CSRF-Token\" KeyLookup string // Name of the session cookie. This cookie will store session key. // Optional. Default value \"csrf_\". CookieName string // Domain of the CSRF cookie. // Optional. Default value \"\". CookieDomain string // Path of the CSRF cookie. // Optional. Default value \"\". CookiePath string // Indicates if CSRF cookie is secure. // Optional. Default value false. CookieSecure bool // Indicates if CSRF cookie is HTTP only. // Optional. Default value false. CookieHTTPOnly bool // Indicates if CSRF cookie is requested by SameSite. // Optional. Default value \"Lax\". CookieSameSite string // Decides whether cookie should last for only the browser sesison. // Ignores Expiration if set to true CookieSessionOnly bool // Expiration is the duration before csrf token will expire // // Optional. Default: 1 * time.Hour Expiration time.Duration // Store is used to store the state of the middleware // // Optional. Default: memory.New() Storage fiber.Storage // Context key to store generated CSRF token into context. // If left empty, token will not be stored in context. // // Optional. Default: \"\" ContextKey string // KeyGenerator creates a new CSRF token // // Optional. Default: utils.UUID KeyGenerator func() string // Extractor returns the csrf token // // If set this will be used in place of an Extractor based on KeyLookup. // // Optional. Default will create an Extractor based on KeyLookup. Extractor func(c *fiber.Ctx) (string, error) }","s":"Config","u":"/next/api/middleware/csrf","h":"#config","p":213},{"i":222,"t":"var ConfigDefault = Config{ KeyLookup: \"header:\" + HeaderName, CookieName: \"csrf_\", CookieSameSite: \"Lax\", Expiration: 1 * time.Hour, KeyGenerator: utils.UUID, ErrorHandler: defaultErrorHandler, Extractor: CsrfFromHeader(HeaderName), }","s":"Default Config","u":"/next/api/middleware/csrf","h":"#default-config","p":213},{"i":224,"t":"const ( HeaderName = \"X-Csrf-Token\" )","s":"Constants","u":"/next/api/middleware/csrf","h":"#constants","p":213},{"i":226,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 app.Use(csrf.New(csrf.Config{ Storage: storage, }))","s":"Custom Storage/Database","u":"/next/api/middleware/csrf","h":"#custom-storagedatabase","p":213},{"i":228,"t":"The Early Data middleware for Fiber adds support for TLS 1.3's early data (\"0-RTT\") feature. Citing RFC 8446, when a client and server share a PSK, TLS 1.3 allows clients to send data on the first flight (\"early data\") to speed up the request, effectively reducing the regular 1-RTT request to a 0-RTT request. Make sure to enable fiber's EnableTrustedProxyCheck config option before using this middleware in order to not trust bogus HTTP request headers of the client. Also be aware that enabling support for early data in your reverse proxy (e.g. nginx, as done with a simple ssl_early_data on;) makes requests replayable. Refer to the following documents before continuing: https://datatracker.ietf.org/doc/html/rfc8446#section-8 https://blog.trailofbits.com/2019/03/25/what-application-developers-need-to-know-about-tls-early-data-0rtt/ By default, this middleware allows early data requests on safe HTTP request methods only and rejects the request otherwise, i.e. aborts the request before executing your handler. This behavior can be controlled by the AllowEarlyData config option. Safe HTTP methods β€” GET, HEAD, OPTIONS and TRACE β€” should not modify a state on the server.","s":"EarlyData","u":"/next/api/middleware/earlydata","h":"","p":227},{"i":230,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/earlydata","h":"#signatures","p":227},{"i":232,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/earlydata\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(earlydata.New()) // Or extend your config for customization app.Use(earlydata.New(earlydata.Config{ Error: fiber.ErrTooEarly, // ... }))","s":"Examples","u":"/next/api/middleware/earlydata","h":"#examples","p":227},{"i":234,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // IsEarlyData returns whether the request is an early-data request. // // Optional. Default: a function which checks if the \"Early-Data\" request header equals \"1\". IsEarlyData func(c *fiber.Ctx) bool // AllowEarlyData returns whether the early-data request should be allowed or rejected. // // Optional. Default: a function which rejects the request on unsafe and allows the request on safe HTTP request methods. AllowEarlyData func(c *fiber.Ctx) bool // Error is returned in case an early-data request is rejected. // // Optional. Default: fiber.ErrTooEarly. Error error }","s":"Config","u":"/next/api/middleware/earlydata","h":"#config","p":227},{"i":236,"t":"var ConfigDefault = Config{ IsEarlyData: func(c *fiber.Ctx) bool { return c.Get(DefaultHeaderName) == DefaultHeaderTrueValue }, AllowEarlyData: func(c *fiber.Ctx) bool { return fiber.IsMethodSafe(c.Method()) }, Error: fiber.ErrTooEarly, }","s":"Default Config","u":"/next/api/middleware/earlydata","h":"#default-config","p":227},{"i":238,"t":"const ( DefaultHeaderName = \"Early-Data\" DefaultHeaderTrueValue = \"1\" )","s":"Constants","u":"/next/api/middleware/earlydata","h":"#constants","p":227},{"i":240,"t":"EnvVar middleware for Fiber that can be used to expose environment variables with various options.","s":"EnvVar","u":"/next/api/middleware/envvar","h":"","p":239},{"i":242,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/envvar","h":"#signatures","p":239},{"i":244,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/envvar\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(\"/expose/envvars\", envvar.New()) // Or extend your config for customization app.Use(\"/expose/envvars\", envvar.New( envvar.Config{ ExportVars: map[string]string{\"testKey\": \"\", \"testDefaultKey\": \"testDefaultVal\"}, ExcludeVars: map[string]string{\"excludeKey\": \"\"}, }), ) note You will need to provide a path to use the envvar middleware.","s":"Examples","u":"/next/api/middleware/envvar","h":"#examples","p":239},{"i":246,"t":"Http response contract: { \"vars\": { \"someEnvVariable\": \"someValue\", \"anotherEnvVariable\": \"anotherValue\", } }","s":"Response","u":"/next/api/middleware/envvar","h":"#response","p":239},{"i":248,"t":"// Config defines the config for middleware. type Config struct { // ExportVars specifies the environment variables that should export ExportVars map[string]string // ExcludeVars specifies the environment variables that should not export ExcludeVars map[string]string }","s":"Config","u":"/next/api/middleware/envvar","h":"#config","p":239},{"i":250,"t":"Config{}","s":"Default Config","u":"/next/api/middleware/envvar","h":"#default-config","p":239},{"i":252,"t":"Encrypt middleware for Fiber which encrypts cookie values. Note: this middleware does not encrypt cookie names.","s":"Encrypt Cookie","u":"/next/api/middleware/encryptcookie","h":"","p":251},{"i":254,"t":"// Intitializes the middleware func New(config ...Config) fiber.Handler // Returns a random 32 character long string func GenerateKey() string","s":"Signatures","u":"/next/api/middleware/encryptcookie","h":"#signatures","p":251},{"i":256,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/encryptcookie\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config // `Key` must be a 32 character string. It's used to encrypt the values, so make sure it is random and keep it secret. // You can run `openssl rand -base64 32` or call `encryptcookie.GenerateKey()` to create a random key for you. // Make sure not to set `Key` to `encryptcookie.GenerateKey()` because that will create a new key every run. app.Use(encryptcookie.New(encryptcookie.Config{ Key: \"secret-thirty-2-character-string\", })) // Get / reading out the encrypted cookie app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"value=\" + c.Cookies(\"test\")) }) // Post / create the encrypted cookie app.Post(\"/\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"test\", Value: \"SomeThing\", }) return nil })","s":"Examples","u":"/next/api/middleware/encryptcookie","h":"#examples","p":251},{"i":258,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Array of cookie keys that should not be encrypted. // // Optional. Default: [\"csrf_\"] Except []string // Base64 encoded unique key to encode & decode cookies. // // Required. The key should be 32 bytes of random data in base64-encoded form. // You may run `openssl rand -base64 32` or use `encryptcookie.GenerateKey()` to generate a new key. Key string // Custom function to encrypt cookies. // // Optional. Default: EncryptCookie Encryptor func(decryptedString, key string) (string, error) // Custom function to decrypt cookies. // // Optional. Default: DecryptCookie Decryptor func(encryptedString, key string) (string, error) }","s":"Config","u":"/next/api/middleware/encryptcookie","h":"#config","p":251},{"i":260,"t":"var ConfigDefault = Config{ Next: nil, Except: []string{\"csrf_\"}, Key: \"\", Encryptor: EncryptCookie, Decryptor: DecryptCookie, }","s":"Default Config","u":"/next/api/middleware/encryptcookie","h":"#default-config","p":251},{"i":262,"t":"Normally, encryptcookie middleware skips csrf_ cookies. However, it won't work when you use custom cookie names for CSRF. You should update Except config to avoid this problem. For example: app.Use(encryptcookie.New(encryptcookie.Config{ Key: \"secret-thirty-2-character-string\", Except: []string{\"csrf_1\"}, // exclude CSRF cookie })) app.Use(csrf.New(csrf.Config{ KeyLookup: \"form:test\", CookieName: \"csrf_1\", CookieHTTPOnly: true, }))","s":"Usage of CSRF and Encryptcookie Middlewares with Custom Cookie Names","u":"/next/api/middleware/encryptcookie","h":"#usage-of-csrf-and-encryptcookie-middlewares-with-custom-cookie-names","p":251},{"i":264,"t":"ETag middleware for Fiber that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.","s":"ETag","u":"/next/api/middleware/etag","h":"","p":263},{"i":266,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/etag","h":"#signatures","p":263},{"i":268,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/etag\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(etag.New()) // Get / receives Etag: \"13-1831710635\" in response header app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) // Or extend your config for customization app.Use(etag.New(etag.Config{ Weak: true, })) // Get / receives Etag: \"W/\"13-1831710635\" in response header app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") })","s":"Examples","u":"/next/api/middleware/etag","h":"#examples","p":263},{"i":270,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Weak indicates that a weak validator is used. Weak etags are easy // to generate, but are far less useful for comparisons. Strong // validators are ideal for comparisons but can be very difficult // to generate efficiently. Weak ETag values of two representations // of the same resources might be semantically equivalent, but not // byte-for-byte identical. This means weak etags prevent caching // when byte range requests are used, but strong etags mean range // requests can still be cached. Weak bool }","s":"Config","u":"/next/api/middleware/etag","h":"#config","p":263},{"i":272,"t":"var ConfigDefault = Config{ Next: nil, Weak: false, }","s":"Default Config","u":"/next/api/middleware/etag","h":"#default-config","p":263},{"i":274,"t":"Expvar middleware for Fiber that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is /debug/vars.","s":"ExpVar","u":"/next/api/middleware/expvar","h":"","p":273},{"i":276,"t":"func New() fiber.Handler","s":"Signatures","u":"/next/api/middleware/expvar","h":"#signatures","p":273},{"i":278,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" expvarmw \"github.com/gofiber/fiber/v2/middleware/expvar\" ) After you initiate your Fiber app, you can use the following possibilities: var count = expvar.NewInt(\"count\") app.Use(expvarmw.New()) app.Get(\"/\", func(c *fiber.Ctx) error { count.Add(1) return c.SendString(fmt.Sprintf(\"hello expvar count %d\", count.Value())) }) Visit path /debug/vars to see all vars and use query r=key to filter exposed variables. curl 127.0.0.1:3000 hello expvar count 1 curl 127.0.0.1:3000/debug/vars { \"cmdline\": [\"xxx\"], \"count\": 1, \"expvarHandlerCalls\": 33, \"expvarRegexpErrors\": 0, \"memstats\": {...} } curl 127.0.0.1:3000/debug/vars?r=c { \"cmdline\": [\"xxx\"], \"count\": 1 }","s":"Examples","u":"/next/api/middleware/expvar","h":"#examples","p":273},{"i":280,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool }","s":"Config","u":"/next/api/middleware/expvar","h":"#config","p":273},{"i":282,"t":"var ConfigDefault = Config{ Next: nil, }","s":"Default Config","u":"/next/api/middleware/expvar","h":"#default-config","p":273},{"i":284,"t":"Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware. note This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or custom favicon URL.","s":"Favicon","u":"/next/api/middleware/favicon","h":"","p":283},{"i":286,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/favicon","h":"#signatures","p":283},{"i":288,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/favicon\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(favicon.New()) // Or extend your config for customization app.Use(favicon.New(favicon.Config{ File: \"./favicon.ico\", URL: \"/favicon.ico\", }))","s":"Examples","u":"/next/api/middleware/favicon","h":"#examples","p":283},{"i":290,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // File holds the path to an actual favicon that will be cached // // Optional. Default: \"\" File string // URL for favicon handler // // Optional. Default: \"/favicon.ico\" URL string // FileSystem is an optional alternate filesystem to search for the favicon in. // An example of this could be an embedded or network filesystem // // Optional. Default: nil FileSystem http.FileSystem // CacheControl defines how the Cache-Control header in the response should be set // // Optional. Default: \"public, max-age=31536000\" CacheControl string }","s":"Config","u":"/next/api/middleware/favicon","h":"#config","p":283},{"i":292,"t":"var ConfigDefault = Config{ Next: nil, File: \"\", URL: fPath, CacheControl: \"public, max-age=31536000\", }","s":"Default Config","u":"/next/api/middleware/favicon","h":"#default-config","p":283},{"i":294,"t":"Filesystem middleware for Fiber that enables you to serve files from a directory. caution :params & :optionals? within the prefix path are not supported! To handle paths with spaces (or other url encoded values) make sure to set fiber.Config{ UnescapePath: true }","s":"FileSystem","u":"/next/api/middleware/filesystem","h":"","p":293},{"i":296,"t":"func New(config Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/filesystem","h":"#signatures","p":293},{"i":298,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config app.Use(filesystem.New(filesystem.Config{ Root: http.Dir(\"./assets\"), })) // Or extend your config for customization app.Use(filesystem.New(filesystem.Config{ Root: http.Dir(\"./assets\"), Browse: true, Index: \"index.html\", NotFoundFile: \"404.html\", MaxAge: 3600, })) If your environment (Go 1.16+) supports it, we recommend using Go Embed instead of the other solutions listed as this one is native to Go and the easiest to use.","s":"Examples","u":"/next/api/middleware/filesystem","h":"#examples","p":293},{"i":300,"t":"Embed is the native method to embed files in a Golang excecutable. Introduced in Go 1.16. package main import ( \"embed\" \"io/fs\" \"log\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" ) // Embed a single file //go:embed index.html var f embed.FS // Embed a directory //go:embed static/* var embedDirStatic embed.FS func main() { app := fiber.New() app.Use(\"/\", filesystem.New(filesystem.Config{ Root: http.FS(f), })) // Access file \"image.png\" under `static/` directory via URL: `http:///static/image.png`. // Without `PathPrefix`, you have to access it via URL: // `http:///static/static/image.png`. app.Use(\"/static\", filesystem.New(filesystem.Config{ Root: http.FS(embedDirStatic), PathPrefix: \"static\", Browse: true, })) log.Fatal(app.Listen(\":3000\")) }","s":"embed","u":"/next/api/middleware/filesystem","h":"#embed","p":293},{"i":302,"t":"https://github.com/markbates/pkger package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/markbates/pkger\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: pkger.Dir(\"/assets\"), })) log.Fatal(app.Listen(\":3000\")) }","s":"pkger","u":"/next/api/middleware/filesystem","h":"#pkger","p":293},{"i":304,"t":"https://github.com/gobuffalo/packr package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/gobuffalo/packr/v2\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: packr.New(\"Assets Box\", \"/assets\"), })) log.Fatal(app.Listen(\":3000\")) }","s":"packr","u":"/next/api/middleware/filesystem","h":"#packr","p":293},{"i":306,"t":"https://github.com/GeertJohan/go.rice package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/GeertJohan/go.rice\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: rice.MustFindBox(\"assets\").HTTPBox(), })) log.Fatal(app.Listen(\":3000\")) }","s":"go.rice","u":"/next/api/middleware/filesystem","h":"#gorice","p":293},{"i":308,"t":"https://github.com/UnnoTed/fileb0x package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"/myEmbeddedFiles\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: myEmbeddedFiles.HTTP, })) log.Fatal(app.Listen(\":3000\")) }","s":"fileb0x","u":"/next/api/middleware/filesystem","h":"#fileb0x","p":293},{"i":310,"t":"https://github.com/rakyll/statik package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" // Use blank to invoke init function and register data to statik _ \"/statik\" \"github.com/rakyll/statik/fs\" ) func main() { statikFS, err := fs.New() if err != nil { panic(err) } app := fiber.New() app.Use(\"/\", filesystem.New(filesystem.Config{ Root: statikFS, })) log.Fatal(app.Listen(\":3000\")) }","s":"statik","u":"/next/api/middleware/filesystem","h":"#statik","p":293},{"i":312,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Root is a FileSystem that provides access // to a collection of files and directories. // // Required. Default: nil Root http.FileSystem `json:\"-\"` // PathPrefix defines a prefix to be added to a filepath when // reading a file from the FileSystem. // // Use when using Go 1.16 embed.FS // // Optional. Default \"\" PathPrefix string `json:\"path_prefix\"` // Enable directory browsing. // // Optional. Default: false Browse bool `json:\"browse\"` // Index file for serving a directory. // // Optional. Default: \"index.html\" Index string `json:\"index\"` // The value for the Cache-Control HTTP-header // that is set on the file response. MaxAge is defined in seconds. // // Optional. Default value 0. MaxAge int `json:\"max_age\"` // File to return if path is not found. Useful for SPA's. // // Optional. Default: \"\" NotFoundFile string `json:\"not_found_file\"` // The value for the Content-Type HTTP-header // that is set on the file response // // Optional. Default: \"\" ContentTypeCharset string `json:\"content_type_charset\"` }","s":"Config","u":"/next/api/middleware/filesystem","h":"#config","p":293},{"i":314,"t":"var ConfigDefault = Config{ Next: nil, Root: nil, PathPrefix: \"\", Browse: false, Index: \"/index.html\", MaxAge: 0, ContentTypeCharset: \"\", }","s":"Default Config","u":"/next/api/middleware/filesystem","h":"#default-config","p":293},{"i":316,"t":"Helmet middleware helps secure your apps by setting various HTTP headers.","s":"Helmet","u":"/next/api/middleware/helmet","h":"","p":315},{"i":318,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/helmet","h":"#signatures","p":315},{"i":320,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/helmet\" ) func main() { app := fiber.New() app.Use(helmet.New()) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome!\") }) app.Listen(\":3000\") } Test: curl -I http://localhost:3000","s":"Examples","u":"/next/api/middleware/helmet","h":"#examples","p":315},{"i":322,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // XSSProtection // Optional. Default value \"0\". XSSProtection string // ContentTypeNosniff // Optional. Default value \"nosniff\". ContentTypeNosniff string // XFrameOptions // Optional. Default value \"SAMEORIGIN\". // Possible values: \"SAMEORIGIN\", \"DENY\", \"ALLOW-FROM uri\" XFrameOptions string // HSTSMaxAge // Optional. Default value 0. HSTSMaxAge int // HSTSExcludeSubdomains // Optional. Default value false. HSTSExcludeSubdomains bool // ContentSecurityPolicy // Optional. Default value \"\". ContentSecurityPolicy string // CSPReportOnly // Optional. Default value false. CSPReportOnly bool // HSTSPreloadEnabled // Optional. Default value false. HSTSPreloadEnabled bool // ReferrerPolicy // Optional. Default value \"ReferrerPolicy\". ReferrerPolicy string // Permissions-Policy // Optional. Default value \"\". PermissionPolicy string // Cross-Origin-Embedder-Policy // Optional. Default value \"require-corp\". CrossOriginEmbedderPolicy string // Cross-Origin-Opener-Policy // Optional. Default value \"same-origin\". CrossOriginOpenerPolicy string // Cross-Origin-Resource-Policy // Optional. Default value \"same-origin\". CrossOriginResourcePolicy string // Origin-Agent-Cluster // Optional. Default value \"?1\". OriginAgentCluster string // X-DNS-Prefetch-Control // Optional. Default value \"off\". XDNSPrefetchControl string // X-Download-Options // Optional. Default value \"noopen\". XDownloadOptions string // X-Permitted-Cross-Domain-Policies // Optional. Default value \"none\". XPermittedCrossDomain string }","s":"Config","u":"/next/api/middleware/helmet","h":"#config","p":315},{"i":324,"t":"var ConfigDefault = Config{ XSSProtection: \"0\", ContentTypeNosniff: \"nosniff\", XFrameOptions: \"SAMEORIGIN\", ReferrerPolicy: \"no-referrer\", CrossOriginEmbedderPolicy: \"require-corp\", CrossOriginOpenerPolicy: \"same-origin\", CrossOriginResourcePolicy: \"same-origin\", OriginAgentCluster: \"?1\", XDNSPrefetchControl: \"off\", XDownloadOptions: \"noopen\", XPermittedCrossDomain: \"none\", }","s":"Default Config","u":"/next/api/middleware/helmet","h":"#default-config","p":315},{"i":326,"t":"Idempotency middleware for Fiber allows for fault-tolerant APIs where duplicate requests β€” for example due to networking issues on the client-side β€” do not erroneously cause the same action performed multiple times on the server-side. Refer to https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02 for a better understanding.","s":"Idempotency","u":"/next/api/middleware/idempotency","h":"","p":325},{"i":328,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/idempotency","h":"#signatures","p":325},{"i":330,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/idempotency\" ) After you initiate your Fiber app, you can use the following possibilities:","s":"Examples","u":"/next/api/middleware/idempotency","h":"#examples","p":325},{"i":332,"t":"app.Use(idempotency.New())","s":"Default Config","u":"/next/api/middleware/idempotency","h":"#default-config","p":325},{"i":334,"t":"app.Use(idempotency.New(idempotency.Config{ Lifetime: 42 * time.Minute, // ... }))","s":"Custom Config","u":"/next/api/middleware/idempotency","h":"#custom-config","p":325},{"i":336,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: a function which skips the middleware on safe HTTP request method. Next func(c *fiber.Ctx) bool // Lifetime is the maximum lifetime of an idempotency key. // // Optional. Default: 30 * time.Minute Lifetime time.Duration // KeyHeader is the name of the header that contains the idempotency key. // // Optional. Default: X-Idempotency-Key KeyHeader string // KeyHeaderValidate defines a function to validate the syntax of the idempotency header. // // Optional. Default: a function which ensures the header is 36 characters long (the size of an UUID). KeyHeaderValidate func(string) error // KeepResponseHeaders is a list of headers that should be kept from the original response. // // Optional. Default: nil (to keep all headers) KeepResponseHeaders []string // Lock locks an idempotency key. // // Optional. Default: an in-memory locker for this process only. Lock Locker // Storage stores response data by idempotency key. // // Optional. Default: an in-memory storage for this process only. Storage fiber.Storage }","s":"Config","u":"/next/api/middleware/idempotency","h":"#config","p":325},{"i":338,"t":"var ConfigDefault = Config{ Next: func(c *fiber.Ctx) bool { // Skip middleware if the request was done using a safe HTTP method return fiber.IsMethodSafe(c.Method()) }, Lifetime: 30 * time.Minute, KeyHeader: \"X-Idempotency-Key\", KeyHeaderValidate: func(k string) error { if l, wl := len(k), 36; l != wl { // UUID length is 36 chars return fmt.Errorf(\"%w: invalid length: %d != %d\", ErrInvalidIdempotencyKey, l, wl) } return nil }, KeepResponseHeaders: nil, Lock: nil, // Set in configDefault so we don't allocate data here. Storage: nil, // Set in configDefault so we don't allocate data here. }","s":"Default Config","u":"/next/api/middleware/idempotency","h":"#default-config-1","p":325},{"i":340,"t":"Key auth middleware provides a key based authentication.","s":"Keyauth","u":"/next/api/middleware/keyauth","h":"","p":339},{"i":342,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/keyauth","h":"#signatures","p":339},{"i":344,"t":"package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" ) var ( apiKey = \"correct horse battery staple\" ) func validateAPIKey(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey } func main() { app := fiber.New() // note that the keyauth middleware needs to be defined before the routes are defined! app.Use(keyauth.New(keyauth.Config{ KeyLookup: \"cookie:access_token\", Validator: validateAPIKey, })) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Listen(\":3000\") } Test: # No api-key specified -> 400 missing curl http://localhost:3000 #> missing or malformed API Key curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000 #> Successfully authenticated! curl --cookie \"access_token=Clearly A Wrong Key\" http://localhost:3000 #> missing or malformed API Key For a more detailed example, see also the github.com/gofiber/recipes repository and specifically the fiber-envoy-extauthz repository and the keyauth example code.","s":"Examples","u":"/next/api/middleware/keyauth","h":"#examples","p":339},{"i":346,"t":"If you want to authenticate only certain endpoints, you can use the Config of keyauth and apply a filter function (eg. authFilter) like so package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" \"regexp\" \"strings\" ) var ( apiKey = \"correct horse battery staple\" protectedURLs = []*regexp.Regexp{ regexp.MustCompile(\"^/authenticated$\"), regexp.MustCompile(\"^/auth2$\"), } ) func validateAPIKey(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey } func authFilter(c *fiber.Ctx) bool { originalURL := strings.ToLower(c.OriginalURL()) for _, pattern := range protectedURLs { if pattern.MatchString(originalURL) { return false } } return true } func main() { app := fiber.New() app.Use(keyauth.New(keyauth.Config{ Next: authFilter, KeyLookup: \"cookie:access_token\", Validator: validateAPIKey, })) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome\") }) app.Get(\"/authenticated\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Get(\"/auth2\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated 2!\") }) app.Listen(\":3000\") } Which results in this # / does not need to be authenticated curl http://localhost:3000 #> Welcome # /authenticated needs to be authenticated curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000/authenticated #> Successfully authenticated! # /auth2 needs to be authenticated too curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000/auth2 #> Successfully authenticated 2!","s":"Authenticate only certain endpoints","u":"/next/api/middleware/keyauth","h":"#authenticate-only-certain-endpoints","p":339},{"i":348,"t":"package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" ) const ( apiKey = \"my-super-secret-key\" ) func main() { app := fiber.New() authMiddleware := keyauth.New(keyauth.Config{ Validator: func(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey }, }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome\") }) app.Get(\"/allowed\", authMiddleware, func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Listen(\":3000\") } Which results in this # / does not need to be authenticated curl http://localhost:3000 #> Welcome # /allowed needs to be authenticated too curl --header \"Authorization: Bearer my-super-secret-key\" http://localhost:3000/allowed #> Successfully authenticated!","s":"Specifying middleware in the handler","u":"/next/api/middleware/keyauth","h":"#specifying-middleware-in-the-handler","p":339},{"i":350,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // SuccessHandler defines a function which is executed for a valid key. // Optional. Default: nil SuccessHandler fiber.Handler // ErrorHandler defines a function which is executed for an invalid key. // It may be used to define a custom error. // Optional. Default: 401 Invalid or expired key ErrorHandler fiber.ErrorHandler // KeyLookup is a string in the form of \":\" that is used // to extract key from the request. // Optional. Default value \"header:Authorization\". // Possible values: // - \"header:\" // - \"query:\" // - \"form:\" // - \"param:\" // - \"cookie:\" KeyLookup string // AuthScheme to be used in the Authorization header. // Optional. Default value \"Bearer\". AuthScheme string // Validator is a function to validate key. Validator func(*fiber.Ctx, string) (bool, error) // Context key to store the bearertoken from the token into context. // Optional. Default: \"token\". ContextKey string }","s":"Config","u":"/next/api/middleware/keyauth","h":"#config","p":339},{"i":352,"t":"var ConfigDefault = Config{ SuccessHandler: func(c *fiber.Ctx) error { return c.Next() }, ErrorHandler: func(c *fiber.Ctx, err error) error { if err == ErrMissingOrMalformedAPIKey { return c.Status(fiber.StatusUnauthorized).SendString(err.Error()) } return c.Status(fiber.StatusUnauthorized).SendString(\"Invalid or expired API Key\") }, KeyLookup: \"header:\" + fiber.HeaderAuthorization, AuthScheme: \"Bearer\", ContextKey: \"token\", }","s":"Default Config","u":"/next/api/middleware/keyauth","h":"#default-config","p":339},{"i":354,"t":"Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases. note This module does not share state with other processes/servers by default.","s":"Limiter","u":"/next/api/middleware/limiter","h":"","p":353},{"i":356,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/limiter","h":"#signatures","p":353},{"i":358,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/limiter\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(limiter.New()) // Or extend your config for customization app.Use(limiter.New(limiter.Config{ Next: func(c *fiber.Ctx) bool { return c.IP() == \"127.0.0.1\" }, Max: 20, Expiration: 30 * time.Second, KeyGenerator: func(c *fiber.Ctx) string { return c.Get(\"x-forwarded-for\") }, LimitReached: func(c *fiber.Ctx) error { return c.SendFile(\"./toofast.html\") }, Storage: myCustomStorage{}, }))","s":"Examples","u":"/next/api/middleware/limiter","h":"#examples","p":353},{"i":360,"t":"Instead of using the standard fixed window algorithm, you can enable the sliding window algorithm. A example of such configuration is: app.Use(limiter.New(limiter.Config{ Max: 20, Expiration: 30 * time.Second, LimiterMiddleware: limiter.SlidingWindow{}, })) This means that every window will take into account the previous window(if there was any). The given formula for the rate is: weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration) rate = weightOfPreviousWindpw + current window's amount request.","s":"Sliding window","u":"/next/api/middleware/limiter","h":"#sliding-window","p":353},{"i":362,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Max number of recent connections during `Duration` seconds before sending a 429 response // // Default: 5 Max int // KeyGenerator allows you to generate custom keys, by default c.IP() is used // // Default: func(c *fiber.Ctx) string { // return c.IP() // } KeyGenerator func(*fiber.Ctx) string // Expiration is the time on how long to keep records of requests in memory // // Default: 1 * time.Minute Expiration time.Duration // LimitReached is called when a request hits the limit // // Default: func(c *fiber.Ctx) error { // return c.SendStatus(fiber.StatusTooManyRequests) // } LimitReached fiber.Handler // When set to true, requests with StatusCode >= 400 won't be counted. // // Default: false SkipFailedRequests bool // When set to true, requests with StatusCode < 400 won't be counted. // // Default: false SkipSuccessfulRequests bool // Store is used to store the state of the middleware // // Default: an in memory store for this process only Storage fiber.Storage // LimiterMiddleware is the struct that implements limiter middleware. // // Default: a new Fixed Window Rate Limiter LimiterMiddleware LimiterHandler } note A custom store can be used if it implements the Storage interface - more details and an example can be found in store.go.","s":"Config","u":"/next/api/middleware/limiter","h":"#config","p":353},{"i":364,"t":"var ConfigDefault = Config{ Max: 5, Expiration: 1 * time.Minute, KeyGenerator: func(c *fiber.Ctx) string { return c.IP() }, LimitReached: func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusTooManyRequests) }, SkipFailedRequests: false, SkipSuccessfulRequests: false, LimiterMiddleware: FixedWindow{}, }","s":"Default Config","u":"/next/api/middleware/limiter","h":"#default-config","p":353},{"i":366,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 app.Use(limiter.New(limiter.Config{ Storage: storage, }))","s":"Custom Storage/Database","u":"/next/api/middleware/limiter","h":"#custom-storagedatabase","p":353},{"i":368,"t":"Logger middleware for Fiber that logs HTTP request/response details.","s":"Logger","u":"/next/api/middleware/logger","h":"","p":367},{"i":370,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/logger","h":"#signatures","p":367},{"i":372,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/logger\" ) tip The order of registration plays a role. Only all routes that are registered after this one will be logged. The middleware should therefore be one of the first to be registered. After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(logger.New()) // Or extend your config for customization // Logging remote IP and Port app.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) // Logging Request ID app.Use(requestid.New()) app.Use(logger.New(logger.Config{ // For more options, see the Config section Format: \"${pid} ${locals:requestid} ${status} - ${method} ${path}​\\n\", })) // Changing TimeZone & TimeFormat app.Use(logger.New(logger.Config{ Format: \"${pid} ${status} - ${method} ${path}\\n\", TimeFormat: \"02-Jan-2006\", TimeZone: \"America/New_York\", })) // Custom File Writer file, err := os.OpenFile(\"./123.log\", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) if err != nil { log.Fatalf(\"error opening file: %v\", err) } defer file.Close() app.Use(logger.New(logger.Config{ Output: file, })) // Add Custom Tags app.Use(logger.New(logger.Config{ CustomTags: map[string]logger.LogFunc{ \"custom_tag\": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) { return output.WriteString(\"it is a custom tag\") }, }, })) // Callback after log is written app.Use(logger.New(logger.Config{ TimeFormat: time.RFC3339Nano, TimeZone: \"Asia/Shanghai\", Done: func(c *fiber.Ctx, logString []byte) { if c.Response().StatusCode() != fiber.StatusOK { reporter.SendToSlack(logString) } }, })) // Disable colors when outputting to default format app.Use(logger.New(logger.Config{ DisableColors: true, }))","s":"Examples","u":"/next/api/middleware/logger","h":"#examples","p":367},{"i":374,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Done is a function that is called after the log string for a request is written to Output, // and pass the log string as parameter. // // Optional. Default: nil Done func(c *fiber.Ctx, logString []byte) // tagFunctions defines the custom tag action // // Optional. Default: map[string]LogFunc CustomTags map[string]LogFunc // Format defines the logging tags // // Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\\n Format string // TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html // // Optional. Default: 15:04:05 TimeFormat string // TimeZone can be specified, such as \"UTC\" and \"America/New_York\" and \"Asia/Chongqing\", etc // // Optional. Default: \"Local\" TimeZone string // TimeInterval is the delay before the timestamp is updated // // Optional. Default: 500 * time.Millisecond TimeInterval time.Duration // Output is a writer where logs are written // // Default: os.Stdout Output io.Writer // DisableColors defines if the logs output should be colorized // // Default: false DisableColors bool enableColors bool enableLatency bool timeZoneLocation *time.Location } type LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)","s":"Config","u":"/next/api/middleware/logger","h":"#config","p":367},{"i":376,"t":"var ConfigDefault = Config{ Next: nil, Done: nil, Format: \"[${time}] ${status} - ${latency} ${method} ${path}\\n\", TimeFormat: \"15:04:05\", TimeZone: \"Local\", TimeInterval: 500 * time.Millisecond, Output: os.Stdout, DisableColors: false, }","s":"Default Config","u":"/next/api/middleware/logger","h":"#default-config","p":367},{"i":378,"t":"// Logger variables const ( TagPid = \"pid\" TagTime = \"time\" TagReferer = \"referer\" TagProtocol = \"protocol\" TagPort = \"port\" TagIP = \"ip\" TagIPs = \"ips\" TagHost = \"host\" TagMethod = \"method\" TagPath = \"path\" TagURL = \"url\" TagUA = \"ua\" TagLatency = \"latency\" TagStatus = \"status\" // response status TagResBody = \"resBody\" // response body TagReqHeaders = \"reqHeaders\" TagQueryStringParams = \"queryParams\" // request query parameters TagBody = \"body\" // request body TagBytesSent = \"bytesSent\" TagBytesReceived = \"bytesReceived\" TagRoute = \"route\" TagError = \"error\" // DEPRECATED: Use TagReqHeader instead TagHeader = \"header:\" // request header TagReqHeader = \"reqHeader:\" // request header TagRespHeader = \"respHeader:\" // response header TagQuery = \"query:\" // request query TagForm = \"form:\" // request form TagCookie = \"cookie:\" // request cookie TagLocals = \"locals:\" // colors TagBlack = \"black\" TagRed = \"red\" TagGreen = \"green\" TagYellow = \"yellow\" TagBlue = \"blue\" TagMagenta = \"magenta\" TagCyan = \"cyan\" TagWhite = \"white\" TagReset = \"reset\" )","s":"Constants","u":"/next/api/middleware/logger","h":"#constants","p":367},{"i":380,"t":"Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor caution Monitor is still in beta, API might change in the future!","s":"Monitor","u":"/next/api/middleware/monitor","h":"","p":379},{"i":382,"t":"func New() fiber.Handler","s":"Signatures","u":"/next/api/middleware/monitor","h":"#signatures","p":379},{"i":384,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/monitor\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config (Assign the middleware to /metrics) app.Get(\"/metrics\", monitor.New()) // Or extend your config for customization // Assign the middleware to /metrics // and change the Title to `MyService Metrics Page` app.Get(\"/metrics\", monitor.New(monitor.Config{Title: \"MyService Metrics Page\"})) You can also access the API endpoint with curl -X GET -H \"Accept: application/json\" http://localhost:3000/metrics which returns: {\"pid\":{ \"cpu\":0.4568381746582226, \"ram\":20516864, \"conns\":3 }, \"os\": { \"cpu\":8.759124087593099, \"ram\":3997155328, \"conns\":44, \"total_ram\":8245489664, \"load_avg\":0.51 }}","s":"Examples","u":"/next/api/middleware/monitor","h":"#examples","p":379},{"i":386,"t":"// Config defines the config for middleware. type Config struct { // Metrics page title // // Optional. Default: \"Fiber Monitor\" Title string // Refresh period // // Optional. Default: 3 seconds Refresh time.Duration // Whether the service should expose only the monitoring API. // // Optional. Default: false APIOnly bool // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Custom HTML Code to Head Section(Before End) // // Optional. Default: empty CustomHead string // FontURL for specify font resource path or URL . also you can use relative path // // Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap FontURL string // ChartJsURL for specify ChartJS library path or URL . also you can use relative path // // Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js ChartJsURL string index string }","s":"Config","u":"/next/api/middleware/monitor","h":"#config","p":379},{"i":388,"t":"var ConfigDefault = Config{ Title: defaultTitle, Refresh: defaultRefresh, FontURL: defaultFontURL, ChartJsURL: defaultChartJSURL, CustomHead: defaultCustomHead, APIOnly: false, Next: nil, index: newIndex(viewBag{ defaultTitle, defaultRefresh, defaultFontURL, defaultChartJSURL, defaultCustomHead, }), }","s":"Default Config","u":"/next/api/middleware/monitor","h":"#default-config","p":379},{"i":390,"t":"Pprof middleware for Fiber that serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/.","s":"Pprof","u":"/next/api/middleware/pprof","h":"","p":389},{"i":392,"t":"func New() fiber.Handler","s":"Signatures","u":"/next/api/middleware/pprof","h":"#signatures","p":389},{"i":394,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/pprof\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(pprof.New()) // Or extend your config for customization // For example, in systems where you have multiple ingress endpoints, it is common to add a URL prefix, like so: app.Use(pprof.New(pprof.Config{Prefix: \"/endpoint-prefix\"})) // This prefix will be added to the default path of \"/debug/pprof/\", for a resulting URL of: \"/endpoint-prefix/debug/pprof/\".","s":"Examples","u":"/next/api/middleware/pprof","h":"#examples","p":389},{"i":396,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Prefix defines a URL prefix added before \"/debug/pprof\". // Note that it should start with (but not end with) a slash. // Example: \"/federated-fiber\" // // Optional. Default: \"\" Prefix string }","s":"Config","u":"/next/api/middleware/pprof","h":"#config","p":389},{"i":398,"t":"var ConfigDefault = Config{ Next: nil, }","s":"Default Config","u":"/next/api/middleware/pprof","h":"#default-config","p":389},{"i":400,"t":"Proxy middleware for Fiber that allows you to proxy requests to multiple servers.","s":"Proxy","u":"/next/api/middleware/proxy","h":"","p":399},{"i":402,"t":"// Balancer create a load balancer among multiple upstrem servers. func Balancer(config Config) fiber.Handler // Forward performs the given http request and fills the given http response. func Forward(addr string, clients ...*fasthttp.Client) fiber.Handler // Do performs the given http request and fills the given http response. func Do(c *fiber.Ctx, addr string, clients ...*fasthttp.Client) error // DoRedirects performs the given http request and fills the given http response while following up to maxRedirectsCount redirects. func DoRedirects(c *fiber.Ctx, addr string, maxRedirectsCount int, clients ...*fasthttp.Client) error // DoDeadline performs the given request and waits for response until the given deadline. func DoDeadline(c *fiber.Ctx, addr string, deadline time.Time, clients ...*fasthttp.Client) error // DoTimeout performs the given request and waits for response during the given timeout duration. func DoTimeout(c *fiber.Ctx, addr string, timeout time.Duration, clients ...*fasthttp.Client) error // DomainForward the given http request based on the given domain and fills the given http response func DomainForward(hostname string, addr string, clients ...*fasthttp.Client) fiber.Handler // BalancerForward performs the given http request based round robin balancer and fills the given http response func BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler","s":"Signatures","u":"/next/api/middleware/proxy","h":"#signatures","p":399},{"i":404,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/proxy\" ) After you initiate your Fiber app, you can use the following possibilities: // if target https site uses a self-signed certificate, you should // call WithTlsConfig before Do and Forward proxy.WithTlsConfig(&tls.Config{ InsecureSkipVerify: true, }) // if you need to use global self-custom client, you should use proxy.WithClient. proxy.WithClient(&fasthttp.Client{ NoDefaultUserAgentHeader: true, DisablePathNormalizing: true, }) // Forward to url app.Get(\"/gif\", proxy.Forward(\"https://i.imgur.com/IWaBepg.gif\")) // If you want to forward with a specific domain. You have to use proxy.DomainForward. app.Get(\"/payments\", proxy.DomainForward(\"docs.gofiber.io\", \"http://localhost:8000\")) // Forward to url with local custom client app.Get(\"/gif\", proxy.Forward(\"https://i.imgur.com/IWaBepg.gif\", &fasthttp.Client{ NoDefaultUserAgentHeader: true, DisablePathNormalizing: true, })) // Make request within handler app.Get(\"/:id\", func(c *fiber.Ctx) error { url := \"https://i.imgur.com/\"+c.Params(\"id\")+\".gif\" if err := proxy.Do(c, url); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests while following redirects app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoRedirects(c, \"http://google.com\", 3); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests and wait up to 5 seconds before timing out app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoTimeout(c, \"http://localhost:3000\", time.Second * 5); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests, timeout a minute from now app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoDeadline(c, \"http://localhost\", time.Now().Add(time.Minute)); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Minimal round robin balancer app.Use(proxy.Balancer(proxy.Config{ Servers: []string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }, })) // Or extend your balancer for customization app.Use(proxy.Balancer(proxy.Config{ Servers: []string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }, ModifyRequest: func(c *fiber.Ctx) error { c.Request().Header.Add(\"X-Real-IP\", c.IP()) return nil }, ModifyResponse: func(c *fiber.Ctx) error { c.Response().Header.Del(fiber.HeaderServer) return nil }, })) // Or this way if the balancer is using https and the destination server is only using http. app.Use(proxy.BalancerForward([]string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }))","s":"Examples","u":"/next/api/middleware/proxy","h":"#examples","p":399},{"i":406,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Servers defines a list of :// HTTP servers, // // which are used in a round-robin manner. // i.e.: \"https://foobar.com, http://www.foobar.com\" // // Required Servers []string // ModifyRequest allows you to alter the request // // Optional. Default: nil ModifyRequest fiber.Handler // ModifyResponse allows you to alter the response // // Optional. Default: nil ModifyResponse fiber.Handler // Timeout is the request timeout used when calling the proxy client // // Optional. Default: 1 second Timeout time.Duration // Per-connection buffer size for requests' reading. // This also limits the maximum header size. // Increase this buffer if your clients send multi-KB RequestURIs // and/or multi-KB headers (for example, BIG cookies). ReadBufferSize int // Per-connection buffer size for responses' writing. WriteBufferSize int // tls config for the http client. TlsConfig *tls.Config // Client is custom client when client config is complex. // Note that Servers, Timeout, WriteBufferSize, ReadBufferSize and TlsConfig // will not be used if the client are set. Client *fasthttp.LBClient }","s":"Config","u":"/next/api/middleware/proxy","h":"#config","p":399},{"i":408,"t":"var ConfigDefault = Config{ Next: nil, ModifyRequest: nil, ModifyResponse: nil, Timeout: fasthttp.DefaultLBClientTimeout, }","s":"Default Config","u":"/next/api/middleware/proxy","h":"#default-config","p":399},{"i":410,"t":"Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.","s":"Recover","u":"/next/api/middleware/recover","h":"","p":409},{"i":412,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/recover","h":"#signatures","p":409},{"i":414,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/recover\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(recover.New()) // This panic will be caught by the middleware app.Get(\"/\", func(c *fiber.Ctx) error { panic(\"I'm an error\") })","s":"Examples","u":"/next/api/middleware/recover","h":"#examples","p":409},{"i":416,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // EnableStackTrace enables handling stack trace // // Optional. Default: false EnableStackTrace bool // StackTraceHandler defines a function to handle stack trace // // Optional. Default: defaultStackTraceHandler StackTraceHandler func(c *fiber.Ctx, e interface{}) }","s":"Config","u":"/next/api/middleware/recover","h":"#config","p":409},{"i":418,"t":"var ConfigDefault = Config{ Next: nil, EnableStackTrace: false, StackTraceHandler: defaultStackTraceHandler, }","s":"Default Config","u":"/next/api/middleware/recover","h":"#default-config","p":409},{"i":420,"t":"Redirection middleware for Fiber.","s":"Redirect","u":"/next/api/middleware/redirect","h":"","p":419},{"i":422,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/redirect","h":"#signatures","p":419},{"i":424,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/redirect\" ) func main() { app := fiber.New() app.Use(redirect.New(redirect.Config{ Rules: map[string]string{ \"/old\": \"/new\", \"/old/*\": \"/new/$1\", }, StatusCode: 301, })) app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) app.Get(\"/new/*\", func(c *fiber.Ctx) error { return c.SendString(\"Wildcard: \" + c.Params(\"*\")) }) app.Listen(\":3000\") } Test: curl http://localhost:3000/old curl http://localhost:3000/old/hello","s":"Examples","u":"/next/api/middleware/redirect","h":"#examples","p":419},{"i":426,"t":"// Config defines the config for middleware. type Config struct { // Filter defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // Rules defines the URL path rewrite rules. The values captured in asterisk can be // retrieved by index e.g. $1, $2 and so on. // Required. Example: // \"/old\": \"/new\", // \"/api/*\": \"/$1\", // \"/js/*\": \"/public/javascripts/$1\", // \"/users/*/orders/*\": \"/user/$1/order/$2\", Rules map[string]string // The status code when redirecting // This is ignored if Redirect is disabled // Optional. Default: 302 (fiber.StatusFound) StatusCode int rulesRegex map[*regexp.Regexp]string }","s":"Config","u":"/next/api/middleware/redirect","h":"#config","p":419},{"i":428,"t":"var ConfigDefault = Config{ StatusCode: fiber.StatusFound, }","s":"Default Config","u":"/next/api/middleware/redirect","h":"#default-config","p":419},{"i":430,"t":"RequestID middleware for Fiber that adds an indentifier to the response.","s":"RequestID","u":"/next/api/middleware/requestid","h":"","p":429},{"i":432,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/requestid","h":"#signatures","p":429},{"i":434,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/requestid\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(requestid.New()) // Or extend your config for customization app.Use(requestid.New(requestid.Config{ Header: \"X-Custom-Header\", Generator: func() string { return \"static-id\" }, }))","s":"Examples","u":"/next/api/middleware/requestid","h":"#examples","p":429},{"i":436,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Header is the header key where to get/set the unique request ID // // Optional. Default: \"X-Request-ID\" Header string // Generator defines a function to generate the unique identifier. // // Optional. Default: utils.UUID Generator func() string // ContextKey defines the key used when storing the request ID in // the locals for a specific request. // // Optional. Default: requestid ContextKey interface{} }","s":"Config","u":"/next/api/middleware/requestid","h":"#config","p":429},{"i":438,"t":"The default config uses a fast UUID generator which will expose the number of requests made to the server. To conceal this value for better privacy, use the utils.UUIDv4 generator. var ConfigDefault = Config{ Next: nil, Header: fiber.HeaderXRequestID, Generator: utils.UUID, ContextKey: \"requestid\", }","s":"Default Config","u":"/next/api/middleware/requestid","h":"#default-config","p":429},{"i":440,"t":"Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links.","s":"Rewrite","u":"/next/api/middleware/rewrite","h":"","p":439},{"i":442,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/rewrite","h":"#signatures","p":439},{"i":444,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/rewrite\" ) func main() { app := fiber.New() app.Use(rewrite.New(rewrite.Config{ Rules: map[string]string{ \"/old\": \"/new\", \"/old/*\": \"/new/$1\", }, })) app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) app.Get(\"/new/*\", func(c *fiber.Ctx) error { return c.SendString(\"Wildcard: \" + c.Params(\"*\")) }) app.Listen(\":3000\") } Test: curl http://localhost:3000/old curl http://localhost:3000/old/hello","s":"Examples","u":"/next/api/middleware/rewrite","h":"#examples","p":439},{"i":446,"t":"Session middleware for Fiber. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.","s":"Session","u":"/next/api/middleware/session","h":"","p":445},{"i":448,"t":"func New(config ...Config) *Store func (s *Store) RegisterType(i interface{}) func (s *Store) Get(c *fiber.Ctx) (*Session, error) func (s *Store) Reset() error func (s *Session) Get(key string) interface{} func (s *Session) Set(key string, val interface{}) func (s *Session) Delete(key string) func (s *Session) Destroy() error func (s *Session) Regenerate() error func (s *Session) Save() error func (s *Session) Fresh() bool func (s *Session) ID() string func (s *Session) Keys() []string caution Storing interface{} values are limited to built-ins Go types.","s":"Signatures","u":"/next/api/middleware/session","h":"#signatures","p":445},{"i":450,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/session\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config // This stores all of your app's sessions store := session.New() app.Get(\"/\", func(c *fiber.Ctx) error { // Get session from storage sess, err := store.Get(c) if err != nil { panic(err) } // Get value name := sess.Get(\"name\") // Set key/value sess.Set(\"name\", \"john\") // Get all Keys keys := sess.Keys() // Delete key sess.Delete(\"name\") // Destroy session if err := sess.Destroy(); err != nil { panic(err) } // Sets a specific expiration for this session sess.SetExpiry(time.Second * 2) // Save session if err := sess.Save(); err != nil { panic(err) } return c.SendString(fmt.Sprintf(\"Welcome %v\", name)) })","s":"Examples","u":"/next/api/middleware/session","h":"#examples","p":445},{"i":452,"t":"// Config defines the config for middleware. type Config struct { // Allowed session duration // Optional. Default value 24 * time.Hour Expiration time.Duration // Storage interface to store the session data // Optional. Default value memory.New() Storage fiber.Storage // KeyLookup is a string in the form of \":\" that is used // to extract session id from the request. // Possible values: \"header:\", \"query:\" or \"cookie:\" // Optional. Default value \"cookie:session_id\". KeyLookup string // Domain of the CSRF cookie. // Optional. Default value \"\". CookieDomain string // Path of the CSRF cookie. // Optional. Default value \"\". CookiePath string // Indicates if CSRF cookie is secure. // Optional. Default value false. CookieSecure bool // Indicates if CSRF cookie is HTTP only. // Optional. Default value false. CookieHTTPOnly bool // Value of SameSite cookie. // Optional. Default value \"Lax\". CookieSameSite string // Decides whether cookie should last for only the browser sesison. // Ignores Expiration if set to true // Optional. Default value false. CookieSessionOnly bool // KeyGenerator generates the session key. // Optional. Default value utils.UUIDv4 KeyGenerator func() string // Deprecated: Please use KeyLookup CookieName string // Source defines where to obtain the session id source Source // The session name sessionName string }","s":"Config","u":"/next/api/middleware/session","h":"#config","p":445},{"i":454,"t":"var ConfigDefault = Config{ Expiration: 24 * time.Hour, KeyLookup: \"cookie:session_id\", KeyGenerator: utils.UUIDv4, source: \"cookie\", sessionName: \"session_id\", }","s":"Default Config","u":"/next/api/middleware/session","h":"#default-config","p":445},{"i":456,"t":"const ( SourceCookie Source = \"cookie\" SourceHeader Source = \"header\" SourceURLQuery Source = \"query\" )","s":"Constants","u":"/next/api/middleware/session","h":"#constants","p":445},{"i":458,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 store := session.New(session.Config{ Storage: storage, }) To use the store, see the Examples.","s":"Custom Storage/Database","u":"/next/api/middleware/session","h":"#custom-storagedatabase","p":445},{"i":460,"t":"Skip middleware for Fiber that skips a wrapped handler if a predicate is true.","s":"Skip","u":"/next/api/middleware/skip","h":"","p":459},{"i":462,"t":"func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler","s":"Signatures","u":"/next/api/middleware/skip","h":"#signatures","p":459},{"i":464,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/skip\" ) After you initiate your Fiber app, you can use the following possibilities: func main() { app := fiber.New() app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool { return ctx.Method() == fiber.MethodGet })) app.Get(\"/\", func(ctx *fiber.Ctx) error { return ctx.SendString(\"It was a GET request!\") }) log.Fatal(app.Listen(\":3000\")) } func BasicHandler(ctx *fiber.Ctx) error { return ctx.SendString(\"It was not a GET request!\") } tip app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.","s":"Examples","u":"/next/api/middleware/skip","h":"#examples","p":459},{"i":466,"t":"There exist two distinct implementations of timeout middleware Fiber. New Wraps a fiber.Handler with a timeout. If the handler takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler. caution This has been deprecated since it raises race conditions. NewWithContext As a fiber.Handler wrapper, it creates a context with context.WithTimeout and pass it in UserContext. If the context passed executions (eg. DB ops, Http calls) takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler. It does not cancel long running executions. Underlying executions must handle timeout by using context.Context parameter.","s":"Timeout","u":"/next/api/middleware/timeout","h":"","p":465},{"i":468,"t":"func New(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler func NewWithContext(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler","s":"Signatures","u":"/next/api/middleware/timeout","h":"#signatures","p":465},{"i":470,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/timeout\" ) After you initiate your Fiber app, you can use the following possibilities: func main() { app := fiber.New() h := func(c *fiber.Ctx) error { sleepTime, _ := time.ParseDuration(c.Params(\"sleepTime\") + \"ms\") if err := sleepWithContext(c.UserContext(), sleepTime); err != nil { return fmt.Errorf(\"%w: execution error\", err) } return nil } app.Get(\"/foo/:sleepTime\", timeout.New(h, 2*time.Second)) log.Fatal(app.Listen(\":3000\")) } func sleepWithContext(ctx context.Context, d time.Duration) error { timer := time.NewTimer(d) select { case <-ctx.Done(): if !timer.Stop() { <-timer.C } return context.DeadlineExceeded case <-timer.C: } return nil } Test http 200 with curl: curl --location -I --request GET 'http://localhost:3000/foo/1000' Test http 408 with curl: curl --location -I --request GET 'http://localhost:3000/foo/3000' Use with custom error: var ErrFooTimeOut = errors.New(\"foo context canceled\") func main() { app := fiber.New() h := func(c *fiber.Ctx) error { sleepTime, _ := time.ParseDuration(c.Params(\"sleepTime\") + \"ms\") if err := sleepWithContextWithCustomError(c.UserContext(), sleepTime); err != nil { return fmt.Errorf(\"%w: execution error\", err) } return nil } app.Get(\"/foo/:sleepTime\", timeout.NewWithContext(h, 2*time.Second, ErrFooTimeOut)) log.Fatal(app.Listen(\":3000\")) } func sleepWithContextWithCustomError(ctx context.Context, d time.Duration) error { timer := time.NewTimer(d) select { case <-ctx.Done(): if !timer.Stop() { <-timer.C } return ErrFooTimeOut case <-timer.C: } return nil } Sample usage with a DB call: func main() { app := fiber.New() db, _ := gorm.Open(postgres.Open(\"postgres://localhost/foodb\"), &gorm.Config{}) handler := func(ctx *fiber.Ctx) error { tran := db.WithContext(ctx.UserContext()).Begin() if tran = tran.Exec(\"SELECT pg_sleep(50)\"); tran.Error != nil { return tran.Error } if tran = tran.Commit(); tran.Error != nil { return tran.Error } return nil } app.Get(\"/foo\", timeout.NewWithContext(handler, 10*time.Second)) log.Fatal(app.Listen(\":3000\")) }","s":"Examples","u":"/next/api/middleware/timeout","h":"#examples","p":465},{"i":473,"t":"TechEmpower provides a performance comparison of many web application frameworks executing fundamental tasks such as JSON serialization, database access, and server-side template composition. Each framework is operating in a realistic production configuration. Results are captured on cloud instances and on physical hardware. The test implementations are largely community-contributed and all source is available at the GitHub repository. Fiber v1.10.0 28 HT Cores Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz 32GB RAM Ubuntu 18.04.3 4.15.0-88-generic Dedicated Cisco 10-Gbit Ethernet switch.","s":"TechEmpower","u":"/next/extra/benchmarks","h":"#techempower","p":471},{"i":475,"t":"The Plaintext test is an exercise of the request-routing fundamentals only, designed to demonstrate the capacity of high-performance platforms in particular. Requests will be sent using HTTP pipelining. The response payload is still small, meaning good performance is still necessary in order to saturate the gigabit Ethernet of the test environment. See Plaintext requirements Fiber - 6,162,556 responses per second with an average latency of 2.0 ms. Express - 367,069 responses per second with an average latency of 354.1 ms.","s":"Plaintext","u":"/next/extra/benchmarks","h":"#plaintext","p":471},{"i":477,"t":"Fiber handled 11,846 responses per second with an average latency of 42.8 ms. Express handled 2,066 responses per second with an average latency of 390.44 ms.","s":"Data Updates","u":"/next/extra/benchmarks","h":"#data-updates","p":471},{"i":479,"t":"Fiber handled 19,664 responses per second with an average latency of 25.7 ms. Express handled 4,302 responses per second with an average latency of 117.2 ms.","s":"Multiple Queries","u":"/next/extra/benchmarks","h":"#multiple-queries","p":471},{"i":481,"t":"Fiber handled 368,647 responses per second with an average latency of 0.7 ms. Express handled 57,880 responses per second with an average latency of 4.4 ms.","s":"Single Query","u":"/next/extra/benchmarks","h":"#single-query","p":471},{"i":483,"t":"Fiber handled 1,146,667 responses per second with an average latency of 0.4 ms. Express handled 244,847 responses per second with an average latency of 1.1 ms.","s":"JSON Serialization","u":"/next/extra/benchmarks","h":"#json-serialization","p":471},{"i":485,"t":"πŸ”— https://github.com/smallnest/go-web-framework-benchmark CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz MEM 4GB GO go1.13.6 linux/amd64 OS Linux The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers. The concurrency clients are 5000. Latency is the time of real processing time by web servers. The smaller is the better. Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better. If we enable http pipelining, test result as below: Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is: If we enable http pipelining, test result as below: Dependency graph for v1.9.0","s":"Go web framework benchmark","u":"/next/extra/benchmarks","h":"#go-web-framework-benchmark","p":471},{"i":488,"t":"There is no definitive answer to this question. The answer depends on the scale of your application and the team that is involved. To be as flexible as possible, Fiber makes no assumptions in terms of structure. Routes and other application-specific logic can live in as many files as you wish, in any directory structure you prefer. View the following examples for inspiration: gofiber/boilerplate thomasvvugt/fiber-boilerplate Youtube - Building a REST API using Gorm and Fiber embedmode/fiberseed","s":"How should I structure my application?","u":"/next/extra/faq","h":"#how-should-i-structure-my-application","p":486},{"i":490,"t":"If you're using v2.32.0 or later, all you need to do is to implement a custom error handler. See below, or see a more detailed explanation at Error Handling. If you're using v2.31.0 or earlier, the error handler will not capture 404 errors. Instead, you need to add a middleware function at the very bottom of the stack (below all other functions) to handle a 404 response: Example app.Use(func(c *fiber.Ctx) error { return c.Status(fiber.StatusNotFound).SendString(\"Sorry can't find that!\") })","s":"How do I handle custom 404 responses?","u":"/next/extra/faq","h":"#how-do-i-handle-custom-404-responses","p":486},{"i":492,"t":"Air is a handy tool that automatically restarts your Go applications whenever the source code changes, making your development process faster and more efficient. To use Air in a Fiber project, follow these steps: Install Air by downloading the appropriate binary for your operating system from the GitHub release page or by building the tool directly from source. Create a configuration file for Air in your project directory. This file can be named, for example, .air.toml or air.conf. Here's a sample configuration file that works with Fiber: # .air.toml root = \".\" tmp_dir = \"tmp\" [build] cmd = \"go build -o ./tmp/main .\" bin = \"./tmp/main\" delay = 1000 # ms exclude_dir = [\"assets\", \"tmp\", \"vendor\"] include_ext = [\"go\", \"tpl\", \"tmpl\", \"html\"] exclude_regex = [\"_test\\\\.go\"] Start your Fiber application using Air by running the following command in the terminal: air As you make changes to your source code, Air will detect them and automatically restart the application. A complete example demonstrating the use of Air with Fiber can be found in the Fiber Recipes repository. This example shows how to configure and use Air in a Fiber project to create an efficient development environment.","s":"How can i use live reload ?","u":"/next/extra/faq","h":"#how-can-i-use-live-reload-","p":486},{"i":494,"t":"To override the default error handler, you can override the default when providing a Config when initiating a new Fiber instance. Example app := fiber.New(fiber.Config{ ErrorHandler: func(c *fiber.Ctx, err error) error { return c.Status(fiber.StatusInternalServerError).SendString(err.Error()) }, }) We have a dedicated page explaining how error handling works in Fiber, see Error Handling.","s":"How do I set up an error handler?","u":"/next/extra/faq","h":"#how-do-i-set-up-an-error-handler","p":486},{"i":496,"t":"Fiber currently supports 8 template engines in our gofiber/template middleware: Ace Amber Django Handlebars HTML Jet Mustache Pug To learn more about using Templates in Fiber, see Templates.","s":"Which template engines does Fiber support?","u":"/next/extra/faq","h":"#which-template-engines-does-fiber-support","p":486},{"i":498,"t":"Yes, we have our own Discord server, where we hang out. We have different rooms for every subject. If you have questions or just want to have a chat, feel free to join us via this > invite link <.","s":"Does Fiber have a community chat?","u":"/next/extra/faq","h":"#does-fiber-have-a-community-chat","p":486},{"i":500,"t":"Yes we do, here are some examples: This example works v2 package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/logger\" ) type Host struct { Fiber *fiber.App } func main() { // Hosts hosts := map[string]*Host{} //----- // API //----- api := fiber.New() api.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"api.localhost:3000\"] = &Host{api} api.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"API\") }) //------ // Blog //------ blog := fiber.New() blog.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"blog.localhost:3000\"] = &Host{blog} blog.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Blog\") }) //--------- // Website //--------- site := fiber.New() site.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"localhost:3000\"] = &Host{site} site.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Website\") }) // Server app := fiber.New() app.Use(func(c *fiber.Ctx) error { host := hosts[c.Hostname()] if host == nil { return c.SendStatus(fiber.StatusNotFound) } else { host.Fiber.Handler()(c.Context()) return nil } }) log.Fatal(app.Listen(\":3000\")) } If more information is needed, please refer to this issue #750","s":"Does fiber support sub domain routing ?","u":"/next/extra/faq","h":"#does-fiber-support-sub-domain-routing-","p":486},{"i":503,"t":"It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them. Example app.Get(\"/\", func(c *fiber.Ctx) error { // Pass error to Fiber return c.SendFile(\"file-does-not-exist\") }) Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below: Example package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/recover\" ) func main() { app := fiber.New() app.Use(recover.New()) app.Get(\"/\", func(c *fiber.Ctx) error { panic(\"This panic is caught by fiber\") }) log.Fatal(app.Listen(\":3000\")) } You could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found). Example app.Get(\"/\", func(c *fiber.Ctx) error { // 503 Service Unavailable return fiber.ErrServiceUnavailable // 503 On vacation! return fiber.NewError(fiber.StatusServiceUnavailable, \"On vacation!\") })","s":"Catching Errors","u":"/next/guide/error-handling","h":"#catching-errors","p":501},{"i":505,"t":"Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If the error is of type fiber.Error, the response is sent with the provided status code and message. Example // Default error handler var DefaultErrorHandler = func(c *fiber.Ctx, err error) error { // Status code defaults to 500 code := fiber.StatusInternalServerError // Retrieve the custom status code if it's a *fiber.Error var e *fiber.Error if errors.As(err, &e) { code = e.Code } // Set Content-Type: text/plain; charset=utf-8 c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8) // Return status code with error message return c.Status(code).SendString(err.Error()) }","s":"Default Error Handler","u":"/next/guide/error-handling","h":"#default-error-handler","p":501},{"i":507,"t":"A custom error handler can be set using a Config when initializing a Fiber instance. In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response. The following example shows how to display error pages for different types of errors. Example // Create a new fiber instance with custom config app := fiber.New(fiber.Config{ // Override default error handler ErrorHandler: func(ctx *fiber.Ctx, err error) error { // Status code defaults to 500 code := fiber.StatusInternalServerError // Retrieve the custom status code if it's a *fiber.Error var e *fiber.Error if errors.As(err, &e) { code = e.Code } // Send custom error page err = ctx.Status(code).SendFile(fmt.Sprintf(\"./%d.html\", code)) if err != nil { // In case the SendFile fails return ctx.Status(fiber.StatusInternalServerError).SendString(\"Internal Server Error\") } // Return from handler return nil }, }) // ... Special thanks to the Echo & Express framework for inspiration regarding error handling.","s":"Custom Error Handler","u":"/next/guide/error-handling","h":"#custom-error-handler","p":501},{"i":510,"t":"Since Fiber v2.32.0, we use encoding/json as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of encoding/json, we recommend you to use these libraries: goccy/go-json bytedance/sonic segmentio/encoding mailru/easyjson minio/simdjson-go wI2L/jettison Example package main import \"github.com/gofiber/fiber/v2\" import \"github.com/goccy/go-json\" func main() { app := fiber.New(fiber.Config{ JSONEncoder: json.Marshal, JSONDecoder: json.Unmarshal, }) # ... }","s":"Custom JSON Encoder/Decoder","u":"/next/guide/faster-fiber","h":"#custom-json-encoderdecoder","p":508},{"i":512,"t":"Set custom JSON encoder for client Set custom JSON decoder for client Set custom JSON encoder for application Set custom JSON decoder for application","s":"References","u":"/next/guide/faster-fiber","h":"#references","p":508},{"i":514,"t":"info In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.","s":"🎭 Grouping","u":"/next/guide/grouping","h":"","p":513},{"i":516,"t":"Like Routing, groups can also have paths that belong to a cluster. func main() { app := fiber.New() api := app.Group(\"/api\", middleware) // /api v1 := api.Group(\"/v1\", middleware) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", middleware) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } A Group of paths can have an optional handler. func main() { app := fiber.New() api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\") // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\") // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } caution Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.","s":"Paths","u":"/next/guide/grouping","h":"#paths","p":513},{"i":518,"t":"Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue. func main() { app := fiber.New() handler := func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusOK) } api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\", func(c *fiber.Ctx) error { // middleware for /api/v1 c.Set(\"Version\", \"v1\") return c.Next() }) v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user log.Fatal(app.Listen(\":3000\")) }","s":"Group Handlers","u":"/next/guide/grouping","h":"#group-handlers","p":513},{"i":520,"t":"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks: OnRoute OnName OnGroup OnGroupName OnListen OnFork OnShutdown OnMount","s":"πŸͺ Hooks","u":"/next/guide/hooks","h":"","p":519},{"i":522,"t":"// Handlers define a function to create hooks for Fiber. type OnRouteHandler = func(Route) error type OnNameHandler = OnRouteHandler type OnGroupHandler = func(Group) error type OnGroupNameHandler = OnGroupHandler type OnListenHandler = func(ListenData) error type OnForkHandler = func(int) error type OnShutdownHandler = func() error type OnMountHandler = func(*App) error","s":"Constants","u":"/next/guide/hooks","h":"#constants","p":519},{"i":524,"t":"OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by route parameter. Signature func (app *App) OnRoute(handler ...OnRouteHandler)","s":"OnRoute","u":"/next/guide/hooks","h":"#onroute","p":519},{"i":526,"t":"OnName is a hook to execute user functions on each route naming. Also you can get route properties by route parameter. caution OnName only works with naming routes, not groups. Signature func (app *App) OnName(handler ...OnNameHandler) OnName Example package main import ( \"fmt\" \"github.com/gofiber/fiber/v2\" ) func main() { app := fiber.New() app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"index\") app.Hooks().OnName(func(r fiber.Route) error { fmt.Print(\"Name: \" + r.Name + \", \") return nil }) app.Hooks().OnName(func(r fiber.Route) error { fmt.Print(\"Method: \" + r.Method + \"\\n\") return nil }) app.Get(\"/add/user\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"addUser\") app.Delete(\"/destroy/user\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"destroyUser\") app.Listen(\":5000\") } // Results: // Name: addUser, Method: GET // Name: destroyUser, Method: DELETE","s":"OnName","u":"/next/guide/hooks","h":"#onname","p":519},{"i":528,"t":"OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by group parameter. Signature func (app *App) OnGroup(handler ...OnGroupHandler)","s":"OnGroup","u":"/next/guide/hooks","h":"#ongroup","p":519},{"i":530,"t":"OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by group parameter. caution OnGroupName only works with naming groups, not routes. Signature func (app *App) OnGroupName(handler ...OnGroupNameHandler)","s":"OnGroupName","u":"/next/guide/hooks","h":"#ongroupname","p":519},{"i":532,"t":"OnListen is a hook to execute user functions on Listen, ListenTLS, Listener. Signature func (app *App) OnListen(handler ...OnListenHandler) OnListen Example app := fiber.New(fiber.Config{ DisableStartupMessage: true, }) app.Hooks().OnListen(func(listenData fiber.ListenData) error { if fiber.IsChild() { return nil } scheme := \"http\" if data.TLS { scheme = \"https\" } log.Println(scheme + \"://\" + listenData.Host + \":\" + listenData.Port) return nil }) app.Listen(\":5000\")","s":"OnListen","u":"/next/guide/hooks","h":"#onlisten","p":519},{"i":534,"t":"OnFork is a hook to execute user functions on Fork. Signature func (app *App) OnFork(handler ...OnForkHandler)","s":"OnFork","u":"/next/guide/hooks","h":"#onfork","p":519},{"i":536,"t":"OnShutdown is a hook to execute user functions after Shutdown. Signature func (app *App) OnShutdown(handler ...OnShutdownHandler)","s":"OnShutdown","u":"/next/guide/hooks","h":"#onshutdown","p":519},{"i":538,"t":"OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting. Signature func (h *Hooks) OnMount(handler ...OnMountHandler) OnMount Example package main import ( \"fmt\" \"github.com/gofiber/fiber/v2\" ) func main() { app := New() app.Get(\"/\", testSimpleHandler).Name(\"x\") subApp := New() subApp.Get(\"/test\", testSimpleHandler) subApp.Hooks().OnMount(func(parent *fiber.App) error { fmt.Print(\"Mount path of parent app: \"+parent.MountPath()) // ... return nil }) app.Mount(\"/sub\", subApp) } // Result: // Mount path of parent app: caution OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.","s":"OnMount","u":"/next/guide/hooks","h":"#onmount","p":519},{"i":541,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Handlers","u":"/next/guide/routing","h":"#handlers","p":539},{"i":543,"t":"Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns. Examples of route paths based on strings // This route path will match requests to the root route, \"/\": app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"root\") }) // This route path will match requests to \"/about\": app.Get(\"/about\", func(c *fiber.Ctx) error { return c.SendString(\"about\") }) // This route path will match requests to \"/random.txt\": app.Get(\"/random.txt\", func(c *fiber.Ctx) error { return c.SendString(\"random.txt\") }) As with the expressJs framework, the order of the route declaration plays a role. When a request is received, the routes are checked in the order in which they are declared. info So please be careful to write routes with variable parameters after the routes that contain fixed parts, so that these variable parts do not match instead and unexpected behavior occurs.","s":"Paths","u":"/next/guide/routing","h":"#paths","p":539},{"i":545,"t":"Route parameters are dynamic elements in the route, which are named or not named segments. This segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys or for unnamed parameters the character(*, +) and the counter of this. The characters :, +, and * are characters that introduce a parameter. Greedy parameters are indicated by wildcard(*) or plus(+) signs. The routing also offers the possibility to use optional parameters, for the named parameters these are marked with a final \"?\", unlike the plus sign which is not optional, you can use the wildcard character for a parameter range which is optional and greedy. Example of define routes with route parameters // Parameters app.Get(\"/user/:name/books/:title\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s\\n\", c.Params(\"name\")) fmt.Fprintf(c, \"%s\\n\", c.Params(\"title\")) return nil }) // Plus - greedy - not optional app.Get(\"/user/+\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"+\")) }) // Optional parameter app.Get(\"/user/:name?\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"name\")) }) // Wildcard - greedy - optional app.Get(\"/user/*\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"*\")) }) // This route path will match requests to \"/v1/some/resource/name:customVerb\", since the parameter character is escaped app.Get(\"/v1/some/resource/name\\\\:customVerb\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, Community\") }) info Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes. info All special parameter characters can also be escaped with \"\\\\\" and lose their value, so you can use them in the route if you want, like in the custom methods of the google api design guide. // http://localhost:3000/plantae/prunus.persica app.Get(\"/plantae/:genus.:species\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s.%s\\n\", c.Params(\"genus\"), c.Params(\"species\")) return nil // prunus.persica }) // http://localhost:3000/flights/LAX-SFO app.Get(\"/flights/:from-:to\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s-%s\\n\", c.Params(\"from\"), c.Params(\"to\")) return nil // LAX-SFO }) Our intelligent router recognizes that the introductory parameter characters should be part of the request route in this case and can process them as such. // http://localhost:3000/shop/product/color:blue/size:xs app.Get(\"/shop/product/color::color/size::size\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s:%s\\n\", c.Params(\"color\"), c.Params(\"size\")) return nil // blue:xs }) In addition, several parameters in a row and several unnamed parameter characters in the route, such as the wildcard or plus character, are possible, which greatly expands the possibilities of the router for the user. // GET /@v1 // Params: \"sign\" -> \"@\", \"param\" -> \"v1\" app.Get(\"/:sign:param\", handler) // GET /api-v1 // Params: \"name\" -> \"v1\" app.Get(\"/api-:name\", handler) // GET /customer/v1/cart/proxy // Params: \"*1\" -> \"customer/\", \"*2\" -> \"/cart\" app.Get(\"/*v1*/proxy\", handler) // GET /v1/brand/4/shop/blue/xs // Params: \"*1\" -> \"brand/4\", \"*2\" -> \"blue/xs\" app.Get(\"/v1/*/shop/*\", handler) We have adapted the routing strongly to the express routing, but currently without the possibility of the regular expressions, because they are quite slow. The possibilities can be tested with version 0.1.7 (express 4) in the online Express route tester.","s":"Parameters","u":"/next/guide/routing","h":"#parameters","p":539},{"i":547,"t":"Route constraints execute when a match has occurred to the incoming URL and the URL path is tokenized into route values by parameters. The feature was intorduced in v2.37.0 and inspired by .NET Core. caution Constraints aren't validation for parameters. If constraint aren't valid for parameter value, Fiber returns 404 handler. Constraint Example Example matches int :id 123456789, -123456789 bool :active true,false guid :id CD2C1638-1638-72D5-1638-DEADBEEF1638 float :weight 1.234, -1,001.01e8 minLen(value) :username Test (must be at least 4 characters) maxLen(value) :filename MyFile (must be no more than 8 characters len(length) :filename somefile.txt (exactly 12 characters) min(value) :age 19 (Integer value must be at least 18) max(value) :age 91 (Integer value must be no more than 120) range(min,max) :age 91 (Integer value must be at least 18 but no more than 120) alpha :name Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive) datetime :dob 2005-11-01 regex(expression) :date 2022-08-27 (Must match regular expression) Examples Single Constraint Multiple Constraints Regex Constraint app.Get(\"/:test\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/12 // 12 // curl -X GET http://localhost:3000/1 // Cannot GET /1 You can use ; for multiple constraints. app.Get(\"/:test\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/120000 // Cannot GET /120000 // curl -X GET http://localhost:3000/1 // Cannot GET /1 // curl -X GET http://localhost:3000/250 // 250 Fiber precompiles regex query when to register routes. So there're no performance overhead for regex constraint. app.Get(\"/:date\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"date\")) }) // curl -X GET http://localhost:3000/125 // Cannot GET /125 // curl -X GET http://localhost:3000/test // Cannot GET /test // curl -X GET http://localhost:3000/2022-08-27 // 2022-08-27 caution You should use \\\\ before routing-specific characters when to use datetime constraint (*, +, ?, :, /, <, >, ;, (, )), to avoid wrong parsing. Optional Parameter Example You can impose constraints on optional parameters as well. app.Get(\"/:test?\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/42 // 42 // curl -X GET http://localhost:3000/ // // curl -X GET http://localhost:3000/7.0 // Cannot GET /7.0","s":"Constraints","u":"/next/guide/routing","h":"#constraints","p":539},{"i":549,"t":"Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route. Example of a middleware function app.Use(func(c *fiber.Ctx) error { // Set a custom header on all responses: c.Set(\"X-Custom-Header\", \"Hello, World\") // Go to next middleware: return c.Next() }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.","s":"Middleware","u":"/next/guide/routing","h":"#middleware","p":539},{"i":551,"t":"If you have many endpoints, you can organize your routes using Group. func main() { app := fiber.New() api := app.Group(\"/api\", middleware) // /api v1 := api.Group(\"/v1\", middleware) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", middleware) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } More information about this in our Grouping Guide","s":"Grouping","u":"/next/guide/routing","h":"#grouping","p":539},{"i":554,"t":"Fiber provides a Views interface to provide your own template engine: Views type Views interface { Load() error Render(io.Writer, string, interface{}, ...string) error } Views interface contains a Load and Render method, Load is executed by Fiber on app initialization to load/parse the templates. // Pass engine to Fiber's Views Engine app := fiber.New(fiber.Config{ Views: engine, // Views Layout is the global layout for all template render until override on Render function. ViewsLayout: \"layouts/main\" }) The Render method is linked to the ctx.Render() function that accepts a template name and binding data. It will use global layout if layout is not being defined in Render function. If the Fiber config option PassLocalsToViews is enabled, then all locals set using ctx.Locals(key, value) will be passed to the template. app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"index\", fiber.Map{ \"hello\": \"world\", }); })","s":"Template interfaces","u":"/next/guide/templates","h":"#template-interfaces","p":552},{"i":556,"t":"Fiber team maintains templates package that provides wrappers for multiple template engines: html ace amber django handlebars jet mustache pug Example views/index.html package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html/v2\" ) func main() { // Initialize standard Go html template engine engine := html.New(\"./views\", \".html\") // If you want other engine, just replace with following // Create a new engine with django // engine := django.New(\"./views\", \".django\") app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index template return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) log.Fatal(app.Listen(\":3000\")) }

{{.Title}}

","s":"Engines","u":"/next/guide/templates","h":"#engines","p":552},{"i":559,"t":"Fiber can make great use of the validator package to ensure correct validation of data to store. Official validator Github page (Installation, use, examples..). You can find the detailed descriptions of the validations used in the fields contained on the structs below: Detailed docs Validation Example package main import ( \"fmt\" \"log\" \"strings\" \"github.com/go-playground/validator/v10\" \"github.com/gofiber/fiber/v2\" ) type ( User struct { Name string `validate:\"required,min=5,max=20\"` // Required field, min 5 char long max 20 Age int `validate:\"required,teener\"` // Required field, and client needs to implement our 'teener' tag format which we'll see later } ErrorResponse struct { Error bool FailedField string Tag string Value interface{} } XValidator struct { validator *validator.Validate } GlobalErrorHandlerResp struct { Success bool `json:\"success\"` Message string `json:\"message\"` } ) // This is the validator instance // for more information see: https://github.com/go-playground/validator var validate = validator.New() func (v XValidator) Validate(data interface{}) []ErrorResponse { validationErrors := []ErrorResponse{} errs := validate.Struct(data) if errs != nil { for _, err := range errs.(validator.ValidationErrors) { // In this case data object is actually holding the User struct var elem ErrorResponse elem.FailedField = err.Field() // Export struct field name elem.Tag = err.Tag() // Export struct tag elem.Value = err.Value() // Export field value elem.Error = true validationErrors = append(validationErrors, elem) } } return validationErrors } func main() { myValidator := &XValidator{ validator: validate, } app := fiber.New(fiber.Config{ // Global custom error handler ErrorHandler: func(c *fiber.Ctx, err error) error { return c.Status(fiber.StatusBadRequest).JSON(GlobalErrorHandlerResp{ Success: false, Message: err.Error(), }) }, }) // Custom struct validation tag format myValidator.validator.RegisterValidation(\"teener\", func(fl validator.FieldLevel) bool { // User.Age needs to fit our needs, 12-18 years old. return fl.Field().Int() >= 12 && fl.Field().Int() <= 18 }) app.Get(\"/\", func(c *fiber.Ctx) error { user := &User{ Name: c.Query(\"name\"), Age: c.QueryInt(\"age\"), } // Validation if errs := myValidator.Validate(user); len(errs) > 0 && errs[0].Error { errMsgs := make([]string, 0) for _, err := range errs { errMsgs = append(errMsgs, fmt.Sprintf( \"[%s]: '%v' | Needs to implement '%s'\", err.FailedField, err.Value, err.Tag, )) } return &fiber.Error{ Code: fiber.ErrBadRequest.Code, Message: strings.Join(errMsgs, \" and \"), } } // Logic, validated with success return c.SendString(\"Hello, World!\") }) log.Fatal(app.Listen(\":3000\")) } /** OUTPUT [1] Request: GET http://127.0.0.1:3000/ Response: {\"success\":false,\"message\":\"[Name]: '' | Needs to implement 'required' and [Age]: '0' | Needs to implement 'required'\"} [2] Request: GET http://127.0.0.1:3000/?name=efdal&age=9 Response: {\"success\":false,\"message\":\"[Age]: '9' | Needs to implement 'teener'\"} [3] Request: GET http://127.0.0.1:3000/?name=efdal&age= Response: {\"success\":false,\"message\":\"[Age]: '0' | Needs to implement 'required'\"} [4] Request: GET http://127.0.0.1:3000/?name=efdal&age=18 Response: Hello, World! **/","s":"Validator package","u":"/next/guide/validation","h":"#validator-package","p":557},{"i":561,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Route Handlers","u":"/next/partials/routing/route-handlers","h":"","p":560},{"i":564,"t":"Checks, if the specified extensions or content types are acceptable. info Based on the request’s Accept HTTP header. Signature func (c *Ctx) Accepts(offers ...string) string func (c *Ctx) AcceptsCharsets(offers ...string) string func (c *Ctx) AcceptsEncodings(offers ...string) string func (c *Ctx) AcceptsLanguages(offers ...string) string Example // Accept: text/html, application/json; q=0.8, text/plain; q=0.5; charset=\"utf-8\" app.Get(\"/\", func(c *fiber.Ctx) error { c.Accepts(\"html\") // \"html\" c.Accepts(\"text/html\") // \"text/html\" c.Accepts(\"json\", \"text\") // \"json\" c.Accepts(\"application/json\") // \"application/json\" c.Accepts(\"text/plain\", \"application/json\") // \"application/json\", due to quality c.Accepts(\"image/png\") // \"\" c.Accepts(\"png\") // \"\" // ... }) Example 2 // Accept: text/html, text/*, application/json, */*; q=0 app.Get(\"/\", func(c *fiber.Ctx) error { c.Accepts(\"text/plain\", \"application/json\") // \"application/json\", due to specificity c.Accepts(\"application/json\", \"text/html\") // \"text/html\", due to first match c.Accepts(\"image/png\") // \"\", due to */* without q factor 0 is Not Acceptable // ... }) Fiber provides similar functions for the other accept headers. // Accept-Charset: utf-8, iso-8859-1;q=0.2 // Accept-Encoding: gzip, compress;q=0.2 // Accept-Language: en;q=0.8, nl, ru app.Get(\"/\", func(c *fiber.Ctx) error { c.AcceptsCharsets(\"utf-16\", \"iso-8859-1\") // \"iso-8859-1\" c.AcceptsEncodings(\"compress\", \"br\") // \"compress\" c.AcceptsLanguages(\"pt\", \"nl\", \"ru\") // \"nl\" // ... })","s":"Accepts","u":"/next/api/ctx","h":"#accepts","p":562},{"i":566,"t":"Params is used to get all route parameters. Using Params method to get params. Signature func (c *Ctx) AllParams() map[string]string Example // GET http://example.com/user/fenny app.Get(\"/user/:name\", func(c *fiber.Ctx) error { c.AllParams() // \"{\"name\": \"fenny\"}\" // ... }) // GET http://example.com/user/fenny/123 app.Get(\"/user/*\", func(c *fiber.Ctx) error { c.AllParams() // \"{\"*1\": \"fenny/123\"}\" // ... })","s":"AllParams","u":"/next/api/ctx","h":"#allparams","p":562},{"i":568,"t":"Returns the *App reference so you could easily access all application settings. Signature func (c *Ctx) App() *App Example app.Get(\"/stack\", func(c *fiber.Ctx) error { return c.JSON(c.App().Stack()) })","s":"App","u":"/next/api/ctx","h":"#app","p":562},{"i":570,"t":"Appends the specified value to the HTTP response header field. caution If the header is not already set, it creates the header with the specified value. Signature func (c *Ctx) Append(field string, values ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Append(\"Link\", \"http://google.com\", \"http://localhost\") // => Link: http://localhost, http://google.com c.Append(\"Link\", \"Test\") // => Link: http://localhost, http://google.com, Test // ... })","s":"Append","u":"/next/api/ctx","h":"#append","p":562},{"i":572,"t":"Sets the HTTP response Content-Disposition header field to attachment. Signature func (c *Ctx) Attachment(filename ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Attachment() // => Content-Disposition: attachment c.Attachment(\"./upload/images/logo.png\") // => Content-Disposition: attachment; filename=\"logo.png\" // => Content-Type: image/png // ... })","s":"Attachment","u":"/next/api/ctx","h":"#attachment","p":562},{"i":574,"t":"Returns the base URL (protocol + host) as a string. Signature func (c *Ctx) BaseURL() string Example // GET https://example.com/page#chapter-1 app.Get(\"/\", func(c *fiber.Ctx) error { c.BaseURL() // https://example.com // ... })","s":"BaseURL","u":"/next/api/ctx","h":"#baseurl","p":562},{"i":576,"t":"Add vars to default view var map binding to template engine. Variables are read by the Render method and may be overwritten. Signature func (c *Ctx) Bind(vars Map) error Example app.Use(func(c *fiber.Ctx) error { c.Bind(fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"xxx.tmpl\", fiber.Map{}) // Render will use Title variable })","s":"Bind","u":"/next/api/ctx","h":"#bind","p":562},{"i":578,"t":"Returns the raw request body. Signature func (c *Ctx) Body() []byte Example // curl -X POST http://localhost:8080 -d user=john app.Post(\"/\", func(c *fiber.Ctx) error { // Get raw body from POST request: return c.Send(c.Body()) // []byte(\"user=john\") }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Body","u":"/next/api/ctx","h":"#body","p":562},{"i":580,"t":"Binds the request body to a struct. It is important to specify the correct struct tag based on the content type to be parsed. For example, if you want to parse a JSON body with a field called Pass, you would use a struct field of json:\"pass\". content-type struct tag application/x-www-form-urlencoded form multipart/form-data form application/json json application/xml xml text/xml xml Signature func (c *Ctx) BodyParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `json:\"name\" xml:\"name\" form:\"name\"` Pass string `json:\"pass\" xml:\"pass\" form:\"pass\"` } app.Post(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.BodyParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe // ... }) // Run tests with the following curl commands // curl -X POST -H \"Content-Type: application/json\" --data \"{\\\"name\\\":\\\"john\\\",\\\"pass\\\":\\\"doe\\\"}\" localhost:3000 // curl -X POST -H \"Content-Type: application/xml\" --data \"johndoe\" localhost:3000 // curl -X POST -H \"Content-Type: application/x-www-form-urlencoded\" --data \"name=john&pass=doe\" localhost:3000 // curl -X POST -F name=john -F pass=doe http://localhost:3000 // curl -X POST \"http://localhost:3000/?name=john&pass=doe\" Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"BodyParser","u":"/next/api/ctx","h":"#bodyparser","p":562},{"i":582,"t":"Expire a client cookie (or all cookies if left empty) Signature func (c *Ctx) ClearCookie(key ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { // Clears all cookies: c.ClearCookie() // Expire specific cookie by name: c.ClearCookie(\"user\") // Expire multiple cookies by names: c.ClearCookie(\"token\", \"session\", \"track_id\", \"version\") // ... }) caution Web browsers and other compliant clients will only clear the cookie if the given options are identical to those when creating the cookie, excluding expires and maxAge. ClearCookie will not set these values for you - a technique similar to the one shown below should be used to ensure your cookie is deleted. Example app.Get(\"/set\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"token\", Value: \"randomvalue\", Expires: time.Now().Add(24 * time.Hour), HTTPOnly: true, SameSite: \"lax\", }) // ... }) app.Get(\"/delete\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"token\", // Set expiry date to the past Expires: time.Now().Add(-(time.Hour * 2)), HTTPOnly: true, SameSite: \"lax\", }) // ... })","s":"ClearCookie","u":"/next/api/ctx","h":"#clearcookie","p":562},{"i":584,"t":"ClientHelloInfo contains information from a ClientHello message in order to guide application logic in the GetCertificate and GetConfigForClient callbacks. You can refer to the ClientHelloInfo struct documentation for more information on the returned struct. Signature func (c *Ctx) ClientHelloInfo() *tls.ClientHelloInfo Example // GET http://example.com/hello app.Get(\"/hello\", func(c *fiber.Ctx) error { chi := c.ClientHelloInfo() // ... })","s":"ClientHelloInfo","u":"/next/api/ctx","h":"#clienthelloinfo","p":562},{"i":586,"t":"Returns *fasthttp.RequestCtx that is compatible with the context.Context interface that requires a deadline, a cancellation signal, and other values across API boundaries. Signature func (c *Ctx) Context() *fasthttp.RequestCtx info Please read the Fasthttp Documentation for more information.","s":"Context","u":"/next/api/ctx","h":"#context","p":562},{"i":588,"t":"Set cookie Signature func (c *Ctx) Cookie(cookie *Cookie) type Cookie struct { Name string `json:\"name\"` Value string `json:\"value\"` Path string `json:\"path\"` Domain string `json:\"domain\"` MaxAge int `json:\"max_age\"` Expires time.Time `json:\"expires\"` Secure bool `json:\"secure\"` HTTPOnly bool `json:\"http_only\"` SameSite string `json:\"same_site\"` SessionOnly bool `json:\"session_only\"` } Example app.Get(\"/\", func(c *fiber.Ctx) error { // Create cookie cookie := new(fiber.Cookie) cookie.Name = \"john\" cookie.Value = \"doe\" cookie.Expires = time.Now().Add(24 * time.Hour) // Set cookie c.Cookie(cookie) // ... })","s":"Cookie","u":"/next/api/ctx","h":"#cookie","p":562},{"i":590,"t":"Get cookie value by key, you could pass an optional default value that will be returned if the cookie key does not exist. Signature func (c *Ctx) Cookies(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { // Get cookie by key: c.Cookies(\"name\") // \"john\" c.Cookies(\"empty\", \"doe\") // \"doe\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Cookies","u":"/next/api/ctx","h":"#cookies","p":562},{"i":592,"t":"Transfers the file from path as an attachment. Typically, browsers will prompt the user to download. By default, the Content-Disposition header filename= parameter is the file path (this typically appears in the browser dialog). Override this default with the filename parameter. Signature func (c *Ctx) Download(file string, filename ...string) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.Download(\"./files/report-12345.pdf\"); // => Download report-12345.pdf return c.Download(\"./files/report-12345.pdf\", \"report.pdf\"); // => Download report.pdf })","s":"Download","u":"/next/api/ctx","h":"#download","p":562},{"i":594,"t":"Performs content-negotiation on the Accept HTTP header. It uses Accepts to select a proper format. info If the header is not specified or there is no proper format, text/plain is used. Signature func (c *Ctx) Format(body interface{}) error Example app.Get(\"/\", func(c *fiber.Ctx) error { // Accept: text/plain c.Format(\"Hello, World!\") // => Hello, World! // Accept: text/html c.Format(\"Hello, World!\") // =>

Hello, World!

// Accept: application/json c.Format(\"Hello, World!\") // => \"Hello, World!\" // .. })","s":"Format","u":"/next/api/ctx","h":"#format","p":562},{"i":596,"t":"MultipartForm files can be retrieved by name, the first file from the given key is returned. Signature func (c *Ctx) FormFile(key string) (*multipart.FileHeader, error) Example app.Post(\"/\", func(c *fiber.Ctx) error { // Get first file from form field \"document\": file, err := c.FormFile(\"document\") // Save file to root directory: return c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)) })","s":"FormFile","u":"/next/api/ctx","h":"#formfile","p":562},{"i":598,"t":"Any form values can be retrieved by name, the first value from the given key is returned. Signature func (c *Ctx) FormValue(key string, defaultValue ...string) string Example app.Post(\"/\", func(c *fiber.Ctx) error { // Get first value from form field \"name\": c.FormValue(\"name\") // => \"john\" or \"\" if not exist // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"FormValue","u":"/next/api/ctx","h":"#formvalue","p":562},{"i":600,"t":"https://expressjs.com/en/4x/api.html#req.fresh Signature func (c *Ctx) Fresh() bool","s":"Fresh","u":"/next/api/ctx","h":"#fresh","p":562},{"i":602,"t":"Returns the HTTP request header specified by the field. tip The match is case-insensitive. Signature func (c *Ctx) Get(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Get(\"Content-Type\") // \"text/plain\" c.Get(\"CoNtEnT-TypE\") // \"text/plain\" c.Get(\"something\", \"john\") // \"john\" // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Get","u":"/next/api/ctx","h":"#get","p":562},{"i":604,"t":"Returns the HTTP request headers. Signature func (c *Ctx) GetReqHeaders() map[string]string","s":"GetReqHeaders","u":"/next/api/ctx","h":"#getreqheaders","p":562},{"i":606,"t":"Returns the HTTP response header specified by the field. tip The match is case-insensitive. Signature func (c *Ctx) GetRespHeader(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.GetRespHeader(\"X-Request-Id\") // \"8d7ad5e3-aaf3-450b-a241-2beb887efd54\" c.GetRespHeader(\"Content-Type\") // \"text/plain\" c.GetRespHeader(\"something\", \"john\") // \"john\" // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"GetRespHeader","u":"/next/api/ctx","h":"#getrespheader","p":562},{"i":608,"t":"Returns the HTTP response headers. Signature func (c *Ctx) GetRespHeaders() map[string]string","s":"GetRespHeaders","u":"/next/api/ctx","h":"#getrespheaders","p":562},{"i":610,"t":"Generates URLs to named routes, with parameters. URLs are relative, for example: \"/user/1831\" Signature func (c *Ctx) GetRouteURL(routeName string, params Map) (string, error) Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Home page\") }).Name(\"home\") app.Get(\"/user/:id\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"id\")) }).Name(\"user.show\") app.Get(\"/test\", func(c *fiber.Ctx) error { location, _ := c.GetRouteURL(\"user.show\", fiber.Map{\"id\": 1}) return c.SendString(location) }) // /test returns \"/user/1\"","s":"GetRouteURL","u":"/next/api/ctx","h":"#getrouteurl","p":562},{"i":612,"t":"Returns the hostname derived from the Host HTTP header. Signature func (c *Ctx) Hostname() string Example // GET http://google.com/search app.Get(\"/\", func(c *fiber.Ctx) error { c.Hostname() // \"google.com\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Hostname","u":"/next/api/ctx","h":"#hostname","p":562},{"i":614,"t":"Returns the remote IP address of the request. Signature func (c *Ctx) IP() string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.IP() // \"127.0.0.1\" // ... }) When registering the proxy request header in the fiber app, the ip address of the header is returned (Fiber configuration) app := fiber.New(fiber.Config{ ProxyHeader: fiber.HeaderXForwardedFor, })","s":"IP","u":"/next/api/ctx","h":"#ip","p":562},{"i":616,"t":"Returns an array of IP addresses specified in the X-Forwarded-For request header. Signature func (c *Ctx) IPs() []string Example // X-Forwarded-For: proxy1, 127.0.0.1, proxy3 app.Get(\"/\", func(c *fiber.Ctx) error { c.IPs() // [\"proxy1\", \"127.0.0.1\", \"proxy3\"] // ... }) caution Improper use of the X-Forwarded-For header can be a security risk. For details, see the Security and privacy concerns section.","s":"IPs","u":"/next/api/ctx","h":"#ips","p":562},{"i":618,"t":"Returns the matching content type, if the incoming request’s Content-Type HTTP header field matches the MIME type specified by the type parameter. info If the request has no body, it returns false. Signature func (c *Ctx) Is(extension string) bool Example // Content-Type: text/html; charset=utf-8 app.Get(\"/\", func(c *fiber.Ctx) error { c.Is(\"html\") // true c.Is(\".html\") // true c.Is(\"json\") // false // ... })","s":"Is","u":"/next/api/ctx","h":"#is","p":562},{"i":620,"t":"Returns true if request came from localhost Signature func (c *Ctx) IsFromLocal() bool { Example app.Get(\"/\", func(c *fiber.Ctx) error { // If request came from localhost, return true else return false c.IsFromLocal() // ... })","s":"IsFromLocal","u":"/next/api/ctx","h":"#isfromlocal","p":562},{"i":622,"t":"Converts any interface or string to JSON using the goccy/go-json package. info JSON also sets the content header to application/json. Signature func (c *Ctx) JSON(data interface{}) error Example type SomeStruct struct { Name string Age uint8 } app.Get(\"/json\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ Name: \"Grame\", Age: 20, } return c.JSON(data) // => Content-Type: application/json // => \"{\"Name\": \"Grame\", \"Age\": 20}\" return c.JSON(fiber.Map{ \"name\": \"Grame\", \"age\": 20, }) // => Content-Type: application/json // => \"{\"name\": \"Grame\", \"age\": 20}\" })","s":"JSON","u":"/next/api/ctx","h":"#json","p":562},{"i":624,"t":"Sends a JSON response with JSONP support. This method is identical to JSON, except that it opts-in to JSONP callback support. By default, the callback name is simply callback. Override this by passing a named string in the method. Signature func (c *Ctx) JSONP(data interface{}, callback ...string) error Example type SomeStruct struct { name string age uint8 } app.Get(\"/\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ name: \"Grame\", age: 20, } return c.JSONP(data) // => callback({\"name\": \"Grame\", \"age\": 20}) return c.JSONP(data, \"customFunc\") // => customFunc({\"name\": \"Grame\", \"age\": 20}) })","s":"JSONP","u":"/next/api/ctx","h":"#jsonp","p":562},{"i":626,"t":"Joins the links followed by the property to populate the response’s Link HTTP header field. Signature func (c *Ctx) Links(link ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Links( \"http://api.example.com/users?page=2\", \"next\", \"http://api.example.com/users?page=5\", \"last\", ) // Link: ; rel=\"next\", // ; rel=\"last\" // ... })","s":"Links","u":"/next/api/ctx","h":"#links","p":562},{"i":628,"t":"A method that stores variables scoped to the request and, therefore, are available only to the routes that match the request. tip This is useful if you want to pass some specific data to the next middleware. Signature func (c *Ctx) Locals(key interface{}, value ...interface{}) interface{} Example app.Use(func(c *fiber.Ctx) error { c.Locals(\"user\", \"admin\") return c.Next() }) app.Get(\"/admin\", func(c *fiber.Ctx) error { if c.Locals(\"user\") == \"admin\" { return c.Status(fiber.StatusOK).SendString(\"Welcome, admin!\") } return c.SendStatus(fiber.StatusForbidden) })","s":"Locals","u":"/next/api/ctx","h":"#locals","p":562},{"i":630,"t":"Sets the response Location HTTP header to the specified path parameter. Signature func (c *Ctx) Location(path string) Example app.Post(\"/\", func(c *fiber.Ctx) error { c.Location(\"http://example.com\") c.Location(\"/foo/bar\") return nil })","s":"Location","u":"/next/api/ctx","h":"#location","p":562},{"i":632,"t":"Returns a string corresponding to the HTTP method of the request: GET, POST, PUT, and so on. Optionally, you could override the method by passing a string. Signature func (c *Ctx) Method(override ...string) string Example app.Post(\"/\", func(c *fiber.Ctx) error { c.Method() // \"POST\" c.Method(\"GET\") c.Method() // GET // ... })","s":"Method","u":"/next/api/ctx","h":"#method","p":562},{"i":634,"t":"To access multipart form entries, you can parse the binary with MultipartForm(). This returns a map[string][]string, so given a key, the value will be a string slice. Signature func (c *Ctx) MultipartForm() (*multipart.Form, error) Example app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form if token := form.Value[\"token\"]; len(token) > 0 { // Get key value: fmt.Println(token[0]) } // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: if err := c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)); err != nil { return err } } } return err })","s":"MultipartForm","u":"/next/api/ctx","h":"#multipartform","p":562},{"i":636,"t":"When Next is called, it executes the next method in the stack that matches the current route. You can pass an error struct within the method that will end the chaining and call the error handler. Signature func (c *Ctx) Next() error Example app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(\"1st route!\") return c.Next() }) app.Get(\"*\", func(c *fiber.Ctx) error { fmt.Println(\"2nd route!\") return c.Next() }) app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(\"3rd route!\") return c.SendString(\"Hello, World!\") })","s":"Next","u":"/next/api/ctx","h":"#next","p":562},{"i":638,"t":"Returns the original request URL. Signature func (c *Ctx) OriginalURL() string Example // GET http://example.com/search?q=something app.Get(\"/\", func(c *fiber.Ctx) error { c.OriginalURL() // \"/search?q=something\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"OriginalURL","u":"/next/api/ctx","h":"#originalurl","p":562},{"i":640,"t":"Method can be used to get the route parameters, you could pass an optional default value that will be returned if the param key does not exist. info Defaults to empty string (\"\"), if the param doesn't exist. Signature func (c *Ctx) Params(key string, defaultValue ...string) string Example // GET http://example.com/user/fenny app.Get(\"/user/:name\", func(c *fiber.Ctx) error { c.Params(\"name\") // \"fenny\" // ... }) // GET http://example.com/user/fenny/123 app.Get(\"/user/*\", func(c *fiber.Ctx) error { c.Params(\"*\") // \"fenny/123\" c.Params(\"*1\") // \"fenny/123\" // ... }) Unnamed route parameters(*, +) can be fetched by the character and the counter in the route. Example // ROUTE: /v1/*/shop/* // GET: /v1/brand/4/shop/blue/xs c.Params(\"*1\") // \"brand/4\" c.Params(\"*2\") // \"blue/xs\" For reasons of downward compatibility, the first parameter segment for the parameter character can also be accessed without the counter. Example app.Get(\"/v1/*/shop/*\", func(c *fiber.Ctx) error { c.Params(\"*\") // outputs the values of the first wildcard segment }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Params","u":"/next/api/ctx","h":"#params","p":562},{"i":642,"t":"Method can be used to get an integer from the route parameters. Please note if that parameter is not in the request, zero will be returned. If the parameter is NOT a number, zero and an error will be returned info Defaults to the integer zero (0), if the param doesn't exist. Signature func (c *Ctx) ParamsInt(key string) (int, error) Example // GET http://example.com/user/123 app.Get(\"/user/:id\", func(c *fiber.Ctx) error { id, err := c.ParamsInt(\"id\") // int 123 and no error // ... }) This method is equivalent of using atoi with ctx.Params","s":"ParamsInt","u":"/next/api/ctx","h":"#paramsint","p":562},{"i":644,"t":"This method is similar to BodyParser, but for path parameters. It is important to use the struct tag \"params\". For example, if you want to parse a path parameter with a field called Pass, you would use a struct field of params:\"pass\" Signature func (c *Ctx) ParamsParser(out interface{}) error Example // GET http://example.com/user/111 app.Get(\"/user/:id\", func(c *fiber.Ctx) error { param := struct {ID uint `params:\"id\"`}{} c.ParamsParser(¶m) // \"{\"id\": 111}\" // ... })","s":"ParamsParser","u":"/next/api/ctx","h":"#paramsparser","p":562},{"i":646,"t":"Contains the path part of the request URL. Optionally, you could override the path by passing a string. For internal redirects, you might want to call RestartRouting instead of Next. Signature func (c *Ctx) Path(override ...string) string Example // GET http://example.com/users?sort=desc app.Get(\"/users\", func(c *fiber.Ctx) error { c.Path() // \"/users\" c.Path(\"/john\") c.Path() // \"/john\" // ... })","s":"Path","u":"/next/api/ctx","h":"#path","p":562},{"i":648,"t":"Contains the request protocol string: http or https for TLS requests. Signature func (c *Ctx) Protocol() string Example // GET http://example.com app.Get(\"/\", func(c *fiber.Ctx) error { c.Protocol() // \"http\" // ... })","s":"Protocol","u":"/next/api/ctx","h":"#protocol","p":562},{"i":650,"t":"Queries is a function that returns an object containing a property for each query string parameter in the route. Signature func (c *Ctx) Queries() map[string]string Example // GET http://example.com/?name=alex&want_pizza=false&id= app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"name\"] // \"alex\" m[\"want_pizza\"] // \"false\" m[\"id\"] // \"\" // ... }) Example // GET http://example.com/?field1=value1&field1=value2&field2=value3 app.Get(\"/\", func (c *fiber.Ctx) error { m := c.Queries() m[\"field1\"] // \"value2\" m[\"field2\"] // value3 }) Example // GET http://example.com/?list_a=1&list_a=2&list_a=3&list_b[]=1&list_b[]=2&list_b[]=3&list_c=1,2,3 app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"list_a\"] // \"3\" m[\"list_b[]\"] // \"3\" m[\"list_c\"] // \"1,2,3\" }) Example // GET /api/posts?filters.author.name=John&filters.category.name=Technology app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"filters.author.name\"] // John m[\"filters.category.name\"] // Technology }) Example // GET /api/posts?tags=apple,orange,banana&filters[tags]=apple,orange,banana&filters[category][name]=fruits&filters.tags=apple,orange,banana&filters.category.name=fruits app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"tags\"] // apple,orange,banana m[\"filters[tags]\"] // apple,orange,banana m[\"filters[category][name]\"] // fruits m[\"filters.tags\"] // apple,orange,banana m[\"filters.category.name\"] // fruits })","s":"Queries","u":"/next/api/ctx","h":"#queries","p":562},{"i":652,"t":"This property is an object containing a property for each query string parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. info If there is no query string, it returns an empty string. Signature func (c *Ctx) Query(key string, defaultValue ...string) string Example // GET http://example.com/?order=desc&brand=nike app.Get(\"/\", func(c *fiber.Ctx) error { c.Query(\"order\") // \"desc\" c.Query(\"brand\") // \"nike\" c.Query(\"empty\", \"nike\") // \"nike\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Query","u":"/next/api/ctx","h":"#query","p":562},{"i":654,"t":"This property is an object containing a property for each query boolean parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, false will be returned. If the parameter is not a boolean, it is still tried to be converted and usually returned as false. Signature func (c *Ctx) QueryBool(key string, defaultValue ...bool) bool Example // GET http://example.com/?name=alex&want_pizza=false&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryBool(\"want_pizza\") // false c.QueryBool(\"want_pizza\", true) // false c.QueryBool(\"name\") // false c.QueryBool(\"name\", true) // true c.QueryBool(\"id\") // false c.QueryBool(\"id\", true) // true // ... })","s":"QueryBool","u":"/next/api/ctx","h":"#querybool","p":562},{"i":656,"t":"This property is an object containing a property for each query float64 parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, zero will be returned. If the parameter is not a number, it is still tried to be converted and usually returned as 1. info Defaults to the float64 zero (0), if the param doesn't exist. Signature func (c *Ctx) QueryFloat(key string, defaultValue ...float64) float64 Example // GET http://example.com/?name=alex&amount=32.23&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryFloat(\"amount\") // 32.23 c.QueryFloat(\"amount\", 3) // 32.23 c.QueryFloat(\"name\", 1) // 1 c.QueryFloat(\"name\") // 0 c.QueryFloat(\"id\", 3) // 3 // ... })","s":"QueryFloat","u":"/next/api/ctx","h":"#queryfloat","p":562},{"i":658,"t":"This property is an object containing a property for each query integer parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, zero will be returned. If the parameter is not a number, it is still tried to be converted and usually returned as 1. info Defaults to the integer zero (0), if the param doesn't exist. Signature func (c *Ctx) QueryInt(key string, defaultValue ...int) int Example // GET http://example.com/?name=alex&wanna_cake=2&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryInt(\"wanna_cake\", 1) // 2 c.QueryInt(\"name\", 1) // 1 c.QueryInt(\"id\", 1) // 1 c.QueryInt(\"id\") // 0 // ... })","s":"QueryInt","u":"/next/api/ctx","h":"#queryint","p":562},{"i":660,"t":"This method is similar to BodyParser, but for query parameters. It is important to use the struct tag \"query\". For example, if you want to parse a query parameter with a field called Pass, you would use a struct field of query:\"pass\". Signature func (c *Ctx) QueryParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `query:\"name\"` Pass string `query:\"pass\"` Products []string `query:\"products\"` } app.Get(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.QueryParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe log.Println(p.Products) // [shoe, hat] // ... }) // Run tests with the following curl command // curl \"http://localhost:3000/?name=john&pass=doe&products=shoe,hat\"","s":"QueryParser","u":"/next/api/ctx","h":"#queryparser","p":562},{"i":662,"t":"A struct containing the type and a slice of ranges will be returned. Signature func (c *Ctx) Range(size int) (Range, error) Example // Range: bytes=500-700, 700-900 app.Get(\"/\", func(c *fiber.Ctx) error { b := c.Range(1000) if b.Type == \"bytes\" { for r := range r.Ranges { fmt.Println(r) // [500, 700] } } })","s":"Range","u":"/next/api/ctx","h":"#range","p":562},{"i":664,"t":"Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. Signature func (c *Ctx) Redirect(location string, status ...int) error Example app.Get(\"/coffee\", func(c *fiber.Ctx) error { return c.Redirect(\"/teapot\") }) app.Get(\"/teapot\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusTeapot).Send(\"🍡 short and stout 🍡\") }) More examples app.Get(\"/\", func(c *fiber.Ctx) error { return c.Redirect(\"/foo/bar\") return c.Redirect(\"../login\") return c.Redirect(\"http://example.com\") return c.Redirect(\"http://example.com\", 301) })","s":"Redirect","u":"/next/api/ctx","h":"#redirect","p":562},{"i":666,"t":"Redirects to the specific route along with the parameters and with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. info If you want to send queries to route, you must add \"queries\" key typed as map[string]string to params. Signature func (c *Ctx) RedirectToRoute(routeName string, params fiber.Map, status ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { // /user/fiber return c.RedirectToRoute(\"user\", fiber.Map{ \"name\": \"fiber\" }) }) app.Get(\"/with-queries\", func(c *fiber.Ctx) error { // /user/fiber?data[0][name]=john&data[0][age]=10&test=doe return c.RedirectToRoute(\"user\", fiber.Map{ \"name\": \"fiber\", \"queries\": map[string]string{\"data[0][name]\": \"john\", \"data[0][age]\": \"10\", \"test\": \"doe\"}, }) }) app.Get(\"/user/:name\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"name\")) }).Name(\"user\")","s":"RedirectToRoute","u":"/next/api/ctx","h":"#redirecttoroute","p":562},{"i":668,"t":"Redirects back to refer URL. It redirects to fallback URL if refer header doesn't exists, with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. Signature func (c *Ctx) RedirectBack(fallback string, status ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Home page\") }) app.Get(\"/test\", func(c *fiber.Ctx) error { c.Set(\"Content-Type\", \"text/html\") return c.SendString(`Back`) }) app.Get(\"/back\", func(c *fiber.Ctx) error { return c.RedirectBack(\"/\") })","s":"RedirectBack","u":"/next/api/ctx","h":"#redirectback","p":562},{"i":670,"t":"Renders a view with data and sends a text/html response. By default Render uses the default Go Template engine. If you want to use another View engine, please take a look at our Template middleware. Signature func (c *Ctx) Render(name string, bind interface{}, layouts ...string) error","s":"Render","u":"/next/api/ctx","h":"#render","p":562},{"i":672,"t":"Request return the *fasthttp.Request pointer Signature func (c *Ctx) Request() *fasthttp.Request Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Request().Header.Method() // => []byte(\"GET\") })","s":"Request","u":"/next/api/ctx","h":"#request","p":562},{"i":674,"t":"This method is similar to BodyParser, but for request headers. It is important to use the struct tag \"reqHeader\". For example, if you want to parse a request header with a field called Pass, you would use a struct field of reqHeader:\"pass\". Signature func (c *Ctx) ReqHeaderParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `reqHeader:\"name\"` Pass string `reqHeader:\"pass\"` Products []string `reqHeader:\"products\"` } app.Get(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.ReqHeaderParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe log.Println(p.Products) // [shoe, hat] // ... }) // Run tests with the following curl command // curl \"http://localhost:3000/\" -H \"name: john\" -H \"pass: doe\" -H \"products: shoe,hat\"","s":"ReqHeaderParser","u":"/next/api/ctx","h":"#reqheaderparser","p":562},{"i":676,"t":"Response return the *fasthttp.Response pointer Signature func (c *Ctx) Response() *fasthttp.Response Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Response().BodyWriter().Write([]byte(\"Hello, World!\")) // => \"Hello, World!\" return nil })","s":"Response","u":"/next/api/ctx","h":"#response","p":562},{"i":678,"t":"Instead of executing the next method when calling Next, RestartRouting restarts execution from the first method that matches the current route. This may be helpful after overriding the path, i. e. an internal redirect. Note that handlers might be executed again which could result in an infinite loop. Signature func (c *Ctx) RestartRouting() error Example app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"From /new\") }) app.Get(\"/old\", func(c *fiber.Ctx) error { c.Path(\"/new\") return c.RestartRouting() })","s":"RestartRouting","u":"/next/api/ctx","h":"#restartrouting","p":562},{"i":680,"t":"Returns the matched Route struct. Signature func (c *Ctx) Route() *Route Example // http://localhost:8080/hello app.Get(\"/hello/:name\", func(c *fiber.Ctx) error { r := c.Route() fmt.Println(r.Method, r.Path, r.Params, r.Handlers) // GET /hello/:name handler [name] // ... }) caution Do not rely on c.Route() in middlewares before calling c.Next() - c.Route() returns the last executed route. Example func MyMiddleware() fiber.Handler { return func(c *fiber.Ctx) error { beforeNext := c.Route().Path // Will be '/' err := c.Next() afterNext := c.Route().Path // Will be '/hello/:name' return err } }","s":"Route","u":"/next/api/ctx","h":"#route","p":562},{"i":682,"t":"Method is used to save any multipart file to disk. Signature func (c *Ctx) SaveFile(fh *multipart.FileHeader, path string) error Example app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: if err := c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)); err != nil { return err } } return err } })","s":"SaveFile","u":"/next/api/ctx","h":"#savefile","p":562},{"i":684,"t":"Method is used to save any multipart file to an external storage system. Signature func (c *Ctx) SaveFileToStorage(fileheader *multipart.FileHeader, path string, storage Storage) error Example storage := memory.New() app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to storage: if err := c.SaveFileToStorage(file, fmt.Sprintf(\"./%s\", file.Filename), storage); err != nil { return err } } return err } })","s":"SaveFileToStorage","u":"/next/api/ctx","h":"#savefiletostorage","p":562},{"i":686,"t":"A boolean property that is true , if a TLS connection is established. Signature func (c *Ctx) Secure() bool Example // Secure() method is equivalent to: c.Protocol() == \"https\"","s":"Secure","u":"/next/api/ctx","h":"#secure","p":562},{"i":688,"t":"Sets the HTTP response body. Signature func (c *Ctx) Send(body []byte) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.Send([]byte(\"Hello, World!\")) // => \"Hello, World!\" }) Fiber also provides SendString and SendStream methods for raw inputs. tip Use this if you don't need type assertion, recommended for faster performance. Signature func (c *Ctx) SendString(body string) error func (c *Ctx) SendStream(stream io.Reader, size ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") // => \"Hello, World!\" return c.SendStream(bytes.NewReader([]byte(\"Hello, World!\"))) // => \"Hello, World!\" })","s":"Send","u":"/next/api/ctx","h":"#send","p":562},{"i":690,"t":"Transfers the file from the given path. Sets the Content-Type response HTTP header field based on the filenames extension. caution Method doesnΒ΄t use gzipping by default, set it to true to enable. Signature func (c *Ctx) SendFile(file string, compress ...bool) error Example app.Get(\"/not-found\", func(c *fiber.Ctx) error { return c.SendFile(\"./public/404.html\"); // Disable compression return c.SendFile(\"./static/index.html\", false); }) info If the file contains an url specific character you have to escape it before passing the file path into the sendFile function. Example app.Get(\"/file-with-url-chars\", func(c *fiber.Ctx) error { return c.SendFile(url.PathEscape(\"hash_sign_#.txt\")) })","s":"SendFile","u":"/next/api/ctx","h":"#sendfile","p":562},{"i":692,"t":"Sets the status code and the correct status message in the body, if the response body is empty. tip You can find all used status codes and messages here. Signature func (c *Ctx) SendStatus(status int) error Example app.Get(\"/not-found\", func(c *fiber.Ctx) error { return c.SendStatus(415) // => 415 \"Unsupported Media Type\" c.SendString(\"Hello, World!\") return c.SendStatus(415) // => 415 \"Hello, World!\" })","s":"SendStatus","u":"/next/api/ctx","h":"#sendstatus","p":562},{"i":694,"t":"Sets the response’s HTTP header field to the specified key, value. Signature func (c *Ctx) Set(key string, val string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Set(\"Content-Type\", \"text/plain\") // => \"Content-type: text/plain\" // ... })","s":"Set","u":"/next/api/ctx","h":"#set","p":562},{"i":696,"t":"Allow you to config BodyParser/QueryParser decoder, base on schema's options, providing possibility to add custom type for parsing. Signature func SetParserDecoder(parserConfig fiber.ParserConfig{ IgnoreUnknownKeys bool, ParserType []fiber.ParserType{ Customtype interface{}, Converter func(string) reflect.Value, }, ZeroEmpty bool, SetAliasTag string, }) Example type CustomTime time.Time // String() returns the time in string func (ct *CustomTime) String() string { t := time.Time(*ct).String() return t } // Register the converter for CustomTime type format as 2006-01-02 var timeConverter = func(value string) reflect.Value { fmt.Println(\"timeConverter\", value) if v, err := time.Parse(\"2006-01-02\", value); err == nil { return reflect.ValueOf(v) } return reflect.Value{} } customTime := fiber.ParserType{ Customtype: CustomTime{}, Converter: timeConverter, } // Add setting to the Decoder fiber.SetParserDecoder(fiber.ParserConfig{ IgnoreUnknownKeys: true, ParserType: []fiber.ParserType{customTime}, ZeroEmpty: true, }) // Example to use CustomType, you pause custom time format not in RFC3339 type Demo struct { Date CustomTime `form:\"date\" query:\"date\"` Title string `form:\"title\" query:\"title\"` Body string `form:\"body\" query:\"body\"` } app.Post(\"/body\", func(c *fiber.Ctx) error { var d Demo c.BodyParser(&d) fmt.Println(\"d.Date\", d.Date.String()) return c.JSON(d) }) app.Get(\"/query\", func(c *fiber.Ctx) error { var d Demo c.QueryParser(&d) fmt.Println(\"d.Date\", d.Date.String()) return c.JSON(d) }) // curl -X POST -F title=title -F body=body -F date=2021-10-20 http://localhost:3000/body // curl -X GET \"http://localhost:3000/query?title=title&body=body&date=2021-10-20\"","s":"SetParserDecoder","u":"/next/api/ctx","h":"#setparserdecoder","p":562},{"i":698,"t":"Sets the user specified implementation for context interface. Signature func (c *Ctx) SetUserContext(ctx context.Context) Example app.Get(\"/\", func(c *fiber.Ctx) error { ctx := context.Background() c.SetUserContext(ctx) // Here ctx could be any context implementation // ... })","s":"SetUserContext","u":"/next/api/ctx","h":"#setusercontext","p":562},{"i":700,"t":"https://expressjs.com/en/4x/api.html#req.stale Signature func (c *Ctx) Stale() bool","s":"Stale","u":"/next/api/ctx","h":"#stale","p":562},{"i":702,"t":"Sets the HTTP status for the response. info Method is a chainable. Signature func (c *Ctx) Status(status int) *Ctx Example app.Get(\"/fiber\", func(c *fiber.Ctx) error { c.Status(fiber.StatusOK) return nil } app.Get(\"/hello\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusBadRequest).SendString(\"Bad Request\") } app.Get(\"/world\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusNotFound).SendFile(\"./public/gopher.png\") })","s":"Status","u":"/next/api/ctx","h":"#status","p":562},{"i":704,"t":"Returns a string slice of subdomains in the domain name of the request. The application property subdomain offset, which defaults to 2, is used for determining the beginning of the subdomain segments. Signature func (c *Ctx) Subdomains(offset ...int) []string Example // Host: \"tobi.ferrets.example.com\" app.Get(\"/\", func(c *fiber.Ctx) error { c.Subdomains() // [\"ferrets\", \"tobi\"] c.Subdomains(1) // [\"tobi\"] // ... })","s":"Subdomains","u":"/next/api/ctx","h":"#subdomains","p":562},{"i":706,"t":"Sets the Content-Type HTTP header to the MIME type listed here specified by the file extension. Signature func (c *Ctx) Type(ext string, charset ...string) *Ctx Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Type(\".html\") // => \"text/html\" c.Type(\"html\") // => \"text/html\" c.Type(\"png\") // => \"image/png\" c.Type(\"json\", \"utf-8\") // => \"application/json; charset=utf-8\" // ... })","s":"Type","u":"/next/api/ctx","h":"#type","p":562},{"i":708,"t":"UserContext returns a context implementation that was set by user earlier or returns a non-nil, empty context, if it was not set earlier. Signature func (c *Ctx) UserContext() context.Context Example app.Get(\"/\", func(c *fiber.Ctx) error { ctx := c.UserContext() // ctx is context implementation set by user // ... })","s":"UserContext","u":"/next/api/ctx","h":"#usercontext","p":562},{"i":710,"t":"Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location. info Multiple fields are allowed. Signature func (c *Ctx) Vary(fields ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Vary(\"Origin\") // => Vary: Origin c.Vary(\"User-Agent\") // => Vary: Origin, User-Agent // No duplicates c.Vary(\"Origin\") // => Vary: Origin, User-Agent c.Vary(\"Accept-Encoding\", \"Accept\") // => Vary: Origin, User-Agent, Accept-Encoding, Accept // ... })","s":"Vary","u":"/next/api/ctx","h":"#vary","p":562},{"i":712,"t":"Write adopts the Writer interface Signature func (c *Ctx) Write(p []byte) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Write([]byte(\"Hello, World!\")) // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"Write","u":"/next/api/ctx","h":"#write","p":562},{"i":714,"t":"Writef adopts the string with variables Signature func (c *Ctx) Writef(f string, a ...interface{}) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { world := \"World!\" c.Writef(\"Hello, %s\", world) // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"Writef","u":"/next/api/ctx","h":"#writef","p":562},{"i":716,"t":"WriteString adopts the string Signature func (c *Ctx) WriteString(s string) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.WriteString(\"Hello, World!\") // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"WriteString","u":"/next/api/ctx","h":"#writestring","p":562},{"i":718,"t":"A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery). Signature func (c *Ctx) XHR() bool Example // X-Requested-With: XMLHttpRequest app.Get(\"/\", func(c *fiber.Ctx) error { c.XHR() // true // ... })","s":"XHR","u":"/next/api/ctx","h":"#xhr","p":562},{"i":720,"t":"Converts any interface or string to XML using the standard encoding/xml package. info XML also sets the content header to application/xml. Signature func (c *Ctx) XML(data interface{}) error Example type SomeStruct struct { XMLName xml.Name `xml:\"Fiber\"` Name string `xml:\"Name\"` Age uint8 `xml:\"Age\"` } app.Get(\"/\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ Name: \"Grame\", Age: 20, } return c.XML(data) // // Grame // 20 // })","s":"XML","u":"/next/api/ctx","h":"#xml","p":562}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/2",[0,5.72,1,3.184,2,4.307,3,0.895,4,3.862,5,5.041,6,3.766,7,1.515,8,2.272,9,6.309,10,6.309,11,3.958,12,4.81,13,2.871,14,5.331,15,5.331,16,4.81,17,6.309,18,2.042,19,4.452,20,3.474,21,4.81,22,6.309,23,6.309,24,4.81,25,5.72,26,5.041,27,4.81,28,4.307,29,4.81,30,3.614,31,6.309,32,5.331,33,4.452,34,4.617,35,6.309,36,6.309,37,6.309]],["t/4",[20,5.665,38,5.007,39,5.84,40,8.107,41,7.981,42,7.981,43,5.007,44,5.631,45,1.495,46,6.084,47,2.876]],["t/6",[3,0.736,7,0.794,8,0.814,30,2.972,45,1.475,48,2.809,49,1.086,50,1.217,51,5.115,52,1.408,53,3.308,54,2.998,55,5.188,56,1.397,57,2.521,58,3.308,59,4.016,60,3.667,61,2.781,62,2.42,63,1.697,64,3.308,65,2.42,66,2.998,67,2.334,68,2.025,69,3.308,70,3.661,71,0.51,72,5.188,73,0.937,74,0.539,75,4.669,76,3.284,77,3.918,78,5.188,79,1.857,80,6.402,81,2.075,82,3.308,83,3.179,84,3.919,85,2.795,86,4.384,87,3.308,88,0.624,89,3.308,90,3.308,91,3.308,92,3.308,93,3.308,94,4.384,95,3.308,96,1.57,97,1.134,98,3.308,99,1.134,100,2.795,101,2.795,102,2.521,103,3.308,104,3.308,105,0.552,106,3.308,107,2.998,108,0.913,109,1.669,110,2.998,111,3.308,112,2.998,113,2.998,114,2.075,115,1.18,116,1.485,117,2.258,118,2.025,119,2.258,120,2.998,121,2.998]],["t/8",[7,2.029,8,1.602,20,3.585,47,2.347,49,0.976,50,1.006,68,3.986,71,0.64,73,0.953,74,0.511,96,3.091,105,1.087,122,5.903,123,5.903,124,6.511,125,2.088,126,3.394,127,2.168,128,2.709,129,1.86,130,3.73,131,4.132,132,3.894,133,3.809,134,6.511,135,4.765,136,4.193,137,3.73,138,3.519,139,4.313]],["t/10",[1,1.755,7,0.835,8,0.855,18,1.746,48,1.169,49,1.208,50,1.151,56,2.005,59,2.182,61,1.228,63,1.784,73,1.249,74,0.553,88,0.656,99,2.266,105,1.244,129,0.993,130,3.09,131,3.232,138,3.572,140,3.139,141,2.778,142,2.182,143,5.395,144,1.846,145,3.152,146,2.453,147,2.778,148,3.206,149,1.915,150,2.139,151,4.559,152,3.302,153,3.948,154,2.034,155,1.915,156,2.722,157,2.97,158,3.152,159,2.545,160,1.35,161,2.938,162,0.55,163,3.477,164,3.948,165,2.08,166,2.938,167,1.675,168,2.778,169,1.915,170,2.545,171,1.992,172,2.524,173,3.477,174,3.477,175,3.152,176,3.477,177,1.228,178,3.477,179,3.477,180,4.559,181,2.97,182,3.477,183,2.938,184,3.477,185,3.152,186,3.152,187,2.778,188,3.477]],["t/12",[7,1.492,45,1.164,61,2.194,74,0.309,81,3.898,88,1.547,94,5.25,99,2.809,128,2.585,132,3.716,160,2.412,162,0.983,171,3.559,189,5.015,190,6.547,191,4.88,192,5.632,193,5.632,194,5.632,195,5.25,196,6.258,197,6.213,198,1.368,199,3.135,200,2.467,201,6.708,202,5.632,203,4.964,204,6.213,205,6.213,206,6.213]],["t/14",[1,4.757,5,7.533,8,2.319,11,4.864,20,5.191,116,3.481,117,5.292,118,4.746,119,5.292,207,5.91,208,7.752,209,7.752,210,7.752]],["t/17",[4,3.69,18,2.923,56,1.623,71,1.013,74,0.3,88,1.947,144,5.589,150,2.6,162,0.954,211,2.743,212,2.731,213,6.029,214,4.293,215,6.029,216,6.029,217,6.029,218,6.029,219,6.029]],["t/19",[14,6.744,15,6.744,56,2.148,81,5.007,150,3.33,214,3.321,220,7.981,221,7.235,222,7.981,223,7.981,224,7.981,225,6.744]],["t/21",[74,0.555,199,3.572,221,6.416,226,5.455,227,3.266,228,7.078,229,5.655,230,7.078,231,7.078,232,7.078,233,4.439,234,7.078,235,1.987,236,5.981,237,3.692,238,7.078]],["t/23",[3,0.868,48,2.057,71,0.952,74,0.403,88,1.717,108,2.239,162,0.968,214,4.466,239,3.369,240,2.252,241,1.858,242,6.119,243,6.417,244,6.119,245,4.738,246,6.119,247,6.119,248,6.119,249,5.538,250,6.119,251,6.119,252,5.548,253,6.119,254,5.548]],["t/25",[3,0.764,33,3.803,48,1.812,71,0.903,74,0.48,88,1.609,99,1.847,155,2.967,162,0.853,214,4.337,239,2.967,240,2.739,241,2.589,243,6.091,245,4.497,249,6.588,252,4.886,254,4.886,255,4.264,256,3.57,257,4.109,258,5.39,259,5.39,260,5.39,261,5.39,262,5.39,263,5.39,264,5.39,265,5.39,266,8.527,267,4.886]],["t/27",[3,1.132,71,0.784,74,0.477,162,1.263,214,3.992,241,2.423,255,4.571,268,9.594,269,5.631,270,6.744,271,7.981]],["t/29",[3,1.059,48,2.511,71,0.905,74,0.458,88,1.41,108,2.061,162,1.181,214,4.46,241,2.268,245,3.652,272,7.468,273,3.768,274,7.468,275,7.468,276,7.468]],["t/31",[3,0.836,33,4.161,45,1.105,48,3.209,71,0.978,74,0.394,88,1.686,108,2.185,155,3.247,162,0.933,214,4.533,240,2.17,243,3.906,245,4.368,249,4.026,267,5.346,277,5.067,278,3.311,279,5.897,280,5.897,281,5.897,282,5.897,283,5.897,284,5.897,285,5.897]],["t/33",[3,1.069,48,2.534,63,4.753,71,0.91,74,0.461,88,1.423,108,2.08,162,1.192,214,4.356,241,2.289,245,3.686,286,7.537,287,7.537,288,7.537]],["t/35",[3,1.049,48,2.488,71,0.9,74,0.456,88,1.397,108,2.043,162,1.171,214,4.328,241,2.247,245,3.619,289,7.4,290,3.619,291,2.833,292,7.4,293,7.4,294,7.4]],["t/37",[3,1.079,71,0.915,74,0.463,88,1.436,108,2.1,162,1.203,214,4.37,241,2.31,245,3.72,295,6.002,296,7.607,297,7.607,298,7.607]],["t/39",[3,1.069,71,0.91,74,0.461,88,1.749,108,2.08,147,6.022,162,1.192,214,4.356,245,3.686,299,7.537,300,4.614,301,7.537,302,7.537,303,7.537]],["t/41",[3,1.004,18,2.291,45,1.326,71,0.875,74,0.443,88,1.336,108,1.954,147,5.655,162,1.12,214,4.26,245,3.461,304,6.416,305,5.981,306,7.793,307,6.416,308,5.981,309,7.078,310,7.078,311,7.078,312,5.981]],["t/43",[3,0.691,49,0.73,56,2.174,71,0.793,74,0.545,88,0.92,108,1.915,162,0.771,177,1.721,214,4.021,237,4.85,245,3.392,313,3.894,314,4.118,315,4.873,316,4.873,317,8.075,318,4.118,319,3.715,320,8.798,321,3.558,322,2.248,323,4.418,324,2.791,325,6.936,326,3.681,327,3.894,328,4.873,329,2.459,330,4.873,331,2.159,332,3.228,333,4.873,334,2.42,335,3.327,336,4.873,337,4.418,338,2.052,339,4.873,340,4.873,341,4.873,342,2.104]],["t/45",[3,1.069,56,2.029,71,0.74,74,0.461,108,2.08,115,2.689,162,1.192,214,3.856,241,2.289,290,3.686,291,2.33,343,5.421,344,4.508,345,5.145,346,7.537,347,3.214,348,7.537]],["t/47",[3,1.069,56,2.029,71,0.74,74,0.461,108,2.08,115,2.689,162,1.192,214,3.856,241,2.289,290,3.686,291,2.33,344,4.508,347,3.214,349,7.404,350,6.022,351,7.537,352,7.537]],["t/49",[3,0.836,30,3.378,34,4.316,56,2.13,65,4.316,71,0.579,74,0.521,108,1.628,162,0.933,199,2.976,214,3.293,235,1.656,237,3.076,241,1.791,278,5.589,290,2.884,291,1.823,312,4.983,344,4.733,353,4.983,354,4.712,355,4.983,356,8.654,357,4.983,358,4.316,359,3.7,360,7.175,361,4.712,362,4.983,363,5.897,364,5.346,365,5.897,366,5.346]],["t/51",[3,0.933,8,0.686,30,2.592,34,3.311,45,0.522,56,2.197,65,3.311,71,0.71,74,0.528,88,1.462,108,1.249,150,0.902,155,1.534,162,1.04,191,4.096,199,2.283,200,2.871,214,3.758,240,1.025,241,0.846,243,1.846,245,1.363,278,5.07,290,3.216,291,1.399,312,2.354,313,2.226,322,1.286,324,1.596,326,1.479,329,1.406,331,2.005,334,1.384,344,3.416,356,5.178,358,3.311,359,2.839,360,4.102,361,3.615,362,3.823,364,2.526,366,2.526,367,4.827,368,6.221,369,2.354,370,2.226,371,2.786,372,2.786,373,2.786,374,2.786,375,5.178,376,2.786,377,2.786,378,5.712,379,2.786,380,3.823,381,5.556,382,2.786,383,5.712,384,2.786,385,2.786,386,3.838,387,2.786,388,4.524,389,2.786,390,5.712,391,6.575,392,2.786,393,1.047,394,5.712,395,2.786,396,2.786,397,2.786,398,2.786,399,4.524,400,4.524,401,2.786,402,2.786,403,2.786]],["t/53",[3,1.079,56,2.048,71,0.747,74,0.463,162,1.203,214,3.878,404,6.428,405,6.896,406,4.357,407,4.111,408,2.799,409,5.368,410,7.607,411,6.428,412,7.607,413,6.896,414,7.607]],["t/55",[3,1.121,56,2.127,71,0.776,74,0.474,108,2.182,162,1.25,214,3.969,415,6.143,416,5.395,417,7.903,418,4.436,419,7.903]],["t/57",[3,1.04,34,5.366,45,1.707,56,1.974,71,0.72,74,0.453,162,1.16,165,4.386,214,4.314,361,5.859,406,4.2,420,9.111,421,6.648,422,5.174,423,7.333,424,6.648,425,7.333]],["t/59",[3,1.079,71,0.747,74,0.463,162,1.203,167,3.665,200,3.021,214,4.193,295,4.899,426,8.449,427,4.657,428,5.193,429,7.607,430,5.368,431,6.079,432,7.607]],["t/61",[3,0.987,71,0.683,74,0.533,96,3.302,108,1.92,162,1.101,198,1.941,214,3.668,240,2.56,430,6.22,433,6.307,434,5.838,435,6.957,436,6.22,437,6.307,438,3.76,439,6.957,440,6.307,441,6.957]],["t/63",[3,1.11,71,0.769,74,0.472,108,2.161,162,1.238,214,3.946,335,5.343,338,3.297,442,7.096,443,5.041,444,5.041,445,6.614,446,7.827,447,7.827]],["t/65",[3,1.121,71,0.776,74,0.474,97,2.709,108,2.182,162,1.25,214,3.969,343,4.623,448,6.678,449,5.235,450,7.903,451,7.164,452,7.903]],["t/67",[3,1.121,71,0.776,74,0.474,97,2.709,108,2.182,162,1.25,214,3.969,343,4.623,453,6.678,454,6.025,455,7.903,456,7.164,457,7.903]],["t/69",[3,1.11,49,1.173,56,2.854,71,0.769,74,0.507,162,1.238,165,4.681,214,3.946,229,6.254,458,7.827]],["t/71",[3,0.97,30,3.918,34,5.005,65,5.005,71,0.672,74,0.477,97,2.989,108,1.888,162,1.082,165,4.091,199,3.451,214,3.995,358,5.005,359,4.291,361,5.465,362,5.78,408,3.532,459,6.84,460,8.72,461,6.84,462,6.201,463,6.84,464,6.84]],["t/73",[3,1.022,29,5.491,71,0.708,74,0.489,97,2.469,108,1.988,162,1.14,195,6.087,214,3.749,237,3.758,245,3.523,290,3.523,408,2.65,465,10.302,466,6.087,467,3.523,468,5.491,469,7.203,470,7.203]],["t/75",[3,1.013,49,1.07,71,0.701,73,1.311,74,0.487,162,1.13,199,4.942,211,3.249,214,2.971,233,4.078,237,5.108,245,5.022,338,3.007,471,3.662,472,7.14]],["t/77",[3,1.04,49,1.099,71,0.72,73,1.333,74,0.493,88,1.957,162,1.16,199,4.598,211,3.337,214,3.051,233,3.337,237,4.753,338,3.089,471,3.761,473,7.333]],["t/79",[3,0.938,49,0.991,71,0.65,73,1.249,74,0.47,162,1.047,199,4.769,211,3.011,214,2.754,233,3.885,237,5.209,239,3.643,243,4.383,245,4.622,331,2.932,338,2.787,347,2.822,393,2.487,471,3.394,474,6.617,475,6.617,476,2.598,477,4.842,478,6.617]],["t/81",[3,0.978,16,5.258,45,1.292,49,1.033,52,1.872,71,0.678,73,1.01,74,0.521,99,2.364,162,1.091,214,3.648,229,5.512,427,4.222,428,4.709,479,6.898,480,6.253,481,6.898,482,6.898,483,6.898,484,6.898,485,6.898,486,6.898,487,2.364,488,6.898,489,6.253]],["t/83",[18,0.495,29,0.425,39,0.408,45,0.2,56,0.633,62,0.408,63,0.286,73,0.082,74,0.567,84,0.937,108,0.154,109,1.37,120,0.505,150,0.495,151,0.471,152,0.341,157,0.587,162,0.169,167,0.513,177,0.691,199,0.281,201,0.78,211,0.254,214,0.232,240,0.563,241,0.714,269,0.752,273,0.281,277,0.566,278,0.313,290,2.049,291,0.473,295,0.686,318,0.471,331,0.867,335,0.381,345,0.728,350,0.852,353,0.471,354,0.852,355,0.471,359,0.35,369,0.471,427,2.408,443,0.686,449,1.014,471,0.286,476,0.219,480,0.505,490,1.045,491,1.337,492,0.558,493,9.198,494,9.101,495,0.558,496,0.558,497,0.558,498,0.558,499,0.558,500,0.558,501,0.558,502,0.558,503,1.066,504,0.558,505,0.558,506,0.408,507,0.558,508,0.558,509,0.558,510,0.558,511,0.558,512,0.558,513,0.425,514,0.558,515,0.558,516,0.471,517,0.558,518,0.558,519,0.966,520,0.558,521,0.752,522,0.558,523,0.752,524,0.558,525,0.558,526,0.558,527,1.066,528,0.558,529,0.558,530,0.558,531,0.558,532,0.558,533,2.17,534,1.854,535,0.558,536,0.558,537,0.558,538,0.558,539,0.558,540,0.558,541,0.505,542,0.558,543,0.558,544,0.558,545,0.558,546,0.558,547,0.558,548,0.558,549,0.558,550,0.558,551,0.558,552,0.558,553,0.558,554,0.471,555,0.558,556,0.558,557,0.558,558,0.558,559,0.558,560,0.558,561,0.558,562,0.558,563,0.558,564,0.558,565,0.558,566,0.558,567,0.558,568,0.558,569,0.558,570,0.558,571,0.558,572,0.558,573,1.531,574,1.066,575,0.558,576,0.558,577,3.66,578,0.558,579,0.558,580,0.558,581,1.531,582,0.558,583,0.558,584,0.558,585,0.558,586,0.558,587,0.558,588,0.558,589,0.558,590,0.558,591,0.471,592,0.558,593,0.558,594,0.425,595,0.558,596,0.558,597,0.558,598,0.558,599,0.558,600,0.558,601,1.531,602,0.558,603,0.558,604,0.558,605,0.558,606,0.558,607,0.558,608,0.558,609,0.558,610,0.558,611,1.721,612,0.558,613,0.471,614,1.066,615,0.558,616,0.445,617,1.958,618,1.066,619,0.558,620,0.558,621,1.066,622,0.558,623,0.558,624,1.066,625,0.558,626,0.425,627,1.066,628,0.558,629,0.558,630,1.066,631,0.558,632,0.558,633,1.066,634,0.558,635,0.558,636,1.066,637,0.558,638,0.505,639,1.066,640,0.558,641,0.558,642,1.066,643,0.558,644,0.558,645,1.066,646,0.558,647,0.558,648,1.066,649,0.558,650,0.558,651,1.066,652,0.558,653,0.505,654,1.066,655,0.558,656,0.558,657,1.066,658,0.558,659,0.505,660,1.066,661,0.558,662,0.558,663,0.966,664,0.558,665,0.558,666,1.066,667,0.558,668,0.558,669,1.066,670,1.066,671,0.558,672,0.558,673,1.066,674,1.066,675,0.558,676,0.558,677,1.066,678,0.558,679,0.558,680,1.066,681,0.558,682,0.558,683,1.066,684,0.558,685,0.558,686,1.066,687,1.066,688,0.558,689,1.066,690,0.558,691,0.558,692,3.368,693,0.558,694,0.505,695,0.78,696,0.558,697,0.558,698,0.812,699,0.558,700,0.558,701,1.066,702,0.558,703,0.393,704,1.066,705,0.558,706,0.558,707,1.066,708,0.558,709,0.558,710,1.066,711,0.558,712,0.505,713,1.066,714,0.558,715,0.558,716,1.066,717,0.558,718,0.558,719,1.066,720,0.558,721,0.558,722,1.066,723,1.066,724,0.558,725,0.558,726,1.066,727,0.558,728,0.558,729,1.066,730,0.558,731,0.558,732,1.066,733,1.066,734,0.558,735,0.558,736,1.066,737,0.558,738,0.558,739,0.558,740,0.558,741,0.558,742,0.558,743,0.558,744,0.558,745,0.558,746,0.558,747,0.558,748,0.558,749,0.558,750,0.558,751,0.558,752,0.558,753,0.558,754,0.558,755,0.558,756,0.558,757,0.558,758,0.558,759,0.558,760,0.558,761,0.558,762,0.558,763,0.558,764,0.558,765,0.558,766,0.558,767,0.558,768,0.558,769,0.558,770,0.558,771,0.558,772,0.558,773,0.558,774,0.558,775,0.558,776,0.558,777,0.558,778,0.558,779,0.558,780,0.558,781,0.558,782,0.558,783,0.558,784,0.558,785,0.558,786,0.558,787,0.558,788,0.558,789,0.558,790,0.558,791,0.558,792,0.558,793,0.558,794,0.558,795,0.558,796,0.558,797,0.558,798,0.558,799,0.558,800,0.558,801,0.558,802,0.558,803,0.558,804,0.558,805,0.558,806,0.558,807,0.558,808,0.558,809,0.558,810,0.558,811,0.558,812,0.558,813,0.558,814,0.558,815,0.558,816,0.558,817,0.558,818,0.78,819,0.558,820,0.752,821,0.752,822,0.558,823,0.558,824,0.558,825,0.78,826,0.558,827,0.35,828,0.558,829,0.505,830,0.445,831,0.558,832,0.286,833,0.558,834,0.558,835,0.558,836,0.505,837,0.558,838,2.775,839,1.066,840,0.558,841,0.445,842,0.558,843,1.066,844,0.558,845,0.558,846,0.445,847,0.558,848,0.333,849,0.558,850,0.558,851,1.066,852,0.558,853,0.558,854,0.425,855,0.558,856,0.558,857,0.966,858,0.558,859,0.471,860,0.558,861,0.558,862,0.558,863,0.812,864,0.558,865,0.505,866,0.558,867,0.558,868,0.505,869,0.558,870,0.558,871,0.471,872,0.558,873,0.558,874,0.966,875,0.558,876,0.558,877,0.9,878,0.558,879,2.154,880,0.558,881,0.558,882,2.113,883,0.445,884,0.558,885,0.558,886,0.558,887,1.228,888,0.558,889,0.393,890,0.558,891,0.558,892,0.558,893,0.558,894,0.558,895,0.637,896,0.558,897,3.09,898,0.505,899,0.852,900,0.381,901,3.053,902,0.558,903,0.558,904,0.558,905,0.558,906,0.558,907,0.471,908,0.558,909,0.558,910,0.558,911,0.505,912,0.558,913,0.812,914,0.558,915,0.558,916,0.558,917,0.558,918,0.558,919,0.558,920,0.505,921,0.558,922,0.812,923,0.558,924,0.505,925,0.558,926,0.471,927,0.558,928,0.558,929,0.558,930,0.558,931,0.558,932,0.505,933,0.558,934,0.558,935,0.558,936,0.558,937,1.228,938,0.558,939,0.558,940,0.558,941,0.558,942,1.08,943,0.558,944,1.293,945,0.558,946,0.408,947,0.558,948,0.505,949,0.558,950,0.425,951,0.558,952,1.066,953,0.558,954,0.558,955,0.558,956,0.558,957,0.558,958,1.066,959,0.558,960,0.558,961,0.558,962,0.558,963,0.558,964,0.558,965,0.558,966,0.558,967,0.558,968,0.471,969,0.558,970,0.505,971,0.706,972,0.558,973,0.558,974,0.558,975,1.066,976,0.558,977,0.558,978,0.558,979,0.558,980,0.558,981,0.558,982,0.558,983,0.471,984,0.558,985,2.352,986,2.352,987,0.558,988,0.445,989,0.558,990,0.558,991,0.558,992,0.471,993,0.558,994,0.558,995,1.066,996,0.558,997,0.558,998,0.558,999,0.558,1000,0.558,1001,0.408,1002,0.558,1003,0.341,1004,0.558,1005,0.471,1006,0.558,1007,0.408,1008,0.558,1009,0.558,1010,0.558,1011,0.558,1012,0.558,1013,0.471,1014,0.558,1015,0.558,1016,0.558,1017,0.558,1018,0.505,1019,0.505,1020,0.558,1021,0.558,1022,0.558,1023,0.558,1024,0.558,1025,0.558,1026,0.381,1027,0.558,1028,0.505,1029,0.445]],["t/86",[3,0.658,7,0.852,18,0.673,39,2.596,45,1.152,48,2.531,49,0.312,52,2.209,56,0.955,61,1.253,68,1.274,71,0.204,74,0.542,81,1.305,88,0.67,97,0.713,99,1.216,105,0.347,108,1.973,109,1.05,115,2.686,116,0.934,135,3.394,148,1.743,149,1.146,150,1.148,155,1.146,160,0.808,162,0.329,166,1.758,167,1.002,171,1.192,177,2.874,189,4.608,190,6.502,191,4.319,192,1.886,193,1.886,194,1.886,196,4.879,198,0.781,199,1.05,200,1.409,201,4.499,202,4.967,235,0.996,241,0.632,245,1.018,291,0.643,321,1.067,338,0.876,393,1.333,406,3.138,408,1.706,416,1.42,418,1.992,427,2.172,487,2.108,827,2.226,832,1.067,937,1.305,1003,2.839,1030,1.05,1031,2.704,1032,2.081,1033,1.274,1034,2.081,1035,2.081,1036,2.081,1037,2.122,1038,1.663,1039,1.274,1040,1.468,1041,1.033,1042,1.886,1043,2.081,1044,2.081,1045,2.081,1046,2.081,1047,1.104,1048,2.081,1049,1.886,1050,1.886,1051,4.637,1052,2.622,1053,1.34,1054,1.758,1055,1.586,1056,1.586,1057,1.758,1058,1.886,1059,3.272,1060,1.34,1061,1.586,1062,2.081,1063,0.852,1064,2.396,1065,2.081,1066,3.548,1067,2.081,1068,1.886,1069,1.886,1070,2.081,1071,1.886,1072,2.081,1073,2.081,1074,1.523,1075,2.704,1076,2.704,1077,3.548,1078,2.081,1079,3.166,1080,1.244,1081,1.758,1082,2.835,1083,1.886,1084,1.24,1085,0.947,1086,0.57,1087,2.081,1088,1.886]],["t/88",[1,2.124,3,0.597,4,2.576,7,2.501,18,1.739,45,0.788,48,0.857,49,1.177,50,1.214,56,1.857,61,3.698,71,0.902,73,1.15,74,0.518,88,1.697,97,0.874,105,1.24,109,1.287,125,0.818,140,1.977,148,1.582,149,1.404,150,2.018,152,2.576,153,1.866,154,1.492,155,2.317,157,3.799,162,0.666,170,3.08,181,1.404,241,0.774,255,1.461,256,1.689,347,1.088,1033,5.622,1037,3.213,1063,0.613,1089,2.517,1090,3.363,1091,2.155,1092,2.155,1093,2.155,1094,2.155,1095,2.155,1096,2.155,1097,2.155,1098,2.155,1099,2.155,1100,2.155,1101,2.155,1102,1.866,1103,2.155,1104,2.155,1105,3.556,1106,2.155,1107,2.155,1108,1.866,1109,1.944,1110,2.038,1111,2.155,1112,2.155,1113,1.741,1114,4.57,1115,3.556,1116,3.363,1117,1.561,1118,2.155,1119,1.944,1120,2.038,1121,2.155]],["t/90",[3,0.902,7,2.362,8,1.564,49,0.953,50,0.983,71,0.817,73,0.931,74,0.538,88,1.2,96,3.018,105,1.062,126,2.554,128,3.462,162,1.006,165,3.803,554,5.373,1033,3.892,1110,5.081,1122,6.342,1123,6.359,1124,8.319,1125,6.359,1126,5.764,1127,6.359,1128,5.764,1129,3.436]],["t/92",[3,0.759,4,3.277,7,2.312,71,0.728,74,0.537,88,1.011,116,2.404,126,2.151,127,1.783,128,3.816,148,2.785,162,0.847,169,2.948,422,6.47,1047,2.842,1122,6.99,1130,8.497,1131,3.006,1132,4.524,1133,4.854,1134,6.261,1135,7.409,1136,5.354,1137,5.354,1138,5.354,1139,5.354,1140,5.354,1141,5.354,1142,5.354,1143,5.354,1144,5.354,1145,2.842,1146,3.778,1147,5.354,1148,5.354]],["t/94",[1,3.862,3,0.796,7,2.092,33,3.96,61,3.769,71,0.752,74,0.55,88,1.059,96,2.664,126,2.254,128,2.336,140,2.065,162,0.888,249,3.832,393,2.109,1033,3.436,1129,3.033,1149,5.069,1150,5.613,1151,4.485,1152,4.485,1153,4.485,1154,4.485,1155,4.485,1156,4.485,1157,4.485,1158,4.743,1159,4.743,1160,4.743,1161,4.743,1162,4.743,1163,4.743]],["t/96",[3,0.861,7,2.177,71,0.793,74,0.525,88,1.524,99,2.082,126,2.44,128,2.527,140,2.235,162,0.961,200,3.6,1033,4.941,1037,3.632,1052,2.59,1129,3.282,1164,7.317,1165,6.074,1166,6.074,1167,6.074,1168,5.506,1169,6.074,1170,6.074,1171,5.506,1172,6.074,1173,6.074,1174,6.074,1175,6.074,1176,6.074,1177,6.074,1178,6.074,1179,6.074,1180,3.168]],["t/98",[3,1.031,7,2.371,16,5.54,49,1.089,71,0.89,74,0.539,85,6.141,126,2.919,128,3.024,162,1.15,167,4.756,342,3.138,1181,7.267,1182,7.267]],["t/100",[7,2.431,38,3.546,49,0.847,71,0.859,73,1.279,167,3.704,269,6.167,270,6.498,324,3.237,370,4.516,415,3.64,418,3.173,832,2.899,1060,3.64,1183,7.924,1184,5.652,1185,8.74,1186,7.924,1187,4.308,1188,5.124,1189,7.69,1190,4.776,1191,3.306,1192,4.516,1193,5.652,1194,5.652,1195,5.652,1196,5.652,1197,5.652,1198,5.652,1199,5.652,1200,4.776,1201,5.652,1202,5.652,1203,5.652,1204,3.988]],["t/102",[7,2.346,49,1.232,61,2.904,71,0.808,150,2.662,162,1.301,1089,4.918,1205,6.948,1206,8.223,1207,8.223]],["t/104",[3,0.695,7,1.946,49,1.044,50,0.758,61,2.861,71,0.684,73,0.717,74,0.569,77,2.649,105,0.819,126,1.969,128,2.04,132,2.932,140,1.804,148,3.045,150,2.855,152,3.001,162,0.776,235,1.376,331,2.172,335,3.347,438,2.649,476,1.925,825,5.097,887,3.076,1033,3.001,1089,2.932,1208,5.097,1209,4.902,1210,4.902,1211,4.444,1212,4.902,1213,6.965,1214,4.74,1215,3.917]],["t/106",[3,0.491,7,1.583,49,0.519,50,0.535,61,1.899,71,0.528,73,0.507,74,0.565,77,1.871,88,0.654,96,1.644,105,0.578,126,1.391,128,1.441,129,0.989,132,2.071,140,1.274,148,3.452,150,3.054,162,0.548,200,3.746,235,0.972,331,1.534,335,4.5,438,1.871,476,1.359,506,4.824,513,2.639,1003,2.12,1033,2.12,1116,2.767,1211,3.139,1214,5.374,1215,8.074,1216,3.139,1217,3.462,1218,3.462,1219,3.462,1220,3.462,1221,3.462,1222,3.462,1223,3.462,1224,3.462,1225,3.462,1226,3.462,1227,3.462,1228,3.462,1229,3.462,1230,2.926,1231,3.671,1232,3.462,1233,5.377,1234,3.462,1235,3.462]],["t/108",[3,0.836,7,2.145,49,0.884,50,0.912,61,2.083,71,0.777,73,0.863,74,0.554,77,3.187,88,1.113,105,0.985,126,2.369,128,2.454,129,1.684,132,3.527,140,2.912,148,2.216,150,2.562,162,0.933,200,3.143,235,1.656,331,2.613,438,3.187,476,2.316,1003,3.61,1214,3.45,1215,4.712,1230,4.983,1236,4.983,1237,5.897,1238,5.897,1239,5.897]],["t/110",[3,0.802,7,2.099,49,0.847,50,0.874,71,0.859,73,0.827,74,0.55,77,3.054,115,2.016,126,2.27,128,2.352,130,3.237,131,2.764,140,3.216,148,2.124,150,2.489,152,3.46,162,0.894,200,2.244,212,1.496,331,2.504,438,3.054,487,1.937,1003,3.46,1063,1.357,1089,3.38,1214,3.306,1215,4.516,1230,4.776,1236,4.776,1240,5.652,1241,5.652,1242,4.776,1243,4.516,1244,3.546,1245,5.124,1246,5.652]],["t/112",[7,2.471,48,2.683,49,1.196,71,0.784,74,0.477,162,1.263,198,2.351,326,4.236]],["t/114",[7,2.291,45,1.48,49,1.184,56,2.127,61,3.618,71,0.776,97,2.709,162,1.25,167,3.807,189,4.838,1247,6.678,1248,7.903]],["t/116",[3,1.04,7,2.188,18,2.374,56,1.974,71,0.72,73,1.073,74,0.453,88,1.384,97,2.514,162,1.16,189,4.489,239,4.038,295,4.723,1191,5.33,1249,5.174,1250,7.333,1251,4.857,1252,7.333,1253,7.333,1254,7.333]],["t/118",[3,0.849,7,1.92,18,1.937,45,1.686,52,2.169,56,1.611,71,0.588,73,0.876,74,0.478,88,1.13,148,2.249,160,2.324,162,0.947,189,3.663,191,2.883,198,1.76,239,3.295,240,2.202,322,2.761,430,5.639,434,3.964,436,5.639,1191,3.501,1249,4.222,1255,7.245,1256,6.753,1257,6.753,1258,5.425,1259,5.984,1260,5.425,1261,5.425,1262,4.782,1263,4.782,1264,4.782,1265,4.782]],["t/120",[3,0.954,7,2.072,45,1.616,52,2.342,71,0.661,73,0.984,74,0.5,88,1.27,160,2.612,162,1.064,198,1.9,322,3.104,430,4.746,436,6.088,1191,3.935,1258,6.098,1262,5.375,1263,5.375,1264,6.894,1265,7.611,1266,6.727,1267,6.727]],["t/122",[3,0.796,7,1.838,18,1.817,45,1.631,52,2.077,56,1.511,71,0.551,73,0.821,74,0.465,88,1.059,148,2.109,160,2.179,162,0.888,189,3.436,191,2.704,198,1.686,239,3.09,240,2.065,322,2.59,430,5.4,431,4.485,434,3.718,436,5.4,1191,3.283,1249,3.96,1256,6.467,1257,6.467,1260,6.938,1261,5.088,1262,4.485,1263,4.485,1264,4.485,1265,4.485,1268,7.654,1269,6.938,1270,5.613,1271,5.613,1272,5.613,1273,5.088,1274,5.088,1275,5.088,1276,5.088]],["t/124",[3,0.807,7,1.856,18,1.842,45,1.643,52,2.097,56,1.532,71,0.559,73,0.833,74,0.468,88,1.074,148,2.139,160,2.21,162,0.9,189,3.484,191,2.742,198,1.702,239,3.134,240,2.094,322,2.626,430,5.452,434,3.77,436,5.452,1191,3.329,1249,4.016,1256,4.809,1257,4.809,1262,4.547,1263,4.547,1264,6.173,1265,7.009,1269,5.159,1273,5.159,1274,5.159,1275,5.159,1276,7.952,1277,7.726,1278,5.691,1279,5.691,1280,5.691]],["t/126",[3,0.946,7,2.061,45,1.608,71,0.655,73,0.976,74,0.427,97,2.287,150,2.778,162,1.055,406,3.821,436,4.707,437,6.048,438,4.638,440,6.048,1191,3.903,1281,3.078,1282,8.582,1283,6.671,1284,6.671,1285,8.582,1286,6.671,1287,4.882,1288,6.671,1289,6.671,1290,6.671,1291,6.671,1292,6.671]],["t/128",[3,0.634,7,1.566,44,3.155,45,0.838,49,0.67,50,0.691,52,1.214,71,0.439,73,0.954,74,0.547,77,2.416,79,2.51,96,3.094,97,2.235,105,0.747,129,1.277,130,2.561,131,3.188,138,2.416,140,2.399,142,2.805,150,2.49,162,0.707,191,2.154,229,3.573,235,1.255,237,2.332,241,1.979,338,1.883,342,1.931,404,3.778,415,4.198,438,3.523,462,4.053,1047,2.373,1074,3.272,1080,2.674,1180,4.013,1281,2.063,1293,4.471,1294,3.573,1295,4.471,1296,4.471,1297,4.471,1298,4.471,1299,5.209,1300,4.471,1301,6.519,1302,4.471,1303,5.508,1304,4.471,1305,6.519,1306,4.471,1307,4.471,1308,4.471,1309,4.053,1310,4.471,1311,4.053,1312,4.471,1313,4.471]],["t/130",[7,2.346,49,1.232,71,0.808,150,2.662,162,1.301,1131,4.616,1314,6.763]],["t/133",[3,1.013,7,2.352,52,1.938,71,0.701,74,0.511,96,4.253,128,2.971,150,2.311,162,1.13,165,5.359,177,2.521,198,2.157,200,2.835,467,4.382,1281,3.294,1315,3.603]],["t/135",[3,0.256,7,1.279,8,0.772,15,0.824,16,0.744,18,1.016,19,2.214,20,0.537,27,0.744,30,0.559,32,0.824,38,1.132,45,1.159,48,1.673,49,0.845,50,0.151,51,1.105,52,1.53,56,1.518,59,1.58,61,1.108,62,1.842,73,0.264,74,0.341,75,0.628,76,1.889,77,0.527,79,0.548,83,0.484,86,2.128,88,1.005,96,0.463,97,0.619,99,0.619,102,0.744,108,1.774,109,2.101,113,0.884,114,0.612,115,2.207,116,0.81,117,0.666,119,0.666,121,0.884,137,2.109,140,1.355,142,1.132,144,0.958,148,0.678,150,1.192,155,0.537,156,0.492,159,0.714,165,0.583,167,1.512,169,0.537,177,1.108,191,1.213,198,0.555,200,1.462,203,0.779,207,1.376,211,0.821,212,0.258,226,1.105,235,0.881,237,1.637,239,1.386,240,0.359,241,1.951,255,0.559,256,2.439,269,3.241,270,0.824,277,0.518,278,1.013,290,1.231,291,0.97,295,0.628,318,0.824,319,3.174,322,0.45,324,1.442,326,0.958,327,1.442,329,0.492,331,1.116,334,0.484,338,1.322,343,1.056,344,1.506,347,0.416,349,0.779,357,0.824,368,1.376,370,0.779,386,0.518,404,0.824,405,0.884,406,3.681,408,1.532,415,1.162,416,0.666,418,1.413,428,0.666,434,0.646,448,0.824,449,2.078,451,0.884,453,0.824,454,0.744,456,0.884,466,0.824,467,0.882,487,2.53,653,0.884,695,0.714,820,1.777,836,1.636,838,0.646,848,0.583,854,2.392,868,1.636,879,2.598,887,0.612,895,1.506,897,2.293,920,0.884,922,0.744,924,0.884,926,1.525,937,1.132,968,0.824,1001,0.714,1005,0.824,1030,0.492,1033,1.105,1037,0.583,1052,0.416,1053,0.628,1055,0.744,1059,0.688,1060,0.628,1061,1.376,1063,0.754,1064,3.228,1074,2.695,1084,0.341,1117,1.541,1122,0.744,1131,1.013,1180,0.509,1191,0.571,1192,0.779,1205,1.525,1236,0.824,1249,1.777,1251,0.646,1281,0.833,1316,2.845,1317,1.804,1318,1.804,1319,1.804,1320,1.804,1321,0.975,1322,0.779,1323,0.975,1324,0.975,1325,3.112,1326,0.975,1327,2.214,1328,0.975,1329,2.518,1330,4.593,1331,0.975,1332,3.138,1333,0.975,1334,1.442,1335,0.975,1336,0.975,1337,0.666,1338,2.439,1339,0.975,1340,0.975,1341,0.975,1342,0.975,1343,1.525,1344,0.666,1345,0.975,1346,0.975,1347,1.636,1348,1.376,1349,0.975,1350,0.975,1351,0.884,1352,0.975,1353,0.824,1354,0.975,1355,0.975,1356,0.975,1357,0.824,1358,0.975,1359,0.975,1360,0.884,1361,1.442,1362,1.056,1363,0.975,1364,1.442,1365,0.884,1366,0.975,1367,0.975,1368,0.779,1369,0.975,1370,3.241,1371,3.047,1372,0.824,1373,0.975,1374,0.975,1375,1.804,1376,0.884,1377,0.884,1378,1.804,1379,2.283,1380,0.779,1381,1.804,1382,2.845,1383,2.518,1384,2.128,1385,1.636,1386,2.283,1387,2.518,1388,0.975,1389,0.975,1390,0.628,1391,0.537,1392,1.525,1393,0.975,1394,1.668,1395,0.401,1396,0.975,1397,0.666,1398,0.824,1399,0.975,1400,0.824,1401,1.804,1402,0.824,1403,0.975,1404,1.636,1405,1.804,1406,1.804,1407,1.442,1408,2.283,1409,2.283,1410,1.919,1411,0.884,1412,0.884,1413,1.525,1414,0.975,1415,1.804,1416,1.804,1417,0.975,1418,1.804,1419,0.975,1420,0.975,1421,0.975,1422,1.636,1423,0.666,1424,2.598,1425,0.975,1426,0.884,1427,0.628,1428,0.884,1429,0.975,1430,0.975,1431,1.804,1432,0.688,1433,0.975,1434,0.714,1435,0.824,1436,0.975,1437,0.744,1438,1.636,1439,0.975,1440,0.975,1441,0.975,1442,0.824,1443,0.824,1444,0.779,1445,1.273,1446,0.884,1447,1.636,1448,1.636,1449,0.884,1450,0.824,1451,0.884,1452,1.804,1453,0.884,1454,1.804,1455,1.804,1456,0.975,1457,0.975,1458,0.824,1459,0.975,1460,1.804,1461,0.975,1462,0.975,1463,0.646,1464,0.975,1465,0.884,1466,0.975,1467,0.427,1468,0.975,1469,0.884,1470,0.666,1471,1.195,1472,0.884,1473,0.744,1474,2.296,1475,0.824,1476,1.919,1477,0.884,1478,1.525,1479,0.714,1480,0.646,1481,0.884,1482,1.442,1483,0.975,1484,0.975,1485,0.975,1486,0.975]],["t/137",[3,1.013,49,1.07,50,1.104,71,0.701,73,1.433,74,0.446,88,1.348,96,3.389,97,2.447,105,1.192,129,2.039,162,1.13,165,4.27,177,2.521,338,3.007,467,3.492,1337,6.685,1487,7.14,1488,7.14,1489,7.14,1490,7.14]],["t/139",[3,0.938,7,1.589,71,0.65,74,0.548,77,3.576,114,4.152,115,2.361,141,5.287,162,1.047,487,2.268,1316,8.568,1426,5.999,1427,6.431,1463,4.383,1491,8.537,1492,8.537,1493,5.999,1494,8.537,1495,5.999]],["t/141",[8,1.602,45,1.22,52,1.767,81,4.085,99,2.232,153,4.765,161,5.502,313,5.203,314,5.502,322,3.898,407,5.068,1052,2.777,1053,4.193,1361,5.203,1391,3.585,1479,4.765,1496,6.511,1497,5.903,1498,5.203,1499,6.511,1500,7.139,1501,4.964,1502,6.511,1503,5.903,1504,5.903,1505,5.903,1506,5.203,1507,6.511,1508,4.594,1509,4.313,1510,6.511,1511,6.511,1512,5.903]],["t/143",[74,0.514,491,5.502,1397,5.502,1513,7.306,1514,8.06,1515,8.06,1516,8.06,1517,8.06,1518,8.06,1519,8.06,1520,8.06]],["t/145",[8,1.788,74,0.514,291,2.801,322,3.353,347,4.21,407,3.928,1410,5.54,1521,8.213,1522,6.141,1523,5.128,1524,8.213,1525,5.128,1526,7.267,1527,9.06,1528,7.267]],["t/147",[45,0.815,48,2.149,52,1.181,102,4.872,118,2.664,131,2.128,133,2.546,138,2.352,150,2.069,200,1.728,240,2.351,329,2.196,334,2.161,407,4.093,1040,3.07,1061,4.872,1126,3.945,1145,2.31,1186,3.945,1188,3.945,1337,2.971,1344,2.971,1361,6.669,1397,5.171,1497,3.945,1500,5.4,1512,3.945,1529,4.352,1530,3.945,1531,4.352,1532,4.352,1533,4.352,1534,4.352,1535,4.352,1536,4.352,1537,5.794,1538,6.391,1539,6.391,1540,6.391,1541,4.352,1542,6.391,1543,4.352,1544,4.352,1545,4.509,1546,5.106,1547,4.352,1548,4.352,1549,2.803,1550,3.477,1551,3.317,1552,4.352,1553,5.774,1554,6.391,1555,4.352,1556,6.391,1557,4.352,1558,6.391,1559,4.352,1560,6.391,1561,6.391,1562,4.352,1563,6.391,1564,4.352,1565,4.352,1566,4.352,1567,4.352,1568,4.352,1569,4.352,1570,4.352,1571,4.352,1572,3.945]],["t/149",[45,1.727,52,1.473,74,0.519,97,1.86,99,1.86,100,4.585,102,4.136,108,1.498,127,2.49,170,3.97,291,1.677,322,2.503,332,4.953,393,2.039,407,4.984,438,2.932,476,2.13,895,3.245,1047,2.88,1361,4.335,1380,4.335,1479,6.261,1508,3.828,1509,3.594,1522,4.585,1525,6.037,1573,4.918,1574,6.779,1575,5.425,1576,5.425,1577,5.425,1578,4.335,1579,5.425,1580,5.425,1581,5.425,1582,5.425,1583,5.425,1584,5.425,1585,4.918,1586,5.425,1587,5.425,1588,5.425]],["t/151",[52,2.104,68,4.746,108,2.14,127,2.581,150,2.509,334,3.85,407,5.095,1343,6.551,1397,5.292,1509,5.135,1513,7.028,1525,5.47,1574,7.028,1589,7.752,1590,5.673,1591,7.752]],["t/153",[49,0.808,52,1.463,74,0.538,108,2.354,191,4.807,233,3.387,235,1.513,291,1.666,407,2.913,438,2.913,476,2.116,695,3.944,1509,6.392,1521,4.886,1525,6.016,1551,4.109,1585,4.886,1592,5.39,1593,7.73,1594,7.443,1595,5.39,1596,5.39,1597,5.39,1598,5.39,1599,7.443,1600,7.443,1601,7.443,1602,6.748,1603,5.39,1604,5.39,1605,5.39,1606,5.39]],["t/155",[45,1.48,49,1.184,59,5.984,74,0.393,108,2.182,150,2.558,160,3.069,165,4.727,1041,3.925,1090,6.315,1524,8.647,1607,7.903,1608,7.903]],["t/157",[8,2.044,56,2.236,61,3.47,490,5.671,1470,5.671,1473,6.332,1546,6.637,1609,8.307,1610,8.307]],["t/159",[7,1.269,8,1.3,50,1.135,73,0.773,74,0.516,162,0.836,200,2.098,347,2.253,487,1.811,1204,3.729,1247,6.205,1299,5.867,1322,4.222,1395,4.386,1611,5.284,1612,5.284,1613,7.925,1614,5.284,1615,5.284,1616,8.381,1617,5.284,1618,5.284,1619,7.343,1620,5.284,1621,5.284,1622,5.284,1623,5.284,1624,5.284,1625,5.284,1626,4.465,1627,5.284,1628,5.284,1629,5.284,1630,5.284,1631,5.284,1632,5.284]],["t/162",[7,1.856,8,1.4,47,2.051,49,0.853,71,0.862,74,0.557,125,1.825,126,3.103,127,1.895,128,2.368,129,1.625,131,2.783,132,3.404,138,3.076,467,2.783,490,3.885,1191,3.329,1251,3.77,1287,4.165,1299,4.547,1395,3.177,1613,6.173,1616,6.529,1633,4.547,1634,4.339,1635,5.691,1636,5.691,1637,5.691,1638,5.691,1639,5.691,1640,5.691,1641,5.159,1642,4.547,1643,5.691]],["t/164",[7,1.92,8,1.472,18,1.937,47,2.157,49,0.897,71,0.785,74,0.555,125,1.919,126,3.21,127,1.993,128,2.49,132,3.579,407,3.234,467,2.927,490,4.085,1063,1.92,1191,3.501,1251,3.964,1287,4.379,1299,4.782,1395,2.461,1613,6.386,1634,4.562,1641,5.425,1642,6.386,1644,5.984,1645,5.984,1646,5.984,1647,5.984,1648,5.984]],["t/166",[47,2.31,49,0.96,50,0.991,71,0.821,73,0.938,74,0.554,125,2.055,126,3.359,127,2.134,130,3.671,131,3.134,235,1.799,490,4.375,1191,3.749,1251,4.245,1287,4.69,1395,3.438,1613,5.121,1616,5.415,1634,4.885,1649,6.409,1650,6.409,1651,6.409,1652,6.409,1653,5.415,1654,5.81]],["t/168",[7,1.629,47,2.444,49,1.016,50,1.048,71,0.852,73,0.993,74,0.545,125,2.175,126,3.484,127,2.259,128,2.822,130,3.885,131,3.317,490,4.63,1191,3.968,1251,4.492,1287,4.963,1634,5.171,1653,5.731,1654,6.149,1655,6.149,1656,6.783,1657,6.149]],["t/170",[7,1.448,47,2.173,49,1.203,50,0.932,71,0.789,73,0.882,74,0.558,125,1.933,126,3.226,127,2.007,128,2.509,211,2.743,233,4.11,235,1.693,490,4.116,1064,2.637,1191,3.527,1251,3.993,1287,4.412,1634,4.596,1653,5.094,1655,5.465,1657,5.465,1658,6.029,1659,6.029,1660,6.029,1661,6.029,1662,6.029,1663,6.029]],["t/172",[8,1.854,18,2.44,61,2.662,76,3.866,97,2.584,307,8.401,322,3.477,329,3.803,408,2.773,616,6.022,821,6.538,883,7.404,1063,1.81,1084,2.635,1664,6.022,1665,6.022,1666,6.022]],["t/174",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/176",[6,2.092,7,1.104,8,1.637,13,2.092,45,0.861,47,1.657,49,1.283,50,0.711,73,0.673,74,0.557,88,0.868,97,1.576,105,0.768,115,2.373,125,1.474,127,2.215,160,1.785,181,4.304,198,1.465,227,2.121,273,4.323,322,2.121,487,1.576,818,3.364,1056,3.505,1063,1.104,1064,2.011,1231,5.336,1281,3.606,1467,2.011,1664,3.674,1667,2.151,1668,4.597,1669,6.652,1670,4.072,1671,7.086,1672,7.816,1673,2.581,1674,3.885,1675,4.597,1676,4.597,1677,4.597,1678,3.885,1679,4.597,1680,3.885,1681,4.597]],["t/178",[43,2.2,45,0.657,49,0.996,50,0.542,52,2.504,74,0.555,88,1.528,99,1.862,105,0.586,109,1.77,115,1.937,119,2.394,144,1.862,177,3.023,198,1.464,235,1.866,237,1.83,240,1.998,241,1.065,273,2.74,291,1.084,304,3.179,305,5.616,306,5.31,308,2.964,329,1.77,354,2.802,393,1.318,408,1.998,487,1.862,616,2.802,818,3.974,821,2.475,848,2.098,877,2.964,883,5.979,1040,2.475,1047,1.862,1052,3.651,1063,1.304,1064,1.534,1084,1.899,1085,1.596,1281,1.618,1395,1.442,1423,3.708,1664,5.979,1670,3.324,1674,6.323,1678,2.964,1680,2.964,1682,3.507,1683,2.964,1684,3.179,1685,3.179,1686,2.394,1687,3.507,1688,2.964,1689,2.566,1690,3.507,1691,2.656,1692,3.507]],["t/180",[74,0.463,198,1.675,235,2.829,273,3.839,305,6.428,306,6.079,476,2.987,818,5.567,1084,2.66,1664,6.079,1670,4.657,1674,6.428,1678,6.428,1680,6.428,1685,6.896,1693,3.778]],["t/182",[8,1.966,21,4.562,24,6.092,45,1.121,49,0.897,56,1.611,96,2.841,237,3.122,290,2.927,291,1.85,408,3.311,427,4.892,471,3.07,827,6.784,1001,5.848,1063,2.161,1069,5.425,1473,4.562,1546,4.782,1665,4.782,1683,5.057,1691,2.927,1694,5.984,1695,4.562,1696,4.782,1697,5.057,1698,5.984,1699,5.057,1700,4.222,1701,7.992,1702,5.984]],["t/184",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/186",[6,2.104,7,1.111,8,1.643,13,2.104,45,0.866,47,1.666,49,1.287,50,1.328,52,1.255,73,0.677,74,0.549,88,0.873,97,2.29,105,1.434,115,2.383,125,1.483,127,2.224,129,1.321,160,1.795,198,1.471,227,3.082,240,1.701,418,2.596,438,2.499,487,1.585,832,3.426,895,4.69,1063,1.111,1076,3.525,1084,1.617,1467,2.022,1667,2.163,1673,2.596,1703,4.624,1704,4.624,1705,6.679,1706,4.624,1707,3.383,1708,3.157,1709,3.525,1710,3.907,1711,4.624,1712,4.624,1713,4.624,1714,4.624,1715,4.624,1716,4.624,1717,2.901,1718,3.907,1719,4.624,1720,4.624,1721,4.624]],["t/188",[18,0.911,28,1.922,45,0.855,48,0.946,49,0.862,50,0.705,52,2.565,61,0.994,74,0.557,83,1.398,88,1.249,97,1.564,99,0.965,105,0.762,108,0.777,109,2.903,115,1.628,140,1.036,144,1.494,150,1.862,160,1.093,164,3.339,177,2.567,198,1.457,235,1.281,237,1.469,240,2.434,241,1.747,245,1.377,291,0.87,321,2.34,342,1.216,393,1.058,406,1.613,408,2.117,418,2.561,443,1.813,467,1.377,468,2.146,471,1.444,487,1.972,506,2.06,827,5.142,832,3.729,895,1.684,897,1.55,1041,1.398,1052,1.946,1063,1.746,1064,1.995,1084,2.011,1085,1.281,1327,3.219,1344,1.922,1362,3.365,1427,1.813,1467,1.231,1665,2.25,1686,1.922,1691,3.555,1696,2.25,1708,1.922,1709,3.478,1710,2.379,1717,1.766,1718,2.379,1722,2.552,1723,4.136,1724,2.552,1725,2.815,1726,2.146,1727,2.146,1728,1.58,1729,2.146,1730,2.379,1731,2.552,1732,2.815,1733,2.815,1734,2.552,1735,2.815,1736,2.552,1737,2.146,1738,2.552,1739,2.552,1740,2.552,1741,2.379]],["t/190",[49,0.991,50,1.023,74,0.514,88,1.249,105,1.105,150,2.142,198,1.457,235,2.654,321,3.394,342,2.857,476,2.598,827,4.152,832,3.394,897,3.643,1064,3.734,1084,2.314,1693,3.287,1708,4.517,1709,5.044,1710,5.592,1717,4.152,1718,5.592,1723,5.999,1728,3.715,1731,5.999,1738,5.999,1740,5.999,1741,5.592]],["t/192",[8,1.963,45,1.495,241,2.423,408,2.936,449,5.286,838,5.286,1059,7.259,1063,1.917,1742,6.744,1743,7.981,1744,7.981,1745,6.744]],["t/194",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/196",[6,2.608,7,1.377,8,1.91,13,2.608,45,1.074,47,2.066,49,0.859,50,0.886,52,1.556,74,0.548,97,1.965,105,0.957,125,1.838,127,2.585,140,2.109,149,3.156,160,2.225,198,1.71,227,3.582,342,3.352,487,1.965,1063,1.865,1084,2.004,1085,2.608,1397,5.3,1467,2.507,1667,2.682,1673,3.217,1696,4.579,1746,5.731,1747,5.731,1748,7.763,1749,7.763,1750,5.731]],["t/198",[49,0.877,50,0.905,52,2.138,74,0.553,99,2.007,105,0.978,115,2.089,141,4.678,177,2.781,198,1.96,235,1.644,291,1.81,321,3.003,338,2.466,342,3.401,393,2.2,487,2.007,1052,3.359,1059,4.131,1063,1.892,1084,2.754,1085,2.664,1397,5.377,1751,5.855,1752,6.655,1753,5.308,1754,5.308,1755,5.308,1756,3.502]],["t/200",[74,0.492,198,1.848,235,2.356,476,3.295,1084,2.934,1397,5.729,1693,4.168,1752,7.091]],["t/202",[74,0.553,321,3.939,342,4.048,491,5.243,1059,5.418,1397,5.243,1752,6.489,1753,6.962,1754,6.962,1755,6.962,1756,4.593]],["t/204",[8,2.023,45,1.54,177,2.904,406,4.71,887,5.159,899,6.57,946,6.017,1063,1.975,1523,5.802,1757,6.948,1758,6.948]],["t/206",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/208",[3,0.951,6,2.116,7,1.117,8,1.65,13,2.116,26,3.716,45,1.474,47,1.676,49,0.697,52,1.262,56,1.252,74,0.508,88,0.878,97,1.594,99,1.594,108,1.851,109,3.384,125,1.491,127,2.233,133,2.72,136,4.32,160,1.806,198,1.477,227,3.094,241,1.412,290,2.274,291,1.438,334,2.31,344,2.781,359,4.208,408,1.711,427,2.847,487,1.594,838,4.442,882,2.917,887,5.403,950,3.545,1063,1.117,1467,2.034,1667,2.176,1673,2.61,1757,5.667,1759,4.65,1760,6.707,1761,6.707,1762,5.667,1763,4.65,1764,4.65,1765,3.929,1766,5.667,1767,3.545,1768,4.216,1769,3.545,1770,3.403,1771,4.216,1772,4.216,1773,3.716,1774,4.216,1775,4.65]],["t/210",[45,1.374,48,2.638,49,0.693,50,0.443,52,2.332,56,2.389,74,0.555,77,1.548,83,1.423,88,1.385,99,1.586,105,0.478,108,1.277,109,2.938,115,2.077,144,1.521,150,0.927,177,3.034,198,1.282,235,1.299,241,2.029,291,0.886,321,1.47,334,1.423,338,1.207,359,1.797,393,1.077,408,2.699,427,1.754,428,3.159,487,1.995,827,1.797,882,4.193,883,3.697,887,4.193,889,2.021,946,3.386,950,2.184,1038,3.697,1052,3.52,1063,1.111,1064,1.253,1079,3.159,1080,1.713,1084,1.618,1085,1.304,1338,3.856,1545,2.021,1667,1.341,1686,3.974,1757,2.421,1762,4.919,1765,3.91,1766,3.91,1768,2.597,1769,2.184,1770,2.096,1771,2.597,1772,2.597,1773,2.289,1774,2.597,1776,4.195,1777,6.683,1778,2.865,1779,4.195,1780,2.865,1781,2.421,1782,4.195,1783,2.865]],["t/212",[74,0.542,198,1.532,235,2.475,321,3.568,476,2.731,1064,3.043,1079,4.749,1084,2.432,1693,3.455,1741,5.878,1762,5.878,1765,5.878,1766,5.878,1776,6.307,1779,6.307,1782,6.307,1784,6.957,1785,6.307,1786,6.957,1787,6.957,1788,6.957,1789,6.957]],["t/214",[3,0.667,8,1.157,28,3.211,45,1.267,48,1.581,49,0.705,52,1.277,56,2.131,68,4.14,73,0.688,88,0.888,97,1.612,108,2.186,125,1.508,137,3.874,144,2.497,177,1.661,198,1.489,277,4.595,322,2.17,331,2.084,334,2.336,335,3.211,347,2.006,359,2.951,467,2.3,513,3.586,830,3.759,832,2.413,848,2.813,899,3.759,968,3.975,1052,2.006,1053,3.029,1063,2.079,1117,2.879,1281,2.17,1362,3.956,1432,3.319,1523,3.319,1590,3.442,1666,3.759,1684,4.264,1728,2.641,1790,6.988,1791,4.704,1792,6.517,1793,4.264,1794,4.264,1795,4.704,1796,4.704,1797,3.319,1798,4.704,1799,3.442,1800,4.949,1801,5.404,1802,3.442]],["t/216",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/218",[6,2.554,7,1.348,8,1.883,13,2.554,45,1.051,47,2.023,50,0.868,52,1.523,73,0.821,74,0.531,88,1.059,97,1.924,105,0.937,108,1.549,125,1.8,127,2.549,160,2.179,198,1.686,227,3.531,334,2.788,342,2.424,832,2.879,1063,1.348,1467,2.455,1667,2.626,1673,3.151,1717,3.521,1773,4.485,1790,4.107,1792,3.718,1800,4.107,1803,5.613,1804,5.613,1805,4.743,1806,4.929,1807,5.088,1808,4.279,1809,4.485,1810,4.107,1811,3.96,1812,4.279,1813,6.467,1814,4.279]],["t/220",[18,0.791,45,0.976,48,2.591,49,0.609,50,0.628,52,2.508,56,1.093,59,3.27,71,0.24,73,0.358,74,0.558,88,1.581,96,2.474,99,0.838,105,0.678,108,1.439,115,1.449,148,0.918,177,3.263,198,1.148,200,0.97,235,0.686,240,1.494,277,4.284,278,1.372,291,0.755,324,1.399,342,1.055,393,0.918,416,1.668,418,1.372,428,1.668,467,1.195,487,2.081,832,3.115,863,1.863,900,1.668,942,1.724,1052,1.732,1063,1.252,1064,1.776,1084,1.42,1085,1.112,1362,1.429,1467,1.069,1686,3.558,1691,3.296,1717,2.548,1727,1.863,1728,1.372,1729,1.863,1767,1.863,1773,1.952,1790,6.321,1792,5.105,1799,1.788,1800,1.788,1806,3.911,1807,2.215,1808,1.863,1809,1.952,1810,1.788,1811,1.724,1812,1.863,1813,6.145,1814,3.096,1815,2.443,1816,2.065,1817,2.065,1818,2.065,1819,2.215,1820,2.215,1821,2.065,1822,2.972,1823,2.215,1824,2.215,1825,2.215,1826,2.065,1827,1.952,1828,2.215,1829,2.215,1830,2.215,1831,2.065,1832,2.065,1833,1.668,1834,2.443,1835,2.616]],["t/222",[74,0.516,198,1.615,241,2.227,342,3.166,476,2.879,832,3.761,1394,4.857,1400,6.196,1693,3.642,1717,4.601,1800,5.366,1806,4.723,1808,5.59,1809,5.859,1810,5.366,1811,5.174,1812,5.59,1813,6.196,1836,6.648,1837,7.333]],["t/224",[74,0.525,491,5.789,897,4.669,1790,6.205,1792,5.617,1836,7.687]],["t/226",[45,1.51,74,0.514,125,2.585,1728,6.146,1805,6.81,1838,6.81,1839,6.81]],["t/228",[2,2.608,8,0.94,18,2.268,24,2.912,26,3.052,38,2.397,44,2.695,45,0.716,52,1.037,56,2.614,61,1.349,63,1.96,74,0.288,79,2.144,83,2.88,109,2.926,142,2.397,144,3.72,150,1.877,156,1.928,160,1.483,167,2.793,170,2.795,177,2.475,198,1.277,241,1.16,255,2.188,321,2.974,324,4.014,331,4.077,335,2.608,342,1.65,344,2.285,406,3.321,427,2.338,434,4.642,493,3.463,513,2.912,534,2.608,820,2.695,846,7.076,857,3.463,950,2.912,1063,1.683,1109,2.912,1117,3.55,1146,2.695,1376,3.463,1379,3.463,1382,3.463,1392,3.228,1402,3.228,1437,2.912,1444,3.052,1498,3.052,1590,4.243,1727,2.912,1758,3.228,1840,3.82,1841,7.008,1842,3.82,1843,3.82,1844,3.82,1845,3.82,1846,3.82,1847,3.228,1848,3.82,1849,3.228,1850,3.228,1851,3.82,1852,3.82,1853,3.82,1854,3.82,1855,3.82,1856,3.82,1857,3.463,1858,3.82,1859,3.82,1860,3.82,1861,3.82,1862,3.82,1863,3.228]],["t/230",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/232",[6,3.061,7,1.616,8,2.123,13,3.061,45,1.26,47,2.424,52,1.826,73,0.984,74,0.538,97,2.306,125,2.157,127,2.873,160,2.612,198,1.9,227,3.981,1063,1.616,1467,2.942,1667,3.147,1673,3.776,1864,6.727,1865,6.727,1866,6.727,1867,5.684]],["t/234",[18,1.455,49,1.27,50,1.193,52,2.301,56,2.677,73,1.13,74,0.538,99,2.645,105,1.289,109,3.303,115,1.604,119,3.069,150,1.455,177,2.994,198,1.7,235,1.262,241,1.365,291,1.39,331,3.756,342,1.941,393,1.69,428,4.468,487,2.645,846,6.773,1052,2.791,1063,1.572,1084,2.288,1085,2.046,1242,3.799,1390,2.895,1402,6.521,1590,3.29,1863,5.531,1867,3.799,1868,5.933,1869,4.496]],["t/236",[49,1.35,50,1.393,73,1.054,74,0.546,105,1.504,198,1.586,476,2.828,487,3.089,1693,3.578,1863,6.087,1867,6.087,1868,6.53,1870,7.203,1871,6.53,1872,6.53]],["t/238",[74,0.538,331,3.68,342,3.587,491,5.671,846,6.637,1871,7.53,1873,8.307]],["t/240",[8,2.065,45,1.572,75,5.405,177,2.964,889,5.921,1063,2.016,1434,6.141,1523,5.921,1874,7.608]],["t/242",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/244",[6,2.723,7,1.437,8,1.966,13,2.723,45,1.497,47,2.157,52,1.624,74,0.531,79,3.359,97,2.051,125,1.919,127,2.661,148,2.249,160,2.324,198,1.76,227,3.687,322,2.761,334,2.972,1063,1.92,1467,2.617,1667,2.8,1673,3.359,1874,5.425,1875,5.984,1876,7.992,1877,7.992,1878,5.984,1879,5.425,1880,5.984,1881,5.984,1882,5.984,1883,5.425,1884,5.984]],["t/246",[18,2.635,74,0.534,408,2.995,476,3.196,1885,8.14,1886,8.14,1887,8.14,1888,8.14,1889,8.14]],["t/248",[74,0.526,75,5.771,198,2.157,291,2.207,393,2.683,1041,4.45,1052,3.045,1063,1.715,1434,6.557,1670,5.485,1879,8.123,1883,8.123,1890,8.123]],["t/250",[198,2.015]],["t/252",[8,2.023,48,2.764,200,3.265,277,5.184,334,4.084,1063,2.346,1891,8.805]],["t/254",[49,1.162,71,0.926,74,0.469,88,1.78,198,1.707,1063,1.862,1315,3.912,1368,6.194,1395,3.188,1471,5.135,1545,5.47,1892,7.752,1893,6.551,1894,7.752]],["t/256",[6,1.959,7,1.034,8,1.56,13,1.959,45,1.188,47,1.552,48,2.132,49,0.95,50,0.98,62,3.151,73,0.928,74,0.541,83,3.149,88,1.197,96,3.573,105,1.059,108,1.188,125,1.381,127,2.111,129,1.23,133,3.709,152,2.636,160,1.672,175,3.903,198,0.948,200,1.71,207,3.282,227,1.986,235,1.209,240,3.257,277,3.366,322,1.986,326,2.285,329,2.173,467,2.106,1056,3.282,1063,1.034,1180,2.246,1244,2.701,1309,3.903,1368,5.067,1437,4.834,1467,1.883,1471,4.2,1667,2.015,1756,2.575,1770,3.151,1891,6.36,1893,5.358,1895,4.305,1896,5.358,1897,3.903,1898,3.903,1899,3.903,1900,5.748,1901,3.903,1902,3.903,1903,4.305,1904,3.903]],["t/258",[43,2.659,45,0.794,49,0.635,50,0.655,52,2.237,73,0.917,74,0.548,88,1.738,97,2.148,99,2.557,105,0.708,115,1.512,133,2.479,177,2.91,198,1.643,235,1.19,240,3.505,245,2.073,277,4.374,278,2.379,291,1.31,331,1.878,393,1.593,449,4.94,454,3.231,467,2.073,487,1.453,1052,2.673,1063,1.505,1084,2.191,1085,1.929,1362,2.479,1368,5.008,1697,3.581,1800,3.101,1891,5.296,1893,3.581,1897,3.842,1898,3.842,1899,6.761,1900,3.842,1905,3.842,1906,3.386,1907,3.581,1908,3.842,1909,4.238,1910,4.238,1911,3.842,1912,3.842,1913,4.238]],["t/260",[74,0.509,198,1.741,235,2.219,240,2.908,476,3.103,1084,2.763,1693,3.925,1906,6.315,1907,6.678,1908,7.164,1911,7.164,1912,7.164,1914,7.903]],["t/262",[3,0.895,45,1.182,74,0.459,88,1.191,97,2.163,115,2.251,198,1.39,200,2.505,240,2.321,277,4.903,1060,4.063,1063,1.515,1085,2.871,1348,4.81,1351,5.72,1471,4.179,1500,5.331,1756,3.773,1790,6.056,1800,4.617,1805,5.331,1806,4.063,1808,4.81,1826,5.331,1896,5.331,1901,5.72,1902,5.72,1906,6.613,1907,5.331,1915,5.72,1916,5.72,1917,5.72,1918,6.309,1919,6.309,1920,6.309]],["t/264",[6,3.528,8,1.907,67,5.47,79,4.352,116,3.481,167,3.735,290,3.791,408,2.852,827,4.864,848,4.636,854,5.91,1063,1.862,1453,7.028,1506,6.194,1921,7.752,1922,7.752,1923,7.752]],["t/266",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/268",[6,2.421,7,1.278,8,1.815,13,2.421,45,0.996,47,1.917,49,1.105,50,1.14,52,1.444,73,1.08,74,0.545,97,1.823,105,1.232,115,1.897,125,1.706,127,2.456,129,2.107,130,4.225,131,3.607,160,2.065,198,1.624,227,3.403,241,2.24,408,2.714,854,5.623,1063,1.278,1364,4.25,1467,2.326,1667,2.489,1673,2.986,1924,5.319,1925,5.319,1926,6.687,1927,5.319,1928,7.376,1929,5.319,1930,5.319]],["t/270",[45,1.478,48,1.572,49,0.701,50,0.723,52,1.269,56,1.813,74,0.538,76,3.454,99,1.603,105,0.781,115,1.668,177,1.652,198,1.738,235,1.313,245,3.86,256,3.098,291,1.446,393,1.758,487,2.309,827,4.225,854,6.582,937,4.225,946,3.422,1052,2.872,1063,1.618,1084,2.355,1085,2.128,1134,3.952,1362,3.94,1364,7.615,1365,6.105,1506,3.737,1686,3.193,1700,3.3,1737,5.134,1931,4.677,1932,4.677,1933,4.677,1934,6.105,1935,4.677,1936,4.24,1937,4.677,1938,4.677,1939,4.677,1940,3.952,1941,3.737,1942,4.677]],["t/272",[74,0.492,198,1.848,235,2.356,476,3.295,1064,3.67,1084,2.934,1364,6.706,1693,4.168]],["t/274",[8,1.804,18,2.949,61,2.59,125,2.352,127,2.442,148,2.756,167,3.533,189,4.489,343,4.29,359,4.601,889,5.174,1063,1.761,1089,4.386,1391,4.038,1549,4.723,1726,5.59,1847,6.196,1943,6.648,1944,6.648,1945,7.333,1946,6.196,1947,6.648]],["t/276",[71,0.879,467,4.375,1395,3.678]],["t/278",[6,2.258,7,1.192,8,1.728,13,2.258,45,1.316,47,1.788,49,0.743,50,0.767,73,0.726,74,0.524,75,3.196,105,0.829,125,1.591,127,2.339,129,1.417,137,2.842,138,2.682,148,1.865,160,1.927,227,2.289,300,3.038,321,2.545,342,3.522,445,7.91,476,2.758,477,3.631,889,3.501,1063,1.192,1243,3.965,1467,2.17,1667,2.322,1943,6.369,1947,4.498,1948,4.962,1949,4.962,1950,4.962,1951,4.962,1952,4.962,1953,4.962,1954,4.962,1955,4.962,1956,4.962,1957,4.672,1958,4.962,1959,4.962,1960,7.026,1961,7.026,1962,4.962,1963,4.962,1964,4.962,1965,4.962,1966,4.962]],["t/280",[49,1.06,50,1.094,52,1.921,74,0.536,99,2.426,105,1.182,115,2.525,177,2.5,198,2.148,235,1.987,291,2.188,393,2.66,487,2.426,1052,3.8,1063,2.14,1084,3.116,1085,3.221]],["t/282",[74,0.498,198,1.887,235,2.406,476,3.365,1084,2.996,1693,4.256]],["t/284",[8,1.552,28,4.307,30,3.614,45,1.182,52,1.713,56,2.486,97,2.163,189,3.862,211,2.871,214,2.625,273,3.184,322,2.911,324,3.614,334,3.134,407,3.41,827,3.958,882,3.958,1063,2.355,1085,2.871,1348,4.81,1458,5.331,1504,5.72,1525,4.452,1814,4.81,1967,8.889,1968,6.309,1969,5.331,1970,6.994,1971,6.309,1972,6.309,1973,6.309,1974,6.309]],["t/286",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/288",[6,3.061,7,1.616,8,2.123,13,3.061,45,1.26,47,2.424,52,1.826,74,0.517,97,2.306,125,2.157,127,2.873,160,2.612,191,3.24,198,1.9,211,3.061,227,3.981,1063,1.616,1467,2.942,1667,3.147,1673,3.776,1970,7.29,1975,6.727,1976,6.727,1977,6.727]],["t/290",[3,0.656,49,0.693,50,0.715,52,2.473,61,1.633,74,0.554,88,1.48,99,1.585,105,0.772,107,4.192,108,1.276,115,1.649,122,4.192,148,1.738,177,3.353,191,3.218,198,1.727,201,3.383,211,3.04,235,1.875,241,1.404,291,1.429,393,1.738,408,1.701,427,2.83,443,2.978,487,1.585,827,4.191,1038,3.694,1052,3.344,1063,1.604,1084,2.335,1085,2.104,1413,3.907,1505,4.192,1709,5.092,1967,7.109,1970,3.907,1978,4.192,1979,7.258,1980,4.192,1981,4.192]],["t/292",[74,0.509,191,3.807,198,1.741,201,5.783,211,3.596,235,2.219,443,5.09,476,3.103,1084,2.763,1693,3.925,1709,6.025,1981,7.164,1982,7.903]],["t/294",[8,1.726,48,2.359,60,4.019,74,0.441,83,3.485,108,1.937,115,2.503,148,3.331,177,2.478,189,4.295,191,3.38,196,4.79,211,3.193,406,4.019,449,4.648,1037,4.196,1063,1.685,1117,4.295,1145,3.724,1214,4.105,1391,3.863,1437,5.349,1469,6.361,1979,5.929,1983,7.017,1984,7.017]],["t/296",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/298",[6,2.537,7,1.339,8,1.874,13,2.537,20,4.778,45,1.626,47,2.009,74,0.501,97,1.911,115,1.989,125,1.788,127,2.537,135,4.079,160,2.164,171,4.363,198,1.678,227,2.572,322,2.572,358,4.079,422,3.933,1003,3.412,1031,4.249,1056,4.249,1063,1.339,1079,3.805,1088,5.053,1117,3.412,1338,3.692,1434,4.079,1467,2.438,1667,2.608,1673,3.129,1985,3.933,1986,7.618,1987,7.618,1988,5.053,1989,5.574,1990,4.71,1991,5.053,1992,3.069,1993,5.574,1994,5.053,1995,5.574]],["t/300",[7,1.177,20,2.699,47,1.767,71,0.482,74,0.533,102,3.737,115,1.749,125,1.572,126,2.798,127,1.632,128,2.04,135,3.587,150,1.587,171,3.99,190,6.474,191,3.903,196,4.755,211,3.17,359,4.37,407,2.649,476,2.735,490,3.347,882,4.37,1031,3.737,1102,3.587,1129,2.649,1187,3.737,1551,3.737,1802,3.587,1985,3.459,1990,4.142,1991,8.448,1994,4.444,1996,4.902,1997,4.902,1998,4.444,1999,4.902,2000,6.965,2001,6.314,2002,4.902,2003,5.097,2004,4.902,2005,4.902,2006,4.902,2007,5.886,2008,4.902,2009,4.902,2010,4.902]],["t/302",[7,1.777,47,2.667,71,0.727,74,0.542,125,2.373,126,3.68,127,2.464,128,3.079,171,4.239,1129,3.999,1985,5.221,2003,5.415,2011,7.4,2012,7.4,2013,5.913,2014,7.4]],["t/304",[7,1.746,47,2.619,71,0.714,74,0.539,125,2.331,126,3.639,127,2.42,128,3.024,171,4.163,1054,6.141,1129,3.928,1985,5.128,2003,5.318,2013,5.807,2015,7.267,2016,7.267,2017,7.267,2018,7.267]],["t/306",[7,1.777,47,2.667,71,0.727,74,0.542,125,2.373,126,3.68,127,2.464,128,3.079,171,4.239,1129,3.999,1985,5.221,2003,5.415,2013,5.913,2019,7.4,2020,7.4,2021,7.4]],["t/308",[7,1.761,20,4.038,47,2.643,71,0.72,74,0.54,125,2.352,126,3.66,127,2.442,128,3.051,171,4.2,1129,3.963,1985,5.174,2003,5.366,2013,5.859,2022,7.333,2023,7.333,2024,7.333]],["t/310",[7,1.481,20,3.395,45,1.155,47,2.222,71,0.606,74,0.55,99,2.114,125,1.977,126,3.274,127,2.053,128,2.566,171,3.532,233,3.71,235,1.731,236,5.21,331,2.732,438,3.332,1089,3.688,1102,4.512,1129,3.332,1985,4.35,2003,4.512,2025,6.166,2026,6.166,2027,6.166,2028,6.166,2029,6.166,2030,6.166,2031,6.166,2032,8.152,2033,6.166]],["t/312",[18,1.723,20,1.882,43,2.145,45,1.225,48,2.198,49,0.798,50,0.528,52,2.483,74,0.56,88,1.393,99,1.172,105,0.571,108,1.47,115,1.22,135,3.896,148,1.285,171,3.05,177,3.124,189,2.093,191,4.081,196,4.464,198,1.44,235,1.495,241,1.617,257,2.606,290,1.672,291,1.646,321,1.754,322,1.577,326,1.815,338,1.44,343,2,393,1.285,406,1.958,408,1.959,427,2.093,487,1.825,827,2.145,882,2.145,1003,3.259,1031,2.606,1037,2.045,1052,3.147,1063,1.279,1064,1.495,1068,3.099,1071,3.099,1079,3.635,1080,2.045,1081,2.889,1084,1.861,1085,1.556,1979,4.499,1980,3.099,1988,3.099,1990,2.889,2001,3.099,2007,4.499,2034,3.419,2035,3.419,2036,3.419,2037,2.264,2038,3.419,2039,3.419,2040,3.099,2041,3.419]],["t/314",[74,0.522,135,5.567,171,4.357,198,1.675,235,2.617,321,3.902,476,2.987,1003,4.657,1031,5.799,1064,3.327,1079,5.193,1084,2.66,1693,3.778,2007,6.428,2040,6.896]],["t/316",[7,2.016,18,2.716,108,2.317,241,2.548,942,5.921,1063,2.016,1523,5.921,2042,8.392,2043,7.091]],["t/318",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/320",[7,1.7,47,2.551,49,1.06,50,1.094,71,0.695,73,1.036,74,0.544,105,1.182,125,2.27,126,3.579,127,2.357,128,2.945,129,2.021,132,4.233,136,4.558,1180,3.692,1957,4.054,2044,7.078,2045,7.078,2046,5.981]],["t/322",[39,2.025,43,1.736,48,3.41,52,2.753,74,0.554,88,1.805,99,0.949,109,1.396,147,2.211,164,2.025,177,3.611,198,1.252,214,1.152,235,0.777,256,2.98,291,0.856,321,2.308,338,1.166,342,1.195,393,1.04,427,1.694,487,2.245,859,2.338,887,4.844,897,3.13,898,2.509,899,5.233,900,1.889,901,6.532,946,2.025,1018,2.509,1019,2.509,1052,1.919,1063,1.081,1064,2.487,1084,1.573,1085,1.259,1190,2.338,1467,1.21,2047,4.079,2048,4.079,2049,2.509,2050,4.079,2051,4.079,2052,2.767,2053,4.499,2054,4.499,2055,4.499,2056,4.499,2057,4.499,2058,5.154,2059,2.767,2060,2.767,2061,2.767,2062,2.509,2063,2.509,2064,2.509,2065,2.509,2066,2.509,2067,2.509,2068,2.509,2069,2.509,2070,2.509,2071,2.509]],["t/324",[43,4.365,74,0.438,198,1.532,256,5.838,321,3.568,342,3.004,476,2.731,859,5.878,887,5.53,932,6.307,1693,3.455,2047,6.307,2048,6.307,2049,6.307,2050,6.307,2051,6.307,2058,6.307,2062,6.307,2063,6.307,2064,6.307,2065,6.307,2067,6.307,2068,6.307,2069,6.307,2070,6.307,2071,6.307]],["t/326",[1,3.312,3,0.931,8,1.615,30,3.76,56,1.767,63,3.367,74,0.422,109,3.312,144,3.484,155,3.614,167,3.162,240,2.415,241,1.993,256,4.347,895,3.926,1063,1.576,1347,5.95,1407,5.245,1413,5.546,1726,6.474,2072,7.176,2073,6.564,2074,6.564,2075,5.95,2076,5.546,2077,6.564,2078,5.546,2079,6.564,2080,6.564,2081,6.564,2082,5.245,2083,5.546,2084,6.564]],["t/328",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/330",[6,3.495,7,1.844,8,2.306,13,3.495,45,1.438,47,2.768,74,0.466,125,2.463,127,3.121,160,2.982,227,3.543,1063,1.844,1467,3.359,1667,3.593,2085,7.679]],["t/332",[2086,9.147]],["t/334",[74,0.541,841,6.776,1708,5.789,2087,8.48,2088,7.687]],["t/336",[18,1.192,28,3.849,49,0.552,50,0.569,52,2.466,56,0.991,62,2.694,73,0.539,74,0.548,76,1.889,88,1.064,99,2.632,105,0.615,115,1.313,150,1.192,169,2.027,177,3.208,198,1.509,200,1.462,235,1.034,240,3.045,241,2.513,291,1.138,319,2.807,331,1.631,393,1.384,408,2.074,418,2.067,487,1.262,841,5.474,887,2.31,897,2.027,1052,2.921,1063,1.645,1084,1.971,1085,2.566,1325,3.111,1338,2.439,1427,3.631,1471,2.439,1545,2.598,1590,2.694,1688,3.111,1691,1.801,1707,2.694,1708,2.514,1728,3.846,1729,2.807,2072,7.376,2089,5.111,2090,5.111,2091,3.682,2092,2.942,2093,3.338,2094,3.111,2095,5.111,2096,3.682,2097,6.211,2098,5.638]],["t/338",[18,1.54,29,5.199,44,3.358,45,0.891,49,1.194,50,0.736,56,1.281,70,4.812,73,0.696,74,0.546,88,0.898,105,0.795,108,1.882,150,1.54,198,1.048,235,2.444,240,1.751,331,3.021,476,1.869,477,4.99,487,1.631,841,3.802,897,2.62,911,6.182,1063,1.143,1084,1.664,1085,2.166,1590,3.482,1666,3.802,1693,3.958,1707,3.482,1708,3.249,1728,2.671,1872,4.314,2072,4.021,2089,4.314,2090,4.314,2093,6.182,2094,4.021,2095,4.314,2097,4.314,2099,4.759,2100,7.97,2101,7.97,2102,4.759,2103,4.021,2104,4.314,2105,4.759,2106,6.182]],["t/340",[240,3.682,308,7.241,322,3.954,821,6.046,1063,2.058,1835,5.519]],["t/342",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/344",[1,3.516,3,0.817,7,0.909,8,0.931,47,1.364,49,1.044,50,0.89,71,0.566,73,0.843,74,0.548,76,1.941,79,2.125,88,0.714,105,0.632,115,1.35,116,1.699,125,1.214,126,2.313,127,1.26,128,1.575,129,1.081,132,2.263,136,4.488,137,2.168,140,1.393,149,2.084,199,1.91,235,1.063,240,3.082,277,3.056,324,2.168,334,1.88,342,1.634,409,2.67,476,1.486,487,1.297,613,3.198,821,4.062,1041,1.88,1052,2.455,1063,0.909,1064,1.655,1180,1.974,1665,5.568,1689,2.769,1806,2.437,1957,3.991,2107,3.198,2108,3.198,2109,3.198,2110,3.198,2111,5.219,2112,5.219,2113,5.219,2114,3.431,2115,3.198,2116,3.198,2117,4.865,2118,3.198,2119,3.198,2120,3.198,2121,5.219,2122,3.431,2123,3.431,2124,3.431,2125,3.198,2126,5.757,2127,3.431,2128,3.198,2129,3.785,2130,3.431,2131,3.785,2132,4.865,2133,3.785,2134,3.785]],["t/346",[7,0.76,45,0.593,47,1.141,49,1.287,50,1.192,71,0.611,73,1.036,74,0.558,76,1.624,77,1.711,79,3.493,88,0.946,99,1.085,105,1.039,115,1.788,125,1.015,126,2.013,127,1.054,128,1.317,129,0.904,132,1.893,136,2.039,146,2.234,198,0.697,235,0.889,240,1.165,277,2.661,342,1.367,438,1.711,476,1.243,487,1.718,821,6.473,937,1.986,1047,1.68,1064,2.192,1084,1.107,1132,2.675,1243,2.53,1398,2.675,1689,2.317,1756,2.998,1806,2.039,1957,3.564,2046,2.675,2107,2.675,2108,2.675,2109,2.675,2110,2.675,2111,5.641,2112,5.641,2113,5.641,2114,2.87,2115,2.675,2116,2.675,2117,4.235,2118,2.675,2119,2.675,2120,2.675,2121,2.87,2122,2.87,2123,2.87,2124,2.87,2125,4.235,2127,4.544,2128,4.235,2135,3.166,2136,2.87,2137,5.012,2138,3.166,2139,5.012,2140,3.166,2141,3.166,2142,3.166,2143,3.166,2144,2.87,2145,3.166,2146,3.166,2147,3.166,2148,3.166,2149,2.87,2150,3.166,2151,3.166,2152,3.166]],["t/348",[7,1.051,47,1.577,49,1.254,50,1.174,71,0.43,73,1.112,74,0.56,76,2.244,77,2.364,79,3.602,88,0.826,105,1.269,109,2.208,115,1.561,125,1.403,126,2.577,127,1.457,128,1.821,129,1.25,132,2.617,136,2.818,235,1.228,240,2.795,241,1.328,342,1.889,487,1.5,491,2.987,818,3.201,821,5.904,1064,1.913,1896,5.422,1957,3.675,2046,3.697,2107,3.697,2108,3.697,2109,3.697,2110,3.697,2115,3.697,2116,3.697,2117,5.422,2118,3.697,2119,3.697,2120,3.697,2125,3.697,2128,3.697,2149,3.966,2153,6.416,2154,6.416,2155,4.375,2156,4.375,2157,3.697,2158,4.375]],["t/350",[45,1.324,48,2.377,52,2.417,56,1.043,59,3.677,73,0.858,74,0.55,76,4.043,88,1.598,97,1.328,99,2.702,156,2.958,164,4.289,177,3.145,198,1.557,235,1.646,240,3.276,241,1.177,278,2.175,291,1.198,393,1.456,487,2.009,616,3.096,818,2.835,832,1.988,1052,3.61,1063,1.408,1084,2.049,1085,1.763,1394,3.882,1395,1.593,1467,1.695,1666,4.683,1691,1.895,1792,3.882,1799,2.835,1806,3.775,1816,3.274,1817,3.274,1818,3.274,1819,3.513,1820,3.513,1821,3.274,2157,3.274,2159,5.313,2160,3.875,2161,3.513,2162,3.875,2163,5.313,2164,3.875]],["t/352",[1,3.184,49,1.384,50,1.279,73,1.352,74,0.548,105,1.382,198,1.39,233,3.766,240,2.321,241,1.916,476,2.477,832,3.236,1114,4.179,1394,4.179,1693,3.134,1792,4.179,1799,4.617,1806,4.063,2157,5.331,2159,5.72,2163,5.72,2165,6.309,2166,6.309,2167,6.309,2168,6.309]],["t/354",[1,4.013,3,0.843,6,2.703,8,1.462,28,4.056,45,1.679,52,2.159,56,1.599,68,3.636,79,3.335,81,3.727,125,1.905,137,3.403,144,3.153,146,4.192,201,4.347,306,4.747,331,2.632,334,3.95,347,2.533,848,3.553,1053,3.826,1063,2.153,1117,3.636,1327,5.611,1432,4.192,1450,5.02,1523,4.192,1727,4.529,1728,3.335,1758,5.02,1801,6.355,1802,4.347,2169,5.941,2170,5.02,2171,5.941,2172,5.385,2173,5.941,2174,5.941,2175,5.941]],["t/356",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/358",[6,2.436,7,1.286,8,1.823,13,2.436,45,1.003,47,1.93,49,1.273,50,1.313,52,1.453,73,0.784,74,0.546,88,1.011,97,1.835,105,1.419,125,1.717,127,2.467,160,2.079,198,1.632,227,3.419,443,3.448,487,1.835,832,2.746,879,3.778,1063,1.286,1076,4.082,1084,1.872,1370,3.778,1467,2.342,1667,2.505,1673,3.006,1707,3.918,1717,3.359,1728,3.006,2176,5.354,2177,5.354,2178,4.524,2179,4.524,2180,3.778,2181,5.354,2182,4.524,2183,5.354,2184,5.354]],["t/360",[3,0.836,45,1.105,56,2.13,74,0.521,81,3.7,159,4.316,239,3.247,406,3.378,443,3.798,832,4.059,1053,3.798,1076,4.496,1205,6.687,1463,3.906,1508,4.161,1707,4.316,1737,4.496,1992,3.247,2178,4.983,2180,4.161,2185,4.983,2186,8.098,2187,7.914,2188,5.897,2189,4.983,2190,5.897,2191,5.897,2192,7.914,2193,5.897,2194,5.897,2195,7.175,2196,7.914,2197,7.914,2198,5.897]],["t/362",[3,0.435,28,3.34,45,1.142,49,0.914,50,0.942,52,2.527,56,1.872,62,2.247,73,0.449,74,0.558,88,0.923,97,1.677,99,1.052,105,1.018,108,1.35,109,1.549,115,2.175,116,1.379,164,2.247,177,1.084,198,1.343,235,0.862,240,1.13,269,2.166,291,0.949,324,1.759,329,1.549,332,3.24,334,1.525,338,1.293,342,1.326,344,1.836,347,1.309,393,1.838,408,1.13,409,2.166,416,2.096,418,1.724,443,3.151,445,4.134,467,1.502,487,2.09,613,4.134,694,2.783,698,2.341,832,2.509,895,1.836,1052,2.086,1063,1.67,1064,2.139,1080,1.836,1084,1.71,1085,1.397,1327,4.302,1344,2.096,1362,1.796,1370,3.452,1395,1.262,1427,1.977,1545,2.166,1691,3.401,1695,3.729,1708,2.096,1717,3.069,1724,2.783,1727,2.341,1728,2.746,1729,2.341,1915,4.435,2037,2.034,2182,4.134,2185,2.594,2186,2.783,2189,4.134,2195,2.783,2199,3.07,2200,2.783,2201,3.07,2202,2.783,2203,2.783,2204,2.783,2205,3.07,2206,3.07]],["t/364",[49,1.293,50,1.334,73,0.984,74,0.538,88,1.27,105,1.441,198,1.481,342,2.905,443,4.332,476,2.641,698,5.128,832,3.45,1064,3.773,1370,4.746,1693,3.341,1708,4.592,1717,4.22,2182,5.684,2189,5.684,2202,6.098,2203,6.098,2204,6.098,2207,6.727]],["t/366",[45,1.51,74,0.514,125,2.585,1728,6.146,1838,6.81,1839,6.81,2178,6.81]],["t/368",[8,2.108,18,2.774,407,4.631,409,6.046,1063,2.058,1525,6.046,2208,8.569]],["t/370",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/372",[6,1.408,7,0.743,8,1.211,13,1.408,38,1.941,44,2.183,45,0.58,47,1.115,49,0.464,50,0.761,52,1.336,56,0.833,67,2.183,73,0.453,74,0.549,88,0.584,97,2.394,105,0.517,115,1.104,116,1.389,125,0.992,127,1.639,137,1.772,140,1.138,150,1.984,160,1.201,168,2.472,177,1.093,191,3.365,198,1.35,212,0.819,227,2.271,233,2.789,235,0.869,243,2.049,245,1.513,255,1.772,331,1.371,338,1.303,407,3.775,422,3.472,471,3.143,971,2.049,1026,3.36,1063,1.182,1074,2.264,1089,2.943,1146,2.183,1190,2.614,1251,2.049,1311,2.805,1334,2.472,1371,2.264,1442,2.614,1467,1.353,1509,3.26,1549,4.498,1602,2.805,1667,1.448,1673,1.737,2082,2.472,2209,2.805,2210,2.183,2211,3.094,2212,2.805,2213,2.805,2214,2.805,2215,3.094,2216,8.514,2217,2.805,2218,3.932,2219,2.805,2220,2.805,2221,4.159,2222,3.094,2223,3.094,2224,5.178,2225,5.178,2226,3.094,2227,2.805,2228,2.805,2229,2.614,2230,3.094,2231,3.094,2232,3.094,2233,3.094,2234,3.094,2235,2.805,2236,3.094,2237,3.094,2238,3.094,2239,2.805,2240,2.805,2241,2.805,2242,3.094,2243,2.805,2244,3.094,2245,3.094,2246,2.805,2247,3.094,2248,3.094,2249,2.614]],["t/374",[44,3.57,49,0.48,50,0.969,52,2.5,56,0.862,73,0.469,74,0.551,81,2.01,88,1.629,97,1.098,99,1.734,105,0.845,115,1.143,150,1.037,153,2.344,172,1.499,177,3.048,198,1.381,212,0.848,226,1.961,235,1.42,245,1.567,291,1.564,324,1.835,329,1.616,331,1.419,338,1.349,393,1.204,407,4.191,411,2.707,413,2.904,418,1.798,471,1.643,487,2.441,703,2.26,895,3.026,1001,2.344,1026,3.454,1041,1.591,1052,3.307,1063,1.215,1064,1.401,1084,1.769,1085,1.458,1281,1.478,1334,2.56,1423,2.187,1509,4.717,1549,3.258,1916,2.904,2078,2.707,2218,2.56,2224,4.275,2225,4.275,2228,2.904,2229,2.707,2235,2.904,2239,2.904,2240,2.904,2241,2.904,2243,4.586,2246,2.904,2249,4.275,2250,3.203,2251,5.059,2252,2.122,2253,3.203,2254,3.203,2255,2.904,2256,3.203,2257,3.203,2258,4.586,2259,2.904,2260,3.203,2261,2.904,2262,3.203,2263,3.203,2264,3.203,2265,3.203,2266,3.203,2267,3.203]],["t/376",[44,4.994,74,0.485,150,2.291,198,1.559,235,2.502,411,5.981,471,3.63,476,2.779,703,4.994,895,4.233,1064,3.096,1084,2.475,1423,4.832,1509,4.688,1549,4.558,1693,3.515,2218,5.655,2224,5.981,2225,5.981,2249,5.981,2252,4.688,2255,6.416,2258,6.416,2261,6.416]],["t/378",[45,0.62,56,2.352,63,1.697,73,0.484,74,0.57,75,2.13,140,1.217,148,1.243,150,1.071,172,1.548,211,1.505,237,3.339,241,2.201,277,2.754,278,2.912,295,2.13,300,3.919,408,2.355,471,2.661,491,2.258,895,1.978,922,2.521,1028,2.998,1251,2.191,1334,2.643,1371,3.797,1423,2.258,1525,2.334,1992,1.821,2170,2.795,2221,2.795,2252,2.191,2268,3.308,2269,3.308,2270,3.308,2271,3.308,2272,3.308,2273,5.188,2274,3.308,2275,3.308,2276,3.308,2277,3.308,2278,3.308,2279,3.308,2280,3.308,2281,3.308,2282,3.308,2283,6.402,2284,4.703,2285,3.308,2286,3.308,2287,3.308,2288,3.308,2289,3.308,2290,3.308,2291,3.308,2292,3.308,2293,3.308,2294,2.795,2295,3.308,2296,3.308,2297,3.308,2298,3.308,2299,3.308,2300,3.308,2301,3.308,2302,3.308,2303,3.308,2304,3.308,2305,3.308,2306,3.308,2307,3.308,2308,3.308,2309,3.308,2310,3.308,2311,3.308,2312,3.308,2313,3.308,2314,3.308,2315,3.308,2316,3.308,2317,3.308,2318,3.308]],["t/380",[1,3.912,8,1.907,11,4.864,12,5.91,66,7.028,67,5.47,167,3.735,471,3.976,944,6.551,1063,1.862,1145,4.115,1700,5.47,2319,9.21,2320,6.551,2321,7.752]],["t/382",[71,0.879,467,4.375,1395,3.678]],["t/384",[1,2.616,6,2.359,7,1.245,8,1.782,13,2.359,45,0.971,47,1.868,49,0.777,52,1.407,67,3.657,74,0.522,97,1.777,125,1.662,127,2.412,139,4.798,146,3.657,160,2.013,198,1.596,227,3.342,345,3.539,838,3.433,882,3.252,897,2.854,1063,2.006,1216,6.568,1467,2.267,1667,2.425,1673,2.91,1957,2.969,2221,4.38,2320,7.641,2322,5.183,2323,7.245,2324,5.183,2325,3.793,2326,7.245,2327,5.183,2328,3.951,2329,5.183,2330,5.183,2331,5.183,2332,5.183,2333,4.699,2334,5.183,2335,5.183,2336,5.183,2337,5.183,2338,5.183]],["t/386",[1,2.023,8,0.986,45,1.126,49,0.601,50,0.62,52,2.539,74,0.555,88,1.621,97,1.374,99,1.374,105,0.669,115,1.43,139,2.655,148,3.013,177,3.303,198,1.589,199,2.023,211,2.736,235,1.125,291,1.239,335,2.737,393,1.506,418,2.25,428,2.737,487,2.061,611,2.933,889,2.828,946,2.933,1003,2.454,1041,2.986,1052,2.564,1063,1.444,1064,1.753,1080,2.397,1084,2.102,1085,1.824,1410,3.056,1550,3.203,1833,2.737,2319,5.451,2320,3.387,2325,4.4,2339,5.451,2340,4.008,2341,3.634,2342,3.634,2343,3.056,2344,4.008,2345,3.634,2346,5.451,2347,4.008,2348,5.451,2349,4.008,2350,5.451,2351,4.008,2352,4.008]],["t/388",[74,0.485,198,1.559,235,1.987,476,2.779,1003,4.333,1064,3.096,1084,2.475,1693,3.515,2325,5.179,2339,6.416,2342,6.416,2345,6.416,2346,6.416,2350,6.416,2353,8.911,2354,8.911,2355,8.911,2356,8.911,2357,8.911,2358,7.078]],["t/390",[8,1.741,18,2.884,61,2.5,125,2.27,127,2.357,148,2.66,167,3.41,189,4.333,331,3.136,359,4.441,877,5.981,1063,1.7,1089,4.233,1108,5.179,1391,3.897,1549,4.558,1726,5.396,1847,5.981,1944,6.416,1946,5.981,2359,8.911,2360,7.078,2361,7.078,2362,6.416,2363,5.981]],["t/392",[71,0.879,467,4.375,1395,3.678]],["t/394",[3,0.836,6,2.684,7,1.416,8,1.947,13,2.684,45,1.105,47,2.125,52,2.148,74,0.51,77,3.187,97,2.022,125,1.891,127,2.635,146,6.303,148,2.216,155,3.247,160,2.29,198,1.743,211,3.602,227,3.651,255,3.378,257,4.496,1037,5.342,1040,4.161,1063,1.416,1164,5.346,1467,2.579,1667,2.76,1673,3.311,2363,4.983,2364,5.897,2365,5.897,2366,5.897,2367,5.897,2368,5.897]],["t/396",[3,0.83,4,3.584,8,1.44,49,0.877,50,0.905,52,2.138,74,0.55,88,1.105,99,2.007,105,0.978,115,2.089,177,2.781,198,1.96,211,2.664,235,1.644,257,4.463,291,1.81,324,3.354,334,2.908,393,2.2,487,2.007,1037,5.323,1052,3.795,1063,1.892,1084,2.754,1085,2.664,1550,4.678,2363,4.948,2369,5.855,2370,5.855]],["t/398",[74,0.498,198,1.887,235,2.406,476,3.365,1084,2.996,1693,4.256]],["t/400",[8,2.086,56,2.283,109,4.279,155,4.669,167,4.085,820,7.018,1063,2.037]],["t/402",[18,3.11,24,2.606,30,4.853,50,1.141,56,2.381,71,0.899,73,1.08,74,0.455,88,1.727,96,1.623,144,4.695,155,1.882,160,1.327,167,1.647,198,0.753,203,2.732,239,5.67,327,2.732,338,1.44,408,3.254,415,3.429,416,2.334,418,1.919,442,4.827,444,2.202,879,2.412,900,2.334,1192,4.254,1200,4.499,1395,3.035,1443,5.525,1835,3.429,2200,3.099,2371,3.419,2372,3.419,2373,7.999,2374,3.419,2375,8.019,2376,3.419,2377,7.999,2378,3.419,2379,3.419,2380,3.419,2381,3.419,2382,2.889,2383,3.419,2384,3.419,2385,3.419,2386,3.419,2387,3.419,2388,2.889,2389,2.889,2390,3.419]],["t/404",[6,1.017,7,0.537,8,0.927,13,1.017,18,1.582,24,1.704,45,1.386,47,0.806,49,1.253,50,1.074,56,1.545,60,1.28,61,0.789,73,1.017,74,0.555,79,1.255,83,2.851,88,0.712,94,1.889,97,1.676,105,1.161,115,2.287,125,0.717,127,1.255,136,1.439,144,2.001,149,1.231,160,1.464,167,3.563,207,1.704,211,2.612,227,1.031,233,4.009,235,2.348,241,1.743,314,1.889,324,2.159,329,1.128,408,2.112,415,1.439,426,2.026,430,1.577,444,1.439,611,1.636,698,2.874,820,3.449,830,1.786,879,4.05,895,1.337,900,1.526,1013,1.889,1047,1.186,1056,1.704,1063,0.537,1076,1.704,1080,1.337,1082,1.786,1192,1.786,1303,1.889,1370,1.577,1371,1.636,1423,1.526,1443,4.131,1467,0.978,1479,1.636,1593,2.026,1667,1.046,1673,1.255,2375,2.026,2388,1.889,2389,1.889,2391,2.235,2392,2.235,2393,3.77,2394,2.235,2395,2.235,2396,2.235,2397,2.235,2398,3.77,2399,3.77,2400,3.77,2401,3.77,2402,2.235,2403,2.235,2404,2.235,2405,2.235,2406,2.235,2407,2.235,2408,2.235,2409,5.74,2410,6.41,2411,4.888,2412,2.235,2413,2.235,2414,2.235,2415,2.235,2416,2.026,2417,2.235,2418,3.77,2419,4.888,2420,4.888,2421,4.888,2422,1.889,2423,2.235,2424,2.026,2425,2.235]],["t/406",[3,0.475,18,1.696,43,2.101,45,1.209,49,0.502,50,0.518,52,1.981,56,1.737,74,0.551,86,5.452,88,0.632,97,1.148,99,1.148,105,0.559,108,0.924,109,2.643,115,1.194,144,4.822,167,3.516,177,2.577,198,1.744,235,1.812,241,1.591,269,3.696,277,1.777,291,1.035,319,4.919,326,1.777,329,1.69,334,1.663,338,2.206,342,1.446,344,2.003,393,1.258,408,1.927,415,4.7,418,1.88,433,4.749,434,2.218,436,2.363,487,1.148,820,2.363,1052,2.751,1063,1.258,1080,2.003,1082,4.186,1083,4.749,1084,1.831,1085,1.524,1109,2.553,1325,2.829,1327,2.363,1338,2.218,1395,2.154,1404,4.749,1445,3.696,1446,3.036,1447,4.749,1448,4.749,1449,3.036,1450,2.829,1451,3.036,1481,4.749,1482,2.675,2388,2.829,2389,2.829,2422,4.426,2426,3.348,2427,3.348,2428,3.348,2429,3.348,2430,3.348,2431,3.348]],["t/408",[74,0.48,198,1.775,235,2.901,415,5.191,476,3.165,1082,6.44,1084,2.818,1693,4.003,2422,6.81,2432,8.06]],["t/410",[8,2.003,110,7.38,427,4.983,431,6.504,1063,1.955,1208,5.957,1391,4.482,1394,5.392,2433,8.802,2434,6.879,2435,6.879]],["t/412",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/414",[6,3.011,7,1.589,8,2.1,13,3.011,45,1.24,47,2.385,50,1.023,52,1.796,73,1.249,74,0.526,105,1.105,125,2.122,127,2.843,129,1.89,160,2.569,198,1.457,227,3.939,1063,2.05,1467,2.894,1667,3.096,2434,5.592,2436,5.999,2437,5.999,2438,5.999,2439,6.617]],["t/416",[49,0.841,50,1.183,52,2.364,74,0.546,99,2.624,105,1.278,115,2.002,177,3.076,198,1.918,235,1.576,291,1.735,347,2.393,393,2.109,406,3.215,487,2.624,513,5.834,1052,3.714,1063,1.838,1064,2.455,1084,2.676,1085,2.554,1208,5.601,1391,4.214,2440,6.938,2441,6.938,2442,5.088,2443,4.485]],["t/418",[74,0.486,198,1.811,235,2.309,476,3.228,1064,3.596,1084,2.875,1693,4.084,2440,7.454,2441,7.454,2442,7.454]],["t/420",[8,2.201,444,5.762,1063,2.149]],["t/422",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/424",[7,1.406,47,2.11,49,1.18,50,1.217,57,4.463,71,0.575,73,1.153,74,0.553,105,1.315,125,1.878,126,3.164,127,1.95,128,2.436,130,3.354,131,2.863,132,3.502,187,4.678,467,2.863,591,4.948,1180,3.054,1670,3.584,1695,4.463,1957,4.511,2444,5.855,2445,5.855,2446,6.293,2447,5.308,2448,6.655,2449,5.308,2450,5.308,2451,5.308]],["t/426",[1,2.551,3,0.717,43,3.171,48,1.699,52,1.932,57,6.281,74,0.548,99,1.733,148,1.9,164,3.699,177,2.514,198,1.814,199,2.551,211,2.3,235,1.419,291,1.563,338,2.129,342,3.074,393,1.9,444,4.584,467,2.472,471,2.593,487,1.733,594,3.853,1003,3.094,1052,3.513,1063,1.71,1074,3.699,1084,1.767,1085,2.3,1243,4.039,1444,4.039,1670,3.094,1695,3.853,1756,3.023,1797,3.566,1814,3.853,2446,4.039,2452,4.582,2453,3.853,2454,5.055,2455,5.055,2456,5.055,2457,5.055,2458,5.055,2459,4.582,2460,5.055,2461,5.055]],["t/428",[74,0.498,198,1.887,476,3.365,1693,4.256,1695,6.532,2459,7.768]],["t/430",[8,2.131,255,4.961,408,3.186,1063,2.08,2462,7.318,2463,8.66]],["t/432",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/434",[6,2.871,7,1.515,8,2.036,13,2.871,45,1.182,47,2.274,49,0.945,52,1.713,71,0.62,74,0.53,88,1.191,97,2.837,125,2.023,127,2.756,160,2.45,190,5.041,198,1.823,227,3.819,241,2.513,897,3.474,971,4.179,1063,1.515,1362,3.691,1467,2.759,1667,2.952,1673,3.542,2219,5.72,2464,6.309,2465,6.309]],["t/436",[45,0.918,49,0.735,50,0.758,52,2.395,56,2.375,71,0.482,74,0.548,88,1.315,99,2.388,105,0.819,115,1.749,149,2.699,177,3.115,198,1.784,235,1.376,240,2.563,241,2.46,291,1.516,347,2.09,393,1.842,487,1.68,897,2.699,971,5.366,1052,3.762,1063,1.673,1084,2.435,1085,2.231,1362,4.74,1423,3.347,1683,4.142,1691,2.397,1697,5.886,1799,5.097,1812,3.737,2462,4.142,2466,4.902]],["t/438",[25,6.201,45,1.633,48,2.299,52,1.857,56,1.841,74,0.434,167,3.295,198,1.921,235,1.92,241,2.077,476,2.686,889,4.826,1084,2.391,1344,4.669,1362,5.616,1693,3.397,1781,5.78,1799,5.005,1812,5.214,2083,5.78,2094,5.78,2462,5.78,2467,6.84,2468,6.201,2469,5.78,2470,6.84]],["t/440",[57,5.967,96,3.715,116,3.514,148,2.941,211,3.562,322,3.611,1007,5.727,1029,6.254,1063,1.88,1322,6.254,1835,5.041,2043,6.614,2452,8.597,2471,7.827,2472,7.827]],["t/442",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/444",[7,1.427,47,2.141,49,1.192,50,1.229,57,4.529,71,0.584,73,1.164,74,0.554,105,1.328,125,1.905,126,3.194,127,1.978,128,2.472,130,3.403,131,2.905,132,3.553,187,4.747,467,2.905,1180,3.099,1670,3.636,1957,4.555,2446,6.355,2447,5.385,2448,6.72,2449,5.385,2450,5.385,2451,5.385,2473,5.941,2474,5.941]],["t/446",[3,1.031,8,1.788,28,4.961,45,1.361,52,1.973,68,4.449,125,2.331,137,4.163,331,3.22,334,3.61,347,3.099,848,4.346,1053,4.681,1063,2.371,1117,4.449,1432,5.128,1523,5.128,1728,4.08,1801,7.239,1802,5.318,1822,5.318]],["t/448",[14,4.142,20,2.699,48,1.648,50,0.758,71,1.063,73,1.364,88,1.759,198,1.08,240,1.804,291,1.516,347,3.762,487,1.68,848,2.932,971,3.247,1145,2.602,1315,2.474,1327,3.459,1553,8.178,1691,4.557,1822,7.684,2170,4.142,2475,4.902,2476,4.902,2477,4.444,2478,4.444,2479,4.444,2480,4.902,2481,4.444,2482,4.902,2483,4.444,2484,4.902]],["t/450",[6,1.939,7,1.023,8,1.548,13,1.939,45,0.798,47,1.535,48,1.432,49,0.638,50,0.659,52,1.156,73,0.624,74,0.564,105,0.711,108,1.737,125,1.366,127,2.095,129,1.217,149,2.346,160,1.654,181,2.346,198,0.938,200,2.499,227,2.903,233,4.198,235,2.1,236,6.321,240,2.753,243,2.822,506,3.118,832,2.185,848,2.548,1063,1.023,1467,1.863,1667,1.993,1691,3.077,1728,2.392,1756,2.548,1822,6.449,2481,3.862,2485,4.26,2486,4.26,2487,4.26,2488,4.26,2489,4.26,2490,4.26,2491,4.26,2492,4.26,2493,4.26,2494,4.26,2495,4.26,2496,4.26,2497,4.26,2498,4.26]],["t/452",[18,1.025,45,0.939,48,3.279,52,2.551,56,0.852,65,2.317,71,0.311,74,0.55,88,1.682,108,0.874,109,1.598,115,1.129,118,1.938,148,1.19,177,3.318,198,1.37,200,1.257,240,1.165,277,4.353,278,1.777,291,0.979,331,1.403,347,1.35,393,1.19,416,2.161,418,1.777,428,2.161,487,2.133,832,2.571,863,2.413,900,2.161,942,2.234,971,3.32,1052,2.137,1063,0.76,1064,2.721,1362,1.852,1467,1.385,1686,3.422,1691,1.548,1717,3.145,1728,2.814,1729,2.413,1767,2.413,1790,5.178,1806,4.007,1808,2.413,1809,2.53,1810,2.317,1811,2.234,1814,2.413,1816,2.675,1817,2.675,1818,2.675,1821,2.675,1822,6.001,1823,2.87,1824,2.87,1825,2.87,1826,2.675,1827,2.53,1828,2.87,1829,2.87,1830,2.87,1831,2.675,2161,2.87,2294,2.675,2469,2.675,2499,2.87,2500,2.87,2501,4.743,2502,2.87]],["t/454",[74,0.505,198,1.707,277,4.115,476,3.044,832,3.976,1693,3.85,1717,4.864,1806,4.993,1811,5.47,2469,6.551,2499,7.028,2500,7.028,2501,5.91,2502,7.028,2503,7.752]],["t/456",[74,0.542,241,2.4,277,4.195,300,4.838,491,5.395,2501,7.81,2504,7.903,2505,7.903,2506,7.903]],["t/458",[3,1.079,45,1.746,74,0.522,125,2.44,137,4.357,1691,4.558,1728,6.049,1838,6.428,1839,6.428,2507,7.607]],["t/460",[8,2.086,61,2.995,115,3.025,1063,2.037,1085,4.526,1475,7.165,2508,8.48]],["t/462",[50,1.311,71,0.833,105,1.416,487,2.907,1348,6.464,1395,4.09,2509,7.687]],["t/464",[3,0.759,6,2.436,7,1.78,8,1.823,13,2.436,45,1.003,47,1.93,49,1.273,50,1.313,56,2.287,71,0.728,73,1.084,74,0.542,100,4.524,125,1.717,126,2.151,127,2.467,128,2.228,129,1.529,140,1.97,150,2.398,160,2.079,227,2.47,487,1.835,1063,1.286,1085,2.436,1102,3.918,1129,2.893,1391,2.948,1467,2.342,1667,2.505,1785,4.854,2210,3.778,2510,5.354,2511,5.354,2512,6.261,2513,5.354,2514,7.409,2515,5.354]],["t/466",[8,1.3,18,1.711,45,0.99,49,1.1,59,4.607,61,1.866,73,1.075,85,4.465,96,2.508,108,2.027,133,3.091,156,4.258,159,5.373,172,2.473,239,4.043,329,2.667,332,3.5,415,6.171,416,5.013,424,6.656,467,2.584,879,5.181,1039,3.235,1063,1.269,1134,4.465,1145,2.805,1204,3.729,1281,3.388,1391,2.91,1394,4.863,1395,3.019,1475,4.465,1545,3.729,2136,4.791,2294,4.465,2435,6.205,2516,5.284,2517,5.284,2518,5.284,2519,5.284,2520,5.284,2521,4.791,2522,5.284,2523,4.791,2524,4.791,2525,5.284,2526,4.465]],["t/468",[71,0.931,73,1.388,415,6.107,418,5.323,1395,4.36,2509,7.096,2527,9.483,2528,7.827]],["t/470",[6,1.146,7,1.486,8,1.025,13,1.146,18,1.348,45,0.78,47,0.908,49,1.342,50,0.823,56,1.121,59,1.58,61,0.89,71,0.673,73,1.196,74,0.564,97,0.863,105,0.695,125,0.808,126,2.139,127,1.387,128,2.216,156,2.102,160,0.978,227,1.162,233,3.36,235,2.379,329,1.271,418,2.338,438,2.878,476,0.989,477,3.048,554,2.128,638,2.283,913,3.175,1058,2.283,1063,0.605,1129,2.878,1180,2.173,1204,2.939,1390,3.985,1467,1.102,1667,1.179,1957,3.544,2104,3.776,2328,3.175,2512,2.128,2524,3.776,2526,2.128,2529,2.519,2530,6.188,2531,4.165,2532,2.844,2533,2.519,2534,4.165,2535,2.519,2536,4.165,2537,2.519,2538,4.165,2539,4.165,2540,3.776,2541,4.165,2542,4.165,2543,6.188,2544,2.519,2545,2.519,2546,2.519,2547,5.326,2548,2.519,2549,2.519,2550,2.519,2551,2.519,2552,2.283,2553,2.519,2554,2.519,2555,5.326,2556,2.519,2557,2.519,2558,2.519,2559,6.188,2560,2.519,2561,2.519,2562,2.519,2563,2.519]],["t/473",[6,2.405,8,1.3,13,3.341,30,3.027,74,0.263,77,2.856,81,3.315,101,4.465,142,3.315,154,3.091,156,2.667,165,3.16,167,2.546,225,4.465,322,2.438,332,3.5,343,3.091,882,3.315,1005,4.465,1053,3.403,1057,4.465,1075,4.028,1180,2.757,1362,3.091,1424,3.729,1699,4.465,1726,4.028,1769,4.028,1801,4.222,1934,4.791,2132,4.465,2172,4.791,2453,4.028,2501,4.028,2564,5.284,2565,4.465,2566,4.791,2567,5.284,2568,5.284,2569,4.791,2570,5.284,2571,5.284,2572,5.284,2573,5.284,2574,4.791,2575,5.284,2576,4.465,2577,5.284,2578,5.284,2579,5.284,2580,4.791,2581,4.791,2582,4.791,2583,5.284,2584,5.284,2585,5.284,2586,5.284,2587,5.284,2588,5.284,2589,5.284,2590,5.284,2591,5.284,2592,5.284,2593,4.791,2594,5.284]],["t/475",[8,1.41,11,3.596,18,1.855,21,4.369,30,4.447,43,3.596,45,1.074,54,5.196,56,2.09,137,3.283,140,2.109,145,5.196,408,3.239,466,4.843,1080,4.643,1146,4.044,1180,4.05,1434,4.194,1445,5.478,1700,5.478,1737,4.369,2252,5.142,2532,5.3,2566,5.196,2593,5.196,2595,7.763,2596,5.731,2597,5.196,2598,5.731,2599,5.731,2600,5.196,2601,5.196,2602,5.731,2603,5.731,2604,5.731,2605,5.731,2606,5.731,2607,5.731,2608,5.918,2609,5.731,2610,5.731,2611,5.731]],["t/477",[8,1.854,11,4.729,408,3.41,1080,5.542,1391,5.102,1445,6.538,2252,6.138,2532,6.326,2608,7.064,2612,7.537,2613,7.537,2614,7.537,2615,7.537]],["t/479",[8,1.854,11,4.729,408,3.41,1080,5.542,1391,5.102,1445,6.538,2252,6.138,2532,6.326,2608,7.064,2616,7.537,2617,7.537,2618,7.537,2619,7.537]],["t/481",[8,1.854,11,4.729,408,3.41,663,6.833,1080,5.542,1391,5.102,1445,6.538,2252,6.138,2532,6.326,2608,7.064,2620,7.537,2621,7.537,2622,7.537]],["t/483",[8,1.854,11,4.729,408,3.41,1080,5.542,1391,5.102,1445,6.538,2252,6.138,2532,6.326,2608,7.064,2623,7.537,2624,7.537,2625,7.537,2626,7.537]],["t/485",[6,3.603,13,2.141,18,2.189,20,2.59,29,5.155,38,2.951,61,1.661,68,4.14,74,0.336,77,4.279,133,2.752,144,3.59,167,3.258,321,2.413,406,3.874,541,6.131,703,3.319,895,5.178,1057,5.714,1075,3.586,1180,4.981,1343,5.714,1390,3.029,1427,5.099,1707,3.442,1745,3.975,2083,5.714,2252,3.116,2333,4.264,2424,4.264,2532,6.261,2580,4.264,2581,4.264,2582,4.264,2601,6.131,2627,4.704,2628,4.704,2629,4.704,2630,4.704,2631,4.704,2632,4.704,2633,4.704,2634,4.704,2635,4.704,2636,4.704,2637,6.763,2638,6.763,2639,4.704,2640,4.704,2641,4.704,2642,4.264,2643,4.704,2644,4.704]],["t/488",[1,3.159,3,0.888,5,5.002,8,2.026,12,4.773,45,1.173,83,3.109,140,2.304,142,5.166,149,3.447,158,5.676,160,2.431,161,6.958,191,3.016,196,4.274,1294,5.002,1408,5.676,1458,5.29,1467,2.738,1474,4.581,1537,7.465,1722,5.676,1745,5.29,2565,5.29,2645,5.676,2646,6.261,2647,5.676,2648,6.261,2649,6.261,2650,6.261,2651,6.261,2652,6.261,2653,6.261,2654,6.261,2655,6.261,2656,6.261,2657,6.261,2658,6.261]],["t/490",[3,0.843,45,1.49,49,0.89,50,0.918,61,2.809,68,4.868,73,1.461,74,0.395,79,4.464,97,2.036,99,2.726,116,2.667,137,4.555,255,3.403,332,3.935,408,2.186,409,4.192,626,6.063,1063,1.427,1113,4.056,1208,4.347,1391,4.379,1435,6.72,1578,4.747,1936,5.385,1992,3.271,2453,4.529,2659,5.385,2660,5.385,2661,5.941,2662,5.941,2663,5.385,2664,5.941,2665,5.941,2666,5.941]],["t/492",[3,0.974,4,2.264,5,5.489,8,2.151,20,3.783,26,4.52,34,2.706,39,2.706,40,3.125,45,1.441,46,2.82,67,3.992,74,0.504,83,2.81,96,2.685,116,1.661,133,2.164,139,2.45,142,4.31,160,2.197,171,2.119,191,3.31,196,2.525,199,2.855,200,1.469,1040,2.61,1053,4.425,1054,3.125,1060,2.382,1357,3.125,1427,2.382,1434,2.706,1438,3.353,1506,4.52,1530,3.353,1573,6.228,2037,2.45,2132,3.125,2259,3.353,2343,2.82,2362,5.129,2501,5.237,2532,2.525,2552,3.353,2569,3.353,2576,3.125,2597,3.353,2642,3.353,2667,9.62,2668,3.353,2669,5.657,2670,5.129,2671,3.699,2672,3.353,2673,3.699,2674,3.699,2675,5.657,2676,3.699,2677,3.699,2678,3.699,2679,5.657,2680,3.699,2681,5.657,2682,3.699,2683,3.699,2684,3.699,2685,3.699,2686,3.699,2687,3.699,2688,3.699,2689,3.699,2690,3.699,2691,3.699,2692,3.699,2693,3.699,2694,3.353]],["t/494",[3,0.923,7,1.564,8,2.078,49,0.976,50,1.006,52,2.293,61,2.299,73,1.505,74,0.494,105,1.087,114,4.085,137,3.73,139,4.313,165,3.894,198,1.434,225,5.502,227,3.004,233,2.963,322,3.004,467,3.184,1060,4.193,1391,4.652,1394,4.313,1480,5.596,2695,6.511,2696,6.511]],["t/496",[8,2.241,19,5.174,45,1.374,116,3.292,137,4.2,534,5.006,1063,1.761,1117,4.489,1424,6.994,1428,6.648,1463,4.857,2343,5.59,2697,7.333,2698,6.648,2699,6.648,2700,6.648,2701,6.648,2702,6.648,2703,6.648,2704,6.648]],["t/498",[74,0.463,167,3.665,207,5.799,359,4.773,1007,5.567,1047,4.038,1061,5.799,1736,6.896,2645,6.896,2705,6.896,2706,7.607,2707,7.607,2708,7.607,2709,7.607,2710,7.607,2711,7.607,2712,6.896,2713,7.607]],["t/500",[1,2.796,3,0.786,7,0.865,8,0.886,33,2.54,47,1.298,49,1.227,50,1.173,63,1.847,70,2.54,71,0.354,73,1.11,74,0.566,79,2.021,105,1.128,116,1.616,117,2.458,118,2.204,125,1.155,126,2.226,127,1.199,128,3.157,150,2.187,167,1.734,186,3.264,235,1.556,291,1.113,295,5.276,393,1.353,407,1.946,471,3.465,830,2.877,1060,2.319,1113,2.458,1129,1.946,1407,2.877,1549,4.351,1626,3.042,2209,3.264,2217,6.125,2218,5.398,2705,3.264,2714,3.6,2715,3.6,2716,3.6,2717,3.6,2718,3.6,2719,5.542,2720,3.6,2721,3.6,2722,3.6,2723,3.6,2724,3.6,2725,3.6,2726,3.6,2727,3.6,2728,3.6,2729,3.6,2730,3.6,2731,3.6,2732,3.6,2733,3.6,2734,3.6]],["t/503",[3,1.02,7,0.958,8,2.109,45,1.122,47,1.438,49,1.198,50,1.112,52,1.626,61,2.541,68,2.442,71,0.392,73,1.318,74,0.523,79,2.239,97,1.367,99,1.367,105,1.201,123,3.616,125,1.279,126,2.406,127,1.328,128,1.66,129,2.055,133,2.333,140,1.468,177,1.409,199,3.023,370,3.187,393,1.499,407,2.156,471,3.073,626,3.041,712,5.431,1039,2.442,1063,1.439,1129,2.156,1208,2.919,1242,3.371,1281,3.319,1337,4.09,1391,2.196,1427,2.569,1730,3.371,1770,2.919,1832,3.371,1833,2.723,1850,3.371,2037,2.642,2092,3.187,2341,3.616,2433,5.431,2434,6.079,2436,3.616,2437,3.616,2438,3.616,2735,3.989,2736,5.991,2737,3.371,2738,3.989,2739,3.989,2740,3.989,2741,3.989,2742,3.989,2743,3.989,2744,5.991,2745,3.989]],["t/505",[3,0.691,8,1.199,49,1.039,50,0.753,52,2.192,61,2.449,73,1.487,74,0.533,97,1.67,105,0.814,108,1.345,167,2.347,199,4.876,233,2.218,290,2.383,291,2.144,322,3.2,408,2.552,471,4.513,476,2.723,523,3.438,533,3.894,534,3.327,703,4.894,1337,4.735,1400,4.118,1508,3.438,1770,3.566,1797,3.438,2443,5.542,2600,6.288,2746,4.118,2747,6.823,2748,4.418,2749,4.418,2750,4.418,2751,4.873,2752,4.873,2753,4.873]],["t/507",[3,0.775,7,0.85,8,1.345,11,2.22,12,2.697,13,1.61,45,0.663,49,1.001,50,0.547,52,1.814,61,2.87,73,1.503,74,0.539,96,1.679,97,2.945,108,0.977,112,3.207,114,2.22,139,4.426,144,1.878,159,2.589,160,1.374,165,3.27,167,1.704,198,1.204,199,4.101,227,1.632,233,3.041,235,1.535,291,1.69,343,2.07,344,3.996,380,2.989,407,1.912,408,2.012,467,1.73,471,2.804,476,1.389,703,2.496,1040,2.496,1047,1.878,1050,3.207,1061,4.168,1390,3.521,1391,1.948,1394,2.343,1444,4.368,1473,2.697,1480,2.343,1546,2.827,1770,2.589,1797,2.496,2078,2.989,2435,2.989,2443,4.368,2453,2.697,2512,2.989,2668,3.207,2694,3.207,2747,4.62,2748,3.207,2749,3.207,2750,3.207,2754,3.538,2755,3.538,2756,3.538,2757,3.538,2758,3.538,2759,3.538,2760,3.538,2761,3.538,2762,3.538]],["t/510",[3,0.807,7,1.367,8,1.4,20,3.134,30,3.26,45,1.447,47,2.051,52,1.545,71,0.559,74,0.504,114,3.571,125,1.825,126,3.103,127,2.573,343,5.131,358,4.165,448,4.809,453,4.809,1049,5.159,1410,7.172,1411,5.159,1412,5.159,1435,4.809,1508,4.016,1793,5.159,2076,4.809,2659,5.159,2763,7.726,2764,5.691,2765,5.691,2766,5.159,2767,5.691,2768,5.691,2769,5.691,2770,5.159,2771,5.691,2772,5.691,2773,5.691,2774,5.691,2775,5.691,2776,5.691]],["t/512",[97,3.588,108,2.89,142,5.814,144,4.919,343,6.124,449,6.138,454,7.064]],["t/514",[8,2.169,13,3.166,60,3.985,99,2.385,119,4.749,140,2.56,166,5.878,1030,3.511,1037,4.161,1146,4.909,1149,6.738,1338,4.608,1362,4.07,1498,5.559,1737,5.303,1802,5.091,1941,5.559,2777,6.957,2778,6.957,2779,7.991,2780,8.772,2781,6.957]],["t/516",[1,4.457,7,1.517,33,5.295,61,3.537,71,0.62,73,0.924,74,0.559,77,2.315,83,2.127,108,1.182,126,2.537,128,2.628,133,2.505,140,1.576,148,2.374,177,1.512,249,5.123,626,3.265,1063,1.802,1129,3.414,1145,2.273,1149,4.184,1151,5.047,1152,5.047,1153,5.047,1154,5.047,1155,5.047,1156,5.047,1157,5.047,1158,5.337,1159,5.337,1160,5.337,1161,5.337,1162,5.337,1163,5.337,1437,3.265,2066,3.883,2782,4.283]],["t/518",[1,3.917,7,1.377,45,1.074,49,1.163,50,1.2,61,3.332,71,0.563,73,1.136,74,0.555,105,1.296,126,2.302,128,2.385,140,2.109,148,2.154,249,5.3,257,4.369,1063,1.377,1084,2.004,1114,3.796,1128,5.196,1129,3.097,1149,3.796,1151,4.579,1152,4.579,1153,4.579,1154,4.579,1155,4.579,1156,4.579,1157,4.579,1857,5.196,2783,5.731,2784,5.731]],["t/520",[8,1.872,70,5.368,97,2.608,99,2.608,133,4.45,150,2.462,156,3.839,273,3.839,1314,4.773,1338,5.039,2785,7.607,2786,6.896,2787,6.896,2788,6.896,2789,6.896,2790,6.896,2791,6.896,2792,6.896,2793,6.896]],["t/522",[8,1.505,61,2.161,71,0.601,73,1.516,74,0.54,96,2.905,99,2.098,291,3.318,1052,2.609,1168,5.548,1314,3.839,2794,7.353,2795,5.548,2796,7.353,2797,6.119,2798,5.548,2799,5.548,2800,6.119,2801,5.548,2802,6.119,2803,5.548,2804,5.548,2805,6.119]],["t/524",[7,2.251,71,0.754,99,2.632,140,3.723,154,4.492,156,3.875,162,1.215,172,3.593,273,3.875,1131,4.311,1314,4.818,2786,6.962,2794,6.962,2806,6.962,2807,7.679]],["t/526",[3,0.604,7,1.797,47,1.535,49,1.321,50,1.156,71,0.618,73,1.29,74,0.554,77,2.302,99,1.46,105,1.249,125,1.366,126,2.527,127,1.419,128,1.773,129,1.217,140,3.04,150,2.037,154,2.492,156,2.15,162,0.674,172,1.993,200,3.281,235,1.767,273,2.15,506,3.118,1060,2.744,1131,2.392,1145,2.261,1149,2.822,1171,5.704,1245,3.862,1314,2.673,1633,3.404,2787,6.782,2795,3.862,2808,4.26,2809,7.481,2810,6.292,2811,4.26,2812,4.26,2813,4.26,2814,4.26,2815,3.404,2816,4.26,2817,4.26,2818,4.26,2819,4.26,2820,3.862,2821,4.26,2822,4.26]],["t/528",[7,2.251,71,0.754,99,2.632,154,4.492,156,3.875,162,1.215,172,3.593,273,3.875,1131,4.311,1149,6.701,1314,4.818,2788,6.962,2796,6.962,2806,6.962,2823,7.679]],["t/530",[7,2.176,71,0.714,99,2.491,140,2.674,154,4.251,156,3.667,162,1.15,172,3.401,200,3.598,273,3.667,1060,4.681,1131,4.08,1145,3.858,1149,6.845,1314,4.56,2789,8.213,2798,6.588,2824,7.267]],["t/532",[3,0.819,7,2.122,18,2.525,49,1.169,71,0.567,73,0.845,74,0.56,99,1.979,114,3.621,115,2.059,156,2.913,162,0.913,235,2.19,273,2.913,926,6.591,1191,4.563,1255,5.233,1314,3.621,1360,5.233,1493,5.233,2790,7.071,2799,5.233,2820,5.233,2825,5.772,2826,5.772,2827,5.772,2828,5.772,2829,5.772,2830,5.772,2831,5.772]],["t/534",[7,2.332,71,0.8,99,2.79,156,4.108,162,1.288,273,4.108,1314,5.107,2791,7.38,2801,7.38,2832,8.14,2833,8.14]],["t/536",[7,2.332,71,0.8,99,2.79,156,4.108,162,1.288,273,4.108,1183,7.38,1314,5.107,2792,7.38,2803,7.38,2834,8.14]],["t/538",[3,0.641,4,2.767,7,2.392,45,0.847,47,1.629,49,0.677,71,0.646,73,0.662,74,0.525,77,2.443,99,1.55,125,1.45,126,2.64,127,1.505,129,1.291,140,2.418,148,2.91,156,2.281,162,0.715,172,2.115,235,1.269,273,2.281,422,3.19,467,3.214,970,4.098,1037,2.704,1060,2.912,1122,7.593,1133,5.957,1145,2.4,1149,4.353,1281,2.086,1314,4.857,1427,2.912,1495,7.705,1626,3.82,1633,3.612,2328,3.446,2793,5.957,2804,4.098,2835,4.521,2836,4.521,2837,4.521,2838,6.571,2839,4.521,2840,4.521,2841,4.521,2842,4.521,2843,4.521,2844,4.521,2845,4.521,2846,4.521]],["t/541",[1,2.124,3,0.597,4,2.576,7,2.501,18,1.739,45,0.788,48,0.857,49,1.177,50,1.214,56,1.857,61,3.698,71,0.902,73,1.15,74,0.518,88,1.697,97,0.874,105,1.24,109,1.287,125,0.818,140,1.977,148,1.582,149,1.404,150,2.018,152,2.576,153,1.866,154,1.492,155,2.317,157,3.799,162,0.666,170,3.08,181,1.404,241,0.774,255,1.461,256,1.689,347,1.088,1033,5.622,1037,3.213,1063,0.613,1089,2.517,1090,3.363,1091,2.155,1092,2.155,1093,2.155,1094,2.155,1095,2.155,1096,2.155,1097,2.155,1098,2.155,1099,2.155,1100,2.155,1101,2.155,1102,1.866,1103,2.155,1104,2.155,1105,3.556,1106,2.155,1107,2.155,1108,1.866,1109,1.944,1110,2.038,1111,2.155,1112,2.155,1113,1.741,1114,4.57,1115,3.556,1116,3.363,1117,1.561,1118,2.155,1119,1.944,1120,2.038,1121,2.155]],["t/543",[3,0.638,13,2.046,49,1.156,50,1.193,56,2.531,73,1.13,74,0.512,75,4.215,88,1.457,105,1.289,118,2.752,119,3.069,129,1.284,140,3.84,146,3.172,148,3.533,150,1.455,157,4.667,169,2.475,171,2.575,172,2.104,1030,2.269,1052,1.917,1132,3.799,1146,4.618,1482,3.592,1498,3.592,1667,3.063,1781,3.799,1835,2.895,1926,4.076,1992,2.475,2185,3.799,2212,4.076,2213,4.076,2737,3.799,2779,4.076,2780,5.933,2847,4.496,2848,4.496,2849,4.496,2850,4.496,2851,4.496,2852,4.496,2853,4.496,2854,4.496,2855,4.496]],["t/545",[0,1.79,1,1.712,3,0.28,11,3.32,21,1.505,45,1.304,48,1.499,49,1.101,50,1.136,56,0.913,61,1.869,65,1.445,73,1.076,74,0.545,81,2.128,97,1.163,99,0.677,105,1.227,130,1.131,140,3.245,148,1.275,150,0.639,157,1.087,172,4.331,177,2.298,180,1.669,183,4.472,185,1.79,200,2.584,211,0.899,235,1.486,240,0.727,249,3.613,273,0.996,313,2.711,342,1.465,695,1.445,937,1.239,992,1.669,1013,3.768,1030,1.712,1033,2.077,1041,1.685,1047,1.048,1052,0.842,1180,1.03,1187,1.505,1214,3.806,1390,1.272,1427,1.272,1463,1.308,1467,2.606,1471,5.088,1473,1.505,1522,1.669,1553,1.505,1667,0.924,1686,1.348,1730,1.669,1756,2.029,1797,1.393,1810,1.445,1849,1.669,1998,1.79,2453,1.505,2574,1.79,2766,1.79,2856,1.975,2857,1.975,2858,2.867,2859,1.578,2860,1.975,2861,3.075,2862,1.79,2863,5.292,2864,5.292,2865,1.975,2866,1.975,2867,1.975,2868,1.975,2869,1.975,2870,4.762,2871,3.563,2872,1.975,2873,2.711,2874,3.392,2875,1.578,2876,1.79,2877,1.975,2878,3.075,2879,1.975,2880,1.975,2881,1.975,2882,1.975,2883,1.975,2884,1.79,2885,1.975,2886,1.975,2887,1.975,2888,1.578,2889,1.975,2890,1.975,2891,1.975,2892,1.975,2893,1.975,2894,1.975,2895,1.975,2896,3.392,2897,1.975,2898,1.975,2899,1.975,2900,1.975,2901,1.975,2902,1.975,2903,1.975,2904,1.975,2905,1.975,2906,1.975,2907,1.975,2908,1.975,2909,1.975,2910,1.975,2911,1.975,2912,1.975,2913,1.975,2914,1.975,2915,1.975,2916,1.79,2917,1.79,2918,1.79,2919,1.79,2920,1.975,2921,1.975,2922,1.975,2923,1.975]],["t/547",[3,0.811,8,0.923,11,1.395,12,1.695,30,1.273,45,0.912,48,2.148,49,0.957,50,0.884,61,0.785,73,0.837,74,0.541,76,1.925,88,0.42,105,0.955,116,2.568,136,1.432,140,2.105,148,0.835,149,1.224,155,2.066,156,1.122,157,2.681,172,2.99,177,1.325,211,1.708,226,1.361,300,1.361,323,2.015,324,1.273,338,0.936,342,1.62,422,1.568,487,0.762,534,1.518,626,1.695,695,1.627,897,4.727,950,1.695,1089,1.329,1145,1.992,1180,1.957,1353,1.878,1390,1.432,1471,4.232,1503,2.015,1699,1.878,1792,1.472,1802,1.627,1849,1.878,1917,2.015,1957,4.917,2082,1.776,2088,2.015,2130,2.015,2737,1.878,2888,1.776,2924,8.585,2925,2.223,2926,2.223,2927,2.223,2928,3.752,2929,2.223,2930,3.752,2931,2.223,2932,2.223,2933,2.223,2934,2.223,2935,3.752,2936,2.223,2937,2.223,2938,2.223,2939,2.223,2940,2.223,2941,2.223,2942,2.223,2943,2.223,2944,2.223,2945,2.223,2946,2.223,2947,2.223,2948,2.223,2949,2.223,2950,3.402,2951,2.223,2952,2.223,2953,2.223,2954,3.563,2955,3.402,2956,2.223,2957,2.223,2958,3.752,2959,3.752,2960,2.223,2961,2.223,2962,2.223,2963,2.223,2964,2.223,2965,2.223,2966,2.223,2967,2.223,2968,1.878,2969,3.752,2970,2.223,2971,3.402,2972,2.223,2973,2.223,2974,2.223,2975,2.223,2976,5.72,2977,3.752,2978,4.869,2979,4.869,2980,4.869,2981,2.223,2982,4.869,2983,2.223,2984,3.752,2985,2.223,2986,2.223,2987,2.223,2988,2.223,2989,2.223,2990,2.223,2991,2.223,2992,2.223,2993,2.223,2994,2.223,2995,2.223,2996,2.223,2997,2.223,2998,2.223,2999,2.223,3000,2.223,3001,2.223,3002,2.223,3003,2.223]],["t/549",[3,0.754,8,1.309,20,2.929,21,4.055,45,0.996,49,1.105,50,1.14,56,1.985,67,3.753,73,1.08,74,0.494,83,2.642,97,2.528,99,3.292,105,0.888,108,1.468,129,1.519,130,3.047,131,3.607,138,2.875,140,1.957,148,3.182,150,1.722,156,2.684,157,2.929,241,2.24,329,3.722,408,2.714,1033,3.256,1037,3.181,1063,2.196,1084,2.96,1108,3.892,1113,3.631,1114,3.523,1120,4.25,1122,4.055,1327,3.753,1398,4.495,1463,3.523]],["t/551",[1,3.955,7,1.396,33,4.102,45,1.089,61,3.352,71,0.571,74,0.553,116,2.61,117,3.969,126,2.335,128,2.419,140,2.139,146,4.102,249,3.969,1063,2.13,1129,3.142,1149,5.191,1151,4.645,1152,4.645,1153,4.645,1154,4.645,1155,4.645,1156,4.645,1157,4.645,1158,4.912,1159,4.912,1160,4.912,1161,4.912,1162,4.912,1163,4.912,2565,4.912,2888,4.645,3004,5.813]],["t/554",[7,1.529,8,1.858,19,5.874,45,1.192,48,1.455,49,0.649,50,0.669,73,1.105,74,0.499,88,1.202,99,2.588,105,0.723,108,1.195,114,2.716,129,1.236,131,2.117,138,2.339,150,2.06,156,2.184,169,2.383,177,1.529,198,0.953,200,1.719,203,6.033,227,1.997,291,1.338,322,2.937,327,3.459,331,1.918,347,3.55,406,2.479,838,2.867,1007,3.167,1052,1.846,1281,2.937,1422,3.924,1423,2.955,1424,6.259,1474,7.018,1476,6.763,1477,3.924,1478,7.035,1479,4.658,1480,2.867,1850,3.657,3005,4.328,3006,4.328,3007,4.328,3008,4.328,3009,3.459,3010,4.328,3011,4.328,3012,3.924,3013,3.459]],["t/556",[3,0.656,7,1.111,8,1.138,19,6.906,20,2.546,47,1.666,49,0.693,50,0.715,71,0.454,73,0.677,74,0.544,96,2.195,105,0.772,114,2.901,125,2.142,126,2.683,127,1.54,129,1.321,131,2.261,138,2.499,155,2.546,160,1.795,195,3.907,227,2.133,237,3.484,322,2.133,407,2.499,467,2.261,1003,2.83,1047,2.454,1129,2.499,1424,6.06,1474,3.383,1476,3.525,1508,3.262,2325,3.383,2343,6.944,2521,4.192,2647,4.192,2698,4.192,2699,4.192,2700,7.109,2701,4.192,2702,4.192,2703,4.192,2704,4.192,3012,4.192,3013,3.694,3014,4.624,3015,4.624,3016,4.624,3017,4.624,3018,4.624,3019,4.624,3020,4.624]],["t/559",[3,0.447,7,0.435,8,0.446,32,1.531,40,1.531,43,3.547,45,0.782,47,0.653,48,1.059,49,0.847,50,0.487,56,1.344,61,0.64,68,1.109,71,0.309,73,0.827,74,0.559,76,4.303,79,3.96,83,0.9,88,1.067,97,1.08,105,0.526,114,1.137,115,0.646,116,0.813,117,1.237,125,1.01,126,1.265,127,0.603,129,0.517,130,1.038,131,1.54,137,1.804,138,0.979,139,1.2,144,0.962,165,1.084,169,0.998,199,0.914,200,1.659,233,3.032,235,0.509,243,2.086,273,2.519,291,0.56,321,2.56,331,1.395,332,4.107,338,0.763,342,0.782,347,1.343,386,3.001,393,2.779,407,0.979,408,1.837,409,2.222,438,1.702,443,1.167,476,1.237,487,1.432,611,1.326,695,1.326,698,1.381,825,3.057,937,1.976,1026,3.408,1038,1.448,1064,0.792,1129,0.979,1294,1.448,1322,1.448,1337,2.852,1390,1.167,1394,1.2,1479,1.326,1509,1.2,1545,1.278,1549,2.028,1553,2.401,1578,1.448,1633,1.448,1689,1.326,1691,0.886,1756,1.084,1890,3.787,1978,1.643,2092,1.448,2103,1.531,2180,1.278,2446,1.448,2576,1.531,2660,1.643,2747,1.531,2950,2.855,2955,2.855,3021,1.812,3022,1.812,3023,1.812,3024,1.812,3025,1.812,3026,1.812,3027,1.812,3028,3.149,3029,1.812,3030,4.992,3031,1.812,3032,4.177,3033,1.812,3034,1.812,3035,4.177,3036,1.812,3037,1.812,3038,1.812,3039,1.812,3040,1.812,3041,1.812,3042,4.177,3043,1.812,3044,1.812,3045,1.326,3046,3.149,3047,1.812,3048,1.812,3049,1.812,3050,3.149,3051,1.812,3052,3.149,3053,1.812,3054,1.812,3055,1.812,3056,1.812,3057,1.812,3058,1.812,3059,1.812,3060,1.812,3061,1.812,3062,1.812,3063,1.812,3064,3.149,3065,1.812,3066,1.812,3067,1.812,3068,1.812,3069,1.812,3070,3.149,3071,1.812,3072,1.812,3073,1.812,3074,1.812,3075,1.812,3076,1.812,3077,1.812,3078,1.812,3079,1.812,3080,3.149,3081,1.812,3082,1.812,3083,1.812]],["t/561",[1,2.124,3,0.597,4,2.576,7,2.501,18,1.739,45,0.788,48,0.857,49,1.177,50,1.214,56,1.857,61,3.698,71,0.902,73,1.15,74,0.518,88,1.697,97,0.874,105,1.24,109,1.287,125,0.818,140,1.977,148,1.582,149,1.404,150,2.018,152,2.576,153,1.866,154,1.492,155,2.317,157,3.799,162,0.666,170,3.08,181,1.404,241,0.774,255,1.461,256,1.689,347,1.088,1033,5.622,1037,3.213,1063,0.613,1089,2.517,1090,3.363,1091,2.155,1092,2.155,1093,2.155,1094,2.155,1095,2.155,1096,2.155,1097,2.155,1098,2.155,1099,2.155,1100,2.155,1101,2.155,1102,1.866,1103,2.155,1104,2.155,1105,3.556,1106,2.155,1107,2.155,1108,1.866,1109,1.944,1110,2.038,1111,2.155,1112,2.155,1113,1.741,1114,4.57,1115,3.556,1116,3.363,1117,1.561,1118,2.155,1119,1.944,1120,2.038,1121,2.155]],["t/564",[3,0.707,8,0.773,18,1.017,38,1.971,50,0.957,71,0.692,73,0.906,74,0.553,88,1.677,99,1.077,105,1.034,119,2.145,129,1.768,149,1.73,157,1.73,162,0.497,212,1.865,241,1.513,290,1.536,291,0.971,321,1.611,322,1.449,342,2.151,343,1.838,345,5.848,449,2.081,521,5.42,523,2.217,534,3.401,838,6.061,871,2.655,874,2.848,988,2.51,1030,1.585,1041,1.56,1059,2.217,1086,1.928,1187,2.395,1742,2.655,1756,1.879,1835,2.023,2076,5.953,2343,2.395,3084,2.655,3085,3.141,3086,3.141,3087,3.141,3088,3.141,3089,3.141,3090,3.141,3091,3.141,3092,3.141,3093,3.141,3094,3.141,3095,4.982,3096,4.982,3097,4.982,3098,3.141,3099,4.982,3100,3.141,3101,3.141,3102,3.141,3103,3.141,3104,2.395,3105,2.848,3106,6.19,3107,6.19,3108,3.141,3109,3.141,3110,3.141,3111,6.19,3112,4.982,3113,3.141,3114,3.141,3115,3.141,3116,3.141,3117,3.141]],["t/566",[3,0.881,45,1.535,50,1.266,71,0.61,73,1.199,74,0.555,105,1.368,140,2.286,150,2.011,162,0.983,172,2.907,200,2.467,212,1.645,342,2.683,1086,1.701,1214,5.363,1670,3.803,2873,4.964,2875,4.964,3118,6.213,3119,5.632,3120,8.193,3121,5.632,3122,5.632,3123,5.632]],["t/568",[3,1.049,7,2.39,49,1.373,50,1.144,63,3.796,71,0.727,73,1.083,74,0.456,105,1.236,108,2.043,142,4.643,162,1.171,212,1.959,882,4.643,1086,2.025,3124,7.4,3125,7.4,3126,7.4]],["t/570",[3,0.849,18,1.937,48,3.025,50,0.925,71,0.588,73,0.876,74,0.531,88,1.509,96,2.841,105,0.999,108,1.652,129,1.709,162,0.947,212,1.584,241,2.732,381,5.057,386,3.176,408,2.202,1007,5.848,1041,3.969,1086,1.638,1145,3.176,1180,4.169,1303,7.603,1380,4.782,2416,8.157,3127,5.984,3128,7.992]],["t/572",[3,0.895,18,2.042,50,0.975,71,0.62,73,0.923,74,0.548,88,1.191,105,1.053,108,1.742,129,1.802,162,0.998,212,1.67,241,1.916,290,4.795,291,1.951,386,3.349,408,2.321,907,7.805,1086,1.727,1119,7.041,3129,6.309,3130,6.309,3131,6.309,3132,6.309,3133,5.72]],["t/574",[3,0.995,49,1.051,50,1.085,71,0.689,73,1.027,74,0.543,88,1.673,105,1.172,129,2.004,162,1.11,211,3.193,212,1.858,295,4.519,342,3.03,489,6.361,922,5.349,1086,1.921,1835,4.519,3134,7.017,3135,7.017,3136,7.017]],["t/576",[3,0.861,19,4.285,45,1.138,49,0.91,50,1.248,52,1.649,71,0.597,73,1.327,74,0.514,75,5.198,105,1.014,129,1.735,131,2.97,138,3.282,150,1.966,162,0.961,212,1.608,255,3.479,326,3.224,476,3.169,1086,1.663,1113,4.146,1424,4.285,1474,4.444,1476,6.153,2325,5.906,3009,4.853,3013,4.853,3137,7.317,3138,6.074,3139,6.074,3140,6.074,3141,6.074]],["t/578",[3,0.849,45,1.121,48,2.012,49,1.348,50,0.925,51,3.663,56,2.151,60,3.428,61,2.113,63,3.07,71,0.588,73,0.876,74,0.498,76,3.07,83,2.972,84,3.663,105,0.999,108,1.652,116,2.687,152,4.892,162,0.947,212,1.584,237,4.694,245,2.927,326,3.176,477,4.379,897,3.295,1086,1.638,1244,3.755,1372,6.753,1691,2.927,1957,3.428,1992,3.295,3142,5.984,3143,5.984,3144,5.984,3145,5.984]],["t/580",[3,0.709,4,1.93,45,0.936,46,2.404,48,1.06,49,0.749,50,0.487,51,1.93,56,0.849,60,1.806,61,1.114,63,1.618,71,0.31,73,0.731,74,0.524,76,1.618,83,1.566,84,1.93,88,0.943,105,0.527,108,0.871,116,1.416,127,1.05,133,1.845,136,2.031,152,4.711,160,1.225,162,0.499,181,1.736,200,1.984,212,0.835,226,3.059,233,2.824,235,0.885,237,2.607,278,3.963,290,3.764,291,2.531,326,1.674,329,1.591,331,3.128,343,2.923,345,3.411,347,1.345,349,3.993,350,3.993,353,4.222,354,3.993,355,4.222,369,2.665,386,3.294,393,2.892,519,2.859,897,4.237,1026,3.411,1041,1.566,1047,1.674,1086,0.863,1180,1.645,1231,2.153,1244,1.979,1281,2.306,1551,3.809,1689,2.308,1691,1.542,1835,2.031,1957,4.69,1992,1.736,2328,4.731,3009,2.52,3146,4.997,3147,3.154,3148,2.665,3149,2.665,3150,2.665,3151,2.859,3152,2.859,3153,3.154,3154,3.154,3155,3.154,3156,2.665,3157,2.665,3158,3.154,3159,2.665,3160,2.665,3161,3.154,3162,6.206,3163,3.154,3164,3.154,3165,3.154,3166,3.154,3167,3.154]],["t/582",[3,0.847,6,1.806,45,0.744,48,2.007,50,1.109,68,2.43,71,0.39,73,1.05,74,0.543,88,0.749,96,1.884,105,1.198,108,1.648,115,2.129,129,1.134,144,3.168,149,2.185,155,2.185,162,0.628,177,1.402,200,3.168,212,1.051,239,2.185,277,5.092,422,2.801,506,2.905,829,5.411,832,4.609,992,3.354,1001,2.905,1042,3.598,1079,2.71,1086,1.086,1145,2.107,1348,3.026,1756,2.374,1767,3.026,1792,3.953,1794,3.598,1810,4.368,1811,4.211,1822,2.905,1827,4.769,1832,3.354,1833,2.71,1904,5.411,1941,3.172,2092,3.172,3104,3.026,3168,3.969,3169,3.969,3170,3.969,3171,3.969,3172,3.969,3173,3.969,3174,3.969,3175,3.969,3176,3.969,3177,3.969,3178,3.598,3179,5.411,3180,3.969,3181,3.969,3182,3.969,3183,3.969]],["t/584",[2,4.341,3,0.902,49,0.953,50,0.983,63,3.262,71,0.625,73,0.931,74,0.521,105,1.062,116,2.855,117,5.679,142,3.989,162,1.006,168,5.081,169,3.501,212,1.683,393,3.126,1086,1.74,1146,4.486,1294,5.081,1337,4.341,2888,5.081,3184,9.272,3185,6.359,3186,6.359,3187,6.359,3188,6.359,3189,6.359,3190,5.764,3191,6.359,3192,6.359]],["t/586",[1,3.635,2,4.918,16,5.491,43,4.519,48,2.422,49,1.079,59,4.519,71,0.708,116,3.234,117,4.918,118,4.409,162,1.14,212,1.907,326,3.823,347,3.072,375,6.53,1029,5.756,1030,3.635,1086,1.972,1200,6.087,1204,5.082,1247,7.613,2526,6.087,3193,7.203]],["t/588",[3,0.717,48,1.699,50,0.781,71,0.497,73,0.74,74,0.541,88,1.779,96,2.399,105,0.844,108,1.965,129,1.444,148,1.9,162,0.8,181,2.783,200,2.007,212,1.338,277,5.19,291,1.563,338,2.129,393,1.9,487,2.824,832,2.593,900,3.451,942,3.566,1079,3.451,1081,4.271,1086,1.384,1231,3.451,1811,3.566,1827,4.039,2382,4.271,3151,4.582,3178,4.582,3179,4.582,3194,5.055,3195,5.055,3196,5.055,3197,5.055,3198,5.055,3199,5.055,3200,5.055,3201,5.055,3202,5.055,3203,5.055,3204,5.055,3205,5.055,3206,5.055,3207,5.055,3208,5.055]],["t/590",[3,0.813,45,1.074,48,2.96,49,1.163,50,0.886,51,3.508,52,1.556,60,3.283,61,2.024,63,2.94,71,0.563,73,0.839,74,0.517,76,2.94,83,2.847,84,3.508,88,1.662,105,0.957,108,1.582,116,2.573,129,1.637,162,0.907,177,2.024,181,3.156,212,1.517,240,3.239,277,4.673,326,3.042,1039,3.508,1086,1.569,1231,5.3,1281,2.644,1691,2.803,1992,3.156,3209,5.731,3210,3.796,3211,5.731,3212,5.731]],["t/592",[3,0.796,39,6.373,49,1.147,50,0.868,52,2.077,71,0.551,73,1.12,74,0.502,88,1.445,105,0.937,129,1.603,148,2.876,162,0.888,172,3.581,191,3.687,212,1.486,241,1.704,273,2.832,290,2.745,907,4.743,944,4.743,983,4.743,1086,1.536,1119,4.279,1480,3.718,1767,5.834,1946,6.467,3213,5.613,3214,7.895,3215,5.613,3216,5.613,3217,5.613,3218,7.654,3219,8.709,3220,7.654]],["t/594",[3,0.775,18,1.768,30,3.129,45,1.407,50,0.844,71,0.537,73,1.099,74,0.547,105,0.912,129,1.56,131,4.742,138,4.06,162,0.864,212,1.446,241,2.281,290,2.671,345,3.729,347,2.329,521,3.854,523,5.3,838,6.422,1030,2.756,1041,2.713,1086,1.495,1549,4.838,2540,4.952,3221,5.462,3222,7.512,3223,5.462,3224,8.587,3225,5.462,3226,5.462]],["t/596",[2,4.241,3,0.881,38,5.14,49,1.228,50,0.96,71,0.61,73,1.199,74,0.504,88,1.173,105,1.037,162,0.983,171,3.559,191,4.88,196,4.241,200,2.467,212,1.645,233,2.827,239,3.421,240,2.286,278,3.488,367,5.25,386,3.298,848,3.716,1086,1.701,1244,3.898,1797,4.384,3227,6.213,3228,4.964,3229,6.213,3230,5.25,3231,4.964,3232,4.964]],["t/598",[3,0.813,38,4.871,45,1.074,48,3.172,49,1.163,50,0.886,51,3.508,60,3.283,61,2.024,63,2.94,71,0.563,73,0.839,74,0.526,76,2.94,83,2.847,84,3.508,88,1.662,105,0.957,108,1.582,116,2.573,162,0.907,181,3.156,200,3.083,212,1.517,239,3.156,240,2.109,278,4.358,326,3.042,386,3.042,1039,3.508,1086,1.569,1244,3.596,1691,2.803,1797,4.044,1992,3.156,3210,3.796,3233,5.731,3234,5.731]],["t/600",[71,0.842,162,1.356,212,2.269,487,2.937,1086,2.346,2483,7.768,3235,8.569]],["t/602",[3,0.807,18,1.842,45,1.066,48,1.913,49,1.158,50,0.88,51,3.484,56,1.532,60,3.26,61,2.01,63,2.919,71,0.559,73,0.833,74,0.516,76,2.919,83,2.827,84,3.484,88,1.656,105,0.95,108,1.571,116,2.555,129,1.625,157,3.134,162,0.9,181,4.254,212,1.507,241,1.728,291,2.389,326,3.021,386,3.021,523,5.452,1041,2.827,1086,1.558,1390,3.665,1691,2.783,1992,3.134,2210,4.016,2477,5.159,2968,4.809,3210,3.77,3236,7.726,3237,5.691]],["t/604",[18,2.689,49,1.245,56,2.236,71,0.816,162,1.314,212,2.199,241,2.522,1086,2.274,1670,5.085,3238,8.307]],["t/606",[3,0.78,18,1.78,45,1.03,48,1.849,49,1.131,50,0.85,51,3.366,56,1.48,60,3.15,61,1.942,63,2.821,71,0.54,73,0.805,74,0.511,76,2.821,83,2.731,84,3.366,88,1.627,105,0.918,108,1.518,116,2.469,129,1.571,157,3.028,162,0.87,181,4.155,212,1.456,241,1.67,291,1.7,326,2.919,386,2.919,408,2.023,523,3.88,971,3.642,1041,2.731,1086,1.505,1390,3.541,1691,2.689,1992,3.028,2210,3.88,2968,4.647,3210,3.642,3239,5.499,3240,5.499,3241,5.499,3242,5.499,3243,5.499,3244,5.499,3245,5.499,3246,5.499,3247,5.499]],["t/608",[18,2.689,49,1.245,71,0.816,162,1.314,212,2.199,241,2.522,408,3.056,1086,2.274,1670,5.085,3248,8.307]],["t/610",[3,1.096,49,1.41,50,1.356,71,0.559,73,1.377,74,0.504,88,1.458,105,1.465,129,1.625,139,3.77,140,2.094,162,0.9,172,2.663,200,2.26,211,3.516,212,1.507,342,2.458,438,3.076,913,4.339,1086,1.558,1180,2.969,1214,3.329,1362,3.329,2348,5.159,3137,5.159,3249,5.691,3250,5.691,3251,5.159,3252,5.691,3253,4.809,3254,5.691,3255,5.691,3256,5.159,3257,5.691,3258,5.691,3259,5.691,3260,5.691]],["t/612",[3,0.895,18,2.042,45,1.182,48,2.121,49,1.24,50,0.975,51,3.862,60,3.614,61,2.228,63,3.236,71,0.62,73,0.923,74,0.52,76,3.236,83,3.134,84,3.862,88,1.191,105,1.053,108,1.742,116,2.833,129,1.802,162,0.998,212,1.67,241,1.916,295,4.063,326,3.349,1086,1.727,1386,5.72,1691,3.085,1992,3.474,3261,8.277,3262,5.72,3263,6.309,3264,6.309]],["t/614",[3,0.895,7,1.988,8,2.036,49,1.24,50,0.975,56,2.228,71,0.62,73,0.923,74,0.53,88,1.191,105,1.053,114,3.958,129,1.802,162,0.998,212,1.67,241,2.513,820,4.452,1053,4.063,1086,1.727,1089,3.773,1249,5.84,1370,4.452,1371,6.759,1385,5.72,1442,5.331,2179,5.331,3265,6.309]],["t/616",[3,0.843,45,1.113,49,0.89,50,0.918,56,1.599,71,0.584,73,0.869,74,0.511,88,1.121,105,0.992,129,1.697,137,3.403,162,0.94,212,1.573,241,2.415,409,4.192,879,6.326,897,4.936,942,5.611,1041,2.95,1086,1.626,1145,3.153,1249,4.192,1370,4.192,1371,5.82,1377,5.385,1905,5.385,2179,6.72,2220,5.385,2468,5.385,3266,7.953,3267,7.953,3268,5.941,3269,5.941]],["t/618",[3,0.819,18,1.868,49,1.169,50,0.892,56,1.554,71,0.567,73,0.845,74,0.527,88,1.09,105,0.964,115,2.783,129,1.649,157,4.295,162,0.913,172,2.701,212,1.528,237,3.011,241,1.753,290,4.321,291,3.056,386,3.064,487,1.979,516,4.877,521,4.073,533,4.612,534,3.94,1030,2.913,1041,2.867,1064,3.412,1086,1.58,1353,4.877,3084,4.877,3270,5.772,3271,5.772,3272,5.772,3273,5.772]],["t/620",[3,0.978,49,1.444,50,1.066,56,2.36,71,0.678,73,1.01,74,0.532,105,1.152,115,3.128,129,1.97,162,1.091,212,1.826,487,2.364,1064,3.017,1086,1.888,3274,8.767,3275,8.767,3276,6.898,3277,6.898]],["t/622",[3,0.687,45,0.907,49,1.035,50,0.749,71,0.476,73,1.011,74,0.547,88,1.304,96,2.299,105,0.809,108,1.337,125,1.553,162,0.766,200,3.683,212,1.282,241,1.471,290,3.936,291,2.488,331,3.06,343,4.708,345,5.495,347,2.945,393,2.595,825,6.788,1030,2.444,1086,1.326,1470,3.307,2180,6.191,2770,4.391,3278,4.844,3279,5.836,3280,4.093,3281,4.844,3282,7.414,3283,4.844,3284,4.844]],["t/624",[3,0.699,49,1.048,50,0.762,52,1.339,71,0.484,73,1.024,74,0.529,88,1.534,96,2.341,105,0.824,129,1.409,150,2.264,162,0.78,168,7.068,200,3.513,212,1.306,291,1.525,331,3.099,343,4.092,344,2.95,347,2.103,393,2.629,408,1.815,825,6.473,1086,1.35,1117,4.282,1281,2.276,1480,3.267,1906,3.941,1941,3.941,2180,5.736,3279,5.911,3280,4.168,3282,6.869,3285,6.995,3286,4.932,3287,4.932,3288,4.932,3289,6.995,3290,4.932,3291,4.932,3292,4.932]],["t/626",[3,0.916,18,2.091,50,0.998,71,0.635,73,0.945,74,0.532,88,1.219,105,1.079,129,1.845,160,2.508,162,1.022,212,1.71,241,1.961,386,3.429,863,4.924,1007,6.837,1084,2.258,1086,1.768,1131,3.626,2712,5.856,3293,6.459,3294,5.856,3295,6.459,3296,6.459,3297,8.405,3298,8.405,3299,6.459,3300,6.459]],["t/628",[3,0.819,45,1.081,48,1.941,49,1.324,50,1.206,56,2.1,71,0.567,73,1.142,74,0.518,75,3.717,101,4.877,105,0.964,140,2.124,149,3.178,150,1.868,157,3.178,162,0.913,212,1.528,331,2.557,347,3.768,1047,3.064,1063,1.386,1084,2.018,1086,1.58,1113,3.94,1114,3.823,1281,2.663,1671,8.01,1691,2.823,2210,4.073,2214,5.233,3301,5.772,3302,5.772,3303,7.8,3304,5.772,3305,5.772,3306,5.772]],["t/630",[3,1.022,18,2.332,49,1.079,50,1.113,71,0.708,73,1.054,74,0.448,88,1.36,105,1.203,108,1.988,148,2.707,162,1.14,172,3.37,212,1.907,235,2.022,241,2.187,408,2.65,913,5.491,1041,3.578,1086,1.972,1244,4.519,3307,7.203,3308,7.203,3309,7.203]],["t/632",[3,0.938,18,2.142,49,0.991,50,1.023,56,1.781,71,0.65,73,0.968,74,0.526,88,1.885,105,1.105,150,2.763,151,5.592,152,5.226,162,1.047,177,2.337,212,1.752,1086,1.811,1244,4.152,1281,3.053,1480,4.383,1501,5.044,3310,6.617,3311,8.537,3312,6.617]],["t/634",[2,2.893,3,0.601,48,2.107,49,1.117,50,0.655,71,0.416,73,0.917,74,0.562,88,0.8,105,0.708,162,0.67,191,4.435,212,1.122,226,3.837,233,4.19,235,1.76,239,2.334,240,2.744,278,4.187,321,2.174,367,5.296,368,4.778,438,2.29,468,3.231,848,2.535,882,2.659,937,2.659,1086,1.16,1244,2.659,1357,3.581,1432,2.99,1734,3.842,1792,2.807,1969,3.581,3228,3.386,3230,3.581,3231,3.386,3232,3.386,3313,4.238,3314,5.296,3315,3.581,3316,4.238,3317,4.238,3318,4.238,3319,3.581,3320,3.386,3321,3.581,3322,3.581,3323,3.581,3324,3.581,3325,3.581,3326,3.581,3327,3.581]],["t/636",[3,0.796,49,1.305,50,1.346,60,3.215,61,1.982,71,0.551,73,1.479,74,0.502,105,1.454,129,2.487,130,3.215,131,2.745,140,3.442,150,2.477,156,2.832,157,3.09,162,0.888,212,1.486,329,3.862,393,2.109,431,4.485,1084,3.045,1086,1.536,1114,5.069,1208,4.107,1281,2.59,1463,3.718,1550,4.485,3328,5.613,3329,5.613,3330,5.613]],["t/638",[3,0.909,45,1.2,48,2.155,49,1.253,50,0.991,51,3.923,56,1.725,60,3.671,61,2.263,63,3.287,71,0.63,73,0.938,74,0.522,76,3.287,83,3.183,84,3.923,88,1.21,105,1.07,108,1.769,116,2.877,129,1.83,162,1.014,211,2.916,212,1.697,326,3.402,887,4.021,1086,1.754,1691,3.134,1992,3.529,2144,5.81,3331,6.409,3332,6.409,3333,6.409]],["t/640",[3,1.011,38,3.717,45,1.11,48,2.397,49,0.888,50,1.102,51,2.406,52,1.608,60,2.252,61,1.388,63,2.016,71,0.386,73,1.044,74,0.547,76,2.016,83,1.952,84,2.406,88,1.499,105,1.191,108,1.085,116,1.765,140,2.921,150,1.272,162,0.622,172,3.715,177,1.388,180,3.322,183,3.322,187,4.734,212,1.041,240,1.446,326,2.087,882,2.466,1029,3.141,1030,1.984,1039,3.627,1086,1.076,1187,2.997,1214,3.466,1281,1.814,1471,3.925,1509,2.604,1691,1.922,1833,2.684,1992,2.164,2858,5.007,2861,3.564,2862,5.372,2873,3.141,2875,3.141,2916,3.564,2917,3.564,2918,3.564,2919,3.564,3119,3.564,3121,3.564,3122,3.564,3123,5.372,3210,2.604,3334,2.997,3335,3.931,3336,5.925,3337,3.931,3338,3.931,3339,3.931,3340,3.931,3341,3.931]],["t/642",[3,0.802,27,6.663,45,1.44,49,1.152,50,0.874,52,1.534,56,1.521,71,0.555,73,1.373,74,0.515,88,1.067,105,0.944,118,3.46,140,2.079,150,2.489,162,0.894,172,4.09,212,1.496,233,2.572,321,2.899,334,2.807,338,3.239,971,3.743,1030,2.852,1039,3.46,1086,1.547,1214,3.306,1344,3.858,1940,4.776,2954,5.627,3253,4.776,3334,4.308,3342,5.652,3343,5.652,3344,5.652,3345,5.652,3346,5.652,3347,5.652]],["t/644",[3,1.122,45,1.482,50,0.912,71,0.579,73,1.158,74,0.521,105,0.985,127,1.964,148,2.974,150,1.909,162,0.933,172,3.703,212,1.561,226,3.61,329,2.976,347,2.515,386,4.201,393,3.357,971,5.242,1026,4.026,1047,3.13,1086,1.614,1214,4.63,1281,2.721,1739,5.346,3104,4.496,3253,4.983,3348,4.983,3349,5.897,3350,5.897,3351,5.897,3352,5.897,3353,5.897,3354,5.897]],["t/646",[3,0.888,50,0.968,56,1.685,71,0.615,73,0.916,74,0.529,88,1.737,105,1.045,148,3.095,162,0.99,169,3.447,177,2.211,181,3.447,211,2.849,212,1.657,273,3.159,329,3.159,444,4.032,1047,3.323,1084,2.189,1086,1.714,1281,2.889,1480,4.147,1667,2.929,1696,6.58,1992,3.447,2746,5.29,2873,5.002,3355,5.676,3356,6.261,3357,6.261,3358,6.261]],["t/648",[3,0.995,18,3.144,50,1.085,56,2.386,71,0.689,73,1.027,74,0.534,88,1.673,105,1.172,129,2.004,162,1.11,169,3.863,212,1.858,434,4.648,922,6.756,1086,1.921,1384,5.929,3359,7.017]],["t/650",[3,1.193,49,0.572,50,1.3,71,0.57,73,1.231,74,0.566,88,0.721,99,1.31,105,1.306,129,2.403,140,1.406,154,2.235,162,0.604,169,2.103,172,1.788,181,2.103,212,1.535,300,4.29,611,4.243,1064,1.671,1086,1.046,1131,2.144,1572,5.257,1670,2.338,3045,2.795,3360,3.463,3361,8.412,3362,8.412,3363,3.82,3364,3.82,3365,3.82,3366,3.82,3367,3.82,3368,3.82,3369,3.82,3370,3.82,3371,3.82,3372,3.82,3373,3.82,3374,3.82,3375,3.82,3376,3.82,3377,3.82,3378,3.82,3379,5.798,3380,3.82,3381,3.82,3382,3.82,3383,7.008,3384,3.82,3385,3.82,3386,3.82]],["t/652",[3,0.74,45,0.977,48,2.446,49,1.256,50,0.806,51,3.193,52,1.416,60,2.988,61,1.842,63,2.676,71,0.512,73,0.763,74,0.514,76,2.676,83,2.591,84,3.193,88,1.864,105,0.871,108,1.44,116,2.342,129,1.49,140,1.919,154,3.052,162,0.825,169,2.872,172,2.441,177,1.842,212,1.381,240,1.919,300,5.13,326,2.769,1030,2.632,1039,3.193,1086,1.428,1131,4.085,1281,2.407,1691,2.551,1833,3.561,1992,2.872,3045,3.817,3210,3.455,3387,5.217,3388,5.217,3389,5.217,3390,5.217,3391,5.217,3392,8.38,3393,5.217]],["t/654",[3,0.717,48,1.699,49,1.234,50,0.781,52,1.372,56,1.361,71,0.497,73,0.74,74,0.531,88,0.954,105,0.844,115,3.363,118,3.094,129,1.444,140,1.86,154,2.957,162,0.8,169,2.783,172,3.855,177,1.785,212,1.338,240,1.86,300,4.357,334,2.51,487,2.44,1039,3.094,1055,3.853,1064,4.277,1086,1.384,1131,3.996,1145,2.683,1281,2.332,1470,3.451,1700,3.566,3045,3.699,3210,3.348,3360,4.582,3394,6.015,3395,4.271,3396,5.055,3397,7.118,3398,7.118,3399,7.118]],["t/656",[3,0.695,27,5.31,48,1.648,49,1.214,50,0.758,52,1.891,56,1.32,71,0.482,73,0.717,74,0.522,88,0.925,105,0.819,118,3.001,129,1.4,140,1.804,154,2.868,162,0.776,169,2.699,172,3.791,177,1.731,212,1.298,240,1.804,300,4.264,321,3.573,334,2.435,342,3.498,611,5.929,1030,2.474,1039,4.264,1055,3.737,1086,1.342,1131,3.91,1145,2.602,1214,2.868,1281,2.262,1344,3.347,1470,3.347,1700,3.459,3045,3.587,3210,3.247,3334,3.737,3395,4.142,3400,8.822,3401,4.902,3402,4.902,3403,6.965,3404,6.965,3405,6.965,3406,4.902]],["t/658",[3,0.708,27,5.379,48,1.678,49,1.226,50,0.772,52,1.915,56,1.344,71,0.49,73,0.731,74,0.517,88,0.942,105,0.834,118,3.056,129,1.426,140,1.837,154,2.921,162,0.79,169,2.749,172,3.829,177,1.763,212,1.322,240,1.837,300,4.319,321,3.619,334,2.48,338,2.972,342,4.206,1030,2.519,1039,4.319,1055,3.806,1086,1.367,1131,3.961,1145,2.65,1214,2.921,1281,2.303,1344,3.408,1470,3.408,1700,3.523,1756,2.986,2954,5.163,3045,3.653,3210,3.307,3334,3.806,3395,4.219,3407,4.993,3408,4.993,3409,4.993,3410,4.993,3411,7.056]],["t/660",[3,0.94,4,2.799,45,1.241,46,3.485,49,0.685,50,0.707,71,0.449,73,0.97,74,0.546,88,1.471,105,0.763,127,1.522,129,1.306,133,2.674,150,1.48,160,1.775,162,0.723,172,3.1,181,2.517,200,2.631,212,1.21,226,2.799,233,3.546,235,1.284,291,1.413,300,4.77,329,2.307,347,1.949,386,4.136,393,2.928,1026,3.121,1047,2.427,1086,1.251,1180,2.385,1231,3.121,1281,3.057,1769,3.485,1957,3.795,3104,3.485,3148,3.863,3149,3.863,3150,3.863,3156,3.863,3157,3.863,3159,3.863,3160,3.863,3348,3.863,3412,6.625,3413,4.572,3414,4.572,3415,4.572,3416,4.572,3417,4.144,3418,4.144,3419,4.144,3420,4.572]],["t/662",[3,0.868,49,0.917,50,0.946,71,0.601,73,1.187,74,0.55,105,1.022,129,1.748,162,0.968,169,3.369,212,1.62,245,2.993,291,1.892,338,2.577,393,2.3,468,4.665,703,4.318,937,6.079,1086,1.675,1642,4.89,3421,6.119,3422,6.119,3423,9.099,3424,6.119,3425,6.119,3426,6.119,3427,6.119,3428,6.119,3429,6.119]],["t/664",[3,1.046,18,1.722,49,1.489,50,1.309,52,1.444,71,0.522,73,1.338,74,0.507,88,1.004,105,1.414,116,2.388,129,1.519,148,1.999,162,0.841,199,2.684,211,2.421,212,1.408,338,2.24,444,3.426,471,4.69,591,4.495,594,4.055,1030,2.684,1041,4.205,1086,1.456,1501,4.055,2037,3.523,2859,4.25,2954,3.892,3262,4.822,3430,5.319,3431,5.319,3432,5.319,3433,5.319,3434,5.319,3435,5.319,3436,5.319,3437,5.319,3438,5.319,3439,7.376]],["t/666",[3,0.663,8,1.657,18,1.514,49,1.182,50,1.22,52,1.269,71,0.459,73,1.264,74,0.509,88,0.883,105,1.318,129,1.336,140,2.478,149,2.575,162,0.74,172,2.188,181,2.575,199,2.36,200,2.674,212,1.238,240,1.721,255,2.679,291,1.446,300,5.285,338,1.97,344,2.797,444,3.012,471,4.429,594,3.565,1030,3.398,1041,3.345,1047,2.482,1075,3.565,1086,1.28,1180,2.44,1214,3.94,1231,3.193,1501,3.565,1670,2.863,2037,3.098,2859,3.737,2875,3.737,2876,4.24,2884,4.24,2954,3.422,3013,6.306,3440,4.677,3441,4.677,3442,6.735,3443,4.677,3444,4.677,3445,4.677,3446,4.677,3447,4.677]],["t/668",[3,0.759,18,1.733,49,1.273,50,1.313,52,1.453,63,3.801,71,0.526,73,1.342,74,0.495,88,1.011,105,1.419,129,1.529,139,3.546,162,0.847,199,2.702,211,3.372,212,1.417,241,1.626,291,1.655,338,2.255,444,4.772,471,4.703,521,3.778,594,4.082,1030,2.702,1039,3.277,1041,3.68,1086,1.466,1472,4.854,1501,4.082,2037,3.546,2859,4.278,2954,3.918,3251,4.854,3256,4.854,3334,4.082,3448,5.354,3449,5.354,3450,4.854,3451,5.354,3452,5.354,3453,5.354,3454,5.354]],["t/670",[19,6.055,20,3.673,45,1.608,52,2.33,71,0.655,73,0.976,88,1.62,118,4.084,159,4.882,162,1.055,212,1.766,331,2.956,344,3.99,347,2.845,408,2.455,521,4.707,1047,3.541,1063,1.602,1086,1.826,1409,6.048,1424,6.055,1465,6.048,1474,6.28,1476,6.542,1478,5.637,3009,5.331,3455,6.671]],["t/672",[3,1.059,49,1.119,50,1.154,56,2.48,71,0.734,73,1.093,74,0.519,105,1.247,129,2.133,162,1.181,212,1.977,1086,2.044,3456,9.214,3457,6.77,3458,7.468,3459,7.468]],["t/674",[3,0.906,4,2.664,45,1.197,46,3.317,49,0.652,50,0.673,56,1.72,71,0.427,73,0.935,74,0.542,88,1.43,105,0.727,127,1.449,129,1.243,133,2.546,136,2.803,150,1.409,160,1.69,162,0.688,181,3.519,200,3.008,212,1.152,226,2.664,233,3.447,235,1.222,241,1.941,291,1.345,329,2.196,347,1.856,386,4.02,393,2.846,1026,2.971,1047,2.31,1086,1.191,1180,2.27,1231,4.363,1281,3.494,1769,4.872,1957,3.661,2284,3.945,2328,5.774,3104,3.317,3148,3.677,3149,3.677,3150,3.677,3156,3.677,3157,3.677,3159,3.677,3160,3.677,3348,3.677,3417,3.945,3418,3.945,3419,3.945,3460,6.391,3461,4.352,3462,4.352,3463,4.352,3464,4.352,3465,4.352]],["t/676",[3,1.022,49,1.35,50,1.113,71,0.708,73,1.054,74,0.512,105,1.203,129,2.057,131,4.406,138,3.893,162,1.14,212,1.907,235,2.022,408,3.315,1086,1.972,3457,6.53,3466,9.01,3467,7.203]],["t/678",[3,0.824,38,3.647,49,1.174,50,1.211,61,2.053,71,0.571,73,1.298,74,0.472,77,3.142,105,1.309,140,2.139,148,2.185,150,2.537,156,4.475,157,3.201,162,0.92,212,1.539,329,2.933,334,2.887,421,5.27,444,3.744,467,2.843,1084,2.74,1086,1.591,1463,3.85,1480,3.85,1992,3.201,2043,4.912,2443,4.645,2448,4.912,2670,5.27,2746,4.912,3320,4.645,3355,7.105,3468,5.813,3469,5.813,3470,5.813,3471,5.813,3472,5.813]],["t/680",[3,1.018,49,1.347,50,1.11,61,1.807,71,0.705,73,1.051,74,0.554,105,1.199,140,3.309,156,2.583,157,2.818,162,0.81,200,2.032,212,1.355,233,3.268,324,2.932,329,2.583,393,1.923,863,3.902,1063,1.229,1086,1.401,1114,4.756,1145,2.717,1395,2.105,1642,4.09,3473,5.118,3474,5.118,3475,8.295,3476,5.118,3477,5.118,3478,5.118,3479,5.118,3480,7.181,3481,5.118,3482,5.118,3483,5.118,3484,7.181,3485,5.118]],["t/682",[2,3.193,3,0.663,45,0.876,49,1.009,50,0.723,71,0.459,73,0.986,74,0.561,88,0.883,105,0.781,148,1.758,150,1.514,162,0.74,191,4.731,212,1.238,226,2.863,233,4.337,235,1.891,240,1.721,278,3.781,368,5.134,438,2.527,848,4.028,937,2.934,1086,1.28,1244,2.934,1432,3.3,1969,5.691,3228,5.381,3230,3.952,3231,3.737,3232,3.737,3314,3.952,3315,3.952,3319,3.952,3320,3.737,3321,3.952,3322,3.952,3323,3.952,3324,3.952,3325,3.952,3326,3.952,3327,3.952,3486,4.677]],["t/684",[2,3.052,3,0.634,45,0.838,49,0.977,50,0.691,71,0.439,73,0.954,74,0.56,88,0.844,105,0.747,148,1.68,150,1.447,162,0.707,191,4.667,212,1.184,226,2.737,233,4.27,235,1.83,240,1.645,278,3.659,368,4.969,438,2.416,848,3.899,937,2.805,1040,3.155,1086,1.224,1244,2.805,1432,3.155,1728,5.268,1831,3.778,3228,5.209,3231,3.573,3232,3.573,3314,3.778,3315,3.778,3319,3.778,3320,3.573,3321,3.778,3322,3.778,3323,3.778,3324,3.778,3325,3.778,3326,3.778,3327,3.778,3487,4.471,3488,4.471,3489,4.471]],["t/686",[3,1.059,18,2.417,71,0.734,74,0.497,115,2.664,150,2.417,162,1.181,212,1.977,269,5.269,434,4.946,487,2.56,942,6.501,1086,2.044,1131,4.192,1384,6.31,1940,6.31,3394,6.31,3490,7.468]],["t/688",[3,0.992,8,1.213,18,1.596,30,2.825,45,0.924,49,1.218,50,1.081,71,0.798,73,1.367,74,0.523,79,2.769,88,0.931,105,1.168,108,1.361,129,1.998,130,2.825,131,4.744,138,4.393,150,1.596,162,1.107,212,2.152,237,2.573,245,2.412,291,1.525,319,3.76,322,2.276,337,4.471,338,2.077,358,3.609,408,1.815,1086,2.225,1372,4.168,2106,4.471,2210,3.48,2672,4.471,3491,4.932,3492,4.932,3493,4.932,3494,4.932,3495,4.932,3496,4.932,3497,4.932,3498,4.932,3499,4.932]],["t/690",[3,1.014,18,1.646,45,0.953,49,1.239,50,1.105,52,1.381,71,0.5,73,1.21,74,0.47,88,0.96,99,1.744,105,1.194,108,1.973,115,1.814,148,2.687,149,2.8,150,1.646,162,0.805,169,2.8,191,3.982,211,3.253,212,1.347,239,2.8,241,1.544,290,2.487,291,1.572,324,2.913,380,4.298,386,2.7,406,2.913,408,1.871,487,1.744,983,4.298,988,4.064,1030,2.567,1059,5.044,1064,2.224,1074,3.722,1086,1.392,1145,2.7,1281,2.347,1471,3.369,1742,4.298,1835,3.276,2037,3.369,2103,4.298,2878,4.611,3214,4.611,3500,5.086,3501,5.086,3502,4.611,3503,5.086,3504,5.086,3505,5.086,3506,5.086]],["t/692",[3,0.843,45,1.113,49,1.192,50,0.918,70,4.192,71,0.584,73,1.164,74,0.511,105,0.992,108,1.64,130,3.403,131,3.889,138,3.21,162,0.94,199,4.013,212,1.573,237,4.149,291,1.837,338,2.502,408,2.186,471,4.599,659,7.21,1086,1.626,1337,5.429,1578,4.747,1689,4.347,1833,4.056,2037,3.935,2210,4.192,3502,5.385,3507,5.941,3508,7.953,3509,5.941,3510,5.941]],["t/694",[3,0.954,18,2.177,48,2.261,50,1.04,71,0.661,73,0.984,74,0.529,88,1.629,105,1.123,108,1.857,129,1.921,162,1.064,212,1.781,240,2.475,241,2.043,290,3.29,291,2.667,386,3.57,523,6.088,1041,3.341,1086,1.841,2478,6.098,2479,6.098,3294,6.098,3450,6.098]],["t/696",[3,0.686,45,0.567,48,1.625,49,1.204,50,0.747,71,0.475,73,0.707,74,0.539,88,1.655,97,1.657,105,0.807,108,0.835,109,1.526,115,1.724,152,1.852,162,0.478,177,1.068,198,0.666,226,1.852,233,2.2,235,0.849,237,1.578,243,2.003,255,2.769,291,2.132,322,1.396,347,1.29,393,1.137,454,3.685,476,2.37,477,3.537,487,1.657,895,2.891,897,2.661,948,2.742,1001,2.213,1075,3.685,1089,1.809,1467,1.323,1470,4.122,1549,3.113,1551,4.602,1688,2.556,1835,1.948,1957,2.769,2082,3.862,2180,3.411,2227,2.742,2325,2.213,2382,2.556,2971,4.382,3511,3.025,3512,3.025,3513,3.025,3514,3.025,3515,4.834,3516,4.834,3517,4.834,3518,6.037,3519,6.037,3520,4.834,3521,3.025,3522,8.039,3523,4.834,3524,3.025,3525,4.834,3526,3.025,3527,3.025,3528,3.025,3529,3.025,3530,3.025,3531,3.025,3532,3.025,3533,3.025,3534,6.037,3535,3.025,3536,3.025,3537,3.025,3538,3.025,3539,3.025,3540,3.025,3541,3.025,3542,3.025,3543,4.834,3544,4.834,3545,4.834,3546,3.025,3547,3.025,3548,3.025,3549,3.025,3550,3.025,3551,3.025,3552,3.025]],["t/698",[3,0.978,50,1.066,59,5.5,70,4.867,71,0.678,73,1.01,74,0.532,105,1.152,108,1.904,129,1.97,162,1.091,212,1.826,273,3.481,332,5.807,347,2.941,1041,3.426,1086,2.638,1204,4.867,3553,6.898,3554,6.898,3555,6.898]],["t/700",[71,0.842,162,1.356,212,2.269,487,2.937,1086,2.346,3556,8.569,3557,8.569]],["t/702",[3,0.895,18,2.042,49,1.384,50,1.428,56,1.698,71,0.62,73,1.352,74,0.52,105,1.542,108,1.742,150,2.042,162,0.998,212,1.67,235,1.771,338,2.657,408,2.321,471,3.236,1030,3.184,1086,2.265,3190,5.72,3558,6.309,3559,6.309,3560,6.309,3561,6.309,3562,6.309,3563,6.309,3564,6.309]],["t/704",[3,0.874,45,1.155,49,0.924,50,0.953,52,1.674,56,1.66,71,0.606,73,0.902,74,0.527,88,1.539,105,1.029,129,1.761,141,4.927,142,3.868,162,0.975,200,2.448,212,1.632,295,3.971,338,2.597,468,4.7,900,4.209,1086,1.688,1108,4.512,1131,3.461,1756,3.688,2858,5.21,3565,9.133,3566,6.166,3567,6.166,3568,6.166,3569,6.166,3570,6.166,3571,8.152,3572,6.166]],["t/706",[3,0.836,18,1.909,50,0.912,70,4.161,71,0.579,73,0.863,74,0.55,88,1.494,105,0.985,108,1.628,129,1.684,162,0.933,191,2.841,212,1.561,241,1.791,290,2.884,291,2.447,345,4.026,516,4.983,521,5.584,533,4.712,534,5.403,871,4.983,988,4.712,1041,2.929,1086,2.166,1338,3.906,3105,5.346,3133,5.346,3573,5.897,3574,5.897,3575,5.897,3576,5.897,3577,5.897]],["t/708",[3,0.916,49,1.259,50,0.998,59,5.862,71,0.635,73,0.945,74,0.523,105,1.079,108,2.579,129,1.845,162,1.022,212,1.71,235,1.814,273,4.241,332,5.567,357,5.458,1086,2.557,1204,4.558,1833,4.41,2523,7.619,2663,7.619,3578,6.459]],["t/710",[3,0.735,50,0.801,71,0.509,73,0.759,74,0.543,88,0.978,105,0.865,109,2.616,129,1.48,155,2.854,162,0.82,212,1.372,214,3.763,239,2.854,241,2.536,255,2.969,273,4.214,381,4.38,386,3.845,408,1.907,449,4.798,838,5.532,865,8.625,887,5.673,913,3.951,1030,2.616,1086,1.419,1338,4.798,1380,4.142,1392,4.38,1463,3.433,2075,4.699,3579,5.183,3580,5.183,3581,7.245,3582,5.183,3583,5.183]],["t/712",[3,0.938,50,1.023,71,0.65,73,1.249,74,0.514,105,1.105,129,1.89,131,4.884,138,5.108,162,1.047,212,1.752,233,3.011,245,3.236,338,2.787,347,2.822,1086,1.811,1482,5.287,2229,5.592,2815,5.287,2870,5.287,2871,5.287,3584,5.592,3585,6.617,3586,6.617,3587,5.592]],["t/714",[3,0.902,50,0.983,71,0.625,73,1.218,74,0.521,75,4.095,88,1.57,105,1.062,129,1.816,131,5.121,138,5.011,162,1.006,212,1.683,233,2.894,338,2.678,347,2.711,1086,1.74,1553,4.847,2815,5.081,2870,5.081,2871,5.081,3584,5.373,3587,5.373,3588,6.359,3589,6.359,3590,6.359]],["t/716",[3,0.946,50,1.031,71,0.655,73,1.256,74,0.515,88,1.62,105,1.114,129,1.905,131,4.899,138,5.128,162,1.055,212,1.766,233,3.036,338,2.81,1086,1.826,2815,5.331,2870,5.331,2871,5.331,3584,5.637,3587,5.637,3591,6.671,3592,6.671,3593,6.671]],["t/718",[3,0.916,50,0.998,56,2.515,71,0.635,73,0.945,74,0.523,81,4.053,105,1.079,115,2.998,129,1.845,144,3.429,162,1.022,212,1.71,241,1.961,386,3.429,487,2.214,897,4.628,1086,1.768,1131,3.626,1407,5.161,1410,4.924,1686,4.41,3084,5.458,3394,5.458,3594,8.405,3595,6.459,3596,6.459,3597,6.459]],["t/720",[3,0.759,8,1.823,45,1.003,49,0.802,50,0.828,71,0.526,73,1.084,74,0.537,88,1.399,96,2.542,105,0.894,108,1.478,125,1.717,129,1.529,162,0.847,200,2.942,212,1.417,241,1.626,290,2.618,291,1.655,331,3.283,347,3.16,349,5.92,350,4.278,393,2.785,825,5.422,1030,2.702,1086,1.466,1470,3.655,1508,3.778,2180,3.778,3152,4.854,3279,6.261,3280,4.524,3282,4.524,3598,5.354,3599,5.354,3600,5.354,3601,5.354,3602,5.354,3603,5.354,3604,5.354,3605,5.354,3606,5.354]]],"invertedIndex":[["",{"_index":74,"t":{"6":{"position":[[531,1],[533,2],[586,2],[605,2],[608,3],[612,1],[810,1],[812,2],[865,2],[884,2],[906,2],[967,2],[985,2],[1018,2],[1021,3],[1025,1],[1167,1],[1169,2],[1205,2],[1242,2],[1245,3],[1249,2],[1461,2],[1505,2]]},"8":{"position":[[143,1],[149,2],[202,1],[241,2],[264,1]]},"10":{"position":[[329,2],[639,2],[685,3],[727,1],[766,2],[780,2],[867,1],[897,1],[899,1],[920,2],[923,2],[962,2],[984,2],[1062,1],[1084,2],[1087,2],[1090,1],[1119,1],[1121,1],[1141,2],[1144,2],[1158,1],[1198,2],[1211,2],[1297,1],[1330,1],[1332,1],[1349,2],[1352,2],[1375,2]]},"12":{"position":[[271,2]]},"17":{"position":[[58,2]]},"21":{"position":[[40,2],[62,2],[156,2],[174,2],[181,1],[194,1],[213,2],[226,2],[229,3]]},"23":{"position":[[380,2],[383,3]]},"25":{"position":[[448,2],[460,2],[470,2],[480,2],[490,2]]},"27":{"position":[[134,2],[137,3]]},"29":{"position":[[190,2],[193,3]]},"31":{"position":[[429,2],[432,3]]},"33":{"position":[[197,2],[200,3]]},"35":{"position":[[210,2],[213,3]]},"37":{"position":[[158,2],[161,3]]},"39":{"position":[[201,2],[204,3]]},"41":{"position":[[241,2],[244,3]]},"43":{"position":[[148,2],[214,2],[217,2],[235,2],[297,2],[325,2],[328,2],[343,1],[386,2],[389,2],[459,2],[490,2],[493,2],[737,2],[740,3]]},"45":{"position":[[182,2],[185,3]]},"47":{"position":[[178,2],[181,3]]},"49":{"position":[[109,2],[166,2],[169,2],[236,2],[331,2],[388,2],[391,3]]},"51":{"position":[[162,2],[228,2],[231,2],[298,2],[402,2],[468,2],[471,3],[772,2],[775,3],[1153,2],[1156,3],[1225,2],[1289,1],[1291,2],[1347,2],[1387,2],[1436,1],[1448,2],[1502,2],[1505,2],[1580,2],[1690,2],[1754,2],[1859,2],[1862,3]]},"53":{"position":[[168,2],[171,3]]},"55":{"position":[[138,2],[141,3]]},"57":{"position":[[217,2],[220,3]]},"59":{"position":[[188,2],[191,3]]},"61":{"position":[[98,2],[131,2],[175,2],[229,1],[255,2],[258,3]]},"63":{"position":[[157,2],[160,3]]},"65":{"position":[[154,2],[157,3]]},"67":{"position":[[158,2],[161,3]]},"69":{"position":[[97,2],[116,2],[119,3]]},"71":{"position":[[255,2],[300,2],[303,3]]},"73":{"position":[[190,1],[216,2],[219,3]]},"75":{"position":[[158,2],[175,2],[178,3]]},"77":{"position":[[146,2],[164,2],[167,3]]},"79":{"position":[[232,2],[252,2],[255,3]]},"81":{"position":[[268,1],[287,2],[312,2],[315,2],[318,3]]},"83":{"position":[[46,1],[58,1],[66,2],[96,1],[105,2],[135,1],[144,2],[173,1],[181,2],[212,1],[222,2],[247,1],[258,2],[291,1],[303,2],[336,1],[348,2],[379,1],[389,2],[418,1],[426,1],[468,1],[482,1],[508,1],[536,1],[570,1],[610,1],[657,1],[704,1],[758,1],[805,1],[852,1],[904,1],[958,1],[1018,1],[1084,1],[1157,1],[1199,1],[1252,1],[1269,1],[1275,2],[1319,1],[1325,2],[1361,1],[1367,2],[1402,1],[1408,2],[1429,1],[1435,2],[1468,1],[1474,2],[1508,1],[1514,2],[1567,1],[1573,2],[1608,1],[1614,2],[1652,1],[1658,2],[1698,1],[1704,2],[1739,1],[1745,2],[1785,1],[1791,2],[1821,1],[1827,2],[1869,1],[1875,2],[1917,1],[1923,2],[1954,1],[1960,2],[1994,1],[2000,2],[2037,1],[2043,2],[2075,1],[2081,2],[2124,1],[2130,2],[2173,1],[2179,2],[2211,1],[2217,2],[2255,1],[2261,2],[2300,1],[2306,2],[2341,1],[2347,2],[2381,1],[2387,2],[2429,1],[2435,2],[2474,1],[2480,2],[2523,1],[2529,2],[2567,1],[2573,2],[2607,1],[2613,2],[2643,1],[2649,2],[2689,1],[2695,2],[2740,1],[2746,2],[2791,1],[2797,2],[2841,1],[2847,2],[2894,1],[2900,2],[2955,1],[2961,2],[3002,1],[3008,2],[3041,1],[3047,2],[3091,1],[3097,2],[3142,1],[3148,2],[3179,1],[3185,2],[3226,1],[3232,2],[3265,1],[3271,2],[3311,1],[3317,2],[3364,1],[3370,2],[3407,1],[3413,2],[3462,1],[3468,2],[3516,1],[3522,2],[3563,1],[3569,2],[3609,1],[3615,2],[3651,1],[3657,2],[3701,1],[3707,2],[3747,1],[3753,2],[3802,1],[3808,2],[3855,1],[3861,2],[3904,1],[3910,2],[3947,1],[3953,2],[3988,1],[3994,2],[4045,1],[4051,2],[4066,1],[4079,1],[4095,1],[4124,2],[4159,1],[4190,2],[4226,1],[4260,2],[4292,1],[4320,2],[4351,1],[4378,2],[4417,1],[4452,2],[4488,1],[4520,2],[4560,1],[4596,2],[4631,1],[4664,2],[4695,1],[4722,2],[4749,1],[4772,2],[4809,1],[4842,2],[4884,1],[4921,2],[4963,1],[5003,2],[5044,1],[5080,2],[5124,1],[5163,2],[5215,1],[5262,2],[5300,1],[5336,2],[5366,1],[5391,2],[5432,1],[5469,2],[5511,1],[5549,2],[5577,1],[5602,2],[5640,1],[5675,2],[5705,1],[5732,2],[5769,1],[5803,2],[5847,1],[5886,2],[5920,1],[5954,2],[6000,1],[6046,2],[6091,1],[6136,2],[6174,1],[6212,2],[6249,1],[6282,2],[6315,1],[6344,2],[6385,1],[6422,2],[6459,1],[6492,2],[6538,1],[6580,2],[6624,1],[6664,2],[6704,1],[6742,2],[6776,1],[6807,2],[6839,1],[6869,2],[6917,1],[6965,2],[6980,1],[7028,1],[7050,1],[7092,1],[7140,1],[7186,1],[7217,1],[7244,1],[7282,1],[7316,1],[7341,1],[7366,1],[7393,1],[7430,1],[7470,1],[7496,1],[7520,1],[7550,1],[7584,1],[7615,1],[7636,1],[7659,1],[7694,1],[7734,1],[7776,1],[7819,1],[7848,1],[7874,1],[7905,1],[7933,1],[7964,1],[8004,1],[8045,1],[8078,1],[8102,1],[8131,1],[8164,1],[8215,1],[8284,1],[8349,1],[8413,1],[8478,1],[8538,1],[8599,1],[8667,1],[8714,1],[8749,1],[8809,1],[8857,1],[8874,1],[8906,1],[8952,1],[8995,1],[9036,1],[9077,1],[9116,1],[9149,1],[9173,1],[9201,1],[9242,1],[9285,1],[9332,1],[9377,1],[9414,1],[9446,1],[9470,1],[9490,1],[9513,1],[9546,1],[9582,1],[9609,1],[9632,1],[9662,1],[9699,1],[9731,1],[9756,1],[9794,1],[9860,1],[9932,1],[9980,1],[10014,1],[10053,1],[10103,1],[10165,1],[10225,1],[10281,1],[10331,1],[10374,1],[10411,1],[10449,1],[10488,1],[10516,1],[10539,1],[10566,1],[10593,1],[10616,1],[10637,1],[10672,1],[10719,1],[10773,1],[10824,1],[10873,1],[10926,1],[10970,1],[11010,1],[11055,1],[11089,1],[11112,1],[11133,1],[11165,1],[11197,1],[11223,1],[11256,1],[11291,1],[11325,1],[11359,1],[11394,1],[11422,1],[11460,1],[11503,1],[11535,1],[11573,1],[11611,1],[11648,1],[11668,1]]},"86":{"position":[[349,2],[352,2],[388,2],[391,2],[429,2],[432,2],[480,2],[549,2],[868,2],[871,2],[914,2],[917,2],[962,2],[965,2],[1188,2],[1276,1],[1278,2],[1366,2],[1444,2],[1509,2],[1559,2],[1627,2],[1676,2],[1738,2],[1784,2],[1850,2],[1905,2],[1974,2],[2025,2],[2072,2],[2075,2],[2105,1],[2172,2],[2219,2],[2286,2],[2289,2],[2347,2],[2423,2],[2426,2],[2475,2],[2546,2],[2549,2],[2598,1],[2608,2],[2752,1],[2781,2]]},"88":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"90":{"position":[[133,1],[139,2],[160,2],[201,2],[219,1],[271,1],[309,2],[343,1]]},"92":{"position":[[156,1],[162,2],[181,2],[200,2],[221,2],[325,2],[351,2],[383,2],[419,2],[422,2],[425,1]]},"94":{"position":[[146,1],[152,2],[171,2],[201,2],[212,2],[241,2],[277,2],[318,2],[337,2],[366,2],[402,2],[443,2],[490,1]]},"96":{"position":[[186,1],[192,2],[249,1],[288,2],[355,2],[385,2],[428,1]]},"98":{"position":[[119,1],[125,2],[167,1],[171,2],[174,3],[178,1]]},"104":{"position":[[112,1],[139,1],[152,1],[166,1],[172,2],[257,2],[292,3],[296,1],[298,2],[347,1],[356,1],[358,1],[360,1],[411,1],[419,1],[421,1],[423,2],[426,1],[428,1],[480,1],[488,1],[490,1],[492,2],[495,1],[497,1],[553,1],[555,1],[557,1]]},"106":{"position":[[126,1],[153,1],[166,1],[180,1],[186,2],[373,2],[451,2],[486,3],[490,1],[492,2],[539,1],[548,1],[550,1],[552,1],[596,4],[616,2],[619,1],[685,2],[688,1],[760,1],[762,2],[765,1],[767,1],[795,3],[807,4],[827,2],[830,1],[858,3],[893,2],[896,1],[924,3],[962,1],[964,2],[979,1],[981,1],[1055,1],[1057,2],[1072,1],[1074,1],[1148,1],[1150,2],[1158,1]]},"108":{"position":[[111,1],[138,1],[151,1],[165,1],[171,2],[230,2],[275,3],[279,1],[281,2],[328,1],[337,1],[381,4],[401,1]]},"110":{"position":[[211,1],[217,2],[272,1],[336,2],[379,3],[383,1],[385,2],[412,1],[421,1],[423,1],[468,4],[488,1],[490,1]]},"112":{"position":[[39,1],[51,2]]},"116":{"position":[[113,2],[157,2]]},"118":{"position":[[307,1],[349,1],[453,2],[456,1]]},"120":{"position":[[194,1],[236,1],[340,2],[343,1]]},"122":{"position":[[390,1],[432,1],[607,2],[610,1]]},"124":{"position":[[439,1],[481,1],[656,2],[659,1]]},"126":{"position":[[205,2],[295,1]]},"128":{"position":[[347,2],[427,1],[454,2],[457,2],[516,2],[519,2],[562,2],[565,2],[585,2],[681,2],[706,2],[723,2],[772,2],[790,1],[800,2],[855,2],[858,2],[875,1]]},"133":{"position":[[155,2],[177,2],[192,2],[195,3]]},"135":{"position":[[76,2],[97,2],[232,2],[235,2],[238,3],[347,2],[508,1],[515,1],[1000,1],[1335,1],[5038,1],[5333,2],[5336,2],[5917,2],[6901,2]]},"137":{"position":[[174,1],[227,2]]},"139":{"position":[[104,2],[146,2],[188,2],[211,1],[251,1],[258,1],[295,1],[297,2],[300,3]]},"143":{"position":[[6,1],[25,1],[96,1]]},"145":{"position":[[107,1],[140,1],[167,1],[207,1]]},"149":{"position":[[441,1],[492,1],[514,1],[562,1],[583,1],[585,2],[588,3],[592,2]]},"153":{"position":[[127,1],[172,3],[235,1],[277,2],[313,2],[390,2],[397,1],[406,1],[477,2],[514,2],[587,2]]},"155":{"position":[[124,2]]},"159":{"position":[[95,1],[195,1],[325,1],[412,1],[510,1],[591,1],[704,1],[846,1]]},"162":{"position":[[20,1],[118,1],[132,1],[134,2],[155,2],[170,2],[187,1],[253,2],[274,1],[339,2],[382,1],[430,1],[459,1],[512,1],[544,1]]},"164":{"position":[[20,1],[118,1],[132,1],[134,2],[155,2],[170,2],[190,1],[253,2],[296,1],[349,1],[420,1],[473,2],[476,1]]},"166":{"position":[[20,1],[112,1],[126,1],[128,2],[146,1],[207,2],[225,1],[302,2],[359,1],[392,1],[430,1]]},"168":{"position":[[20,1],[112,1],[126,1],[132,2],[172,2],[247,1],[280,1],[318,1]]},"170":{"position":[[20,1],[112,1],[126,1],[132,2],[183,2],[258,1],[302,1],[317,2],[360,2],[367,1],[380,1],[416,1],[418,1],[442,1]]},"176":{"position":[[77,1],[160,1],[238,2],[366,2],[369,3],[373,2],[516,2],[580,1],[590,2],[600,2],[608,2],[617,1],[631,1],[641,2],[652,2],[660,2],[672,1],[686,1],[701,2],[743,1],[786,2],[841,3]]},"178":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[236,2],[239,2],[305,2],[366,2],[425,2],[475,2],[478,2],[527,2],[573,2],[619,2],[669,2],[724,2],[770,2],[773,2],[837,2],[907,2],[992,2],[995,2],[1048,2],[1106,2],[1109,2],[1165,2],[1223,2],[1226,2],[1282,1]]},"180":{"position":[[18,1],[182,1]]},"186":{"position":[[77,1],[156,1],[234,2],[284,2],[389,1],[417,2],[427,2],[445,1],[480,3],[638,1],[656,2],[729,1],[759,2],[802,1],[838,2],[841,3],[883,1],[957,2]]},"188":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[255,2],[258,2],[282,1],[321,2],[427,2],[430,2],[456,2],[459,2],[508,2],[567,2],[570,2],[616,2],[687,2],[690,2],[728,1],[730,2],[767,2],[770,1],[809,2],[898,2],[901,2],[977,2],[1031,2],[1034,2],[1109,2],[1181,1],[1191,2],[1194,2],[1238,2],[1335,2],[1408,2],[1428,2],[1431,2],[1459,2],[1501,2],[1572,2],[1575,2],[1648,1]]},"190":{"position":[[18,1],[53,1],[153,1],[189,2],[328,1]]},"196":{"position":[[77,1],[159,1],[237,2],[290,2],[403,2],[408,3],[412,2],[519,1],[537,2],[557,2],[592,2],[597,3]]},"198":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[240,2],[243,2],[278,2],[299,2],[318,2],[339,2],[376,1]]},"200":{"position":[[18,1],[60,1]]},"202":{"position":[[0,2],[28,1],[44,1],[62,1],[81,1],[106,1],[110,1]]},"208":{"position":[[77,1],[155,1],[233,2],[282,2],[458,3],[959,1],[993,2],[1010,2],[1013,3]]},"210":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[282,2],[352,2],[355,2],[449,2],[488,2],[491,2],[559,2],[630,2],[633,2],[660,3],[684,2],[760,2],[812,2],[815,2],[895,2],[967,2],[1041,2],[1044,2],[1071,3],[1095,2],[1168,2],[1242,2],[1314,2],[1363,2],[1366,2],[1422,2],[1495,2],[1506,2],[1509,2],[1536,3],[1561,2],[1638,2],[1656,2],[1659,2],[1700,1]]},"212":{"position":[[18,1],[76,4],[227,2],[230,5],[250,3],[294,3],[309,1]]},"218":{"position":[[77,1],[155,1],[233,2],[282,2],[447,1],[532,1],[534,3],[538,2],[541,3]]},"220":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[265,2],[333,2],[353,2],[374,2],[394,2],[414,2],[433,2],[454,2],[457,2],[503,2],[506,2],[567,2],[634,2],[688,2],[718,2],[745,3],[769,2],[797,2],[824,3],[846,2],[885,2],[937,2],[979,2],[1033,2],[1087,2],[1143,2],[1211,2],[1271,2],[1331,2],[1334,2],[1358,1],[1395,2],[1449,2],[1452,2],[1509,2],[1568,2],[1623,2],[1626,2],[1648,2],[1669,2],[1710,2],[1713,2],[1773,2],[1809,2],[1812,2],[1885,2],[1888,2],[1999,1]]},"222":{"position":[[18,1],[49,1],[121,1],[234,1]]},"224":{"position":[[6,1],[19,1],[36,1]]},"226":{"position":[[58,2],[75,2],[166,3]]},"228":{"position":[[1107,1],[1138,1]]},"232":{"position":[[77,1],[160,1],[238,2],[292,2],[401,2],[404,3],[408,3]]},"234":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[264,2],[267,2],[396,2],[484,2],[487,2],[648,2],[712,2],[715,2],[768,1]]},"236":{"position":[[18,1],[65,1],[99,2],[125,2],[168,1],[208,2],[237,1]]},"238":{"position":[[6,1],[26,1],[64,1],[70,1]]},"244":{"position":[[77,1],[157,1],[235,2],[305,2],[443,3],[529,4],[534,3],[538,1]]},"246":{"position":[[24,1],[34,1],[106,1],[108,1]]},"248":{"position":[[0,2],[64,1],[66,2],[164,2],[268,1]]},"254":{"position":[[0,2],[72,2]]},"256":{"position":[[77,1],[164,1],[242,2],[270,2],[389,2],[500,2],[698,3],[702,2],[709,1],[782,1],[813,1],[834,2],[837,2],[845,1],[914,1],[974,2],[988,2]]},"258":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[249,2],[252,2],[300,2],[339,1],[357,2],[360,2],[439,2],[551,2],[590,2],[593,2],[689,2],[728,2],[731,2],[827,1]]},"260":{"position":[[18,1],[71,3],[127,1]]},"262":{"position":[[307,2],[330,3],[432,3]]},"268":{"position":[[77,1],[155,1],[233,2],[282,2],[289,1],[379,1],[418,2],[421,2],[506,3],[510,2],[517,1],[610,1],[649,2]]},"270":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[264,2],[328,2],[394,2],[462,2],[529,2],[595,2],[661,2],[704,1]]},"272":{"position":[[18,1],[52,1]]},"278":{"position":[[77,1],[166,1],[254,1],[341,1],[429,2],[592,1],[689,5],[695,1],[732,1],[765,1]]},"280":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,1]]},"282":{"position":[[18,1],[39,1]]},"288":{"position":[[77,1],[158,1],[236,2],[288,2],[411,3]]},"290":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[259,2],[262,2],[284,2],[299,2],[326,2],[329,2],[377,2],[457,2],[522,2],[525,2],[578,2],[661,2],[664,2],[733,1]]},"292":{"position":[[18,1],[45,3],[103,1]]},"294":{"position":[[98,1],[262,1]]},"298":{"position":[[77,1],[161,1],[239,2],[337,3],[341,2],[529,3]]},"300":{"position":[[110,1],[227,1],[229,2],[289,2],[370,1],[376,2],[456,3],[460,2],[558,2],[614,2],[780,3],[815,1]]},"302":{"position":[[55,1],[168,1],[182,1],[188,2],[284,3],[319,1]]},"304":{"position":[[55,1],[171,1],[185,1],[191,2],[301,3],[336,1]]},"306":{"position":[[58,1],[174,1],[188,1],[194,2],[306,3],[341,1]]},"308":{"position":[[55,1],[174,1],[188,1],[194,2],[290,3],[325,1]]},"310":{"position":[[53,1],[137,2],[260,1],[274,1],[290,2],[309,2],[316,1],[329,1],[335,2],[413,3],[448,1]]},"312":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[240,2],[285,2],[288,2],[343,2],[346,2],[408,2],[447,2],[450,2],[485,2],[488,2],[509,2],[551,2],[581,2],[584,2],[640,2],[679,2],[682,2],[745,2],[792,2],[859,2],[862,2],[920,2],[978,2],[981,2],[1003,2],[1050,2],[1096,2],[1132,2],[1135,2],[1157,2],[1216,1]]},"314":{"position":[[18,1],[62,3],[134,3],[138,1]]},"320":{"position":[[20,1],[100,1],[114,1],[120,2],[195,1],[229,2],[252,1]]},"322":{"position":[[0,2],[64,1],[66,2],[113,2],[166,2],[183,2],[236,2],[258,2],[322,2],[339,2],[380,2],[460,2],[474,2],[519,2],[544,2],[605,2],[630,2],[657,3],[690,2],[707,2],[760,2],[782,2],[840,2],[858,2],[925,2],[947,2],[974,3],[1002,2],[1034,2],[1110,2],[1140,2],[1213,2],[1245,2],[1320,2],[1344,2],[1403,2],[1429,2],[1490,2],[1512,2],[1573,2],[1610,2],[1674,1]]},"324":{"position":[[18,1],[377,1]]},"326":{"position":[[89,1],[147,1]]},"330":{"position":[[77,1],[162,1]]},"334":{"position":[[57,1],[72,2],[75,3],[79,3]]},"336":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[258,2],[317,2],[320,2],[345,1],[382,2],[456,2],[459,2],[516,2],[606,2],[609,2],[749,2],[841,2],[844,2],[921,2],[955,2],[958,2],[1035,2],[1087,2],[1090,2],[1178,1]]},"338":{"position":[[18,1],[58,1],[60,2],[166,2],[182,1],[269,1],[280,2],[297,2],[303,1],[305,2],[374,2],[415,1],[428,2],[468,2],[538,2],[594,1]]},"344":{"position":[[20,1],[133,1],[139,1],[148,1],[181,1],[243,1],[258,2],[301,2],[392,2],[397,1],[416,1],[468,1],[482,1],[488,2],[503,2],[687,3],[729,1],[782,2],[805,1],[813,1],[837,1],[878,2],[990,2],[1092,2]]},"346":{"position":[[159,1],[291,1],[297,1],[306,1],[353,1],[445,1],[447,1],[509,1],[524,2],[567,2],[658,2],[663,1],[682,1],[734,1],[771,1],[785,2],[836,2],[859,1],[897,1],[912,1],[914,1],[928,1],[942,1],[948,2],[1078,3],[1120,1],[1153,2],[1207,1],[1260,2],[1306,1],[1361,2],[1384,1],[1408,1],[1410,1],[1473,2],[1484,1],[1621,2],[1652,1],[1777,2]]},"348":{"position":[[20,1],[133,1],[141,1],[150,1],[174,1],[188,1],[194,2],[224,2],[311,1],[326,2],[369,2],[460,2],[465,1],[484,1],[536,2],[539,2],[580,1],[613,2],[677,1],[730,2],[753,1],[777,1],[779,1],[842,2],[853,1],[982,2]]},"350":{"position":[[0,2],[64,1],[66,2],[113,2],[166,2],[238,2],[293,2],[366,2],[410,2],[491,2],[562,2],[598,2],[649,2],[669,2],[690,2],[710,2],[729,2],[749,2],[787,2],[841,2],[896,2],[989,2],[1058,2],[1107,1]]},"352":{"position":[[18,1],[69,1],[87,2],[140,1],[149,2],[180,1],[248,1],[333,2],[357,1],[429,1]]},"358":{"position":[[77,1],[158,1],[236,2],[288,2],[397,1],[413,2],[428,2],[455,1],[510,1],[544,2],[586,1],[624,2],[655,3]]},"360":{"position":[[195,1],[254,3],[407,1],[442,1],[459,1],[478,1],[503,1]]},"362":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[287,2],[290,2],[312,2],[390,2],[393,2],[431,1],[433,2],[450,2],[453,1],[492,2],[568,2],[571,2],[585,1],[624,2],[680,2],[683,2],[720,1],[722,2],[774,2],[777,1],[806,2],[852,2],[877,2],[880,2],[922,2],[968,1],[992,2],[995,2],[1041,2],[1095,2],[1098,2],[1173,2],[1244,2],[1247,2],[1324,1]]},"364":{"position":[[18,1],[50,1],[105,1],[121,2],[163,1],[214,2],[309,1]]},"366":{"position":[[58,2],[75,2],[172,3]]},"372":{"position":[[77,1],[157,1],[416,2],[467,2],[510,2],[633,3],[637,2],[718,2],[833,3],[837,2],[858,1],[1012,3],[1016,2],[1048,2],[1124,2],[1131,1],[1175,1],[1244,3],[1248,2],[1446,1],[1496,2],[1499,2],[1502,3],[1506,2],[1673,1],[1704,2],[1722,1],[1756,1],[1758,2],[1761,3],[1765,2],[1872,3]]},"374":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[289,2],[330,2],[333,2],[401,2],[447,2],[450,2],[521,2],[556,2],[559,2],[648,2],[734,2],[737,2],[786,2],[879,2],[882,2],[928,2],[989,2],[992,2],[1018,1],[1064,2],[1109,2],[1112,2],[1151,2],[1215,2],[1218,2],[1324,1]]},"376":{"position":[[18,1],[175,1],[236,1]]},"378":{"position":[[0,2],[26,1],[35,1],[51,1],[71,1],[95,1],[116,1],[131,1],[145,1],[161,1],[180,1],[199,1],[215,1],[229,1],[247,1],[269,1],[280,2],[310,1],[322,2],[353,1],[389,1],[405,2],[441,1],[450,2],[479,1],[510,1],[537,1],[556,1],[566,2],[616,1],[628,2],[659,1],[674,2],[706,1],[722,2],[750,1],[761,2],[786,1],[796,2],[822,1],[834,2],[862,1],[874,2],[893,1],[910,1],[927,1],[947,1],[966,1],[986,1],[1006,1],[1024,1],[1043,1],[1053,1]]},"384":{"position":[[77,1],[158,1],[236,2],[336,2],[379,2],[416,2],[740,2],[749,1],[846,2]]},"386":{"position":[[0,2],[64,1],[66,2],[88,2],[91,2],[142,2],[160,2],[163,2],[217,2],[279,2],[282,2],[323,2],[394,2],[397,2],[452,2],[500,2],[503,2],[549,2],[598,1],[631,2],[634,2],[745,2],[799,1],[832,2],[835,2],[955,1]]},"388":{"position":[[18,1],[297,3],[301,1]]},"394":{"position":[[77,1],[156,1],[234,2],[284,2],[327,2],[501,2]]},"396":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[255,2],[317,2],[348,2],[351,2],[373,2],[390,1]]},"398":{"position":[[18,1],[39,1]]},"402":{"position":[[0,2],[110,2],[257,2],[400,2],[634,2],[822,2],[1020,2],[1212,2]]},"404":{"position":[[77,1],[156,1],[234,2],[301,2],[404,2],[407,2],[586,2],[589,2],[673,2],[846,2],[1034,3],[1038,2],[1110,1],[1116,2],[1171,2],[1196,2],[1203,1],[1216,1],[1218,2],[1311,2],[1314,2],[1406,1],[1415,2],[1468,2],[1475,1],[1488,1],[1490,2],[1583,2],[1586,2],[1695,1],[1704,2],[1763,1],[1773,2],[1780,1],[1793,1],[1795,2],[1888,2],[1891,2],[1984,1],[1993,2],[2070,2],[2077,1],[2090,1],[2092,2],[2185,2],[2188,2],[2351,2],[2354,3],[2358,2],[2534,2],[2577,1],[2634,2],[2678,1],[2735,2],[2738,3],[2742,2],[2950,3]]},"406":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[256,2],[259,2],[302,2],[355,2],[358,2],[387,2],[436,2],[439,2],[493,2],[544,2],[547,2],[602,2],[671,2],[674,2],[727,2],[780,2],[825,2],[891,2],[965,2],[1039,2],[1096,2],[1154,2],[1231,2],[1300,1]]},"408":{"position":[[18,1],[122,1]]},"414":{"position":[[77,1],[158,1],[236,2],[288,2],[373,1],[397,2]]},"416":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[244,2],[247,2],[297,2],[359,2],[362,2],[461,1]]},"418":{"position":[[18,1],[109,1]]},"424":{"position":[[20,1],[102,1],[116,1],[122,2],[238,2],[258,3],[303,1],[342,2],[388,1],[421,1],[423,1],[440,2],[463,1]]},"426":{"position":[[0,2],[64,1],[66,2],[115,2],[168,2],[252,2],[297,2],[319,2],[338,2],[358,2],[396,2],[465,2],[501,2],[544,2],[642,1]]},"428":{"position":[[18,1],[59,1]]},"434":{"position":[[77,1],[160,1],[238,2],[292,2],[427,1],[448,2],[451,3]]},"436":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[262,2],[265,2],[316,2],[383,2],[386,2],[443,2],[509,2],[547,2],[550,2],[605,1]]},"438":{"position":[[199,1],[300,1]]},"444":{"position":[[20,1],[101,1],[115,1],[121,2],[235,2],[238,3],[283,1],[322,2],[368,1],[401,1],[403,1],[420,2],[443,1]]},"450":{"position":[[77,1],[158,1],[236,2],[265,2],[313,2],[368,1],[370,2],[408,2],[431,2],[438,1],[451,1],[453,2],[471,2],[491,2],[533,2],[554,2],[569,2],[603,2],[629,2],[652,2],[659,1],[672,1],[674,2],[748,1],[753,2],[776,2],[796,2],[803,1],[816,1],[871,2]]},"452":{"position":[[0,2],[64,1],[66,2],[94,2],[124,1],[161,2],[208,2],[270,2],[341,2],[384,2],[455,2],[520,2],[550,2],[577,3],[601,2],[629,2],[656,3],[678,2],[717,2],[769,2],[811,2],[865,2],[894,2],[950,2],[1018,2],[1055,2],[1112,2],[1155,2],[1222,2],[1276,2],[1339,2],[1378,1]]},"454":{"position":[[18,1],[43,1],[161,1]]},"456":{"position":[[6,1],[28,1],[59,1],[92,1],[102,1]]},"458":{"position":[[58,2],[75,2],[124,2],[173,2]]},"464":{"position":[[77,1],[155,1],[245,1],[251,2],[323,1],[345,2],[364,3],[408,1],[457,2],[491,1],[533,1],[586,1]]},"470":{"position":[[77,1],[158,1],[248,1],[254,2],[271,2],[299,1],[314,2],[358,1],[373,2],[426,2],[433,1],[481,1],[494,1],[585,1],[653,1],[661,2],[688,1],[695,1],[726,1],[728,1],[738,1],[777,1],[788,1],[801,1],[1026,1],[1075,1],[1081,2],[1098,2],[1126,1],[1141,2],[1185,1],[1200,2],[1268,2],[1275,1],[1323,1],[1336,1],[1453,1],[1536,1],[1544,2],[1571,1],[1578,1],[1609,1],[1611,1],[1621,1],[1649,1],[1660,1],[1673,1],[1716,1],[1722,2],[1743,2],[1825,2],[1855,1],[1862,2],[1915,1],[1962,2],[1969,1],[1989,1],[1999,1],[2027,2],[2034,1],[2054,1],[2067,1],[2165,1]]},"473":{"position":[[497,1]]},"485":{"position":[[0,2],[94,1]]},"490":{"position":[[415,1],[492,2]]},"492":{"position":[[545,1],[562,1],[564,3],[576,1],[596,1],[622,2],[629,1],[650,1],[657,1],[674,1],[716,1],[762,1]]},"494":{"position":[[142,2],[219,1],[294,2],[297,2]]},"498":{"position":[[180,1],[194,2]]},"500":{"position":[[77,1],[163,1],[182,1],[201,1],[215,1],[217,2],[232,2],[254,2],[262,2],[269,2],[281,2],[389,3],[421,1],[472,1],[501,2],[504,2],[513,2],[521,2],[535,2],[644,3],[677,1],[730,1],[760,2],[763,2],[775,2],[786,2],[803,2],[912,3],[940,1],[993,1],[1026,2],[1029,2],[1043,2],[1091,1],[1098,2],[1129,2],[1136,1],[1180,1],[1187,1],[1234,1],[1236,2],[1270,1]]},"503":{"position":[[244,1],[246,2],[310,2],[492,1],[579,1],[593,1],[599,2],[675,1],[716,2],[750,1],[1021,1],[1023,2],[1085,2],[1175,2]]},"505":{"position":[[226,2],[275,1],[313,1],[315,2],[351,2],[386,2],[485,1],[492,1],[501,1],[503,2],[613,2],[700,1]]},"507":{"position":[[539,2],[593,2],[620,2],[706,1],[708,2],[744,2],[779,2],[878,1],[885,1],[894,1],[896,2],[926,1],[993,2],[1000,1],[1002,2],[1119,1],[1121,2],[1155,2],[1158,2],[1161,2],[1164,3],[1195,1]]},"510":{"position":[[480,1],[486,2],[569,2],[572,1],[574,3],[578,1]]},"516":{"position":[[79,1],[85,2],[104,2],[137,2],[148,2],[180,2],[216,2],[257,2],[276,2],[308,2],[344,2],[385,2],[432,1],[493,1],[499,2],[518,2],[539,2],[550,2],[570,2],[606,2],[647,2],[666,2],[686,2],[722,2],[763,2],[810,1]]},"518":{"position":[[131,1],[137,2],[160,2],[188,1],[226,1],[232,2],[253,2],[264,2],[309,1],[311,2],[376,2],[404,2],[445,2],[492,1]]},"522":{"position":[[0,2],[77,1],[116,1],[153,1],[197,1],[235,1],[279,1],[320,1],[355,1]]},"526":{"position":[[271,1],[309,1],[323,1],[329,2],[382,1],[482,1],[501,1],[503,1],[512,1],[514,2],[517,2],[531,2],[579,1],[600,1],[602,1],[613,1],[632,2],[681,1],[791,1],[872,1],[874,2],[886,2],[916,2]]},"532":{"position":[[161,2],[217,2],[281,1],[302,1],[315,1],[324,2],[346,1],[355,1],[365,1],[386,1],[388,5],[394,1],[412,1],[414,3],[418,1],[448,2]]},"538":{"position":[[308,1],[346,1],[360,1],[366,2],[424,2],[525,1],[586,2],[589,3],[604,2],[633,1],[635,2],[646,2]]},"541":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"543":{"position":[[185,2],[243,4],[286,1],[316,2],[319,2],[414,1],[445,2],[448,2],[553,1],[589,2]]},"545":{"position":[[372,2],[415,2],[418,2],[425,1],[658,4],[841,2],[916,1],[1012,2],[1015,2],[1091,1],[1128,2],[1131,2],[1202,1],[1242,2],[1245,2],[1321,1],[1358,2],[1361,2],[1553,1],[1595,2],[1620,1],[1622,1],[1636,3],[1796,4],[1928,2],[2037,1],[2116,2],[2134,2],[2137,2],[2233,1],[2306,2],[2317,2],[2476,2],[2607,1],[2683,2],[2694,2],[2915,2],[2927,2],[2946,1],[2948,4],[2962,1],[3002,2],[3017,2],[3036,1],[3074,2],[3105,2],[3122,1],[3143,1],[3185,2],[3217,2],[3234,1],[3253,1]]},"547":{"position":[[1339,1],[1379,2],[1382,2],[1422,2],[1428,2],[1467,2],[1496,1],[1587,1],[1627,2],[1630,2],[1674,2],[1696,2],[1735,2],[1752,2],[1793,2],[1986,1],[2026,2],[2029,2],[2070,2],[2089,2],[2131,2],[2151,2],[2199,2],[2236,2],[2306,3],[2310,2],[2313,2],[2316,2],[2319,2],[2322,2],[2325,2],[2328,2],[2331,2],[2334,3],[2497,1],[2537,2],[2540,2],[2580,2],[2586,2],[2624,2],[2627,2],[2668,2]]},"549":{"position":[[279,1],[281,2],[363,2],[405,2],[446,1],[485,2]]},"551":{"position":[[82,1],[88,2],[107,2],[140,2],[151,2],[183,2],[219,2],[260,2],[279,2],[311,2],[347,2],[388,2],[435,1]]},"554":{"position":[[97,1],[168,1],[298,2],[341,2],[383,2],[507,2],[867,1],[923,3],[927,2]]},"556":{"position":[[188,1],[264,1],[278,1],[280,2],[334,2],[366,2],[423,2],[458,2],[468,2],[508,2],[550,2],[591,1],[593,2],[680,2],[683,2],[717,1]]},"559":{"position":[[323,1],[418,1],[425,1],[439,1],[488,2],[567,2],[662,1],[685,1],[746,1],[766,1],[798,1],[830,1],[894,1],[896,1],[898,2],[932,2],[1017,1],[1098,1],[1117,2],[1143,2],[1176,2],[1183,1],[1196,2],[1239,1],[1241,2],[1345,1],[1359,2],[1396,1],[1408,2],[1440,1],[1454,2],[1487,1],[1511,1],[1544,1],[1546,1],[1572,1],[1586,1],[1600,2],[1637,1],[1643,2],[1670,2],[1751,1],[1860,2],[1863,2],[1866,2],[1869,2],[1994,1],[1996,2],[2073,2],[2079,2],[2099,2],[2105,2],[2146,1],[2153,2],[2210,1],[2212,2],[2234,2],[2275,1],[2279,2],[2296,1],[2306,2],[2338,2],[2352,1],[2362,1],[2405,1],[2470,2],[2473,1],[2559,1],[2565,3],[2569,1],[2571,1],[2573,2],[2643,2],[2677,1],[2679,3],[2776,2],[2779,1],[2826,1],[2966,1],[3103,1],[3219,3]]},"561":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"564":{"position":[[349,2],[469,1],[489,2],[522,2],[563,2],[603,2],[669,2],[730,2],[733,2],[753,2],[756,2],[759,2],[762,3],[766,2],[779,2],[827,4],[874,1],[920,2],[1005,2],[1063,2],[1066,3],[1077,3],[1118,2],[1121,3],[1125,2],[1191,2],[1234,2],[1275,2],[1350,1],[1394,2],[1447,2],[1498,2],[1506,2],[1509,3],[1513,2]]},"566":{"position":[[141,2],[226,1],[242,2],[265,2],[268,3],[272,2],[275,2],[360,1],[376,2],[401,2],[404,3],[408,2]]},"568":{"position":[[166,1],[199,2]]},"570":{"position":[[262,1],[322,2],[325,2],[395,2],[398,2],[449,2],[452,3],[456,2]]},"572":{"position":[[172,1],[189,2],[192,2],[268,2],[271,2],[327,2],[330,2],[357,2],[360,3],[364,2]]},"574":{"position":[[31,1],[101,2],[181,1],[195,2],[218,2],[221,3],[225,2]]},"576":{"position":[[211,1],[257,2],[260,2],[301,1],[344,2],[378,2]]},"578":{"position":[[76,2],[166,1],[168,2],[227,2],[250,2]]},"580":{"position":[[452,2],[524,1],[624,1],[665,1],[669,2],[691,2],[715,2],[722,1],[735,1],[757,2],[785,2],[792,2],[795,3],[799,2],[802,2],[848,2],[961,2],[1085,2],[1197,2],[1260,2]]},"582":{"position":[[151,1],[153,2],[192,2],[249,2],[343,2],[346,3],[350,2],[718,1],[808,1],[855,2],[858,2],[861,3],[865,2],[912,1],[953,2],[1020,1],[1060,2],[1063,2],[1066,3],[1070,2]]},"584":{"position":[[330,2],[405,1],[411,2],[434,2],[437,3],[441,2]]},"588":{"position":[[77,1],[387,1],[435,1],[437,2],[461,2],[494,1],[516,1],[539,1],[559,1],[572,2],[603,2],[606,3],[610,2]]},"590":{"position":[[243,1],[245,2],[285,2],[321,2],[330,2],[333,3],[337,2]]},"592":{"position":[[398,1],[447,2],[450,2],[540,2],[543,2],[566,2]]},"594":{"position":[[286,1],[288,2],[336,2],[339,2],[356,2],[403,2],[406,2],[430,2],[484,2],[487,2],[506,2],[509,2],[512,2]]},"596":{"position":[[216,1],[218,2],[274,2],[300,2],[392,2]]},"598":{"position":[[214,1],[216,2],[279,2],[282,2],[295,2],[311,2],[314,2],[317,2]]},"602":{"position":[[208,1],[232,2],[270,2],[313,2],[323,2],[326,2],[329,2]]},"606":{"position":[[219,1],[253,2],[327,2],[380,2],[390,2],[393,2],[396,2]]},"610":{"position":[[222,1],[319,1],[420,1],[434,2],[514,2],[517,2]]},"612":{"position":[[106,2],[176,1],[191,2],[207,2],[210,3],[214,2]]},"614":{"position":[[128,1],[137,2],[152,2],[155,3],[159,2],[289,2],[356,2]]},"616":{"position":[[129,2],[213,1],[223,2],[260,2],[263,3],[267,2]]},"618":{"position":[[256,2],[336,1],[351,2],[373,2],[394,2],[403,2],[406,3],[410,2]]},"620":{"position":[[87,1],[135,1],[137,2],[218,2],[221,3],[225,2]]},"622":{"position":[[218,1],[242,1],[286,1],[288,2],[316,2],[355,1],[377,2],[380,2],[414,2],[417,2],[504,2],[507,2],[510,2],[544,2],[547,2],[581,2]]},"624":{"position":[[336,1],[360,1],[400,1],[402,2],[430,2],[469,1],[492,2],[495,2],[572,2],[575,2],[619,2]]},"626":{"position":[[184,1],[289,1],[291,2],[351,2],[404,2],[407,3],[411,2]]},"628":{"position":[[331,1],[375,2],[421,1],[443,2],[454,1],[518,1],[563,2]]},"630":{"position":[[165,1],[234,2]]},"632":{"position":[[261,1],[274,2],[311,2],[318,2],[321,3],[325,2]]},"634":{"position":[[279,1],[281,2],[323,2],[349,2],[356,1],[358,2],[361,2],[389,2],[424,1],[428,1],[430,2],[470,1],[472,2],[517,2],[543,2],[546,2],[573,2],[608,2],[623,1],[695,2],[698,2],[741,2],[775,2],[836,2],[843,1],[856,1],[858,1],[860,1],[873,2]]},"636":{"position":[[279,1],[323,2],[364,1],[408,2],[449,1],[514,2]]},"638":{"position":[[87,2],[170,1],[188,2],[213,2],[216,3],[220,2]]},"640":{"position":[[174,5],[290,2],[375,1],[394,2],[405,2],[408,3],[412,2],[415,2],[500,1],[516,2],[546,2],[561,2],[564,3],[568,2],[599,2],[672,2],[695,2],[743,2],[771,2],[978,1],[994,2],[1046,2]]},"642":{"position":[[343,2],[424,1],[434,2],[455,2],[479,2],[482,3],[486,2]]},"644":{"position":[[302,2],[383,1],[391,2],[450,2],[467,2],[470,3],[474,2]]},"646":{"position":[[247,2],[332,1],[343,2],[380,2],[391,2],[394,3],[398,2]]},"648":{"position":[[120,2],[184,1],[199,2],[209,2],[212,3],[216,2]]},"650":{"position":[[173,2],[269,1],[273,2],[298,2],[324,2],[343,2],[346,2],[349,2],[352,3],[356,2],[367,2],[475,1],[479,2],[506,2],[530,2],[540,2],[551,2],[689,1],[693,2],[720,2],[741,2],[760,2],[771,2],[782,2],[896,1],[900,2],[940,2],[975,2],[989,2],[1000,2],[1208,1],[1212,2],[1237,2],[1279,2],[1331,2],[1359,2],[1409,2],[1419,2]]},"652":{"position":[[334,2],[421,1],[440,2],[467,2],[502,2],[512,2],[515,3],[519,2]]},"654":{"position":[[458,2],[554,1],[582,2],[623,2],[652,2],[687,2],[713,2],[746,2],[754,2],[757,3],[761,2]]},"656":{"position":[[526,2],[618,1],[643,2],[678,2],[711,2],[737,2],[764,2],[769,2],[772,3],[776,2]]},"658":{"position":[[516,2],[608,1],[638,2],[665,2],[690,2],[712,2],[717,2],[720,3],[724,2]]},"660":{"position":[[302,2],[374,1],[467,1],[507,1],[511,2],[533,2],[558,2],[565,1],[578,1],[600,2],[628,2],[659,2],[674,2],[677,3],[681,2],[684,2],[729,2]]},"662":{"position":[[132,2],[203,1],[207,2],[234,2],[245,1],[253,2],[271,1],[288,2],[302,1],[304,1],[306,2]]},"664":{"position":[[313,1],[344,2],[391,1],[454,4],[459,2],[514,1],[661,2]]},"666":{"position":[[449,1],[451,2],[526,2],[529,2],[582,1],[584,2],[796,2],[799,2],[850,1]]},"668":{"position":[[347,1],[382,2],[427,1],[512,2],[557,1],[586,2]]},"672":{"position":[[143,1],[173,2],[176,2],[193,2]]},"674":{"position":[[312,2],[384,1],[489,1],[529,1],[533,2],[555,2],[584,2],[591,1],[604,1],[626,2],[654,2],[685,2],[700,2],[703,3],[707,2],[710,2],[755,2]]},"676":{"position":[[147,1],[206,2],[209,2],[239,2]]},"678":{"position":[[398,1],[433,2],[477,1],[520,2]]},"680":{"position":[[81,2],[161,1],[165,2],[230,2],[265,2],[268,3],[272,2],[434,1],[468,1],[481,2],[499,2],[510,3],[518,2],[540,2],[558,2],[595,1],[597,1]]},"682":{"position":[[176,1],[178,2],[220,2],[246,2],[253,1],[255,2],[258,2],[277,2],[322,2],[348,2],[351,2],[378,2],[413,2],[428,1],[500,2],[503,2],[546,2],[580,2],[641,2],[648,1],[661,1],[663,1],[676,1],[678,2]]},"684":{"position":[[201,2],[256,1],[258,2],[300,2],[326,2],[333,1],[335,2],[338,2],[357,2],[402,2],[428,2],[431,2],[458,2],[493,2],[508,1],[580,2],[583,2],[626,2],[663,2],[742,2],[749,1],[762,1],[764,1],[777,1],[779,2]]},"686":{"position":[[32,1],[116,2],[166,2]]},"688":{"position":[[123,1],[164,2],[167,2],[186,2],[504,1],[543,2],[546,2],[627,2],[630,2],[649,2]]},"690":{"position":[[322,1],[364,2],[436,2],[635,1],[690,2]]},"692":{"position":[[262,1],[289,2],[292,2],[379,2],[382,2],[405,2]]},"694":{"position":[[165,1],[203,2],[206,2],[236,2],[239,3],[243,2]]},"696":{"position":[[314,2],[353,2],[390,2],[467,1],[471,2],[507,1],[509,2],[594,1],[629,1],[677,2],[717,2],[724,1],[752,1],[777,1],[790,2],[863,1],[865,2],[1024,2],[1027,2],[1118,1],[1244,1],[1289,1],[1375,2],[1421,1],[1508,2],[1511,2],[1601,2]]},"698":{"position":[[168,1],[174,2],[220,2],[268,2],[271,3],[275,2]]},"702":{"position":[[166,1],[204,1],[249,1],[317,1],[362,1],[434,2]]},"704":{"position":[[268,2],[342,1],[359,2],[398,2],[410,2],[413,3],[417,2]]},"706":{"position":[[207,1],[225,2],[228,2],[258,2],[261,2],[290,2],[293,2],[332,2],[335,2],[372,2],[375,3],[379,2]]},"708":{"position":[[238,1],[244,2],[263,2],[308,2],[311,3],[315,2]]},"710":{"position":[[288,1],[307,2],[310,2],[347,2],[350,2],[378,2],[412,2],[415,2],[479,2],[482,2],[535,2],[538,3],[542,2]]},"712":{"position":[[139,1],[174,2],[177,2],[236,2],[268,2]]},"714":{"position":[[164,1],[172,2],[213,2],[216,2],[275,2],[307,2]]},"716":{"position":[[141,1],[174,2],[177,2],[236,2],[268,2]]},"718":{"position":[[220,2],[294,1],[304,2],[312,2],[315,3],[319,2]]},"720":{"position":[[222,1],[302,1],[342,1],[344,2],[372,2],[411,1],[432,2],[443,2],[465,2],[482,2],[494,2]]}}}],["0",{"_index":321,"t":{"43":{"position":[[238,2],[345,2]]},"86":{"position":[[2316,2]]},"188":{"position":[[1411,1],[1443,1]]},"190":{"position":[[271,2]]},"198":{"position":[[316,1]]},"202":{"position":[[64,1]]},"210":{"position":[[1686,2]]},"212":{"position":[[306,2]]},"228":{"position":[[74,3],[296,1]]},"278":{"position":[[674,2]]},"312":{"position":[[889,2]]},"314":{"position":[[111,2]]},"322":{"position":[[210,4],[501,2]]},"324":{"position":[[43,4]]},"485":{"position":[[176,1]]},"559":{"position":[[2277,1],[2324,2],[2822,3],[3099,3]]},"564":{"position":[[1098,1]]},"634":{"position":[[426,1]]},"642":{"position":[[243,4]]},"656":{"position":[[405,4],[740,1]]},"658":{"position":[[405,4],[715,1]]}}}],["0.1.7",{"_index":2922,"t":{"545":{"position":[[3499,5]]}}}],["0.4",{"_index":2624,"t":{"483":{"position":[[72,3]]}}}],["0.7",{"_index":2621,"t":{"481":{"position":[[70,3]]}}}],["01",{"_index":2971,"t":{"547":{"position":[[1108,4],[1126,2]]},"696":{"position":[[570,2],[697,2]]}}}],["02",{"_index":2082,"t":{"326":{"position":[[324,2]]},"372":{"position":[[967,3]]},"547":{"position":[[1113,4]]},"696":{"position":[[573,2],[700,4]]}}}],["0666",{"_index":1602,"t":{"153":{"position":[[377,5],[578,5]]},"372":{"position":[[1111,5]]}}}],["08",{"_index":2978,"t":{"547":{"position":[[1185,2],[2193,2],[2207,2]]}}}],["0rtt",{"_index":1861,"t":{"228":{"position":[[835,5]]}}}],["1",{"_index":342,"t":{"43":{"position":[[734,2]]},"98":{"position":[[169,1]]},"128":{"position":[[222,1]]},"188":{"position":[[280,1]]},"190":{"position":[[51,1]]},"196":{"position":[[406,1],[595,1]]},"198":{"position":[[297,1],[337,1]]},"202":{"position":[[47,1],[83,1]]},"218":{"position":[[445,1]]},"220":{"position":[[1356,1]]},"222":{"position":[[119,1]]},"228":{"position":[[277,1]]},"234":{"position":[[355,4]]},"238":{"position":[[66,3]]},"278":{"position":[[559,1],[623,2],[763,1]]},"322":{"position":[[1371,5]]},"324":{"position":[[284,5]]},"344":{"position":[[395,1]]},"346":{"position":[[661,1]]},"348":{"position":[[463,1]]},"362":{"position":[[583,1]]},"364":{"position":[[48,1]]},"406":{"position":[[696,1]]},"426":{"position":[[279,3],[351,6]]},"545":{"position":[[3116,4],[3228,4]]},"547":{"position":[[1481,2],[1749,2]]},"559":{"position":[[2690,3]]},"564":{"position":[[1390,3],[1407,2]]},"566":{"position":[[379,7]]},"574":{"position":[[141,1]]},"610":{"position":[[480,3]]},"656":{"position":[[368,2],[708,2],[714,1]]},"658":{"position":[[368,2],[635,2],[662,2],[668,1],[687,2],[693,1]]}}}],["1,001.01e8",{"_index":2941,"t":{"547":{"position":[[510,10]]}}}],["1,146,667",{"_index":2623,"t":{"483":{"position":[[14,9]]}}}],["1,2,3",{"_index":3376,"t":{"650":{"position":[[763,7]]}}}],["1.1",{"_index":2626,"t":{"483":{"position":[[152,3]]}}}],["1.16",{"_index":1990,"t":{"298":{"position":[[557,6]]},"300":{"position":[[84,5]]},"312":{"position":[[471,4]]}}}],["1.17",{"_index":41,"t":{"4":{"position":[[39,4]]}}}],["1.234",{"_index":2940,"t":{"547":{"position":[[502,6]]}}}],["1.3",{"_index":1845,"t":{"228":{"position":[[152,3]]}}}],["1.3'",{"_index":1840,"t":{"228":{"position":[[57,5]]}}}],["10",{"_index":1075,"t":{"86":{"position":[[2102,2],[2749,2]]},"473":{"position":[[565,2]]},"485":{"position":[[182,2]]},"666":{"position":[[774,5]]},"696":{"position":[[1568,2],[1677,2]]}}}],["10*time.second",{"_index":2563,"t":{"470":{"position":[[2117,16]]}}}],["10.1",{"_index":549,"t":{"83":{"position":[[1380,4]]}}}],["10.4.1",{"_index":586,"t":{"83":{"position":[[1840,6]]}}}],["100",{"_index":541,"t":{"83":{"position":[[1271,3]]},"485":{"position":[[189,3],[580,4]]}}}],["1000",{"_index":2642,"t":{"485":{"position":[[585,5]]},"492":{"position":[[652,4]]}}}],["101",{"_index":544,"t":{"83":{"position":[[1321,3]]}}}],["102",{"_index":547,"t":{"83":{"position":[[1363,3]]}}}],["1024",{"_index":1329,"t":{"135":{"position":[[510,4],[517,4],[1002,4]]}}}],["103",{"_index":551,"t":{"83":{"position":[[1404,3]]}}}],["11",{"_index":2973,"t":{"547":{"position":[[1123,2]]}}}],["11,846",{"_index":2612,"t":{"477":{"position":[[14,6]]}}}],["11.1",{"_index":578,"t":{"83":{"position":[[1758,4]]}}}],["11.2",{"_index":677,"t":{"83":{"position":[[3161,4],[5562,4]]}}}],["11.3",{"_index":680,"t":{"83":{"position":[[3198,4],[5615,4]]}}}],["11.4",{"_index":683,"t":{"83":{"position":[[3245,4],[5688,4]]}}}],["11.5",{"_index":726,"t":{"83":{"position":[[3923,4],[6755,4]]}}}],["111",{"_index":3354,"t":{"644":{"position":[[461,5]]}}}],["117.2",{"_index":2619,"t":{"479":{"position":[[148,5]]}}}],["12",{"_index":2950,"t":{"547":{"position":[[723,2],[1425,2]]},"559":{"position":[[2032,2],[2076,2]]}}}],["120",{"_index":2959,"t":{"547":{"position":[[867,4],[962,4]]}}}],["120000",{"_index":2987,"t":{"547":{"position":[[1688,7]]}}}],["123",{"_index":3345,"t":{"642":{"position":[[462,3]]}}}],["12345.pdf",{"_index":3219,"t":{"592":{"position":[[434,12],[469,9],[513,11]]}}}],["123456",{"_index":1672,"t":{"176":{"position":[[356,9],[506,9],[663,8]]}}}],["123456789",{"_index":2930,"t":{"547":{"position":[[377,10],[389,9]]}}}],["125",{"_index":2996,"t":{"547":{"position":[[2084,4]]}}}],["127.0.0.1",{"_index":2179,"t":{"358":{"position":[[416,11]]},"614":{"position":[[140,11]]},"616":{"position":[[157,10],[237,12]]}}}],["127.0.0.1:3000",{"_index":1958,"t":{"278":{"position":[[525,14]]}}}],["127.0.0.1:3000/debug/var",{"_index":1959,"t":{"278":{"position":[[566,25]]}}}],["127.0.0.1:3000/debug/vars?r=c",{"_index":1966,"t":{"278":{"position":[[702,29]]}}}],["13",{"_index":1927,"t":{"268":{"position":[[306,3]]}}}],["15:04:05",{"_index":2255,"t":{"374":{"position":[[759,8]]},"376":{"position":[[126,11]]}}}],["15th",{"_index":36,"t":{"2":{"position":[[363,5]]}}}],["16",{"_index":3114,"t":{"564":{"position":[[1375,4]]}}}],["1638",{"_index":2935,"t":{"547":{"position":[[453,4],[463,4]]}}}],["18",{"_index":2955,"t":{"547":{"position":[[798,3],[942,2]]},"559":{"position":[[2035,2],[2102,2]]}}}],["18.04.3",{"_index":2588,"t":{"473":{"position":[[523,7]]}}}],["1831710635",{"_index":1928,"t":{"268":{"position":[[310,11],[541,11]]}}}],["185",{"_index":121,"t":{"6":{"position":[[1552,5]]},"135":{"position":[[4104,5]]}}}],["19",{"_index":2953,"t":{"547":{"position":[[763,2]]}}}],["19,664",{"_index":2616,"t":{"479":{"position":[[14,6]]}}}],["1;q=0.2",{"_index":3108,"t":{"564":{"position":[[1226,7]]}}}],["1s",{"_index":1295,"t":{"128":{"position":[[168,2]]}}}],["2",{"_index":1756,"t":{"198":{"position":[[364,1]]},"202":{"position":[[108,1]]},"256":{"position":[[677,1]]},"262":{"position":[[258,1]]},"346":{"position":[[1356,4],[1807,2]]},"426":{"position":[[283,2]]},"450":{"position":[[750,2]]},"545":{"position":[[3137,4],[3247,4]]},"559":{"position":[[2860,3]]},"564":{"position":[[777,1]]},"582":{"position":[[1022,4]]},"658":{"position":[[641,1]]},"704":{"position":[[133,2]]}}}],["2*time.second",{"_index":2536,"t":{"470":{"position":[[538,15],[1391,14]]}}}],["2,066",{"_index":2614,"t":{"477":{"position":[[94,5]]}}}],["2.0",{"_index":2609,"t":{"475":{"position":[[444,3]]}}}],["2.20ghz",{"_index":2584,"t":{"473":{"position":[[499,7]]}}}],["2.3.3",{"_index":670,"t":{"83":{"position":[[3060,5],[5404,5]]}}}],["2.30ghz",{"_index":2630,"t":{"485":{"position":[[96,7]]}}}],["20",{"_index":2180,"t":{"358":{"position":[[436,3]]},"360":{"position":[[176,3]]},"559":{"position":[[527,2]]},"622":{"position":[[351,3],[446,4],[500,3],[576,4]]},"624":{"position":[[465,3],[532,4],[614,4]]},"696":{"position":[[1571,2],[1680,3]]},"720":{"position":[[407,3]]}}}],["200",{"_index":554,"t":{"83":{"position":[[1431,3]]},"90":{"position":[[221,3]]},"470":{"position":[[813,3]]}}}],["2005",{"_index":2972,"t":{"547":{"position":[[1118,4]]}}}],["2006",{"_index":2227,"t":{"372":{"position":[[975,6]]},"696":{"position":[[565,4]]}}}],["201",{"_index":557,"t":{"83":{"position":[[1470,3]]}}}],["202",{"_index":560,"t":{"83":{"position":[[1510,3]]}}}],["2020",{"_index":37,"t":{"2":{"position":[[369,5]]}}}],["2022",{"_index":2977,"t":{"547":{"position":[[1180,4],[2202,4]]}}}],["203",{"_index":563,"t":{"83":{"position":[[1569,3]]}}}],["204",{"_index":566,"t":{"83":{"position":[[1610,3]]}}}],["205",{"_index":569,"t":{"83":{"position":[[1654,3]]}}}],["206",{"_index":572,"t":{"83":{"position":[[1700,3]]}}}],["207",{"_index":576,"t":{"83":{"position":[[1741,3]]}}}],["208",{"_index":580,"t":{"83":{"position":[[1787,3]]}}}],["226",{"_index":584,"t":{"83":{"position":[[1823,3]]}}}],["2295",{"_index":722,"t":{"83":{"position":[[3868,5],[6671,5]]}}}],["233",{"_index":1556,"t":{"147":{"position":[[673,4],[988,4]]}}}],["24",{"_index":2499,"t":{"452":{"position":[[121,2]]},"454":{"position":[[40,2]]}}}],["244,847",{"_index":2625,"t":{"483":{"position":[[96,7]]}}}],["25.7",{"_index":2617,"t":{"479":{"position":[[69,4]]}}}],["250",{"_index":2989,"t":{"547":{"position":[[1796,3]]}}}],["2518",{"_index":548,"t":{"83":{"position":[[1374,5]]}}}],["256",{"_index":1345,"t":{"135":{"position":[[996,3]]}}}],["27",{"_index":2979,"t":{"547":{"position":[[1188,2],[2196,2],[2210,2]]}}}],["2774",{"_index":732,"t":{"83":{"position":[[4001,5],[6876,5]]}}}],["28",{"_index":2578,"t":{"473":{"position":[[454,2]]}}}],["2beb887efd54",{"_index":3245,"t":{"606":{"position":[[281,13]]}}}],["3",{"_index":611,"t":{"83":{"position":[[2192,1],[3383,1],[3535,1],[5899,1],[6149,1]]},"386":{"position":[[185,1]]},"404":{"position":[[1460,3]]},"559":{"position":[[2998,3]]},"650":{"position":[[723,3],[744,3]]},"656":{"position":[[675,2],[761,2],[767,1]]}}}],["3.1",{"_index":618,"t":{"83":{"position":[[2274,3],[4203,3]]}}}],["3.2",{"_index":636,"t":{"83":{"position":[[2542,3],[4609,3]]}}}],["30",{"_index":1707,"t":{"186":{"position":[[442,2]]},"336":{"position":[[342,2]]},"338":{"position":[[179,2]]},"358":{"position":[[452,2]]},"360":{"position":[[192,2]]},"485":{"position":[[537,2]]}}}],["300",{"_index":588,"t":{"83":{"position":[[1871,3]]}}}],["3000",{"_index":1287,"t":{"126":{"position":[[226,8]]},"162":{"position":[[357,4]]},"164":{"position":[[271,4]]},"166":{"position":[[320,4]]},"168":{"position":[[190,4]]},"170":{"position":[[201,4]]}}}],["301",{"_index":591,"t":{"83":{"position":[[1919,3]]},"424":{"position":[[253,4]]},"664":{"position":[[656,4]]}}}],["302",{"_index":594,"t":{"83":{"position":[[1956,3]]},"426":{"position":[[566,3]]},"664":{"position":[[179,3]]},"666":{"position":[[187,3]]},"668":{"position":[[215,3]]}}}],["303",{"_index":597,"t":{"83":{"position":[[1996,3]]}}}],["304",{"_index":600,"t":{"83":{"position":[[2039,3]]}}}],["305",{"_index":603,"t":{"83":{"position":[[2077,3]]}}}],["307",{"_index":606,"t":{"83":{"position":[[2126,3]]}}}],["308",{"_index":609,"t":{"83":{"position":[[2175,3]]}}}],["32",{"_index":1368,"t":{"135":{"position":[[1953,4]]},"254":{"position":[[92,2]]},"256":{"position":[[289,2],[426,3]]},"258":{"position":[[391,2],[476,3]]}}}],["32.23",{"_index":3404,"t":{"656":{"position":[[646,5],[681,5]]}}}],["3229",{"_index":585,"t":{"83":{"position":[[1834,5]]}}}],["32gb",{"_index":2585,"t":{"473":{"position":[[507,4]]}}}],["33",{"_index":1963,"t":{"278":{"position":[[648,3]]}}}],["354.1",{"_index":2611,"t":{"475":{"position":[[518,5]]}}}],["36",{"_index":2093,"t":{"336":{"position":[[670,2]]},"338":{"position":[[291,3],[323,2]]}}}],["3600",{"_index":1088,"t":{"86":{"position":[[2775,5]]},"298":{"position":[[523,5]]}}}],["360641",{"_index":3326,"t":{"634":{"position":[[716,6]]},"682":{"position":[[521,6]]},"684":{"position":[[601,6]]}}}],["367,069",{"_index":2610,"t":{"475":{"position":[[462,7]]}}}],["368,647",{"_index":2620,"t":{"481":{"position":[[14,7]]}}}],["390.44",{"_index":2615,"t":{"477":{"position":[[148,6]]}}}],["3rd",{"_index":2767,"t":{"510":{"position":[[158,3]]}}}],["4",{"_index":695,"t":{"83":{"position":[[3426,1],[5967,1]]},"135":{"position":[[506,1]]},"153":{"position":[[232,2]]},"545":{"position":[[3514,2]]},"547":{"position":[[579,1]]},"559":{"position":[[3137,3]]}}}],["4,302",{"_index":2618,"t":{"479":{"position":[[94,5]]}}}],["4.1",{"_index":574,"t":{"83":{"position":[[1717,3],[2056,3]]}}}],["4.15.0",{"_index":2589,"t":{"473":{"position":[[531,6]]}}}],["4.2",{"_index":651,"t":{"83":{"position":[[2759,3],[4934,3]]}}}],["4.3.1",{"_index":495,"t":{"83":{"position":[[79,5]]}}}],["4.3.2",{"_index":497,"t":{"83":{"position":[[118,5]]}}}],["4.3.3",{"_index":499,"t":{"83":{"position":[[157,5]]}}}],["4.3.4",{"_index":501,"t":{"83":{"position":[[194,5]]}}}],["4.3.5",{"_index":507,"t":{"83":{"position":[[271,5]]}}}],["4.3.6",{"_index":509,"t":{"83":{"position":[[316,5]]}}}],["4.3.7",{"_index":511,"t":{"83":{"position":[[361,5]]}}}],["4.3.8",{"_index":514,"t":{"83":{"position":[[402,5]]}}}],["4.4",{"_index":663,"t":{"83":{"position":[[2974,3],[5275,3]]},"481":{"position":[[149,3]]}}}],["400",{"_index":613,"t":{"83":{"position":[[2213,3]]},"344":{"position":[[839,3]]},"362":{"position":[[855,3],[970,3]]}}}],["401",{"_index":616,"t":{"83":{"position":[[2257,3]]},"172":{"position":[[138,3]]},"178":{"position":[[943,3]]},"350":{"position":[[432,3]]}}}],["402",{"_index":620,"t":{"83":{"position":[[2302,3]]}}}],["403",{"_index":623,"t":{"83":{"position":[[2343,3]]}}}],["404",{"_index":626,"t":{"83":{"position":[[2383,3]]},"490":{"position":[[229,3],[360,3]]},"503":{"position":[[951,4]]},"516":{"position":[[860,3]]},"547":{"position":[[316,3]]}}}],["404.html",{"_index":1989,"t":{"298":{"position":[[503,11]]}}}],["405",{"_index":629,"t":{"83":{"position":[[2431,3]]}}}],["406",{"_index":632,"t":{"83":{"position":[[2476,3]]}}}],["407",{"_index":635,"t":{"83":{"position":[[2525,3]]}}}],["408",{"_index":638,"t":{"83":{"position":[[2569,3]]},"470":{"position":[[904,3]]}}}],["409",{"_index":641,"t":{"83":{"position":[[2609,3]]}}}],["4096",{"_index":1452,"t":{"135":{"position":[[5565,4],[6975,4]]}}}],["410",{"_index":644,"t":{"83":{"position":[[2645,3]]}}}],["411",{"_index":647,"t":{"83":{"position":[[2691,3]]}}}],["412",{"_index":650,"t":{"83":{"position":[[2742,3]]}}}],["413",{"_index":653,"t":{"83":{"position":[[2793,3]]},"135":{"position":[[465,3]]}}}],["414",{"_index":656,"t":{"83":{"position":[[2843,3]]}}}],["415",{"_index":659,"t":{"83":{"position":[[2896,3]]},"692":{"position":[[295,3],[385,3]]}}}],["416",{"_index":662,"t":{"83":{"position":[[2957,3]]}}}],["417",{"_index":665,"t":{"83":{"position":[[3004,3]]}}}],["418",{"_index":668,"t":{"83":{"position":[[3043,3]]}}}],["42",{"_index":2088,"t":{"334":{"position":[[54,2]]},"547":{"position":[[2583,2]]}}}],["42.8",{"_index":2613,"t":{"477":{"position":[[69,4]]}}}],["421",{"_index":672,"t":{"83":{"position":[[3093,3]]}}}],["422",{"_index":676,"t":{"83":{"position":[[3144,3]]}}}],["423",{"_index":679,"t":{"83":{"position":[[3181,3]]}}}],["424",{"_index":682,"t":{"83":{"position":[[3228,3]]}}}],["425",{"_index":685,"t":{"83":{"position":[[3267,3]]}}}],["426",{"_index":120,"t":{"6":{"position":[[1543,4]]},"83":{"position":[[3313,3]]}}}],["428",{"_index":691,"t":{"83":{"position":[[3366,3]]}}}],["429",{"_index":694,"t":{"83":{"position":[[3409,3]]},"362":{"position":[[274,3]]}}}],["431",{"_index":697,"t":{"83":{"position":[[3464,3]]}}}],["450b",{"_index":3243,"t":{"606":{"position":[[271,4]]}}}],["451",{"_index":700,"t":{"83":{"position":[[3518,3]]}}}],["4918",{"_index":577,"t":{"83":{"position":[[1752,5],[3155,5],[3192,5],[3239,5],[3917,5],[5556,5],[5609,5],[5682,5],[6749,5]]}}}],["4gb",{"_index":2632,"t":{"485":{"position":[[108,3]]}}}],["5",{"_index":698,"t":{"83":{"position":[[3481,1],[6059,1]]},"362":{"position":[[302,1]]},"364":{"position":[[33,2]]},"404":{"position":[[1624,1],[1765,3]]},"559":{"position":[[511,1]]}}}],["5.2",{"_index":687,"t":{"83":{"position":[[3284,4],[5745,4]]}}}],["500",{"_index":703,"t":{"83":{"position":[[3565,3]]},"374":{"position":[[1014,3]]},"376":{"position":[[171,3]]},"485":{"position":[[197,3]]},"505":{"position":[[90,3],[342,3]]},"507":{"position":[[735,3]]},"662":{"position":[[291,5]]}}}],["5000",{"_index":2637,"t":{"485":{"position":[[261,5],[591,4]]}}}],["501",{"_index":706,"t":{"83":{"position":[[3611,3]]}}}],["502",{"_index":709,"t":{"83":{"position":[[3653,3]]}}}],["503",{"_index":712,"t":{"83":{"position":[[3703,3]]},"503":{"position":[[1026,3],[1088,3]]}}}],["504",{"_index":715,"t":{"83":{"position":[[3749,3]]}}}],["505",{"_index":718,"t":{"83":{"position":[[3804,3]]}}}],["506",{"_index":721,"t":{"83":{"position":[[3857,3]]}}}],["507",{"_index":725,"t":{"83":{"position":[[3906,3]]}}}],["508",{"_index":728,"t":{"83":{"position":[[3949,3]]}}}],["510",{"_index":731,"t":{"83":{"position":[[3990,3]]}}}],["511",{"_index":735,"t":{"83":{"position":[[4047,3]]}}}],["5120",{"_index":2583,"t":{"473":{"position":[[488,4]]}}}],["57,880",{"_index":2622,"t":{"481":{"position":[[94,6]]}}}],["5789",{"_index":504,"t":{"83":{"position":[[229,4]]}}}],["5842",{"_index":581,"t":{"83":{"position":[[1798,5],[3960,5],[6814,5]]}}}],["6",{"_index":736,"t":{"83":{"position":[[4064,1],[6978,1]]}}}],["6,162,556",{"_index":2607,"t":{"475":{"position":[[386,9]]}}}],["6.2.1",{"_index":542,"t":{"83":{"position":[[1288,5]]}}}],["6.2.2",{"_index":545,"t":{"83":{"position":[[1338,5]]}}}],["6.3.1",{"_index":555,"t":{"83":{"position":[[1448,5]]}}}],["6.3.2",{"_index":558,"t":{"83":{"position":[[1487,5]]}}}],["6.3.3",{"_index":561,"t":{"83":{"position":[[1527,5]]}}}],["6.3.4",{"_index":564,"t":{"83":{"position":[[1586,5]]}}}],["6.3.5",{"_index":567,"t":{"83":{"position":[[1627,5]]}}}],["6.3.6",{"_index":570,"t":{"83":{"position":[[1671,5]]}}}],["6.4.1",{"_index":589,"t":{"83":{"position":[[1888,5]]}}}],["6.4.2",{"_index":592,"t":{"83":{"position":[[1936,5]]}}}],["6.4.3",{"_index":595,"t":{"83":{"position":[[1973,5]]}}}],["6.4.4",{"_index":598,"t":{"83":{"position":[[2013,5]]}}}],["6.4.5",{"_index":604,"t":{"83":{"position":[[2094,5]]}}}],["6.4.7",{"_index":607,"t":{"83":{"position":[[2143,5]]}}}],["6.5.1",{"_index":614,"t":{"83":{"position":[[2230,5],[4137,5]]}}}],["6.5.10",{"_index":648,"t":{"83":{"position":[[2708,6],[4855,6]]}}}],["6.5.11",{"_index":654,"t":{"83":{"position":[[2810,6],[5016,6]]}}}],["6.5.12",{"_index":657,"t":{"83":{"position":[[2860,6],[5093,6]]}}}],["6.5.13",{"_index":660,"t":{"83":{"position":[[2913,6],[5176,6]]}}}],["6.5.14",{"_index":666,"t":{"83":{"position":[[3021,6],[5349,6]]}}}],["6.5.15",{"_index":689,"t":{"83":{"position":[[3330,6],[5816,6]]}}}],["6.5.2",{"_index":621,"t":{"83":{"position":[[2319,5],[4273,5]]}}}],["6.5.3",{"_index":624,"t":{"83":{"position":[[2360,5],[4333,5]]}}}],["6.5.4",{"_index":627,"t":{"83":{"position":[[2400,5],[4391,5]]}}}],["6.5.5",{"_index":630,"t":{"83":{"position":[[2448,5],[4465,5]]}}}],["6.5.6",{"_index":633,"t":{"83":{"position":[[2493,5],[4533,5]]}}}],["6.5.7",{"_index":639,"t":{"83":{"position":[[2586,5],[4677,5]]}}}],["6.5.8",{"_index":642,"t":{"83":{"position":[[2626,5],[4735,5]]}}}],["6.5.9",{"_index":645,"t":{"83":{"position":[[2662,5],[4785,5]]}}}],["6.6.1",{"_index":704,"t":{"83":{"position":[[3582,5],[6225,5]]}}}],["6.6.2",{"_index":707,"t":{"83":{"position":[[3628,5],[6295,5]]}}}],["6.6.3",{"_index":710,"t":{"83":{"position":[[3670,5],[6357,5]]}}}],["6.6.4",{"_index":713,"t":{"83":{"position":[[3720,5],[6435,5]]}}}],["6.6.5",{"_index":716,"t":{"83":{"position":[[3766,5],[6505,5]]}}}],["6.6.6",{"_index":719,"t":{"83":{"position":[[3821,5],[6593,5]]}}}],["600",{"_index":1715,"t":{"186":{"position":[[702,7]]}}}],["6000",{"_index":1720,"t":{"186":{"position":[[923,7]]}}}],["6140",{"_index":2629,"t":{"485":{"position":[[85,4]]}}}],["6585",{"_index":692,"t":{"83":{"position":[[3377,5],[3420,5],[3475,5],[4058,5],[5893,5],[5961,5],[6053,5],[6972,5]]}}}],["7",{"_index":733,"t":{"83":{"position":[[4007,1],[6882,1]]}}}],["7.0",{"_index":3003,"t":{"547":{"position":[[2682,4]]}}}],["7.1",{"_index":582,"t":{"83":{"position":[[1804,3]]}}}],["7.2",{"_index":729,"t":{"83":{"position":[[3966,3],[6820,3]]}}}],["700",{"_index":3423,"t":{"662":{"position":[[152,4],[157,3],[297,4]]}}}],["7168",{"_index":669,"t":{"83":{"position":[[3054,5],[5398,5]]}}}],["7231",{"_index":494,"t":{"83":{"position":[[73,5],[112,5],[151,5],[188,5],[265,5],[310,5],[355,5],[396,5],[1282,5],[1332,5],[1442,5],[1481,5],[1521,5],[1580,5],[1621,5],[1665,5],[1882,5],[1930,5],[1967,5],[2007,5],[2088,5],[2137,5],[2224,5],[2313,5],[2354,5],[2394,5],[2442,5],[2487,5],[2580,5],[2620,5],[2656,5],[2702,5],[2804,5],[2854,5],[2907,5],[3015,5],[3324,5],[3576,5],[3622,5],[3664,5],[3714,5],[3760,5],[3815,5],[4131,5],[4267,5],[4327,5],[4385,5],[4459,5],[4527,5],[4671,5],[4729,5],[4779,5],[4849,5],[5010,5],[5087,5],[5170,5],[5343,5],[5810,5],[6219,5],[6289,5],[6351,5],[6429,5],[6499,5],[6587,5]]}}}],["7232",{"_index":601,"t":{"83":{"position":[[2050,5],[2753,5],[4928,5]]}}}],["7233",{"_index":573,"t":{"83":{"position":[[1711,5],[2968,5],[5269,5]]}}}],["7235",{"_index":617,"t":{"83":{"position":[[2268,5],[2536,5],[4197,5],[4603,5]]}}}],["72d5",{"_index":2936,"t":{"547":{"position":[[458,4]]}}}],["750",{"_index":2734,"t":{"500":{"position":[[1330,4]]}}}],["7538",{"_index":610,"t":{"83":{"position":[[2186,5]]}}}],["7540",{"_index":673,"t":{"83":{"position":[[3104,5],[5476,5]]}}}],["7725",{"_index":701,"t":{"83":{"position":[[3529,5],[6143,5]]}}}],["8",{"_index":534,"t":{"83":{"position":[[877,2],[930,2],[985,2],[1050,2],[1117,2],[1196,2]]},"228":{"position":[[731,1]]},"496":{"position":[[25,1]]},"505":{"position":[[548,1]]},"547":{"position":[[657,1]]},"564":{"position":[[428,2],[1214,2]]},"618":{"position":[[296,1]]},"706":{"position":[[328,3],[369,2]]}}}],["8.1",{"_index":723,"t":{"83":{"position":[[3874,3],[6677,3]]}}}],["8080",{"_index":1252,"t":{"116":{"position":[[131,5]]}}}],["8297",{"_index":552,"t":{"83":{"position":[[1415,4]]}}}],["8446",{"_index":1843,"t":{"228":{"position":[[104,5]]}}}],["8470",{"_index":686,"t":{"83":{"position":[[3278,5],[5739,5]]}}}],["88",{"_index":2590,"t":{"473":{"position":[[538,2]]}}}],["8859",{"_index":3107,"t":{"564":{"position":[[1221,4],[1385,4],[1402,4]]}}}],["8d7ad5e3",{"_index":3241,"t":{"606":{"position":[[256,9]]}}}],["9",{"_index":3081,"t":{"559":{"position":[[2962,3]]}}}],["9.1.2",{"_index":674,"t":{"83":{"position":[[3110,5],[5482,5]]}}}],["900",{"_index":3424,"t":{"662":{"position":[[161,3]]}}}],["91",{"_index":2958,"t":{"547":{"position":[[828,2],[907,2]]}}}],["_",{"_index":438,"t":{"61":{"position":[[129,1]]},"104":{"position":[[255,1]]},"106":{"position":[[449,1]]},"108":{"position":[[228,1]]},"110":{"position":[[334,1]]},"126":{"position":[[203,1],[240,3]]},"128":{"position":[[704,1],[798,1]]},"149":{"position":[[498,1]]},"153":{"position":[[512,1]]},"186":{"position":[[654,1]]},"310":{"position":[[202,1]]},"346":{"position":[[825,2]]},"470":{"position":[[312,1],[1139,1],[1741,1]]},"559":{"position":[[1189,2],[2331,2]]},"610":{"position":[[432,1]]},"634":{"position":[[600,2]]},"682":{"position":[[405,2]]},"684":{"position":[[485,2]]}}}],["_pass",{"_index":1681,"t":{"176":{"position":[[832,8]]}}}],["_test.go",{"_index":1293,"t":{"128":{"position":[[84,8]]}}}],["_test\\\\.go",{"_index":2689,"t":{"492":{"position":[[764,14]]}}}],["_user",{"_index":1679,"t":{"176":{"position":[[806,8]]}}}],["a.byt",{"_index":238,"t":{"21":{"position":[[216,9]]}}}],["a.get(\"/test",{"_index":1228,"t":{"106":{"position":[[406,14]]}}}],["a.name(\"fd",{"_index":1227,"t":{"106":{"position":[[392,13]]}}}],["a.pars",{"_index":234,"t":{"21":{"position":[[159,10]]}}}],["a.request",{"_index":230,"t":{"21":{"position":[[65,11]]}}}],["a/test",{"_index":1233,"t":{"106":{"position":[[734,10],[936,10]]}}}],["a241",{"_index":3244,"t":{"606":{"position":[[276,4]]}}}],["aaf3",{"_index":3242,"t":{"606":{"position":[[266,4]]}}}],["abort",{"_index":1862,"t":{"228":{"position":[[970,6]]}}}],["abov",{"_index":100,"t":{"6":{"position":[[1081,5]]},"149":{"position":[[218,5]]},"464":{"position":[[668,6]]}}}],["ac",{"_index":2698,"t":{"496":{"position":[[80,3]]},"556":{"position":[[98,3]]}}}],["accept",{"_index":838,"t":{"83":{"position":[[7395,7],[7432,7],[7935,8],[7966,7],[8006,7],[8047,7],[9664,7],[10736,7],[10972,7],[11012,7],[11057,7]]},"135":{"position":[[3677,9]]},"192":{"position":[[125,6]]},"208":{"position":[[449,8],[641,8]]},"384":{"position":[[607,8]]},"554":{"position":[[572,7]]},"564":{"position":[[57,11],[97,6],[352,7],[782,7],[1107,10],[1175,6],[1194,6],[1237,6],[1278,6]]},"594":{"position":[[36,6],[64,7],[291,7],[359,7],[433,7]]},"710":{"position":[[469,9],[511,6],[528,6]]}}}],["accepts(off",{"_index":3085,"t":{"564":{"position":[[141,14]]}}}],["acceptscharsets(off",{"_index":3086,"t":{"564":{"position":[[188,22]]}}}],["acceptsencodings(off",{"_index":3087,"t":{"564":{"position":[[243,23]]}}}],["acceptslanguages(off",{"_index":3088,"t":{"564":{"position":[[299,23]]}}}],["access",{"_index":882,"t":{"83":{"position":[[8217,7],[8286,7],[8351,7],[8415,7],[8480,7],[8540,7],[8601,7],[8669,7]]},"208":{"position":[[658,6]]},"210":{"position":[[252,7],[609,6],[736,9],[1498,7]]},"284":{"position":[[135,7]]},"300":{"position":[[463,6],[595,6]]},"312":{"position":[[233,6]]},"384":{"position":[[563,6]]},"473":{"position":[[146,7]]},"568":{"position":[[47,6]]},"634":{"position":[[3,6]]},"640":{"position":[[891,8]]}}}],["access_token=clearli",{"_index":2129,"t":{"344":{"position":[[1035,21]]}}}],["access_token=correct",{"_index":2127,"t":{"344":{"position":[[924,21]]},"346":{"position":[[1541,21],[1705,21]]}}}],["accordingli",{"_index":2755,"t":{"507":{"position":[[263,11]]}}}],["account",{"_index":2191,"t":{"360":{"position":[[302,7]]}}}],["acquireag",{"_index":228,"t":{"21":{"position":[[43,14]]}}}],["acquirearg",{"_index":360,"t":{"49":{"position":[[209,11],[334,13]]},"51":{"position":[[271,11],[405,13]]}}}],["acquireformfil",{"_index":395,"t":{"51":{"position":[[1549,15]]}}}],["acquirerespons",{"_index":460,"t":{"71":{"position":[[105,15],[258,17]]}}}],["action",{"_index":2078,"t":{"326":{"position":[[183,6]]},"374":{"position":[[440,6]]},"507":{"position":[[256,6]]}}}],["activ",{"_index":1189,"t":{"100":{"position":[[67,6],[272,6]]}}}],["active20{{.title}}back/static/image.png",{"_index":2006,"t":{"300":{"position":[[522,35]]}}}],["http:///static/static/image.png",{"_index":2008,"t":{"300":{"position":[[617,42]]}}}],["http://api.example.com/users?page=2",{"_index":3297,"t":{"626":{"position":[[195,38],[300,38]]}}}],["http://api.example.com/users?page=5",{"_index":3298,"t":{"626":{"position":[[242,38],[354,38]]}}}],["http://example.com",{"_index":3359,"t":{"648":{"position":[[127,18]]}}}],["http://example.com/?field1=value1&field1=value2&field2=value3",{"_index":3367,"t":{"650":{"position":[[374,61]]}}}],["http://example.com/?list_a=1&list_a=2&list_a=3&list_b[]=1&list_b[]=2&list_b[]=3&list_c=1,2,3",{"_index":3372,"t":{"650":{"position":[[558,92]]}}}],["http://example.com/?name=alex&amount=32.23&id",{"_index":3402,"t":{"656":{"position":[[533,46]]}}}],["http://example.com/?name=alex&wanna_cake=2&id",{"_index":3408,"t":{"658":{"position":[[523,46]]}}}],["http://example.com/?name=alex&want_pizza=false&id",{"_index":3360,"t":{"650":{"position":[[180,50]]},"654":{"position":[[465,50]]}}}],["http://example.com/?order=desc&brand=nik",{"_index":3388,"t":{"652":{"position":[[341,41]]}}}],["http://example.com/hello",{"_index":3189,"t":{"584":{"position":[[337,24]]}}}],["http://example.com/search?q=someth",{"_index":3331,"t":{"638":{"position":[[94,37]]}}}],["http://example.com/user/111",{"_index":3351,"t":{"644":{"position":[[309,27]]}}}],["http://example.com/user/123",{"_index":3343,"t":{"642":{"position":[[350,27]]}}}],["http://example.com/user/fenni",{"_index":3119,"t":{"566":{"position":[[148,29]]},"640":{"position":[[297,29]]}}}],["http://example.com/user/fenny/123",{"_index":3122,"t":{"566":{"position":[[282,33]]},"640":{"position":[[422,33]]}}}],["http://example.com/users?sort=desc",{"_index":3357,"t":{"646":{"position":[[254,34]]}}}],["http://google.com",{"_index":1303,"t":{"128":{"position":[[460,17],[615,20]]},"404":{"position":[[1439,20]]},"570":{"position":[[281,20],[352,17],[425,18]]}}}],["http://google.com/search",{"_index":3263,"t":{"612":{"position":[[113,24]]}}}],["http://localhost",{"_index":2416,"t":{"404":{"position":[[2016,19]]},"570":{"position":[[302,19],[334,17],[407,17]]}}}],["http://localhost:3000",{"_index":136,"t":{"8":{"position":[[293,21]]},"208":{"position":[[589,21],[717,22]]},"320":{"position":[[268,21]]},"344":{"position":[[856,21],[968,21],[1070,21]]},"346":{"position":[[1451,21]]},"348":{"position":[[820,21]]},"404":{"position":[[1726,24]]},"547":{"position":[[2601,22]]},"580":{"position":[[1238,21]]},"674":{"position":[[763,24]]}}}],["http://localhost:3000/1",{"_index":2984,"t":{"547":{"position":[[1443,23],[1711,23]]}}}],["http://localhost:3000/12",{"_index":2983,"t":{"547":{"position":[[1397,24]]}}}],["http://localhost:3000/120000",{"_index":2986,"t":{"547":{"position":[[1645,28]]}}}],["http://localhost:3000/125",{"_index":2995,"t":{"547":{"position":[[2044,25]]}}}],["http://localhost:3000/2022",{"_index":2998,"t":{"547":{"position":[[2166,26]]}}}],["http://localhost:3000/250",{"_index":2988,"t":{"547":{"position":[[1767,25]]}}}],["http://localhost:3000/42",{"_index":3001,"t":{"547":{"position":[[2555,24]]}}}],["http://localhost:3000/7.0",{"_index":3002,"t":{"547":{"position":[[2642,25]]}}}],["http://localhost:3000/?name=john&pass=do",{"_index":3167,"t":{"580":{"position":[[1276,43]]}}}],["http://localhost:3000/?name=john&pass=doe&products=shoe,hat",{"_index":3420,"t":{"660":{"position":[[737,61]]}}}],["http://localhost:3000/allow",{"_index":2158,"t":{"348":{"position":[[952,29]]}}}],["http://localhost:3000/api/user/john",{"_index":184,"t":{"10":{"position":[[1218,35]]}}}],["http://localhost:3000/auth2",{"_index":2152,"t":{"346":{"position":[[1749,27]]}}}],["http://localhost:3000/authent",{"_index":2150,"t":{"346":{"position":[[1585,35]]}}}],["http://localhost:3000/bodi",{"_index":3551,"t":{"696":{"position":[[1574,26]]}}}],["http://localhost:3000/css/style.css",{"_index":1036,"t":{"86":{"position":[[435,35]]}}}],["http://localhost:3000/flights/lax",{"_index":2895,"t":{"545":{"position":[[2140,33]]}}}],["http://localhost:3000/foo/1000",{"_index":2545,"t":{"470":{"position":[[861,32]]}}}],["http://localhost:3000/foo/3000",{"_index":2546,"t":{"470":{"position":[[952,32]]}}}],["http://localhost:3000/hello.html",{"_index":1034,"t":{"86":{"position":[[355,32]]}}}],["http://localhost:3000/john",{"_index":178,"t":{"10":{"position":[[991,26]]}}}],["http://localhost:3000/js/jquery.j",{"_index":1035,"t":{"86":{"position":[[394,34]]}}}],["http://localhost:3000/metr",{"_index":2329,"t":{"384":{"position":[[634,29]]}}}],["http://localhost:3000/old",{"_index":2450,"t":{"424":{"position":[[476,25]]},"444":{"position":[[456,25]]}}}],["http://localhost:3000/old/hello",{"_index":2451,"t":{"424":{"position":[[507,31]]},"444":{"position":[[487,31]]}}}],["http://localhost:3000/plantae/prunus.persica",{"_index":2889,"t":{"545":{"position":[[1931,44]]}}}],["http://localhost:3000/query?title=title&body=body&date=2021",{"_index":3552,"t":{"696":{"position":[[1616,60]]}}}],["http://localhost:3000/shop/product/color:blue/size:x",{"_index":2903,"t":{"545":{"position":[[2479,53]]}}}],["http://localhost:3000/static/css/style.css",{"_index":1046,"t":{"86":{"position":[[968,42]]}}}],["http://localhost:3000/static/hello.html",{"_index":1044,"t":{"86":{"position":[[874,39]]}}}],["http://localhost:3000/static/js/jquery.j",{"_index":1045,"t":{"86":{"position":[[920,41]]}}}],["http://localhost:3000/test",{"_index":2997,"t":{"547":{"position":[[2104,26]]}}}],["http://localhost:3001",{"_index":2419,"t":{"404":{"position":[[2276,24],[2459,24],[2875,24]]}}}],["http://localhost:3002",{"_index":2420,"t":{"404":{"position":[[2301,24],[2484,24],[2900,24]]}}}],["http://localhost:3003",{"_index":2421,"t":{"404":{"position":[[2326,24],[2509,24],[2925,24]]}}}],["http://localhost:8000",{"_index":2405,"t":{"404":{"position":[[820,25]]}}}],["http://localhost:8080",{"_index":3142,"t":{"578":{"position":[[92,21]]}}}],["http://localhost:8080/css/style.css",{"_index":206,"t":{"12":{"position":[[466,35]]}}}],["http://localhost:8080/hello",{"_index":3473,"t":{"680":{"position":[[84,27]]}}}],["http://localhost:8080/hello%20world",{"_index":173,"t":{"10":{"position":[[787,35]]}}}],["http://localhost:8080/hello.html",{"_index":204,"t":{"12":{"position":[[398,32]]}}}],["http://localhost:8080/js/jquery.j",{"_index":205,"t":{"12":{"position":[[431,34]]}}}],["http://www.foobar.com",{"_index":2429,"t":{"406":{"position":[[332,22]]}}}],["httpapi",{"_index":2081,"t":{"326":{"position":[[293,7]]}}}],["httperror",{"_index":1488,"t":{"137":{"position":[[23,9]]}}}],["httphandler",{"_index":1611,"t":{"159":{"position":[[27,11]]}}}],["httphandler(h",{"_index":1612,"t":{"159":{"position":[[39,13]]}}}],["httphandlerfunc",{"_index":1614,"t":{"159":{"position":[[111,15]]}}}],["httphandlerfunc(h",{"_index":1615,"t":{"159":{"position":[[127,17]]}}}],["httphandlerfunc(mw",{"_index":1618,"t":{"159":{"position":[[226,18]]}}}],["httpmiddlewar",{"_index":1617,"t":{"159":{"position":[[211,14]]}}}],["httponli",{"_index":3179,"t":{"582":{"position":[[822,9],[1027,9]]},"588":{"position":[[280,8]]}}}],["httpreq",{"_index":1660,"t":{"170":{"position":[[304,8]]}}}],["httpreq.url.str",{"_index":1663,"t":{"170":{"position":[[420,21]]}}}],["https://blog.trailofbits.com/2019/03/25/what",{"_index":1859,"t":{"228":{"position":[[733,44]]}}}],["https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/chart.bundle.min.j",{"_index":2352,"t":{"386":{"position":[[857,66]]}}}],["https://datatracker.ietf.org/doc/html/draft",{"_index":2079,"t":{"326":{"position":[[244,43]]}}}],["https://datatracker.ietf.org/doc/html/rfc8446#sect",{"_index":1858,"t":{"228":{"position":[[677,53]]}}}],["https://example.com",{"_index":489,"t":{"81":{"position":[[290,21]]},"574":{"position":[[198,19]]}}}],["https://example.com/page#chapt",{"_index":3135,"t":{"574":{"position":[[108,32]]}}}],["https://expressjs.com/en/4x/api.html#req.fresh",{"_index":3235,"t":{"600":{"position":[[0,46]]}}}],["https://expressjs.com/en/4x/api.html#req.stal",{"_index":3556,"t":{"700":{"position":[[0,46]]}}}],["https://fonts.googleapis.com/css2?family=roboto:wght@400;900&display=swap",{"_index":2349,"t":{"386":{"position":[[656,73]]}}}],["https://foobar.com",{"_index":2428,"t":{"406":{"position":[[311,20]]}}}],["https://github.com/geertjohan/go.ric",{"_index":2019,"t":{"306":{"position":[[0,37]]}}}],["https://github.com/go",{"_index":3038,"t":{"559":{"position":[[961,21]]}}}],["https://github.com/gobuffalo/packr",{"_index":2015,"t":{"304":{"position":[[0,34]]}}}],["https://github.com/markbates/pkg",{"_index":2011,"t":{"302":{"position":[[0,34]]}}}],["https://github.com/rakyll/statik",{"_index":2025,"t":{"310":{"position":[[0,32]]}}}],["https://github.com/smallnest/go",{"_index":2627,"t":{"485":{"position":[[3,31]]}}}],["https://github.com/unnoted/fileb0x",{"_index":2022,"t":{"308":{"position":[[0,34]]}}}],["https://gofiber.io",{"_index":1763,"t":{"208":{"position":[[369,20]]}}}],["https://gofiber.net",{"_index":1764,"t":{"208":{"position":[[390,21]]}}}],["https://i.imgur.com/\"+c.params(\"id\")+\".gif",{"_index":2407,"t":{"404":{"position":[[1119,44]]}}}],["https://programming.guide/go/format",{"_index":2253,"t":{"374":{"position":[[662,35]]}}}],["httptest.newrequest(\"get",{"_index":1306,"t":{"128":{"position":[[588,26]]}}}],["hyphen",{"_index":2880,"t":{"545":{"position":[[1613,6]]}}}],["i.",{"_index":1109,"t":{"88":{"position":[[1292,4]]},"228":{"position":[[965,4]]},"406":{"position":[[305,5]]},"541":{"position":[[1292,4]]},"561":{"position":[[1292,4]]}}}],["icon",{"_index":1968,"t":{"284":{"position":[[80,4]]}}}],["id",{"_index":971,"t":{"83":{"position":[[10502,3],[11548,3]]},"372":{"position":[[656,2]]},"434":{"position":[[444,3]]},"436":{"position":[[259,2],[298,3],[503,2]]},"448":{"position":[[445,4]]},"452":{"position":[[363,2],[1322,2]]},"606":{"position":[[248,4]]},"642":{"position":[[426,3]]},"644":{"position":[[401,3],[453,7]]}}}],["idjohndoe/myembeddedfil",{"_index":2023,"t":{"308":{"position":[[149,24]]}}}],["module>/statik",{"_index":2030,"t":{"310":{"position":[[214,15]]}}}],["monitor",{"_index":2319,"t":{"380":{"position":[[0,7],[85,7],[101,7]]},"386":{"position":[[120,8],[263,10]]}}}],["monitor.new",{"_index":2324,"t":{"384":{"position":[[321,14]]}}}],["monitor.new(monitor.config{titl",{"_index":2327,"t":{"384":{"position":[[488,33]]}}}],["more",{"_index":116,"t":{"6":{"position":[[1512,4]]},"14":{"position":[[4,4]]},"86":{"position":[[1044,4]]},"92":{"position":[[39,4]]},"135":{"position":[[4813,4],[5057,4]]},"264":{"position":[[46,4]]},"344":{"position":[[1130,4]]},"362":{"position":[[1399,4]]},"372":{"position":[[725,4]]},"440":{"position":[[140,4]]},"490":{"position":[[113,4]]},"492":{"position":[[146,4]]},"496":{"position":[[139,4]]},"500":{"position":[[1275,4]]},"547":{"position":[[647,4],[857,4],[952,4],[1022,4]]},"551":{"position":[[437,4]]},"559":{"position":[[939,4]]},"578":{"position":[[386,7]]},"580":{"position":[[1453,7]]},"584":{"position":[[218,4]]},"586":{"position":[[275,4]]},"590":{"position":[[473,7]]},"598":{"position":[[453,7]]},"602":{"position":[[465,7]]},"606":{"position":[[532,7]]},"612":{"position":[[350,7]]},"638":{"position":[[356,7]]},"640":{"position":[[1182,7]]},"652":{"position":[[655,7]]},"664":{"position":[[462,4]]}}}],["mount",{"_index":1122,"t":{"90":{"position":[[8,5],[43,6]]},"92":{"position":[[81,8],[435,8],[497,5],[536,8]]},"135":{"position":[[3436,7]]},"538":{"position":[[49,8],[71,5],[108,7],[201,9],[649,5],[728,5],[795,5],[848,5]]},"549":{"position":[[509,6]]}}}],["mount(prefix",{"_index":1123,"t":{"90":{"position":[[74,12]]}}}],["mountpath",{"_index":1130,"t":{"92":{"position":[[4,9],[116,11],[467,10]]}}}],["ms",{"_index":2532,"t":{"470":{"position":[[360,5],[1187,5]]},"475":{"position":[[448,3],[524,3]]},"477":{"position":[[74,3],[155,3]]},"479":{"position":[[74,3],[154,3]]},"481":{"position":[[74,3],[153,3]]},"483":{"position":[[76,3],[156,3]]},"485":{"position":[[178,3],[185,3],[193,3],[201,2],[540,2]]},"492":{"position":[[659,2]]}}}],["msg",{"_index":1533,"t":{"147":{"position":[[226,4]]}}}],["mstimeout",{"_index":1300,"t":{"128":{"position":[[296,9]]}}}],["multi",{"_index":1447,"t":{"135":{"position":[[5492,5],[5520,5]]},"406":{"position":[[870,5],[901,5]]}}}],["multipart",{"_index":368,"t":{"51":{"position":[[20,9],[185,9],[632,9],[833,9],[1201,9],[1248,9],[1478,9]]},"135":{"position":[[1559,9],[1650,9]]},"634":{"position":[[10,9],[294,9]]},"682":{"position":[[27,9],[191,9]]},"684":{"position":[[27,9],[271,9]]}}}],["multipart.filehead",{"_index":3228,"t":{"596":{"position":[[138,23]]},"634":{"position":[[549,23]]},"682":{"position":[[87,22],[354,23]]},"684":{"position":[[126,22],[434,23]]}}}],["multipart.form",{"_index":3314,"t":{"634":{"position":[[207,17],[364,15]]},"682":{"position":[[261,15]]},"684":{"position":[[341,15]]}}}],["multipart/form",{"_index":369,"t":{"51":{"position":[[81,14]]},"83":{"position":[[807,15]]},"580":{"position":[[306,14]]}}}],["multipartform",{"_index":367,"t":{"51":{"position":[[0,13],[165,13],[580,14]]},"596":{"position":[[0,13]]},"634":{"position":[[64,16],[191,15]]}}}],["multipartform(arg",{"_index":373,"t":{"51":{"position":[[356,18]]}}}],["multipartform(nil",{"_index":378,"t":{"51":{"position":[[752,19],[1133,19],[1840,18]]}}}],["multipl",{"_index":155,"t":{"10":{"position":[[208,8]]},"25":{"position":[[38,8]]},"31":{"position":[[68,8]]},"51":{"position":[[889,8]]},"86":{"position":[[500,8]]},"88":{"position":[[1625,9],[1742,8]]},"135":{"position":[[4757,8]]},"326":{"position":[[200,8]]},"394":{"position":[[369,8]]},"400":{"position":[[64,8]]},"402":{"position":[[41,8]]},"541":{"position":[[1625,9],[1742,8]]},"547":{"position":[[1250,8],[1502,8]]},"556":{"position":[[66,8]]},"561":{"position":[[1625,9],[1742,8]]},"582":{"position":[[259,8]]},"710":{"position":[[166,8]]}}}],["mustach",{"_index":2703,"t":{"496":{"position":[[117,8]]},"556":{"position":[[130,8]]}}}],["mycustomstorag",{"_index":2184,"t":{"358":{"position":[[636,18]]}}}],["myembeddedfiles.http",{"_index":2024,"t":{"308":{"position":[[268,21]]}}}],["myfil",{"_index":2946,"t":{"547":{"position":[[628,6]]}}}],["mymiddlewar",{"_index":3482,"t":{"680":{"position":[[405,14]]}}}],["myservic",{"_index":2326,"t":{"384":{"position":[[443,10],[522,10]]}}}],["myvalid",{"_index":3055,"t":{"559":{"position":[[1588,11]]}}}],["myvalidator.validate(us",{"_index":3067,"t":{"559":{"position":[[2237,27]]}}}],["myvalidator.validator.registervalidation(\"teen",{"_index":3058,"t":{"559":{"position":[[1908,50]]}}}],["n",{"_index":2815,"t":{"526":{"position":[[615,5]]},"712":{"position":[[74,2]]},"714":{"position":[[99,2]]},"716":{"position":[[76,2]]}}}],["name",{"_index":200,"t":{"12":{"position":[[251,5]]},"51":{"position":[[1087,6],[1325,4],[1350,4],[1370,4],[1375,4]]},"59":{"position":[[93,5]]},"86":{"position":[[306,5],[1857,4]]},"96":{"position":[[142,4],[301,6],[368,6]]},"106":{"position":[[24,4],[571,7],[638,7],[707,7],[787,7],[850,7],[916,7],[1003,7],[1095,7]]},"108":{"position":[[30,5],[356,7]]},"110":{"position":[[443,7]]},"133":{"position":[[30,5]]},"135":{"position":[[330,4],[849,4],[920,5],[1299,5],[2532,4]]},"147":{"position":[[1037,7]]},"159":{"position":[[0,4]]},"220":{"position":[[570,4]]},"252":{"position":[[105,6]]},"256":{"position":[[940,5]]},"262":{"position":[[106,5]]},"336":{"position":[[402,4]]},"450":{"position":[[466,4],[864,6]]},"452":{"position":[[1354,4]]},"492":{"position":[[444,6]]},"526":{"position":[[57,7],[150,6],[889,5],[919,5]]},"530":{"position":[[62,7],[160,6]]},"545":{"position":[[62,5],[75,5],[254,4],[611,5],[3028,6],[3057,7]]},"554":{"position":[[591,4]]},"559":{"position":[[441,4],[1382,4],[2163,5]]},"566":{"position":[[245,9]]},"580":{"position":[[461,5],[526,4]]},"582":{"position":[[221,5],[279,6],[744,5],[938,5]]},"588":{"position":[[79,4]]},"596":{"position":[[40,5]]},"598":{"position":[[36,5],[251,7]]},"610":{"position":[[18,5]]},"622":{"position":[[220,4],[331,5],[420,9],[476,7],[550,9]]},"624":{"position":[[151,4],[203,5],[338,4],[445,5]]},"660":{"position":[[311,5],[376,4]]},"666":{"position":[[510,7],[687,7]]},"674":{"position":[[321,5],[386,4],[791,6]]},"680":{"position":[[258,6]]},"704":{"position":[[51,4]]},"720":{"position":[[255,4],[387,5]]}}}],["name(\"addus",{"_index":2817,"t":{"526":{"position":[[719,18]]}}}],["name(\"destroyus",{"_index":2819,"t":{"526":{"position":[[829,22]]}}}],["name(\"hom",{"_index":3252,"t":{"610":{"position":[[257,15]]}}}],["name(\"index",{"_index":1245,"t":{"110":{"position":[[311,16]]},"526":{"position":[[420,16]]}}}],["name(\"us",{"_index":3447,"t":{"666":{"position":[[890,15]]}}}],["name(\"user.show",{"_index":3255,"t":{"610":{"position":[[357,20]]}}}],["name(nam",{"_index":1218,"t":{"106":{"position":[[80,9]]}}}],["name1",{"_index":388,"t":{"51":{"position":[[1118,7],[1723,7]]}}}],["name2",{"_index":402,"t":{"51":{"position":[[1787,7]]}}}],["namegramehello",{"_index":3225,"t":{"594":{"position":[[409,9]]}}}],["packag",{"_index":125,"t":{"8":{"position":[[81,7]]},"88":{"position":[[1206,8]]},"162":{"position":[[0,7]]},"164":{"position":[[0,7]]},"166":{"position":[[0,7]]},"168":{"position":[[0,7]]},"170":{"position":[[0,7]]},"176":{"position":[[22,7]]},"186":{"position":[[22,7]]},"196":{"position":[[22,7]]},"208":{"position":[[22,7]]},"214":{"position":[[695,7]]},"218":{"position":[[22,7]]},"226":{"position":[[41,8]]},"232":{"position":[[22,7]]},"244":{"position":[[22,7]]},"256":{"position":[[22,7]]},"268":{"position":[[22,7]]},"274":{"position":[[109,7]]},"278":{"position":[[22,7]]},"288":{"position":[[22,7]]},"298":{"position":[[22,7]]},"300":{"position":[[90,7]]},"302":{"position":[[35,7]]},"304":{"position":[[35,7]]},"306":{"position":[[38,7]]},"308":{"position":[[35,7]]},"310":{"position":[[33,7]]},"320":{"position":[[0,7]]},"330":{"position":[[22,7]]},"344":{"position":[[0,7]]},"346":{"position":[[139,7]]},"348":{"position":[[0,7]]},"354":{"position":[[252,7]]},"358":{"position":[[22,7]]},"366":{"position":[[41,8]]},"372":{"position":[[22,7]]},"384":{"position":[[22,7]]},"390":{"position":[[142,7]]},"394":{"position":[[22,7]]},"404":{"position":[[22,7]]},"414":{"position":[[22,7]]},"424":{"position":[[0,7]]},"434":{"position":[[22,7]]},"444":{"position":[[0,7]]},"446":{"position":[[68,7]]},"450":{"position":[[22,7]]},"458":{"position":[[41,8]]},"464":{"position":[[22,7]]},"470":{"position":[[22,7]]},"500":{"position":[[57,7]]},"503":{"position":[[472,7]]},"510":{"position":[[384,7]]},"526":{"position":[[251,7]]},"538":{"position":[[288,7]]},"541":{"position":[[1206,8]]},"556":{"position":[[31,7],[168,7]]},"559":{"position":[[42,7],[303,7]]},"561":{"position":[[1206,8]]},"622":{"position":[[65,8]]},"720":{"position":[[72,8]]}}}],["packr.new(\"asset",{"_index":2017,"t":{"304":{"position":[[265,17]]}}}],["page",{"_index":139,"t":{"8":{"position":[[355,5]]},"384":{"position":[[462,5],[541,8]]},"386":{"position":[[77,4]]},"492":{"position":[[313,4]]},"494":{"position":[[320,4]]},"507":{"position":[[415,4],[494,5],[917,4]]},"559":{"position":[[123,4]]},"610":{"position":[[250,6]]},"668":{"position":[[375,6]]}}}],["pair",{"_index":1566,"t":{"147":{"position":[[927,5]]}}}],["panic",{"_index":2434,"t":{"410":{"position":[[48,6]]},"414":{"position":[[296,5]]},"503":{"position":[[335,6],[372,5],[689,5]]}}}],["panic(\"i'm",{"_index":2439,"t":{"414":{"position":[[375,10]]}}}],["panic(\"thi",{"_index":2740,"t":{"503":{"position":[[677,11]]}}}],["panic(err",{"_index":236,"t":{"21":{"position":[[183,10]]},"310":{"position":[[318,10]]},"450":{"position":[[440,10],[661,10],[805,10]]}}}],["param",{"_index":1214,"t":{"104":{"position":[[401,9],[470,9],[538,9]]},"106":{"position":[[601,9],[670,9],[745,9],[812,9],[878,9],[947,9],[1040,9],[1133,9]]},"108":{"position":[[386,9]]},"110":{"position":[[473,9]]},"294":{"position":[[90,7]]},"545":{"position":[[228,6],[2930,7],[2953,7],[3020,7],[3108,7],[3220,7]]},"566":{"position":[[0,6],[50,6],[71,7]]},"610":{"position":[[148,6]]},"640":{"position":[[118,5],[187,5]]},"642":{"position":[[255,5]]},"644":{"position":[[101,9],[385,5]]},"656":{"position":[[417,5]]},"658":{"position":[[417,5]]},"666":{"position":[[298,7],[364,6]]}}}],["param:://:: Get request with value: hello world }) Optional parameter // GET http://localhost:3000/john app.Get(\"/:name?\", func(c *fiber.Ctx) error { if c.Params(\"name\") != \"\" { return c.SendString(\"Hello \" + c.Params(\"name\")) // => Hello john } return c.SendString(\"Where is john?\") }) Wildcards // GET http://localhost:3000/api/user/john app.Get(\"/api/*\", func(c *fiber.Ctx) error { return c.SendString(\"API path: \" + c.Params(\"*\")) // => API path: user/john })","s":"Basic routing","u":"/next/","h":"#basic-routing","p":1},{"i":12,"t":"To serve static files such as images, CSS, and JavaScript files, replace your function handler with a file or directory string. Function signature: app.Static(prefix, root string, config ...Static) Use the following code to serve files in a directory named ./public: app := fiber.New() app.Static(\"/\", \"./public\") app.Listen(\":3000\") Now, you can load the files that are in the ./public directory: http://localhost:8080/hello.html http://localhost:8080/js/jquery.js http://localhost:8080/css/style.css","s":"Static files","u":"/next/","h":"#static-files","p":1},{"i":14,"t":"For more information on how to build APIs in Go with Fiber, please check out this excellent article on building an express-style API in Go with Fiber.","s":"Note","u":"/next/","h":"#note","p":1},{"i":17,"t":"Use the Static method to serve static files such as images, CSS, and JavaScript. info By default, Static will serve index.html files in response to a request on a directory. Signature func (app *App) Static(prefix, root string, config ...Static) Router Use the following code to serve files in a directory named ./public app.Static(\"/\", \"./public\") // => http://localhost:3000/hello.html // => http://localhost:3000/js/jquery.js // => http://localhost:3000/css/style.css Examples // Serve files from multiple directories app.Static(\"/\", \"./public\") // Serve files from \"./files\" directory: app.Static(\"/\", \"./files\") You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below: Examples app.Static(\"/static\", \"./public\") // => http://localhost:3000/static/hello.html // => http://localhost:3000/static/js/jquery.js // => http://localhost:3000/static/css/style.css If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings. fiber.Static{} // Static defines configuration options when defining static assets. type Static struct { // When set to true, the server tries minimizing CPU usage by caching compressed files. // This works differently than the github.com/gofiber/compression middleware. // Optional. Default value false Compress bool `json:\"compress\"` // When set to true, enables byte range requests. // Optional. Default value false ByteRange bool `json:\"byte_range\"` // When set to true, enables directory browsing. // Optional. Default value false. Browse bool `json:\"browse\"` // When set to true, enables direct download. // Optional. Default value false. Download bool `json:\"download\"` // The name of the index file for serving a directory. // Optional. Default value \"index.html\". Index string `json:\"index\"` // Expiration duration for inactive file handlers. // Use a negative time.Duration to disable it. // // Optional. Default value 10 * time.Second. CacheDuration time.Duration `json:\"cache_duration\"` // The value for the Cache-Control HTTP-header // that is set on the file response. MaxAge is defined in seconds. // // Optional. Default value 0. MaxAge int `json:\"max_age\"` // ModifyResponse defines a function that allows you to alter the response. // // Optional. Default: nil ModifyResponse Handler // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *Ctx) bool } Example // Custom config app.Static(\"/\", \"./public\", fiber.Static{ Compress: true, ByteRange: true, Browse: true, Index: \"john.html\", CacheDuration: 10 * time.Second, MaxAge: 3600, })","s":"Static","u":"/next/api/app","h":"#static","p":15},{"i":19,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Route Handlers","u":"/next/api/app","h":"#route-handlers","p":15},{"i":21,"t":"You can Mount Fiber instance by creating a *Mount Signature func (a *App) Mount(prefix string, app *App) Router Examples func main() { app := fiber.New() micro := fiber.New() app.Mount(\"/john\", micro) // GET /john/doe -> 200 OK micro.Get(\"/doe\", func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusOK) }) log.Fatal(app.Listen(\":3000\")) }","s":"Mount","u":"/next/api/app","h":"#mount","p":15},{"i":23,"t":"The MountPath property contains one or more path patterns on which a sub-app was mounted. Signature func (app *App) MountPath() string Examples func main() { app := fiber.New() one := fiber.New() two := fiber.New() three := fiber.New() two.Mount(\"/three\", three) one.Mount(\"/two\", two) app.Mount(\"/one\", one) one.MountPath() // \"/one\" two.MountPath() // \"/one/two\" three.MountPath() // \"/one/two/three\" app.MountPath() // \"\" } caution Mounting order is important for MountPath. If you want to get mount paths properly, you should start mounting from the deepest app.","s":"MountPath","u":"/next/api/app","h":"#mountpath","p":15},{"i":25,"t":"You can group routes by creating a *Group struct. Signature func (app *App) Group(prefix string, handlers ...Handler) Router Examples func main() { app := fiber.New() api := app.Group(\"/api\", handler) // /api v1 := api.Group(\"/v1\", handler) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", handler) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) }","s":"Group","u":"/next/api/app","h":"#group","p":15},{"i":27,"t":"You can define routes with a common prefix inside the common function. Signature func (app *App) Route(prefix string, fn func(router Router), name ...string) Router Examples func main() { app := fiber.New() app.Route(\"/test\", func(api fiber.Router) { api.Get(\"/foo\", handler).Name(\"foo\") // /test/foo (name: test.foo) api.Get(\"/bar\", handler).Name(\"bar\") // /test/bar (name: test.bar) }, \"test.\") log.Fatal(app.Listen(\":3000\")) }","s":"Route","u":"/next/api/app","h":"#route","p":15},{"i":29,"t":"Server returns the underlying fasthttp server Signature func (app *App) Server() *fasthttp.Server Examples func main() { app := fiber.New() app.Server().MaxConnsPerIP = 1 // ... }","s":"Server","u":"/next/api/app","h":"#server","p":15},{"i":31,"t":"Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners and then waits indefinitely for all connections to return to idle before shutting down. ShutdownWithTimeout will forcefully close any active connections after the timeout expires. ShutdownWithContext shuts down the server including by force if the context's deadline is exceeded. func (app *App) Shutdown() error func (app *App) ShutdownWithTimeout(timeout time.Duration) error func (app *App) ShutdownWithContext(ctx context.Context) error","s":"Server Shutdown","u":"/next/api/app","h":"#server-shutdown","p":15},{"i":33,"t":"This method returns the amount of registered handlers. Signature func (app *App) HandlersCount() uint32","s":"HandlersCount","u":"/next/api/app","h":"#handlerscount","p":15},{"i":35,"t":"This method returns the original router stack Signature func (app *App) Stack() [][]*Route Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/john/:age\", handler) app.Post(\"/register\", handler) data, _ := json.MarshalIndent(app.Stack(), \"\", \" \") fmt.Println(string(data)) app.Listen(\":3000\") } Result [ [ { \"method\": \"GET\", \"path\": \"/john/:age\", \"params\": [ \"age\" ] } ], [ { \"method\": \"HEAD\", \"path\": \"/john/:age\", \"params\": [ \"age\" ] } ], [ { \"method\": \"POST\", \"path\": \"/register\", \"params\": null } ] ]","s":"Stack","u":"/next/api/app","h":"#stack","p":15},{"i":37,"t":"This method assigns the name of latest created route. Signature func (app *App) Name(name string) Router Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/\", handler) app.Name(\"index\") app.Get(\"/doe\", handler).Name(\"home\") app.Trace(\"/tracer\", handler).Name(\"tracert\") app.Delete(\"/delete\", handler).Name(\"delete\") a := app.Group(\"/a\") a.Name(\"fd.\") a.Get(\"/test\", handler).Name(\"test\") data, _ := json.MarshalIndent(app.Stack(), \"\", \" \") fmt.Print(string(data)) app.Listen(\":3000\") } Result [ [ { \"method\": \"GET\", \"name\": \"index\", \"path\": \"/\", \"params\": null }, { \"method\": \"GET\", \"name\": \"home\", \"path\": \"/doe\", \"params\": null }, { \"method\": \"GET\", \"name\": \"fd.test\", \"path\": \"/a/test\", \"params\": null } ], [ { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/\", \"params\": null }, { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/doe\", \"params\": null }, { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/a/test\", \"params\": null } ], null, null, [ { \"method\": \"DELETE\", \"name\": \"delete\", \"path\": \"/delete\", \"params\": null } ], null, null, [ { \"method\": \"TRACE\", \"name\": \"tracert\", \"path\": \"/tracer\", \"params\": null } ], null ]","s":"Name","u":"/next/api/app","h":"#name","p":15},{"i":39,"t":"This method gets the route by name. Signature func (app *App) GetRoute(name string) Route Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/\", handler).Name(\"index\") data, _ := json.MarshalIndent(app.GetRoute(\"index\"), \"\", \" \") fmt.Print(string(data)) app.Listen(\":3000\") } Result { \"method\": \"GET\", \"name\": \"index\", \"path\": \"/\", \"params\": null }","s":"GetRoute","u":"/next/api/app","h":"#getroute","p":15},{"i":41,"t":"This method gets all routes. Signature func (app *App) GetRoutes(filterUseOption ...bool) []Route When filterUseOption equal to true, it will filter the routes registered by the middleware. Examples func main() { app := fiber.New() app.Post(\"/\", func (c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }).Name(\"index\") data, _ := json.MarshalIndent(app.GetRoutes(true), \"\", \" \") fmt.Print(string(data)) } Result [ { \"method\": \"POST\", \"name\": \"index\", \"path\": \"/\", \"params\": null } ]","s":"GetRoutes","u":"/next/api/app","h":"#getroutes","p":15},{"i":43,"t":"Config returns the app config as value ( read-only ). Signature func (app *App) Config() Config","s":"Config","u":"/next/api/app","h":"#config","p":15},{"i":45,"t":"Handler returns the server handler that can be used to serve custom *fasthttp.RequestCtx requests. Signature func (app *App) Handler() fasthttp.RequestHandler","s":"Handler","u":"/next/api/app","h":"#handler","p":15},{"i":47,"t":"Listen serves HTTP requests from the given address. Signature func (app *App) Listen(addr string) error Examples // Listen on port :8080 app.Listen(\":8080\") // Custom host app.Listen(\"127.0.0.1:8080\")","s":"Listen","u":"/next/api/app","h":"#listen","p":15},{"i":49,"t":"ListenTLS serves HTTPs requests from the given address using certFile and keyFile paths to as TLS certificate and key file. Signature func (app *App) ListenTLS(addr, certFile, keyFile string) error Examples app.ListenTLS(\":443\", \"./cert.pem\", \"./cert.key\"); Using ListenTLS defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, Certificates: []tls.Certificate{ cert, }, }","s":"ListenTLS","u":"/next/api/app","h":"#listentls","p":15},{"i":51,"t":"Signature func (app *App) ListenTLS(addr string, cert tls.Certificate) error Examples app.ListenTLSWithCertificate(\":443\", cert); Using ListenTLSWithCertificate defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, Certificates: []tls.Certificate{ cert, }, }","s":"ListenTLSWithCertificate","u":"/next/api/app","h":"#listentlswithcertificate","p":15},{"i":53,"t":"ListenMutualTLS serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file Signature func (app *App) ListenMutualTLS(addr, certFile, keyFile, clientCertFile string) error Examples app.ListenMutualTLS(\":443\", \"./cert.pem\", \"./cert.key\", \"./ca-chain-cert.pem\"); Using ListenMutualTLS defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, ClientAuth: tls.RequireAndVerifyClientCert, ClientCAs: clientCertPool, Certificates: []tls.Certificate{ cert, }, }","s":"ListenMutualTLS","u":"/next/api/app","h":"#listenmutualtls","p":15},{"i":55,"t":"ListenMutualTLSWithCertificate serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file Signature func (app *App) ListenMutualTLSWithCertificate(addr string, cert tls.Certificate, clientCertPool *x509.CertPool) error Examples app.ListenMutualTLSWithCertificate(\":443\", cert, clientCertPool); Using ListenMutualTLSWithCertificate defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, ClientAuth: tls.RequireAndVerifyClientCert, ClientCAs: clientCertPool, Certificates: []tls.Certificate{ cert, }, }","s":"ListenMutualTLSWithCertificate","u":"/next/api/app","h":"#listenmutualtlswithcertificate","p":15},{"i":57,"t":"You can pass your own net.Listener using the Listener method. This method can be used to enable TLS/HTTPS with a custom tls.Config. Signature func (app *App) Listener(ln net.Listener) error Examples ln, _ := net.Listen(\"tcp\", \":3000\") cer, _:= tls.LoadX509KeyPair(\"server.crt\", \"server.key\") ln = tls.NewListener(ln, &tls.Config{Certificates: []tls.Certificate{cer}}) app.Listener(ln)","s":"Listener","u":"/next/api/app","h":"#listener","p":15},{"i":59,"t":"Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 1s if you want to disable a timeout altogether, pass -1 as a second argument. Signature func (app *App) Test(req *http.Request, msTimeout ...int) (*http.Response, error) Examples // Create route with GET method for test: app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(c.BaseURL()) // => http://google.com fmt.Println(c.Get(\"X-Custom-Header\")) // => hi return c.SendString(\"hello, World!\") }) // http.Request req := httptest.NewRequest(\"GET\", \"http://google.com\", nil) req.Header.Set(\"X-Custom-Header\", \"hi\") // http.Response resp, _ := app.Test(req) // Do something with results: if resp.StatusCode == fiber.StatusOK { body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) // => Hello, World! }","s":"Test","u":"/next/api/app","h":"#test","p":15},{"i":61,"t":"Hooks is a method to return hooks property. Signature func (app *App) Hooks() *Hooks","s":"Hooks","u":"/next/api/app","h":"#hooks","p":15},{"i":64,"t":"Start a http request with http method and url. Signatures // Client http methods func (c *Client) Get(url string) *Agent func (c *Client) Head(url string) *Agent func (c *Client) Post(url string) *Agent func (c *Client) Put(url string) *Agent func (c *Client) Patch(url string) *Agent func (c *Client) Delete(url string) *Agent","s":"Start request","u":"/next/api/client","h":"#start-request","p":62},{"i":66,"t":"Agent is built on top of FastHTTP's HostClient which has lots of convenient helper methods such as dedicated methods for request methods.","s":"✨ Agent","u":"/next/api/client","h":"#-agent","p":62},{"i":68,"t":"Parse initializes a HostClient. Parse a := AcquireAgent() req := a.Request() req.Header.SetMethod(MethodGet) req.SetRequestURI(\"http://example.com\") if err := a.Parse(); err != nil { panic(err) } code, body, errs := a.Bytes() // ...","s":"Parse","u":"/next/api/client","h":"#parse","p":62},{"i":70,"t":"Set sets the given key: value header. Signature func (a *Agent) Set(k, v string) *Agent func (a *Agent) SetBytesK(k []byte, v string) *Agent func (a *Agent) SetBytesV(k string, v []byte) *Agent func (a *Agent) SetBytesKV(k []byte, v []byte) *Agent Example agent.Set(\"k1\", \"v1\"). SetBytesK([]byte(\"k1\"), \"v1\"). SetBytesV(\"k1\", []byte(\"v1\")). SetBytesKV([]byte(\"k2\"), []byte(\"v2\")) // ...","s":"Set","u":"/next/api/client","h":"#set","p":62},{"i":72,"t":"Add adds the given key: value header. Multiple headers with the same key may be added with this function. Signature func (a *Agent) Add(k, v string) *Agent func (a *Agent) AddBytesK(k []byte, v string) *Agent func (a *Agent) AddBytesV(k string, v []byte) *Agent func (a *Agent) AddBytesKV(k []byte, v []byte) *Agent Example agent.Add(\"k1\", \"v1\"). AddBytesK([]byte(\"k1\"), \"v1\"). AddBytesV(\"k1\", []byte(\"v1\")). AddBytesKV([]byte(\"k2\"), []byte(\"v2\")) // Headers: // K1: v1 // K1: v1 // K1: v1 // K2: v2","s":"Add","u":"/next/api/client","h":"#add","p":62},{"i":74,"t":"ConnectionClose adds the Connection: close header. Signature func (a *Agent) ConnectionClose() *Agent Example agent.ConnectionClose() // ...","s":"ConnectionClose","u":"/next/api/client","h":"#connectionclose","p":62},{"i":76,"t":"UserAgent sets User-Agent header value. Signature func (a *Agent) UserAgent(userAgent string) *Agent func (a *Agent) UserAgentBytes(userAgent []byte) *Agent Example agent.UserAgent(\"fiber\") // ...","s":"UserAgent","u":"/next/api/client","h":"#useragent","p":62},{"i":78,"t":"Cookie sets a cookie in key: value form. Cookies can be used to set multiple cookies. Signature func (a *Agent) Cookie(key, value string) *Agent func (a *Agent) CookieBytesK(key []byte, value string) *Agent func (a *Agent) CookieBytesKV(key, value []byte) *Agent func (a *Agent) Cookies(kv ...string) *Agent func (a *Agent) CookiesBytesKV(kv ...[]byte) *Agent Example agent.Cookie(\"k\", \"v\") agent.Cookies(\"k1\", \"v1\", \"k2\", \"v2\") // ...","s":"Cookie","u":"/next/api/client","h":"#cookie","p":62},{"i":80,"t":"Referer sets the Referer header value. Signature func (a *Agent) Referer(referer string) *Agent func (a *Agent) RefererBytes(referer []byte) *Agent Example agent.Referer(\"https://docs.gofiber.io\") // ...","s":"Referer","u":"/next/api/client","h":"#referer","p":62},{"i":82,"t":"ContentType sets Content-Type header value. Signature func (a *Agent) ContentType(contentType string) *Agent func (a *Agent) ContentTypeBytes(contentType []byte) *Agent Example agent.ContentType(\"custom-type\") // ...","s":"ContentType","u":"/next/api/client","h":"#contenttype","p":62},{"i":84,"t":"Host sets the Host header. Signature func (a *Agent) Host(host string) *Agent func (a *Agent) HostBytes(host []byte) *Agent Example agent.Host(\"example.com\") // ...","s":"Host","u":"/next/api/client","h":"#host","p":62},{"i":86,"t":"QueryString sets the URI query string. Signature func (a *Agent) QueryString(queryString string) *Agent func (a *Agent) QueryStringBytes(queryString []byte) *Agent Example agent.QueryString(\"foo=bar\") // ...","s":"QueryString","u":"/next/api/client","h":"#querystring","p":62},{"i":88,"t":"BasicAuth sets the URI username and password using HTTP Basic Auth. Signature func (a *Agent) BasicAuth(username, password string) *Agent func (a *Agent) BasicAuthBytes(username, password []byte) *Agent Example agent.BasicAuth(\"foo\", \"bar\") // ...","s":"BasicAuth","u":"/next/api/client","h":"#basicauth","p":62},{"i":90,"t":"There are several ways to set request body. Signature func (a *Agent) BodyString(bodyString string) *Agent func (a *Agent) Body(body []byte) *Agent // BodyStream sets request body stream and, optionally body size. // // If bodySize is >= 0, then the bodyStream must provide exactly bodySize bytes // before returning io.EOF. // // If bodySize < 0, then bodyStream is read until io.EOF. // // bodyStream.Close() is called after finishing reading all body data // if it implements io.Closer. // // Note that GET and HEAD requests cannot have body. func (a *Agent) BodyStream(bodyStream io.Reader, bodySize int) *Agent Example agent.BodyString(\"foo=bar\") agent.Body([]byte(\"bar=baz\")) agent.BodyStream(strings.NewReader(\"body=stream\"), -1) // ...","s":"Body","u":"/next/api/client","h":"#body","p":62},{"i":92,"t":"JSON sends a JSON request by setting the Content-Type header to application/json. Signature func (a *Agent) JSON(v interface{}) *Agent Example agent.JSON(fiber.Map{\"success\": true}) // ...","s":"JSON","u":"/next/api/client","h":"#json","p":62},{"i":94,"t":"XML sends an XML request by setting the Content-Type header to application/xml. Signature func (a *Agent) XML(v interface{}) *Agent Example agent.XML(fiber.Map{\"success\": true}) // ...","s":"XML","u":"/next/api/client","h":"#xml","p":62},{"i":96,"t":"Form sends a form request by setting the Content-Type header to application/x-www-form-urlencoded. Signature // Form sends form request with body if args is non-nil. // // It is recommended obtaining args via AcquireArgs and release it // manually in performance-critical code. func (a *Agent) Form(args *Args) *Agent Example args := AcquireArgs() args.Set(\"foo\", \"bar\") agent.Form(args) // ... ReleaseArgs(args)","s":"Form","u":"/next/api/client","h":"#form","p":62},{"i":98,"t":"MultipartForm sends multipart form request by setting the Content-Type header to multipart/form-data. These requests can include key-value's and files. Signature // MultipartForm sends multipart form request with k-v and files. // // It is recommended to obtain args via AcquireArgs and release it // manually in performance-critical code. func (a *Agent) MultipartForm(args *Args) *Agent Example args := AcquireArgs() args.Set(\"foo\", \"bar\") agent.MultipartForm(args) // ... ReleaseArgs(args) Fiber provides several methods for sending files. Note that they must be called before MultipartForm. Boundary​ Boundary sets boundary for multipart form request. Signature func (a *Agent) Boundary(boundary string) *Agent Example agent.Boundary(\"myBoundary\") .MultipartForm(nil) // ... SendFile(s)​ SendFile read a file and appends it to a multipart form request. Sendfiles can be used to append multiple files. Signature func (a *Agent) SendFile(filename string, fieldname ...string) *Agent func (a *Agent) SendFiles(filenamesAndFieldnames ...string) *Agent Example agent.SendFile(\"f\", \"field name\") .SendFiles(\"f1\", \"field name1\", \"f2\"). .MultipartForm(nil) // ... FileData​ FileData appends file data for multipart form request. // FormFile represents multipart form file type FormFile struct { // Fieldname is form file's field name Fieldname string // Name is form file's name Name string // Content is form file's content Content []byte } Signature // FileData appends files for multipart form request. // // It is recommended obtaining formFile via AcquireFormFile and release it // manually in performance-critical code. func (a *Agent) FileData(formFiles ...*FormFile) *Agent Example ff1 := &FormFile{\"filename1\", \"field name1\", []byte(\"content\")} ff2 := &FormFile{\"filename2\", \"field name2\", []byte(\"content\")} agent.FileData(ff1, ff2). MultipartForm(nil) // ...","s":"MultipartForm","u":"/next/api/client","h":"#multipartform","p":62},{"i":100,"t":"Debug mode enables logging request and response detail to io.writer(default is os.Stdout). Signature func (a *Agent) Debug(w ...io.Writer) *Agent Example agent.Debug() // ...","s":"Debug","u":"/next/api/client","h":"#debug","p":62},{"i":102,"t":"Timeout sets request timeout duration. Signature func (a *Agent) Timeout(timeout time.Duration) *Agent Example agent.Timeout(time.Second) // ...","s":"Timeout","u":"/next/api/client","h":"#timeout","p":62},{"i":104,"t":"Reuse enables the Agent instance to be used again after one request. If agent is reusable, then it should be released manually when it is no longer used. Signature func (a *Agent) Reuse() *Agent Example agent.Reuse() // ...","s":"Reuse","u":"/next/api/client","h":"#reuse","p":62},{"i":106,"t":"InsecureSkipVerify controls whether the Agent verifies the server certificate chain and host name. Signature func (a *Agent) InsecureSkipVerify() *Agent Example agent.InsecureSkipVerify() // ...","s":"InsecureSkipVerify","u":"/next/api/client","h":"#insecureskipverify","p":62},{"i":108,"t":"TLSConfig sets tls config. Signature func (a *Agent) TLSConfig(config *tls.Config) *Agent Example // Create tls certificate cer, _ := tls.LoadX509KeyPair(\"pem\", \"key\") config := &tls.Config{ Certificates: []tls.Certificate{cer}, } agent.TLSConfig(config) // ...","s":"TLSConfig","u":"/next/api/client","h":"#tlsconfig","p":62},{"i":110,"t":"MaxRedirectsCount sets max redirect count for GET and HEAD. Signature func (a *Agent) MaxRedirectsCount(count int) *Agent Example agent.MaxRedirectsCount(7) // ...","s":"MaxRedirectsCount","u":"/next/api/client","h":"#maxredirectscount","p":62},{"i":112,"t":"JSONEncoder sets custom json encoder. Signature func (a *Agent) JSONEncoder(jsonEncoder utils.JSONMarshal) *Agent Example agent.JSONEncoder(json.Marshal) // ...","s":"JSONEncoder","u":"/next/api/client","h":"#jsonencoder","p":62},{"i":114,"t":"JSONDecoder sets custom json decoder. Signature func (a *Agent) JSONDecoder(jsonDecoder utils.JSONUnmarshal) *Agent Example agent.JSONDecoder(json.Unmarshal) // ...","s":"JSONDecoder","u":"/next/api/client","h":"#jsondecoder","p":62},{"i":116,"t":"Request returns Agent request instance. Signature func (a *Agent) Request() *Request Example req := agent.Request() // ...","s":"Request","u":"/next/api/client","h":"#request","p":62},{"i":118,"t":"SetResponse sets custom response for the Agent instance. It is recommended obtaining custom response via AcquireResponse and release it manually in performance-critical code. Signature func (a *Agent) SetResponse(customResp *Response) *Agent Example resp := AcquireResponse() agent.SetResponse(resp) // ... ReleaseResponse(resp)","s":"SetResponse","u":"/next/api/client","h":"#setresponse","p":62},{"i":120,"t":"Dest sets custom dest. The contents of dest will be replaced by the response body, if the dest is too small a new slice will be allocated. Signature func (a *Agent) Dest(dest []byte) *Agent { Example agent.Dest(nil) // ...","s":"Dest","u":"/next/api/client","h":"#dest","p":62},{"i":122,"t":"Bytes returns the status code, bytes body and errors of url. Signature func (a *Agent) Bytes() (code int, body []byte, errs []error) Example code, body, errs := agent.Bytes() // ...","s":"Bytes","u":"/next/api/client","h":"#bytes","p":62},{"i":124,"t":"String returns the status code, string body and errors of url. Signature func (a *Agent) String() (int, string, []error) Example code, body, errs := agent.String() // ...","s":"String","u":"/next/api/client","h":"#string","p":62},{"i":126,"t":"Struct returns the status code, bytes body and errors of url. And bytes body will be unmarshalled to given v. Signature func (a *Agent) Struct(v interface{}) (code int, body []byte, errs []error) Example var d data code, body, errs := agent.Struct(&d) // ...","s":"Struct","u":"/next/api/client","h":"#struct","p":62},{"i":128,"t":"RetryIf controls whether a retry should be attempted after an error. By default, will use isIdempotent function from fasthttp Signature func (a *Agent) RetryIf(retryIf RetryIfFunc) *Agent Example agent.Get(\"https://example.com\").RetryIf(func (req *fiber.Request) bool { return req.URI() == \"https://example.com\" }) // ...","s":"RetryIf","u":"/next/api/client","h":"#retryif","p":62},{"i":130,"t":"HTTP methods were copied from net/http. const ( MethodGet = \"GET\" // RFC 7231, 4.3.1 MethodHead = \"HEAD\" // RFC 7231, 4.3.2 MethodPost = \"POST\" // RFC 7231, 4.3.3 MethodPut = \"PUT\" // RFC 7231, 4.3.4 MethodPatch = \"PATCH\" // RFC 5789 MethodDelete = \"DELETE\" // RFC 7231, 4.3.5 MethodConnect = \"CONNECT\" // RFC 7231, 4.3.6 MethodOptions = \"OPTIONS\" // RFC 7231, 4.3.7 MethodTrace = \"TRACE\" // RFC 7231, 4.3.8 methodUse = \"USE\" ) MIME types that are commonly used const ( MIMETextXML = \"text/xml\" MIMETextHTML = \"text/html\" MIMETextPlain = \"text/plain\" MIMEApplicationXML = \"application/xml\" MIMEApplicationJSON = \"application/json\" MIMEApplicationJavaScript = \"application/javascript\" MIMEApplicationForm = \"application/x-www-form-urlencoded\" MIMEOctetStream = \"application/octet-stream\" MIMEMultipartForm = \"multipart/form-data\" MIMETextXMLCharsetUTF8 = \"text/xml; charset=utf-8\" MIMETextHTMLCharsetUTF8 = \"text/html; charset=utf-8\" MIMETextPlainCharsetUTF8 = \"text/plain; charset=utf-8\" MIMEApplicationXMLCharsetUTF8 = \"application/xml; charset=utf-8\" MIMEApplicationJSONCharsetUTF8 = \"application/json; charset=utf-8\" MIMEApplicationJavaScriptCharsetUTF8 = \"application/javascript; charset=utf-8\" ) HTTP status codes were copied from net/http. const ( StatusContinue = 100 // RFC 7231, 6.2.1 StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2 StatusProcessing = 102 // RFC 2518, 10.1 StatusEarlyHints = 103 // RFC 8297 StatusOK = 200 // RFC 7231, 6.3.1 StatusCreated = 201 // RFC 7231, 6.3.2 StatusAccepted = 202 // RFC 7231, 6.3.3 StatusNonAuthoritativeInformation = 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 StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7 StatusPermanentRedirect = 308 // RFC 7538, 3 StatusBadRequest = 400 // RFC 7231, 6.5.1 StatusUnauthorized = 401 // RFC 7235, 3.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 StatusMisdirectedRequest = 421 // RFC 7540, 9.1.2 StatusUnprocessableEntity = 422 // RFC 4918, 11.2 StatusLocked = 423 // RFC 4918, 11.3 StatusFailedDependency = 424 // RFC 4918, 11.4 StatusTooEarly = 425 // RFC 8470, 5.2. StatusUpgradeRequired = 426 // RFC 7231, 6.5.15 StatusPreconditionRequired = 428 // RFC 6585, 3 StatusTooManyRequests = 429 // RFC 6585, 4 StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5 StatusUnavailableForLegalReasons = 451 // RFC 7725, 3 StatusInternalServerError = 500 // RFC 7231, 6.6.1 StatusNotImplemented = 501 // RFC 7231, 6.6.2 StatusBadGateway = 502 // RFC 7231, 6.6.3 StatusServiceUnavailable = 503 // RFC 7231, 6.6.4 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 ) Errors var ( ErrBadRequest = NewError(StatusBadRequest) // RFC 7231, 6.5.1 ErrUnauthorized = NewError(StatusUnauthorized) // RFC 7235, 3.1 ErrPaymentRequired = NewError(StatusPaymentRequired) // RFC 7231, 6.5.2 ErrForbidden = NewError(StatusForbidden) // RFC 7231, 6.5.3 ErrNotFound = NewError(StatusNotFound) // RFC 7231, 6.5.4 ErrMethodNotAllowed = NewError(StatusMethodNotAllowed) // RFC 7231, 6.5.5 ErrNotAcceptable = NewError(StatusNotAcceptable) // RFC 7231, 6.5.6 ErrProxyAuthRequired = NewError(StatusProxyAuthRequired) // RFC 7235, 3.2 ErrRequestTimeout = NewError(StatusRequestTimeout) // RFC 7231, 6.5.7 ErrConflict = NewError(StatusConflict) // RFC 7231, 6.5.8 ErrGone = NewError(StatusGone) // RFC 7231, 6.5.9 ErrLengthRequired = NewError(StatusLengthRequired) // RFC 7231, 6.5.10 ErrPreconditionFailed = NewError(StatusPreconditionFailed) // RFC 7232, 4.2 ErrRequestEntityTooLarge = NewError(StatusRequestEntityTooLarge) // RFC 7231, 6.5.11 ErrRequestURITooLong = NewError(StatusRequestURITooLong) // RFC 7231, 6.5.12 ErrUnsupportedMediaType = NewError(StatusUnsupportedMediaType) // RFC 7231, 6.5.13 ErrRequestedRangeNotSatisfiable = NewError(StatusRequestedRangeNotSatisfiable) // RFC 7233, 4.4 ErrExpectationFailed = NewError(StatusExpectationFailed) // RFC 7231, 6.5.14 ErrTeapot = NewError(StatusTeapot) // RFC 7168, 2.3.3 ErrMisdirectedRequest = NewError(StatusMisdirectedRequest) // RFC 7540, 9.1.2 ErrUnprocessableEntity = NewError(StatusUnprocessableEntity) // RFC 4918, 11.2 ErrLocked = NewError(StatusLocked) // RFC 4918, 11.3 ErrFailedDependency = NewError(StatusFailedDependency) // RFC 4918, 11.4 ErrTooEarly = NewError(StatusTooEarly) // RFC 8470, 5.2. ErrUpgradeRequired = NewError(StatusUpgradeRequired) // RFC 7231, 6.5.15 ErrPreconditionRequired = NewError(StatusPreconditionRequired) // RFC 6585, 3 ErrTooManyRequests = NewError(StatusTooManyRequests) // RFC 6585, 4 ErrRequestHeaderFieldsTooLarge = NewError(StatusRequestHeaderFieldsTooLarge) // RFC 6585, 5 ErrUnavailableForLegalReasons = NewError(StatusUnavailableForLegalReasons) // RFC 7725, 3 ErrInternalServerError = NewError(StatusInternalServerError) // RFC 7231, 6.6.1 ErrNotImplemented = NewError(StatusNotImplemented) // RFC 7231, 6.6.2 ErrBadGateway = NewError(StatusBadGateway) // RFC 7231, 6.6.3 ErrServiceUnavailable = NewError(StatusServiceUnavailable) // RFC 7231, 6.6.4 ErrGatewayTimeout = NewError(StatusGatewayTimeout) // RFC 7231, 6.6.5 ErrHTTPVersionNotSupported = NewError(StatusHTTPVersionNotSupported) // RFC 7231, 6.6.6 ErrVariantAlsoNegotiates = NewError(StatusVariantAlsoNegotiates) // RFC 2295, 8.1 ErrInsufficientStorage = NewError(StatusInsufficientStorage) // RFC 4918, 11.5 ErrLoopDetected = NewError(StatusLoopDetected) // RFC 5842, 7.2 ErrNotExtended = NewError(StatusNotExtended) // RFC 2774, 7 ErrNetworkAuthenticationRequired = NewError(StatusNetworkAuthenticationRequired) // RFC 6585, 6 ) HTTP Headers were copied from net/http. const ( HeaderAuthorization = \"Authorization\" HeaderProxyAuthenticate = \"Proxy-Authenticate\" HeaderProxyAuthorization = \"Proxy-Authorization\" HeaderWWWAuthenticate = \"WWW-Authenticate\" HeaderAge = \"Age\" HeaderCacheControl = \"Cache-Control\" HeaderClearSiteData = \"Clear-Site-Data\" HeaderExpires = \"Expires\" HeaderPragma = \"Pragma\" HeaderWarning = \"Warning\" HeaderAcceptCH = \"Accept-CH\" HeaderAcceptCHLifetime = \"Accept-CH-Lifetime\" HeaderContentDPR = \"Content-DPR\" HeaderDPR = \"DPR\" HeaderEarlyData = \"Early-Data\" HeaderSaveData = \"Save-Data\" HeaderViewportWidth = \"Viewport-Width\" HeaderWidth = \"Width\" HeaderETag = \"ETag\" HeaderIfMatch = \"If-Match\" HeaderIfModifiedSince = \"If-Modified-Since\" HeaderIfNoneMatch = \"If-None-Match\" HeaderIfUnmodifiedSince = \"If-Unmodified-Since\" HeaderLastModified = \"Last-Modified\" HeaderVary = \"Vary\" HeaderConnection = \"Connection\" HeaderKeepAlive = \"Keep-Alive\" HeaderAccept = \"Accept\" HeaderAcceptCharset = \"Accept-Charset\" HeaderAcceptEncoding = \"Accept-Encoding\" HeaderAcceptLanguage = \"Accept-Language\" HeaderCookie = \"Cookie\" HeaderExpect = \"Expect\" HeaderMaxForwards = \"Max-Forwards\" HeaderSetCookie = \"Set-Cookie\" 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\" HeaderOrigin = \"Origin\" HeaderTimingAllowOrigin = \"Timing-Allow-Origin\" HeaderXPermittedCrossDomainPolicies = \"X-Permitted-Cross-Domain-Policies\" HeaderDNT = \"DNT\" HeaderTk = \"Tk\" HeaderContentDisposition = \"Content-Disposition\" HeaderContentEncoding = \"Content-Encoding\" HeaderContentLanguage = \"Content-Language\" HeaderContentLength = \"Content-Length\" HeaderContentLocation = \"Content-Location\" HeaderContentType = \"Content-Type\" HeaderForwarded = \"Forwarded\" HeaderVia = \"Via\" HeaderXForwardedFor = \"X-Forwarded-For\" HeaderXForwardedHost = \"X-Forwarded-Host\" HeaderXForwardedProto = \"X-Forwarded-Proto\" HeaderXForwardedProtocol = \"X-Forwarded-Protocol\" HeaderXForwardedSsl = \"X-Forwarded-Ssl\" HeaderXUrlScheme = \"X-Url-Scheme\" HeaderLocation = \"Location\" HeaderFrom = \"From\" HeaderHost = \"Host\" HeaderReferer = \"Referer\" HeaderReferrerPolicy = \"Referrer-Policy\" HeaderUserAgent = \"User-Agent\" HeaderAllow = \"Allow\" HeaderServer = \"Server\" HeaderAcceptRanges = \"Accept-Ranges\" HeaderContentRange = \"Content-Range\" HeaderIfRange = \"If-Range\" HeaderRange = \"Range\" HeaderContentSecurityPolicy = \"Content-Security-Policy\" HeaderContentSecurityPolicyReportOnly = \"Content-Security-Policy-Report-Only\" HeaderCrossOriginResourcePolicy = \"Cross-Origin-Resource-Policy\" HeaderExpectCT = \"Expect-CT\" HeaderFeaturePolicy = \"Feature-Policy\" HeaderPublicKeyPins = \"Public-Key-Pins\" HeaderPublicKeyPinsReportOnly = \"Public-Key-Pins-Report-Only\" HeaderStrictTransportSecurity = \"Strict-Transport-Security\" HeaderUpgradeInsecureRequests = \"Upgrade-Insecure-Requests\" HeaderXContentTypeOptions = \"X-Content-Type-Options\" HeaderXDownloadOptions = \"X-Download-Options\" HeaderXFrameOptions = \"X-Frame-Options\" HeaderXPoweredBy = \"X-Powered-By\" HeaderXXSSProtection = \"X-XSS-Protection\" HeaderLastEventID = \"Last-Event-ID\" HeaderNEL = \"NEL\" HeaderPingFrom = \"Ping-From\" HeaderPingTo = \"Ping-To\" HeaderReportTo = \"Report-To\" HeaderTE = \"TE\" HeaderTrailer = \"Trailer\" HeaderTransferEncoding = \"Transfer-Encoding\" HeaderSecWebSocketAccept = \"Sec-WebSocket-Accept\" HeaderSecWebSocketExtensions = \"Sec-WebSocket-Extensions\" HeaderSecWebSocketKey = \"Sec-WebSocket-Key\" HeaderSecWebSocketProtocol = \"Sec-WebSocket-Protocol\" HeaderSecWebSocketVersion = \"Sec-WebSocket-Version\" HeaderAcceptPatch = \"Accept-Patch\" HeaderAcceptPushPolicy = \"Accept-Push-Policy\" HeaderAcceptSignature = \"Accept-Signature\" HeaderAltSvc = \"Alt-Svc\" HeaderDate = \"Date\" HeaderIndex = \"Index\" HeaderLargeAllocation = \"Large-Allocation\" HeaderLink = \"Link\" HeaderPushPolicy = \"Push-Policy\" HeaderRetryAfter = \"Retry-After\" HeaderServerTiming = \"Server-Timing\" HeaderSignature = \"Signature\" HeaderSignedHeaders = \"Signed-Headers\" HeaderSourceMap = \"SourceMap\" HeaderUpgrade = \"Upgrade\" HeaderXDNSPrefetchControl = \"X-DNS-Prefetch-Control\" HeaderXPingback = \"X-Pingback\" HeaderXRequestID = \"X-Request-ID\" HeaderXRequestedWith = \"X-Requested-With\" HeaderXRobotsTag = \"X-Robots-Tag\" HeaderXUACompatible = \"X-UA-Compatible\" )","s":"πŸ“‹ Constants","u":"/next/api/constants","h":"","p":129},{"i":133,"t":"This method creates a new App named instance. You can pass optional config when creating a new instance. Signature func New(config ...Config) *App Example // Default config app := fiber.New() // ...","s":"New","u":"/next/api/fiber","h":"#new","p":131},{"i":135,"t":"You can pass an optional Config when creating a new Fiber instance. Example // Custom config app := fiber.New(fiber.Config{ Prefork: true, CaseSensitive: true, StrictRouting: true, ServerHeader: \"Fiber\", AppName: \"Test App v1.0.1\", }) // ... Config fields Property Type Description Default AppName string This allows to setup app name for the app \"\" BodyLimit int Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response. 4 * 1024 * 1024 CaseSensitive bool When enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same. false ColorScheme Colors You can define custom color scheme. They'll be used for startup message, route list and some middlewares. DefaultColors CompressedFileSuffix string Adds a suffix to the original file name and tries saving the resulting compressed file under the new file name. \".fiber.gz\" Concurrency int Maximum number of concurrent connections. 256 * 1024 DisableDefaultContentType bool When set to true, causes the default Content-Type header to be excluded from the Response. false DisableDefaultDate bool When set to true causes the default date header to be excluded from the response. false DisableHeaderNormalizing bool By default all header names are normalized: conteNT-tYPE -> Content-Type false DisableKeepalive bool Disable keep-alive connections, the server will close incoming connections after sending the first response to the client false DisablePreParseMultipartForm bool Will not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data. false DisableStartupMessage bool When set to true, it will not print out debug information false ETag bool Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled. false EnableIPValidation bool If set to true, c.IP() and c.IPs() will validate IP addresses before returning them. Also, c.IP() will return only the first valid IP rather than just the raw header value that may be a comma seperated string. WARNING: There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header. false EnablePrintRoutes bool EnablePrintRoutes enables print all routes with their method, path, name and handler.. false EnableTrustedProxyCheck bool When set to true, fiber will check whether proxy is trusted, using TrustedProxies list. By default c.Protocol() will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, c.IP() will get value from ProxyHeader header, c.Hostname() will get value from X-Forwarded-Host header. If EnableTrustedProxyCheck is true, and RemoteIP is in the list of TrustedProxies c.Protocol(), c.IP(), and c.Hostname() will have the same behaviour when EnableTrustedProxyCheck disabled, if RemoteIP isn't in the list, c.Protocol() will return https in case when tls connection is handled by the app, or http otherwise, c.IP() will return RemoteIP() from fasthttp context, c.Hostname() will return fasthttp.Request.URI().Host() false ErrorHandler ErrorHandler ErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests. DefaultErrorHandler GETOnly bool Rejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set. false IdleTimeout time.Duration The maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used. nil Immutable bool When enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue #185. false JSONDecoder utils.JSONUnmarshal Allowing for flexibility in using another json library for decoding. json.Unmarshal JSONEncoder utils.JSONMarshal Allowing for flexibility in using another json library for encoding. json.Marshal Network string Known networks are \"tcp\", \"tcp4\" (IPv4-only), \"tcp6\" (IPv6-only) WARNING: When prefork is set to true, only \"tcp4\" and \"tcp6\" can be chosen. NetworkTCP4 PassLocalsToViews bool PassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our Template Middleware for supported engines. false Prefork bool Enables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding. NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with CMD ./app or CMD [\"sh\", \"-c\", \"/app\"]. For more info, see this issue comment. false ProxyHeader string This will enable c.IP() to return the value of the given header key. By default c.IP()will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. X-Forwarded-*. \"\" ReadBufferSize int per-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies). 4096 ReadTimeout time.Duration The amount of time allowed to read the full request, including the body. The default timeout is unlimited. nil RequestMethods []string RequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish. DefaultMethods ServerHeader string Enables the Server HTTP header with the given value. \"\" StreamRequestBody bool StreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit. false StrictRouting bool When enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same. false TrustedProxies []string Contains the list of trusted proxy IP's. Look at EnableTrustedProxyCheck doc. It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses. []string*__* UnescapePath bool Converts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special characters false Views Views Views is the interface that wraps the Render function. See our Template Middleware for supported engines. nil ViewsLayout string Views Layout is the global layout for all template render until override on Render function. See our Template Middleware for supported engines. \"\" WriteBufferSize int Per-connection buffer size for responses' writing. 4096 WriteTimeout time.Duration The maximum duration before timing out writes of the response. The default timeout is unlimited. nil XMLEncoder utils.XMLMarshal Allowing for flexibility in using another XML library for encoding. xml.Marshal","s":"Config","u":"/next/api/fiber","h":"#config","p":131},{"i":137,"t":"NewError creates a new HTTPError instance with an optional message. Signature func NewError(code int, message ...string) *Error Example app.Get(\"/\", func(c *fiber.Ctx) error { return fiber.NewError(782, \"Custom error message\") })","s":"NewError","u":"/next/api/fiber","h":"#newerror","p":131},{"i":139,"t":"IsChild determines if the current process is a result of Prefork. Signature func IsChild() bool Example // Prefork will spawn child processes app := fiber.New(fiber.Config{ Prefork: true, }) if !fiber.IsChild() { fmt.Println(\"I'm the parent process\") } else { fmt.Println(\"I'm a child process\") } // ...","s":"IsChild","u":"/next/api/fiber","h":"#ischild","p":131},{"i":141,"t":"We can use logs to observe program behavior, diagnose problems, or configure corresponding alarms. And defining a well structured log can improve search efficiency and facilitate handling of problems. Fiber provides a default way to print logs in the standard output. It also provides several global functions, such as log.Info, log.Errorf, log.Warnw, etc.","s":"Log","u":"/next/api/log","h":"#log","p":140},{"i":143,"t":"const ( LevelTrace Level = iota LevelDebug LevelInfo LevelWarn LevelError LevelFatal LevelPanic )","s":"Log levels","u":"/next/api/log","h":"#log-levels","p":140},{"i":145,"t":"Fiber provides the AllLogger interface for adapting the various log libraries. type CommonLogger interface { Logger FormatLogger WithLogger } type AllLogger interface { CommonLogger ControlLogger WithLogger }","s":"Custom log","u":"/next/api/log","h":"#custom-log","p":140},{"i":147,"t":"Note: The method of calling the Fatal level will interrupt the program running after printing the log, please use it with caution. Directly print logs of different levels, which will be entered into messageKey, the default is msg. log.Info(\"Hello, World!\") log.Debug(\"Are you OK?\") log.Info(\"42 is the answer to life, the universe, and everything\") log.Warn(\"We are under attack!\") log.Error(\"Houston, we have a problem.\") log.Fatal(\"So Long, and Thanks for All the Fislog.\") log.Panic(\"The system is down.\") Format and print logs of different levels, all methods end with f log.Debugf(\"Hello %s\", \"boy\") log.Infof(\"%d is the answer to life, the universe, and everything\", 233) log.Warnf(\"We are under attack %s!\", \"boss\") log.Errorf(\"%s, we have a problem.\", \"Master Shifu\") log.Fatalf(\"So Long, and Thanks for All the %s.\", \"banana\") Print a message with the key and value, or KEYVALS UNPAIRED if the key and value are not a pair. log.Debugw(\"\", \"Hello\", \"boy\") log.Infow(\"\", \"number\", 233) log.Warnw(\"\", \"job\", \"boss\") log.Errorw(\"\", \"name\", \"Master Shifu\") log.Fatalw(\"\", \"fruit\", \"banana\")","s":"Print log","u":"/next/api/log","h":"#print-log","p":140},{"i":149,"t":"If you are in a project and just want to use a simple log function that can be printed at any time in the global, we provide a global log. import \"github.com/gofiber/fiber/v2/log\" log.Info(\"info\") log.Warn(\"warn\") The above is using the default log.DefaultLogger standard output. You can also find an already implemented adaptation under contrib, or use your own implemented Logger and use log.SetLogger to set the global log logger. import ( \"log\" fiberlog \"github.com/gofiber/fiber/v2/log\" ) var _ log.AllLogger = (*customLogger)(nil) type customLogger struct { stdlog *log.Logger } // ... // inject your custom logger fiberlog.SetLogger(customLogger)","s":"Global log","u":"/next/api/log","h":"#global-log","p":140},{"i":151,"t":"log.SetLevel sets the level of logs below which logs will not be output. The default logger is LevelTrace. Note that this method is not concurrent-safe. import \"github.com/gofiber/fiber/v2/log\" log.SetLevel(log.LevelInfo)","s":"Set Level","u":"/next/api/log","h":"#set-level","p":140},{"i":153,"t":"log.SetOutput sets the output destination of the logger. The default logger types the log in the console. var logger AllLogger = &defaultLogger{ stdlog: log.New(os.Stderr, \"\", log.LstdFlags|log.Lshortfile|log.Lmicroseconds), depth: 4, } Set the output destination to the file. // Output to ./test.log file f, err := os.OpenFile(\"test.log\", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) if err != nil { return } log.SetOutput(f) Set the output destination to the console and file. // Output to ./test.log file file, _ := os.OpenFile(\"test.log\", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) iw := io.MultiWriter(os.Stdout, file) log.SetOutput(iw)","s":"Set output","u":"/next/api/log","h":"#set-output","p":140},{"i":155,"t":"Set the context, using the following method will return a CommonLogger instance bound to the specified context commonLogger := log.WithContext(ctx) commonLogger.Info(\"info\")","s":"Bind context","u":"/next/api/log","h":"#bind-context","p":140},{"i":157,"t":"Converter for net/http handlers to/from Fiber request handlers, special thanks to @arsmn!","s":"Adaptor","u":"/next/api/middleware/adaptor","h":"","p":156},{"i":159,"t":"Name Signature Description HTTPHandler HTTPHandler(h http.Handler) fiber.Handler http.Handler -> fiber.Handler HTTPHandlerFunc HTTPHandlerFunc(h http.HandlerFunc) fiber.Handler http.HandlerFunc -> fiber.Handler HTTPMiddleware HTTPHandlerFunc(mw func(http.Handler) http.Handler) fiber.Handler func(http.Handler) http.Handler -> fiber.Handler FiberHandler FiberHandler(h fiber.Handler) http.Handler fiber.Handler -> http.Handler FiberHandlerFunc FiberHandlerFunc(h fiber.Handler) http.HandlerFunc fiber.Handler -> http.HandlerFunc FiberApp FiberApp(app *fiber.App) http.HandlerFunc Fiber app -> http.HandlerFunc ConvertRequest ConvertRequest(c *fiber.Ctx, forServer bool) (*http.Request, error) fiber.Ctx -> http.Request CopyContextToFiberContext CopyContextToFiberContext(context interface{}, requestContext *fasthttp.RequestCtx) context.Context -> fasthttp.RequestCtx","s":"Signatures","u":"/next/api/middleware/adaptor","h":"#signatures","p":156},{"i":162,"t":"package main import ( \"fmt\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // New fiber app app := fiber.New() // http.Handler -> fiber.Handler app.Get(\"/\", adaptor.HTTPHandler(handler(greet))) // http.HandlerFunc -> fiber.Handler app.Get(\"/func\", adaptor.HTTPHandlerFunc(greet)) // Listen on port 3000 app.Listen(\":3000\") } func handler(f http.HandlerFunc) http.Handler { return http.HandlerFunc(f) } func greet(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, \"Hello World!\") }","s":"net/http to Fiber","u":"/next/api/middleware/adaptor","h":"#nethttp-to-fiber","p":156},{"i":164,"t":"package main import ( \"log\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // New fiber app app := fiber.New() // http middleware -> fiber.Handler app.Use(adaptor.HTTPMiddleware(logMiddleware)) // Listen on port 3000 app.Listen(\":3000\") } func logMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { log.Println(\"log middleware\") next.ServeHTTP(w, r) }) }","s":"net/http middleware to Fiber","u":"/next/api/middleware/adaptor","h":"#nethttp-middleware-to-fiber","p":156},{"i":166,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // fiber.Handler -> http.Handler http.Handle(\"/\", adaptor.FiberHandler(greet)) // fiber.Handler -> http.HandlerFunc http.HandleFunc(\"/func\", adaptor.FiberHandlerFunc(greet)) // Listen on port 3000 http.ListenAndServe(\":3000\", nil) } func greet(c *fiber.Ctx) error { return c.SendString(\"Hello World!\") }","s":"Fiber Handler to net/http","u":"/next/api/middleware/adaptor","h":"#fiber-handler-to-nethttp","p":156},{"i":168,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { app := fiber.New() app.Get(\"/greet\", greet) // Listen on port 3000 http.ListenAndServe(\":3000\", adaptor.FiberApp(app)) } func greet(c *fiber.Ctx) error { return c.SendString(\"Hello World!\") }","s":"Fiber App to net/http","u":"/next/api/middleware/adaptor","h":"#fiber-app-to-nethttp","p":156},{"i":170,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { app := fiber.New() app.Get(\"/greet\", greetWithHTTPReq) // Listen on port 3000 http.ListenAndServe(\":3000\", adaptor.FiberApp(app)) } func greetWithHTTPReq(c *fiber.Ctx) error { httpReq, err := adaptor.ConvertRequest(c, false) if err != nil { return err } return c.SendString(\"Request URL: \" + httpReq.URL.String()) }","s":"Fiber Context to (net/http).Request","u":"/next/api/middleware/adaptor","h":"#fiber-context-to-nethttprequest","p":156},{"i":172,"t":"Basic Authentication middleware for Fiber that provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized or a custom response for missing or invalid credentials.","s":"BasicAuth","u":"/next/api/middleware/basicauth","h":"","p":171},{"i":174,"t":"func New(config Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/basicauth","h":"#signatures","p":171},{"i":176,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/basicauth\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config app.Use(basicauth.New(basicauth.Config{ Users: map[string]string{ \"john\": \"doe\", \"admin\": \"123456\", }, })) // Or extend your config for customization app.Use(basicauth.New(basicauth.Config{ Users: map[string]string{ \"john\": \"doe\", \"admin\": \"123456\", }, Realm: \"Forbidden\", Authorizer: func(user, pass string) bool { if user == \"john\" && pass == \"doe\" { return true } if user == \"admin\" && pass == \"123456\" { return true } return false }, Unauthorized: func(c *fiber.Ctx) error { return c.SendFile(\"./unauthorized.html\") }, ContextUsername: \"_user\", ContextPassword: \"_pass\", }))","s":"Examples","u":"/next/api/middleware/basicauth","h":"#examples","p":171},{"i":178,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Users defines the allowed credentials // // Required. Default: map[string]string{} Users map[string]string // Realm is a string to define realm attribute of BasicAuth. // the realm identifies the system to authenticate against // and can be used by clients to save credentials // // Optional. Default: \"Restricted\". Realm string // Authorizer defines a function you can pass // to check the credentials however you want. // It will be called with a username and password // and is expected to return true or false to indicate // that the credentials were approved or not. // // Optional. Default: nil. Authorizer func(string, string) bool // Unauthorized defines the response body for unauthorized responses. // By default it will return with a 401 Unauthorized and the correct WWW-Auth header // // Optional. Default: nil Unauthorized fiber.Handler // ContextUser is the key to store the username in Locals // // Optional. Default: \"username\" ContextUsername string // ContextPass is the key to store the password in Locals // // Optional. Default: \"password\" ContextPassword string }","s":"Config","u":"/next/api/middleware/basicauth","h":"#config","p":171},{"i":180,"t":"var ConfigDefault = Config{ Next: nil, Users: map[string]string{}, Realm: \"Restricted\", Authorizer: nil, Unauthorized: nil, ContextUsername: \"username\", ContextPassword: \"password\", }","s":"Default Config","u":"/next/api/middleware/basicauth","h":"#default-config","p":171},{"i":182,"t":"Cache middleware for Fiber designed to intercept responses and cache them. This middleware will cache the Body, Content-Type and StatusCode using the c.Path() as unique identifier. Special thanks to @codemicro for creating this middleware for Fiber core! Request Directives Cache-Control: no-cache will return the up-to-date response but still caches it. You will always get a miss cache status. Cache-Control: no-store will refrain from caching. You will always get the up-to-date response.","s":"Cache","u":"/next/api/middleware/cache","h":"","p":181},{"i":184,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/cache","h":"#signatures","p":181},{"i":186,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/cache\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(cache.New()) // Or extend your config for customization app.Use(cache.New(cache.Config{ Next: func(c *fiber.Ctx) bool { return c.Query(\"refresh\") == \"true\" }, Expiration: 30 * time.Minute, CacheControl: true, })) Or you can custom key and expire time like this: app.Use(cache.New(cache.Config{ ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration { newCacheTime, _ := strconv.Atoi(c.GetRespHeader(\"Cache-Time\", \"600\")) return time.Second * time.Duration(newCacheTime) }, KeyGenerator: func(c *fiber.Ctx) string { return utils.CopyString(c.Path()) }, })) app.Get(\"/\", func(c *fiber.Ctx) error { c.Response().Header.Add(\"Cache-Time\", \"6000\") return c.SendString(\"hi\") })","s":"Examples","u":"/next/api/middleware/cache","h":"#examples","p":181},{"i":188,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Expiration is the time that an cached response will live // // Optional. Default: 1 * time.Minute Expiration time.Duration // CacheHeader header on response header, indicate cache status, with the following possible return value // // hit, miss, unreachable // // Optional. Default: X-Cache CacheHeader string // CacheControl enables client side caching if set to true // // Optional. Default: false CacheControl bool // Key allows you to generate custom keys, by default c.Path() is used // // Default: func(c *fiber.Ctx) string { // return utils.CopyString(c.Path()) // } KeyGenerator func(*fiber.Ctx) string // allows you to generate custom Expiration Key By Key, default is Expiration (Optional) // // Default: nil ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration // Store is used to store the state of the middleware // // Default: an in memory store for this process only Storage fiber.Storage // allows you to store additional headers generated by next middlewares & handler // // Default: false StoreResponseHeaders bool // Max number of bytes of response bodies simultaneously stored in cache. When limit is reached, // entries with the nearest expiration are deleted to make room for new. // 0 means no limit // // Default: 0 MaxBytes uint // You can specify HTTP methods to cache. // The middleware just caches the routes of its methods in this slice. // // Default: []string{fiber.MethodGet, fiber.MethodHead} Methods []string }","s":"Config","u":"/next/api/middleware/cache","h":"#config","p":181},{"i":190,"t":"var ConfigDefault = Config{ Next: nil, Expiration: 1 * time.Minute, CacheHeader: \"X-Cache\", CacheControl: false, KeyGenerator: func(c *fiber.Ctx) string { return utils.CopyString(c.Path()) }, ExpirationGenerator: nil, StoreResponseHeaders: false, Storage: nil, MaxBytes: 0, Methods: []string{fiber.MethodGet, fiber.MethodHead}, }","s":"Default Config","u":"/next/api/middleware/cache","h":"#default-config","p":181},{"i":192,"t":"Compression middleware for Fiber that will compress the response using gzip, deflate and brotli compression depending on the Accept-Encoding header.","s":"Compress","u":"/next/api/middleware/compress","h":"","p":191},{"i":194,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/compress","h":"#signatures","p":191},{"i":196,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/compress\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(compress.New()) // Or extend your config for customization app.Use(compress.New(compress.Config{ Level: compress.LevelBestSpeed, // 1 })) // Skip middleware for specific routes app.Use(compress.New(compress.Config{ Next: func(c *fiber.Ctx) bool { return c.Path() == \"/dont_compress\" }, Level: compress.LevelBestSpeed, // 1 }))","s":"Examples","u":"/next/api/middleware/compress","h":"#examples","p":191},{"i":198,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Level determines the compression algoritm // // Optional. Default: LevelDefault // LevelDisabled: -1 // LevelDefault: 0 // LevelBestSpeed: 1 // LevelBestCompression: 2 Level int }","s":"Config","u":"/next/api/middleware/compress","h":"#config","p":191},{"i":200,"t":"var ConfigDefault = Config{ Next: nil, Level: LevelDefault, }","s":"Default Config","u":"/next/api/middleware/compress","h":"#default-config","p":191},{"i":202,"t":"// Compression levels const ( LevelDisabled = -1 LevelDefault = 0 LevelBestSpeed = 1 LevelBestCompression = 2 )","s":"Constants","u":"/next/api/middleware/compress","h":"#constants","p":191},{"i":204,"t":"CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.","s":"CORS","u":"/next/api/middleware/cors","h":"","p":203},{"i":206,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/cors","h":"#signatures","p":203},{"i":208,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/cors\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(cors.New()) // Or extend your config for customization app.Use(cors.New(cors.Config{ AllowOrigins: \"https://gofiber.io, https://gofiber.net\", AllowHeaders: \"Origin, Content-Type, Accept\", })) Using the AllowOriginsFunc function. In this example any origin will be allowed via CORS. For example, if a browser running on http://localhost:3000 sends a request, this will be accepted and the access-control-allow-origin response header will be set to http://localhost:3000. Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via AllowOrigins. app.Use(cors.New()) app.Use(cors.New(cors.Config{ AllowOriginsFunc: func(origin string) bool { return os.Getenv(\"ENVIRONMENT\") == \"development\" }, }))","s":"Examples","u":"/next/api/middleware/cors","h":"#examples","p":203},{"i":210,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // AllowOriginsFunc defines a function that will set the 'access-control-allow-origin' // response header to the 'origin' request header when returned true. // // Note: Using this feature is discouraged in production and it's best practice to explicitly // set CORS origins via 'AllowOrigins' // // Optional. Default: nil AllowOriginsFunc func(origin string) bool // AllowOrigin defines a list of origins that may access the resource. // // Optional. Default value \"*\" AllowOrigins string // AllowMethods defines a list methods allowed when accessing the resource. // This is used in response to a preflight request. // // Optional. Default value \"GET,POST,HEAD,PUT,DELETE,PATCH\" AllowMethods string // AllowHeaders defines a list of request headers that can be used when // making the actual request. This is in response to a preflight request. // // Optional. Default value \"\". AllowHeaders string // AllowCredentials indicates whether or not the response to the request // can be exposed when the credentials flag is true. When used as part of // a response to a preflight request, this indicates whether or not the // actual request can be made using credentials. // // Optional. Default value false. AllowCredentials bool // ExposeHeaders defines a whitelist headers that clients are allowed to // access. // // Optional. Default value \"\". ExposeHeaders string // MaxAge indicates how long (in seconds) the results of a preflight request // can be cached. // // Optional. Default value 0. MaxAge int }","s":"Config","u":"/next/api/middleware/cors","h":"#config","p":203},{"i":212,"t":"var ConfigDefault = Config{ Next: nil, AllowOriginsFunc: nil, AllowOrigins: \"*\", AllowMethods: strings.Join([]string{ fiber.MethodGet, fiber.MethodPost, fiber.MethodHead, fiber.MethodPut, fiber.MethodDelete, fiber.MethodPatch, }, \",\"), AllowHeaders: \"\", AllowCredentials: false, ExposeHeaders: \"\", MaxAge: 0, }","s":"Default Config","u":"/next/api/middleware/cors","h":"#default-config","p":203},{"i":214,"t":"CSRF middleware for Fiber that provides Cross-site request forgery protection by passing a csrf token via cookies. This cookie value will be used to compare against the client csrf token on requests, other than those defined as \"safe\" by RFC7231 (GET, HEAD, OPTIONS, or TRACE). When the csrf token is invalid, this middleware will return the fiber.ErrForbidden error. CSRF Tokens are generated on GET requests. You can retrieve the CSRF token with c.Locals(contextKey), where contextKey is the string you set in the config (see Custom Config below). When no csrf_ cookie is set, or the token has expired, a new token will be generated and csrf_ cookie set. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.","s":"CSRF","u":"/next/api/middleware/csrf","h":"","p":213},{"i":216,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/csrf","h":"#signatures","p":213},{"i":218,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/csrf\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(csrf.New()) // Or extend your config for customization app.Use(csrf.New(csrf.Config{ KeyLookup: \"header:X-Csrf-Token\", CookieName: \"csrf_\", CookieSameSite: \"Lax\", Expiration: 1 * time.Hour, KeyGenerator: utils.UUID, Extractor: func(c *fiber.Ctx) (string, error) { ... }, })) note KeyLookup will be ignored if Extractor is explicitly set.","s":"Examples","u":"/next/api/middleware/csrf","h":"#examples","p":213},{"i":220,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // KeyLookup is a string in the form of \":\" that is used // to create an Extractor that extracts the token from the request. // Possible values: // - \"header:\" // - \"query:\" // - \"param:\" // - \"form:\" // - \"cookie:\" // // Ignored if an Extractor is explicitly set. // // Optional. Default: \"header:X-CSRF-Token\" KeyLookup string // Name of the session cookie. This cookie will store session key. // Optional. Default value \"csrf_\". CookieName string // Domain of the CSRF cookie. // Optional. Default value \"\". CookieDomain string // Path of the CSRF cookie. // Optional. Default value \"\". CookiePath string // Indicates if CSRF cookie is secure. // Optional. Default value false. CookieSecure bool // Indicates if CSRF cookie is HTTP only. // Optional. Default value false. CookieHTTPOnly bool // Indicates if CSRF cookie is requested by SameSite. // Optional. Default value \"Lax\". CookieSameSite string // Decides whether cookie should last for only the browser sesison. // Ignores Expiration if set to true CookieSessionOnly bool // Expiration is the duration before csrf token will expire // // Optional. Default: 1 * time.Hour Expiration time.Duration // Store is used to store the state of the middleware // // Optional. Default: memory.New() Storage fiber.Storage // Context key to store generated CSRF token into context. // If left empty, token will not be stored in context. // // Optional. Default: \"\" ContextKey string // KeyGenerator creates a new CSRF token // // Optional. Default: utils.UUID KeyGenerator func() string // Extractor returns the csrf token // // If set this will be used in place of an Extractor based on KeyLookup. // // Optional. Default will create an Extractor based on KeyLookup. Extractor func(c *fiber.Ctx) (string, error) }","s":"Config","u":"/next/api/middleware/csrf","h":"#config","p":213},{"i":222,"t":"var ConfigDefault = Config{ KeyLookup: \"header:\" + HeaderName, CookieName: \"csrf_\", CookieSameSite: \"Lax\", Expiration: 1 * time.Hour, KeyGenerator: utils.UUID, ErrorHandler: defaultErrorHandler, Extractor: CsrfFromHeader(HeaderName), }","s":"Default Config","u":"/next/api/middleware/csrf","h":"#default-config","p":213},{"i":224,"t":"const ( HeaderName = \"X-Csrf-Token\" )","s":"Constants","u":"/next/api/middleware/csrf","h":"#constants","p":213},{"i":226,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 app.Use(csrf.New(csrf.Config{ Storage: storage, }))","s":"Custom Storage/Database","u":"/next/api/middleware/csrf","h":"#custom-storagedatabase","p":213},{"i":228,"t":"The Early Data middleware for Fiber adds support for TLS 1.3's early data (\"0-RTT\") feature. Citing RFC 8446, when a client and server share a PSK, TLS 1.3 allows clients to send data on the first flight (\"early data\") to speed up the request, effectively reducing the regular 1-RTT request to a 0-RTT request. Make sure to enable fiber's EnableTrustedProxyCheck config option before using this middleware in order to not trust bogus HTTP request headers of the client. Also be aware that enabling support for early data in your reverse proxy (e.g. nginx, as done with a simple ssl_early_data on;) makes requests replayable. Refer to the following documents before continuing: https://datatracker.ietf.org/doc/html/rfc8446#section-8 https://blog.trailofbits.com/2019/03/25/what-application-developers-need-to-know-about-tls-early-data-0rtt/ By default, this middleware allows early data requests on safe HTTP request methods only and rejects the request otherwise, i.e. aborts the request before executing your handler. This behavior can be controlled by the AllowEarlyData config option. Safe HTTP methods β€” GET, HEAD, OPTIONS and TRACE β€” should not modify a state on the server.","s":"EarlyData","u":"/next/api/middleware/earlydata","h":"","p":227},{"i":230,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/earlydata","h":"#signatures","p":227},{"i":232,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/earlydata\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(earlydata.New()) // Or extend your config for customization app.Use(earlydata.New(earlydata.Config{ Error: fiber.ErrTooEarly, // ... }))","s":"Examples","u":"/next/api/middleware/earlydata","h":"#examples","p":227},{"i":234,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // IsEarlyData returns whether the request is an early-data request. // // Optional. Default: a function which checks if the \"Early-Data\" request header equals \"1\". IsEarlyData func(c *fiber.Ctx) bool // AllowEarlyData returns whether the early-data request should be allowed or rejected. // // Optional. Default: a function which rejects the request on unsafe and allows the request on safe HTTP request methods. AllowEarlyData func(c *fiber.Ctx) bool // Error is returned in case an early-data request is rejected. // // Optional. Default: fiber.ErrTooEarly. Error error }","s":"Config","u":"/next/api/middleware/earlydata","h":"#config","p":227},{"i":236,"t":"var ConfigDefault = Config{ IsEarlyData: func(c *fiber.Ctx) bool { return c.Get(DefaultHeaderName) == DefaultHeaderTrueValue }, AllowEarlyData: func(c *fiber.Ctx) bool { return fiber.IsMethodSafe(c.Method()) }, Error: fiber.ErrTooEarly, }","s":"Default Config","u":"/next/api/middleware/earlydata","h":"#default-config","p":227},{"i":238,"t":"const ( DefaultHeaderName = \"Early-Data\" DefaultHeaderTrueValue = \"1\" )","s":"Constants","u":"/next/api/middleware/earlydata","h":"#constants","p":227},{"i":240,"t":"Encrypt middleware for Fiber which encrypts cookie values. Note: this middleware does not encrypt cookie names.","s":"Encrypt Cookie","u":"/next/api/middleware/encryptcookie","h":"","p":239},{"i":242,"t":"// Intitializes the middleware func New(config ...Config) fiber.Handler // Returns a random 32 character long string func GenerateKey() string","s":"Signatures","u":"/next/api/middleware/encryptcookie","h":"#signatures","p":239},{"i":244,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/encryptcookie\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config // `Key` must be a 32 character string. It's used to encrypt the values, so make sure it is random and keep it secret. // You can run `openssl rand -base64 32` or call `encryptcookie.GenerateKey()` to create a random key for you. // Make sure not to set `Key` to `encryptcookie.GenerateKey()` because that will create a new key every run. app.Use(encryptcookie.New(encryptcookie.Config{ Key: \"secret-thirty-2-character-string\", })) // Get / reading out the encrypted cookie app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"value=\" + c.Cookies(\"test\")) }) // Post / create the encrypted cookie app.Post(\"/\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"test\", Value: \"SomeThing\", }) return nil })","s":"Examples","u":"/next/api/middleware/encryptcookie","h":"#examples","p":239},{"i":246,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Array of cookie keys that should not be encrypted. // // Optional. Default: [\"csrf_\"] Except []string // Base64 encoded unique key to encode & decode cookies. // // Required. The key should be 32 bytes of random data in base64-encoded form. // You may run `openssl rand -base64 32` or use `encryptcookie.GenerateKey()` to generate a new key. Key string // Custom function to encrypt cookies. // // Optional. Default: EncryptCookie Encryptor func(decryptedString, key string) (string, error) // Custom function to decrypt cookies. // // Optional. Default: DecryptCookie Decryptor func(encryptedString, key string) (string, error) }","s":"Config","u":"/next/api/middleware/encryptcookie","h":"#config","p":239},{"i":248,"t":"var ConfigDefault = Config{ Next: nil, Except: []string{\"csrf_\"}, Key: \"\", Encryptor: EncryptCookie, Decryptor: DecryptCookie, }","s":"Default Config","u":"/next/api/middleware/encryptcookie","h":"#default-config","p":239},{"i":250,"t":"Normally, encryptcookie middleware skips csrf_ cookies. However, it won't work when you use custom cookie names for CSRF. You should update Except config to avoid this problem. For example: app.Use(encryptcookie.New(encryptcookie.Config{ Key: \"secret-thirty-2-character-string\", Except: []string{\"csrf_1\"}, // exclude CSRF cookie })) app.Use(csrf.New(csrf.Config{ KeyLookup: \"form:test\", CookieName: \"csrf_1\", CookieHTTPOnly: true, }))","s":"Usage of CSRF and Encryptcookie Middlewares with Custom Cookie Names","u":"/next/api/middleware/encryptcookie","h":"#usage-of-csrf-and-encryptcookie-middlewares-with-custom-cookie-names","p":239},{"i":252,"t":"EnvVar middleware for Fiber that can be used to expose environment variables with various options.","s":"EnvVar","u":"/next/api/middleware/envvar","h":"","p":251},{"i":254,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/envvar","h":"#signatures","p":251},{"i":256,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/envvar\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(\"/expose/envvars\", envvar.New()) // Or extend your config for customization app.Use(\"/expose/envvars\", envvar.New( envvar.Config{ ExportVars: map[string]string{\"testKey\": \"\", \"testDefaultKey\": \"testDefaultVal\"}, ExcludeVars: map[string]string{\"excludeKey\": \"\"}, }), ) note You will need to provide a path to use the envvar middleware.","s":"Examples","u":"/next/api/middleware/envvar","h":"#examples","p":251},{"i":258,"t":"Http response contract: { \"vars\": { \"someEnvVariable\": \"someValue\", \"anotherEnvVariable\": \"anotherValue\", } }","s":"Response","u":"/next/api/middleware/envvar","h":"#response","p":251},{"i":260,"t":"// Config defines the config for middleware. type Config struct { // ExportVars specifies the environment variables that should export ExportVars map[string]string // ExcludeVars specifies the environment variables that should not export ExcludeVars map[string]string }","s":"Config","u":"/next/api/middleware/envvar","h":"#config","p":251},{"i":262,"t":"Config{}","s":"Default Config","u":"/next/api/middleware/envvar","h":"#default-config","p":251},{"i":264,"t":"ETag middleware for Fiber that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.","s":"ETag","u":"/next/api/middleware/etag","h":"","p":263},{"i":266,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/etag","h":"#signatures","p":263},{"i":268,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/etag\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(etag.New()) // Get / receives Etag: \"13-1831710635\" in response header app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) // Or extend your config for customization app.Use(etag.New(etag.Config{ Weak: true, })) // Get / receives Etag: \"W/\"13-1831710635\" in response header app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") })","s":"Examples","u":"/next/api/middleware/etag","h":"#examples","p":263},{"i":270,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Weak indicates that a weak validator is used. Weak etags are easy // to generate, but are far less useful for comparisons. Strong // validators are ideal for comparisons but can be very difficult // to generate efficiently. Weak ETag values of two representations // of the same resources might be semantically equivalent, but not // byte-for-byte identical. This means weak etags prevent caching // when byte range requests are used, but strong etags mean range // requests can still be cached. Weak bool }","s":"Config","u":"/next/api/middleware/etag","h":"#config","p":263},{"i":272,"t":"var ConfigDefault = Config{ Next: nil, Weak: false, }","s":"Default Config","u":"/next/api/middleware/etag","h":"#default-config","p":263},{"i":274,"t":"Expvar middleware for Fiber that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is /debug/vars.","s":"ExpVar","u":"/next/api/middleware/expvar","h":"","p":273},{"i":276,"t":"func New() fiber.Handler","s":"Signatures","u":"/next/api/middleware/expvar","h":"#signatures","p":273},{"i":278,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" expvarmw \"github.com/gofiber/fiber/v2/middleware/expvar\" ) After you initiate your Fiber app, you can use the following possibilities: var count = expvar.NewInt(\"count\") app.Use(expvarmw.New()) app.Get(\"/\", func(c *fiber.Ctx) error { count.Add(1) return c.SendString(fmt.Sprintf(\"hello expvar count %d\", count.Value())) }) Visit path /debug/vars to see all vars and use query r=key to filter exposed variables. curl 127.0.0.1:3000 hello expvar count 1 curl 127.0.0.1:3000/debug/vars { \"cmdline\": [\"xxx\"], \"count\": 1, \"expvarHandlerCalls\": 33, \"expvarRegexpErrors\": 0, \"memstats\": {...} } curl 127.0.0.1:3000/debug/vars?r=c { \"cmdline\": [\"xxx\"], \"count\": 1 }","s":"Examples","u":"/next/api/middleware/expvar","h":"#examples","p":273},{"i":280,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool }","s":"Config","u":"/next/api/middleware/expvar","h":"#config","p":273},{"i":282,"t":"var ConfigDefault = Config{ Next: nil, }","s":"Default Config","u":"/next/api/middleware/expvar","h":"#default-config","p":273},{"i":284,"t":"Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware. note This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or custom favicon URL.","s":"Favicon","u":"/next/api/middleware/favicon","h":"","p":283},{"i":286,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/favicon","h":"#signatures","p":283},{"i":288,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/favicon\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(favicon.New()) // Or extend your config for customization app.Use(favicon.New(favicon.Config{ File: \"./favicon.ico\", URL: \"/favicon.ico\", }))","s":"Examples","u":"/next/api/middleware/favicon","h":"#examples","p":283},{"i":290,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // File holds the path to an actual favicon that will be cached // // Optional. Default: \"\" File string // URL for favicon handler // // Optional. Default: \"/favicon.ico\" URL string // FileSystem is an optional alternate filesystem to search for the favicon in. // An example of this could be an embedded or network filesystem // // Optional. Default: nil FileSystem http.FileSystem // CacheControl defines how the Cache-Control header in the response should be set // // Optional. Default: \"public, max-age=31536000\" CacheControl string }","s":"Config","u":"/next/api/middleware/favicon","h":"#config","p":283},{"i":292,"t":"var ConfigDefault = Config{ Next: nil, File: \"\", URL: fPath, CacheControl: \"public, max-age=31536000\", }","s":"Default Config","u":"/next/api/middleware/favicon","h":"#default-config","p":283},{"i":294,"t":"Filesystem middleware for Fiber that enables you to serve files from a directory. caution :params & :optionals? within the prefix path are not supported! To handle paths with spaces (or other url encoded values) make sure to set fiber.Config{ UnescapePath: true }","s":"FileSystem","u":"/next/api/middleware/filesystem","h":"","p":293},{"i":296,"t":"func New(config Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/filesystem","h":"#signatures","p":293},{"i":298,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config app.Use(filesystem.New(filesystem.Config{ Root: http.Dir(\"./assets\"), })) // Or extend your config for customization app.Use(filesystem.New(filesystem.Config{ Root: http.Dir(\"./assets\"), Browse: true, Index: \"index.html\", NotFoundFile: \"404.html\", MaxAge: 3600, })) If your environment (Go 1.16+) supports it, we recommend using Go Embed instead of the other solutions listed as this one is native to Go and the easiest to use.","s":"Examples","u":"/next/api/middleware/filesystem","h":"#examples","p":293},{"i":300,"t":"Embed is the native method to embed files in a Golang excecutable. Introduced in Go 1.16. package main import ( \"embed\" \"io/fs\" \"log\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" ) // Embed a single file //go:embed index.html var f embed.FS // Embed a directory //go:embed static/* var embedDirStatic embed.FS func main() { app := fiber.New() app.Use(\"/\", filesystem.New(filesystem.Config{ Root: http.FS(f), })) // Access file \"image.png\" under `static/` directory via URL: `http:///static/image.png`. // Without `PathPrefix`, you have to access it via URL: // `http:///static/static/image.png`. app.Use(\"/static\", filesystem.New(filesystem.Config{ Root: http.FS(embedDirStatic), PathPrefix: \"static\", Browse: true, })) log.Fatal(app.Listen(\":3000\")) }","s":"embed","u":"/next/api/middleware/filesystem","h":"#embed","p":293},{"i":302,"t":"https://github.com/markbates/pkger package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/markbates/pkger\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: pkger.Dir(\"/assets\"), })) log.Fatal(app.Listen(\":3000\")) }","s":"pkger","u":"/next/api/middleware/filesystem","h":"#pkger","p":293},{"i":304,"t":"https://github.com/gobuffalo/packr package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/gobuffalo/packr/v2\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: packr.New(\"Assets Box\", \"/assets\"), })) log.Fatal(app.Listen(\":3000\")) }","s":"packr","u":"/next/api/middleware/filesystem","h":"#packr","p":293},{"i":306,"t":"https://github.com/GeertJohan/go.rice package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/GeertJohan/go.rice\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: rice.MustFindBox(\"assets\").HTTPBox(), })) log.Fatal(app.Listen(\":3000\")) }","s":"go.rice","u":"/next/api/middleware/filesystem","h":"#gorice","p":293},{"i":308,"t":"https://github.com/UnnoTed/fileb0x package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"/myEmbeddedFiles\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: myEmbeddedFiles.HTTP, })) log.Fatal(app.Listen(\":3000\")) }","s":"fileb0x","u":"/next/api/middleware/filesystem","h":"#fileb0x","p":293},{"i":310,"t":"https://github.com/rakyll/statik package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" // Use blank to invoke init function and register data to statik _ \"/statik\" \"github.com/rakyll/statik/fs\" ) func main() { statikFS, err := fs.New() if err != nil { panic(err) } app := fiber.New() app.Use(\"/\", filesystem.New(filesystem.Config{ Root: statikFS, })) log.Fatal(app.Listen(\":3000\")) }","s":"statik","u":"/next/api/middleware/filesystem","h":"#statik","p":293},{"i":312,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Root is a FileSystem that provides access // to a collection of files and directories. // // Required. Default: nil Root http.FileSystem `json:\"-\"` // PathPrefix defines a prefix to be added to a filepath when // reading a file from the FileSystem. // // Use when using Go 1.16 embed.FS // // Optional. Default \"\" PathPrefix string `json:\"path_prefix\"` // Enable directory browsing. // // Optional. Default: false Browse bool `json:\"browse\"` // Index file for serving a directory. // // Optional. Default: \"index.html\" Index string `json:\"index\"` // The value for the Cache-Control HTTP-header // that is set on the file response. MaxAge is defined in seconds. // // Optional. Default value 0. MaxAge int `json:\"max_age\"` // File to return if path is not found. Useful for SPA's. // // Optional. Default: \"\" NotFoundFile string `json:\"not_found_file\"` // The value for the Content-Type HTTP-header // that is set on the file response // // Optional. Default: \"\" ContentTypeCharset string `json:\"content_type_charset\"` }","s":"Config","u":"/next/api/middleware/filesystem","h":"#config","p":293},{"i":314,"t":"var ConfigDefault = Config{ Next: nil, Root: nil, PathPrefix: \"\", Browse: false, Index: \"/index.html\", MaxAge: 0, ContentTypeCharset: \"\", }","s":"Default Config","u":"/next/api/middleware/filesystem","h":"#default-config","p":293},{"i":316,"t":"Helmet middleware helps secure your apps by setting various HTTP headers.","s":"Helmet","u":"/next/api/middleware/helmet","h":"","p":315},{"i":318,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/helmet","h":"#signatures","p":315},{"i":320,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/helmet\" ) func main() { app := fiber.New() app.Use(helmet.New()) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome!\") }) app.Listen(\":3000\") } Test: curl -I http://localhost:3000","s":"Examples","u":"/next/api/middleware/helmet","h":"#examples","p":315},{"i":322,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // XSSProtection // Optional. Default value \"0\". XSSProtection string // ContentTypeNosniff // Optional. Default value \"nosniff\". ContentTypeNosniff string // XFrameOptions // Optional. Default value \"SAMEORIGIN\". // Possible values: \"SAMEORIGIN\", \"DENY\", \"ALLOW-FROM uri\" XFrameOptions string // HSTSMaxAge // Optional. Default value 0. HSTSMaxAge int // HSTSExcludeSubdomains // Optional. Default value false. HSTSExcludeSubdomains bool // ContentSecurityPolicy // Optional. Default value \"\". ContentSecurityPolicy string // CSPReportOnly // Optional. Default value false. CSPReportOnly bool // HSTSPreloadEnabled // Optional. Default value false. HSTSPreloadEnabled bool // ReferrerPolicy // Optional. Default value \"ReferrerPolicy\". ReferrerPolicy string // Permissions-Policy // Optional. Default value \"\". PermissionPolicy string // Cross-Origin-Embedder-Policy // Optional. Default value \"require-corp\". CrossOriginEmbedderPolicy string // Cross-Origin-Opener-Policy // Optional. Default value \"same-origin\". CrossOriginOpenerPolicy string // Cross-Origin-Resource-Policy // Optional. Default value \"same-origin\". CrossOriginResourcePolicy string // Origin-Agent-Cluster // Optional. Default value \"?1\". OriginAgentCluster string // X-DNS-Prefetch-Control // Optional. Default value \"off\". XDNSPrefetchControl string // X-Download-Options // Optional. Default value \"noopen\". XDownloadOptions string // X-Permitted-Cross-Domain-Policies // Optional. Default value \"none\". XPermittedCrossDomain string }","s":"Config","u":"/next/api/middleware/helmet","h":"#config","p":315},{"i":324,"t":"var ConfigDefault = Config{ XSSProtection: \"0\", ContentTypeNosniff: \"nosniff\", XFrameOptions: \"SAMEORIGIN\", ReferrerPolicy: \"no-referrer\", CrossOriginEmbedderPolicy: \"require-corp\", CrossOriginOpenerPolicy: \"same-origin\", CrossOriginResourcePolicy: \"same-origin\", OriginAgentCluster: \"?1\", XDNSPrefetchControl: \"off\", XDownloadOptions: \"noopen\", XPermittedCrossDomain: \"none\", }","s":"Default Config","u":"/next/api/middleware/helmet","h":"#default-config","p":315},{"i":326,"t":"Idempotency middleware for Fiber allows for fault-tolerant APIs where duplicate requests β€” for example due to networking issues on the client-side β€” do not erroneously cause the same action performed multiple times on the server-side. Refer to https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02 for a better understanding.","s":"Idempotency","u":"/next/api/middleware/idempotency","h":"","p":325},{"i":328,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/idempotency","h":"#signatures","p":325},{"i":330,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/idempotency\" ) After you initiate your Fiber app, you can use the following possibilities:","s":"Examples","u":"/next/api/middleware/idempotency","h":"#examples","p":325},{"i":332,"t":"app.Use(idempotency.New())","s":"Default Config","u":"/next/api/middleware/idempotency","h":"#default-config","p":325},{"i":334,"t":"app.Use(idempotency.New(idempotency.Config{ Lifetime: 42 * time.Minute, // ... }))","s":"Custom Config","u":"/next/api/middleware/idempotency","h":"#custom-config","p":325},{"i":336,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: a function which skips the middleware on safe HTTP request method. Next func(c *fiber.Ctx) bool // Lifetime is the maximum lifetime of an idempotency key. // // Optional. Default: 30 * time.Minute Lifetime time.Duration // KeyHeader is the name of the header that contains the idempotency key. // // Optional. Default: X-Idempotency-Key KeyHeader string // KeyHeaderValidate defines a function to validate the syntax of the idempotency header. // // Optional. Default: a function which ensures the header is 36 characters long (the size of an UUID). KeyHeaderValidate func(string) error // KeepResponseHeaders is a list of headers that should be kept from the original response. // // Optional. Default: nil (to keep all headers) KeepResponseHeaders []string // Lock locks an idempotency key. // // Optional. Default: an in-memory locker for this process only. Lock Locker // Storage stores response data by idempotency key. // // Optional. Default: an in-memory storage for this process only. Storage fiber.Storage }","s":"Config","u":"/next/api/middleware/idempotency","h":"#config","p":325},{"i":338,"t":"var ConfigDefault = Config{ Next: func(c *fiber.Ctx) bool { // Skip middleware if the request was done using a safe HTTP method return fiber.IsMethodSafe(c.Method()) }, Lifetime: 30 * time.Minute, KeyHeader: \"X-Idempotency-Key\", KeyHeaderValidate: func(k string) error { if l, wl := len(k), 36; l != wl { // UUID length is 36 chars return fmt.Errorf(\"%w: invalid length: %d != %d\", ErrInvalidIdempotencyKey, l, wl) } return nil }, KeepResponseHeaders: nil, Lock: nil, // Set in configDefault so we don't allocate data here. Storage: nil, // Set in configDefault so we don't allocate data here. }","s":"Default Config","u":"/next/api/middleware/idempotency","h":"#default-config-1","p":325},{"i":340,"t":"Key auth middleware provides a key based authentication.","s":"Keyauth","u":"/next/api/middleware/keyauth","h":"","p":339},{"i":342,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/keyauth","h":"#signatures","p":339},{"i":344,"t":"package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" ) var ( apiKey = \"correct horse battery staple\" ) func validateAPIKey(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey } func main() { app := fiber.New() // note that the keyauth middleware needs to be defined before the routes are defined! app.Use(keyauth.New(keyauth.Config{ KeyLookup: \"cookie:access_token\", Validator: validateAPIKey, })) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Listen(\":3000\") } Test: # No api-key specified -> 400 missing curl http://localhost:3000 #> missing or malformed API Key curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000 #> Successfully authenticated! curl --cookie \"access_token=Clearly A Wrong Key\" http://localhost:3000 #> missing or malformed API Key For a more detailed example, see also the github.com/gofiber/recipes repository and specifically the fiber-envoy-extauthz repository and the keyauth example code.","s":"Examples","u":"/next/api/middleware/keyauth","h":"#examples","p":339},{"i":346,"t":"If you want to authenticate only certain endpoints, you can use the Config of keyauth and apply a filter function (eg. authFilter) like so package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" \"regexp\" \"strings\" ) var ( apiKey = \"correct horse battery staple\" protectedURLs = []*regexp.Regexp{ regexp.MustCompile(\"^/authenticated$\"), regexp.MustCompile(\"^/auth2$\"), } ) func validateAPIKey(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey } func authFilter(c *fiber.Ctx) bool { originalURL := strings.ToLower(c.OriginalURL()) for _, pattern := range protectedURLs { if pattern.MatchString(originalURL) { return false } } return true } func main() { app := fiber.New() app.Use(keyauth.New(keyauth.Config{ Next: authFilter, KeyLookup: \"cookie:access_token\", Validator: validateAPIKey, })) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome\") }) app.Get(\"/authenticated\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Get(\"/auth2\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated 2!\") }) app.Listen(\":3000\") } Which results in this # / does not need to be authenticated curl http://localhost:3000 #> Welcome # /authenticated needs to be authenticated curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000/authenticated #> Successfully authenticated! # /auth2 needs to be authenticated too curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000/auth2 #> Successfully authenticated 2!","s":"Authenticate only certain endpoints","u":"/next/api/middleware/keyauth","h":"#authenticate-only-certain-endpoints","p":339},{"i":348,"t":"package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" ) const ( apiKey = \"my-super-secret-key\" ) func main() { app := fiber.New() authMiddleware := keyauth.New(keyauth.Config{ Validator: func(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey }, }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome\") }) app.Get(\"/allowed\", authMiddleware, func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Listen(\":3000\") } Which results in this # / does not need to be authenticated curl http://localhost:3000 #> Welcome # /allowed needs to be authenticated too curl --header \"Authorization: Bearer my-super-secret-key\" http://localhost:3000/allowed #> Successfully authenticated!","s":"Specifying middleware in the handler","u":"/next/api/middleware/keyauth","h":"#specifying-middleware-in-the-handler","p":339},{"i":350,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // SuccessHandler defines a function which is executed for a valid key. // Optional. Default: nil SuccessHandler fiber.Handler // ErrorHandler defines a function which is executed for an invalid key. // It may be used to define a custom error. // Optional. Default: 401 Invalid or expired key ErrorHandler fiber.ErrorHandler // KeyLookup is a string in the form of \":\" that is used // to extract key from the request. // Optional. Default value \"header:Authorization\". // Possible values: // - \"header:\" // - \"query:\" // - \"form:\" // - \"param:\" // - \"cookie:\" KeyLookup string // AuthScheme to be used in the Authorization header. // Optional. Default value \"Bearer\". AuthScheme string // Validator is a function to validate key. Validator func(*fiber.Ctx, string) (bool, error) // Context key to store the bearertoken from the token into context. // Optional. Default: \"token\". ContextKey string }","s":"Config","u":"/next/api/middleware/keyauth","h":"#config","p":339},{"i":352,"t":"var ConfigDefault = Config{ SuccessHandler: func(c *fiber.Ctx) error { return c.Next() }, ErrorHandler: func(c *fiber.Ctx, err error) error { if err == ErrMissingOrMalformedAPIKey { return c.Status(fiber.StatusUnauthorized).SendString(err.Error()) } return c.Status(fiber.StatusUnauthorized).SendString(\"Invalid or expired API Key\") }, KeyLookup: \"header:\" + fiber.HeaderAuthorization, AuthScheme: \"Bearer\", ContextKey: \"token\", }","s":"Default Config","u":"/next/api/middleware/keyauth","h":"#default-config","p":339},{"i":354,"t":"Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases. note This module does not share state with other processes/servers by default.","s":"Limiter","u":"/next/api/middleware/limiter","h":"","p":353},{"i":356,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/limiter","h":"#signatures","p":353},{"i":358,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/limiter\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(limiter.New()) // Or extend your config for customization app.Use(limiter.New(limiter.Config{ Next: func(c *fiber.Ctx) bool { return c.IP() == \"127.0.0.1\" }, Max: 20, Expiration: 30 * time.Second, KeyGenerator: func(c *fiber.Ctx) string { return c.Get(\"x-forwarded-for\") }, LimitReached: func(c *fiber.Ctx) error { return c.SendFile(\"./toofast.html\") }, Storage: myCustomStorage{}, }))","s":"Examples","u":"/next/api/middleware/limiter","h":"#examples","p":353},{"i":360,"t":"Instead of using the standard fixed window algorithm, you can enable the sliding window algorithm. A example of such configuration is: app.Use(limiter.New(limiter.Config{ Max: 20, Expiration: 30 * time.Second, LimiterMiddleware: limiter.SlidingWindow{}, })) This means that every window will take into account the previous window(if there was any). The given formula for the rate is: weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration) rate = weightOfPreviousWindpw + current window's amount request.","s":"Sliding window","u":"/next/api/middleware/limiter","h":"#sliding-window","p":353},{"i":362,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Max number of recent connections during `Duration` seconds before sending a 429 response // // Default: 5 Max int // KeyGenerator allows you to generate custom keys, by default c.IP() is used // // Default: func(c *fiber.Ctx) string { // return c.IP() // } KeyGenerator func(*fiber.Ctx) string // Expiration is the time on how long to keep records of requests in memory // // Default: 1 * time.Minute Expiration time.Duration // LimitReached is called when a request hits the limit // // Default: func(c *fiber.Ctx) error { // return c.SendStatus(fiber.StatusTooManyRequests) // } LimitReached fiber.Handler // When set to true, requests with StatusCode >= 400 won't be counted. // // Default: false SkipFailedRequests bool // When set to true, requests with StatusCode < 400 won't be counted. // // Default: false SkipSuccessfulRequests bool // Store is used to store the state of the middleware // // Default: an in memory store for this process only Storage fiber.Storage // LimiterMiddleware is the struct that implements limiter middleware. // // Default: a new Fixed Window Rate Limiter LimiterMiddleware LimiterHandler } note A custom store can be used if it implements the Storage interface - more details and an example can be found in store.go.","s":"Config","u":"/next/api/middleware/limiter","h":"#config","p":353},{"i":364,"t":"var ConfigDefault = Config{ Max: 5, Expiration: 1 * time.Minute, KeyGenerator: func(c *fiber.Ctx) string { return c.IP() }, LimitReached: func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusTooManyRequests) }, SkipFailedRequests: false, SkipSuccessfulRequests: false, LimiterMiddleware: FixedWindow{}, }","s":"Default Config","u":"/next/api/middleware/limiter","h":"#default-config","p":353},{"i":366,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 app.Use(limiter.New(limiter.Config{ Storage: storage, }))","s":"Custom Storage/Database","u":"/next/api/middleware/limiter","h":"#custom-storagedatabase","p":353},{"i":368,"t":"Logger middleware for Fiber that logs HTTP request/response details.","s":"Logger","u":"/next/api/middleware/logger","h":"","p":367},{"i":370,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/logger","h":"#signatures","p":367},{"i":372,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/logger\" ) tip The order of registration plays a role. Only all routes that are registered after this one will be logged. The middleware should therefore be one of the first to be registered. After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(logger.New()) // Or extend your config for customization // Logging remote IP and Port app.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) // Logging Request ID app.Use(requestid.New()) app.Use(logger.New(logger.Config{ // For more options, see the Config section Format: \"${pid} ${locals:requestid} ${status} - ${method} ${path}​\\n\", })) // Changing TimeZone & TimeFormat app.Use(logger.New(logger.Config{ Format: \"${pid} ${status} - ${method} ${path}\\n\", TimeFormat: \"02-Jan-2006\", TimeZone: \"America/New_York\", })) // Custom File Writer file, err := os.OpenFile(\"./123.log\", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) if err != nil { log.Fatalf(\"error opening file: %v\", err) } defer file.Close() app.Use(logger.New(logger.Config{ Output: file, })) // Add Custom Tags app.Use(logger.New(logger.Config{ CustomTags: map[string]logger.LogFunc{ \"custom_tag\": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) { return output.WriteString(\"it is a custom tag\") }, }, })) // Callback after log is written app.Use(logger.New(logger.Config{ TimeFormat: time.RFC3339Nano, TimeZone: \"Asia/Shanghai\", Done: func(c *fiber.Ctx, logString []byte) { if c.Response().StatusCode() != fiber.StatusOK { reporter.SendToSlack(logString) } }, })) // Disable colors when outputting to default format app.Use(logger.New(logger.Config{ DisableColors: true, }))","s":"Examples","u":"/next/api/middleware/logger","h":"#examples","p":367},{"i":374,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Done is a function that is called after the log string for a request is written to Output, // and pass the log string as parameter. // // Optional. Default: nil Done func(c *fiber.Ctx, logString []byte) // tagFunctions defines the custom tag action // // Optional. Default: map[string]LogFunc CustomTags map[string]LogFunc // Format defines the logging tags // // Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\\n Format string // TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html // // Optional. Default: 15:04:05 TimeFormat string // TimeZone can be specified, such as \"UTC\" and \"America/New_York\" and \"Asia/Chongqing\", etc // // Optional. Default: \"Local\" TimeZone string // TimeInterval is the delay before the timestamp is updated // // Optional. Default: 500 * time.Millisecond TimeInterval time.Duration // Output is a writer where logs are written // // Default: os.Stdout Output io.Writer // DisableColors defines if the logs output should be colorized // // Default: false DisableColors bool enableColors bool enableLatency bool timeZoneLocation *time.Location } type LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)","s":"Config","u":"/next/api/middleware/logger","h":"#config","p":367},{"i":376,"t":"var ConfigDefault = Config{ Next: nil, Done: nil, Format: \"[${time}] ${status} - ${latency} ${method} ${path}\\n\", TimeFormat: \"15:04:05\", TimeZone: \"Local\", TimeInterval: 500 * time.Millisecond, Output: os.Stdout, DisableColors: false, }","s":"Default Config","u":"/next/api/middleware/logger","h":"#default-config","p":367},{"i":378,"t":"// Logger variables const ( TagPid = \"pid\" TagTime = \"time\" TagReferer = \"referer\" TagProtocol = \"protocol\" TagPort = \"port\" TagIP = \"ip\" TagIPs = \"ips\" TagHost = \"host\" TagMethod = \"method\" TagPath = \"path\" TagURL = \"url\" TagUA = \"ua\" TagLatency = \"latency\" TagStatus = \"status\" // response status TagResBody = \"resBody\" // response body TagReqHeaders = \"reqHeaders\" TagQueryStringParams = \"queryParams\" // request query parameters TagBody = \"body\" // request body TagBytesSent = \"bytesSent\" TagBytesReceived = \"bytesReceived\" TagRoute = \"route\" TagError = \"error\" // DEPRECATED: Use TagReqHeader instead TagHeader = \"header:\" // request header TagReqHeader = \"reqHeader:\" // request header TagRespHeader = \"respHeader:\" // response header TagQuery = \"query:\" // request query TagForm = \"form:\" // request form TagCookie = \"cookie:\" // request cookie TagLocals = \"locals:\" // colors TagBlack = \"black\" TagRed = \"red\" TagGreen = \"green\" TagYellow = \"yellow\" TagBlue = \"blue\" TagMagenta = \"magenta\" TagCyan = \"cyan\" TagWhite = \"white\" TagReset = \"reset\" )","s":"Constants","u":"/next/api/middleware/logger","h":"#constants","p":367},{"i":380,"t":"Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor caution Monitor is still in beta, API might change in the future!","s":"Monitor","u":"/next/api/middleware/monitor","h":"","p":379},{"i":382,"t":"func New() fiber.Handler","s":"Signatures","u":"/next/api/middleware/monitor","h":"#signatures","p":379},{"i":384,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/monitor\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config (Assign the middleware to /metrics) app.Get(\"/metrics\", monitor.New()) // Or extend your config for customization // Assign the middleware to /metrics // and change the Title to `MyService Metrics Page` app.Get(\"/metrics\", monitor.New(monitor.Config{Title: \"MyService Metrics Page\"})) You can also access the API endpoint with curl -X GET -H \"Accept: application/json\" http://localhost:3000/metrics which returns: {\"pid\":{ \"cpu\":0.4568381746582226, \"ram\":20516864, \"conns\":3 }, \"os\": { \"cpu\":8.759124087593099, \"ram\":3997155328, \"conns\":44, \"total_ram\":8245489664, \"load_avg\":0.51 }}","s":"Examples","u":"/next/api/middleware/monitor","h":"#examples","p":379},{"i":386,"t":"// Config defines the config for middleware. type Config struct { // Metrics page title // // Optional. Default: \"Fiber Monitor\" Title string // Refresh period // // Optional. Default: 3 seconds Refresh time.Duration // Whether the service should expose only the monitoring API. // // Optional. Default: false APIOnly bool // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Custom HTML Code to Head Section(Before End) // // Optional. Default: empty CustomHead string // FontURL for specify font resource path or URL . also you can use relative path // // Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap FontURL string // ChartJsURL for specify ChartJS library path or URL . also you can use relative path // // Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js ChartJsURL string index string }","s":"Config","u":"/next/api/middleware/monitor","h":"#config","p":379},{"i":388,"t":"var ConfigDefault = Config{ Title: defaultTitle, Refresh: defaultRefresh, FontURL: defaultFontURL, ChartJsURL: defaultChartJSURL, CustomHead: defaultCustomHead, APIOnly: false, Next: nil, index: newIndex(viewBag{ defaultTitle, defaultRefresh, defaultFontURL, defaultChartJSURL, defaultCustomHead, }), }","s":"Default Config","u":"/next/api/middleware/monitor","h":"#default-config","p":379},{"i":390,"t":"Pprof middleware for Fiber that serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/.","s":"Pprof","u":"/next/api/middleware/pprof","h":"","p":389},{"i":392,"t":"func New() fiber.Handler","s":"Signatures","u":"/next/api/middleware/pprof","h":"#signatures","p":389},{"i":394,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/pprof\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(pprof.New()) // Or extend your config for customization // For example, in systems where you have multiple ingress endpoints, it is common to add a URL prefix, like so: app.Use(pprof.New(pprof.Config{Prefix: \"/endpoint-prefix\"})) // This prefix will be added to the default path of \"/debug/pprof/\", for a resulting URL of: \"/endpoint-prefix/debug/pprof/\".","s":"Examples","u":"/next/api/middleware/pprof","h":"#examples","p":389},{"i":396,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Prefix defines a URL prefix added before \"/debug/pprof\". // Note that it should start with (but not end with) a slash. // Example: \"/federated-fiber\" // // Optional. Default: \"\" Prefix string }","s":"Config","u":"/next/api/middleware/pprof","h":"#config","p":389},{"i":398,"t":"var ConfigDefault = Config{ Next: nil, }","s":"Default Config","u":"/next/api/middleware/pprof","h":"#default-config","p":389},{"i":400,"t":"Proxy middleware for Fiber that allows you to proxy requests to multiple servers.","s":"Proxy","u":"/next/api/middleware/proxy","h":"","p":399},{"i":402,"t":"// Balancer create a load balancer among multiple upstrem servers. func Balancer(config Config) fiber.Handler // Forward performs the given http request and fills the given http response. func Forward(addr string, clients ...*fasthttp.Client) fiber.Handler // Do performs the given http request and fills the given http response. func Do(c *fiber.Ctx, addr string, clients ...*fasthttp.Client) error // DoRedirects performs the given http request and fills the given http response while following up to maxRedirectsCount redirects. func DoRedirects(c *fiber.Ctx, addr string, maxRedirectsCount int, clients ...*fasthttp.Client) error // DoDeadline performs the given request and waits for response until the given deadline. func DoDeadline(c *fiber.Ctx, addr string, deadline time.Time, clients ...*fasthttp.Client) error // DoTimeout performs the given request and waits for response during the given timeout duration. func DoTimeout(c *fiber.Ctx, addr string, timeout time.Duration, clients ...*fasthttp.Client) error // DomainForward the given http request based on the given domain and fills the given http response func DomainForward(hostname string, addr string, clients ...*fasthttp.Client) fiber.Handler // BalancerForward performs the given http request based round robin balancer and fills the given http response func BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler","s":"Signatures","u":"/next/api/middleware/proxy","h":"#signatures","p":399},{"i":404,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/proxy\" ) After you initiate your Fiber app, you can use the following possibilities: // if target https site uses a self-signed certificate, you should // call WithTlsConfig before Do and Forward proxy.WithTlsConfig(&tls.Config{ InsecureSkipVerify: true, }) // if you need to use global self-custom client, you should use proxy.WithClient. proxy.WithClient(&fasthttp.Client{ NoDefaultUserAgentHeader: true, DisablePathNormalizing: true, }) // Forward to url app.Get(\"/gif\", proxy.Forward(\"https://i.imgur.com/IWaBepg.gif\")) // If you want to forward with a specific domain. You have to use proxy.DomainForward. app.Get(\"/payments\", proxy.DomainForward(\"docs.gofiber.io\", \"http://localhost:8000\")) // Forward to url with local custom client app.Get(\"/gif\", proxy.Forward(\"https://i.imgur.com/IWaBepg.gif\", &fasthttp.Client{ NoDefaultUserAgentHeader: true, DisablePathNormalizing: true, })) // Make request within handler app.Get(\"/:id\", func(c *fiber.Ctx) error { url := \"https://i.imgur.com/\"+c.Params(\"id\")+\".gif\" if err := proxy.Do(c, url); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests while following redirects app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoRedirects(c, \"http://google.com\", 3); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests and wait up to 5 seconds before timing out app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoTimeout(c, \"http://localhost:3000\", time.Second * 5); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests, timeout a minute from now app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoDeadline(c, \"http://localhost\", time.Now().Add(time.Minute)); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Minimal round robin balancer app.Use(proxy.Balancer(proxy.Config{ Servers: []string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }, })) // Or extend your balancer for customization app.Use(proxy.Balancer(proxy.Config{ Servers: []string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }, ModifyRequest: func(c *fiber.Ctx) error { c.Request().Header.Add(\"X-Real-IP\", c.IP()) return nil }, ModifyResponse: func(c *fiber.Ctx) error { c.Response().Header.Del(fiber.HeaderServer) return nil }, })) // Or this way if the balancer is using https and the destination server is only using http. app.Use(proxy.BalancerForward([]string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }))","s":"Examples","u":"/next/api/middleware/proxy","h":"#examples","p":399},{"i":406,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Servers defines a list of :// HTTP servers, // // which are used in a round-robin manner. // i.e.: \"https://foobar.com, http://www.foobar.com\" // // Required Servers []string // ModifyRequest allows you to alter the request // // Optional. Default: nil ModifyRequest fiber.Handler // ModifyResponse allows you to alter the response // // Optional. Default: nil ModifyResponse fiber.Handler // Timeout is the request timeout used when calling the proxy client // // Optional. Default: 1 second Timeout time.Duration // Per-connection buffer size for requests' reading. // This also limits the maximum header size. // Increase this buffer if your clients send multi-KB RequestURIs // and/or multi-KB headers (for example, BIG cookies). ReadBufferSize int // Per-connection buffer size for responses' writing. WriteBufferSize int // tls config for the http client. TlsConfig *tls.Config // Client is custom client when client config is complex. // Note that Servers, Timeout, WriteBufferSize, ReadBufferSize and TlsConfig // will not be used if the client are set. Client *fasthttp.LBClient }","s":"Config","u":"/next/api/middleware/proxy","h":"#config","p":399},{"i":408,"t":"var ConfigDefault = Config{ Next: nil, ModifyRequest: nil, ModifyResponse: nil, Timeout: fasthttp.DefaultLBClientTimeout, }","s":"Default Config","u":"/next/api/middleware/proxy","h":"#default-config","p":399},{"i":410,"t":"Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.","s":"Recover","u":"/next/api/middleware/recover","h":"","p":409},{"i":412,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/recover","h":"#signatures","p":409},{"i":414,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/recover\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(recover.New()) // This panic will be caught by the middleware app.Get(\"/\", func(c *fiber.Ctx) error { panic(\"I'm an error\") })","s":"Examples","u":"/next/api/middleware/recover","h":"#examples","p":409},{"i":416,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // EnableStackTrace enables handling stack trace // // Optional. Default: false EnableStackTrace bool // StackTraceHandler defines a function to handle stack trace // // Optional. Default: defaultStackTraceHandler StackTraceHandler func(c *fiber.Ctx, e interface{}) }","s":"Config","u":"/next/api/middleware/recover","h":"#config","p":409},{"i":418,"t":"var ConfigDefault = Config{ Next: nil, EnableStackTrace: false, StackTraceHandler: defaultStackTraceHandler, }","s":"Default Config","u":"/next/api/middleware/recover","h":"#default-config","p":409},{"i":420,"t":"Redirection middleware for Fiber.","s":"Redirect","u":"/next/api/middleware/redirect","h":"","p":419},{"i":422,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/redirect","h":"#signatures","p":419},{"i":424,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/redirect\" ) func main() { app := fiber.New() app.Use(redirect.New(redirect.Config{ Rules: map[string]string{ \"/old\": \"/new\", \"/old/*\": \"/new/$1\", }, StatusCode: 301, })) app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) app.Get(\"/new/*\", func(c *fiber.Ctx) error { return c.SendString(\"Wildcard: \" + c.Params(\"*\")) }) app.Listen(\":3000\") } Test: curl http://localhost:3000/old curl http://localhost:3000/old/hello","s":"Examples","u":"/next/api/middleware/redirect","h":"#examples","p":419},{"i":426,"t":"// Config defines the config for middleware. type Config struct { // Filter defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // Rules defines the URL path rewrite rules. The values captured in asterisk can be // retrieved by index e.g. $1, $2 and so on. // Required. Example: // \"/old\": \"/new\", // \"/api/*\": \"/$1\", // \"/js/*\": \"/public/javascripts/$1\", // \"/users/*/orders/*\": \"/user/$1/order/$2\", Rules map[string]string // The status code when redirecting // This is ignored if Redirect is disabled // Optional. Default: 302 (fiber.StatusFound) StatusCode int rulesRegex map[*regexp.Regexp]string }","s":"Config","u":"/next/api/middleware/redirect","h":"#config","p":419},{"i":428,"t":"var ConfigDefault = Config{ StatusCode: fiber.StatusFound, }","s":"Default Config","u":"/next/api/middleware/redirect","h":"#default-config","p":419},{"i":430,"t":"RequestID middleware for Fiber that adds an indentifier to the response.","s":"RequestID","u":"/next/api/middleware/requestid","h":"","p":429},{"i":432,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/requestid","h":"#signatures","p":429},{"i":434,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/requestid\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(requestid.New()) // Or extend your config for customization app.Use(requestid.New(requestid.Config{ Header: \"X-Custom-Header\", Generator: func() string { return \"static-id\" }, }))","s":"Examples","u":"/next/api/middleware/requestid","h":"#examples","p":429},{"i":436,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Header is the header key where to get/set the unique request ID // // Optional. Default: \"X-Request-ID\" Header string // Generator defines a function to generate the unique identifier. // // Optional. Default: utils.UUID Generator func() string // ContextKey defines the key used when storing the request ID in // the locals for a specific request. // // Optional. Default: requestid ContextKey interface{} }","s":"Config","u":"/next/api/middleware/requestid","h":"#config","p":429},{"i":438,"t":"The default config uses a fast UUID generator which will expose the number of requests made to the server. To conceal this value for better privacy, use the utils.UUIDv4 generator. var ConfigDefault = Config{ Next: nil, Header: fiber.HeaderXRequestID, Generator: utils.UUID, ContextKey: \"requestid\", }","s":"Default Config","u":"/next/api/middleware/requestid","h":"#default-config","p":429},{"i":440,"t":"Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links.","s":"Rewrite","u":"/next/api/middleware/rewrite","h":"","p":439},{"i":442,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/next/api/middleware/rewrite","h":"#signatures","p":439},{"i":444,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/rewrite\" ) func main() { app := fiber.New() app.Use(rewrite.New(rewrite.Config{ Rules: map[string]string{ \"/old\": \"/new\", \"/old/*\": \"/new/$1\", }, })) app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) app.Get(\"/new/*\", func(c *fiber.Ctx) error { return c.SendString(\"Wildcard: \" + c.Params(\"*\")) }) app.Listen(\":3000\") } Test: curl http://localhost:3000/old curl http://localhost:3000/old/hello","s":"Examples","u":"/next/api/middleware/rewrite","h":"#examples","p":439},{"i":446,"t":"Session middleware for Fiber. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.","s":"Session","u":"/next/api/middleware/session","h":"","p":445},{"i":448,"t":"func New(config ...Config) *Store func (s *Store) RegisterType(i interface{}) func (s *Store) Get(c *fiber.Ctx) (*Session, error) func (s *Store) Reset() error func (s *Session) Get(key string) interface{} func (s *Session) Set(key string, val interface{}) func (s *Session) Delete(key string) func (s *Session) Destroy() error func (s *Session) Regenerate() error func (s *Session) Save() error func (s *Session) Fresh() bool func (s *Session) ID() string func (s *Session) Keys() []string caution Storing interface{} values are limited to built-ins Go types.","s":"Signatures","u":"/next/api/middleware/session","h":"#signatures","p":445},{"i":450,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/session\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config // This stores all of your app's sessions store := session.New() app.Get(\"/\", func(c *fiber.Ctx) error { // Get session from storage sess, err := store.Get(c) if err != nil { panic(err) } // Get value name := sess.Get(\"name\") // Set key/value sess.Set(\"name\", \"john\") // Get all Keys keys := sess.Keys() // Delete key sess.Delete(\"name\") // Destroy session if err := sess.Destroy(); err != nil { panic(err) } // Sets a specific expiration for this session sess.SetExpiry(time.Second * 2) // Save session if err := sess.Save(); err != nil { panic(err) } return c.SendString(fmt.Sprintf(\"Welcome %v\", name)) })","s":"Examples","u":"/next/api/middleware/session","h":"#examples","p":445},{"i":452,"t":"// Config defines the config for middleware. type Config struct { // Allowed session duration // Optional. Default value 24 * time.Hour Expiration time.Duration // Storage interface to store the session data // Optional. Default value memory.New() Storage fiber.Storage // KeyLookup is a string in the form of \":\" that is used // to extract session id from the request. // Possible values: \"header:\", \"query:\" or \"cookie:\" // Optional. Default value \"cookie:session_id\". KeyLookup string // Domain of the CSRF cookie. // Optional. Default value \"\". CookieDomain string // Path of the CSRF cookie. // Optional. Default value \"\". CookiePath string // Indicates if CSRF cookie is secure. // Optional. Default value false. CookieSecure bool // Indicates if CSRF cookie is HTTP only. // Optional. Default value false. CookieHTTPOnly bool // Value of SameSite cookie. // Optional. Default value \"Lax\". CookieSameSite string // Decides whether cookie should last for only the browser sesison. // Ignores Expiration if set to true // Optional. Default value false. CookieSessionOnly bool // KeyGenerator generates the session key. // Optional. Default value utils.UUIDv4 KeyGenerator func() string // Deprecated: Please use KeyLookup CookieName string // Source defines where to obtain the session id source Source // The session name sessionName string }","s":"Config","u":"/next/api/middleware/session","h":"#config","p":445},{"i":454,"t":"var ConfigDefault = Config{ Expiration: 24 * time.Hour, KeyLookup: \"cookie:session_id\", KeyGenerator: utils.UUIDv4, source: \"cookie\", sessionName: \"session_id\", }","s":"Default Config","u":"/next/api/middleware/session","h":"#default-config","p":445},{"i":456,"t":"const ( SourceCookie Source = \"cookie\" SourceHeader Source = \"header\" SourceURLQuery Source = \"query\" )","s":"Constants","u":"/next/api/middleware/session","h":"#constants","p":445},{"i":458,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 store := session.New(session.Config{ Storage: storage, }) To use the store, see the Examples.","s":"Custom Storage/Database","u":"/next/api/middleware/session","h":"#custom-storagedatabase","p":445},{"i":460,"t":"Skip middleware for Fiber that skips a wrapped handler if a predicate is true.","s":"Skip","u":"/next/api/middleware/skip","h":"","p":459},{"i":462,"t":"func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler","s":"Signatures","u":"/next/api/middleware/skip","h":"#signatures","p":459},{"i":464,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/skip\" ) After you initiate your Fiber app, you can use the following possibilities: func main() { app := fiber.New() app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool { return ctx.Method() == fiber.MethodGet })) app.Get(\"/\", func(ctx *fiber.Ctx) error { return ctx.SendString(\"It was a GET request!\") }) log.Fatal(app.Listen(\":3000\")) } func BasicHandler(ctx *fiber.Ctx) error { return ctx.SendString(\"It was not a GET request!\") } tip app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.","s":"Examples","u":"/next/api/middleware/skip","h":"#examples","p":459},{"i":466,"t":"There exist two distinct implementations of timeout middleware Fiber. New Wraps a fiber.Handler with a timeout. If the handler takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler. caution This has been deprecated since it raises race conditions. NewWithContext As a fiber.Handler wrapper, it creates a context with context.WithTimeout and pass it in UserContext. If the context passed executions (eg. DB ops, Http calls) takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler. It does not cancel long running executions. Underlying executions must handle timeout by using context.Context parameter.","s":"Timeout","u":"/next/api/middleware/timeout","h":"","p":465},{"i":468,"t":"func New(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler func NewWithContext(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler","s":"Signatures","u":"/next/api/middleware/timeout","h":"#signatures","p":465},{"i":470,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/timeout\" ) After you initiate your Fiber app, you can use the following possibilities: func main() { app := fiber.New() h := func(c *fiber.Ctx) error { sleepTime, _ := time.ParseDuration(c.Params(\"sleepTime\") + \"ms\") if err := sleepWithContext(c.UserContext(), sleepTime); err != nil { return fmt.Errorf(\"%w: execution error\", err) } return nil } app.Get(\"/foo/:sleepTime\", timeout.New(h, 2*time.Second)) log.Fatal(app.Listen(\":3000\")) } func sleepWithContext(ctx context.Context, d time.Duration) error { timer := time.NewTimer(d) select { case <-ctx.Done(): if !timer.Stop() { <-timer.C } return context.DeadlineExceeded case <-timer.C: } return nil } Test http 200 with curl: curl --location -I --request GET 'http://localhost:3000/foo/1000' Test http 408 with curl: curl --location -I --request GET 'http://localhost:3000/foo/3000' Use with custom error: var ErrFooTimeOut = errors.New(\"foo context canceled\") func main() { app := fiber.New() h := func(c *fiber.Ctx) error { sleepTime, _ := time.ParseDuration(c.Params(\"sleepTime\") + \"ms\") if err := sleepWithContextWithCustomError(c.UserContext(), sleepTime); err != nil { return fmt.Errorf(\"%w: execution error\", err) } return nil } app.Get(\"/foo/:sleepTime\", timeout.NewWithContext(h, 2*time.Second, ErrFooTimeOut)) log.Fatal(app.Listen(\":3000\")) } func sleepWithContextWithCustomError(ctx context.Context, d time.Duration) error { timer := time.NewTimer(d) select { case <-ctx.Done(): if !timer.Stop() { <-timer.C } return ErrFooTimeOut case <-timer.C: } return nil } Sample usage with a DB call: func main() { app := fiber.New() db, _ := gorm.Open(postgres.Open(\"postgres://localhost/foodb\"), &gorm.Config{}) handler := func(ctx *fiber.Ctx) error { tran := db.WithContext(ctx.UserContext()).Begin() if tran = tran.Exec(\"SELECT pg_sleep(50)\"); tran.Error != nil { return tran.Error } if tran = tran.Commit(); tran.Error != nil { return tran.Error } return nil } app.Get(\"/foo\", timeout.NewWithContext(handler, 10*time.Second)) log.Fatal(app.Listen(\":3000\")) }","s":"Examples","u":"/next/api/middleware/timeout","h":"#examples","p":465},{"i":473,"t":"TechEmpower provides a performance comparison of many web application frameworks executing fundamental tasks such as JSON serialization, database access, and server-side template composition. Each framework is operating in a realistic production configuration. Results are captured on cloud instances and on physical hardware. The test implementations are largely community-contributed and all source is available at the GitHub repository. Fiber v1.10.0 28 HT Cores Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz 32GB RAM Ubuntu 18.04.3 4.15.0-88-generic Dedicated Cisco 10-Gbit Ethernet switch.","s":"TechEmpower","u":"/next/extra/benchmarks","h":"#techempower","p":471},{"i":475,"t":"The Plaintext test is an exercise of the request-routing fundamentals only, designed to demonstrate the capacity of high-performance platforms in particular. Requests will be sent using HTTP pipelining. The response payload is still small, meaning good performance is still necessary in order to saturate the gigabit Ethernet of the test environment. See Plaintext requirements Fiber - 6,162,556 responses per second with an average latency of 2.0 ms. Express - 367,069 responses per second with an average latency of 354.1 ms.","s":"Plaintext","u":"/next/extra/benchmarks","h":"#plaintext","p":471},{"i":477,"t":"Fiber handled 11,846 responses per second with an average latency of 42.8 ms. Express handled 2,066 responses per second with an average latency of 390.44 ms.","s":"Data Updates","u":"/next/extra/benchmarks","h":"#data-updates","p":471},{"i":479,"t":"Fiber handled 19,664 responses per second with an average latency of 25.7 ms. Express handled 4,302 responses per second with an average latency of 117.2 ms.","s":"Multiple Queries","u":"/next/extra/benchmarks","h":"#multiple-queries","p":471},{"i":481,"t":"Fiber handled 368,647 responses per second with an average latency of 0.7 ms. Express handled 57,880 responses per second with an average latency of 4.4 ms.","s":"Single Query","u":"/next/extra/benchmarks","h":"#single-query","p":471},{"i":483,"t":"Fiber handled 1,146,667 responses per second with an average latency of 0.4 ms. Express handled 244,847 responses per second with an average latency of 1.1 ms.","s":"JSON Serialization","u":"/next/extra/benchmarks","h":"#json-serialization","p":471},{"i":485,"t":"πŸ”— https://github.com/smallnest/go-web-framework-benchmark CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz MEM 4GB GO go1.13.6 linux/amd64 OS Linux The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers. The concurrency clients are 5000. Latency is the time of real processing time by web servers. The smaller is the better. Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better. If we enable http pipelining, test result as below: Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is: If we enable http pipelining, test result as below: Dependency graph for v1.9.0","s":"Go web framework benchmark","u":"/next/extra/benchmarks","h":"#go-web-framework-benchmark","p":471},{"i":488,"t":"There is no definitive answer to this question. The answer depends on the scale of your application and the team that is involved. To be as flexible as possible, Fiber makes no assumptions in terms of structure. Routes and other application-specific logic can live in as many files as you wish, in any directory structure you prefer. View the following examples for inspiration: gofiber/boilerplate thomasvvugt/fiber-boilerplate Youtube - Building a REST API using Gorm and Fiber embedmode/fiberseed","s":"How should I structure my application?","u":"/next/extra/faq","h":"#how-should-i-structure-my-application","p":486},{"i":490,"t":"If you're using v2.32.0 or later, all you need to do is to implement a custom error handler. See below, or see a more detailed explanation at Error Handling. If you're using v2.31.0 or earlier, the error handler will not capture 404 errors. Instead, you need to add a middleware function at the very bottom of the stack (below all other functions) to handle a 404 response: Example app.Use(func(c *fiber.Ctx) error { return c.Status(fiber.StatusNotFound).SendString(\"Sorry can't find that!\") })","s":"How do I handle custom 404 responses?","u":"/next/extra/faq","h":"#how-do-i-handle-custom-404-responses","p":486},{"i":492,"t":"Air is a handy tool that automatically restarts your Go applications whenever the source code changes, making your development process faster and more efficient. To use Air in a Fiber project, follow these steps: Install Air by downloading the appropriate binary for your operating system from the GitHub release page or by building the tool directly from source. Create a configuration file for Air in your project directory. This file can be named, for example, .air.toml or air.conf. Here's a sample configuration file that works with Fiber: # .air.toml root = \".\" tmp_dir = \"tmp\" [build] cmd = \"go build -o ./tmp/main .\" bin = \"./tmp/main\" delay = 1000 # ms exclude_dir = [\"assets\", \"tmp\", \"vendor\"] include_ext = [\"go\", \"tpl\", \"tmpl\", \"html\"] exclude_regex = [\"_test\\\\.go\"] Start your Fiber application using Air by running the following command in the terminal: air As you make changes to your source code, Air will detect them and automatically restart the application. A complete example demonstrating the use of Air with Fiber can be found in the Fiber Recipes repository. This example shows how to configure and use Air in a Fiber project to create an efficient development environment.","s":"How can i use live reload ?","u":"/next/extra/faq","h":"#how-can-i-use-live-reload-","p":486},{"i":494,"t":"To override the default error handler, you can override the default when providing a Config when initiating a new Fiber instance. Example app := fiber.New(fiber.Config{ ErrorHandler: func(c *fiber.Ctx, err error) error { return c.Status(fiber.StatusInternalServerError).SendString(err.Error()) }, }) We have a dedicated page explaining how error handling works in Fiber, see Error Handling.","s":"How do I set up an error handler?","u":"/next/extra/faq","h":"#how-do-i-set-up-an-error-handler","p":486},{"i":496,"t":"Fiber currently supports 8 template engines in our gofiber/template middleware: Ace Amber Django Handlebars HTML Jet Mustache Pug To learn more about using Templates in Fiber, see Templates.","s":"Which template engines does Fiber support?","u":"/next/extra/faq","h":"#which-template-engines-does-fiber-support","p":486},{"i":498,"t":"Yes, we have our own Discord server, where we hang out. We have different rooms for every subject. If you have questions or just want to have a chat, feel free to join us via this > invite link <.","s":"Does Fiber have a community chat?","u":"/next/extra/faq","h":"#does-fiber-have-a-community-chat","p":486},{"i":500,"t":"Yes we do, here are some examples: This example works v2 package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/logger\" ) type Host struct { Fiber *fiber.App } func main() { // Hosts hosts := map[string]*Host{} //----- // API //----- api := fiber.New() api.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"api.localhost:3000\"] = &Host{api} api.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"API\") }) //------ // Blog //------ blog := fiber.New() blog.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"blog.localhost:3000\"] = &Host{blog} blog.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Blog\") }) //--------- // Website //--------- site := fiber.New() site.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"localhost:3000\"] = &Host{site} site.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Website\") }) // Server app := fiber.New() app.Use(func(c *fiber.Ctx) error { host := hosts[c.Hostname()] if host == nil { return c.SendStatus(fiber.StatusNotFound) } else { host.Fiber.Handler()(c.Context()) return nil } }) log.Fatal(app.Listen(\":3000\")) } If more information is needed, please refer to this issue #750","s":"Does fiber support sub domain routing ?","u":"/next/extra/faq","h":"#does-fiber-support-sub-domain-routing-","p":486},{"i":503,"t":"It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them. Example app.Get(\"/\", func(c *fiber.Ctx) error { // Pass error to Fiber return c.SendFile(\"file-does-not-exist\") }) Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below: Example package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/recover\" ) func main() { app := fiber.New() app.Use(recover.New()) app.Get(\"/\", func(c *fiber.Ctx) error { panic(\"This panic is caught by fiber\") }) log.Fatal(app.Listen(\":3000\")) } You could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found). Example app.Get(\"/\", func(c *fiber.Ctx) error { // 503 Service Unavailable return fiber.ErrServiceUnavailable // 503 On vacation! return fiber.NewError(fiber.StatusServiceUnavailable, \"On vacation!\") })","s":"Catching Errors","u":"/next/guide/error-handling","h":"#catching-errors","p":501},{"i":505,"t":"Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If the error is of type fiber.Error, the response is sent with the provided status code and message. Example // Default error handler var DefaultErrorHandler = func(c *fiber.Ctx, err error) error { // Status code defaults to 500 code := fiber.StatusInternalServerError // Retrieve the custom status code if it's a *fiber.Error var e *fiber.Error if errors.As(err, &e) { code = e.Code } // Set Content-Type: text/plain; charset=utf-8 c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8) // Return status code with error message return c.Status(code).SendString(err.Error()) }","s":"Default Error Handler","u":"/next/guide/error-handling","h":"#default-error-handler","p":501},{"i":507,"t":"A custom error handler can be set using a Config when initializing a Fiber instance. In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response. The following example shows how to display error pages for different types of errors. Example // Create a new fiber instance with custom config app := fiber.New(fiber.Config{ // Override default error handler ErrorHandler: func(ctx *fiber.Ctx, err error) error { // Status code defaults to 500 code := fiber.StatusInternalServerError // Retrieve the custom status code if it's a *fiber.Error var e *fiber.Error if errors.As(err, &e) { code = e.Code } // Send custom error page err = ctx.Status(code).SendFile(fmt.Sprintf(\"./%d.html\", code)) if err != nil { // In case the SendFile fails return ctx.Status(fiber.StatusInternalServerError).SendString(\"Internal Server Error\") } // Return from handler return nil }, }) // ... Special thanks to the Echo & Express framework for inspiration regarding error handling.","s":"Custom Error Handler","u":"/next/guide/error-handling","h":"#custom-error-handler","p":501},{"i":510,"t":"Since Fiber v2.32.0, we use encoding/json as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of encoding/json, we recommend you to use these libraries: goccy/go-json bytedance/sonic segmentio/encoding mailru/easyjson minio/simdjson-go wI2L/jettison Example package main import \"github.com/gofiber/fiber/v2\" import \"github.com/goccy/go-json\" func main() { app := fiber.New(fiber.Config{ JSONEncoder: json.Marshal, JSONDecoder: json.Unmarshal, }) # ... }","s":"Custom JSON Encoder/Decoder","u":"/next/guide/faster-fiber","h":"#custom-json-encoderdecoder","p":508},{"i":512,"t":"Set custom JSON encoder for client Set custom JSON decoder for client Set custom JSON encoder for application Set custom JSON decoder for application","s":"References","u":"/next/guide/faster-fiber","h":"#references","p":508},{"i":514,"t":"info In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.","s":"🎭 Grouping","u":"/next/guide/grouping","h":"","p":513},{"i":516,"t":"Like Routing, groups can also have paths that belong to a cluster. func main() { app := fiber.New() api := app.Group(\"/api\", middleware) // /api v1 := api.Group(\"/v1\", middleware) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", middleware) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } A Group of paths can have an optional handler. func main() { app := fiber.New() api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\") // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\") // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } caution Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.","s":"Paths","u":"/next/guide/grouping","h":"#paths","p":513},{"i":518,"t":"Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue. func main() { app := fiber.New() handler := func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusOK) } api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\", func(c *fiber.Ctx) error { // middleware for /api/v1 c.Set(\"Version\", \"v1\") return c.Next() }) v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user log.Fatal(app.Listen(\":3000\")) }","s":"Group Handlers","u":"/next/guide/grouping","h":"#group-handlers","p":513},{"i":520,"t":"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks: OnRoute OnName OnGroup OnGroupName OnListen OnFork OnShutdown OnMount","s":"πŸͺ Hooks","u":"/next/guide/hooks","h":"","p":519},{"i":522,"t":"// Handlers define a function to create hooks for Fiber. type OnRouteHandler = func(Route) error type OnNameHandler = OnRouteHandler type OnGroupHandler = func(Group) error type OnGroupNameHandler = OnGroupHandler type OnListenHandler = func(ListenData) error type OnForkHandler = func(int) error type OnShutdownHandler = func() error type OnMountHandler = func(*App) error","s":"Constants","u":"/next/guide/hooks","h":"#constants","p":519},{"i":524,"t":"OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by route parameter. Signature func (app *App) OnRoute(handler ...OnRouteHandler)","s":"OnRoute","u":"/next/guide/hooks","h":"#onroute","p":519},{"i":526,"t":"OnName is a hook to execute user functions on each route naming. Also you can get route properties by route parameter. caution OnName only works with naming routes, not groups. Signature func (app *App) OnName(handler ...OnNameHandler) OnName Example package main import ( \"fmt\" \"github.com/gofiber/fiber/v2\" ) func main() { app := fiber.New() app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"index\") app.Hooks().OnName(func(r fiber.Route) error { fmt.Print(\"Name: \" + r.Name + \", \") return nil }) app.Hooks().OnName(func(r fiber.Route) error { fmt.Print(\"Method: \" + r.Method + \"\\n\") return nil }) app.Get(\"/add/user\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"addUser\") app.Delete(\"/destroy/user\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"destroyUser\") app.Listen(\":5000\") } // Results: // Name: addUser, Method: GET // Name: destroyUser, Method: DELETE","s":"OnName","u":"/next/guide/hooks","h":"#onname","p":519},{"i":528,"t":"OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by group parameter. Signature func (app *App) OnGroup(handler ...OnGroupHandler)","s":"OnGroup","u":"/next/guide/hooks","h":"#ongroup","p":519},{"i":530,"t":"OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by group parameter. caution OnGroupName only works with naming groups, not routes. Signature func (app *App) OnGroupName(handler ...OnGroupNameHandler)","s":"OnGroupName","u":"/next/guide/hooks","h":"#ongroupname","p":519},{"i":532,"t":"OnListen is a hook to execute user functions on Listen, ListenTLS, Listener. Signature func (app *App) OnListen(handler ...OnListenHandler) OnListen Example app := fiber.New(fiber.Config{ DisableStartupMessage: true, }) app.Hooks().OnListen(func(listenData fiber.ListenData) error { if fiber.IsChild() { return nil } scheme := \"http\" if data.TLS { scheme = \"https\" } log.Println(scheme + \"://\" + listenData.Host + \":\" + listenData.Port) return nil }) app.Listen(\":5000\")","s":"OnListen","u":"/next/guide/hooks","h":"#onlisten","p":519},{"i":534,"t":"OnFork is a hook to execute user functions on Fork. Signature func (app *App) OnFork(handler ...OnForkHandler)","s":"OnFork","u":"/next/guide/hooks","h":"#onfork","p":519},{"i":536,"t":"OnShutdown is a hook to execute user functions after Shutdown. Signature func (app *App) OnShutdown(handler ...OnShutdownHandler)","s":"OnShutdown","u":"/next/guide/hooks","h":"#onshutdown","p":519},{"i":538,"t":"OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting. Signature func (h *Hooks) OnMount(handler ...OnMountHandler) OnMount Example package main import ( \"fmt\" \"github.com/gofiber/fiber/v2\" ) func main() { app := New() app.Get(\"/\", testSimpleHandler).Name(\"x\") subApp := New() subApp.Get(\"/test\", testSimpleHandler) subApp.Hooks().OnMount(func(parent *fiber.App) error { fmt.Print(\"Mount path of parent app: \"+parent.MountPath()) // ... return nil }) app.Mount(\"/sub\", subApp) } // Result: // Mount path of parent app: caution OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.","s":"OnMount","u":"/next/guide/hooks","h":"#onmount","p":519},{"i":541,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Handlers","u":"/next/guide/routing","h":"#handlers","p":539},{"i":543,"t":"Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns. Examples of route paths based on strings // This route path will match requests to the root route, \"/\": app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"root\") }) // This route path will match requests to \"/about\": app.Get(\"/about\", func(c *fiber.Ctx) error { return c.SendString(\"about\") }) // This route path will match requests to \"/random.txt\": app.Get(\"/random.txt\", func(c *fiber.Ctx) error { return c.SendString(\"random.txt\") }) As with the expressJs framework, the order of the route declaration plays a role. When a request is received, the routes are checked in the order in which they are declared. info So please be careful to write routes with variable parameters after the routes that contain fixed parts, so that these variable parts do not match instead and unexpected behavior occurs.","s":"Paths","u":"/next/guide/routing","h":"#paths","p":539},{"i":545,"t":"Route parameters are dynamic elements in the route, which are named or not named segments. This segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys or for unnamed parameters the character(*, +) and the counter of this. The characters :, +, and * are characters that introduce a parameter. Greedy parameters are indicated by wildcard(*) or plus(+) signs. The routing also offers the possibility to use optional parameters, for the named parameters these are marked with a final \"?\", unlike the plus sign which is not optional, you can use the wildcard character for a parameter range which is optional and greedy. Example of define routes with route parameters // Parameters app.Get(\"/user/:name/books/:title\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s\\n\", c.Params(\"name\")) fmt.Fprintf(c, \"%s\\n\", c.Params(\"title\")) return nil }) // Plus - greedy - not optional app.Get(\"/user/+\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"+\")) }) // Optional parameter app.Get(\"/user/:name?\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"name\")) }) // Wildcard - greedy - optional app.Get(\"/user/*\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"*\")) }) // This route path will match requests to \"/v1/some/resource/name:customVerb\", since the parameter character is escaped app.Get(\"/v1/some/resource/name\\\\:customVerb\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, Community\") }) info Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes. info All special parameter characters can also be escaped with \"\\\\\" and lose their value, so you can use them in the route if you want, like in the custom methods of the google api design guide. // http://localhost:3000/plantae/prunus.persica app.Get(\"/plantae/:genus.:species\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s.%s\\n\", c.Params(\"genus\"), c.Params(\"species\")) return nil // prunus.persica }) // http://localhost:3000/flights/LAX-SFO app.Get(\"/flights/:from-:to\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s-%s\\n\", c.Params(\"from\"), c.Params(\"to\")) return nil // LAX-SFO }) Our intelligent router recognizes that the introductory parameter characters should be part of the request route in this case and can process them as such. // http://localhost:3000/shop/product/color:blue/size:xs app.Get(\"/shop/product/color::color/size::size\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s:%s\\n\", c.Params(\"color\"), c.Params(\"size\")) return nil // blue:xs }) In addition, several parameters in a row and several unnamed parameter characters in the route, such as the wildcard or plus character, are possible, which greatly expands the possibilities of the router for the user. // GET /@v1 // Params: \"sign\" -> \"@\", \"param\" -> \"v1\" app.Get(\"/:sign:param\", handler) // GET /api-v1 // Params: \"name\" -> \"v1\" app.Get(\"/api-:name\", handler) // GET /customer/v1/cart/proxy // Params: \"*1\" -> \"customer/\", \"*2\" -> \"/cart\" app.Get(\"/*v1*/proxy\", handler) // GET /v1/brand/4/shop/blue/xs // Params: \"*1\" -> \"brand/4\", \"*2\" -> \"blue/xs\" app.Get(\"/v1/*/shop/*\", handler) We have adapted the routing strongly to the express routing, but currently without the possibility of the regular expressions, because they are quite slow. The possibilities can be tested with version 0.1.7 (express 4) in the online Express route tester.","s":"Parameters","u":"/next/guide/routing","h":"#parameters","p":539},{"i":547,"t":"Route constraints execute when a match has occurred to the incoming URL and the URL path is tokenized into route values by parameters. The feature was intorduced in v2.37.0 and inspired by .NET Core. caution Constraints aren't validation for parameters. If constraint aren't valid for parameter value, Fiber returns 404 handler. Constraint Example Example matches int :id 123456789, -123456789 bool :active true,false guid :id CD2C1638-1638-72D5-1638-DEADBEEF1638 float :weight 1.234, -1,001.01e8 minLen(value) :username Test (must be at least 4 characters) maxLen(value) :filename MyFile (must be no more than 8 characters len(length) :filename somefile.txt (exactly 12 characters) min(value) :age 19 (Integer value must be at least 18) max(value) :age 91 (Integer value must be no more than 120) range(min,max) :age 91 (Integer value must be at least 18 but no more than 120) alpha :name Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive) datetime :dob 2005-11-01 regex(expression) :date 2022-08-27 (Must match regular expression) Examples Single Constraint Multiple Constraints Regex Constraint app.Get(\"/:test\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/12 // 12 // curl -X GET http://localhost:3000/1 // Cannot GET /1 You can use ; for multiple constraints. app.Get(\"/:test\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/120000 // Cannot GET /120000 // curl -X GET http://localhost:3000/1 // Cannot GET /1 // curl -X GET http://localhost:3000/250 // 250 Fiber precompiles regex query when to register routes. So there're no performance overhead for regex constraint. app.Get(\"/:date\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"date\")) }) // curl -X GET http://localhost:3000/125 // Cannot GET /125 // curl -X GET http://localhost:3000/test // Cannot GET /test // curl -X GET http://localhost:3000/2022-08-27 // 2022-08-27 caution You should use \\\\ before routing-specific characters when to use datetime constraint (*, +, ?, :, /, <, >, ;, (, )), to avoid wrong parsing. Optional Parameter Example You can impose constraints on optional parameters as well. app.Get(\"/:test?\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/42 // 42 // curl -X GET http://localhost:3000/ // // curl -X GET http://localhost:3000/7.0 // Cannot GET /7.0","s":"Constraints","u":"/next/guide/routing","h":"#constraints","p":539},{"i":549,"t":"Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route. Example of a middleware function app.Use(func(c *fiber.Ctx) error { // Set a custom header on all responses: c.Set(\"X-Custom-Header\", \"Hello, World\") // Go to next middleware: return c.Next() }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.","s":"Middleware","u":"/next/guide/routing","h":"#middleware","p":539},{"i":551,"t":"If you have many endpoints, you can organize your routes using Group. func main() { app := fiber.New() api := app.Group(\"/api\", middleware) // /api v1 := api.Group(\"/v1\", middleware) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", middleware) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } More information about this in our Grouping Guide","s":"Grouping","u":"/next/guide/routing","h":"#grouping","p":539},{"i":554,"t":"Fiber provides a Views interface to provide your own template engine: Views type Views interface { Load() error Render(io.Writer, string, interface{}, ...string) error } Views interface contains a Load and Render method, Load is executed by Fiber on app initialization to load/parse the templates. // Pass engine to Fiber's Views Engine app := fiber.New(fiber.Config{ Views: engine, // Views Layout is the global layout for all template render until override on Render function. ViewsLayout: \"layouts/main\" }) The Render method is linked to the ctx.Render() function that accepts a template name and binding data. It will use global layout if layout is not being defined in Render function. If the Fiber config option PassLocalsToViews is enabled, then all locals set using ctx.Locals(key, value) will be passed to the template. app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"index\", fiber.Map{ \"hello\": \"world\", }); })","s":"Template interfaces","u":"/next/guide/templates","h":"#template-interfaces","p":552},{"i":556,"t":"Fiber team maintains templates package that provides wrappers for multiple template engines: html ace amber django handlebars jet mustache pug Example views/index.html package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html/v2\" ) func main() { // Initialize standard Go html template engine engine := html.New(\"./views\", \".html\") // If you want other engine, just replace with following // Create a new engine with django // engine := django.New(\"./views\", \".django\") app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index template return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) log.Fatal(app.Listen(\":3000\")) }

{{.Title}}

","s":"Engines","u":"/next/guide/templates","h":"#engines","p":552},{"i":559,"t":"Fiber can make great use of the validator package to ensure correct validation of data to store. Official validator Github page (Installation, use, examples..). You can find the detailed descriptions of the validations used in the fields contained on the structs below: Detailed docs Validation Example package main import ( \"fmt\" \"log\" \"strings\" \"github.com/go-playground/validator/v10\" \"github.com/gofiber/fiber/v2\" ) type ( User struct { Name string `validate:\"required,min=5,max=20\"` // Required field, min 5 char long max 20 Age int `validate:\"required,teener\"` // Required field, and client needs to implement our 'teener' tag format which we'll see later } ErrorResponse struct { Error bool FailedField string Tag string Value interface{} } XValidator struct { validator *validator.Validate } GlobalErrorHandlerResp struct { Success bool `json:\"success\"` Message string `json:\"message\"` } ) // This is the validator instance // for more information see: https://github.com/go-playground/validator var validate = validator.New() func (v XValidator) Validate(data interface{}) []ErrorResponse { validationErrors := []ErrorResponse{} errs := validate.Struct(data) if errs != nil { for _, err := range errs.(validator.ValidationErrors) { // In this case data object is actually holding the User struct var elem ErrorResponse elem.FailedField = err.Field() // Export struct field name elem.Tag = err.Tag() // Export struct tag elem.Value = err.Value() // Export field value elem.Error = true validationErrors = append(validationErrors, elem) } } return validationErrors } func main() { myValidator := &XValidator{ validator: validate, } app := fiber.New(fiber.Config{ // Global custom error handler ErrorHandler: func(c *fiber.Ctx, err error) error { return c.Status(fiber.StatusBadRequest).JSON(GlobalErrorHandlerResp{ Success: false, Message: err.Error(), }) }, }) // Custom struct validation tag format myValidator.validator.RegisterValidation(\"teener\", func(fl validator.FieldLevel) bool { // User.Age needs to fit our needs, 12-18 years old. return fl.Field().Int() >= 12 && fl.Field().Int() <= 18 }) app.Get(\"/\", func(c *fiber.Ctx) error { user := &User{ Name: c.Query(\"name\"), Age: c.QueryInt(\"age\"), } // Validation if errs := myValidator.Validate(user); len(errs) > 0 && errs[0].Error { errMsgs := make([]string, 0) for _, err := range errs { errMsgs = append(errMsgs, fmt.Sprintf( \"[%s]: '%v' | Needs to implement '%s'\", err.FailedField, err.Value, err.Tag, )) } return &fiber.Error{ Code: fiber.ErrBadRequest.Code, Message: strings.Join(errMsgs, \" and \"), } } // Logic, validated with success return c.SendString(\"Hello, World!\") }) log.Fatal(app.Listen(\":3000\")) } /** OUTPUT [1] Request: GET http://127.0.0.1:3000/ Response: {\"success\":false,\"message\":\"[Name]: '' | Needs to implement 'required' and [Age]: '0' | Needs to implement 'required'\"} [2] Request: GET http://127.0.0.1:3000/?name=efdal&age=9 Response: {\"success\":false,\"message\":\"[Age]: '9' | Needs to implement 'teener'\"} [3] Request: GET http://127.0.0.1:3000/?name=efdal&age= Response: {\"success\":false,\"message\":\"[Age]: '0' | Needs to implement 'required'\"} [4] Request: GET http://127.0.0.1:3000/?name=efdal&age=18 Response: Hello, World! **/","s":"Validator package","u":"/next/guide/validation","h":"#validator-package","p":557},{"i":561,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Route Handlers","u":"/next/partials/routing/route-handlers","h":"","p":560},{"i":564,"t":"Checks, if the specified extensions or content types are acceptable. info Based on the request’s Accept HTTP header. Signature func (c *Ctx) Accepts(offers ...string) string func (c *Ctx) AcceptsCharsets(offers ...string) string func (c *Ctx) AcceptsEncodings(offers ...string) string func (c *Ctx) AcceptsLanguages(offers ...string) string Example // Accept: text/html, application/json; q=0.8, text/plain; q=0.5; charset=\"utf-8\" app.Get(\"/\", func(c *fiber.Ctx) error { c.Accepts(\"html\") // \"html\" c.Accepts(\"text/html\") // \"text/html\" c.Accepts(\"json\", \"text\") // \"json\" c.Accepts(\"application/json\") // \"application/json\" c.Accepts(\"text/plain\", \"application/json\") // \"application/json\", due to quality c.Accepts(\"image/png\") // \"\" c.Accepts(\"png\") // \"\" // ... }) Example 2 // Accept: text/html, text/*, application/json, */*; q=0 app.Get(\"/\", func(c *fiber.Ctx) error { c.Accepts(\"text/plain\", \"application/json\") // \"application/json\", due to specificity c.Accepts(\"application/json\", \"text/html\") // \"text/html\", due to first match c.Accepts(\"image/png\") // \"\", due to */* without q factor 0 is Not Acceptable // ... }) Fiber provides similar functions for the other accept headers. // Accept-Charset: utf-8, iso-8859-1;q=0.2 // Accept-Encoding: gzip, compress;q=0.2 // Accept-Language: en;q=0.8, nl, ru app.Get(\"/\", func(c *fiber.Ctx) error { c.AcceptsCharsets(\"utf-16\", \"iso-8859-1\") // \"iso-8859-1\" c.AcceptsEncodings(\"compress\", \"br\") // \"compress\" c.AcceptsLanguages(\"pt\", \"nl\", \"ru\") // \"nl\" // ... })","s":"Accepts","u":"/next/api/ctx","h":"#accepts","p":562},{"i":566,"t":"Params is used to get all route parameters. Using Params method to get params. Signature func (c *Ctx) AllParams() map[string]string Example // GET http://example.com/user/fenny app.Get(\"/user/:name\", func(c *fiber.Ctx) error { c.AllParams() // \"{\"name\": \"fenny\"}\" // ... }) // GET http://example.com/user/fenny/123 app.Get(\"/user/*\", func(c *fiber.Ctx) error { c.AllParams() // \"{\"*1\": \"fenny/123\"}\" // ... })","s":"AllParams","u":"/next/api/ctx","h":"#allparams","p":562},{"i":568,"t":"Returns the *App reference so you could easily access all application settings. Signature func (c *Ctx) App() *App Example app.Get(\"/stack\", func(c *fiber.Ctx) error { return c.JSON(c.App().Stack()) })","s":"App","u":"/next/api/ctx","h":"#app","p":562},{"i":570,"t":"Appends the specified value to the HTTP response header field. caution If the header is not already set, it creates the header with the specified value. Signature func (c *Ctx) Append(field string, values ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Append(\"Link\", \"http://google.com\", \"http://localhost\") // => Link: http://localhost, http://google.com c.Append(\"Link\", \"Test\") // => Link: http://localhost, http://google.com, Test // ... })","s":"Append","u":"/next/api/ctx","h":"#append","p":562},{"i":572,"t":"Sets the HTTP response Content-Disposition header field to attachment. Signature func (c *Ctx) Attachment(filename ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Attachment() // => Content-Disposition: attachment c.Attachment(\"./upload/images/logo.png\") // => Content-Disposition: attachment; filename=\"logo.png\" // => Content-Type: image/png // ... })","s":"Attachment","u":"/next/api/ctx","h":"#attachment","p":562},{"i":574,"t":"Returns the base URL (protocol + host) as a string. Signature func (c *Ctx) BaseURL() string Example // GET https://example.com/page#chapter-1 app.Get(\"/\", func(c *fiber.Ctx) error { c.BaseURL() // https://example.com // ... })","s":"BaseURL","u":"/next/api/ctx","h":"#baseurl","p":562},{"i":576,"t":"Add vars to default view var map binding to template engine. Variables are read by the Render method and may be overwritten. Signature func (c *Ctx) Bind(vars Map) error Example app.Use(func(c *fiber.Ctx) error { c.Bind(fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"xxx.tmpl\", fiber.Map{}) // Render will use Title variable })","s":"Bind","u":"/next/api/ctx","h":"#bind","p":562},{"i":578,"t":"Returns the raw request body. Signature func (c *Ctx) Body() []byte Example // curl -X POST http://localhost:8080 -d user=john app.Post(\"/\", func(c *fiber.Ctx) error { // Get raw body from POST request: return c.Send(c.Body()) // []byte(\"user=john\") }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Body","u":"/next/api/ctx","h":"#body","p":562},{"i":580,"t":"Binds the request body to a struct. It is important to specify the correct struct tag based on the content type to be parsed. For example, if you want to parse a JSON body with a field called Pass, you would use a struct field of json:\"pass\". content-type struct tag application/x-www-form-urlencoded form multipart/form-data form application/json json application/xml xml text/xml xml Signature func (c *Ctx) BodyParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `json:\"name\" xml:\"name\" form:\"name\"` Pass string `json:\"pass\" xml:\"pass\" form:\"pass\"` } app.Post(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.BodyParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe // ... }) // Run tests with the following curl commands // curl -X POST -H \"Content-Type: application/json\" --data \"{\\\"name\\\":\\\"john\\\",\\\"pass\\\":\\\"doe\\\"}\" localhost:3000 // curl -X POST -H \"Content-Type: application/xml\" --data \"johndoe\" localhost:3000 // curl -X POST -H \"Content-Type: application/x-www-form-urlencoded\" --data \"name=john&pass=doe\" localhost:3000 // curl -X POST -F name=john -F pass=doe http://localhost:3000 // curl -X POST \"http://localhost:3000/?name=john&pass=doe\" Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"BodyParser","u":"/next/api/ctx","h":"#bodyparser","p":562},{"i":582,"t":"Expire a client cookie (or all cookies if left empty) Signature func (c *Ctx) ClearCookie(key ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { // Clears all cookies: c.ClearCookie() // Expire specific cookie by name: c.ClearCookie(\"user\") // Expire multiple cookies by names: c.ClearCookie(\"token\", \"session\", \"track_id\", \"version\") // ... }) caution Web browsers and other compliant clients will only clear the cookie if the given options are identical to those when creating the cookie, excluding expires and maxAge. ClearCookie will not set these values for you - a technique similar to the one shown below should be used to ensure your cookie is deleted. Example app.Get(\"/set\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"token\", Value: \"randomvalue\", Expires: time.Now().Add(24 * time.Hour), HTTPOnly: true, SameSite: \"lax\", }) // ... }) app.Get(\"/delete\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"token\", // Set expiry date to the past Expires: time.Now().Add(-(time.Hour * 2)), HTTPOnly: true, SameSite: \"lax\", }) // ... })","s":"ClearCookie","u":"/next/api/ctx","h":"#clearcookie","p":562},{"i":584,"t":"ClientHelloInfo contains information from a ClientHello message in order to guide application logic in the GetCertificate and GetConfigForClient callbacks. You can refer to the ClientHelloInfo struct documentation for more information on the returned struct. Signature func (c *Ctx) ClientHelloInfo() *tls.ClientHelloInfo Example // GET http://example.com/hello app.Get(\"/hello\", func(c *fiber.Ctx) error { chi := c.ClientHelloInfo() // ... })","s":"ClientHelloInfo","u":"/next/api/ctx","h":"#clienthelloinfo","p":562},{"i":586,"t":"Returns *fasthttp.RequestCtx that is compatible with the context.Context interface that requires a deadline, a cancellation signal, and other values across API boundaries. Signature func (c *Ctx) Context() *fasthttp.RequestCtx info Please read the Fasthttp Documentation for more information.","s":"Context","u":"/next/api/ctx","h":"#context","p":562},{"i":588,"t":"Set cookie Signature func (c *Ctx) Cookie(cookie *Cookie) type Cookie struct { Name string `json:\"name\"` Value string `json:\"value\"` Path string `json:\"path\"` Domain string `json:\"domain\"` MaxAge int `json:\"max_age\"` Expires time.Time `json:\"expires\"` Secure bool `json:\"secure\"` HTTPOnly bool `json:\"http_only\"` SameSite string `json:\"same_site\"` SessionOnly bool `json:\"session_only\"` } Example app.Get(\"/\", func(c *fiber.Ctx) error { // Create cookie cookie := new(fiber.Cookie) cookie.Name = \"john\" cookie.Value = \"doe\" cookie.Expires = time.Now().Add(24 * time.Hour) // Set cookie c.Cookie(cookie) // ... })","s":"Cookie","u":"/next/api/ctx","h":"#cookie","p":562},{"i":590,"t":"Get cookie value by key, you could pass an optional default value that will be returned if the cookie key does not exist. Signature func (c *Ctx) Cookies(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { // Get cookie by key: c.Cookies(\"name\") // \"john\" c.Cookies(\"empty\", \"doe\") // \"doe\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Cookies","u":"/next/api/ctx","h":"#cookies","p":562},{"i":592,"t":"Transfers the file from path as an attachment. Typically, browsers will prompt the user to download. By default, the Content-Disposition header filename= parameter is the file path (this typically appears in the browser dialog). Override this default with the filename parameter. Signature func (c *Ctx) Download(file string, filename ...string) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.Download(\"./files/report-12345.pdf\"); // => Download report-12345.pdf return c.Download(\"./files/report-12345.pdf\", \"report.pdf\"); // => Download report.pdf })","s":"Download","u":"/next/api/ctx","h":"#download","p":562},{"i":594,"t":"Performs content-negotiation on the Accept HTTP header. It uses Accepts to select a proper format. info If the header is not specified or there is no proper format, text/plain is used. Signature func (c *Ctx) Format(body interface{}) error Example app.Get(\"/\", func(c *fiber.Ctx) error { // Accept: text/plain c.Format(\"Hello, World!\") // => Hello, World! // Accept: text/html c.Format(\"Hello, World!\") // =>

Hello, World!

// Accept: application/json c.Format(\"Hello, World!\") // => \"Hello, World!\" // .. })","s":"Format","u":"/next/api/ctx","h":"#format","p":562},{"i":596,"t":"MultipartForm files can be retrieved by name, the first file from the given key is returned. Signature func (c *Ctx) FormFile(key string) (*multipart.FileHeader, error) Example app.Post(\"/\", func(c *fiber.Ctx) error { // Get first file from form field \"document\": file, err := c.FormFile(\"document\") // Save file to root directory: return c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)) })","s":"FormFile","u":"/next/api/ctx","h":"#formfile","p":562},{"i":598,"t":"Any form values can be retrieved by name, the first value from the given key is returned. Signature func (c *Ctx) FormValue(key string, defaultValue ...string) string Example app.Post(\"/\", func(c *fiber.Ctx) error { // Get first value from form field \"name\": c.FormValue(\"name\") // => \"john\" or \"\" if not exist // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"FormValue","u":"/next/api/ctx","h":"#formvalue","p":562},{"i":600,"t":"https://expressjs.com/en/4x/api.html#req.fresh Signature func (c *Ctx) Fresh() bool","s":"Fresh","u":"/next/api/ctx","h":"#fresh","p":562},{"i":602,"t":"Returns the HTTP request header specified by the field. tip The match is case-insensitive. Signature func (c *Ctx) Get(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Get(\"Content-Type\") // \"text/plain\" c.Get(\"CoNtEnT-TypE\") // \"text/plain\" c.Get(\"something\", \"john\") // \"john\" // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Get","u":"/next/api/ctx","h":"#get","p":562},{"i":604,"t":"Returns the HTTP request headers. Signature func (c *Ctx) GetReqHeaders() map[string]string","s":"GetReqHeaders","u":"/next/api/ctx","h":"#getreqheaders","p":562},{"i":606,"t":"Returns the HTTP response header specified by the field. tip The match is case-insensitive. Signature func (c *Ctx) GetRespHeader(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.GetRespHeader(\"X-Request-Id\") // \"8d7ad5e3-aaf3-450b-a241-2beb887efd54\" c.GetRespHeader(\"Content-Type\") // \"text/plain\" c.GetRespHeader(\"something\", \"john\") // \"john\" // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"GetRespHeader","u":"/next/api/ctx","h":"#getrespheader","p":562},{"i":608,"t":"Returns the HTTP response headers. Signature func (c *Ctx) GetRespHeaders() map[string]string","s":"GetRespHeaders","u":"/next/api/ctx","h":"#getrespheaders","p":562},{"i":610,"t":"Generates URLs to named routes, with parameters. URLs are relative, for example: \"/user/1831\" Signature func (c *Ctx) GetRouteURL(routeName string, params Map) (string, error) Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Home page\") }).Name(\"home\") app.Get(\"/user/:id\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"id\")) }).Name(\"user.show\") app.Get(\"/test\", func(c *fiber.Ctx) error { location, _ := c.GetRouteURL(\"user.show\", fiber.Map{\"id\": 1}) return c.SendString(location) }) // /test returns \"/user/1\"","s":"GetRouteURL","u":"/next/api/ctx","h":"#getrouteurl","p":562},{"i":612,"t":"Returns the hostname derived from the Host HTTP header. Signature func (c *Ctx) Hostname() string Example // GET http://google.com/search app.Get(\"/\", func(c *fiber.Ctx) error { c.Hostname() // \"google.com\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Hostname","u":"/next/api/ctx","h":"#hostname","p":562},{"i":614,"t":"Returns the remote IP address of the request. Signature func (c *Ctx) IP() string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.IP() // \"127.0.0.1\" // ... }) When registering the proxy request header in the fiber app, the ip address of the header is returned (Fiber configuration) app := fiber.New(fiber.Config{ ProxyHeader: fiber.HeaderXForwardedFor, })","s":"IP","u":"/next/api/ctx","h":"#ip","p":562},{"i":616,"t":"Returns an array of IP addresses specified in the X-Forwarded-For request header. Signature func (c *Ctx) IPs() []string Example // X-Forwarded-For: proxy1, 127.0.0.1, proxy3 app.Get(\"/\", func(c *fiber.Ctx) error { c.IPs() // [\"proxy1\", \"127.0.0.1\", \"proxy3\"] // ... }) caution Improper use of the X-Forwarded-For header can be a security risk. For details, see the Security and privacy concerns section.","s":"IPs","u":"/next/api/ctx","h":"#ips","p":562},{"i":618,"t":"Returns the matching content type, if the incoming request’s Content-Type HTTP header field matches the MIME type specified by the type parameter. info If the request has no body, it returns false. Signature func (c *Ctx) Is(extension string) bool Example // Content-Type: text/html; charset=utf-8 app.Get(\"/\", func(c *fiber.Ctx) error { c.Is(\"html\") // true c.Is(\".html\") // true c.Is(\"json\") // false // ... })","s":"Is","u":"/next/api/ctx","h":"#is","p":562},{"i":620,"t":"Returns true if request came from localhost Signature func (c *Ctx) IsFromLocal() bool { Example app.Get(\"/\", func(c *fiber.Ctx) error { // If request came from localhost, return true else return false c.IsFromLocal() // ... })","s":"IsFromLocal","u":"/next/api/ctx","h":"#isfromlocal","p":562},{"i":622,"t":"Converts any interface or string to JSON using the goccy/go-json package. info JSON also sets the content header to application/json. Signature func (c *Ctx) JSON(data interface{}) error Example type SomeStruct struct { Name string Age uint8 } app.Get(\"/json\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ Name: \"Grame\", Age: 20, } return c.JSON(data) // => Content-Type: application/json // => \"{\"Name\": \"Grame\", \"Age\": 20}\" return c.JSON(fiber.Map{ \"name\": \"Grame\", \"age\": 20, }) // => Content-Type: application/json // => \"{\"name\": \"Grame\", \"age\": 20}\" })","s":"JSON","u":"/next/api/ctx","h":"#json","p":562},{"i":624,"t":"Sends a JSON response with JSONP support. This method is identical to JSON, except that it opts-in to JSONP callback support. By default, the callback name is simply callback. Override this by passing a named string in the method. Signature func (c *Ctx) JSONP(data interface{}, callback ...string) error Example type SomeStruct struct { name string age uint8 } app.Get(\"/\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ name: \"Grame\", age: 20, } return c.JSONP(data) // => callback({\"name\": \"Grame\", \"age\": 20}) return c.JSONP(data, \"customFunc\") // => customFunc({\"name\": \"Grame\", \"age\": 20}) })","s":"JSONP","u":"/next/api/ctx","h":"#jsonp","p":562},{"i":626,"t":"Joins the links followed by the property to populate the response’s Link HTTP header field. Signature func (c *Ctx) Links(link ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Links( \"http://api.example.com/users?page=2\", \"next\", \"http://api.example.com/users?page=5\", \"last\", ) // Link: ; rel=\"next\", // ; rel=\"last\" // ... })","s":"Links","u":"/next/api/ctx","h":"#links","p":562},{"i":628,"t":"A method that stores variables scoped to the request and, therefore, are available only to the routes that match the request. tip This is useful if you want to pass some specific data to the next middleware. Signature func (c *Ctx) Locals(key interface{}, value ...interface{}) interface{} Example app.Use(func(c *fiber.Ctx) error { c.Locals(\"user\", \"admin\") return c.Next() }) app.Get(\"/admin\", func(c *fiber.Ctx) error { if c.Locals(\"user\") == \"admin\" { return c.Status(fiber.StatusOK).SendString(\"Welcome, admin!\") } return c.SendStatus(fiber.StatusForbidden) })","s":"Locals","u":"/next/api/ctx","h":"#locals","p":562},{"i":630,"t":"Sets the response Location HTTP header to the specified path parameter. Signature func (c *Ctx) Location(path string) Example app.Post(\"/\", func(c *fiber.Ctx) error { c.Location(\"http://example.com\") c.Location(\"/foo/bar\") return nil })","s":"Location","u":"/next/api/ctx","h":"#location","p":562},{"i":632,"t":"Returns a string corresponding to the HTTP method of the request: GET, POST, PUT, and so on. Optionally, you could override the method by passing a string. Signature func (c *Ctx) Method(override ...string) string Example app.Post(\"/\", func(c *fiber.Ctx) error { c.Method() // \"POST\" c.Method(\"GET\") c.Method() // GET // ... })","s":"Method","u":"/next/api/ctx","h":"#method","p":562},{"i":634,"t":"To access multipart form entries, you can parse the binary with MultipartForm(). This returns a map[string][]string, so given a key, the value will be a string slice. Signature func (c *Ctx) MultipartForm() (*multipart.Form, error) Example app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form if token := form.Value[\"token\"]; len(token) > 0 { // Get key value: fmt.Println(token[0]) } // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: if err := c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)); err != nil { return err } } } return err })","s":"MultipartForm","u":"/next/api/ctx","h":"#multipartform","p":562},{"i":636,"t":"When Next is called, it executes the next method in the stack that matches the current route. You can pass an error struct within the method that will end the chaining and call the error handler. Signature func (c *Ctx) Next() error Example app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(\"1st route!\") return c.Next() }) app.Get(\"*\", func(c *fiber.Ctx) error { fmt.Println(\"2nd route!\") return c.Next() }) app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(\"3rd route!\") return c.SendString(\"Hello, World!\") })","s":"Next","u":"/next/api/ctx","h":"#next","p":562},{"i":638,"t":"Returns the original request URL. Signature func (c *Ctx) OriginalURL() string Example // GET http://example.com/search?q=something app.Get(\"/\", func(c *fiber.Ctx) error { c.OriginalURL() // \"/search?q=something\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"OriginalURL","u":"/next/api/ctx","h":"#originalurl","p":562},{"i":640,"t":"Method can be used to get the route parameters, you could pass an optional default value that will be returned if the param key does not exist. info Defaults to empty string (\"\"), if the param doesn't exist. Signature func (c *Ctx) Params(key string, defaultValue ...string) string Example // GET http://example.com/user/fenny app.Get(\"/user/:name\", func(c *fiber.Ctx) error { c.Params(\"name\") // \"fenny\" // ... }) // GET http://example.com/user/fenny/123 app.Get(\"/user/*\", func(c *fiber.Ctx) error { c.Params(\"*\") // \"fenny/123\" c.Params(\"*1\") // \"fenny/123\" // ... }) Unnamed route parameters(*, +) can be fetched by the character and the counter in the route. Example // ROUTE: /v1/*/shop/* // GET: /v1/brand/4/shop/blue/xs c.Params(\"*1\") // \"brand/4\" c.Params(\"*2\") // \"blue/xs\" For reasons of downward compatibility, the first parameter segment for the parameter character can also be accessed without the counter. Example app.Get(\"/v1/*/shop/*\", func(c *fiber.Ctx) error { c.Params(\"*\") // outputs the values of the first wildcard segment }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Params","u":"/next/api/ctx","h":"#params","p":562},{"i":642,"t":"Method can be used to get an integer from the route parameters. Please note if that parameter is not in the request, zero will be returned. If the parameter is NOT a number, zero and an error will be returned info Defaults to the integer zero (0), if the param doesn't exist. Signature func (c *Ctx) ParamsInt(key string) (int, error) Example // GET http://example.com/user/123 app.Get(\"/user/:id\", func(c *fiber.Ctx) error { id, err := c.ParamsInt(\"id\") // int 123 and no error // ... }) This method is equivalent of using atoi with ctx.Params","s":"ParamsInt","u":"/next/api/ctx","h":"#paramsint","p":562},{"i":644,"t":"This method is similar to BodyParser, but for path parameters. It is important to use the struct tag \"params\". For example, if you want to parse a path parameter with a field called Pass, you would use a struct field of params:\"pass\" Signature func (c *Ctx) ParamsParser(out interface{}) error Example // GET http://example.com/user/111 app.Get(\"/user/:id\", func(c *fiber.Ctx) error { param := struct {ID uint `params:\"id\"`}{} c.ParamsParser(¶m) // \"{\"id\": 111}\" // ... })","s":"ParamsParser","u":"/next/api/ctx","h":"#paramsparser","p":562},{"i":646,"t":"Contains the path part of the request URL. Optionally, you could override the path by passing a string. For internal redirects, you might want to call RestartRouting instead of Next. Signature func (c *Ctx) Path(override ...string) string Example // GET http://example.com/users?sort=desc app.Get(\"/users\", func(c *fiber.Ctx) error { c.Path() // \"/users\" c.Path(\"/john\") c.Path() // \"/john\" // ... })","s":"Path","u":"/next/api/ctx","h":"#path","p":562},{"i":648,"t":"Contains the request protocol string: http or https for TLS requests. Signature func (c *Ctx) Protocol() string Example // GET http://example.com app.Get(\"/\", func(c *fiber.Ctx) error { c.Protocol() // \"http\" // ... })","s":"Protocol","u":"/next/api/ctx","h":"#protocol","p":562},{"i":650,"t":"Queries is a function that returns an object containing a property for each query string parameter in the route. Signature func (c *Ctx) Queries() map[string]string Example // GET http://example.com/?name=alex&want_pizza=false&id= app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"name\"] // \"alex\" m[\"want_pizza\"] // \"false\" m[\"id\"] // \"\" // ... }) Example // GET http://example.com/?field1=value1&field1=value2&field2=value3 app.Get(\"/\", func (c *fiber.Ctx) error { m := c.Queries() m[\"field1\"] // \"value2\" m[\"field2\"] // value3 }) Example // GET http://example.com/?list_a=1&list_a=2&list_a=3&list_b[]=1&list_b[]=2&list_b[]=3&list_c=1,2,3 app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"list_a\"] // \"3\" m[\"list_b[]\"] // \"3\" m[\"list_c\"] // \"1,2,3\" }) Example // GET /api/posts?filters.author.name=John&filters.category.name=Technology app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"filters.author.name\"] // John m[\"filters.category.name\"] // Technology }) Example // GET /api/posts?tags=apple,orange,banana&filters[tags]=apple,orange,banana&filters[category][name]=fruits&filters.tags=apple,orange,banana&filters.category.name=fruits app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"tags\"] // apple,orange,banana m[\"filters[tags]\"] // apple,orange,banana m[\"filters[category][name]\"] // fruits m[\"filters.tags\"] // apple,orange,banana m[\"filters.category.name\"] // fruits })","s":"Queries","u":"/next/api/ctx","h":"#queries","p":562},{"i":652,"t":"This property is an object containing a property for each query string parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. info If there is no query string, it returns an empty string. Signature func (c *Ctx) Query(key string, defaultValue ...string) string Example // GET http://example.com/?order=desc&brand=nike app.Get(\"/\", func(c *fiber.Ctx) error { c.Query(\"order\") // \"desc\" c.Query(\"brand\") // \"nike\" c.Query(\"empty\", \"nike\") // \"nike\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Query","u":"/next/api/ctx","h":"#query","p":562},{"i":654,"t":"This property is an object containing a property for each query boolean parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, false will be returned. If the parameter is not a boolean, it is still tried to be converted and usually returned as false. Signature func (c *Ctx) QueryBool(key string, defaultValue ...bool) bool Example // GET http://example.com/?name=alex&want_pizza=false&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryBool(\"want_pizza\") // false c.QueryBool(\"want_pizza\", true) // false c.QueryBool(\"name\") // false c.QueryBool(\"name\", true) // true c.QueryBool(\"id\") // false c.QueryBool(\"id\", true) // true // ... })","s":"QueryBool","u":"/next/api/ctx","h":"#querybool","p":562},{"i":656,"t":"This property is an object containing a property for each query float64 parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, zero will be returned. If the parameter is not a number, it is still tried to be converted and usually returned as 1. info Defaults to the float64 zero (0), if the param doesn't exist. Signature func (c *Ctx) QueryFloat(key string, defaultValue ...float64) float64 Example // GET http://example.com/?name=alex&amount=32.23&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryFloat(\"amount\") // 32.23 c.QueryFloat(\"amount\", 3) // 32.23 c.QueryFloat(\"name\", 1) // 1 c.QueryFloat(\"name\") // 0 c.QueryFloat(\"id\", 3) // 3 // ... })","s":"QueryFloat","u":"/next/api/ctx","h":"#queryfloat","p":562},{"i":658,"t":"This property is an object containing a property for each query integer parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, zero will be returned. If the parameter is not a number, it is still tried to be converted and usually returned as 1. info Defaults to the integer zero (0), if the param doesn't exist. Signature func (c *Ctx) QueryInt(key string, defaultValue ...int) int Example // GET http://example.com/?name=alex&wanna_cake=2&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryInt(\"wanna_cake\", 1) // 2 c.QueryInt(\"name\", 1) // 1 c.QueryInt(\"id\", 1) // 1 c.QueryInt(\"id\") // 0 // ... })","s":"QueryInt","u":"/next/api/ctx","h":"#queryint","p":562},{"i":660,"t":"This method is similar to BodyParser, but for query parameters. It is important to use the struct tag \"query\". For example, if you want to parse a query parameter with a field called Pass, you would use a struct field of query:\"pass\". Signature func (c *Ctx) QueryParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `query:\"name\"` Pass string `query:\"pass\"` Products []string `query:\"products\"` } app.Get(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.QueryParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe log.Println(p.Products) // [shoe, hat] // ... }) // Run tests with the following curl command // curl \"http://localhost:3000/?name=john&pass=doe&products=shoe,hat\"","s":"QueryParser","u":"/next/api/ctx","h":"#queryparser","p":562},{"i":662,"t":"A struct containing the type and a slice of ranges will be returned. Signature func (c *Ctx) Range(size int) (Range, error) Example // Range: bytes=500-700, 700-900 app.Get(\"/\", func(c *fiber.Ctx) error { b := c.Range(1000) if b.Type == \"bytes\" { for r := range r.Ranges { fmt.Println(r) // [500, 700] } } })","s":"Range","u":"/next/api/ctx","h":"#range","p":562},{"i":664,"t":"Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. Signature func (c *Ctx) Redirect(location string, status ...int) error Example app.Get(\"/coffee\", func(c *fiber.Ctx) error { return c.Redirect(\"/teapot\") }) app.Get(\"/teapot\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusTeapot).Send(\"🍡 short and stout 🍡\") }) More examples app.Get(\"/\", func(c *fiber.Ctx) error { return c.Redirect(\"/foo/bar\") return c.Redirect(\"../login\") return c.Redirect(\"http://example.com\") return c.Redirect(\"http://example.com\", 301) })","s":"Redirect","u":"/next/api/ctx","h":"#redirect","p":562},{"i":666,"t":"Redirects to the specific route along with the parameters and with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. info If you want to send queries to route, you must add \"queries\" key typed as map[string]string to params. Signature func (c *Ctx) RedirectToRoute(routeName string, params fiber.Map, status ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { // /user/fiber return c.RedirectToRoute(\"user\", fiber.Map{ \"name\": \"fiber\" }) }) app.Get(\"/with-queries\", func(c *fiber.Ctx) error { // /user/fiber?data[0][name]=john&data[0][age]=10&test=doe return c.RedirectToRoute(\"user\", fiber.Map{ \"name\": \"fiber\", \"queries\": map[string]string{\"data[0][name]\": \"john\", \"data[0][age]\": \"10\", \"test\": \"doe\"}, }) }) app.Get(\"/user/:name\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"name\")) }).Name(\"user\")","s":"RedirectToRoute","u":"/next/api/ctx","h":"#redirecttoroute","p":562},{"i":668,"t":"Redirects back to refer URL. It redirects to fallback URL if refer header doesn't exists, with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. Signature func (c *Ctx) RedirectBack(fallback string, status ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Home page\") }) app.Get(\"/test\", func(c *fiber.Ctx) error { c.Set(\"Content-Type\", \"text/html\") return c.SendString(`Back`) }) app.Get(\"/back\", func(c *fiber.Ctx) error { return c.RedirectBack(\"/\") })","s":"RedirectBack","u":"/next/api/ctx","h":"#redirectback","p":562},{"i":670,"t":"Renders a view with data and sends a text/html response. By default Render uses the default Go Template engine. If you want to use another View engine, please take a look at our Template middleware. Signature func (c *Ctx) Render(name string, bind interface{}, layouts ...string) error","s":"Render","u":"/next/api/ctx","h":"#render","p":562},{"i":672,"t":"Request return the *fasthttp.Request pointer Signature func (c *Ctx) Request() *fasthttp.Request Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Request().Header.Method() // => []byte(\"GET\") })","s":"Request","u":"/next/api/ctx","h":"#request","p":562},{"i":674,"t":"This method is similar to BodyParser, but for request headers. It is important to use the struct tag \"reqHeader\". For example, if you want to parse a request header with a field called Pass, you would use a struct field of reqHeader:\"pass\". Signature func (c *Ctx) ReqHeaderParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `reqHeader:\"name\"` Pass string `reqHeader:\"pass\"` Products []string `reqHeader:\"products\"` } app.Get(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.ReqHeaderParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe log.Println(p.Products) // [shoe, hat] // ... }) // Run tests with the following curl command // curl \"http://localhost:3000/\" -H \"name: john\" -H \"pass: doe\" -H \"products: shoe,hat\"","s":"ReqHeaderParser","u":"/next/api/ctx","h":"#reqheaderparser","p":562},{"i":676,"t":"Response return the *fasthttp.Response pointer Signature func (c *Ctx) Response() *fasthttp.Response Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Response().BodyWriter().Write([]byte(\"Hello, World!\")) // => \"Hello, World!\" return nil })","s":"Response","u":"/next/api/ctx","h":"#response","p":562},{"i":678,"t":"Instead of executing the next method when calling Next, RestartRouting restarts execution from the first method that matches the current route. This may be helpful after overriding the path, i. e. an internal redirect. Note that handlers might be executed again which could result in an infinite loop. Signature func (c *Ctx) RestartRouting() error Example app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"From /new\") }) app.Get(\"/old\", func(c *fiber.Ctx) error { c.Path(\"/new\") return c.RestartRouting() })","s":"RestartRouting","u":"/next/api/ctx","h":"#restartrouting","p":562},{"i":680,"t":"Returns the matched Route struct. Signature func (c *Ctx) Route() *Route Example // http://localhost:8080/hello app.Get(\"/hello/:name\", func(c *fiber.Ctx) error { r := c.Route() fmt.Println(r.Method, r.Path, r.Params, r.Handlers) // GET /hello/:name handler [name] // ... }) caution Do not rely on c.Route() in middlewares before calling c.Next() - c.Route() returns the last executed route. Example func MyMiddleware() fiber.Handler { return func(c *fiber.Ctx) error { beforeNext := c.Route().Path // Will be '/' err := c.Next() afterNext := c.Route().Path // Will be '/hello/:name' return err } }","s":"Route","u":"/next/api/ctx","h":"#route","p":562},{"i":682,"t":"Method is used to save any multipart file to disk. Signature func (c *Ctx) SaveFile(fh *multipart.FileHeader, path string) error Example app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: if err := c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)); err != nil { return err } } return err } })","s":"SaveFile","u":"/next/api/ctx","h":"#savefile","p":562},{"i":684,"t":"Method is used to save any multipart file to an external storage system. Signature func (c *Ctx) SaveFileToStorage(fileheader *multipart.FileHeader, path string, storage Storage) error Example storage := memory.New() app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to storage: if err := c.SaveFileToStorage(file, fmt.Sprintf(\"./%s\", file.Filename), storage); err != nil { return err } } return err } })","s":"SaveFileToStorage","u":"/next/api/ctx","h":"#savefiletostorage","p":562},{"i":686,"t":"A boolean property that is true , if a TLS connection is established. Signature func (c *Ctx) Secure() bool Example // Secure() method is equivalent to: c.Protocol() == \"https\"","s":"Secure","u":"/next/api/ctx","h":"#secure","p":562},{"i":688,"t":"Sets the HTTP response body. Signature func (c *Ctx) Send(body []byte) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.Send([]byte(\"Hello, World!\")) // => \"Hello, World!\" }) Fiber also provides SendString and SendStream methods for raw inputs. tip Use this if you don't need type assertion, recommended for faster performance. Signature func (c *Ctx) SendString(body string) error func (c *Ctx) SendStream(stream io.Reader, size ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") // => \"Hello, World!\" return c.SendStream(bytes.NewReader([]byte(\"Hello, World!\"))) // => \"Hello, World!\" })","s":"Send","u":"/next/api/ctx","h":"#send","p":562},{"i":690,"t":"Transfers the file from the given path. Sets the Content-Type response HTTP header field based on the filenames extension. caution Method doesnΒ΄t use gzipping by default, set it to true to enable. Signature func (c *Ctx) SendFile(file string, compress ...bool) error Example app.Get(\"/not-found\", func(c *fiber.Ctx) error { return c.SendFile(\"./public/404.html\"); // Disable compression return c.SendFile(\"./static/index.html\", false); }) info If the file contains an url specific character you have to escape it before passing the file path into the sendFile function. Example app.Get(\"/file-with-url-chars\", func(c *fiber.Ctx) error { return c.SendFile(url.PathEscape(\"hash_sign_#.txt\")) })","s":"SendFile","u":"/next/api/ctx","h":"#sendfile","p":562},{"i":692,"t":"Sets the status code and the correct status message in the body, if the response body is empty. tip You can find all used status codes and messages here. Signature func (c *Ctx) SendStatus(status int) error Example app.Get(\"/not-found\", func(c *fiber.Ctx) error { return c.SendStatus(415) // => 415 \"Unsupported Media Type\" c.SendString(\"Hello, World!\") return c.SendStatus(415) // => 415 \"Hello, World!\" })","s":"SendStatus","u":"/next/api/ctx","h":"#sendstatus","p":562},{"i":694,"t":"Sets the response’s HTTP header field to the specified key, value. Signature func (c *Ctx) Set(key string, val string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Set(\"Content-Type\", \"text/plain\") // => \"Content-type: text/plain\" // ... })","s":"Set","u":"/next/api/ctx","h":"#set","p":562},{"i":696,"t":"Allow you to config BodyParser/QueryParser decoder, base on schema's options, providing possibility to add custom type for parsing. Signature func SetParserDecoder(parserConfig fiber.ParserConfig{ IgnoreUnknownKeys bool, ParserType []fiber.ParserType{ Customtype interface{}, Converter func(string) reflect.Value, }, ZeroEmpty bool, SetAliasTag string, }) Example type CustomTime time.Time // String() returns the time in string func (ct *CustomTime) String() string { t := time.Time(*ct).String() return t } // Register the converter for CustomTime type format as 2006-01-02 var timeConverter = func(value string) reflect.Value { fmt.Println(\"timeConverter\", value) if v, err := time.Parse(\"2006-01-02\", value); err == nil { return reflect.ValueOf(v) } return reflect.Value{} } customTime := fiber.ParserType{ Customtype: CustomTime{}, Converter: timeConverter, } // Add setting to the Decoder fiber.SetParserDecoder(fiber.ParserConfig{ IgnoreUnknownKeys: true, ParserType: []fiber.ParserType{customTime}, ZeroEmpty: true, }) // Example to use CustomType, you pause custom time format not in RFC3339 type Demo struct { Date CustomTime `form:\"date\" query:\"date\"` Title string `form:\"title\" query:\"title\"` Body string `form:\"body\" query:\"body\"` } app.Post(\"/body\", func(c *fiber.Ctx) error { var d Demo c.BodyParser(&d) fmt.Println(\"d.Date\", d.Date.String()) return c.JSON(d) }) app.Get(\"/query\", func(c *fiber.Ctx) error { var d Demo c.QueryParser(&d) fmt.Println(\"d.Date\", d.Date.String()) return c.JSON(d) }) // curl -X POST -F title=title -F body=body -F date=2021-10-20 http://localhost:3000/body // curl -X GET \"http://localhost:3000/query?title=title&body=body&date=2021-10-20\"","s":"SetParserDecoder","u":"/next/api/ctx","h":"#setparserdecoder","p":562},{"i":698,"t":"Sets the user specified implementation for context interface. Signature func (c *Ctx) SetUserContext(ctx context.Context) Example app.Get(\"/\", func(c *fiber.Ctx) error { ctx := context.Background() c.SetUserContext(ctx) // Here ctx could be any context implementation // ... })","s":"SetUserContext","u":"/next/api/ctx","h":"#setusercontext","p":562},{"i":700,"t":"https://expressjs.com/en/4x/api.html#req.stale Signature func (c *Ctx) Stale() bool","s":"Stale","u":"/next/api/ctx","h":"#stale","p":562},{"i":702,"t":"Sets the HTTP status for the response. info Method is a chainable. Signature func (c *Ctx) Status(status int) *Ctx Example app.Get(\"/fiber\", func(c *fiber.Ctx) error { c.Status(fiber.StatusOK) return nil } app.Get(\"/hello\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusBadRequest).SendString(\"Bad Request\") } app.Get(\"/world\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusNotFound).SendFile(\"./public/gopher.png\") })","s":"Status","u":"/next/api/ctx","h":"#status","p":562},{"i":704,"t":"Returns a string slice of subdomains in the domain name of the request. The application property subdomain offset, which defaults to 2, is used for determining the beginning of the subdomain segments. Signature func (c *Ctx) Subdomains(offset ...int) []string Example // Host: \"tobi.ferrets.example.com\" app.Get(\"/\", func(c *fiber.Ctx) error { c.Subdomains() // [\"ferrets\", \"tobi\"] c.Subdomains(1) // [\"tobi\"] // ... })","s":"Subdomains","u":"/next/api/ctx","h":"#subdomains","p":562},{"i":706,"t":"Sets the Content-Type HTTP header to the MIME type listed here specified by the file extension. Signature func (c *Ctx) Type(ext string, charset ...string) *Ctx Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Type(\".html\") // => \"text/html\" c.Type(\"html\") // => \"text/html\" c.Type(\"png\") // => \"image/png\" c.Type(\"json\", \"utf-8\") // => \"application/json; charset=utf-8\" // ... })","s":"Type","u":"/next/api/ctx","h":"#type","p":562},{"i":708,"t":"UserContext returns a context implementation that was set by user earlier or returns a non-nil, empty context, if it was not set earlier. Signature func (c *Ctx) UserContext() context.Context Example app.Get(\"/\", func(c *fiber.Ctx) error { ctx := c.UserContext() // ctx is context implementation set by user // ... })","s":"UserContext","u":"/next/api/ctx","h":"#usercontext","p":562},{"i":710,"t":"Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location. info Multiple fields are allowed. Signature func (c *Ctx) Vary(fields ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Vary(\"Origin\") // => Vary: Origin c.Vary(\"User-Agent\") // => Vary: Origin, User-Agent // No duplicates c.Vary(\"Origin\") // => Vary: Origin, User-Agent c.Vary(\"Accept-Encoding\", \"Accept\") // => Vary: Origin, User-Agent, Accept-Encoding, Accept // ... })","s":"Vary","u":"/next/api/ctx","h":"#vary","p":562},{"i":712,"t":"Write adopts the Writer interface Signature func (c *Ctx) Write(p []byte) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Write([]byte(\"Hello, World!\")) // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"Write","u":"/next/api/ctx","h":"#write","p":562},{"i":714,"t":"Writef adopts the string with variables Signature func (c *Ctx) Writef(f string, a ...interface{}) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { world := \"World!\" c.Writef(\"Hello, %s\", world) // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"Writef","u":"/next/api/ctx","h":"#writef","p":562},{"i":716,"t":"WriteString adopts the string Signature func (c *Ctx) WriteString(s string) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.WriteString(\"Hello, World!\") // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"WriteString","u":"/next/api/ctx","h":"#writestring","p":562},{"i":718,"t":"A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery). Signature func (c *Ctx) XHR() bool Example // X-Requested-With: XMLHttpRequest app.Get(\"/\", func(c *fiber.Ctx) error { c.XHR() // true // ... })","s":"XHR","u":"/next/api/ctx","h":"#xhr","p":562},{"i":720,"t":"Converts any interface or string to XML using the standard encoding/xml package. info XML also sets the content header to application/xml. Signature func (c *Ctx) XML(data interface{}) error Example type SomeStruct struct { XMLName xml.Name `xml:\"Fiber\"` Name string `xml:\"Name\"` Age uint8 `xml:\"Age\"` } app.Get(\"/\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ Name: \"Grame\", Age: 20, } return c.XML(data) // // Grame // 20 // })","s":"XML","u":"/next/api/ctx","h":"#xml","p":562}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/2",[0,5.72,1,3.184,2,4.307,3,0.895,4,3.862,5,5.041,6,3.766,7,1.515,8,2.272,9,6.309,10,6.309,11,3.958,12,4.81,13,2.871,14,5.331,15,5.331,16,4.81,17,6.309,18,2.042,19,4.452,20,3.474,21,4.81,22,6.309,23,6.309,24,4.81,25,5.72,26,5.041,27,4.81,28,4.307,29,4.81,30,3.614,31,6.309,32,5.331,33,4.452,34,4.617,35,6.309,36,6.309,37,6.309]],["t/4",[20,5.665,38,5.007,39,5.84,40,8.107,41,7.981,42,7.981,43,5.007,44,5.631,45,1.495,46,6.084,47,2.876]],["t/6",[3,0.736,7,0.794,8,0.814,30,2.972,45,1.475,48,2.809,49,1.086,50,1.217,51,5.115,52,1.408,53,3.308,54,2.998,55,5.188,56,1.397,57,2.521,58,3.308,59,4.016,60,3.667,61,2.781,62,2.42,63,1.697,64,3.308,65,2.42,66,2.998,67,2.334,68,2.025,69,3.308,70,3.661,71,0.51,72,5.188,73,0.937,74,0.539,75,4.669,76,3.284,77,3.918,78,5.188,79,1.857,80,6.402,81,2.075,82,3.308,83,3.179,84,3.919,85,2.795,86,4.384,87,3.308,88,0.624,89,3.308,90,3.308,91,3.308,92,3.308,93,3.308,94,4.384,95,3.308,96,1.57,97,1.134,98,3.308,99,1.134,100,2.795,101,2.795,102,2.521,103,3.308,104,3.308,105,0.552,106,3.308,107,2.998,108,0.913,109,1.669,110,2.998,111,3.308,112,2.998,113,2.998,114,2.075,115,1.18,116,1.485,117,2.258,118,2.025,119,2.258,120,2.998,121,2.998]],["t/8",[7,2.029,8,1.602,20,3.585,47,2.347,49,0.976,50,1.006,68,3.986,71,0.64,73,0.953,74,0.511,96,3.091,105,1.087,122,5.903,123,5.903,124,6.511,125,2.088,126,3.394,127,2.168,128,2.709,129,1.86,130,3.73,131,4.132,132,3.894,133,3.809,134,6.511,135,4.765,136,4.193,137,3.73,138,3.519,139,4.313]],["t/10",[1,1.755,7,0.835,8,0.855,18,1.746,48,1.169,49,1.208,50,1.151,56,2.005,59,2.182,61,1.228,63,1.784,73,1.249,74,0.553,88,0.656,99,2.266,105,1.244,129,0.993,130,3.09,131,3.232,138,3.572,140,3.139,141,2.778,142,2.182,143,5.395,144,1.846,145,3.152,146,2.453,147,2.778,148,3.206,149,1.915,150,2.139,151,4.559,152,3.302,153,3.948,154,2.034,155,1.915,156,2.722,157,2.97,158,3.152,159,2.545,160,1.35,161,2.938,162,0.55,163,3.477,164,3.948,165,2.08,166,2.938,167,1.675,168,2.778,169,1.915,170,2.545,171,1.992,172,2.524,173,3.477,174,3.477,175,3.152,176,3.477,177,1.228,178,3.477,179,3.477,180,4.559,181,2.97,182,3.477,183,2.938,184,3.477,185,3.152,186,3.152,187,2.778,188,3.477]],["t/12",[7,1.492,45,1.164,61,2.194,74,0.309,81,3.898,88,1.547,94,5.25,99,2.809,128,2.585,132,3.716,160,2.412,162,0.983,171,3.559,189,5.015,190,6.547,191,4.88,192,5.632,193,5.632,194,5.632,195,5.25,196,6.258,197,6.213,198,1.368,199,3.135,200,2.467,201,6.708,202,5.632,203,4.964,204,6.213,205,6.213,206,6.213]],["t/14",[1,4.757,5,7.533,8,2.319,11,4.864,20,5.191,116,3.481,117,5.292,118,4.746,119,5.292,207,5.91,208,7.752,209,7.752,210,7.752]],["t/17",[3,0.658,7,0.852,18,0.673,39,2.596,45,1.152,48,2.531,49,0.312,52,2.209,56,0.955,61,1.253,68,1.274,71,0.204,74,0.542,81,1.305,88,0.67,97,0.713,99,1.216,105,0.347,108,1.973,109,1.05,115,2.686,116,0.934,135,3.394,148,1.743,149,1.146,150,1.148,155,1.146,160,0.808,162,0.329,166,1.758,167,1.002,171,1.192,177,2.874,189,4.608,190,6.502,191,4.319,192,1.886,193,1.886,194,1.886,196,4.879,198,0.781,199,1.05,200,1.409,201,4.499,202,4.967,211,1.05,212,2.704,213,1.706,214,2.081,215,1.274,216,2.081,217,2.081,218,2.081,219,2.122,220,1.663,221,1.274,222,1.468,223,1.033,224,1.886,225,2.081,226,2.081,227,2.081,228,2.081,229,1.104,230,2.081,231,1.886,232,2.172,233,1.886,234,4.637,235,1.333,236,3.138,237,2.622,238,1.34,239,1.758,240,0.643,241,1.586,242,1.586,243,1.758,244,1.886,245,2.226,246,3.272,247,1.34,248,1.586,249,2.081,250,0.852,251,2.396,252,2.108,253,2.081,254,1.018,255,1.305,256,3.548,257,2.081,258,1.886,259,1.886,260,2.081,261,2.839,262,1.886,263,1.067,264,1.42,265,2.081,266,2.081,267,1.992,268,1.523,269,2.704,270,2.704,271,3.548,272,2.081,273,0.632,274,3.166,275,1.244,276,1.067,277,0.876,278,1.758,279,2.835,280,1.886,281,0.996,282,1.24,283,0.947,284,0.57,285,2.081,286,1.886]],["t/19",[1,2.124,3,0.597,4,2.576,7,2.501,18,1.739,45,0.788,48,0.857,49,1.177,50,1.214,56,1.857,61,3.698,71,0.902,73,1.15,74,0.518,88,1.697,97,0.874,105,1.24,109,1.287,125,0.818,140,1.977,148,1.582,149,1.404,150,2.018,152,2.576,153,1.866,154,1.492,155,2.317,157,3.799,162,0.666,170,3.08,181,1.404,215,5.622,219,3.213,250,0.613,273,0.774,287,2.517,288,3.363,289,2.155,290,2.155,291,2.155,292,2.155,293,2.155,294,2.155,295,2.155,296,2.155,297,2.155,298,1.461,299,2.155,300,2.155,301,1.689,302,1.866,303,2.155,304,2.155,305,3.556,306,2.155,307,2.155,308,1.866,309,1.944,310,2.038,311,2.155,312,2.155,313,1.088,314,1.741,315,4.57,316,3.556,317,3.363,318,1.561,319,2.155,320,1.944,321,2.038,322,2.155]],["t/21",[3,0.902,7,2.362,8,1.564,49,0.953,50,0.983,71,0.817,73,0.931,74,0.538,88,1.2,96,3.018,105,1.062,126,2.554,128,3.462,162,1.006,165,3.803,215,3.892,310,5.081,323,6.342,324,6.359,325,8.319,326,6.359,327,5.373,328,5.764,329,6.359,330,5.764,331,3.436]],["t/23",[3,0.759,4,3.277,7,2.312,71,0.728,74,0.537,88,1.011,116,2.404,126,2.151,127,1.783,128,3.816,148,2.785,162,0.847,169,2.948,229,2.842,323,6.99,332,8.497,333,3.006,334,6.47,335,4.524,336,4.854,337,6.261,338,7.409,339,5.354,340,5.354,341,5.354,342,5.354,343,5.354,344,5.354,345,5.354,346,5.354,347,5.354,348,2.842,349,3.778,350,5.354,351,5.354]],["t/25",[1,3.862,3,0.796,7,2.092,33,3.96,61,3.769,71,0.752,74,0.55,88,1.059,96,2.664,126,2.254,128,2.336,140,2.065,162,0.888,215,3.436,235,2.109,331,3.033,352,5.069,353,5.613,354,4.485,355,3.832,356,4.485,357,4.485,358,4.485,359,4.485,360,4.485,361,4.485,362,4.743,363,4.743,364,4.743,365,4.743,366,4.743,367,4.743]],["t/27",[3,0.861,7,2.177,71,0.793,74,0.525,88,1.524,99,2.082,126,2.44,128,2.527,140,2.235,162,0.961,200,3.6,215,4.941,219,3.632,237,2.59,331,3.282,368,7.317,369,6.074,370,6.074,371,6.074,372,5.506,373,6.074,374,6.074,375,5.506,376,6.074,377,6.074,378,6.074,379,6.074,380,6.074,381,6.074,382,6.074,383,6.074,384,3.168]],["t/29",[3,1.031,7,2.371,16,5.54,49,1.089,71,0.89,74,0.539,85,6.141,126,2.919,128,3.024,162,1.15,167,4.756,385,7.267,386,7.267,387,3.138]],["t/31",[7,2.431,38,3.546,49,0.847,71,0.859,73,1.279,167,3.704,247,3.64,263,2.899,267,3.173,388,7.924,389,5.652,390,8.74,391,7.924,392,4.308,393,5.124,394,7.69,395,6.167,396,6.498,397,4.776,398,3.306,399,4.516,400,5.652,401,5.652,402,3.237,403,5.652,404,5.652,405,3.64,406,5.652,407,4.516,408,5.652,409,5.652,410,4.776,411,5.652,412,5.652,413,5.652,414,3.988]],["t/33",[7,2.346,49,1.232,61,2.904,71,0.808,150,2.662,162,1.301,287,4.918,415,6.948,416,8.223,417,8.223]],["t/35",[3,0.695,7,1.946,49,1.044,50,0.758,61,2.861,71,0.684,73,0.717,74,0.569,77,2.649,105,0.819,126,1.969,128,2.04,132,2.932,140,1.804,148,3.045,150,2.855,152,3.001,162,0.776,215,3.001,281,1.376,287,2.932,418,3.076,419,5.097,420,1.925,421,4.902,422,4.902,423,2.172,424,2.649,425,4.444,426,4.902,427,6.965,428,4.74,429,5.097,430,3.347,431,3.917]],["t/37",[3,0.491,7,1.583,49,0.519,50,0.535,61,1.899,71,0.528,73,0.507,74,0.565,77,1.871,88,0.654,96,1.644,105,0.578,126,1.391,128,1.441,129,0.989,132,2.071,140,1.274,148,3.452,150,3.054,162,0.548,200,3.746,215,2.12,261,2.12,281,0.972,317,2.767,420,1.359,423,1.534,424,1.871,425,3.139,428,5.374,430,4.5,431,8.074,432,3.139,433,3.462,434,3.462,435,3.462,436,3.462,437,3.462,438,3.462,439,3.462,440,3.462,441,3.462,442,3.462,443,3.462,444,3.462,445,3.462,446,2.926,447,3.671,448,3.462,449,5.377,450,4.824,451,2.639,452,3.462,453,3.462]],["t/39",[3,0.836,7,2.145,49,0.884,50,0.912,61,2.083,71,0.777,73,0.863,74,0.554,77,3.187,88,1.113,105,0.985,126,2.369,128,2.454,129,1.684,132,3.527,140,2.912,148,2.216,150,2.562,162,0.933,200,3.143,261,3.61,281,1.656,420,2.316,423,2.613,424,3.187,428,3.45,431,4.712,446,4.983,454,4.983,455,5.897,456,5.897,457,5.897]],["t/41",[3,0.802,7,2.099,49,0.847,50,0.874,71,0.859,73,0.827,74,0.55,77,3.054,115,2.016,126,2.27,128,2.352,130,3.237,131,2.764,140,3.216,148,2.124,150,2.489,152,3.46,162,0.894,200,2.244,250,1.357,252,1.937,261,3.46,287,3.38,423,2.504,424,3.054,428,3.306,431,4.516,446,4.776,454,4.776,458,5.652,459,5.652,460,4.776,461,4.516,462,3.546,463,1.496,464,5.124,465,5.652]],["t/43",[7,2.471,48,2.683,49,1.196,71,0.784,74,0.477,162,1.263,198,2.351,466,4.236]],["t/45",[7,2.291,45,1.48,49,1.184,56,2.127,61,3.618,71,0.776,97,2.709,162,1.25,167,3.807,189,4.838,467,6.678,468,7.903]],["t/47",[3,1.04,7,2.188,18,2.374,56,1.974,71,0.72,73,1.073,74,0.453,88,1.384,97,2.514,162,1.16,189,4.489,398,5.33,469,4.038,470,5.174,471,7.333,472,4.857,473,7.333,474,7.333,475,4.723,476,7.333]],["t/49",[3,0.849,7,1.92,18,1.937,45,1.686,52,2.169,56,1.611,71,0.588,73,0.876,74,0.478,88,1.13,148,2.249,160,2.324,162,0.947,189,3.663,191,2.883,198,1.76,398,3.501,469,3.295,470,4.222,477,7.245,478,6.753,479,6.753,480,3.964,481,5.639,482,2.202,483,5.425,484,5.984,485,5.425,486,5.425,487,2.761,488,5.639,489,4.782,490,4.782,491,4.782,492,4.782]],["t/51",[3,0.954,7,2.072,45,1.616,52,2.342,71,0.661,73,0.984,74,0.5,88,1.27,160,2.612,162,1.064,198,1.9,398,3.935,481,4.746,483,6.098,487,3.104,488,6.088,489,5.375,490,5.375,491,6.894,492,7.611,493,6.727,494,6.727]],["t/53",[3,0.796,7,1.838,18,1.817,45,1.631,52,2.077,56,1.511,71,0.551,73,0.821,74,0.465,88,1.059,148,2.109,160,2.179,162,0.888,189,3.436,191,2.704,198,1.686,398,3.283,469,3.09,470,3.96,478,6.467,479,6.467,480,3.718,481,5.4,482,2.065,485,6.938,486,5.088,487,2.59,488,5.4,489,4.485,490,4.485,491,4.485,492,4.485,495,7.654,496,6.938,497,5.613,498,5.613,499,5.613,500,4.485,501,5.088,502,5.088,503,5.088,504,5.088]],["t/55",[3,0.807,7,1.856,18,1.842,45,1.643,52,2.097,56,1.532,71,0.559,73,0.833,74,0.468,88,1.074,148,2.139,160,2.21,162,0.9,189,3.484,191,2.742,198,1.702,398,3.329,469,3.134,470,4.016,478,4.809,479,4.809,480,3.77,481,5.452,482,2.094,487,2.626,488,5.452,489,4.547,490,4.547,491,6.173,492,7.009,496,5.159,501,5.159,502,5.159,503,5.159,504,7.952,505,7.726,506,5.691,507,5.691,508,5.691]],["t/57",[3,0.946,7,2.061,45,1.608,71,0.655,73,0.976,74,0.427,97,2.287,150,2.778,162,1.055,236,3.821,398,3.903,424,4.638,488,4.707,509,3.078,510,8.582,511,6.671,512,6.671,513,8.582,514,6.671,515,4.882,516,6.048,517,6.671,518,6.671,519,6.671,520,6.671,521,6.048,522,6.671]],["t/59",[3,0.634,7,1.566,44,3.155,45,0.838,49,0.67,50,0.691,52,1.214,71,0.439,73,0.954,74,0.547,77,2.416,79,2.51,96,3.094,97,2.235,105,0.747,129,1.277,130,2.561,131,3.188,138,2.416,140,2.399,142,2.805,150,2.49,162,0.707,191,2.154,229,2.373,268,3.272,273,1.979,275,2.674,277,1.883,281,1.255,384,4.013,387,1.931,405,4.198,424,3.523,509,2.063,523,4.471,524,3.778,525,3.573,526,4.471,527,4.471,528,4.471,529,4.471,530,5.209,531,4.471,532,6.519,533,4.471,534,5.508,535,4.471,536,6.519,537,3.573,538,4.471,539,4.471,540,4.053,541,4.471,542,4.053,543,4.471,544,4.053,545,2.332,546,4.471,547,4.471]],["t/61",[7,2.346,49,1.232,71,0.808,150,2.662,162,1.301,333,4.616,548,6.763]],["t/64",[4,3.69,18,2.923,56,1.623,71,1.013,74,0.3,88,1.947,144,5.589,150,2.6,162,0.954,463,2.731,549,2.743,550,6.029,551,4.293,552,6.029,553,6.029,554,6.029,555,6.029,556,6.029]],["t/66",[14,6.744,15,6.744,56,2.148,81,5.007,150,3.33,551,3.321,557,7.981,558,7.235,559,7.981,560,7.981,561,7.981,562,6.744]],["t/68",[74,0.555,199,3.572,281,1.987,537,5.655,545,3.692,558,6.416,563,5.455,564,3.266,565,7.078,566,7.078,567,7.078,568,7.078,569,4.439,570,7.078,571,5.981,572,7.078]],["t/70",[3,0.868,48,2.057,71,0.952,74,0.403,88,1.717,108,2.239,162,0.968,254,4.738,273,1.858,355,5.538,469,3.369,482,2.252,551,4.466,573,6.119,574,6.417,575,6.119,576,6.119,577,6.119,578,6.119,579,6.119,580,6.119,581,5.548,582,6.119,583,5.548]],["t/72",[3,0.764,33,3.803,48,1.812,71,0.903,74,0.48,88,1.609,99,1.847,155,2.967,162,0.853,254,4.497,273,2.589,298,4.264,301,3.57,355,6.588,469,2.967,482,2.739,551,4.337,574,6.091,581,4.886,583,4.886,584,4.109,585,5.39,586,5.39,587,5.39,588,5.39,589,5.39,590,5.39,591,5.39,592,5.39,593,8.527,594,4.886]],["t/74",[3,1.132,71,0.784,74,0.477,162,1.263,273,2.423,298,4.571,395,5.631,396,6.744,551,3.992,595,9.594,596,7.981]],["t/76",[3,1.059,48,2.511,71,0.905,74,0.458,88,1.41,108,2.061,162,1.181,254,3.652,273,2.268,551,4.46,597,7.468,598,3.768,599,7.468,600,7.468,601,7.468]],["t/78",[3,0.836,33,4.161,45,1.105,48,3.209,71,0.978,74,0.394,88,1.686,108,2.185,155,3.247,162,0.933,254,4.368,355,4.026,482,2.17,551,4.533,574,3.906,594,5.346,602,5.067,603,3.311,604,5.897,605,5.897,606,5.897,607,5.897,608,5.897,609,5.897,610,5.897]],["t/80",[3,1.069,48,2.534,63,4.753,71,0.91,74,0.461,88,1.423,108,2.08,162,1.192,254,3.686,273,2.289,551,4.356,611,7.537,612,7.537,613,7.537]],["t/82",[3,1.049,48,2.488,71,0.9,74,0.456,88,1.397,108,2.043,162,1.171,240,2.833,254,3.619,273,2.247,551,4.328,614,7.4,615,3.619,616,7.4,617,7.4,618,7.4]],["t/84",[3,1.079,71,0.915,74,0.463,88,1.436,108,2.1,162,1.203,254,3.72,273,2.31,475,6.002,551,4.37,619,7.607,620,7.607,621,7.607]],["t/86",[3,1.069,71,0.91,74,0.461,88,1.749,108,2.08,147,6.022,162,1.192,254,3.686,551,4.356,622,7.537,623,4.614,624,7.537,625,7.537,626,7.537]],["t/88",[3,1.004,18,2.291,45,1.326,71,0.875,74,0.443,88,1.336,108,1.954,147,5.655,162,1.12,254,3.461,551,4.26,627,6.416,628,5.981,629,7.793,630,6.416,631,5.981,632,7.078,633,7.078,634,7.078,635,5.981]],["t/90",[3,0.691,49,0.73,56,2.174,71,0.793,74,0.545,88,0.92,108,1.915,162,0.771,177,1.721,254,3.392,276,3.558,277,2.052,387,2.104,402,2.791,423,2.159,430,3.327,466,3.681,487,2.248,545,4.85,551,4.021,636,3.894,637,4.118,638,4.873,639,4.873,640,8.075,641,4.118,642,3.715,643,8.798,644,4.418,645,6.936,646,3.894,647,4.873,648,2.459,649,4.873,650,3.228,651,4.873,652,2.42,653,4.873,654,4.418,655,4.873,656,4.873,657,4.873]],["t/92",[3,1.069,56,2.029,71,0.74,74,0.461,108,2.08,115,2.689,162,1.192,240,2.33,273,2.289,313,3.214,551,3.856,615,3.686,658,5.421,659,4.508,660,5.145,661,7.537,662,7.537]],["t/94",[3,1.069,56,2.029,71,0.74,74,0.461,108,2.08,115,2.689,162,1.192,240,2.33,273,2.289,313,3.214,551,3.856,615,3.686,659,4.508,663,7.404,664,6.022,665,7.537,666,7.537]],["t/96",[3,0.836,30,3.378,34,4.316,56,2.13,65,4.316,71,0.579,74,0.521,108,1.628,162,0.933,199,2.976,240,1.823,273,1.791,281,1.656,545,3.076,551,3.293,603,5.589,615,2.884,635,4.983,659,4.733,667,4.983,668,4.712,669,4.983,670,8.654,671,4.983,672,4.316,673,3.7,674,7.175,675,4.712,676,4.983,677,5.897,678,5.346,679,5.897,680,5.346]],["t/98",[3,0.933,8,0.686,30,2.592,34,3.311,45,0.522,56,2.197,65,3.311,71,0.71,74,0.528,88,1.462,108,1.249,150,0.902,155,1.534,162,1.04,191,4.096,199,2.283,200,2.871,235,1.047,240,1.399,254,1.363,273,0.846,402,1.596,407,2.226,423,2.005,466,1.479,482,1.025,487,1.286,551,3.758,574,1.846,603,5.07,615,3.216,635,2.354,636,2.226,648,1.406,652,1.384,659,3.416,670,5.178,672,3.311,673,2.839,674,4.102,675,3.615,676,3.823,678,2.526,680,2.526,681,4.827,682,6.221,683,2.354,684,2.786,685,2.786,686,2.786,687,2.786,688,5.178,689,2.786,690,2.786,691,5.712,692,2.786,693,3.823,694,5.556,695,2.786,696,5.712,697,2.786,698,2.786,699,3.838,700,2.786,701,4.524,702,2.786,703,5.712,704,6.575,705,2.786,706,5.712,707,2.786,708,2.786,709,2.786,710,2.786,711,4.524,712,4.524,713,2.786,714,2.786,715,2.786]],["t/100",[3,1.079,56,2.048,71,0.747,74,0.463,162,1.203,213,2.799,236,4.357,524,6.428,551,3.878,716,6.896,717,4.111,718,5.368,719,7.607,720,6.428,721,7.607,722,6.896,723,7.607]],["t/102",[3,1.121,56,2.127,71,0.776,74,0.474,108,2.182,162,1.25,264,5.395,267,4.436,405,6.143,551,3.969,724,7.903,725,7.903]],["t/104",[3,1.04,34,5.366,45,1.707,56,1.974,71,0.72,74,0.453,162,1.16,165,4.386,236,4.2,334,5.174,551,4.314,675,5.859,726,9.111,727,6.648,728,7.333,729,6.648,730,7.333]],["t/106",[3,1.079,71,0.747,74,0.463,162,1.203,167,3.665,200,3.021,232,4.657,475,4.899,481,5.368,500,6.079,551,4.193,731,8.449,732,5.193,733,7.607,734,7.607]],["t/108",[3,0.987,71,0.683,74,0.533,96,3.302,108,1.92,162,1.101,198,1.941,424,3.76,480,5.838,481,6.22,482,2.56,488,6.22,516,6.307,521,6.307,551,3.668,735,6.307,736,6.957,737,6.957,738,6.957]],["t/110",[3,1.11,71,0.769,74,0.472,108,2.161,162,1.238,277,3.297,430,5.343,551,3.946,739,7.096,740,5.041,741,5.041,742,6.614,743,7.827,744,7.827]],["t/112",[3,1.121,71,0.776,74,0.474,97,2.709,108,2.182,162,1.25,551,3.969,658,4.623,745,6.678,746,5.235,747,7.903,748,7.164,749,7.903]],["t/114",[3,1.121,71,0.776,74,0.474,97,2.709,108,2.182,162,1.25,551,3.969,658,4.623,750,6.678,751,6.025,752,7.903,753,7.164,754,7.903]],["t/116",[3,1.11,49,1.173,56,2.854,71,0.769,74,0.507,162,1.238,165,4.681,537,6.254,551,3.946,755,7.827]],["t/118",[3,0.97,30,3.918,34,5.005,65,5.005,71,0.672,74,0.477,97,2.989,108,1.888,162,1.082,165,4.091,199,3.451,213,3.532,540,6.201,551,3.995,672,5.005,673,4.291,675,5.465,676,5.78,756,6.84,757,8.72,758,6.84,759,6.84,760,6.84]],["t/120",[3,1.022,29,5.491,71,0.708,74,0.489,97,2.469,108,1.988,162,1.14,195,6.087,213,2.65,254,3.523,545,3.758,551,3.749,615,3.523,761,10.302,762,6.087,763,3.523,764,5.491,765,7.203,766,7.203]],["t/122",[3,1.013,49,1.07,71,0.701,73,1.311,74,0.487,162,1.13,199,4.942,254,5.022,277,3.007,545,5.108,549,3.249,551,2.971,569,4.078,767,3.662,768,7.14]],["t/124",[3,1.04,49,1.099,71,0.72,73,1.333,74,0.493,88,1.957,162,1.16,199,4.598,277,3.089,545,4.753,549,3.337,551,3.051,569,3.337,767,3.761,769,7.333]],["t/126",[3,0.938,49,0.991,71,0.65,73,1.249,74,0.47,162,1.047,199,4.769,235,2.487,254,4.622,277,2.787,313,2.822,420,2.598,423,2.932,469,3.643,545,5.209,549,3.011,551,2.754,569,3.885,574,4.383,767,3.394,770,6.617,771,6.617,772,4.842,773,6.617]],["t/128",[3,0.978,16,5.258,45,1.292,49,1.033,52,1.872,71,0.678,73,1.01,74,0.521,99,2.364,162,1.091,232,4.222,252,2.364,537,5.512,551,3.648,732,4.709,774,6.898,775,6.253,776,6.898,777,6.898,778,6.898,779,6.898,780,6.898,781,6.898,782,6.898,783,6.253]],["t/130",[18,0.495,29,0.425,39,0.408,45,0.2,56,0.633,62,0.408,63,0.286,73,0.082,74,0.567,84,0.937,108,0.154,109,1.37,120,0.505,150,0.495,151,0.471,152,0.341,157,0.587,162,0.169,167,0.513,177,0.691,199,0.281,201,0.78,232,2.408,240,0.473,245,0.35,255,1.228,261,0.341,263,0.286,273,0.714,327,0.471,395,0.752,418,1.228,420,0.219,423,0.867,429,0.78,430,0.381,450,0.408,451,0.425,475,0.686,482,0.563,549,0.254,551,0.232,598,0.281,602,0.566,603,0.313,615,2.049,641,0.471,660,0.728,664,0.852,667,0.471,668,0.852,669,0.471,673,0.35,683,0.471,740,0.686,746,1.014,767,0.286,775,0.505,784,1.045,785,1.337,786,0.558,787,9.198,788,9.101,789,0.558,790,0.558,791,0.558,792,0.558,793,0.558,794,0.558,795,0.558,796,0.558,797,1.066,798,0.558,799,0.558,800,0.558,801,0.558,802,0.558,803,0.558,804,0.558,805,0.558,806,0.558,807,0.558,808,0.471,809,0.558,810,0.558,811,0.966,812,0.558,813,0.752,814,0.558,815,0.752,816,0.558,817,0.558,818,0.558,819,1.066,820,0.558,821,0.558,822,0.558,823,0.558,824,0.558,825,2.17,826,1.854,827,0.558,828,0.558,829,0.558,830,0.558,831,0.558,832,0.558,833,0.505,834,0.558,835,0.558,836,0.558,837,0.558,838,0.558,839,0.558,840,0.558,841,0.558,842,0.558,843,0.558,844,0.558,845,0.558,846,0.558,847,0.558,848,0.558,849,0.558,850,0.558,851,0.558,852,0.558,853,0.558,854,0.558,855,0.558,856,0.558,857,0.558,858,0.558,859,0.558,860,0.558,861,0.558,862,0.558,863,0.558,864,1.531,865,1.066,866,0.558,867,0.558,868,3.66,869,0.558,870,0.558,871,0.558,872,1.531,873,0.558,874,0.558,875,0.558,876,0.558,877,0.558,878,0.558,879,0.558,880,0.558,881,0.558,882,0.471,883,0.558,884,0.558,885,0.425,886,0.558,887,0.558,888,0.558,889,0.558,890,0.558,891,0.558,892,1.531,893,0.558,894,0.558,895,0.558,896,0.558,897,0.558,898,0.558,899,0.558,900,0.558,901,0.558,902,1.721,903,0.558,904,0.471,905,1.066,906,0.558,907,0.445,908,1.958,909,1.066,910,0.558,911,0.558,912,1.066,913,0.558,914,0.558,915,1.066,916,0.558,917,0.425,918,1.066,919,0.558,920,0.558,921,1.066,922,0.558,923,0.558,924,1.066,925,0.558,926,0.558,927,1.066,928,0.558,929,0.505,930,1.066,931,0.558,932,0.558,933,1.066,934,0.558,935,0.558,936,1.066,937,0.558,938,0.558,939,1.066,940,0.558,941,0.558,942,1.066,943,0.558,944,0.505,945,1.066,946,0.558,947,0.558,948,1.066,949,0.558,950,0.505,951,1.066,952,0.558,953,0.558,954,0.966,955,0.558,956,0.558,957,1.066,958,0.558,959,0.558,960,1.066,961,1.066,962,0.558,963,0.558,964,1.066,965,1.066,966,0.558,967,0.558,968,1.066,969,0.558,970,0.558,971,1.066,972,0.558,973,0.558,974,1.066,975,0.558,976,0.558,977,1.066,978,1.066,979,0.558,980,1.066,981,0.558,982,0.558,983,3.368,984,0.558,985,0.505,986,0.78,987,0.558,988,0.558,989,0.812,990,0.558,991,0.558,992,1.066,993,0.558,994,0.393,995,1.066,996,0.558,997,0.558,998,1.066,999,0.558,1000,0.558,1001,1.066,1002,0.558,1003,0.505,1004,1.066,1005,0.558,1006,0.558,1007,1.066,1008,0.558,1009,0.558,1010,1.066,1011,0.558,1012,0.558,1013,1.066,1014,1.066,1015,0.558,1016,0.558,1017,1.066,1018,0.558,1019,0.558,1020,1.066,1021,0.558,1022,0.558,1023,1.066,1024,1.066,1025,0.558,1026,0.558,1027,1.066,1028,0.558,1029,0.558,1030,0.558,1031,0.558,1032,0.558,1033,0.558,1034,0.558,1035,0.558,1036,0.558,1037,0.558,1038,0.558,1039,0.558,1040,0.558,1041,0.558,1042,0.558,1043,0.558,1044,0.558,1045,0.558,1046,0.558,1047,0.558,1048,0.558,1049,0.558,1050,0.558,1051,0.558,1052,0.558,1053,0.558,1054,0.558,1055,0.558,1056,0.558,1057,0.558,1058,0.558,1059,0.558,1060,0.558,1061,0.558,1062,0.558,1063,0.558,1064,0.558,1065,0.558,1066,0.558,1067,0.558,1068,0.558,1069,0.558,1070,0.558,1071,0.558,1072,0.558,1073,0.558,1074,0.558,1075,0.558,1076,0.558,1077,0.558,1078,0.558,1079,0.558,1080,0.558,1081,0.558,1082,0.558,1083,0.558,1084,0.558,1085,0.558,1086,0.558,1087,0.558,1088,0.558,1089,0.558,1090,0.558,1091,0.558,1092,0.558,1093,0.558,1094,0.558,1095,0.558,1096,0.558,1097,0.558,1098,0.558,1099,0.558,1100,0.558,1101,0.558,1102,0.558,1103,0.558,1104,0.558,1105,0.558,1106,0.558,1107,0.558,1108,0.558,1109,0.78,1110,0.558,1111,0.752,1112,0.752,1113,0.558,1114,0.558,1115,0.558,1116,0.558,1117,0.558,1118,0.505,1119,0.445,1120,0.558,1121,0.558,1122,0.558,1123,0.558,1124,0.505,1125,0.558,1126,2.775,1127,1.066,1128,0.558,1129,0.445,1130,0.558,1131,1.066,1132,0.558,1133,0.558,1134,0.445,1135,0.558,1136,0.333,1137,0.558,1138,0.558,1139,1.066,1140,0.558,1141,0.558,1142,0.425,1143,0.558,1144,0.558,1145,0.966,1146,0.558,1147,0.471,1148,0.558,1149,0.558,1150,0.558,1151,0.812,1152,0.558,1153,0.505,1154,0.558,1155,0.558,1156,0.505,1157,0.558,1158,0.558,1159,0.471,1160,0.558,1161,0.558,1162,0.966,1163,0.558,1164,0.558,1165,0.9,1166,0.558,1167,2.154,1168,0.558,1169,0.558,1170,2.113,1171,0.445,1172,0.558,1173,0.558,1174,0.558,1175,0.558,1176,0.393,1177,0.558,1178,0.558,1179,0.558,1180,0.558,1181,0.558,1182,0.637,1183,0.558,1184,3.09,1185,0.505,1186,0.852,1187,0.381,1188,3.053,1189,0.558,1190,0.558,1191,0.558,1192,0.558,1193,0.558,1194,0.471,1195,0.558,1196,0.558,1197,0.558,1198,0.505,1199,0.558,1200,0.812,1201,0.558,1202,0.558,1203,0.558,1204,0.558,1205,0.558,1206,0.558,1207,0.505,1208,0.558,1209,0.812,1210,0.558,1211,0.505,1212,0.558,1213,0.471,1214,0.558,1215,0.558,1216,0.558,1217,0.558,1218,0.558,1219,0.505,1220,0.558,1221,0.558,1222,0.558,1223,0.558,1224,0.558,1225,0.558,1226,0.558,1227,0.558,1228,1.08,1229,0.558,1230,1.293,1231,0.558,1232,0.408,1233,0.558,1234,0.505,1235,0.558,1236,0.425,1237,0.558,1238,1.066,1239,0.558,1240,0.558,1241,0.558,1242,0.558,1243,0.558,1244,1.066,1245,0.558,1246,0.558,1247,0.558,1248,0.558,1249,0.558,1250,0.558,1251,0.558,1252,0.558,1253,0.558,1254,0.471,1255,0.558,1256,0.505,1257,0.706,1258,0.558,1259,0.558,1260,0.558,1261,1.066,1262,0.558,1263,0.558,1264,0.558,1265,0.558,1266,0.558,1267,0.558,1268,0.558,1269,0.471,1270,0.558,1271,2.352,1272,2.352,1273,0.558,1274,0.445,1275,0.558,1276,0.558,1277,0.558,1278,0.471,1279,0.558,1280,0.558,1281,1.066,1282,0.558,1283,0.558,1284,0.558,1285,0.558,1286,0.558,1287,0.408,1288,0.558,1289,0.558,1290,0.471,1291,0.558,1292,0.408,1293,0.558,1294,0.558,1295,0.558,1296,0.558,1297,0.558,1298,0.471,1299,0.558,1300,0.558,1301,0.558,1302,0.558,1303,0.505,1304,0.505,1305,0.558,1306,0.558,1307,0.558,1308,0.558,1309,0.558,1310,0.558,1311,0.381,1312,0.558,1313,0.505,1314,0.445]],["t/133",[3,1.013,7,2.352,52,1.938,71,0.701,74,0.511,96,4.253,128,2.971,150,2.311,162,1.13,165,5.359,177,2.521,198,2.157,200,2.835,509,3.294,763,4.382,1315,3.603]],["t/135",[3,0.256,7,1.279,8,0.772,15,0.824,16,0.744,18,1.016,19,2.214,20,0.537,27,0.744,30,0.559,32,0.824,38,1.132,45,1.159,48,1.673,49,0.845,50,0.151,51,1.105,52,1.53,56,1.518,59,1.58,61,1.108,62,1.842,73,0.264,74,0.341,75,0.628,76,1.889,77,0.527,79,0.548,83,0.484,86,2.128,88,1.005,96,0.463,97,0.619,99,0.619,102,0.744,108,1.774,109,2.101,113,0.884,114,0.612,115,2.207,116,0.81,117,0.666,119,0.666,121,0.884,137,2.109,140,1.355,142,1.132,144,0.958,148,0.678,150,1.192,155,0.537,156,0.492,159,0.714,165,0.583,167,1.512,169,0.537,177,1.108,191,1.213,198,0.555,200,1.462,203,0.779,207,1.376,211,0.492,213,1.532,215,1.105,219,0.583,236,3.681,237,0.416,238,0.628,240,0.97,241,0.744,246,0.688,247,0.628,248,1.376,250,0.754,251,3.228,252,2.53,255,1.132,264,0.666,267,1.413,268,2.695,273,1.951,277,1.322,281,0.881,282,0.341,298,0.559,301,2.439,313,0.416,318,1.541,323,0.744,333,1.013,384,0.509,395,3.241,396,0.824,398,0.571,399,0.779,402,1.442,405,1.162,407,0.779,415,1.525,418,0.612,423,1.116,454,0.824,463,0.258,466,0.958,469,1.386,470,1.777,472,0.646,475,0.628,480,0.646,482,0.359,487,0.45,509,0.833,524,0.824,545,1.637,549,0.821,563,1.105,602,0.518,603,1.013,615,1.231,641,0.824,642,3.174,646,1.442,648,0.492,652,0.484,658,1.056,659,1.506,663,0.779,671,0.824,682,1.376,699,0.518,716,0.884,732,0.666,745,0.824,746,2.078,748,0.884,750,0.824,751,0.744,753,0.884,762,0.824,763,0.882,944,0.884,986,0.714,1111,1.777,1124,1.636,1126,0.646,1136,0.583,1142,2.392,1156,1.636,1167,2.598,1182,1.506,1184,2.293,1207,0.884,1209,0.744,1211,0.884,1213,1.525,1254,0.824,1287,0.714,1290,0.824,1316,2.845,1317,1.804,1318,1.804,1319,1.804,1320,1.804,1321,0.975,1322,0.779,1323,0.975,1324,0.975,1325,3.112,1326,0.975,1327,2.214,1328,0.975,1329,2.518,1330,4.593,1331,0.975,1332,3.138,1333,0.975,1334,1.442,1335,0.975,1336,0.975,1337,0.666,1338,2.439,1339,0.975,1340,0.975,1341,0.975,1342,0.975,1343,1.525,1344,0.666,1345,0.975,1346,0.975,1347,1.636,1348,1.376,1349,0.975,1350,0.975,1351,0.884,1352,0.975,1353,0.824,1354,0.975,1355,0.975,1356,0.975,1357,0.824,1358,0.975,1359,0.975,1360,0.884,1361,1.442,1362,1.056,1363,0.975,1364,1.442,1365,0.884,1366,0.975,1367,0.975,1368,0.779,1369,0.975,1370,3.241,1371,3.047,1372,0.824,1373,0.975,1374,0.975,1375,1.804,1376,0.884,1377,0.884,1378,1.804,1379,2.283,1380,0.779,1381,1.804,1382,2.845,1383,2.518,1384,2.128,1385,1.636,1386,2.283,1387,2.518,1388,0.975,1389,0.975,1390,0.628,1391,0.537,1392,1.525,1393,0.975,1394,1.668,1395,0.401,1396,0.975,1397,0.666,1398,0.824,1399,0.975,1400,0.824,1401,1.804,1402,0.824,1403,0.975,1404,1.636,1405,1.804,1406,1.804,1407,1.442,1408,2.283,1409,2.283,1410,1.919,1411,0.884,1412,0.884,1413,1.525,1414,0.975,1415,1.804,1416,1.804,1417,0.975,1418,1.804,1419,0.975,1420,0.975,1421,0.975,1422,1.636,1423,0.666,1424,2.598,1425,0.975,1426,0.884,1427,0.628,1428,0.884,1429,0.975,1430,0.975,1431,1.804,1432,0.688,1433,0.975,1434,0.714,1435,0.824,1436,0.975,1437,0.744,1438,1.636,1439,0.975,1440,0.975,1441,0.975,1442,0.824,1443,0.824,1444,0.779,1445,1.273,1446,0.884,1447,1.636,1448,1.636,1449,0.884,1450,0.824,1451,0.884,1452,1.804,1453,0.884,1454,1.804,1455,1.804,1456,0.975,1457,0.975,1458,0.824,1459,0.975,1460,1.804,1461,0.975,1462,0.975,1463,0.646,1464,0.975,1465,0.884,1466,0.975,1467,0.427,1468,0.975,1469,0.884,1470,0.666,1471,1.195,1472,0.884,1473,0.744,1474,2.296,1475,0.824,1476,1.919,1477,0.884,1478,1.525,1479,0.714,1480,0.646,1481,0.884,1482,1.442,1483,0.975,1484,0.975,1485,0.975,1486,0.975]],["t/137",[3,1.013,49,1.07,50,1.104,71,0.701,73,1.433,74,0.446,88,1.348,96,3.389,97,2.447,105,1.192,129,2.039,162,1.13,165,4.27,177,2.521,277,3.007,763,3.492,1337,6.685,1487,7.14,1488,7.14,1489,7.14,1490,7.14]],["t/139",[3,0.938,7,1.589,71,0.65,74,0.548,77,3.576,114,4.152,115,2.361,141,5.287,162,1.047,252,2.268,1316,8.568,1426,5.999,1427,6.431,1463,4.383,1491,8.537,1492,8.537,1493,5.999,1494,8.537,1495,5.999]],["t/141",[8,1.602,45,1.22,52,1.767,81,4.085,99,2.232,153,4.765,161,5.502,237,2.777,238,4.193,487,3.898,636,5.203,637,5.502,717,5.068,1361,5.203,1391,3.585,1479,4.765,1496,6.511,1497,5.903,1498,5.203,1499,6.511,1500,7.139,1501,4.964,1502,6.511,1503,5.903,1504,5.903,1505,5.903,1506,5.203,1507,6.511,1508,4.594,1509,4.313,1510,6.511,1511,6.511,1512,5.903]],["t/143",[74,0.514,785,5.502,1397,5.502,1513,7.306,1514,8.06,1515,8.06,1516,8.06,1517,8.06,1518,8.06,1519,8.06,1520,8.06]],["t/145",[8,1.788,74,0.514,240,2.801,313,4.21,487,3.353,717,3.928,1410,5.54,1521,8.213,1522,6.141,1523,5.128,1524,8.213,1525,5.128,1526,7.267,1527,9.06,1528,7.267]],["t/147",[45,0.815,48,2.149,52,1.181,102,4.872,118,2.664,131,2.128,133,2.546,138,2.352,150,2.069,200,1.728,222,3.07,248,4.872,328,3.945,348,2.31,391,3.945,393,3.945,482,2.351,648,2.196,652,2.161,717,4.093,1337,2.971,1344,2.971,1361,6.669,1397,5.171,1497,3.945,1500,5.4,1512,3.945,1529,4.352,1530,3.945,1531,4.352,1532,4.352,1533,4.352,1534,4.352,1535,4.352,1536,4.352,1537,5.794,1538,6.391,1539,6.391,1540,6.391,1541,4.352,1542,6.391,1543,4.352,1544,4.352,1545,4.509,1546,5.106,1547,4.352,1548,4.352,1549,2.803,1550,3.477,1551,3.317,1552,4.352,1553,5.774,1554,6.391,1555,4.352,1556,6.391,1557,4.352,1558,6.391,1559,4.352,1560,6.391,1561,6.391,1562,4.352,1563,6.391,1564,4.352,1565,4.352,1566,4.352,1567,4.352,1568,4.352,1569,4.352,1570,4.352,1571,4.352,1572,3.945]],["t/149",[45,1.727,52,1.473,74,0.519,97,1.86,99,1.86,100,4.585,102,4.136,108,1.498,127,2.49,170,3.97,229,2.88,235,2.039,240,1.677,420,2.13,424,2.932,487,2.503,650,4.953,717,4.984,1182,3.245,1361,4.335,1380,4.335,1479,6.261,1508,3.828,1509,3.594,1522,4.585,1525,6.037,1573,4.918,1574,6.779,1575,5.425,1576,5.425,1577,5.425,1578,4.335,1579,5.425,1580,5.425,1581,5.425,1582,5.425,1583,5.425,1584,5.425,1585,4.918,1586,5.425,1587,5.425,1588,5.425]],["t/151",[52,2.104,68,4.746,108,2.14,127,2.581,150,2.509,652,3.85,717,5.095,1343,6.551,1397,5.292,1509,5.135,1513,7.028,1525,5.47,1574,7.028,1589,7.752,1590,5.673,1591,7.752]],["t/153",[49,0.808,52,1.463,74,0.538,108,2.354,191,4.807,240,1.666,281,1.513,420,2.116,424,2.913,569,3.387,717,2.913,986,3.944,1509,6.392,1521,4.886,1525,6.016,1551,4.109,1585,4.886,1592,5.39,1593,7.73,1594,7.443,1595,5.39,1596,5.39,1597,5.39,1598,5.39,1599,7.443,1600,7.443,1601,7.443,1602,6.748,1603,5.39,1604,5.39,1605,5.39,1606,5.39]],["t/155",[45,1.48,49,1.184,59,5.984,74,0.393,108,2.182,150,2.558,160,3.069,165,4.727,223,3.925,288,6.315,1524,8.647,1607,7.903,1608,7.903]],["t/157",[8,2.044,56,2.236,61,3.47,784,5.671,1470,5.671,1473,6.332,1546,6.637,1609,8.307,1610,8.307]],["t/159",[7,1.269,8,1.3,50,1.135,73,0.773,74,0.516,162,0.836,200,2.098,252,1.811,313,2.253,414,3.729,467,6.205,530,5.867,1322,4.222,1395,4.386,1611,5.284,1612,5.284,1613,7.925,1614,5.284,1615,5.284,1616,8.381,1617,5.284,1618,5.284,1619,7.343,1620,5.284,1621,5.284,1622,5.284,1623,5.284,1624,5.284,1625,5.284,1626,4.465,1627,5.284,1628,5.284,1629,5.284,1630,5.284,1631,5.284,1632,5.284]],["t/162",[7,1.856,8,1.4,47,2.051,49,0.853,71,0.862,74,0.557,125,1.825,126,3.103,127,1.895,128,2.368,129,1.625,131,2.783,132,3.404,138,3.076,398,3.329,472,3.77,515,4.165,530,4.547,763,2.783,784,3.885,1395,3.177,1613,6.173,1616,6.529,1633,4.547,1634,4.339,1635,5.691,1636,5.691,1637,5.691,1638,5.691,1639,5.691,1640,5.691,1641,5.159,1642,4.547,1643,5.691]],["t/164",[7,1.92,8,1.472,18,1.937,47,2.157,49,0.897,71,0.785,74,0.555,125,1.919,126,3.21,127,1.993,128,2.49,132,3.579,250,1.92,398,3.501,472,3.964,515,4.379,530,4.782,717,3.234,763,2.927,784,4.085,1395,2.461,1613,6.386,1634,4.562,1641,5.425,1642,6.386,1644,5.984,1645,5.984,1646,5.984,1647,5.984,1648,5.984]],["t/166",[47,2.31,49,0.96,50,0.991,71,0.821,73,0.938,74,0.554,125,2.055,126,3.359,127,2.134,130,3.671,131,3.134,281,1.799,398,3.749,472,4.245,515,4.69,784,4.375,1395,3.438,1613,5.121,1616,5.415,1634,4.885,1649,6.409,1650,6.409,1651,6.409,1652,6.409,1653,5.415,1654,5.81]],["t/168",[7,1.629,47,2.444,49,1.016,50,1.048,71,0.852,73,0.993,74,0.545,125,2.175,126,3.484,127,2.259,128,2.822,130,3.885,131,3.317,398,3.968,472,4.492,515,4.963,784,4.63,1634,5.171,1653,5.731,1654,6.149,1655,6.149,1656,6.783,1657,6.149]],["t/170",[7,1.448,47,2.173,49,1.203,50,0.932,71,0.789,73,0.882,74,0.558,125,1.933,126,3.226,127,2.007,128,2.509,251,2.637,281,1.693,398,3.527,472,3.993,515,4.412,549,2.743,569,4.11,784,4.116,1634,4.596,1653,5.094,1655,5.465,1657,5.465,1658,6.029,1659,6.029,1660,6.029,1661,6.029,1662,6.029,1663,6.029]],["t/172",[8,1.854,18,2.44,61,2.662,76,3.866,97,2.584,213,2.773,250,1.81,282,2.635,487,3.477,630,8.401,648,3.803,907,6.022,1112,6.538,1171,7.404,1664,6.022,1665,6.022,1666,6.022]],["t/174",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/176",[6,2.092,7,1.104,8,1.637,13,2.092,45,0.861,47,1.657,49,1.283,50,0.711,73,0.673,74,0.557,88,0.868,97,1.576,105,0.768,115,2.373,125,1.474,127,2.215,160,1.785,181,4.304,198,1.465,242,3.505,250,1.104,251,2.011,252,1.576,447,5.336,487,2.121,509,3.606,564,2.121,598,4.323,1109,3.364,1467,2.011,1664,3.674,1667,2.151,1668,4.597,1669,6.652,1670,4.072,1671,7.086,1672,7.816,1673,2.581,1674,3.885,1675,4.597,1676,4.597,1677,4.597,1678,3.885,1679,4.597,1680,3.885,1681,4.597]],["t/178",[43,2.2,45,0.657,49,0.996,50,0.542,52,2.504,74,0.555,88,1.528,99,1.862,105,0.586,109,1.77,115,1.937,119,2.394,144,1.862,177,3.023,198,1.464,213,1.998,222,2.475,229,1.862,235,1.318,237,3.651,240,1.084,250,1.304,251,1.534,252,1.862,273,1.065,281,1.866,282,1.899,283,1.596,482,1.998,509,1.618,545,1.83,598,2.74,627,3.179,628,5.616,629,5.31,631,2.964,648,1.77,668,2.802,907,2.802,1109,3.974,1112,2.475,1136,2.098,1165,2.964,1171,5.979,1395,1.442,1423,3.708,1664,5.979,1670,3.324,1674,6.323,1678,2.964,1680,2.964,1682,3.507,1683,2.964,1684,3.179,1685,3.179,1686,2.394,1687,3.507,1688,2.964,1689,2.566,1690,3.507,1691,2.656,1692,3.507]],["t/180",[74,0.463,198,1.675,281,2.829,282,2.66,420,2.987,598,3.839,628,6.428,629,6.079,1109,5.567,1664,6.079,1670,4.657,1674,6.428,1678,6.428,1680,6.428,1685,6.896,1693,3.778]],["t/182",[8,1.966,21,4.562,24,6.092,45,1.121,49,0.897,56,1.611,96,2.841,213,3.311,232,4.892,240,1.85,245,6.784,250,2.161,259,5.425,545,3.122,615,2.927,767,3.07,1287,5.848,1473,4.562,1546,4.782,1665,4.782,1683,5.057,1691,2.927,1694,5.984,1695,4.562,1696,4.782,1697,5.057,1698,5.984,1699,5.057,1700,4.222,1701,7.992,1702,5.984]],["t/184",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/186",[6,2.104,7,1.111,8,1.643,13,2.104,45,0.866,47,1.666,49,1.287,50,1.328,52,1.255,73,0.677,74,0.549,88,0.873,97,2.29,105,1.434,115,2.383,125,1.483,127,2.224,129,1.321,160,1.795,198,1.471,250,1.111,252,1.585,263,3.426,267,2.596,270,3.525,282,1.617,424,2.499,482,1.701,564,3.082,1182,4.69,1467,2.022,1667,2.163,1673,2.596,1703,4.624,1704,4.624,1705,6.679,1706,4.624,1707,3.383,1708,3.157,1709,3.525,1710,3.907,1711,4.624,1712,4.624,1713,4.624,1714,4.624,1715,4.624,1716,4.624,1717,2.901,1718,3.907,1719,4.624,1720,4.624,1721,4.624]],["t/188",[18,0.911,28,1.922,45,0.855,48,0.946,49,0.862,50,0.705,52,2.565,61,0.994,74,0.557,83,1.398,88,1.249,97,1.564,99,0.965,105,0.762,108,0.777,109,2.903,115,1.628,140,1.036,144,1.494,150,1.862,160,1.093,164,3.339,177,2.567,198,1.457,213,2.117,223,1.398,235,1.058,236,1.613,237,1.946,240,0.87,245,5.142,250,1.746,251,1.995,252,1.972,254,1.377,263,3.729,267,2.561,273,1.747,276,2.34,281,1.281,282,2.011,283,1.281,387,1.216,450,2.06,482,2.434,545,1.469,740,1.813,763,1.377,764,2.146,767,1.444,1182,1.684,1184,1.55,1327,3.219,1344,1.922,1362,3.365,1427,1.813,1467,1.231,1665,2.25,1686,1.922,1691,3.555,1696,2.25,1708,1.922,1709,3.478,1710,2.379,1717,1.766,1718,2.379,1722,2.552,1723,4.136,1724,2.552,1725,2.815,1726,2.146,1727,2.146,1728,1.58,1729,2.146,1730,2.379,1731,2.552,1732,2.815,1733,2.815,1734,2.552,1735,2.815,1736,2.552,1737,2.146,1738,2.552,1739,2.552,1740,2.552,1741,2.379]],["t/190",[49,0.991,50,1.023,74,0.514,88,1.249,105,1.105,150,2.142,198,1.457,245,4.152,251,3.734,263,3.394,276,3.394,281,2.654,282,2.314,387,2.857,420,2.598,1184,3.643,1693,3.287,1708,4.517,1709,5.044,1710,5.592,1717,4.152,1718,5.592,1723,5.999,1728,3.715,1731,5.999,1738,5.999,1740,5.999,1741,5.592]],["t/192",[8,1.963,45,1.495,213,2.936,246,7.259,250,1.917,273,2.423,746,5.286,1126,5.286,1742,6.744,1743,7.981,1744,7.981,1745,6.744]],["t/194",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/196",[6,2.608,7,1.377,8,1.91,13,2.608,45,1.074,47,2.066,49,0.859,50,0.886,52,1.556,74,0.548,97,1.965,105,0.957,125,1.838,127,2.585,140,2.109,149,3.156,160,2.225,198,1.71,250,1.865,252,1.965,282,2.004,283,2.608,387,3.352,564,3.582,1397,5.3,1467,2.507,1667,2.682,1673,3.217,1696,4.579,1746,5.731,1747,5.731,1748,7.763,1749,7.763,1750,5.731]],["t/198",[49,0.877,50,0.905,52,2.138,74,0.553,99,2.007,105,0.978,115,2.089,141,4.678,177,2.781,198,1.96,235,2.2,237,3.359,240,1.81,246,4.131,250,1.892,252,2.007,276,3.003,277,2.466,281,1.644,282,2.754,283,2.664,387,3.401,1397,5.377,1751,5.855,1752,6.655,1753,5.308,1754,5.308,1755,5.308,1756,3.502]],["t/200",[74,0.492,198,1.848,281,2.356,282,2.934,420,3.295,1397,5.729,1693,4.168,1752,7.091]],["t/202",[74,0.553,246,5.418,276,3.939,387,4.048,785,5.243,1397,5.243,1752,6.489,1753,6.962,1754,6.962,1755,6.962,1756,4.593]],["t/204",[8,2.023,45,1.54,177,2.904,236,4.71,250,1.975,418,5.159,1186,6.57,1232,6.017,1523,5.802,1757,6.948,1758,6.948]],["t/206",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/208",[3,0.951,6,2.116,7,1.117,8,1.65,13,2.116,26,3.716,45,1.474,47,1.676,49,0.697,52,1.262,56,1.252,74,0.508,88,0.878,97,1.594,99,1.594,108,1.851,109,3.384,125,1.491,127,2.233,133,2.72,136,4.32,160,1.806,198,1.477,213,1.711,232,2.847,240,1.438,250,1.117,252,1.594,273,1.412,418,5.403,564,3.094,615,2.274,652,2.31,659,2.781,673,4.208,1126,4.442,1170,2.917,1236,3.545,1467,2.034,1667,2.176,1673,2.61,1757,5.667,1759,4.65,1760,6.707,1761,6.707,1762,5.667,1763,4.65,1764,4.65,1765,3.929,1766,5.667,1767,3.545,1768,4.216,1769,3.545,1770,3.403,1771,4.216,1772,4.216,1773,3.716,1774,4.216,1775,4.65]],["t/210",[45,1.374,48,2.638,49,0.693,50,0.443,52,2.332,56,2.389,74,0.555,77,1.548,83,1.423,88,1.385,99,1.586,105,0.478,108,1.277,109,2.938,115,2.077,144,1.521,150,0.927,177,3.034,198,1.282,213,2.699,220,3.697,232,1.754,235,1.077,237,3.52,240,0.886,245,1.797,250,1.111,251,1.253,252,1.995,273,2.029,274,3.159,275,1.713,276,1.47,277,1.207,281,1.299,282,1.618,283,1.304,418,4.193,652,1.423,673,1.797,732,3.159,1170,4.193,1171,3.697,1176,2.021,1232,3.386,1236,2.184,1338,3.856,1545,2.021,1667,1.341,1686,3.974,1757,2.421,1762,4.919,1765,3.91,1766,3.91,1768,2.597,1769,2.184,1770,2.096,1771,2.597,1772,2.597,1773,2.289,1774,2.597,1776,4.195,1777,6.683,1778,2.865,1779,4.195,1780,2.865,1781,2.421,1782,4.195,1783,2.865]],["t/212",[74,0.542,198,1.532,251,3.043,274,4.749,276,3.568,281,2.475,282,2.432,420,2.731,1693,3.455,1741,5.878,1762,5.878,1765,5.878,1766,5.878,1776,6.307,1779,6.307,1782,6.307,1784,6.957,1785,6.307,1786,6.957,1787,6.957,1788,6.957,1789,6.957]],["t/214",[3,0.667,8,1.157,28,3.211,45,1.267,48,1.581,49,0.705,52,1.277,56,2.131,68,4.14,73,0.688,88,0.888,97,1.612,108,2.186,125,1.508,137,3.874,144,2.497,177,1.661,198,1.489,237,2.006,238,3.029,250,2.079,263,2.413,313,2.006,318,2.879,423,2.084,430,3.211,451,3.586,487,2.17,509,2.17,602,4.595,652,2.336,673,2.951,763,2.3,1119,3.759,1136,2.813,1186,3.759,1254,3.975,1362,3.956,1432,3.319,1523,3.319,1590,3.442,1666,3.759,1684,4.264,1728,2.641,1790,6.988,1791,4.704,1792,6.517,1793,4.264,1794,4.264,1795,4.704,1796,4.704,1797,3.319,1798,4.704,1799,3.442,1800,4.949,1801,5.404,1802,3.442]],["t/216",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/218",[6,2.554,7,1.348,8,1.883,13,2.554,45,1.051,47,2.023,50,0.868,52,1.523,73,0.821,74,0.531,88,1.059,97,1.924,105,0.937,108,1.549,125,1.8,127,2.549,160,2.179,198,1.686,250,1.348,263,2.879,387,2.424,564,3.531,652,2.788,1467,2.455,1667,2.626,1673,3.151,1717,3.521,1773,4.485,1790,4.107,1792,3.718,1800,4.107,1803,5.613,1804,5.613,1805,4.743,1806,4.929,1807,5.088,1808,4.279,1809,4.485,1810,4.107,1811,3.96,1812,4.279,1813,6.467,1814,4.279]],["t/220",[18,0.791,45,0.976,48,2.591,49,0.609,50,0.628,52,2.508,56,1.093,59,3.27,71,0.24,73,0.358,74,0.558,88,1.581,96,2.474,99,0.838,105,0.678,108,1.439,115,1.449,148,0.918,177,3.263,198,1.148,200,0.97,235,0.918,237,1.732,240,0.755,250,1.252,251,1.776,252,2.081,263,3.115,264,1.668,267,1.372,281,0.686,282,1.42,283,1.112,387,1.055,402,1.399,482,1.494,602,4.284,603,1.372,732,1.668,763,1.195,1151,1.863,1187,1.668,1228,1.724,1362,1.429,1467,1.069,1686,3.558,1691,3.296,1717,2.548,1727,1.863,1728,1.372,1729,1.863,1767,1.863,1773,1.952,1790,6.321,1792,5.105,1799,1.788,1800,1.788,1806,3.911,1807,2.215,1808,1.863,1809,1.952,1810,1.788,1811,1.724,1812,1.863,1813,6.145,1814,3.096,1815,2.443,1816,2.065,1817,2.065,1818,2.065,1819,2.215,1820,2.215,1821,2.065,1822,2.972,1823,2.215,1824,2.215,1825,2.215,1826,2.065,1827,1.952,1828,2.215,1829,2.215,1830,2.215,1831,2.065,1832,2.065,1833,1.668,1834,2.443,1835,2.616]],["t/222",[74,0.516,198,1.615,263,3.761,273,2.227,387,3.166,420,2.879,1394,4.857,1400,6.196,1693,3.642,1717,4.601,1800,5.366,1806,4.723,1808,5.59,1809,5.859,1810,5.366,1811,5.174,1812,5.59,1813,6.196,1836,6.648,1837,7.333]],["t/224",[74,0.525,785,5.789,1184,4.669,1790,6.205,1792,5.617,1836,7.687]],["t/226",[45,1.51,74,0.514,125,2.585,1728,6.146,1805,6.81,1838,6.81,1839,6.81]],["t/228",[2,2.608,8,0.94,18,2.268,24,2.912,26,3.052,38,2.397,44,2.695,45,0.716,52,1.037,56,2.614,61,1.349,63,1.96,74,0.288,79,2.144,83,2.88,109,2.926,142,2.397,144,3.72,150,1.877,156,1.928,160,1.483,167,2.793,170,2.795,177,2.475,198,1.277,232,2.338,236,3.321,250,1.683,273,1.16,276,2.974,298,2.188,309,2.912,318,3.55,349,2.695,387,1.65,402,4.014,423,4.077,430,2.608,451,2.912,480,4.642,659,2.285,787,3.463,826,2.608,1111,2.695,1134,7.076,1145,3.463,1236,2.912,1376,3.463,1379,3.463,1382,3.463,1392,3.228,1402,3.228,1437,2.912,1444,3.052,1498,3.052,1590,4.243,1727,2.912,1758,3.228,1840,3.82,1841,7.008,1842,3.82,1843,3.82,1844,3.82,1845,3.82,1846,3.82,1847,3.228,1848,3.82,1849,3.228,1850,3.228,1851,3.82,1852,3.82,1853,3.82,1854,3.82,1855,3.82,1856,3.82,1857,3.463,1858,3.82,1859,3.82,1860,3.82,1861,3.82,1862,3.82,1863,3.228]],["t/230",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/232",[6,3.061,7,1.616,8,2.123,13,3.061,45,1.26,47,2.424,52,1.826,73,0.984,74,0.538,97,2.306,125,2.157,127,2.873,160,2.612,198,1.9,250,1.616,564,3.981,1467,2.942,1667,3.147,1673,3.776,1864,6.727,1865,6.727,1866,6.727,1867,5.684]],["t/234",[18,1.455,49,1.27,50,1.193,52,2.301,56,2.677,73,1.13,74,0.538,99,2.645,105,1.289,109,3.303,115,1.604,119,3.069,150,1.455,177,2.994,198,1.7,235,1.69,237,2.791,240,1.39,250,1.572,252,2.645,273,1.365,281,1.262,282,2.288,283,2.046,387,1.941,423,3.756,460,3.799,732,4.468,1134,6.773,1390,2.895,1402,6.521,1590,3.29,1863,5.531,1867,3.799,1868,5.933,1869,4.496]],["t/236",[49,1.35,50,1.393,73,1.054,74,0.546,105,1.504,198,1.586,252,3.089,420,2.828,1693,3.578,1863,6.087,1867,6.087,1868,6.53,1870,7.203,1871,6.53,1872,6.53]],["t/238",[74,0.538,387,3.587,423,3.68,785,5.671,1134,6.637,1871,7.53,1873,8.307]],["t/240",[8,2.023,48,2.764,200,3.265,250,2.346,602,5.184,652,4.084,1874,8.805]],["t/242",[49,1.162,71,0.926,74,0.469,88,1.78,198,1.707,250,1.862,1315,3.912,1368,6.194,1395,3.188,1471,5.135,1545,5.47,1875,7.752,1876,6.551,1877,7.752]],["t/244",[6,1.959,7,1.034,8,1.56,13,1.959,45,1.188,47,1.552,48,2.132,49,0.95,50,0.98,62,3.151,73,0.928,74,0.541,83,3.149,88,1.197,96,3.573,105,1.059,108,1.188,125,1.381,127,2.111,129,1.23,133,3.709,152,2.636,160,1.672,175,3.903,198,0.948,200,1.71,207,3.282,242,3.282,250,1.034,281,1.209,384,2.246,462,2.701,466,2.285,482,3.257,487,1.986,542,3.903,564,1.986,602,3.366,648,2.173,763,2.106,1368,5.067,1437,4.834,1467,1.883,1471,4.2,1667,2.015,1756,2.575,1770,3.151,1874,6.36,1876,5.358,1878,4.305,1879,5.358,1880,3.903,1881,3.903,1882,3.903,1883,5.748,1884,3.903,1885,3.903,1886,4.305,1887,3.903]],["t/246",[43,2.659,45,0.794,49,0.635,50,0.655,52,2.237,73,0.917,74,0.548,88,1.738,97,2.148,99,2.557,105,0.708,115,1.512,133,2.479,177,2.91,198,1.643,235,1.593,237,2.673,240,1.31,250,1.505,252,1.453,254,2.073,281,1.19,282,2.191,283,1.929,423,1.878,482,3.505,602,4.374,603,2.379,746,4.94,751,3.231,763,2.073,1362,2.479,1368,5.008,1697,3.581,1800,3.101,1874,5.296,1876,3.581,1880,3.842,1881,3.842,1882,6.761,1883,3.842,1888,3.842,1889,3.386,1890,3.581,1891,3.842,1892,4.238,1893,4.238,1894,3.842,1895,3.842,1896,4.238]],["t/248",[74,0.509,198,1.741,281,2.219,282,2.763,420,3.103,482,2.908,1693,3.925,1889,6.315,1890,6.678,1891,7.164,1894,7.164,1895,7.164,1897,7.903]],["t/250",[3,0.895,45,1.182,74,0.459,88,1.191,97,2.163,115,2.251,198,1.39,200,2.505,247,4.063,250,1.515,283,2.871,482,2.321,602,4.903,1348,4.81,1351,5.72,1471,4.179,1500,5.331,1756,3.773,1790,6.056,1800,4.617,1805,5.331,1806,4.063,1808,4.81,1826,5.331,1879,5.331,1884,5.72,1885,5.72,1889,6.613,1890,5.331,1898,5.72,1899,5.72,1900,5.72,1901,6.309,1902,6.309,1903,6.309]],["t/252",[8,2.065,45,1.572,75,5.405,177,2.964,250,2.016,1176,5.921,1434,6.141,1523,5.921,1904,7.608]],["t/254",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/256",[6,2.723,7,1.437,8,1.966,13,2.723,45,1.497,47,2.157,52,1.624,74,0.531,79,3.359,97,2.051,125,1.919,127,2.661,148,2.249,160,2.324,198,1.76,250,1.92,487,2.761,564,3.687,652,2.972,1467,2.617,1667,2.8,1673,3.359,1904,5.425,1905,5.984,1906,7.992,1907,7.992,1908,5.984,1909,5.425,1910,5.984,1911,5.984,1912,5.984,1913,5.425,1914,5.984]],["t/258",[18,2.635,74,0.534,213,2.995,420,3.196,1915,8.14,1916,8.14,1917,8.14,1918,8.14,1919,8.14]],["t/260",[74,0.526,75,5.771,198,2.157,223,4.45,235,2.683,237,3.045,240,2.207,250,1.715,1434,6.557,1670,5.485,1909,8.123,1913,8.123,1920,8.123]],["t/262",[198,2.015]],["t/264",[6,3.528,8,1.907,67,5.47,79,4.352,116,3.481,167,3.735,213,2.852,245,4.864,250,1.862,615,3.791,1136,4.636,1142,5.91,1453,7.028,1506,6.194,1921,7.752,1922,7.752,1923,7.752]],["t/266",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/268",[6,2.421,7,1.278,8,1.815,13,2.421,45,0.996,47,1.917,49,1.105,50,1.14,52,1.444,73,1.08,74,0.545,97,1.823,105,1.232,115,1.897,125,1.706,127,2.456,129,2.107,130,4.225,131,3.607,160,2.065,198,1.624,213,2.714,250,1.278,273,2.24,564,3.403,1142,5.623,1364,4.25,1467,2.326,1667,2.489,1673,2.986,1924,5.319,1925,5.319,1926,6.687,1927,5.319,1928,7.376,1929,5.319,1930,5.319]],["t/270",[45,1.478,48,1.572,49,0.701,50,0.723,52,1.269,56,1.813,74,0.538,76,3.454,99,1.603,105,0.781,115,1.668,177,1.652,198,1.738,235,1.758,237,2.872,240,1.446,245,4.225,250,1.618,252,2.309,254,3.86,255,4.225,281,1.313,282,2.355,283,2.128,301,3.098,337,3.952,1142,6.582,1232,3.422,1362,3.94,1364,7.615,1365,6.105,1506,3.737,1686,3.193,1700,3.3,1737,5.134,1931,4.677,1932,4.677,1933,4.677,1934,6.105,1935,4.677,1936,4.24,1937,4.677,1938,4.677,1939,4.677,1940,3.952,1941,3.737,1942,4.677]],["t/272",[74,0.492,198,1.848,251,3.67,281,2.356,282,2.934,420,3.295,1364,6.706,1693,4.168]],["t/274",[8,1.804,18,2.949,61,2.59,125,2.352,127,2.442,148,2.756,167,3.533,189,4.489,250,1.761,287,4.386,658,4.29,673,4.601,1176,5.174,1391,4.038,1549,4.723,1726,5.59,1847,6.196,1943,6.648,1944,6.648,1945,7.333,1946,6.196,1947,6.648]],["t/276",[71,0.879,763,4.375,1395,3.678]],["t/278",[6,2.258,7,1.192,8,1.728,13,2.258,45,1.316,47,1.788,49,0.743,50,0.767,73,0.726,74,0.524,75,3.196,105,0.829,125,1.591,127,2.339,129,1.417,137,2.842,138,2.682,148,1.865,160,1.927,250,1.192,276,2.545,387,3.522,420,2.758,461,3.965,564,2.289,623,3.038,742,7.91,772,3.631,1176,3.501,1467,2.17,1667,2.322,1943,6.369,1947,4.498,1948,4.962,1949,4.962,1950,4.962,1951,4.962,1952,4.962,1953,4.962,1954,4.962,1955,4.962,1956,4.962,1957,4.672,1958,4.962,1959,4.962,1960,7.026,1961,7.026,1962,4.962,1963,4.962,1964,4.962,1965,4.962,1966,4.962]],["t/280",[49,1.06,50,1.094,52,1.921,74,0.536,99,2.426,105,1.182,115,2.525,177,2.5,198,2.148,235,2.66,237,3.8,240,2.188,250,2.14,252,2.426,281,1.987,282,3.116,283,3.221]],["t/282",[74,0.498,198,1.887,281,2.406,282,2.996,420,3.365,1693,4.256]],["t/284",[8,1.552,28,4.307,30,3.614,45,1.182,52,1.713,56,2.486,97,2.163,189,3.862,245,3.958,250,2.355,283,2.871,402,3.614,487,2.911,549,2.871,551,2.625,598,3.184,652,3.134,717,3.41,1170,3.958,1348,4.81,1458,5.331,1504,5.72,1525,4.452,1814,4.81,1967,8.889,1968,6.309,1969,5.331,1970,6.994,1971,6.309,1972,6.309,1973,6.309,1974,6.309]],["t/286",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/288",[6,3.061,7,1.616,8,2.123,13,3.061,45,1.26,47,2.424,52,1.826,74,0.517,97,2.306,125,2.157,127,2.873,160,2.612,191,3.24,198,1.9,250,1.616,549,3.061,564,3.981,1467,2.942,1667,3.147,1673,3.776,1970,7.29,1975,6.727,1976,6.727,1977,6.727]],["t/290",[3,0.656,49,0.693,50,0.715,52,2.473,61,1.633,74,0.554,88,1.48,99,1.585,105,0.772,107,4.192,108,1.276,115,1.649,122,4.192,148,1.738,177,3.353,191,3.218,198,1.727,201,3.383,213,1.701,220,3.694,232,2.83,235,1.738,237,3.344,240,1.429,245,4.191,250,1.604,252,1.585,273,1.404,281,1.875,282,2.335,283,2.104,549,3.04,740,2.978,1413,3.907,1505,4.192,1709,5.092,1967,7.109,1970,3.907,1978,4.192,1979,7.258,1980,4.192,1981,4.192]],["t/292",[74,0.509,191,3.807,198,1.741,201,5.783,281,2.219,282,2.763,420,3.103,549,3.596,740,5.09,1693,3.925,1709,6.025,1981,7.164,1982,7.903]],["t/294",[8,1.726,48,2.359,60,4.019,74,0.441,83,3.485,108,1.937,115,2.503,148,3.331,177,2.478,189,4.295,191,3.38,196,4.79,219,4.196,236,4.019,250,1.685,318,4.295,348,3.724,428,4.105,549,3.193,746,4.648,1391,3.863,1437,5.349,1469,6.361,1979,5.929,1983,7.017,1984,7.017]],["t/296",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/298",[6,2.537,7,1.339,8,1.874,13,2.537,20,4.778,45,1.626,47,2.009,74,0.501,97,1.911,115,1.989,125,1.788,127,2.537,135,4.079,160,2.164,171,4.363,198,1.678,212,4.249,242,4.249,250,1.339,261,3.412,274,3.805,286,5.053,318,3.412,334,3.933,487,2.572,564,2.572,672,4.079,1338,3.692,1434,4.079,1467,2.438,1667,2.608,1673,3.129,1985,3.933,1986,7.618,1987,7.618,1988,5.053,1989,5.574,1990,4.71,1991,5.053,1992,3.069,1993,5.574,1994,5.053,1995,5.574]],["t/300",[7,1.177,20,2.699,47,1.767,71,0.482,74,0.533,102,3.737,115,1.749,125,1.572,126,2.798,127,1.632,128,2.04,135,3.587,150,1.587,171,3.99,190,6.474,191,3.903,196,4.755,212,3.737,302,3.587,331,2.649,392,3.737,420,2.735,549,3.17,673,4.37,717,2.649,784,3.347,1170,4.37,1551,3.737,1802,3.587,1985,3.459,1990,4.142,1991,8.448,1994,4.444,1996,4.902,1997,4.902,1998,4.444,1999,4.902,2000,6.965,2001,6.314,2002,4.902,2003,5.097,2004,4.902,2005,4.902,2006,4.902,2007,5.886,2008,4.902,2009,4.902,2010,4.902]],["t/302",[7,1.777,47,2.667,71,0.727,74,0.542,125,2.373,126,3.68,127,2.464,128,3.079,171,4.239,331,3.999,1985,5.221,2003,5.415,2011,7.4,2012,7.4,2013,5.913,2014,7.4]],["t/304",[7,1.746,47,2.619,71,0.714,74,0.539,125,2.331,126,3.639,127,2.42,128,3.024,171,4.163,239,6.141,331,3.928,1985,5.128,2003,5.318,2013,5.807,2015,7.267,2016,7.267,2017,7.267,2018,7.267]],["t/306",[7,1.777,47,2.667,71,0.727,74,0.542,125,2.373,126,3.68,127,2.464,128,3.079,171,4.239,331,3.999,1985,5.221,2003,5.415,2013,5.913,2019,7.4,2020,7.4,2021,7.4]],["t/308",[7,1.761,20,4.038,47,2.643,71,0.72,74,0.54,125,2.352,126,3.66,127,2.442,128,3.051,171,4.2,331,3.963,1985,5.174,2003,5.366,2013,5.859,2022,7.333,2023,7.333,2024,7.333]],["t/310",[7,1.481,20,3.395,45,1.155,47,2.222,71,0.606,74,0.55,99,2.114,125,1.977,126,3.274,127,2.053,128,2.566,171,3.532,281,1.731,287,3.688,302,4.512,331,3.332,423,2.732,424,3.332,569,3.71,571,5.21,1985,4.35,2003,4.512,2025,6.166,2026,6.166,2027,6.166,2028,6.166,2029,6.166,2030,6.166,2031,6.166,2032,8.152,2033,6.166]],["t/312",[18,1.723,20,1.882,43,2.145,45,1.225,48,2.198,49,0.798,50,0.528,52,2.483,74,0.56,88,1.393,99,1.172,105,0.571,108,1.47,115,1.22,135,3.896,148,1.285,171,3.05,177,3.124,189,2.093,191,4.081,196,4.464,198,1.44,212,2.606,213,1.959,219,2.045,232,2.093,235,1.285,236,1.958,237,3.147,240,1.646,245,2.145,250,1.279,251,1.495,252,1.825,258,3.099,261,3.259,262,3.099,273,1.617,274,3.635,275,2.045,276,1.754,277,1.44,278,2.889,281,1.495,282,1.861,283,1.556,466,1.815,487,1.577,584,2.606,615,1.672,658,2,1170,2.145,1979,4.499,1980,3.099,1988,3.099,1990,2.889,2001,3.099,2007,4.499,2034,3.419,2035,3.419,2036,3.419,2037,2.264,2038,3.419,2039,3.419,2040,3.099,2041,3.419]],["t/314",[74,0.522,135,5.567,171,4.357,198,1.675,212,5.799,251,3.327,261,4.657,274,5.193,276,3.902,281,2.617,282,2.66,420,2.987,1693,3.778,2007,6.428,2040,6.896]],["t/316",[7,2.016,18,2.716,108,2.317,250,2.016,273,2.548,1228,5.921,1523,5.921,2042,8.392,2043,7.091]],["t/318",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/320",[7,1.7,47,2.551,49,1.06,50,1.094,71,0.695,73,1.036,74,0.544,105,1.182,125,2.27,126,3.579,127,2.357,128,2.945,129,2.021,132,4.233,136,4.558,384,3.692,1957,4.054,2044,7.078,2045,7.078,2046,5.981]],["t/322",[39,2.025,43,1.736,48,3.41,52,2.753,74,0.554,88,1.805,99,0.949,109,1.396,147,2.211,164,2.025,177,3.611,198,1.252,232,1.694,235,1.04,237,1.919,240,0.856,250,1.081,251,2.487,252,2.245,276,2.308,277,1.166,281,0.777,282,1.573,283,1.259,301,2.98,387,1.195,397,2.338,418,4.844,551,1.152,1147,2.338,1184,3.13,1185,2.509,1186,5.233,1187,1.889,1188,6.532,1232,2.025,1303,2.509,1304,2.509,1467,1.21,2047,4.079,2048,4.079,2049,2.509,2050,4.079,2051,4.079,2052,2.767,2053,4.499,2054,4.499,2055,4.499,2056,4.499,2057,4.499,2058,5.154,2059,2.767,2060,2.767,2061,2.767,2062,2.509,2063,2.509,2064,2.509,2065,2.509,2066,2.509,2067,2.509,2068,2.509,2069,2.509,2070,2.509,2071,2.509]],["t/324",[43,4.365,74,0.438,198,1.532,276,3.568,301,5.838,387,3.004,418,5.53,420,2.731,1147,5.878,1219,6.307,1693,3.455,2047,6.307,2048,6.307,2049,6.307,2050,6.307,2051,6.307,2058,6.307,2062,6.307,2063,6.307,2064,6.307,2065,6.307,2067,6.307,2068,6.307,2069,6.307,2070,6.307,2071,6.307]],["t/326",[1,3.312,3,0.931,8,1.615,30,3.76,56,1.767,63,3.367,74,0.422,109,3.312,144,3.484,155,3.614,167,3.162,250,1.576,273,1.993,301,4.347,482,2.415,1182,3.926,1347,5.95,1407,5.245,1413,5.546,1726,6.474,2072,7.176,2073,6.564,2074,6.564,2075,5.95,2076,5.546,2077,6.564,2078,5.546,2079,6.564,2080,6.564,2081,6.564,2082,5.245,2083,5.546,2084,6.564]],["t/328",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/330",[6,3.495,7,1.844,8,2.306,13,3.495,45,1.438,47,2.768,74,0.466,125,2.463,127,3.121,160,2.982,250,1.844,564,3.543,1467,3.359,1667,3.593,2085,7.679]],["t/332",[2086,9.147]],["t/334",[74,0.541,1129,6.776,1708,5.789,2087,8.48,2088,7.687]],["t/336",[18,1.192,28,3.849,49,0.552,50,0.569,52,2.466,56,0.991,62,2.694,73,0.539,74,0.548,76,1.889,88,1.064,99,2.632,105,0.615,115,1.313,150,1.192,169,2.027,177,3.208,198,1.509,200,1.462,213,2.074,235,1.384,237,2.921,240,1.138,250,1.645,252,1.262,267,2.067,273,2.513,281,1.034,282,1.971,283,2.566,418,2.31,423,1.631,482,3.045,642,2.807,1129,5.474,1184,2.027,1325,3.111,1338,2.439,1427,3.631,1471,2.439,1545,2.598,1590,2.694,1688,3.111,1691,1.801,1707,2.694,1708,2.514,1728,3.846,1729,2.807,2072,7.376,2089,5.111,2090,5.111,2091,3.682,2092,2.942,2093,3.338,2094,3.111,2095,5.111,2096,3.682,2097,6.211,2098,5.638]],["t/338",[18,1.54,29,5.199,44,3.358,45,0.891,49,1.194,50,0.736,56,1.281,70,4.812,73,0.696,74,0.546,88,0.898,105,0.795,108,1.882,150,1.54,198,1.048,250,1.143,252,1.631,281,2.444,282,1.664,283,2.166,420,1.869,423,3.021,482,1.751,772,4.99,1129,3.802,1184,2.62,1198,6.182,1590,3.482,1666,3.802,1693,3.958,1707,3.482,1708,3.249,1728,2.671,1872,4.314,2072,4.021,2089,4.314,2090,4.314,2093,6.182,2094,4.021,2095,4.314,2097,4.314,2099,4.759,2100,7.97,2101,7.97,2102,4.759,2103,4.021,2104,4.314,2105,4.759,2106,6.182]],["t/340",[250,2.058,482,3.682,487,3.954,631,7.241,1112,6.046,1835,5.519]],["t/342",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/344",[1,3.516,3,0.817,7,0.909,8,0.931,47,1.364,49,1.044,50,0.89,71,0.566,73,0.843,74,0.548,76,1.941,79,2.125,88,0.714,105,0.632,115,1.35,116,1.699,125,1.214,126,2.313,127,1.26,128,1.575,129,1.081,132,2.263,136,4.488,137,2.168,140,1.393,149,2.084,199,1.91,223,1.88,237,2.455,250,0.909,251,1.655,252,1.297,281,1.063,384,1.974,387,1.634,402,2.168,420,1.486,482,3.082,602,3.056,652,1.88,718,2.67,904,3.198,1112,4.062,1665,5.568,1689,2.769,1806,2.437,1957,3.991,2107,3.198,2108,3.198,2109,3.198,2110,3.198,2111,5.219,2112,5.219,2113,5.219,2114,3.431,2115,3.198,2116,3.198,2117,4.865,2118,3.198,2119,3.198,2120,3.198,2121,5.219,2122,3.431,2123,3.431,2124,3.431,2125,3.198,2126,5.757,2127,3.431,2128,3.198,2129,3.785,2130,3.431,2131,3.785,2132,4.865,2133,3.785,2134,3.785]],["t/346",[7,0.76,45,0.593,47,1.141,49,1.287,50,1.192,71,0.611,73,1.036,74,0.558,76,1.624,77,1.711,79,3.493,88,0.946,99,1.085,105,1.039,115,1.788,125,1.015,126,2.013,127,1.054,128,1.317,129,0.904,132,1.893,136,2.039,146,2.234,198,0.697,229,1.68,251,2.192,252,1.718,255,1.986,281,0.889,282,1.107,335,2.675,387,1.367,420,1.243,424,1.711,461,2.53,482,1.165,602,2.661,1112,6.473,1398,2.675,1689,2.317,1756,2.998,1806,2.039,1957,3.564,2046,2.675,2107,2.675,2108,2.675,2109,2.675,2110,2.675,2111,5.641,2112,5.641,2113,5.641,2114,2.87,2115,2.675,2116,2.675,2117,4.235,2118,2.675,2119,2.675,2120,2.675,2121,2.87,2122,2.87,2123,2.87,2124,2.87,2125,4.235,2127,4.544,2128,4.235,2135,3.166,2136,2.87,2137,5.012,2138,3.166,2139,5.012,2140,3.166,2141,3.166,2142,3.166,2143,3.166,2144,2.87,2145,3.166,2146,3.166,2147,3.166,2148,3.166,2149,2.87,2150,3.166,2151,3.166,2152,3.166]],["t/348",[7,1.051,47,1.577,49,1.254,50,1.174,71,0.43,73,1.112,74,0.56,76,2.244,77,2.364,79,3.602,88,0.826,105,1.269,109,2.208,115,1.561,125,1.403,126,2.577,127,1.457,128,1.821,129,1.25,132,2.617,136,2.818,251,1.913,252,1.5,273,1.328,281,1.228,387,1.889,482,2.795,785,2.987,1109,3.201,1112,5.904,1879,5.422,1957,3.675,2046,3.697,2107,3.697,2108,3.697,2109,3.697,2110,3.697,2115,3.697,2116,3.697,2117,5.422,2118,3.697,2119,3.697,2120,3.697,2125,3.697,2128,3.697,2149,3.966,2153,6.416,2154,6.416,2155,4.375,2156,4.375,2157,3.697,2158,4.375]],["t/350",[45,1.324,48,2.377,52,2.417,56,1.043,59,3.677,73,0.858,74,0.55,76,4.043,88,1.598,97,1.328,99,2.702,156,2.958,164,4.289,177,3.145,198,1.557,235,1.456,237,3.61,240,1.198,250,1.408,252,2.009,263,1.988,273,1.177,281,1.646,282,2.049,283,1.763,482,3.276,603,2.175,907,3.096,1109,2.835,1394,3.882,1395,1.593,1467,1.695,1666,4.683,1691,1.895,1792,3.882,1799,2.835,1806,3.775,1816,3.274,1817,3.274,1818,3.274,1819,3.513,1820,3.513,1821,3.274,2157,3.274,2159,5.313,2160,3.875,2161,3.513,2162,3.875,2163,5.313,2164,3.875]],["t/352",[1,3.184,49,1.384,50,1.279,73,1.352,74,0.548,105,1.382,198,1.39,263,3.236,273,1.916,315,4.179,420,2.477,482,2.321,569,3.766,1394,4.179,1693,3.134,1792,4.179,1799,4.617,1806,4.063,2157,5.331,2159,5.72,2163,5.72,2165,6.309,2166,6.309,2167,6.309,2168,6.309]],["t/354",[1,4.013,3,0.843,6,2.703,8,1.462,28,4.056,45,1.679,52,2.159,56,1.599,68,3.636,79,3.335,81,3.727,125,1.905,137,3.403,144,3.153,146,4.192,201,4.347,238,3.826,250,2.153,313,2.533,318,3.636,423,2.632,629,4.747,652,3.95,1136,3.553,1327,5.611,1432,4.192,1450,5.02,1523,4.192,1727,4.529,1728,3.335,1758,5.02,1801,6.355,1802,4.347,2169,5.941,2170,5.02,2171,5.941,2172,5.385,2173,5.941,2174,5.941,2175,5.941]],["t/356",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/358",[6,2.436,7,1.286,8,1.823,13,2.436,45,1.003,47,1.93,49,1.273,50,1.313,52,1.453,73,0.784,74,0.546,88,1.011,97,1.835,105,1.419,125,1.717,127,2.467,160,2.079,198,1.632,250,1.286,252,1.835,263,2.746,270,4.082,282,1.872,564,3.419,740,3.448,1167,3.778,1370,3.778,1467,2.342,1667,2.505,1673,3.006,1707,3.918,1717,3.359,1728,3.006,2176,5.354,2177,5.354,2178,4.524,2179,4.524,2180,3.778,2181,5.354,2182,4.524,2183,5.354,2184,5.354]],["t/360",[3,0.836,45,1.105,56,2.13,74,0.521,81,3.7,159,4.316,236,3.378,238,3.798,263,4.059,270,4.496,415,6.687,469,3.247,740,3.798,1463,3.906,1508,4.161,1707,4.316,1737,4.496,1992,3.247,2178,4.983,2180,4.161,2185,4.983,2186,8.098,2187,7.914,2188,5.897,2189,4.983,2190,5.897,2191,5.897,2192,7.914,2193,5.897,2194,5.897,2195,7.175,2196,7.914,2197,7.914,2198,5.897]],["t/362",[3,0.435,28,3.34,45,1.142,49,0.914,50,0.942,52,2.527,56,1.872,62,2.247,73,0.449,74,0.558,88,0.923,97,1.677,99,1.052,105,1.018,108,1.35,109,1.549,115,2.175,116,1.379,164,2.247,177,1.084,198,1.343,213,1.13,235,1.838,237,2.086,240,0.949,250,1.67,251,2.139,252,2.09,263,2.509,264,2.096,267,1.724,275,1.836,277,1.293,281,0.862,282,1.71,283,1.397,313,1.309,387,1.326,395,2.166,402,1.759,482,1.13,648,1.549,650,3.24,652,1.525,659,1.836,718,2.166,740,3.151,742,4.134,763,1.502,904,4.134,985,2.783,989,2.341,1182,1.836,1327,4.302,1344,2.096,1362,1.796,1370,3.452,1395,1.262,1427,1.977,1545,2.166,1691,3.401,1695,3.729,1708,2.096,1717,3.069,1724,2.783,1727,2.341,1728,2.746,1729,2.341,1898,4.435,2037,2.034,2182,4.134,2185,2.594,2186,2.783,2189,4.134,2195,2.783,2199,3.07,2200,2.783,2201,3.07,2202,2.783,2203,2.783,2204,2.783,2205,3.07,2206,3.07]],["t/364",[49,1.293,50,1.334,73,0.984,74,0.538,88,1.27,105,1.441,198,1.481,251,3.773,263,3.45,387,2.905,420,2.641,740,4.332,989,5.128,1370,4.746,1693,3.341,1708,4.592,1717,4.22,2182,5.684,2189,5.684,2202,6.098,2203,6.098,2204,6.098,2207,6.727]],["t/366",[45,1.51,74,0.514,125,2.585,1728,6.146,1838,6.81,1839,6.81,2178,6.81]],["t/368",[8,2.108,18,2.774,250,2.058,717,4.631,718,6.046,1525,6.046,2208,8.569]],["t/370",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/372",[6,1.408,7,0.743,8,1.211,13,1.408,38,1.941,44,2.183,45,0.58,47,1.115,49,0.464,50,0.761,52,1.336,56,0.833,67,2.183,73,0.453,74,0.549,88,0.584,97,2.394,105,0.517,115,1.104,116,1.389,125,0.992,127,1.639,137,1.772,140,1.138,150,1.984,160,1.201,168,2.472,177,1.093,191,3.365,198,1.35,250,1.182,254,1.513,268,2.264,277,1.303,281,0.869,287,2.943,298,1.772,334,3.472,349,2.183,397,2.614,423,1.371,463,0.819,472,2.049,544,2.805,564,2.271,569,2.789,574,2.049,717,3.775,767,3.143,1257,2.049,1311,3.36,1334,2.472,1371,2.264,1442,2.614,1467,1.353,1509,3.26,1549,4.498,1602,2.805,1667,1.448,1673,1.737,2082,2.472,2209,2.805,2210,2.183,2211,3.094,2212,2.805,2213,2.805,2214,2.805,2215,3.094,2216,8.514,2217,2.805,2218,3.932,2219,2.805,2220,2.805,2221,4.159,2222,3.094,2223,3.094,2224,5.178,2225,5.178,2226,3.094,2227,2.805,2228,2.805,2229,2.614,2230,3.094,2231,3.094,2232,3.094,2233,3.094,2234,3.094,2235,2.805,2236,3.094,2237,3.094,2238,3.094,2239,2.805,2240,2.805,2241,2.805,2242,3.094,2243,2.805,2244,3.094,2245,3.094,2246,2.805,2247,3.094,2248,3.094,2249,2.614]],["t/374",[44,3.57,49,0.48,50,0.969,52,2.5,56,0.862,73,0.469,74,0.551,81,2.01,88,1.629,97,1.098,99,1.734,105,0.845,115,1.143,150,1.037,153,2.344,172,1.499,177,3.048,198,1.381,223,1.591,235,1.204,237,3.307,240,1.564,250,1.215,251,1.401,252,2.441,254,1.567,267,1.798,277,1.349,281,1.42,282,1.769,283,1.458,402,1.835,423,1.419,463,0.848,509,1.478,563,1.961,648,1.616,717,4.191,720,2.707,722,2.904,767,1.643,994,2.26,1182,3.026,1287,2.344,1311,3.454,1334,2.56,1423,2.187,1509,4.717,1549,3.258,1899,2.904,2078,2.707,2218,2.56,2224,4.275,2225,4.275,2228,2.904,2229,2.707,2235,2.904,2239,2.904,2240,2.904,2241,2.904,2243,4.586,2246,2.904,2249,4.275,2250,3.203,2251,5.059,2252,2.122,2253,3.203,2254,3.203,2255,2.904,2256,3.203,2257,3.203,2258,4.586,2259,2.904,2260,3.203,2261,2.904,2262,3.203,2263,3.203,2264,3.203,2265,3.203,2266,3.203,2267,3.203]],["t/376",[44,4.994,74,0.485,150,2.291,198,1.559,251,3.096,281,2.502,282,2.475,420,2.779,720,5.981,767,3.63,994,4.994,1182,4.233,1423,4.832,1509,4.688,1549,4.558,1693,3.515,2218,5.655,2224,5.981,2225,5.981,2249,5.981,2252,4.688,2255,6.416,2258,6.416,2261,6.416]],["t/378",[45,0.62,56,2.352,63,1.697,73,0.484,74,0.57,75,2.13,140,1.217,148,1.243,150,1.071,172,1.548,213,2.355,273,2.201,472,2.191,475,2.13,545,3.339,549,1.505,602,2.754,603,2.912,623,3.919,767,2.661,785,2.258,1182,1.978,1209,2.521,1313,2.998,1334,2.643,1371,3.797,1423,2.258,1525,2.334,1992,1.821,2170,2.795,2221,2.795,2252,2.191,2268,3.308,2269,3.308,2270,3.308,2271,3.308,2272,3.308,2273,5.188,2274,3.308,2275,3.308,2276,3.308,2277,3.308,2278,3.308,2279,3.308,2280,3.308,2281,3.308,2282,3.308,2283,6.402,2284,4.703,2285,3.308,2286,3.308,2287,3.308,2288,3.308,2289,3.308,2290,3.308,2291,3.308,2292,3.308,2293,3.308,2294,2.795,2295,3.308,2296,3.308,2297,3.308,2298,3.308,2299,3.308,2300,3.308,2301,3.308,2302,3.308,2303,3.308,2304,3.308,2305,3.308,2306,3.308,2307,3.308,2308,3.308,2309,3.308,2310,3.308,2311,3.308,2312,3.308,2313,3.308,2314,3.308,2315,3.308,2316,3.308,2317,3.308,2318,3.308]],["t/380",[1,3.912,8,1.907,11,4.864,12,5.91,66,7.028,67,5.47,167,3.735,250,1.862,348,4.115,767,3.976,1230,6.551,1700,5.47,2319,9.21,2320,6.551,2321,7.752]],["t/382",[71,0.879,763,4.375,1395,3.678]],["t/384",[1,2.616,6,2.359,7,1.245,8,1.782,13,2.359,45,0.971,47,1.868,49,0.777,52,1.407,67,3.657,74,0.522,97,1.777,125,1.662,127,2.412,139,4.798,146,3.657,160,2.013,198,1.596,250,2.006,432,6.568,564,3.342,660,3.539,1126,3.433,1170,3.252,1184,2.854,1467,2.267,1667,2.425,1673,2.91,1957,2.969,2221,4.38,2320,7.641,2322,5.183,2323,7.245,2324,5.183,2325,3.793,2326,7.245,2327,5.183,2328,3.951,2329,5.183,2330,5.183,2331,5.183,2332,5.183,2333,4.699,2334,5.183,2335,5.183,2336,5.183,2337,5.183,2338,5.183]],["t/386",[1,2.023,8,0.986,45,1.126,49,0.601,50,0.62,52,2.539,74,0.555,88,1.621,97,1.374,99,1.374,105,0.669,115,1.43,139,2.655,148,3.013,177,3.303,198,1.589,199,2.023,223,2.986,235,1.506,237,2.564,240,1.239,250,1.444,251,1.753,252,2.061,261,2.454,267,2.25,275,2.397,281,1.125,282,2.102,283,1.824,430,2.737,549,2.736,732,2.737,902,2.933,1176,2.828,1232,2.933,1410,3.056,1550,3.203,1833,2.737,2319,5.451,2320,3.387,2325,4.4,2339,5.451,2340,4.008,2341,3.634,2342,3.634,2343,3.056,2344,4.008,2345,3.634,2346,5.451,2347,4.008,2348,5.451,2349,4.008,2350,5.451,2351,4.008,2352,4.008]],["t/388",[74,0.485,198,1.559,251,3.096,261,4.333,281,1.987,282,2.475,420,2.779,1693,3.515,2325,5.179,2339,6.416,2342,6.416,2345,6.416,2346,6.416,2350,6.416,2353,8.911,2354,8.911,2355,8.911,2356,8.911,2357,8.911,2358,7.078]],["t/390",[8,1.741,18,2.884,61,2.5,125,2.27,127,2.357,148,2.66,167,3.41,189,4.333,250,1.7,287,4.233,308,5.179,423,3.136,673,4.441,1165,5.981,1391,3.897,1549,4.558,1726,5.396,1847,5.981,1944,6.416,1946,5.981,2359,8.911,2360,7.078,2361,7.078,2362,6.416,2363,5.981]],["t/392",[71,0.879,763,4.375,1395,3.678]],["t/394",[3,0.836,6,2.684,7,1.416,8,1.947,13,2.684,45,1.105,47,2.125,52,2.148,74,0.51,77,3.187,97,2.022,125,1.891,127,2.635,146,6.303,148,2.216,155,3.247,160,2.29,198,1.743,219,5.342,222,4.161,250,1.416,298,3.378,368,5.346,549,3.602,564,3.651,584,4.496,1467,2.579,1667,2.76,1673,3.311,2363,4.983,2364,5.897,2365,5.897,2366,5.897,2367,5.897,2368,5.897]],["t/396",[3,0.83,4,3.584,8,1.44,49,0.877,50,0.905,52,2.138,74,0.55,88,1.105,99,2.007,105,0.978,115,2.089,177,2.781,198,1.96,219,5.323,235,2.2,237,3.795,240,1.81,250,1.892,252,2.007,281,1.644,282,2.754,283,2.664,402,3.354,549,2.664,584,4.463,652,2.908,1550,4.678,2363,4.948,2369,5.855,2370,5.855]],["t/398",[74,0.498,198,1.887,281,2.406,282,2.996,420,3.365,1693,4.256]],["t/400",[8,2.086,56,2.283,109,4.279,155,4.669,167,4.085,250,2.037,1111,7.018]],["t/402",[18,3.11,24,2.606,30,4.853,50,1.141,56,2.381,71,0.899,73,1.08,74,0.455,88,1.727,96,1.623,144,4.695,155,1.882,160,1.327,167,1.647,198,0.753,203,2.732,213,3.254,264,2.334,267,1.919,277,1.44,399,4.254,405,3.429,410,4.499,469,5.67,646,2.732,739,4.827,741,2.202,1167,2.412,1187,2.334,1395,3.035,1443,5.525,1835,3.429,2200,3.099,2371,3.419,2372,3.419,2373,7.999,2374,3.419,2375,8.019,2376,3.419,2377,7.999,2378,3.419,2379,3.419,2380,3.419,2381,3.419,2382,2.889,2383,3.419,2384,3.419,2385,3.419,2386,3.419,2387,3.419,2388,2.889,2389,2.889,2390,3.419]],["t/404",[6,1.017,7,0.537,8,0.927,13,1.017,18,1.582,24,1.704,45,1.386,47,0.806,49,1.253,50,1.074,56,1.545,60,1.28,61,0.789,73,1.017,74,0.555,79,1.255,83,2.851,88,0.712,94,1.889,97,1.676,105,1.161,115,2.287,125,0.717,127,1.255,136,1.439,144,2.001,149,1.231,160,1.464,167,3.563,207,1.704,213,2.112,229,1.186,242,1.704,250,0.537,270,1.704,273,1.743,275,1.337,279,1.786,281,2.348,399,1.786,402,2.159,405,1.439,481,1.577,534,1.889,549,2.612,564,1.031,569,4.009,637,1.889,648,1.128,731,2.026,741,1.439,902,1.636,989,2.874,1111,3.449,1119,1.786,1167,4.05,1182,1.337,1187,1.526,1298,1.889,1370,1.577,1371,1.636,1423,1.526,1443,4.131,1467,0.978,1479,1.636,1593,2.026,1667,1.046,1673,1.255,2375,2.026,2388,1.889,2389,1.889,2391,2.235,2392,2.235,2393,3.77,2394,2.235,2395,2.235,2396,2.235,2397,2.235,2398,3.77,2399,3.77,2400,3.77,2401,3.77,2402,2.235,2403,2.235,2404,2.235,2405,2.235,2406,2.235,2407,2.235,2408,2.235,2409,5.74,2410,6.41,2411,4.888,2412,2.235,2413,2.235,2414,2.235,2415,2.235,2416,2.026,2417,2.235,2418,3.77,2419,4.888,2420,4.888,2421,4.888,2422,1.889,2423,2.235,2424,2.026,2425,2.235]],["t/406",[3,0.475,18,1.696,43,2.101,45,1.209,49,0.502,50,0.518,52,1.981,56,1.737,74,0.551,86,5.452,88,0.632,97,1.148,99,1.148,105,0.559,108,0.924,109,2.643,115,1.194,144,4.822,167,3.516,177,2.577,198,1.744,213,1.927,235,1.258,237,2.751,240,1.035,250,1.258,252,1.148,267,1.88,273,1.591,275,2.003,277,2.206,279,4.186,280,4.749,281,1.812,282,1.831,283,1.524,309,2.553,387,1.446,395,3.696,405,4.7,466,1.777,480,2.218,488,2.363,602,1.777,642,4.919,648,1.69,652,1.663,659,2.003,735,4.749,1111,2.363,1325,2.829,1327,2.363,1338,2.218,1395,2.154,1404,4.749,1445,3.696,1446,3.036,1447,4.749,1448,4.749,1449,3.036,1450,2.829,1451,3.036,1481,4.749,1482,2.675,2388,2.829,2389,2.829,2422,4.426,2426,3.348,2427,3.348,2428,3.348,2429,3.348,2430,3.348,2431,3.348]],["t/408",[74,0.48,198,1.775,279,6.44,281,2.901,282,2.818,405,5.191,420,3.165,1693,4.003,2422,6.81,2432,8.06]],["t/410",[8,2.003,110,7.38,232,4.983,250,1.955,419,5.957,500,6.504,1391,4.482,1394,5.392,2433,8.802,2434,6.879,2435,6.879]],["t/412",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/414",[6,3.011,7,1.589,8,2.1,13,3.011,45,1.24,47,2.385,50,1.023,52,1.796,73,1.249,74,0.526,105,1.105,125,2.122,127,2.843,129,1.89,160,2.569,198,1.457,250,2.05,564,3.939,1467,2.894,1667,3.096,2434,5.592,2436,5.999,2437,5.999,2438,5.999,2439,6.617]],["t/416",[49,0.841,50,1.183,52,2.364,74,0.546,99,2.624,105,1.278,115,2.002,177,3.076,198,1.918,235,2.109,236,3.215,237,3.714,240,1.735,250,1.838,251,2.455,252,2.624,281,1.576,282,2.676,283,2.554,313,2.393,419,5.601,451,5.834,1391,4.214,2440,6.938,2441,6.938,2442,5.088,2443,4.485]],["t/418",[74,0.486,198,1.811,251,3.596,281,2.309,282,2.875,420,3.228,1693,4.084,2440,7.454,2441,7.454,2442,7.454]],["t/420",[8,2.201,250,2.149,741,5.762]],["t/422",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/424",[7,1.406,47,2.11,49,1.18,50,1.217,57,4.463,71,0.575,73,1.153,74,0.553,105,1.315,125,1.878,126,3.164,127,1.95,128,2.436,130,3.354,131,2.863,132,3.502,187,4.678,384,3.054,763,2.863,882,4.948,1670,3.584,1695,4.463,1957,4.511,2444,5.855,2445,5.855,2446,6.293,2447,5.308,2448,6.655,2449,5.308,2450,5.308,2451,5.308]],["t/426",[1,2.551,3,0.717,43,3.171,48,1.699,52,1.932,57,6.281,74,0.548,99,1.733,148,1.9,164,3.699,177,2.514,198,1.814,199,2.551,235,1.9,237,3.513,240,1.563,250,1.71,252,1.733,261,3.094,268,3.699,277,2.129,281,1.419,282,1.767,283,2.3,387,3.074,461,4.039,549,2.3,741,4.584,763,2.472,767,2.593,885,3.853,1444,4.039,1670,3.094,1695,3.853,1756,3.023,1797,3.566,1814,3.853,2446,4.039,2452,4.582,2453,3.853,2454,5.055,2455,5.055,2456,5.055,2457,5.055,2458,5.055,2459,4.582,2460,5.055,2461,5.055]],["t/428",[74,0.498,198,1.887,420,3.365,1693,4.256,1695,6.532,2459,7.768]],["t/430",[8,2.131,213,3.186,250,2.08,298,4.961,2462,7.318,2463,8.66]],["t/432",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/434",[6,2.871,7,1.515,8,2.036,13,2.871,45,1.182,47,2.274,49,0.945,52,1.713,71,0.62,74,0.53,88,1.191,97,2.837,125,2.023,127,2.756,160,2.45,190,5.041,198,1.823,250,1.515,273,2.513,564,3.819,1184,3.474,1257,4.179,1362,3.691,1467,2.759,1667,2.952,1673,3.542,2219,5.72,2464,6.309,2465,6.309]],["t/436",[45,0.918,49,0.735,50,0.758,52,2.395,56,2.375,71,0.482,74,0.548,88,1.315,99,2.388,105,0.819,115,1.749,149,2.699,177,3.115,198,1.784,235,1.842,237,3.762,240,1.516,250,1.673,252,1.68,273,2.46,281,1.376,282,2.435,283,2.231,313,2.09,482,2.563,1184,2.699,1257,5.366,1362,4.74,1423,3.347,1683,4.142,1691,2.397,1697,5.886,1799,5.097,1812,3.737,2462,4.142,2466,4.902]],["t/438",[25,6.201,45,1.633,48,2.299,52,1.857,56,1.841,74,0.434,167,3.295,198,1.921,273,2.077,281,1.92,282,2.391,420,2.686,1176,4.826,1344,4.669,1362,5.616,1693,3.397,1781,5.78,1799,5.005,1812,5.214,2083,5.78,2094,5.78,2462,5.78,2467,6.84,2468,6.201,2469,5.78,2470,6.84]],["t/440",[57,5.967,96,3.715,116,3.514,148,2.941,250,1.88,487,3.611,549,3.562,1292,5.727,1314,6.254,1322,6.254,1835,5.041,2043,6.614,2452,8.597,2471,7.827,2472,7.827]],["t/442",[71,0.869,198,1.949,1315,4.465,1395,3.638]],["t/444",[7,1.427,47,2.141,49,1.192,50,1.229,57,4.529,71,0.584,73,1.164,74,0.554,105,1.328,125,1.905,126,3.194,127,1.978,128,2.472,130,3.403,131,2.905,132,3.553,187,4.747,384,3.099,763,2.905,1670,3.636,1957,4.555,2446,6.355,2447,5.385,2448,6.72,2449,5.385,2450,5.385,2451,5.385,2473,5.941,2474,5.941]],["t/446",[3,1.031,8,1.788,28,4.961,45,1.361,52,1.973,68,4.449,125,2.331,137,4.163,238,4.681,250,2.371,313,3.099,318,4.449,423,3.22,652,3.61,1136,4.346,1432,5.128,1523,5.128,1728,4.08,1801,7.239,1802,5.318,1822,5.318]],["t/448",[14,4.142,20,2.699,48,1.648,50,0.758,71,1.063,73,1.364,88,1.759,198,1.08,240,1.516,252,1.68,313,3.762,348,2.602,482,1.804,1136,2.932,1257,3.247,1315,2.474,1327,3.459,1553,8.178,1691,4.557,1822,7.684,2170,4.142,2475,4.902,2476,4.902,2477,4.444,2478,4.444,2479,4.444,2480,4.902,2481,4.444,2482,4.902,2483,4.444,2484,4.902]],["t/450",[6,1.939,7,1.023,8,1.548,13,1.939,45,0.798,47,1.535,48,1.432,49,0.638,50,0.659,52,1.156,73,0.624,74,0.564,105,0.711,108,1.737,125,1.366,127,2.095,129,1.217,149,2.346,160,1.654,181,2.346,198,0.938,200,2.499,250,1.023,263,2.185,281,2.1,450,3.118,482,2.753,564,2.903,569,4.198,571,6.321,574,2.822,1136,2.548,1467,1.863,1667,1.993,1691,3.077,1728,2.392,1756,2.548,1822,6.449,2481,3.862,2485,4.26,2486,4.26,2487,4.26,2488,4.26,2489,4.26,2490,4.26,2491,4.26,2492,4.26,2493,4.26,2494,4.26,2495,4.26,2496,4.26,2497,4.26,2498,4.26]],["t/452",[18,1.025,45,0.939,48,3.279,52,2.551,56,0.852,65,2.317,71,0.311,74,0.55,88,1.682,108,0.874,109,1.598,115,1.129,118,1.938,148,1.19,177,3.318,198,1.37,200,1.257,235,1.19,237,2.137,240,0.979,250,0.76,251,2.721,252,2.133,263,2.571,264,2.161,267,1.777,313,1.35,423,1.403,482,1.165,602,4.353,603,1.777,732,2.161,1151,2.413,1187,2.161,1228,2.234,1257,3.32,1362,1.852,1467,1.385,1686,3.422,1691,1.548,1717,3.145,1728,2.814,1729,2.413,1767,2.413,1790,5.178,1806,4.007,1808,2.413,1809,2.53,1810,2.317,1811,2.234,1814,2.413,1816,2.675,1817,2.675,1818,2.675,1821,2.675,1822,6.001,1823,2.87,1824,2.87,1825,2.87,1826,2.675,1827,2.53,1828,2.87,1829,2.87,1830,2.87,1831,2.675,2161,2.87,2294,2.675,2469,2.675,2499,2.87,2500,2.87,2501,4.743,2502,2.87]],["t/454",[74,0.505,198,1.707,263,3.976,420,3.044,602,4.115,1693,3.85,1717,4.864,1806,4.993,1811,5.47,2469,6.551,2499,7.028,2500,7.028,2501,5.91,2502,7.028,2503,7.752]],["t/456",[74,0.542,273,2.4,602,4.195,623,4.838,785,5.395,2501,7.81,2504,7.903,2505,7.903,2506,7.903]],["t/458",[3,1.079,45,1.746,74,0.522,125,2.44,137,4.357,1691,4.558,1728,6.049,1838,6.428,1839,6.428,2507,7.607]],["t/460",[8,2.086,61,2.995,115,3.025,250,2.037,283,4.526,1475,7.165,2508,8.48]],["t/462",[50,1.311,71,0.833,105,1.416,252,2.907,1348,6.464,1395,4.09,2509,7.687]],["t/464",[3,0.759,6,2.436,7,1.78,8,1.823,13,2.436,45,1.003,47,1.93,49,1.273,50,1.313,56,2.287,71,0.728,73,1.084,74,0.542,100,4.524,125,1.717,126,2.151,127,2.467,128,2.228,129,1.529,140,1.97,150,2.398,160,2.079,250,1.286,252,1.835,283,2.436,302,3.918,331,2.893,564,2.47,1391,2.948,1467,2.342,1667,2.505,1785,4.854,2210,3.778,2510,5.354,2511,5.354,2512,6.261,2513,5.354,2514,7.409,2515,5.354]],["t/466",[8,1.3,18,1.711,45,0.99,49,1.1,59,4.607,61,1.866,73,1.075,85,4.465,96,2.508,108,2.027,133,3.091,156,4.258,159,5.373,172,2.473,221,3.235,250,1.269,264,5.013,337,4.465,348,2.805,405,6.171,414,3.729,469,4.043,509,3.388,648,2.667,650,3.5,729,6.656,763,2.584,1167,5.181,1391,2.91,1394,4.863,1395,3.019,1475,4.465,1545,3.729,2136,4.791,2294,4.465,2435,6.205,2516,5.284,2517,5.284,2518,5.284,2519,5.284,2520,5.284,2521,4.791,2522,5.284,2523,4.791,2524,4.791,2525,5.284,2526,4.465]],["t/468",[71,0.931,73,1.388,267,5.323,405,6.107,1395,4.36,2509,7.096,2527,9.483,2528,7.827]],["t/470",[6,1.146,7,1.486,8,1.025,13,1.146,18,1.348,45,0.78,47,0.908,49,1.342,50,0.823,56,1.121,59,1.58,61,0.89,71,0.673,73,1.196,74,0.564,97,0.863,105,0.695,125,0.808,126,2.139,127,1.387,128,2.216,156,2.102,160,0.978,244,2.283,250,0.605,267,2.338,281,2.379,327,2.128,331,2.878,384,2.173,414,2.939,420,0.989,424,2.878,564,1.162,569,3.36,648,1.271,772,3.048,929,2.283,1200,3.175,1390,3.985,1467,1.102,1667,1.179,1957,3.544,2104,3.776,2328,3.175,2512,2.128,2524,3.776,2526,2.128,2529,2.519,2530,6.188,2531,4.165,2532,2.844,2533,2.519,2534,4.165,2535,2.519,2536,4.165,2537,2.519,2538,4.165,2539,4.165,2540,3.776,2541,4.165,2542,4.165,2543,6.188,2544,2.519,2545,2.519,2546,2.519,2547,5.326,2548,2.519,2549,2.519,2550,2.519,2551,2.519,2552,2.283,2553,2.519,2554,2.519,2555,5.326,2556,2.519,2557,2.519,2558,2.519,2559,6.188,2560,2.519,2561,2.519,2562,2.519,2563,2.519]],["t/473",[6,2.405,8,1.3,13,3.341,30,3.027,74,0.263,77,2.856,81,3.315,101,4.465,142,3.315,154,3.091,156,2.667,165,3.16,167,2.546,238,3.403,243,4.465,269,4.028,384,2.757,487,2.438,562,4.465,650,3.5,658,3.091,1170,3.315,1290,4.465,1362,3.091,1424,3.729,1699,4.465,1726,4.028,1769,4.028,1801,4.222,1934,4.791,2132,4.465,2172,4.791,2453,4.028,2501,4.028,2564,5.284,2565,4.465,2566,4.791,2567,5.284,2568,5.284,2569,4.791,2570,5.284,2571,5.284,2572,5.284,2573,5.284,2574,4.791,2575,5.284,2576,4.465,2577,5.284,2578,5.284,2579,5.284,2580,4.791,2581,4.791,2582,4.791,2583,5.284,2584,5.284,2585,5.284,2586,5.284,2587,5.284,2588,5.284,2589,5.284,2590,5.284,2591,5.284,2592,5.284,2593,4.791,2594,5.284]],["t/475",[8,1.41,11,3.596,18,1.855,21,4.369,30,4.447,43,3.596,45,1.074,54,5.196,56,2.09,137,3.283,140,2.109,145,5.196,213,3.239,275,4.643,349,4.044,384,4.05,762,4.843,1434,4.194,1445,5.478,1700,5.478,1737,4.369,2252,5.142,2532,5.3,2566,5.196,2593,5.196,2595,7.763,2596,5.731,2597,5.196,2598,5.731,2599,5.731,2600,5.196,2601,5.196,2602,5.731,2603,5.731,2604,5.731,2605,5.731,2606,5.731,2607,5.731,2608,5.918,2609,5.731,2610,5.731,2611,5.731]],["t/477",[8,1.854,11,4.729,213,3.41,275,5.542,1391,5.102,1445,6.538,2252,6.138,2532,6.326,2608,7.064,2612,7.537,2613,7.537,2614,7.537,2615,7.537]],["t/479",[8,1.854,11,4.729,213,3.41,275,5.542,1391,5.102,1445,6.538,2252,6.138,2532,6.326,2608,7.064,2616,7.537,2617,7.537,2618,7.537,2619,7.537]],["t/481",[8,1.854,11,4.729,213,3.41,275,5.542,954,6.833,1391,5.102,1445,6.538,2252,6.138,2532,6.326,2608,7.064,2620,7.537,2621,7.537,2622,7.537]],["t/483",[8,1.854,11,4.729,213,3.41,275,5.542,1391,5.102,1445,6.538,2252,6.138,2532,6.326,2608,7.064,2623,7.537,2624,7.537,2625,7.537,2626,7.537]],["t/485",[6,3.603,13,2.141,18,2.189,20,2.59,29,5.155,38,2.951,61,1.661,68,4.14,74,0.336,77,4.279,133,2.752,144,3.59,167,3.258,236,3.874,243,5.714,269,3.586,276,2.413,384,4.981,833,6.131,994,3.319,1182,5.178,1343,5.714,1390,3.029,1427,5.099,1707,3.442,1745,3.975,2083,5.714,2252,3.116,2333,4.264,2424,4.264,2532,6.261,2580,4.264,2581,4.264,2582,4.264,2601,6.131,2627,4.704,2628,4.704,2629,4.704,2630,4.704,2631,4.704,2632,4.704,2633,4.704,2634,4.704,2635,4.704,2636,4.704,2637,6.763,2638,6.763,2639,4.704,2640,4.704,2641,4.704,2642,4.264,2643,4.704,2644,4.704]],["t/488",[1,3.159,3,0.888,5,5.002,8,2.026,12,4.773,45,1.173,83,3.109,140,2.304,142,5.166,149,3.447,158,5.676,160,2.431,161,6.958,191,3.016,196,4.274,525,5.002,1408,5.676,1458,5.29,1467,2.738,1474,4.581,1537,7.465,1722,5.676,1745,5.29,2565,5.29,2645,5.676,2646,6.261,2647,5.676,2648,6.261,2649,6.261,2650,6.261,2651,6.261,2652,6.261,2653,6.261,2654,6.261,2655,6.261,2656,6.261,2657,6.261,2658,6.261]],["t/490",[3,0.843,45,1.49,49,0.89,50,0.918,61,2.809,68,4.868,73,1.461,74,0.395,79,4.464,97,2.036,99,2.726,116,2.667,137,4.555,213,2.186,250,1.427,298,3.403,314,4.056,419,4.347,650,3.935,718,4.192,917,6.063,1391,4.379,1435,6.72,1578,4.747,1936,5.385,1992,3.271,2453,4.529,2659,5.385,2660,5.385,2661,5.941,2662,5.941,2663,5.385,2664,5.941,2665,5.941,2666,5.941]],["t/492",[3,0.974,4,2.264,5,5.489,8,2.151,20,3.783,26,4.52,34,2.706,39,2.706,40,3.125,45,1.441,46,2.82,67,3.992,74,0.504,83,2.81,96,2.685,116,1.661,133,2.164,139,2.45,142,4.31,160,2.197,171,2.119,191,3.31,196,2.525,199,2.855,200,1.469,222,2.61,238,4.425,239,3.125,247,2.382,1357,3.125,1427,2.382,1434,2.706,1438,3.353,1506,4.52,1530,3.353,1573,6.228,2037,2.45,2132,3.125,2259,3.353,2343,2.82,2362,5.129,2501,5.237,2532,2.525,2552,3.353,2569,3.353,2576,3.125,2597,3.353,2642,3.353,2667,9.62,2668,3.353,2669,5.657,2670,5.129,2671,3.699,2672,3.353,2673,3.699,2674,3.699,2675,5.657,2676,3.699,2677,3.699,2678,3.699,2679,5.657,2680,3.699,2681,5.657,2682,3.699,2683,3.699,2684,3.699,2685,3.699,2686,3.699,2687,3.699,2688,3.699,2689,3.699,2690,3.699,2691,3.699,2692,3.699,2693,3.699,2694,3.353]],["t/494",[3,0.923,7,1.564,8,2.078,49,0.976,50,1.006,52,2.293,61,2.299,73,1.505,74,0.494,105,1.087,114,4.085,137,3.73,139,4.313,165,3.894,198,1.434,247,4.193,487,3.004,562,5.502,564,3.004,569,2.963,763,3.184,1391,4.652,1394,4.313,1480,5.596,2695,6.511,2696,6.511]],["t/496",[8,2.241,19,5.174,45,1.374,116,3.292,137,4.2,250,1.761,318,4.489,826,5.006,1424,6.994,1428,6.648,1463,4.857,2343,5.59,2697,7.333,2698,6.648,2699,6.648,2700,6.648,2701,6.648,2702,6.648,2703,6.648,2704,6.648]],["t/498",[74,0.463,167,3.665,207,5.799,229,4.038,248,5.799,673,4.773,1292,5.567,1736,6.896,2645,6.896,2705,6.896,2706,7.607,2707,7.607,2708,7.607,2709,7.607,2710,7.607,2711,7.607,2712,6.896,2713,7.607]],["t/500",[1,2.796,3,0.786,7,0.865,8,0.886,33,2.54,47,1.298,49,1.227,50,1.173,63,1.847,70,2.54,71,0.354,73,1.11,74,0.566,79,2.021,105,1.128,116,1.616,117,2.458,118,2.204,125,1.155,126,2.226,127,1.199,128,3.157,150,2.187,167,1.734,186,3.264,235,1.353,240,1.113,247,2.319,281,1.556,314,2.458,331,1.946,475,5.276,717,1.946,767,3.465,1119,2.877,1407,2.877,1549,4.351,1626,3.042,2209,3.264,2217,6.125,2218,5.398,2705,3.264,2714,3.6,2715,3.6,2716,3.6,2717,3.6,2718,3.6,2719,5.542,2720,3.6,2721,3.6,2722,3.6,2723,3.6,2724,3.6,2725,3.6,2726,3.6,2727,3.6,2728,3.6,2729,3.6,2730,3.6,2731,3.6,2732,3.6,2733,3.6,2734,3.6]],["t/503",[3,1.02,7,0.958,8,2.109,45,1.122,47,1.438,49,1.198,50,1.112,52,1.626,61,2.541,68,2.442,71,0.392,73,1.318,74,0.523,79,2.239,97,1.367,99,1.367,105,1.201,123,3.616,125,1.279,126,2.406,127,1.328,128,1.66,129,2.055,133,2.333,140,1.468,177,1.409,199,3.023,221,2.442,235,1.499,250,1.439,331,2.156,407,3.187,419,2.919,460,3.371,509,3.319,717,2.156,767,3.073,917,3.041,1003,5.431,1337,4.09,1391,2.196,1427,2.569,1730,3.371,1770,2.919,1832,3.371,1833,2.723,1850,3.371,2037,2.642,2092,3.187,2341,3.616,2433,5.431,2434,6.079,2436,3.616,2437,3.616,2438,3.616,2735,3.989,2736,5.991,2737,3.371,2738,3.989,2739,3.989,2740,3.989,2741,3.989,2742,3.989,2743,3.989,2744,5.991,2745,3.989]],["t/505",[3,0.691,8,1.199,49,1.039,50,0.753,52,2.192,61,2.449,73,1.487,74,0.533,97,1.67,105,0.814,108,1.345,167,2.347,199,4.876,213,2.552,240,2.144,420,2.723,487,3.2,569,2.218,615,2.383,767,4.513,815,3.438,825,3.894,826,3.327,994,4.894,1337,4.735,1400,4.118,1508,3.438,1770,3.566,1797,3.438,2443,5.542,2600,6.288,2746,4.118,2747,6.823,2748,4.418,2749,4.418,2750,4.418,2751,4.873,2752,4.873,2753,4.873]],["t/507",[3,0.775,7,0.85,8,1.345,11,2.22,12,2.697,13,1.61,45,0.663,49,1.001,50,0.547,52,1.814,61,2.87,73,1.503,74,0.539,96,1.679,97,2.945,108,0.977,112,3.207,114,2.22,139,4.426,144,1.878,159,2.589,160,1.374,165,3.27,167,1.704,198,1.204,199,4.101,213,2.012,222,2.496,229,1.878,233,3.207,240,1.69,248,4.168,281,1.535,420,1.389,564,1.632,569,3.041,658,2.07,659,3.996,693,2.989,717,1.912,763,1.73,767,2.804,994,2.496,1390,3.521,1391,1.948,1394,2.343,1444,4.368,1473,2.697,1480,2.343,1546,2.827,1770,2.589,1797,2.496,2078,2.989,2435,2.989,2443,4.368,2453,2.697,2512,2.989,2668,3.207,2694,3.207,2747,4.62,2748,3.207,2749,3.207,2750,3.207,2754,3.538,2755,3.538,2756,3.538,2757,3.538,2758,3.538,2759,3.538,2760,3.538,2761,3.538,2762,3.538]],["t/510",[3,0.807,7,1.367,8,1.4,20,3.134,30,3.26,45,1.447,47,2.051,52,1.545,71,0.559,74,0.504,114,3.571,125,1.825,126,3.103,127,2.573,231,5.159,658,5.131,672,4.165,745,4.809,750,4.809,1410,7.172,1411,5.159,1412,5.159,1435,4.809,1508,4.016,1793,5.159,2076,4.809,2659,5.159,2763,7.726,2764,5.691,2765,5.691,2766,5.159,2767,5.691,2768,5.691,2769,5.691,2770,5.159,2771,5.691,2772,5.691,2773,5.691,2774,5.691,2775,5.691,2776,5.691]],["t/512",[97,3.588,108,2.89,142,5.814,144,4.919,658,6.124,746,6.138,751,7.064]],["t/514",[8,2.169,13,3.166,60,3.985,99,2.385,119,4.749,140,2.56,166,5.878,211,3.511,219,4.161,349,4.909,352,6.738,1338,4.608,1362,4.07,1498,5.559,1737,5.303,1802,5.091,1941,5.559,2777,6.957,2778,6.957,2779,7.991,2780,8.772,2781,6.957]],["t/516",[1,4.457,7,1.517,33,5.295,61,3.537,71,0.62,73,0.924,74,0.559,77,2.315,83,2.127,108,1.182,126,2.537,128,2.628,133,2.505,140,1.576,148,2.374,177,1.512,250,1.802,331,3.414,348,2.273,352,4.184,354,5.047,355,5.123,356,5.047,357,5.047,358,5.047,359,5.047,360,5.047,361,5.047,362,5.337,363,5.337,364,5.337,365,5.337,366,5.337,367,5.337,917,3.265,1437,3.265,2066,3.883,2782,4.283]],["t/518",[1,3.917,7,1.377,45,1.074,49,1.163,50,1.2,61,3.332,71,0.563,73,1.136,74,0.555,105,1.296,126,2.302,128,2.385,140,2.109,148,2.154,250,1.377,282,2.004,315,3.796,330,5.196,331,3.097,352,3.796,354,4.579,355,5.3,356,4.579,357,4.579,358,4.579,359,4.579,360,4.579,361,4.579,584,4.369,1857,5.196,2783,5.731,2784,5.731]],["t/520",[8,1.872,70,5.368,97,2.608,99,2.608,133,4.45,150,2.462,156,3.839,548,4.773,598,3.839,1338,5.039,2785,7.607,2786,6.896,2787,6.896,2788,6.896,2789,6.896,2790,6.896,2791,6.896,2792,6.896,2793,6.896]],["t/522",[8,1.505,61,2.161,71,0.601,73,1.516,74,0.54,96,2.905,99,2.098,237,2.609,240,3.318,372,5.548,548,3.839,2794,7.353,2795,5.548,2796,7.353,2797,6.119,2798,5.548,2799,5.548,2800,6.119,2801,5.548,2802,6.119,2803,5.548,2804,5.548,2805,6.119]],["t/524",[7,2.251,71,0.754,99,2.632,140,3.723,154,4.492,156,3.875,162,1.215,172,3.593,333,4.311,548,4.818,598,3.875,2786,6.962,2794,6.962,2806,6.962,2807,7.679]],["t/526",[3,0.604,7,1.797,47,1.535,49,1.321,50,1.156,71,0.618,73,1.29,74,0.554,77,2.302,99,1.46,105,1.249,125,1.366,126,2.527,127,1.419,128,1.773,129,1.217,140,3.04,150,2.037,154,2.492,156,2.15,162,0.674,172,1.993,200,3.281,247,2.744,281,1.767,333,2.392,348,2.261,352,2.822,375,5.704,450,3.118,464,3.862,548,2.673,598,2.15,1633,3.404,2787,6.782,2795,3.862,2808,4.26,2809,7.481,2810,6.292,2811,4.26,2812,4.26,2813,4.26,2814,4.26,2815,3.404,2816,4.26,2817,4.26,2818,4.26,2819,4.26,2820,3.862,2821,4.26,2822,4.26]],["t/528",[7,2.251,71,0.754,99,2.632,154,4.492,156,3.875,162,1.215,172,3.593,333,4.311,352,6.701,548,4.818,598,3.875,2788,6.962,2796,6.962,2806,6.962,2823,7.679]],["t/530",[7,2.176,71,0.714,99,2.491,140,2.674,154,4.251,156,3.667,162,1.15,172,3.401,200,3.598,247,4.681,333,4.08,348,3.858,352,6.845,548,4.56,598,3.667,2789,8.213,2798,6.588,2824,7.267]],["t/532",[3,0.819,7,2.122,18,2.525,49,1.169,71,0.567,73,0.845,74,0.56,99,1.979,114,3.621,115,2.059,156,2.913,162,0.913,281,2.19,398,4.563,477,5.233,548,3.621,598,2.913,1213,6.591,1360,5.233,1493,5.233,2790,7.071,2799,5.233,2820,5.233,2825,5.772,2826,5.772,2827,5.772,2828,5.772,2829,5.772,2830,5.772,2831,5.772]],["t/534",[7,2.332,71,0.8,99,2.79,156,4.108,162,1.288,548,5.107,598,4.108,2791,7.38,2801,7.38,2832,8.14,2833,8.14]],["t/536",[7,2.332,71,0.8,99,2.79,156,4.108,162,1.288,388,7.38,548,5.107,598,4.108,2792,7.38,2803,7.38,2834,8.14]],["t/538",[3,0.641,4,2.767,7,2.392,45,0.847,47,1.629,49,0.677,71,0.646,73,0.662,74,0.525,77,2.443,99,1.55,125,1.45,126,2.64,127,1.505,129,1.291,140,2.418,148,2.91,156,2.281,162,0.715,172,2.115,219,2.704,247,2.912,281,1.269,323,7.593,334,3.19,336,5.957,348,2.4,352,4.353,509,2.086,548,4.857,598,2.281,763,3.214,1256,4.098,1427,2.912,1495,7.705,1626,3.82,1633,3.612,2328,3.446,2793,5.957,2804,4.098,2835,4.521,2836,4.521,2837,4.521,2838,6.571,2839,4.521,2840,4.521,2841,4.521,2842,4.521,2843,4.521,2844,4.521,2845,4.521,2846,4.521]],["t/541",[1,2.124,3,0.597,4,2.576,7,2.501,18,1.739,45,0.788,48,0.857,49,1.177,50,1.214,56,1.857,61,3.698,71,0.902,73,1.15,74,0.518,88,1.697,97,0.874,105,1.24,109,1.287,125,0.818,140,1.977,148,1.582,149,1.404,150,2.018,152,2.576,153,1.866,154,1.492,155,2.317,157,3.799,162,0.666,170,3.08,181,1.404,215,5.622,219,3.213,250,0.613,273,0.774,287,2.517,288,3.363,289,2.155,290,2.155,291,2.155,292,2.155,293,2.155,294,2.155,295,2.155,296,2.155,297,2.155,298,1.461,299,2.155,300,2.155,301,1.689,302,1.866,303,2.155,304,2.155,305,3.556,306,2.155,307,2.155,308,1.866,309,1.944,310,2.038,311,2.155,312,2.155,313,1.088,314,1.741,315,4.57,316,3.556,317,3.363,318,1.561,319,2.155,320,1.944,321,2.038,322,2.155]],["t/543",[3,0.638,13,2.046,49,1.156,50,1.193,56,2.531,73,1.13,74,0.512,75,4.215,88,1.457,105,1.289,118,2.752,119,3.069,129,1.284,140,3.84,146,3.172,148,3.533,150,1.455,157,4.667,169,2.475,171,2.575,172,2.104,211,2.269,237,1.917,335,3.799,349,4.618,1482,3.592,1498,3.592,1667,3.063,1781,3.799,1835,2.895,1926,4.076,1992,2.475,2185,3.799,2212,4.076,2213,4.076,2737,3.799,2779,4.076,2780,5.933,2847,4.496,2848,4.496,2849,4.496,2850,4.496,2851,4.496,2852,4.496,2853,4.496,2854,4.496,2855,4.496]],["t/545",[0,1.79,1,1.712,3,0.28,11,3.32,21,1.505,45,1.304,48,1.499,49,1.101,50,1.136,56,0.913,61,1.869,65,1.445,73,1.076,74,0.545,81,2.128,97,1.163,99,0.677,105,1.227,130,1.131,140,3.245,148,1.275,150,0.639,157,1.087,172,4.331,177,2.298,180,1.669,183,4.472,185,1.79,200,2.584,211,1.712,215,2.077,223,1.685,229,1.048,237,0.842,255,1.239,281,1.486,355,3.613,384,1.03,387,1.465,392,1.505,428,3.806,482,0.727,549,0.899,598,0.996,636,2.711,986,1.445,1278,1.669,1298,3.768,1390,1.272,1427,1.272,1463,1.308,1467,2.606,1471,5.088,1473,1.505,1522,1.669,1553,1.505,1667,0.924,1686,1.348,1730,1.669,1756,2.029,1797,1.393,1810,1.445,1849,1.669,1998,1.79,2453,1.505,2574,1.79,2766,1.79,2856,1.975,2857,1.975,2858,2.867,2859,1.578,2860,1.975,2861,3.075,2862,1.79,2863,5.292,2864,5.292,2865,1.975,2866,1.975,2867,1.975,2868,1.975,2869,1.975,2870,4.762,2871,3.563,2872,1.975,2873,2.711,2874,3.392,2875,1.578,2876,1.79,2877,1.975,2878,3.075,2879,1.975,2880,1.975,2881,1.975,2882,1.975,2883,1.975,2884,1.79,2885,1.975,2886,1.975,2887,1.975,2888,1.578,2889,1.975,2890,1.975,2891,1.975,2892,1.975,2893,1.975,2894,1.975,2895,1.975,2896,3.392,2897,1.975,2898,1.975,2899,1.975,2900,1.975,2901,1.975,2902,1.975,2903,1.975,2904,1.975,2905,1.975,2906,1.975,2907,1.975,2908,1.975,2909,1.975,2910,1.975,2911,1.975,2912,1.975,2913,1.975,2914,1.975,2915,1.975,2916,1.79,2917,1.79,2918,1.79,2919,1.79,2920,1.975,2921,1.975,2922,1.975,2923,1.975]],["t/547",[3,0.811,8,0.923,11,1.395,12,1.695,30,1.273,45,0.912,48,2.148,49,0.957,50,0.884,61,0.785,73,0.837,74,0.541,76,1.925,88,0.42,105,0.955,116,2.568,136,1.432,140,2.105,148,0.835,149,1.224,155,2.066,156,1.122,157,2.681,172,2.99,177,1.325,252,0.762,277,0.936,287,1.329,334,1.568,348,1.992,384,1.957,387,1.62,402,1.273,549,1.708,563,1.361,623,1.361,644,2.015,826,1.518,917,1.695,986,1.627,1184,4.727,1236,1.695,1353,1.878,1390,1.432,1471,4.232,1503,2.015,1699,1.878,1792,1.472,1802,1.627,1849,1.878,1900,2.015,1957,4.917,2082,1.776,2088,2.015,2130,2.015,2737,1.878,2888,1.776,2924,8.585,2925,2.223,2926,2.223,2927,2.223,2928,3.752,2929,2.223,2930,3.752,2931,2.223,2932,2.223,2933,2.223,2934,2.223,2935,3.752,2936,2.223,2937,2.223,2938,2.223,2939,2.223,2940,2.223,2941,2.223,2942,2.223,2943,2.223,2944,2.223,2945,2.223,2946,2.223,2947,2.223,2948,2.223,2949,2.223,2950,3.402,2951,2.223,2952,2.223,2953,2.223,2954,3.563,2955,3.402,2956,2.223,2957,2.223,2958,3.752,2959,3.752,2960,2.223,2961,2.223,2962,2.223,2963,2.223,2964,2.223,2965,2.223,2966,2.223,2967,2.223,2968,1.878,2969,3.752,2970,2.223,2971,3.402,2972,2.223,2973,2.223,2974,2.223,2975,2.223,2976,5.72,2977,3.752,2978,4.869,2979,4.869,2980,4.869,2981,2.223,2982,4.869,2983,2.223,2984,3.752,2985,2.223,2986,2.223,2987,2.223,2988,2.223,2989,2.223,2990,2.223,2991,2.223,2992,2.223,2993,2.223,2994,2.223,2995,2.223,2996,2.223,2997,2.223,2998,2.223,2999,2.223,3000,2.223,3001,2.223,3002,2.223,3003,2.223]],["t/549",[3,0.754,8,1.309,20,2.929,21,4.055,45,0.996,49,1.105,50,1.14,56,1.985,67,3.753,73,1.08,74,0.494,83,2.642,97,2.528,99,3.292,105,0.888,108,1.468,129,1.519,130,3.047,131,3.607,138,2.875,140,1.957,148,3.182,150,1.722,156,2.684,157,2.929,213,2.714,215,3.256,219,3.181,250,2.196,273,2.24,282,2.96,308,3.892,314,3.631,315,3.523,321,4.25,323,4.055,648,3.722,1327,3.753,1398,4.495,1463,3.523]],["t/551",[1,3.955,7,1.396,33,4.102,45,1.089,61,3.352,71,0.571,74,0.553,116,2.61,117,3.969,126,2.335,128,2.419,140,2.139,146,4.102,250,2.13,331,3.142,352,5.191,354,4.645,355,3.969,356,4.645,357,4.645,358,4.645,359,4.645,360,4.645,361,4.645,362,4.912,363,4.912,364,4.912,365,4.912,366,4.912,367,4.912,2565,4.912,2888,4.645,3004,5.813]],["t/554",[7,1.529,8,1.858,19,5.874,45,1.192,48,1.455,49,0.649,50,0.669,73,1.105,74,0.499,88,1.202,99,2.588,105,0.723,108,1.195,114,2.716,129,1.236,131,2.117,138,2.339,150,2.06,156,2.184,169,2.383,177,1.529,198,0.953,200,1.719,203,6.033,236,2.479,237,1.846,240,1.338,313,3.55,423,1.918,487,2.937,509,2.937,564,1.997,646,3.459,1126,2.867,1292,3.167,1422,3.924,1423,2.955,1424,6.259,1474,7.018,1476,6.763,1477,3.924,1478,7.035,1479,4.658,1480,2.867,1850,3.657,3005,4.328,3006,4.328,3007,4.328,3008,4.328,3009,3.459,3010,4.328,3011,4.328,3012,3.924,3013,3.459]],["t/556",[3,0.656,7,1.111,8,1.138,19,6.906,20,2.546,47,1.666,49,0.693,50,0.715,71,0.454,73,0.677,74,0.544,96,2.195,105,0.772,114,2.901,125,2.142,126,2.683,127,1.54,129,1.321,131,2.261,138,2.499,155,2.546,160,1.795,195,3.907,229,2.454,261,2.83,331,2.499,487,2.133,545,3.484,564,2.133,717,2.499,763,2.261,1424,6.06,1474,3.383,1476,3.525,1508,3.262,2325,3.383,2343,6.944,2521,4.192,2647,4.192,2698,4.192,2699,4.192,2700,7.109,2701,4.192,2702,4.192,2703,4.192,2704,4.192,3012,4.192,3013,3.694,3014,4.624,3015,4.624,3016,4.624,3017,4.624,3018,4.624,3019,4.624,3020,4.624]],["t/559",[3,0.447,7,0.435,8,0.446,32,1.531,40,1.531,43,3.547,45,0.782,47,0.653,48,1.059,49,0.847,50,0.487,56,1.344,61,0.64,68,1.109,71,0.309,73,0.827,74,0.559,76,4.303,79,3.96,83,0.9,88,1.067,97,1.08,105,0.526,114,1.137,115,0.646,116,0.813,117,1.237,125,1.01,126,1.265,127,0.603,129,0.517,130,1.038,131,1.54,137,1.804,138,0.979,139,1.2,144,0.962,165,1.084,169,0.998,199,0.914,200,1.659,213,1.837,220,1.448,235,2.779,240,0.56,251,0.792,252,1.432,255,1.976,276,2.56,277,0.763,281,0.509,313,1.343,331,0.979,387,0.782,420,1.237,423,1.395,424,1.702,429,3.057,525,1.448,569,3.032,574,2.086,598,2.519,650,4.107,699,3.001,717,0.979,718,2.222,740,1.167,902,1.326,986,1.326,989,1.381,1311,3.408,1322,1.448,1337,2.852,1390,1.167,1394,1.2,1479,1.326,1509,1.2,1545,1.278,1549,2.028,1553,2.401,1578,1.448,1633,1.448,1689,1.326,1691,0.886,1756,1.084,1920,3.787,1978,1.643,2092,1.448,2103,1.531,2180,1.278,2446,1.448,2576,1.531,2660,1.643,2747,1.531,2950,2.855,2955,2.855,3021,1.812,3022,1.812,3023,1.812,3024,1.812,3025,1.812,3026,1.812,3027,1.812,3028,3.149,3029,1.812,3030,4.992,3031,1.812,3032,4.177,3033,1.812,3034,1.812,3035,4.177,3036,1.812,3037,1.812,3038,1.812,3039,1.812,3040,1.812,3041,1.812,3042,4.177,3043,1.812,3044,1.812,3045,1.326,3046,3.149,3047,1.812,3048,1.812,3049,1.812,3050,3.149,3051,1.812,3052,3.149,3053,1.812,3054,1.812,3055,1.812,3056,1.812,3057,1.812,3058,1.812,3059,1.812,3060,1.812,3061,1.812,3062,1.812,3063,1.812,3064,3.149,3065,1.812,3066,1.812,3067,1.812,3068,1.812,3069,1.812,3070,3.149,3071,1.812,3072,1.812,3073,1.812,3074,1.812,3075,1.812,3076,1.812,3077,1.812,3078,1.812,3079,1.812,3080,3.149,3081,1.812,3082,1.812,3083,1.812]],["t/561",[1,2.124,3,0.597,4,2.576,7,2.501,18,1.739,45,0.788,48,0.857,49,1.177,50,1.214,56,1.857,61,3.698,71,0.902,73,1.15,74,0.518,88,1.697,97,0.874,105,1.24,109,1.287,125,0.818,140,1.977,148,1.582,149,1.404,150,2.018,152,2.576,153,1.866,154,1.492,155,2.317,157,3.799,162,0.666,170,3.08,181,1.404,215,5.622,219,3.213,250,0.613,273,0.774,287,2.517,288,3.363,289,2.155,290,2.155,291,2.155,292,2.155,293,2.155,294,2.155,295,2.155,296,2.155,297,2.155,298,1.461,299,2.155,300,2.155,301,1.689,302,1.866,303,2.155,304,2.155,305,3.556,306,2.155,307,2.155,308,1.866,309,1.944,310,2.038,311,2.155,312,2.155,313,1.088,314,1.741,315,4.57,316,3.556,317,3.363,318,1.561,319,2.155,320,1.944,321,2.038,322,2.155]],["t/564",[3,0.707,8,0.773,18,1.017,38,1.971,50,0.957,71,0.692,73,0.906,74,0.553,88,1.677,99,1.077,105,1.034,119,2.145,129,1.768,149,1.73,157,1.73,162,0.497,211,1.585,223,1.56,240,0.971,246,2.217,273,1.513,276,1.611,284,1.928,387,2.151,392,2.395,463,1.865,487,1.449,615,1.536,658,1.838,660,5.848,746,2.081,813,5.42,815,2.217,826,3.401,1126,6.061,1159,2.655,1162,2.848,1274,2.51,1742,2.655,1756,1.879,1835,2.023,2076,5.953,2343,2.395,3084,2.655,3085,3.141,3086,3.141,3087,3.141,3088,3.141,3089,3.141,3090,3.141,3091,3.141,3092,3.141,3093,3.141,3094,3.141,3095,4.982,3096,4.982,3097,4.982,3098,3.141,3099,4.982,3100,3.141,3101,3.141,3102,3.141,3103,3.141,3104,2.395,3105,2.848,3106,6.19,3107,6.19,3108,3.141,3109,3.141,3110,3.141,3111,6.19,3112,4.982,3113,3.141,3114,3.141,3115,3.141,3116,3.141,3117,3.141]],["t/566",[3,0.881,45,1.535,50,1.266,71,0.61,73,1.199,74,0.555,105,1.368,140,2.286,150,2.011,162,0.983,172,2.907,200,2.467,284,1.701,387,2.683,428,5.363,463,1.645,1670,3.803,2873,4.964,2875,4.964,3118,6.213,3119,5.632,3120,8.193,3121,5.632,3122,5.632,3123,5.632]],["t/568",[3,1.049,7,2.39,49,1.373,50,1.144,63,3.796,71,0.727,73,1.083,74,0.456,105,1.236,108,2.043,142,4.643,162,1.171,284,2.025,463,1.959,1170,4.643,3124,7.4,3125,7.4,3126,7.4]],["t/570",[3,0.849,18,1.937,48,3.025,50,0.925,71,0.588,73,0.876,74,0.531,88,1.509,96,2.841,105,0.999,108,1.652,129,1.709,162,0.947,213,2.202,223,3.969,273,2.732,284,1.638,348,3.176,384,4.169,463,1.584,534,7.603,694,5.057,699,3.176,1292,5.848,1380,4.782,2416,8.157,3127,5.984,3128,7.992]],["t/572",[3,0.895,18,2.042,50,0.975,71,0.62,73,0.923,74,0.548,88,1.191,105,1.053,108,1.742,129,1.802,162,0.998,213,2.321,240,1.951,273,1.916,284,1.727,320,7.041,463,1.67,615,4.795,699,3.349,1194,7.805,3129,6.309,3130,6.309,3131,6.309,3132,6.309,3133,5.72]],["t/574",[3,0.995,49,1.051,50,1.085,71,0.689,73,1.027,74,0.543,88,1.673,105,1.172,129,2.004,162,1.11,284,1.921,387,3.03,463,1.858,475,4.519,549,3.193,783,6.361,1209,5.349,1835,4.519,3134,7.017,3135,7.017,3136,7.017]],["t/576",[3,0.861,19,4.285,45,1.138,49,0.91,50,1.248,52,1.649,71,0.597,73,1.327,74,0.514,75,5.198,105,1.014,129,1.735,131,2.97,138,3.282,150,1.966,162,0.961,284,1.663,298,3.479,314,4.146,420,3.169,463,1.608,466,3.224,1424,4.285,1474,4.444,1476,6.153,2325,5.906,3009,4.853,3013,4.853,3137,7.317,3138,6.074,3139,6.074,3140,6.074,3141,6.074]],["t/578",[3,0.849,45,1.121,48,2.012,49,1.348,50,0.925,51,3.663,56,2.151,60,3.428,61,2.113,63,3.07,71,0.588,73,0.876,74,0.498,76,3.07,83,2.972,84,3.663,105,0.999,108,1.652,116,2.687,152,4.892,162,0.947,254,2.927,284,1.638,462,3.755,463,1.584,466,3.176,545,4.694,772,4.379,1184,3.295,1372,6.753,1691,2.927,1957,3.428,1992,3.295,3142,5.984,3143,5.984,3144,5.984,3145,5.984]],["t/580",[3,0.709,4,1.93,45,0.936,46,2.404,48,1.06,49,0.749,50,0.487,51,1.93,56,0.849,60,1.806,61,1.114,63,1.618,71,0.31,73,0.731,74,0.524,76,1.618,83,1.566,84,1.93,88,0.943,105,0.527,108,0.871,116,1.416,127,1.05,133,1.845,136,2.031,152,4.711,160,1.225,162,0.499,181,1.736,200,1.984,223,1.566,229,1.674,235,2.892,240,2.531,281,0.885,284,0.863,313,1.345,384,1.645,423,3.128,447,2.153,462,1.979,463,0.835,466,1.674,509,2.306,545,2.607,563,3.059,569,2.824,603,3.963,615,3.764,648,1.591,658,2.923,660,3.411,663,3.993,664,3.993,667,4.222,668,3.993,669,4.222,683,2.665,699,3.294,811,2.859,1184,4.237,1311,3.411,1551,3.809,1689,2.308,1691,1.542,1835,2.031,1957,4.69,1992,1.736,2328,4.731,3009,2.52,3146,4.997,3147,3.154,3148,2.665,3149,2.665,3150,2.665,3151,2.859,3152,2.859,3153,3.154,3154,3.154,3155,3.154,3156,2.665,3157,2.665,3158,3.154,3159,2.665,3160,2.665,3161,3.154,3162,6.206,3163,3.154,3164,3.154,3165,3.154,3166,3.154,3167,3.154]],["t/582",[3,0.847,6,1.806,45,0.744,48,2.007,50,1.109,68,2.43,71,0.39,73,1.05,74,0.543,88,0.749,96,1.884,105,1.198,108,1.648,115,2.129,129,1.134,144,3.168,149,2.185,155,2.185,162,0.628,177,1.402,200,3.168,224,3.598,263,4.609,274,2.71,284,1.086,334,2.801,348,2.107,450,2.905,463,1.051,469,2.185,602,5.092,1118,5.411,1278,3.354,1287,2.905,1348,3.026,1756,2.374,1767,3.026,1792,3.953,1794,3.598,1810,4.368,1811,4.211,1822,2.905,1827,4.769,1832,3.354,1833,2.71,1887,5.411,1941,3.172,2092,3.172,3104,3.026,3168,3.969,3169,3.969,3170,3.969,3171,3.969,3172,3.969,3173,3.969,3174,3.969,3175,3.969,3176,3.969,3177,3.969,3178,3.598,3179,5.411,3180,3.969,3181,3.969,3182,3.969,3183,3.969]],["t/584",[2,4.341,3,0.902,49,0.953,50,0.983,63,3.262,71,0.625,73,0.931,74,0.521,105,1.062,116,2.855,117,5.679,142,3.989,162,1.006,168,5.081,169,3.501,235,3.126,284,1.74,349,4.486,463,1.683,525,5.081,1337,4.341,2888,5.081,3184,9.272,3185,6.359,3186,6.359,3187,6.359,3188,6.359,3189,6.359,3190,5.764,3191,6.359,3192,6.359]],["t/586",[1,3.635,2,4.918,16,5.491,43,4.519,48,2.422,49,1.079,59,4.519,71,0.708,116,3.234,117,4.918,118,4.409,162,1.14,211,3.635,284,1.972,313,3.072,410,6.087,414,5.082,463,1.907,466,3.823,467,7.613,688,6.53,1314,5.756,2526,6.087,3193,7.203]],["t/588",[3,0.717,48,1.699,50,0.781,71,0.497,73,0.74,74,0.541,88,1.779,96,2.399,105,0.844,108,1.965,129,1.444,148,1.9,162,0.8,181,2.783,200,2.007,235,1.9,240,1.563,252,2.824,263,2.593,274,3.451,277,2.129,278,4.271,284,1.384,447,3.451,463,1.338,602,5.19,1187,3.451,1228,3.566,1811,3.566,1827,4.039,2382,4.271,3151,4.582,3178,4.582,3179,4.582,3194,5.055,3195,5.055,3196,5.055,3197,5.055,3198,5.055,3199,5.055,3200,5.055,3201,5.055,3202,5.055,3203,5.055,3204,5.055,3205,5.055,3206,5.055,3207,5.055,3208,5.055]],["t/590",[3,0.813,45,1.074,48,2.96,49,1.163,50,0.886,51,3.508,52,1.556,60,3.283,61,2.024,63,2.94,71,0.563,73,0.839,74,0.517,76,2.94,83,2.847,84,3.508,88,1.662,105,0.957,108,1.582,116,2.573,129,1.637,162,0.907,177,2.024,181,3.156,221,3.508,284,1.569,447,5.3,463,1.517,466,3.042,482,3.239,509,2.644,602,4.673,1691,2.803,1992,3.156,3209,5.731,3210,3.796,3211,5.731,3212,5.731]],["t/592",[3,0.796,39,6.373,49,1.147,50,0.868,52,2.077,71,0.551,73,1.12,74,0.502,88,1.445,105,0.937,129,1.603,148,2.876,162,0.888,172,3.581,191,3.687,273,1.704,284,1.536,320,4.279,463,1.486,598,2.832,615,2.745,1194,4.743,1230,4.743,1269,4.743,1480,3.718,1767,5.834,1946,6.467,3213,5.613,3214,7.895,3215,5.613,3216,5.613,3217,5.613,3218,7.654,3219,8.709,3220,7.654]],["t/594",[3,0.775,18,1.768,30,3.129,45,1.407,50,0.844,71,0.537,73,1.099,74,0.547,105,0.912,129,1.56,131,4.742,138,4.06,162,0.864,211,2.756,223,2.713,273,2.281,284,1.495,313,2.329,463,1.446,615,2.671,660,3.729,813,3.854,815,5.3,1126,6.422,1549,4.838,2540,4.952,3221,5.462,3222,7.512,3223,5.462,3224,8.587,3225,5.462,3226,5.462]],["t/596",[2,4.241,3,0.881,38,5.14,49,1.228,50,0.96,71,0.61,73,1.199,74,0.504,88,1.173,105,1.037,162,0.983,171,3.559,191,4.88,196,4.241,200,2.467,284,1.701,462,3.898,463,1.645,469,3.421,482,2.286,569,2.827,603,3.488,681,5.25,699,3.298,1136,3.716,1797,4.384,3227,6.213,3228,4.964,3229,6.213,3230,5.25,3231,4.964,3232,4.964]],["t/598",[3,0.813,38,4.871,45,1.074,48,3.172,49,1.163,50,0.886,51,3.508,60,3.283,61,2.024,63,2.94,71,0.563,73,0.839,74,0.526,76,2.94,83,2.847,84,3.508,88,1.662,105,0.957,108,1.582,116,2.573,162,0.907,181,3.156,200,3.083,221,3.508,284,1.569,462,3.596,463,1.517,466,3.042,469,3.156,482,2.109,603,4.358,699,3.042,1691,2.803,1797,4.044,1992,3.156,3210,3.796,3233,5.731,3234,5.731]],["t/600",[71,0.842,162,1.356,252,2.937,284,2.346,463,2.269,2483,7.768,3235,8.569]],["t/602",[3,0.807,18,1.842,45,1.066,48,1.913,49,1.158,50,0.88,51,3.484,56,1.532,60,3.26,61,2.01,63,2.919,71,0.559,73,0.833,74,0.516,76,2.919,83,2.827,84,3.484,88,1.656,105,0.95,108,1.571,116,2.555,129,1.625,157,3.134,162,0.9,181,4.254,223,2.827,240,2.389,273,1.728,284,1.558,463,1.507,466,3.021,699,3.021,815,5.452,1390,3.665,1691,2.783,1992,3.134,2210,4.016,2477,5.159,2968,4.809,3210,3.77,3236,7.726,3237,5.691]],["t/604",[18,2.689,49,1.245,56,2.236,71,0.816,162,1.314,273,2.522,284,2.274,463,2.199,1670,5.085,3238,8.307]],["t/606",[3,0.78,18,1.78,45,1.03,48,1.849,49,1.131,50,0.85,51,3.366,56,1.48,60,3.15,61,1.942,63,2.821,71,0.54,73,0.805,74,0.511,76,2.821,83,2.731,84,3.366,88,1.627,105,0.918,108,1.518,116,2.469,129,1.571,157,3.028,162,0.87,181,4.155,213,2.023,223,2.731,240,1.7,273,1.67,284,1.505,463,1.456,466,2.919,699,2.919,815,3.88,1257,3.642,1390,3.541,1691,2.689,1992,3.028,2210,3.88,2968,4.647,3210,3.642,3239,5.499,3240,5.499,3241,5.499,3242,5.499,3243,5.499,3244,5.499,3245,5.499,3246,5.499,3247,5.499]],["t/608",[18,2.689,49,1.245,71,0.816,162,1.314,213,3.056,273,2.522,284,2.274,463,2.199,1670,5.085,3248,8.307]],["t/610",[3,1.096,49,1.41,50,1.356,71,0.559,73,1.377,74,0.504,88,1.458,105,1.465,129,1.625,139,3.77,140,2.094,162,0.9,172,2.663,200,2.26,284,1.558,384,2.969,387,2.458,424,3.076,428,3.329,463,1.507,549,3.516,1200,4.339,1362,3.329,2348,5.159,3137,5.159,3249,5.691,3250,5.691,3251,5.159,3252,5.691,3253,4.809,3254,5.691,3255,5.691,3256,5.159,3257,5.691,3258,5.691,3259,5.691,3260,5.691]],["t/612",[3,0.895,18,2.042,45,1.182,48,2.121,49,1.24,50,0.975,51,3.862,60,3.614,61,2.228,63,3.236,71,0.62,73,0.923,74,0.52,76,3.236,83,3.134,84,3.862,88,1.191,105,1.053,108,1.742,116,2.833,129,1.802,162,0.998,273,1.916,284,1.727,463,1.67,466,3.349,475,4.063,1386,5.72,1691,3.085,1992,3.474,3261,8.277,3262,5.72,3263,6.309,3264,6.309]],["t/614",[3,0.895,7,1.988,8,2.036,49,1.24,50,0.975,56,2.228,71,0.62,73,0.923,74,0.53,88,1.191,105,1.053,114,3.958,129,1.802,162,0.998,238,4.063,273,2.513,284,1.727,287,3.773,463,1.67,470,5.84,1111,4.452,1370,4.452,1371,6.759,1385,5.72,1442,5.331,2179,5.331,3265,6.309]],["t/616",[3,0.843,45,1.113,49,0.89,50,0.918,56,1.599,71,0.584,73,0.869,74,0.511,88,1.121,105,0.992,129,1.697,137,3.403,162,0.94,223,2.95,273,2.415,284,1.626,348,3.153,463,1.573,470,4.192,718,4.192,1167,6.326,1184,4.936,1228,5.611,1370,4.192,1371,5.82,1377,5.385,1888,5.385,2179,6.72,2220,5.385,2468,5.385,3266,7.953,3267,7.953,3268,5.941,3269,5.941]],["t/618",[3,0.819,18,1.868,49,1.169,50,0.892,56,1.554,71,0.567,73,0.845,74,0.527,88,1.09,105,0.964,115,2.783,129,1.649,157,4.295,162,0.913,172,2.701,211,2.913,223,2.867,240,3.056,251,3.412,252,1.979,273,1.753,284,1.58,463,1.528,545,3.011,615,4.321,699,3.064,808,4.877,813,4.073,825,4.612,826,3.94,1353,4.877,3084,4.877,3270,5.772,3271,5.772,3272,5.772,3273,5.772]],["t/620",[3,0.978,49,1.444,50,1.066,56,2.36,71,0.678,73,1.01,74,0.532,105,1.152,115,3.128,129,1.97,162,1.091,251,3.017,252,2.364,284,1.888,463,1.826,3274,8.767,3275,8.767,3276,6.898,3277,6.898]],["t/622",[3,0.687,45,0.907,49,1.035,50,0.749,71,0.476,73,1.011,74,0.547,88,1.304,96,2.299,105,0.809,108,1.337,125,1.553,162,0.766,200,3.683,211,2.444,235,2.595,240,2.488,273,1.471,284,1.326,313,2.945,423,3.06,429,6.788,463,1.282,615,3.936,658,4.708,660,5.495,1470,3.307,2180,6.191,2770,4.391,3278,4.844,3279,5.836,3280,4.093,3281,4.844,3282,7.414,3283,4.844,3284,4.844]],["t/624",[3,0.699,49,1.048,50,0.762,52,1.339,71,0.484,73,1.024,74,0.529,88,1.534,96,2.341,105,0.824,129,1.409,150,2.264,162,0.78,168,7.068,200,3.513,213,1.815,235,2.629,240,1.525,284,1.35,313,2.103,318,4.282,423,3.099,429,6.473,463,1.306,509,2.276,658,4.092,659,2.95,1480,3.267,1889,3.941,1941,3.941,2180,5.736,3279,5.911,3280,4.168,3282,6.869,3285,6.995,3286,4.932,3287,4.932,3288,4.932,3289,6.995,3290,4.932,3291,4.932,3292,4.932]],["t/626",[3,0.916,18,2.091,50,0.998,71,0.635,73,0.945,74,0.532,88,1.219,105,1.079,129,1.845,160,2.508,162,1.022,273,1.961,282,2.258,284,1.768,333,3.626,463,1.71,699,3.429,1151,4.924,1292,6.837,2712,5.856,3293,6.459,3294,5.856,3295,6.459,3296,6.459,3297,8.405,3298,8.405,3299,6.459,3300,6.459]],["t/628",[3,0.819,45,1.081,48,1.941,49,1.324,50,1.206,56,2.1,71,0.567,73,1.142,74,0.518,75,3.717,101,4.877,105,0.964,140,2.124,149,3.178,150,1.868,157,3.178,162,0.913,229,3.064,250,1.386,282,2.018,284,1.58,313,3.768,314,3.94,315,3.823,423,2.557,463,1.528,509,2.663,1671,8.01,1691,2.823,2210,4.073,2214,5.233,3301,5.772,3302,5.772,3303,7.8,3304,5.772,3305,5.772,3306,5.772]],["t/630",[3,1.022,18,2.332,49,1.079,50,1.113,71,0.708,73,1.054,74,0.448,88,1.36,105,1.203,108,1.988,148,2.707,162,1.14,172,3.37,213,2.65,223,3.578,273,2.187,281,2.022,284,1.972,462,4.519,463,1.907,1200,5.491,3307,7.203,3308,7.203,3309,7.203]],["t/632",[3,0.938,18,2.142,49,0.991,50,1.023,56,1.781,71,0.65,73,0.968,74,0.526,88,1.885,105,1.105,150,2.763,151,5.592,152,5.226,162,1.047,177,2.337,284,1.811,462,4.152,463,1.752,509,3.053,1480,4.383,1501,5.044,3310,6.617,3311,8.537,3312,6.617]],["t/634",[2,2.893,3,0.601,48,2.107,49,1.117,50,0.655,71,0.416,73,0.917,74,0.562,88,0.8,105,0.708,162,0.67,191,4.435,255,2.659,276,2.174,281,1.76,284,1.16,424,2.29,462,2.659,463,1.122,469,2.334,482,2.744,563,3.837,569,4.19,603,4.187,681,5.296,682,4.778,764,3.231,1136,2.535,1170,2.659,1357,3.581,1432,2.99,1734,3.842,1792,2.807,1969,3.581,3228,3.386,3230,3.581,3231,3.386,3232,3.386,3313,4.238,3314,5.296,3315,3.581,3316,4.238,3317,4.238,3318,4.238,3319,3.581,3320,3.386,3321,3.581,3322,3.581,3323,3.581,3324,3.581,3325,3.581,3326,3.581,3327,3.581]],["t/636",[3,0.796,49,1.305,50,1.346,60,3.215,61,1.982,71,0.551,73,1.479,74,0.502,105,1.454,129,2.487,130,3.215,131,2.745,140,3.442,150,2.477,156,2.832,157,3.09,162,0.888,235,2.109,282,3.045,284,1.536,315,5.069,419,4.107,463,1.486,500,4.485,509,2.59,648,3.862,1463,3.718,1550,4.485,3328,5.613,3329,5.613,3330,5.613]],["t/638",[3,0.909,45,1.2,48,2.155,49,1.253,50,0.991,51,3.923,56,1.725,60,3.671,61,2.263,63,3.287,71,0.63,73,0.938,74,0.522,76,3.287,83,3.183,84,3.923,88,1.21,105,1.07,108,1.769,116,2.877,129,1.83,162,1.014,284,1.754,418,4.021,463,1.697,466,3.402,549,2.916,1691,3.134,1992,3.529,2144,5.81,3331,6.409,3332,6.409,3333,6.409]],["t/640",[3,1.011,38,3.717,45,1.11,48,2.397,49,0.888,50,1.102,51,2.406,52,1.608,60,2.252,61,1.388,63,2.016,71,0.386,73,1.044,74,0.547,76,2.016,83,1.952,84,2.406,88,1.499,105,1.191,108,1.085,116,1.765,140,2.921,150,1.272,162,0.622,172,3.715,177,1.388,180,3.322,183,3.322,187,4.734,211,1.984,221,3.627,284,1.076,392,2.997,428,3.466,463,1.041,466,2.087,482,1.446,509,1.814,1170,2.466,1314,3.141,1471,3.925,1509,2.604,1691,1.922,1833,2.684,1992,2.164,2858,5.007,2861,3.564,2862,5.372,2873,3.141,2875,3.141,2916,3.564,2917,3.564,2918,3.564,2919,3.564,3119,3.564,3121,3.564,3122,3.564,3123,5.372,3210,2.604,3334,2.997,3335,3.931,3336,5.925,3337,3.931,3338,3.931,3339,3.931,3340,3.931,3341,3.931]],["t/642",[3,0.802,27,6.663,45,1.44,49,1.152,50,0.874,52,1.534,56,1.521,71,0.555,73,1.373,74,0.515,88,1.067,105,0.944,118,3.46,140,2.079,150,2.489,162,0.894,172,4.09,211,2.852,221,3.46,276,2.899,277,3.239,284,1.547,428,3.306,463,1.496,569,2.572,652,2.807,1257,3.743,1344,3.858,1940,4.776,2954,5.627,3253,4.776,3334,4.308,3342,5.652,3343,5.652,3344,5.652,3345,5.652,3346,5.652,3347,5.652]],["t/644",[3,1.122,45,1.482,50,0.912,71,0.579,73,1.158,74,0.521,105,0.985,127,1.964,148,2.974,150,1.909,162,0.933,172,3.703,229,3.13,235,3.357,284,1.614,313,2.515,428,4.63,463,1.561,509,2.721,563,3.61,648,2.976,699,4.201,1257,5.242,1311,4.026,1739,5.346,3104,4.496,3253,4.983,3348,4.983,3349,5.897,3350,5.897,3351,5.897,3352,5.897,3353,5.897,3354,5.897]],["t/646",[3,0.888,50,0.968,56,1.685,71,0.615,73,0.916,74,0.529,88,1.737,105,1.045,148,3.095,162,0.99,169,3.447,177,2.211,181,3.447,229,3.323,282,2.189,284,1.714,463,1.657,509,2.889,549,2.849,598,3.159,648,3.159,741,4.032,1480,4.147,1667,2.929,1696,6.58,1992,3.447,2746,5.29,2873,5.002,3355,5.676,3356,6.261,3357,6.261,3358,6.261]],["t/648",[3,0.995,18,3.144,50,1.085,56,2.386,71,0.689,73,1.027,74,0.534,88,1.673,105,1.172,129,2.004,162,1.11,169,3.863,284,1.921,463,1.858,480,4.648,1209,6.756,1384,5.929,3359,7.017]],["t/650",[3,1.193,49,0.572,50,1.3,71,0.57,73,1.231,74,0.566,88,0.721,99,1.31,105,1.306,129,2.403,140,1.406,154,2.235,162,0.604,169,2.103,172,1.788,181,2.103,251,1.671,284,1.046,333,2.144,463,1.535,623,4.29,902,4.243,1572,5.257,1670,2.338,3045,2.795,3360,3.463,3361,8.412,3362,8.412,3363,3.82,3364,3.82,3365,3.82,3366,3.82,3367,3.82,3368,3.82,3369,3.82,3370,3.82,3371,3.82,3372,3.82,3373,3.82,3374,3.82,3375,3.82,3376,3.82,3377,3.82,3378,3.82,3379,5.798,3380,3.82,3381,3.82,3382,3.82,3383,7.008,3384,3.82,3385,3.82,3386,3.82]],["t/652",[3,0.74,45,0.977,48,2.446,49,1.256,50,0.806,51,3.193,52,1.416,60,2.988,61,1.842,63,2.676,71,0.512,73,0.763,74,0.514,76,2.676,83,2.591,84,3.193,88,1.864,105,0.871,108,1.44,116,2.342,129,1.49,140,1.919,154,3.052,162,0.825,169,2.872,172,2.441,177,1.842,211,2.632,221,3.193,284,1.428,333,4.085,463,1.381,466,2.769,482,1.919,509,2.407,623,5.13,1691,2.551,1833,3.561,1992,2.872,3045,3.817,3210,3.455,3387,5.217,3388,5.217,3389,5.217,3390,5.217,3391,5.217,3392,8.38,3393,5.217]],["t/654",[3,0.717,48,1.699,49,1.234,50,0.781,52,1.372,56,1.361,71,0.497,73,0.74,74,0.531,88,0.954,105,0.844,115,3.363,118,3.094,129,1.444,140,1.86,154,2.957,162,0.8,169,2.783,172,3.855,177,1.785,221,3.094,241,3.853,251,4.277,252,2.44,284,1.384,333,3.996,348,2.683,463,1.338,482,1.86,509,2.332,623,4.357,652,2.51,1470,3.451,1700,3.566,3045,3.699,3210,3.348,3360,4.582,3394,6.015,3395,4.271,3396,5.055,3397,7.118,3398,7.118,3399,7.118]],["t/656",[3,0.695,27,5.31,48,1.648,49,1.214,50,0.758,52,1.891,56,1.32,71,0.482,73,0.717,74,0.522,88,0.925,105,0.819,118,3.001,129,1.4,140,1.804,154,2.868,162,0.776,169,2.699,172,3.791,177,1.731,211,2.474,221,4.264,241,3.737,276,3.573,284,1.342,333,3.91,348,2.602,387,3.498,428,2.868,463,1.298,482,1.804,509,2.262,623,4.264,652,2.435,902,5.929,1344,3.347,1470,3.347,1700,3.459,3045,3.587,3210,3.247,3334,3.737,3395,4.142,3400,8.822,3401,4.902,3402,4.902,3403,6.965,3404,6.965,3405,6.965,3406,4.902]],["t/658",[3,0.708,27,5.379,48,1.678,49,1.226,50,0.772,52,1.915,56,1.344,71,0.49,73,0.731,74,0.517,88,0.942,105,0.834,118,3.056,129,1.426,140,1.837,154,2.921,162,0.79,169,2.749,172,3.829,177,1.763,211,2.519,221,4.319,241,3.806,276,3.619,277,2.972,284,1.367,333,3.961,348,2.65,387,4.206,428,2.921,463,1.322,482,1.837,509,2.303,623,4.319,652,2.48,1344,3.408,1470,3.408,1700,3.523,1756,2.986,2954,5.163,3045,3.653,3210,3.307,3334,3.806,3395,4.219,3407,4.993,3408,4.993,3409,4.993,3410,4.993,3411,7.056]],["t/660",[3,0.94,4,2.799,45,1.241,46,3.485,49,0.685,50,0.707,71,0.449,73,0.97,74,0.546,88,1.471,105,0.763,127,1.522,129,1.306,133,2.674,150,1.48,160,1.775,162,0.723,172,3.1,181,2.517,200,2.631,229,2.427,235,2.928,240,1.413,281,1.284,284,1.251,313,1.949,384,2.385,447,3.121,463,1.21,509,3.057,563,2.799,569,3.546,623,4.77,648,2.307,699,4.136,1311,3.121,1769,3.485,1957,3.795,3104,3.485,3148,3.863,3149,3.863,3150,3.863,3156,3.863,3157,3.863,3159,3.863,3160,3.863,3348,3.863,3412,6.625,3413,4.572,3414,4.572,3415,4.572,3416,4.572,3417,4.144,3418,4.144,3419,4.144,3420,4.572]],["t/662",[3,0.868,49,0.917,50,0.946,71,0.601,73,1.187,74,0.55,105,1.022,129,1.748,162,0.968,169,3.369,235,2.3,240,1.892,254,2.993,255,6.079,277,2.577,284,1.675,463,1.62,764,4.665,994,4.318,1642,4.89,3421,6.119,3422,6.119,3423,9.099,3424,6.119,3425,6.119,3426,6.119,3427,6.119,3428,6.119,3429,6.119]],["t/664",[3,1.046,18,1.722,49,1.489,50,1.309,52,1.444,71,0.522,73,1.338,74,0.507,88,1.004,105,1.414,116,2.388,129,1.519,148,1.999,162,0.841,199,2.684,211,2.684,223,4.205,277,2.24,284,1.456,463,1.408,549,2.421,741,3.426,767,4.69,882,4.495,885,4.055,1501,4.055,2037,3.523,2859,4.25,2954,3.892,3262,4.822,3430,5.319,3431,5.319,3432,5.319,3433,5.319,3434,5.319,3435,5.319,3436,5.319,3437,5.319,3438,5.319,3439,7.376]],["t/666",[3,0.663,8,1.657,18,1.514,49,1.182,50,1.22,52,1.269,71,0.459,73,1.264,74,0.509,88,0.883,105,1.318,129,1.336,140,2.478,149,2.575,162,0.74,172,2.188,181,2.575,199,2.36,200,2.674,211,3.398,223,3.345,229,2.482,240,1.446,269,3.565,277,1.97,284,1.28,298,2.679,384,2.44,428,3.94,447,3.193,463,1.238,482,1.721,623,5.285,659,2.797,741,3.012,767,4.429,885,3.565,1501,3.565,1670,2.863,2037,3.098,2859,3.737,2875,3.737,2876,4.24,2884,4.24,2954,3.422,3013,6.306,3440,4.677,3441,4.677,3442,6.735,3443,4.677,3444,4.677,3445,4.677,3446,4.677,3447,4.677]],["t/668",[3,0.759,18,1.733,49,1.273,50,1.313,52,1.453,63,3.801,71,0.526,73,1.342,74,0.495,88,1.011,105,1.419,129,1.529,139,3.546,162,0.847,199,2.702,211,2.702,221,3.277,223,3.68,240,1.655,273,1.626,277,2.255,284,1.466,463,1.417,549,3.372,741,4.772,767,4.703,813,3.778,885,4.082,1472,4.854,1501,4.082,2037,3.546,2859,4.278,2954,3.918,3251,4.854,3256,4.854,3334,4.082,3448,5.354,3449,5.354,3450,4.854,3451,5.354,3452,5.354,3453,5.354,3454,5.354]],["t/670",[19,6.055,20,3.673,45,1.608,52,2.33,71,0.655,73,0.976,88,1.62,118,4.084,159,4.882,162,1.055,213,2.455,229,3.541,250,1.602,284,1.826,313,2.845,423,2.956,463,1.766,659,3.99,813,4.707,1409,6.048,1424,6.055,1465,6.048,1474,6.28,1476,6.542,1478,5.637,3009,5.331,3455,6.671]],["t/672",[3,1.059,49,1.119,50,1.154,56,2.48,71,0.734,73,1.093,74,0.519,105,1.247,129,2.133,162,1.181,284,2.044,463,1.977,3456,9.214,3457,6.77,3458,7.468,3459,7.468]],["t/674",[3,0.906,4,2.664,45,1.197,46,3.317,49,0.652,50,0.673,56,1.72,71,0.427,73,0.935,74,0.542,88,1.43,105,0.727,127,1.449,129,1.243,133,2.546,136,2.803,150,1.409,160,1.69,162,0.688,181,3.519,200,3.008,229,2.31,235,2.846,240,1.345,273,1.941,281,1.222,284,1.191,313,1.856,384,2.27,447,4.363,463,1.152,509,3.494,563,2.664,569,3.447,648,2.196,699,4.02,1311,2.971,1769,4.872,1957,3.661,2284,3.945,2328,5.774,3104,3.317,3148,3.677,3149,3.677,3150,3.677,3156,3.677,3157,3.677,3159,3.677,3160,3.677,3348,3.677,3417,3.945,3418,3.945,3419,3.945,3460,6.391,3461,4.352,3462,4.352,3463,4.352,3464,4.352,3465,4.352]],["t/676",[3,1.022,49,1.35,50,1.113,71,0.708,73,1.054,74,0.512,105,1.203,129,2.057,131,4.406,138,3.893,162,1.14,213,3.315,281,2.022,284,1.972,463,1.907,3457,6.53,3466,9.01,3467,7.203]],["t/678",[3,0.824,38,3.647,49,1.174,50,1.211,61,2.053,71,0.571,73,1.298,74,0.472,77,3.142,105,1.309,140,2.139,148,2.185,150,2.537,156,4.475,157,3.201,162,0.92,282,2.74,284,1.591,463,1.539,648,2.933,652,2.887,727,5.27,741,3.744,763,2.843,1463,3.85,1480,3.85,1992,3.201,2043,4.912,2443,4.645,2448,4.912,2670,5.27,2746,4.912,3320,4.645,3355,7.105,3468,5.813,3469,5.813,3470,5.813,3471,5.813,3472,5.813]],["t/680",[3,1.018,49,1.347,50,1.11,61,1.807,71,0.705,73,1.051,74,0.554,105,1.199,140,3.309,156,2.583,157,2.818,162,0.81,200,2.032,235,1.923,250,1.229,284,1.401,315,4.756,348,2.717,402,2.932,463,1.355,569,3.268,648,2.583,1151,3.902,1395,2.105,1642,4.09,3473,5.118,3474,5.118,3475,8.295,3476,5.118,3477,5.118,3478,5.118,3479,5.118,3480,7.181,3481,5.118,3482,5.118,3483,5.118,3484,7.181,3485,5.118]],["t/682",[2,3.193,3,0.663,45,0.876,49,1.009,50,0.723,71,0.459,73,0.986,74,0.561,88,0.883,105,0.781,148,1.758,150,1.514,162,0.74,191,4.731,255,2.934,281,1.891,284,1.28,424,2.527,462,2.934,463,1.238,482,1.721,563,2.863,569,4.337,603,3.781,682,5.134,1136,4.028,1432,3.3,1969,5.691,3228,5.381,3230,3.952,3231,3.737,3232,3.737,3314,3.952,3315,3.952,3319,3.952,3320,3.737,3321,3.952,3322,3.952,3323,3.952,3324,3.952,3325,3.952,3326,3.952,3327,3.952,3486,4.677]],["t/684",[2,3.052,3,0.634,45,0.838,49,0.977,50,0.691,71,0.439,73,0.954,74,0.56,88,0.844,105,0.747,148,1.68,150,1.447,162,0.707,191,4.667,222,3.155,255,2.805,281,1.83,284,1.224,424,2.416,462,2.805,463,1.184,482,1.645,563,2.737,569,4.27,603,3.659,682,4.969,1136,3.899,1432,3.155,1728,5.268,1831,3.778,3228,5.209,3231,3.573,3232,3.573,3314,3.778,3315,3.778,3319,3.778,3320,3.573,3321,3.778,3322,3.778,3323,3.778,3324,3.778,3325,3.778,3326,3.778,3327,3.778,3487,4.471,3488,4.471,3489,4.471]],["t/686",[3,1.059,18,2.417,71,0.734,74,0.497,115,2.664,150,2.417,162,1.181,252,2.56,284,2.044,333,4.192,395,5.269,463,1.977,480,4.946,1228,6.501,1384,6.31,1940,6.31,3394,6.31,3490,7.468]],["t/688",[3,0.992,8,1.213,18,1.596,30,2.825,45,0.924,49,1.218,50,1.081,71,0.798,73,1.367,74,0.523,79,2.769,88,0.931,105,1.168,108,1.361,129,1.998,130,2.825,131,4.744,138,4.393,150,1.596,162,1.107,213,1.815,240,1.525,254,2.412,277,2.077,284,2.225,463,2.152,487,2.276,545,2.573,642,3.76,654,4.471,672,3.609,1372,4.168,2106,4.471,2210,3.48,2672,4.471,3491,4.932,3492,4.932,3493,4.932,3494,4.932,3495,4.932,3496,4.932,3497,4.932,3498,4.932,3499,4.932]],["t/690",[3,1.014,18,1.646,45,0.953,49,1.239,50,1.105,52,1.381,71,0.5,73,1.21,74,0.47,88,0.96,99,1.744,105,1.194,108,1.973,115,1.814,148,2.687,149,2.8,150,1.646,162,0.805,169,2.8,191,3.982,211,2.567,213,1.871,236,2.913,240,1.572,246,5.044,251,2.224,252,1.744,268,3.722,273,1.544,284,1.392,348,2.7,402,2.913,463,1.347,469,2.8,509,2.347,549,3.253,615,2.487,693,4.298,699,2.7,1269,4.298,1274,4.064,1471,3.369,1742,4.298,1835,3.276,2037,3.369,2103,4.298,2878,4.611,3214,4.611,3500,5.086,3501,5.086,3502,4.611,3503,5.086,3504,5.086,3505,5.086,3506,5.086]],["t/692",[3,0.843,45,1.113,49,1.192,50,0.918,70,4.192,71,0.584,73,1.164,74,0.511,105,0.992,108,1.64,130,3.403,131,3.889,138,3.21,162,0.94,199,4.013,213,2.186,240,1.837,277,2.502,284,1.626,463,1.573,545,4.149,767,4.599,950,7.21,1337,5.429,1578,4.747,1689,4.347,1833,4.056,2037,3.935,2210,4.192,3502,5.385,3507,5.941,3508,7.953,3509,5.941,3510,5.941]],["t/694",[3,0.954,18,2.177,48,2.261,50,1.04,71,0.661,73,0.984,74,0.529,88,1.629,105,1.123,108,1.857,129,1.921,162,1.064,223,3.341,240,2.667,273,2.043,284,1.841,463,1.781,482,2.475,615,3.29,699,3.57,815,6.088,2478,6.098,2479,6.098,3294,6.098,3450,6.098]],["t/696",[3,0.686,45,0.567,48,1.625,49,1.204,50,0.747,71,0.475,73,0.707,74,0.539,88,1.655,97,1.657,105,0.807,108,0.835,109,1.526,115,1.724,152,1.852,162,0.478,177,1.068,198,0.666,235,1.137,240,2.132,252,1.657,269,3.685,281,0.849,287,1.809,298,2.769,313,1.29,420,2.37,487,1.396,545,1.578,563,1.852,569,2.2,574,2.003,751,3.685,772,3.537,1182,2.891,1184,2.661,1234,2.742,1287,2.213,1467,1.323,1470,4.122,1549,3.113,1551,4.602,1688,2.556,1835,1.948,1957,2.769,2082,3.862,2180,3.411,2227,2.742,2325,2.213,2382,2.556,2971,4.382,3511,3.025,3512,3.025,3513,3.025,3514,3.025,3515,4.834,3516,4.834,3517,4.834,3518,6.037,3519,6.037,3520,4.834,3521,3.025,3522,8.039,3523,4.834,3524,3.025,3525,4.834,3526,3.025,3527,3.025,3528,3.025,3529,3.025,3530,3.025,3531,3.025,3532,3.025,3533,3.025,3534,6.037,3535,3.025,3536,3.025,3537,3.025,3538,3.025,3539,3.025,3540,3.025,3541,3.025,3542,3.025,3543,4.834,3544,4.834,3545,4.834,3546,3.025,3547,3.025,3548,3.025,3549,3.025,3550,3.025,3551,3.025,3552,3.025]],["t/698",[3,0.978,50,1.066,59,5.5,70,4.867,71,0.678,73,1.01,74,0.532,105,1.152,108,1.904,129,1.97,162,1.091,223,3.426,284,2.638,313,2.941,414,4.867,463,1.826,598,3.481,650,5.807,3553,6.898,3554,6.898,3555,6.898]],["t/700",[71,0.842,162,1.356,252,2.937,284,2.346,463,2.269,3556,8.569,3557,8.569]],["t/702",[3,0.895,18,2.042,49,1.384,50,1.428,56,1.698,71,0.62,73,1.352,74,0.52,105,1.542,108,1.742,150,2.042,162,0.998,211,3.184,213,2.321,277,2.657,281,1.771,284,2.265,463,1.67,767,3.236,3190,5.72,3558,6.309,3559,6.309,3560,6.309,3561,6.309,3562,6.309,3563,6.309,3564,6.309]],["t/704",[3,0.874,45,1.155,49,0.924,50,0.953,52,1.674,56,1.66,71,0.606,73,0.902,74,0.527,88,1.539,105,1.029,129,1.761,141,4.927,142,3.868,162,0.975,200,2.448,277,2.597,284,1.688,308,4.512,333,3.461,463,1.632,475,3.971,764,4.7,1187,4.209,1756,3.688,2858,5.21,3565,9.133,3566,6.166,3567,6.166,3568,6.166,3569,6.166,3570,6.166,3571,8.152,3572,6.166]],["t/706",[3,0.836,18,1.909,50,0.912,70,4.161,71,0.579,73,0.863,74,0.55,88,1.494,105,0.985,108,1.628,129,1.684,162,0.933,191,2.841,223,2.929,240,2.447,273,1.791,284,2.166,463,1.561,615,2.884,660,4.026,808,4.983,813,5.584,825,4.712,826,5.403,1159,4.983,1274,4.712,1338,3.906,3105,5.346,3133,5.346,3573,5.897,3574,5.897,3575,5.897,3576,5.897,3577,5.897]],["t/708",[3,0.916,49,1.259,50,0.998,59,5.862,71,0.635,73,0.945,74,0.523,105,1.079,108,2.579,129,1.845,162,1.022,281,1.814,284,2.557,414,4.558,463,1.71,598,4.241,650,5.567,671,5.458,1833,4.41,2523,7.619,2663,7.619,3578,6.459]],["t/710",[3,0.735,50,0.801,71,0.509,73,0.759,74,0.543,88,0.978,105,0.865,109,2.616,129,1.48,155,2.854,162,0.82,211,2.616,213,1.907,273,2.536,284,1.419,298,2.969,418,5.673,463,1.372,469,2.854,551,3.763,598,4.214,694,4.38,699,3.845,746,4.798,1126,5.532,1153,8.625,1200,3.951,1338,4.798,1380,4.142,1392,4.38,1463,3.433,2075,4.699,3579,5.183,3580,5.183,3581,7.245,3582,5.183,3583,5.183]],["t/712",[3,0.938,50,1.023,71,0.65,73,1.249,74,0.514,105,1.105,129,1.89,131,4.884,138,5.108,162,1.047,254,3.236,277,2.787,284,1.811,313,2.822,463,1.752,569,3.011,1482,5.287,2229,5.592,2815,5.287,2870,5.287,2871,5.287,3584,5.592,3585,6.617,3586,6.617,3587,5.592]],["t/714",[3,0.902,50,0.983,71,0.625,73,1.218,74,0.521,75,4.095,88,1.57,105,1.062,129,1.816,131,5.121,138,5.011,162,1.006,277,2.678,284,1.74,313,2.711,463,1.683,569,2.894,1553,4.847,2815,5.081,2870,5.081,2871,5.081,3584,5.373,3587,5.373,3588,6.359,3589,6.359,3590,6.359]],["t/716",[3,0.946,50,1.031,71,0.655,73,1.256,74,0.515,88,1.62,105,1.114,129,1.905,131,4.899,138,5.128,162,1.055,277,2.81,284,1.826,463,1.766,569,3.036,2815,5.331,2870,5.331,2871,5.331,3584,5.637,3587,5.637,3591,6.671,3592,6.671,3593,6.671]],["t/718",[3,0.916,50,0.998,56,2.515,71,0.635,73,0.945,74,0.523,81,4.053,105,1.079,115,2.998,129,1.845,144,3.429,162,1.022,252,2.214,273,1.961,284,1.768,333,3.626,463,1.71,699,3.429,1184,4.628,1407,5.161,1410,4.924,1686,4.41,3084,5.458,3394,5.458,3594,8.405,3595,6.459,3596,6.459,3597,6.459]],["t/720",[3,0.759,8,1.823,45,1.003,49,0.802,50,0.828,71,0.526,73,1.084,74,0.537,88,1.399,96,2.542,105,0.894,108,1.478,125,1.717,129,1.529,162,0.847,200,2.942,211,2.702,235,2.785,240,1.655,273,1.626,284,1.466,313,3.16,423,3.283,429,5.422,463,1.417,615,2.618,663,5.92,664,4.278,1470,3.655,1508,3.778,2180,3.778,3152,4.854,3279,6.261,3280,4.524,3282,4.524,3598,5.354,3599,5.354,3600,5.354,3601,5.354,3602,5.354,3603,5.354,3604,5.354,3605,5.354,3606,5.354]]],"invertedIndex":[["",{"_index":74,"t":{"6":{"position":[[531,1],[533,2],[586,2],[605,2],[608,3],[612,1],[810,1],[812,2],[865,2],[884,2],[906,2],[967,2],[985,2],[1018,2],[1021,3],[1025,1],[1167,1],[1169,2],[1205,2],[1242,2],[1245,3],[1249,2],[1461,2],[1505,2]]},"8":{"position":[[143,1],[149,2],[202,1],[241,2],[264,1]]},"10":{"position":[[329,2],[639,2],[685,3],[727,1],[766,2],[780,2],[867,1],[897,1],[899,1],[920,2],[923,2],[962,2],[984,2],[1062,1],[1084,2],[1087,2],[1090,1],[1119,1],[1121,1],[1141,2],[1144,2],[1158,1],[1198,2],[1211,2],[1297,1],[1330,1],[1332,1],[1349,2],[1352,2],[1375,2]]},"12":{"position":[[271,2]]},"17":{"position":[[349,2],[352,2],[388,2],[391,2],[429,2],[432,2],[480,2],[549,2],[868,2],[871,2],[914,2],[917,2],[962,2],[965,2],[1188,2],[1276,1],[1278,2],[1366,2],[1444,2],[1509,2],[1559,2],[1627,2],[1676,2],[1738,2],[1784,2],[1850,2],[1905,2],[1974,2],[2025,2],[2072,2],[2075,2],[2105,1],[2172,2],[2219,2],[2286,2],[2289,2],[2347,2],[2423,2],[2426,2],[2475,2],[2546,2],[2549,2],[2598,1],[2608,2],[2752,1],[2781,2]]},"19":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"21":{"position":[[133,1],[139,2],[160,2],[201,2],[219,1],[271,1],[309,2],[343,1]]},"23":{"position":[[156,1],[162,2],[181,2],[200,2],[221,2],[325,2],[351,2],[383,2],[419,2],[422,2],[425,1]]},"25":{"position":[[146,1],[152,2],[171,2],[201,2],[212,2],[241,2],[277,2],[318,2],[337,2],[366,2],[402,2],[443,2],[490,1]]},"27":{"position":[[186,1],[192,2],[249,1],[288,2],[355,2],[385,2],[428,1]]},"29":{"position":[[119,1],[125,2],[167,1],[171,2],[174,3],[178,1]]},"35":{"position":[[112,1],[139,1],[152,1],[166,1],[172,2],[257,2],[292,3],[296,1],[298,2],[347,1],[356,1],[358,1],[360,1],[411,1],[419,1],[421,1],[423,2],[426,1],[428,1],[480,1],[488,1],[490,1],[492,2],[495,1],[497,1],[553,1],[555,1],[557,1]]},"37":{"position":[[126,1],[153,1],[166,1],[180,1],[186,2],[373,2],[451,2],[486,3],[490,1],[492,2],[539,1],[548,1],[550,1],[552,1],[596,4],[616,2],[619,1],[685,2],[688,1],[760,1],[762,2],[765,1],[767,1],[795,3],[807,4],[827,2],[830,1],[858,3],[893,2],[896,1],[924,3],[962,1],[964,2],[979,1],[981,1],[1055,1],[1057,2],[1072,1],[1074,1],[1148,1],[1150,2],[1158,1]]},"39":{"position":[[111,1],[138,1],[151,1],[165,1],[171,2],[230,2],[275,3],[279,1],[281,2],[328,1],[337,1],[381,4],[401,1]]},"41":{"position":[[211,1],[217,2],[272,1],[336,2],[379,3],[383,1],[385,2],[412,1],[421,1],[423,1],[468,4],[488,1],[490,1]]},"43":{"position":[[39,1],[51,2]]},"47":{"position":[[113,2],[157,2]]},"49":{"position":[[307,1],[349,1],[453,2],[456,1]]},"51":{"position":[[194,1],[236,1],[340,2],[343,1]]},"53":{"position":[[390,1],[432,1],[607,2],[610,1]]},"55":{"position":[[439,1],[481,1],[656,2],[659,1]]},"57":{"position":[[205,2],[295,1]]},"59":{"position":[[347,2],[427,1],[454,2],[457,2],[516,2],[519,2],[562,2],[565,2],[585,2],[681,2],[706,2],[723,2],[772,2],[790,1],[800,2],[855,2],[858,2],[875,1]]},"64":{"position":[[58,2]]},"68":{"position":[[40,2],[62,2],[156,2],[174,2],[181,1],[194,1],[213,2],[226,2],[229,3]]},"70":{"position":[[380,2],[383,3]]},"72":{"position":[[448,2],[460,2],[470,2],[480,2],[490,2]]},"74":{"position":[[134,2],[137,3]]},"76":{"position":[[190,2],[193,3]]},"78":{"position":[[429,2],[432,3]]},"80":{"position":[[197,2],[200,3]]},"82":{"position":[[210,2],[213,3]]},"84":{"position":[[158,2],[161,3]]},"86":{"position":[[201,2],[204,3]]},"88":{"position":[[241,2],[244,3]]},"90":{"position":[[148,2],[214,2],[217,2],[235,2],[297,2],[325,2],[328,2],[343,1],[386,2],[389,2],[459,2],[490,2],[493,2],[737,2],[740,3]]},"92":{"position":[[182,2],[185,3]]},"94":{"position":[[178,2],[181,3]]},"96":{"position":[[109,2],[166,2],[169,2],[236,2],[331,2],[388,2],[391,3]]},"98":{"position":[[162,2],[228,2],[231,2],[298,2],[402,2],[468,2],[471,3],[772,2],[775,3],[1153,2],[1156,3],[1225,2],[1289,1],[1291,2],[1347,2],[1387,2],[1436,1],[1448,2],[1502,2],[1505,2],[1580,2],[1690,2],[1754,2],[1859,2],[1862,3]]},"100":{"position":[[168,2],[171,3]]},"102":{"position":[[138,2],[141,3]]},"104":{"position":[[217,2],[220,3]]},"106":{"position":[[188,2],[191,3]]},"108":{"position":[[98,2],[131,2],[175,2],[229,1],[255,2],[258,3]]},"110":{"position":[[157,2],[160,3]]},"112":{"position":[[154,2],[157,3]]},"114":{"position":[[158,2],[161,3]]},"116":{"position":[[97,2],[116,2],[119,3]]},"118":{"position":[[255,2],[300,2],[303,3]]},"120":{"position":[[190,1],[216,2],[219,3]]},"122":{"position":[[158,2],[175,2],[178,3]]},"124":{"position":[[146,2],[164,2],[167,3]]},"126":{"position":[[232,2],[252,2],[255,3]]},"128":{"position":[[268,1],[287,2],[312,2],[315,2],[318,3]]},"130":{"position":[[46,1],[58,1],[66,2],[96,1],[105,2],[135,1],[144,2],[173,1],[181,2],[212,1],[222,2],[247,1],[258,2],[291,1],[303,2],[336,1],[348,2],[379,1],[389,2],[418,1],[426,1],[468,1],[482,1],[508,1],[536,1],[570,1],[610,1],[657,1],[704,1],[758,1],[805,1],[852,1],[904,1],[958,1],[1018,1],[1084,1],[1157,1],[1199,1],[1252,1],[1269,1],[1275,2],[1319,1],[1325,2],[1361,1],[1367,2],[1402,1],[1408,2],[1429,1],[1435,2],[1468,1],[1474,2],[1508,1],[1514,2],[1567,1],[1573,2],[1608,1],[1614,2],[1652,1],[1658,2],[1698,1],[1704,2],[1739,1],[1745,2],[1785,1],[1791,2],[1821,1],[1827,2],[1869,1],[1875,2],[1917,1],[1923,2],[1954,1],[1960,2],[1994,1],[2000,2],[2037,1],[2043,2],[2075,1],[2081,2],[2124,1],[2130,2],[2173,1],[2179,2],[2211,1],[2217,2],[2255,1],[2261,2],[2300,1],[2306,2],[2341,1],[2347,2],[2381,1],[2387,2],[2429,1],[2435,2],[2474,1],[2480,2],[2523,1],[2529,2],[2567,1],[2573,2],[2607,1],[2613,2],[2643,1],[2649,2],[2689,1],[2695,2],[2740,1],[2746,2],[2791,1],[2797,2],[2841,1],[2847,2],[2894,1],[2900,2],[2955,1],[2961,2],[3002,1],[3008,2],[3041,1],[3047,2],[3091,1],[3097,2],[3142,1],[3148,2],[3179,1],[3185,2],[3226,1],[3232,2],[3265,1],[3271,2],[3311,1],[3317,2],[3364,1],[3370,2],[3407,1],[3413,2],[3462,1],[3468,2],[3516,1],[3522,2],[3563,1],[3569,2],[3609,1],[3615,2],[3651,1],[3657,2],[3701,1],[3707,2],[3747,1],[3753,2],[3802,1],[3808,2],[3855,1],[3861,2],[3904,1],[3910,2],[3947,1],[3953,2],[3988,1],[3994,2],[4045,1],[4051,2],[4066,1],[4079,1],[4095,1],[4124,2],[4159,1],[4190,2],[4226,1],[4260,2],[4292,1],[4320,2],[4351,1],[4378,2],[4417,1],[4452,2],[4488,1],[4520,2],[4560,1],[4596,2],[4631,1],[4664,2],[4695,1],[4722,2],[4749,1],[4772,2],[4809,1],[4842,2],[4884,1],[4921,2],[4963,1],[5003,2],[5044,1],[5080,2],[5124,1],[5163,2],[5215,1],[5262,2],[5300,1],[5336,2],[5366,1],[5391,2],[5432,1],[5469,2],[5511,1],[5549,2],[5577,1],[5602,2],[5640,1],[5675,2],[5705,1],[5732,2],[5769,1],[5803,2],[5847,1],[5886,2],[5920,1],[5954,2],[6000,1],[6046,2],[6091,1],[6136,2],[6174,1],[6212,2],[6249,1],[6282,2],[6315,1],[6344,2],[6385,1],[6422,2],[6459,1],[6492,2],[6538,1],[6580,2],[6624,1],[6664,2],[6704,1],[6742,2],[6776,1],[6807,2],[6839,1],[6869,2],[6917,1],[6965,2],[6980,1],[7028,1],[7050,1],[7092,1],[7140,1],[7186,1],[7217,1],[7244,1],[7282,1],[7316,1],[7341,1],[7366,1],[7393,1],[7430,1],[7470,1],[7496,1],[7520,1],[7550,1],[7584,1],[7615,1],[7636,1],[7659,1],[7694,1],[7734,1],[7776,1],[7819,1],[7848,1],[7874,1],[7905,1],[7933,1],[7964,1],[8004,1],[8045,1],[8078,1],[8102,1],[8131,1],[8164,1],[8215,1],[8284,1],[8349,1],[8413,1],[8478,1],[8538,1],[8599,1],[8667,1],[8714,1],[8749,1],[8809,1],[8857,1],[8874,1],[8906,1],[8952,1],[8995,1],[9036,1],[9077,1],[9116,1],[9149,1],[9173,1],[9201,1],[9242,1],[9285,1],[9332,1],[9377,1],[9414,1],[9446,1],[9470,1],[9490,1],[9513,1],[9546,1],[9582,1],[9609,1],[9632,1],[9662,1],[9699,1],[9731,1],[9756,1],[9794,1],[9860,1],[9932,1],[9980,1],[10014,1],[10053,1],[10103,1],[10165,1],[10225,1],[10281,1],[10331,1],[10374,1],[10411,1],[10449,1],[10488,1],[10516,1],[10539,1],[10566,1],[10593,1],[10616,1],[10637,1],[10672,1],[10719,1],[10773,1],[10824,1],[10873,1],[10926,1],[10970,1],[11010,1],[11055,1],[11089,1],[11112,1],[11133,1],[11165,1],[11197,1],[11223,1],[11256,1],[11291,1],[11325,1],[11359,1],[11394,1],[11422,1],[11460,1],[11503,1],[11535,1],[11573,1],[11611,1],[11648,1],[11668,1]]},"133":{"position":[[155,2],[177,2],[192,2],[195,3]]},"135":{"position":[[76,2],[97,2],[232,2],[235,2],[238,3],[347,2],[508,1],[515,1],[1000,1],[1335,1],[5038,1],[5333,2],[5336,2],[5917,2],[6901,2]]},"137":{"position":[[174,1],[227,2]]},"139":{"position":[[104,2],[146,2],[188,2],[211,1],[251,1],[258,1],[295,1],[297,2],[300,3]]},"143":{"position":[[6,1],[25,1],[96,1]]},"145":{"position":[[107,1],[140,1],[167,1],[207,1]]},"149":{"position":[[441,1],[492,1],[514,1],[562,1],[583,1],[585,2],[588,3],[592,2]]},"153":{"position":[[127,1],[172,3],[235,1],[277,2],[313,2],[390,2],[397,1],[406,1],[477,2],[514,2],[587,2]]},"155":{"position":[[124,2]]},"159":{"position":[[95,1],[195,1],[325,1],[412,1],[510,1],[591,1],[704,1],[846,1]]},"162":{"position":[[20,1],[118,1],[132,1],[134,2],[155,2],[170,2],[187,1],[253,2],[274,1],[339,2],[382,1],[430,1],[459,1],[512,1],[544,1]]},"164":{"position":[[20,1],[118,1],[132,1],[134,2],[155,2],[170,2],[190,1],[253,2],[296,1],[349,1],[420,1],[473,2],[476,1]]},"166":{"position":[[20,1],[112,1],[126,1],[128,2],[146,1],[207,2],[225,1],[302,2],[359,1],[392,1],[430,1]]},"168":{"position":[[20,1],[112,1],[126,1],[132,2],[172,2],[247,1],[280,1],[318,1]]},"170":{"position":[[20,1],[112,1],[126,1],[132,2],[183,2],[258,1],[302,1],[317,2],[360,2],[367,1],[380,1],[416,1],[418,1],[442,1]]},"176":{"position":[[77,1],[160,1],[238,2],[366,2],[369,3],[373,2],[516,2],[580,1],[590,2],[600,2],[608,2],[617,1],[631,1],[641,2],[652,2],[660,2],[672,1],[686,1],[701,2],[743,1],[786,2],[841,3]]},"178":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[236,2],[239,2],[305,2],[366,2],[425,2],[475,2],[478,2],[527,2],[573,2],[619,2],[669,2],[724,2],[770,2],[773,2],[837,2],[907,2],[992,2],[995,2],[1048,2],[1106,2],[1109,2],[1165,2],[1223,2],[1226,2],[1282,1]]},"180":{"position":[[18,1],[182,1]]},"186":{"position":[[77,1],[156,1],[234,2],[284,2],[389,1],[417,2],[427,2],[445,1],[480,3],[638,1],[656,2],[729,1],[759,2],[802,1],[838,2],[841,3],[883,1],[957,2]]},"188":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[255,2],[258,2],[282,1],[321,2],[427,2],[430,2],[456,2],[459,2],[508,2],[567,2],[570,2],[616,2],[687,2],[690,2],[728,1],[730,2],[767,2],[770,1],[809,2],[898,2],[901,2],[977,2],[1031,2],[1034,2],[1109,2],[1181,1],[1191,2],[1194,2],[1238,2],[1335,2],[1408,2],[1428,2],[1431,2],[1459,2],[1501,2],[1572,2],[1575,2],[1648,1]]},"190":{"position":[[18,1],[53,1],[153,1],[189,2],[328,1]]},"196":{"position":[[77,1],[159,1],[237,2],[290,2],[403,2],[408,3],[412,2],[519,1],[537,2],[557,2],[592,2],[597,3]]},"198":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[240,2],[243,2],[278,2],[299,2],[318,2],[339,2],[376,1]]},"200":{"position":[[18,1],[60,1]]},"202":{"position":[[0,2],[28,1],[44,1],[62,1],[81,1],[106,1],[110,1]]},"208":{"position":[[77,1],[155,1],[233,2],[282,2],[458,3],[959,1],[993,2],[1010,2],[1013,3]]},"210":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[282,2],[352,2],[355,2],[449,2],[488,2],[491,2],[559,2],[630,2],[633,2],[660,3],[684,2],[760,2],[812,2],[815,2],[895,2],[967,2],[1041,2],[1044,2],[1071,3],[1095,2],[1168,2],[1242,2],[1314,2],[1363,2],[1366,2],[1422,2],[1495,2],[1506,2],[1509,2],[1536,3],[1561,2],[1638,2],[1656,2],[1659,2],[1700,1]]},"212":{"position":[[18,1],[76,4],[227,2],[230,5],[250,3],[294,3],[309,1]]},"218":{"position":[[77,1],[155,1],[233,2],[282,2],[447,1],[532,1],[534,3],[538,2],[541,3]]},"220":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[265,2],[333,2],[353,2],[374,2],[394,2],[414,2],[433,2],[454,2],[457,2],[503,2],[506,2],[567,2],[634,2],[688,2],[718,2],[745,3],[769,2],[797,2],[824,3],[846,2],[885,2],[937,2],[979,2],[1033,2],[1087,2],[1143,2],[1211,2],[1271,2],[1331,2],[1334,2],[1358,1],[1395,2],[1449,2],[1452,2],[1509,2],[1568,2],[1623,2],[1626,2],[1648,2],[1669,2],[1710,2],[1713,2],[1773,2],[1809,2],[1812,2],[1885,2],[1888,2],[1999,1]]},"222":{"position":[[18,1],[49,1],[121,1],[234,1]]},"224":{"position":[[6,1],[19,1],[36,1]]},"226":{"position":[[58,2],[75,2],[166,3]]},"228":{"position":[[1107,1],[1138,1]]},"232":{"position":[[77,1],[160,1],[238,2],[292,2],[401,2],[404,3],[408,3]]},"234":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[264,2],[267,2],[396,2],[484,2],[487,2],[648,2],[712,2],[715,2],[768,1]]},"236":{"position":[[18,1],[65,1],[99,2],[125,2],[168,1],[208,2],[237,1]]},"238":{"position":[[6,1],[26,1],[64,1],[70,1]]},"242":{"position":[[0,2],[72,2]]},"244":{"position":[[77,1],[164,1],[242,2],[270,2],[389,2],[500,2],[698,3],[702,2],[709,1],[782,1],[813,1],[834,2],[837,2],[845,1],[914,1],[974,2],[988,2]]},"246":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[249,2],[252,2],[300,2],[339,1],[357,2],[360,2],[439,2],[551,2],[590,2],[593,2],[689,2],[728,2],[731,2],[827,1]]},"248":{"position":[[18,1],[71,3],[127,1]]},"250":{"position":[[307,2],[330,3],[432,3]]},"256":{"position":[[77,1],[157,1],[235,2],[305,2],[443,3],[529,4],[534,3],[538,1]]},"258":{"position":[[24,1],[34,1],[106,1],[108,1]]},"260":{"position":[[0,2],[64,1],[66,2],[164,2],[268,1]]},"268":{"position":[[77,1],[155,1],[233,2],[282,2],[289,1],[379,1],[418,2],[421,2],[506,3],[510,2],[517,1],[610,1],[649,2]]},"270":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[264,2],[328,2],[394,2],[462,2],[529,2],[595,2],[661,2],[704,1]]},"272":{"position":[[18,1],[52,1]]},"278":{"position":[[77,1],[166,1],[254,1],[341,1],[429,2],[592,1],[689,5],[695,1],[732,1],[765,1]]},"280":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,1]]},"282":{"position":[[18,1],[39,1]]},"288":{"position":[[77,1],[158,1],[236,2],[288,2],[411,3]]},"290":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[259,2],[262,2],[284,2],[299,2],[326,2],[329,2],[377,2],[457,2],[522,2],[525,2],[578,2],[661,2],[664,2],[733,1]]},"292":{"position":[[18,1],[45,3],[103,1]]},"294":{"position":[[98,1],[262,1]]},"298":{"position":[[77,1],[161,1],[239,2],[337,3],[341,2],[529,3]]},"300":{"position":[[110,1],[227,1],[229,2],[289,2],[370,1],[376,2],[456,3],[460,2],[558,2],[614,2],[780,3],[815,1]]},"302":{"position":[[55,1],[168,1],[182,1],[188,2],[284,3],[319,1]]},"304":{"position":[[55,1],[171,1],[185,1],[191,2],[301,3],[336,1]]},"306":{"position":[[58,1],[174,1],[188,1],[194,2],[306,3],[341,1]]},"308":{"position":[[55,1],[174,1],[188,1],[194,2],[290,3],[325,1]]},"310":{"position":[[53,1],[137,2],[260,1],[274,1],[290,2],[309,2],[316,1],[329,1],[335,2],[413,3],[448,1]]},"312":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[240,2],[285,2],[288,2],[343,2],[346,2],[408,2],[447,2],[450,2],[485,2],[488,2],[509,2],[551,2],[581,2],[584,2],[640,2],[679,2],[682,2],[745,2],[792,2],[859,2],[862,2],[920,2],[978,2],[981,2],[1003,2],[1050,2],[1096,2],[1132,2],[1135,2],[1157,2],[1216,1]]},"314":{"position":[[18,1],[62,3],[134,3],[138,1]]},"320":{"position":[[20,1],[100,1],[114,1],[120,2],[195,1],[229,2],[252,1]]},"322":{"position":[[0,2],[64,1],[66,2],[113,2],[166,2],[183,2],[236,2],[258,2],[322,2],[339,2],[380,2],[460,2],[474,2],[519,2],[544,2],[605,2],[630,2],[657,3],[690,2],[707,2],[760,2],[782,2],[840,2],[858,2],[925,2],[947,2],[974,3],[1002,2],[1034,2],[1110,2],[1140,2],[1213,2],[1245,2],[1320,2],[1344,2],[1403,2],[1429,2],[1490,2],[1512,2],[1573,2],[1610,2],[1674,1]]},"324":{"position":[[18,1],[377,1]]},"326":{"position":[[89,1],[147,1]]},"330":{"position":[[77,1],[162,1]]},"334":{"position":[[57,1],[72,2],[75,3],[79,3]]},"336":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[258,2],[317,2],[320,2],[345,1],[382,2],[456,2],[459,2],[516,2],[606,2],[609,2],[749,2],[841,2],[844,2],[921,2],[955,2],[958,2],[1035,2],[1087,2],[1090,2],[1178,1]]},"338":{"position":[[18,1],[58,1],[60,2],[166,2],[182,1],[269,1],[280,2],[297,2],[303,1],[305,2],[374,2],[415,1],[428,2],[468,2],[538,2],[594,1]]},"344":{"position":[[20,1],[133,1],[139,1],[148,1],[181,1],[243,1],[258,2],[301,2],[392,2],[397,1],[416,1],[468,1],[482,1],[488,2],[503,2],[687,3],[729,1],[782,2],[805,1],[813,1],[837,1],[878,2],[990,2],[1092,2]]},"346":{"position":[[159,1],[291,1],[297,1],[306,1],[353,1],[445,1],[447,1],[509,1],[524,2],[567,2],[658,2],[663,1],[682,1],[734,1],[771,1],[785,2],[836,2],[859,1],[897,1],[912,1],[914,1],[928,1],[942,1],[948,2],[1078,3],[1120,1],[1153,2],[1207,1],[1260,2],[1306,1],[1361,2],[1384,1],[1408,1],[1410,1],[1473,2],[1484,1],[1621,2],[1652,1],[1777,2]]},"348":{"position":[[20,1],[133,1],[141,1],[150,1],[174,1],[188,1],[194,2],[224,2],[311,1],[326,2],[369,2],[460,2],[465,1],[484,1],[536,2],[539,2],[580,1],[613,2],[677,1],[730,2],[753,1],[777,1],[779,1],[842,2],[853,1],[982,2]]},"350":{"position":[[0,2],[64,1],[66,2],[113,2],[166,2],[238,2],[293,2],[366,2],[410,2],[491,2],[562,2],[598,2],[649,2],[669,2],[690,2],[710,2],[729,2],[749,2],[787,2],[841,2],[896,2],[989,2],[1058,2],[1107,1]]},"352":{"position":[[18,1],[69,1],[87,2],[140,1],[149,2],[180,1],[248,1],[333,2],[357,1],[429,1]]},"358":{"position":[[77,1],[158,1],[236,2],[288,2],[397,1],[413,2],[428,2],[455,1],[510,1],[544,2],[586,1],[624,2],[655,3]]},"360":{"position":[[195,1],[254,3],[407,1],[442,1],[459,1],[478,1],[503,1]]},"362":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[287,2],[290,2],[312,2],[390,2],[393,2],[431,1],[433,2],[450,2],[453,1],[492,2],[568,2],[571,2],[585,1],[624,2],[680,2],[683,2],[720,1],[722,2],[774,2],[777,1],[806,2],[852,2],[877,2],[880,2],[922,2],[968,1],[992,2],[995,2],[1041,2],[1095,2],[1098,2],[1173,2],[1244,2],[1247,2],[1324,1]]},"364":{"position":[[18,1],[50,1],[105,1],[121,2],[163,1],[214,2],[309,1]]},"366":{"position":[[58,2],[75,2],[172,3]]},"372":{"position":[[77,1],[157,1],[416,2],[467,2],[510,2],[633,3],[637,2],[718,2],[833,3],[837,2],[858,1],[1012,3],[1016,2],[1048,2],[1124,2],[1131,1],[1175,1],[1244,3],[1248,2],[1446,1],[1496,2],[1499,2],[1502,3],[1506,2],[1673,1],[1704,2],[1722,1],[1756,1],[1758,2],[1761,3],[1765,2],[1872,3]]},"374":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[289,2],[330,2],[333,2],[401,2],[447,2],[450,2],[521,2],[556,2],[559,2],[648,2],[734,2],[737,2],[786,2],[879,2],[882,2],[928,2],[989,2],[992,2],[1018,1],[1064,2],[1109,2],[1112,2],[1151,2],[1215,2],[1218,2],[1324,1]]},"376":{"position":[[18,1],[175,1],[236,1]]},"378":{"position":[[0,2],[26,1],[35,1],[51,1],[71,1],[95,1],[116,1],[131,1],[145,1],[161,1],[180,1],[199,1],[215,1],[229,1],[247,1],[269,1],[280,2],[310,1],[322,2],[353,1],[389,1],[405,2],[441,1],[450,2],[479,1],[510,1],[537,1],[556,1],[566,2],[616,1],[628,2],[659,1],[674,2],[706,1],[722,2],[750,1],[761,2],[786,1],[796,2],[822,1],[834,2],[862,1],[874,2],[893,1],[910,1],[927,1],[947,1],[966,1],[986,1],[1006,1],[1024,1],[1043,1],[1053,1]]},"384":{"position":[[77,1],[158,1],[236,2],[336,2],[379,2],[416,2],[740,2],[749,1],[846,2]]},"386":{"position":[[0,2],[64,1],[66,2],[88,2],[91,2],[142,2],[160,2],[163,2],[217,2],[279,2],[282,2],[323,2],[394,2],[397,2],[452,2],[500,2],[503,2],[549,2],[598,1],[631,2],[634,2],[745,2],[799,1],[832,2],[835,2],[955,1]]},"388":{"position":[[18,1],[297,3],[301,1]]},"394":{"position":[[77,1],[156,1],[234,2],[284,2],[327,2],[501,2]]},"396":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[255,2],[317,2],[348,2],[351,2],[373,2],[390,1]]},"398":{"position":[[18,1],[39,1]]},"402":{"position":[[0,2],[110,2],[257,2],[400,2],[634,2],[822,2],[1020,2],[1212,2]]},"404":{"position":[[77,1],[156,1],[234,2],[301,2],[404,2],[407,2],[586,2],[589,2],[673,2],[846,2],[1034,3],[1038,2],[1110,1],[1116,2],[1171,2],[1196,2],[1203,1],[1216,1],[1218,2],[1311,2],[1314,2],[1406,1],[1415,2],[1468,2],[1475,1],[1488,1],[1490,2],[1583,2],[1586,2],[1695,1],[1704,2],[1763,1],[1773,2],[1780,1],[1793,1],[1795,2],[1888,2],[1891,2],[1984,1],[1993,2],[2070,2],[2077,1],[2090,1],[2092,2],[2185,2],[2188,2],[2351,2],[2354,3],[2358,2],[2534,2],[2577,1],[2634,2],[2678,1],[2735,2],[2738,3],[2742,2],[2950,3]]},"406":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[256,2],[259,2],[302,2],[355,2],[358,2],[387,2],[436,2],[439,2],[493,2],[544,2],[547,2],[602,2],[671,2],[674,2],[727,2],[780,2],[825,2],[891,2],[965,2],[1039,2],[1096,2],[1154,2],[1231,2],[1300,1]]},"408":{"position":[[18,1],[122,1]]},"414":{"position":[[77,1],[158,1],[236,2],[288,2],[373,1],[397,2]]},"416":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[244,2],[247,2],[297,2],[359,2],[362,2],[461,1]]},"418":{"position":[[18,1],[109,1]]},"424":{"position":[[20,1],[102,1],[116,1],[122,2],[238,2],[258,3],[303,1],[342,2],[388,1],[421,1],[423,1],[440,2],[463,1]]},"426":{"position":[[0,2],[64,1],[66,2],[115,2],[168,2],[252,2],[297,2],[319,2],[338,2],[358,2],[396,2],[465,2],[501,2],[544,2],[642,1]]},"428":{"position":[[18,1],[59,1]]},"434":{"position":[[77,1],[160,1],[238,2],[292,2],[427,1],[448,2],[451,3]]},"436":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[262,2],[265,2],[316,2],[383,2],[386,2],[443,2],[509,2],[547,2],[550,2],[605,1]]},"438":{"position":[[199,1],[300,1]]},"444":{"position":[[20,1],[101,1],[115,1],[121,2],[235,2],[238,3],[283,1],[322,2],[368,1],[401,1],[403,1],[420,2],[443,1]]},"450":{"position":[[77,1],[158,1],[236,2],[265,2],[313,2],[368,1],[370,2],[408,2],[431,2],[438,1],[451,1],[453,2],[471,2],[491,2],[533,2],[554,2],[569,2],[603,2],[629,2],[652,2],[659,1],[672,1],[674,2],[748,1],[753,2],[776,2],[796,2],[803,1],[816,1],[871,2]]},"452":{"position":[[0,2],[64,1],[66,2],[94,2],[124,1],[161,2],[208,2],[270,2],[341,2],[384,2],[455,2],[520,2],[550,2],[577,3],[601,2],[629,2],[656,3],[678,2],[717,2],[769,2],[811,2],[865,2],[894,2],[950,2],[1018,2],[1055,2],[1112,2],[1155,2],[1222,2],[1276,2],[1339,2],[1378,1]]},"454":{"position":[[18,1],[43,1],[161,1]]},"456":{"position":[[6,1],[28,1],[59,1],[92,1],[102,1]]},"458":{"position":[[58,2],[75,2],[124,2],[173,2]]},"464":{"position":[[77,1],[155,1],[245,1],[251,2],[323,1],[345,2],[364,3],[408,1],[457,2],[491,1],[533,1],[586,1]]},"470":{"position":[[77,1],[158,1],[248,1],[254,2],[271,2],[299,1],[314,2],[358,1],[373,2],[426,2],[433,1],[481,1],[494,1],[585,1],[653,1],[661,2],[688,1],[695,1],[726,1],[728,1],[738,1],[777,1],[788,1],[801,1],[1026,1],[1075,1],[1081,2],[1098,2],[1126,1],[1141,2],[1185,1],[1200,2],[1268,2],[1275,1],[1323,1],[1336,1],[1453,1],[1536,1],[1544,2],[1571,1],[1578,1],[1609,1],[1611,1],[1621,1],[1649,1],[1660,1],[1673,1],[1716,1],[1722,2],[1743,2],[1825,2],[1855,1],[1862,2],[1915,1],[1962,2],[1969,1],[1989,1],[1999,1],[2027,2],[2034,1],[2054,1],[2067,1],[2165,1]]},"473":{"position":[[497,1]]},"485":{"position":[[0,2],[94,1]]},"490":{"position":[[415,1],[492,2]]},"492":{"position":[[545,1],[562,1],[564,3],[576,1],[596,1],[622,2],[629,1],[650,1],[657,1],[674,1],[716,1],[762,1]]},"494":{"position":[[142,2],[219,1],[294,2],[297,2]]},"498":{"position":[[180,1],[194,2]]},"500":{"position":[[77,1],[163,1],[182,1],[201,1],[215,1],[217,2],[232,2],[254,2],[262,2],[269,2],[281,2],[389,3],[421,1],[472,1],[501,2],[504,2],[513,2],[521,2],[535,2],[644,3],[677,1],[730,1],[760,2],[763,2],[775,2],[786,2],[803,2],[912,3],[940,1],[993,1],[1026,2],[1029,2],[1043,2],[1091,1],[1098,2],[1129,2],[1136,1],[1180,1],[1187,1],[1234,1],[1236,2],[1270,1]]},"503":{"position":[[244,1],[246,2],[310,2],[492,1],[579,1],[593,1],[599,2],[675,1],[716,2],[750,1],[1021,1],[1023,2],[1085,2],[1175,2]]},"505":{"position":[[226,2],[275,1],[313,1],[315,2],[351,2],[386,2],[485,1],[492,1],[501,1],[503,2],[613,2],[700,1]]},"507":{"position":[[539,2],[593,2],[620,2],[706,1],[708,2],[744,2],[779,2],[878,1],[885,1],[894,1],[896,2],[926,1],[993,2],[1000,1],[1002,2],[1119,1],[1121,2],[1155,2],[1158,2],[1161,2],[1164,3],[1195,1]]},"510":{"position":[[480,1],[486,2],[569,2],[572,1],[574,3],[578,1]]},"516":{"position":[[79,1],[85,2],[104,2],[137,2],[148,2],[180,2],[216,2],[257,2],[276,2],[308,2],[344,2],[385,2],[432,1],[493,1],[499,2],[518,2],[539,2],[550,2],[570,2],[606,2],[647,2],[666,2],[686,2],[722,2],[763,2],[810,1]]},"518":{"position":[[131,1],[137,2],[160,2],[188,1],[226,1],[232,2],[253,2],[264,2],[309,1],[311,2],[376,2],[404,2],[445,2],[492,1]]},"522":{"position":[[0,2],[77,1],[116,1],[153,1],[197,1],[235,1],[279,1],[320,1],[355,1]]},"526":{"position":[[271,1],[309,1],[323,1],[329,2],[382,1],[482,1],[501,1],[503,1],[512,1],[514,2],[517,2],[531,2],[579,1],[600,1],[602,1],[613,1],[632,2],[681,1],[791,1],[872,1],[874,2],[886,2],[916,2]]},"532":{"position":[[161,2],[217,2],[281,1],[302,1],[315,1],[324,2],[346,1],[355,1],[365,1],[386,1],[388,5],[394,1],[412,1],[414,3],[418,1],[448,2]]},"538":{"position":[[308,1],[346,1],[360,1],[366,2],[424,2],[525,1],[586,2],[589,3],[604,2],[633,1],[635,2],[646,2]]},"541":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"543":{"position":[[185,2],[243,4],[286,1],[316,2],[319,2],[414,1],[445,2],[448,2],[553,1],[589,2]]},"545":{"position":[[372,2],[415,2],[418,2],[425,1],[658,4],[841,2],[916,1],[1012,2],[1015,2],[1091,1],[1128,2],[1131,2],[1202,1],[1242,2],[1245,2],[1321,1],[1358,2],[1361,2],[1553,1],[1595,2],[1620,1],[1622,1],[1636,3],[1796,4],[1928,2],[2037,1],[2116,2],[2134,2],[2137,2],[2233,1],[2306,2],[2317,2],[2476,2],[2607,1],[2683,2],[2694,2],[2915,2],[2927,2],[2946,1],[2948,4],[2962,1],[3002,2],[3017,2],[3036,1],[3074,2],[3105,2],[3122,1],[3143,1],[3185,2],[3217,2],[3234,1],[3253,1]]},"547":{"position":[[1339,1],[1379,2],[1382,2],[1422,2],[1428,2],[1467,2],[1496,1],[1587,1],[1627,2],[1630,2],[1674,2],[1696,2],[1735,2],[1752,2],[1793,2],[1986,1],[2026,2],[2029,2],[2070,2],[2089,2],[2131,2],[2151,2],[2199,2],[2236,2],[2306,3],[2310,2],[2313,2],[2316,2],[2319,2],[2322,2],[2325,2],[2328,2],[2331,2],[2334,3],[2497,1],[2537,2],[2540,2],[2580,2],[2586,2],[2624,2],[2627,2],[2668,2]]},"549":{"position":[[279,1],[281,2],[363,2],[405,2],[446,1],[485,2]]},"551":{"position":[[82,1],[88,2],[107,2],[140,2],[151,2],[183,2],[219,2],[260,2],[279,2],[311,2],[347,2],[388,2],[435,1]]},"554":{"position":[[97,1],[168,1],[298,2],[341,2],[383,2],[507,2],[867,1],[923,3],[927,2]]},"556":{"position":[[188,1],[264,1],[278,1],[280,2],[334,2],[366,2],[423,2],[458,2],[468,2],[508,2],[550,2],[591,1],[593,2],[680,2],[683,2],[717,1]]},"559":{"position":[[323,1],[418,1],[425,1],[439,1],[488,2],[567,2],[662,1],[685,1],[746,1],[766,1],[798,1],[830,1],[894,1],[896,1],[898,2],[932,2],[1017,1],[1098,1],[1117,2],[1143,2],[1176,2],[1183,1],[1196,2],[1239,1],[1241,2],[1345,1],[1359,2],[1396,1],[1408,2],[1440,1],[1454,2],[1487,1],[1511,1],[1544,1],[1546,1],[1572,1],[1586,1],[1600,2],[1637,1],[1643,2],[1670,2],[1751,1],[1860,2],[1863,2],[1866,2],[1869,2],[1994,1],[1996,2],[2073,2],[2079,2],[2099,2],[2105,2],[2146,1],[2153,2],[2210,1],[2212,2],[2234,2],[2275,1],[2279,2],[2296,1],[2306,2],[2338,2],[2352,1],[2362,1],[2405,1],[2470,2],[2473,1],[2559,1],[2565,3],[2569,1],[2571,1],[2573,2],[2643,2],[2677,1],[2679,3],[2776,2],[2779,1],[2826,1],[2966,1],[3103,1],[3219,3]]},"561":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"564":{"position":[[349,2],[469,1],[489,2],[522,2],[563,2],[603,2],[669,2],[730,2],[733,2],[753,2],[756,2],[759,2],[762,3],[766,2],[779,2],[827,4],[874,1],[920,2],[1005,2],[1063,2],[1066,3],[1077,3],[1118,2],[1121,3],[1125,2],[1191,2],[1234,2],[1275,2],[1350,1],[1394,2],[1447,2],[1498,2],[1506,2],[1509,3],[1513,2]]},"566":{"position":[[141,2],[226,1],[242,2],[265,2],[268,3],[272,2],[275,2],[360,1],[376,2],[401,2],[404,3],[408,2]]},"568":{"position":[[166,1],[199,2]]},"570":{"position":[[262,1],[322,2],[325,2],[395,2],[398,2],[449,2],[452,3],[456,2]]},"572":{"position":[[172,1],[189,2],[192,2],[268,2],[271,2],[327,2],[330,2],[357,2],[360,3],[364,2]]},"574":{"position":[[31,1],[101,2],[181,1],[195,2],[218,2],[221,3],[225,2]]},"576":{"position":[[211,1],[257,2],[260,2],[301,1],[344,2],[378,2]]},"578":{"position":[[76,2],[166,1],[168,2],[227,2],[250,2]]},"580":{"position":[[452,2],[524,1],[624,1],[665,1],[669,2],[691,2],[715,2],[722,1],[735,1],[757,2],[785,2],[792,2],[795,3],[799,2],[802,2],[848,2],[961,2],[1085,2],[1197,2],[1260,2]]},"582":{"position":[[151,1],[153,2],[192,2],[249,2],[343,2],[346,3],[350,2],[718,1],[808,1],[855,2],[858,2],[861,3],[865,2],[912,1],[953,2],[1020,1],[1060,2],[1063,2],[1066,3],[1070,2]]},"584":{"position":[[330,2],[405,1],[411,2],[434,2],[437,3],[441,2]]},"588":{"position":[[77,1],[387,1],[435,1],[437,2],[461,2],[494,1],[516,1],[539,1],[559,1],[572,2],[603,2],[606,3],[610,2]]},"590":{"position":[[243,1],[245,2],[285,2],[321,2],[330,2],[333,3],[337,2]]},"592":{"position":[[398,1],[447,2],[450,2],[540,2],[543,2],[566,2]]},"594":{"position":[[286,1],[288,2],[336,2],[339,2],[356,2],[403,2],[406,2],[430,2],[484,2],[487,2],[506,2],[509,2],[512,2]]},"596":{"position":[[216,1],[218,2],[274,2],[300,2],[392,2]]},"598":{"position":[[214,1],[216,2],[279,2],[282,2],[295,2],[311,2],[314,2],[317,2]]},"602":{"position":[[208,1],[232,2],[270,2],[313,2],[323,2],[326,2],[329,2]]},"606":{"position":[[219,1],[253,2],[327,2],[380,2],[390,2],[393,2],[396,2]]},"610":{"position":[[222,1],[319,1],[420,1],[434,2],[514,2],[517,2]]},"612":{"position":[[106,2],[176,1],[191,2],[207,2],[210,3],[214,2]]},"614":{"position":[[128,1],[137,2],[152,2],[155,3],[159,2],[289,2],[356,2]]},"616":{"position":[[129,2],[213,1],[223,2],[260,2],[263,3],[267,2]]},"618":{"position":[[256,2],[336,1],[351,2],[373,2],[394,2],[403,2],[406,3],[410,2]]},"620":{"position":[[87,1],[135,1],[137,2],[218,2],[221,3],[225,2]]},"622":{"position":[[218,1],[242,1],[286,1],[288,2],[316,2],[355,1],[377,2],[380,2],[414,2],[417,2],[504,2],[507,2],[510,2],[544,2],[547,2],[581,2]]},"624":{"position":[[336,1],[360,1],[400,1],[402,2],[430,2],[469,1],[492,2],[495,2],[572,2],[575,2],[619,2]]},"626":{"position":[[184,1],[289,1],[291,2],[351,2],[404,2],[407,3],[411,2]]},"628":{"position":[[331,1],[375,2],[421,1],[443,2],[454,1],[518,1],[563,2]]},"630":{"position":[[165,1],[234,2]]},"632":{"position":[[261,1],[274,2],[311,2],[318,2],[321,3],[325,2]]},"634":{"position":[[279,1],[281,2],[323,2],[349,2],[356,1],[358,2],[361,2],[389,2],[424,1],[428,1],[430,2],[470,1],[472,2],[517,2],[543,2],[546,2],[573,2],[608,2],[623,1],[695,2],[698,2],[741,2],[775,2],[836,2],[843,1],[856,1],[858,1],[860,1],[873,2]]},"636":{"position":[[279,1],[323,2],[364,1],[408,2],[449,1],[514,2]]},"638":{"position":[[87,2],[170,1],[188,2],[213,2],[216,3],[220,2]]},"640":{"position":[[174,5],[290,2],[375,1],[394,2],[405,2],[408,3],[412,2],[415,2],[500,1],[516,2],[546,2],[561,2],[564,3],[568,2],[599,2],[672,2],[695,2],[743,2],[771,2],[978,1],[994,2],[1046,2]]},"642":{"position":[[343,2],[424,1],[434,2],[455,2],[479,2],[482,3],[486,2]]},"644":{"position":[[302,2],[383,1],[391,2],[450,2],[467,2],[470,3],[474,2]]},"646":{"position":[[247,2],[332,1],[343,2],[380,2],[391,2],[394,3],[398,2]]},"648":{"position":[[120,2],[184,1],[199,2],[209,2],[212,3],[216,2]]},"650":{"position":[[173,2],[269,1],[273,2],[298,2],[324,2],[343,2],[346,2],[349,2],[352,3],[356,2],[367,2],[475,1],[479,2],[506,2],[530,2],[540,2],[551,2],[689,1],[693,2],[720,2],[741,2],[760,2],[771,2],[782,2],[896,1],[900,2],[940,2],[975,2],[989,2],[1000,2],[1208,1],[1212,2],[1237,2],[1279,2],[1331,2],[1359,2],[1409,2],[1419,2]]},"652":{"position":[[334,2],[421,1],[440,2],[467,2],[502,2],[512,2],[515,3],[519,2]]},"654":{"position":[[458,2],[554,1],[582,2],[623,2],[652,2],[687,2],[713,2],[746,2],[754,2],[757,3],[761,2]]},"656":{"position":[[526,2],[618,1],[643,2],[678,2],[711,2],[737,2],[764,2],[769,2],[772,3],[776,2]]},"658":{"position":[[516,2],[608,1],[638,2],[665,2],[690,2],[712,2],[717,2],[720,3],[724,2]]},"660":{"position":[[302,2],[374,1],[467,1],[507,1],[511,2],[533,2],[558,2],[565,1],[578,1],[600,2],[628,2],[659,2],[674,2],[677,3],[681,2],[684,2],[729,2]]},"662":{"position":[[132,2],[203,1],[207,2],[234,2],[245,1],[253,2],[271,1],[288,2],[302,1],[304,1],[306,2]]},"664":{"position":[[313,1],[344,2],[391,1],[454,4],[459,2],[514,1],[661,2]]},"666":{"position":[[449,1],[451,2],[526,2],[529,2],[582,1],[584,2],[796,2],[799,2],[850,1]]},"668":{"position":[[347,1],[382,2],[427,1],[512,2],[557,1],[586,2]]},"672":{"position":[[143,1],[173,2],[176,2],[193,2]]},"674":{"position":[[312,2],[384,1],[489,1],[529,1],[533,2],[555,2],[584,2],[591,1],[604,1],[626,2],[654,2],[685,2],[700,2],[703,3],[707,2],[710,2],[755,2]]},"676":{"position":[[147,1],[206,2],[209,2],[239,2]]},"678":{"position":[[398,1],[433,2],[477,1],[520,2]]},"680":{"position":[[81,2],[161,1],[165,2],[230,2],[265,2],[268,3],[272,2],[434,1],[468,1],[481,2],[499,2],[510,3],[518,2],[540,2],[558,2],[595,1],[597,1]]},"682":{"position":[[176,1],[178,2],[220,2],[246,2],[253,1],[255,2],[258,2],[277,2],[322,2],[348,2],[351,2],[378,2],[413,2],[428,1],[500,2],[503,2],[546,2],[580,2],[641,2],[648,1],[661,1],[663,1],[676,1],[678,2]]},"684":{"position":[[201,2],[256,1],[258,2],[300,2],[326,2],[333,1],[335,2],[338,2],[357,2],[402,2],[428,2],[431,2],[458,2],[493,2],[508,1],[580,2],[583,2],[626,2],[663,2],[742,2],[749,1],[762,1],[764,1],[777,1],[779,2]]},"686":{"position":[[32,1],[116,2],[166,2]]},"688":{"position":[[123,1],[164,2],[167,2],[186,2],[504,1],[543,2],[546,2],[627,2],[630,2],[649,2]]},"690":{"position":[[322,1],[364,2],[436,2],[635,1],[690,2]]},"692":{"position":[[262,1],[289,2],[292,2],[379,2],[382,2],[405,2]]},"694":{"position":[[165,1],[203,2],[206,2],[236,2],[239,3],[243,2]]},"696":{"position":[[314,2],[353,2],[390,2],[467,1],[471,2],[507,1],[509,2],[594,1],[629,1],[677,2],[717,2],[724,1],[752,1],[777,1],[790,2],[863,1],[865,2],[1024,2],[1027,2],[1118,1],[1244,1],[1289,1],[1375,2],[1421,1],[1508,2],[1511,2],[1601,2]]},"698":{"position":[[168,1],[174,2],[220,2],[268,2],[271,3],[275,2]]},"702":{"position":[[166,1],[204,1],[249,1],[317,1],[362,1],[434,2]]},"704":{"position":[[268,2],[342,1],[359,2],[398,2],[410,2],[413,3],[417,2]]},"706":{"position":[[207,1],[225,2],[228,2],[258,2],[261,2],[290,2],[293,2],[332,2],[335,2],[372,2],[375,3],[379,2]]},"708":{"position":[[238,1],[244,2],[263,2],[308,2],[311,3],[315,2]]},"710":{"position":[[288,1],[307,2],[310,2],[347,2],[350,2],[378,2],[412,2],[415,2],[479,2],[482,2],[535,2],[538,3],[542,2]]},"712":{"position":[[139,1],[174,2],[177,2],[236,2],[268,2]]},"714":{"position":[[164,1],[172,2],[213,2],[216,2],[275,2],[307,2]]},"716":{"position":[[141,1],[174,2],[177,2],[236,2],[268,2]]},"718":{"position":[[220,2],[294,1],[304,2],[312,2],[315,3],[319,2]]},"720":{"position":[[222,1],[302,1],[342,1],[344,2],[372,2],[411,1],[432,2],[443,2],[465,2],[482,2],[494,2]]}}}],["0",{"_index":276,"t":{"17":{"position":[[2316,2]]},"90":{"position":[[238,2],[345,2]]},"188":{"position":[[1411,1],[1443,1]]},"190":{"position":[[271,2]]},"198":{"position":[[316,1]]},"202":{"position":[[64,1]]},"210":{"position":[[1686,2]]},"212":{"position":[[306,2]]},"228":{"position":[[74,3],[296,1]]},"278":{"position":[[674,2]]},"312":{"position":[[889,2]]},"314":{"position":[[111,2]]},"322":{"position":[[210,4],[501,2]]},"324":{"position":[[43,4]]},"485":{"position":[[176,1]]},"559":{"position":[[2277,1],[2324,2],[2822,3],[3099,3]]},"564":{"position":[[1098,1]]},"634":{"position":[[426,1]]},"642":{"position":[[243,4]]},"656":{"position":[[405,4],[740,1]]},"658":{"position":[[405,4],[715,1]]}}}],["0.1.7",{"_index":2922,"t":{"545":{"position":[[3499,5]]}}}],["0.4",{"_index":2624,"t":{"483":{"position":[[72,3]]}}}],["0.7",{"_index":2621,"t":{"481":{"position":[[70,3]]}}}],["01",{"_index":2971,"t":{"547":{"position":[[1108,4],[1126,2]]},"696":{"position":[[570,2],[697,2]]}}}],["02",{"_index":2082,"t":{"326":{"position":[[324,2]]},"372":{"position":[[967,3]]},"547":{"position":[[1113,4]]},"696":{"position":[[573,2],[700,4]]}}}],["0666",{"_index":1602,"t":{"153":{"position":[[377,5],[578,5]]},"372":{"position":[[1111,5]]}}}],["08",{"_index":2978,"t":{"547":{"position":[[1185,2],[2193,2],[2207,2]]}}}],["0rtt",{"_index":1861,"t":{"228":{"position":[[835,5]]}}}],["1",{"_index":387,"t":{"29":{"position":[[169,1]]},"59":{"position":[[222,1]]},"90":{"position":[[734,2]]},"188":{"position":[[280,1]]},"190":{"position":[[51,1]]},"196":{"position":[[406,1],[595,1]]},"198":{"position":[[297,1],[337,1]]},"202":{"position":[[47,1],[83,1]]},"218":{"position":[[445,1]]},"220":{"position":[[1356,1]]},"222":{"position":[[119,1]]},"228":{"position":[[277,1]]},"234":{"position":[[355,4]]},"238":{"position":[[66,3]]},"278":{"position":[[559,1],[623,2],[763,1]]},"322":{"position":[[1371,5]]},"324":{"position":[[284,5]]},"344":{"position":[[395,1]]},"346":{"position":[[661,1]]},"348":{"position":[[463,1]]},"362":{"position":[[583,1]]},"364":{"position":[[48,1]]},"406":{"position":[[696,1]]},"426":{"position":[[279,3],[351,6]]},"545":{"position":[[3116,4],[3228,4]]},"547":{"position":[[1481,2],[1749,2]]},"559":{"position":[[2690,3]]},"564":{"position":[[1390,3],[1407,2]]},"566":{"position":[[379,7]]},"574":{"position":[[141,1]]},"610":{"position":[[480,3]]},"656":{"position":[[368,2],[708,2],[714,1]]},"658":{"position":[[368,2],[635,2],[662,2],[668,1],[687,2],[693,1]]}}}],["1,001.01e8",{"_index":2941,"t":{"547":{"position":[[510,10]]}}}],["1,146,667",{"_index":2623,"t":{"483":{"position":[[14,9]]}}}],["1,2,3",{"_index":3376,"t":{"650":{"position":[[763,7]]}}}],["1.1",{"_index":2626,"t":{"483":{"position":[[152,3]]}}}],["1.16",{"_index":1990,"t":{"298":{"position":[[557,6]]},"300":{"position":[[84,5]]},"312":{"position":[[471,4]]}}}],["1.17",{"_index":41,"t":{"4":{"position":[[39,4]]}}}],["1.234",{"_index":2940,"t":{"547":{"position":[[502,6]]}}}],["1.3",{"_index":1845,"t":{"228":{"position":[[152,3]]}}}],["1.3'",{"_index":1840,"t":{"228":{"position":[[57,5]]}}}],["10",{"_index":269,"t":{"17":{"position":[[2102,2],[2749,2]]},"473":{"position":[[565,2]]},"485":{"position":[[182,2]]},"666":{"position":[[774,5]]},"696":{"position":[[1568,2],[1677,2]]}}}],["10*time.second",{"_index":2563,"t":{"470":{"position":[[2117,16]]}}}],["10.1",{"_index":841,"t":{"130":{"position":[[1380,4]]}}}],["10.4.1",{"_index":877,"t":{"130":{"position":[[1840,6]]}}}],["100",{"_index":833,"t":{"130":{"position":[[1271,3]]},"485":{"position":[[189,3],[580,4]]}}}],["1000",{"_index":2642,"t":{"485":{"position":[[585,5]]},"492":{"position":[[652,4]]}}}],["101",{"_index":836,"t":{"130":{"position":[[1321,3]]}}}],["102",{"_index":839,"t":{"130":{"position":[[1363,3]]}}}],["1024",{"_index":1329,"t":{"135":{"position":[[510,4],[517,4],[1002,4]]}}}],["103",{"_index":843,"t":{"130":{"position":[[1404,3]]}}}],["11",{"_index":2973,"t":{"547":{"position":[[1123,2]]}}}],["11,846",{"_index":2612,"t":{"477":{"position":[[14,6]]}}}],["11.1",{"_index":869,"t":{"130":{"position":[[1758,4]]}}}],["11.2",{"_index":968,"t":{"130":{"position":[[3161,4],[5562,4]]}}}],["11.3",{"_index":971,"t":{"130":{"position":[[3198,4],[5615,4]]}}}],["11.4",{"_index":974,"t":{"130":{"position":[[3245,4],[5688,4]]}}}],["11.5",{"_index":1017,"t":{"130":{"position":[[3923,4],[6755,4]]}}}],["111",{"_index":3354,"t":{"644":{"position":[[461,5]]}}}],["117.2",{"_index":2619,"t":{"479":{"position":[[148,5]]}}}],["12",{"_index":2950,"t":{"547":{"position":[[723,2],[1425,2]]},"559":{"position":[[2032,2],[2076,2]]}}}],["120",{"_index":2959,"t":{"547":{"position":[[867,4],[962,4]]}}}],["120000",{"_index":2987,"t":{"547":{"position":[[1688,7]]}}}],["123",{"_index":3345,"t":{"642":{"position":[[462,3]]}}}],["12345.pdf",{"_index":3219,"t":{"592":{"position":[[434,12],[469,9],[513,11]]}}}],["123456",{"_index":1672,"t":{"176":{"position":[[356,9],[506,9],[663,8]]}}}],["123456789",{"_index":2930,"t":{"547":{"position":[[377,10],[389,9]]}}}],["125",{"_index":2996,"t":{"547":{"position":[[2084,4]]}}}],["127.0.0.1",{"_index":2179,"t":{"358":{"position":[[416,11]]},"614":{"position":[[140,11]]},"616":{"position":[[157,10],[237,12]]}}}],["127.0.0.1:3000",{"_index":1958,"t":{"278":{"position":[[525,14]]}}}],["127.0.0.1:3000/debug/var",{"_index":1959,"t":{"278":{"position":[[566,25]]}}}],["127.0.0.1:3000/debug/vars?r=c",{"_index":1966,"t":{"278":{"position":[[702,29]]}}}],["13",{"_index":1927,"t":{"268":{"position":[[306,3]]}}}],["15:04:05",{"_index":2255,"t":{"374":{"position":[[759,8]]},"376":{"position":[[126,11]]}}}],["15th",{"_index":36,"t":{"2":{"position":[[363,5]]}}}],["16",{"_index":3114,"t":{"564":{"position":[[1375,4]]}}}],["1638",{"_index":2935,"t":{"547":{"position":[[453,4],[463,4]]}}}],["18",{"_index":2955,"t":{"547":{"position":[[798,3],[942,2]]},"559":{"position":[[2035,2],[2102,2]]}}}],["18.04.3",{"_index":2588,"t":{"473":{"position":[[523,7]]}}}],["1831710635",{"_index":1928,"t":{"268":{"position":[[310,11],[541,11]]}}}],["185",{"_index":121,"t":{"6":{"position":[[1552,5]]},"135":{"position":[[4104,5]]}}}],["19",{"_index":2953,"t":{"547":{"position":[[763,2]]}}}],["19,664",{"_index":2616,"t":{"479":{"position":[[14,6]]}}}],["1;q=0.2",{"_index":3108,"t":{"564":{"position":[[1226,7]]}}}],["1s",{"_index":526,"t":{"59":{"position":[[168,2]]}}}],["2",{"_index":1756,"t":{"198":{"position":[[364,1]]},"202":{"position":[[108,1]]},"244":{"position":[[677,1]]},"250":{"position":[[258,1]]},"346":{"position":[[1356,4],[1807,2]]},"426":{"position":[[283,2]]},"450":{"position":[[750,2]]},"545":{"position":[[3137,4],[3247,4]]},"559":{"position":[[2860,3]]},"564":{"position":[[777,1]]},"582":{"position":[[1022,4]]},"658":{"position":[[641,1]]},"704":{"position":[[133,2]]}}}],["2*time.second",{"_index":2536,"t":{"470":{"position":[[538,15],[1391,14]]}}}],["2,066",{"_index":2614,"t":{"477":{"position":[[94,5]]}}}],["2.0",{"_index":2609,"t":{"475":{"position":[[444,3]]}}}],["2.20ghz",{"_index":2584,"t":{"473":{"position":[[499,7]]}}}],["2.3.3",{"_index":961,"t":{"130":{"position":[[3060,5],[5404,5]]}}}],["2.30ghz",{"_index":2630,"t":{"485":{"position":[[96,7]]}}}],["20",{"_index":2180,"t":{"358":{"position":[[436,3]]},"360":{"position":[[176,3]]},"559":{"position":[[527,2]]},"622":{"position":[[351,3],[446,4],[500,3],[576,4]]},"624":{"position":[[465,3],[532,4],[614,4]]},"696":{"position":[[1571,2],[1680,3]]},"720":{"position":[[407,3]]}}}],["200",{"_index":327,"t":{"21":{"position":[[221,3]]},"130":{"position":[[1431,3]]},"470":{"position":[[813,3]]}}}],["2005",{"_index":2972,"t":{"547":{"position":[[1118,4]]}}}],["2006",{"_index":2227,"t":{"372":{"position":[[975,6]]},"696":{"position":[[565,4]]}}}],["201",{"_index":848,"t":{"130":{"position":[[1470,3]]}}}],["202",{"_index":851,"t":{"130":{"position":[[1510,3]]}}}],["2020",{"_index":37,"t":{"2":{"position":[[369,5]]}}}],["2022",{"_index":2977,"t":{"547":{"position":[[1180,4],[2202,4]]}}}],["203",{"_index":854,"t":{"130":{"position":[[1569,3]]}}}],["204",{"_index":857,"t":{"130":{"position":[[1610,3]]}}}],["205",{"_index":860,"t":{"130":{"position":[[1654,3]]}}}],["206",{"_index":863,"t":{"130":{"position":[[1700,3]]}}}],["207",{"_index":867,"t":{"130":{"position":[[1741,3]]}}}],["208",{"_index":871,"t":{"130":{"position":[[1787,3]]}}}],["226",{"_index":875,"t":{"130":{"position":[[1823,3]]}}}],["2295",{"_index":1013,"t":{"130":{"position":[[3868,5],[6671,5]]}}}],["233",{"_index":1556,"t":{"147":{"position":[[673,4],[988,4]]}}}],["24",{"_index":2499,"t":{"452":{"position":[[121,2]]},"454":{"position":[[40,2]]}}}],["244,847",{"_index":2625,"t":{"483":{"position":[[96,7]]}}}],["25.7",{"_index":2617,"t":{"479":{"position":[[69,4]]}}}],["250",{"_index":2989,"t":{"547":{"position":[[1796,3]]}}}],["2518",{"_index":840,"t":{"130":{"position":[[1374,5]]}}}],["256",{"_index":1345,"t":{"135":{"position":[[996,3]]}}}],["27",{"_index":2979,"t":{"547":{"position":[[1188,2],[2196,2],[2210,2]]}}}],["2774",{"_index":1023,"t":{"130":{"position":[[4001,5],[6876,5]]}}}],["28",{"_index":2578,"t":{"473":{"position":[[454,2]]}}}],["2beb887efd54",{"_index":3245,"t":{"606":{"position":[[281,13]]}}}],["3",{"_index":902,"t":{"130":{"position":[[2192,1],[3383,1],[3535,1],[5899,1],[6149,1]]},"386":{"position":[[185,1]]},"404":{"position":[[1460,3]]},"559":{"position":[[2998,3]]},"650":{"position":[[723,3],[744,3]]},"656":{"position":[[675,2],[761,2],[767,1]]}}}],["3.1",{"_index":909,"t":{"130":{"position":[[2274,3],[4203,3]]}}}],["3.2",{"_index":927,"t":{"130":{"position":[[2542,3],[4609,3]]}}}],["30",{"_index":1707,"t":{"186":{"position":[[442,2]]},"336":{"position":[[342,2]]},"338":{"position":[[179,2]]},"358":{"position":[[452,2]]},"360":{"position":[[192,2]]},"485":{"position":[[537,2]]}}}],["300",{"_index":879,"t":{"130":{"position":[[1871,3]]}}}],["3000",{"_index":515,"t":{"57":{"position":[[226,8]]},"162":{"position":[[357,4]]},"164":{"position":[[271,4]]},"166":{"position":[[320,4]]},"168":{"position":[[190,4]]},"170":{"position":[[201,4]]}}}],["301",{"_index":882,"t":{"130":{"position":[[1919,3]]},"424":{"position":[[253,4]]},"664":{"position":[[656,4]]}}}],["302",{"_index":885,"t":{"130":{"position":[[1956,3]]},"426":{"position":[[566,3]]},"664":{"position":[[179,3]]},"666":{"position":[[187,3]]},"668":{"position":[[215,3]]}}}],["303",{"_index":888,"t":{"130":{"position":[[1996,3]]}}}],["304",{"_index":891,"t":{"130":{"position":[[2039,3]]}}}],["305",{"_index":894,"t":{"130":{"position":[[2077,3]]}}}],["307",{"_index":897,"t":{"130":{"position":[[2126,3]]}}}],["308",{"_index":900,"t":{"130":{"position":[[2175,3]]}}}],["32",{"_index":1368,"t":{"135":{"position":[[1953,4]]},"242":{"position":[[92,2]]},"244":{"position":[[289,2],[426,3]]},"246":{"position":[[391,2],[476,3]]}}}],["32.23",{"_index":3404,"t":{"656":{"position":[[646,5],[681,5]]}}}],["3229",{"_index":876,"t":{"130":{"position":[[1834,5]]}}}],["32gb",{"_index":2585,"t":{"473":{"position":[[507,4]]}}}],["33",{"_index":1963,"t":{"278":{"position":[[648,3]]}}}],["354.1",{"_index":2611,"t":{"475":{"position":[[518,5]]}}}],["36",{"_index":2093,"t":{"336":{"position":[[670,2]]},"338":{"position":[[291,3],[323,2]]}}}],["3600",{"_index":286,"t":{"17":{"position":[[2775,5]]},"298":{"position":[[523,5]]}}}],["360641",{"_index":3326,"t":{"634":{"position":[[716,6]]},"682":{"position":[[521,6]]},"684":{"position":[[601,6]]}}}],["367,069",{"_index":2610,"t":{"475":{"position":[[462,7]]}}}],["368,647",{"_index":2620,"t":{"481":{"position":[[14,7]]}}}],["390.44",{"_index":2615,"t":{"477":{"position":[[148,6]]}}}],["3rd",{"_index":2767,"t":{"510":{"position":[[158,3]]}}}],["4",{"_index":986,"t":{"130":{"position":[[3426,1],[5967,1]]},"135":{"position":[[506,1]]},"153":{"position":[[232,2]]},"545":{"position":[[3514,2]]},"547":{"position":[[579,1]]},"559":{"position":[[3137,3]]}}}],["4,302",{"_index":2618,"t":{"479":{"position":[[94,5]]}}}],["4.1",{"_index":865,"t":{"130":{"position":[[1717,3],[2056,3]]}}}],["4.15.0",{"_index":2589,"t":{"473":{"position":[[531,6]]}}}],["4.2",{"_index":942,"t":{"130":{"position":[[2759,3],[4934,3]]}}}],["4.3.1",{"_index":789,"t":{"130":{"position":[[79,5]]}}}],["4.3.2",{"_index":791,"t":{"130":{"position":[[118,5]]}}}],["4.3.3",{"_index":793,"t":{"130":{"position":[[157,5]]}}}],["4.3.4",{"_index":795,"t":{"130":{"position":[[194,5]]}}}],["4.3.5",{"_index":800,"t":{"130":{"position":[[271,5]]}}}],["4.3.6",{"_index":802,"t":{"130":{"position":[[316,5]]}}}],["4.3.7",{"_index":804,"t":{"130":{"position":[[361,5]]}}}],["4.3.8",{"_index":806,"t":{"130":{"position":[[402,5]]}}}],["4.4",{"_index":954,"t":{"130":{"position":[[2974,3],[5275,3]]},"481":{"position":[[149,3]]}}}],["400",{"_index":904,"t":{"130":{"position":[[2213,3]]},"344":{"position":[[839,3]]},"362":{"position":[[855,3],[970,3]]}}}],["401",{"_index":907,"t":{"130":{"position":[[2257,3]]},"172":{"position":[[138,3]]},"178":{"position":[[943,3]]},"350":{"position":[[432,3]]}}}],["402",{"_index":911,"t":{"130":{"position":[[2302,3]]}}}],["403",{"_index":914,"t":{"130":{"position":[[2343,3]]}}}],["404",{"_index":917,"t":{"130":{"position":[[2383,3]]},"490":{"position":[[229,3],[360,3]]},"503":{"position":[[951,4]]},"516":{"position":[[860,3]]},"547":{"position":[[316,3]]}}}],["404.html",{"_index":1989,"t":{"298":{"position":[[503,11]]}}}],["405",{"_index":920,"t":{"130":{"position":[[2431,3]]}}}],["406",{"_index":923,"t":{"130":{"position":[[2476,3]]}}}],["407",{"_index":926,"t":{"130":{"position":[[2525,3]]}}}],["408",{"_index":929,"t":{"130":{"position":[[2569,3]]},"470":{"position":[[904,3]]}}}],["409",{"_index":932,"t":{"130":{"position":[[2609,3]]}}}],["4096",{"_index":1452,"t":{"135":{"position":[[5565,4],[6975,4]]}}}],["410",{"_index":935,"t":{"130":{"position":[[2645,3]]}}}],["411",{"_index":938,"t":{"130":{"position":[[2691,3]]}}}],["412",{"_index":941,"t":{"130":{"position":[[2742,3]]}}}],["413",{"_index":944,"t":{"130":{"position":[[2793,3]]},"135":{"position":[[465,3]]}}}],["414",{"_index":947,"t":{"130":{"position":[[2843,3]]}}}],["415",{"_index":950,"t":{"130":{"position":[[2896,3]]},"692":{"position":[[295,3],[385,3]]}}}],["416",{"_index":953,"t":{"130":{"position":[[2957,3]]}}}],["417",{"_index":956,"t":{"130":{"position":[[3004,3]]}}}],["418",{"_index":959,"t":{"130":{"position":[[3043,3]]}}}],["42",{"_index":2088,"t":{"334":{"position":[[54,2]]},"547":{"position":[[2583,2]]}}}],["42.8",{"_index":2613,"t":{"477":{"position":[[69,4]]}}}],["421",{"_index":963,"t":{"130":{"position":[[3093,3]]}}}],["422",{"_index":967,"t":{"130":{"position":[[3144,3]]}}}],["423",{"_index":970,"t":{"130":{"position":[[3181,3]]}}}],["424",{"_index":973,"t":{"130":{"position":[[3228,3]]}}}],["425",{"_index":976,"t":{"130":{"position":[[3267,3]]}}}],["426",{"_index":120,"t":{"6":{"position":[[1543,4]]},"130":{"position":[[3313,3]]}}}],["428",{"_index":982,"t":{"130":{"position":[[3366,3]]}}}],["429",{"_index":985,"t":{"130":{"position":[[3409,3]]},"362":{"position":[[274,3]]}}}],["431",{"_index":988,"t":{"130":{"position":[[3464,3]]}}}],["450b",{"_index":3243,"t":{"606":{"position":[[271,4]]}}}],["451",{"_index":991,"t":{"130":{"position":[[3518,3]]}}}],["4918",{"_index":868,"t":{"130":{"position":[[1752,5],[3155,5],[3192,5],[3239,5],[3917,5],[5556,5],[5609,5],[5682,5],[6749,5]]}}}],["4gb",{"_index":2632,"t":{"485":{"position":[[108,3]]}}}],["5",{"_index":989,"t":{"130":{"position":[[3481,1],[6059,1]]},"362":{"position":[[302,1]]},"364":{"position":[[33,2]]},"404":{"position":[[1624,1],[1765,3]]},"559":{"position":[[511,1]]}}}],["5.2",{"_index":978,"t":{"130":{"position":[[3284,4],[5745,4]]}}}],["500",{"_index":994,"t":{"130":{"position":[[3565,3]]},"374":{"position":[[1014,3]]},"376":{"position":[[171,3]]},"485":{"position":[[197,3]]},"505":{"position":[[90,3],[342,3]]},"507":{"position":[[735,3]]},"662":{"position":[[291,5]]}}}],["5000",{"_index":2637,"t":{"485":{"position":[[261,5],[591,4]]}}}],["501",{"_index":997,"t":{"130":{"position":[[3611,3]]}}}],["502",{"_index":1000,"t":{"130":{"position":[[3653,3]]}}}],["503",{"_index":1003,"t":{"130":{"position":[[3703,3]]},"503":{"position":[[1026,3],[1088,3]]}}}],["504",{"_index":1006,"t":{"130":{"position":[[3749,3]]}}}],["505",{"_index":1009,"t":{"130":{"position":[[3804,3]]}}}],["506",{"_index":1012,"t":{"130":{"position":[[3857,3]]}}}],["507",{"_index":1016,"t":{"130":{"position":[[3906,3]]}}}],["508",{"_index":1019,"t":{"130":{"position":[[3949,3]]}}}],["510",{"_index":1022,"t":{"130":{"position":[[3990,3]]}}}],["511",{"_index":1026,"t":{"130":{"position":[[4047,3]]}}}],["5120",{"_index":2583,"t":{"473":{"position":[[488,4]]}}}],["57,880",{"_index":2622,"t":{"481":{"position":[[94,6]]}}}],["5789",{"_index":798,"t":{"130":{"position":[[229,4]]}}}],["5842",{"_index":872,"t":{"130":{"position":[[1798,5],[3960,5],[6814,5]]}}}],["6",{"_index":1027,"t":{"130":{"position":[[4064,1],[6978,1]]}}}],["6,162,556",{"_index":2607,"t":{"475":{"position":[[386,9]]}}}],["6.2.1",{"_index":834,"t":{"130":{"position":[[1288,5]]}}}],["6.2.2",{"_index":837,"t":{"130":{"position":[[1338,5]]}}}],["6.3.1",{"_index":846,"t":{"130":{"position":[[1448,5]]}}}],["6.3.2",{"_index":849,"t":{"130":{"position":[[1487,5]]}}}],["6.3.3",{"_index":852,"t":{"130":{"position":[[1527,5]]}}}],["6.3.4",{"_index":855,"t":{"130":{"position":[[1586,5]]}}}],["6.3.5",{"_index":858,"t":{"130":{"position":[[1627,5]]}}}],["6.3.6",{"_index":861,"t":{"130":{"position":[[1671,5]]}}}],["6.4.1",{"_index":880,"t":{"130":{"position":[[1888,5]]}}}],["6.4.2",{"_index":883,"t":{"130":{"position":[[1936,5]]}}}],["6.4.3",{"_index":886,"t":{"130":{"position":[[1973,5]]}}}],["6.4.4",{"_index":889,"t":{"130":{"position":[[2013,5]]}}}],["6.4.5",{"_index":895,"t":{"130":{"position":[[2094,5]]}}}],["6.4.7",{"_index":898,"t":{"130":{"position":[[2143,5]]}}}],["6.5.1",{"_index":905,"t":{"130":{"position":[[2230,5],[4137,5]]}}}],["6.5.10",{"_index":939,"t":{"130":{"position":[[2708,6],[4855,6]]}}}],["6.5.11",{"_index":945,"t":{"130":{"position":[[2810,6],[5016,6]]}}}],["6.5.12",{"_index":948,"t":{"130":{"position":[[2860,6],[5093,6]]}}}],["6.5.13",{"_index":951,"t":{"130":{"position":[[2913,6],[5176,6]]}}}],["6.5.14",{"_index":957,"t":{"130":{"position":[[3021,6],[5349,6]]}}}],["6.5.15",{"_index":980,"t":{"130":{"position":[[3330,6],[5816,6]]}}}],["6.5.2",{"_index":912,"t":{"130":{"position":[[2319,5],[4273,5]]}}}],["6.5.3",{"_index":915,"t":{"130":{"position":[[2360,5],[4333,5]]}}}],["6.5.4",{"_index":918,"t":{"130":{"position":[[2400,5],[4391,5]]}}}],["6.5.5",{"_index":921,"t":{"130":{"position":[[2448,5],[4465,5]]}}}],["6.5.6",{"_index":924,"t":{"130":{"position":[[2493,5],[4533,5]]}}}],["6.5.7",{"_index":930,"t":{"130":{"position":[[2586,5],[4677,5]]}}}],["6.5.8",{"_index":933,"t":{"130":{"position":[[2626,5],[4735,5]]}}}],["6.5.9",{"_index":936,"t":{"130":{"position":[[2662,5],[4785,5]]}}}],["6.6.1",{"_index":995,"t":{"130":{"position":[[3582,5],[6225,5]]}}}],["6.6.2",{"_index":998,"t":{"130":{"position":[[3628,5],[6295,5]]}}}],["6.6.3",{"_index":1001,"t":{"130":{"position":[[3670,5],[6357,5]]}}}],["6.6.4",{"_index":1004,"t":{"130":{"position":[[3720,5],[6435,5]]}}}],["6.6.5",{"_index":1007,"t":{"130":{"position":[[3766,5],[6505,5]]}}}],["6.6.6",{"_index":1010,"t":{"130":{"position":[[3821,5],[6593,5]]}}}],["600",{"_index":1715,"t":{"186":{"position":[[702,7]]}}}],["6000",{"_index":1720,"t":{"186":{"position":[[923,7]]}}}],["6140",{"_index":2629,"t":{"485":{"position":[[85,4]]}}}],["6585",{"_index":983,"t":{"130":{"position":[[3377,5],[3420,5],[3475,5],[4058,5],[5893,5],[5961,5],[6053,5],[6972,5]]}}}],["7",{"_index":1024,"t":{"130":{"position":[[4007,1],[6882,1]]}}}],["7.0",{"_index":3003,"t":{"547":{"position":[[2682,4]]}}}],["7.1",{"_index":873,"t":{"130":{"position":[[1804,3]]}}}],["7.2",{"_index":1020,"t":{"130":{"position":[[3966,3],[6820,3]]}}}],["700",{"_index":3423,"t":{"662":{"position":[[152,4],[157,3],[297,4]]}}}],["7168",{"_index":960,"t":{"130":{"position":[[3054,5],[5398,5]]}}}],["7231",{"_index":788,"t":{"130":{"position":[[73,5],[112,5],[151,5],[188,5],[265,5],[310,5],[355,5],[396,5],[1282,5],[1332,5],[1442,5],[1481,5],[1521,5],[1580,5],[1621,5],[1665,5],[1882,5],[1930,5],[1967,5],[2007,5],[2088,5],[2137,5],[2224,5],[2313,5],[2354,5],[2394,5],[2442,5],[2487,5],[2580,5],[2620,5],[2656,5],[2702,5],[2804,5],[2854,5],[2907,5],[3015,5],[3324,5],[3576,5],[3622,5],[3664,5],[3714,5],[3760,5],[3815,5],[4131,5],[4267,5],[4327,5],[4385,5],[4459,5],[4527,5],[4671,5],[4729,5],[4779,5],[4849,5],[5010,5],[5087,5],[5170,5],[5343,5],[5810,5],[6219,5],[6289,5],[6351,5],[6429,5],[6499,5],[6587,5]]}}}],["7232",{"_index":892,"t":{"130":{"position":[[2050,5],[2753,5],[4928,5]]}}}],["7233",{"_index":864,"t":{"130":{"position":[[1711,5],[2968,5],[5269,5]]}}}],["7235",{"_index":908,"t":{"130":{"position":[[2268,5],[2536,5],[4197,5],[4603,5]]}}}],["72d5",{"_index":2936,"t":{"547":{"position":[[458,4]]}}}],["750",{"_index":2734,"t":{"500":{"position":[[1330,4]]}}}],["7538",{"_index":901,"t":{"130":{"position":[[2186,5]]}}}],["7540",{"_index":964,"t":{"130":{"position":[[3104,5],[5476,5]]}}}],["7725",{"_index":992,"t":{"130":{"position":[[3529,5],[6143,5]]}}}],["8",{"_index":826,"t":{"130":{"position":[[877,2],[930,2],[985,2],[1050,2],[1117,2],[1196,2]]},"228":{"position":[[731,1]]},"496":{"position":[[25,1]]},"505":{"position":[[548,1]]},"547":{"position":[[657,1]]},"564":{"position":[[428,2],[1214,2]]},"618":{"position":[[296,1]]},"706":{"position":[[328,3],[369,2]]}}}],["8.1",{"_index":1014,"t":{"130":{"position":[[3874,3],[6677,3]]}}}],["8080",{"_index":473,"t":{"47":{"position":[[131,5]]}}}],["8297",{"_index":844,"t":{"130":{"position":[[1415,4]]}}}],["8446",{"_index":1843,"t":{"228":{"position":[[104,5]]}}}],["8470",{"_index":977,"t":{"130":{"position":[[3278,5],[5739,5]]}}}],["88",{"_index":2590,"t":{"473":{"position":[[538,2]]}}}],["8859",{"_index":3107,"t":{"564":{"position":[[1221,4],[1385,4],[1402,4]]}}}],["8d7ad5e3",{"_index":3241,"t":{"606":{"position":[[256,9]]}}}],["9",{"_index":3081,"t":{"559":{"position":[[2962,3]]}}}],["9.1.2",{"_index":965,"t":{"130":{"position":[[3110,5],[5482,5]]}}}],["900",{"_index":3424,"t":{"662":{"position":[[161,3]]}}}],["91",{"_index":2958,"t":{"547":{"position":[[828,2],[907,2]]}}}],["_",{"_index":424,"t":{"35":{"position":[[255,1]]},"37":{"position":[[449,1]]},"39":{"position":[[228,1]]},"41":{"position":[[334,1]]},"57":{"position":[[203,1],[240,3]]},"59":{"position":[[704,1],[798,1]]},"108":{"position":[[129,1]]},"149":{"position":[[498,1]]},"153":{"position":[[512,1]]},"186":{"position":[[654,1]]},"310":{"position":[[202,1]]},"346":{"position":[[825,2]]},"470":{"position":[[312,1],[1139,1],[1741,1]]},"559":{"position":[[1189,2],[2331,2]]},"610":{"position":[[432,1]]},"634":{"position":[[600,2]]},"682":{"position":[[405,2]]},"684":{"position":[[485,2]]}}}],["_pass",{"_index":1681,"t":{"176":{"position":[[832,8]]}}}],["_test.go",{"_index":523,"t":{"59":{"position":[[84,8]]}}}],["_test\\\\.go",{"_index":2689,"t":{"492":{"position":[[764,14]]}}}],["_user",{"_index":1679,"t":{"176":{"position":[[806,8]]}}}],["a.byt",{"_index":572,"t":{"68":{"position":[[216,9]]}}}],["a.get(\"/test",{"_index":444,"t":{"37":{"position":[[406,14]]}}}],["a.name(\"fd",{"_index":443,"t":{"37":{"position":[[392,13]]}}}],["a.pars",{"_index":570,"t":{"68":{"position":[[159,10]]}}}],["a.request",{"_index":566,"t":{"68":{"position":[[65,11]]}}}],["a/test",{"_index":449,"t":{"37":{"position":[[734,10],[936,10]]}}}],["a241",{"_index":3244,"t":{"606":{"position":[[276,4]]}}}],["aaf3",{"_index":3242,"t":{"606":{"position":[[266,4]]}}}],["abort",{"_index":1862,"t":{"228":{"position":[[970,6]]}}}],["abov",{"_index":100,"t":{"6":{"position":[[1081,5]]},"149":{"position":[[218,5]]},"464":{"position":[[668,6]]}}}],["ac",{"_index":2698,"t":{"496":{"position":[[80,3]]},"556":{"position":[[98,3]]}}}],["accept",{"_index":1126,"t":{"130":{"position":[[7395,7],[7432,7],[7935,8],[7966,7],[8006,7],[8047,7],[9664,7],[10736,7],[10972,7],[11012,7],[11057,7]]},"135":{"position":[[3677,9]]},"192":{"position":[[125,6]]},"208":{"position":[[449,8],[641,8]]},"384":{"position":[[607,8]]},"554":{"position":[[572,7]]},"564":{"position":[[57,11],[97,6],[352,7],[782,7],[1107,10],[1175,6],[1194,6],[1237,6],[1278,6]]},"594":{"position":[[36,6],[64,7],[291,7],[359,7],[433,7]]},"710":{"position":[[469,9],[511,6],[528,6]]}}}],["accepts(off",{"_index":3085,"t":{"564":{"position":[[141,14]]}}}],["acceptscharsets(off",{"_index":3086,"t":{"564":{"position":[[188,22]]}}}],["acceptsencodings(off",{"_index":3087,"t":{"564":{"position":[[243,23]]}}}],["acceptslanguages(off",{"_index":3088,"t":{"564":{"position":[[299,23]]}}}],["access",{"_index":1170,"t":{"130":{"position":[[8217,7],[8286,7],[8351,7],[8415,7],[8480,7],[8540,7],[8601,7],[8669,7]]},"208":{"position":[[658,6]]},"210":{"position":[[252,7],[609,6],[736,9],[1498,7]]},"284":{"position":[[135,7]]},"300":{"position":[[463,6],[595,6]]},"312":{"position":[[233,6]]},"384":{"position":[[563,6]]},"473":{"position":[[146,7]]},"568":{"position":[[47,6]]},"634":{"position":[[3,6]]},"640":{"position":[[891,8]]}}}],["access_token=clearli",{"_index":2129,"t":{"344":{"position":[[1035,21]]}}}],["access_token=correct",{"_index":2127,"t":{"344":{"position":[[924,21]]},"346":{"position":[[1541,21],[1705,21]]}}}],["accordingli",{"_index":2755,"t":{"507":{"position":[[263,11]]}}}],["account",{"_index":2191,"t":{"360":{"position":[[302,7]]}}}],["acquireag",{"_index":565,"t":{"68":{"position":[[43,14]]}}}],["acquirearg",{"_index":674,"t":{"96":{"position":[[209,11],[334,13]]},"98":{"position":[[271,11],[405,13]]}}}],["acquireformfil",{"_index":707,"t":{"98":{"position":[[1549,15]]}}}],["acquirerespons",{"_index":757,"t":{"118":{"position":[[105,15],[258,17]]}}}],["action",{"_index":2078,"t":{"326":{"position":[[183,6]]},"374":{"position":[[440,6]]},"507":{"position":[[256,6]]}}}],["activ",{"_index":394,"t":{"31":{"position":[[67,6],[272,6]]}}}],["active20{{.title}}back/static/image.png",{"_index":2006,"t":{"300":{"position":[[522,35]]}}}],["http:///static/static/image.png",{"_index":2008,"t":{"300":{"position":[[617,42]]}}}],["http://api.example.com/users?page=2",{"_index":3297,"t":{"626":{"position":[[195,38],[300,38]]}}}],["http://api.example.com/users?page=5",{"_index":3298,"t":{"626":{"position":[[242,38],[354,38]]}}}],["http://example.com",{"_index":3359,"t":{"648":{"position":[[127,18]]}}}],["http://example.com/?field1=value1&field1=value2&field2=value3",{"_index":3367,"t":{"650":{"position":[[374,61]]}}}],["http://example.com/?list_a=1&list_a=2&list_a=3&list_b[]=1&list_b[]=2&list_b[]=3&list_c=1,2,3",{"_index":3372,"t":{"650":{"position":[[558,92]]}}}],["http://example.com/?name=alex&amount=32.23&id",{"_index":3402,"t":{"656":{"position":[[533,46]]}}}],["http://example.com/?name=alex&wanna_cake=2&id",{"_index":3408,"t":{"658":{"position":[[523,46]]}}}],["http://example.com/?name=alex&want_pizza=false&id",{"_index":3360,"t":{"650":{"position":[[180,50]]},"654":{"position":[[465,50]]}}}],["http://example.com/?order=desc&brand=nik",{"_index":3388,"t":{"652":{"position":[[341,41]]}}}],["http://example.com/hello",{"_index":3189,"t":{"584":{"position":[[337,24]]}}}],["http://example.com/search?q=someth",{"_index":3331,"t":{"638":{"position":[[94,37]]}}}],["http://example.com/user/111",{"_index":3351,"t":{"644":{"position":[[309,27]]}}}],["http://example.com/user/123",{"_index":3343,"t":{"642":{"position":[[350,27]]}}}],["http://example.com/user/fenni",{"_index":3119,"t":{"566":{"position":[[148,29]]},"640":{"position":[[297,29]]}}}],["http://example.com/user/fenny/123",{"_index":3122,"t":{"566":{"position":[[282,33]]},"640":{"position":[[422,33]]}}}],["http://example.com/users?sort=desc",{"_index":3357,"t":{"646":{"position":[[254,34]]}}}],["http://google.com",{"_index":534,"t":{"59":{"position":[[460,17],[615,20]]},"404":{"position":[[1439,20]]},"570":{"position":[[281,20],[352,17],[425,18]]}}}],["http://google.com/search",{"_index":3263,"t":{"612":{"position":[[113,24]]}}}],["http://localhost",{"_index":2416,"t":{"404":{"position":[[2016,19]]},"570":{"position":[[302,19],[334,17],[407,17]]}}}],["http://localhost:3000",{"_index":136,"t":{"8":{"position":[[293,21]]},"208":{"position":[[589,21],[717,22]]},"320":{"position":[[268,21]]},"344":{"position":[[856,21],[968,21],[1070,21]]},"346":{"position":[[1451,21]]},"348":{"position":[[820,21]]},"404":{"position":[[1726,24]]},"547":{"position":[[2601,22]]},"580":{"position":[[1238,21]]},"674":{"position":[[763,24]]}}}],["http://localhost:3000/1",{"_index":2984,"t":{"547":{"position":[[1443,23],[1711,23]]}}}],["http://localhost:3000/12",{"_index":2983,"t":{"547":{"position":[[1397,24]]}}}],["http://localhost:3000/120000",{"_index":2986,"t":{"547":{"position":[[1645,28]]}}}],["http://localhost:3000/125",{"_index":2995,"t":{"547":{"position":[[2044,25]]}}}],["http://localhost:3000/2022",{"_index":2998,"t":{"547":{"position":[[2166,26]]}}}],["http://localhost:3000/250",{"_index":2988,"t":{"547":{"position":[[1767,25]]}}}],["http://localhost:3000/42",{"_index":3001,"t":{"547":{"position":[[2555,24]]}}}],["http://localhost:3000/7.0",{"_index":3002,"t":{"547":{"position":[[2642,25]]}}}],["http://localhost:3000/?name=john&pass=do",{"_index":3167,"t":{"580":{"position":[[1276,43]]}}}],["http://localhost:3000/?name=john&pass=doe&products=shoe,hat",{"_index":3420,"t":{"660":{"position":[[737,61]]}}}],["http://localhost:3000/allow",{"_index":2158,"t":{"348":{"position":[[952,29]]}}}],["http://localhost:3000/api/user/john",{"_index":184,"t":{"10":{"position":[[1218,35]]}}}],["http://localhost:3000/auth2",{"_index":2152,"t":{"346":{"position":[[1749,27]]}}}],["http://localhost:3000/authent",{"_index":2150,"t":{"346":{"position":[[1585,35]]}}}],["http://localhost:3000/bodi",{"_index":3551,"t":{"696":{"position":[[1574,26]]}}}],["http://localhost:3000/css/style.css",{"_index":218,"t":{"17":{"position":[[435,35]]}}}],["http://localhost:3000/flights/lax",{"_index":2895,"t":{"545":{"position":[[2140,33]]}}}],["http://localhost:3000/foo/1000",{"_index":2545,"t":{"470":{"position":[[861,32]]}}}],["http://localhost:3000/foo/3000",{"_index":2546,"t":{"470":{"position":[[952,32]]}}}],["http://localhost:3000/hello.html",{"_index":216,"t":{"17":{"position":[[355,32]]}}}],["http://localhost:3000/john",{"_index":178,"t":{"10":{"position":[[991,26]]}}}],["http://localhost:3000/js/jquery.j",{"_index":217,"t":{"17":{"position":[[394,34]]}}}],["http://localhost:3000/metr",{"_index":2329,"t":{"384":{"position":[[634,29]]}}}],["http://localhost:3000/old",{"_index":2450,"t":{"424":{"position":[[476,25]]},"444":{"position":[[456,25]]}}}],["http://localhost:3000/old/hello",{"_index":2451,"t":{"424":{"position":[[507,31]]},"444":{"position":[[487,31]]}}}],["http://localhost:3000/plantae/prunus.persica",{"_index":2889,"t":{"545":{"position":[[1931,44]]}}}],["http://localhost:3000/query?title=title&body=body&date=2021",{"_index":3552,"t":{"696":{"position":[[1616,60]]}}}],["http://localhost:3000/shop/product/color:blue/size:x",{"_index":2903,"t":{"545":{"position":[[2479,53]]}}}],["http://localhost:3000/static/css/style.css",{"_index":228,"t":{"17":{"position":[[968,42]]}}}],["http://localhost:3000/static/hello.html",{"_index":226,"t":{"17":{"position":[[874,39]]}}}],["http://localhost:3000/static/js/jquery.j",{"_index":227,"t":{"17":{"position":[[920,41]]}}}],["http://localhost:3000/test",{"_index":2997,"t":{"547":{"position":[[2104,26]]}}}],["http://localhost:3001",{"_index":2419,"t":{"404":{"position":[[2276,24],[2459,24],[2875,24]]}}}],["http://localhost:3002",{"_index":2420,"t":{"404":{"position":[[2301,24],[2484,24],[2900,24]]}}}],["http://localhost:3003",{"_index":2421,"t":{"404":{"position":[[2326,24],[2509,24],[2925,24]]}}}],["http://localhost:8000",{"_index":2405,"t":{"404":{"position":[[820,25]]}}}],["http://localhost:8080",{"_index":3142,"t":{"578":{"position":[[92,21]]}}}],["http://localhost:8080/css/style.css",{"_index":206,"t":{"12":{"position":[[466,35]]}}}],["http://localhost:8080/hello",{"_index":3473,"t":{"680":{"position":[[84,27]]}}}],["http://localhost:8080/hello%20world",{"_index":173,"t":{"10":{"position":[[787,35]]}}}],["http://localhost:8080/hello.html",{"_index":204,"t":{"12":{"position":[[398,32]]}}}],["http://localhost:8080/js/jquery.j",{"_index":205,"t":{"12":{"position":[[431,34]]}}}],["http://www.foobar.com",{"_index":2429,"t":{"406":{"position":[[332,22]]}}}],["httpapi",{"_index":2081,"t":{"326":{"position":[[293,7]]}}}],["httperror",{"_index":1488,"t":{"137":{"position":[[23,9]]}}}],["httphandler",{"_index":1611,"t":{"159":{"position":[[27,11]]}}}],["httphandler(h",{"_index":1612,"t":{"159":{"position":[[39,13]]}}}],["httphandlerfunc",{"_index":1614,"t":{"159":{"position":[[111,15]]}}}],["httphandlerfunc(h",{"_index":1615,"t":{"159":{"position":[[127,17]]}}}],["httphandlerfunc(mw",{"_index":1618,"t":{"159":{"position":[[226,18]]}}}],["httpmiddlewar",{"_index":1617,"t":{"159":{"position":[[211,14]]}}}],["httponli",{"_index":3179,"t":{"582":{"position":[[822,9],[1027,9]]},"588":{"position":[[280,8]]}}}],["httpreq",{"_index":1660,"t":{"170":{"position":[[304,8]]}}}],["httpreq.url.str",{"_index":1663,"t":{"170":{"position":[[420,21]]}}}],["https://blog.trailofbits.com/2019/03/25/what",{"_index":1859,"t":{"228":{"position":[[733,44]]}}}],["https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/chart.bundle.min.j",{"_index":2352,"t":{"386":{"position":[[857,66]]}}}],["https://datatracker.ietf.org/doc/html/draft",{"_index":2079,"t":{"326":{"position":[[244,43]]}}}],["https://datatracker.ietf.org/doc/html/rfc8446#sect",{"_index":1858,"t":{"228":{"position":[[677,53]]}}}],["https://example.com",{"_index":783,"t":{"128":{"position":[[290,21]]},"574":{"position":[[198,19]]}}}],["https://example.com/page#chapt",{"_index":3135,"t":{"574":{"position":[[108,32]]}}}],["https://expressjs.com/en/4x/api.html#req.fresh",{"_index":3235,"t":{"600":{"position":[[0,46]]}}}],["https://expressjs.com/en/4x/api.html#req.stal",{"_index":3556,"t":{"700":{"position":[[0,46]]}}}],["https://fonts.googleapis.com/css2?family=roboto:wght@400;900&display=swap",{"_index":2349,"t":{"386":{"position":[[656,73]]}}}],["https://foobar.com",{"_index":2428,"t":{"406":{"position":[[311,20]]}}}],["https://github.com/geertjohan/go.ric",{"_index":2019,"t":{"306":{"position":[[0,37]]}}}],["https://github.com/go",{"_index":3038,"t":{"559":{"position":[[961,21]]}}}],["https://github.com/gobuffalo/packr",{"_index":2015,"t":{"304":{"position":[[0,34]]}}}],["https://github.com/markbates/pkg",{"_index":2011,"t":{"302":{"position":[[0,34]]}}}],["https://github.com/rakyll/statik",{"_index":2025,"t":{"310":{"position":[[0,32]]}}}],["https://github.com/smallnest/go",{"_index":2627,"t":{"485":{"position":[[3,31]]}}}],["https://github.com/unnoted/fileb0x",{"_index":2022,"t":{"308":{"position":[[0,34]]}}}],["https://gofiber.io",{"_index":1763,"t":{"208":{"position":[[369,20]]}}}],["https://gofiber.net",{"_index":1764,"t":{"208":{"position":[[390,21]]}}}],["https://i.imgur.com/\"+c.params(\"id\")+\".gif",{"_index":2407,"t":{"404":{"position":[[1119,44]]}}}],["https://programming.guide/go/format",{"_index":2253,"t":{"374":{"position":[[662,35]]}}}],["httptest.newrequest(\"get",{"_index":538,"t":{"59":{"position":[[588,26]]}}}],["hyphen",{"_index":2880,"t":{"545":{"position":[[1613,6]]}}}],["i.",{"_index":309,"t":{"19":{"position":[[1292,4]]},"228":{"position":[[965,4]]},"406":{"position":[[305,5]]},"541":{"position":[[1292,4]]},"561":{"position":[[1292,4]]}}}],["icon",{"_index":1968,"t":{"284":{"position":[[80,4]]}}}],["id",{"_index":1257,"t":{"130":{"position":[[10502,3],[11548,3]]},"372":{"position":[[656,2]]},"434":{"position":[[444,3]]},"436":{"position":[[259,2],[298,3],[503,2]]},"448":{"position":[[445,4]]},"452":{"position":[[363,2],[1322,2]]},"606":{"position":[[248,4]]},"642":{"position":[[426,3]]},"644":{"position":[[401,3],[453,7]]}}}],["idjohndoe/myembeddedfil",{"_index":2023,"t":{"308":{"position":[[149,24]]}}}],["module>/statik",{"_index":2030,"t":{"310":{"position":[[214,15]]}}}],["monitor",{"_index":2319,"t":{"380":{"position":[[0,7],[85,7],[101,7]]},"386":{"position":[[120,8],[263,10]]}}}],["monitor.new",{"_index":2324,"t":{"384":{"position":[[321,14]]}}}],["monitor.new(monitor.config{titl",{"_index":2327,"t":{"384":{"position":[[488,33]]}}}],["more",{"_index":116,"t":{"6":{"position":[[1512,4]]},"14":{"position":[[4,4]]},"17":{"position":[[1044,4]]},"23":{"position":[[39,4]]},"135":{"position":[[4813,4],[5057,4]]},"264":{"position":[[46,4]]},"344":{"position":[[1130,4]]},"362":{"position":[[1399,4]]},"372":{"position":[[725,4]]},"440":{"position":[[140,4]]},"490":{"position":[[113,4]]},"492":{"position":[[146,4]]},"496":{"position":[[139,4]]},"500":{"position":[[1275,4]]},"547":{"position":[[647,4],[857,4],[952,4],[1022,4]]},"551":{"position":[[437,4]]},"559":{"position":[[939,4]]},"578":{"position":[[386,7]]},"580":{"position":[[1453,7]]},"584":{"position":[[218,4]]},"586":{"position":[[275,4]]},"590":{"position":[[473,7]]},"598":{"position":[[453,7]]},"602":{"position":[[465,7]]},"606":{"position":[[532,7]]},"612":{"position":[[350,7]]},"638":{"position":[[356,7]]},"640":{"position":[[1182,7]]},"652":{"position":[[655,7]]},"664":{"position":[[462,4]]}}}],["mount",{"_index":323,"t":{"21":{"position":[[8,5],[43,6]]},"23":{"position":[[81,8],[435,8],[497,5],[536,8]]},"135":{"position":[[3436,7]]},"538":{"position":[[49,8],[71,5],[108,7],[201,9],[649,5],[728,5],[795,5],[848,5]]},"549":{"position":[[509,6]]}}}],["mount(prefix",{"_index":324,"t":{"21":{"position":[[74,12]]}}}],["mountpath",{"_index":332,"t":{"23":{"position":[[4,9],[116,11],[467,10]]}}}],["ms",{"_index":2532,"t":{"470":{"position":[[360,5],[1187,5]]},"475":{"position":[[448,3],[524,3]]},"477":{"position":[[74,3],[155,3]]},"479":{"position":[[74,3],[154,3]]},"481":{"position":[[74,3],[153,3]]},"483":{"position":[[76,3],[156,3]]},"485":{"position":[[178,3],[185,3],[193,3],[201,2],[540,2]]},"492":{"position":[[659,2]]}}}],["msg",{"_index":1533,"t":{"147":{"position":[[226,4]]}}}],["mstimeout",{"_index":531,"t":{"59":{"position":[[296,9]]}}}],["multi",{"_index":1447,"t":{"135":{"position":[[5492,5],[5520,5]]},"406":{"position":[[870,5],[901,5]]}}}],["multipart",{"_index":682,"t":{"98":{"position":[[20,9],[185,9],[632,9],[833,9],[1201,9],[1248,9],[1478,9]]},"135":{"position":[[1559,9],[1650,9]]},"634":{"position":[[10,9],[294,9]]},"682":{"position":[[27,9],[191,9]]},"684":{"position":[[27,9],[271,9]]}}}],["multipart.filehead",{"_index":3228,"t":{"596":{"position":[[138,23]]},"634":{"position":[[549,23]]},"682":{"position":[[87,22],[354,23]]},"684":{"position":[[126,22],[434,23]]}}}],["multipart.form",{"_index":3314,"t":{"634":{"position":[[207,17],[364,15]]},"682":{"position":[[261,15]]},"684":{"position":[[341,15]]}}}],["multipart/form",{"_index":683,"t":{"98":{"position":[[81,14]]},"130":{"position":[[807,15]]},"580":{"position":[[306,14]]}}}],["multipartform",{"_index":681,"t":{"98":{"position":[[0,13],[165,13],[580,14]]},"596":{"position":[[0,13]]},"634":{"position":[[64,16],[191,15]]}}}],["multipartform(arg",{"_index":686,"t":{"98":{"position":[[356,18]]}}}],["multipartform(nil",{"_index":691,"t":{"98":{"position":[[752,19],[1133,19],[1840,18]]}}}],["multipl",{"_index":155,"t":{"10":{"position":[[208,8]]},"17":{"position":[[500,8]]},"19":{"position":[[1625,9],[1742,8]]},"72":{"position":[[38,8]]},"78":{"position":[[68,8]]},"98":{"position":[[889,8]]},"135":{"position":[[4757,8]]},"326":{"position":[[200,8]]},"394":{"position":[[369,8]]},"400":{"position":[[64,8]]},"402":{"position":[[41,8]]},"541":{"position":[[1625,9],[1742,8]]},"547":{"position":[[1250,8],[1502,8]]},"556":{"position":[[66,8]]},"561":{"position":[[1625,9],[1742,8]]},"582":{"position":[[259,8]]},"710":{"position":[[166,8]]}}}],["mustach",{"_index":2703,"t":{"496":{"position":[[117,8]]},"556":{"position":[[130,8]]}}}],["mycustomstorag",{"_index":2184,"t":{"358":{"position":[[636,18]]}}}],["myembeddedfiles.http",{"_index":2024,"t":{"308":{"position":[[268,21]]}}}],["myfil",{"_index":2946,"t":{"547":{"position":[[628,6]]}}}],["mymiddlewar",{"_index":3482,"t":{"680":{"position":[[405,14]]}}}],["myservic",{"_index":2326,"t":{"384":{"position":[[443,10],[522,10]]}}}],["myvalid",{"_index":3055,"t":{"559":{"position":[[1588,11]]}}}],["myvalidator.validate(us",{"_index":3067,"t":{"559":{"position":[[2237,27]]}}}],["myvalidator.validator.registervalidation(\"teen",{"_index":3058,"t":{"559":{"position":[[1908,50]]}}}],["n",{"_index":2815,"t":{"526":{"position":[[615,5]]},"712":{"position":[[74,2]]},"714":{"position":[[99,2]]},"716":{"position":[[76,2]]}}}],["name",{"_index":200,"t":{"12":{"position":[[251,5]]},"17":{"position":[[306,5],[1857,4]]},"27":{"position":[[142,4],[301,6],[368,6]]},"37":{"position":[[24,4],[571,7],[638,7],[707,7],[787,7],[850,7],[916,7],[1003,7],[1095,7]]},"39":{"position":[[30,5],[356,7]]},"41":{"position":[[443,7]]},"98":{"position":[[1087,6],[1325,4],[1350,4],[1370,4],[1375,4]]},"106":{"position":[[93,5]]},"133":{"position":[[30,5]]},"135":{"position":[[330,4],[849,4],[920,5],[1299,5],[2532,4]]},"147":{"position":[[1037,7]]},"159":{"position":[[0,4]]},"220":{"position":[[570,4]]},"240":{"position":[[105,6]]},"244":{"position":[[940,5]]},"250":{"position":[[106,5]]},"336":{"position":[[402,4]]},"450":{"position":[[466,4],[864,6]]},"452":{"position":[[1354,4]]},"492":{"position":[[444,6]]},"526":{"position":[[57,7],[150,6],[889,5],[919,5]]},"530":{"position":[[62,7],[160,6]]},"545":{"position":[[62,5],[75,5],[254,4],[611,5],[3028,6],[3057,7]]},"554":{"position":[[591,4]]},"559":{"position":[[441,4],[1382,4],[2163,5]]},"566":{"position":[[245,9]]},"580":{"position":[[461,5],[526,4]]},"582":{"position":[[221,5],[279,6],[744,5],[938,5]]},"588":{"position":[[79,4]]},"596":{"position":[[40,5]]},"598":{"position":[[36,5],[251,7]]},"610":{"position":[[18,5]]},"622":{"position":[[220,4],[331,5],[420,9],[476,7],[550,9]]},"624":{"position":[[151,4],[203,5],[338,4],[445,5]]},"660":{"position":[[311,5],[376,4]]},"666":{"position":[[510,7],[687,7]]},"674":{"position":[[321,5],[386,4],[791,6]]},"680":{"position":[[258,6]]},"704":{"position":[[51,4]]},"720":{"position":[[255,4],[387,5]]}}}],["name(\"addus",{"_index":2817,"t":{"526":{"position":[[719,18]]}}}],["name(\"destroyus",{"_index":2819,"t":{"526":{"position":[[829,22]]}}}],["name(\"hom",{"_index":3252,"t":{"610":{"position":[[257,15]]}}}],["name(\"index",{"_index":464,"t":{"41":{"position":[[311,16]]},"526":{"position":[[420,16]]}}}],["name(\"us",{"_index":3447,"t":{"666":{"position":[[890,15]]}}}],["name(\"user.show",{"_index":3255,"t":{"610":{"position":[[357,20]]}}}],["name(nam",{"_index":434,"t":{"37":{"position":[[80,9]]}}}],["name1",{"_index":701,"t":{"98":{"position":[[1118,7],[1723,7]]}}}],["name2",{"_index":714,"t":{"98":{"position":[[1787,7]]}}}],["namegramehello",{"_index":3225,"t":{"594":{"position":[[409,9]]}}}],["packag",{"_index":125,"t":{"8":{"position":[[81,7]]},"19":{"position":[[1206,8]]},"162":{"position":[[0,7]]},"164":{"position":[[0,7]]},"166":{"position":[[0,7]]},"168":{"position":[[0,7]]},"170":{"position":[[0,7]]},"176":{"position":[[22,7]]},"186":{"position":[[22,7]]},"196":{"position":[[22,7]]},"208":{"position":[[22,7]]},"214":{"position":[[695,7]]},"218":{"position":[[22,7]]},"226":{"position":[[41,8]]},"232":{"position":[[22,7]]},"244":{"position":[[22,7]]},"256":{"position":[[22,7]]},"268":{"position":[[22,7]]},"274":{"position":[[109,7]]},"278":{"position":[[22,7]]},"288":{"position":[[22,7]]},"298":{"position":[[22,7]]},"300":{"position":[[90,7]]},"302":{"position":[[35,7]]},"304":{"position":[[35,7]]},"306":{"position":[[38,7]]},"308":{"position":[[35,7]]},"310":{"position":[[33,7]]},"320":{"position":[[0,7]]},"330":{"position":[[22,7]]},"344":{"position":[[0,7]]},"346":{"position":[[139,7]]},"348":{"position":[[0,7]]},"354":{"position":[[252,7]]},"358":{"position":[[22,7]]},"366":{"position":[[41,8]]},"372":{"position":[[22,7]]},"384":{"position":[[22,7]]},"390":{"position":[[142,7]]},"394":{"position":[[22,7]]},"404":{"position":[[22,7]]},"414":{"position":[[22,7]]},"424":{"position":[[0,7]]},"434":{"position":[[22,7]]},"444":{"position":[[0,7]]},"446":{"position":[[68,7]]},"450":{"position":[[22,7]]},"458":{"position":[[41,8]]},"464":{"position":[[22,7]]},"470":{"position":[[22,7]]},"500":{"position":[[57,7]]},"503":{"position":[[472,7]]},"510":{"position":[[384,7]]},"526":{"position":[[251,7]]},"538":{"position":[[288,7]]},"541":{"position":[[1206,8]]},"556":{"position":[[31,7],[168,7]]},"559":{"position":[[42,7],[303,7]]},"561":{"position":[[1206,8]]},"622":{"position":[[65,8]]},"720":{"position":[[72,8]]}}}],["packr.new(\"asset",{"_index":2017,"t":{"304":{"position":[[265,17]]}}}],["page",{"_index":139,"t":{"8":{"position":[[355,5]]},"384":{"position":[[462,5],[541,8]]},"386":{"position":[[77,4]]},"492":{"position":[[313,4]]},"494":{"position":[[320,4]]},"507":{"position":[[415,4],[494,5],[917,4]]},"559":{"position":[[123,4]]},"610":{"position":[[250,6]]},"668":{"position":[[375,6]]}}}],["pair",{"_index":1566,"t":{"147":{"position":[[927,5]]}}}],["panic",{"_index":2434,"t":{"410":{"position":[[48,6]]},"414":{"position":[[296,5]]},"503":{"position":[[335,6],[372,5],[689,5]]}}}],["panic(\"i'm",{"_index":2439,"t":{"414":{"position":[[375,10]]}}}],["panic(\"thi",{"_index":2740,"t":{"503":{"position":[[677,11]]}}}],["panic(err",{"_index":571,"t":{"68":{"position":[[183,10]]},"310":{"position":[[318,10]]},"450":{"position":[[440,10],[661,10],[805,10]]}}}],["param",{"_index":428,"t":{"35":{"position":[[401,9],[470,9],[538,9]]},"37":{"position":[[601,9],[670,9],[745,9],[812,9],[878,9],[947,9],[1040,9],[1133,9]]},"39":{"position":[[386,9]]},"41":{"position":[[473,9]]},"294":{"position":[[90,7]]},"545":{"position":[[228,6],[2930,7],[2953,7],[3020,7],[3108,7],[3220,7]]},"566":{"position":[[0,6],[50,6],[71,7]]},"610":{"position":[[148,6]]},"640":{"position":[[118,5],[187,5]]},"642":{"position":[[255,5]]},"644":{"position":[[101,9],[385,5]]},"656":{"position":[[417,5]]},"658":{"position":[[417,5]]},"666":{"position":[[298,7],[364,6]]}}}],["param:://::Route Handlers | Fiber - - + +
-
Version: v2.x

Route Handlers

Registers a route bound to a specific HTTP method.

Signatures
// HTTP methods
func (app *App) Get(path string, handlers ...Handler) Router
func (app *App) Head(path string, handlers ...Handler) Router
func (app *App) Post(path string, handlers ...Handler) Router
func (app *App) Put(path string, handlers ...Handler) Router
func (app *App) Delete(path string, handlers ...Handler) Router
func (app *App) Connect(path string, handlers ...Handler) Router
func (app *App) Options(path string, handlers ...Handler) Router
func (app *App) Trace(path string, handlers ...Handler) Router
func (app *App) Patch(path string, handlers ...Handler) Router

// Add allows you to specifiy a method as value
func (app *App) Add(method, path string, handlers ...Handler) Router

// All will register the route on all HTTP methods
// Almost the same as app.Use but not bound to prefixes
func (app *App) All(path string, handlers ...Handler) Router
Examples
// Simple GET handler
app.Get("/api/list", func(c *fiber.Ctx) error {
return c.SendString("I'm a GET request!")
})

// Simple POST handler
app.Post("/api/register", func(c *fiber.Ctx) error {
return c.SendString("I'm a POST request!")
})

Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc

Signature
func (app *App) Use(args ...interface{}) Router
Examples
// Match any request
app.Use(func(c *fiber.Ctx) error {
return c.Next()
})

// Match request starting with /api
app.Use("/api", func(c *fiber.Ctx) error {
return c.Next()
})

// Match requests starting with /api or /home (multiple-prefix support)
app.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {
return c.Next()
})

// Attach multiple handlers
app.Use("/api", func(c *fiber.Ctx) error {
c.Set("X-Custom-Header", random.String(32))
return c.Next()
}, func(c *fiber.Ctx) error {
return c.Next()
})
- - +
Version: v2.x

Route Handlers

Registers a route bound to a specific HTTP method.

Signatures
// HTTP methods
func (app *App) Get(path string, handlers ...Handler) Router
func (app *App) Head(path string, handlers ...Handler) Router
func (app *App) Post(path string, handlers ...Handler) Router
func (app *App) Put(path string, handlers ...Handler) Router
func (app *App) Delete(path string, handlers ...Handler) Router
func (app *App) Connect(path string, handlers ...Handler) Router
func (app *App) Options(path string, handlers ...Handler) Router
func (app *App) Trace(path string, handlers ...Handler) Router
func (app *App) Patch(path string, handlers ...Handler) Router

// Add allows you to specifiy a method as value
func (app *App) Add(method, path string, handlers ...Handler) Router

// All will register the route on all HTTP methods
// Almost the same as app.Use but not bound to prefixes
func (app *App) All(path string, handlers ...Handler) Router
Examples
// Simple GET handler
app.Get("/api/list", func(c *fiber.Ctx) error {
return c.SendString("I'm a GET request!")
})

// Simple POST handler
app.Post("/api/register", func(c *fiber.Ctx) error {
return c.SendString("I'm a POST request!")
})

Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc

Signature
func (app *App) Use(args ...interface{}) Router
Examples
// Match any request
app.Use(func(c *fiber.Ctx) error {
return c.Next()
})

// Match request starting with /api
app.Use("/api", func(c *fiber.Ctx) error {
return c.Next()
})

// Match requests starting with /api or /home (multiple-prefix support)
app.Use([]string{"/api", "/home"}, func(c *fiber.Ctx) error {
return c.Next()
})

// Attach multiple handlers
app.Use("/api", func(c *fiber.Ctx) error {
c.Set("X-Custom-Header", random.String(32))
return c.Next()
}, func(c *fiber.Ctx) error {
return c.Next()
})
+ + \ No newline at end of file diff --git a/search-index.json b/search-index.json index dc828831970..70b142232d8 100644 --- a/search-index.json +++ b/search-index.json @@ -1 +1 @@ -[{"documents":[{"i":721,"t":"πŸ‘‹ Welcome","u":"/contrib/","b":[]},{"i":726,"t":"Casbin","u":"/contrib/casbin/","b":[]},{"i":742,"t":"Fiberi18n","u":"/contrib/fiberi18n/","b":[]},{"i":752,"t":"Fibernewrelic","u":"/contrib/fibernewrelic/","b":[]},{"i":764,"t":"Fibersentry","u":"/contrib/fibersentry/","b":[]},{"i":776,"t":"Fiberzap","u":"/contrib/fiberzap/","b":[]},{"i":786,"t":"Fiberzerolog","u":"/contrib/fiberzerolog/","b":[]},{"i":796,"t":"JWT","u":"/contrib/jwt/","b":[]},{"i":816,"t":"Opafiber","u":"/contrib/opafiber/","b":[]},{"i":828,"t":"Otelfiber","u":"/contrib/otelfiber/","b":["Otelfiber"]},{"i":840,"t":"Example","u":"/contrib/otelfiber/example/","b":["Otelfiber"]},{"i":842,"t":"Paseto","u":"/contrib/paseto/","b":[]},{"i":852,"t":"Swagger","u":"/contrib/swagger/","b":[]},{"i":864,"t":"Websocket","u":"/contrib/websocket/","b":[]},{"i":872,"t":"πŸ‘‹ Welcome","u":"/storage/","b":[]},{"i":877,"t":"ArangoDB","u":"/storage/arangodb/","b":[]},{"i":891,"t":"Azure Blob","u":"/storage/azureblob/","b":[]},{"i":905,"t":"Badger","u":"/storage/badger/","b":[]},{"i":919,"t":"Bbolt","u":"/storage/bbolt/","b":[]},{"i":933,"t":"Couchbase","u":"/storage/couchbase/","b":[]},{"i":947,"t":"DynamoDB","u":"/storage/dynamodb/","b":[]},{"i":961,"t":"Etcd","u":"/storage/etcd/","b":[]},{"i":975,"t":"Memcache","u":"/storage/memcache/","b":[]},{"i":989,"t":"Memory","u":"/storage/memory/","b":[]},{"i":1003,"t":"MongoDB","u":"/storage/mongodb/","b":[]},{"i":1017,"t":"MSSQL","u":"/storage/mssql/","b":[]},{"i":1031,"t":"MySQL","u":"/storage/mysql/","b":[]},{"i":1045,"t":"Pebble","u":"/storage/pebble/","b":[]},{"i":1059,"t":"Postgres","u":"/storage/postgres/","b":[]},{"i":1073,"t":"Redis","u":"/storage/redis/","b":[]},{"i":1087,"t":"Ristretto","u":"/storage/ristretto/","b":[]},{"i":1101,"t":"S3","u":"/storage/s3/","b":[]},{"i":1115,"t":"SQLite3","u":"/storage/sqlite3/","b":[]},{"i":1129,"t":"πŸ‘‹ Welcome","u":"/template/","b":[]},{"i":1141,"t":"Ace","u":"/template/ace/","b":[]},{"i":1145,"t":"Amber","u":"/template/amber/","b":[]},{"i":1149,"t":"Django","u":"/template/django/","b":[]},{"i":1157,"t":"Handlebars","u":"/template/handlebars/","b":[]},{"i":1161,"t":"HTML","u":"/template/html/","b":["HTML"]},{"i":1169,"t":"Golang Templates Cheatsheet","u":"/template/html/TEMPLATES_CHEATSHEET","b":["HTML"]},{"i":1191,"t":"Jet","u":"/template/jet/","b":[]},{"i":1195,"t":"Mustache","u":"/template/mustache/","b":[]},{"i":1199,"t":"Pug","u":"/template/pug/","b":[]},{"i":1203,"t":"Slim","u":"/template/slim/","b":[]},{"i":1207,"t":"πŸ‘‹ Welcome","u":"/","b":["🏠 Home"]},{"i":1221,"t":"πŸš€ App","u":"/api/app","b":["🏠 Home","API"]},{"i":1268,"t":"🌎 Client","u":"/api/client","b":["🏠 Home","API"]},{"i":1335,"t":"πŸ“‹ Constants","u":"/api/constants","b":["🏠 Home","API"]},{"i":1337,"t":"πŸ“¦ Fiber","u":"/api/fiber","b":["🏠 Home","API"]},{"i":1346,"t":"Adaptor","u":"/api/middleware/adaptor","b":["🏠 Home","API","🧬 Middleware"]},{"i":1361,"t":"BasicAuth","u":"/api/middleware/basicauth","b":["🏠 Home","API","🧬 Middleware"]},{"i":1371,"t":"Cache","u":"/api/middleware/cache","b":["🏠 Home","API","🧬 Middleware"]},{"i":1381,"t":"Compress","u":"/api/middleware/compress","b":["🏠 Home","API","🧬 Middleware"]},{"i":1393,"t":"CORS","u":"/api/middleware/cors","b":["🏠 Home","API","🧬 Middleware"]},{"i":1403,"t":"CSRF","u":"/api/middleware/csrf","b":["🏠 Home","API","🧬 Middleware"]},{"i":1417,"t":"EarlyData","u":"/api/middleware/earlydata","b":["🏠 Home","API","🧬 Middleware"]},{"i":1429,"t":"Encrypt Cookie","u":"/api/middleware/encryptcookie","b":["🏠 Home","API","🧬 Middleware"]},{"i":1441,"t":"EnvVar","u":"/api/middleware/envvar","b":["🏠 Home","API","🧬 Middleware"]},{"i":1453,"t":"ETag","u":"/api/middleware/etag","b":["🏠 Home","API","🧬 Middleware"]},{"i":1463,"t":"ExpVar","u":"/api/middleware/expvar","b":["🏠 Home","API","🧬 Middleware"]},{"i":1473,"t":"Favicon","u":"/api/middleware/favicon","b":["🏠 Home","API","🧬 Middleware"]},{"i":1483,"t":"FileSystem","u":"/api/middleware/filesystem","b":["🏠 Home","API","🧬 Middleware"]},{"i":1505,"t":"Helmet","u":"/api/middleware/helmet","b":["🏠 Home","API","🧬 Middleware"]},{"i":1515,"t":"Idempotency","u":"/api/middleware/idempotency","b":["🏠 Home","API","🧬 Middleware"]},{"i":1529,"t":"Keyauth","u":"/api/middleware/keyauth","b":["🏠 Home","API","🧬 Middleware"]},{"i":1543,"t":"Limiter","u":"/api/middleware/limiter","b":["🏠 Home","API","🧬 Middleware"]},{"i":1557,"t":"Logger","u":"/api/middleware/logger","b":["🏠 Home","API","🧬 Middleware"]},{"i":1569,"t":"Monitor","u":"/api/middleware/monitor","b":["🏠 Home","API","🧬 Middleware"]},{"i":1579,"t":"Pprof","u":"/api/middleware/pprof","b":["🏠 Home","API","🧬 Middleware"]},{"i":1589,"t":"Proxy","u":"/api/middleware/proxy","b":["🏠 Home","API","🧬 Middleware"]},{"i":1599,"t":"Recover","u":"/api/middleware/recover","b":["🏠 Home","API","🧬 Middleware"]},{"i":1609,"t":"Redirect","u":"/api/middleware/redirect","b":["🏠 Home","API","🧬 Middleware"]},{"i":1619,"t":"RequestID","u":"/api/middleware/requestid","b":["🏠 Home","API","🧬 Middleware"]},{"i":1629,"t":"Rewrite","u":"/api/middleware/rewrite","b":["🏠 Home","API","🧬 Middleware"]},{"i":1635,"t":"Session","u":"/api/middleware/session","b":["🏠 Home","API","🧬 Middleware"]},{"i":1649,"t":"Skip","u":"/api/middleware/skip","b":["🏠 Home","API","🧬 Middleware"]},{"i":1655,"t":"Timeout","u":"/api/middleware/timeout","b":["🏠 Home","API","🧬 Middleware"]},{"i":1661,"t":"πŸ“Š Benchmarks","u":"/extra/benchmarks","b":["🏠 Home","Extra"]},{"i":1676,"t":"πŸ€” FAQ","u":"/extra/faq","b":["🏠 Home","Extra"]},{"i":1691,"t":"πŸ› Error Handling","u":"/guide/error-handling","b":["🏠 Home","Guide"]},{"i":1698,"t":"⚑ Make Fiber Faster","u":"/guide/faster-fiber","b":["🏠 Home","Guide"]},{"i":1703,"t":"🎭 Grouping","u":"/guide/grouping","b":["🏠 Home","Guide"]},{"i":1709,"t":"πŸͺ Hooks","u":"/guide/hooks","b":["🏠 Home","Guide"]},{"i":1729,"t":"πŸ”Œ Routing","u":"/guide/routing","b":["🏠 Home","Guide"]},{"i":1742,"t":"πŸ“ Templates","u":"/guide/templates","b":["🏠 Home","Guide"]},{"i":1747,"t":"πŸ”Ž Validation","u":"/guide/validation","b":["🏠 Home","Guide"]},{"i":1750,"t":"Route Handlers","u":"/partials/routing/route-handlers","b":[]},{"i":1752,"t":"🧠 Ctx","u":"/api/ctx","b":["🏠 Home","API"]}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/721",[0,1.285,1,2.441]],["t/726",[2,4.503]],["t/742",[3,4.503]],["t/752",[4,4.503]],["t/764",[5,4.503]],["t/776",[6,4.503]],["t/786",[7,4.503]],["t/796",[8,4.503]],["t/816",[9,4.503]],["t/828",[10,4.503]],["t/840",[11,4.503]],["t/842",[12,4.503]],["t/852",[13,4.503]],["t/864",[14,4.503]],["t/872",[0,1.285,1,2.441]],["t/877",[15,4.503]],["t/891",[16,3.34,17,3.34]],["t/905",[18,4.503]],["t/919",[19,4.503]],["t/933",[20,4.503]],["t/947",[21,4.503]],["t/961",[22,4.503]],["t/975",[23,4.503]],["t/989",[24,4.503]],["t/1003",[25,4.503]],["t/1017",[26,4.503]],["t/1031",[27,4.503]],["t/1045",[28,4.503]],["t/1059",[29,4.503]],["t/1073",[30,4.503]],["t/1087",[31,4.503]],["t/1101",[32,4.503]],["t/1115",[33,4.503]],["t/1129",[0,1.285,1,2.441]],["t/1141",[34,4.503]],["t/1145",[35,4.503]],["t/1149",[36,4.503]],["t/1157",[37,4.503]],["t/1161",[38,4.503]],["t/1169",[39,2.654,40,2.322,41,2.654]],["t/1191",[42,4.503]],["t/1195",[43,4.503]],["t/1199",[44,4.503]],["t/1203",[45,4.503]],["t/1207",[0,1.285,1,2.441]],["t/1221",[0,1.285,46,3.34]],["t/1268",[0,1.285,47,3.34]],["t/1335",[0,1.285,48,3.34]],["t/1337",[0,1.285,49,2.922]],["t/1346",[50,4.503]],["t/1361",[51,4.503]],["t/1371",[52,4.503]],["t/1381",[53,4.503]],["t/1393",[54,4.503]],["t/1403",[55,4.503]],["t/1417",[56,4.503]],["t/1429",[57,3.34,58,3.34]],["t/1441",[59,4.503]],["t/1453",[60,4.503]],["t/1463",[61,4.503]],["t/1473",[62,4.503]],["t/1483",[63,4.503]],["t/1505",[64,4.503]],["t/1515",[65,4.503]],["t/1529",[66,4.503]],["t/1543",[67,4.503]],["t/1557",[68,4.503]],["t/1569",[69,4.503]],["t/1579",[70,4.503]],["t/1589",[71,4.503]],["t/1599",[72,4.503]],["t/1609",[73,4.503]],["t/1619",[74,4.503]],["t/1629",[75,4.503]],["t/1635",[76,4.503]],["t/1649",[77,4.503]],["t/1655",[78,4.503]],["t/1661",[0,1.285,79,3.34]],["t/1676",[0,1.285,80,3.34]],["t/1691",[0,1.021,81,2.654,82,2.654]],["t/1698",[0,0.847,49,1.927,83,2.202,84,2.202]],["t/1703",[0,1.285,85,3.34]],["t/1709",[0,1.285,86,3.34]],["t/1729",[0,1.285,87,2.922]],["t/1742",[0,1.285,40,2.922]],["t/1747",[0,1.285,88,3.34]],["t/1750",[87,2.922,89,3.34]],["t/1752",[0,1.285,90,3.34]]],"invertedIndex":[["",{"_index":0,"t":{"721":{"position":[[0,2]]},"872":{"position":[[0,2]]},"1129":{"position":[[0,2]]},"1207":{"position":[[0,2]]},"1221":{"position":[[0,2]]},"1268":{"position":[[0,2]]},"1335":{"position":[[0,2]]},"1337":{"position":[[0,2]]},"1661":{"position":[[0,2]]},"1676":{"position":[[0,2]]},"1691":{"position":[[0,2]]},"1698":{"position":[[0,1]]},"1703":{"position":[[0,2]]},"1709":{"position":[[0,2]]},"1729":{"position":[[0,2]]},"1742":{"position":[[0,2]]},"1747":{"position":[[0,2]]},"1752":{"position":[[0,2]]}}}],["ac",{"_index":34,"t":{"1141":{"position":[[0,3]]}}}],["adaptor",{"_index":50,"t":{"1346":{"position":[[0,7]]}}}],["amber",{"_index":35,"t":{"1145":{"position":[[0,5]]}}}],["app",{"_index":46,"t":{"1221":{"position":[[3,3]]}}}],["arangodb",{"_index":15,"t":{"877":{"position":[[0,8]]}}}],["azur",{"_index":16,"t":{"891":{"position":[[0,5]]}}}],["badger",{"_index":18,"t":{"905":{"position":[[0,6]]}}}],["basicauth",{"_index":51,"t":{"1361":{"position":[[0,9]]}}}],["bbolt",{"_index":19,"t":{"919":{"position":[[0,5]]}}}],["benchmark",{"_index":79,"t":{"1661":{"position":[[3,10]]}}}],["blob",{"_index":17,"t":{"891":{"position":[[6,4]]}}}],["cach",{"_index":52,"t":{"1371":{"position":[[0,5]]}}}],["casbin",{"_index":2,"t":{"726":{"position":[[0,6]]}}}],["cheatsheet",{"_index":41,"t":{"1169":{"position":[[17,10]]}}}],["client",{"_index":47,"t":{"1268":{"position":[[3,6]]}}}],["compress",{"_index":53,"t":{"1381":{"position":[[0,8]]}}}],["constant",{"_index":48,"t":{"1335":{"position":[[3,9]]}}}],["cooki",{"_index":58,"t":{"1429":{"position":[[8,6]]}}}],["cor",{"_index":54,"t":{"1393":{"position":[[0,4]]}}}],["couchbas",{"_index":20,"t":{"933":{"position":[[0,9]]}}}],["csrf",{"_index":55,"t":{"1403":{"position":[[0,4]]}}}],["ctx",{"_index":90,"t":{"1752":{"position":[[3,3]]}}}],["django",{"_index":36,"t":{"1149":{"position":[[0,6]]}}}],["dynamodb",{"_index":21,"t":{"947":{"position":[[0,8]]}}}],["earlydata",{"_index":56,"t":{"1417":{"position":[[0,9]]}}}],["encrypt",{"_index":57,"t":{"1429":{"position":[[0,7]]}}}],["envvar",{"_index":59,"t":{"1441":{"position":[[0,6]]}}}],["error",{"_index":81,"t":{"1691":{"position":[[3,5]]}}}],["etag",{"_index":60,"t":{"1453":{"position":[[0,4]]}}}],["etcd",{"_index":22,"t":{"961":{"position":[[0,4]]}}}],["exampl",{"_index":11,"t":{"840":{"position":[[0,7]]}}}],["expvar",{"_index":61,"t":{"1463":{"position":[[0,6]]}}}],["faq",{"_index":80,"t":{"1676":{"position":[[3,3]]}}}],["faster",{"_index":84,"t":{"1698":{"position":[[13,6]]}}}],["favicon",{"_index":62,"t":{"1473":{"position":[[0,7]]}}}],["fiber",{"_index":49,"t":{"1337":{"position":[[3,5]]},"1698":{"position":[[7,5]]}}}],["fiberi18n",{"_index":3,"t":{"742":{"position":[[0,9]]}}}],["fibernewrel",{"_index":4,"t":{"752":{"position":[[0,13]]}}}],["fibersentri",{"_index":5,"t":{"764":{"position":[[0,11]]}}}],["fiberzap",{"_index":6,"t":{"776":{"position":[[0,8]]}}}],["fiberzerolog",{"_index":7,"t":{"786":{"position":[[0,12]]}}}],["filesystem",{"_index":63,"t":{"1483":{"position":[[0,10]]}}}],["golang",{"_index":39,"t":{"1169":{"position":[[0,6]]}}}],["group",{"_index":85,"t":{"1703":{"position":[[3,8]]}}}],["handl",{"_index":82,"t":{"1691":{"position":[[9,8]]}}}],["handlebar",{"_index":37,"t":{"1157":{"position":[[0,10]]}}}],["handler",{"_index":89,"t":{"1750":{"position":[[6,8]]}}}],["helmet",{"_index":64,"t":{"1505":{"position":[[0,6]]}}}],["hook",{"_index":86,"t":{"1709":{"position":[[3,5]]}}}],["html",{"_index":38,"t":{"1161":{"position":[[0,4]]}}}],["idempot",{"_index":65,"t":{"1515":{"position":[[0,11]]}}}],["jet",{"_index":42,"t":{"1191":{"position":[[0,3]]}}}],["jwt",{"_index":8,"t":{"796":{"position":[[0,3]]}}}],["keyauth",{"_index":66,"t":{"1529":{"position":[[0,7]]}}}],["limit",{"_index":67,"t":{"1543":{"position":[[0,7]]}}}],["logger",{"_index":68,"t":{"1557":{"position":[[0,6]]}}}],["make",{"_index":83,"t":{"1698":{"position":[[2,4]]}}}],["memcach",{"_index":23,"t":{"975":{"position":[[0,8]]}}}],["memori",{"_index":24,"t":{"989":{"position":[[0,6]]}}}],["mongodb",{"_index":25,"t":{"1003":{"position":[[0,7]]}}}],["monitor",{"_index":69,"t":{"1569":{"position":[[0,7]]}}}],["mssql",{"_index":26,"t":{"1017":{"position":[[0,5]]}}}],["mustach",{"_index":43,"t":{"1195":{"position":[[0,8]]}}}],["mysql",{"_index":27,"t":{"1031":{"position":[[0,5]]}}}],["opafib",{"_index":9,"t":{"816":{"position":[[0,8]]}}}],["otelfib",{"_index":10,"t":{"828":{"position":[[0,9]]}}}],["paseto",{"_index":12,"t":{"842":{"position":[[0,6]]}}}],["pebbl",{"_index":28,"t":{"1045":{"position":[[0,6]]}}}],["postgr",{"_index":29,"t":{"1059":{"position":[[0,8]]}}}],["pprof",{"_index":70,"t":{"1579":{"position":[[0,5]]}}}],["proxi",{"_index":71,"t":{"1589":{"position":[[0,5]]}}}],["pug",{"_index":44,"t":{"1199":{"position":[[0,3]]}}}],["recov",{"_index":72,"t":{"1599":{"position":[[0,7]]}}}],["redi",{"_index":30,"t":{"1073":{"position":[[0,5]]}}}],["redirect",{"_index":73,"t":{"1609":{"position":[[0,8]]}}}],["requestid",{"_index":74,"t":{"1619":{"position":[[0,9]]}}}],["rewrit",{"_index":75,"t":{"1629":{"position":[[0,7]]}}}],["ristretto",{"_index":31,"t":{"1087":{"position":[[0,9]]}}}],["rout",{"_index":87,"t":{"1729":{"position":[[3,7]]},"1750":{"position":[[0,5]]}}}],["s3",{"_index":32,"t":{"1101":{"position":[[0,2]]}}}],["session",{"_index":76,"t":{"1635":{"position":[[0,7]]}}}],["skip",{"_index":77,"t":{"1649":{"position":[[0,4]]}}}],["slim",{"_index":45,"t":{"1203":{"position":[[0,4]]}}}],["sqlite3",{"_index":33,"t":{"1115":{"position":[[0,7]]}}}],["swagger",{"_index":13,"t":{"852":{"position":[[0,7]]}}}],["templat",{"_index":40,"t":{"1169":{"position":[[7,9]]},"1742":{"position":[[3,9]]}}}],["timeout",{"_index":78,"t":{"1655":{"position":[[0,7]]}}}],["valid",{"_index":88,"t":{"1747":{"position":[[3,10]]}}}],["websocket",{"_index":14,"t":{"864":{"position":[[0,9]]}}}],["welcom",{"_index":1,"t":{"721":{"position":[[3,7]]},"872":{"position":[[3,7]]},"1129":{"position":[[3,7]]},"1207":{"position":[[3,7]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":722,"t":"Contrib","u":"/contrib/","h":"","p":721},{"i":724,"t":"πŸ“‘ Middleware Implementations","u":"/contrib/","h":"#-middleware-implementations","p":721},{"i":728,"t":"Install","u":"/contrib/casbin/","h":"#install","p":726},{"i":730,"t":"Signature","u":"/contrib/casbin/","h":"#signature","p":726},{"i":732,"t":"Config","u":"/contrib/casbin/","h":"#config","p":726},{"i":734,"t":"Examples","u":"/contrib/casbin/","h":"#examples","p":726},{"i":736,"t":"CustomPermission","u":"/contrib/casbin/","h":"#custompermission","p":726},{"i":738,"t":"RoutePermission","u":"/contrib/casbin/","h":"#routepermission","p":726},{"i":740,"t":"RoleAuthorization","u":"/contrib/casbin/","h":"#roleauthorization","p":726},{"i":744,"t":"Install","u":"/contrib/fiberi18n/","h":"#install","p":742},{"i":746,"t":"Signature","u":"/contrib/fiberi18n/","h":"#signature","p":742},{"i":748,"t":"Config","u":"/contrib/fiberi18n/","h":"#config","p":742},{"i":750,"t":"Example","u":"/contrib/fiberi18n/","h":"#example","p":742},{"i":754,"t":"Install","u":"/contrib/fibernewrelic/","h":"#install","p":752},{"i":756,"t":"Signature","u":"/contrib/fibernewrelic/","h":"#signature","p":752},{"i":758,"t":"Config","u":"/contrib/fibernewrelic/","h":"#config","p":752},{"i":760,"t":"Usage","u":"/contrib/fibernewrelic/","h":"#usage","p":752},{"i":762,"t":"Usage with existing New Relic application","u":"/contrib/fibernewrelic/","h":"#usage-with-existing-new-relic-application","p":752},{"i":766,"t":"Install","u":"/contrib/fibersentry/","h":"#install","p":764},{"i":768,"t":"Signature","u":"/contrib/fibersentry/","h":"#signature","p":764},{"i":770,"t":"Config","u":"/contrib/fibersentry/","h":"#config","p":764},{"i":772,"t":"Usage","u":"/contrib/fibersentry/","h":"#usage","p":764},{"i":774,"t":"Accessing Context in BeforeSend callback","u":"/contrib/fibersentry/","h":"#accessing-context-in-beforesend-callback","p":764},{"i":778,"t":"Install","u":"/contrib/fiberzap/","h":"#install","p":776},{"i":780,"t":"Signature","u":"/contrib/fiberzap/","h":"#signature","p":776},{"i":782,"t":"Config","u":"/contrib/fiberzap/","h":"#config","p":776},{"i":784,"t":"Example","u":"/contrib/fiberzap/","h":"#example","p":776},{"i":788,"t":"Install","u":"/contrib/fiberzerolog/","h":"#install","p":786},{"i":790,"t":"Signature","u":"/contrib/fiberzerolog/","h":"#signature","p":786},{"i":792,"t":"Config","u":"/contrib/fiberzerolog/","h":"#config","p":786},{"i":794,"t":"Example","u":"/contrib/fiberzerolog/","h":"#example","p":786},{"i":798,"t":"Install","u":"/contrib/jwt/","h":"#install","p":796},{"i":800,"t":"Signature","u":"/contrib/jwt/","h":"#signature","p":796},{"i":802,"t":"Config","u":"/contrib/jwt/","h":"#config","p":796},{"i":804,"t":"HS256 Example","u":"/contrib/jwt/","h":"#hs256-example","p":796},{"i":806,"t":"HS256 Test","u":"/contrib/jwt/","h":"#hs256-test","p":796},{"i":808,"t":"RS256 Example","u":"/contrib/jwt/","h":"#rs256-example","p":796},{"i":810,"t":"RS256 Test","u":"/contrib/jwt/","h":"#rs256-test","p":796},{"i":812,"t":"JWK Set Test","u":"/contrib/jwt/","h":"#jwk-set-test","p":796},{"i":814,"t":"Custom KeyFunc example","u":"/contrib/jwt/","h":"#custom-keyfunc-example","p":796},{"i":818,"t":"Install","u":"/contrib/opafiber/","h":"#install","p":816},{"i":820,"t":"Signature","u":"/contrib/opafiber/","h":"#signature","p":816},{"i":822,"t":"Config","u":"/contrib/opafiber/","h":"#config","p":816},{"i":824,"t":"Types","u":"/contrib/opafiber/","h":"#types","p":816},{"i":826,"t":"Usage","u":"/contrib/opafiber/","h":"#usage","p":816},{"i":830,"t":"Install","u":"/contrib/otelfiber/","h":"#install","p":828},{"i":832,"t":"Signature","u":"/contrib/otelfiber/","h":"#signature","p":828},{"i":834,"t":"Config","u":"/contrib/otelfiber/","h":"#config","p":828},{"i":836,"t":"Usage","u":"/contrib/otelfiber/","h":"#usage","p":828},{"i":838,"t":"Example","u":"/contrib/otelfiber/","h":"#example","p":828},{"i":844,"t":"Install","u":"/contrib/paseto/","h":"#install","p":842},{"i":846,"t":"Signature","u":"/contrib/paseto/","h":"#signature","p":842},{"i":848,"t":"Config","u":"/contrib/paseto/","h":"#config","p":842},{"i":850,"t":"Instructions","u":"/contrib/paseto/","h":"#instructions","p":842},{"i":854,"t":"Table of Contents","u":"/contrib/swagger/","h":"#table-of-contents","p":852},{"i":856,"t":"Signatures","u":"/contrib/swagger/","h":"#signatures","p":852},{"i":858,"t":"Examples","u":"/contrib/swagger/","h":"#examples","p":852},{"i":860,"t":"Default Config","u":"/contrib/swagger/","h":"#default-config","p":852},{"i":862,"t":"Custom Config","u":"/contrib/swagger/","h":"#custom-config","p":852},{"i":866,"t":"Install","u":"/contrib/websocket/","h":"#install","p":864},{"i":868,"t":"Example","u":"/contrib/websocket/","h":"#example","p":864},{"i":870,"t":"Note with cache middleware","u":"/contrib/websocket/","h":"#note-with-cache-middleware","p":864},{"i":873,"t":"πŸ“¦ Storage","u":"/storage/","h":"","p":872},{"i":875,"t":"πŸ“‘ Storage Implementations","u":"/storage/","h":"#-storage-implementations","p":872},{"i":879,"t":"Table of Contents","u":"/storage/arangodb/","h":"#table-of-contents","p":877},{"i":881,"t":"Signatures","u":"/storage/arangodb/","h":"#signatures","p":877},{"i":883,"t":"Installation","u":"/storage/arangodb/","h":"#installation","p":877},{"i":885,"t":"Examples","u":"/storage/arangodb/","h":"#examples","p":877},{"i":887,"t":"Config","u":"/storage/arangodb/","h":"#config","p":877},{"i":889,"t":"Default Config","u":"/storage/arangodb/","h":"#default-config","p":877},{"i":893,"t":"Table of Contents","u":"/storage/azureblob/","h":"#table-of-contents","p":891},{"i":895,"t":"Signatures","u":"/storage/azureblob/","h":"#signatures","p":891},{"i":897,"t":"Installation","u":"/storage/azureblob/","h":"#installation","p":891},{"i":899,"t":"Examples","u":"/storage/azureblob/","h":"#examples","p":891},{"i":901,"t":"Config","u":"/storage/azureblob/","h":"#config","p":891},{"i":903,"t":"Default Config","u":"/storage/azureblob/","h":"#default-config","p":891},{"i":907,"t":"Table of Contents","u":"/storage/badger/","h":"#table-of-contents","p":905},{"i":909,"t":"Signatures","u":"/storage/badger/","h":"#signatures","p":905},{"i":911,"t":"Installation","u":"/storage/badger/","h":"#installation","p":905},{"i":913,"t":"Examples","u":"/storage/badger/","h":"#examples","p":905},{"i":915,"t":"Config","u":"/storage/badger/","h":"#config","p":905},{"i":917,"t":"Default Config","u":"/storage/badger/","h":"#default-config","p":905},{"i":921,"t":"Table of Contents","u":"/storage/bbolt/","h":"#table-of-contents","p":919},{"i":923,"t":"Signatures","u":"/storage/bbolt/","h":"#signatures","p":919},{"i":925,"t":"Installation","u":"/storage/bbolt/","h":"#installation","p":919},{"i":927,"t":"Examples","u":"/storage/bbolt/","h":"#examples","p":919},{"i":929,"t":"Config","u":"/storage/bbolt/","h":"#config","p":919},{"i":931,"t":"Default Config","u":"/storage/bbolt/","h":"#default-config","p":919},{"i":935,"t":"Table of Contents","u":"/storage/couchbase/","h":"#table-of-contents","p":933},{"i":937,"t":"Signatures","u":"/storage/couchbase/","h":"#signatures","p":933},{"i":939,"t":"Installation","u":"/storage/couchbase/","h":"#installation","p":933},{"i":941,"t":"Examples","u":"/storage/couchbase/","h":"#examples","p":933},{"i":943,"t":"Config","u":"/storage/couchbase/","h":"#config","p":933},{"i":945,"t":"Default Config","u":"/storage/couchbase/","h":"#default-config","p":933},{"i":949,"t":"Table of Contents","u":"/storage/dynamodb/","h":"#table-of-contents","p":947},{"i":951,"t":"Signatures","u":"/storage/dynamodb/","h":"#signatures","p":947},{"i":953,"t":"Installation","u":"/storage/dynamodb/","h":"#installation","p":947},{"i":955,"t":"Examples","u":"/storage/dynamodb/","h":"#examples","p":947},{"i":957,"t":"Config","u":"/storage/dynamodb/","h":"#config","p":947},{"i":959,"t":"Default Config","u":"/storage/dynamodb/","h":"#default-config","p":947},{"i":963,"t":"Table of Contents","u":"/storage/etcd/","h":"#table-of-contents","p":961},{"i":965,"t":"Signatures","u":"/storage/etcd/","h":"#signatures","p":961},{"i":967,"t":"Installation","u":"/storage/etcd/","h":"#installation","p":961},{"i":969,"t":"Examples","u":"/storage/etcd/","h":"#examples","p":961},{"i":971,"t":"Config","u":"/storage/etcd/","h":"#config","p":961},{"i":973,"t":"Default Config","u":"/storage/etcd/","h":"#default-config","p":961},{"i":977,"t":"Table of Contents","u":"/storage/memcache/","h":"#table-of-contents","p":975},{"i":979,"t":"Signatures","u":"/storage/memcache/","h":"#signatures","p":975},{"i":981,"t":"Installation","u":"/storage/memcache/","h":"#installation","p":975},{"i":983,"t":"Examples","u":"/storage/memcache/","h":"#examples","p":975},{"i":985,"t":"Config","u":"/storage/memcache/","h":"#config","p":975},{"i":987,"t":"Default Config","u":"/storage/memcache/","h":"#default-config","p":975},{"i":991,"t":"Table of Contents","u":"/storage/memory/","h":"#table-of-contents","p":989},{"i":993,"t":"Signatures","u":"/storage/memory/","h":"#signatures","p":989},{"i":995,"t":"Installation","u":"/storage/memory/","h":"#installation","p":989},{"i":997,"t":"Examples","u":"/storage/memory/","h":"#examples","p":989},{"i":999,"t":"Config","u":"/storage/memory/","h":"#config","p":989},{"i":1001,"t":"Default Config","u":"/storage/memory/","h":"#default-config","p":989},{"i":1005,"t":"Table of Contents","u":"/storage/mongodb/","h":"#table-of-contents","p":1003},{"i":1007,"t":"Signatures","u":"/storage/mongodb/","h":"#signatures","p":1003},{"i":1009,"t":"Installation","u":"/storage/mongodb/","h":"#installation","p":1003},{"i":1011,"t":"Examples","u":"/storage/mongodb/","h":"#examples","p":1003},{"i":1013,"t":"Config","u":"/storage/mongodb/","h":"#config","p":1003},{"i":1015,"t":"Default Config","u":"/storage/mongodb/","h":"#default-config","p":1003},{"i":1019,"t":"Table of Contents","u":"/storage/mssql/","h":"#table-of-contents","p":1017},{"i":1021,"t":"Signatures","u":"/storage/mssql/","h":"#signatures","p":1017},{"i":1023,"t":"Installation","u":"/storage/mssql/","h":"#installation","p":1017},{"i":1025,"t":"Examples","u":"/storage/mssql/","h":"#examples","p":1017},{"i":1027,"t":"Config","u":"/storage/mssql/","h":"#config","p":1017},{"i":1029,"t":"Default Config","u":"/storage/mssql/","h":"#default-config","p":1017},{"i":1033,"t":"Table of Contents","u":"/storage/mysql/","h":"#table-of-contents","p":1031},{"i":1035,"t":"Signatures","u":"/storage/mysql/","h":"#signatures","p":1031},{"i":1037,"t":"Installation","u":"/storage/mysql/","h":"#installation","p":1031},{"i":1039,"t":"Examples","u":"/storage/mysql/","h":"#examples","p":1031},{"i":1041,"t":"Config","u":"/storage/mysql/","h":"#config","p":1031},{"i":1043,"t":"Default Config","u":"/storage/mysql/","h":"#default-config","p":1031},{"i":1047,"t":"Table of Contents","u":"/storage/pebble/","h":"#table-of-contents","p":1045},{"i":1049,"t":"Signatures","u":"/storage/pebble/","h":"#signatures","p":1045},{"i":1051,"t":"Installation","u":"/storage/pebble/","h":"#installation","p":1045},{"i":1053,"t":"Examples","u":"/storage/pebble/","h":"#examples","p":1045},{"i":1055,"t":"Config","u":"/storage/pebble/","h":"#config","p":1045},{"i":1057,"t":"Default Config","u":"/storage/pebble/","h":"#default-config","p":1045},{"i":1061,"t":"Table of Contents","u":"/storage/postgres/","h":"#table-of-contents","p":1059},{"i":1063,"t":"Signatures","u":"/storage/postgres/","h":"#signatures","p":1059},{"i":1065,"t":"Installation","u":"/storage/postgres/","h":"#installation","p":1059},{"i":1067,"t":"Examples","u":"/storage/postgres/","h":"#examples","p":1059},{"i":1069,"t":"Config","u":"/storage/postgres/","h":"#config","p":1059},{"i":1071,"t":"Default Config","u":"/storage/postgres/","h":"#default-config","p":1059},{"i":1075,"t":"Table of Contents","u":"/storage/redis/","h":"#table-of-contents","p":1073},{"i":1077,"t":"Signatures","u":"/storage/redis/","h":"#signatures","p":1073},{"i":1079,"t":"Installation","u":"/storage/redis/","h":"#installation","p":1073},{"i":1081,"t":"Examples","u":"/storage/redis/","h":"#examples","p":1073},{"i":1083,"t":"Config","u":"/storage/redis/","h":"#config","p":1073},{"i":1085,"t":"Default Config","u":"/storage/redis/","h":"#default-config","p":1073},{"i":1089,"t":"Table of Contents","u":"/storage/ristretto/","h":"#table-of-contents","p":1087},{"i":1091,"t":"Signatures","u":"/storage/ristretto/","h":"#signatures","p":1087},{"i":1093,"t":"Installation","u":"/storage/ristretto/","h":"#installation","p":1087},{"i":1095,"t":"Examples","u":"/storage/ristretto/","h":"#examples","p":1087},{"i":1097,"t":"Config","u":"/storage/ristretto/","h":"#config","p":1087},{"i":1099,"t":"Default Config","u":"/storage/ristretto/","h":"#default-config","p":1087},{"i":1103,"t":"Table of Contents","u":"/storage/s3/","h":"#table-of-contents","p":1101},{"i":1105,"t":"Signatures","u":"/storage/s3/","h":"#signatures","p":1101},{"i":1107,"t":"Installation","u":"/storage/s3/","h":"#installation","p":1101},{"i":1109,"t":"Examples","u":"/storage/s3/","h":"#examples","p":1101},{"i":1111,"t":"Config","u":"/storage/s3/","h":"#config","p":1101},{"i":1113,"t":"Default Config","u":"/storage/s3/","h":"#default-config","p":1101},{"i":1117,"t":"Table of Contents","u":"/storage/sqlite3/","h":"#table-of-contents","p":1115},{"i":1119,"t":"Signatures","u":"/storage/sqlite3/","h":"#signatures","p":1115},{"i":1121,"t":"Installation","u":"/storage/sqlite3/","h":"#installation","p":1115},{"i":1123,"t":"Examples","u":"/storage/sqlite3/","h":"#examples","p":1115},{"i":1125,"t":"Config","u":"/storage/sqlite3/","h":"#config","p":1115},{"i":1127,"t":"Default Config","u":"/storage/sqlite3/","h":"#default-config","p":1115},{"i":1131,"t":"Installation","u":"/template/","h":"#installation","p":1129},{"i":1133,"t":"Example","u":"/template/","h":"#example","p":1129},{"i":1135,"t":"More Examples","u":"/template/","h":"#more-examples","p":1129},{"i":1137,"t":"embedded Systems","u":"/template/","h":"#embedded-systems","p":1129},{"i":1139,"t":"Benchmarks","u":"/template/","h":"#benchmarks","p":1129},{"i":1143,"t":"Basic Example","u":"/template/ace/","h":"#basic-example","p":1141},{"i":1147,"t":"Basic Example","u":"/template/amber/","h":"#basic-example","p":1145},{"i":1151,"t":"Basic Example","u":"/template/django/","h":"#basic-example","p":1149},{"i":1153,"t":"Using embedded file system (1.16+ only)","u":"/template/django/","h":"#using-embedded-file-system-116-only","p":1149},{"i":1155,"t":"Register and use custom functions","u":"/template/django/","h":"#register-and-use-custom-functions","p":1149},{"i":1159,"t":"Basic Example","u":"/template/handlebars/","h":"#basic-example","p":1157},{"i":1163,"t":"Basic Example","u":"/template/html/","h":"#basic-example","p":1161},{"i":1165,"t":"Example with embed.FS","u":"/template/html/","h":"#example-with-embedfs","p":1161},{"i":1167,"t":"Example with innerHTML","u":"/template/html/","h":"#example-with-innerhtml","p":1161},{"i":1171,"t":"Table of Contents","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#table-of-contents","p":1169},{"i":1173,"t":"Parsing and Creating Templates","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#parsing-and-creating-templates","p":1169},{"i":1175,"t":"Executing Templates","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#executing-templates","p":1169},{"i":1177,"t":"Template Encoding and HTML","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-encoding-and-html","p":1169},{"i":1179,"t":"Template Variables","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-variables","p":1169},{"i":1181,"t":"Template Actions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-actions","p":1169},{"i":1183,"t":"Template Functions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-functions","p":1169},{"i":1185,"t":"Template Comparison Functions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-comparison-functions","p":1169},{"i":1187,"t":"Nested Templates and Layouts","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#nested-templates-and-layouts","p":1169},{"i":1189,"t":"Templates Calling Functions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#templates-calling-functions","p":1169},{"i":1193,"t":"Basic Example","u":"/template/jet/","h":"#basic-example","p":1191},{"i":1197,"t":"Basic Example","u":"/template/mustache/","h":"#basic-example","p":1195},{"i":1201,"t":"Basic Example","u":"/template/pug/","h":"#basic-example","p":1199},{"i":1205,"t":"Basic Example","u":"/template/slim/","h":"#basic-example","p":1203},{"i":1209,"t":"Installation","u":"/","h":"#installation","p":1207},{"i":1211,"t":"Zero Allocation","u":"/","h":"#zero-allocation","p":1207},{"i":1213,"t":"Hello, World!","u":"/","h":"#hello-world","p":1207},{"i":1215,"t":"Basic routing","u":"/","h":"#basic-routing","p":1207},{"i":1217,"t":"Static files","u":"/","h":"#static-files","p":1207},{"i":1219,"t":"Note","u":"/","h":"#note","p":1207},{"i":1222,"t":"Static","u":"/api/app","h":"#static","p":1221},{"i":1224,"t":"Route Handlers","u":"/api/app","h":"#route-handlers","p":1221},{"i":1226,"t":"Mount","u":"/api/app","h":"#mount","p":1221},{"i":1228,"t":"MountPath","u":"/api/app","h":"#mountpath","p":1221},{"i":1230,"t":"Group","u":"/api/app","h":"#group","p":1221},{"i":1232,"t":"Route","u":"/api/app","h":"#route","p":1221},{"i":1234,"t":"Server","u":"/api/app","h":"#server","p":1221},{"i":1236,"t":"Server Shutdown","u":"/api/app","h":"#server-shutdown","p":1221},{"i":1238,"t":"HandlersCount","u":"/api/app","h":"#handlerscount","p":1221},{"i":1240,"t":"Stack","u":"/api/app","h":"#stack","p":1221},{"i":1242,"t":"Name","u":"/api/app","h":"#name","p":1221},{"i":1244,"t":"GetRoute","u":"/api/app","h":"#getroute","p":1221},{"i":1246,"t":"GetRoutes","u":"/api/app","h":"#getroutes","p":1221},{"i":1248,"t":"Config","u":"/api/app","h":"#config","p":1221},{"i":1250,"t":"Handler","u":"/api/app","h":"#handler","p":1221},{"i":1252,"t":"Listen","u":"/api/app","h":"#listen","p":1221},{"i":1254,"t":"ListenTLS","u":"/api/app","h":"#listentls","p":1221},{"i":1256,"t":"ListenTLSWithCertificate","u":"/api/app","h":"#listentlswithcertificate","p":1221},{"i":1258,"t":"ListenMutualTLS","u":"/api/app","h":"#listenmutualtls","p":1221},{"i":1260,"t":"ListenMutualTLSWithCertificate","u":"/api/app","h":"#listenmutualtlswithcertificate","p":1221},{"i":1262,"t":"Listener","u":"/api/app","h":"#listener","p":1221},{"i":1264,"t":"Test","u":"/api/app","h":"#test","p":1221},{"i":1266,"t":"Hooks","u":"/api/app","h":"#hooks","p":1221},{"i":1269,"t":"Start request","u":"/api/client","h":"#start-request","p":1268},{"i":1271,"t":"✨ Agent","u":"/api/client","h":"#-agent","p":1268},{"i":1273,"t":"Parse","u":"/api/client","h":"#parse","p":1268},{"i":1275,"t":"Set","u":"/api/client","h":"#set","p":1268},{"i":1277,"t":"Add","u":"/api/client","h":"#add","p":1268},{"i":1279,"t":"ConnectionClose","u":"/api/client","h":"#connectionclose","p":1268},{"i":1281,"t":"UserAgent","u":"/api/client","h":"#useragent","p":1268},{"i":1283,"t":"Cookie","u":"/api/client","h":"#cookie","p":1268},{"i":1285,"t":"Referer","u":"/api/client","h":"#referer","p":1268},{"i":1287,"t":"ContentType","u":"/api/client","h":"#contenttype","p":1268},{"i":1289,"t":"Host","u":"/api/client","h":"#host","p":1268},{"i":1291,"t":"QueryString","u":"/api/client","h":"#querystring","p":1268},{"i":1293,"t":"BasicAuth","u":"/api/client","h":"#basicauth","p":1268},{"i":1295,"t":"Body","u":"/api/client","h":"#body","p":1268},{"i":1297,"t":"JSON","u":"/api/client","h":"#json","p":1268},{"i":1299,"t":"XML","u":"/api/client","h":"#xml","p":1268},{"i":1301,"t":"Form","u":"/api/client","h":"#form","p":1268},{"i":1303,"t":"MultipartForm","u":"/api/client","h":"#multipartform","p":1268},{"i":1305,"t":"Debug","u":"/api/client","h":"#debug","p":1268},{"i":1307,"t":"Timeout","u":"/api/client","h":"#timeout","p":1268},{"i":1309,"t":"Reuse","u":"/api/client","h":"#reuse","p":1268},{"i":1311,"t":"InsecureSkipVerify","u":"/api/client","h":"#insecureskipverify","p":1268},{"i":1313,"t":"TLSConfig","u":"/api/client","h":"#tlsconfig","p":1268},{"i":1315,"t":"MaxRedirectsCount","u":"/api/client","h":"#maxredirectscount","p":1268},{"i":1317,"t":"JSONEncoder","u":"/api/client","h":"#jsonencoder","p":1268},{"i":1319,"t":"JSONDecoder","u":"/api/client","h":"#jsondecoder","p":1268},{"i":1321,"t":"Request","u":"/api/client","h":"#request","p":1268},{"i":1323,"t":"SetResponse","u":"/api/client","h":"#setresponse","p":1268},{"i":1325,"t":"Dest","u":"/api/client","h":"#dest","p":1268},{"i":1327,"t":"Bytes","u":"/api/client","h":"#bytes","p":1268},{"i":1329,"t":"String","u":"/api/client","h":"#string","p":1268},{"i":1331,"t":"Struct","u":"/api/client","h":"#struct","p":1268},{"i":1333,"t":"RetryIf","u":"/api/client","h":"#retryif","p":1268},{"i":1338,"t":"New","u":"/api/fiber","h":"#new","p":1337},{"i":1340,"t":"Config","u":"/api/fiber","h":"#config","p":1337},{"i":1342,"t":"NewError","u":"/api/fiber","h":"#newerror","p":1337},{"i":1344,"t":"IsChild","u":"/api/fiber","h":"#ischild","p":1337},{"i":1348,"t":"Signatures","u":"/api/middleware/adaptor","h":"#signatures","p":1346},{"i":1350,"t":"Examples","u":"/api/middleware/adaptor","h":"#examples","p":1346},{"i":1351,"t":"net/http to Fiber","u":"/api/middleware/adaptor","h":"#nethttp-to-fiber","p":1346},{"i":1353,"t":"net/http middleware to Fiber","u":"/api/middleware/adaptor","h":"#nethttp-middleware-to-fiber","p":1346},{"i":1355,"t":"Fiber Handler to net/http","u":"/api/middleware/adaptor","h":"#fiber-handler-to-nethttp","p":1346},{"i":1357,"t":"Fiber App to net/http","u":"/api/middleware/adaptor","h":"#fiber-app-to-nethttp","p":1346},{"i":1359,"t":"Fiber Context to (net/http).Request","u":"/api/middleware/adaptor","h":"#fiber-context-to-nethttprequest","p":1346},{"i":1363,"t":"Signatures","u":"/api/middleware/basicauth","h":"#signatures","p":1361},{"i":1365,"t":"Examples","u":"/api/middleware/basicauth","h":"#examples","p":1361},{"i":1367,"t":"Config","u":"/api/middleware/basicauth","h":"#config","p":1361},{"i":1369,"t":"Default Config","u":"/api/middleware/basicauth","h":"#default-config","p":1361},{"i":1373,"t":"Signatures","u":"/api/middleware/cache","h":"#signatures","p":1371},{"i":1375,"t":"Examples","u":"/api/middleware/cache","h":"#examples","p":1371},{"i":1377,"t":"Config","u":"/api/middleware/cache","h":"#config","p":1371},{"i":1379,"t":"Default Config","u":"/api/middleware/cache","h":"#default-config","p":1371},{"i":1383,"t":"Signatures","u":"/api/middleware/compress","h":"#signatures","p":1381},{"i":1385,"t":"Examples","u":"/api/middleware/compress","h":"#examples","p":1381},{"i":1387,"t":"Config","u":"/api/middleware/compress","h":"#config","p":1381},{"i":1389,"t":"Default Config","u":"/api/middleware/compress","h":"#default-config","p":1381},{"i":1391,"t":"Constants","u":"/api/middleware/compress","h":"#constants","p":1381},{"i":1395,"t":"Signatures","u":"/api/middleware/cors","h":"#signatures","p":1393},{"i":1397,"t":"Examples","u":"/api/middleware/cors","h":"#examples","p":1393},{"i":1399,"t":"Config","u":"/api/middleware/cors","h":"#config","p":1393},{"i":1401,"t":"Default Config","u":"/api/middleware/cors","h":"#default-config","p":1393},{"i":1405,"t":"Signatures","u":"/api/middleware/csrf","h":"#signatures","p":1403},{"i":1407,"t":"Examples","u":"/api/middleware/csrf","h":"#examples","p":1403},{"i":1409,"t":"Config","u":"/api/middleware/csrf","h":"#config","p":1403},{"i":1411,"t":"Default Config","u":"/api/middleware/csrf","h":"#default-config","p":1403},{"i":1413,"t":"Constants","u":"/api/middleware/csrf","h":"#constants","p":1403},{"i":1415,"t":"Custom Storage/Database","u":"/api/middleware/csrf","h":"#custom-storagedatabase","p":1403},{"i":1419,"t":"Signatures","u":"/api/middleware/earlydata","h":"#signatures","p":1417},{"i":1421,"t":"Examples","u":"/api/middleware/earlydata","h":"#examples","p":1417},{"i":1423,"t":"Config","u":"/api/middleware/earlydata","h":"#config","p":1417},{"i":1425,"t":"Default Config","u":"/api/middleware/earlydata","h":"#default-config","p":1417},{"i":1427,"t":"Constants","u":"/api/middleware/earlydata","h":"#constants","p":1417},{"i":1431,"t":"Signatures","u":"/api/middleware/encryptcookie","h":"#signatures","p":1429},{"i":1433,"t":"Examples","u":"/api/middleware/encryptcookie","h":"#examples","p":1429},{"i":1435,"t":"Config","u":"/api/middleware/encryptcookie","h":"#config","p":1429},{"i":1437,"t":"Default Config","u":"/api/middleware/encryptcookie","h":"#default-config","p":1429},{"i":1439,"t":"Usage of CSRF and Encryptcookie Middlewares with Custom Cookie Names","u":"/api/middleware/encryptcookie","h":"#usage-of-csrf-and-encryptcookie-middlewares-with-custom-cookie-names","p":1429},{"i":1443,"t":"Signatures","u":"/api/middleware/envvar","h":"#signatures","p":1441},{"i":1445,"t":"Examples","u":"/api/middleware/envvar","h":"#examples","p":1441},{"i":1447,"t":"Response","u":"/api/middleware/envvar","h":"#response","p":1441},{"i":1449,"t":"Config","u":"/api/middleware/envvar","h":"#config","p":1441},{"i":1451,"t":"Default Config","u":"/api/middleware/envvar","h":"#default-config","p":1441},{"i":1455,"t":"Signatures","u":"/api/middleware/etag","h":"#signatures","p":1453},{"i":1457,"t":"Examples","u":"/api/middleware/etag","h":"#examples","p":1453},{"i":1459,"t":"Config","u":"/api/middleware/etag","h":"#config","p":1453},{"i":1461,"t":"Default Config","u":"/api/middleware/etag","h":"#default-config","p":1453},{"i":1465,"t":"Signatures","u":"/api/middleware/expvar","h":"#signatures","p":1463},{"i":1467,"t":"Examples","u":"/api/middleware/expvar","h":"#examples","p":1463},{"i":1469,"t":"Config","u":"/api/middleware/expvar","h":"#config","p":1463},{"i":1471,"t":"Default Config","u":"/api/middleware/expvar","h":"#default-config","p":1463},{"i":1475,"t":"Signatures","u":"/api/middleware/favicon","h":"#signatures","p":1473},{"i":1477,"t":"Examples","u":"/api/middleware/favicon","h":"#examples","p":1473},{"i":1479,"t":"Config","u":"/api/middleware/favicon","h":"#config","p":1473},{"i":1481,"t":"Default Config","u":"/api/middleware/favicon","h":"#default-config","p":1473},{"i":1485,"t":"Signatures","u":"/api/middleware/filesystem","h":"#signatures","p":1483},{"i":1487,"t":"Examples","u":"/api/middleware/filesystem","h":"#examples","p":1483},{"i":1489,"t":"embed","u":"/api/middleware/filesystem","h":"#embed","p":1483},{"i":1491,"t":"pkger","u":"/api/middleware/filesystem","h":"#pkger","p":1483},{"i":1493,"t":"packr","u":"/api/middleware/filesystem","h":"#packr","p":1483},{"i":1495,"t":"go.rice","u":"/api/middleware/filesystem","h":"#gorice","p":1483},{"i":1497,"t":"fileb0x","u":"/api/middleware/filesystem","h":"#fileb0x","p":1483},{"i":1499,"t":"statik","u":"/api/middleware/filesystem","h":"#statik","p":1483},{"i":1501,"t":"Config","u":"/api/middleware/filesystem","h":"#config","p":1483},{"i":1503,"t":"Default Config","u":"/api/middleware/filesystem","h":"#default-config","p":1483},{"i":1507,"t":"Signatures","u":"/api/middleware/helmet","h":"#signatures","p":1505},{"i":1509,"t":"Examples","u":"/api/middleware/helmet","h":"#examples","p":1505},{"i":1511,"t":"Config","u":"/api/middleware/helmet","h":"#config","p":1505},{"i":1513,"t":"Default Config","u":"/api/middleware/helmet","h":"#default-config","p":1505},{"i":1517,"t":"Signatures","u":"/api/middleware/idempotency","h":"#signatures","p":1515},{"i":1519,"t":"Examples","u":"/api/middleware/idempotency","h":"#examples","p":1515},{"i":1521,"t":"Default Config","u":"/api/middleware/idempotency","h":"#default-config","p":1515},{"i":1523,"t":"Custom Config","u":"/api/middleware/idempotency","h":"#custom-config","p":1515},{"i":1525,"t":"Config","u":"/api/middleware/idempotency","h":"#config","p":1515},{"i":1527,"t":"Default Config","u":"/api/middleware/idempotency","h":"#default-config-1","p":1515},{"i":1531,"t":"Signatures","u":"/api/middleware/keyauth","h":"#signatures","p":1529},{"i":1533,"t":"Examples","u":"/api/middleware/keyauth","h":"#examples","p":1529},{"i":1535,"t":"Authenticate only certain endpoints","u":"/api/middleware/keyauth","h":"#authenticate-only-certain-endpoints","p":1529},{"i":1537,"t":"Specifying middleware in the handler","u":"/api/middleware/keyauth","h":"#specifying-middleware-in-the-handler","p":1529},{"i":1539,"t":"Config","u":"/api/middleware/keyauth","h":"#config","p":1529},{"i":1541,"t":"Default Config","u":"/api/middleware/keyauth","h":"#default-config","p":1529},{"i":1545,"t":"Signatures","u":"/api/middleware/limiter","h":"#signatures","p":1543},{"i":1547,"t":"Examples","u":"/api/middleware/limiter","h":"#examples","p":1543},{"i":1549,"t":"Sliding window","u":"/api/middleware/limiter","h":"#sliding-window","p":1543},{"i":1551,"t":"Config","u":"/api/middleware/limiter","h":"#config","p":1543},{"i":1553,"t":"Default Config","u":"/api/middleware/limiter","h":"#default-config","p":1543},{"i":1555,"t":"Custom Storage/Database","u":"/api/middleware/limiter","h":"#custom-storagedatabase","p":1543},{"i":1559,"t":"Signatures","u":"/api/middleware/logger","h":"#signatures","p":1557},{"i":1561,"t":"Examples","u":"/api/middleware/logger","h":"#examples","p":1557},{"i":1563,"t":"Config","u":"/api/middleware/logger","h":"#config","p":1557},{"i":1565,"t":"Default Config","u":"/api/middleware/logger","h":"#default-config","p":1557},{"i":1567,"t":"Constants","u":"/api/middleware/logger","h":"#constants","p":1557},{"i":1571,"t":"Signatures","u":"/api/middleware/monitor","h":"#signatures","p":1569},{"i":1573,"t":"Examples","u":"/api/middleware/monitor","h":"#examples","p":1569},{"i":1575,"t":"Config","u":"/api/middleware/monitor","h":"#config","p":1569},{"i":1577,"t":"Default Config","u":"/api/middleware/monitor","h":"#default-config","p":1569},{"i":1581,"t":"Signatures","u":"/api/middleware/pprof","h":"#signatures","p":1579},{"i":1583,"t":"Examples","u":"/api/middleware/pprof","h":"#examples","p":1579},{"i":1585,"t":"Config","u":"/api/middleware/pprof","h":"#config","p":1579},{"i":1587,"t":"Default Config","u":"/api/middleware/pprof","h":"#default-config","p":1579},{"i":1591,"t":"Signatures","u":"/api/middleware/proxy","h":"#signatures","p":1589},{"i":1593,"t":"Examples","u":"/api/middleware/proxy","h":"#examples","p":1589},{"i":1595,"t":"Config","u":"/api/middleware/proxy","h":"#config","p":1589},{"i":1597,"t":"Default Config","u":"/api/middleware/proxy","h":"#default-config","p":1589},{"i":1601,"t":"Signatures","u":"/api/middleware/recover","h":"#signatures","p":1599},{"i":1603,"t":"Examples","u":"/api/middleware/recover","h":"#examples","p":1599},{"i":1605,"t":"Config","u":"/api/middleware/recover","h":"#config","p":1599},{"i":1607,"t":"Default Config","u":"/api/middleware/recover","h":"#default-config","p":1599},{"i":1611,"t":"Signatures","u":"/api/middleware/redirect","h":"#signatures","p":1609},{"i":1613,"t":"Examples","u":"/api/middleware/redirect","h":"#examples","p":1609},{"i":1615,"t":"Config","u":"/api/middleware/redirect","h":"#config","p":1609},{"i":1617,"t":"Default Config","u":"/api/middleware/redirect","h":"#default-config","p":1609},{"i":1621,"t":"Signatures","u":"/api/middleware/requestid","h":"#signatures","p":1619},{"i":1623,"t":"Examples","u":"/api/middleware/requestid","h":"#examples","p":1619},{"i":1625,"t":"Config","u":"/api/middleware/requestid","h":"#config","p":1619},{"i":1627,"t":"Default Config","u":"/api/middleware/requestid","h":"#default-config","p":1619},{"i":1631,"t":"Signatures","u":"/api/middleware/rewrite","h":"#signatures","p":1629},{"i":1633,"t":"Examples","u":"/api/middleware/rewrite","h":"#examples","p":1629},{"i":1637,"t":"Signatures","u":"/api/middleware/session","h":"#signatures","p":1635},{"i":1639,"t":"Examples","u":"/api/middleware/session","h":"#examples","p":1635},{"i":1641,"t":"Config","u":"/api/middleware/session","h":"#config","p":1635},{"i":1643,"t":"Default Config","u":"/api/middleware/session","h":"#default-config","p":1635},{"i":1645,"t":"Constants","u":"/api/middleware/session","h":"#constants","p":1635},{"i":1647,"t":"Custom Storage/Database","u":"/api/middleware/session","h":"#custom-storagedatabase","p":1635},{"i":1651,"t":"Signatures","u":"/api/middleware/skip","h":"#signatures","p":1649},{"i":1653,"t":"Examples","u":"/api/middleware/skip","h":"#examples","p":1649},{"i":1657,"t":"Signatures","u":"/api/middleware/timeout","h":"#signatures","p":1655},{"i":1659,"t":"Examples","u":"/api/middleware/timeout","h":"#examples","p":1655},{"i":1662,"t":"TechEmpower","u":"/extra/benchmarks","h":"#techempower","p":1661},{"i":1664,"t":"Plaintext","u":"/extra/benchmarks","h":"#plaintext","p":1661},{"i":1666,"t":"Data Updates","u":"/extra/benchmarks","h":"#data-updates","p":1661},{"i":1668,"t":"Multiple Queries","u":"/extra/benchmarks","h":"#multiple-queries","p":1661},{"i":1670,"t":"Single Query","u":"/extra/benchmarks","h":"#single-query","p":1661},{"i":1672,"t":"JSON Serialization","u":"/extra/benchmarks","h":"#json-serialization","p":1661},{"i":1674,"t":"Go web framework benchmark","u":"/extra/benchmarks","h":"#go-web-framework-benchmark","p":1661},{"i":1677,"t":"How should I structure my application?","u":"/extra/faq","h":"#how-should-i-structure-my-application","p":1676},{"i":1679,"t":"How do I handle custom 404 responses?","u":"/extra/faq","h":"#how-do-i-handle-custom-404-responses","p":1676},{"i":1681,"t":"How can i use live reload ?","u":"/extra/faq","h":"#how-can-i-use-live-reload-","p":1676},{"i":1683,"t":"How do I set up an error handler?","u":"/extra/faq","h":"#how-do-i-set-up-an-error-handler","p":1676},{"i":1685,"t":"Which template engines does Fiber support?","u":"/extra/faq","h":"#which-template-engines-does-fiber-support","p":1676},{"i":1687,"t":"Does Fiber have a community chat?","u":"/extra/faq","h":"#does-fiber-have-a-community-chat","p":1676},{"i":1689,"t":"Does fiber support sub domain routing ?","u":"/extra/faq","h":"#does-fiber-support-sub-domain-routing-","p":1676},{"i":1692,"t":"Catching Errors","u":"/guide/error-handling","h":"#catching-errors","p":1691},{"i":1694,"t":"Default Error Handler","u":"/guide/error-handling","h":"#default-error-handler","p":1691},{"i":1696,"t":"Custom Error Handler","u":"/guide/error-handling","h":"#custom-error-handler","p":1691},{"i":1699,"t":"Custom JSON Encoder/Decoder","u":"/guide/faster-fiber","h":"#custom-json-encoderdecoder","p":1698},{"i":1701,"t":"References","u":"/guide/faster-fiber","h":"#references","p":1698},{"i":1705,"t":"Paths","u":"/guide/grouping","h":"#paths","p":1703},{"i":1707,"t":"Group Handlers","u":"/guide/grouping","h":"#group-handlers","p":1703},{"i":1711,"t":"Constants","u":"/guide/hooks","h":"#constants","p":1709},{"i":1713,"t":"OnRoute","u":"/guide/hooks","h":"#onroute","p":1709},{"i":1715,"t":"OnName","u":"/guide/hooks","h":"#onname","p":1709},{"i":1717,"t":"OnGroup","u":"/guide/hooks","h":"#ongroup","p":1709},{"i":1719,"t":"OnGroupName","u":"/guide/hooks","h":"#ongroupname","p":1709},{"i":1721,"t":"OnListen","u":"/guide/hooks","h":"#onlisten","p":1709},{"i":1723,"t":"OnFork","u":"/guide/hooks","h":"#onfork","p":1709},{"i":1725,"t":"OnShutdown","u":"/guide/hooks","h":"#onshutdown","p":1709},{"i":1727,"t":"OnMount","u":"/guide/hooks","h":"#onmount","p":1709},{"i":1730,"t":"Handlers","u":"/guide/routing","h":"#handlers","p":1729},{"i":1732,"t":"Paths","u":"/guide/routing","h":"#paths","p":1729},{"i":1734,"t":"Parameters","u":"/guide/routing","h":"#parameters","p":1729},{"i":1736,"t":"Constraints","u":"/guide/routing","h":"#constraints","p":1729},{"i":1738,"t":"Middleware","u":"/guide/routing","h":"#middleware","p":1729},{"i":1740,"t":"Grouping","u":"/guide/routing","h":"#grouping","p":1729},{"i":1743,"t":"Template interfaces","u":"/guide/templates","h":"#template-interfaces","p":1742},{"i":1745,"t":"Engines","u":"/guide/templates","h":"#engines","p":1742},{"i":1748,"t":"Validator package","u":"/guide/validation","h":"#validator-package","p":1747},{"i":1753,"t":"Accepts","u":"/api/ctx","h":"#accepts","p":1752},{"i":1755,"t":"AllParams","u":"/api/ctx","h":"#allparams","p":1752},{"i":1757,"t":"App","u":"/api/ctx","h":"#app","p":1752},{"i":1759,"t":"Append","u":"/api/ctx","h":"#append","p":1752},{"i":1761,"t":"Attachment","u":"/api/ctx","h":"#attachment","p":1752},{"i":1763,"t":"BaseURL","u":"/api/ctx","h":"#baseurl","p":1752},{"i":1765,"t":"Bind","u":"/api/ctx","h":"#bind","p":1752},{"i":1767,"t":"Body","u":"/api/ctx","h":"#body","p":1752},{"i":1769,"t":"BodyParser","u":"/api/ctx","h":"#bodyparser","p":1752},{"i":1771,"t":"ClearCookie","u":"/api/ctx","h":"#clearcookie","p":1752},{"i":1773,"t":"ClientHelloInfo","u":"/api/ctx","h":"#clienthelloinfo","p":1752},{"i":1775,"t":"Context","u":"/api/ctx","h":"#context","p":1752},{"i":1777,"t":"Cookie","u":"/api/ctx","h":"#cookie","p":1752},{"i":1779,"t":"Cookies","u":"/api/ctx","h":"#cookies","p":1752},{"i":1781,"t":"Download","u":"/api/ctx","h":"#download","p":1752},{"i":1783,"t":"Format","u":"/api/ctx","h":"#format","p":1752},{"i":1785,"t":"FormFile","u":"/api/ctx","h":"#formfile","p":1752},{"i":1787,"t":"FormValue","u":"/api/ctx","h":"#formvalue","p":1752},{"i":1789,"t":"Fresh","u":"/api/ctx","h":"#fresh","p":1752},{"i":1791,"t":"Get","u":"/api/ctx","h":"#get","p":1752},{"i":1793,"t":"GetReqHeaders","u":"/api/ctx","h":"#getreqheaders","p":1752},{"i":1795,"t":"GetRespHeader","u":"/api/ctx","h":"#getrespheader","p":1752},{"i":1797,"t":"GetRespHeaders","u":"/api/ctx","h":"#getrespheaders","p":1752},{"i":1799,"t":"GetRouteURL","u":"/api/ctx","h":"#getrouteurl","p":1752},{"i":1801,"t":"Hostname","u":"/api/ctx","h":"#hostname","p":1752},{"i":1803,"t":"IP","u":"/api/ctx","h":"#ip","p":1752},{"i":1805,"t":"IPs","u":"/api/ctx","h":"#ips","p":1752},{"i":1807,"t":"Is","u":"/api/ctx","h":"#is","p":1752},{"i":1809,"t":"IsFromLocal","u":"/api/ctx","h":"#isfromlocal","p":1752},{"i":1811,"t":"JSON","u":"/api/ctx","h":"#json","p":1752},{"i":1813,"t":"JSONP","u":"/api/ctx","h":"#jsonp","p":1752},{"i":1815,"t":"Links","u":"/api/ctx","h":"#links","p":1752},{"i":1817,"t":"Locals","u":"/api/ctx","h":"#locals","p":1752},{"i":1819,"t":"Location","u":"/api/ctx","h":"#location","p":1752},{"i":1821,"t":"Method","u":"/api/ctx","h":"#method","p":1752},{"i":1823,"t":"MultipartForm","u":"/api/ctx","h":"#multipartform","p":1752},{"i":1825,"t":"Next","u":"/api/ctx","h":"#next","p":1752},{"i":1827,"t":"OriginalURL","u":"/api/ctx","h":"#originalurl","p":1752},{"i":1829,"t":"Params","u":"/api/ctx","h":"#params","p":1752},{"i":1831,"t":"ParamsInt","u":"/api/ctx","h":"#paramsint","p":1752},{"i":1833,"t":"ParamsParser","u":"/api/ctx","h":"#paramsparser","p":1752},{"i":1835,"t":"Path","u":"/api/ctx","h":"#path","p":1752},{"i":1837,"t":"Protocol","u":"/api/ctx","h":"#protocol","p":1752},{"i":1839,"t":"Queries","u":"/api/ctx","h":"#queries","p":1752},{"i":1841,"t":"Query","u":"/api/ctx","h":"#query","p":1752},{"i":1843,"t":"QueryBool","u":"/api/ctx","h":"#querybool","p":1752},{"i":1845,"t":"QueryFloat","u":"/api/ctx","h":"#queryfloat","p":1752},{"i":1847,"t":"QueryInt","u":"/api/ctx","h":"#queryint","p":1752},{"i":1849,"t":"QueryParser","u":"/api/ctx","h":"#queryparser","p":1752},{"i":1851,"t":"Range","u":"/api/ctx","h":"#range","p":1752},{"i":1853,"t":"Redirect","u":"/api/ctx","h":"#redirect","p":1752},{"i":1855,"t":"RedirectToRoute","u":"/api/ctx","h":"#redirecttoroute","p":1752},{"i":1857,"t":"RedirectBack","u":"/api/ctx","h":"#redirectback","p":1752},{"i":1859,"t":"Render","u":"/api/ctx","h":"#render","p":1752},{"i":1861,"t":"Request","u":"/api/ctx","h":"#request","p":1752},{"i":1863,"t":"ReqHeaderParser","u":"/api/ctx","h":"#reqheaderparser","p":1752},{"i":1865,"t":"Response","u":"/api/ctx","h":"#response","p":1752},{"i":1867,"t":"RestartRouting","u":"/api/ctx","h":"#restartrouting","p":1752},{"i":1869,"t":"Route","u":"/api/ctx","h":"#route","p":1752},{"i":1871,"t":"SaveFile","u":"/api/ctx","h":"#savefile","p":1752},{"i":1873,"t":"SaveFileToStorage","u":"/api/ctx","h":"#savefiletostorage","p":1752},{"i":1875,"t":"Secure","u":"/api/ctx","h":"#secure","p":1752},{"i":1877,"t":"Send","u":"/api/ctx","h":"#send","p":1752},{"i":1879,"t":"SendFile","u":"/api/ctx","h":"#sendfile","p":1752},{"i":1881,"t":"SendStatus","u":"/api/ctx","h":"#sendstatus","p":1752},{"i":1883,"t":"Set","u":"/api/ctx","h":"#set","p":1752},{"i":1885,"t":"SetParserDecoder","u":"/api/ctx","h":"#setparserdecoder","p":1752},{"i":1887,"t":"SetUserContext","u":"/api/ctx","h":"#setusercontext","p":1752},{"i":1889,"t":"Stale","u":"/api/ctx","h":"#stale","p":1752},{"i":1891,"t":"Status","u":"/api/ctx","h":"#status","p":1752},{"i":1893,"t":"Subdomains","u":"/api/ctx","h":"#subdomains","p":1752},{"i":1895,"t":"Type","u":"/api/ctx","h":"#type","p":1752},{"i":1897,"t":"UserContext","u":"/api/ctx","h":"#usercontext","p":1752},{"i":1899,"t":"Vary","u":"/api/ctx","h":"#vary","p":1752},{"i":1901,"t":"Write","u":"/api/ctx","h":"#write","p":1752},{"i":1903,"t":"Writef","u":"/api/ctx","h":"#writef","p":1752},{"i":1905,"t":"WriteString","u":"/api/ctx","h":"#writestring","p":1752},{"i":1907,"t":"XHR","u":"/api/ctx","h":"#xhr","p":1752},{"i":1909,"t":"XML","u":"/api/ctx","h":"#xml","p":1752}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/722",[0,6.557]],["t/724",[1,2.935,2,2.935,3,3.577]],["t/728",[4,3.138]],["t/730",[5,2.462]],["t/732",[6,1.835]],["t/734",[7,2.249]],["t/736",[8,6.557]],["t/738",[9,6.557]],["t/740",[10,6.557]],["t/744",[4,3.138]],["t/746",[5,2.462]],["t/748",[6,1.835]],["t/750",[7,2.249]],["t/754",[4,3.138]],["t/756",[5,2.462]],["t/758",[6,1.835]],["t/760",[11,4.91]],["t/762",[11,2.093,12,2.796,13,2.551,14,2.796,15,2.551]],["t/766",[4,3.138]],["t/768",[5,2.462]],["t/770",[6,1.835]],["t/772",[11,4.91]],["t/774",[16,3.264,17,2.79,18,3.264,19,3.264]],["t/778",[4,3.138]],["t/780",[5,2.462]],["t/782",[6,1.835]],["t/784",[7,2.249]],["t/788",[4,3.138]],["t/790",[5,2.462]],["t/792",[6,1.835]],["t/794",[7,2.249]],["t/798",[4,3.138]],["t/800",[5,2.462]],["t/802",[6,1.835]],["t/804",[7,1.683,20,4.477]],["t/806",[20,4.477,21,3.983]],["t/808",[7,1.683,22,4.477]],["t/810",[21,3.983,22,4.477]],["t/812",[21,3.182,23,3.92,24,3.182]],["t/814",[7,1.345,25,2.552,26,3.92]],["t/818",[4,3.138]],["t/820",[5,2.462]],["t/822",[6,1.835]],["t/824",[27,5.983]],["t/826",[11,4.91]],["t/830",[4,3.138]],["t/832",[5,2.462]],["t/834",[6,1.835]],["t/836",[11,4.91]],["t/838",[7,2.249]],["t/844",[4,3.138]],["t/846",[5,2.462]],["t/848",[6,1.835]],["t/850",[28,6.557]],["t/854",[29,2.709,30,2.709]],["t/856",[5,2.462]],["t/858",[7,2.249]],["t/860",[6,1.373,31,2.039]],["t/862",[6,1.373,25,3.195]],["t/866",[4,3.138]],["t/868",[7,2.249]],["t/870",[2,2.935,32,3.577,33,3.92]],["t/873",[1,3.674,34,4.477]],["t/875",[1,2.935,3,3.577,34,3.577]],["t/879",[29,2.709,30,2.709]],["t/881",[5,2.462]],["t/883",[4,3.138]],["t/885",[7,2.249]],["t/887",[6,1.835]],["t/889",[6,1.373,31,2.039]],["t/893",[29,2.709,30,2.709]],["t/895",[5,2.462]],["t/897",[4,3.138]],["t/899",[7,2.249]],["t/901",[6,1.835]],["t/903",[6,1.373,31,2.039]],["t/907",[29,2.709,30,2.709]],["t/909",[5,2.462]],["t/911",[4,3.138]],["t/913",[7,2.249]],["t/915",[6,1.835]],["t/917",[6,1.373,31,2.039]],["t/921",[29,2.709,30,2.709]],["t/923",[5,2.462]],["t/925",[4,3.138]],["t/927",[7,2.249]],["t/929",[6,1.835]],["t/931",[6,1.373,31,2.039]],["t/935",[29,2.709,30,2.709]],["t/937",[5,2.462]],["t/939",[4,3.138]],["t/941",[7,2.249]],["t/943",[6,1.835]],["t/945",[6,1.373,31,2.039]],["t/949",[29,2.709,30,2.709]],["t/951",[5,2.462]],["t/953",[4,3.138]],["t/955",[7,2.249]],["t/957",[6,1.835]],["t/959",[6,1.373,31,2.039]],["t/963",[29,2.709,30,2.709]],["t/965",[5,2.462]],["t/967",[4,3.138]],["t/969",[7,2.249]],["t/971",[6,1.835]],["t/973",[6,1.373,31,2.039]],["t/977",[29,2.709,30,2.709]],["t/979",[5,2.462]],["t/981",[4,3.138]],["t/983",[7,2.249]],["t/985",[6,1.835]],["t/987",[6,1.373,31,2.039]],["t/991",[29,2.709,30,2.709]],["t/993",[5,2.462]],["t/995",[4,3.138]],["t/997",[7,2.249]],["t/999",[6,1.835]],["t/1001",[6,1.373,31,2.039]],["t/1005",[29,2.709,30,2.709]],["t/1007",[5,2.462]],["t/1009",[4,3.138]],["t/1011",[7,2.249]],["t/1013",[6,1.835]],["t/1015",[6,1.373,31,2.039]],["t/1019",[29,2.709,30,2.709]],["t/1021",[5,2.462]],["t/1023",[4,3.138]],["t/1025",[7,2.249]],["t/1027",[6,1.835]],["t/1029",[6,1.373,31,2.039]],["t/1033",[29,2.709,30,2.709]],["t/1035",[5,2.462]],["t/1037",[4,3.138]],["t/1039",[7,2.249]],["t/1041",[6,1.835]],["t/1043",[6,1.373,31,2.039]],["t/1047",[29,2.709,30,2.709]],["t/1049",[5,2.462]],["t/1051",[4,3.138]],["t/1053",[7,2.249]],["t/1055",[6,1.835]],["t/1057",[6,1.373,31,2.039]],["t/1061",[29,2.709,30,2.709]],["t/1063",[5,2.462]],["t/1065",[4,3.138]],["t/1067",[7,2.249]],["t/1069",[6,1.835]],["t/1071",[6,1.373,31,2.039]],["t/1075",[29,2.709,30,2.709]],["t/1077",[5,2.462]],["t/1079",[4,3.138]],["t/1081",[7,2.249]],["t/1083",[6,1.835]],["t/1085",[6,1.373,31,2.039]],["t/1089",[29,2.709,30,2.709]],["t/1091",[5,2.462]],["t/1093",[4,3.138]],["t/1095",[7,2.249]],["t/1097",[6,1.835]],["t/1099",[6,1.373,31,2.039]],["t/1103",[29,2.709,30,2.709]],["t/1105",[5,2.462]],["t/1107",[4,3.138]],["t/1109",[7,2.249]],["t/1111",[6,1.835]],["t/1113",[6,1.373,31,2.039]],["t/1117",[29,2.709,30,2.709]],["t/1119",[5,2.462]],["t/1121",[4,3.138]],["t/1123",[7,2.249]],["t/1125",[6,1.835]],["t/1127",[6,1.373,31,2.039]],["t/1131",[4,3.138]],["t/1133",[7,2.249]],["t/1135",[7,1.683,35,4.907]],["t/1137",[36,4.477,37,4.477]],["t/1139",[38,5.983]],["t/1143",[7,1.683,39,3.271]],["t/1147",[7,1.683,39,3.271]],["t/1151",[7,1.683,39,3.271]],["t/1153",[36,2.551,37,2.551,40,2.39,41,2.551,42,2.796]],["t/1155",[25,2.125,40,2.79,43,3.264,44,2.65]],["t/1159",[7,1.683,39,3.271]],["t/1163",[7,1.683,39,3.271]],["t/1165",[7,1.683,45,4.907]],["t/1167",[7,1.683,46,4.907]],["t/1171",[29,2.709,30,2.709]],["t/1173",[47,3.577,48,3.92,49,2.552]],["t/1175",[49,3.195,50,4.907]],["t/1177",[49,2.552,51,3.92,52,3.92]],["t/1179",[49,3.195,53,4.907]],["t/1181",[49,3.195,54,4.907]],["t/1183",[44,3.983,49,3.195]],["t/1185",[44,3.182,49,2.552,55,3.92]],["t/1187",[49,2.552,56,3.92,57,3.92]],["t/1189",[44,3.182,49,2.552,58,3.92]],["t/1193",[7,1.683,39,3.271]],["t/1197",[7,1.683,39,3.271]],["t/1201",[7,1.683,39,3.271]],["t/1205",[7,1.683,39,3.271]],["t/1209",[4,3.138]],["t/1211",[59,4.907,60,4.907]],["t/1213",[61,4.907,62,4.907]],["t/1215",[39,3.271,63,3.815]],["t/1217",[41,4.477,64,4.477]],["t/1219",[32,5.983]],["t/1222",[64,5.983]],["t/1224",[63,3.815,65,3.355]],["t/1226",[66,6.557]],["t/1228",[67,6.557]],["t/1230",[68,5.606]],["t/1232",[63,5.098]],["t/1234",[69,5.983]],["t/1236",[69,4.477,70,4.907]],["t/1238",[71,6.557]],["t/1240",[72,6.557]],["t/1242",[73,5.983]],["t/1244",[74,5.983]],["t/1246",[74,5.983]],["t/1248",[6,1.835]],["t/1250",[65,4.484]],["t/1252",[75,5.983]],["t/1254",[76,6.557]],["t/1256",[77,6.557]],["t/1258",[78,6.557]],["t/1260",[79,6.557]],["t/1262",[75,5.983]],["t/1264",[21,5.323]],["t/1266",[80,6.557]],["t/1269",[81,4.907,82,4.195]],["t/1271",[1,3.674,83,4.907]],["t/1273",[47,5.983]],["t/1275",[24,5.323]],["t/1277",[84,6.557]],["t/1279",[85,6.557]],["t/1281",[86,6.557]],["t/1283",[87,5.323]],["t/1285",[88,5.983]],["t/1287",[89,6.557]],["t/1289",[90,6.557]],["t/1291",[91,6.557]],["t/1293",[92,6.557]],["t/1295",[93,5.983]],["t/1297",[94,5.323]],["t/1299",[95,5.983]],["t/1301",[96,6.557]],["t/1303",[97,5.983]],["t/1305",[98,6.557]],["t/1307",[99,6.557]],["t/1309",[100,6.557]],["t/1311",[101,6.557]],["t/1313",[102,6.557]],["t/1315",[103,6.557]],["t/1317",[104,6.557]],["t/1319",[105,6.557]],["t/1321",[82,5.606]],["t/1323",[106,6.557]],["t/1325",[107,6.557]],["t/1327",[108,6.557]],["t/1329",[109,6.557]],["t/1331",[110,6.557]],["t/1333",[111,6.557]],["t/1338",[13,5.983]],["t/1340",[6,1.835]],["t/1342",[112,6.557]],["t/1344",[113,6.557]],["t/1348",[5,2.462]],["t/1350",[7,2.249]],["t/1351",[114,3.983,115,3.449]],["t/1353",[2,2.935,114,3.182,115,2.755]],["t/1355",[65,2.681,114,3.182,115,2.755]],["t/1357",[114,3.182,115,2.755,116,3.577]],["t/1359",[17,3.351,115,2.755,117,3.92]],["t/1363",[5,2.462]],["t/1365",[7,2.249]],["t/1367",[6,1.835]],["t/1369",[6,1.373,31,2.039]],["t/1373",[5,2.462]],["t/1375",[7,2.249]],["t/1377",[6,1.835]],["t/1379",[6,1.373,31,2.039]],["t/1383",[5,2.462]],["t/1385",[7,2.249]],["t/1387",[6,1.835]],["t/1389",[6,1.373,31,2.039]],["t/1391",[118,4.91]],["t/1395",[5,2.462]],["t/1397",[7,2.249]],["t/1399",[6,1.835]],["t/1401",[6,1.373,31,2.039]],["t/1405",[5,2.462]],["t/1407",[7,2.249]],["t/1409",[6,1.835]],["t/1411",[6,1.373,31,2.039]],["t/1413",[118,4.91]],["t/1415",[25,3.195,119,4.195]],["t/1419",[5,2.462]],["t/1421",[7,2.249]],["t/1423",[6,1.835]],["t/1425",[6,1.373,31,2.039]],["t/1427",[118,4.91]],["t/1431",[5,2.462]],["t/1433",[7,2.249]],["t/1435",[6,1.835]],["t/1437",[6,1.373,31,2.039]],["t/1439",[2,1.627,11,1.627,25,1.415,73,1.982,87,1.764,120,2.172,121,2.172]],["t/1443",[5,2.462]],["t/1445",[7,2.249]],["t/1447",[122,5.606]],["t/1449",[6,1.835]],["t/1451",[6,1.373,31,2.039]],["t/1455",[5,2.462]],["t/1457",[7,2.249]],["t/1459",[6,1.835]],["t/1461",[6,1.373,31,2.039]],["t/1465",[5,2.462]],["t/1467",[7,2.249]],["t/1469",[6,1.835]],["t/1471",[6,1.373,31,2.039]],["t/1475",[5,2.462]],["t/1477",[7,2.249]],["t/1479",[6,1.835]],["t/1481",[6,1.373,31,2.039]],["t/1485",[5,2.462]],["t/1487",[7,2.249]],["t/1489",[123,6.557]],["t/1491",[124,6.557]],["t/1493",[125,6.557]],["t/1495",[126,6.557]],["t/1497",[127,6.557]],["t/1499",[128,6.557]],["t/1501",[6,1.835]],["t/1503",[6,1.373,31,2.039]],["t/1507",[5,2.462]],["t/1509",[7,2.249]],["t/1511",[6,1.835]],["t/1513",[6,1.373,31,2.039]],["t/1517",[5,2.462]],["t/1519",[7,2.249]],["t/1521",[6,1.373,31,2.039]],["t/1523",[6,1.373,25,3.195]],["t/1525",[6,1.835]],["t/1527",[6,1.373,31,2.039]],["t/1531",[5,2.462]],["t/1533",[7,2.249]],["t/1535",[129,3.92,130,3.92,131,3.92]],["t/1537",[2,2.935,65,2.681,132,3.92]],["t/1539",[6,1.835]],["t/1541",[6,1.373,31,2.039]],["t/1545",[5,2.462]],["t/1547",[7,2.249]],["t/1549",[133,4.907,134,4.907]],["t/1551",[6,1.835]],["t/1553",[6,1.373,31,2.039]],["t/1555",[25,3.195,119,4.195]],["t/1559",[5,2.462]],["t/1561",[7,2.249]],["t/1563",[6,1.835]],["t/1565",[6,1.373,31,2.039]],["t/1567",[118,4.91]],["t/1571",[5,2.462]],["t/1573",[7,2.249]],["t/1575",[6,1.835]],["t/1577",[6,1.373,31,2.039]],["t/1581",[5,2.462]],["t/1583",[7,2.249]],["t/1585",[6,1.835]],["t/1587",[6,1.373,31,2.039]],["t/1591",[5,2.462]],["t/1593",[7,2.249]],["t/1595",[6,1.835]],["t/1597",[6,1.373,31,2.039]],["t/1601",[5,2.462]],["t/1603",[7,2.249]],["t/1605",[6,1.835]],["t/1607",[6,1.373,31,2.039]],["t/1611",[5,2.462]],["t/1613",[7,2.249]],["t/1615",[6,1.835]],["t/1617",[6,1.373,31,2.039]],["t/1621",[5,2.462]],["t/1623",[7,2.249]],["t/1625",[6,1.835]],["t/1627",[6,1.373,31,2.039]],["t/1631",[5,2.462]],["t/1633",[7,2.249]],["t/1637",[5,2.462]],["t/1639",[7,2.249]],["t/1641",[6,1.835]],["t/1643",[6,1.373,31,2.039]],["t/1645",[118,4.91]],["t/1647",[25,3.195,119,4.195]],["t/1651",[5,2.462]],["t/1653",[7,2.249]],["t/1657",[5,2.462]],["t/1659",[7,2.249]],["t/1662",[135,6.557]],["t/1664",[136,6.557]],["t/1666",[137,4.907,138,4.907]],["t/1668",[139,4.907,140,3.983]],["t/1670",[140,3.983,141,4.907]],["t/1672",[94,3.983,142,4.907]],["t/1674",[38,2.978,143,3.264,144,3.264,145,3.264]],["t/1677",[15,4.477,146,4.907]],["t/1679",[25,2.125,122,2.79,147,3.264,148,3.264]],["t/1681",[1,2.444,40,2.79,149,3.264,150,3.264]],["t/1683",[24,2.65,65,2.232,151,3.264,152,2.65]],["t/1685",[49,2.125,115,2.294,153,2.978,154,2.978]],["t/1687",[115,2.755,155,3.92,156,3.92]],["t/1689",[1,1.831,63,1.901,115,1.719,154,2.231,157,2.445,158,2.445]],["t/1692",[152,3.983,159,4.907]],["t/1694",[31,1.629,65,2.681,152,3.182]],["t/1696",[25,2.552,65,2.681,152,3.182]],["t/1699",[25,2.552,94,3.182,160,3.92]],["t/1701",[88,5.983]],["t/1705",[161,5.606]],["t/1707",[65,3.355,68,4.195]],["t/1711",[118,4.91]],["t/1713",[162,6.557]],["t/1715",[163,6.557]],["t/1717",[164,6.557]],["t/1719",[165,6.557]],["t/1721",[166,6.557]],["t/1723",[167,6.557]],["t/1725",[168,6.557]],["t/1727",[169,6.557]],["t/1730",[65,4.484]],["t/1732",[161,5.606]],["t/1734",[170,6.557]],["t/1736",[171,6.557]],["t/1738",[2,4.91]],["t/1740",[68,5.606]],["t/1743",[49,3.195,172,4.907]],["t/1745",[153,5.983]],["t/1748",[173,4.907,174,4.907]],["t/1753",[175,6.557]],["t/1755",[176,6.557]],["t/1757",[116,5.983]],["t/1759",[177,6.557]],["t/1761",[178,6.557]],["t/1763",[179,6.557]],["t/1765",[180,6.557]],["t/1767",[93,5.983]],["t/1769",[181,6.557]],["t/1771",[182,6.557]],["t/1773",[183,6.557]],["t/1775",[17,5.606]],["t/1777",[87,5.323]],["t/1779",[87,5.323]],["t/1781",[184,6.557]],["t/1783",[185,6.557]],["t/1785",[186,6.557]],["t/1787",[187,6.557]],["t/1789",[188,6.557]],["t/1791",[]],["t/1793",[189,6.557]],["t/1795",[190,5.983]],["t/1797",[190,5.983]],["t/1799",[191,6.557]],["t/1801",[192,6.557]],["t/1803",[193,5.983]],["t/1805",[193,5.983]],["t/1807",[]],["t/1809",[194,6.557]],["t/1811",[94,5.323]],["t/1813",[195,6.557]],["t/1815",[196,6.557]],["t/1817",[197,6.557]],["t/1819",[198,6.557]],["t/1821",[199,6.557]],["t/1823",[97,5.983]],["t/1825",[200,6.557]],["t/1827",[201,6.557]],["t/1829",[202,6.557]],["t/1831",[203,6.557]],["t/1833",[204,6.557]],["t/1835",[161,5.606]],["t/1837",[205,6.557]],["t/1839",[140,5.323]],["t/1841",[140,5.323]],["t/1843",[206,6.557]],["t/1845",[207,6.557]],["t/1847",[208,6.557]],["t/1849",[209,6.557]],["t/1851",[210,6.557]],["t/1853",[211,6.557]],["t/1855",[212,6.557]],["t/1857",[213,6.557]],["t/1859",[214,6.557]],["t/1861",[82,5.606]],["t/1863",[215,6.557]],["t/1865",[122,5.606]],["t/1867",[216,6.557]],["t/1869",[63,5.098]],["t/1871",[217,6.557]],["t/1873",[218,6.557]],["t/1875",[219,6.557]],["t/1877",[220,6.557]],["t/1879",[221,6.557]],["t/1881",[222,6.557]],["t/1883",[24,5.323]],["t/1885",[223,6.557]],["t/1887",[224,6.557]],["t/1889",[225,6.557]],["t/1891",[226,6.557]],["t/1893",[227,6.557]],["t/1895",[27,5.983]],["t/1897",[228,6.557]],["t/1899",[229,6.557]],["t/1901",[230,6.557]],["t/1903",[231,6.557]],["t/1905",[232,6.557]],["t/1907",[233,6.557]],["t/1909",[95,5.983]]],"invertedIndex":[["",{"_index":1,"t":{"724":{"position":[[0,2]]},"873":{"position":[[0,2]]},"875":{"position":[[0,2]]},"1271":{"position":[[0,1]]},"1681":{"position":[[26,1]]},"1689":{"position":[[38,1]]}}}],["1.16",{"_index":42,"t":{"1153":{"position":[[27,6]]}}}],["404",{"_index":148,"t":{"1679":{"position":[[23,3]]}}}],["accept",{"_index":175,"t":{"1753":{"position":[[0,7]]}}}],["access",{"_index":16,"t":{"774":{"position":[[0,9]]}}}],["action",{"_index":54,"t":{"1181":{"position":[[9,7]]}}}],["add",{"_index":84,"t":{"1277":{"position":[[0,3]]}}}],["agent",{"_index":83,"t":{"1271":{"position":[[2,5]]}}}],["alloc",{"_index":60,"t":{"1211":{"position":[[5,10]]}}}],["allparam",{"_index":176,"t":{"1755":{"position":[[0,9]]}}}],["app",{"_index":116,"t":{"1357":{"position":[[6,3]]},"1757":{"position":[[0,3]]}}}],["append",{"_index":177,"t":{"1759":{"position":[[0,6]]}}}],["applic",{"_index":15,"t":{"762":{"position":[[30,11]]},"1677":{"position":[[26,12]]}}}],["attach",{"_index":178,"t":{"1761":{"position":[[0,10]]}}}],["authent",{"_index":129,"t":{"1535":{"position":[[0,12]]}}}],["baseurl",{"_index":179,"t":{"1763":{"position":[[0,7]]}}}],["basic",{"_index":39,"t":{"1143":{"position":[[0,5]]},"1147":{"position":[[0,5]]},"1151":{"position":[[0,5]]},"1159":{"position":[[0,5]]},"1163":{"position":[[0,5]]},"1193":{"position":[[0,5]]},"1197":{"position":[[0,5]]},"1201":{"position":[[0,5]]},"1205":{"position":[[0,5]]},"1215":{"position":[[0,5]]}}}],["basicauth",{"_index":92,"t":{"1293":{"position":[[0,9]]}}}],["beforesend",{"_index":18,"t":{"774":{"position":[[21,10]]}}}],["benchmark",{"_index":38,"t":{"1139":{"position":[[0,10]]},"1674":{"position":[[17,9]]}}}],["bind",{"_index":180,"t":{"1765":{"position":[[0,4]]}}}],["bodi",{"_index":93,"t":{"1295":{"position":[[0,4]]},"1767":{"position":[[0,4]]}}}],["bodypars",{"_index":181,"t":{"1769":{"position":[[0,10]]}}}],["byte",{"_index":108,"t":{"1327":{"position":[[0,5]]}}}],["cach",{"_index":33,"t":{"870":{"position":[[10,5]]}}}],["call",{"_index":58,"t":{"1189":{"position":[[10,7]]}}}],["callback",{"_index":19,"t":{"774":{"position":[[32,8]]}}}],["catch",{"_index":159,"t":{"1692":{"position":[[0,8]]}}}],["certain",{"_index":130,"t":{"1535":{"position":[[18,7]]}}}],["chat",{"_index":156,"t":{"1687":{"position":[[28,5]]}}}],["clearcooki",{"_index":182,"t":{"1771":{"position":[[0,11]]}}}],["clienthelloinfo",{"_index":183,"t":{"1773":{"position":[[0,15]]}}}],["commun",{"_index":155,"t":{"1687":{"position":[[18,9]]}}}],["comparison",{"_index":55,"t":{"1185":{"position":[[9,10]]}}}],["config",{"_index":6,"t":{"732":{"position":[[0,6]]},"748":{"position":[[0,6]]},"758":{"position":[[0,6]]},"770":{"position":[[0,6]]},"782":{"position":[[0,6]]},"792":{"position":[[0,6]]},"802":{"position":[[0,6]]},"822":{"position":[[0,6]]},"834":{"position":[[0,6]]},"848":{"position":[[0,6]]},"860":{"position":[[8,6]]},"862":{"position":[[7,6]]},"887":{"position":[[0,6]]},"889":{"position":[[8,6]]},"901":{"position":[[0,6]]},"903":{"position":[[8,6]]},"915":{"position":[[0,6]]},"917":{"position":[[8,6]]},"929":{"position":[[0,6]]},"931":{"position":[[8,6]]},"943":{"position":[[0,6]]},"945":{"position":[[8,6]]},"957":{"position":[[0,6]]},"959":{"position":[[8,6]]},"971":{"position":[[0,6]]},"973":{"position":[[8,6]]},"985":{"position":[[0,6]]},"987":{"position":[[8,6]]},"999":{"position":[[0,6]]},"1001":{"position":[[8,6]]},"1013":{"position":[[0,6]]},"1015":{"position":[[8,6]]},"1027":{"position":[[0,6]]},"1029":{"position":[[8,6]]},"1041":{"position":[[0,6]]},"1043":{"position":[[8,6]]},"1055":{"position":[[0,6]]},"1057":{"position":[[8,6]]},"1069":{"position":[[0,6]]},"1071":{"position":[[8,6]]},"1083":{"position":[[0,6]]},"1085":{"position":[[8,6]]},"1097":{"position":[[0,6]]},"1099":{"position":[[8,6]]},"1111":{"position":[[0,6]]},"1113":{"position":[[8,6]]},"1125":{"position":[[0,6]]},"1127":{"position":[[8,6]]},"1248":{"position":[[0,6]]},"1340":{"position":[[0,6]]},"1367":{"position":[[0,6]]},"1369":{"position":[[8,6]]},"1377":{"position":[[0,6]]},"1379":{"position":[[8,6]]},"1387":{"position":[[0,6]]},"1389":{"position":[[8,6]]},"1399":{"position":[[0,6]]},"1401":{"position":[[8,6]]},"1409":{"position":[[0,6]]},"1411":{"position":[[8,6]]},"1423":{"position":[[0,6]]},"1425":{"position":[[8,6]]},"1435":{"position":[[0,6]]},"1437":{"position":[[8,6]]},"1449":{"position":[[0,6]]},"1451":{"position":[[8,6]]},"1459":{"position":[[0,6]]},"1461":{"position":[[8,6]]},"1469":{"position":[[0,6]]},"1471":{"position":[[8,6]]},"1479":{"position":[[0,6]]},"1481":{"position":[[8,6]]},"1501":{"position":[[0,6]]},"1503":{"position":[[8,6]]},"1511":{"position":[[0,6]]},"1513":{"position":[[8,6]]},"1521":{"position":[[8,6]]},"1523":{"position":[[7,6]]},"1525":{"position":[[0,6]]},"1527":{"position":[[8,6]]},"1539":{"position":[[0,6]]},"1541":{"position":[[8,6]]},"1551":{"position":[[0,6]]},"1553":{"position":[[8,6]]},"1563":{"position":[[0,6]]},"1565":{"position":[[8,6]]},"1575":{"position":[[0,6]]},"1577":{"position":[[8,6]]},"1585":{"position":[[0,6]]},"1587":{"position":[[8,6]]},"1595":{"position":[[0,6]]},"1597":{"position":[[8,6]]},"1605":{"position":[[0,6]]},"1607":{"position":[[8,6]]},"1615":{"position":[[0,6]]},"1617":{"position":[[8,6]]},"1625":{"position":[[0,6]]},"1627":{"position":[[8,6]]},"1641":{"position":[[0,6]]},"1643":{"position":[[8,6]]}}}],["connectionclos",{"_index":85,"t":{"1279":{"position":[[0,15]]}}}],["constant",{"_index":118,"t":{"1391":{"position":[[0,9]]},"1413":{"position":[[0,9]]},"1427":{"position":[[0,9]]},"1567":{"position":[[0,9]]},"1645":{"position":[[0,9]]},"1711":{"position":[[0,9]]}}}],["constraint",{"_index":171,"t":{"1736":{"position":[[0,11]]}}}],["content",{"_index":30,"t":{"854":{"position":[[9,8]]},"879":{"position":[[9,8]]},"893":{"position":[[9,8]]},"907":{"position":[[9,8]]},"921":{"position":[[9,8]]},"935":{"position":[[9,8]]},"949":{"position":[[9,8]]},"963":{"position":[[9,8]]},"977":{"position":[[9,8]]},"991":{"position":[[9,8]]},"1005":{"position":[[9,8]]},"1019":{"position":[[9,8]]},"1033":{"position":[[9,8]]},"1047":{"position":[[9,8]]},"1061":{"position":[[9,8]]},"1075":{"position":[[9,8]]},"1089":{"position":[[9,8]]},"1103":{"position":[[9,8]]},"1117":{"position":[[9,8]]},"1171":{"position":[[9,8]]}}}],["contenttyp",{"_index":89,"t":{"1287":{"position":[[0,11]]}}}],["context",{"_index":17,"t":{"774":{"position":[[10,7]]},"1359":{"position":[[6,7]]},"1775":{"position":[[0,7]]}}}],["contrib",{"_index":0,"t":{"722":{"position":[[0,7]]}}}],["cooki",{"_index":87,"t":{"1283":{"position":[[0,6]]},"1439":{"position":[[56,6]]},"1777":{"position":[[0,6]]},"1779":{"position":[[0,7]]}}}],["creat",{"_index":48,"t":{"1173":{"position":[[12,8]]}}}],["csrf",{"_index":120,"t":{"1439":{"position":[[9,4]]}}}],["custom",{"_index":25,"t":{"814":{"position":[[0,6]]},"862":{"position":[[0,6]]},"1155":{"position":[[17,6]]},"1415":{"position":[[0,6]]},"1439":{"position":[[49,6]]},"1523":{"position":[[0,6]]},"1555":{"position":[[0,6]]},"1647":{"position":[[0,6]]},"1679":{"position":[[16,6]]},"1696":{"position":[[0,6]]},"1699":{"position":[[0,6]]}}}],["custompermiss",{"_index":8,"t":{"736":{"position":[[0,16]]}}}],["data",{"_index":137,"t":{"1666":{"position":[[0,4]]}}}],["debug",{"_index":98,"t":{"1305":{"position":[[0,5]]}}}],["default",{"_index":31,"t":{"860":{"position":[[0,7]]},"889":{"position":[[0,7]]},"903":{"position":[[0,7]]},"917":{"position":[[0,7]]},"931":{"position":[[0,7]]},"945":{"position":[[0,7]]},"959":{"position":[[0,7]]},"973":{"position":[[0,7]]},"987":{"position":[[0,7]]},"1001":{"position":[[0,7]]},"1015":{"position":[[0,7]]},"1029":{"position":[[0,7]]},"1043":{"position":[[0,7]]},"1057":{"position":[[0,7]]},"1071":{"position":[[0,7]]},"1085":{"position":[[0,7]]},"1099":{"position":[[0,7]]},"1113":{"position":[[0,7]]},"1127":{"position":[[0,7]]},"1369":{"position":[[0,7]]},"1379":{"position":[[0,7]]},"1389":{"position":[[0,7]]},"1401":{"position":[[0,7]]},"1411":{"position":[[0,7]]},"1425":{"position":[[0,7]]},"1437":{"position":[[0,7]]},"1451":{"position":[[0,7]]},"1461":{"position":[[0,7]]},"1471":{"position":[[0,7]]},"1481":{"position":[[0,7]]},"1503":{"position":[[0,7]]},"1513":{"position":[[0,7]]},"1521":{"position":[[0,7]]},"1527":{"position":[[0,7]]},"1541":{"position":[[0,7]]},"1553":{"position":[[0,7]]},"1565":{"position":[[0,7]]},"1577":{"position":[[0,7]]},"1587":{"position":[[0,7]]},"1597":{"position":[[0,7]]},"1607":{"position":[[0,7]]},"1617":{"position":[[0,7]]},"1627":{"position":[[0,7]]},"1643":{"position":[[0,7]]},"1694":{"position":[[0,7]]}}}],["dest",{"_index":107,"t":{"1325":{"position":[[0,4]]}}}],["domain",{"_index":158,"t":{"1689":{"position":[[23,6]]}}}],["download",{"_index":184,"t":{"1781":{"position":[[0,8]]}}}],["emb",{"_index":123,"t":{"1489":{"position":[[0,5]]}}}],["embed",{"_index":36,"t":{"1137":{"position":[[0,8]]},"1153":{"position":[[6,8]]}}}],["embed.f",{"_index":45,"t":{"1165":{"position":[[13,8]]}}}],["encod",{"_index":51,"t":{"1177":{"position":[[9,8]]}}}],["encoder/decod",{"_index":160,"t":{"1699":{"position":[[12,15]]}}}],["encryptcooki",{"_index":121,"t":{"1439":{"position":[[18,13]]}}}],["endpoint",{"_index":131,"t":{"1535":{"position":[[26,9]]}}}],["engin",{"_index":153,"t":{"1685":{"position":[[15,7]]},"1745":{"position":[[0,7]]}}}],["error",{"_index":152,"t":{"1683":{"position":[[19,5]]},"1692":{"position":[[9,6]]},"1694":{"position":[[8,5]]},"1696":{"position":[[7,5]]}}}],["exampl",{"_index":7,"t":{"734":{"position":[[0,8]]},"750":{"position":[[0,7]]},"784":{"position":[[0,7]]},"794":{"position":[[0,7]]},"804":{"position":[[6,7]]},"808":{"position":[[6,7]]},"814":{"position":[[15,7]]},"838":{"position":[[0,7]]},"858":{"position":[[0,8]]},"868":{"position":[[0,7]]},"885":{"position":[[0,8]]},"899":{"position":[[0,8]]},"913":{"position":[[0,8]]},"927":{"position":[[0,8]]},"941":{"position":[[0,8]]},"955":{"position":[[0,8]]},"969":{"position":[[0,8]]},"983":{"position":[[0,8]]},"997":{"position":[[0,8]]},"1011":{"position":[[0,8]]},"1025":{"position":[[0,8]]},"1039":{"position":[[0,8]]},"1053":{"position":[[0,8]]},"1067":{"position":[[0,8]]},"1081":{"position":[[0,8]]},"1095":{"position":[[0,8]]},"1109":{"position":[[0,8]]},"1123":{"position":[[0,8]]},"1133":{"position":[[0,7]]},"1135":{"position":[[5,8]]},"1143":{"position":[[6,7]]},"1147":{"position":[[6,7]]},"1151":{"position":[[6,7]]},"1159":{"position":[[6,7]]},"1163":{"position":[[6,7]]},"1165":{"position":[[0,7]]},"1167":{"position":[[0,7]]},"1193":{"position":[[6,7]]},"1197":{"position":[[6,7]]},"1201":{"position":[[6,7]]},"1205":{"position":[[6,7]]},"1350":{"position":[[0,8]]},"1365":{"position":[[0,8]]},"1375":{"position":[[0,8]]},"1385":{"position":[[0,8]]},"1397":{"position":[[0,8]]},"1407":{"position":[[0,8]]},"1421":{"position":[[0,8]]},"1433":{"position":[[0,8]]},"1445":{"position":[[0,8]]},"1457":{"position":[[0,8]]},"1467":{"position":[[0,8]]},"1477":{"position":[[0,8]]},"1487":{"position":[[0,8]]},"1509":{"position":[[0,8]]},"1519":{"position":[[0,8]]},"1533":{"position":[[0,8]]},"1547":{"position":[[0,8]]},"1561":{"position":[[0,8]]},"1573":{"position":[[0,8]]},"1583":{"position":[[0,8]]},"1593":{"position":[[0,8]]},"1603":{"position":[[0,8]]},"1613":{"position":[[0,8]]},"1623":{"position":[[0,8]]},"1633":{"position":[[0,8]]},"1639":{"position":[[0,8]]},"1653":{"position":[[0,8]]},"1659":{"position":[[0,8]]}}}],["execut",{"_index":50,"t":{"1175":{"position":[[0,9]]}}}],["exist",{"_index":12,"t":{"762":{"position":[[11,8]]}}}],["fiber",{"_index":115,"t":{"1351":{"position":[[12,5]]},"1353":{"position":[[23,5]]},"1355":{"position":[[0,5]]},"1357":{"position":[[0,5]]},"1359":{"position":[[0,5]]},"1685":{"position":[[28,5]]},"1687":{"position":[[5,5]]},"1689":{"position":[[5,5]]}}}],["file",{"_index":41,"t":{"1153":{"position":[[15,4]]},"1217":{"position":[[7,5]]}}}],["fileb0x",{"_index":127,"t":{"1497":{"position":[[0,7]]}}}],["form",{"_index":96,"t":{"1301":{"position":[[0,4]]}}}],["format",{"_index":185,"t":{"1783":{"position":[[0,6]]}}}],["formfil",{"_index":186,"t":{"1785":{"position":[[0,8]]}}}],["formvalu",{"_index":187,"t":{"1787":{"position":[[0,9]]}}}],["framework",{"_index":145,"t":{"1674":{"position":[[7,9]]}}}],["fresh",{"_index":188,"t":{"1789":{"position":[[0,5]]}}}],["function",{"_index":44,"t":{"1155":{"position":[[24,9]]},"1183":{"position":[[9,9]]},"1185":{"position":[[20,9]]},"1189":{"position":[[18,9]]}}}],["getreqhead",{"_index":189,"t":{"1793":{"position":[[0,13]]}}}],["getresphead",{"_index":190,"t":{"1795":{"position":[[0,13]]},"1797":{"position":[[0,14]]}}}],["getrout",{"_index":74,"t":{"1244":{"position":[[0,8]]},"1246":{"position":[[0,9]]}}}],["getrouteurl",{"_index":191,"t":{"1799":{"position":[[0,11]]}}}],["go",{"_index":143,"t":{"1674":{"position":[[0,2]]}}}],["go.ric",{"_index":126,"t":{"1495":{"position":[[0,7]]}}}],["group",{"_index":68,"t":{"1230":{"position":[[0,5]]},"1707":{"position":[[0,5]]},"1740":{"position":[[0,8]]}}}],["handl",{"_index":147,"t":{"1679":{"position":[[9,6]]}}}],["handler",{"_index":65,"t":{"1224":{"position":[[6,8]]},"1250":{"position":[[0,7]]},"1355":{"position":[[6,7]]},"1537":{"position":[[29,7]]},"1683":{"position":[[25,8]]},"1694":{"position":[[14,7]]},"1696":{"position":[[13,7]]},"1707":{"position":[[6,8]]},"1730":{"position":[[0,8]]}}}],["handlerscount",{"_index":71,"t":{"1238":{"position":[[0,13]]}}}],["hello",{"_index":61,"t":{"1213":{"position":[[0,6]]}}}],["hook",{"_index":80,"t":{"1266":{"position":[[0,5]]}}}],["host",{"_index":90,"t":{"1289":{"position":[[0,4]]}}}],["hostnam",{"_index":192,"t":{"1801":{"position":[[0,8]]}}}],["hs256",{"_index":20,"t":{"804":{"position":[[0,5]]},"806":{"position":[[0,5]]}}}],["html",{"_index":52,"t":{"1177":{"position":[[22,4]]}}}],["implement",{"_index":3,"t":{"724":{"position":[[14,15]]},"875":{"position":[[11,15]]}}}],["innerhtml",{"_index":46,"t":{"1167":{"position":[[13,9]]}}}],["insecureskipverifi",{"_index":101,"t":{"1311":{"position":[[0,18]]}}}],["instal",{"_index":4,"t":{"728":{"position":[[0,7]]},"744":{"position":[[0,7]]},"754":{"position":[[0,7]]},"766":{"position":[[0,7]]},"778":{"position":[[0,7]]},"788":{"position":[[0,7]]},"798":{"position":[[0,7]]},"818":{"position":[[0,7]]},"830":{"position":[[0,7]]},"844":{"position":[[0,7]]},"866":{"position":[[0,7]]},"883":{"position":[[0,12]]},"897":{"position":[[0,12]]},"911":{"position":[[0,12]]},"925":{"position":[[0,12]]},"939":{"position":[[0,12]]},"953":{"position":[[0,12]]},"967":{"position":[[0,12]]},"981":{"position":[[0,12]]},"995":{"position":[[0,12]]},"1009":{"position":[[0,12]]},"1023":{"position":[[0,12]]},"1037":{"position":[[0,12]]},"1051":{"position":[[0,12]]},"1065":{"position":[[0,12]]},"1079":{"position":[[0,12]]},"1093":{"position":[[0,12]]},"1107":{"position":[[0,12]]},"1121":{"position":[[0,12]]},"1131":{"position":[[0,12]]},"1209":{"position":[[0,12]]}}}],["instruct",{"_index":28,"t":{"850":{"position":[[0,12]]}}}],["interfac",{"_index":172,"t":{"1743":{"position":[[9,10]]}}}],["ip",{"_index":193,"t":{"1803":{"position":[[0,2]]},"1805":{"position":[[0,3]]}}}],["ischild",{"_index":113,"t":{"1344":{"position":[[0,7]]}}}],["isfromloc",{"_index":194,"t":{"1809":{"position":[[0,11]]}}}],["json",{"_index":94,"t":{"1297":{"position":[[0,4]]},"1672":{"position":[[0,4]]},"1699":{"position":[[7,4]]},"1811":{"position":[[0,4]]}}}],["jsondecod",{"_index":105,"t":{"1319":{"position":[[0,11]]}}}],["jsonencod",{"_index":104,"t":{"1317":{"position":[[0,11]]}}}],["jsonp",{"_index":195,"t":{"1813":{"position":[[0,5]]}}}],["jwk",{"_index":23,"t":{"812":{"position":[[0,3]]}}}],["keyfunc",{"_index":26,"t":{"814":{"position":[[7,7]]}}}],["layout",{"_index":57,"t":{"1187":{"position":[[21,7]]}}}],["link",{"_index":196,"t":{"1815":{"position":[[0,5]]}}}],["listen",{"_index":75,"t":{"1252":{"position":[[0,6]]},"1262":{"position":[[0,8]]}}}],["listenmutualtl",{"_index":78,"t":{"1258":{"position":[[0,15]]}}}],["listenmutualtlswithcertif",{"_index":79,"t":{"1260":{"position":[[0,30]]}}}],["listentl",{"_index":76,"t":{"1254":{"position":[[0,9]]}}}],["listentlswithcertif",{"_index":77,"t":{"1256":{"position":[[0,24]]}}}],["live",{"_index":149,"t":{"1681":{"position":[[14,4]]}}}],["local",{"_index":197,"t":{"1817":{"position":[[0,6]]}}}],["locat",{"_index":198,"t":{"1819":{"position":[[0,8]]}}}],["maxredirectscount",{"_index":103,"t":{"1315":{"position":[[0,17]]}}}],["method",{"_index":199,"t":{"1821":{"position":[[0,6]]}}}],["middlewar",{"_index":2,"t":{"724":{"position":[[3,10]]},"870":{"position":[[16,10]]},"1353":{"position":[[9,10]]},"1439":{"position":[[32,11]]},"1537":{"position":[[11,10]]},"1738":{"position":[[0,10]]}}}],["more",{"_index":35,"t":{"1135":{"position":[[0,4]]}}}],["mount",{"_index":66,"t":{"1226":{"position":[[0,5]]}}}],["mountpath",{"_index":67,"t":{"1228":{"position":[[0,9]]}}}],["multipartform",{"_index":97,"t":{"1303":{"position":[[0,13]]},"1823":{"position":[[0,13]]}}}],["multipl",{"_index":139,"t":{"1668":{"position":[[0,8]]}}}],["name",{"_index":73,"t":{"1242":{"position":[[0,4]]},"1439":{"position":[[63,5]]}}}],["nest",{"_index":56,"t":{"1187":{"position":[[0,6]]}}}],["net/http",{"_index":114,"t":{"1351":{"position":[[0,8]]},"1353":{"position":[[0,8]]},"1355":{"position":[[17,8]]},"1357":{"position":[[13,8]]}}}],["net/http).request",{"_index":117,"t":{"1359":{"position":[[17,18]]}}}],["new",{"_index":13,"t":{"762":{"position":[[20,3]]},"1338":{"position":[[0,3]]}}}],["newerror",{"_index":112,"t":{"1342":{"position":[[0,8]]}}}],["next",{"_index":200,"t":{"1825":{"position":[[0,4]]}}}],["note",{"_index":32,"t":{"870":{"position":[[0,4]]},"1219":{"position":[[0,4]]}}}],["onfork",{"_index":167,"t":{"1723":{"position":[[0,6]]}}}],["ongroup",{"_index":164,"t":{"1717":{"position":[[0,7]]}}}],["ongroupnam",{"_index":165,"t":{"1719":{"position":[[0,11]]}}}],["onlisten",{"_index":166,"t":{"1721":{"position":[[0,8]]}}}],["onmount",{"_index":169,"t":{"1727":{"position":[[0,7]]}}}],["onnam",{"_index":163,"t":{"1715":{"position":[[0,6]]}}}],["onrout",{"_index":162,"t":{"1713":{"position":[[0,7]]}}}],["onshutdown",{"_index":168,"t":{"1725":{"position":[[0,10]]}}}],["originalurl",{"_index":201,"t":{"1827":{"position":[[0,11]]}}}],["packag",{"_index":174,"t":{"1748":{"position":[[10,7]]}}}],["packr",{"_index":125,"t":{"1493":{"position":[[0,5]]}}}],["param",{"_index":202,"t":{"1829":{"position":[[0,6]]}}}],["paramet",{"_index":170,"t":{"1734":{"position":[[0,10]]}}}],["paramsint",{"_index":203,"t":{"1831":{"position":[[0,9]]}}}],["paramspars",{"_index":204,"t":{"1833":{"position":[[0,12]]}}}],["pars",{"_index":47,"t":{"1173":{"position":[[0,7]]},"1273":{"position":[[0,5]]}}}],["path",{"_index":161,"t":{"1705":{"position":[[0,5]]},"1732":{"position":[[0,5]]},"1835":{"position":[[0,4]]}}}],["pkger",{"_index":124,"t":{"1491":{"position":[[0,5]]}}}],["plaintext",{"_index":136,"t":{"1664":{"position":[[0,9]]}}}],["protocol",{"_index":205,"t":{"1837":{"position":[[0,8]]}}}],["queri",{"_index":140,"t":{"1668":{"position":[[9,7]]},"1670":{"position":[[7,5]]},"1839":{"position":[[0,7]]},"1841":{"position":[[0,5]]}}}],["querybool",{"_index":206,"t":{"1843":{"position":[[0,9]]}}}],["queryfloat",{"_index":207,"t":{"1845":{"position":[[0,10]]}}}],["queryint",{"_index":208,"t":{"1847":{"position":[[0,8]]}}}],["querypars",{"_index":209,"t":{"1849":{"position":[[0,11]]}}}],["querystr",{"_index":91,"t":{"1291":{"position":[[0,11]]}}}],["rang",{"_index":210,"t":{"1851":{"position":[[0,5]]}}}],["redirect",{"_index":211,"t":{"1853":{"position":[[0,8]]}}}],["redirectback",{"_index":213,"t":{"1857":{"position":[[0,12]]}}}],["redirecttorout",{"_index":212,"t":{"1855":{"position":[[0,15]]}}}],["refer",{"_index":88,"t":{"1285":{"position":[[0,7]]},"1701":{"position":[[0,10]]}}}],["regist",{"_index":43,"t":{"1155":{"position":[[0,8]]}}}],["relic",{"_index":14,"t":{"762":{"position":[[24,5]]}}}],["reload",{"_index":150,"t":{"1681":{"position":[[19,6]]}}}],["render",{"_index":214,"t":{"1859":{"position":[[0,6]]}}}],["reqheaderpars",{"_index":215,"t":{"1863":{"position":[[0,15]]}}}],["request",{"_index":82,"t":{"1269":{"position":[[6,7]]},"1321":{"position":[[0,7]]},"1861":{"position":[[0,7]]}}}],["respons",{"_index":122,"t":{"1447":{"position":[[0,8]]},"1679":{"position":[[27,10]]},"1865":{"position":[[0,8]]}}}],["restartrout",{"_index":216,"t":{"1867":{"position":[[0,14]]}}}],["retryif",{"_index":111,"t":{"1333":{"position":[[0,7]]}}}],["reus",{"_index":100,"t":{"1309":{"position":[[0,5]]}}}],["roleauthor",{"_index":10,"t":{"740":{"position":[[0,17]]}}}],["rout",{"_index":63,"t":{"1215":{"position":[[6,7]]},"1224":{"position":[[0,5]]},"1232":{"position":[[0,5]]},"1689":{"position":[[30,7]]},"1869":{"position":[[0,5]]}}}],["routepermiss",{"_index":9,"t":{"738":{"position":[[0,15]]}}}],["rs256",{"_index":22,"t":{"808":{"position":[[0,5]]},"810":{"position":[[0,5]]}}}],["savefil",{"_index":217,"t":{"1871":{"position":[[0,8]]}}}],["savefiletostorag",{"_index":218,"t":{"1873":{"position":[[0,17]]}}}],["secur",{"_index":219,"t":{"1875":{"position":[[0,6]]}}}],["send",{"_index":220,"t":{"1877":{"position":[[0,4]]}}}],["sendfil",{"_index":221,"t":{"1879":{"position":[[0,8]]}}}],["sendstatu",{"_index":222,"t":{"1881":{"position":[[0,10]]}}}],["serial",{"_index":142,"t":{"1672":{"position":[[5,13]]}}}],["server",{"_index":69,"t":{"1234":{"position":[[0,6]]},"1236":{"position":[[0,6]]}}}],["set",{"_index":24,"t":{"812":{"position":[[4,3]]},"1275":{"position":[[0,3]]},"1683":{"position":[[9,3]]},"1883":{"position":[[0,3]]}}}],["setparserdecod",{"_index":223,"t":{"1885":{"position":[[0,16]]}}}],["setrespons",{"_index":106,"t":{"1323":{"position":[[0,11]]}}}],["setusercontext",{"_index":224,"t":{"1887":{"position":[[0,14]]}}}],["shutdown",{"_index":70,"t":{"1236":{"position":[[7,8]]}}}],["signatur",{"_index":5,"t":{"730":{"position":[[0,9]]},"746":{"position":[[0,9]]},"756":{"position":[[0,9]]},"768":{"position":[[0,9]]},"780":{"position":[[0,9]]},"790":{"position":[[0,9]]},"800":{"position":[[0,9]]},"820":{"position":[[0,9]]},"832":{"position":[[0,9]]},"846":{"position":[[0,9]]},"856":{"position":[[0,10]]},"881":{"position":[[0,10]]},"895":{"position":[[0,10]]},"909":{"position":[[0,10]]},"923":{"position":[[0,10]]},"937":{"position":[[0,10]]},"951":{"position":[[0,10]]},"965":{"position":[[0,10]]},"979":{"position":[[0,10]]},"993":{"position":[[0,10]]},"1007":{"position":[[0,10]]},"1021":{"position":[[0,10]]},"1035":{"position":[[0,10]]},"1049":{"position":[[0,10]]},"1063":{"position":[[0,10]]},"1077":{"position":[[0,10]]},"1091":{"position":[[0,10]]},"1105":{"position":[[0,10]]},"1119":{"position":[[0,10]]},"1348":{"position":[[0,10]]},"1363":{"position":[[0,10]]},"1373":{"position":[[0,10]]},"1383":{"position":[[0,10]]},"1395":{"position":[[0,10]]},"1405":{"position":[[0,10]]},"1419":{"position":[[0,10]]},"1431":{"position":[[0,10]]},"1443":{"position":[[0,10]]},"1455":{"position":[[0,10]]},"1465":{"position":[[0,10]]},"1475":{"position":[[0,10]]},"1485":{"position":[[0,10]]},"1507":{"position":[[0,10]]},"1517":{"position":[[0,10]]},"1531":{"position":[[0,10]]},"1545":{"position":[[0,10]]},"1559":{"position":[[0,10]]},"1571":{"position":[[0,10]]},"1581":{"position":[[0,10]]},"1591":{"position":[[0,10]]},"1601":{"position":[[0,10]]},"1611":{"position":[[0,10]]},"1621":{"position":[[0,10]]},"1631":{"position":[[0,10]]},"1637":{"position":[[0,10]]},"1651":{"position":[[0,10]]},"1657":{"position":[[0,10]]}}}],["singl",{"_index":141,"t":{"1670":{"position":[[0,6]]}}}],["slide",{"_index":133,"t":{"1549":{"position":[[0,7]]}}}],["specifi",{"_index":132,"t":{"1537":{"position":[[0,10]]}}}],["stack",{"_index":72,"t":{"1240":{"position":[[0,5]]}}}],["stale",{"_index":225,"t":{"1889":{"position":[[0,5]]}}}],["start",{"_index":81,"t":{"1269":{"position":[[0,5]]}}}],["static",{"_index":64,"t":{"1217":{"position":[[0,6]]},"1222":{"position":[[0,6]]}}}],["statik",{"_index":128,"t":{"1499":{"position":[[0,6]]}}}],["statu",{"_index":226,"t":{"1891":{"position":[[0,6]]}}}],["storag",{"_index":34,"t":{"873":{"position":[[3,7]]},"875":{"position":[[3,7]]}}}],["storage/databas",{"_index":119,"t":{"1415":{"position":[[7,16]]},"1555":{"position":[[7,16]]},"1647":{"position":[[7,16]]}}}],["string",{"_index":109,"t":{"1329":{"position":[[0,6]]}}}],["struct",{"_index":110,"t":{"1331":{"position":[[0,6]]}}}],["structur",{"_index":146,"t":{"1677":{"position":[[13,9]]}}}],["sub",{"_index":157,"t":{"1689":{"position":[[19,3]]}}}],["subdomain",{"_index":227,"t":{"1893":{"position":[[0,10]]}}}],["support",{"_index":154,"t":{"1685":{"position":[[34,8]]},"1689":{"position":[[11,7]]}}}],["system",{"_index":37,"t":{"1137":{"position":[[9,7]]},"1153":{"position":[[20,6]]}}}],["tabl",{"_index":29,"t":{"854":{"position":[[0,5]]},"879":{"position":[[0,5]]},"893":{"position":[[0,5]]},"907":{"position":[[0,5]]},"921":{"position":[[0,5]]},"935":{"position":[[0,5]]},"949":{"position":[[0,5]]},"963":{"position":[[0,5]]},"977":{"position":[[0,5]]},"991":{"position":[[0,5]]},"1005":{"position":[[0,5]]},"1019":{"position":[[0,5]]},"1033":{"position":[[0,5]]},"1047":{"position":[[0,5]]},"1061":{"position":[[0,5]]},"1075":{"position":[[0,5]]},"1089":{"position":[[0,5]]},"1103":{"position":[[0,5]]},"1117":{"position":[[0,5]]},"1171":{"position":[[0,5]]}}}],["techempow",{"_index":135,"t":{"1662":{"position":[[0,11]]}}}],["templat",{"_index":49,"t":{"1173":{"position":[[21,9]]},"1175":{"position":[[10,9]]},"1177":{"position":[[0,8]]},"1179":{"position":[[0,8]]},"1181":{"position":[[0,8]]},"1183":{"position":[[0,8]]},"1185":{"position":[[0,8]]},"1187":{"position":[[7,9]]},"1189":{"position":[[0,9]]},"1685":{"position":[[6,8]]},"1743":{"position":[[0,8]]}}}],["test",{"_index":21,"t":{"806":{"position":[[6,4]]},"810":{"position":[[6,4]]},"812":{"position":[[8,4]]},"1264":{"position":[[0,4]]}}}],["timeout",{"_index":99,"t":{"1307":{"position":[[0,7]]}}}],["tlsconfig",{"_index":102,"t":{"1313":{"position":[[0,9]]}}}],["type",{"_index":27,"t":{"824":{"position":[[0,5]]},"1895":{"position":[[0,4]]}}}],["up",{"_index":151,"t":{"1683":{"position":[[13,2]]}}}],["updat",{"_index":138,"t":{"1666":{"position":[[5,7]]}}}],["us",{"_index":40,"t":{"1153":{"position":[[0,5]]},"1155":{"position":[[13,3]]},"1681":{"position":[[10,3]]}}}],["usag",{"_index":11,"t":{"760":{"position":[[0,5]]},"762":{"position":[[0,5]]},"772":{"position":[[0,5]]},"826":{"position":[[0,5]]},"836":{"position":[[0,5]]},"1439":{"position":[[0,5]]}}}],["userag",{"_index":86,"t":{"1281":{"position":[[0,9]]}}}],["usercontext",{"_index":228,"t":{"1897":{"position":[[0,11]]}}}],["valid",{"_index":173,"t":{"1748":{"position":[[0,9]]}}}],["vari",{"_index":229,"t":{"1899":{"position":[[0,4]]}}}],["variabl",{"_index":53,"t":{"1179":{"position":[[9,9]]}}}],["web",{"_index":144,"t":{"1674":{"position":[[3,3]]}}}],["window",{"_index":134,"t":{"1549":{"position":[[8,6]]}}}],["world",{"_index":62,"t":{"1213":{"position":[[7,6]]}}}],["write",{"_index":230,"t":{"1901":{"position":[[0,5]]}}}],["writef",{"_index":231,"t":{"1903":{"position":[[0,6]]}}}],["writestr",{"_index":232,"t":{"1905":{"position":[[0,11]]}}}],["xhr",{"_index":233,"t":{"1907":{"position":[[0,3]]}}}],["xml",{"_index":95,"t":{"1299":{"position":[[0,3]]},"1909":{"position":[[0,3]]}}}],["zero",{"_index":59,"t":{"1211":{"position":[[0,4]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":723,"t":"Repository for third party middlewares with dependencies.","s":"Contrib","u":"/contrib/","h":"","p":721},{"i":725,"t":"Casbin Fiberi18n Fibersentry Fiberzap Fiberzerolog JWT NewRelic Open Policy Agent Otelfiber (OpenTelemetry) Paseto Swagger Websocket","s":"πŸ“‘ Middleware Implementations","u":"/contrib/","h":"#-middleware-implementations","p":721},{"i":727,"t":"Casbin middleware for Fiber.","s":"Casbin","u":"/contrib/casbin/","h":"","p":726},{"i":729,"t":"go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/casbin choose an adapter from here go get -u github.com/casbin/xorm-adapter","s":"Install","u":"/contrib/casbin/","h":"#install","p":726},{"i":731,"t":"casbin.New(config ...casbin.Config) *casbin.Middleware","s":"Signature","u":"/contrib/casbin/","h":"#signature","p":726},{"i":733,"t":"Property Type Description Default ModelFilePath string Model file path \"./model.conf\" PolicyAdapter persist.Adapter Database adapter for policies ./policy.csv Enforcer *casbin.Enforcer Custom casbin enforcer Middleware generated enforcer using ModelFilePath & PolicyAdapter Lookup func(*fiber.Ctx) string Look up for current subject \"\" Unauthorized func(*fiber.Ctx) error Response body for unauthorized responses Unauthorized Forbidden func(*fiber.Ctx) error Response body for forbidden responses Forbidden","s":"Config","u":"/contrib/casbin/","h":"#config","p":726},{"i":735,"t":"Gorm Adapter File Adapter","s":"Examples","u":"/contrib/casbin/","h":"#examples","p":726},{"i":737,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/casbin\" _ \"github.com/go-sql-driver/mysql\" \"github.com/casbin/xorm-adapter/v2\" ) func main() { app := fiber.New() authz := casbin.New(casbin.Config{ ModelFilePath: \"path/to/rbac_model.conf\", PolicyAdapter: xormadapter.NewAdapter(\"mysql\", \"root:@tcp(127.0.0.1:3306)/\"), Lookup: func(c *fiber.Ctx) string { // fetch authenticated user subject }, }) app.Post(\"/blog\", authz.RequiresPermissions([]string{\"blog:create\"}, casbin.WithValidationRule(casbin.MatchAllRule)), func(c *fiber.Ctx) error { // your handler }, ) app.Delete(\"/blog/:id\", authz.RequiresPermissions([]string{\"blog:create\", \"blog:delete\"}, casbin.WithValidationRule(casbin.AtLeastOneRule)), func(c *fiber.Ctx) error { // your handler }, ) app.Listen(\":8080\") }","s":"CustomPermission","u":"/contrib/casbin/","h":"#custompermission","p":726},{"i":739,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/casbin\" _ \"github.com/go-sql-driver/mysql\" \"github.com/casbin/xorm-adapter/v2\" ) func main() { app := fiber.New() authz := casbin.New(casbin.Config{ ModelFilePath: \"path/to/rbac_model.conf\", PolicyAdapter: xormadapter.NewAdapter(\"mysql\", \"root:@tcp(127.0.0.1:3306)/\"), Lookup: func(c *fiber.Ctx) string { // fetch authenticated user subject }, }) // check permission with Method and Path app.Post(\"/blog\", authz.RoutePermission(), func(c *fiber.Ctx) error { // your handler }, ) app.Listen(\":8080\") }","s":"RoutePermission","u":"/contrib/casbin/","h":"#routepermission","p":726},{"i":741,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/casbin\" _ \"github.com/go-sql-driver/mysql\" \"github.com/casbin/xorm-adapter/v2\" ) func main() { app := fiber.New() authz := casbin.New(casbin.Config{ ModelFilePath: \"path/to/rbac_model.conf\", PolicyAdapter: xormadapter.NewAdapter(\"mysql\", \"root:@tcp(127.0.0.1:3306)/\"), Lookup: func(c *fiber.Ctx) string { // fetch authenticated user subject }, }) app.Put(\"/blog/:id\", authz.RequiresRoles([]string{\"admin\"}), func(c *fiber.Ctx) error { // your handler }, ) app.Listen(\":8080\") }","s":"RoleAuthorization","u":"/contrib/casbin/","h":"#roleauthorization","p":726},{"i":743,"t":"go-i18n support for Fiber.","s":"Fiberi18n","u":"/contrib/fiberi18n/","h":"","p":742},{"i":745,"t":"This middleware supports Fiber v2. go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/fiberi18n","s":"Install","u":"/contrib/fiberi18n/","h":"#install","p":742},{"i":747,"t":"fiberi18n.New(config ...*Config) fiber.Handler","s":"Signature","u":"/contrib/fiberi18n/","h":"#signature","p":742},{"i":749,"t":"Property Type Description Default Next func(c *fiber.Ctx) bool A function to skip this middleware when returned true. nil RootPath string The i18n template folder path. \"./example/localize\" AcceptLanguages []language.Tag A collection of languages that can be processed. []language.Tag{language.Chinese, language.English} FormatBundleFile string The type of the template file. \"yaml\" DefaultLanguage language.Tag The default returned language type. language.English Loader Loader The implementation of the Loader interface, which defines how to read the file. We provide both os.ReadFile and embed.FS.ReadFile. LoaderFunc(os.ReadFile) UnmarshalFunc i18n.UnmarshalFunc The function used for decoding template files. yaml.Unmarshal LangHandler func(ctx *fiber.Ctx, defaultLang string) string Used to get the kind of language handled by *fiber.Ctx and defaultLang. Retrieved from the request header Accept-Language or query parameter lang.","s":"Config","u":"/contrib/fiberi18n/","h":"#config","p":742},{"i":751,"t":"package main import ( \"github.com/gofiber/contrib/fiberi18n\" \"github.com/gofiber/fiber/v2\" \"github.com/nicksnyder/go-i18n/v2/i18n\" \"golang.org/x/text/language\" ) func main() { app := fiber.New() app.Use( fiberi18n.New(&fiberi18n.Config{ RootPath: \"./example/localize\", AcceptLanguages: []language.Tag{language.Chinese, language.English}, DefaultLanguage: language.Chinese, }), ) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(fiberi18n.MustGetMessage(\"welcome\")) }) app.Get(\"/:name\", func(ctx *fiber.Ctx) error { return ctx.SendString(fiberi18n.MustGetMessage(&i18n.LocalizeConfig{ MessageID: \"welcomeWithName\", TemplateData: map[string]string{ \"name\": ctx.Params(\"name\"), }, })) }) app.Listen(\"127.0.0.1:3000\") }","s":"Example","u":"/contrib/fiberi18n/","h":"#example","p":742},{"i":753,"t":"NewRelic support for Fiber.","s":"Fibernewrelic","u":"/contrib/fibernewrelic/","h":"","p":752},{"i":755,"t":"go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/fibernewrelic","s":"Install","u":"/contrib/fibernewrelic/","h":"#install","p":752},{"i":757,"t":"fibernewrelic.New(config fibernewrelic.Config) fiber.Handler","s":"Signature","u":"/contrib/fibernewrelic/","h":"#signature","p":752},{"i":759,"t":"Property Type Description Default License string Required - New Relic License Key \"\" AppName string New Relic Application Name fiber-api Enabled bool Enable/Disable New Relic false TransportType string Can be HTTP or HTTPS (Deprecated) \"HTTP\" Application Application Existing New Relic App nil ErrorStatusCodeHandler func(c *fiber.Ctx, err error) int If you want to change newrelic status code, you can use it. DefaultErrorStatusCodeHandler","s":"Config","u":"/contrib/fibernewrelic/","h":"#config","p":752},{"i":761,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/fibernewrelic\" ) func main() { app := fiber.New() app.Get(\"/\", func(ctx *fiber.Ctx) error { return ctx.SendStatus(200) }) cfg := fibernewrelic.Config{ License: \"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\", AppName: \"MyCustomApi\", Enabled: true, } app.Use(fibernewrelic.New(cfg)) app.Listen(\":8080\") }","s":"Usage","u":"/contrib/fibernewrelic/","h":"#usage","p":752},{"i":763,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/fibernewrelic\" \"github.com/newrelic/go-agent/v3/newrelic\" ) func main() { newrelicApp, err := newrelic.NewApplication( newrelic.ConfigAppName(\"MyCustomApi\"), newrelic.ConfigLicense(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\"), newrelic.ConfigEnabled(true), ) app := fiber.New() app.Get(\"/\", func(ctx *fiber.Ctx) error { return ctx.SendStatus(200) }) cfg := fibernewrelic.Config{ Application: newrelicApp } app.Use(fibernewrelic.New(cfg)) app.Listen(\":8080\") }","s":"Usage with existing New Relic application","u":"/contrib/fibernewrelic/","h":"#usage-with-existing-new-relic-application","p":752},{"i":765,"t":"Sentry support for Fiber.","s":"Fibersentry","u":"/contrib/fibersentry/","h":"","p":764},{"i":767,"t":"This middleware supports Fiber v2. go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/fibersentry go get -u github.com/getsentry/sentry-go","s":"Install","u":"/contrib/fibersentry/","h":"#install","p":764},{"i":769,"t":"fibersentry.New(config ...Config) fiber.Handler","s":"Signature","u":"/contrib/fibersentry/","h":"#signature","p":764},{"i":771,"t":"Property Type Description Default Repanic bool Repanic configures whether Sentry should repanic after recovery. Set to true, if Recover middleware is used. false WaitForDelivery bool WaitForDelivery configures whether you want to block the request before moving forward with the response. If Recover middleware is used, it's safe to either skip this option or set it to false. false Timeout time.Duration Timeout for the event delivery requests. time.Second * 2","s":"Config","u":"/contrib/fibersentry/","h":"#config","p":764},{"i":773,"t":"fibersentry attaches an instance of *sentry.Hub (https://godoc.org/github.com/getsentry/sentry-go#Hub) to the request's context, which makes it available throughout the rest of the request's lifetime. You can access it by using the fibersentry.GetHubFromContext() method on the context itself in any of your proceeding middleware and routes. And it should be used instead of the global sentry.CaptureMessage, sentry.CaptureException, or any other calls, as it keeps the separation of data between the requests. Keep in mind that *sentry.Hub won't be available in middleware attached before to fibersentry! package main import ( \"fmt\" \"log\" \"github.com/getsentry/sentry-go\" \"github.com/gofiber/contrib/fibersentry\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/utils\" ) func main() { _ = sentry.Init(sentry.ClientOptions{ Dsn: \"\", BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event { if hint.Context != nil { if c, ok := hint.Context.Value(sentry.RequestContextKey).(*fiber.Ctx); ok { // You have access to the original Context if it panicked fmt.Println(utils.ImmutableString(c.Hostname())) } } fmt.Println(event) return event }, Debug: true, AttachStacktrace: true, }) app := fiber.New() app.Use(fibersentry.New(fibersentry.Config{ Repanic: true, WaitForDelivery: true, })) enhanceSentryEvent := func(c *fiber.Ctx) error { if hub := fibersentry.GetHubFromContext(c); hub != nil { hub.Scope().SetTag(\"someRandomTag\", \"maybeYouNeedIt\") } return c.Next() } app.All(\"/foo\", enhanceSentryEvent, func(c *fiber.Ctx) error { panic(\"y tho\") }) app.All(\"/\", func(c *fiber.Ctx) error { if hub := fibersentry.GetHubFromContext(c); hub != nil { hub.WithScope(func(scope *sentry.Scope) { scope.SetExtra(\"unwantedQuery\", \"someQueryDataMaybe\") hub.CaptureMessage(\"User provided unwanted query string, but we recovered just fine\") }) } return c.SendStatus(fiber.StatusOK) }) log.Fatal(app.Listen(\":3000\")) }","s":"Usage","u":"/contrib/fibersentry/","h":"#usage","p":764},{"i":775,"t":"sentry.Init(sentry.ClientOptions{ Dsn: \"your-public-dsn\", BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event { if hint.Context != nil { if c, ok := hint.Context.Value(sentry.RequestContextKey).(*fiber.Ctx); ok { // You have access to the original Context if it panicked fmt.Println(c.Hostname()) } } return event }, })","s":"Accessing Context in BeforeSend callback","u":"/contrib/fibersentry/","h":"#accessing-context-in-beforesend-callback","p":764},{"i":777,"t":"Zap logging support for Fiber.","s":"Fiberzap","u":"/contrib/fiberzap/","h":"","p":776},{"i":779,"t":"This middleware supports Fiber v2. go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/fiberzap go get -u go.uber.org/zap","s":"Install","u":"/contrib/fiberzap/","h":"#install","p":776},{"i":781,"t":"fiberzap.New(config ...Config) fiber.Handler","s":"Signature","u":"/contrib/fiberzap/","h":"#signature","p":776},{"i":783,"t":"Property Type Description Default Next func(*Ctx) bool Define a function to skip this middleware when returned true nil Logger *zap.Logger Add custom zap logger. zap.NewDevelopment() Fields []string Add fields what you want see. []string{\"latency\", \"status\", \"method\", \"url\"} Messages []string Custom response messages. []string{\"Server error\", \"Client error\", \"Success\"} Levels []zapcore.Level Custom response levels. []zapcore.Level{zapcore.ErrorLevel, zapcore.WarnLevel, zapcore.InfoLevel} SkipURIs []string Skip logging these URI. []string{} GetResBody func(c *fiber.Ctx) []byte Define a function to get response body when return non-nil. eg: When use compress middleware, resBody is unreadable. you can set GetResBody func to get readable resBody. nil","s":"Config","u":"/contrib/fiberzap/","h":"#config","p":776},{"i":785,"t":"package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/fiberzap\" \"go.uber.org/zap\" ) func main() { app := fiber.New() logger, _ := zap.NewProduction() app.Use(fiberzap.New(fiberzap.Config{ Logger: logger, })) app.Get(\"/\", func (c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Example","u":"/contrib/fiberzap/","h":"#example","p":776},{"i":787,"t":"Zerolog logging support for Fiber.","s":"Fiberzerolog","u":"/contrib/fiberzerolog/","h":"","p":786},{"i":789,"t":"This middleware supports Fiber v2. go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/fiberzerolog go get -u github.com/rs/zerolog/log","s":"Install","u":"/contrib/fiberzerolog/","h":"#install","p":786},{"i":791,"t":"fiberzerolog.New(config ...Config) fiber.Handler","s":"Signature","u":"/contrib/fiberzerolog/","h":"#signature","p":786},{"i":793,"t":"Property Type Description Default Next func(*Ctx) bool Define a function to skip this middleware when returned true nil Logger *zerolog.Logger Add custom zerolog logger. zerolog.New(os.Stderr).With().Timestamp().Logger() GetLogger func(*fiber.Ctx) zerolog.Logger Get custom zerolog logger, if it's defined the returned logger will replace the Logger value. nil Fields []string Add fields what you want see. []string{\"latency\", \"status\", \"method\", \"url\", \"error\"} Messages []string Custom response messages. []string{\"Server error\", \"Client error\", \"Success\"} Levels []zerolog.Level Custom response levels. []zerolog.Level{zerolog.ErrorLevel, zerolog.WarnLevel, zerolog.InfoLevel} SkipURIs []string Skip logging these URI. []string{} GetResBody func(c *fiber.Ctx) []byte Define a function to get response body when return non-nil. eg: When use compress middleware, resBody is unreadable. you can set GetResBody func to get readable resBody. nil","s":"Config","u":"/contrib/fiberzerolog/","h":"#config","p":786},{"i":795,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/fiberzerolog\" \"github.com/rs/zerolog\" ) func main() { app := fiber.New() logger := zerolog.New(os.Stderr).With().Timestamp().Logger() app.Use(fiberzerolog.New(fiberzerolog.Config{ Logger: &logger, })) app.Get(\"/\", func (c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) if err := app.Listen(\":3000\"); err != nil { logger.Fatal().Err(err).Msg(\"Fiber app error\") } }","s":"Example","u":"/contrib/fiberzerolog/","h":"#example","p":786},{"i":797,"t":"JWT returns a JSON Web Token (JWT) auth middleware. For valid token, it sets the user in Ctx.Locals and calls next handler. For invalid token, it returns \"401 - Unauthorized\" error. For missing token, it returns \"400 - Bad Request\" error. Special thanks and credits to Echo","s":"JWT","u":"/contrib/jwt/","h":"","p":796},{"i":799,"t":"This middleware supports Fiber v1 & v2, install accordingly. go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/jwt go get -u github.com/golang-jwt/jwt/v5","s":"Install","u":"/contrib/jwt/","h":"#install","p":796},{"i":801,"t":"jwtware.New(config ...jwtware.Config) func(*fiber.Ctx) error","s":"Signature","u":"/contrib/jwt/","h":"#signature","p":796},{"i":803,"t":"Property Type Description Default Filter func(*fiber.Ctx) bool Defines a function to skip middleware nil SuccessHandler func(*fiber.Ctx) error SuccessHandler defines a function which is executed for a valid token. nil ErrorHandler func(*fiber.Ctx, error) error ErrorHandler defines a function which is executed for an invalid token. 401 Invalid or expired JWT SigningKey interface{} Signing key to validate token. Used as fallback if SigningKeys has length 0. nil SigningKeys map[string]interface{} Map of signing keys to validate token with kid field usage. nil ContextKey string Context key to store user information from the token into context. \"user\" Claims jwt.Claim Claims are extendable claims data defining token content. jwt.MapClaims{} TokenLookup string TokenLookup is a string in the form of : that is used \"header:Authorization\" AuthScheme string AuthScheme to be used in the Authorization header. The default value (\"Bearer\") will only be used in conjuction with the default TokenLookup value. \"Bearer\" KeyFunc func() jwt.Keyfunc KeyFunc defines a user-defined function that supplies the public key for a token validation. jwtKeyFunc JWKSetURLs []string A slice of unique JSON Web Key (JWK) Set URLs to used to parse JWTs. nil","s":"Config","u":"/contrib/jwt/","h":"#config","p":796},{"i":805,"t":"package main import ( \"time\" \"github.com/gofiber/fiber/v2\" jwtware \"github.com/gofiber/contrib/jwt\" \"github.com/golang-jwt/jwt/v5\" ) func main() { app := fiber.New() // Login route app.Post(\"/login\", login) // Unauthenticated route app.Get(\"/\", accessible) // JWT Middleware app.Use(jwtware.New(jwtware.Config{ SigningKey: jwtware.SigningKey{Key: []byte(\"secret\")}, })) // Restricted Routes app.Get(\"/restricted\", restricted) app.Listen(\":3000\") } func login(c *fiber.Ctx) error { user := c.FormValue(\"user\") pass := c.FormValue(\"pass\") // Throws Unauthorized error if user != \"john\" || pass != \"doe\" { return c.SendStatus(fiber.StatusUnauthorized) } // Create the Claims claims := jwt.MapClaims{ \"name\": \"John Doe\", \"admin\": true, \"exp\": time.Now().Add(time.Hour * 72).Unix(), } // Create token token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) // Generate encoded token and send it as response. t, err := token.SignedString([]byte(\"secret\")) if err != nil { return c.SendStatus(fiber.StatusInternalServerError) } return c.JSON(fiber.Map{\"token\": t}) } func accessible(c *fiber.Ctx) error { return c.SendString(\"Accessible\") } func restricted(c *fiber.Ctx) error { user := c.Locals(\"user\").(*jwt.Token) claims := user.Claims.(jwt.MapClaims) name := claims[\"name\"].(string) return c.SendString(\"Welcome \" + name) }","s":"HS256 Example","u":"/contrib/jwt/","h":"#hs256-example","p":796},{"i":807,"t":"Login using username and password to retrieve a token. curl --data \"user=john&pass=doe\" http://localhost:3000/login Response { \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NjE5NTcxMzZ9.RB3arc4-OyzASAaUhC2W3ReWaXAt_z2Fd3BN4aWTgEY\" } Request a restricted resource using the token in Authorization request header. curl localhost:3000/restricted -H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NjE5NTcxMzZ9.RB3arc4-OyzASAaUhC2W3ReWaXAt_z2Fd3BN4aWTgEY\" Response Welcome John Doe","s":"HS256 Test","u":"/contrib/jwt/","h":"#hs256-test","p":796},{"i":809,"t":"package main import ( \"crypto/rand\" \"crypto/rsa\" \"log\" \"time\" \"github.com/gofiber/fiber/v2\" \"github.com/golang-jwt/jwt/v5\" jwtware \"github.com/gofiber/contrib/jwt\" ) var ( // Obviously, this is just a test example. Do not do this in production. // In production, you would have the private key and public key pair generated // in advance. NEVER add a private key to any GitHub repo. privateKey *rsa.PrivateKey ) func main() { app := fiber.New() // Just as a demo, generate a new private/public key pair on each run. See note above. rng := rand.Reader var err error privateKey, err = rsa.GenerateKey(rng, 2048) if err != nil { log.Fatalf(\"rsa.GenerateKey: %v\", err) } // Login route app.Post(\"/login\", login) // Unauthenticated route app.Get(\"/\", accessible) // JWT Middleware app.Use(jwtware.New(jwtware.Config{ SigningKey: jwtware.SigningKey{ JWTAlg: jwtware.RS256, Key: privateKey.Public(), }, })) // Restricted Routes app.Get(\"/restricted\", restricted) app.Listen(\":3000\") } func login(c *fiber.Ctx) error { user := c.FormValue(\"user\") pass := c.FormValue(\"pass\") // Throws Unauthorized error if user != \"john\" || pass != \"doe\" { return c.SendStatus(fiber.StatusUnauthorized) } // Create the Claims claims := jwt.MapClaims{ \"name\": \"John Doe\", \"admin\": true, \"exp\": time.Now().Add(time.Hour * 72).Unix(), } // Create token token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) // Generate encoded token and send it as response. t, err := token.SignedString(privateKey) if err != nil { log.Printf(\"token.SignedString: %v\", err) return c.SendStatus(fiber.StatusInternalServerError) } return c.JSON(fiber.Map{\"token\": t}) } func accessible(c *fiber.Ctx) error { return c.SendString(\"Accessible\") } func restricted(c *fiber.Ctx) error { user := c.Locals(\"user\").(*jwt.Token) claims := user.Claims.(jwt.MapClaims) name := claims[\"name\"].(string) return c.SendString(\"Welcome \" + name) }","s":"RS256 Example","u":"/contrib/jwt/","h":"#rs256-example","p":796},{"i":811,"t":"The RS256 is actually identical to the HS256 test above.","s":"RS256 Test","u":"/contrib/jwt/","h":"#rs256-test","p":796},{"i":813,"t":"The tests are identical to basic JWT tests above, with exception that JWKSetURLs to valid public keys collection in JSON Web Key (JWK) Set format should be supplied. See RFC 7517.","s":"JWK Set Test","u":"/contrib/jwt/","h":"#jwk-set-test","p":796},{"i":815,"t":"KeyFunc defines a user-defined function that supplies the public key for a token validation. The function shall take care of verifying the signing algorithm and selecting the proper key. A user-defined KeyFunc can be useful if tokens are issued by an external party. When a user-defined KeyFunc is provided, SigningKey, SigningKeys, and SigningMethod are ignored. This is one of the three options to provide a token validation key. The order of precedence is a user-defined KeyFunc, SigningKeys and SigningKey. Required if neither SigningKeys nor SigningKey is provided. Default to an internal implementation verifying the signing algorithm and selecting the proper key. package main import ( \"fmt\" \"github.com/gofiber/fiber/v2\" jwtware \"github.com/gofiber/contrib/jwt\" \"github.com/golang-jwt/jwt/v5\" ) func main() { app := fiber.New() app.Use(jwtware.New(jwtware.Config{ KeyFunc: customKeyFunc(), })) app.Get(\"/ok\", func(c *fiber.Ctx) error { return c.SendString(\"OK\") }) } func customKeyFunc() jwt.Keyfunc { return func(t *jwt.Token) (interface{}, error) { // Always check the signing method if t.Method.Alg() != jwtware.HS256 { return nil, fmt.Errorf(\"Unexpected jwt signing method=%v\", t.Header[\"alg\"]) } // TODO custom implementation of loading signing key like from a database signingKey := \"secret\" return []byte(signingKey), nil } }","s":"Custom KeyFunc example","u":"/contrib/jwt/","h":"#custom-keyfunc-example","p":796},{"i":817,"t":"Open Policy Agent support for Fiber. Note: Requires Go 1.18 and above","s":"Opafiber","u":"/contrib/opafiber/","h":"","p":816},{"i":819,"t":"go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/opafiber","s":"Install","u":"/contrib/opafiber/","h":"#install","p":816},{"i":821,"t":"opafiber.New(config opafiber.Config) fiber.Handler","s":"Signature","u":"/contrib/opafiber/","h":"#signature","p":816},{"i":823,"t":"Property Type Description Default RegoQuery string Required - Rego query - RegoPolicy io.Reader Required - Rego policy - IncludeQueryString bool Include query string as input to rego policy false DeniedStatusCode int Http status code to return when policy denies request 400 DeniedResponseMessage string Http response body text to return when policy denies request \"\" IncludeHeaders []string Include headers as input to rego policy - InputCreationMethod InputCreationFunc Use your own function to provide input for OPA func defaultInput(ctx *fiber.Ctx) (map[string]interface{}, error)","s":"Config","u":"/contrib/opafiber/","h":"#config","p":816},{"i":825,"t":"type InputCreationFunc func(c *fiber.Ctx) (map[string]interface{}, error)","s":"Types","u":"/contrib/opafiber/","h":"#types","p":816},{"i":827,"t":"OPA Fiber middleware sends the following example data to the policy engine as input: { \"method\": \"GET\", \"path\": \"/somePath\", \"query\": { \"name\": [\"John Doe\"] }, \"headers\": { \"Accept\": \"application/json\", \"Content-Type\": \"application/json\" } } package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/opafiber\" ) func main() { app := fiber.New() module := ` package example.authz default allow := false allow { input.method == \"GET\" } ` cfg := opafiber.Config{ RegoQuery: \"data.example.authz.allow\", RegoPolicy: bytes.NewBufferString(module), IncludeQueryString: true, DeniedStatusCode: fiber.StatusForbidden, DeniedResponseMessage: \"status forbidden\", IncludeHeaders: []string{\"Authorization\"}, InputCreationMethod: func (ctx *fiber.Ctx) (map[string]interface{}, error) { return map[string]interface{}{ \"method\": ctx.Method(), \"path\": ctx.Path(), }, nil }, } app.Use(opafiber.New(cfg)) app.Get(\"/\", func(ctx *fiber.Ctx) error { return ctx.SendStatus(200) }) app.Listen(\":8080\") }","s":"Usage","u":"/contrib/opafiber/","h":"#usage","p":816},{"i":829,"t":"OpenTelemetry support for Fiber. Can be found on OpenTelemetry Registry.","s":"Otelfiber","u":"/contrib/otelfiber/","h":"","p":828},{"i":831,"t":"This middleware supports Fiber v2. go get -u github.com/gofiber/contrib/otelfiber","s":"Install","u":"/contrib/otelfiber/","h":"#install","p":828},{"i":833,"t":"otelfiber.Middleware(opts ...Option) fiber.Handler","s":"Signature","u":"/contrib/otelfiber/","h":"#signature","p":828},{"i":835,"t":"Property Type Description Default Next func(*fiber.Ctx) bool Define a function to skip this middleware when returned trueRequired - Rego quer nil TracerProvider oteltrace.TracerProvider Specifies a tracer provider to use for creating a tracer nil - the global tracer provider is used MeterProvider otelmetric.MeterProvider Specifies a meter provider to use for reporting nil - the global meter provider is used Port *int Specifies the value to use when setting the net.host.port attribute on metrics/spans Required: If not default (80 for http, 443 for https) Propagators propagation.TextMapPropagator Specifies propagators to use for extracting information from the HTTP requests If none are specified, global ones will be used ServerName *string specifies the value to use when setting the http.server_name attribute on metrics/spans - SpanNameFormatter func(*fiber.Ctx) string Takes a function that will be called on every request and the returned string will become the Span Name default formatter returns the route pathRaw","s":"Config","u":"/contrib/otelfiber/","h":"#config","p":828},{"i":837,"t":"Please refer to example","s":"Usage","u":"/contrib/otelfiber/","h":"#usage","p":828},{"i":839,"t":"package main import ( \"context\" \"errors\" \"log\" \"go.opentelemetry.io/otel/sdk/resource\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/otelfiber\" \"go.opentelemetry.io/otel\" \"go.opentelemetry.io/otel/attribute\" stdout \"go.opentelemetry.io/otel/exporters/stdout/stdouttrace\" //\"go.opentelemetry.io/otel/exporters/jaeger\" \"go.opentelemetry.io/otel/propagation\" sdktrace \"go.opentelemetry.io/otel/sdk/trace\" semconv \"go.opentelemetry.io/otel/semconv/v1.4.0\" oteltrace \"go.opentelemetry.io/otel/trace\" ) var tracer = otel.Tracer(\"fiber-server\") func main() { tp := initTracer() defer func() { if err := tp.Shutdown(context.Background()); err != nil { log.Printf(\"Error shutting down tracer provider: %v\", err) } }() app := fiber.New() app.Use(otelfiber.Middleware()) app.Get(\"/error\", func(ctx *fiber.Ctx) error { return errors.New(\"abc\") }) app.Get(\"/users/:id\", func(c *fiber.Ctx) error { id := c.Params(\"id\") name := getUser(c.UserContext(), id) return c.JSON(fiber.Map{\"id\": id, name: name}) }) log.Fatal(app.Listen(\":3000\")) } func initTracer() *sdktrace.TracerProvider { exporter, err := stdout.New(stdout.WithPrettyPrint()) if err != nil { log.Fatal(err) } tp := sdktrace.NewTracerProvider( sdktrace.WithSampler(sdktrace.AlwaysSample()), sdktrace.WithBatcher(exporter), sdktrace.WithResource( resource.NewWithAttributes( semconv.SchemaURL, semconv.ServiceNameKey.String(\"my-service\"), )), ) otel.SetTracerProvider(tp) otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})) return tp } func getUser(ctx context.Context, id string) string { _, span := tracer.Start(ctx, \"getUser\", oteltrace.WithAttributes(attribute.String(\"id\", id))) defer span.End() if id == \"123\" { return \"otelfiber tester\" } return \"unknown\" }","s":"Example","u":"/contrib/otelfiber/","h":"#example","p":828},{"i":841,"t":"An HTTP server using gofiber fiber and instrumentation. The server has a /users/:id endpoint. The server generates span information to stdout. These instructions expect you have docker-compose installed. Bring up the fiber-server and fiber-client services to run the example: docker-compose up --detach fiber-server fiber-client The fiber-client service sends just one HTTP request to fiber-server and then exits. View the span generated by fiber-server in the logs: docker-compose logs fiber-server Shut down the services when you are finished with the example: docker-compose down","s":"Example","u":"/contrib/otelfiber/example/","h":"","p":840},{"i":843,"t":"PASETO returns a Web Token (PASETO) auth middleware. For valid token, it sets the payload data in Ctx.Locals and calls next handler. For invalid token, it returns \"401 - Unauthorized\" error. For missing token, it returns \"400 - BadRequest\" error.","s":"Paseto","u":"/contrib/paseto/","h":"","p":842},{"i":845,"t":"This middleware supports Fiber v2. go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/paseto go get -u github.com/o1egl/paseto","s":"Install","u":"/contrib/paseto/","h":"#install","p":842},{"i":847,"t":"pasetoware.New(config ...pasetoware.Config) func(*fiber.Ctx) error","s":"Signature","u":"/contrib/paseto/","h":"#signature","p":842},{"i":849,"t":"Property Type Description Default Next func(*Ctx) bool Defines a function to skip middleware nil SuccessHandler func(*fiber.Ctx) error SuccessHandler defines a function which is executed for a valid token. c.Next() ErrorHandler func(*fiber.Ctx, error) error ErrorHandler defines a function which is executed for an invalid token. 401 Invalid or expired PASETO Validate PayloadValidator Defines a function to validate if payload is valid. Optional. In case payload used is created using CreateToken function. If token is created using another function, this function must be provided. nil SymmetricKey []byte Secret key to encrypt token. If present the middleware will generate local tokens. nil PrivateKey ed25519.PrivateKey Secret key to sign the tokens. If present (along with its PublicKey) the middleware will generate public tokens. nil PublicKey crypto.PublicKey Public key to verify the tokens. If present (along with PrivateKey) the middleware will generate public tokens. nil ContextKey string Context key to store user information from the token into context. \"auth-token\" TokenLookup [2]string TokenLookup is a string slice with size 2, that is used to extract token from the request [\"header\",\"Authorization\"]","s":"Config","u":"/contrib/paseto/","h":"#config","p":842},{"i":851,"t":"When using this middleware, and creating a token for authentication, you can use the function pasetoware.CreateToken, that will create a token, encrypt or sign it and returns the PASETO token. Passing a SymmetricKey in the Config results in a local (encrypted) token, while passing a PublicKey and PrivateKey results in a public (signed) token. In case you want to use your own data structure, is needed to provide the Validate function in paseware.Config, that will return the data stored in the token, and a error.","s":"Instructions","u":"/contrib/paseto/","h":"#instructions","p":842},{"i":853,"t":"Swagger middleware for Fiber. The middleware handles Swagger UI.","s":"Swagger","u":"/contrib/swagger/","h":"","p":852},{"i":855,"t":"Signatures Examples","s":"Table of Contents","u":"/contrib/swagger/","h":"#table-of-contents","p":852},{"i":857,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/contrib/swagger/","h":"#signatures","p":852},{"i":859,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/swagger\" ) Then create a Fiber app with app := fiber.New(). After you initiate your Fiber app, you can use the following possibilities:","s":"Examples","u":"/contrib/swagger/","h":"#examples","p":852},{"i":861,"t":"app.Use(swagger.New(cfg))","s":"Default Config","u":"/contrib/swagger/","h":"#default-config","p":852},{"i":863,"t":"cfg := swagger.Config{ BasePath: \"/\", //swagger ui base path FilePath: \"./docs/swagger.json\", } app.Use(swagger.New(cfg))","s":"Custom Config","u":"/contrib/swagger/","h":"#custom-config","p":852},{"i":865,"t":"Based on Fasthttp WebSocket for Fiber with available *fiber.Ctx methods like Locals, Params, Query and Cookies.","s":"Websocket","u":"/contrib/websocket/","h":"","p":864},{"i":867,"t":"go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/websocket","s":"Install","u":"/contrib/websocket/","h":"#install","p":864},{"i":869,"t":"package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/websocket\" ) func main() { app := fiber.New() app.Use(\"/ws\", func(c *fiber.Ctx) error { // IsWebSocketUpgrade returns true if the client // requested upgrade to the WebSocket protocol. if websocket.IsWebSocketUpgrade(c) { c.Locals(\"allowed\", true) return c.Next() } return fiber.ErrUpgradeRequired }) app.Get(\"/ws/:id\", websocket.New(func(c *websocket.Conn) { // c.Locals is added to the *websocket.Conn log.Println(c.Locals(\"allowed\")) // true log.Println(c.Params(\"id\")) // 123 log.Println(c.Query(\"v\")) // 1.0 log.Println(c.Cookies(\"session\")) // \"\" // websocket.Conn bindings https://pkg.go.dev/github.com/fasthttp/websocket?tab=doc#pkg-index var ( mt int msg []byte err error ) for { if mt, msg, err = c.ReadMessage(); err != nil { log.Println(\"read:\", err) break } log.Printf(\"recv: %s\", msg) if err = c.WriteMessage(mt, msg); err != nil { log.Println(\"write:\", err) break } } })) log.Fatal(app.Listen(\":3000\")) // Access the websocket server: ws://localhost:3000/ws/123?v=1.0 // https://www.websocket.org/echo.html }","s":"Example","u":"/contrib/websocket/","h":"#example","p":864},{"i":871,"t":"If you get the error websocket: bad handshake when using the cache middleware, please use config.Next to skip websocket path. app := fiber.New() app.Use(cache.New(cache.Config{ Next: func(c *fiber.Ctx) bool { return strings.Contains(c.Route().Path, \"/ws\") }, })) app.Get(\"/ws/:id\", websocket.New(func(c *websocket.Conn) {}))","s":"Note with cache middleware","u":"/contrib/websocket/","h":"#note-with-cache-middleware","p":864},{"i":874,"t":"Premade storage drivers that implement the Storage interface, designed to be used with various Fiber middlewares. // Storage interface for communicating with different database/key-value // providers. Visit https://github.com/gofiber/storage for more info. type Storage interface { // Get gets the value for the given key. // `nil, nil` is returned when the key does not exist Get(key string) ([]byte, error) // Set stores the given value for the given key along // with an expiration value, 0 means no expiration. // Empty key or value will be ignored without an error. Set(key string, val []byte, exp time.Duration) error // Delete deletes the value for the given key. // It returns no error if the storage does not contain the key, Delete(key string) error // Reset resets the storage and delete all keys. Reset() error // Close closes the storage and will stop any running garbage // collectors and open connections. Close() error }","s":"πŸ“¦ Storage","u":"/storage/","h":"","p":872},{"i":876,"t":"ArangoDB AzureBlob Badger Bbolt Couchbase DynamoDB Etcd Memcache Memory MongoDB MSSQL MySQL Pebble Postgres Redis S3 SQLite3","s":"πŸ“‘ Storage Implementations","u":"/storage/","h":"#-storage-implementations","p":872},{"i":878,"t":"A ArangoDB storage driver using arangodb/go-driver and arangodb/go-driver.","s":"ArangoDB","u":"/storage/arangodb/","h":"","p":877},{"i":880,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/arangodb/","h":"#table-of-contents","p":877},{"i":882,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() driver.Client","s":"Signatures","u":"/storage/arangodb/","h":"#signatures","p":877},{"i":884,"t":"ArangoDB is tested on the 2 last (1.14/1.15) Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the mysql implementation: go get github.com/gofiber/storage/arangodb","s":"Installation","u":"/storage/arangodb/","h":"#installation","p":877},{"i":886,"t":"Import the storage package. import \"github.com/gofiber/storage/arangodb\" You can use the following possibilities to create a storage: // Initialize default config store := arangodb.New() // Initialize custom config store := arangodb.New(arangodb.Config{ Host: \"http://127.0.0.1\", Port: 8529, Database: \"fiber\", Collection: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/arangodb/","h":"#examples","p":877},{"i":888,"t":"type Config struct { // Host name where the DB is hosted // // Optional. Default is \"http://127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 8529 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Database name // // Optional. Default is \"fiber\" Database string // Collection name // // Optional. Default is \"fiber_storage\" Collection string // Reset clears any existing keys in existing collection // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration }","s":"Config","u":"/storage/arangodb/","h":"#config","p":877},{"i":890,"t":"Used only for optional fields var ConfigDefault = Config{ Host: \"http://127.0.0.1\", Port: 8529, Database: \"fiber\", Collection: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, }","s":"Default Config","u":"/storage/arangodb/","h":"#default-config","p":877},{"i":892,"t":"Azure Blob storage is Microsoft's object storage solution for the cloud. NOTE: Go 1.18 or later is required. Source: link","s":"Azure Blob","u":"/storage/azureblob/","h":"","p":891},{"i":894,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/azureblob/","h":"#table-of-contents","p":891},{"i":896,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *azblob.Client","s":"Signatures","u":"/storage/azureblob/","h":"#signatures","p":891},{"i":898,"t":"Azure blob storage driver is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the azure blob implementation: go get github.com/gofiber/storage/azureblob","s":"Installation","u":"/storage/azureblob/","h":"#installation","p":891},{"i":900,"t":"Import the storage package. import \"github.com/gofiber/storage/azureblob\" You can use the following possibilities to create a storage: // Initialize default config store := azureblob.New() // Initialize custom config store := azureblob.New(azureblob.Config{ Account: \"test\", Container: \"test\", Credentials: Credentials{ Account: \"test\", Key: \"YXp1cml0ZWtleQo=\", }, })","s":"Examples","u":"/storage/azureblob/","h":"#examples","p":891},{"i":902,"t":"type Config struct { // Storage account name. Account string // Container name. Container string // Storage endpoint. // Optional. Default: \"https://STORAGEACCOUNTNAME.blob.core.windows.net\" Endpoint string // Request timeout. // Optional. Default is 0 (no timeout) RequestTimeout time.Duration // Reset clears any existing keys in existing container. // Optional. Default is false Reset bool // Credentials overrides AWS access key and AWS secret access key. Not recommended. // Optional. Default is Credentials{} Credentials Credentials // The maximum number of times requests that encounter retryable failures should be attempted. // Optional. Default is 3 MaxAttempts int }","s":"Config","u":"/storage/azureblob/","h":"#config","p":891},{"i":904,"t":"var ConfigDefault = Config{ Account: \"\", Container: \"\", Endpoint: \"\", RequestTimeout: 0, Reset: false, MaxAttempts: 3, }","s":"Default Config","u":"/storage/azureblob/","h":"#default-config","p":891},{"i":906,"t":"A fast key-value DB using dgraph-io/badger","s":"Badger","u":"/storage/badger/","h":"","p":905},{"i":908,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/badger/","h":"#table-of-contents","p":905},{"i":910,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *badger.DB","s":"Signatures","u":"/storage/badger/","h":"#signatures","p":905},{"i":912,"t":"Badger is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the badger implementation: go get github.com/gofiber/storage/badger","s":"Installation","u":"/storage/badger/","h":"#installation","p":905},{"i":914,"t":"Import the storage package. import \"github.com/gofiber/storage/badger\" You can use the following possibilities to create a storage: // Initialize default config store := badger.New() // Initialize custom config store := badger.New(badger.Config{ Database: \"./fiber.badger\", Reset: false, GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/badger/","h":"#examples","p":905},{"i":916,"t":"type Config struct { // Database name // // Optional. Default is \"./fiber.badger\" Database string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration // BadgerOptions is a way to set options in badger // // Optional. Default is badger.DefaultOptions(\"./fiber.badger\") BadgerOptions badger.Options // Logger is the default logger used by badger // // Optional. Default is nil Logger badger.Logger // UseLogger define if any logger will be used // // Optional. Default is false UseLogger bool }","s":"Config","u":"/storage/badger/","h":"#config","p":905},{"i":918,"t":"var ConfigDefault = Config{ Database: \"./fiber.badger\", Reset: false, GCInterval: 10 * time.Second, BadgerOptions: badger.DefaultOptions(\"./fiber.badger\").WithLogger(nil), Logger: nil, UseLogger: false, }","s":"Default Config","u":"/storage/badger/","h":"#default-config","p":905},{"i":920,"t":"A Bbolt storage driver using etcd-io/bbolt. Bolt is a pure Go key/value store inspired by Howard Chu's LMDB project. The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL.","s":"Bbolt","u":"/storage/bbolt/","h":"","p":919},{"i":922,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/bbolt/","h":"#table-of-contents","p":919},{"i":924,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *bbolt.DB","s":"Signatures","u":"/storage/bbolt/","h":"#signatures","p":919},{"i":926,"t":"Bbolt is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the s3 implementation: go get github.com/gofiber/storage/bbolt","s":"Installation","u":"/storage/bbolt/","h":"#installation","p":919},{"i":928,"t":"Import the storage package. import \"github.com/gofiber/storage/bbolt\" You can use the following possibilities to create a storage: // Initialize default config store := bbolt.New() // Initialize custom config store := bbolt.New(bbolt.Config{ Database: \"my_database.db\", Bucket: \"my-bucket\", Reset: false, })","s":"Examples","u":"/storage/bbolt/","h":"#examples","p":919},{"i":930,"t":"// Config defines the config for storage. type Config struct { // Database path // // Optional. Default is \"fiber.db\" Database string // Bbolt bucket name // // Optional. Default is \"fiber_storage\" Bucket string // Timeout is the amount of time to wait to obtain a file lock. // Only available on Darwin and Linux. // // Optional. Default is 60 * time.Second. Timeout time.Duration // Open database in read-only mode. // // Optional. Default is false ReadOnly bool // Reset clears any existing keys in existing Bucket // // Optional. Default is false Reset bool }","s":"Config","u":"/storage/bbolt/","h":"#config","p":919},{"i":932,"t":"// ConfigDefault is the default config var ConfigDefault = Config{ Database: \"fiber.db\", Bucket: \"fiber_storage\", Timeout: 60 * time.Second, ReadOnly: false, Reset: false, }","s":"Default Config","u":"/storage/bbolt/","h":"#default-config","p":919},{"i":934,"t":"A Couchbase storage driver using couchbase/gocb.","s":"Couchbase","u":"/storage/couchbase/","h":"","p":933},{"i":936,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/couchbase/","h":"#table-of-contents","p":933},{"i":938,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *gocb.Cluster","s":"Signatures","u":"/storage/couchbase/","h":"#signatures","p":933},{"i":940,"t":"Couchbase is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the Couchbase implementation: go get github.com/gofiber/storage/couchbase","s":"Installation","u":"/storage/couchbase/","h":"#installation","p":933},{"i":942,"t":"Import the storage package. import \"github.com/gofiber/storage/couchbase\" You can use the following possibilities to create a storage: // Initialize default config store := couchbase.New() // Initialize Couchbase storage with custom config store := couchbase.New(couchbase.Config{ Host: \"127.0.0.1:8091\", Username: \"\", Password: \"\", Bucket: 0, ConnectionTimeout: 3* time.Second, KVTimeout: 1* time.Second, })","s":"Examples","u":"/storage/couchbase/","h":"#examples","p":933},{"i":944,"t":"type Config struct { // The application username to Connect to the Couchbase cluster Username string // The application password to Connect to the Couchbase cluster Password string // The connection string for the Couchbase cluster Host string // The name of the bucket to Connect to Bucket string // The timeout for connecting to the Couchbase cluster ConnectionTimeout time.Duration // The timeout for performing operations on the Couchbase cluster KVTimeout time.Duration }","s":"Config","u":"/storage/couchbase/","h":"#config","p":933},{"i":946,"t":"// ConfigDefault is the default config var ConfigDefault = Config{ Host: \"127.0.0.1:8091\", Username: \"admin\", Password: \"123456\", Bucket: \"fiber_storage\", ConnectionTimeout: 3 * time.Second, KVTimeout: 1 * time.Second, }","s":"Default Config","u":"/storage/couchbase/","h":"#default-config","p":933},{"i":948,"t":"A DynamoDB storage driver using aws/aws-sdk-go-v2. Note: If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: specifying credentials ....","s":"DynamoDB","u":"/storage/dynamodb/","h":"","p":947},{"i":950,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/dynamodb/","h":"#table-of-contents","p":947},{"i":952,"t":"func New(config Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *awsdynamodb.Client","s":"Signatures","u":"/storage/dynamodb/","h":"#signatures","p":947},{"i":954,"t":"DynamoDB is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the dynamodb implementation: go get github.com/gofiber/storage/dynamodb","s":"Installation","u":"/storage/dynamodb/","h":"#installation","p":947},{"i":956,"t":"Import the storage package. import \"github.com/gofiber/storage/dynamodb\" You can use the following possibilities to create a storage: // Initialize dynamodb store := dynamodb.New(dynamodb.Config{ })","s":"Examples","u":"/storage/dynamodb/","h":"#examples","p":947},{"i":958,"t":"type Config struct { // Region of the DynamoDB service you want to use. // Valid values: https://docs.aws.amazon.com/general/latest/gr/rande.html#ddb_region. // E.g. \"us-west-2\". // Optional (read from shared config file or environment variable if not set). // Environment variable: \"AWS_REGION\". Region string // Name of the DynamoDB table. // Optional (\"fiber_storage\" by default). Table string // CustomEndpoint allows you to set a custom DynamoDB service endpoint. // This is especially useful if you're running a \"DynamoDB local\" Docker container for local testing. // Typical value for the Docker container: \"http://localhost:8000\". // See https://hub.docker.com/r/amazon/dynamodb-local/. // Optional (\"\" by default) Endpoint string // Credentials overrides AWS access key and AWS secret access key. Not recommended. // // Optional. Default is Credentials{} Credentials Credentials // The maximum number of times requests that encounter retryable failures should be attempted. // // Optional. Default is 3 MaxAttempts int // Reset clears any existing keys in existing Bucket // // Optional. Default is false Reset bool // ReadCapacityUnits of the table. // Only required when the table doesn't exist yet and is created by gokv. // Optional (5 by default, which is the same default value as when creating a table in the web console) // 25 RCUs are included in the free tier (across all tables). // For example calculations, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/HowItWorks.ProvisionedThroughput. // For limits, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/Limits.md#capacity-units-and-provisioned-throughput.md#provisioned-throughput. ReadCapacityUnits int64 // ReadCapacityUnits of the table. // Only required when the table doesn't exist yet and is created by gokv. // Optional (5 by default, which is the same default value as when creating a table in the web console) // 25 RCUs are included in the free tier (across all tables). // For example calculations, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/HowItWorks.ProvisionedThroughput. // For limits, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/Limits.md#capacity-units-and-provisioned-throughput.md#provisioned-throughput. WriteCapacityUnits int64 // If the table doesn't exist yet, gokv creates it. // If WaitForTableCreation is true, gokv will block until the table is created, with a timeout of 15 seconds. // If the table still doesn't exist after 15 seconds, an error is returned. // If WaitForTableCreation is false, gokv returns the client immediately. // In the latter case you need to make sure that you don't read from or write to the table before it's created, // because otherwise you will get ResourceNotFoundException errors. // Optional (true by default). WaitForTableCreation *bool } type Credentials struct { AccessKey string SecretAccessKey string }","s":"Config","u":"/storage/dynamodb/","h":"#config","p":947},{"i":960,"t":"var ConfigDefault = Config{ Table: \"fiber_storage\", Credentials: Credentials{}, MaxAttempts: 3, Reset: false, ReadCapacityUnits: 5, WriteCapacityUnits: 5, WaitForTableCreation: aws.Bool(true), }","s":"Default Config","u":"/storage/dynamodb/","h":"#default-config","p":947},{"i":962,"t":"A Etcd storage driver using etcd-io/etcd.","s":"Etcd","u":"/storage/etcd/","h":"","p":961},{"i":964,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/etcd/","h":"#table-of-contents","p":961},{"i":966,"t":"func New(config ...Config) *Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *clientv3.Client","s":"Signatures","u":"/storage/etcd/","h":"#signatures","p":961},{"i":968,"t":"Etcd is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the etcd implementation: go get github.com/gofiber/storage/etcd","s":"Installation","u":"/storage/etcd/","h":"#installation","p":961},{"i":970,"t":"Import the storage package. import \"github.com/gofiber/storage/etcd\" You can use the following possibilities to create a storage: // Initialize default config store := etcd.New() // Initialize custom config store := etcd.New(Config{ Endpoints: []string{\"localhost:2379\"}, })","s":"Examples","u":"/storage/etcd/","h":"#examples","p":961},{"i":972,"t":"type Config struct { // Endpoints is a list of URLs. Endpoints []string // DialTimeout is the timeout for failing to establish a connection. DialTimeout time.Duration // Username is a username for authentication. Username string // Password is a password for authentication. Password string // TLS holds the client secure credentials, if any. TLS *tls.Config }","s":"Config","u":"/storage/etcd/","h":"#config","p":961},{"i":974,"t":"var ConfigDefault = Config{ Endpoints: []string{\"localhost:2379\"}, DialTimeout: 2 * time.Second, Username: \"\", Password: \"\", TLS: nil, }","s":"Default Config","u":"/storage/etcd/","h":"#default-config","p":961},{"i":976,"t":"A Memcache storage driver using bradfitz/gomemcache.","s":"Memcache","u":"/storage/memcache/","h":"","p":975},{"i":978,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/memcache/","h":"#table-of-contents","p":975},{"i":980,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *mc.Client","s":"Signatures","u":"/storage/memcache/","h":"#signatures","p":975},{"i":982,"t":"Memory is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the memory implementation: go get github.com/gofiber/storage/memory","s":"Installation","u":"/storage/memcache/","h":"#installation","p":975},{"i":984,"t":"Import the storage package. import \"github.com/gofiber/storage/memcache\" You can use the following possibilities to create a storage: // Initialize default config store := memcache.New() // Initialize custom config store := memcache.New(memcache.Config{ Servers: \"localhost:11211\", })","s":"Examples","u":"/storage/memcache/","h":"#examples","p":975},{"i":986,"t":"type Config struct { // Server list divided by , // i.e. server1:11211, server2:11212 // // Optional. Default is \"127.0.0.1:11211\" Servers string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool }","s":"Config","u":"/storage/memcache/","h":"#config","p":975},{"i":988,"t":"var ConfigDefault = Config{ Servers: \"127.0.0.1:11211\", }","s":"Default Config","u":"/storage/memcache/","h":"#default-config","p":975},{"i":990,"t":"An in-memory storage driver.","s":"Memory","u":"/storage/memory/","h":"","p":989},{"i":992,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/memory/","h":"#table-of-contents","p":989},{"i":994,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() map[string]entry","s":"Signatures","u":"/storage/memory/","h":"#signatures","p":989},{"i":996,"t":"Memory is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the memory implementation: go get github.com/gofiber/storage/memory","s":"Installation","u":"/storage/memory/","h":"#installation","p":989},{"i":998,"t":"Import the storage package. import \"github.com/gofiber/storage/memory\" You can use the following possibilities to create a storage: // Initialize default config store := memory.New() // Initialize custom config store := memory.New(memory.Config{ GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/memory/","h":"#examples","p":989},{"i":1000,"t":"type Config struct { // Time before deleting expired keys // // Default is 10 * time.Second GCInterval time.Duration }","s":"Config","u":"/storage/memory/","h":"#config","p":989},{"i":1002,"t":"var ConfigDefault = Config{ GCInterval: 10 * time.Second, }","s":"Default Config","u":"/storage/memory/","h":"#default-config","p":989},{"i":1004,"t":"A MongoDB storage driver using mongodb/mongo-go-driver.","s":"MongoDB","u":"/storage/mongodb/","h":"","p":1003},{"i":1006,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/mongodb/","h":"#table-of-contents","p":1003},{"i":1008,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *mongo.Database","s":"Signatures","u":"/storage/mongodb/","h":"#signatures","p":1003},{"i":1010,"t":"MongoDB is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the mongodb implementation: go get github.com/gofiber/storage/mongodb","s":"Installation","u":"/storage/mongodb/","h":"#installation","p":1003},{"i":1012,"t":"Import the storage package. import \"github.com/gofiber/storage/mongodb\" You can use the following possibilities to create a storage: // Initialize default config store := mongodb.New() // Initialize custom config store := mongodb.New(mongodb.Config{ Host: \"127.0.0.1\", Port: 27017, Database: \"fiber\", Collection: \"fiber_storage\", Reset: false, }) // Initialize custom config using connection string store := mongodb.New(mongodb.Config{ ConnectionURI: \"mongodb://user:password@127.0.0.1:27017\", Database: \"fiber\", Collection: \"fiber_storage\", Reset: false, })","s":"Examples","u":"/storage/mongodb/","h":"#examples","p":1003},{"i":1014,"t":"type Config struct { // Connection string to use for DB. Will override all other authentication values if used // // Optional. Default is \"\" ConnectionURI string // Host name where the DB is hosted // // Optional. Default is \"127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 27017 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Database name // // Optional. Default is \"fiber\" Database string // Collection name // // Optional. Default is \"fiber_storage\" Collection string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool }","s":"Config","u":"/storage/mongodb/","h":"#config","p":1003},{"i":1016,"t":"var ConfigDefault = Config{ ConnectionURI: \"\", Host: \"127.0.0.1\", Port: 27017, Database: \"fiber\", Collection: \"fiber_storage\", Reset: false, }","s":"Default Config","u":"/storage/mongodb/","h":"#default-config","p":1003},{"i":1018,"t":"A MSSQL storage driver using microsoft/go-mssqldb.","s":"MSSQL","u":"/storage/mssql/","h":"","p":1017},{"i":1020,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/mssql/","h":"#table-of-contents","p":1017},{"i":1022,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *sql.DB","s":"Signatures","u":"/storage/mssql/","h":"#signatures","p":1017},{"i":1024,"t":"MSSQL is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the mssql implementation: go get github.com/gofiber/storage/mssql","s":"Installation","u":"/storage/mssql/","h":"#installation","p":1017},{"i":1026,"t":"Import the storage package. import \"github.com/gofiber/storage/mssql\" You can use the following possibilities to create a storage: // Initialize default config store := mssql.New() // Initialize custom config store := mssql.New(mssql.Config{ Host: \"127.0.0.1\", Port: 1433, Database: \"fiber\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, SslMode: \"disable\", }) // Initialize custom config using connection string store := mssql.New(mssql.Config{ ConnectionURI: \"sqlserver://user:password@localhost:1433?database=fiber\" Reset: false, GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/mssql/","h":"#examples","p":1017},{"i":1028,"t":"// Config defines the config for storage. type Config struct { // Connection string to use for DB. Will override all other authentication values if used // // Optional. Default is \"\" ConnectionURI string // Host name where the DB is hosted // // Optional. Default is \"127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 1433 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Instance name // // Optional. Default is \"\" Instance string // Database name // // Optional. Default is \"fiber\" Database string // Table name // // Optional. Default is \"fiber_storage\" Table string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration // The SSL mode for the connection // // Optional. Default is \"disable\" SslMode string }","s":"Config","u":"/storage/mssql/","h":"#config","p":1017},{"i":1030,"t":"var ConfigDefault = Config{ ConnectionURI: \"\", Host: \"127.0.0.1\", Port: 1433, Database: \"fiber\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, SslMode: \"disable\", }","s":"Default Config","u":"/storage/mssql/","h":"#default-config","p":1017},{"i":1032,"t":"A MySQL storage driver using database/sql and go-sql-driver/mysql.","s":"MySQL","u":"/storage/mysql/","h":"","p":1031},{"i":1034,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/mysql/","h":"#table-of-contents","p":1031},{"i":1036,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *sql.DB","s":"Signatures","u":"/storage/mysql/","h":"#signatures","p":1031},{"i":1038,"t":"MySQL is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the mysql implementation: go get github.com/gofiber/storage/mysql","s":"Installation","u":"/storage/mysql/","h":"#installation","p":1031},{"i":1040,"t":"Import the storage package. import \"github.com/gofiber/storage/mysql\" You can use the following possibilities to create a storage: // Initialize default config store := mysql.New() // Initialize custom config store := mysql.New(mysql.Config{ Host: \"127.0.0.1\", Port: 3306, Database: \"fiber\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, }) // Initialize custom config using connection string store := mysql.New(mysql.Config{ ConnectionURI: \":@tcp(:)/\" Reset: false, GCInterval: 10 * time.Second, }) // Initialize custom config using sql db connection db, _ := sql.Open(\"mysql\", \":@tcp(:)/\") store := mysql.New(mysql.Config{ Db: db, Reset: false, GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/mysql/","h":"#examples","p":1031},{"i":1042,"t":"type Config struct { // DB Will override ConnectionURI and all other authentication values if used // // Optional. Default is nil Db *sql.DB // Connection string to use for DB. Will override all other authentication values if used // // Optional. Default is \"\" ConnectionURI string // Host name where the DB is hosted // // Optional. Default is \"127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 3306 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Database name // // Optional. Default is \"fiber\" Database string // Table name // // Optional. Default is \"fiber_storage\" Table string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration }","s":"Config","u":"/storage/mysql/","h":"#config","p":1031},{"i":1044,"t":"var ConfigDefault = Config{ ConnectionURI: \"\", Host: \"127.0.0.1\", Port: 3306, Database: \"fiber\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, }","s":"Default Config","u":"/storage/mysql/","h":"#default-config","p":1031},{"i":1046,"t":"A fast key-value DB using cockroachdb/pebble","s":"Pebble","u":"/storage/pebble/","h":"","p":1045},{"i":1048,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/pebble/","h":"#table-of-contents","p":1045},{"i":1050,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *badger.DB","s":"Signatures","u":"/storage/pebble/","h":"#signatures","p":1045},{"i":1052,"t":"Pebble is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// Note: This step is only required if you don't have an existing module. And then install the Pebble implementation: go get github.com/gofiber/storage/pebble","s":"Installation","u":"/storage/pebble/","h":"#installation","p":1045},{"i":1054,"t":"Import the storage package. import \"github.com/gofiber/storage/pebble\" You can use the following possibilities to create a storage: // Initialize default config store := pebble.New() // Initialize custom config store := pebble.New(pebble.Config{ Path: \"db\", WriteOptions: &pebble.WriteOptions{}, })","s":"Examples","u":"/storage/pebble/","h":"#examples","p":1045},{"i":1056,"t":"type Config struct { // Database name // // Optional. Default is \"./db\" Path string // Pass write options during write operations // // Optional. Default is nil WriteOptions &pebble.WriteOptions{} }","s":"Config","u":"/storage/pebble/","h":"#config","p":1045},{"i":1058,"t":"var ConfigDefault = Config{ Path: \"db\", WriteOptions: &pebble.WriteOptions{}, }","s":"Default Config","u":"/storage/pebble/","h":"#default-config","p":1045},{"i":1060,"t":"A Postgres storage driver using jackc/pgx.","s":"Postgres","u":"/storage/postgres/","h":"","p":1059},{"i":1062,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/postgres/","h":"#table-of-contents","p":1059},{"i":1064,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *pgxpool.Pool","s":"Signatures","u":"/storage/postgres/","h":"#signatures","p":1059},{"i":1066,"t":"Postgres is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the postgres implementation: go get github.com/gofiber/storage/postgres/v2","s":"Installation","u":"/storage/postgres/","h":"#installation","p":1059},{"i":1068,"t":"Import the storage package. import \"github.com/gofiber/storage/postgres/v2\" You can use the following possibilities to create a storage: // Initialize default config store := postgres.New() // Initialize custom config store := postgres.New(postgres.Config{ Db: dbPool, Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/postgres/","h":"#examples","p":1059},{"i":1070,"t":"// Config defines the config for storage. type Config struct { // DB pgxpool.Pool object will override connection uri and other connection fields // // Optional. Default is nil DB *pgxpool.Pool // Connection string to use for DB. Will override all other authentication values if used // // Optional. Default is \"\" ConnectionURI string // Host name where the DB is hosted // // Optional. Default is \"127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 5432 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Database name // // Optional. Default is \"fiber\" Database string // Table name // // Optional. Default is \"fiber_storage\" Table string // The SSL mode for the connection // // Optional. Default is \"disable\" SSLMode string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration }","s":"Config","u":"/storage/postgres/","h":"#config","p":1059},{"i":1072,"t":"// ConfigDefault is the default config var ConfigDefault = Config{ ConnectionURI: \"\", Host: \"127.0.0.1\", Port: 5432, Database: \"fiber\", Table: \"fiber_storage\", SSLMode: \"disable\", Reset: false, GCInterval: 10 * time.Second, }","s":"Default Config","u":"/storage/postgres/","h":"#default-config","p":1059},{"i":1074,"t":"A Redis storage driver using go-redis/redis.","s":"Redis","u":"/storage/redis/","h":"","p":1073},{"i":1076,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/redis/","h":"#table-of-contents","p":1073},{"i":1078,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() redis.UniversalClient","s":"Signatures","u":"/storage/redis/","h":"#signatures","p":1073},{"i":1080,"t":"Redis is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the redis implementation: go get github.com/gofiber/storage/redis/v2","s":"Installation","u":"/storage/redis/","h":"#installation","p":1073},{"i":1082,"t":"Import the storage package. import \"github.com/gofiber/storage/redis/v2\" You can use the one of the following options to create a Redis Storage: // Initialize default config store := redis.New() // Initialize custom config store := redis.New(redis.Config{ Host: \"127.0.0.1\", Port: 6379, Username: \"\", Password: \"\", Database: 0, Reset: false, TLSConfig: nil, PoolSize: 10 * runtime.GOMAXPROCS(0), }) // Initialize Redis Failover Client store := redis.New(redis.Config{ MasterName: \"master-name\", Addrs: []string{\":6379\"}, }) // Initialize Redis Cluster Client store := redis.New(redis.Config{ Addrs: []string{\":6379\", \":6380\"}, }) // Create a client with support for TLS cer, err := tls.LoadX509KeyPair(\"./client.crt\", \"./client.key\") if err != nil { log.Println(err) return } tlsCfg := &tls.Config{ MinVersion: tls.VersionTLS12, InsecureSkipVerify: true, Certificates: []tls.Certificate{cer}, } store = redis.New(redis.Config{ URL: \"redis://:@127.0.0.1:6379/\", TLSConfig: tlsCfg, Reset: false, }) // Create a client with a Redis URL with all information. store = redis.New(redis.Config{ URL: \"redis://:@127.0.0.1:6379/\", Reset: false, })","s":"Examples","u":"/storage/redis/","h":"#examples","p":1073},{"i":1084,"t":"type Config struct { // Host name where the DB is hosted // // Optional. Default is \"127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 6379 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Database to be selected after connecting to the server. // // Optional. Default is 0 Database int // URL standard format Redis URL. If this is set all other config options, Host, Port, Username, Password, Database have no effect. // // Example: redis://:@localhost:6379/ // Optional. Default is \"\" URL string // Either a single address or a seed list of host:port addresses, this enables FailoverClient and ClusterClient // // Optional. Default is []string{} Addrs []string // MasterName is the sentinel master's name // // Optional. Default is \"\" MasterName string // ClientName will execute the `CLIENT SETNAME ClientName` command for each conn. // // Optional. Default is \"\" ClientName string // SentinelUsername // // Optional. Default is \"\" SentinelUsername string // SentinelPassword // // Optional. Default is \"\" SentinelPassword string // Reset clears any existing keys in existing Collection // // Optional. Default is false Reset bool // TLS Config to use. When set TLS will be negotiated. // // Optional. Default is nil TLSConfig *tls.Config // Maximum number of socket connections. // // Optional. Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS. PoolSize int }","s":"Config","u":"/storage/redis/","h":"#config","p":1073},{"i":1086,"t":"var ConfigDefault = Config{ Host: \"127.0.0.1\", Port: 6379, Username: \"\", Password: \"\", URL: \"\", Database: 0, Reset: false, TLSConfig: nil, PoolSize: 10 * runtime.GOMAXPROCS(0), Addrs: []string{}, MasterName: \"\", ClientName: \"\", SentinelUsername: \"\", SentinelPassword: \"\", }","s":"Default Config","u":"/storage/redis/","h":"#default-config","p":1073},{"i":1088,"t":"A Memory-bound storage driver using dgraph-io/ristretto.","s":"Ristretto","u":"/storage/ristretto/","h":"","p":1087},{"i":1090,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/ristretto/","h":"#table-of-contents","p":1087},{"i":1092,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *ristretto.Cache","s":"Signatures","u":"/storage/ristretto/","h":"#signatures","p":1087},{"i":1094,"t":"Ristretto is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the ristretto implementation: go get github.com/gofiber/storage/ristretto","s":"Installation","u":"/storage/ristretto/","h":"#installation","p":1087},{"i":1096,"t":"Import the storage package. import \"github.com/gofiber/storage/ristretto\" You can use the following possibilities to create a storage: // Initialize default config store := ristretto.New() // Initialize custom config store := ristretto.New(ristretto.Config{ NumCounters: 1e7, // number of keys to track frequency of (10M). MaxCost: 1 << 30, // maximum cost of cache (1GB). BufferItems: 64, // number of keys per Get buffer. })","s":"Examples","u":"/storage/ristretto/","h":"#examples","p":1087},{"i":1098,"t":"type Config struct { // NumCounters number of keys to track frequency of (10M). NumCounters int64 // MaxCost maximum cost of cache (1GB). MaxCost int64 // BufferItems number of keys per Get buffer. BufferItems int64 }","s":"Config","u":"/storage/ristretto/","h":"#config","p":1087},{"i":1100,"t":"var ConfigDefault = Config{ NumCounters: 1e7, MaxCost: 1 << 30, BufferItems: 64, DefaultCost: 1, }","s":"Default Config","u":"/storage/ristretto/","h":"#default-config","p":1087},{"i":1102,"t":"A S3 storage driver using aws/aws-sdk-go-v2. Note: If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: specifying credentials","s":"S3","u":"/storage/s3/","h":"","p":1101},{"i":1104,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/s3/","h":"#table-of-contents","p":1101},{"i":1106,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *s3.Client","s":"Signatures","u":"/storage/s3/","h":"#signatures","p":1101},{"i":1108,"t":"S3 is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the s3 implementation: go get github.com/gofiber/storage/s3","s":"Installation","u":"/storage/s3/","h":"#installation","p":1101},{"i":1110,"t":"Import the storage package. import \"github.com/gofiber/storage/s3\" You can use the following possibilities to create a storage: // Initialize default config store := s3.New() // Initialize custom config store := s3.New(s3.Config{ Bucket: \"my-bucket-url\", Endpoint: \"my-endpoint\", Region: \"my-region\", Reset: false, })","s":"Examples","u":"/storage/s3/","h":"#examples","p":1101},{"i":1112,"t":"// Config defines the config for storage. type Config struct { // S3 bucket name Bucket string // AWS endpoint Endpoint string // AWS region Region string // Request timeout // // Optional. Default is 0 (no timeout) RequestTimeout time.Duration // Reset clears any existing keys in existing Bucket // // Optional. Default is false Reset bool // Credentials overrides AWS access key and AWS secret access key. Not recommended. // // Optional. Default is Credentials{} Credentials Credentials // The maximum number of times requests that encounter retryable failures should be attempted. // // Optional. Default is 3 MaxAttempts int } type Credentials struct { AccessKey string SecretAccessKey string }","s":"Config","u":"/storage/s3/","h":"#config","p":1101},{"i":1114,"t":"The default configuration lacks Bucket, Region, and Endpoint which are all required and must be overwritten: // ConfigDefault is the default config var ConfigDefault = Config{ Bucket: \"\", Region: \"\", Endpoint: \"\", Credentials: Credentials{}, MaxAttempts: 3, RequestTimeout: 0, Reset: false, }","s":"Default Config","u":"/storage/s3/","h":"#default-config","p":1101},{"i":1116,"t":"A SQLite3 storage driver using mattn/go-sqlite3.","s":"SQLite3","u":"/storage/sqlite3/","h":"","p":1115},{"i":1118,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/sqlite3/","h":"#table-of-contents","p":1115},{"i":1120,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *sql.DB","s":"Signatures","u":"/storage/sqlite3/","h":"#signatures","p":1115},{"i":1122,"t":"SQLite3 is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the sqlite3 implementation: go get github.com/gofiber/storage/sqlite3","s":"Installation","u":"/storage/sqlite3/","h":"#installation","p":1115},{"i":1124,"t":"Import the storage package. import \"github.com/gofiber/storage/sqlite3\" You can use the following possibilities to create a storage: // Initialize default config store := sqlite3.New() // Initialize custom config store := sqlite3.New(sqlite3.Config{ Database: \"./fiber.sqlite3\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, MaxOpenConns: 100, MaxIdleConns: 100, ConnMaxLifetime: 1 * time.Second, })","s":"Examples","u":"/storage/sqlite3/","h":"#examples","p":1115},{"i":1126,"t":"type Config struct { // Database name // // Optional. Default is \"fiber\" Database string // Table name // // Optional. Default is \"fiber_storage\" Table string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration // ////////////////////////////////// // Adaptor related config options // // ////////////////////////////////// // MaxIdleConns sets the maximum number of connections in the idle connection pool. // // Optional. Default is 100. MaxIdleConns int // MaxOpenConns sets the maximum number of open connections to the database. // // Optional. Default is 100. MaxOpenConns int // ConnMaxLifetime sets the maximum amount of time a connection may be reused. // // Optional. Default is 1 second. ConnMaxLifetime time.Duration }","s":"Config","u":"/storage/sqlite3/","h":"#config","p":1115},{"i":1128,"t":"var ConfigDefault = Config{ Database: \"./fiber.sqlite3\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, MaxOpenConns: 100, MaxIdleConns: 100, ConnMaxLifetime: 1 * time.Second, }","s":"Default Config","u":"/storage/sqlite3/","h":"#default-config","p":1115},{"i":1130,"t":"This package provides universal methods to use multiple template engines with the Fiber web framework using the new Views interface that is available from > v1.11.1. Special thanks to @bdtomlin & @arsmn for helping! 9 template engines are supported: html ace amber django handlebars jet mustache pug slim","s":"πŸ‘‹ Welcome","u":"/template/","h":"","p":1129},{"i":1132,"t":"Go version 1.17 or higher is required. go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/template/any_template_engine/vX","s":"Installation","u":"/template/","h":"#installation","p":1129},{"i":1134,"t":"package main import ( \"log\" \"github.com/gofiber/fiber/v2\" // To use a specific template engine, import as shown below: // \"github.com/gofiber/template/pug\" // \"github.com/gofiber/template/mustache\" // etc.. // In this example we use the html template engine \"github.com/gofiber/template/html/v2\" ) func main() { // Create a new engine by passing the template folder // and template extension using .New(dir, ext string) engine := html.New(\"./views\", \".html\") // We also support the http.FileSystem interface // See examples below to load templates from embedded files engine := html.NewFileSystem(http.Dir(\"./views\"), \".html\") // Reload the templates on each render, good for development engine.Reload(true) // Optional. Default: false // Debug will print each template that is parsed, good for debugging engine.Debug(true) // Optional. Default: false // Layout defines the variable name that is used to yield templates within layouts engine.Layout(\"embed\") // Optional. Default: \"embed\" // Delims sets the action delimiters to the specified strings engine.Delims(\"{{\", \"}}\") // Optional. Default: engine delimiters // AddFunc adds a function to the template's global function map. engine.AddFunc(\"greet\", func(name string) string { return \"Hello, \" + name + \"!\" }) // After you created your engine, you can pass it to Fiber's Views Engine app := fiber.New(fiber.Config{ Views: engine, }) // To render a template, you can call the ctx.Render function // Render(tmpl string, values interface{}, layout ...string) app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) // Render with layout example app.Get(\"/layout\", func(c *fiber.Ctx) error { return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Example","u":"/template/","h":"#example","p":1129},{"i":1136,"t":"To view more specific examples, you could visit each engine folder to learn more html ace amber django handlebars jet mustache pug slim","s":"More Examples","u":"/template/","h":"#more-examples","p":1129},{"i":1138,"t":"We support the http.FileSystem interface, so you can use different libraries to load the templates from embedded binaries. pkger​ Read documentation: https://github.com/markbates/pkger package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" \"github.com/markbates/pkger\" ) func main() { engine := html.NewFileSystem(pkger.Dir(\"/views\"), \".html\") app := fiber.New(fiber.Config{ Views: engine, }) // run pkger && go build } packr​ Read documentation: https://github.com/gobuffalo/packr package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" \"github.com/gobuffalo/packr/v2\" ) func main() { engine := html.NewFileSystem(packr.New(\"Templates\", \"/views\"), \".html\") app := fiber.New(fiber.Config{ Views: engine, }) // run packr && go build } go.rice​ Read documentation: https://github.com/GeertJohan/go.rice package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" \"github.com/GeertJohan/go.rice\" ) func main() { engine := html.NewFileSystem(rice.MustFindBox(\"views\").HTTPBox(), \".html\") app := fiber.New(fiber.Config{ Views: engine, }) // run rice embed-go && go build } fileb0x​ Read documentation: https://github.com/UnnoTed/fileb0x package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" // your generated package \"github.com///static\" ) func main() { engine := html.NewFileSystem(static.HTTP, \".html\") app := fiber.New(fiber.Config{ Views: engine, }) // Read the documentation on how to use fileb0x }","s":"embedded Systems","u":"/template/","h":"#embedded-systems","p":1129},{"i":1140,"t":"Simple​ Extended​ Benchmarks were ran on Apple Macbook M1. Each engine was benchmarked 20 times and the results averaged into a single xlsx file. Mustache was excluded from the extended benchmark","s":"Benchmarks","u":"/template/","h":"#benchmarks","p":1129},{"i":1142,"t":"Ace is a template engine create by yossi, to see the original syntax documentation please click here","s":"Ace","u":"/template/ace/","h":"","p":1141},{"i":1144,"t":"./views/index.ace = include ./views/partials/header . h1 {{.Title}} = include ./views/partials/footer . ./views/partials/header.ace h1 Header ./views/partials/footer.ace h1 Footer ./views/layouts/main.ace = doctype html html head title Main body {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/ace/v2\" ) func main() { // Create a new engine engine := ace.New(\"./views\", \".ace\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := html.NewFileSystem(http.Dir(\"./views\", \".ace\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/ace/","h":"#basic-example","p":1141},{"i":1146,"t":"Amber is a template engine create by eknkc, to see the original syntax documentation please click here","s":"Amber","u":"/template/amber/","h":"","p":1145},{"i":1148,"t":"./views/index.amber import ./views/partials/header h1 #{Title} import ./views/partials/footer ./views/partials/header.amber h1 Header ./views/partials/footer.amber h1 Footer ./views/layouts/main.amber doctype html html head title Main body #{embed()} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/amber/v2\" ) func main() { // Create a new engine engine := amber.New(\"./views\", \".amber\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := html.NewFileSystem(http.Dir(\"./views\", \".amber\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/amber/","h":"#basic-example","p":1145},{"i":1150,"t":"Django is a template engine create by flosch, to see the original syntax documentation please click here","s":"Django","u":"/template/django/","h":"","p":1149},{"i":1152,"t":"./views/index.django {% include \"partials/header.django\" %}

{{ Title }}

{% include \"partials/footer.django\" %} ./views/partials/header.django

Header

./views/partials/footer.django

Footer

./views/layouts/main.django Main {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/django/v3\" ) func main() { // Create a new engine engine := django.New(\"./views\", \".django\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := html.NewFileSystem(http.Dir(\"./views\", \".django\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/django/","h":"#basic-example","p":1149},{"i":1154,"t":"When using the // go:embed directive, resolution of inherited templates using django's {% extend '' %} keyword fails when instantiating the template engine with django.NewFileSystem(). In that case, use the django.NewPathForwardingFileSystem() function to instantiate the template engine. This function provides the proper configuration for resolving inherited templates. Assume you have the following files: views/ancenstor.django views/descendant.djando then package main import ( \"log\" \"embed\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/django/v3\" ) //go:embed views var viewsAsssets embed.FS func main() { // Create a new engine engine := NewPathForwardingFileSystem(http.FS(viewsAsssets), \"/views\", \".django\") // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render descendant return c.Render(\"descendant\", fiber.Map{ \"greeting\": \"World\", }) }) log.Fatal(app.Listen(\":3000\")) }","s":"Using embedded file system (1.16+ only)","u":"/template/django/","h":"#using-embedded-file-system-116-only","p":1149},{"i":1156,"t":"// My custom function func Nl2brHtml(value interface{}) string { if str, ok := value.(string); ok { return strings.Replace(str, \"\\n\", \"
\", -1) } return \"\" } // Create a new engine engine := django.New(\"./views\", \".django\") // register functions engine.AddFunc(\"nl2br\", Nl2brHtml) // Pass the engine to the Views app := fiber.New(fiber.Config{Views: engine}) in the handler c.Render(\"index\", fiber.Map{ \"Fiber\": \"Hello, World!\\n\\nGreetings from Fiber Team\", }) ./views/index.django {{ nl2br(Fiber) }} Output: Hello, World!

Greetings from Fiber Team ","s":"Register and use custom functions","u":"/template/django/","h":"#register-and-use-custom-functions","p":1149},{"i":1158,"t":"Handlebars is a template engine create by aymerick, to see the original syntax documentation please click here","s":"Handlebars","u":"/template/handlebars/","h":"","p":1157},{"i":1160,"t":"./views/index.hbs {{> 'partials/header' }}

{{Title}}

{{> 'partials/footer' }} ./views/partials/header.hbs

Header

./views/partials/footer.hbs

Footer

./views/layouts/main.hbs Main {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/handlebars/v2\" ) func main() { // Create a new engine engine := handlebars.New(\"./views\", \".hbs\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := html.NewFileSystem(http.Dir(\"./views\", \".hbs\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/handlebars/","h":"#basic-example","p":1157},{"i":1162,"t":"HTML is the official Go template engine html/template, to see the original syntax documentation please click here Info: All templates within the specified view directory are analyzed and compiled at the beginning to increase the performance when using them. Thus it should be noted that no definition with the same name should exist, otherwise they will overwrite each other. For templating the {{embed}} tag should be used","s":"HTML","u":"/template/html/","h":"","p":1161},{"i":1164,"t":"./views/index.html {{template \"partials/header\" .}}

{{.Title}}

{{template \"partials/footer\" .}} ./views/partials/header.html

Header

./views/partials/footer.html

Footer

./views/layouts/main.html Main {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html/v2\" ) func main() { // Create a new engine engine := html.New(\"./views\", \".html\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := html.NewFileSystem(http.Dir(\"./views\", \".html\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/html/","h":"#basic-example","p":1161},{"i":1166,"t":"package main import ( \"log\" \"net/http\" \"embed\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" ) //go:embed views/* var viewsfs embed.FS func main() { engine := html.NewFileSystem(http.FS(viewsfs), \".html\") // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index - start with views directory return c.Render(\"views/index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) log.Fatal(app.Listen(\":3000\")) } and change the starting point to the views directory ./views/index.html {{template \"views/partials/header\" .}}

{{.Title}}

{{template \"views/partials/footer\" .}}","s":"Example with embed.FS","u":"/template/html/","h":"#example-with-embedfs","p":1161},{"i":1168,"t":"package main import ( \"embed\" \"html/template\" \"log\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" ) //go:embed views/* var viewsfs embed.FS func main() { engine := html.NewFileSystem(http.FS(viewsfs), \".html\") engine.AddFunc( // add unescape function \"unescape\", func(s string) template.HTML { return template.HTML(s) }, ) // Pass the engine to the Views app := fiber.New(fiber.Config{Views: engine}) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"views/index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) log.Fatal(app.Listen(\":3000\")) } and change the starting point to the views directory ./views/index.html

{{ unescape .Title}}

html output

Hello, World!

","s":"Example with innerHTML","u":"/template/html/","h":"#example-with-innerhtml","p":1161},{"i":1170,"t":"The Go standard library provides a set of packages to generate output. The text/template package implements templates for generating text output, while the html/template package implements templates for generating HTML output that is safe against certain attacks. Both packages use the same interface but the following examples of the core features are directed towards HTML applications.","s":"Golang Templates Cheatsheet","u":"/template/html/TEMPLATES_CHEATSHEET","h":"","p":1169},{"i":1172,"t":"Parsing and Creating Templates Executing Templates Template Encoding and HTML Template Variables Template Actions Template Functions Template Comparison Functions Nested Templates and Layouts Templates Calling Functions","s":"Table of Contents","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#table-of-contents","p":1169},{"i":1174,"t":"Naming Templates​ There is no defined file extension for Go templates. One of the most popular is .tmpl supported by vim-go and referenced in the text/template godocs. The extension .gohtml supports syntax highlighting in both Atom and GoSublime editors. Finally analysis of large Go codebases finds that .tpl is often used by developers. While the extension is not important it is still good to be consistent within a project for clarity. Creating a Template​ tpl, err := template.Parse(filename) will get the template at filename and store it in tpl. tpl can then be executed to show the template. Parsing Multiple Templates​ template.ParseFiles(filenames) takes a list of filenames and stores all templates. template.ParseGlob(pattern) will find all templates matching the pattern and store the templates.","s":"Parsing and Creating Templates","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#parsing-and-creating-templates","p":1169},{"i":1176,"t":"Execute a Single Template​ Once a template has been parsed there are two options to execute them. A single template tpl can be executed using tpl.Execute(io.Writer, data). The content of tpl will be written to the io.Writer. Data is an interface passed to the template that will be useable in the template. Executing a Named Template​ tpl.ExecuteTemplate(io.Writer, name, data) works the same as execute but allows for a string name of the template the user wants to execute.","s":"Executing Templates","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#executing-templates","p":1169},{"i":1178,"t":"Contextual Encoding​ Go’s html/template package does encoding based on the context of the code. As a result, html/template encodes any characters that need encoding to be rendered correctly. For example the < and > in \"

A header!

\" will be encoded as <h1>A header!</h1> . Type template.HTML can be used to skip encoding by telling Go the string is safe. template.HTML(\"

A Safe header

\") will then be

A Safe header

. Using this type with user input is dangerous and leaves the application vulnerable. The go html/template package is aware of attributes within the template and will encode values differently based on the attribute. Go templates can also be used with javascript. Structs and maps will be expanded into JSON objects and quotes will be added to strings for use in function parameters and as variable values. // Go type Cat struct { Name string Age int } kitten := Cat{\"Sam\", 12} // Template // Javascript var cat = {\"Name\":\"Sam\", \"Age\" 12} Safe Strings and HTML Comments​ The html/template package will remove any comments from a template by default. This can cause issues when comments are necessary such as detecting internet explorer. We can use the Custom Functions method (Globally) to create a function that returns html preserving comments. Define a function htmlSafe in the FuncMap of the template. testTemplate, err = template.New(\"hello.gohtml\").Funcs(template.FuncMap{ \"htmlSafe\": func(html string) template.HTML { return template.HTML(html) }, }).ParseFiles(\"hello.gohtml\") This function takes a string and produces the unaltered HTML code. This function can be used in a template like so to preserve the comments : {{htmlSafe \"\" }}","s":"Template Encoding and HTML","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-encoding-and-html","p":1169},{"i":1180,"t":"The dot character (.)​ A template variable can be a boolean, string, character, integer, floating-point, imaginary, or complex constant in Go syntax. Data passed to the template can be accessed using dot {{ . }}. If the data is a complex type then it’s fields can be accessed using the dot with the field name {{ .FieldName }}. Dots can be chained together if the data contains multiple complex structures. {{ .Struct.StructTwo.Field }} Variables in Templates​ Data passed to the template can be saved in a variable and used throughout the template. {{$number := .}} We use the $number to create a variable then initialize it with the value passed to the template. To use the variable we call it in the template with {{$number}}. {{$number := .}}

It is day number {{$number}} of the month

var tpl *template.Template tpl = template.Must(template.ParseFiles(\"templateName\")) err := tpl.ExecuteTemplate(os.Stdout, \"templateName\", 23) In this example we pass 23 to the template and stored in the $number variable which can be used anywhere in the template","s":"Template Variables","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-variables","p":1169},{"i":1182,"t":"If/Else Statements​ Go templates support if/else statements like many programming languages. We can use the if statement to check for values, if it doesn’t exist we can use an else value. The empty values are false, 0, any nil pointer or interface value, and any array, slice, map, or string of length zero.

Hello, {{if .Name}} {{.Name}} {{else}} Anonymous {{end}}!

If .Name exists then Hello, Name will be printed (replaced with the name value) otherwise it will print Hello, Anonymous. Templates also provide the else if statment {{else if .Name2 }} which can be used to evaluate other options after an if. Removing Whitespace​ Adding different values to a template can add various amounts of whitespace. We can either change our template to better handle it, by ignoring or minimizing effects, or we can use the minus sign - within out template.

Hello, {{if .Name}} {{.Name}} {{- else}} Anonymous {{- end}}!

Here we are telling the template to remove all spaces between the Name variable and whatever comes after it. We are doing the same with the end keyword. This allows us to have whitespace within the template for easier reading but remove it in production. Range Blocks​ Go templates have a range keyword to iterate over all objects in a structure. Suppose we had the Go structures: type Item struct { Name string Price int } type ViewData struct { Name string Items []Item } We have an Item, with a name and price, then a ViewData which is the structure sent to the template. Consider the template containing the following: {{range .Items}}

{{.Name}}

${{.Price}}
{{end}} For each Item in the range of Items (in the ViewData structure) get the Name and Price of that item and create html for each Item automatically. Within a range each Item becomes the {{.}} and the item properties therefore become {{.Name}} or {{.Price}} in this example.","s":"Template Actions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-actions","p":1169},{"i":1184,"t":"The template package provides a list of predefined global functions. Below are some of the most used. Indexing structures in Templates​ If the data passed to the template is a map, slice, or array it can be indexed from the template. We use {{index x number}} where index is the keyword, x is the data and number is a integer for the index value. If we had {{index names 2}} it is equivalent to names[2]. We can add more integers to index deeper into data. {{index names 2 3 4}} is equivalent to names[2][3][4].

{{index .FavNums 2 }}

type person struct { Name string FavNums []int } func main() { tpl := template.Must(template.ParseGlob(\"*.gohtml\")) tpl.Execute(os.Stdout, &person{\"Curtis\", []int{7, 11, 94}}) } This code example passes a person structure and gets the 3rd favourite number from the FavNums slice. The and Function​ The and function returns the boolean AND of its arguments by returning the first empty argument or the last argument. and x y behaves logically as if x then y else x . Consider the following go code type User struct { Admin bool } type ViewData struct { *User } Pass a ViewData with a User that has Admin set true to the following template {{if and .User .User.Admin}} You are an admin user! {{else}} Access denied! {{end}} The result will be You are an admin user!. However if the ViewData did not include a *User object or Admin was set as false then the result will be Access denied!. The or Function​ The or function operates similarly to the and function however will stop at the first true. or x y is equivalent to if x then x else y so y will never be evaluated if x is not empty. The not Function​ The not function returns the boolean negation of the argument. {{ if not .Authenticated}} Access Denied! {{ end }}","s":"Template Functions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-functions","p":1169},{"i":1186,"t":"Comparisons​ The html/template package provides a variety of functions to do comparisons between operators. The operators may only be basic types or named basic types such as type Temp float32 Remember that template functions take the form {{ function arg1 arg2 }}. eq Returns the result of arg1 == arg2 ne Returns the result of arg1 != arg2 lt Returns the result of arg1 < arg2 le Returns the result of arg1 <= arg2 gt Returns the result of arg1 > arg2 ge Returns the result of arg1 >= arg2 Of special note eq can be used with two or more arguments by comparing all arguments to the first. {{ eq arg1 arg2 arg3 arg4}} will result in the following logical expression: arg1==arg2 || arg1==arg3 || arg1==arg4","s":"Template Comparison Functions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-comparison-functions","p":1169},{"i":1188,"t":"Nesting Templates​ Nested templates can be used for parts of code frequently used across templates, a footer or header for example. Rather than updating each template separately we can use a nested template that all other templates can use. You can define a template as follows: {{define \"footer\"}}

Here is the footer

{{end}} A template named β€œfooter” is defined which can be used in other templates like so to add the footer template content into the other template: {{template \"footer\"}} Passing Variables between Templates​ The template action used to include nested templates also allows a second parameter to pass data to the nested template. // Define a nested template called header {{define \"header\"}}

{{.}}

{{end}} // Call template and pass a name parameter {{range .Items}}
{{template \"header\" .Name}} ${{.Price}}
{{end}} We use the same range to loop through Items as before but we pass the name to the header template each time in this simple example. Creating Layouts​ Glob patterns specify sets of filenames with wildcard characters. The template.ParseGlob(pattern string) function will parse all templates that match the string pattern. template.ParseFiles(files...) can also be used with a list of file names. The templates are named by default based on the base names of the argument files. This mean views/layouts/hello.gohtml will have the name hello.gohtml . If the template has a `{{define β€œtemplateName”}} within it then that name will be usable. A specific template can be executed using t.ExecuteTemplate(w, \"templateName\", nil) . t is an object of type Template, w is type io.Writer such as an http.ResponseWriter, Then there is the name of the template to execute, and finally passing any data to the template, in this case a nil value. Example main.go file // Omitted imports & package var LayoutDir string = \"views/layouts\" var bootstrap *template.Template func main() { var err error bootstrap, err = template.ParseGlob(LayoutDir + \"/*.gohtml\") if err != nil { panic(err) } http.HandleFunc(\"/\", handler) http.ListenAndServe(\":8080\", nil) } func handler(w http.ResponseWriter, r *http.Request) { bootstrap.ExecuteTemplate(w, \"bootstrap\", nil) } All .gohtml files are parsed in main. When route / is reached the template defined as bootstrap is executed using the handler function. Example views/layouts/bootstrap.gohtml file {{define \"bootstrap\"}} Go Templates

Filler header

Filler paragraph

{{end}}","s":"Nested Templates and Layouts","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#nested-templates-and-layouts","p":1169},{"i":1190,"t":"Function Variables (calling struct methods)​ We can use templates to call the methods of objects in the template to return data. Consider the User struct with the following method. type User struct { ID int Email string } func (u User) HasPermission(feature string) bool { if feature == \"feature-a\" { return true } else { return false } } When a type User has been passed to the template we can then call this method from the template. {{if .User.HasPermission \"feature-a\"}}

Feature A

Some other stuff here...

{{else}}

Feature A

To enable Feature A please upgrade your plan

{{end}} The template checks if the User HasPermission for the feature and renders depending on the result. Function Variables (call)​ If the Method HasPermission has to change at times then the Function Variables (Methods) implementation may not fit the design. Instead a HasPermission func(string) bool attribute can be added on the User type. This can then have a function assigned to it at creation. // Structs type ViewData struct { User User } type User struct { ID int Email string HasPermission func(string) bool } // Example of creating a ViewData vd := ViewData{ User: User{ ID: 1, Email: \"curtis.vermeeren@gmail.com\", // Create the HasPermission function HasPermission: func(feature string) bool { if feature == \"feature-b\" { return true } return false }, }, } // Executing the ViewData with the template err := testTemplate.Execute(w, vd) We need to tell the Go template that we want to call this function so we must change the template from the Function Variables (Methods) implementation to do this. We use the call keyword supplied by the go html/template package. Changing the previous template to use call results in: {{if (call .User.HasPermission \"feature-b\")}}

Feature B

Some other stuff here...

{{else}}

Feature B

To enable Feature B please upgrade your plan

{{end}} Custom Functions​ Another way to call functions is to create custom functions with template.FuncMap . This method creates global methods that can be used throughout the entire application. FuncMap has type map[string]interface{} mapping a string, the function name, to a function. The mapped functions must have either a single return value, or two return values where the second has type error. // Creating a template with function hasPermission testTemplate, err = template.New(\"hello.gohtml\").Funcs(template.FuncMap{ \"hasPermission\": func(user User, feature string) bool { if user.ID == 1 && feature == \"feature-a\" { return true } return false }, }).ParseFiles(\"hello.gohtml\") Here the function to check if a user has permission for a feature is mapped to the string \"hasPermission\" and stored in the FuncMap. Note that the custom functions must be created before calling ParseFiles() The function could be executed in the template as follows: {{ if hasPermission .User \"feature-a\" }} The .User and string \"feature-a\" are both passed to hasPermission as arguments. Custom Functions (Globally)​ The previous two methods of custom functions rely on .User being passed to the template. This works in many cases but in a large application passing too many objects to a template can become difficult to maintain across many templates. We can change the implementation of the custom function to work without the .User being passed. Using a similar feature example as the other 2 sections first you would have to create a default hasPermission function and define it in the template’s function map. testTemplate, err = template.New(\"hello.gohtml\").Funcs(template.FuncMap{ \"hasPermission\": func(feature string) bool { return false }, }).ParseFiles(\"hello.gohtml\") This function could be placed in main() or somewhere that ensures the default hasPermission is created in the hello.gohtml function map. The default function just returns false but it defines the function and implementation that doesn’t require User . Next a closure could be used to redefine the hasPermission function. It would use the User data available when it is created in a handler rather than having User data passed to it. Within the handler for the template you can redefine any functions to use the information available. func handler(w http.ResponseWriter, r *http.Request) { w.Header().Set(\"Content-Type\", \"text/html\") user := User{ ID: 1, Email: \"Curtis.vermeeren@gmail.com\", } vd := ViewData{} err := testTemplate.Funcs(template.FuncMap{ \"hasPermission\": func(feature string) bool { if user.ID == 1 && feature == \"feature-a\" { return true } return false }, }).Execute(w, vd) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } } In this handler a User is created with ID and Email, Then a ViewData is created without passing the user to it. The hasPermission function is redefined using user.ID which is available when the function is created. {{if hasPermission \"feature-a\"}} can be used in a template without having to pass a User to the template as the User object in the handler is used instead.","s":"Templates Calling Functions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#templates-calling-functions","p":1169},{"i":1192,"t":"Jet is a template engine create by cloudykit, to see the original syntax documentation please click here","s":"Jet","u":"/template/jet/","h":"","p":1191},{"i":1194,"t":"./views/index.jet {{include \"partials/header\"}}

{{ Title }}

{{include \"partials/footer\"}} ./views/partials/header.jet

Header

./views/partials/footer.jet

Footer

./views/layouts/main.jet Title {{ embed() }} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/jet/v2\" ) func main() { // Create a new engine engine := jet.New(\"./views\", \".jet\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := jet.NewFileSystem(http.Dir(\"./views\", \".jet\")) // Pass the engine to the views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/jet/","h":"#basic-example","p":1191},{"i":1196,"t":"Mustache is a template engine created by hoisie/cbroglie, to see the original syntax documentation please click here","s":"Mustache","u":"/template/mustache/","h":"","p":1195},{"i":1198,"t":"./views/index.mustache {{> views/partials/header }}

{{Title}}

{{> views/partials/footer }} ./views/partials/header.mustache

Header

./views/partials/footer.mustache

Footer

./views/layouts/main.mustache Main {{{embed}}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/mustache/v2\" ) func main() { // Create a new engine engine := mustache.New(\"./views\", \".mustache\") // Or from an embedded system // Note that with an embedded system the partials included from template files must be // specified relative to the filesystem's root, not the current working directory // engine := mustache.NewFileSystem(http.Dir(\"./views\", \".mustache\"), \".mustache\") // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/mustache/","h":"#basic-example","p":1195},{"i":1200,"t":"Pug is a template engine create by joker, to see the original syntax documentation please click here","s":"Pug","u":"/template/pug/","h":"","p":1199},{"i":1202,"t":"./views/index.pug include partials/header.pug h1 #{.Title} include partials/footer.pug ./views/partials/header.pug h2 Header ./views/partials/footer.pug h2 Footer ./views/layouts/main.pug doctype html html head title Main include ../partials/meta.pug body | {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/pug/v2\" // \"net/http\" // embedded system ) func main() { // Create a new engine engine := pug.New(\"./views\", \".pug\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := pug.NewFileSystem(http.Dir(\"./views\", \".pug\")) // Pass the engine to the views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/pug/","h":"#basic-example","p":1199},{"i":1204,"t":"Slim is a template engine created by mattn, to see the original syntax documentation please click here","s":"Slim","u":"/template/slim/","h":"","p":1203},{"i":1206,"t":"./views/index.slim == render(\"partials/header.slim\") h1 = Title == render(\"partials/footer.slim\") ./views/partials/header.slim h2 = Header ./views/partials/footer.slim h2 = Footer ./views/layouts/main.slim doctype html html head title Main include ../partials/meta.slim body | {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/slim/v2\" // \"net/http\" // embedded system ) func main() { // Create a new engine engine := slim.New(\"./views\", \".slim\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := slim.NewFileSystem(http.Dir(\"./views\", \".slim\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/slim/","h":"#basic-example","p":1203},{"i":1208,"t":"An online API documentation with examples so you can start building web apps with Fiber right away! Fiber is an Express inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development with zero memory allocation and performance in mind. These docs are for Fiber v2, which was released on September 15th, 2020.","s":"πŸ‘‹ Welcome","u":"/","h":"","p":1207},{"i":1210,"t":"First of all, download and install Go. 1.17 or higher is required. Installation is done using the go get command: go get github.com/gofiber/fiber/v2","s":"Installation","u":"/","h":"#installation","p":1207},{"i":1212,"t":"Some values returned from *fiber.Ctx are not immutable by default. Because fiber is optimized for high-performance, values returned from fiber.Ctx are not immutable by default and will be re-used across requests. As a rule of thumb, you must only use context values within the handler, and you must not keep any references. As soon as you return from the handler, any values you have obtained from the context will be re-used in future requests and will change below your feet. Here is an example: func handler(c *fiber.Ctx) error { // Variable is only valid within this handler result := c.Params(\"foo\") // ... } If you need to persist such values outside the handler, make copies of their underlying buffer using the copy builtin. Here is an example for persisting a string: func handler(c *fiber.Ctx) error { // Variable is only valid within this handler result := c.Params(\"foo\") // Make a copy buffer := make([]byte, len(result)) copy(buffer, result) resultCopy := string(buffer) // Variable is now valid forever // ... } We created a custom CopyString function that does the above and is available under gofiber/utils. app.Get(\"/:foo\", func(c *fiber.Ctx) error { // Variable is now immutable result := utils.CopyString(c.Params(\"foo\")) // ... }) Alternatively, you can also use the Immutable setting. It will make all values returned from the context immutable, allowing you to persist them anywhere. Of course, this comes at the cost of performance. app := fiber.New(fiber.Config{ Immutable: true, }) For more information, please check #426 and #185.","s":"Zero Allocation","u":"/","h":"#zero-allocation","p":1207},{"i":1214,"t":"Embedded below is essentially the most straightforward Fiber app you can create: package main import \"github.com/gofiber/fiber/v2\" func main() { app := fiber.New() app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) app.Listen(\":3000\") } go run server.go Browse to http://localhost:3000 and you should see Hello, World! on the page.","s":"Hello, World!","u":"/","h":"#hello-world","p":1207},{"i":1216,"t":"Routing refers to determining how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (GET, PUT, POST, etc.). Each route can have multiple handler functions that are executed when the route is matched. Route definition takes the following structures: // Function signature app.Method(path string, ...func(*fiber.Ctx) error) app is an instance of Fiber Method is an HTTP request method: GET, PUT, POST, etc. path is a virtual path on the server func(*fiber.Ctx) error is a callback function containing the Context executed when the route is matched Simple route // Respond with \"Hello, World!\" on root path, \"/\" app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) Parameters // GET http://localhost:8080/hello%20world app.Get(\"/:value\", func(c *fiber.Ctx) error { return c.SendString(\"value: \" + c.Params(\"value\")) // => Get request with value: hello world }) Optional parameter // GET http://localhost:3000/john app.Get(\"/:name?\", func(c *fiber.Ctx) error { if c.Params(\"name\") != \"\" { return c.SendString(\"Hello \" + c.Params(\"name\")) // => Hello john } return c.SendString(\"Where is john?\") }) Wildcards // GET http://localhost:3000/api/user/john app.Get(\"/api/*\", func(c *fiber.Ctx) error { return c.SendString(\"API path: \" + c.Params(\"*\")) // => API path: user/john })","s":"Basic routing","u":"/","h":"#basic-routing","p":1207},{"i":1218,"t":"To serve static files such as images, CSS, and JavaScript files, replace your function handler with a file or directory string. Function signature: app.Static(prefix, root string, config ...Static) Use the following code to serve files in a directory named ./public: app := fiber.New() app.Static(\"/\", \"./public\") app.Listen(\":3000\") Now, you can load the files that are in the ./public directory: http://localhost:8080/hello.html http://localhost:8080/js/jquery.js http://localhost:8080/css/style.css","s":"Static files","u":"/","h":"#static-files","p":1207},{"i":1220,"t":"For more information on how to build APIs in Go with Fiber, please check out this excellent article on building an express-style API in Go with Fiber.","s":"Note","u":"/","h":"#note","p":1207},{"i":1223,"t":"Use the Static method to serve static files such as images, CSS, and JavaScript. info By default, Static will serve index.html files in response to a request on a directory. Signature func (app *App) Static(prefix, root string, config ...Static) Router Use the following code to serve files in a directory named ./public app.Static(\"/\", \"./public\") // => http://localhost:3000/hello.html // => http://localhost:3000/js/jquery.js // => http://localhost:3000/css/style.css Examples // Serve files from multiple directories app.Static(\"/\", \"./public\") // Serve files from \"./files\" directory: app.Static(\"/\", \"./files\") You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below: Examples app.Static(\"/static\", \"./public\") // => http://localhost:3000/static/hello.html // => http://localhost:3000/static/js/jquery.js // => http://localhost:3000/static/css/style.css If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings. fiber.Static{} // Static defines configuration options when defining static assets. type Static struct { // When set to true, the server tries minimizing CPU usage by caching compressed files. // This works differently than the github.com/gofiber/compression middleware. // Optional. Default value false Compress bool `json:\"compress\"` // When set to true, enables byte range requests. // Optional. Default value false ByteRange bool `json:\"byte_range\"` // When set to true, enables directory browsing. // Optional. Default value false. Browse bool `json:\"browse\"` // When set to true, enables direct download. // Optional. Default value false. Download bool `json:\"download\"` // The name of the index file for serving a directory. // Optional. Default value \"index.html\". Index string `json:\"index\"` // Expiration duration for inactive file handlers. // Use a negative time.Duration to disable it. // // Optional. Default value 10 * time.Second. CacheDuration time.Duration `json:\"cache_duration\"` // The value for the Cache-Control HTTP-header // that is set on the file response. MaxAge is defined in seconds. // // Optional. Default value 0. MaxAge int `json:\"max_age\"` // ModifyResponse defines a function that allows you to alter the response. // // Optional. Default: nil ModifyResponse Handler // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *Ctx) bool } Example // Custom config app.Static(\"/\", \"./public\", fiber.Static{ Compress: true, ByteRange: true, Browse: true, Index: \"john.html\", CacheDuration: 10 * time.Second, MaxAge: 3600, })","s":"Static","u":"/api/app","h":"#static","p":1221},{"i":1225,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Route Handlers","u":"/api/app","h":"#route-handlers","p":1221},{"i":1227,"t":"You can Mount Fiber instance by creating a *Mount Signature func (a *App) Mount(prefix string, app *App) Router Examples func main() { app := fiber.New() micro := fiber.New() app.Mount(\"/john\", micro) // GET /john/doe -> 200 OK micro.Get(\"/doe\", func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusOK) }) log.Fatal(app.Listen(\":3000\")) }","s":"Mount","u":"/api/app","h":"#mount","p":1221},{"i":1229,"t":"The MountPath property contains one or more path patterns on which a sub-app was mounted. Signature func (app *App) MountPath() string Examples func main() { app := fiber.New() one := fiber.New() two := fiber.New() three := fiber.New() two.Mount(\"/three\", three) one.Mount(\"/two\", two) app.Mount(\"/one\", one) one.MountPath() // \"/one\" two.MountPath() // \"/one/two\" three.MountPath() // \"/one/two/three\" app.MountPath() // \"\" } caution Mounting order is important for MountPath. If you want to get mount paths properly, you should start mounting from the deepest app.","s":"MountPath","u":"/api/app","h":"#mountpath","p":1221},{"i":1231,"t":"You can group routes by creating a *Group struct. Signature func (app *App) Group(prefix string, handlers ...Handler) Router Examples func main() { app := fiber.New() api := app.Group(\"/api\", handler) // /api v1 := api.Group(\"/v1\", handler) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", handler) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) }","s":"Group","u":"/api/app","h":"#group","p":1221},{"i":1233,"t":"You can define routes with a common prefix inside the common function. Signature func (app *App) Route(prefix string, fn func(router Router), name ...string) Router Examples func main() { app := fiber.New() app.Route(\"/test\", func(api fiber.Router) { api.Get(\"/foo\", handler).Name(\"foo\") // /test/foo (name: test.foo) api.Get(\"/bar\", handler).Name(\"bar\") // /test/bar (name: test.bar) }, \"test.\") log.Fatal(app.Listen(\":3000\")) }","s":"Route","u":"/api/app","h":"#route","p":1221},{"i":1235,"t":"Server returns the underlying fasthttp server Signature func (app *App) Server() *fasthttp.Server Examples func main() { app := fiber.New() app.Server().MaxConnsPerIP = 1 // ... }","s":"Server","u":"/api/app","h":"#server","p":1221},{"i":1237,"t":"Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners and then waits indefinitely for all connections to return to idle before shutting down. ShutdownWithTimeout will forcefully close any active connections after the timeout expires. ShutdownWithContext shuts down the server including by force if the context's deadline is exceeded. func (app *App) Shutdown() error func (app *App) ShutdownWithTimeout(timeout time.Duration) error func (app *App) ShutdownWithContext(ctx context.Context) error","s":"Server Shutdown","u":"/api/app","h":"#server-shutdown","p":1221},{"i":1239,"t":"This method returns the amount of registered handlers. Signature func (app *App) HandlersCount() uint32","s":"HandlersCount","u":"/api/app","h":"#handlerscount","p":1221},{"i":1241,"t":"This method returns the original router stack Signature func (app *App) Stack() [][]*Route Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/john/:age\", handler) app.Post(\"/register\", handler) data, _ := json.MarshalIndent(app.Stack(), \"\", \" \") fmt.Println(string(data)) app.Listen(\":3000\") } Result [ [ { \"method\": \"GET\", \"path\": \"/john/:age\", \"params\": [ \"age\" ] } ], [ { \"method\": \"HEAD\", \"path\": \"/john/:age\", \"params\": [ \"age\" ] } ], [ { \"method\": \"POST\", \"path\": \"/register\", \"params\": null } ] ]","s":"Stack","u":"/api/app","h":"#stack","p":1221},{"i":1243,"t":"This method assigns the name of latest created route. Signature func (app *App) Name(name string) Router Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/\", handler) app.Name(\"index\") app.Get(\"/doe\", handler).Name(\"home\") app.Trace(\"/tracer\", handler).Name(\"tracert\") app.Delete(\"/delete\", handler).Name(\"delete\") a := app.Group(\"/a\") a.Name(\"fd.\") a.Get(\"/test\", handler).Name(\"test\") data, _ := json.MarshalIndent(app.Stack(), \"\", \" \") fmt.Print(string(data)) app.Listen(\":3000\") } Result [ [ { \"method\": \"GET\", \"name\": \"index\", \"path\": \"/\", \"params\": null }, { \"method\": \"GET\", \"name\": \"home\", \"path\": \"/doe\", \"params\": null }, { \"method\": \"GET\", \"name\": \"fd.test\", \"path\": \"/a/test\", \"params\": null } ], [ { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/\", \"params\": null }, { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/doe\", \"params\": null }, { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/a/test\", \"params\": null } ], null, null, [ { \"method\": \"DELETE\", \"name\": \"delete\", \"path\": \"/delete\", \"params\": null } ], null, null, [ { \"method\": \"TRACE\", \"name\": \"tracert\", \"path\": \"/tracer\", \"params\": null } ], null ]","s":"Name","u":"/api/app","h":"#name","p":1221},{"i":1245,"t":"This method gets the route by name. Signature func (app *App) GetRoute(name string) Route Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/\", handler).Name(\"index\") data, _ := json.MarshalIndent(app.GetRoute(\"index\"), \"\", \" \") fmt.Print(string(data)) app.Listen(\":3000\") } Result { \"method\": \"GET\", \"name\": \"index\", \"path\": \"/\", \"params\": null }","s":"GetRoute","u":"/api/app","h":"#getroute","p":1221},{"i":1247,"t":"This method gets all routes. Signature func (app *App) GetRoutes(filterUseOption ...bool) []Route When filterUseOption equal to true, it will filter the routes registered by the middleware. Examples func main() { app := fiber.New() app.Post(\"/\", func (c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }).Name(\"index\") data, _ := json.MarshalIndent(app.GetRoutes(true), \"\", \" \") fmt.Print(string(data)) } Result [ { \"method\": \"POST\", \"name\": \"index\", \"path\": \"/\", \"params\": null } ]","s":"GetRoutes","u":"/api/app","h":"#getroutes","p":1221},{"i":1249,"t":"Config returns the app config as value ( read-only ). Signature func (app *App) Config() Config","s":"Config","u":"/api/app","h":"#config","p":1221},{"i":1251,"t":"Handler returns the server handler that can be used to serve custom *fasthttp.RequestCtx requests. Signature func (app *App) Handler() fasthttp.RequestHandler","s":"Handler","u":"/api/app","h":"#handler","p":1221},{"i":1253,"t":"Listen serves HTTP requests from the given address. Signature func (app *App) Listen(addr string) error Examples // Listen on port :8080 app.Listen(\":8080\") // Custom host app.Listen(\"127.0.0.1:8080\")","s":"Listen","u":"/api/app","h":"#listen","p":1221},{"i":1255,"t":"ListenTLS serves HTTPs requests from the given address using certFile and keyFile paths to as TLS certificate and key file. Signature func (app *App) ListenTLS(addr, certFile, keyFile string) error Examples app.ListenTLS(\":443\", \"./cert.pem\", \"./cert.key\"); Using ListenTLS defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, Certificates: []tls.Certificate{ cert, }, }","s":"ListenTLS","u":"/api/app","h":"#listentls","p":1221},{"i":1257,"t":"Signature func (app *App) ListenTLS(addr string, cert tls.Certificate) error Examples app.ListenTLSWithCertificate(\":443\", cert); Using ListenTLSWithCertificate defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, Certificates: []tls.Certificate{ cert, }, }","s":"ListenTLSWithCertificate","u":"/api/app","h":"#listentlswithcertificate","p":1221},{"i":1259,"t":"ListenMutualTLS serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file Signature func (app *App) ListenMutualTLS(addr, certFile, keyFile, clientCertFile string) error Examples app.ListenMutualTLS(\":443\", \"./cert.pem\", \"./cert.key\", \"./ca-chain-cert.pem\"); Using ListenMutualTLS defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, ClientAuth: tls.RequireAndVerifyClientCert, ClientCAs: clientCertPool, Certificates: []tls.Certificate{ cert, }, }","s":"ListenMutualTLS","u":"/api/app","h":"#listenmutualtls","p":1221},{"i":1261,"t":"ListenMutualTLSWithCertificate serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file Signature func (app *App) ListenMutualTLSWithCertificate(addr string, cert tls.Certificate, clientCertPool *x509.CertPool) error Examples app.ListenMutualTLSWithCertificate(\":443\", cert, clientCertPool); Using ListenMutualTLSWithCertificate defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, ClientAuth: tls.RequireAndVerifyClientCert, ClientCAs: clientCertPool, Certificates: []tls.Certificate{ cert, }, }","s":"ListenMutualTLSWithCertificate","u":"/api/app","h":"#listenmutualtlswithcertificate","p":1221},{"i":1263,"t":"You can pass your own net.Listener using the Listener method. This method can be used to enable TLS/HTTPS with a custom tls.Config. Signature func (app *App) Listener(ln net.Listener) error Examples ln, _ := net.Listen(\"tcp\", \":3000\") cer, _:= tls.LoadX509KeyPair(\"server.crt\", \"server.key\") ln = tls.NewListener(ln, &tls.Config{Certificates: []tls.Certificate{cer}}) app.Listener(ln)","s":"Listener","u":"/api/app","h":"#listener","p":1221},{"i":1265,"t":"Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 1s if you want to disable a timeout altogether, pass -1 as a second argument. Signature func (app *App) Test(req *http.Request, msTimeout ...int) (*http.Response, error) Examples // Create route with GET method for test: app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(c.BaseURL()) // => http://google.com fmt.Println(c.Get(\"X-Custom-Header\")) // => hi return c.SendString(\"hello, World!\") }) // http.Request req := httptest.NewRequest(\"GET\", \"http://google.com\", nil) req.Header.Set(\"X-Custom-Header\", \"hi\") // http.Response resp, _ := app.Test(req) // Do something with results: if resp.StatusCode == fiber.StatusOK { body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) // => Hello, World! }","s":"Test","u":"/api/app","h":"#test","p":1221},{"i":1267,"t":"Hooks is a method to return hooks property. Signature func (app *App) Hooks() *Hooks","s":"Hooks","u":"/api/app","h":"#hooks","p":1221},{"i":1270,"t":"Start a http request with http method and url. Signatures // Client http methods func (c *Client) Get(url string) *Agent func (c *Client) Head(url string) *Agent func (c *Client) Post(url string) *Agent func (c *Client) Put(url string) *Agent func (c *Client) Patch(url string) *Agent func (c *Client) Delete(url string) *Agent","s":"Start request","u":"/api/client","h":"#start-request","p":1268},{"i":1272,"t":"Agent is built on top of FastHTTP's HostClient which has lots of convenient helper methods such as dedicated methods for request methods.","s":"✨ Agent","u":"/api/client","h":"#-agent","p":1268},{"i":1274,"t":"Parse initializes a HostClient. Parse a := AcquireAgent() req := a.Request() req.Header.SetMethod(MethodGet) req.SetRequestURI(\"http://example.com\") if err := a.Parse(); err != nil { panic(err) } code, body, errs := a.Bytes() // ...","s":"Parse","u":"/api/client","h":"#parse","p":1268},{"i":1276,"t":"Set sets the given key: value header. Signature func (a *Agent) Set(k, v string) *Agent func (a *Agent) SetBytesK(k []byte, v string) *Agent func (a *Agent) SetBytesV(k string, v []byte) *Agent func (a *Agent) SetBytesKV(k []byte, v []byte) *Agent Example agent.Set(\"k1\", \"v1\"). SetBytesK([]byte(\"k1\"), \"v1\"). SetBytesV(\"k1\", []byte(\"v1\")). SetBytesKV([]byte(\"k2\"), []byte(\"v2\")) // ...","s":"Set","u":"/api/client","h":"#set","p":1268},{"i":1278,"t":"Add adds the given key: value header. Multiple headers with the same key may be added with this function. Signature func (a *Agent) Add(k, v string) *Agent func (a *Agent) AddBytesK(k []byte, v string) *Agent func (a *Agent) AddBytesV(k string, v []byte) *Agent func (a *Agent) AddBytesKV(k []byte, v []byte) *Agent Example agent.Add(\"k1\", \"v1\"). AddBytesK([]byte(\"k1\"), \"v1\"). AddBytesV(\"k1\", []byte(\"v1\")). AddBytesKV([]byte(\"k2\"), []byte(\"v2\")) // Headers: // K1: v1 // K1: v1 // K1: v1 // K2: v2","s":"Add","u":"/api/client","h":"#add","p":1268},{"i":1280,"t":"ConnectionClose adds the Connection: close header. Signature func (a *Agent) ConnectionClose() *Agent Example agent.ConnectionClose() // ...","s":"ConnectionClose","u":"/api/client","h":"#connectionclose","p":1268},{"i":1282,"t":"UserAgent sets User-Agent header value. Signature func (a *Agent) UserAgent(userAgent string) *Agent func (a *Agent) UserAgentBytes(userAgent []byte) *Agent Example agent.UserAgent(\"fiber\") // ...","s":"UserAgent","u":"/api/client","h":"#useragent","p":1268},{"i":1284,"t":"Cookie sets a cookie in key: value form. Cookies can be used to set multiple cookies. Signature func (a *Agent) Cookie(key, value string) *Agent func (a *Agent) CookieBytesK(key []byte, value string) *Agent func (a *Agent) CookieBytesKV(key, value []byte) *Agent func (a *Agent) Cookies(kv ...string) *Agent func (a *Agent) CookiesBytesKV(kv ...[]byte) *Agent Example agent.Cookie(\"k\", \"v\") agent.Cookies(\"k1\", \"v1\", \"k2\", \"v2\") // ...","s":"Cookie","u":"/api/client","h":"#cookie","p":1268},{"i":1286,"t":"Referer sets the Referer header value. Signature func (a *Agent) Referer(referer string) *Agent func (a *Agent) RefererBytes(referer []byte) *Agent Example agent.Referer(\"https://docs.gofiber.io\") // ...","s":"Referer","u":"/api/client","h":"#referer","p":1268},{"i":1288,"t":"ContentType sets Content-Type header value. Signature func (a *Agent) ContentType(contentType string) *Agent func (a *Agent) ContentTypeBytes(contentType []byte) *Agent Example agent.ContentType(\"custom-type\") // ...","s":"ContentType","u":"/api/client","h":"#contenttype","p":1268},{"i":1290,"t":"Host sets the Host header. Signature func (a *Agent) Host(host string) *Agent func (a *Agent) HostBytes(host []byte) *Agent Example agent.Host(\"example.com\") // ...","s":"Host","u":"/api/client","h":"#host","p":1268},{"i":1292,"t":"QueryString sets the URI query string. Signature func (a *Agent) QueryString(queryString string) *Agent func (a *Agent) QueryStringBytes(queryString []byte) *Agent Example agent.QueryString(\"foo=bar\") // ...","s":"QueryString","u":"/api/client","h":"#querystring","p":1268},{"i":1294,"t":"BasicAuth sets the URI username and password using HTTP Basic Auth. Signature func (a *Agent) BasicAuth(username, password string) *Agent func (a *Agent) BasicAuthBytes(username, password []byte) *Agent Example agent.BasicAuth(\"foo\", \"bar\") // ...","s":"BasicAuth","u":"/api/client","h":"#basicauth","p":1268},{"i":1296,"t":"There are several ways to set request body. Signature func (a *Agent) BodyString(bodyString string) *Agent func (a *Agent) Body(body []byte) *Agent // BodyStream sets request body stream and, optionally body size. // // If bodySize is >= 0, then the bodyStream must provide exactly bodySize bytes // before returning io.EOF. // // If bodySize < 0, then bodyStream is read until io.EOF. // // bodyStream.Close() is called after finishing reading all body data // if it implements io.Closer. // // Note that GET and HEAD requests cannot have body. func (a *Agent) BodyStream(bodyStream io.Reader, bodySize int) *Agent Example agent.BodyString(\"foo=bar\") agent.Body([]byte(\"bar=baz\")) agent.BodyStream(strings.NewReader(\"body=stream\"), -1) // ...","s":"Body","u":"/api/client","h":"#body","p":1268},{"i":1298,"t":"JSON sends a JSON request by setting the Content-Type header to application/json. Signature func (a *Agent) JSON(v interface{}) *Agent Example agent.JSON(fiber.Map{\"success\": true}) // ...","s":"JSON","u":"/api/client","h":"#json","p":1268},{"i":1300,"t":"XML sends an XML request by setting the Content-Type header to application/xml. Signature func (a *Agent) XML(v interface{}) *Agent Example agent.XML(fiber.Map{\"success\": true}) // ...","s":"XML","u":"/api/client","h":"#xml","p":1268},{"i":1302,"t":"Form sends a form request by setting the Content-Type header to application/x-www-form-urlencoded. Signature // Form sends form request with body if args is non-nil. // // It is recommended obtaining args via AcquireArgs and release it // manually in performance-critical code. func (a *Agent) Form(args *Args) *Agent Example args := AcquireArgs() args.Set(\"foo\", \"bar\") agent.Form(args) // ... ReleaseArgs(args)","s":"Form","u":"/api/client","h":"#form","p":1268},{"i":1304,"t":"MultipartForm sends multipart form request by setting the Content-Type header to multipart/form-data. These requests can include key-value's and files. Signature // MultipartForm sends multipart form request with k-v and files. // // It is recommended to obtain args via AcquireArgs and release it // manually in performance-critical code. func (a *Agent) MultipartForm(args *Args) *Agent Example args := AcquireArgs() args.Set(\"foo\", \"bar\") agent.MultipartForm(args) // ... ReleaseArgs(args) Fiber provides several methods for sending files. Note that they must be called before MultipartForm. Boundary​ Boundary sets boundary for multipart form request. Signature func (a *Agent) Boundary(boundary string) *Agent Example agent.Boundary(\"myBoundary\") .MultipartForm(nil) // ... SendFile(s)​ SendFile read a file and appends it to a multipart form request. Sendfiles can be used to append multiple files. Signature func (a *Agent) SendFile(filename string, fieldname ...string) *Agent func (a *Agent) SendFiles(filenamesAndFieldnames ...string) *Agent Example agent.SendFile(\"f\", \"field name\") .SendFiles(\"f1\", \"field name1\", \"f2\"). .MultipartForm(nil) // ... FileData​ FileData appends file data for multipart form request. // FormFile represents multipart form file type FormFile struct { // Fieldname is form file's field name Fieldname string // Name is form file's name Name string // Content is form file's content Content []byte } Signature // FileData appends files for multipart form request. // // It is recommended obtaining formFile via AcquireFormFile and release it // manually in performance-critical code. func (a *Agent) FileData(formFiles ...*FormFile) *Agent Example ff1 := &FormFile{\"filename1\", \"field name1\", []byte(\"content\")} ff2 := &FormFile{\"filename2\", \"field name2\", []byte(\"content\")} agent.FileData(ff1, ff2). MultipartForm(nil) // ...","s":"MultipartForm","u":"/api/client","h":"#multipartform","p":1268},{"i":1306,"t":"Debug mode enables logging request and response detail to io.writer(default is os.Stdout). Signature func (a *Agent) Debug(w ...io.Writer) *Agent Example agent.Debug() // ...","s":"Debug","u":"/api/client","h":"#debug","p":1268},{"i":1308,"t":"Timeout sets request timeout duration. Signature func (a *Agent) Timeout(timeout time.Duration) *Agent Example agent.Timeout(time.Second) // ...","s":"Timeout","u":"/api/client","h":"#timeout","p":1268},{"i":1310,"t":"Reuse enables the Agent instance to be used again after one request. If agent is reusable, then it should be released manually when it is no longer used. Signature func (a *Agent) Reuse() *Agent Example agent.Reuse() // ...","s":"Reuse","u":"/api/client","h":"#reuse","p":1268},{"i":1312,"t":"InsecureSkipVerify controls whether the Agent verifies the server certificate chain and host name. Signature func (a *Agent) InsecureSkipVerify() *Agent Example agent.InsecureSkipVerify() // ...","s":"InsecureSkipVerify","u":"/api/client","h":"#insecureskipverify","p":1268},{"i":1314,"t":"TLSConfig sets tls config. Signature func (a *Agent) TLSConfig(config *tls.Config) *Agent Example // Create tls certificate cer, _ := tls.LoadX509KeyPair(\"pem\", \"key\") config := &tls.Config{ Certificates: []tls.Certificate{cer}, } agent.TLSConfig(config) // ...","s":"TLSConfig","u":"/api/client","h":"#tlsconfig","p":1268},{"i":1316,"t":"MaxRedirectsCount sets max redirect count for GET and HEAD. Signature func (a *Agent) MaxRedirectsCount(count int) *Agent Example agent.MaxRedirectsCount(7) // ...","s":"MaxRedirectsCount","u":"/api/client","h":"#maxredirectscount","p":1268},{"i":1318,"t":"JSONEncoder sets custom json encoder. Signature func (a *Agent) JSONEncoder(jsonEncoder utils.JSONMarshal) *Agent Example agent.JSONEncoder(json.Marshal) // ...","s":"JSONEncoder","u":"/api/client","h":"#jsonencoder","p":1268},{"i":1320,"t":"JSONDecoder sets custom json decoder. Signature func (a *Agent) JSONDecoder(jsonDecoder utils.JSONUnmarshal) *Agent Example agent.JSONDecoder(json.Unmarshal) // ...","s":"JSONDecoder","u":"/api/client","h":"#jsondecoder","p":1268},{"i":1322,"t":"Request returns Agent request instance. Signature func (a *Agent) Request() *Request Example req := agent.Request() // ...","s":"Request","u":"/api/client","h":"#request","p":1268},{"i":1324,"t":"SetResponse sets custom response for the Agent instance. It is recommended obtaining custom response via AcquireResponse and release it manually in performance-critical code. Signature func (a *Agent) SetResponse(customResp *Response) *Agent Example resp := AcquireResponse() agent.SetResponse(resp) // ... ReleaseResponse(resp)","s":"SetResponse","u":"/api/client","h":"#setresponse","p":1268},{"i":1326,"t":"Dest sets custom dest. The contents of dest will be replaced by the response body, if the dest is too small a new slice will be allocated. Signature func (a *Agent) Dest(dest []byte) *Agent { Example agent.Dest(nil) // ...","s":"Dest","u":"/api/client","h":"#dest","p":1268},{"i":1328,"t":"Bytes returns the status code, bytes body and errors of url. Signature func (a *Agent) Bytes() (code int, body []byte, errs []error) Example code, body, errs := agent.Bytes() // ...","s":"Bytes","u":"/api/client","h":"#bytes","p":1268},{"i":1330,"t":"String returns the status code, string body and errors of url. Signature func (a *Agent) String() (int, string, []error) Example code, body, errs := agent.String() // ...","s":"String","u":"/api/client","h":"#string","p":1268},{"i":1332,"t":"Struct returns the status code, bytes body and errors of url. And bytes body will be unmarshalled to given v. Signature func (a *Agent) Struct(v interface{}) (code int, body []byte, errs []error) Example var d data code, body, errs := agent.Struct(&d) // ...","s":"Struct","u":"/api/client","h":"#struct","p":1268},{"i":1334,"t":"RetryIf controls whether a retry should be attempted after an error. By default, will use isIdempotent function from fasthttp Signature func (a *Agent) RetryIf(retryIf RetryIfFunc) *Agent Example agent.Get(\"https://example.com\").RetryIf(func (req *fiber.Request) bool { return req.URI() == \"https://example.com\" }) // ...","s":"RetryIf","u":"/api/client","h":"#retryif","p":1268},{"i":1336,"t":"HTTP methods were copied from net/http. const ( MethodGet = \"GET\" // RFC 7231, 4.3.1 MethodHead = \"HEAD\" // RFC 7231, 4.3.2 MethodPost = \"POST\" // RFC 7231, 4.3.3 MethodPut = \"PUT\" // RFC 7231, 4.3.4 MethodPatch = \"PATCH\" // RFC 5789 MethodDelete = \"DELETE\" // RFC 7231, 4.3.5 MethodConnect = \"CONNECT\" // RFC 7231, 4.3.6 MethodOptions = \"OPTIONS\" // RFC 7231, 4.3.7 MethodTrace = \"TRACE\" // RFC 7231, 4.3.8 methodUse = \"USE\" ) MIME types that are commonly used const ( MIMETextXML = \"text/xml\" MIMETextHTML = \"text/html\" MIMETextPlain = \"text/plain\" MIMEApplicationXML = \"application/xml\" MIMEApplicationJSON = \"application/json\" MIMEApplicationJavaScript = \"application/javascript\" MIMEApplicationForm = \"application/x-www-form-urlencoded\" MIMEOctetStream = \"application/octet-stream\" MIMEMultipartForm = \"multipart/form-data\" MIMETextXMLCharsetUTF8 = \"text/xml; charset=utf-8\" MIMETextHTMLCharsetUTF8 = \"text/html; charset=utf-8\" MIMETextPlainCharsetUTF8 = \"text/plain; charset=utf-8\" MIMEApplicationXMLCharsetUTF8 = \"application/xml; charset=utf-8\" MIMEApplicationJSONCharsetUTF8 = \"application/json; charset=utf-8\" MIMEApplicationJavaScriptCharsetUTF8 = \"application/javascript; charset=utf-8\" ) HTTP status codes were copied from net/http. const ( StatusContinue = 100 // RFC 7231, 6.2.1 StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2 StatusProcessing = 102 // RFC 2518, 10.1 StatusEarlyHints = 103 // RFC 8297 StatusOK = 200 // RFC 7231, 6.3.1 StatusCreated = 201 // RFC 7231, 6.3.2 StatusAccepted = 202 // RFC 7231, 6.3.3 StatusNonAuthoritativeInformation = 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 StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7 StatusPermanentRedirect = 308 // RFC 7538, 3 StatusBadRequest = 400 // RFC 7231, 6.5.1 StatusUnauthorized = 401 // RFC 7235, 3.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 StatusMisdirectedRequest = 421 // RFC 7540, 9.1.2 StatusUnprocessableEntity = 422 // RFC 4918, 11.2 StatusLocked = 423 // RFC 4918, 11.3 StatusFailedDependency = 424 // RFC 4918, 11.4 StatusTooEarly = 425 // RFC 8470, 5.2. StatusUpgradeRequired = 426 // RFC 7231, 6.5.15 StatusPreconditionRequired = 428 // RFC 6585, 3 StatusTooManyRequests = 429 // RFC 6585, 4 StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5 StatusUnavailableForLegalReasons = 451 // RFC 7725, 3 StatusInternalServerError = 500 // RFC 7231, 6.6.1 StatusNotImplemented = 501 // RFC 7231, 6.6.2 StatusBadGateway = 502 // RFC 7231, 6.6.3 StatusServiceUnavailable = 503 // RFC 7231, 6.6.4 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 ) Errors var ( ErrBadRequest = NewError(StatusBadRequest) // RFC 7231, 6.5.1 ErrUnauthorized = NewError(StatusUnauthorized) // RFC 7235, 3.1 ErrPaymentRequired = NewError(StatusPaymentRequired) // RFC 7231, 6.5.2 ErrForbidden = NewError(StatusForbidden) // RFC 7231, 6.5.3 ErrNotFound = NewError(StatusNotFound) // RFC 7231, 6.5.4 ErrMethodNotAllowed = NewError(StatusMethodNotAllowed) // RFC 7231, 6.5.5 ErrNotAcceptable = NewError(StatusNotAcceptable) // RFC 7231, 6.5.6 ErrProxyAuthRequired = NewError(StatusProxyAuthRequired) // RFC 7235, 3.2 ErrRequestTimeout = NewError(StatusRequestTimeout) // RFC 7231, 6.5.7 ErrConflict = NewError(StatusConflict) // RFC 7231, 6.5.8 ErrGone = NewError(StatusGone) // RFC 7231, 6.5.9 ErrLengthRequired = NewError(StatusLengthRequired) // RFC 7231, 6.5.10 ErrPreconditionFailed = NewError(StatusPreconditionFailed) // RFC 7232, 4.2 ErrRequestEntityTooLarge = NewError(StatusRequestEntityTooLarge) // RFC 7231, 6.5.11 ErrRequestURITooLong = NewError(StatusRequestURITooLong) // RFC 7231, 6.5.12 ErrUnsupportedMediaType = NewError(StatusUnsupportedMediaType) // RFC 7231, 6.5.13 ErrRequestedRangeNotSatisfiable = NewError(StatusRequestedRangeNotSatisfiable) // RFC 7233, 4.4 ErrExpectationFailed = NewError(StatusExpectationFailed) // RFC 7231, 6.5.14 ErrTeapot = NewError(StatusTeapot) // RFC 7168, 2.3.3 ErrMisdirectedRequest = NewError(StatusMisdirectedRequest) // RFC 7540, 9.1.2 ErrUnprocessableEntity = NewError(StatusUnprocessableEntity) // RFC 4918, 11.2 ErrLocked = NewError(StatusLocked) // RFC 4918, 11.3 ErrFailedDependency = NewError(StatusFailedDependency) // RFC 4918, 11.4 ErrTooEarly = NewError(StatusTooEarly) // RFC 8470, 5.2. ErrUpgradeRequired = NewError(StatusUpgradeRequired) // RFC 7231, 6.5.15 ErrPreconditionRequired = NewError(StatusPreconditionRequired) // RFC 6585, 3 ErrTooManyRequests = NewError(StatusTooManyRequests) // RFC 6585, 4 ErrRequestHeaderFieldsTooLarge = NewError(StatusRequestHeaderFieldsTooLarge) // RFC 6585, 5 ErrUnavailableForLegalReasons = NewError(StatusUnavailableForLegalReasons) // RFC 7725, 3 ErrInternalServerError = NewError(StatusInternalServerError) // RFC 7231, 6.6.1 ErrNotImplemented = NewError(StatusNotImplemented) // RFC 7231, 6.6.2 ErrBadGateway = NewError(StatusBadGateway) // RFC 7231, 6.6.3 ErrServiceUnavailable = NewError(StatusServiceUnavailable) // RFC 7231, 6.6.4 ErrGatewayTimeout = NewError(StatusGatewayTimeout) // RFC 7231, 6.6.5 ErrHTTPVersionNotSupported = NewError(StatusHTTPVersionNotSupported) // RFC 7231, 6.6.6 ErrVariantAlsoNegotiates = NewError(StatusVariantAlsoNegotiates) // RFC 2295, 8.1 ErrInsufficientStorage = NewError(StatusInsufficientStorage) // RFC 4918, 11.5 ErrLoopDetected = NewError(StatusLoopDetected) // RFC 5842, 7.2 ErrNotExtended = NewError(StatusNotExtended) // RFC 2774, 7 ErrNetworkAuthenticationRequired = NewError(StatusNetworkAuthenticationRequired) // RFC 6585, 6 ) HTTP Headers were copied from net/http. const ( HeaderAuthorization = \"Authorization\" HeaderProxyAuthenticate = \"Proxy-Authenticate\" HeaderProxyAuthorization = \"Proxy-Authorization\" HeaderWWWAuthenticate = \"WWW-Authenticate\" HeaderAge = \"Age\" HeaderCacheControl = \"Cache-Control\" HeaderClearSiteData = \"Clear-Site-Data\" HeaderExpires = \"Expires\" HeaderPragma = \"Pragma\" HeaderWarning = \"Warning\" HeaderAcceptCH = \"Accept-CH\" HeaderAcceptCHLifetime = \"Accept-CH-Lifetime\" HeaderContentDPR = \"Content-DPR\" HeaderDPR = \"DPR\" HeaderEarlyData = \"Early-Data\" HeaderSaveData = \"Save-Data\" HeaderViewportWidth = \"Viewport-Width\" HeaderWidth = \"Width\" HeaderETag = \"ETag\" HeaderIfMatch = \"If-Match\" HeaderIfModifiedSince = \"If-Modified-Since\" HeaderIfNoneMatch = \"If-None-Match\" HeaderIfUnmodifiedSince = \"If-Unmodified-Since\" HeaderLastModified = \"Last-Modified\" HeaderVary = \"Vary\" HeaderConnection = \"Connection\" HeaderKeepAlive = \"Keep-Alive\" HeaderAccept = \"Accept\" HeaderAcceptCharset = \"Accept-Charset\" HeaderAcceptEncoding = \"Accept-Encoding\" HeaderAcceptLanguage = \"Accept-Language\" HeaderCookie = \"Cookie\" HeaderExpect = \"Expect\" HeaderMaxForwards = \"Max-Forwards\" HeaderSetCookie = \"Set-Cookie\" 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\" HeaderOrigin = \"Origin\" HeaderTimingAllowOrigin = \"Timing-Allow-Origin\" HeaderXPermittedCrossDomainPolicies = \"X-Permitted-Cross-Domain-Policies\" HeaderDNT = \"DNT\" HeaderTk = \"Tk\" HeaderContentDisposition = \"Content-Disposition\" HeaderContentEncoding = \"Content-Encoding\" HeaderContentLanguage = \"Content-Language\" HeaderContentLength = \"Content-Length\" HeaderContentLocation = \"Content-Location\" HeaderContentType = \"Content-Type\" HeaderForwarded = \"Forwarded\" HeaderVia = \"Via\" HeaderXForwardedFor = \"X-Forwarded-For\" HeaderXForwardedHost = \"X-Forwarded-Host\" HeaderXForwardedProto = \"X-Forwarded-Proto\" HeaderXForwardedProtocol = \"X-Forwarded-Protocol\" HeaderXForwardedSsl = \"X-Forwarded-Ssl\" HeaderXUrlScheme = \"X-Url-Scheme\" HeaderLocation = \"Location\" HeaderFrom = \"From\" HeaderHost = \"Host\" HeaderReferer = \"Referer\" HeaderReferrerPolicy = \"Referrer-Policy\" HeaderUserAgent = \"User-Agent\" HeaderAllow = \"Allow\" HeaderServer = \"Server\" HeaderAcceptRanges = \"Accept-Ranges\" HeaderContentRange = \"Content-Range\" HeaderIfRange = \"If-Range\" HeaderRange = \"Range\" HeaderContentSecurityPolicy = \"Content-Security-Policy\" HeaderContentSecurityPolicyReportOnly = \"Content-Security-Policy-Report-Only\" HeaderCrossOriginResourcePolicy = \"Cross-Origin-Resource-Policy\" HeaderExpectCT = \"Expect-CT\" HeaderFeaturePolicy = \"Feature-Policy\" HeaderPublicKeyPins = \"Public-Key-Pins\" HeaderPublicKeyPinsReportOnly = \"Public-Key-Pins-Report-Only\" HeaderStrictTransportSecurity = \"Strict-Transport-Security\" HeaderUpgradeInsecureRequests = \"Upgrade-Insecure-Requests\" HeaderXContentTypeOptions = \"X-Content-Type-Options\" HeaderXDownloadOptions = \"X-Download-Options\" HeaderXFrameOptions = \"X-Frame-Options\" HeaderXPoweredBy = \"X-Powered-By\" HeaderXXSSProtection = \"X-XSS-Protection\" HeaderLastEventID = \"Last-Event-ID\" HeaderNEL = \"NEL\" HeaderPingFrom = \"Ping-From\" HeaderPingTo = \"Ping-To\" HeaderReportTo = \"Report-To\" HeaderTE = \"TE\" HeaderTrailer = \"Trailer\" HeaderTransferEncoding = \"Transfer-Encoding\" HeaderSecWebSocketAccept = \"Sec-WebSocket-Accept\" HeaderSecWebSocketExtensions = \"Sec-WebSocket-Extensions\" HeaderSecWebSocketKey = \"Sec-WebSocket-Key\" HeaderSecWebSocketProtocol = \"Sec-WebSocket-Protocol\" HeaderSecWebSocketVersion = \"Sec-WebSocket-Version\" HeaderAcceptPatch = \"Accept-Patch\" HeaderAcceptPushPolicy = \"Accept-Push-Policy\" HeaderAcceptSignature = \"Accept-Signature\" HeaderAltSvc = \"Alt-Svc\" HeaderDate = \"Date\" HeaderIndex = \"Index\" HeaderLargeAllocation = \"Large-Allocation\" HeaderLink = \"Link\" HeaderPushPolicy = \"Push-Policy\" HeaderRetryAfter = \"Retry-After\" HeaderServerTiming = \"Server-Timing\" HeaderSignature = \"Signature\" HeaderSignedHeaders = \"Signed-Headers\" HeaderSourceMap = \"SourceMap\" HeaderUpgrade = \"Upgrade\" HeaderXDNSPrefetchControl = \"X-DNS-Prefetch-Control\" HeaderXPingback = \"X-Pingback\" HeaderXRequestID = \"X-Request-ID\" HeaderXRequestedWith = \"X-Requested-With\" HeaderXRobotsTag = \"X-Robots-Tag\" HeaderXUACompatible = \"X-UA-Compatible\" )","s":"πŸ“‹ Constants","u":"/api/constants","h":"","p":1335},{"i":1339,"t":"This method creates a new App named instance. You can pass optional config when creating a new instance. Signature func New(config ...Config) *App Example // Default config app := fiber.New() // ...","s":"New","u":"/api/fiber","h":"#new","p":1337},{"i":1341,"t":"You can pass an optional Config when creating a new Fiber instance. Example // Custom config app := fiber.New(fiber.Config{ Prefork: true, CaseSensitive: true, StrictRouting: true, ServerHeader: \"Fiber\", AppName: \"Test App v1.0.1\" }) // ... Config fields Property Type Description Default AppName string This allows to setup app name for the app \"\" BodyLimit int Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response. 4 * 1024 * 1024 CaseSensitive bool When enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same. false ColorScheme Colors You can define custom color scheme. They'll be used for startup message, route list and some middlewares. DefaultColors CompressedFileSuffix string Adds a suffix to the original file name and tries saving the resulting compressed file under the new file name. \".fiber.gz\" Concurrency int Maximum number of concurrent connections. 256 * 1024 DisableDefaultContentType bool When set to true, causes the default Content-Type header to be excluded from the Response. false DisableDefaultDate bool When set to true causes the default date header to be excluded from the response. false DisableHeaderNormalizing bool By default all header names are normalized: conteNT-tYPE -> Content-Type false DisableKeepalive bool Disable keep-alive connections, the server will close incoming connections after sending the first response to the client false DisablePreParseMultipartForm bool Will not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data. false DisableStartupMessage bool When set to true, it will not print out debug information false ETag bool Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled. false EnableIPValidation bool If set to true, c.IP() and c.IPs() will validate IP addresses before returning them. Also, c.IP() will return only the first valid IP rather than just the raw header value that may be a comma seperated string. WARNING: There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header. false EnablePrintRoutes bool EnablePrintRoutes enables print all routes with their method, path, name and handler.. false EnableTrustedProxyCheck bool When set to true, fiber will check whether proxy is trusted, using TrustedProxies list. By default c.Protocol() will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, c.IP() will get value from ProxyHeader header, c.Hostname() will get value from X-Forwarded-Host header. If EnableTrustedProxyCheck is true, and RemoteIP is in the list of TrustedProxies c.Protocol(), c.IP(), and c.Hostname() will have the same behaviour when EnableTrustedProxyCheck disabled, if RemoteIP isn't in the list, c.Protocol() will return https in case when tls connection is handled by the app, or http otherwise, c.IP() will return RemoteIP() from fasthttp context, c.Hostname() will return fasthttp.Request.URI().Host() false ErrorHandler ErrorHandler ErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests. DefaultErrorHandler GETOnly bool Rejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set. false IdleTimeout time.Duration The maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used. nil Immutable bool When enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue #185. false JSONDecoder utils.JSONUnmarshal Allowing for flexibility in using another json library for decoding. json.Unmarshal JSONEncoder utils.JSONMarshal Allowing for flexibility in using another json library for encoding. json.Marshal Network string Known networks are \"tcp\", \"tcp4\" (IPv4-only), \"tcp6\" (IPv6-only) WARNING: When prefork is set to true, only \"tcp4\" and \"tcp6\" can be chosen. NetworkTCP4 PassLocalsToViews bool PassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our Template Middleware for supported engines. false Prefork bool Enables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding. NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with CMD ./app or CMD [\"sh\", \"-c\", \"/app\"]. For more info, see this issue comment. false ProxyHeader string This will enable c.IP() to return the value of the given header key. By default c.IP()will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. X-Forwarded-*. \"\" ReadBufferSize int per-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies). 4096 ReadTimeout time.Duration The amount of time allowed to read the full request, including the body. The default timeout is unlimited. nil RequestMethods []string RequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish. DefaultMethods ServerHeader string Enables the Server HTTP header with the given value. \"\" StreamRequestBody bool StreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit. false StrictRouting bool When enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same. false TrustedProxies []string Contains the list of trusted proxy IP's. Look at EnableTrustedProxyCheck doc. It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses. []string*__* UnescapePath bool Converts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special characters false Views Views Views is the interface that wraps the Render function. See our Template Middleware for supported engines. nil ViewsLayout string Views Layout is the global layout for all template render until override on Render function. See our Template Middleware for supported engines. \"\" WriteBufferSize int Per-connection buffer size for responses' writing. 4096 WriteTimeout time.Duration The maximum duration before timing out writes of the response. The default timeout is unlimited. nil XMLEncoder utils.XMLMarshal Allowing for flexibility in using another XML library for encoding. xml.Marshal","s":"Config","u":"/api/fiber","h":"#config","p":1337},{"i":1343,"t":"NewError creates a new HTTPError instance with an optional message. Signature func NewError(code int, message ...string) *Error Example app.Get(\"/\", func(c *fiber.Ctx) error { return fiber.NewError(782, \"Custom error message\") })","s":"NewError","u":"/api/fiber","h":"#newerror","p":1337},{"i":1345,"t":"IsChild determines if the current process is a result of Prefork. Signature func IsChild() bool Example // Prefork will spawn child processes app := fiber.New(fiber.Config{ Prefork: true, }) if !fiber.IsChild() { fmt.Println(\"I'm the parent process\") } else { fmt.Println(\"I'm a child process\") } // ...","s":"IsChild","u":"/api/fiber","h":"#ischild","p":1337},{"i":1347,"t":"Converter for net/http handlers to/from Fiber request handlers, special thanks to @arsmn!","s":"Adaptor","u":"/api/middleware/adaptor","h":"","p":1346},{"i":1349,"t":"Name Signature Description HTTPHandler HTTPHandler(h http.Handler) fiber.Handler http.Handler -> fiber.Handler HTTPHandlerFunc HTTPHandlerFunc(h http.HandlerFunc) fiber.Handler http.HandlerFunc -> fiber.Handler HTTPMiddleware HTTPHandlerFunc(mw func(http.Handler) http.Handler) fiber.Handler func(http.Handler) http.Handler -> fiber.Handler FiberHandler FiberHandler(h fiber.Handler) http.Handler fiber.Handler -> http.Handler FiberHandlerFunc FiberHandlerFunc(h fiber.Handler) http.HandlerFunc fiber.Handler -> http.HandlerFunc FiberApp FiberApp(app *fiber.App) http.HandlerFunc Fiber app -> http.HandlerFunc ConvertRequest ConvertRequest(c *fiber.Ctx, forServer bool) (*http.Request, error) fiber.Ctx -> http.Request CopyContextToFiberContext CopyContextToFiberContext(context interface{}, requestContext *fasthttp.RequestCtx) context.Context -> fasthttp.RequestCtx","s":"Signatures","u":"/api/middleware/adaptor","h":"#signatures","p":1346},{"i":1352,"t":"package main import ( \"fmt\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // New fiber app app := fiber.New() // http.Handler -> fiber.Handler app.Get(\"/\", adaptor.HTTPHandler(handler(greet))) // http.HandlerFunc -> fiber.Handler app.Get(\"/func\", adaptor.HTTPHandlerFunc(greet)) // Listen on port 3000 app.Listen(\":3000\") } func handler(f http.HandlerFunc) http.Handler { return http.HandlerFunc(f) } func greet(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, \"Hello World!\") }","s":"net/http to Fiber","u":"/api/middleware/adaptor","h":"#nethttp-to-fiber","p":1346},{"i":1354,"t":"package main import ( \"log\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // New fiber app app := fiber.New() // http middleware -> fiber.Handler app.Use(adaptor.HTTPMiddleware(logMiddleware)) // Listen on port 3000 app.Listen(\":3000\") } func logMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { log.Println(\"log middleware\") next.ServeHTTP(w, r) }) }","s":"net/http middleware to Fiber","u":"/api/middleware/adaptor","h":"#nethttp-middleware-to-fiber","p":1346},{"i":1356,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // fiber.Handler -> http.Handler http.Handle(\"/\", adaptor.FiberHandler(greet)) // fiber.Handler -> http.HandlerFunc http.HandleFunc(\"/func\", adaptor.FiberHandlerFunc(greet)) // Listen on port 3000 http.ListenAndServe(\":3000\", nil) } func greet(c *fiber.Ctx) error { return c.SendString(\"Hello World!\") }","s":"Fiber Handler to net/http","u":"/api/middleware/adaptor","h":"#fiber-handler-to-nethttp","p":1346},{"i":1358,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { app := fiber.New() app.Get(\"/greet\", greet) // Listen on port 3000 http.ListenAndServe(\":3000\", adaptor.FiberApp(app)) } func greet(c *fiber.Ctx) error { return c.SendString(\"Hello World!\") }","s":"Fiber App to net/http","u":"/api/middleware/adaptor","h":"#fiber-app-to-nethttp","p":1346},{"i":1360,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { app := fiber.New() app.Get(\"/greet\", greetWithHTTPReq) // Listen on port 3000 http.ListenAndServe(\":3000\", adaptor.FiberApp(app)) } func greetWithHTTPReq(c *fiber.Ctx) error { httpReq, err := adaptor.ConvertRequest(c, false) if err != nil { return err } return c.SendString(\"Request URL: \" + httpReq.URL.String()) }","s":"Fiber Context to (net/http).Request","u":"/api/middleware/adaptor","h":"#fiber-context-to-nethttprequest","p":1346},{"i":1362,"t":"Basic Authentication middleware for Fiber that provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized or a custom response for missing or invalid credentials.","s":"BasicAuth","u":"/api/middleware/basicauth","h":"","p":1361},{"i":1364,"t":"func New(config Config) fiber.Handler","s":"Signatures","u":"/api/middleware/basicauth","h":"#signatures","p":1361},{"i":1366,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/basicauth\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config app.Use(basicauth.New(basicauth.Config{ Users: map[string]string{ \"john\": \"doe\", \"admin\": \"123456\", }, })) // Or extend your config for customization app.Use(basicauth.New(basicauth.Config{ Users: map[string]string{ \"john\": \"doe\", \"admin\": \"123456\", }, Realm: \"Forbidden\", Authorizer: func(user, pass string) bool { if user == \"john\" && pass == \"doe\" { return true } if user == \"admin\" && pass == \"123456\" { return true } return false }, Unauthorized: func(c *fiber.Ctx) error { return c.SendFile(\"./unauthorized.html\") }, ContextUsername: \"_user\", ContextPassword: \"_pass\", }))","s":"Examples","u":"/api/middleware/basicauth","h":"#examples","p":1361},{"i":1368,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Users defines the allowed credentials // // Required. Default: map[string]string{} Users map[string]string // Realm is a string to define realm attribute of BasicAuth. // the realm identifies the system to authenticate against // and can be used by clients to save credentials // // Optional. Default: \"Restricted\". Realm string // Authorizer defines a function you can pass // to check the credentials however you want. // It will be called with a username and password // and is expected to return true or false to indicate // that the credentials were approved or not. // // Optional. Default: nil. Authorizer func(string, string) bool // Unauthorized defines the response body for unauthorized responses. // By default it will return with a 401 Unauthorized and the correct WWW-Auth header // // Optional. Default: nil Unauthorized fiber.Handler // ContextUser is the key to store the username in Locals // // Optional. Default: \"username\" ContextUsername string // ContextPass is the key to store the password in Locals // // Optional. Default: \"password\" ContextPassword string }","s":"Config","u":"/api/middleware/basicauth","h":"#config","p":1361},{"i":1370,"t":"var ConfigDefault = Config{ Next: nil, Users: map[string]string{}, Realm: \"Restricted\", Authorizer: nil, Unauthorized: nil, ContextUsername: \"username\", ContextPassword: \"password\", }","s":"Default Config","u":"/api/middleware/basicauth","h":"#default-config","p":1361},{"i":1372,"t":"Cache middleware for Fiber designed to intercept responses and cache them. This middleware will cache the Body, Content-Type and StatusCode using the c.Path() as unique identifier. Special thanks to @codemicro for creating this middleware for Fiber core! Request Directives Cache-Control: no-cache will return the up-to-date response but still caches it. You will always get a miss cache status. Cache-Control: no-store will refrain from caching. You will always get the up-to-date response.","s":"Cache","u":"/api/middleware/cache","h":"","p":1371},{"i":1374,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/cache","h":"#signatures","p":1371},{"i":1376,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/cache\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(cache.New()) // Or extend your config for customization app.Use(cache.New(cache.Config{ Next: func(c *fiber.Ctx) bool { return c.Query(\"refresh\") == \"true\" }, Expiration: 30 * time.Minute, CacheControl: true, })) Or you can custom key and expire time like this: app.Use(cache.New(cache.Config{ ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration { newCacheTime, _ := strconv.Atoi(c.GetRespHeader(\"Cache-Time\", \"600\")) return time.Second * time.Duration(newCacheTime) }, KeyGenerator: func(c *fiber.Ctx) string { return utils.CopyString(c.Path()) }, })) app.Get(\"/\", func(c *fiber.Ctx) error { c.Response().Header.Add(\"Cache-Time\", \"6000\") return c.SendString(\"hi\") })","s":"Examples","u":"/api/middleware/cache","h":"#examples","p":1371},{"i":1378,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Expiration is the time that an cached response will live // // Optional. Default: 1 * time.Minute Expiration time.Duration // CacheHeader header on response header, indicate cache status, with the following possible return value // // hit, miss, unreachable // // Optional. Default: X-Cache CacheHeader string // CacheControl enables client side caching if set to true // // Optional. Default: false CacheControl bool // Key allows you to generate custom keys, by default c.Path() is used // // Default: func(c *fiber.Ctx) string { // return utils.CopyString(c.Path()) // } KeyGenerator func(*fiber.Ctx) string // allows you to generate custom Expiration Key By Key, default is Expiration (Optional) // // Default: nil ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration // Store is used to store the state of the middleware // // Default: an in memory store for this process only Storage fiber.Storage // allows you to store additional headers generated by next middlewares & handler // // Default: false StoreResponseHeaders bool // Max number of bytes of response bodies simultaneously stored in cache. When limit is reached, // entries with the nearest expiration are deleted to make room for new. // 0 means no limit // // Default: 0 MaxBytes uint // You can specify HTTP methods to cache. // The middleware just caches the routes of its methods in this slice. // // Default: []string{fiber.MethodGet, fiber.MethodHead} Methods []string }","s":"Config","u":"/api/middleware/cache","h":"#config","p":1371},{"i":1380,"t":"var ConfigDefault = Config{ Next: nil, Expiration: 1 * time.Minute, CacheHeader: \"X-Cache\", CacheControl: false, KeyGenerator: func(c *fiber.Ctx) string { return utils.CopyString(c.Path()) }, ExpirationGenerator: nil, StoreResponseHeaders: false, Storage: nil, MaxBytes: 0, Methods: []string{fiber.MethodGet, fiber.MethodHead}, }","s":"Default Config","u":"/api/middleware/cache","h":"#default-config","p":1371},{"i":1382,"t":"Compression middleware for Fiber that will compress the response using gzip, deflate and brotli compression depending on the Accept-Encoding header.","s":"Compress","u":"/api/middleware/compress","h":"","p":1381},{"i":1384,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/compress","h":"#signatures","p":1381},{"i":1386,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/compress\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(compress.New()) // Or extend your config for customization app.Use(compress.New(compress.Config{ Level: compress.LevelBestSpeed, // 1 })) // Skip middleware for specific routes app.Use(compress.New(compress.Config{ Next: func(c *fiber.Ctx) bool { return c.Path() == \"/dont_compress\" }, Level: compress.LevelBestSpeed, // 1 }))","s":"Examples","u":"/api/middleware/compress","h":"#examples","p":1381},{"i":1388,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Level determines the compression algoritm // // Optional. Default: LevelDefault // LevelDisabled: -1 // LevelDefault: 0 // LevelBestSpeed: 1 // LevelBestCompression: 2 Level int }","s":"Config","u":"/api/middleware/compress","h":"#config","p":1381},{"i":1390,"t":"var ConfigDefault = Config{ Next: nil, Level: LevelDefault, }","s":"Default Config","u":"/api/middleware/compress","h":"#default-config","p":1381},{"i":1392,"t":"// Compression levels const ( LevelDisabled = -1 LevelDefault = 0 LevelBestSpeed = 1 LevelBestCompression = 2 )","s":"Constants","u":"/api/middleware/compress","h":"#constants","p":1381},{"i":1394,"t":"CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.","s":"CORS","u":"/api/middleware/cors","h":"","p":1393},{"i":1396,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/cors","h":"#signatures","p":1393},{"i":1398,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/cors\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(cors.New()) // Or extend your config for customization app.Use(cors.New(cors.Config{ AllowOrigins: \"https://gofiber.io, https://gofiber.net\", AllowHeaders: \"Origin, Content-Type, Accept\", })) Using the AllowOriginsFunc function. In this example any origin will be allowed via CORS. For example, if a browser running on http://localhost:3000 sends a request, this will be accepted and the access-control-allow-origin response header will be set to http://localhost:3000. Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via AllowOrigins. app.Use(cors.New()) app.Use(cors.New(cors.Config{ AllowOriginsFunc: func(origin string) bool { return os.Getenv(\"ENVIRONMENT\") == \"development\" }, }))","s":"Examples","u":"/api/middleware/cors","h":"#examples","p":1393},{"i":1400,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // AllowOriginsFunc defines a function that will set the 'access-control-allow-origin' // response header to the 'origin' request header when returned true. // // Note: Using this feature is discouraged in production and it's best practice to explicitly // set CORS origins via 'AllowOrigins' // // Optional. Default: nil AllowOriginsFunc func(origin string) bool // AllowOrigin defines a list of origins that may access the resource. // // Optional. Default value \"*\" AllowOrigins string // AllowMethods defines a list methods allowed when accessing the resource. // This is used in response to a preflight request. // // Optional. Default value \"GET,POST,HEAD,PUT,DELETE,PATCH\" AllowMethods string // AllowHeaders defines a list of request headers that can be used when // making the actual request. This is in response to a preflight request. // // Optional. Default value \"\". AllowHeaders string // AllowCredentials indicates whether or not the response to the request // can be exposed when the credentials flag is true. When used as part of // a response to a preflight request, this indicates whether or not the // actual request can be made using credentials. // // Optional. Default value false. AllowCredentials bool // ExposeHeaders defines a whitelist headers that clients are allowed to // access. // // Optional. Default value \"\". ExposeHeaders string // MaxAge indicates how long (in seconds) the results of a preflight request // can be cached. // // Optional. Default value 0. MaxAge int }","s":"Config","u":"/api/middleware/cors","h":"#config","p":1393},{"i":1402,"t":"var ConfigDefault = Config{ Next: nil, AllowOriginsFunc: nil, AllowOrigins: \"*\", AllowMethods: strings.Join([]string{ fiber.MethodGet, fiber.MethodPost, fiber.MethodHead, fiber.MethodPut, fiber.MethodDelete, fiber.MethodPatch, }, \",\"), AllowHeaders: \"\", AllowCredentials: false, ExposeHeaders: \"\", MaxAge: 0, }","s":"Default Config","u":"/api/middleware/cors","h":"#default-config","p":1393},{"i":1404,"t":"CSRF middleware for Fiber that provides Cross-site request forgery protection by passing a csrf token via cookies. This cookie value will be used to compare against the client csrf token on requests, other than those defined as \"safe\" by RFC7231 (GET, HEAD, OPTIONS, or TRACE). When the csrf token is invalid, this middleware will return the fiber.ErrForbidden error. CSRF Tokens are generated on GET requests. You can retrieve the CSRF token with c.Locals(contextKey), where contextKey is the string you set in the config (see Custom Config below). When no csrf_ cookie is set, or the token has expired, a new token will be generated and csrf_ cookie set. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.","s":"CSRF","u":"/api/middleware/csrf","h":"","p":1403},{"i":1406,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/csrf","h":"#signatures","p":1403},{"i":1408,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/csrf\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(csrf.New()) // Or extend your config for customization app.Use(csrf.New(csrf.Config{ KeyLookup: \"header:X-Csrf-Token\", CookieName: \"csrf_\", CookieSameSite: \"Lax\", Expiration: 1 * time.Hour, KeyGenerator: utils.UUID, Extractor: func(c *fiber.Ctx) (string, error) { ... }, })) note KeyLookup will be ignored if Extractor is explicitly set.","s":"Examples","u":"/api/middleware/csrf","h":"#examples","p":1403},{"i":1410,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // KeyLookup is a string in the form of \":\" that is used // to create an Extractor that extracts the token from the request. // Possible values: // - \"header:\" // - \"query:\" // - \"param:\" // - \"form:\" // - \"cookie:\" // // Ignored if an Extractor is explicitly set. // // Optional. Default: \"header:X-CSRF-Token\" KeyLookup string // Name of the session cookie. This cookie will store session key. // Optional. Default value \"csrf_\". CookieName string // Domain of the CSRF cookie. // Optional. Default value \"\". CookieDomain string // Path of the CSRF cookie. // Optional. Default value \"\". CookiePath string // Indicates if CSRF cookie is secure. // Optional. Default value false. CookieSecure bool // Indicates if CSRF cookie is HTTP only. // Optional. Default value false. CookieHTTPOnly bool // Indicates if CSRF cookie is requested by SameSite. // Optional. Default value \"Lax\". CookieSameSite string // Decides whether cookie should last for only the browser sesison. // Ignores Expiration if set to true CookieSessionOnly bool // Expiration is the duration before csrf token will expire // // Optional. Default: 1 * time.Hour Expiration time.Duration // Store is used to store the state of the middleware // // Optional. Default: memory.New() Storage fiber.Storage // Context key to store generated CSRF token into context. // If left empty, token will not be stored in context. // // Optional. Default: \"\" ContextKey string // KeyGenerator creates a new CSRF token // // Optional. Default: utils.UUID KeyGenerator func() string // Extractor returns the csrf token // // If set this will be used in place of an Extractor based on KeyLookup. // // Optional. Default will create an Extractor based on KeyLookup. Extractor func(c *fiber.Ctx) (string, error) }","s":"Config","u":"/api/middleware/csrf","h":"#config","p":1403},{"i":1412,"t":"var ConfigDefault = Config{ KeyLookup: \"header:\" + HeaderName, CookieName: \"csrf_\", CookieSameSite: \"Lax\", Expiration: 1 * time.Hour, KeyGenerator: utils.UUID, ErrorHandler: defaultErrorHandler, Extractor: CsrfFromHeader(HeaderName), }","s":"Default Config","u":"/api/middleware/csrf","h":"#default-config","p":1403},{"i":1414,"t":"const ( HeaderName = \"X-Csrf-Token\" )","s":"Constants","u":"/api/middleware/csrf","h":"#constants","p":1403},{"i":1416,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 app.Use(csrf.New(csrf.Config{ Storage: storage, }))","s":"Custom Storage/Database","u":"/api/middleware/csrf","h":"#custom-storagedatabase","p":1403},{"i":1418,"t":"The Early Data middleware for Fiber adds support for TLS 1.3's early data (\"0-RTT\") feature. Citing RFC 8446, when a client and server share a PSK, TLS 1.3 allows clients to send data on the first flight (\"early data\") to speed up the request, effectively reducing the regular 1-RTT request to a 0-RTT request. Make sure to enable fiber's EnableTrustedProxyCheck config option before using this middleware in order to not trust bogus HTTP request headers of the client. Also be aware that enabling support for early data in your reverse proxy (e.g. nginx, as done with a simple ssl_early_data on;) makes requests replayable. Refer to the following documents before continuing: https://datatracker.ietf.org/doc/html/rfc8446#section-8 https://blog.trailofbits.com/2019/03/25/what-application-developers-need-to-know-about-tls-early-data-0rtt/ By default, this middleware allows early data requests on safe HTTP request methods only and rejects the request otherwise, i.e. aborts the request before executing your handler. This behavior can be controlled by the AllowEarlyData config option. Safe HTTP methods β€” GET, HEAD, OPTIONS and TRACE β€” should not modify a state on the server.","s":"EarlyData","u":"/api/middleware/earlydata","h":"","p":1417},{"i":1420,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/earlydata","h":"#signatures","p":1417},{"i":1422,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/earlydata\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(earlydata.New()) // Or extend your config for customization app.Use(earlydata.New(earlydata.Config{ Error: fiber.ErrTooEarly, // ... }))","s":"Examples","u":"/api/middleware/earlydata","h":"#examples","p":1417},{"i":1424,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // IsEarlyData returns whether the request is an early-data request. // // Optional. Default: a function which checks if the \"Early-Data\" request header equals \"1\". IsEarlyData func(c *fiber.Ctx) bool // AllowEarlyData returns whether the early-data request should be allowed or rejected. // // Optional. Default: a function which rejects the request on unsafe and allows the request on safe HTTP request methods. AllowEarlyData func(c *fiber.Ctx) bool // Error is returned in case an early-data request is rejected. // // Optional. Default: fiber.ErrTooEarly. Error error }","s":"Config","u":"/api/middleware/earlydata","h":"#config","p":1417},{"i":1426,"t":"var ConfigDefault = Config{ IsEarlyData: func(c *fiber.Ctx) bool { return c.Get(DefaultHeaderName) == DefaultHeaderTrueValue }, AllowEarlyData: func(c *fiber.Ctx) bool { return fiber.IsMethodSafe(c.Method()) }, Error: fiber.ErrTooEarly, }","s":"Default Config","u":"/api/middleware/earlydata","h":"#default-config","p":1417},{"i":1428,"t":"const ( DefaultHeaderName = \"Early-Data\" DefaultHeaderTrueValue = \"1\" )","s":"Constants","u":"/api/middleware/earlydata","h":"#constants","p":1417},{"i":1430,"t":"Encrypt middleware for Fiber which encrypts cookie values. Note: this middleware does not encrypt cookie names.","s":"Encrypt Cookie","u":"/api/middleware/encryptcookie","h":"","p":1429},{"i":1432,"t":"// Intitializes the middleware func New(config ...Config) fiber.Handler // Returns a random 32 character long string func GenerateKey() string","s":"Signatures","u":"/api/middleware/encryptcookie","h":"#signatures","p":1429},{"i":1434,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/encryptcookie\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config // `Key` must be a 32 character string. It's used to encrypt the values, so make sure it is random and keep it secret. // You can run `openssl rand -base64 32` or call `encryptcookie.GenerateKey()` to create a random key for you. // Make sure not to set `Key` to `encryptcookie.GenerateKey()` because that will create a new key every run. app.Use(encryptcookie.New(encryptcookie.Config{ Key: \"secret-thirty-2-character-string\", })) // Get / reading out the encrypted cookie app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"value=\" + c.Cookies(\"test\")) }) // Post / create the encrypted cookie app.Post(\"/\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"test\", Value: \"SomeThing\", }) return nil })","s":"Examples","u":"/api/middleware/encryptcookie","h":"#examples","p":1429},{"i":1436,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Array of cookie keys that should not be encrypted. // // Optional. Default: [\"csrf_\"] Except []string // Base64 encoded unique key to encode & decode cookies. // // Required. The key should be 32 bytes of random data in base64-encoded form. // You may run `openssl rand -base64 32` or use `encryptcookie.GenerateKey()` to generate a new key. Key string // Custom function to encrypt cookies. // // Optional. Default: EncryptCookie Encryptor func(decryptedString, key string) (string, error) // Custom function to decrypt cookies. // // Optional. Default: DecryptCookie Decryptor func(encryptedString, key string) (string, error) }","s":"Config","u":"/api/middleware/encryptcookie","h":"#config","p":1429},{"i":1438,"t":"var ConfigDefault = Config{ Next: nil, Except: []string{\"csrf_\"}, Key: \"\", Encryptor: EncryptCookie, Decryptor: DecryptCookie, }","s":"Default Config","u":"/api/middleware/encryptcookie","h":"#default-config","p":1429},{"i":1440,"t":"Normally, encryptcookie middleware skips csrf_ cookies. However, it won't work when you use custom cookie names for CSRF. You should update Except config to avoid this problem. For example: app.Use(encryptcookie.New(encryptcookie.Config{ Key: \"secret-thirty-2-character-string\", Except: []string{\"csrf_1\"}, // exclude CSRF cookie })) app.Use(csrf.New(csrf.Config{ KeyLookup: \"form:test\", CookieName: \"csrf_1\", CookieHTTPOnly: true, }))","s":"Usage of CSRF and Encryptcookie Middlewares with Custom Cookie Names","u":"/api/middleware/encryptcookie","h":"#usage-of-csrf-and-encryptcookie-middlewares-with-custom-cookie-names","p":1429},{"i":1442,"t":"EnvVar middleware for Fiber that can be used to expose environment variables with various options.","s":"EnvVar","u":"/api/middleware/envvar","h":"","p":1441},{"i":1444,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/envvar","h":"#signatures","p":1441},{"i":1446,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/envvar\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(\"/expose/envvars\", envvar.New()) // Or extend your config for customization app.Use(\"/expose/envvars\", envvar.New( envvar.Config{ ExportVars: map[string]string{\"testKey\": \"\", \"testDefaultKey\": \"testDefaultVal\"}, ExcludeVars: map[string]string{\"excludeKey\": \"\"}, }), ) note You will need to provide a path to use the envvar middleware.","s":"Examples","u":"/api/middleware/envvar","h":"#examples","p":1441},{"i":1448,"t":"Http response contract: { \"vars\": { \"someEnvVariable\": \"someValue\", \"anotherEnvVariable\": \"anotherValue\", } }","s":"Response","u":"/api/middleware/envvar","h":"#response","p":1441},{"i":1450,"t":"// Config defines the config for middleware. type Config struct { // ExportVars specifies the environment variables that should export ExportVars map[string]string // ExcludeVars specifies the environment variables that should not export ExcludeVars map[string]string }","s":"Config","u":"/api/middleware/envvar","h":"#config","p":1441},{"i":1452,"t":"Config{}","s":"Default Config","u":"/api/middleware/envvar","h":"#default-config","p":1441},{"i":1454,"t":"ETag middleware for Fiber that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.","s":"ETag","u":"/api/middleware/etag","h":"","p":1453},{"i":1456,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/etag","h":"#signatures","p":1453},{"i":1458,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/etag\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(etag.New()) // Get / receives Etag: \"13-1831710635\" in response header app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) // Or extend your config for customization app.Use(etag.New(etag.Config{ Weak: true, })) // Get / receives Etag: \"W/\"13-1831710635\" in response header app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") })","s":"Examples","u":"/api/middleware/etag","h":"#examples","p":1453},{"i":1460,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Weak indicates that a weak validator is used. Weak etags are easy // to generate, but are far less useful for comparisons. Strong // validators are ideal for comparisons but can be very difficult // to generate efficiently. Weak ETag values of two representations // of the same resources might be semantically equivalent, but not // byte-for-byte identical. This means weak etags prevent caching // when byte range requests are used, but strong etags mean range // requests can still be cached. Weak bool }","s":"Config","u":"/api/middleware/etag","h":"#config","p":1453},{"i":1462,"t":"var ConfigDefault = Config{ Next: nil, Weak: false, }","s":"Default Config","u":"/api/middleware/etag","h":"#default-config","p":1453},{"i":1464,"t":"Expvar middleware for Fiber that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is /debug/vars.","s":"ExpVar","u":"/api/middleware/expvar","h":"","p":1463},{"i":1466,"t":"func New() fiber.Handler","s":"Signatures","u":"/api/middleware/expvar","h":"#signatures","p":1463},{"i":1468,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" expvarmw \"github.com/gofiber/fiber/v2/middleware/expvar\" ) After you initiate your Fiber app, you can use the following possibilities: var count = expvar.NewInt(\"count\") app.Use(expvarmw.New()) app.Get(\"/\", func(c *fiber.Ctx) error { count.Add(1) return c.SendString(fmt.Sprintf(\"hello expvar count %d\", count.Value())) }) Visit path /debug/vars to see all vars and use query r=key to filter exposed variables. curl 127.0.0.1:3000 hello expvar count 1 curl 127.0.0.1:3000/debug/vars { \"cmdline\": [\"xxx\"], \"count\": 1, \"expvarHandlerCalls\": 33, \"expvarRegexpErrors\": 0, \"memstats\": {...} } curl 127.0.0.1:3000/debug/vars?r=c { \"cmdline\": [\"xxx\"], \"count\": 1 }","s":"Examples","u":"/api/middleware/expvar","h":"#examples","p":1463},{"i":1470,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool }","s":"Config","u":"/api/middleware/expvar","h":"#config","p":1463},{"i":1472,"t":"var ConfigDefault = Config{ Next: nil, }","s":"Default Config","u":"/api/middleware/expvar","h":"#default-config","p":1463},{"i":1474,"t":"Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware. note This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or custom favicon URL.","s":"Favicon","u":"/api/middleware/favicon","h":"","p":1473},{"i":1476,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/favicon","h":"#signatures","p":1473},{"i":1478,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/favicon\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(favicon.New()) // Or extend your config for customization app.Use(favicon.New(favicon.Config{ File: \"./favicon.ico\", URL: \"/favicon.ico\", }))","s":"Examples","u":"/api/middleware/favicon","h":"#examples","p":1473},{"i":1480,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // File holds the path to an actual favicon that will be cached // // Optional. Default: \"\" File string // URL for favicon handler // // Optional. Default: \"/favicon.ico\" URL string // FileSystem is an optional alternate filesystem to search for the favicon in. // An example of this could be an embedded or network filesystem // // Optional. Default: nil FileSystem http.FileSystem // CacheControl defines how the Cache-Control header in the response should be set // // Optional. Default: \"public, max-age=31536000\" CacheControl string }","s":"Config","u":"/api/middleware/favicon","h":"#config","p":1473},{"i":1482,"t":"var ConfigDefault = Config{ Next: nil, File: \"\", URL: fPath, CacheControl: \"public, max-age=31536000\", }","s":"Default Config","u":"/api/middleware/favicon","h":"#default-config","p":1473},{"i":1484,"t":"Filesystem middleware for Fiber that enables you to serve files from a directory. caution :params & :optionals? within the prefix path are not supported! To handle paths with spaces (or other url encoded values) make sure to set fiber.Config{ UnescapePath: true }","s":"FileSystem","u":"/api/middleware/filesystem","h":"","p":1483},{"i":1486,"t":"func New(config Config) fiber.Handler","s":"Signatures","u":"/api/middleware/filesystem","h":"#signatures","p":1483},{"i":1488,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config app.Use(filesystem.New(filesystem.Config{ Root: http.Dir(\"./assets\"), })) // Or extend your config for customization app.Use(filesystem.New(filesystem.Config{ Root: http.Dir(\"./assets\"), Browse: true, Index: \"index.html\", NotFoundFile: \"404.html\", MaxAge: 3600, })) If your environment (Go 1.16+) supports it, we recommend using Go Embed instead of the other solutions listed as this one is native to Go and the easiest to use.","s":"Examples","u":"/api/middleware/filesystem","h":"#examples","p":1483},{"i":1490,"t":"Embed is the native method to embed files in a Golang excecutable. Introduced in Go 1.16. package main import ( \"embed\" \"io/fs\" \"log\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" ) // Embed a single file //go:embed index.html var f embed.FS // Embed a directory //go:embed static/* var embedDirStatic embed.FS func main() { app := fiber.New() app.Use(\"/\", filesystem.New(filesystem.Config{ Root: http.FS(f), })) // Access file \"image.png\" under `static/` directory via URL: `http:///static/image.png`. // Without `PathPrefix`, you have to access it via URL: // `http:///static/static/image.png`. app.Use(\"/static\", filesystem.New(filesystem.Config{ Root: http.FS(embedDirStatic), PathPrefix: \"static\", Browse: true, })) log.Fatal(app.Listen(\":3000\")) }","s":"embed","u":"/api/middleware/filesystem","h":"#embed","p":1483},{"i":1492,"t":"https://github.com/markbates/pkger package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/markbates/pkger\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: pkger.Dir(\"/assets\"), })) log.Fatal(app.Listen(\":3000\")) }","s":"pkger","u":"/api/middleware/filesystem","h":"#pkger","p":1483},{"i":1494,"t":"https://github.com/gobuffalo/packr package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/gobuffalo/packr/v2\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: packr.New(\"Assets Box\", \"/assets\"), })) log.Fatal(app.Listen(\":3000\")) }","s":"packr","u":"/api/middleware/filesystem","h":"#packr","p":1483},{"i":1496,"t":"https://github.com/GeertJohan/go.rice package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/GeertJohan/go.rice\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: rice.MustFindBox(\"assets\").HTTPBox(), })) log.Fatal(app.Listen(\":3000\")) }","s":"go.rice","u":"/api/middleware/filesystem","h":"#gorice","p":1483},{"i":1498,"t":"https://github.com/UnnoTed/fileb0x package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"/myEmbeddedFiles\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: myEmbeddedFiles.HTTP, })) log.Fatal(app.Listen(\":3000\")) }","s":"fileb0x","u":"/api/middleware/filesystem","h":"#fileb0x","p":1483},{"i":1500,"t":"https://github.com/rakyll/statik package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" // Use blank to invoke init function and register data to statik _ \"/statik\" \"github.com/rakyll/statik/fs\" ) func main() { statikFS, err := fs.New() if err != nil { panic(err) } app := fiber.New() app.Use(\"/\", filesystem.New(filesystem.Config{ Root: statikFS, })) log.Fatal(app.Listen(\":3000\")) }","s":"statik","u":"/api/middleware/filesystem","h":"#statik","p":1483},{"i":1502,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Root is a FileSystem that provides access // to a collection of files and directories. // // Required. Default: nil Root http.FileSystem `json:\"-\"` // PathPrefix defines a prefix to be added to a filepath when // reading a file from the FileSystem. // // Use when using Go 1.16 embed.FS // // Optional. Default \"\" PathPrefix string `json:\"path_prefix\"` // Enable directory browsing. // // Optional. Default: false Browse bool `json:\"browse\"` // Index file for serving a directory. // // Optional. Default: \"index.html\" Index string `json:\"index\"` // The value for the Cache-Control HTTP-header // that is set on the file response. MaxAge is defined in seconds. // // Optional. Default value 0. MaxAge int `json:\"max_age\"` // File to return if path is not found. Useful for SPA's. // // Optional. Default: \"\" NotFoundFile string `json:\"not_found_file\"` // The value for the Content-Type HTTP-header // that is set on the file response // // Optional. Default: \"\" ContentTypeCharset string `json:\"content_type_charset\"` }","s":"Config","u":"/api/middleware/filesystem","h":"#config","p":1483},{"i":1504,"t":"var ConfigDefault = Config{ Next: nil, Root: nil, PathPrefix: \"\", Browse: false, Index: \"/index.html\", MaxAge: 0, ContentTypeCharset: \"\", }","s":"Default Config","u":"/api/middleware/filesystem","h":"#default-config","p":1483},{"i":1506,"t":"Helmet middleware helps secure your apps by setting various HTTP headers.","s":"Helmet","u":"/api/middleware/helmet","h":"","p":1505},{"i":1508,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/helmet","h":"#signatures","p":1505},{"i":1510,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/helmet\" ) func main() { app := fiber.New() app.Use(helmet.New()) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome!\") }) app.Listen(\":3000\") } Test: curl -I http://localhost:3000","s":"Examples","u":"/api/middleware/helmet","h":"#examples","p":1505},{"i":1512,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // XSSProtection // Optional. Default value \"0\". XSSProtection string // ContentTypeNosniff // Optional. Default value \"nosniff\". ContentTypeNosniff string // XFrameOptions // Optional. Default value \"SAMEORIGIN\". // Possible values: \"SAMEORIGIN\", \"DENY\", \"ALLOW-FROM uri\" XFrameOptions string // HSTSMaxAge // Optional. Default value 0. HSTSMaxAge int // HSTSExcludeSubdomains // Optional. Default value false. HSTSExcludeSubdomains bool // ContentSecurityPolicy // Optional. Default value \"\". ContentSecurityPolicy string // CSPReportOnly // Optional. Default value false. CSPReportOnly bool // HSTSPreloadEnabled // Optional. Default value false. HSTSPreloadEnabled bool // ReferrerPolicy // Optional. Default value \"ReferrerPolicy\". ReferrerPolicy string // Permissions-Policy // Optional. Default value \"\". PermissionPolicy string // Cross-Origin-Embedder-Policy // Optional. Default value \"require-corp\". CrossOriginEmbedderPolicy string // Cross-Origin-Opener-Policy // Optional. Default value \"same-origin\". CrossOriginOpenerPolicy string // Cross-Origin-Resource-Policy // Optional. Default value \"same-origin\". CrossOriginResourcePolicy string // Origin-Agent-Cluster // Optional. Default value \"?1\". OriginAgentCluster string // X-DNS-Prefetch-Control // Optional. Default value \"off\". XDNSPrefetchControl string // X-Download-Options // Optional. Default value \"noopen\". XDownloadOptions string // X-Permitted-Cross-Domain-Policies // Optional. Default value \"none\". XPermittedCrossDomain string }","s":"Config","u":"/api/middleware/helmet","h":"#config","p":1505},{"i":1514,"t":"var ConfigDefault = Config{ XSSProtection: \"0\", ContentTypeNosniff: \"nosniff\", XFrameOptions: \"SAMEORIGIN\", ReferrerPolicy: \"no-referrer\", CrossOriginEmbedderPolicy: \"require-corp\", CrossOriginOpenerPolicy: \"same-origin\", CrossOriginResourcePolicy: \"same-origin\", OriginAgentCluster: \"?1\", XDNSPrefetchControl: \"off\", XDownloadOptions: \"noopen\", XPermittedCrossDomain: \"none\", }","s":"Default Config","u":"/api/middleware/helmet","h":"#default-config","p":1505},{"i":1516,"t":"Idempotency middleware for Fiber allows for fault-tolerant APIs where duplicate requests β€” for example due to networking issues on the client-side β€” do not erroneously cause the same action performed multiple times on the server-side. Refer to https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02 for a better understanding.","s":"Idempotency","u":"/api/middleware/idempotency","h":"","p":1515},{"i":1518,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/idempotency","h":"#signatures","p":1515},{"i":1520,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/idempotency\" ) After you initiate your Fiber app, you can use the following possibilities:","s":"Examples","u":"/api/middleware/idempotency","h":"#examples","p":1515},{"i":1522,"t":"app.Use(idempotency.New())","s":"Default Config","u":"/api/middleware/idempotency","h":"#default-config","p":1515},{"i":1524,"t":"app.Use(idempotency.New(idempotency.Config{ Lifetime: 42 * time.Minute, // ... }))","s":"Custom Config","u":"/api/middleware/idempotency","h":"#custom-config","p":1515},{"i":1526,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: a function which skips the middleware on safe HTTP request method. Next func(c *fiber.Ctx) bool // Lifetime is the maximum lifetime of an idempotency key. // // Optional. Default: 30 * time.Minute Lifetime time.Duration // KeyHeader is the name of the header that contains the idempotency key. // // Optional. Default: X-Idempotency-Key KeyHeader string // KeyHeaderValidate defines a function to validate the syntax of the idempotency header. // // Optional. Default: a function which ensures the header is 36 characters long (the size of an UUID). KeyHeaderValidate func(string) error // KeepResponseHeaders is a list of headers that should be kept from the original response. // // Optional. Default: nil (to keep all headers) KeepResponseHeaders []string // Lock locks an idempotency key. // // Optional. Default: an in-memory locker for this process only. Lock Locker // Storage stores response data by idempotency key. // // Optional. Default: an in-memory storage for this process only. Storage fiber.Storage }","s":"Config","u":"/api/middleware/idempotency","h":"#config","p":1515},{"i":1528,"t":"var ConfigDefault = Config{ Next: func(c *fiber.Ctx) bool { // Skip middleware if the request was done using a safe HTTP method return fiber.IsMethodSafe(c.Method()) }, Lifetime: 30 * time.Minute, KeyHeader: \"X-Idempotency-Key\", KeyHeaderValidate: func(k string) error { if l, wl := len(k), 36; l != wl { // UUID length is 36 chars return fmt.Errorf(\"%w: invalid length: %d != %d\", ErrInvalidIdempotencyKey, l, wl) } return nil }, KeepResponseHeaders: nil, Lock: nil, // Set in configDefault so we don't allocate data here. Storage: nil, // Set in configDefault so we don't allocate data here. }","s":"Default Config","u":"/api/middleware/idempotency","h":"#default-config-1","p":1515},{"i":1530,"t":"Key auth middleware provides a key based authentication.","s":"Keyauth","u":"/api/middleware/keyauth","h":"","p":1529},{"i":1532,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/keyauth","h":"#signatures","p":1529},{"i":1534,"t":"package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" ) var ( apiKey = \"correct horse battery staple\" ) func validateAPIKey(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey } func main() { app := fiber.New() // note that the keyauth middleware needs to be defined before the routes are defined! app.Use(keyauth.New(keyauth.Config{ KeyLookup: \"cookie:access_token\", Validator: validateAPIKey, })) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Listen(\":3000\") } Test: # No api-key specified -> 400 missing curl http://localhost:3000 #> missing or malformed API Key curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000 #> Successfully authenticated! curl --cookie \"access_token=Clearly A Wrong Key\" http://localhost:3000 #> missing or malformed API Key For a more detailed example, see also the github.com/gofiber/recipes repository and specifically the fiber-envoy-extauthz repository and the keyauth example code.","s":"Examples","u":"/api/middleware/keyauth","h":"#examples","p":1529},{"i":1536,"t":"If you want to authenticate only certain endpoints, you can use the Config of keyauth and apply a filter function (eg. authFilter) like so package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" \"regexp\" \"strings\" ) var ( apiKey = \"correct horse battery staple\" protectedURLs = []*regexp.Regexp{ regexp.MustCompile(\"^/authenticated$\"), regexp.MustCompile(\"^/auth2$\"), } ) func validateAPIKey(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey } func authFilter(c *fiber.Ctx) bool { originalURL := strings.ToLower(c.OriginalURL()) for _, pattern := range protectedURLs { if pattern.MatchString(originalURL) { return false } } return true } func main() { app := fiber.New() app.Use(keyauth.New(keyauth.Config{ Next: authFilter, KeyLookup: \"cookie:access_token\", Validator: validateAPIKey, })) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome\") }) app.Get(\"/authenticated\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Get(\"/auth2\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated 2!\") }) app.Listen(\":3000\") } Which results in this # / does not need to be authenticated curl http://localhost:3000 #> Welcome # /authenticated needs to be authenticated curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000/authenticated #> Successfully authenticated! # /auth2 needs to be authenticated too curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000/auth2 #> Successfully authenticated 2!","s":"Authenticate only certain endpoints","u":"/api/middleware/keyauth","h":"#authenticate-only-certain-endpoints","p":1529},{"i":1538,"t":"package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" ) const ( apiKey = \"my-super-secret-key\" ) func main() { app := fiber.New() authMiddleware := keyauth.New(keyauth.Config{ Validator: func(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey }, }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome\") }) app.Get(\"/allowed\", authMiddleware, func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Listen(\":3000\") } Which results in this # / does not need to be authenticated curl http://localhost:3000 #> Welcome # /allowed needs to be authenticated too curl --header \"Authorization: Bearer my-super-secret-key\" http://localhost:3000/allowed #> Successfully authenticated!","s":"Specifying middleware in the handler","u":"/api/middleware/keyauth","h":"#specifying-middleware-in-the-handler","p":1529},{"i":1540,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // SuccessHandler defines a function which is executed for a valid key. // Optional. Default: nil SuccessHandler fiber.Handler // ErrorHandler defines a function which is executed for an invalid key. // It may be used to define a custom error. // Optional. Default: 401 Invalid or expired key ErrorHandler fiber.ErrorHandler // KeyLookup is a string in the form of \":\" that is used // to extract key from the request. // Optional. Default value \"header:Authorization\". // Possible values: // - \"header:\" // - \"query:\" // - \"form:\" // - \"param:\" // - \"cookie:\" KeyLookup string // AuthScheme to be used in the Authorization header. // Optional. Default value \"Bearer\". AuthScheme string // Validator is a function to validate key. Validator func(*fiber.Ctx, string) (bool, error) // Context key to store the bearertoken from the token into context. // Optional. Default: \"token\". ContextKey string }","s":"Config","u":"/api/middleware/keyauth","h":"#config","p":1529},{"i":1542,"t":"var ConfigDefault = Config{ SuccessHandler: func(c *fiber.Ctx) error { return c.Next() }, ErrorHandler: func(c *fiber.Ctx, err error) error { if err == ErrMissingOrMalformedAPIKey { return c.Status(fiber.StatusUnauthorized).SendString(err.Error()) } return c.Status(fiber.StatusUnauthorized).SendString(\"Invalid or expired API Key\") }, KeyLookup: \"header:\" + fiber.HeaderAuthorization, AuthScheme: \"Bearer\", ContextKey: \"token\", }","s":"Default Config","u":"/api/middleware/keyauth","h":"#default-config","p":1529},{"i":1544,"t":"Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases. note This module does not share state with other processes/servers by default.","s":"Limiter","u":"/api/middleware/limiter","h":"","p":1543},{"i":1546,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/limiter","h":"#signatures","p":1543},{"i":1548,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/limiter\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(limiter.New()) // Or extend your config for customization app.Use(limiter.New(limiter.Config{ Next: func(c *fiber.Ctx) bool { return c.IP() == \"127.0.0.1\" }, Max: 20, Expiration: 30 * time.Second, KeyGenerator: func(c *fiber.Ctx) string { return c.Get(\"x-forwarded-for\") }, LimitReached: func(c *fiber.Ctx) error { return c.SendFile(\"./toofast.html\") }, Storage: myCustomStorage{}, }))","s":"Examples","u":"/api/middleware/limiter","h":"#examples","p":1543},{"i":1550,"t":"Instead of using the standard fixed window algorithm, you can enable the sliding window algorithm. A example of such configuration is: app.Use(limiter.New(limiter.Config{ Max: 20, Expiration: 30 * time.Second, LimiterMiddleware: limiter.SlidingWindow{}, })) This means that every window will take into account the previous window(if there was any). The given formula for the rate is: weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration) rate = weightOfPreviousWindpw + current window's amount request.","s":"Sliding window","u":"/api/middleware/limiter","h":"#sliding-window","p":1543},{"i":1552,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Max number of recent connections during `Duration` seconds before sending a 429 response // // Default: 5 Max int // KeyGenerator allows you to generate custom keys, by default c.IP() is used // // Default: func(c *fiber.Ctx) string { // return c.IP() // } KeyGenerator func(*fiber.Ctx) string // Expiration is the time on how long to keep records of requests in memory // // Default: 1 * time.Minute Expiration time.Duration // LimitReached is called when a request hits the limit // // Default: func(c *fiber.Ctx) error { // return c.SendStatus(fiber.StatusTooManyRequests) // } LimitReached fiber.Handler // When set to true, requests with StatusCode >= 400 won't be counted. // // Default: false SkipFailedRequests bool // When set to true, requests with StatusCode < 400 won't be counted. // // Default: false SkipSuccessfulRequests bool // Store is used to store the state of the middleware // // Default: an in memory store for this process only Storage fiber.Storage // LimiterMiddleware is the struct that implements limiter middleware. // // Default: a new Fixed Window Rate Limiter LimiterMiddleware LimiterHandler } note A custom store can be used if it implements the Storage interface - more details and an example can be found in store.go.","s":"Config","u":"/api/middleware/limiter","h":"#config","p":1543},{"i":1554,"t":"var ConfigDefault = Config{ Max: 5, Expiration: 1 * time.Minute, KeyGenerator: func(c *fiber.Ctx) string { return c.IP() }, LimitReached: func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusTooManyRequests) }, SkipFailedRequests: false, SkipSuccessfulRequests: false, LimiterMiddleware: FixedWindow{}, }","s":"Default Config","u":"/api/middleware/limiter","h":"#default-config","p":1543},{"i":1556,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 app.Use(limiter.New(limiter.Config{ Storage: storage, }))","s":"Custom Storage/Database","u":"/api/middleware/limiter","h":"#custom-storagedatabase","p":1543},{"i":1558,"t":"Logger middleware for Fiber that logs HTTP request/response details.","s":"Logger","u":"/api/middleware/logger","h":"","p":1557},{"i":1560,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/logger","h":"#signatures","p":1557},{"i":1562,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/logger\" ) tip The order of registration plays a role. Only all routes that are registered after this one will be logged. The middleware should therefore be one of the first to be registered. After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(logger.New()) // Or extend your config for customization // Logging remote IP and Port app.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) // Logging Request ID app.Use(requestid.New()) app.Use(logger.New(logger.Config{ // For more options, see the Config section Format: \"${pid} ${locals:requestid} ${status} - ${method} ${path}​\\n\", })) // Changing TimeZone & TimeFormat app.Use(logger.New(logger.Config{ Format: \"${pid} ${status} - ${method} ${path}\\n\", TimeFormat: \"02-Jan-2006\", TimeZone: \"America/New_York\", })) // Custom File Writer file, err := os.OpenFile(\"./123.log\", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) if err != nil { log.Fatalf(\"error opening file: %v\", err) } defer file.Close() app.Use(logger.New(logger.Config{ Output: file, })) // Add Custom Tags app.Use(logger.New(logger.Config{ CustomTags: map[string]logger.LogFunc{ \"custom_tag\": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) { return output.WriteString(\"it is a custom tag\") }, }, })) // Callback after log is written app.Use(logger.New(logger.Config{ TimeFormat: time.RFC3339Nano, TimeZone: \"Asia/Shanghai\", Done: func(c *fiber.Ctx, logString []byte) { if c.Response().StatusCode() != fiber.StatusOK { reporter.SendToSlack(logString) } }, })) // Disable colors when outputting to default format app.Use(logger.New(logger.Config{ DisableColors: true, }))","s":"Examples","u":"/api/middleware/logger","h":"#examples","p":1557},{"i":1564,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Done is a function that is called after the log string for a request is written to Output, // and pass the log string as parameter. // // Optional. Default: nil Done func(c *fiber.Ctx, logString []byte) // tagFunctions defines the custom tag action // // Optional. Default: map[string]LogFunc CustomTags map[string]LogFunc // Format defines the logging tags // // Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\\n Format string // TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html // // Optional. Default: 15:04:05 TimeFormat string // TimeZone can be specified, such as \"UTC\" and \"America/New_York\" and \"Asia/Chongqing\", etc // // Optional. Default: \"Local\" TimeZone string // TimeInterval is the delay before the timestamp is updated // // Optional. Default: 500 * time.Millisecond TimeInterval time.Duration // Output is a writer where logs are written // // Default: os.Stdout Output io.Writer // DisableColors defines if the logs output should be colorized // // Default: false DisableColors bool enableColors bool enableLatency bool timeZoneLocation *time.Location } type LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)","s":"Config","u":"/api/middleware/logger","h":"#config","p":1557},{"i":1566,"t":"var ConfigDefault = Config{ Next: nil, Done: nil, Format: \"[${time}] ${status} - ${latency} ${method} ${path}\\n\", TimeFormat: \"15:04:05\", TimeZone: \"Local\", TimeInterval: 500 * time.Millisecond, Output: os.Stdout, DisableColors: true, }","s":"Default Config","u":"/api/middleware/logger","h":"#default-config","p":1557},{"i":1568,"t":"// Logger variables const ( TagPid = \"pid\" TagTime = \"time\" TagReferer = \"referer\" TagProtocol = \"protocol\" TagPort = \"port\" TagIP = \"ip\" TagIPs = \"ips\" TagHost = \"host\" TagMethod = \"method\" TagPath = \"path\" TagURL = \"url\" TagUA = \"ua\" TagLatency = \"latency\" TagStatus = \"status\" // response status TagResBody = \"resBody\" // response body TagReqHeaders = \"reqHeaders\" TagQueryStringParams = \"queryParams\" // request query parameters TagBody = \"body\" // request body TagBytesSent = \"bytesSent\" TagBytesReceived = \"bytesReceived\" TagRoute = \"route\" TagError = \"error\" // DEPRECATED: Use TagReqHeader instead TagHeader = \"header:\" // request header TagReqHeader = \"reqHeader:\" // request header TagRespHeader = \"respHeader:\" // response header TagQuery = \"query:\" // request query TagForm = \"form:\" // request form TagCookie = \"cookie:\" // request cookie TagLocals = \"locals:\" // colors TagBlack = \"black\" TagRed = \"red\" TagGreen = \"green\" TagYellow = \"yellow\" TagBlue = \"blue\" TagMagenta = \"magenta\" TagCyan = \"cyan\" TagWhite = \"white\" TagReset = \"reset\" )","s":"Constants","u":"/api/middleware/logger","h":"#constants","p":1557},{"i":1570,"t":"Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor caution Monitor is still in beta, API might change in the future!","s":"Monitor","u":"/api/middleware/monitor","h":"","p":1569},{"i":1572,"t":"func New() fiber.Handler","s":"Signatures","u":"/api/middleware/monitor","h":"#signatures","p":1569},{"i":1574,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/monitor\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config (Assign the middleware to /metrics) app.Get(\"/metrics\", monitor.New()) // Or extend your config for customization // Assign the middleware to /metrics // and change the Title to `MyService Metrics Page` app.Get(\"/metrics\", monitor.New(monitor.Config{Title: \"MyService Metrics Page\"})) You can also access the API endpoint with curl -X GET -H \"Accept: application/json\" http://localhost:3000/metrics which returns: {\"pid\":{ \"cpu\":0.4568381746582226, \"ram\":20516864, \"conns\":3 }, \"os\": { \"cpu\":8.759124087593099, \"ram\":3997155328, \"conns\":44, \"total_ram\":8245489664, \"load_avg\":0.51 }}","s":"Examples","u":"/api/middleware/monitor","h":"#examples","p":1569},{"i":1576,"t":"// Config defines the config for middleware. type Config struct { // Metrics page title // // Optional. Default: \"Fiber Monitor\" Title string // Refresh period // // Optional. Default: 3 seconds Refresh time.Duration // Whether the service should expose only the monitoring API. // // Optional. Default: false APIOnly bool // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Custom HTML Code to Head Section(Before End) // // Optional. Default: empty CustomHead string // FontURL for specify font resource path or URL . also you can use relative path // // Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap FontURL string // ChartJsURL for specify ChartJS library path or URL . also you can use relative path // // Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js ChartJsURL string index string }","s":"Config","u":"/api/middleware/monitor","h":"#config","p":1569},{"i":1578,"t":"var ConfigDefault = Config{ Title: defaultTitle, Refresh: defaultRefresh, FontURL: defaultFontURL, ChartJsURL: defaultChartJSURL, CustomHead: defaultCustomHead, APIOnly: false, Next: nil, index: newIndex(viewBag{ defaultTitle, defaultRefresh, defaultFontURL, defaultChartJSURL, defaultCustomHead, }), }","s":"Default Config","u":"/api/middleware/monitor","h":"#default-config","p":1569},{"i":1580,"t":"Pprof middleware for Fiber that serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/.","s":"Pprof","u":"/api/middleware/pprof","h":"","p":1579},{"i":1582,"t":"func New() fiber.Handler","s":"Signatures","u":"/api/middleware/pprof","h":"#signatures","p":1579},{"i":1584,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/pprof\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(pprof.New()) // Or extend your config for customization // For example, in systems where you have multiple ingress endpoints, it is common to add a URL prefix, like so: app.Use(pprof.New(pprof.Config{Prefix: \"/endpoint-prefix\"})) // This prefix will be added to the default path of \"/debug/pprof/\", for a resulting URL of: \"/endpoint-prefix/debug/pprof/\".","s":"Examples","u":"/api/middleware/pprof","h":"#examples","p":1579},{"i":1586,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Prefix defines a URL prefix added before \"/debug/pprof\". // Note that it should start with (but not end with) a slash. // Example: \"/federated-fiber\" // // Optional. Default: \"\" Prefix string }","s":"Config","u":"/api/middleware/pprof","h":"#config","p":1579},{"i":1588,"t":"var ConfigDefault = Config{ Next: nil, }","s":"Default Config","u":"/api/middleware/pprof","h":"#default-config","p":1579},{"i":1590,"t":"Proxy middleware for Fiber that allows you to proxy requests to multiple servers.","s":"Proxy","u":"/api/middleware/proxy","h":"","p":1589},{"i":1592,"t":"// Balancer create a load balancer among multiple upstrem servers. func Balancer(config Config) fiber.Handler // Forward performs the given http request and fills the given http response. func Forward(addr string, clients ...*fasthttp.Client) fiber.Handler // Do performs the given http request and fills the given http response. func Do(c *fiber.Ctx, addr string, clients ...*fasthttp.Client) error // DoRedirects performs the given http request and fills the given http response while following up to maxRedirectsCount redirects. func DoRedirects(c *fiber.Ctx, addr string, maxRedirectsCount int, clients ...*fasthttp.Client) error // DoDeadline performs the given request and waits for response until the given deadline. func DoDeadline(c *fiber.Ctx, addr string, deadline time.Time, clients ...*fasthttp.Client) error // DoTimeout performs the given request and waits for response during the given timeout duration. func DoTimeout(c *fiber.Ctx, addr string, timeout time.Duration, clients ...*fasthttp.Client) error // DomainForward the given http request based on the given domain and fills the given http response func DomainForward(hostname string, addr string, clients ...*fasthttp.Client) fiber.Handler // BalancerForward performs the given http request based round robin balancer and fills the given http response func BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler","s":"Signatures","u":"/api/middleware/proxy","h":"#signatures","p":1589},{"i":1594,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/proxy\" ) After you initiate your Fiber app, you can use the following possibilities: // if target https site uses a self-signed certificate, you should // call WithTlsConfig before Do and Forward proxy.WithTlsConfig(&tls.Config{ InsecureSkipVerify: true, }) // if you need to use global self-custom client, you should use proxy.WithClient. proxy.WithClient(&fasthttp.Client{ NoDefaultUserAgentHeader: true, DisablePathNormalizing: true, }) // Forward to url app.Get(\"/gif\", proxy.Forward(\"https://i.imgur.com/IWaBepg.gif\")) // If you want to forward with a specific domain. You have to use proxy.DomainForward. app.Get(\"/payments\", proxy.DomainForward(\"docs.gofiber.io\", \"http://localhost:8000\")) // Forward to url with local custom client app.Get(\"/gif\", proxy.Forward(\"https://i.imgur.com/IWaBepg.gif\", &fasthttp.Client{ NoDefaultUserAgentHeader: true, DisablePathNormalizing: true, })) // Make request within handler app.Get(\"/:id\", func(c *fiber.Ctx) error { url := \"https://i.imgur.com/\"+c.Params(\"id\")+\".gif\" if err := proxy.Do(c, url); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests while following redirects app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoRedirects(c, \"http://google.com\", 3); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests and wait up to 5 seconds before timing out app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoTimeout(c, \"http://localhost:3000\", time.Second * 5); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests, timeout a minute from now app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoDeadline(c, \"http://localhost\", time.Now().Add(time.Minute)); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Minimal round robin balancer app.Use(proxy.Balancer(proxy.Config{ Servers: []string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }, })) // Or extend your balancer for customization app.Use(proxy.Balancer(proxy.Config{ Servers: []string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }, ModifyRequest: func(c *fiber.Ctx) error { c.Request().Header.Add(\"X-Real-IP\", c.IP()) return nil }, ModifyResponse: func(c *fiber.Ctx) error { c.Response().Header.Del(fiber.HeaderServer) return nil }, })) // Or this way if the balancer is using https and the destination server is only using http. app.Use(proxy.BalancerForward([]string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }))","s":"Examples","u":"/api/middleware/proxy","h":"#examples","p":1589},{"i":1596,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Servers defines a list of :// HTTP servers, // // which are used in a round-robin manner. // i.e.: \"https://foobar.com, http://www.foobar.com\" // // Required Servers []string // ModifyRequest allows you to alter the request // // Optional. Default: nil ModifyRequest fiber.Handler // ModifyResponse allows you to alter the response // // Optional. Default: nil ModifyResponse fiber.Handler // Timeout is the request timeout used when calling the proxy client // // Optional. Default: 1 second Timeout time.Duration // Per-connection buffer size for requests' reading. // This also limits the maximum header size. // Increase this buffer if your clients send multi-KB RequestURIs // and/or multi-KB headers (for example, BIG cookies). ReadBufferSize int // Per-connection buffer size for responses' writing. WriteBufferSize int // tls config for the http client. TlsConfig *tls.Config // Client is custom client when client config is complex. // Note that Servers, Timeout, WriteBufferSize, ReadBufferSize and TlsConfig // will not be used if the client are set. Client *fasthttp.LBClient }","s":"Config","u":"/api/middleware/proxy","h":"#config","p":1589},{"i":1598,"t":"var ConfigDefault = Config{ Next: nil, ModifyRequest: nil, ModifyResponse: nil, Timeout: fasthttp.DefaultLBClientTimeout, }","s":"Default Config","u":"/api/middleware/proxy","h":"#default-config","p":1589},{"i":1600,"t":"Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.","s":"Recover","u":"/api/middleware/recover","h":"","p":1599},{"i":1602,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/recover","h":"#signatures","p":1599},{"i":1604,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/recover\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(recover.New()) // This panic will be caught by the middleware app.Get(\"/\", func(c *fiber.Ctx) error { panic(\"I'm an error\") })","s":"Examples","u":"/api/middleware/recover","h":"#examples","p":1599},{"i":1606,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // EnableStackTrace enables handling stack trace // // Optional. Default: false EnableStackTrace bool // StackTraceHandler defines a function to handle stack trace // // Optional. Default: defaultStackTraceHandler StackTraceHandler func(c *fiber.Ctx, e interface{}) }","s":"Config","u":"/api/middleware/recover","h":"#config","p":1599},{"i":1608,"t":"var ConfigDefault = Config{ Next: nil, EnableStackTrace: false, StackTraceHandler: defaultStackTraceHandler, }","s":"Default Config","u":"/api/middleware/recover","h":"#default-config","p":1599},{"i":1610,"t":"Redirection middleware for Fiber.","s":"Redirect","u":"/api/middleware/redirect","h":"","p":1609},{"i":1612,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/redirect","h":"#signatures","p":1609},{"i":1614,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/redirect\" ) func main() { app := fiber.New() app.Use(redirect.New(redirect.Config{ Rules: map[string]string{ \"/old\": \"/new\", \"/old/*\": \"/new/$1\", }, StatusCode: 301, })) app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) app.Get(\"/new/*\", func(c *fiber.Ctx) error { return c.SendString(\"Wildcard: \" + c.Params(\"*\")) }) app.Listen(\":3000\") } Test: curl http://localhost:3000/old curl http://localhost:3000/old/hello","s":"Examples","u":"/api/middleware/redirect","h":"#examples","p":1609},{"i":1616,"t":"// Config defines the config for middleware. type Config struct { // Filter defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // Rules defines the URL path rewrite rules. The values captured in asterisk can be // retrieved by index e.g. $1, $2 and so on. // Required. Example: // \"/old\": \"/new\", // \"/api/*\": \"/$1\", // \"/js/*\": \"/public/javascripts/$1\", // \"/users/*/orders/*\": \"/user/$1/order/$2\", Rules map[string]string // The status code when redirecting // This is ignored if Redirect is disabled // Optional. Default: 302 (fiber.StatusFound) StatusCode int rulesRegex map[*regexp.Regexp]string }","s":"Config","u":"/api/middleware/redirect","h":"#config","p":1609},{"i":1618,"t":"var ConfigDefault = Config{ StatusCode: fiber.StatusFound, }","s":"Default Config","u":"/api/middleware/redirect","h":"#default-config","p":1609},{"i":1620,"t":"RequestID middleware for Fiber that adds an indentifier to the response.","s":"RequestID","u":"/api/middleware/requestid","h":"","p":1619},{"i":1622,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/requestid","h":"#signatures","p":1619},{"i":1624,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/requestid\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(requestid.New()) // Or extend your config for customization app.Use(requestid.New(requestid.Config{ Header: \"X-Custom-Header\", Generator: func() string { return \"static-id\" }, }))","s":"Examples","u":"/api/middleware/requestid","h":"#examples","p":1619},{"i":1626,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Header is the header key where to get/set the unique request ID // // Optional. Default: \"X-Request-ID\" Header string // Generator defines a function to generate the unique identifier. // // Optional. Default: utils.UUID Generator func() string // ContextKey defines the key used when storing the request ID in // the locals for a specific request. // // Optional. Default: requestid ContextKey interface{} }","s":"Config","u":"/api/middleware/requestid","h":"#config","p":1619},{"i":1628,"t":"The default config uses a fast UUID generator which will expose the number of requests made to the server. To conceal this value for better privacy, use the utils.UUIDv4 generator. var ConfigDefault = Config{ Next: nil, Header: fiber.HeaderXRequestID, Generator: utils.UUID, ContextKey: \"requestid\", }","s":"Default Config","u":"/api/middleware/requestid","h":"#default-config","p":1619},{"i":1630,"t":"Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links.","s":"Rewrite","u":"/api/middleware/rewrite","h":"","p":1629},{"i":1632,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/rewrite","h":"#signatures","p":1629},{"i":1634,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/rewrite\" ) func main() { app := fiber.New() app.Use(rewrite.New(rewrite.Config{ Rules: map[string]string{ \"/old\": \"/new\", \"/old/*\": \"/new/$1\", }, })) app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) app.Get(\"/new/*\", func(c *fiber.Ctx) error { return c.SendString(\"Wildcard: \" + c.Params(\"*\")) }) app.Listen(\":3000\") } Test: curl http://localhost:3000/old curl http://localhost:3000/old/hello","s":"Examples","u":"/api/middleware/rewrite","h":"#examples","p":1629},{"i":1636,"t":"Session middleware for Fiber. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.","s":"Session","u":"/api/middleware/session","h":"","p":1635},{"i":1638,"t":"func New(config ...Config) *Store func (s *Store) RegisterType(i interface{}) func (s *Store) Get(c *fiber.Ctx) (*Session, error) func (s *Store) Reset() error func (s *Session) Get(key string) interface{} func (s *Session) Set(key string, val interface{}) func (s *Session) Delete(key string) func (s *Session) Destroy() error func (s *Session) Regenerate() error func (s *Session) Save() error func (s *Session) Fresh() bool func (s *Session) ID() string func (s *Session) Keys() []string caution Storing interface{} values are limited to built-ins Go types.","s":"Signatures","u":"/api/middleware/session","h":"#signatures","p":1635},{"i":1640,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/session\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config // This stores all of your app's sessions store := session.New() app.Get(\"/\", func(c *fiber.Ctx) error { // Get session from storage sess, err := store.Get(c) if err != nil { panic(err) } // Get value name := sess.Get(\"name\") // Set key/value sess.Set(\"name\", \"john\") // Get all Keys keys := sess.Keys() // Delete key sess.Delete(\"name\") // Destroy session if err := sess.Destroy(); err != nil { panic(err) } // Sets a specific expiration for this session sess.SetExpiry(time.Second * 2) // Save session if err := sess.Save(); err != nil { panic(err) } return c.SendString(fmt.Sprintf(\"Welcome %v\", name)) })","s":"Examples","u":"/api/middleware/session","h":"#examples","p":1635},{"i":1642,"t":"// Config defines the config for middleware. type Config struct { // Allowed session duration // Optional. Default value 24 * time.Hour Expiration time.Duration // Storage interface to store the session data // Optional. Default value memory.New() Storage fiber.Storage // KeyLookup is a string in the form of \":\" that is used // to extract session id from the request. // Possible values: \"header:\", \"query:\" or \"cookie:\" // Optional. Default value \"cookie:session_id\". KeyLookup string // Domain of the CSRF cookie. // Optional. Default value \"\". CookieDomain string // Path of the CSRF cookie. // Optional. Default value \"\". CookiePath string // Indicates if CSRF cookie is secure. // Optional. Default value false. CookieSecure bool // Indicates if CSRF cookie is HTTP only. // Optional. Default value false. CookieHTTPOnly bool // Value of SameSite cookie. // Optional. Default value \"Lax\". CookieSameSite string // Decides whether cookie should last for only the browser sesison. // Ignores Expiration if set to true // Optional. Default value false. CookieSessionOnly bool // KeyGenerator generates the session key. // Optional. Default value utils.UUIDv4 KeyGenerator func() string // Deprecated: Please use KeyLookup CookieName string // Source defines where to obtain the session id source Source // The session name sessionName string }","s":"Config","u":"/api/middleware/session","h":"#config","p":1635},{"i":1644,"t":"var ConfigDefault = Config{ Expiration: 24 * time.Hour, KeyLookup: \"cookie:session_id\", KeyGenerator: utils.UUIDv4, source: \"cookie\", sessionName: \"session_id\", }","s":"Default Config","u":"/api/middleware/session","h":"#default-config","p":1635},{"i":1646,"t":"const ( SourceCookie Source = \"cookie\" SourceHeader Source = \"header\" SourceURLQuery Source = \"query\" )","s":"Constants","u":"/api/middleware/session","h":"#constants","p":1635},{"i":1648,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 store := session.New(session.Config{ Storage: storage, }) To use the store, see the Examples.","s":"Custom Storage/Database","u":"/api/middleware/session","h":"#custom-storagedatabase","p":1635},{"i":1650,"t":"Skip middleware for Fiber that skips a wrapped handler if a predicate is true.","s":"Skip","u":"/api/middleware/skip","h":"","p":1649},{"i":1652,"t":"func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler","s":"Signatures","u":"/api/middleware/skip","h":"#signatures","p":1649},{"i":1654,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/skip\" ) After you initiate your Fiber app, you can use the following possibilities: func main() { app := fiber.New() app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool { return ctx.Method() == fiber.MethodGet })) app.Get(\"/\", func(ctx *fiber.Ctx) error { return ctx.SendString(\"It was a GET request!\") }) log.Fatal(app.Listen(\":3000\")) } func BasicHandler(ctx *fiber.Ctx) error { return ctx.SendString(\"It was not a GET request!\") } tip app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.","s":"Examples","u":"/api/middleware/skip","h":"#examples","p":1649},{"i":1656,"t":"There exist two distinct implementations of timeout middleware Fiber. New Wraps a fiber.Handler with a timeout. If the handler takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler. caution This has been deprecated since it raises race conditions. NewWithContext As a fiber.Handler wrapper, it creates a context with context.WithTimeout and pass it in UserContext. If the context passed executions (eg. DB ops, Http calls) takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler. It does not cancel long running executions. Underlying executions must handle timeout by using context.Context parameter.","s":"Timeout","u":"/api/middleware/timeout","h":"","p":1655},{"i":1658,"t":"func New(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler func NewWithContext(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler","s":"Signatures","u":"/api/middleware/timeout","h":"#signatures","p":1655},{"i":1660,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/timeout\" ) After you initiate your Fiber app, you can use the following possibilities: func main() { app := fiber.New() h := func(c *fiber.Ctx) error { sleepTime, _ := time.ParseDuration(c.Params(\"sleepTime\") + \"ms\") if err := sleepWithContext(c.UserContext(), sleepTime); err != nil { return fmt.Errorf(\"%w: execution error\", err) } return nil } app.Get(\"/foo/:sleepTime\", timeout.New(h, 2*time.Second)) log.Fatal(app.Listen(\":3000\")) } func sleepWithContext(ctx context.Context, d time.Duration) error { timer := time.NewTimer(d) select { case <-ctx.Done(): if !timer.Stop() { <-timer.C } return context.DeadlineExceeded case <-timer.C: } return nil } Test http 200 with curl: curl --location -I --request GET 'http://localhost:3000/foo/1000' Test http 408 with curl: curl --location -I --request GET 'http://localhost:3000/foo/3000' Use with custom error: var ErrFooTimeOut = errors.New(\"foo context canceled\") func main() { app := fiber.New() h := func(c *fiber.Ctx) error { sleepTime, _ := time.ParseDuration(c.Params(\"sleepTime\") + \"ms\") if err := sleepWithContextWithCustomError(c.UserContext(), sleepTime); err != nil { return fmt.Errorf(\"%w: execution error\", err) } return nil } app.Get(\"/foo/:sleepTime\", timeout.NewWithContext(h, 2*time.Second, ErrFooTimeOut)) log.Fatal(app.Listen(\":3000\")) } func sleepWithContextWithCustomError(ctx context.Context, d time.Duration) error { timer := time.NewTimer(d) select { case <-ctx.Done(): if !timer.Stop() { <-timer.C } return ErrFooTimeOut case <-timer.C: } return nil } Sample usage with a DB call: func main() { app := fiber.New() db, _ := gorm.Open(postgres.Open(\"postgres://localhost/foodb\"), &gorm.Config{}) handler := func(ctx *fiber.Ctx) error { tran := db.WithContext(ctx.UserContext()).Begin() if tran = tran.Exec(\"SELECT pg_sleep(50)\"); tran.Error != nil { return tran.Error } if tran = tran.Commit(); tran.Error != nil { return tran.Error } return nil } app.Get(\"/foo\", timeout.NewWithContext(handler, 10*time.Second)) log.Fatal(app.Listen(\":3000\")) }","s":"Examples","u":"/api/middleware/timeout","h":"#examples","p":1655},{"i":1663,"t":"TechEmpower provides a performance comparison of many web application frameworks executing fundamental tasks such as JSON serialization, database access, and server-side template composition. Each framework is operating in a realistic production configuration. Results are captured on cloud instances and on physical hardware. The test implementations are largely community-contributed and all source is available at the GitHub repository. Fiber v1.10.0 28 HT Cores Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz 32GB RAM Ubuntu 18.04.3 4.15.0-88-generic Dedicated Cisco 10-Gbit Ethernet switch.","s":"TechEmpower","u":"/extra/benchmarks","h":"#techempower","p":1661},{"i":1665,"t":"The Plaintext test is an exercise of the request-routing fundamentals only, designed to demonstrate the capacity of high-performance platforms in particular. Requests will be sent using HTTP pipelining. The response payload is still small, meaning good performance is still necessary in order to saturate the gigabit Ethernet of the test environment. See Plaintext requirements Fiber - 6,162,556 responses per second with an average latency of 2.0 ms. Express - 367,069 responses per second with an average latency of 354.1 ms.","s":"Plaintext","u":"/extra/benchmarks","h":"#plaintext","p":1661},{"i":1667,"t":"Fiber handled 11,846 responses per second with an average latency of 42.8 ms. Express handled 2,066 responses per second with an average latency of 390.44 ms.","s":"Data Updates","u":"/extra/benchmarks","h":"#data-updates","p":1661},{"i":1669,"t":"Fiber handled 19,664 responses per second with an average latency of 25.7 ms. Express handled 4,302 responses per second with an average latency of 117.2 ms.","s":"Multiple Queries","u":"/extra/benchmarks","h":"#multiple-queries","p":1661},{"i":1671,"t":"Fiber handled 368,647 responses per second with an average latency of 0.7 ms. Express handled 57,880 responses per second with an average latency of 4.4 ms.","s":"Single Query","u":"/extra/benchmarks","h":"#single-query","p":1661},{"i":1673,"t":"Fiber handled 1,146,667 responses per second with an average latency of 0.4 ms. Express handled 244,847 responses per second with an average latency of 1.1 ms.","s":"JSON Serialization","u":"/extra/benchmarks","h":"#json-serialization","p":1661},{"i":1675,"t":"πŸ”— https://github.com/smallnest/go-web-framework-benchmark CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz MEM 4GB GO go1.13.6 linux/amd64 OS Linux The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers. The concurrency clients are 5000. Latency is the time of real processing time by web servers. The smaller is the better. Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better. If we enable http pipelining, test result as below: Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is: If we enable http pipelining, test result as below: Dependency graph for v1.9.0","s":"Go web framework benchmark","u":"/extra/benchmarks","h":"#go-web-framework-benchmark","p":1661},{"i":1678,"t":"There is no definitive answer to this question. The answer depends on the scale of your application and the team that is involved. To be as flexible as possible, Fiber makes no assumptions in terms of structure. Routes and other application-specific logic can live in as many files as you wish, in any directory structure you prefer. View the following examples for inspiration: gofiber/boilerplate thomasvvugt/fiber-boilerplate Youtube - Building a REST API using Gorm and Fiber embedmode/fiberseed","s":"How should I structure my application?","u":"/extra/faq","h":"#how-should-i-structure-my-application","p":1676},{"i":1680,"t":"If you're using v2.32.0 or later, all you need to do is to implement a custom error handler. See below, or see a more detailed explanation at Error Handling. If you're using v2.31.0 or earlier, the error handler will not capture 404 errors. Instead, you need to add a middleware function at the very bottom of the stack (below all other functions) to handle a 404 response: Example app.Use(func(c *fiber.Ctx) error { return c.Status(fiber.StatusNotFound).SendString(\"Sorry can't find that!\") })","s":"How do I handle custom 404 responses?","u":"/extra/faq","h":"#how-do-i-handle-custom-404-responses","p":1676},{"i":1682,"t":"Air is a handy tool that automatically restarts your Go applications whenever the source code changes, making your development process faster and more efficient. To use Air in a Fiber project, follow these steps: Install Air by downloading the appropriate binary for your operating system from the GitHub release page or by building the tool directly from source. Create a configuration file for Air in your project directory. This file can be named, for example, .air.toml or air.conf. Here's a sample configuration file that works with Fiber: # .air.toml root = \".\" tmp_dir = \"tmp\" [build] cmd = \"go build -o ./tmp/main .\" bin = \"./tmp/main\" delay = 1000 # ms exclude_dir = [\"assets\", \"tmp\", \"vendor\"] include_ext = [\"go\", \"tpl\", \"tmpl\", \"html\"] exclude_regex = [\"_test\\\\.go\"] Start your Fiber application using Air by running the following command in the terminal: air As you make changes to your source code, Air will detect them and automatically restart the application. A complete example demonstrating the use of Air with Fiber can be found in the Fiber Recipes repository. This example shows how to configure and use Air in a Fiber project to create an efficient development environment.","s":"How can i use live reload ?","u":"/extra/faq","h":"#how-can-i-use-live-reload-","p":1676},{"i":1684,"t":"To override the default error handler, you can override the default when providing a Config when initiating a new Fiber instance. Example app := fiber.New(fiber.Config{ ErrorHandler: func(c *fiber.Ctx, err error) error { return c.Status(fiber.StatusInternalServerError).SendString(err.Error()) }, }) We have a dedicated page explaining how error handling works in Fiber, see Error Handling.","s":"How do I set up an error handler?","u":"/extra/faq","h":"#how-do-i-set-up-an-error-handler","p":1676},{"i":1686,"t":"Fiber currently supports 8 template engines in our gofiber/template middleware: Ace Amber Django Handlebars HTML Jet Mustache Pug To learn more about using Templates in Fiber, see Templates.","s":"Which template engines does Fiber support?","u":"/extra/faq","h":"#which-template-engines-does-fiber-support","p":1676},{"i":1688,"t":"Yes, we have our own Discord server, where we hang out. We have different rooms for every subject. If you have questions or just want to have a chat, feel free to join us via this > invite link <.","s":"Does Fiber have a community chat?","u":"/extra/faq","h":"#does-fiber-have-a-community-chat","p":1676},{"i":1690,"t":"Yes we do, here are some examples: This example works v2 package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/logger\" ) type Host struct { Fiber *fiber.App } func main() { // Hosts hosts := map[string]*Host{} //----- // API //----- api := fiber.New() api.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"api.localhost:3000\"] = &Host{api} api.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"API\") }) //------ // Blog //------ blog := fiber.New() blog.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"blog.localhost:3000\"] = &Host{blog} blog.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Blog\") }) //--------- // Website //--------- site := fiber.New() site.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"localhost:3000\"] = &Host{site} site.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Website\") }) // Server app := fiber.New() app.Use(func(c *fiber.Ctx) error { host := hosts[c.Hostname()] if host == nil { return c.SendStatus(fiber.StatusNotFound) } else { host.Fiber.Handler()(c.Context()) return nil } }) log.Fatal(app.Listen(\":3000\")) } If more information is needed, please refer to this issue #750","s":"Does fiber support sub domain routing ?","u":"/extra/faq","h":"#does-fiber-support-sub-domain-routing-","p":1676},{"i":1693,"t":"It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them. Example app.Get(\"/\", func(c *fiber.Ctx) error { // Pass error to Fiber return c.SendFile(\"file-does-not-exist\") }) Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below: Example package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/recover\" ) func main() { app := fiber.New() app.Use(recover.New()) app.Get(\"/\", func(c *fiber.Ctx) error { panic(\"This panic is caught by fiber\") }) log.Fatal(app.Listen(\":3000\")) } You could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found). Example app.Get(\"/\", func(c *fiber.Ctx) error { // 503 Service Unavailable return fiber.ErrServiceUnavailable // 503 On vacation! return fiber.NewError(fiber.StatusServiceUnavailable, \"On vacation!\") })","s":"Catching Errors","u":"/guide/error-handling","h":"#catching-errors","p":1691},{"i":1695,"t":"Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If the error is of type fiber.Error, the response is sent with the provided status code and message. Example // Default error handler var DefaultErrorHandler = func(c *fiber.Ctx, err error) error { // Status code defaults to 500 code := fiber.StatusInternalServerError // Retrieve the custom status code if it's a *fiber.Error var e *fiber.Error if errors.As(err, &e) { code = e.Code } // Set Content-Type: text/plain; charset=utf-8 c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8) // Return status code with error message return c.Status(code).SendString(err.Error()) }","s":"Default Error Handler","u":"/guide/error-handling","h":"#default-error-handler","p":1691},{"i":1697,"t":"A custom error handler can be set using a Config when initializing a Fiber instance. In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response. The following example shows how to display error pages for different types of errors. Example // Create a new fiber instance with custom config app := fiber.New(fiber.Config{ // Override default error handler ErrorHandler: func(ctx *fiber.Ctx, err error) error { // Status code defaults to 500 code := fiber.StatusInternalServerError // Retrieve the custom status code if it's a *fiber.Error var e *fiber.Error if errors.As(err, &e) { code = e.Code } // Send custom error page err = ctx.Status(code).SendFile(fmt.Sprintf(\"./%d.html\", code)) if err != nil { // In case the SendFile fails return ctx.Status(fiber.StatusInternalServerError).SendString(\"Internal Server Error\") } // Return from handler return nil }, }) // ... Special thanks to the Echo & Express framework for inspiration regarding error handling.","s":"Custom Error Handler","u":"/guide/error-handling","h":"#custom-error-handler","p":1691},{"i":1700,"t":"Since Fiber v2.32.0, we use encoding/json as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of encoding/json, we recommend you to use these libraries: goccy/go-json bytedance/sonic segmentio/encoding mailru/easyjson minio/simdjson-go wI2L/jettison Example package main import \"github.com/gofiber/fiber/v2\" import \"github.com/goccy/go-json\" func main() { app := fiber.New(fiber.Config{ JSONEncoder: json.Marshal, JSONDecoder: json.Unmarshal, }) # ... }","s":"Custom JSON Encoder/Decoder","u":"/guide/faster-fiber","h":"#custom-json-encoderdecoder","p":1698},{"i":1702,"t":"Set custom JSON encoder for client Set custom JSON decoder for client Set custom JSON encoder for application Set custom JSON decoder for application","s":"References","u":"/guide/faster-fiber","h":"#references","p":1698},{"i":1704,"t":"info In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.","s":"🎭 Grouping","u":"/guide/grouping","h":"","p":1703},{"i":1706,"t":"Like Routing, groups can also have paths that belong to a cluster. func main() { app := fiber.New() api := app.Group(\"/api\", middleware) // /api v1 := api.Group(\"/v1\", middleware) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", middleware) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } A Group of paths can have an optional handler. func main() { app := fiber.New() api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\") // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\") // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } caution Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.","s":"Paths","u":"/guide/grouping","h":"#paths","p":1703},{"i":1708,"t":"Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue. func main() { app := fiber.New() handler := func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusOK) } api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\", func(c *fiber.Ctx) error { // middleware for /api/v1 c.Set(\"Version\", \"v1\") return c.Next() }) v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user log.Fatal(app.Listen(\":3000\")) }","s":"Group Handlers","u":"/guide/grouping","h":"#group-handlers","p":1703},{"i":1710,"t":"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks: OnRoute OnName OnGroup OnGroupName OnListen OnFork OnShutdown OnMount","s":"πŸͺ Hooks","u":"/guide/hooks","h":"","p":1709},{"i":1712,"t":"// Handlers define a function to create hooks for Fiber. type OnRouteHandler = func(Route) error type OnNameHandler = OnRouteHandler type OnGroupHandler = func(Group) error type OnGroupNameHandler = OnGroupHandler type OnListenHandler = func() error type OnForkHandler = func(int) error type OnShutdownHandler = OnListenHandler type OnMountHandler = func(*App) error","s":"Constants","u":"/guide/hooks","h":"#constants","p":1709},{"i":1714,"t":"OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by route parameter. Signature func (app *App) OnRoute(handler ...OnRouteHandler)","s":"OnRoute","u":"/guide/hooks","h":"#onroute","p":1709},{"i":1716,"t":"OnName is a hook to execute user functions on each route naming. Also you can get route properties by route parameter. caution OnName only works with naming routes, not groups. Signature func (app *App) OnName(handler ...OnNameHandler) OnName Example package main import ( \"fmt\" \"github.com/gofiber/fiber/v2\" ) func main() { app := fiber.New() app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"index\") app.Hooks().OnName(func(r fiber.Route) error { fmt.Print(\"Name: \" + r.Name + \", \") return nil }) app.Hooks().OnName(func(r fiber.Route) error { fmt.Print(\"Method: \" + r.Method + \"\\n\") return nil }) app.Get(\"/add/user\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"addUser\") app.Delete(\"/destroy/user\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"destroyUser\") app.Listen(\":5000\") } // Results: // Name: addUser, Method: GET // Name: destroyUser, Method: DELETE","s":"OnName","u":"/guide/hooks","h":"#onname","p":1709},{"i":1718,"t":"OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by group parameter. Signature func (app *App) OnGroup(handler ...OnGroupHandler)","s":"OnGroup","u":"/guide/hooks","h":"#ongroup","p":1709},{"i":1720,"t":"OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by group parameter. caution OnGroupName only works with naming groups, not routes. Signature func (app *App) OnGroupName(handler ...OnGroupNameHandler)","s":"OnGroupName","u":"/guide/hooks","h":"#ongroupname","p":1709},{"i":1722,"t":"OnListen is a hook to execute user functions on Listen, ListenTLS, Listener. Signature func (app *App) OnListen(handler ...OnListenHandler)","s":"OnListen","u":"/guide/hooks","h":"#onlisten","p":1709},{"i":1724,"t":"OnFork is a hook to execute user functions on Fork. Signature func (app *App) OnFork(handler ...OnForkHandler)","s":"OnFork","u":"/guide/hooks","h":"#onfork","p":1709},{"i":1726,"t":"OnShutdown is a hook to execute user functions after Shutdown. Signature func (app *App) OnShutdown(handler ...OnShutdownHandler)","s":"OnShutdown","u":"/guide/hooks","h":"#onshutdown","p":1709},{"i":1728,"t":"OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting. Signature func (h *Hooks) OnMount(handler ...OnMountHandler) OnMount Example package main import ( \"fmt\" \"github.com/gofiber/fiber/v2\" ) func main() { app := New() app.Get(\"/\", testSimpleHandler).Name(\"x\") subApp := New() subApp.Get(\"/test\", testSimpleHandler) subApp.Hooks().OnMount(func(parent *fiber.App) error { fmt.Print(\"Mount path of parent app: \"+parent.MountPath()) // ... return nil }) app.Mount(\"/sub\", subApp) } // Result: // Mount path of parent app: caution OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.","s":"OnMount","u":"/guide/hooks","h":"#onmount","p":1709},{"i":1731,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Handlers","u":"/guide/routing","h":"#handlers","p":1729},{"i":1733,"t":"Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns. Examples of route paths based on strings // This route path will match requests to the root route, \"/\": app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"root\") }) // This route path will match requests to \"/about\": app.Get(\"/about\", func(c *fiber.Ctx) error { return c.SendString(\"about\") }) // This route path will match requests to \"/random.txt\": app.Get(\"/random.txt\", func(c *fiber.Ctx) error { return c.SendString(\"random.txt\") }) As with the expressJs framework, the order of the route declaration plays a role. When a request is received, the routes are checked in the order in which they are declared. info So please be careful to write routes with variable parameters after the routes that contain fixed parts, so that these variable parts do not match instead and unexpected behavior occurs.","s":"Paths","u":"/guide/routing","h":"#paths","p":1729},{"i":1735,"t":"Route parameters are dynamic elements in the route, which are named or not named segments. This segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys or for unnamed parameters the character(*, +) and the counter of this. The characters :, +, and * are characters that introduce a parameter. Greedy parameters are indicated by wildcard(*) or plus(+) signs. The routing also offers the possibility to use optional parameters, for the named parameters these are marked with a final \"?\", unlike the plus sign which is not optional, you can use the wildcard character for a parameter range which is optional and greedy. Example of define routes with route parameters // Parameters app.Get(\"/user/:name/books/:title\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s\\n\", c.Params(\"name\")) fmt.Fprintf(c, \"%s\\n\", c.Params(\"title\")) return nil }) // Plus - greedy - not optional app.Get(\"/user/+\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"+\")) }) // Optional parameter app.Get(\"/user/:name?\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"name\")) }) // Wildcard - greedy - optional app.Get(\"/user/*\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"*\")) }) // This route path will match requests to \"/v1/some/resource/name:customVerb\", since the parameter character is escaped app.Get(\"/v1/some/resource/name\\\\:customVerb\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, Community\") }) info Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes. info All special parameter characters can also be escaped with \"\\\\\" and lose their value, so you can use them in the route if you want, like in the custom methods of the google api design guide. // http://localhost:3000/plantae/prunus.persica app.Get(\"/plantae/:genus.:species\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s.%s\\n\", c.Params(\"genus\"), c.Params(\"species\")) return nil // prunus.persica }) // http://localhost:3000/flights/LAX-SFO app.Get(\"/flights/:from-:to\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s-%s\\n\", c.Params(\"from\"), c.Params(\"to\")) return nil // LAX-SFO }) Our intelligent router recognizes that the introductory parameter characters should be part of the request route in this case and can process them as such. // http://localhost:3000/shop/product/color:blue/size:xs app.Get(\"/shop/product/color::color/size::size\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s:%s\\n\", c.Params(\"color\"), c.Params(\"size\")) return nil // blue:xs }) In addition, several parameters in a row and several unnamed parameter characters in the route, such as the wildcard or plus character, are possible, which greatly expands the possibilities of the router for the user. // GET /@v1 // Params: \"sign\" -> \"@\", \"param\" -> \"v1\" app.Get(\"/:sign:param\", handler) // GET /api-v1 // Params: \"name\" -> \"v1\" app.Get(\"/api-:name\", handler) // GET /customer/v1/cart/proxy // Params: \"*1\" -> \"customer/\", \"*2\" -> \"/cart\" app.Get(\"/*v1*/proxy\", handler) // GET /v1/brand/4/shop/blue/xs // Params: \"*1\" -> \"brand/4\", \"*2\" -> \"blue/xs\" app.Get(\"/v1/*/shop/*\", handler) We have adapted the routing strongly to the express routing, but currently without the possibility of the regular expressions, because they are quite slow. The possibilities can be tested with version 0.1.7 (express 4) in the online Express route tester.","s":"Parameters","u":"/guide/routing","h":"#parameters","p":1729},{"i":1737,"t":"Route constraints execute when a match has occurred to the incoming URL and the URL path is tokenized into route values by parameters. The feature was intorduced in v2.37.0 and inspired by .NET Core. caution Constraints aren't validation for parameters. If constraint aren't valid for parameter value, Fiber returns 404 handler. Constraint Example Example matches int :id 123456789, -123456789 bool :active true,false guid :id CD2C1638-1638-72D5-1638-DEADBEEF1638 float :weight 1.234, -1,001.01e8 minLen(value) :username Test (must be at least 4 characters) maxLen(value) :filename MyFile (must be no more than 8 characters len(length) :filename somefile.txt (exactly 12 characters) min(value) :age 19 (Integer value must be at least 18) max(value) :age 91 (Integer value must be no more than 120) range(min,max) :age 91 (Integer value must be at least 18 but no more than 120) alpha :name Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive) datetime :dob 2005-11-01 regex(expression) :date 2022-08-27 (Must match regular expression) Examples Single Constraint Multiple Constraints Regex Constraint app.Get(\"/:test\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/12 // 12 // curl -X GET http://localhost:3000/1 // Cannot GET /1 You can use ; for multiple constraints. app.Get(\"/:test\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/120000 // Cannot GET /120000 // curl -X GET http://localhost:3000/1 // Cannot GET /1 // curl -X GET http://localhost:3000/250 // 250 Fiber precompiles regex query when to register routes. So there're no performance overhead for regex constraint. app.Get(\"/:date\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"date\")) }) // curl -X GET http://localhost:3000/125 // Cannot GET /125 // curl -X GET http://localhost:3000/test // Cannot GET /test // curl -X GET http://localhost:3000/2022-08-27 // 2022-08-27 caution You should use \\\\ before routing-specific characters when to use datetime constraint (*, +, ?, :, /, <, >, ;, (, )), to avoid wrong parsing. Optional Parameter Example You can impose constraints on optional parameters as well. app.Get(\"/:test?\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/42 // 42 // curl -X GET http://localhost:3000/ // // curl -X GET http://localhost:3000/7.0 // Cannot GET /7.0","s":"Constraints","u":"/guide/routing","h":"#constraints","p":1729},{"i":1739,"t":"Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route. Example of a middleware function app.Use(func(c *fiber.Ctx) error { // Set a custom header on all responses: c.Set(\"X-Custom-Header\", \"Hello, World\") // Go to next middleware: return c.Next() }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.","s":"Middleware","u":"/guide/routing","h":"#middleware","p":1729},{"i":1741,"t":"If you have many endpoints, you can organize your routes using Group. func main() { app := fiber.New() api := app.Group(\"/api\", middleware) // /api v1 := api.Group(\"/v1\", middleware) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", middleware) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } More information about this in our Grouping Guide","s":"Grouping","u":"/guide/routing","h":"#grouping","p":1729},{"i":1744,"t":"Fiber provides a Views interface to provide your own template engine: Views type Views interface { Load() error Render(io.Writer, string, interface{}, ...string) error } Views interface contains a Load and Render method, Load is executed by Fiber on app initialization to load/parse the templates. // Pass engine to Fiber's Views Engine app := fiber.New(fiber.Config{ Views: engine, // Views Layout is the global layout for all template render until override on Render function. ViewsLayout: \"layouts/main\" }) The Render method is linked to the ctx.Render() function that accepts a template name and binding data. It will use global layout if layout is not being defined in Render function. If the Fiber config option PassLocalsToViews is enabled, then all locals set using ctx.Locals(key, value) will be passed to the template. app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"index\", fiber.Map{ \"hello\": \"world\", }); })","s":"Template interfaces","u":"/guide/templates","h":"#template-interfaces","p":1742},{"i":1746,"t":"Fiber team maintains templates package that provides wrappers for multiple template engines: html ace amber django handlebars jet mustache pug Example views/index.html package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html/v2\" ) func main() { // Initialize standard Go html template engine engine := html.New(\"./views\", \".html\") // If you want other engine, just replace with following // Create a new engine with django // engine := django.New(\"./views\", \".django\") app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index template return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) log.Fatal(app.Listen(\":3000\")) }

{{.Title}}

","s":"Engines","u":"/guide/templates","h":"#engines","p":1742},{"i":1749,"t":"Fiber can make great use of the validator package to ensure correct validation of data to store. Official validator Github page (Installation, use, examples..). You can find the detailed descriptions of the validations used in the fields contained on the structs below: Detailed docs Validation Example type Job struct{ Type string `validate:\"required,min=3,max=32\"` Salary int `validate:\"required,number\"` } type User struct{ Name string `validate:\"required,min=3,max=32\"` // use `*bool` here otherwise the validation will fail for `false` values // Ref: https://github.com/go-playground/validator/issues/319#issuecomment-339222389 IsActive *bool `validate:\"required\"` Email string `validate:\"required,email,min=6,max=32\"` Job Job `validate:\"dive\"` } type ErrorResponse struct { FailedField string Tag string Value string } var validate = validator.New() func ValidateStruct(user User) []*ErrorResponse { var errors []*ErrorResponse err := validate.Struct(user) if err != nil { for _, err := range err.(validator.ValidationErrors) { var element ErrorResponse element.FailedField = err.StructNamespace() element.Tag = err.Tag() element.Value = err.Param() errors = append(errors, &element) } } return errors } func AddUser(c *fiber.Ctx) error { //Connect to database user := new(User) if err := c.BodyParser(user); err != nil { return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{ \"message\": err.Error(), }) } errors := ValidateStruct(*user) if errors != nil { return c.Status(fiber.StatusBadRequest).JSON(errors) } //Do something else here //Return user return c.JSON(user) } // Running a test with the following curl commands // curl -X POST -H \"Content-Type: application/json\" --data \"{\\\"name\\\":\\\"john\\\",\\\"isactive\\\":\\\"True\\\"}\" http://localhost:8080/register/user // Results in // [{\"FailedField\":\"User.Email\",\"Tag\":\"required\",\"Value\":\"\"},{\"FailedField\":\"User.Job.Salary\",\"Tag\":\"required\",\"Value\":\"\"},{\"FailedField\":\"User.Job.Type\",\"Tag\":\"required\",\"Value\":\"\"}]⏎","s":"Validator package","u":"/guide/validation","h":"#validator-package","p":1747},{"i":1751,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Route Handlers","u":"/partials/routing/route-handlers","h":"","p":1750},{"i":1754,"t":"Checks, if the specified extensions or content types are acceptable. info Based on the request’s Accept HTTP header. Signature func (c *Ctx) Accepts(offers ...string) string func (c *Ctx) AcceptsCharsets(offers ...string) string func (c *Ctx) AcceptsEncodings(offers ...string) string func (c *Ctx) AcceptsLanguages(offers ...string) string Example // Accept: text/html, application/json; q=0.8, text/plain; q=0.5; charset=\"utf-8\" app.Get(\"/\", func(c *fiber.Ctx) error { c.Accepts(\"html\") // \"html\" c.Accepts(\"text/html\") // \"text/html\" c.Accepts(\"json\", \"text\") // \"json\" c.Accepts(\"application/json\") // \"application/json\" c.Accepts(\"text/plain\", \"application/json\") // \"application/json\", due to quality c.Accepts(\"image/png\") // \"\" c.Accepts(\"png\") // \"\" // ... }) Example 2 // Accept: text/html, text/*, application/json, */*; q=0 app.Get(\"/\", func(c *fiber.Ctx) error { c.Accepts(\"text/plain\", \"application/json\") // \"application/json\", due to specificity c.Accepts(\"application/json\", \"text/html\") // \"text/html\", due to first match c.Accepts(\"image/png\") // \"\", due to */* without q factor 0 is Not Acceptable // ... }) Fiber provides similar functions for the other accept headers. // Accept-Charset: utf-8, iso-8859-1;q=0.2 // Accept-Encoding: gzip, compress;q=0.2 // Accept-Language: en;q=0.8, nl, ru app.Get(\"/\", func(c *fiber.Ctx) error { c.AcceptsCharsets(\"utf-16\", \"iso-8859-1\") // \"iso-8859-1\" c.AcceptsEncodings(\"compress\", \"br\") // \"compress\" c.AcceptsLanguages(\"pt\", \"nl\", \"ru\") // \"nl\" // ... })","s":"Accepts","u":"/api/ctx","h":"#accepts","p":1752},{"i":1756,"t":"Params is used to get all route parameters. Using Params method to get params. Signature func (c *Ctx) AllParams() map[string]string Example // GET http://example.com/user/fenny app.Get(\"/user/:name\", func(c *fiber.Ctx) error { c.AllParams() // \"{\"name\": \"fenny\"}\" // ... }) // GET http://example.com/user/fenny/123 app.Get(\"/user/*\", func(c *fiber.Ctx) error { c.AllParams() // \"{\"*1\": \"fenny/123\"}\" // ... })","s":"AllParams","u":"/api/ctx","h":"#allparams","p":1752},{"i":1758,"t":"Returns the *App reference so you could easily access all application settings. Signature func (c *Ctx) App() *App Example app.Get(\"/stack\", func(c *fiber.Ctx) error { return c.JSON(c.App().Stack()) })","s":"App","u":"/api/ctx","h":"#app","p":1752},{"i":1760,"t":"Appends the specified value to the HTTP response header field. caution If the header is not already set, it creates the header with the specified value. Signature func (c *Ctx) Append(field string, values ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Append(\"Link\", \"http://google.com\", \"http://localhost\") // => Link: http://localhost, http://google.com c.Append(\"Link\", \"Test\") // => Link: http://localhost, http://google.com, Test // ... })","s":"Append","u":"/api/ctx","h":"#append","p":1752},{"i":1762,"t":"Sets the HTTP response Content-Disposition header field to attachment. Signature func (c *Ctx) Attachment(filename ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Attachment() // => Content-Disposition: attachment c.Attachment(\"./upload/images/logo.png\") // => Content-Disposition: attachment; filename=\"logo.png\" // => Content-Type: image/png // ... })","s":"Attachment","u":"/api/ctx","h":"#attachment","p":1752},{"i":1764,"t":"Returns the base URL (protocol + host) as a string. Signature func (c *Ctx) BaseURL() string Example // GET https://example.com/page#chapter-1 app.Get(\"/\", func(c *fiber.Ctx) error { c.BaseURL() // https://example.com // ... })","s":"BaseURL","u":"/api/ctx","h":"#baseurl","p":1752},{"i":1766,"t":"Add vars to default view var map binding to template engine. Variables are read by the Render method and may be overwritten. Signature func (c *Ctx) Bind(vars Map) error Example app.Use(func(c *fiber.Ctx) error { c.Bind(fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"xxx.tmpl\", fiber.Map{}) // Render will use Title variable })","s":"Bind","u":"/api/ctx","h":"#bind","p":1752},{"i":1768,"t":"Returns the raw request body. Signature func (c *Ctx) Body() []byte Example // curl -X POST http://localhost:8080 -d user=john app.Post(\"/\", func(c *fiber.Ctx) error { // Get raw body from POST request: return c.Send(c.Body()) // []byte(\"user=john\") }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Body","u":"/api/ctx","h":"#body","p":1752},{"i":1770,"t":"Binds the request body to a struct. It is important to specify the correct struct tag based on the content type to be parsed. For example, if you want to parse a JSON body with a field called Pass, you would use a struct field of json:\"pass\". content-type struct tag application/x-www-form-urlencoded form multipart/form-data form application/json json application/xml xml text/xml xml Signature func (c *Ctx) BodyParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `json:\"name\" xml:\"name\" form:\"name\"` Pass string `json:\"pass\" xml:\"pass\" form:\"pass\"` } app.Post(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.BodyParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe // ... }) // Run tests with the following curl commands // curl -X POST -H \"Content-Type: application/json\" --data \"{\\\"name\\\":\\\"john\\\",\\\"pass\\\":\\\"doe\\\"}\" localhost:3000 // curl -X POST -H \"Content-Type: application/xml\" --data \"johndoe\" localhost:3000 // curl -X POST -H \"Content-Type: application/x-www-form-urlencoded\" --data \"name=john&pass=doe\" localhost:3000 // curl -X POST -F name=john -F pass=doe http://localhost:3000 // curl -X POST \"http://localhost:3000/?name=john&pass=doe\" Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"BodyParser","u":"/api/ctx","h":"#bodyparser","p":1752},{"i":1772,"t":"Expire a client cookie (or all cookies if left empty) Signature func (c *Ctx) ClearCookie(key ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { // Clears all cookies: c.ClearCookie() // Expire specific cookie by name: c.ClearCookie(\"user\") // Expire multiple cookies by names: c.ClearCookie(\"token\", \"session\", \"track_id\", \"version\") // ... }) caution Web browsers and other compliant clients will only clear the cookie if the given options are identical to those when creating the cookie, excluding expires and maxAge. ClearCookie will not set these values for you - a technique similar to the one shown below should be used to ensure your cookie is deleted. Example app.Get(\"/set\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"token\", Value: \"randomvalue\", Expires: time.Now().Add(24 * time.Hour), HTTPOnly: true, SameSite: \"lax\", }) // ... }) app.Get(\"/delete\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"token\", // Set expiry date to the past Expires: time.Now().Add(-(time.Hour * 2)), HTTPOnly: true, SameSite: \"lax\", }) // ... })","s":"ClearCookie","u":"/api/ctx","h":"#clearcookie","p":1752},{"i":1774,"t":"ClientHelloInfo contains information from a ClientHello message in order to guide application logic in the GetCertificate and GetConfigForClient callbacks. You can refer to the ClientHelloInfo struct documentation for more information on the returned struct. Signature func (c *Ctx) ClientHelloInfo() *tls.ClientHelloInfo Example // GET http://example.com/hello app.Get(\"/hello\", func(c *fiber.Ctx) error { chi := c.ClientHelloInfo() // ... })","s":"ClientHelloInfo","u":"/api/ctx","h":"#clienthelloinfo","p":1752},{"i":1776,"t":"Returns *fasthttp.RequestCtx that is compatible with the context.Context interface that requires a deadline, a cancellation signal, and other values across API boundaries. Signature func (c *Ctx) Context() *fasthttp.RequestCtx info Please read the Fasthttp Documentation for more information.","s":"Context","u":"/api/ctx","h":"#context","p":1752},{"i":1778,"t":"Set cookie Signature func (c *Ctx) Cookie(cookie *Cookie) type Cookie struct { Name string `json:\"name\"` Value string `json:\"value\"` Path string `json:\"path\"` Domain string `json:\"domain\"` MaxAge int `json:\"max_age\"` Expires time.Time `json:\"expires\"` Secure bool `json:\"secure\"` HTTPOnly bool `json:\"http_only\"` SameSite string `json:\"same_site\"` SessionOnly bool `json:\"session_only\"` } Example app.Get(\"/\", func(c *fiber.Ctx) error { // Create cookie cookie := new(fiber.Cookie) cookie.Name = \"john\" cookie.Value = \"doe\" cookie.Expires = time.Now().Add(24 * time.Hour) // Set cookie c.Cookie(cookie) // ... })","s":"Cookie","u":"/api/ctx","h":"#cookie","p":1752},{"i":1780,"t":"Get cookie value by key, you could pass an optional default value that will be returned if the cookie key does not exist. Signature func (c *Ctx) Cookies(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { // Get cookie by key: c.Cookies(\"name\") // \"john\" c.Cookies(\"empty\", \"doe\") // \"doe\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Cookies","u":"/api/ctx","h":"#cookies","p":1752},{"i":1782,"t":"Transfers the file from path as an attachment. Typically, browsers will prompt the user to download. By default, the Content-Disposition header filename= parameter is the file path (this typically appears in the browser dialog). Override this default with the filename parameter. Signature func (c *Ctx) Download(file string, filename ...string) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.Download(\"./files/report-12345.pdf\"); // => Download report-12345.pdf return c.Download(\"./files/report-12345.pdf\", \"report.pdf\"); // => Download report.pdf })","s":"Download","u":"/api/ctx","h":"#download","p":1752},{"i":1784,"t":"Performs content-negotiation on the Accept HTTP header. It uses Accepts to select a proper format. info If the header is not specified or there is no proper format, text/plain is used. Signature func (c *Ctx) Format(body interface{}) error Example app.Get(\"/\", func(c *fiber.Ctx) error { // Accept: text/plain c.Format(\"Hello, World!\") // => Hello, World! // Accept: text/html c.Format(\"Hello, World!\") // =>

Hello, World!

// Accept: application/json c.Format(\"Hello, World!\") // => \"Hello, World!\" // .. })","s":"Format","u":"/api/ctx","h":"#format","p":1752},{"i":1786,"t":"MultipartForm files can be retrieved by name, the first file from the given key is returned. Signature func (c *Ctx) FormFile(key string) (*multipart.FileHeader, error) Example app.Post(\"/\", func(c *fiber.Ctx) error { // Get first file from form field \"document\": file, err := c.FormFile(\"document\") // Save file to root directory: return c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)) })","s":"FormFile","u":"/api/ctx","h":"#formfile","p":1752},{"i":1788,"t":"Any form values can be retrieved by name, the first value from the given key is returned. Signature func (c *Ctx) FormValue(key string, defaultValue ...string) string Example app.Post(\"/\", func(c *fiber.Ctx) error { // Get first value from form field \"name\": c.FormValue(\"name\") // => \"john\" or \"\" if not exist // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"FormValue","u":"/api/ctx","h":"#formvalue","p":1752},{"i":1790,"t":"https://expressjs.com/en/4x/api.html#req.fresh Signature func (c *Ctx) Fresh() bool","s":"Fresh","u":"/api/ctx","h":"#fresh","p":1752},{"i":1792,"t":"Returns the HTTP request header specified by the field. tip The match is case-insensitive. Signature func (c *Ctx) Get(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Get(\"Content-Type\") // \"text/plain\" c.Get(\"CoNtEnT-TypE\") // \"text/plain\" c.Get(\"something\", \"john\") // \"john\" // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Get","u":"/api/ctx","h":"#get","p":1752},{"i":1794,"t":"Returns the HTTP request headers. Signature func (c *Ctx) GetReqHeaders() map[string]string","s":"GetReqHeaders","u":"/api/ctx","h":"#getreqheaders","p":1752},{"i":1796,"t":"Returns the HTTP response header specified by the field. tip The match is case-insensitive. Signature func (c *Ctx) GetRespHeader(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.GetRespHeader(\"X-Request-Id\") // \"8d7ad5e3-aaf3-450b-a241-2beb887efd54\" c.GetRespHeader(\"Content-Type\") // \"text/plain\" c.GetRespHeader(\"something\", \"john\") // \"john\" // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"GetRespHeader","u":"/api/ctx","h":"#getrespheader","p":1752},{"i":1798,"t":"Returns the HTTP response headers. Signature func (c *Ctx) GetRespHeaders() map[string]string","s":"GetRespHeaders","u":"/api/ctx","h":"#getrespheaders","p":1752},{"i":1800,"t":"Generates URLs to named routes, with parameters. URLs are relative, for example: \"/user/1831\" Signature func (c *Ctx) GetRouteURL(routeName string, params Map) (string, error) Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Home page\") }).Name(\"home\") app.Get(\"/user/:id\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"id\")) }).Name(\"user.show\") app.Get(\"/test\", func(c *fiber.Ctx) error { location, _ := c.GetRouteURL(\"user.show\", fiber.Map{\"id\": 1}) return c.SendString(location) }) // /test returns \"/user/1\"","s":"GetRouteURL","u":"/api/ctx","h":"#getrouteurl","p":1752},{"i":1802,"t":"Returns the hostname derived from the Host HTTP header. Signature func (c *Ctx) Hostname() string Example // GET http://google.com/search app.Get(\"/\", func(c *fiber.Ctx) error { c.Hostname() // \"google.com\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Hostname","u":"/api/ctx","h":"#hostname","p":1752},{"i":1804,"t":"Returns the remote IP address of the request. Signature func (c *Ctx) IP() string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.IP() // \"127.0.0.1\" // ... }) When registering the proxy request header in the fiber app, the ip address of the header is returned (Fiber configuration) app := fiber.New(fiber.Config{ ProxyHeader: fiber.HeaderXForwardedFor, })","s":"IP","u":"/api/ctx","h":"#ip","p":1752},{"i":1806,"t":"Returns an array of IP addresses specified in the X-Forwarded-For request header. Signature func (c *Ctx) IPs() []string Example // X-Forwarded-For: proxy1, 127.0.0.1, proxy3 app.Get(\"/\", func(c *fiber.Ctx) error { c.IPs() // [\"proxy1\", \"127.0.0.1\", \"proxy3\"] // ... })","s":"IPs","u":"/api/ctx","h":"#ips","p":1752},{"i":1808,"t":"Returns the matching content type, if the incoming request’s Content-Type HTTP header field matches the MIME type specified by the type parameter. info If the request has no body, it returns false. Signature func (c *Ctx) Is(extension string) bool Example // Content-Type: text/html; charset=utf-8 app.Get(\"/\", func(c *fiber.Ctx) error { c.Is(\"html\") // true c.Is(\".html\") // true c.Is(\"json\") // false // ... })","s":"Is","u":"/api/ctx","h":"#is","p":1752},{"i":1810,"t":"Returns true if request came from localhost Signature func (c *Ctx) IsFromLocal() bool { Example app.Get(\"/\", func(c *fiber.Ctx) error { // If request came from localhost, return true else return false c.IsFromLocal() // ... })","s":"IsFromLocal","u":"/api/ctx","h":"#isfromlocal","p":1752},{"i":1812,"t":"Converts any interface or string to JSON using the goccy/go-json package. info JSON also sets the content header to application/json. Signature func (c *Ctx) JSON(data interface{}) error Example type SomeStruct struct { Name string Age uint8 } app.Get(\"/json\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ Name: \"Grame\", Age: 20, } return c.JSON(data) // => Content-Type: application/json // => \"{\"Name\": \"Grame\", \"Age\": 20}\" return c.JSON(fiber.Map{ \"name\": \"Grame\", \"age\": 20, }) // => Content-Type: application/json // => \"{\"name\": \"Grame\", \"age\": 20}\" })","s":"JSON","u":"/api/ctx","h":"#json","p":1752},{"i":1814,"t":"Sends a JSON response with JSONP support. This method is identical to JSON, except that it opts-in to JSONP callback support. By default, the callback name is simply callback. Override this by passing a named string in the method. Signature func (c *Ctx) JSONP(data interface{}, callback ...string) error Example type SomeStruct struct { name string age uint8 } app.Get(\"/\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ name: \"Grame\", age: 20, } return c.JSONP(data) // => callback({\"name\": \"Grame\", \"age\": 20}) return c.JSONP(data, \"customFunc\") // => customFunc({\"name\": \"Grame\", \"age\": 20}) })","s":"JSONP","u":"/api/ctx","h":"#jsonp","p":1752},{"i":1816,"t":"Joins the links followed by the property to populate the response’s Link HTTP header field. Signature func (c *Ctx) Links(link ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Links( \"http://api.example.com/users?page=2\", \"next\", \"http://api.example.com/users?page=5\", \"last\", ) // Link: ; rel=\"next\", // ; rel=\"last\" // ... })","s":"Links","u":"/api/ctx","h":"#links","p":1752},{"i":1818,"t":"A method that stores variables scoped to the request and, therefore, are available only to the routes that match the request. tip This is useful if you want to pass some specific data to the next middleware. Signature func (c *Ctx) Locals(key interface{}, value ...interface{}) interface{} Example app.Use(func(c *fiber.Ctx) error { c.Locals(\"user\", \"admin\") return c.Next() }) app.Get(\"/admin\", func(c *fiber.Ctx) error { if c.Locals(\"user\") == \"admin\" { return c.Status(fiber.StatusOK).SendString(\"Welcome, admin!\") } return c.SendStatus(fiber.StatusForbidden) })","s":"Locals","u":"/api/ctx","h":"#locals","p":1752},{"i":1820,"t":"Sets the response Location HTTP header to the specified path parameter. Signature func (c *Ctx) Location(path string) Example app.Post(\"/\", func(c *fiber.Ctx) error { c.Location(\"http://example.com\") c.Location(\"/foo/bar\") return nil })","s":"Location","u":"/api/ctx","h":"#location","p":1752},{"i":1822,"t":"Returns a string corresponding to the HTTP method of the request: GET, POST, PUT, and so on. Optionally, you could override the method by passing a string. Signature func (c *Ctx) Method(override ...string) string Example app.Post(\"/\", func(c *fiber.Ctx) error { c.Method() // \"POST\" c.Method(\"GET\") c.Method() // GET // ... })","s":"Method","u":"/api/ctx","h":"#method","p":1752},{"i":1824,"t":"To access multipart form entries, you can parse the binary with MultipartForm(). This returns a map[string][]string, so given a key, the value will be a string slice. Signature func (c *Ctx) MultipartForm() (*multipart.Form, error) Example app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form if token := form.Value[\"token\"]; len(token) > 0 { // Get key value: fmt.Println(token[0]) } // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: if err := c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)); err != nil { return err } } } return err })","s":"MultipartForm","u":"/api/ctx","h":"#multipartform","p":1752},{"i":1826,"t":"When Next is called, it executes the next method in the stack that matches the current route. You can pass an error struct within the method that will end the chaining and call the error handler. Signature func (c *Ctx) Next() error Example app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(\"1st route!\") return c.Next() }) app.Get(\"*\", func(c *fiber.Ctx) error { fmt.Println(\"2nd route!\") return c.Next() }) app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(\"3rd route!\") return c.SendString(\"Hello, World!\") })","s":"Next","u":"/api/ctx","h":"#next","p":1752},{"i":1828,"t":"Returns the original request URL. Signature func (c *Ctx) OriginalURL() string Example // GET http://example.com/search?q=something app.Get(\"/\", func(c *fiber.Ctx) error { c.OriginalURL() // \"/search?q=something\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"OriginalURL","u":"/api/ctx","h":"#originalurl","p":1752},{"i":1830,"t":"Method can be used to get the route parameters, you could pass an optional default value that will be returned if the param key does not exist. info Defaults to empty string (\"\"), if the param doesn't exist. Signature func (c *Ctx) Params(key string, defaultValue ...string) string Example // GET http://example.com/user/fenny app.Get(\"/user/:name\", func(c *fiber.Ctx) error { c.Params(\"name\") // \"fenny\" // ... }) // GET http://example.com/user/fenny/123 app.Get(\"/user/*\", func(c *fiber.Ctx) error { c.Params(\"*\") // \"fenny/123\" c.Params(\"*1\") // \"fenny/123\" // ... }) Unnamed route parameters(*, +) can be fetched by the character and the counter in the route. Example // ROUTE: /v1/*/shop/* // GET: /v1/brand/4/shop/blue/xs c.Params(\"*1\") // \"brand/4\" c.Params(\"*2\") // \"blue/xs\" For reasons of downward compatibility, the first parameter segment for the parameter character can also be accessed without the counter. Example app.Get(\"/v1/*/shop/*\", func(c *fiber.Ctx) error { c.Params(\"*\") // outputs the values of the first wildcard segment }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Params","u":"/api/ctx","h":"#params","p":1752},{"i":1832,"t":"Method can be used to get an integer from the route parameters. Please note if that parameter is not in the request, zero will be returned. If the parameter is NOT a number, zero and an error will be returned info Defaults to the integer zero (0), if the param doesn't exist. Signature func (c *Ctx) ParamsInt(key string) (int, error) Example // GET http://example.com/user/123 app.Get(\"/user/:id\", func(c *fiber.Ctx) error { id, err := c.ParamsInt(\"id\") // int 123 and no error // ... }) This method is equivalent of using atoi with ctx.Params","s":"ParamsInt","u":"/api/ctx","h":"#paramsint","p":1752},{"i":1834,"t":"This method is similar to BodyParser, but for path parameters. It is important to use the struct tag \"params\". For example, if you want to parse a path parameter with a field called Pass, you would use a struct field of params:\"pass\" Signature func (c *Ctx) ParamsParser(out interface{}) error Example // GET http://example.com/user/111 app.Get(\"/user/:id\", func(c *fiber.Ctx) error { param := struct {ID uint `params:\"id\"`}{} c.ParamsParser(¶m) // \"{\"id\": 111}\" // ... })","s":"ParamsParser","u":"/api/ctx","h":"#paramsparser","p":1752},{"i":1836,"t":"Contains the path part of the request URL. Optionally, you could override the path by passing a string. For internal redirects, you might want to call RestartRouting instead of Next. Signature func (c *Ctx) Path(override ...string) string Example // GET http://example.com/users?sort=desc app.Get(\"/users\", func(c *fiber.Ctx) error { c.Path() // \"/users\" c.Path(\"/john\") c.Path() // \"/john\" // ... })","s":"Path","u":"/api/ctx","h":"#path","p":1752},{"i":1838,"t":"Contains the request protocol string: http or https for TLS requests. Signature func (c *Ctx) Protocol() string Example // GET http://example.com app.Get(\"/\", func(c *fiber.Ctx) error { c.Protocol() // \"http\" // ... })","s":"Protocol","u":"/api/ctx","h":"#protocol","p":1752},{"i":1840,"t":"Queries is a function that returns an object containing a property for each query string parameter in the route. Signature func (c *Ctx) Queries() (map[string]string, error) Example // GET http://example.com/?name=alex&want_pizza=false&id= app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"name\"] // \"alex\" m[\"want_pizza\"] // \"false\" m[\"id\"] // \"\" // ... }) Example // GET http://example.com/?field1=value1&field1=value2&field2=value3 app.Get(\"/\", func (c *fiber.Ctx) error { m := c.Queries() m[\"field1\"] // \"value2\" m[\"field2\"] // value3 }) Example // GET http://example.com/?list_a=1&list_a=2&list_a=3&list_b[]=1&list_b[]=2&list_b[]=3&list_c=1,2,3 app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"list_a\"] // \"3\" m[\"list_b[]\"] // \"3\" m[\"list_c\"] // \"1,2,3\" }) Example // GET /api/posts?filters.author.name=John&filters.category.name=Technology app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"filters.author.name\"] // John m[\"filters.category.name\"] // Technology }) Example // GET /api/posts?tags=apple,orange,banana&filters[tags]=apple,orange,banana&filters[category][name]=fruits&filters.tags=apple,orange,banana&filters.category.name=fruits app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"tags\"] // apple,orange,banana m[\"filters[tags]\"] // apple,orange,banana m[\"filters[category][name]\"] // fruits m[\"filters.tags\"] // apple,orange,banana m[\"filters.category.name\"] // fruits })","s":"Queries","u":"/api/ctx","h":"#queries","p":1752},{"i":1842,"t":"This property is an object containing a property for each query string parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. info If there is no query string, it returns an empty string. Signature func (c *Ctx) Query(key string, defaultValue ...string) string Example // GET http://example.com/?order=desc&brand=nike app.Get(\"/\", func(c *fiber.Ctx) error { c.Query(\"order\") // \"desc\" c.Query(\"brand\") // \"nike\" c.Query(\"empty\", \"nike\") // \"nike\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Query","u":"/api/ctx","h":"#query","p":1752},{"i":1844,"t":"This property is an object containing a property for each query boolean parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, false will be returned. If the parameter is not a boolean, it is still tried to be converted and usually returned as false. Signature func (c *Ctx) QueryBool(key string, defaultValue ...bool) bool Example // GET http://example.com/?name=alex&want_pizza=false&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryBool(\"want_pizza\") // false c.QueryBool(\"want_pizza\", true) // false c.QueryBool(\"name\") // false c.QueryBool(\"name\", true) // true c.QueryBool(\"id\") // false c.QueryBool(\"id\", true) // true // ... })","s":"QueryBool","u":"/api/ctx","h":"#querybool","p":1752},{"i":1846,"t":"This property is an object containing a property for each query float64 parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, zero will be returned. If the parameter is not a number, it is still tried to be converted and usually returned as 1. info Defaults to the float64 zero (0), if the param doesn't exist. Signature func (c *Ctx) QueryFloat(key string, defaultValue ...float64) float64 Example // GET http://example.com/?name=alex&amount=32.23&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryFloat(\"amount\") // 32.23 c.QueryFloat(\"amount\", 3) // 32.23 c.QueryFloat(\"name\", 1) // 1 c.QueryFloat(\"name\") // 0 c.QueryFloat(\"id\", 3) // 3 // ... })","s":"QueryFloat","u":"/api/ctx","h":"#queryfloat","p":1752},{"i":1848,"t":"This property is an object containing a property for each query integer parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, zero will be returned. If the parameter is not a number, it is still tried to be converted and usually returned as 1. info Defaults to the integer zero (0), if the param doesn't exist. Signature func (c *Ctx) QueryInt(key string, defaultValue ...int) int Example // GET http://example.com/?name=alex&wanna_cake=2&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryInt(\"wanna_cake\", 1) // 2 c.QueryInt(\"name\", 1) // 1 c.QueryInt(\"id\", 1) // 1 c.QueryInt(\"id\") // 0 // ... })","s":"QueryInt","u":"/api/ctx","h":"#queryint","p":1752},{"i":1850,"t":"This method is similar to BodyParser, but for query parameters. It is important to use the struct tag \"query\". For example, if you want to parse a query parameter with a field called Pass, you would use a struct field of query:\"pass\". Signature func (c *Ctx) QueryParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `query:\"name\"` Pass string `query:\"pass\"` Products []string `query:\"products\"` } app.Get(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.QueryParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe log.Println(p.Products) // [shoe, hat] // ... }) // Run tests with the following curl command // curl \"http://localhost:3000/?name=john&pass=doe&products=shoe,hat\"","s":"QueryParser","u":"/api/ctx","h":"#queryparser","p":1752},{"i":1852,"t":"A struct containing the type and a slice of ranges will be returned. Signature func (c *Ctx) Range(size int) (Range, error) Example // Range: bytes=500-700, 700-900 app.Get(\"/\", func(c *fiber.Ctx) error { b := c.Range(1000) if b.Type == \"bytes\" { for r := range r.Ranges { fmt.Println(r) // [500, 700] } } })","s":"Range","u":"/api/ctx","h":"#range","p":1752},{"i":1854,"t":"Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. Signature func (c *Ctx) Redirect(location string, status ...int) error Example app.Get(\"/coffee\", func(c *fiber.Ctx) error { return c.Redirect(\"/teapot\") }) app.Get(\"/teapot\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusTeapot).Send(\"🍡 short and stout 🍡\") }) More examples app.Get(\"/\", func(c *fiber.Ctx) error { return c.Redirect(\"/foo/bar\") return c.Redirect(\"../login\") return c.Redirect(\"http://example.com\") return c.Redirect(\"http://example.com\", 301) })","s":"Redirect","u":"/api/ctx","h":"#redirect","p":1752},{"i":1856,"t":"Redirects to the specific route along with the parameters and with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. info If you want to send queries to route, you must add \"queries\" key typed as map[string]string to params. Signature func (c *Ctx) RedirectToRoute(routeName string, params fiber.Map, status ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { // /user/fiber return c.RedirectToRoute(\"user\", fiber.Map{ \"name\": \"fiber\" }) }) app.Get(\"/with-queries\", func(c *fiber.Ctx) error { // /user/fiber?data[0][name]=john&data[0][age]=10&test=doe return c.RedirectToRoute(\"user\", fiber.Map{ \"name\": \"fiber\", \"queries\": map[string]string{\"data[0][name]\": \"john\", \"data[0][age]\": \"10\", \"test\": \"doe\"}, }) }) app.Get(\"/user/:name\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"name\")) }).Name(\"user\")","s":"RedirectToRoute","u":"/api/ctx","h":"#redirecttoroute","p":1752},{"i":1858,"t":"Redirects back to refer URL. It redirects to fallback URL if refer header doesn't exists, with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. Signature func (c *Ctx) RedirectBack(fallback string, status ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Home page\") }) app.Get(\"/test\", func(c *fiber.Ctx) error { c.Set(\"Content-Type\", \"text/html\") return c.SendString(`Back`) }) app.Get(\"/back\", func(c *fiber.Ctx) error { return c.RedirectBack(\"/\") })","s":"RedirectBack","u":"/api/ctx","h":"#redirectback","p":1752},{"i":1860,"t":"Renders a view with data and sends a text/html response. By default Render uses the default Go Template engine. If you want to use another View engine, please take a look at our Template middleware. Signature func (c *Ctx) Render(name string, bind interface{}, layouts ...string) error","s":"Render","u":"/api/ctx","h":"#render","p":1752},{"i":1862,"t":"Request return the *fasthttp.Request pointer Signature func (c *Ctx) Request() *fasthttp.Request Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Request().Header.Method() // => []byte(\"GET\") })","s":"Request","u":"/api/ctx","h":"#request","p":1752},{"i":1864,"t":"This method is similar to BodyParser, but for request headers. It is important to use the struct tag \"reqHeader\". For example, if you want to parse a request header with a field called Pass, you would use a struct field of reqHeader:\"pass\". Signature func (c *Ctx) ReqHeaderParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `reqHeader:\"name\"` Pass string `reqHeader:\"pass\"` Products []string `reqHeader:\"products\"` } app.Get(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.ReqHeaderParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe log.Println(p.Products) // [shoe, hat] // ... }) // Run tests with the following curl command // curl \"http://localhost:3000/\" -H \"name: john\" -H \"pass: doe\" -H \"products: shoe,hat\"","s":"ReqHeaderParser","u":"/api/ctx","h":"#reqheaderparser","p":1752},{"i":1866,"t":"Response return the *fasthttp.Response pointer Signature func (c *Ctx) Response() *fasthttp.Response Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Response().BodyWriter().Write([]byte(\"Hello, World!\")) // => \"Hello, World!\" return nil })","s":"Response","u":"/api/ctx","h":"#response","p":1752},{"i":1868,"t":"Instead of executing the next method when calling Next, RestartRouting restarts execution from the first method that matches the current route. This may be helpful after overriding the path, i. e. an internal redirect. Note that handlers might be executed again which could result in an infinite loop. Signature func (c *Ctx) RestartRouting() error Example app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"From /new\") }) app.Get(\"/old\", func(c *fiber.Ctx) error { c.Path(\"/new\") return c.RestartRouting() })","s":"RestartRouting","u":"/api/ctx","h":"#restartrouting","p":1752},{"i":1870,"t":"Returns the matched Route struct. Signature func (c *Ctx) Route() *Route Example // http://localhost:8080/hello app.Get(\"/hello/:name\", func(c *fiber.Ctx) error { r := c.Route() fmt.Println(r.Method, r.Path, r.Params, r.Handlers) // GET /hello/:name handler [name] // ... }) caution Do not rely on c.Route() in middlewares before calling c.Next() - c.Route() returns the last executed route. Example func MyMiddleware() fiber.Handler { return func(c *fiber.Ctx) error { beforeNext := c.Route().Path // Will be '/' err := c.Next() afterNext := c.Route().Path // Will be '/hello/:name' return err } }","s":"Route","u":"/api/ctx","h":"#route","p":1752},{"i":1872,"t":"Method is used to save any multipart file to disk. Signature func (c *Ctx) SaveFile(fh *multipart.FileHeader, path string) error Example app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: if err := c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)); err != nil { return err } } return err } })","s":"SaveFile","u":"/api/ctx","h":"#savefile","p":1752},{"i":1874,"t":"Method is used to save any multipart file to an external storage system. Signature func (c *Ctx) SaveFileToStorage(fileheader *multipart.FileHeader, path string, storage Storage) error Example storage := memory.New() app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to storage: if err := c.SaveFileToStorage(file, fmt.Sprintf(\"./%s\", file.Filename), storage); err != nil { return err } } return err } })","s":"SaveFileToStorage","u":"/api/ctx","h":"#savefiletostorage","p":1752},{"i":1876,"t":"A boolean property that is true , if a TLS connection is established. Signature func (c *Ctx) Secure() bool Example // Secure() method is equivalent to: c.Protocol() == \"https\"","s":"Secure","u":"/api/ctx","h":"#secure","p":1752},{"i":1878,"t":"Sets the HTTP response body. Signature func (c *Ctx) Send(body []byte) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.Send([]byte(\"Hello, World!\")) // => \"Hello, World!\" }) Fiber also provides SendString and SendStream methods for raw inputs. tip Use this if you don't need type assertion, recommended for faster performance. Signature func (c *Ctx) SendString(body string) error func (c *Ctx) SendStream(stream io.Reader, size ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") // => \"Hello, World!\" return c.SendStream(bytes.NewReader([]byte(\"Hello, World!\"))) // => \"Hello, World!\" })","s":"Send","u":"/api/ctx","h":"#send","p":1752},{"i":1880,"t":"Transfers the file from the given path. Sets the Content-Type response HTTP header field based on the filenames extension. caution Method doesnΒ΄t use gzipping by default, set it to true to enable. Signature func (c *Ctx) SendFile(file string, compress ...bool) error Example app.Get(\"/not-found\", func(c *fiber.Ctx) error { return c.SendFile(\"./public/404.html\"); // Disable compression return c.SendFile(\"./static/index.html\", false); }) info If the file contains an url specific character you have to escape it before passing the file path into the sendFile function. Example app.Get(\"/file-with-url-chars\", func(c *fiber.Ctx) error { return c.SendFile(url.PathEscape(\"hash_sign_#.txt\")) })","s":"SendFile","u":"/api/ctx","h":"#sendfile","p":1752},{"i":1882,"t":"Sets the status code and the correct status message in the body, if the response body is empty. tip You can find all used status codes and messages here. Signature func (c *Ctx) SendStatus(status int) error Example app.Get(\"/not-found\", func(c *fiber.Ctx) error { return c.SendStatus(415) // => 415 \"Unsupported Media Type\" c.SendString(\"Hello, World!\") return c.SendStatus(415) // => 415 \"Hello, World!\" })","s":"SendStatus","u":"/api/ctx","h":"#sendstatus","p":1752},{"i":1884,"t":"Sets the response’s HTTP header field to the specified key, value. Signature func (c *Ctx) Set(key string, val string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Set(\"Content-Type\", \"text/plain\") // => \"Content-type: text/plain\" // ... })","s":"Set","u":"/api/ctx","h":"#set","p":1752},{"i":1886,"t":"Allow you to config BodyParser/QueryParser decoder, base on schema's options, providing possibility to add custom type for pausing. Signature func SetParserDecoder(parserConfig fiber.ParserConfig{ IgnoreUnknownKeys bool, ParserType []fiber.ParserType{ Customtype interface{}, Converter func(string) reflect.Value, }, ZeroEmpty bool, SetAliasTag string, }) Example type CustomTime time.Time // String() returns the time in string func (ct *CustomTime) String() string { t := time.Time(*ct).String() return t } // Register the converter for CustomTime type format as 2006-01-02 var timeConverter = func(value string) reflect.Value { fmt.Println(\"timeConverter\", value) if v, err := time.Parse(\"2006-01-02\", value); err == nil { return reflect.ValueOf(v) } return reflect.Value{} } customTime := fiber.ParserType{ Customtype: CustomTime{}, Converter: timeConverter, } // Add setting to the Decoder fiber.SetParserDecoder(fiber.ParserConfig{ IgnoreUnknownKeys: true, ParserType: []fiber.ParserType{customTime}, ZeroEmpty: true, }) // Example to use CustomType, you pause custom time format not in RFC3339 type Demo struct { Date CustomTime `form:\"date\" query:\"date\"` Title string `form:\"title\" query:\"title\"` Body string `form:\"body\" query:\"body\"` } app.Post(\"/body\", func(c *fiber.Ctx) error { var d Demo c.BodyParser(&d) fmt.Println(\"d.Date\", d.Date.String()) return c.JSON(d) }) app.Get(\"/query\", func(c *fiber.Ctx) error { var d Demo c.QueryParser(&d) fmt.Println(\"d.Date\", d.Date.String()) return c.JSON(d) }) // curl -X POST -F title=title -F body=body -F date=2021-10-20 http://localhost:3000/body // curl -X GET \"http://localhost:3000/query?title=title&body=body&date=2021-10-20\"","s":"SetParserDecoder","u":"/api/ctx","h":"#setparserdecoder","p":1752},{"i":1888,"t":"Sets the user specified implementation for context interface. Signature func (c *Ctx) SetUserContext(ctx context.Context) Example app.Get(\"/\", func(c *fiber.Ctx) error { ctx := context.Background() c.SetUserContext(ctx) // Here ctx could be any context implementation // ... })","s":"SetUserContext","u":"/api/ctx","h":"#setusercontext","p":1752},{"i":1890,"t":"https://expressjs.com/en/4x/api.html#req.stale Signature func (c *Ctx) Stale() bool","s":"Stale","u":"/api/ctx","h":"#stale","p":1752},{"i":1892,"t":"Sets the HTTP status for the response. info Method is a chainable. Signature func (c *Ctx) Status(status int) *Ctx Example app.Get(\"/fiber\", func(c *fiber.Ctx) error { c.Status(fiber.StatusOK) return nil } app.Get(\"/hello\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusBadRequest).SendString(\"Bad Request\") } app.Get(\"/world\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusNotFound).SendFile(\"./public/gopher.png\") })","s":"Status","u":"/api/ctx","h":"#status","p":1752},{"i":1894,"t":"Returns a string slice of subdomains in the domain name of the request. The application property subdomain offset, which defaults to 2, is used for determining the beginning of the subdomain segments. Signature func (c *Ctx) Subdomains(offset ...int) []string Example // Host: \"tobi.ferrets.example.com\" app.Get(\"/\", func(c *fiber.Ctx) error { c.Subdomains() // [\"ferrets\", \"tobi\"] c.Subdomains(1) // [\"tobi\"] // ... })","s":"Subdomains","u":"/api/ctx","h":"#subdomains","p":1752},{"i":1896,"t":"Sets the Content-Type HTTP header to the MIME type listed here specified by the file extension. Signature func (c *Ctx) Type(ext string, charset ...string) *Ctx Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Type(\".html\") // => \"text/html\" c.Type(\"html\") // => \"text/html\" c.Type(\"png\") // => \"image/png\" c.Type(\"json\", \"utf-8\") // => \"application/json; charset=utf-8\" // ... })","s":"Type","u":"/api/ctx","h":"#type","p":1752},{"i":1898,"t":"UserContext returns a context implementation that was set by user earlier or returns a non-nil, empty context, if it was not set earlier. Signature func (c *Ctx) UserContext() context.Context Example app.Get(\"/\", func(c *fiber.Ctx) error { ctx := c.UserContext() // ctx is context implementation set by user // ... })","s":"UserContext","u":"/api/ctx","h":"#usercontext","p":1752},{"i":1900,"t":"Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location. info Multiple fields are allowed. Signature func (c *Ctx) Vary(fields ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Vary(\"Origin\") // => Vary: Origin c.Vary(\"User-Agent\") // => Vary: Origin, User-Agent // No duplicates c.Vary(\"Origin\") // => Vary: Origin, User-Agent c.Vary(\"Accept-Encoding\", \"Accept\") // => Vary: Origin, User-Agent, Accept-Encoding, Accept // ... })","s":"Vary","u":"/api/ctx","h":"#vary","p":1752},{"i":1902,"t":"Write adopts the Writer interface Signature func (c *Ctx) Write(p []byte) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Write([]byte(\"Hello, World!\")) // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"Write","u":"/api/ctx","h":"#write","p":1752},{"i":1904,"t":"Writef adopts the string with variables Signature func (c *Ctx) Writef(f string, a ...interface{}) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { world := \"World!\" c.Writef(\"Hello, %s\", world) // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"Writef","u":"/api/ctx","h":"#writef","p":1752},{"i":1906,"t":"WriteString adopts the string Signature func (c *Ctx) WriteString(s string) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.WriteString(\"Hello, World!\") // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"WriteString","u":"/api/ctx","h":"#writestring","p":1752},{"i":1908,"t":"A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery). Signature func (c *Ctx) XHR() bool Example // X-Requested-With: XMLHttpRequest app.Get(\"/\", func(c *fiber.Ctx) error { c.XHR() // true // ... })","s":"XHR","u":"/api/ctx","h":"#xhr","p":1752},{"i":1910,"t":"Converts any interface or string to XML using the standard encoding/xml package. info XML also sets the content header to application/xml. Signature func (c *Ctx) XML(data interface{}) error Example type SomeStruct struct { XMLName xml.Name `xml:\"Fiber\"` Name string `xml:\"Name\"` Age uint8 `xml:\"Age\"` } app.Get(\"/\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ Name: \"Grame\", Age: 20, } return c.XML(data) // // Grame // 20 // })","s":"XML","u":"/api/ctx","h":"#xml","p":1752}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/723",[0,7.753,1,9.501,2,8.153,3,2.485,4,7.434]],["t/725",[5,7.278,6,8.481,7,7.756,8,8.481,9,8.481,10,6.196,11,7.278,12,6.018,13,6.196,14,3.873,15,7.756,16,7.756,17,6.921,18,7.278,19,6.637]],["t/727",[3,2.546,5,8.354,20,2.469]],["t/729",[21,4.094,22,7.087,23,2.734,24,7.073,25,7.926,26,8.524,27,4.804,28,7.073]],["t/731",[29,9.735,30,9.735,31,9.735]],["t/733",[3,1.588,5,5.21,13,4.436,26,4.955,32,3.115,33,1.797,34,3.765,35,1.421,36,6.778,37,1.577,38,6.071,39,2.855,40,2.401,41,6.071,42,6.778,43,6.071,44,2.855,45,6.071,46,9.467,47,6.071,48,2.062,49,3.365,50,1.111,51,0.648,52,4.955,53,5.984,54,4.751,55,4.436,56,4.001,57,4.751,58,6.541,59,1.354,60,4.056,61,3.867,62,8.124]],["t/735",[26,9.063,39,4.522,63,8.794]],["t/737",[23,1.754,24,4.537,28,4.537,36,4.537,37,1.055,42,4.537,51,0.954,52,4.537,57,4.35,59,1.273,64,1.508,65,2.777,66,1.609,67,2.998,68,4.771,69,4.35,70,4.537,71,4.771,72,0.749,73,1.424,74,2.233,75,4.771,76,4.771,77,4.771,78,4.771,79,4.771,80,1.893,81,1.723,82,4.537,83,3.273,84,2.614,85,5.084,86,7.813,87,5.559,88,3.021,89,5.559,90,5.559,91,5.559,92,4.061]],["t/739",[23,1.858,24,4.807,28,4.807,36,4.807,37,1.118,40,2.329,42,4.807,51,0.948,52,4.807,57,4.609,59,0.96,64,1.598,65,2.891,66,1.705,67,3.177,68,5.055,69,4.609,70,4.807,71,5.055,72,0.793,73,1.509,74,2.366,75,5.055,76,5.055,77,5.055,78,5.055,79,5.055,80,1.704,81,1.552,82,4.807,83,3.468,84,2.77,85,5.387,88,2.278,92,4.303,93,3.8,94,5.055,95,2.136,96,5.891]],["t/741",[23,1.93,24,4.993,28,4.993,36,4.993,37,1.162,42,4.993,51,0.948,52,4.993,57,4.788,59,0.997,64,1.66,65,2.967,66,1.771,67,3.3,68,5.251,69,4.788,70,4.993,71,5.251,72,0.824,73,1.568,74,2.457,75,5.251,76,5.251,77,5.251,78,5.251,79,5.251,80,1.749,81,1.593,82,4.993,83,3.602,84,2.877,88,2.366,92,4.47,97,6.118,98,6.118]],["t/743",[20,2.439,21,3.512,99,8.794,100,3.955]],["t/745",[3,2.344,20,2.273,21,3.892,22,6.736,23,2.827,100,3.686,101,5.364,102,8.196]],["t/747",[103,9.735,104,1.732,105,4.173]],["t/749",[3,1.291,32,2.532,33,2.503,34,3.06,35,1.68,37,1.762,39,3.976,40,1.951,50,1.313,80,1.034,81,1.613,99,4.513,106,1.867,107,1.655,108,2.533,109,2.254,110,1.319,111,1.84,112,1.437,113,4.513,114,3.976,115,4.235,116,4.513,117,4.513,118,7.175,119,3.327,120,7.575,121,3.252,122,4.513,123,6.561,124,4.935,125,4.935,126,4.513,127,8.454,128,2.446,129,2.153,130,2.029,131,2.627,132,2.192,133,3.861,134,4.935,135,4.935,136,4.935,137,4.935,138,4.935,139,3.723,140,4.935,141,4.935,142,3.41,143,7.175,144,4.935,145,2.816,146,3.41,147,1.521,148,1.676,149,3.252,150,2.905,151,2.446,152,4.935]],["t/751",[23,1.901,51,0.94,59,1.347,64,1.635,65,2.936,66,1.744,72,0.811,73,1.544,74,2.42,80,1.262,81,1.576,102,5.51,110,1.518,113,5.51,116,5.51,117,5.51,122,5.51,123,5.51,126,5.51,142,4.163,153,6.025,154,6.025,155,6.025,156,4.402,157,6.025,158,6.025,159,1.846,160,6.025,161,5.51,162,6.025,163,6.025,164,6.025,165,6.025,166,3.809,167,2.113,168,6.025,169,6.025]],["t/753",[11,8.354,20,2.469,100,4.004]],["t/755",[21,3.999,22,6.923,23,2.961,170,8.056]],["t/757",[105,4.173,171,9.735,172,8.354]],["t/759",[11,5.21,20,1.54,32,3.115,33,1.797,34,3.765,35,1.421,37,1.797,50,1.111,51,0.474,59,0.99,73,1.556,80,1.272,81,1.158,107,2.036,112,1.768,167,2.129,173,7.595,174,3.319,175,4.604,176,10.178,177,2.129,178,5.21,179,5.573,180,3.275,181,3.464,182,6.071,183,2.102,184,6.071,185,3.505,186,4.955,187,3.01,188,6.071,189,2.696,190,2.438,191,3.192,192,3.916,193,3.152,194,3.152,195,6.071]],["t/761",[23,2.222,51,0.936,59,1.148,64,1.912,65,3.26,66,2.04,72,0.949,73,1.805,74,2.829,81,1.344,92,5.147,110,1.295,111,2.627,142,4.868,159,2.158,170,6.046,172,6.046,173,6.443,178,6.046,181,4.02,196,6.046,197,5.513,198,7.045,199,7.045,200,6.443]],["t/763",[23,2.11,51,0.943,59,1.09,64,1.814,65,3.15,66,1.936,72,0.901,73,1.713,74,2.686,81,1.276,92,4.886,110,1.229,142,4.621,159,2.049,170,5.739,172,5.739,179,3.937,189,2.97,196,5.739,197,5.233,200,6.116,201,6.688,202,6.688,203,8.864,204,6.688,205,6.688,206,6.688,207,6.688]],["t/765",[20,2.469,100,4.004,208,8.902]],["t/767",[3,2.242,20,2.174,21,4.235,22,7.054,23,2.705,100,3.526,101,5.132,209,7.84,210,7.84]],["t/769",[104,1.732,105,4.173,211,9.735]],["t/771",[3,2.207,32,3.188,33,1.84,34,3.854,35,1.455,50,1.544,51,0.485,60,2.477,107,2.829,109,2.838,111,2.318,147,2.6,183,3.317,191,3.267,208,5.683,212,8.762,213,5.443,214,5.831,215,6.215,216,2.631,217,6.886,218,7.717,219,5.333,220,3.188,221,6.215,222,4.41,223,4.294,224,4.41,225,2.151,226,4.889,227,2.598,228,4.863,229,6.215,230,3.014,231,2.894]],["t/773",[3,1.363,7,4.766,21,1.187,23,1.025,37,0.617,50,0.953,51,0.944,59,1.063,64,0.882,65,1.852,66,0.941,67,1.753,72,0.438,73,0.833,74,1.305,80,1.367,81,1.244,95,1.179,110,1.199,111,2.783,112,1.899,132,1.444,147,1.002,150,1.914,209,2.973,210,2.973,212,2.973,217,2.653,218,2.973,220,1.668,228,2.544,232,3.932,233,1.98,234,5.212,235,3.251,236,3.251,237,5.212,238,3.905,239,1.418,240,3.601,241,2.789,242,2.973,243,2.544,244,2.889,245,3.251,246,3.251,247,3.251,248,1.316,249,1.855,250,2.246,251,3.251,252,3.251,253,1.611,254,3.808,255,2.973,256,1.431,257,2.653,258,2.973,259,2.789,260,2.544,261,1.529,262,3.251,263,2.973,264,2.973,265,2.973,266,2.973,267,4.766,268,2.973,269,2.973,270,2.973,271,1.038,272,4.253,273,2.973,274,1.777,275,2.973,276,3.251,277,3.251,278,2.544,279,3.251,280,3.251,281,5.212,282,7.464,283,5.212,284,3.251,285,3.251,286,2.097,287,3.251,288,3.251,289,3.251,290,3.251,291,3.251,292,3.251,293,3.251,294,3.251,295,3.251,296,3.251,297,3.251,298,2.789,299,1.544]],["t/775",[51,0.946,110,1.307,112,2.07,228,5.562,238,4.255,244,3.94,263,6.501,264,8.437,265,6.501,266,6.501,267,8.437,268,6.501,269,6.501,270,6.501,271,2.269,272,7.529,273,6.501,274,3.886,275,6.501,300,4.494,301,7.109]],["t/777",[20,2.439,100,3.955,261,4.522,302,8.794]],["t/779",[3,2.267,20,2.198,21,4.094,22,7.087,23,2.734,100,3.565,101,5.188,303,7.926,304,7.926]],["t/781",[104,1.732,105,4.173,305,9.735]],["t/783",[3,1.911,32,2.596,33,1.498,34,3.139,35,1.185,37,1.783,48,2.912,50,0.926,59,1.191,60,3.418,61,2.356,72,0.682,80,1.06,81,0.965,95,1.836,106,1.914,107,1.697,108,2.58,109,3.337,110,1.343,111,1.887,112,2.497,130,3.005,191,2.66,193,2.628,216,1.578,261,2.38,302,4.628,306,4.343,307,5.049,308,5.061,309,3.941,310,5.061,311,3.749,312,2.356,313,4.628,314,2.334,315,5.049,316,4.628,317,2.628,318,4.628,319,5.338,320,5.061,321,5.061,322,5.061,323,5.061,324,4.628,325,3.697,326,6.683,327,2.133,328,3.96,329,4.13,330,3.497,331,6.271,332,4.628,333,4.628]],["t/785",[23,2.203,51,0.934,59,1.138,64,1.895,65,3.241,66,2.022,67,3.766,72,1.228,73,1.789,74,2.804,81,1.332,110,1.283,159,2.139,261,3.284,271,2.229,299,3.317,303,6.386,304,6.386,307,7.017,334,6.983,335,6.983,336,4.18,337,3.251]],["t/787",[20,2.439,100,3.955,261,4.522,338,8.794]],["t/789",[3,2.267,20,2.198,21,4.094,22,7.087,23,2.734,100,3.565,101,5.188,339,7.926,340,8.667]],["t/791",[104,1.732,105,4.173,341,9.735]],["t/793",[3,1.787,32,2.369,33,1.367,34,2.864,35,1.081,37,1.707,48,3.053,50,0.845,53,2.919,59,1.326,60,3.242,61,2.15,72,0.622,80,0.968,81,0.881,95,1.675,106,1.747,107,1.548,108,2.413,109,3.121,110,1.495,111,1.722,112,2.618,130,3.346,191,2.427,193,2.398,216,1.44,223,3.191,261,2.171,306,3.963,307,6.632,309,3.686,311,3.506,312,2.15,313,4.223,314,2.129,315,4.722,316,4.223,317,2.398,318,4.223,319,4.992,324,4.223,325,3.373,326,6.249,327,1.946,328,3.613,329,3.768,330,3.191,331,5.864,332,4.223,333,4.223,338,6.249,342,6.834,343,4.223,344,4.618,345,3.613,346,1.609,347,4.618,348,4.618,349,4.618,350,4.618]],["t/795",[23,2.057,51,0.952,59,1.421,64,1.77,65,3.098,66,1.888,72,1.174,73,2.234,74,2.619,81,1.244,110,1.199,112,1.899,159,1.998,189,3.872,271,2.082,307,6.785,336,3.904,337,3.037,339,5.964,343,5.964,351,6.522,352,6.522,353,3.904,354,6.522]],["t/797",[3,1.859,10,6.74,58,4.912,59,1.504,84,3.343,88,2.749,106,2.689,110,1.883,147,2.19,216,2.216,253,3.524,355,4.119,356,3.31,357,6.281,358,5.364,359,3.563,360,6.501,361,5.044,362,5.044,363,5.364,364,5.364,365,6.501,366,5.044,367,5.562,368,7.109,369,6.501]],["t/799",[3,2.149,20,2.084,21,4,22,6.924,23,2.592,51,0.641,100,3.379,101,4.918,370,5.678,371,3.649,372,7.514,373,6.706,374,6.706,375,6.706]],["t/801",[53,6.079,59,1.567,376,9.616,377,9.616]],["t/803",[3,0.993,10,4.304,32,1.948,33,1.124,34,2.355,35,1.69,37,1.672,50,1.611,53,4.563,59,1.177,72,0.511,84,3.395,107,1.273,108,2.872,109,1.734,112,2.564,129,1.656,130,3.832,148,1.289,177,3.089,216,1.184,238,3.526,256,1.671,300,2.4,311,1.948,314,1.751,346,2.053,355,2.2,356,1.768,357,5.633,359,4.078,361,4.181,362,2.694,378,2.971,379,4.808,380,2.92,381,3.972,382,1.862,383,5.891,384,4.181,385,3.472,386,3.099,387,1.862,388,2.971,389,2.694,390,3.797,391,3.258,392,2.694,393,1.562,394,2.4,395,6.195,396,3.797,397,2.166,398,1.882,399,3.258,400,6.602,401,2.2,402,3.258,403,3.472,404,5.056,405,2.694,406,4.61,407,3.797,408,5.388,409,3.472,410,3.099,411,3.797,412,3.472,413,2.624,414,3.099,415,3.472,416,2.235]],["t/805",[3,0.948,10,2.647,23,1.143,49,2.008,51,0.963,58,2.503,59,1.293,60,1.444,64,0.983,65,2.019,66,1.049,72,1.068,73,0.928,74,1.455,81,1.336,84,3.295,110,1.583,111,1.351,112,1.055,159,1.11,167,2.457,189,2.523,244,2.008,248,2.836,353,2.169,357,4.059,373,2.957,374,2.957,375,2.957,383,2.957,395,6.806,399,3.109,417,1.837,418,3.109,419,4.874,420,3.313,421,3.313,422,3.109,423,3.623,424,3.623,425,4.444,426,3.313,427,3.313,428,3.313,429,2.317,430,3.313,431,3.313,432,3.148,433,3.664,434,3.313,435,1.916,436,2.734,437,2.008,438,3.313,439,3.313,440,3.623,441,2.29,442,2.133,443,4.635,444,3.623,445,3.313,446,3.313,447,3.313,448,3.313,449,3.313,450,3.313,451,3.313,452,3.313,453,2.835]],["t/807",[50,1.668,51,0.712,60,3.634,146,4.825,147,2.81,148,2.371,256,3.074,357,5.884,405,6.471,406,5.464,419,5.993,425,5.464,432,3.87,433,4.504,454,4.111,455,4.046,456,5.369,457,6.983,458,6.983,459,9.12,460,9.12,461,5.102,462,6.983,463,5.102,464,5.993]],["t/809",[3,0.725,10,2.025,23,0.874,49,3.241,51,0.957,58,1.915,59,1.225,60,1.105,64,0.752,65,1.627,66,0.803,72,0.914,73,0.71,74,1.113,81,1.116,84,2.75,110,1.382,111,1.034,112,1.333,159,0.849,167,2.051,175,1.254,177,2.636,189,3.804,244,1.536,248,2.367,261,1.304,300,1.752,309,1.495,312,1.291,353,1.659,357,3.388,373,2.262,374,2.262,375,2.262,383,2.262,395,5.827,399,2.379,417,1.405,418,2.379,419,3.929,420,2.535,421,2.535,422,2.379,425,3.582,426,2.535,427,2.535,428,2.535,429,1.868,430,2.535,431,2.535,432,2.537,433,2.953,434,2.535,435,1.545,436,2.091,437,1.536,438,2.535,439,2.535,441,1.752,442,1.632,443,3.736,445,2.535,446,2.535,447,2.535,448,2.535,449,2.535,450,2.535,451,2.535,452,2.535,453,2.169,465,2.772,466,2.772,467,1.672,468,2.772,469,1.199,470,0.491,471,3.345,472,4.578,473,4.578,474,2.772,475,2.535,476,2.262,477,2.772,478,3.929,479,2.772,480,2.535,481,2.772,482,1.515,483,1.582,484,1.359,485,2.091,486,2.772,487,2.772,488,2.772,489,2.772,490,2.772,491,3.087,492,2.772,493,2.772,494,2.772,495,2.772,496,2.772,497,2.772,498,2.772]],["t/811",[469,4.06,485,7.083,499,9.388,500,7.661,501,7.083,502,9.388]],["t/813",[10,5.763,119,5.319,177,3.458,216,2.459,300,4.987,312,3.673,355,4.571,356,3.673,359,3.955,410,6.438,412,7.214,415,7.214,469,4.263,485,5.952,501,5.952,503,6.438,504,6.173,505,5.319,506,6.77,507,7.889]],["t/815",[2,3.167,10,2.696,23,1.164,35,0.864,44,1.736,48,1.253,50,0.675,51,0.898,59,0.939,64,1.001,65,2.048,66,1.068,72,0.776,73,0.946,74,1.482,80,0.773,81,0.704,84,3.768,93,2.381,95,1.339,108,2.035,110,1.473,112,1.678,128,2.857,129,1.61,130,3.574,132,3.149,174,2.017,177,3.048,225,1.278,260,2.888,300,2.333,357,4.108,359,2.889,373,3.012,374,3.012,375,3.012,383,7.852,384,6.167,408,7.947,409,3.375,410,3.012,418,3.167,422,3.167,508,3.691,509,2.432,510,3.375,511,4.945,512,5.27,513,4.703,514,4.945,515,2.785,516,3.375,517,3.691,518,2.619,519,1.829,520,3.375,521,2.619,522,3.691,523,3.012,524,5.763,525,3.691,526,3.691,527,3.691,528,3.691,529,3.375,530,3.691,531,3.691,532,3.691,533,3.691,534,3.691,535,3.691,536,2.696,537,2.619,538,3.691]],["t/817",[12,6.36,13,6.547,14,4.093,20,2.273,21,3.273,100,3.686,174,4.899,484,4.394,485,6.762,539,8.196]],["t/819",[21,3.999,22,6.923,23,2.961,540,8.585]],["t/821",[105,4.173,541,9.735,542,8.902]],["t/823",[13,7.562,32,2.872,33,1.657,34,3.472,35,1.311,37,1.866,50,1.024,51,0.437,59,0.912,60,2.231,61,2.607,72,0.754,81,1.068,107,1.877,108,1.977,110,1.443,132,2.486,147,2.419,148,1.901,150,4.622,174,4.292,183,1.938,185,2.907,190,2.248,193,2.907,194,2.907,364,4.224,388,4.381,543,5.12,544,8.989,545,5.12,546,4.804,547,5.12,548,4.869,549,7.4,550,5.12,551,6.738,552,5.12,553,4.804,554,5.12,555,5.12,556,5.12,557,5.12,558,5.599]],["t/825",[33,2.779,59,1.53,80,1.967,81,1.791,388,7.346,556,8.585]],["t/827",[3,1.154,13,3.223,20,1.119,23,1.392,33,1.306,35,1.033,40,2.612,51,0.951,59,1.077,62,3.786,64,1.792,65,2.348,66,1.277,72,0.89,73,1.13,74,1.772,81,1.26,92,3.223,95,2.396,110,1.214,111,1.645,112,1.284,142,3.048,148,1.498,149,2.907,150,2.597,159,1.351,167,1.547,183,1.527,193,2.291,196,3.786,197,3.452,256,1.942,388,5.169,398,2.187,432,2.445,433,2.845,442,2.597,470,0.781,540,4.034,542,4.034,543,4.034,545,4.034,547,4.034,549,3.6,550,4.034,552,4.034,554,4.034,555,4.034,557,4.034,559,1.578,560,2.075,561,4.411,562,4.453,563,2.48,564,4.411,565,3.389,566,4.411,567,4.411,568,4.411,569,4.411,570,4.411,571,1.47,572,4.034,573,4.411,574,4.411]],["t/829",[16,10.015,20,2.381,100,3.861,575,6.329,576,9.388]],["t/831",[3,2.427,20,2.353,21,3.388,22,5.865,100,3.816,101,5.553,577,8.484]],["t/833",[105,4.173,225,3.37,578,9.735]],["t/835",[3,1.187,32,2.328,33,1.343,34,2.814,35,1.885,37,1.529,50,1.943,53,4.265,106,1.717,107,1.522,108,2.382,109,2.072,110,1.48,112,2.344,130,1.866,132,3.96,147,2.079,167,1.592,174,2.481,185,2.982,190,1.822,216,2.103,248,1.837,250,5.564,253,2.249,346,2.351,394,2.869,435,1.531,509,2.99,519,2.249,544,4.15,579,4.538,580,4.538,581,4.538,582,4.538,583,5.005,584,6.91,585,4.538,586,4.538,587,6.746,588,3.551,589,2.328,590,4.538,591,5.505,592,6.746,593,4.538,594,4.538,595,6.746,596,4.538,597,3.551,598,3.703,599,4.538,600,4.538,601,4.538,602,3.894,603,3.551,604,4.538,605,4.538]],["t/837",[470,1.724,606,5.25,607,5.321]],["t/839",[15,3.254,23,1.122,37,1.063,51,0.951,59,1.129,64,0.965,65,1.99,66,1.03,67,1.919,72,1.058,73,0.912,74,1.429,80,0.745,81,1.068,110,1.57,112,1.63,132,1.58,142,2.458,167,2.428,189,3.793,238,2.129,261,1.673,299,1.69,467,1.299,491,2.399,577,3.254,584,4.805,603,2.784,608,3.558,609,3.558,610,3.558,611,3.254,612,3.558,613,3.558,614,3.558,615,3.558,616,3.558,617,3.558,618,3.558,619,3.558,620,3.558,621,3.558,622,1.625,623,6.924,624,5.6,625,5.121,626,3.558,627,3.558,628,3.053,629,3.053,630,3.558,631,3.558,632,3.558,633,3.558,634,5.976,635,3.558,636,3.558,637,3.558,638,3.558,639,3.254,640,3.558,641,3.558,642,3.558,643,3.558,644,3.558,645,3.558,646,3.558,647,3.558,648,3.558,649,2.784,650,3.558,651,3.558,652,3.558,653,3.558,654,2.525,655,3.558,656,3.558,657,3.558,658,3.558,659,3.053,660,3.254,661,3.558]],["t/841",[20,2.889,49,4.309,50,1.01,55,5.68,147,1.701,185,2.879,261,3.656,317,4.673,371,2.452,394,3.49,442,3.25,470,1.377,483,3.15,519,2.736,603,6.083,611,5.048,622,5.118,628,4.737,629,6.672,649,7.042,662,5.52,663,5.52,664,5.52,665,3.25,666,5.52,667,4.505,668,8.383,669,9.769,670,5.52,671,5.52,672,5.52,673,2.902,674,5.048]],["t/843",[3,1.947,17,7.756,58,5.143,59,1.549,88,2.878,106,2.816,110,1.924,216,2.321,253,3.69,256,3.276,356,3.466,357,6.391,358,5.616,359,3.731,360,6.807,361,5.282,362,5.282,363,5.616,364,5.616,675,6.388,676,7.443]],["t/845",[3,2.267,20,2.198,21,4.094,22,7.087,23,2.734,100,3.565,101,5.188,677,8.667,678,8.667]],["t/847",[53,6.079,59,1.567,679,9.616,680,9.616]],["t/849",[3,2.173,17,3.222,32,2.026,33,1.169,34,2.449,35,0.924,37,1.153,49,4.101,50,1.52,53,3.839,59,1.206,84,1.857,106,1.494,107,1.324,108,3.481,109,1.803,112,2.61,130,3.416,132,1.754,147,1.217,177,2.913,225,1.367,231,1.839,238,3.635,286,2.547,300,4.677,306,3.389,327,1.664,357,6.377,358,2.979,359,4.164,361,4.309,362,2.802,379,4.956,380,3.01,381,4.094,382,1.936,384,2.802,392,2.802,393,1.624,394,2.496,400,5.553,413,2.728,435,2.049,478,5.211,511,3.389,537,4.309,597,3.09,675,5.211,681,3.949,682,2.405,683,3.949,684,3.222,685,3.611,686,3.09,687,7.399,688,2.547,689,3.949,690,4.956,691,5.553,692,3.949,693,3.949,694,2.979,695,3.949]],["t/851",[3,1.692,17,5.279,50,1.789,59,1.054,83,3.808,104,1.151,108,3.061,110,1.593,132,2.873,191,3.4,256,3.816,300,4.089,357,6.497,359,3.243,384,6.152,393,2.66,429,3.537,435,2.925,478,5.551,682,3.94,685,5.916,686,6.784,688,4.173,691,5.916,696,6.469,697,4.557,698,4.881,699,3.691,700,6.469]],["t/853",[3,2.845,18,9.333,20,2.353,145,5.294,701,8.484]],["t/855",[470,1.746,702,2.065]],["t/857",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/859",[3,2.023,20,2.703,23,2.44,50,1.415,51,0.832,64,2.099,66,2.819,73,2.731,74,3.106,356,3.601,435,2.61,559,2.767,704,3.877,705,3.792,706,7.735,707,2.825,708,3.181]],["t/861",[709,9.127]],["t/863",[18,7.438,40,3.428,51,0.875,197,6.782,701,7.926,709,7.926,710,8.667,711,8.667,712,5.375,713,7.926,714,8.667]],["t/865",[19,6.934,20,2.247,81,1.69,95,3.214,150,5.217,240,6.123,688,5.716,712,5.496,715,6.686,716,5.397,717,4.982]],["t/867",[21,3.999,22,6.923,23,2.961,718,8.585]],["t/869",[19,4.922,23,1.304,51,0.964,59,1.025,64,1.122,65,2.236,66,1.197,72,0.557,73,1.059,74,1.66,80,0.866,81,0.789,110,1.399,111,2.839,112,1.831,147,1.274,189,4.451,190,1.66,244,2.292,261,1.944,286,2.667,299,1.964,317,2.147,327,1.743,467,1.51,622,1.888,659,3.548,718,3.781,719,4.135,720,4.135,721,3.548,722,3.12,723,4.135,724,4.135,725,4.135,726,3.781,727,3.781,728,6.962,729,4.135,730,2.857,731,4.135,732,4.135,733,4.135,734,4.135,735,4.135,736,3.235,737,4.135,738,2.173,739,6.29,740,8.508,741,4.135,742,4.135,743,6.29,744,4.135,745,2.26,746,4.135,747,4.135,748,4.135,749,4.135]],["t/871",[3,1.893,19,7.305,40,2.863,50,1.708,51,0.882,59,1.18,73,1.855,74,2.907,80,1.517,81,1.381,106,2.738,107,2.427,109,3.306,110,1.33,365,6.62,606,3.904,726,6.62,727,6.62,728,6.62,750,7.239,751,4.489,752,7.239,753,6.62,754,7.239,755,7.239]],["t/874",[3,1.11,12,3.013,20,1.077,33,1.257,37,1.469,50,0.777,51,0.892,59,1.648,110,1.18,112,1.868,128,2.104,129,3.375,132,1.886,177,3.547,187,2.104,216,1.324,227,1.775,327,2.705,346,3.394,382,3.146,387,2.082,393,1.746,437,2.353,483,2.422,518,3.013,690,3.465,756,4.246,757,3.478,758,2.499,759,3.102,760,3.013,761,3.643,762,3.013,763,4.246,764,3.643,765,4.246,766,2.038,767,2.26,768,3.322,769,4.848,770,2.353,771,3.102,772,2.798,773,3.102,774,2.353,775,2.353,776,4.798,777,2.26,778,2.387,779,3.014,780,4.229,781,3.883,782,4.246,783,4.246,784,2.387]],["t/876",[785,7.125,786,8.303,787,7.125,788,6.776,789,6.497,790,6.497,791,6.776,792,7.593,793,5.249,794,7.125,795,7.125,796,6.497,797,7.593,798,6.776,799,6.497,800,6.497,801,7.125]],["t/878",[50,1.678,757,3.154,758,6.76,785,7.869,802,10.802]],["t/880",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/882",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,804,6.577]],["t/884",[21,3.892,100,3.181,128,3.834,231,3.601,239,3.374,371,3.435,469,3.345,519,3.834,563,4.348,707,2.825,785,6.637,796,6.052,805,4.118,806,7.735,807,4.228,808,4.118,809,3.752,810,4.481,811,4.481,812,4.413,813,4.481,814,7.073]],["t/886",[20,1.711,35,1.579,44,3.172,48,2.29,50,1.234,51,0.886,64,1.83,66,2.581,104,1.586,119,4.547,183,2.335,230,3.272,393,3.666,435,2.276,559,2.413,589,3.46,707,3.255,708,2.774,757,3.066,779,2.627,814,6.168,815,6.745,816,6.745,817,3.343,818,5.788,819,5.788,820,3.638,821,3.738,822,3.381]],["t/888",[20,1.144,33,1.336,35,2.483,37,1.805,44,3.159,51,0.962,104,0.803,107,1.513,119,5.411,167,2.815,177,2.356,183,1.562,187,3.33,190,1.812,220,2.315,225,3.671,227,1.886,230,2.189,382,2.212,417,2.288,454,3.955,455,3.892,589,3.446,622,3.068,776,2.798,779,2.617,817,3.978,818,3.872,819,3.872,820,2.434,821,2.501,822,2.262,823,1.648,824,4.091,825,2.537,826,2.748]],["t/890",[20,2.001,44,3.71,50,1.443,51,0.84,104,1.404,119,5.319,183,2.731,225,2.731,230,3.827,311,4.047,467,2.881,589,4.047,779,3.073,817,3.91,818,6.77,819,6.77,820,4.255,821,4.372,822,3.955,827,3.504]],["t/892",[21,3.097,174,4.636,484,4.158,539,7.756,757,3.546,828,7.756,829,7.278,830,8.481,831,5.471,832,7.756,833,7.756,834,7.756,835,6.399,836,6.018]],["t/894",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/896",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,837,6.577]],["t/898",[21,3.84,100,3.09,128,3.725,231,3.499,239,3.278,371,3.337,469,3.249,519,3.725,563,4.224,707,2.744,757,2.584,758,4.424,805,4,807,4.107,808,4,809,3.645,810,4.354,811,4.354,812,4.287,813,4.354,828,8.743,829,8.205,838,6.872]],["t/900",[35,1.62,48,2.35,50,1.266,51,0.892,64,1.878,66,2.625,104,1.613,177,2.428,393,3.729,435,2.336,469,4.373,559,2.477,707,3.311,708,2.847,757,3.119,777,3.685,838,6.33,839,6.922,840,6.922,841,7.4,842,5.732,843,6.922]],["t/902",[33,1.479,35,2.32,37,1.617,51,0.919,104,0.889,107,1.675,147,2.231,167,2.539,177,2.986,183,1.73,187,3.589,190,2.007,225,3.431,226,4.195,227,2.089,244,4.013,387,2.45,417,2.534,537,3.546,665,4.262,757,2.49,777,4.533,779,2.82,823,1.825,826,3.043,841,5.909,842,5.902,844,4.997,845,4.078,846,2.991,847,6.213,848,3.453,849,3.369,850,2.991,851,4.288,852,4.288,853,4.288,854,4.078,855,3.099,856,3.77]],["t/904",[51,0.919,104,1.477,183,2.874,387,4.071,467,3.032,665,4.888,777,4.42,779,3.234,827,3.688,841,6.776,845,6.776,855,5.15,856,6.265]],["t/906",[50,1.697,177,3.254,346,3.233,824,5.65,857,7.26,858,8.484,859,9.278]],["t/908",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/910",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,860,6.014]],["t/912",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,787,8.408,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,861,7.143]],["t/914",[35,1.664,44,3.343,48,2.414,50,1.3,51,0.899,64,1.929,66,2.671,104,1.642,183,2.461,230,3.448,393,3.794,435,2.399,559,2.543,707,3.369,708,2.924,757,3.173,779,2.769,821,3.94,822,3.563,861,6.501,862,7.109,863,7.109,864,6.1]],["t/916",[33,1.461,35,2.486,37,0.937,44,3.374,50,1.313,51,0.951,104,0.878,107,2.406,112,1.437,130,2.029,167,1.731,177,2.516,183,2.484,187,3.556,216,1.538,220,2.532,225,3.676,227,2.063,230,2.394,307,6.413,382,2.419,417,2.502,776,3.06,779,2.795,787,6.157,821,2.735,822,2.474,823,1.802,826,3.005,864,4.235,865,2.905,866,6.561,867,4.027,868,4.935,869,4.935,870,4.935,871,6.561]],["t/918",[44,3.824,51,0.851,104,1.447,112,2.368,183,3.478,230,3.945,307,5.619,467,2.97,779,3.168,821,4.507,822,4.077,827,3.612,864,6.979,866,7.437,871,7.437,872,8.133]],["t/920",[21,2.62,44,4.364,50,1.312,132,3.186,174,3.921,393,2.95,622,3.276,757,2.467,758,4.223,788,5.854,791,5.854,796,5.613,798,5.854,857,5.613,873,7.173,874,7.173,875,7.173,876,6.56,877,5.412,878,7.173,879,7.173,880,7.173,881,8.828,882,7.173,883,5.09,884,7.173,885,5.613,886,6.156,887,4.449]],["t/922",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/924",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,888,6.577]],["t/926",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,788,6.374,800,6.112,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,889,7.143]],["t/928",[35,1.695,44,3.404,48,2.458,50,1.324,51,0.882,64,1.964,66,2.703,104,1.661,183,2.506,393,3.839,435,2.442,559,2.59,707,3.409,708,2.977,757,3.211,779,2.82,889,6.62,890,7.239,891,7.239,892,7.239,893,6.294]],["t/930",[12,3.591,33,1.498,35,2.332,37,1.387,39,2.38,40,2.001,44,4.033,51,0.95,104,1.526,107,2.45,130,2.081,131,2.694,167,1.775,177,1.775,183,2.53,187,3.622,225,3.448,226,4.234,227,2.116,230,2.455,240,3.497,417,2.566,757,1.741,779,2.846,788,4.13,820,2.73,823,1.848,826,3.082,893,5.782,894,4.628,895,3.819,896,3.96,897,3.697,898,4.343,899,5.061,900,4.628,901,4.628,902,3.96,903,4.628]],["t/932",[35,1.865,44,3.747,51,0.883,104,1.765,183,3.434,226,4.617,230,3.865,467,2.91,779,3.104,820,4.298,827,4.406,893,5.373,894,7.287,901,7.287,903,7.287]],["t/934",[50,1.738,757,3.268,758,5.593,789,7.434,904,9.501]],["t/936",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/938",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,905,6.577]],["t/940",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,789,7.667,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,906,7.143]],["t/942",[35,1.552,48,2.252,50,1.213,51,0.9,64,1.799,66,2.552,104,1.568,230,4.276,387,3.251,393,3.625,435,2.238,454,3.904,455,3.842,559,2.373,707,3.219,708,2.727,757,3.405,789,5.189,817,3.287,855,4.113,893,4.471,906,6.065,907,6.632,908,6.632,909,6.065,910,5.691,911,5.691,912,2.945]],["t/944",[33,1.84,37,2.04,51,0.9,104,1.106,167,2.18,179,4.968,226,4.889,227,3.528,454,4.968,455,4.889,784,6.041,789,8.408,817,3.081,823,2.269,893,5.689,910,5.333,911,5.333,913,8.769,914,3.659,915,4.689]],["t/946",[35,1.793,51,0.897,104,1.722,230,4.694,436,5.779,454,4.509,455,4.438,467,2.797,817,3.797,820,4.131,827,4.298,855,4.75,893,5.164,909,7.005,910,6.573,911,6.573,912,3.402,916,7.005]],["t/948",[21,2.62,50,1.882,51,0.56,54,5.613,101,4.293,104,1.83,233,4.369,311,4.761,484,3.517,583,3.596,757,2.467,758,4.223,769,5.217,790,5.613,842,7.122,917,6.56,918,6.56,919,4.957,920,4.033,921,6.56,922,6.56,923,5.854]],["t/950",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/952",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,924,6.577]],["t/954",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,790,7.667,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,925,7.143]],["t/956",[50,1.519,51,0.859,64,2.253,66,2.946,393,3.415,435,2.802,559,2.971,707,3.032,708,3.415,757,3.5,790,6.497,925,7.593,926,8.303]],["t/958",[33,1.093,35,2.034,37,1.233,39,1.01,48,0.729,50,0.675,51,0.921,59,0.602,104,0.657,107,1.238,110,0.678,111,1.376,131,1.965,147,0.662,167,0.753,174,2.018,177,1.703,183,1.278,187,3.514,190,0.862,191,1.129,216,1.151,219,1.843,220,1.102,223,1.484,225,2.899,226,1.244,231,1,239,0.937,244,2.046,312,3.023,317,1.115,346,2.008,356,1.719,359,1.076,417,1.089,435,2.561,469,0.928,470,0.654,483,1.225,537,1.524,548,2.289,565,1.102,649,2.888,665,2.173,668,3.167,682,1.308,688,3.131,699,1.225,777,1.965,779,1.438,790,6.27,808,1.143,820,1.158,823,1.348,826,1.308,842,4.104,846,1.285,847,3.167,848,1.484,849,1.448,850,1.285,851,1.843,852,1.843,853,1.843,854,1.752,855,1.332,856,1.62,865,5.664,885,1.68,893,1.448,919,2.55,920,2.075,927,3.012,928,2.147,929,1.68,930,2.147,931,1.752,932,2.147,933,2.147,934,2.147,935,1.752,936,1.752,937,1.963,938,2.147,939,4.44,940,4.348,941,6.492,942,2.785,943,2.248,944,3.691,945,3.691,946,3.691,947,3.375,948,3.691,949,3.691,950,5.763,951,4.21,952,3.691,953,2.619,954,3.691,955,3.375,956,3.691,957,3.691,958,3.691,959,3.375,960,1.963,961,4.44,962,1.68,963,3.691,964,2.173,965,1.484,966,2.147,967,2.147,968,1.62,969,1.569,970,2.147,971,1.963,972,1.963]],["t/960",[51,0.784,104,1.447,183,2.815,467,2.97,779,3.168,820,4.386,827,3.612,842,6.351,855,5.044,856,6.136,865,4.788,939,7.437,942,7.581,960,7.437,961,7.437,973,8.133]],["t/962",[50,1.717,757,3.229,758,5.527,791,8.937,974,9.388]],["t/964",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/966",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,975,6.577]],["t/968",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,791,7.996,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,976,7.143]],["t/970",[35,1.759,48,2.551,50,1.375,51,0.892,64,2.039,66,2.768,104,1.701,393,3.932,435,2.535,559,2.689,665,4.424,707,3.492,708,3.09,757,3.288,976,6.872,977,7.514,978,7.514,979,6.872]],["t/972",[33,1.997,37,1.896,51,0.903,83,5.248,104,1.2,226,3.908,227,2.82,314,3.11,317,3.502,454,5.878,455,5.785,665,5.248,784,3.792,823,2.463,842,4.264,980,4.108,981,8.152,982,5.504,983,6.168,984,5.635,985,6.168,986,4.927,987,4.547]],["t/974",[51,0.919,104,1.477,112,2.417,230,4.028,231,3.866,454,4.888,455,4.811,467,3.032,665,4.888,827,3.688,979,7.593,981,7.593,984,5.249]],["t/976",[50,1.738,757,3.268,758,5.593,792,8.688,988,9.501]],["t/978",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/980",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,989,6.577]],["t/982",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,793,6.194,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,990,6.703]],["t/984",[35,1.759,48,2.551,50,1.375,51,0.892,64,2.039,66,2.768,104,1.701,393,3.932,435,2.535,559,2.689,622,3.432,707,3.492,708,3.09,757,3.288,991,7.514,992,7.514,993,7.514,994,7.514]],["t/986",[33,2.067,35,2.135,37,1.326,51,0.943,104,1.243,107,2.341,177,2.449,183,2.417,187,4.521,225,3.157,622,4.165,779,3.552,823,2.55,826,4.253,865,4.111,980,4.253,995,6.983,996,5.269,997,6.983,998,6.983,999,6.386]],["t/988",[51,0.849,104,1.651,467,3.388,622,4.237,827,4.12,999,8.484]],["t/990",[757,3.348,758,5.731,793,6.154]],["t/992",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/994",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1000,6.577]],["t/996",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,793,6.194,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,990,6.703]],["t/998",[35,1.726,48,2.504,50,1.349,51,0.908,64,2.001,66,2.735,104,1.681,230,3.577,393,3.885,435,2.488,559,2.638,707,3.45,708,3.033,757,3.249,821,4.087,822,3.696,990,6.328,1001,6.018,1002,7.374]],["t/1000",[33,2.408,35,1.904,51,0.93,104,1.447,177,2.852,220,4.172,227,3.4,230,3.945,382,3.987,417,4.123,776,5.044,821,4.507,822,4.077,823,2.97]],["t/1002",[51,0.892,104,1.613,230,4.397,467,3.31,821,5.024,822,4.544,827,4.026]],["t/1004",[21,3.388,50,1.697,757,3.191,758,6.403,794,7.962,1003,9.278]],["t/1006",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1008",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1004,6.577]],["t/1010",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,794,8.408,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1005,7.143]],["t/1012",[20,2.084,35,1.4,37,1.135,44,3.865,48,2.791,50,1.504,51,0.892,64,1.622,66,2.38,104,1.671,119,5.541,183,2.845,393,3.862,435,2.018,559,2.139,589,3.068,707,3.43,708,2.459,757,2.827,779,3.202,784,3.362,817,2.964,820,4.433,1005,5.468,1006,5.98,1007,8.219,1008,3.52,1009,5.131,1010,3.94,1011,5.98]],["t/1014",[20,1.138,33,1.328,35,2.479,37,1.956,44,3.146,50,1.224,51,0.962,83,2.641,104,0.798,107,1.504,119,4.51,167,2.805,177,1.574,183,1.553,187,3.316,190,1.802,225,3.665,346,1.563,454,3.938,455,3.876,589,3.432,622,3.055,779,2.606,784,2.522,817,3.965,820,2.42,823,1.638,824,4.871,825,2.522,826,2.732,846,2.685,865,2.641,1008,2.641,1009,3.85,1010,2.957]],["t/1016",[20,2.106,44,3.905,51,0.859,104,1.477,119,5.598,183,2.874,467,3.032,589,4.26,779,3.234,817,4.116,820,4.478,827,3.688,1008,4.888,1009,7.125,1010,5.472]],["t/1018",[50,1.717,757,3.229,758,5.527,795,8.056,1012,9.388,1013,9.388]],["t/1020",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1022",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1014,5.367]],["t/1024",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,795,8.408,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1015,7.143]],["t/1026",[20,1.451,35,1.339,37,1.086,44,2.69,48,2.706,50,1.458,51,0.908,64,1.552,66,2.308,104,1.632,183,2.759,230,3.866,393,3.773,435,1.93,559,2.047,589,2.934,707,3.35,708,2.352,757,2.741,779,3.105,784,3.216,817,2.835,820,3.085,821,4.417,822,3.995,865,3.367,1008,3.367,1010,3.769,1015,5.231,1016,5.72,1017,7.971,1018,4.909,1019,4.476,1020,3.69,1021,5.72]],["t/1028",[20,0.923,33,1.078,35,2.486,37,1.934,44,2.681,50,1.043,51,0.964,83,2.143,104,1.25,107,1.22,130,1.497,167,2.789,177,1.999,183,1.26,187,2.826,190,1.462,220,1.867,225,3.676,227,1.521,230,1.765,233,3.472,346,1.268,382,1.784,417,1.845,454,3.356,455,3.303,589,2.924,622,2.603,757,1.252,776,2.257,779,2.22,784,3.205,817,3.483,820,1.963,821,2.017,822,1.824,823,1.329,824,4.279,825,2.046,826,2.217,846,2.179,865,4.136,902,2.848,1008,2.143,1010,2.398,1018,3.123,1019,2.848,1020,2.348,1022,2.97]],["t/1030",[20,1.981,44,3.673,51,0.876,104,1.39,183,2.704,230,3.789,467,2.852,589,4.007,779,3.043,817,3.872,820,4.213,821,4.329,822,3.915,827,3.469,865,4.598,1008,4.598,1010,5.147,1018,6.703,1019,6.112,1020,5.038]],["t/1032",[21,3.349,50,1.678,69,7.175,70,7.483,757,3.154,758,5.398,796,7.175,1023,9.17]],["t/1034",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1036",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1014,5.367]],["t/1038",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,796,7.667,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1024,7.143]],["t/1040",[20,1.244,35,1.148,37,0.931,44,2.306,48,2.86,50,1.541,51,0.923,64,1.331,66,2.068,67,2.645,69,3.837,104,1.647,183,2.916,230,4.086,393,3.806,435,1.655,559,1.755,589,2.516,707,3.38,708,2.017,757,2.457,779,3.281,784,4.015,817,2.431,820,2.645,821,4.669,822,4.223,824,5.636,865,2.887,1008,2.887,1010,3.232,1024,4.485,1025,4.904,1026,8.424,1027,4.208,1028,7.142,1029,4.904]],["t/1042",[20,0.977,33,1.141,35,2.479,37,1.856,44,2.802,50,1.333,51,0.961,83,3.508,104,0.685,107,1.292,112,1.122,167,2.555,177,2.09,183,1.334,187,2.953,190,1.547,220,1.976,225,3.665,227,1.61,230,1.869,346,2.076,382,1.889,417,1.953,454,3.508,455,3.452,589,3.057,622,2.721,776,2.389,779,2.321,784,2.166,817,3.611,820,2.078,821,2.135,822,1.931,823,1.407,824,5.399,825,2.166,826,2.346,846,3.566,865,4.289,1008,2.268,1010,3.926,1014,3.144,1027,3.306]],["t/1044",[20,2.021,44,3.747,51,0.883,104,1.418,183,2.758,230,3.865,467,2.91,589,4.088,779,3.104,817,3.95,820,4.298,821,4.416,822,3.994,827,3.539,865,4.691,1008,4.691,1010,5.251,1027,6.838]],["t/1046",[50,1.717,177,3.293,346,3.271,824,5.717,857,7.346,1030,9.388]],["t/1048",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1050",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,860,6.014]],["t/1052",[21,3.806,100,3.033,128,3.655,174,4.031,187,3.655,231,3.433,239,3.217,371,3.275,469,3.189,484,3.615,519,3.655,563,5.311,707,2.693,797,8.639,805,3.926,807,4.031,808,3.926,809,3.577,810,4.272,811,4.272,812,4.207,813,4.272,885,5.77,1031,6.743,1032,6.743]],["t/1054",[35,1.726,40,2.916,48,2.504,50,1.349,51,0.887,64,2.001,66,2.735,104,1.681,393,3.885,435,2.488,559,2.638,707,3.45,708,3.033,757,3.249,824,4.491,1032,6.743,1033,7.374,1034,7.374,1035,6.328,1036,6.328]],["t/1056",[33,2.183,35,2.211,37,1.4,40,2.916,44,3.468,51,0.934,104,1.312,112,2.147,167,2.586,225,3.608,429,3.008,823,2.693,824,4.491,915,5.564,968,7.128,1035,6.328,1036,6.328,1037,6.328]],["t/1058",[40,3.585,51,0.838,104,1.613,467,3.31,824,5.521,827,4.026,1035,7.779,1036,7.779]],["t/1060",[50,1.738,757,3.268,758,5.593,798,7.753,1038,9.501]],["t/1062",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1064",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1039,6.014]],["t/1066",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,798,7.996,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1040,7.143]],["t/1068",[35,1.635,48,2.371,50,1.277,51,0.894,64,1.895,66,2.64,104,1.623,183,2.417,230,3.387,393,3.751,435,2.356,559,2.499,707,3.33,708,2.872,757,3.137,779,2.72,820,3.766,821,3.87,822,3.5,824,4.253,865,4.111,1040,6.386,1041,6.983,1042,6.983,1043,6.983]],["t/1070",[20,0.898,33,1.049,35,2.468,37,1.864,44,2.624,50,1.021,51,0.961,83,2.085,104,1.228,107,1.188,112,1.031,130,1.457,167,2.421,177,1.957,183,1.226,187,2.766,190,1.422,220,1.817,225,3.65,227,1.481,230,1.718,311,1.817,325,2.587,346,1.234,382,1.737,417,1.796,454,3.285,455,3.233,589,2.863,622,2.548,757,1.218,776,2.197,779,2.173,784,4.404,817,3.422,820,1.91,821,1.963,822,1.775,823,1.293,824,5.19,825,1.991,826,2.157,831,2.285,846,3.34,865,4.064,902,2.771,1008,2.085,1010,2.334,1019,2.771,1020,2.285,1022,2.89,1039,5.103,1044,3.239]],["t/1072",[20,1.906,35,1.759,44,3.534,51,0.892,104,1.701,183,2.601,230,3.645,467,2.744,589,3.855,779,2.927,817,3.725,820,4.053,821,4.165,822,3.767,827,4.246,865,4.424,1008,4.424,1010,4.952,1019,5.88,1020,4.847,1044,6.872]],["t/1074",[21,3.428,50,1.717,757,3.229,758,5.527,799,7.346,1045,9.388]],["t/1076",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1078",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1046,6.577]],["t/1080",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,799,7.667,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1047,7.143]],["t/1082",[35,0.924,44,1.857,48,1.341,50,0.722,51,0.942,64,1.071,66,1.758,100,1.624,104,1.08,110,0.726,111,1.473,112,1.768,167,1.385,183,2.561,189,2.697,225,1.367,314,3.412,317,4.313,387,1.936,393,3.894,394,2.496,435,2.497,454,2.325,455,2.288,519,1.957,559,1.413,589,2.026,707,3.033,757,2.089,779,2.882,799,6.5,817,1.957,822,1.979,913,3.222,984,2.496,987,2.662,1008,2.325,1047,3.611,1048,3.949,1049,8.966,1050,3.389,1051,4.752,1052,3.389,1053,3.611,1054,3.949,1055,3.389,1056,3.949,1057,4.956,1058,6.073,1059,3.949,1060,3.389,1061,3.949,1062,3.949,1063,3.949,1064,6.073,1065,3.09,1066,3.09,1067,3.389,1068,2.802,1069,3.389,1070,6.073]],["t/1084",[33,0.86,35,2.457,37,1.845,44,2.841,50,0.531,51,0.961,104,1.075,107,0.974,112,0.846,119,1.958,167,1.668,177,1.019,181,1.657,183,1.005,187,2.358,190,2.427,216,1.483,225,3.683,240,2.007,314,2.786,317,1.508,380,1.44,387,1.424,454,3.557,455,3.501,470,0.514,482,1.588,505,1.958,513,2.37,588,2.273,589,3.1,622,2.759,779,1.853,784,3.397,799,2.273,803,1.657,817,3.463,822,1.456,823,1.061,824,2.897,825,1.633,826,1.769,849,1.958,850,1.738,980,1.769,984,3.007,987,1.958,1008,1.71,1050,2.492,1051,2.273,1052,2.492,1055,4.082,1057,2.37,1071,2.122,1072,2.273,1073,2.904,1074,1.958,1075,3.376,1076,2.904,1077,2.904,1078,2.904,1079,2.904,1080,2.904,1081,2.904,1082,5.525,1083,2.904,1084,2.122,1085,4.35,1086,4.35,1087,2.656,1088,2.656,1089,1.958,1090,2.37,1091,2.904]],["t/1086",[37,1.326,44,3.284,51,0.943,104,1.243,112,2.033,183,2.417,314,3.22,387,3.424,454,4.111,455,4.046,467,2.55,589,3.582,779,2.72,817,3.461,822,3.5,827,3.101,1008,4.111,1050,5.993,1051,5.464,1052,5.993,1053,6.386,1055,5.993,1057,5.699,1082,6.386,1085,6.386,1086,6.386]],["t/1088",[50,1.697,757,3.191,758,5.462,793,5.865,858,8.484,1092,7.571,1093,9.278]],["t/1090",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1092",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1094,6.577]],["t/1094",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1095,9.798,1096,7.143]],["t/1096",[35,1.455,48,2.11,50,1.137,51,0.913,64,1.686,66,2.443,104,1.501,177,2.96,393,3.47,435,2.097,559,2.224,707,3.082,708,2.556,751,3.854,757,2.902,849,4.19,850,5.051,912,2.76,1089,4.19,1096,5.683,1097,6.215,1098,6.215,1099,5.333,1100,5.683,1101,5.683,1102,5.683,1103,5.683,1104,5.333,1105,4.41,1106,5.072,1107,5.683,1108,5.333,1109,5.683,1110,4.863]],["t/1098",[33,2.163,51,0.885,104,1.3,177,3.293,751,4.531,823,2.668,849,4.926,850,5.621,959,9.49,1089,4.926,1099,8.059,1101,6.681,1102,6.681,1103,6.681,1104,8.059,1106,5.962,1107,6.681,1108,8.059,1110,5.717]],["t/1100",[51,0.867,104,1.509,467,3.097,827,3.767,912,4.578,1099,7.278,1100,7.756,1104,7.278,1105,6.018,1108,7.278,1109,7.756,1111,8.481]],["t/1102",[21,2.644,50,1.89,54,5.664,101,4.333,104,1.838,233,4.409,311,4.789,484,3.549,583,3.629,757,2.49,758,4.261,769,5.248,800,5.664,842,7.142,917,6.62,918,6.62,919,5.002,920,4.07,921,6.62,922,6.62,923,5.907]],["t/1104",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1106",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1112,6.577]],["t/1108",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,800,7.667,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1113,7.143]],["t/1110",[35,1.649,48,2.392,50,1.289,51,0.874,64,1.912,66,2.656,104,1.632,183,2.439,314,3.249,393,3.772,435,2.377,559,2.521,665,5.4,707,3.35,708,2.898,757,3.155,779,2.744,893,6.184,927,7.486,1113,6.443,1114,7.045,1115,7.045]],["t/1112",[33,2.014,35,2.099,37,1.818,51,0.938,104,1.443,107,1.539,130,1.888,147,2.097,167,1.61,177,2.843,183,1.589,187,3.373,190,1.844,225,3.104,226,3.942,227,1.919,244,3.771,387,2.251,417,2.328,537,3.258,665,4.006,757,1.579,779,2.65,800,3.592,823,2.485,826,2.796,842,6.052,845,3.746,846,2.748,847,7.694,848,3.172,849,3.095,850,2.748,851,3.94,852,3.94,853,3.94,854,3.746,855,2.847,856,3.464,893,5.466,927,5.553,971,4.198,972,4.198]],["t/1114",[35,2.185,51,0.903,104,1.661,174,3.957,183,2.506,213,4.669,387,3.549,467,2.644,665,5.496,779,2.82,827,4.146,842,5.901,845,5.907,855,4.489,856,5.462,893,6.294,927,7.618,1116,7.239,1117,6.62]],["t/1116",[50,1.717,757,3.229,758,5.527,801,9.398,1118,9.388]],["t/1118",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1120",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1014,5.367]],["t/1122",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,801,8.408,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1119,6.112]],["t/1124",[35,1.527,44,3.067,48,2.215,50,1.193,51,0.896,64,1.77,66,2.524,104,1.551,183,2.258,230,4.228,393,3.585,435,2.201,559,2.334,707,3.184,708,2.682,757,2.998,779,2.541,820,3.518,821,3.615,822,3.269,865,3.84,912,2.897,1119,5.104,1120,5.323,1121,6.522,1122,5.964,1123,5.597,1124,6.821,1125,5.597,1126,5.597]],["t/1126",[12,2.965,20,1.06,33,1.237,35,2.355,37,1.204,44,3.603,51,0.957,104,1.128,107,1.401,167,2.224,177,2.224,183,1.446,187,3.143,190,2.546,216,2.389,220,2.144,225,3.587,227,2.651,230,2.027,382,2.049,417,3.215,776,2.591,779,2.47,784,4.809,820,2.254,821,2.316,822,2.094,823,1.526,826,2.545,849,5.166,850,3.795,865,4.511,895,3.153,912,1.856,964,2.46,1123,5.441,1124,4.961,1125,5.441,1126,5.441,1127,4.178,1128,4.178,1129,3.821,1130,4.178,1131,3.821]],["t/1128",[44,3.673,51,0.876,104,1.39,183,2.704,230,4.753,467,2.852,779,3.043,820,4.213,821,4.329,822,3.915,827,3.469,865,4.598,912,3.469,1122,7.143,1123,6.703,1124,7.667,1125,6.703,1126,6.703]],["t/1130",[20,1.74,50,1.649,51,0.704,64,1.862,95,2.489,100,2.822,114,4.24,129,2.993,132,3.048,175,3.104,240,4.741,356,3.195,366,4.869,367,5.369,560,4.24,673,3.607,705,3.364,1132,6.862,1133,3.858,1134,6.862,1135,6.862,1136,6.275,1137,5.6,1138,6.862,1139,3.52,1140,5.177,1141,5.177,1142,4.869,1143,5.369,1144,5.177,1145,5.013,1146,5.177,1147,5.6]],["t/1132",[21,4.133,22,6.691,23,2.795,174,4.844,807,4.844,1148,8.104,1149,8.104,1150,8.862]],["t/1134",[23,0.9,35,1.617,37,1.558,39,1.341,50,1.264,51,0.946,59,0.764,64,0.774,65,1.666,66,1.357,72,0.384,73,0.731,80,0.982,81,0.894,100,1.173,108,2.106,110,1.097,114,4.411,115,2.447,129,2.045,130,1.173,159,0.874,167,1.644,175,1.29,183,1.622,216,0.889,225,2.392,250,1.971,253,1.414,261,1.341,278,3.667,299,1.355,309,1.538,312,1.328,337,2.182,346,0.994,389,2.024,416,1.679,429,1.912,435,1.581,470,1.057,482,2.562,536,2.083,560,4.411,583,1.43,673,2.464,920,1.603,951,2.083,1139,3.061,1151,1.603,1152,2.447,1153,2.963,1154,2.852,1155,2.852,1156,2.152,1157,2.447,1158,2.152,1159,2.852,1160,2.852,1161,2.447,1162,2.327,1163,1.803,1164,2.152,1165,2.852,1166,3.354,1167,4.022,1168,2.852,1169,2.447,1170,2.852,1171,5.213,1172,2.852,1173,1.398,1174,2.852,1175,1.679,1176,2.852,1177,2.152,1178,4.687,1179,2.852,1180,2.852,1181,2.852,1182,2.852,1183,2.852,1184,2.957,1185,2.327,1186,1.559,1187,2.608,1188,2.852,1189,2.963,1190,2.715,1191,2.715,1192,1.923,1193,1.879]],["t/1136",[115,6.979,470,1.44,482,4.445,560,3.824,673,4.275,764,6.979,766,4.822,1139,4.172,1140,6.136,1141,6.136,1142,5.771,1143,6.363,1144,6.136,1145,5.941,1146,6.136,1147,6.637,1151,4.572,1194,6.979]],["t/1138",[21,2.846,23,2.459,49,1.946,50,1.014,51,0.953,64,2.302,65,3.478,66,2.257,72,1.05,73,1.997,100,1.444,114,1.651,129,1.531,131,4.517,261,3.666,483,3.916,536,2.565,560,4.602,673,4.46,762,2.491,1139,3.999,1162,2.865,1163,2.219,1175,2.067,1186,4.261,1195,2.649,1196,2.865,1197,5.541,1198,4.916,1199,3.21,1200,6.689,1201,3.21,1202,3.51,1203,5.371,1204,5.541,1205,3.21,1206,3.21,1207,3.51,1208,3.51,1209,3.21,1210,3.21,1211,3.51,1212,3.51,1213,5.541,1214,3.21,1215,3.51,1216,3.51]],["t/1140",[39,3.747,397,5.661,417,4.04,482,4.356,560,3.747,697,4.189,883,5.654,1074,5.373,1145,5.821,1217,9.879,1218,7.287,1219,7.969,1220,7.969,1221,7.969,1222,5.821,1223,6.012,1224,7.969,1225,6.012]],["t/1142",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1140,6.612,1198,5.077,1226,8.764,1227,5.653,1228,6.055]],["t/1144",[23,1.361,51,0.951,59,1.059,61,2.009,64,1.171,65,2.777,66,1.249,72,0.581,73,1.106,80,1.361,81,1.239,110,1.194,148,1.465,159,1.322,175,1.952,261,2.029,299,2.05,312,2.009,337,3.025,429,1.76,435,1.456,470,0.764,548,4.029,560,4.386,673,3.415,738,3.415,1139,3.333,1140,4.902,1163,2.728,1164,3.256,1166,3.653,1173,2.116,1175,2.54,1184,3.22,1186,2.359,1189,4.107,1190,3.764,1191,5.038,1192,2.909,1193,4.281,1229,4.315,1230,3.521,1231,5.544,1232,3.521,1233,4.315,1234,4.315,1235,3.376,1236,4.315,1237,2.783,1238,2.5,1239,4.315,1240,4.315,1241,2.628,1242,3.062]],["t/1146",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1141,6.612,1198,5.077,1227,5.653,1228,6.055,1243,8.764]],["t/1148",[23,1.399,51,0.938,59,1.081,61,2.066,64,1.204,65,2.824,66,2.3,72,0.597,73,1.137,80,1.39,81,1.265,110,1.219,148,1.506,159,1.359,175,2.007,261,2.086,299,2.107,312,2.066,337,3.088,429,1.81,435,1.497,470,0.786,560,4.438,673,3.487,738,3.487,1139,3.403,1141,5.005,1163,2.804,1164,3.347,1166,3.729,1173,2.175,1175,2.612,1184,3.288,1186,2.425,1189,4.193,1190,3.843,1191,5.108,1192,2.991,1193,4.371,1230,3.62,1231,5.637,1232,3.62,1235,3.471,1237,2.861,1238,2.57,1241,2.702,1242,3.148,1244,4.436,1245,4.436,1246,4.436,1247,4.436,1248,4.436,1249,4.436]],["t/1150",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1142,6.219,1198,5.077,1227,5.653,1228,6.055,1250,8.764]],["t/1152",[23,1.361,51,0.948,59,1.059,61,3.025,64,1.171,65,2.309,66,1.249,72,0.581,73,1.106,80,1.361,81,1.239,110,1.194,159,1.322,175,1.952,261,2.029,299,2.05,312,2.009,337,3.025,429,1.76,435,1.456,470,0.764,548,4.029,560,4.386,673,3.415,738,3.415,1139,4.009,1142,4.61,1163,2.728,1164,3.256,1166,3.653,1173,2.116,1175,2.54,1184,3.22,1186,2.359,1189,4.107,1190,3.764,1191,4.527,1192,2.909,1193,4.281,1231,4.61,1237,2.783,1238,3.764,1241,2.628,1242,3.062,1251,3.946,1252,4.315,1253,4.315,1254,4.315,1255,3.376,1256,4.315,1257,3.376,1258,4.315,1259,3.521,1260,3.946,1261,3.703]],["t/1154",[23,1.465,39,2.184,50,1.493,51,0.926,59,0.757,64,1.26,65,2.439,66,1.345,72,0.625,73,1.19,80,0.973,81,0.886,108,2.423,110,0.854,114,4.24,132,2.063,159,1.423,175,2.101,213,2.996,261,2.184,299,2.206,337,2.163,397,2.65,429,1.895,435,1.567,467,1.696,514,3.986,559,1.662,560,4.736,673,4.74,682,2.829,982,3.79,1142,3.296,1166,2.611,1175,2.734,1186,2.539,1190,2.691,1260,4.247,1262,5.601,1263,3.79,1264,4.645,1265,6.863,1266,4.645,1267,3.79,1268,6.863,1269,4.645,1270,4.645,1271,4.645,1272,4.645,1273,4.645,1274,4.645,1275,2.936,1276,4.645,1277,3.634,1278,4.645,1279,4.645,1280,4.645,1281,3.986]],["t/1156",[20,2.121,37,0.92,48,1.645,51,0.927,61,4.284,72,0.652,73,1.241,88,1.873,108,2.499,110,1.301,129,2.113,175,2.191,272,5.777,429,1.976,435,1.634,560,4.327,673,2.546,912,2.151,1139,5.244,1142,3.437,1184,3.509,1189,3.062,1190,2.806,1237,4.566,1251,4.43,1261,4.157,1281,4.157,1282,4.844,1283,4.844,1284,4.844,1285,4.844,1286,3.79,1287,6.473,1288,3.004,1289,4.844,1290,4.844,1291,4.43,1292,4.844,1293,6.074,1294,6.473,1295,7.079,1296,6.473,1297,7.079,1298,4.844,1299,3.539,1300,4.844]],["t/1158",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1143,6.857,1198,5.077,1227,5.653,1228,6.055,1301,8.764]],["t/1160",[23,1.392,51,0.951,59,1.077,61,3.076,64,1.197,65,2.348,66,1.277,72,0.594,73,1.13,80,1.384,81,1.26,110,1.214,159,1.351,175,1.996,261,2.075,299,2.096,312,2.054,337,3.076,429,1.8,435,1.488,470,0.781,560,4.427,673,3.472,738,3.472,1139,4.062,1163,2.789,1164,3.328,1166,3.714,1173,2.163,1175,2.597,1184,3.274,1186,2.411,1189,4.176,1190,3.827,1191,3.827,1192,2.974,1193,4.353,1237,2.845,1238,3.827,1241,2.687,1242,3.13,1255,3.452,1257,3.452,1259,3.6,1302,4.411,1303,3.786,1304,4.034,1305,3.786,1306,4.411,1307,4.411,1308,4.411,1309,4.411,1310,4.411,1311,6.605]],["t/1162",[21,2.484,27,3.77,50,1.64,114,4.715,167,2.386,187,3.372,274,3.719,312,3.168,482,3.719,484,3.335,560,3.199,583,3.41,606,3.669,673,3.576,767,3.622,914,4.005,943,4.143,969,4.97,1139,3.49,1173,3.335,1175,4.005,1198,3.942,1227,4.388,1228,4.701,1312,6.221,1313,5.133,1314,4.388,1315,6.803,1316,6.803,1317,4.97,1318,5.838,1319,6.803,1320,5.838,1321,6.803,1322,4.701]],["t/1164",[23,1.392,51,0.945,59,1.077,61,3.076,64,1.197,65,2.348,66,1.277,72,0.594,73,1.13,80,1.384,81,1.26,110,1.214,114,3.106,159,1.351,175,1.996,261,2.075,299,2.096,312,2.054,337,3.076,429,1.8,435,1.488,470,0.781,560,4.427,673,3.472,738,3.472,1139,4.83,1157,3.786,1161,3.786,1163,2.789,1164,3.328,1166,3.714,1173,2.163,1175,2.597,1184,3.274,1186,2.411,1189,4.176,1190,3.827,1191,3.827,1192,2.974,1193,4.353,1237,2.845,1238,3.827,1241,2.687,1242,3.13,1255,3.452,1257,3.452,1259,3.6,1303,3.786,1305,3.786,1323,3.6,1324,3.786,1325,4.411,1326,4.411,1327,4.411]],["t/1166",[23,1.729,51,0.933,59,0.893,64,1.487,65,2.75,66,1.587,72,0.738,73,1.405,80,1.149,81,1.046,110,1.008,114,3.638,159,1.679,192,3.536,261,2.578,299,2.604,337,2.553,429,2.237,467,2.002,560,4.216,673,5.399,738,2.882,1139,2.812,1166,3.082,1175,3.227,1184,2.717,1186,2.997,1190,3.176,1191,3.176,1200,4.704,1230,4.474,1232,4.474,1262,4.474,1275,3.465,1277,4.29,1314,4.99,1323,4.474,1324,4.704,1328,5.013,1329,5.013,1330,4.798,1331,5.013,1332,4.704]],["t/1168",[23,1.617,37,0.973,51,0.929,59,0.836,64,1.391,65,2.621,66,1.484,72,0.69,73,1.313,80,1.074,81,0.978,108,1.81,110,1.356,159,1.571,192,3.307,261,2.411,299,2.435,309,2.765,429,2.092,467,1.872,560,4.063,673,4.541,738,2.695,1139,3.784,1166,2.882,1175,3.018,1184,2.541,1190,2.97,1191,2.97,1200,4.399,1262,4.184,1275,3.241,1277,4.011,1291,4.688,1299,3.745,1313,3.868,1314,3.307,1323,4.184,1328,4.688,1329,4.688,1330,3.179,1331,4.688,1332,4.399,1333,5.127,1334,8.639,1335,5.127,1336,4.688,1337,5.127,1338,5.127,1339,4.184,1340,5.127,1341,4.688,1342,5.127]],["t/1170",[21,2.463,49,5.534,50,1.234,64,2.882,114,4.192,128,4.419,129,2.942,132,2.996,133,5.278,179,3.971,216,2.103,224,4.786,470,1.195,553,5.788,559,2.413,943,4.108,1071,4.927,1139,4.573,1195,5.089,1263,5.504,1299,7.294,1313,5.089,1343,6.168,1344,5.788,1345,6.168,1346,6.745,1347,5.504,1348,4.927,1349,6.745]],["t/1172",[108,3.78,114,5.744,253,3.872,380,3.872,416,4.598,435,2.636,441,4.938,920,4.391,1139,4.007,1171,5.894,1177,5.894,1350,6.374,1351,7.143]],["t/1174",[21,3.201,39,2.475,50,0.963,51,0.411,66,1.524,100,3.091,114,5.298,130,2.165,133,4.118,167,1.846,189,2.337,380,2.609,393,3.605,416,3.098,435,1.776,509,3.468,519,2.609,881,4.517,951,3.845,965,3.637,980,3.205,1133,2.959,1158,6.615,1167,4.517,1173,2.58,1227,3.395,1343,4.813,1352,5.263,1353,4.813,1354,5.263,1355,5.263,1356,5.263,1357,4.813,1358,5.263,1359,5.263,1360,5.263,1361,5.263,1362,4.517,1363,5.263,1364,4.118,1365,5.263,1366,6.133,1367,7.482,1368,4.813,1369,5.263,1370,5.263,1371,6.133,1372,4.517,1373,5.263,1374,4.813,1375,3.003,1376,4.118]],["t/1176",[37,1.259,50,1.213,84,3.119,114,5.42,129,2.893,167,3.473,225,2.296,256,4.358,380,5.598,398,3.287,416,3.904,429,2.706,565,3.402,943,4.039,1074,5.943,1367,6.897,1377,6.632,1378,5.004,1379,6.632,1380,5.691,1381,5.412,1382,6.632,1383,6.632,1384,4.192]],["t/1178",[21,2.507,27,1.564,33,2.032,35,0.66,37,1.55,48,0.958,50,1.494,51,0.895,64,1.607,84,2.185,95,1.023,108,2.882,109,1.288,110,0.854,114,3.839,130,1.16,151,1.399,167,0.99,179,1.661,185,1.045,189,1.253,190,1.133,194,2.412,224,4.871,238,1.689,250,1.949,346,1.619,355,1.635,389,2.002,398,1.399,435,0.952,441,5.456,467,1.696,470,0.5,509,1.859,515,2.129,549,2.302,591,3.791,697,1.483,699,1.61,712,2.881,730,1.949,762,2.002,823,1.696,831,1.82,887,1.75,920,1.586,1139,3.038,1166,1.586,1173,1.383,1313,5.179,1336,4.248,1385,2.821,1386,2.821,1387,1.82,1388,2.821,1389,4.645,1390,2.821,1391,2.821,1392,2.821,1393,2.421,1394,2.821,1395,4.248,1396,2.821,1397,2.58,1398,2.821,1399,2.58,1400,3.986,1401,2.58,1402,2.821,1403,5.921,1404,3.505,1405,4.645,1406,2.821,1407,4.248,1408,4.248,1409,2.821,1410,6.94,1411,2.421,1412,2.421,1413,2.58,1414,2.58,1415,4.645,1416,4.645,1417,5.921,1418,2.421,1419,2.58,1420,5.921,1421,4.645,1422,6.864,1423,2.58,1424,2.58,1425,2.58,1426,2.821,1427,2.821,1428,2.58,1429,2.58,1430,2.821,1431,4.248,1432,2.821,1433,2.821,1434,2.821,1435,2.821]],["t/1180",[21,1.576,33,1.277,37,0.819,50,1.793,51,0.895,114,5.035,167,1.513,189,1.916,241,3.703,244,3.601,253,2.139,256,3.827,311,3.333,346,1.504,393,1.775,429,3.547,435,1.456,467,1.576,470,0.764,698,3.256,707,1.576,777,2.297,850,6.087,920,5.51,1133,2.426,1227,2.783,1231,4.61,1332,3.703,1367,5.084,1387,4.191,1436,7.951,1437,3.376,1438,3.062,1439,3.946,1440,4.315,1441,7.145,1442,4.315,1443,3.946,1444,3.946,1445,3.376,1446,4.315,1447,4.315,1448,2.676,1449,4.315,1450,4.315,1451,3.946,1452,4.315,1453,4.315,1454,3.946,1455,6.497,1456,3.703]],["t/1182",[21,2.241,27,1.646,32,1.524,33,1.434,37,1.165,50,1.295,51,0.718,93,1.916,100,1.221,112,0.865,114,4.603,120,2.424,129,1.296,131,1.581,132,1.319,145,1.694,167,3.648,183,1.028,187,2.401,190,1.193,192,1.916,219,2.548,225,1.028,257,2.424,309,1.602,345,2.324,346,2.915,384,2.107,386,2.424,387,1.456,389,2.107,413,2.052,435,1.002,470,0.526,471,2.17,482,3.354,518,2.107,559,1.063,565,1.524,602,4.157,603,2.324,698,5.341,730,2.052,760,2.107,762,2.107,772,1.957,777,1.581,823,1.769,831,1.916,895,2.241,920,1.67,943,1.809,969,2.17,1072,2.324,1139,1.524,1169,4.157,1173,3.008,1184,2.401,1267,3.954,1393,2.548,1411,5.265,1457,4.845,1458,6.136,1459,2.324,1460,2.97,1461,2.716,1462,2.548,1463,2.424,1464,2.241,1465,4.845,1466,6.136,1467,4.845,1468,2.97,1469,2.716,1470,2.716,1471,6.136,1472,2.424,1473,2.241,1474,2.97,1475,2.241,1476,2.716,1477,2.97,1478,2.548,1479,2.716,1480,3.539,1481,2.97,1482,4.93,1483,2.716,1484,2.97,1485,2.97,1486,9.164,1487,7.079,1488,5.265,1489,2.548,1490,2.548,1491,4.157,1492,2.716,1493,2.97,1494,2.97,1495,2.716,1496,2.716,1497,2.548]],["t/1184",[21,1.101,33,1.835,37,0.572,50,0.897,51,0.815,61,2.284,64,0.818,65,1.072,72,0.406,83,1.775,84,4.176,107,1.011,108,3.268,110,1.139,111,1.829,114,3.697,132,1.339,167,2.174,183,1.044,190,1.211,194,2.547,216,1.529,231,2.887,244,3.436,250,2.083,256,2.729,309,1.626,346,1.051,389,2.139,413,3.389,429,2.529,436,5.931,470,0.534,475,2.757,548,1.87,551,5.321,559,1.755,697,2.578,698,3.701,738,4.865,766,1.447,768,2.359,772,3.232,781,2.757,805,1.605,809,2.379,823,2.264,831,1.945,850,3.711,855,1.87,915,2.275,980,1.836,1153,1.906,1231,2.139,1267,2.461,1367,2.359,1437,3.838,1438,3.48,1463,2.461,1470,2.757,1480,3.583,1488,5.321,1490,2.587,1498,3.015,1499,5.46,1500,5.06,1501,3.015,1502,3.015,1503,2.359,1504,3.015,1505,3.015,1506,6.2,1507,4.003,1508,3.015,1509,3.015,1510,3.015,1511,3.015,1512,2.757,1513,3.015,1514,2.757,1515,3.015,1516,5.589,1517,7.861,1518,2.757,1519,2.359,1520,3.015,1521,2.757,1522,3.015]],["t/1186",[33,2.433,50,0.86,51,0.882,64,1.275,108,2.902,110,1.859,114,2.21,132,2.087,167,1.648,257,3.835,366,3.335,401,2.723,484,2.304,503,5.65,509,3.097,559,1.682,697,5.497,766,2.256,809,2.28,887,2.915,915,5.224,1313,3.546,1350,5.65,1378,3.546,1516,5.417,1519,3.678,1523,4.7,1524,4.7,1525,4.7,1526,4.7,1527,10.731,1528,10.731,1529,8.22,1530,4.7,1531,4.7,1532,4.7,1533,4.7,1534,4.7,1535,4.033,1536,4.7,1537,4.7,1538,3.032,1539,4.7,1540,4.7,1541,4.7]],["t/1188",[33,1.132,35,0.524,37,0.951,39,3.13,50,1.617,51,0.825,59,0.365,61,1.781,64,0.607,65,1.359,66,0.648,72,0.515,88,1.479,108,1.35,112,1.938,114,5.264,130,3.359,148,2.26,151,1.896,167,3.099,189,2.224,194,1.162,216,0.698,220,1.148,248,0.906,253,1.896,255,2.047,256,1.684,257,1.827,309,1.207,346,0.78,380,2.483,398,1.109,416,2.252,417,1.135,429,2.716,435,0.755,443,1.827,467,1.829,470,1.049,482,2.091,548,1.388,559,0.801,565,1.148,583,1.122,603,1.751,682,1.363,704,1.122,712,2.372,771,1.635,831,1.444,836,1.588,883,1.588,887,1.388,920,1.258,943,1.363,964,1.318,980,1.363,1139,2.569,1151,1.258,1171,1.689,1173,1.097,1177,1.689,1235,6.063,1237,1.444,1238,2.216,1294,2.047,1351,6.632,1357,3.498,1362,1.921,1371,1.827,1374,2.047,1375,1.277,1376,2.993,1381,1.827,1387,1.444,1395,2.047,1408,5.419,1451,2.047,1454,3.498,1480,4.329,1482,2.418,1486,3.498,1491,5.085,1492,2.047,1495,2.047,1516,1.751,1542,2.047,1543,1.921,1544,2.238,1545,2.238,1546,2.238,1547,1.751,1548,1.588,1549,2.238,1550,1.827,1551,2.238,1552,2.238,1553,2.047,1554,2.238,1555,2.238,1556,2.238,1557,3.121,1558,2.238,1559,2.238,1560,2.238,1561,2.238,1562,7.253,1563,2.238,1564,1.827,1565,2.238,1566,2.238,1567,2.047,1568,1.689,1569,1.689,1570,2.238,1571,2.047,1572,2.238,1573,2.238,1574,2.238,1575,2.238,1576,2.238,1577,2.238,1578,2.238,1579,2.238,1580,2.238,1581,2.238,1582,2.047,1583,2.047,1584,2.238,1585,2.238]],["t/1190",[4,1.031,21,0.874,22,0.833,27,0.73,33,1.833,35,0.771,37,1.315,48,1.788,50,1.324,51,0.888,59,0.215,64,0.357,65,0.468,72,0.322,84,4.594,88,1.566,93,1.544,94,1.13,95,2.511,106,0.498,107,1.93,108,3.571,110,1.429,111,1.511,112,0.383,114,4.044,128,2.008,130,0.985,133,1.031,167,0.462,174,0.72,179,1.41,181,1.366,183,1.822,189,2.088,190,0.962,191,0.692,192,2.613,220,0.676,231,0.613,240,2.274,241,1.13,249,1.366,250,1.654,253,3.432,256,1.449,346,0.834,380,1.187,388,1.031,389,3.336,393,0.542,394,0.833,410,1.075,417,0.668,429,2.526,435,2.536,470,0.424,484,0.646,559,0.857,591,1.075,602,1.13,606,1.291,634,3.098,682,0.802,684,1.075,697,1.259,699,0.752,721,2.055,730,0.91,759,0.962,773,2.405,809,0.639,823,1.923,831,2.123,867,1.075,912,1.799,920,2.277,964,0.775,1020,1.544,1074,0.888,1166,0.741,1173,0.646,1267,1.075,1313,0.994,1348,6.52,1364,1.031,1378,1.807,1384,1.514,1393,1.13,1418,1.13,1423,2.19,1424,2.19,1425,2.19,1428,2.19,1459,2.576,1461,1.205,1480,1.749,1488,4.518,1490,1.13,1491,5.314,1516,1.031,1553,1.205,1557,1.075,1567,1.205,1568,0.994,1569,0.994,1586,4.034,1587,1.317,1588,2.394,1589,4.051,1590,4.051,1591,2.394,1592,2.394,1593,2.394,1594,2.394,1595,2.394,1596,2.394,1597,8.768,1598,1.317,1599,1.954,1600,1.13,1601,1.317,1602,4.051,1603,2.394,1604,3.292,1605,3.01,1606,1.317,1607,2.19,1608,2.394,1609,1.317,1610,1.317,1611,1.205,1612,3.292,1613,1.317,1614,1.205,1615,2.19,1616,1.205,1617,1.205,1618,0.994,1619,1.205,1620,1.317,1621,1.317,1622,1.031,1623,1.317,1624,3.292,1625,2.394,1626,1.317,1627,0.935,1628,1.317,1629,1.317,1630,1.317,1631,1.205,1632,1.317]],["t/1192",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1144,6.612,1198,5.077,1227,5.653,1228,6.055,1633,8.764]],["t/1194",[23,1.376,51,0.943,59,1.068,61,3.05,64,1.184,65,2.328,66,1.263,72,0.588,73,1.118,80,1.373,81,1.25,110,1.204,159,1.337,175,1.974,261,2.052,299,2.073,312,2.031,337,3.05,429,1.78,435,1.472,470,0.773,548,4.063,560,4.406,673,3.443,738,3.443,1139,4.035,1144,4.942,1163,2.758,1166,3.683,1173,2.139,1175,2.568,1184,3.247,1186,2.385,1189,4.141,1190,3.795,1191,4.557,1192,2.941,1193,4.317,1231,4.648,1237,2.814,1238,3.795,1241,2.657,1242,3.096,1255,3.414,1257,3.414,1303,3.744,1305,3.744,1634,4.363,1635,4.363,1636,4.363,1637,4.363,1638,4.363,1639,4.363,1640,4.363,1641,4.363]],["t/1196",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1145,6.402,1198,5.077,1227,5.653,1228,6.055,1642,8.764]],["t/1198",[23,1.297,39,1.934,51,0.946,56,2.71,59,1.021,61,2.917,64,1.116,65,2.227,66,1.191,72,0.554,73,1.054,80,1.313,81,1.195,110,1.151,114,1.934,159,1.26,175,1.861,261,1.934,299,1.954,337,2.917,429,1.678,435,1.388,484,2.017,548,2.551,560,4.294,583,2.062,673,3.293,738,3.293,1139,3.893,1145,5.544,1163,3.96,1166,3.522,1173,2.017,1175,2.421,1184,3.106,1186,2.248,1189,3.96,1190,3.63,1191,3.63,1192,2.773,1193,4.129,1230,3.357,1232,3.357,1237,2.653,1238,3.63,1241,3.816,1255,3.218,1257,3.218,1259,3.357,1304,3.761,1314,2.653,1384,2.6,1643,4.113,1644,4.113,1645,4.113,1646,4.113,1647,4.113,1648,4.113,1649,4.113,1650,3.53,1651,4.113,1652,2.462,1653,4.113]],["t/1200",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1146,6.612,1198,5.077,1227,5.653,1228,6.055,1654,8.764]],["t/1202",[23,1.339,51,0.943,59,1.046,61,1.977,64,1.152,65,2.75,66,1.229,72,0.572,73,1.088,80,1.345,81,1.224,110,1.18,148,1.442,159,1.301,175,1.921,261,1.997,299,2.017,312,1.977,337,2.988,429,1.732,435,1.433,470,0.752,548,4.798,560,4.355,673,3.374,738,3.374,1139,3.292,1146,4.842,1163,4.057,1166,3.608,1173,2.082,1175,2.499,1184,3.181,1186,2.321,1189,4.057,1190,3.718,1191,4.996,1192,2.862,1193,4.229,1231,3.013,1235,3.322,1237,2.739,1238,2.46,1241,3.908,1242,3.013,1275,2.684,1655,4.246,1656,4.246,1657,4.246,1658,4.246,1659,5.869,1660,4.246,1661,4.246,1662,4.246,1663,4.246,1664,4.246,1665,4.246]],["t/1204",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1147,7.152,1198,5.077,1227,5.653,1228,6.055,1666,8.764]],["t/1206",[23,1.318,51,0.955,59,1.033,61,1.945,64,1.134,65,2.723,66,1.21,72,0.563,73,1.071,80,1.328,81,1.209,110,1.165,148,1.419,159,1.28,175,1.89,261,1.965,299,1.985,312,1.945,337,2.952,429,1.705,435,1.41,470,0.74,548,2.591,560,4.324,673,3.333,738,3.333,1139,3.253,1147,5.174,1163,4.008,1166,3.565,1173,2.049,1175,2.46,1184,3.143,1186,2.284,1189,4.008,1190,3.674,1191,4.956,1192,2.817,1193,4.178,1231,2.965,1235,3.269,1237,2.695,1238,2.421,1241,3.861,1242,2.965,1275,2.641,1659,5.798,1667,4.178,1668,4.178,1669,4.178,1670,4.178,1671,4.178,1672,4.178,1673,4.178,1674,4.178,1675,4.178,1676,4.178]],["t/1208",[20,2.511,21,2.422,55,4.845,73,1.699,101,3.969,180,3.577,185,2.456,258,6.065,356,4.104,470,1.175,560,3.119,705,3.251,715,5.004,759,4.845,793,4.192,857,5.189,877,5.004,914,3.904,951,4.845,1198,3.842,1203,5.189,1330,4.113,1464,5.004,1538,4.278,1677,6.065,1678,6.632,1679,6.632,1680,5.691,1681,5.691,1682,6.632,1683,6.632,1684,6.632,1685,5.189,1686,5.691,1687,5.004,1688,6.632,1689,6.632,1690,6.632]],["t/1210",[21,4.075,23,2.705,50,1.568,174,4.686,371,4.609,809,4.159,1084,6.263,1148,7.84,1149,7.84,1691,6.469,1692,6.263]],["t/1212",[20,0.849,27,2.957,35,1.249,37,0.635,48,1.136,50,1.516,51,0.914,59,1.084,72,0.718,73,0.858,80,0.701,81,1.581,88,3.205,93,2.159,108,1.182,110,1.395,111,1.248,147,1.644,192,2.159,216,1.043,238,3.982,239,2.902,240,2.313,254,2.445,346,3.078,359,3.334,394,2.116,435,1.129,470,0.945,485,2.525,565,1.717,606,1.805,607,1.829,697,3.989,699,1.91,766,1.606,887,2.076,897,2.445,914,3.141,920,4.267,1106,2.731,1110,4.175,1153,2.116,1173,3.261,1186,1.829,1456,2.872,1478,2.872,1693,5.697,1694,3.347,1695,3.061,1696,5.335,1697,2.619,1698,3.347,1699,3.347,1700,3.061,1701,3.347,1702,5.335,1703,5.335,1704,6.652,1705,3.347,1706,4.291,1707,2.872,1708,3.347,1709,3.347,1710,3.347,1711,3.347,1712,3.347,1713,3.347,1714,4.578,1715,3.347,1716,3.347,1717,2.872,1718,3.347,1719,3.347,1720,3.347,1721,3.061,1722,3.347,1723,3.061,1724,3.061]],["t/1214",[20,1.74,21,2.506,23,2.165,51,0.867,59,1.118,64,1.862,65,3.204,66,1.987,72,0.924,73,2.31,74,2.756,80,1.438,81,1.309,110,1.261,159,2.102,312,3.195,336,4.107,337,4.198,353,4.107,435,2.315,483,3.915,1153,4.338,1163,4.338,1184,3.401,1725,6.275,1726,6.862,1727,6.862,1728,5.177,1729,4.626,1730,4.741]],["t/1216",[20,0.894,37,0.669,40,3.573,51,0.94,53,3.515,59,1.473,73,0.903,80,1.637,81,1.49,88,1.363,95,2.497,108,2.43,110,1.563,147,2.408,151,2.756,159,1.08,161,3.225,179,2.076,180,1.902,185,2.059,225,1.221,233,2.147,238,2.11,248,3.657,317,1.831,325,2.576,336,3.328,337,3.205,346,1.229,380,2.756,432,3.082,482,1.927,509,2.324,559,1.262,607,1.927,622,1.61,665,2.076,698,2.66,702,0.739,777,1.877,883,2.502,1133,1.982,1151,1.982,1156,4.195,1184,3.412,1320,3.026,1375,3.172,1550,2.878,1652,2.11,1731,2.878,1732,5.56,1733,3.225,1734,4.771,1735,3.515,1736,3.526,1737,3.026,1738,2.878,1739,3.526,1740,3.526,1741,3.225,1742,3.526,1743,3.526,1744,4.771,1745,3.526,1746,3.526,1747,3.225,1748,3.225,1749,2.878,1750,3.526]],["t/1218",[37,1.655,39,5.137,50,1.193,51,0.509,73,1.671,74,2.619,88,2.522,104,1.161,108,3.078,167,2.288,194,3.387,300,6.207,345,5.104,353,3.904,536,4.765,559,2.334,702,1.367,887,4.045,1314,6.334,1400,5.597,1652,3.904,1714,5.597,1751,5.623,1752,7.114,1753,5.964,1754,5.964,1755,6.522,1756,5.964,1757,6.522,1758,6.522,1759,6.522]],["t/1220",[20,2.581,21,3.716,93,5.356,180,5.488,394,5.249,606,4.478,766,3.985,1203,7.963,1475,6.265,1538,5.356,1760,8.303,1761,8.303,1762,8.303]],["t/1223",[3,0.937,33,0.614,35,2.006,37,0.68,39,4.474,40,1.87,48,0.704,50,1.163,51,0.919,60,1.884,72,0.279,73,0.918,80,0.435,88,1.385,95,1.299,104,0.637,106,1.355,107,2.131,108,1.265,109,0.947,110,0.381,111,2.94,112,1.043,130,2.614,147,1.104,148,0.704,167,1.256,181,3.212,183,1.949,185,0.768,187,1.028,190,0.833,191,1.09,194,1.077,213,1.338,216,2.325,225,2.966,227,1.498,230,1.738,300,4.018,327,0.874,330,3.268,346,2.747,382,1.017,387,1.017,391,1.78,470,0.838,500,1.692,559,0.742,565,1.064,571,0.691,583,1.04,622,0.947,702,0.435,738,2.486,751,2.222,762,1.472,766,0.995,767,1.104,822,1.796,823,1.308,887,1.286,964,1.221,1020,1.338,1090,1.692,1133,1.166,1151,1.166,1152,1.78,1153,1.311,1241,1.263,1263,1.692,1314,4.81,1384,1.311,1400,1.78,1473,1.565,1482,1.311,1652,1.241,1691,2.703,1728,3.568,1737,1.78,1751,5.084,1752,6.992,1753,1.897,1754,1.897,1756,5.148,1763,2.803,1764,2.074,1765,1.338,1766,2.074,1767,2.074,1768,2.074,1769,2.265,1770,2.074,1771,2.074,1772,2.074,1773,2.074,1774,2.074,1775,1.897,1776,2.311,1777,1.897,1778,4.729,1779,1.78,1780,1.623,1781,2.074,1782,2.074,1783,3.582,1784,2.074,1785,1.897,1786,2.074,1787,1.897,1788,1.472,1789,2.074,1790,2.074,1791,3.582,1792,2.074,1793,3.356,1794,1.78,1795,2.923,1796,1.897,1797,2.074,1798,1.897]],["t/1225",[3,0.669,37,1.813,40,1.693,48,0.868,50,0.783,51,0.875,59,1.346,64,0.694,72,1.316,73,2.871,80,1.629,81,1.575,88,4.359,95,2.342,100,1.052,110,1.518,129,1.115,147,2.215,148,0.868,156,1.868,180,2.309,185,2.045,232,1.929,248,2.235,286,4.637,309,1.379,346,0.891,432,1.417,470,0.758,482,1.398,565,1.312,702,0.897,883,3.038,943,1.557,996,1.929,1092,3.493,1133,2.407,1151,1.437,1156,1.929,1288,2.655,1317,1.868,1330,2.655,1375,4.102,1735,2.706,1765,6.302,1769,3.49,1799,2.194,1800,2.194,1801,2.194,1802,2.194,1803,2.194,1804,2.194,1805,2.194,1806,2.194,1807,2.194,1808,2.194,1809,2.194,1810,2.194,1811,2.194,1812,3.673,1813,2.194,1814,2.194,1815,2.087,1816,2.194,1817,2.194,1818,1.814,1819,3.673,1820,3.493,1821,2.194,1822,2.087,1823,2.194]],["t/1227",[20,1.696,37,1.27,51,0.915,59,1.09,65,2.377,72,1.194,73,2.712,74,3.56,80,1.401,81,1.276,110,1.229,233,4.073,272,5.458,298,5.739,299,3.177,435,2.257,470,1.184,702,1.401,1765,4.314,1815,5.458,1824,6.936,1825,6.688,1826,8.864,1827,6.688,1828,5.739,1829,6.688]],["t/1229",[32,2.852,37,1.055,40,3.09,51,0.913,65,1.976,66,1.609,72,1.052,73,2.645,74,3.935,191,2.922,470,0.985,519,4.857,520,7.145,521,3.945,702,1.165,766,2.668,777,2.959,1330,3.448,1376,4.35,1378,5.895,1824,7.668,1830,9.034,1831,5.084,1832,5.559,1833,5.559,1834,5.559,1835,5.559,1836,5.559,1837,5.559,1838,5.559,1839,5.559,1840,5.559,1841,3.273,1842,5.559,1843,5.559]],["t/1231",[37,1.11,51,0.936,65,2.078,72,1.09,73,2.378,74,2.348,88,4.462,101,3.5,180,4.365,248,2.367,299,2.778,370,4.04,435,1.973,470,1.036,702,1.225,823,2.135,1765,3.771,1844,5.592,1845,5.847,1846,4.772,1847,4.772,1848,4.772,1849,4.772,1850,4.772,1851,4.772,1852,4.772,1853,5.018,1854,5.018,1855,5.018,1856,5.018,1857,5.018,1858,5.018]],["t/1233",[37,1.628,51,0.89,65,2.262,72,1.155,73,2.485,74,2.556,108,2.247,130,2.618,167,3.402,248,2.576,299,3.024,469,2.752,470,1.127,702,1.334,1765,5.532,1769,4.023,1859,7.842,1860,6.365,1861,6.365,1862,6.365,1863,5.82,1864,6.365,1865,6.365,1866,5.82,1867,6.365,1868,6.365,1869,6.365,1870,6.365,1871,6.365,1872,6.365,1873,6.365,1874,6.365]],["t/1235",[51,0.919,65,2.749,72,1.311,73,2.731,74,3.106,110,1.422,470,1.37,622,4.867,702,1.621,715,5.836,912,3.435,1707,6.637,1875,7.735,1876,7.735]],["t/1237",[12,4.18,59,1.519,72,1.255,73,2.794,110,1.083,220,3.022,226,3.413,227,2.462,382,2.888,548,3.653,622,3.715,628,7.996,629,7.996,654,4.18,773,4.303,780,4.446,784,5.238,809,2.857,825,3.312,896,4.609,1129,5.387,1384,3.724,1877,8.521,1878,5.891,1879,5.891,1880,8.135,1881,5.891,1882,5.891,1883,5.891,1884,5.891,1885,5.891,1886,5.891,1887,5.055,1888,5.891,1889,5.891,1890,5.891]],["t/1239",[72,1.193,73,2.712,88,3.426,95,3.214,110,1.629,702,1.857,895,6.686,1288,5.496,1891,8.862,1892,8.862]],["t/1241",[40,3.392,51,0.97,59,0.825,65,1.799,67,2.73,72,0.984,73,2.197,74,2.032,80,1.06,81,0.965,88,3.316,95,3.406,110,1.343,112,1.473,248,2.048,256,2.228,274,2.766,353,3.029,467,1.848,470,0.896,697,2.66,702,1.06,716,5.223,1238,2.932,1288,3.139,1404,5.514,1735,3.199,1765,3.264,1893,5.514,1894,5.061,1895,5.061,1896,4.628,1897,5.061,1898,7.307,1899,4.13]],["t/1243",[37,0.666,40,3.87,51,0.963,59,0.572,65,1.248,67,1.893,72,0.746,73,1.759,74,1.41,80,0.736,81,0.67,88,2.142,95,3.653,110,0.645,112,1.022,159,1.075,167,3.532,248,1.421,256,1.545,353,2.101,433,3.574,435,1.184,467,1.282,470,0.622,584,3.012,697,1.845,702,0.736,716,5.959,738,1.845,776,4.257,1238,3.977,1600,3.012,1765,2.264,1820,2.865,1896,3.21,1899,8.855,1900,3.51,1901,3.51,1902,3.51,1903,3.51,1904,3.51,1905,3.51,1906,3.51,1907,3.51,1908,3.51,1909,3.51,1910,3.51,1911,3.51,1912,3.51,1913,3.012,1914,3.51,1915,5.541,1916,2.747,1917,3.51]],["t/1245",[37,1.171,40,2.438,51,0.944,59,1.005,65,2.191,67,3.326,72,1.13,73,2.445,74,2.476,80,1.292,81,1.176,88,2.384,95,3.044,110,1.133,112,1.795,159,1.889,167,2.944,248,3.397,256,2.714,353,3.691,467,2.252,470,1.092,697,3.241,702,1.292,716,3.755,738,3.241,768,4.825,1899,5.032,1913,5.291,1918,6.166,1919,6.166,1920,6.166]],["t/1247",[3,1.541,40,2.329,51,0.937,59,0.96,65,2.094,67,3.177,72,1.255,73,2.387,74,2.366,81,1.124,95,2.95,107,1.975,110,1.083,111,2.197,167,2.066,248,3.771,256,2.593,271,1.88,336,3.526,337,2.743,378,4.609,470,1.043,697,3.096,702,1.234,716,3.587,738,3.096,768,4.609,1288,3.653,1735,3.724,1899,4.807,1913,5.055,1921,5.891,1922,5.891,1923,5.055,1924,3.882,1925,5.387,1926,5.891]],["t/1249",[51,0.81,72,1.155,73,2.859,104,2.063,110,1.576,131,4.564,346,2.987,702,1.796]],["t/1251",[48,2.88,50,1.552,72,1.142,73,2.641,88,4.294,110,1.559,147,2.613,622,3.873,702,1.777,1751,5.471,1927,7.278,1928,8.481]],["t/1253",[37,1.483,48,2.652,51,0.765,59,1.273,72,1.052,73,2.51,92,5.706,147,2.407,185,2.892,470,1.383,589,4.007,702,1.637,769,4.391,817,3.872,825,5.508,1075,5.543,1751,5.038,1929,7.811,1930,7.811,1931,7.811]],["t/1255",[35,1.986,37,1.189,39,2.946,40,2.477,50,1.76,51,0.805,59,1.021,72,0.844,73,2.174,104,1.509,132,2.782,147,1.93,177,2.197,185,2.319,470,1.109,559,2.241,702,1.312,769,3.522,825,3.522,984,3.96,987,5.72,1065,4.901,1066,4.901,1068,6.02,1075,4.445,1751,4.04,1932,7.758,1933,7.28,1934,7.28,1935,5.728,1936,6.264,1937,5.728,1938,5.728,1939,5.112,1940,5.112]],["t/1257",[35,2.16,37,1.35,50,1.688,51,0.846,59,1.159,72,0.957,73,2.364,104,1.642,132,3.157,470,1.259,559,2.543,702,1.489,825,3.997,987,6.22,1065,5.562,1066,5.562,1068,5.044,1935,6.501,1939,7.529,1940,8.359,1941,7.109,1942,7.109]],["t/1259",[35,1.895,37,1.11,39,2.75,40,2.312,50,1.698,51,0.782,59,0.953,72,0.787,73,2.073,104,1.44,132,2.597,147,1.802,177,2.051,185,2.165,470,1.036,559,2.092,702,1.225,769,3.287,825,3.287,984,3.696,987,5.456,1065,4.575,1066,4.575,1068,5.743,1075,4.149,1445,4.575,1751,3.771,1933,6.945,1934,6.945,1937,7.401,1938,5.347,1939,4.772,1940,4.772,1943,8.093,1944,7.401,1945,5.847,1946,5.847,1947,5.847,1948,5.347,1949,5.347,1950,5.347,1951,5.347]],["t/1261",[35,1.914,37,1.127,39,2.791,40,2.347,50,1.711,51,0.787,59,0.967,72,0.799,73,2.095,104,1.455,132,2.636,147,1.829,177,2.081,185,2.198,470,1.051,559,2.123,702,1.243,769,3.337,825,3.337,984,3.752,987,5.513,1065,4.644,1066,4.644,1068,5.802,1075,4.211,1751,3.828,1933,5.093,1934,5.093,1939,6.673,1940,7.634,1944,5.427,1948,5.427,1949,5.427,1950,5.427,1951,8.555,1952,8.177,1953,5.935,1954,5.935,1955,5.935]],["t/1263",[48,2.392,50,1.678,51,0.716,59,1.148,67,4.947,72,0.949,73,2.35,95,3.327,181,4.02,429,2.874,470,1.248,702,1.476,825,3.961,987,4.75,1060,6.046,1069,6.046,1956,9.173,1957,7.045,1958,7.045,1959,9.173,1960,7.045,1961,5.316,1962,7.045,1963,7.045,1964,7.045,1965,7.045,1966,7.045]],["t/1265",[35,1.075,39,2.159,48,2.31,50,0.84,51,0.93,59,1.109,61,2.138,67,3.67,72,0.618,73,1.743,80,0.962,81,0.876,95,2.94,110,0.844,112,1.336,148,2.31,159,1.406,179,2.703,190,1.844,191,2.413,226,3.942,248,2.754,278,3.592,336,2.748,337,3.168,429,1.873,435,2.296,469,3.506,470,0.813,697,2.413,699,2.619,702,0.962,912,2.039,964,2.703,1020,2.961,1184,2.276,1516,3.592,1519,3.592,1569,5.134,1692,3.354,1967,4.591,1968,4.591,1969,4.591,1970,4.591,1971,4.591,1972,6.804,1973,4.591,1974,5.839,1975,4.591,1976,6.804,1977,3.746,1978,4.591,1979,4.591,1980,4.198,1981,4.591,1982,3.94,1983,4.591,1984,4.198,1985,4.591,1986,4.591]],["t/1267",[32,4.546,72,1.193,73,2.712,95,3.214,110,1.629,702,1.857,1987,7.727]],["t/1270",[14,5.085,37,2.114,51,0.493,72,1.499,95,3.094,147,1.946,185,3.577,271,3.554,314,2.911,317,5.91,702,1.323,1330,3.916,1988,6.314,1989,6.314,1990,6.314,1991,6.314,1992,6.314,1993,6.314]],["t/1272",[14,3.915,95,4.047,147,2.642,887,5.317,1680,7.357,1681,7.357,1994,8.573,1995,7.84,1996,8.573,1997,8.573,1998,8.573,1999,7.357]],["t/1274",[51,0.947,61,3.499,112,2.188,189,4.67,194,3.901,416,5.628,707,2.744,1564,6.132,1977,6.132,1995,6.872,2000,7.514,2001,7.514,2002,7.514,2003,7.514,2004,7.514,2005,7.514]],["t/1276",[14,5.306,37,1.849,51,0.673,72,1.402,148,2.179,177,2.25,216,2.688,327,4.389,346,2.236,370,5.958,470,1.136,491,7.02,702,1.344,769,3.607,2006,6.416,2007,6.416,2008,6.416,2009,6.416,2010,6.416,2011,6.416,2012,6.416,2013,5.868,2014,6.416,2015,5.868]],["t/1278",[14,5.136,37,1.722,51,0.808,72,1.324,101,3.351,108,1.977,148,3.079,177,2.754,309,4.235,327,4.143,346,1.951,370,7.153,470,0.992,491,6.627,702,1.173,730,3.868,769,3.148,943,3.41,1133,3.148,2013,5.12,2015,5.12,2016,5.599,2017,5.599,2018,5.599,2019,5.599,2020,5.599,2021,5.599,2022,5.599,2023,5.599,2024,9.068,2025,5.12]],["t/1280",[14,4.739,51,0.81,72,1.155,148,2.911,309,4.624,470,1.518,702,1.796,780,4.686,784,4.82,2026,10.377,2027,8.573]],["t/1282",[14,5.312,37,1.513,51,0.774,72,1.336,84,3.747,148,2.706,216,2.484,327,3.359,346,2.776,470,1.411,702,1.67,2028,7.969,2029,7.969,2030,7.969,2031,7.969]],["t/1284",[14,5.391,37,1.812,50,1.128,51,0.655,72,1.443,101,3.691,177,2.163,216,2.617,327,4.022,346,3.569,370,4.261,401,3.573,470,1.092,491,4.157,702,1.292,717,5.759,1133,3.467,2025,5.639,2032,6.166,2033,6.166,2034,6.166,2035,6.166,2036,6.166,2037,6.166,2038,6.166]],["t/1286",[14,5.182,37,1.528,51,0.779,72,1.344,148,2.733,216,2.51,327,3.393,346,2.805,470,1.426,607,5.457,702,1.687,2039,8.05,2040,8.05,2041,8.05]],["t/1288",[14,5.145,33,2.919,37,1.498,51,0.77,72,1.328,148,2.679,216,2.459,327,3.325,346,2.749,398,3.91,470,1.397,702,1.653,2042,7.889,2043,7.889,2044,7.889,2045,7.889]],["t/1290",[14,5.2,37,1.544,51,0.784,72,1.353,148,2.761,216,2.535,327,3.428,470,1.44,702,1.704,817,4.98,2046,8.133,2047,8.133,2048,8.133]],["t/1292",[14,5.182,37,1.896,51,0.779,72,1.344,150,4.739,216,2.51,325,5.881,327,3.393,470,1.426,702,1.687,2049,8.05,2050,8.05,2051,8.05,2052,8.05]],["t/1294",[14,5.055,37,1.427,50,1.375,51,0.746,72,1.288,185,2.782,216,2.343,325,5.489,327,3.167,358,5.669,454,4.424,455,6.093,470,1.331,503,6.132,702,1.574,2053,6.872,2054,7.514,2055,7.514,2056,7.514,2057,6.448]],["t/1296",[14,4.73,37,0.955,51,0.926,61,4.626,72,1.151,110,0.924,128,2.493,131,3.872,132,2.233,147,2.633,190,2.02,216,2.268,220,2.58,225,1.741,253,2.493,256,2.213,327,3.066,387,3.566,470,0.891,484,2.466,546,4.315,674,4.599,694,3.794,702,1.054,867,4.104,912,2.233,962,3.935,1238,2.914,2058,4.315,2059,5.029,2060,5.029,2061,8.546,2062,4.315,2063,9.364,2064,4.599,2065,7.274,2066,5.029,2067,5.029,2068,5.029,2069,5.029,2070,5.029,2071,5.029]],["t/1298",[14,4.559,33,2.383,51,0.779,72,1.084,111,3.002,129,3.512,147,2.48,148,2.733,216,2.51,355,5.784,398,3.99,442,4.739,470,1.426,562,5.427,702,1.687,2072,8.05,2073,8.05]],["t/1300",[14,4.559,33,2.383,51,0.779,72,1.084,111,3.002,129,3.512,147,2.48,148,2.733,216,2.51,398,3.99,442,4.739,470,1.426,702,1.687,2074,8.147,2075,6.569,2076,8.05,2077,8.05]],["t/1302",[14,3.833,33,1.825,51,0.883,61,2.871,72,0.83,112,1.795,147,2.586,148,2.094,194,3.202,216,1.922,328,4.825,398,3.056,401,6.209,442,4.941,470,1.092,702,1.292,848,4.261,897,4.505,914,3.63,1687,4.652,2057,5.291,2078,5.291,2079,5.032,2080,5.291,2081,9.368,2082,4.063,2083,7.676,2084,5.032,2085,5.291,2086,6.166,2087,5.639,2088,6.166,2089,5.639]],["t/1304",[14,4.383,20,0.71,33,1.367,37,1.545,39,4.229,50,0.512,51,0.894,72,1.018,95,1.016,131,1.491,132,1.244,147,2.651,148,0.951,167,2.651,177,0.983,194,2.398,216,1.44,220,1.437,253,1.389,256,2.033,311,3.878,327,1.181,398,3.388,401,5.561,442,3.469,470,1.21,484,1.373,491,1.889,548,1.737,702,1.432,823,1.023,848,3.191,897,3.374,914,2.719,1133,1.575,1444,5.388,1469,2.562,1687,3.484,2057,2.404,2058,2.404,2081,5.388,2082,3.043,2083,4.223,2084,3.769,2085,3.963,2087,2.562,2089,2.562,2090,5.056,2091,6.732,2092,2.404,2093,2.801,2094,2.801,2095,2.801,2096,2.801,2097,5.388,2098,2.801,2099,2.801,2100,5.892,2101,2.801,2102,3.963,2103,5.865,2104,2.801,2105,2.801,2106,2.801,2107,2.801,2108,4.618,2109,2.801,2110,5.892,2111,6.834,2112,2.801,2113,5.892,2114,2.801,2115,2.801,2116,2.801,2117,2.801,2118,4.618,2119,4.618,2120,2.801,2121,2.801]],["t/1306",[14,4.588,51,0.784,60,3.241,72,1.095,147,2.506,181,4.64,261,3.824,278,6.363,470,1.44,702,1.704,902,6.363,1381,6.637,2122,6.136,2123,8.133,2124,6.979,2125,8.133,2126,8.133]],["t/1308",[14,4.708,51,0.805,72,1.142,147,2.613,216,2.644,226,5.973,227,3.545,470,1.502,702,1.777,1788,6.018,2127,8.481,2128,8.481]],["t/1310",[14,5.127,50,1.792,51,0.765,72,1.052,147,2.407,181,4.457,233,4.757,470,1.383,519,3.872,702,1.637,1131,8.96,1687,5.894,2084,6.374,2129,7.143,2130,7.811,2131,7.143,2132,7.811]],["t/1312",[14,4.979,51,0.784,72,1.095,167,2.852,214,5.619,470,1.44,511,6.979,622,3.714,702,1.704,817,4.031,1067,8.622,1068,5.771,1445,6.363,1776,5.246,2133,8.133]],["t/1314",[14,4.314,51,0.908,67,3.977,72,0.993,104,1.681,177,2.586,216,2.299,435,2.488,470,1.306,702,1.545,984,5.972,987,6.369,1051,5.77,1060,6.328,1068,6.703,1069,6.328,2134,7.374,2135,7.374,2136,7.374]],["t/1316",[14,4.678,51,0.8,72,1.13,190,3.37,216,2.616,470,1.486,702,1.758,1238,4.862,2137,7.674,2138,5.798,2139,5.658,2140,7.201,2141,8.391,2142,8.391]],["t/1318",[14,4.708,48,2.88,51,0.805,72,1.142,216,2.644,355,4.914,441,5.361,470,1.502,702,1.777,2143,7.278,2144,8.481,2145,7.756,2146,8.481]],["t/1320",[14,4.708,48,2.88,51,0.805,72,1.142,139,6.399,216,2.644,355,4.914,470,1.502,702,1.777,2147,7.278,2148,8.481,2149,7.756,2150,8.481]],["t/1322",[14,4.678,51,0.863,72,1.13,110,1.542,147,3.547,233,5.11,470,1.486,702,1.758,1977,6.848,2151,8.391]],["t/1324",[14,4.719,48,3.17,51,0.807,60,4.118,72,0.975,194,3.759,216,2.257,233,4.409,470,1.282,702,1.517,848,5.002,897,5.288,914,4.261,1687,5.462,1980,6.62,2082,4.77,2084,5.907,2085,6.212,2152,7.239,2153,9.335,2154,7.239,2155,7.239,2156,7.239]],["t/1326",[14,4.42,48,2.601,51,0.828,60,3.052,61,3.567,72,1.032,175,3.465,216,2.388,327,3.229,345,5.994,398,3.797,413,5.293,470,1.357,702,1.605,1685,5.994,2157,11.147,2158,6.573,2159,7.66,2160,7.66]],["t/1328",[14,3.465,51,0.825,59,1.568,61,4.918,72,1.022,110,1.394,189,4.272,190,3.047,193,3.939,194,5.484,314,3.498,327,4.682,470,1.344,702,1.59,2161,7.586]],["t/1330",[14,3.567,37,2.131,51,0.836,59,1.597,61,4.562,72,1.052,110,1.436,189,3.469,190,3.137,193,4.056,194,5.087,314,3.602,470,1.383,702,1.637,2162,7.811]],["t/1332",[14,3.189,51,0.793,59,1.486,61,5.013,72,0.94,110,1.283,129,3.046,189,4.05,190,2.804,193,3.626,194,5.273,256,3.074,314,3.22,327,4.281,467,2.55,470,1.237,491,4.708,702,1.463,769,3.926,823,2.55,2163,6.983,2164,6.983,2165,5.269,2166,6.983]],["t/1334",[14,4.289,35,1.71,50,1.337,51,0.885,59,1.191,72,0.984,107,2.45,108,2.579,110,1.343,214,5.048,470,1.294,702,1.531,715,5.512,854,5.962,1776,4.712,1977,5.962,2167,7.306,2168,6.681,2169,7.306,2170,7.306,2171,7.306,2172,7.306,2173,7.306,2174,7.306,2175,6.681]],["t/1336",[13,2.47,14,0.249,19,1.83,33,0.447,50,0.192,51,0.966,59,0.089,83,0.617,84,0.257,95,0.548,120,0.855,147,0.721,148,0.794,149,2.794,177,0.53,185,0.56,193,0.283,194,0.283,216,0.17,222,2.169,225,0.672,228,0.427,243,0.427,244,1.874,254,0.399,256,0.854,274,1.061,300,0.662,314,0.252,362,0.387,364,0.412,382,0.267,384,0.387,386,0.445,398,2.102,401,0.316,405,0.743,417,0.531,441,0.955,461,0.399,467,0.199,506,9.335,562,0.706,565,1.391,588,1.182,598,0.445,607,0.298,622,0.478,634,0.69,667,0.855,702,0.219,717,0.589,721,0.899,722,0.79,738,0.287,751,0.338,776,0.338,784,0.589,805,0.558,807,0.298,817,0.519,826,0.332,836,0.387,842,0.345,855,1.451,942,0.79,986,1.104,1022,0.445,1124,0.427,1158,0.412,1238,0.316,1275,0.955,1322,0.377,1348,0.399,1364,0.427,1375,0.598,1404,0.79,1431,0.958,1448,0.338,1482,1.227,1499,3.285,1503,0.82,1627,0.743,1685,0.427,1691,0.412,1706,0.975,1723,0.499,1734,0.468,1735,0.345,1776,2.562,1828,0.468,1916,0.427,2062,0.468,2075,0.855,2078,0.468,2079,0.855,2080,0.468,2082,0.359,2092,0.468,2138,0.724,2168,0.499,2176,1.418,2177,0.546,2178,9.657,2179,0.546,2180,0.546,2181,0.546,2182,0.546,2183,0.546,2184,0.546,2185,0.546,2186,0.546,2187,1.048,2188,0.546,2189,0.546,2190,0.546,2191,0.546,2192,0.546,2193,0.546,2194,0.546,2195,0.546,2196,0.546,2197,0.546,2198,0.468,2199,0.546,2200,0.546,2201,0.958,2202,0.546,2203,0.546,2204,0.765,2205,0.546,2206,0.546,2207,0.546,2208,1.048,2209,0.546,2210,0.546,2211,0.546,2212,0.546,2213,0.546,2214,2.212,2215,1.923,2216,0.546,2217,0.546,2218,0.546,2219,0.546,2220,0.546,2221,0.546,2222,0.546,2223,0.546,2224,0.546,2225,0.546,2226,0.546,2227,0.546,2228,0.546,2229,0.546,2230,0.546,2231,0.546,2232,0.546,2233,0.546,2234,0.546,2235,0.546,2236,0.546,2237,0.546,2238,0.546,2239,0.546,2240,0.546,2241,0.546,2242,0.546,2243,0.546,2244,0.546,2245,0.546,2246,0.546,2247,0.546,2248,0.546,2249,0.546,2250,0.546,2251,0.546,2252,1.511,2253,1.048,2254,0.546,2255,0.546,2256,3.686,2257,0.546,2258,0.546,2259,0.546,2260,1.511,2261,0.546,2262,0.546,2263,0.546,2264,0.546,2265,0.546,2266,0.546,2267,0.546,2268,0.546,2269,0.546,2270,0.468,2271,0.546,2272,0.546,2273,0.427,2274,0.546,2275,0.546,2276,0.546,2277,0.546,2278,0.546,2279,0.546,2280,1.511,2281,0.546,2282,0.546,2283,0.546,2284,0.546,2285,0.546,2286,0.546,2287,0.546,2288,0.546,2289,0.546,2290,0.546,2291,1.048,2292,0.546,2293,1.94,2294,1.048,2295,0.546,2296,0.546,2297,1.048,2298,0.546,2299,0.546,2300,1.048,2301,0.546,2302,0.427,2303,1.048,2304,0.546,2305,0.546,2306,1.048,2307,0.546,2308,0.546,2309,1.048,2310,0.546,2311,0.546,2312,1.048,2313,0.546,2314,0.499,2315,1.048,2316,0.546,2317,0.546,2318,1.048,2319,0.546,2320,0.546,2321,1.048,2322,0.546,2323,0.546,2324,1.048,2325,0.546,2326,0.546,2327,1.048,2328,0.546,2329,0.499,2330,1.048,2331,0.546,2332,0.546,2333,1.048,2334,0.546,2335,0.499,2336,1.048,2337,0.546,2338,0.546,2339,0.958,2340,0.546,2341,0.546,2342,1.048,2343,0.546,2344,0.546,2345,1.048,2346,1.048,2347,0.546,2348,0.546,2349,1.048,2350,1.048,2351,0.546,2352,0.546,2353,1.048,2354,0.546,2355,0.546,2356,1.048,2357,0.546,2358,0.546,2359,1.048,2360,0.546,2361,0.546,2362,1.048,2363,1.048,2364,0.546,2365,1.048,2366,0.546,2367,0.546,2368,3.382,2369,0.546,2370,0.499,2371,0.546,2372,0.546,2373,0.546,2374,0.546,2375,1.048,2376,0.546,2377,0.399,2378,1.048,2379,0.546,2380,0.546,2381,1.048,2382,0.546,2383,0.546,2384,1.048,2385,0.546,2386,0.499,2387,1.048,2388,0.546,2389,0.546,2390,1.048,2391,0.546,2392,0.546,2393,1.048,2394,0.546,2395,0.546,2396,1.048,2397,1.048,2398,0.546,2399,0.546,2400,1.048,2401,0.546,2402,0.546,2403,1.048,2404,0.546,2405,0.546,2406,1.048,2407,1.048,2408,0.546,2409,0.546,2410,0.546,2411,0.546,2412,0.546,2413,0.546,2414,0.546,2415,0.546,2416,0.546,2417,0.546,2418,0.546,2419,0.546,2420,0.546,2421,0.546,2422,0.546,2423,0.546,2424,0.546,2425,0.546,2426,0.546,2427,0.546,2428,0.546,2429,0.546,2430,0.546,2431,0.546,2432,0.546,2433,0.546,2434,0.546,2435,0.546,2436,0.546,2437,0.546,2438,0.546,2439,0.546,2440,0.546,2441,0.546,2442,0.546,2443,0.546,2444,0.546,2445,0.546,2446,0.546,2447,0.546,2448,0.546,2449,0.546,2450,0.546,2451,0.546,2452,0.546,2453,0.546,2454,0.546,2455,0.546,2456,0.546,2457,0.546,2458,0.546,2459,0.546,2460,0.546,2461,0.546,2462,0.546,2463,0.546,2464,0.546,2465,0.546,2466,0.546,2467,0.546,2468,0.546,2469,0.546,2470,0.546,2471,0.546,2472,0.546,2473,0.546,2474,0.546,2475,0.546,2476,0.546,2477,0.546,2478,0.546,2479,0.546,2480,0.546,2481,0.546,2482,0.546,2483,0.546,2484,0.546,2485,0.546,2486,0.546,2487,0.546,2488,0.546,2489,0.546,2490,0.546,2491,0.546,2492,0.765,2493,0.546,2494,0.546,2495,0.546,2496,0.546,2497,0.546,2498,0.445,2499,0.546,2500,0.546,2501,0.546,2502,0.546,2503,0.499,2504,0.546,2505,1.048,2506,0.546,2507,0.546,2508,1.048,2509,0.546,2510,0.546,2511,0.445,2512,0.546,2513,0.546,2514,0.546,2515,1.048,2516,0.546,2517,0.546,2518,0.427,2519,0.546,2520,0.546,2521,0.958,2522,0.546,2523,0.546,2524,0.546,2525,0.546,2526,0.546,2527,0.499,2528,0.546,2529,0.546,2530,0.499,2531,0.546,2532,0.546,2533,0.468,2534,0.546,2535,0.546,2536,0.546,2537,0.546,2538,0.546,2539,0.546,2540,0.546,2541,0.546,2542,0.546,2543,0.546,2544,0.546,2545,0.399,2546,0.546,2547,0.546,2548,0.546,2549,0.546,2550,0.546,2551,0.546,2552,0.499,2553,0.855,2554,0.387,2555,0.546,2556,0.546,2557,0.546,2558,0.546,2559,0.546,2560,0.468,2561,0.546,2562,0.546,2563,0.546,2564,0.546,2565,0.82,2566,0.546,2567,0.546,2568,0.546,2569,0.546,2570,0.546,2571,0.546,2572,0.499,2573,0.546,2574,0.546,2575,0.546,2576,0.499,2577,0.546,2578,0.546,2579,0.546,2580,0.546,2581,0.546,2582,0.499,2583,0.546,2584,0.546,2585,0.546,2586,0.546,2587,0.546,2588,0.546,2589,0.546,2590,0.546,2591,0.546,2592,0.546,2593,0.546,2594,0.499,2595,0.546,2596,0.546,2597,1.048,2598,0.546,2599,0.546,2600,0.546,2601,0.546,2602,0.546,2603,0.546,2604,0.546,2605,0.546,2606,0.546,2607,0.546,2608,0.546,2609,0.546,2610,0.546,2611,0.546,2612,0.468,2613,0.546,2614,0.546,2615,0.546,2616,0.546,2617,1.048,2618,0.546,2619,0.546,2620,0.546,2621,0.546,2622,0.546,2623,0.546,2624,0.546,2625,0.468,2626,0.546,2627,2.339,2628,0.546,2629,0.546,2630,0.546,2631,0.546,2632,0.546,2633,0.546,2634,1.048,2635,0.546,2636,0.546,2637,0.546,2638,0.546,2639,0.546,2640,0.412,2641,0.546,2642,0.546,2643,0.546,2644,0.546,2645,0.546,2646,0.546,2647,0.546,2648,0.546,2649,0.546,2650,0.546,2651,0.546,2652,0.546,2653,0.499,2654,0.499,2655,0.546,2656,0.546,2657,0.546,2658,0.546,2659,0.546,2660,0.546,2661,0.546,2662,0.499,2663,0.445]],["t/1339",[35,1.776,51,0.867,72,1.022,73,2.706,74,3.047,95,2.751,104,1.879,167,2.661,175,4.352,225,2.626,233,5.858,429,3.095,435,3.246,470,1.344,702,1.59,703,3.369]],["t/1341",[3,0.823,20,0.798,21,0.35,25,0.877,32,0.917,33,0.932,34,0.595,35,1.355,37,1.035,39,1.181,40,0.707,48,0.607,49,0.991,50,1.168,51,0.556,54,0.751,56,0.632,59,0.291,60,1.68,61,1.466,73,1.396,81,0.183,88,1.217,93,0.619,95,1.346,100,1.033,104,0.447,105,0.411,106,0.363,107,2.583,108,0.631,110,1.064,111,2.381,112,0.916,114,1.746,121,0.632,129,0.418,130,0.394,131,0.952,132,0.426,133,0.751,139,0.724,145,0.547,147,1.784,148,2.257,149,0.632,167,1.302,175,0.809,177,0.336,178,1.534,179,1.053,181,3.793,183,2.667,185,1.166,190,1.264,213,0.619,214,0.663,216,2.072,220,1.288,222,2.634,225,1.09,226,1.036,227,1.05,233,0.584,238,1.503,239,0.418,248,1.503,250,0.663,253,0.475,254,1.834,256,1.105,271,0.306,274,0.524,278,0.751,309,0.517,311,0.492,312,1.728,314,0.824,315,0.663,317,0.928,319,0.701,328,0.751,330,0.663,346,1.77,355,1.036,359,1.861,366,0.681,380,0.475,381,1.693,394,0.606,398,1.245,401,1.036,416,1.053,417,1.273,429,0.729,435,0.324,441,1.99,442,1.478,469,0.415,470,0.317,484,0.47,509,0.632,515,1.349,536,0.701,548,0.595,560,1.48,565,2.163,589,0.492,622,1.437,668,0.823,673,1.655,682,0.584,684,2.049,688,0.619,694,3.181,697,0.504,699,0.547,708,0.394,715,0.724,717,0.539,722,0.724,762,1.269,766,0.858,767,0.511,768,0.751,769,1.412,777,0.511,780,0.524,784,2.625,808,0.511,809,0.867,817,0.475,825,0.539,829,0.823,846,0.574,849,2.503,850,0.574,886,0.823,895,1.349,896,0.751,902,0.751,914,0.565,919,0.663,920,0.539,929,0.751,935,0.783,943,2.261,953,2.233,962,1.399,968,1.349,969,1.306,980,2.261,984,0.606,1020,2.394,1022,0.783,1075,1.782,1088,0.877,1089,1.205,1106,0.783,1110,1.965,1133,0.539,1166,1.412,1169,1.534,1171,1.349,1186,0.524,1194,0.823,1195,1.895,1196,0.783,1218,1.635,1225,1.349,1318,0.823,1364,0.751,1384,0.606,1387,1.153,1410,0.877,1412,1.534,1448,0.595,1464,0.724,1475,1.349,1479,1.635,1482,1.13,1483,0.877,1499,2.406,1503,0.751,1548,0.681,1681,0.823,1686,0.823,1693,1.153,1717,0.823,1724,0.877,1765,1.153,1769,0.606,1780,0.751,1788,0.681,1824,0.751,2062,0.823,2074,0.783,2091,1.399,2143,0.823,2145,0.877,2147,0.823,2149,0.877,2158,0.823,2329,0.877,2492,1.834,2503,1.635,2518,2.463,2530,1.635,2572,0.877,2576,1.635,2612,0.823,2640,0.724,2664,2.878,2665,1.788,2666,1.788,2667,1.788,2668,0.959,2669,0.959,2670,0.959,2671,0.959,2672,0.959,2673,2.511,2674,4.669,2675,0.959,2676,3.148,2677,0.959,2678,1.459,2679,0.959,2680,0.959,2681,0.959,2682,0.959,2683,0.959,2684,0.959,2685,1.635,2686,0.959,2687,0.959,2688,0.959,2689,0.959,2690,0.877,2691,0.959,2692,0.823,2693,0.959,2694,0.959,2695,0.959,2696,0.959,2697,1.459,2698,0.877,2699,0.959,2700,0.959,2701,0.783,2702,0.959,2703,3.411,2704,3.181,2705,0.823,2706,0.959,2707,0.959,2708,0.877,2709,0.959,2710,1.788,2711,2.296,2712,0.823,2713,1.788,2714,2.878,2715,2.511,2716,2.155,2717,1.635,2718,2.296,2719,2.511,2720,0.959,2721,0.959,2722,0.959,2723,0.959,2724,0.823,2725,0.959,2726,0.823,2727,1.788,2728,0.823,2729,0.959,2730,1.635,2731,1.788,2732,1.788,2733,2.296,2734,0.877,2735,0.877,2736,1.534,2737,0.959,2738,1.788,2739,1.788,2740,0.959,2741,1.788,2742,0.959,2743,0.959,2744,0.959,2745,1.635,2746,0.959,2747,0.877,2748,0.959,2749,0.959,2750,1.635,2751,0.959,2752,0.959,2753,0.823,2754,0.823,2755,1.635,2756,1.635,2757,0.877,2758,0.823,2759,0.877,2760,1.788,2761,1.788,2762,1.788,2763,0.959,2764,0.959,2765,0.823,2766,0.959,2767,1.788,2768,0.959,2769,0.959,2770,0.959,2771,0.959,2772,0.877,2773,0.681,2774,0.877,2775,0.823,2776,0.877,2777,0.877,2778,0.959,2779,0.959,2780,0.959,2781,0.959]],["t/1343",[37,1.44,48,2.576,51,0.751,59,1.722,72,1.022,80,1.59,81,1.447,110,1.394,159,2.324,175,3.432,190,3.047,225,2.626,233,4.62,315,7.298,435,2.56,470,1.344,702,1.59,2782,7.586,2783,7.586,2784,7.586,2785,7.586]],["t/1345",[51,0.934,56,4.602,72,0.94,73,1.789,107,2.341,111,2.604,121,7.095,470,1.237,697,3.671,702,1.463,1186,3.817,1731,5.699,2664,9.287,2747,6.386,2786,9.12,2787,9.12,2788,6.983,2789,9.12,2790,6.386]],["t/1347",[20,2.273,88,4.12,147,2.762,366,6.36,367,7.013,1136,8.196,1275,5.665,2773,6.36,2791,8.962]],["t/1349",[20,1.39,34,3.4,51,0.873,59,0.893,73,1.405,81,1.476,105,4.943,107,1.838,129,2.392,167,1.923,654,3.89,702,1.149,1569,5.837,1927,6.639,2792,5.482,2793,5.482,2794,8.698,2795,5.482,2796,5.482,2797,9.147,2798,5.482,2799,5.482,2800,7.737,2801,5.482,2802,5.482,2803,5.482,2804,5.482,2805,5.482,2806,5.482,2807,4.704,2808,5.482,2809,5.482,2810,5.482,2811,5.482,2812,5.482,2813,5.482]],["t/1352",[20,1.505,23,1.872,51,0.949,64,1.61,65,2.906,66,1.718,72,1.26,73,2.095,74,2.383,105,3.505,110,1.091,159,1.818,175,2.685,260,4.644,337,2.763,353,3.552,589,3.045,825,3.337,1184,2.942,1275,3.752,1557,4.843,1568,4.478,1569,4.478,1961,4.478,2794,6.673,2797,7.017,2814,4.644,2815,5.935,2816,5.935,2817,5.935,2818,5.935,2819,5.935,2820,5.935,2821,5.935]],["t/1354",[3,2.219,20,1.589,23,1.976,51,0.946,64,1.699,65,3.015,66,1.813,72,1.142,73,2.174,74,2.516,105,2.685,110,1.151,175,2.834,185,2.319,261,2.946,353,3.749,589,3.214,825,3.522,1275,3.96,1557,5.112,1568,6.401,1569,4.726,1961,4.726,2794,6.923,2814,4.901,2822,6.264,2823,6.264,2824,6.264,2825,6.264,2826,6.264]],["t/1356",[23,2.128,51,0.944,59,1.099,64,1.83,65,3.168,66,1.953,72,1.2,81,1.287,105,3.822,110,1.24,112,1.964,336,4.037,337,3.141,589,3.46,825,3.792,1275,4.264,1961,5.089,2794,5.504,2797,5.788,2814,5.278,2827,6.745,2828,6.745,2829,6.745,2830,6.745,2831,5.788,2832,6.168]],["t/1358",[23,2.263,51,0.929,59,1.169,64,1.946,65,3.298,66,2.077,72,1.25,73,1.838,74,2.881,81,1.368,110,1.318,336,4.293,337,3.34,589,3.68,825,4.033,1275,4.534,1281,6.156,1961,5.412,2814,5.613,2831,6.156,2832,6.56,2833,6.56,2834,6.56]],["t/1360",[23,1.992,51,0.952,59,1.029,64,1.713,65,3.031,66,1.828,72,1.149,73,1.618,74,2.536,81,1.204,110,1.568,112,1.838,183,2.186,189,4.29,314,2.911,589,3.239,825,3.55,1275,3.991,1961,4.764,2814,4.94,2831,5.418,2833,5.774,2834,5.774,2835,6.314,2836,6.314,2837,6.314,2838,6.314,2839,6.314,2840,6.314]],["t/1362",[3,2.105,20,2.041,48,2.733,58,5.562,60,3.208,83,5.877,88,3.112,106,3.045,132,3.575,185,2.981,253,3.99,359,4.035,361,5.712,362,5.712,363,6.074,503,8.147,842,6.311]],["t/1364",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1366",[3,1.237,20,1.764,23,1.491,37,0.898,48,1.605,50,0.865,51,0.949,58,3.267,59,0.771,62,4.057,64,1.283,66,2.013,73,1.211,80,0.991,81,0.902,84,4.277,104,1.237,107,1.585,110,1.672,111,2.593,132,2.1,166,4.396,183,1.637,356,2.201,397,2.698,405,3.355,429,3.365,432,4.571,433,5.32,436,6.223,559,1.692,704,2.37,705,2.318,707,1.727,708,1.944,916,7.543,1473,3.567,1611,4.324,2841,4.728,2842,6.954,2843,4.057,2844,4.728,2845,4.057,2846,4.728,2847,4.057,2848,4.728]],["t/1368",[3,1.465,33,1.053,35,2.301,37,1.621,50,0.651,51,0.944,58,5.426,60,2.231,61,1.657,80,0.745,81,0.679,83,2.094,84,2.633,93,2.295,104,1.232,105,1.525,106,2.118,107,1.877,108,1.977,109,1.625,110,1.273,111,2.088,112,2.016,130,3.73,148,1.208,166,3.54,174,1.945,177,1.964,183,1.232,191,1.87,225,3.139,253,1.764,317,1.847,358,2.684,362,2.525,393,2.303,405,3.973,425,2.784,429,1.452,454,4.076,455,4.012,565,1.825,591,2.903,667,2.903,688,3.612,823,1.299,842,4.964,1241,2.167,1344,3.053,1448,2.206,1599,2.903,2053,3.254,2079,2.903,2843,6.739,2845,3.053,2847,3.053,2849,3.053,2850,2.525,2851,3.558,2852,2.684,2853,3.558,2854,3.558]],["t/1370",[51,0.784,58,5.619,84,3.824,104,1.447,106,3.076,112,3.174,166,5.141,405,5.771,425,6.363,454,4.788,455,4.712,467,2.97,827,3.612,2843,6.979,2845,6.979,2847,6.979]],["t/1372",[3,2.516,20,2.151,33,1.854,50,1.146,55,6.198,60,3.834,61,2.917,110,1.151,147,1.93,193,3.252,363,4.726,366,4.445,367,4.901,393,2.576,398,3.105,414,5.112,435,2.113,529,7.758,751,7.263,759,4.576,965,4.328,1263,5.112,1347,5.112,1776,5.472,2640,6.401,2849,5.375,2855,6.264,2856,4.901,2857,5.112,2858,6.264,2859,6.264]],["t/1374",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1376",[3,1.244,20,1.771,23,1.5,35,1.113,37,0.903,48,2.372,50,0.87,51,0.934,59,0.775,64,1.29,66,2.022,67,2.565,73,1.219,80,1.911,81,1.74,104,1.243,106,1.799,107,1.595,110,1.676,111,2.605,159,1.457,177,1.668,197,3.722,227,1.988,230,2.307,356,2.215,382,3.424,397,2.714,417,4.197,559,1.702,704,2.384,705,2.332,707,2.551,708,1.956,753,6.387,1105,3.375,2860,4.756,2861,4.756,2862,4.756,2863,3.375,2864,3.722,2865,4.082,2866,4.756,2867,4.756,2868,4.756,2869,4.756,2870,4.756,2871,3.134,2872,4.082,2873,4.756,2874,4.756,2875,4.756]],["t/1378",[3,1.989,33,0.838,35,2.36,37,1.306,48,1.582,49,3.29,50,0.852,51,0.947,53,2.945,60,2.366,61,1.318,80,0.976,81,0.889,88,1.095,95,2.153,104,1.224,106,2.245,107,1.99,108,1,109,1.293,110,1.091,111,1.737,112,1.356,121,1.866,130,1.916,148,2.016,175,1.281,177,2.413,181,1.616,183,1.613,185,1.048,193,1.47,216,0.883,225,2.632,227,1.948,239,1.235,248,1.146,317,1.47,327,1.194,346,0.987,363,2.136,382,3.728,387,2.284,393,3.127,413,1.956,417,1.436,559,1.013,565,3.045,583,1.419,708,1.164,751,5.361,757,0.974,771,2.069,776,1.756,793,1.79,823,1.034,850,1.695,912,1.258,953,3.306,1499,1.616,1571,2.589,2138,1.956,2850,2.009,2857,2.311,2863,2.009,2864,3.646,2865,2.43,2871,1.866,2872,2.43,2876,2.589,2877,4.261,2878,2.589,2879,2.831,2880,2.216,2881,2.216,2882,2.216,2883,2.43,2884,2.589,2885,2.831,2886,2.589,2887,2.831,2888,2.589,2889,2.589,2890,2.589,2891,2.589,2892,2.43]],["t/1380",[37,1.326,51,0.872,80,1.463,81,1.332,95,2.533,104,1.243,106,2.642,110,1.283,112,2.957,183,3.157,382,3.424,387,3.424,467,2.55,751,4.331,757,2.402,827,3.101,912,3.101,1499,3.984,2863,4.955,2864,5.464,2865,5.993,2871,4.602,2872,5.993,2877,6.386,2884,6.386,2889,6.386,2891,6.386,2892,5.993]],["t/1382",[3,2.242,4,6.709,20,2.174,50,1.568,60,3.417,148,2.911,149,5.65,330,7.711,441,5.42,2893,7.357,2894,8.573,2895,8.573]],["t/1384",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1386",[3,2.15,20,2.084,23,1.886,35,1.4,48,2.03,50,1.094,51,0.933,64,1.622,66,2.38,73,1.532,80,1.253,81,1.141,104,1.462,106,2.262,107,2.005,109,2.731,110,1.099,248,2.42,319,6.004,356,2.784,397,3.412,559,2.139,704,2.997,705,2.932,707,3.001,708,2.459,912,3.65,1151,3.362,2857,4.88,2896,5.98,2897,5.98,2898,8.219,2899,8.219,2900,5.98]],["t/1388",[3,2.184,33,1.811,35,1.955,51,0.943,80,1.282,81,1.167,104,1.691,106,3.158,107,2.051,108,2.16,109,2.794,110,1.125,111,2.282,112,1.781,130,3.434,190,2.457,225,2.89,231,2.849,319,6.1,330,4.228,387,3,823,2.234,912,3.708,1731,4.993,2901,6.118,2902,7.165,2903,5.595,2904,5.595,2905,5.595]],["t/1390",[51,0.838,104,1.613,106,3.429,112,2.639,319,6.622,467,3.31,827,4.026,2902,7.779]],["t/1392",[51,0.945,231,3.826,319,6.003,330,5.678,387,4.029,912,4.491,2176,6.003,2902,7.051,2903,7.514,2904,7.514,2905,7.514]],["t/1394",[3,2.318,20,2.247,50,1.621,181,5.056,225,3.068,274,4.844,461,6.474,760,6.288,931,7.232,2553,7.232,2906,7.605]],["t/1396",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1398",[3,1.252,20,1.779,23,1.51,33,1.417,35,1.12,37,0.909,48,1.625,50,1.52,51,0.859,60,1.907,64,1.298,66,2.031,73,1.226,104,1.248,107,1.604,108,1.689,110,0.879,147,1.474,148,1.625,149,4.623,216,2.187,223,3.306,244,2.652,274,5,356,2.228,397,2.73,398,2.372,442,2.817,470,1.243,471,3.496,483,2.73,484,2.346,559,1.712,565,3.599,704,2.399,705,2.346,707,2.562,708,1.968,951,3.496,1348,3.496,1729,4.73,1776,3.087,2082,4.623,2906,6.02,2907,4.785,2908,7.016,2909,7.016,2910,6.02,2911,4.785,2912,4.785,2913,4.106,2914,6.02,2915,3.744,2916,4.376,2917,4.376,2918,4.376,2919,3.905,2920,4.376,2921,4.785]],["t/1400",[3,1.237,33,0.854,35,2.129,37,1.458,50,1.405,51,0.944,60,3.06,80,0.604,81,0.55,95,1.046,104,1.07,106,1.789,107,2.016,108,1.669,109,1.317,110,0.869,111,2.242,112,1.377,130,3.583,147,2.902,148,2.362,183,0.998,190,1.158,214,3.267,216,1.474,223,1.992,225,3.149,239,1.258,244,3.854,274,3.802,317,1.497,346,2.874,387,1.414,461,3.455,471,2.106,484,1.414,500,3.859,565,3.084,697,1.516,704,1.445,751,1.788,823,1.053,842,2.989,964,1.697,980,3.661,1348,2.106,1776,1.86,1793,3.355,2082,1.9,2545,2.106,2850,4.266,2906,2.474,2910,5.159,2913,4.058,2914,4.058,2916,2.637,2917,2.637,2918,2.637,2919,2.353,2920,2.637,2922,4.324,2923,6.955,2924,2.883,2925,4.324,2926,2.883,2927,2.474,2928,4.324,2929,2.883,2930,2.256]],["t/1402",[51,0.923,104,1.312,106,2.789,112,2.75,183,2.553,387,3.615,467,2.693,827,3.275,1793,5.233,2892,6.328,2910,6.328,2913,6.328,2914,6.328,2922,6.743,2925,6.743,2928,6.743,2931,7.374,2932,6.743,2933,7.374,2934,7.374,2935,7.374,2936,7.374]],["t/1404",[3,2.406,20,1.228,35,1.134,37,0.92,44,3.329,48,1.645,49,3.923,50,1.295,59,0.789,64,1.314,100,1.992,104,1.259,110,0.89,129,2.113,130,1.992,132,2.151,146,3.347,147,2.577,175,2.191,213,3.124,216,2.608,224,3.437,225,1.677,256,2.132,312,3.296,317,2.515,346,1.688,357,6.117,361,3.437,382,2.375,392,3.437,429,1.976,470,0.858,484,2.375,717,5.173,757,1.666,760,3.437,793,3.062,1074,3.266,1153,4.475,1238,2.806,1344,4.157,1448,3.004,1535,4.157,1548,3.437,1916,3.79,2082,3.192,2498,3.953,2553,3.953,2612,4.157,2937,7.713,2938,4.844,2939,4.43,2940,4.844,2941,4.844,2942,4.844,2943,5.341]],["t/1406",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1408",[3,1.529,20,2.052,23,1.844,35,1.369,37,1.11,48,1.985,50,1.07,51,0.901,59,0.953,64,1.586,66,2.343,73,1.498,80,1.225,81,1.115,104,1.44,216,1.823,356,2.722,357,3.388,382,2.867,397,3.336,484,2.867,518,4.149,559,2.092,704,2.931,705,2.867,707,2.955,708,2.405,912,2.597,2871,3.853,2919,4.772,2937,4.412,2943,4.412,2944,5.847,2945,5.847,2946,5.018,2947,5.456,2948,5.347,2949,4.575,2950,4.772,2951,4.412,2952,4.271,2953,4.575,2954,6.945]],["t/1410",[3,1.399,33,0.724,35,2.302,37,1.679,40,0.967,49,1.356,50,0.978,51,0.949,59,0.399,72,0.329,80,0.864,81,0.787,104,0.951,106,1.56,107,2.105,108,0.864,109,1.117,110,0.758,111,1.538,112,0.712,130,1.696,147,1.271,167,0.858,175,1.107,177,1.446,183,1.428,185,0.906,214,1.69,216,1.667,220,1.255,225,3.404,227,1.023,238,3.201,346,2.818,357,4.686,382,3.078,392,1.736,393,2.883,401,1.417,435,1.804,518,2.927,597,1.914,708,1.006,712,2.558,717,4.777,757,0.841,772,1.612,805,1.302,823,0.893,912,1.086,986,1.787,1001,1.996,1418,2.099,1788,1.736,2554,1.736,2850,3.794,2871,2.718,2881,1.914,2882,1.914,2915,1.914,2919,1.996,2937,6.898,2943,1.846,2947,4.233,2948,2.237,2949,1.914,2950,1.996,2951,1.846,2952,1.787,2953,1.914,2954,6.523,2955,2.446,2956,2.099,2957,2.099,2958,2.237,2959,2.237,2960,2.099,2961,3.112,2962,2.237,2963,2.237,2964,2.237,2965,2.099,2966,1.996,2967,2.237,2968,2.237,2969,2.237,2970,2.099]],["t/1412",[51,0.876,104,1.39,148,2.652,381,5.266,382,3.83,467,2.852,827,3.469,912,3.469,2726,6.703,2871,5.147,2943,5.894,2947,5.266,2949,6.112,2950,6.374,2951,5.894,2952,5.706,2953,6.112,2954,6.703,2971,7.143,2972,7.811]],["t/1414",[51,0.896,357,5.313,1499,5.232,2176,6.699,2937,6.919,2971,8.386]],["t/1416",[50,1.586,51,0.875,64,2.352,757,4.097,1119,6.782,1120,7.073,2946,7.438]],["t/1418",[3,1.917,20,0.987,35,0.911,50,0.712,51,0.469,55,2.842,88,1.504,95,2.177,100,2.469,104,1.068,147,3.203,148,1.321,179,2.29,181,3.425,185,2.715,220,3.761,224,4.26,225,2.538,239,2.619,256,4.317,309,2.098,317,3.806,380,1.928,387,2.943,442,2.29,506,3.339,521,2.761,559,1.392,565,3.08,607,2.127,622,2.742,699,2.22,808,2.071,809,1.887,883,2.761,912,1.728,929,3.044,931,3.175,951,2.842,969,2.842,984,4.634,996,2.935,1072,3.044,1185,3.175,1198,2.254,1238,2.254,1348,2.842,1399,3.558,1692,2.842,1776,2.509,1916,3.044,2215,2.761,2492,2.842,2511,7.68,2521,3.558,2708,3.558,2711,3.558,2714,3.558,2728,3.339,2881,3.044,2973,3.89,2974,7.331,2975,3.89,2976,3.89,2977,3.89,2978,3.89,2979,3.89,2980,3.89,2981,3.339,2982,3.89,2983,3.89,2984,3.89,2985,3.89,2986,3.89,2987,3.558,2988,3.89,2989,3.89,2990,3.89,2991,3.89,2992,3.89,2993,3.339,2994,3.339]],["t/1420",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1422",[3,1.859,20,2.34,23,2.242,35,1.664,48,2.414,50,1.3,51,0.915,59,1.159,64,1.929,66,2.671,73,1.821,104,1.642,356,3.31,397,4.056,559,2.543,704,3.563,705,3.485,707,3.369,708,2.924,2995,7.109,2996,7.109,2997,7.109,2998,6.1]],["t/1424",[3,1.787,33,1.367,35,2.105,51,0.913,59,1.326,80,1.705,81,1.552,93,2.978,95,1.675,104,1.447,106,2.585,107,2.728,108,2.872,109,2.109,110,1.653,111,1.722,112,1.344,130,2.81,147,3.29,148,1.568,185,1.71,214,4.722,224,3.277,225,3.113,256,3.957,565,3.506,682,2.812,823,1.686,912,2.051,1923,3.963,2511,7.338,2728,6.981,2994,5.864,2998,3.963,2999,6.249,3000,4.618]],["t/1426",[51,0.931,59,1.248,80,2.028,81,1.846,104,1.363,107,3.245,110,1.779,467,2.797,827,3.402,2994,6.573,2998,6.573,2999,7.005,3001,7.66,3002,7.005,3003,7.005]],["t/1428",[51,0.919,256,3.945,912,3.98,2176,6.547,2511,7.314,3002,8.196,3004,8.962]],["t/1430",[3,2.768,20,2.247,167,3.108,346,3.088,484,4.345,686,8.857,717,5.951]],["t/1432",[3,2.172,37,1.932,51,0.794,72,1.37,104,1.477,105,3.56,110,1.526,703,3.688,1387,5.356,2701,6.776,2930,6.497,3005,8.303,3006,7.125,3007,8.303]],["t/1434",[3,1.154,20,1.675,23,1.392,37,1.254,50,1.208,51,0.919,59,1.077,64,1.197,66,1.912,73,1.13,80,1.384,81,1.26,104,0.785,110,1.214,112,1.284,131,2.348,132,1.959,159,1.351,167,1.547,175,1.996,177,3.302,216,1.375,223,3.048,231,2.054,239,2.882,253,2.187,254,3.223,346,2.301,356,2.054,435,2.672,469,1.908,483,3.769,537,4.687,559,1.578,686,6.196,704,2.211,705,2.163,707,1.611,708,1.814,717,3.714,808,3.516,1387,4.261,1473,3.328,1475,3.328,1735,2.789,1741,4.034,1924,2.907,1982,3.786,2701,5.39,3006,5.668,3008,4.411,3009,4.034,3010,4.034,3011,4.034,3012,6.04,3013,4.034,3014,4.034,3015,4.411,3016,4.034]],["t/1436",[3,1.706,33,1.284,35,2.041,37,1.864,48,2.215,49,2.405,50,0.794,51,0.931,59,1.063,80,0.909,81,0.828,104,1.395,106,2.468,107,1.455,108,2.768,109,1.981,110,0.797,111,1.618,112,1.263,130,2.683,139,3.274,174,2.372,175,1.963,177,3.573,225,3.018,256,1.91,327,1.829,401,2.514,414,3.541,441,4.956,483,2.476,504,3.395,686,5.105,717,4.902,823,1.584,1463,3.541,2701,5.324,2943,3.274,3006,3.723,3009,3.968,3010,3.968,3011,7.169,3012,3.968,3017,3.723,3018,3.968,3019,4.339,3020,4.339,3021,3.968,3022,3.968,3023,4.339]],["t/1438",[51,0.867,104,1.509,106,3.208,112,2.469,177,2.975,467,3.097,504,6.637,827,3.767,3017,7.278,3018,7.756,3021,7.756,3022,7.756,3024,8.481]],["t/1440",[3,1.734,37,1.259,48,2.252,50,1.213,51,0.773,104,1.18,109,3.029,111,2.473,167,2.326,177,2.326,231,3.088,259,5.691,470,1.175,504,6.897,537,4.706,717,5.566,1225,5.004,1384,4.192,1387,4.278,1543,5.691,2690,6.065,2937,6.651,2943,5.004,2946,5.691,2947,4.471,2949,5.189,2965,5.691,3013,6.065,3014,6.065,3017,5.691,3025,6.065,3026,6.632,3027,6.632,3028,6.632,3029,6.632]],["t/1442",[3,2.371,20,2.299,50,1.658,225,3.138,760,6.432,919,6.264,920,5.096,2545,6.622,3030,8.29]],["t/1444",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1446",[3,2.219,20,2.151,23,1.976,35,1.466,40,2.477,48,2.127,50,1.552,51,0.902,64,1.699,66,2.456,73,1.605,104,1.509,132,2.782,356,2.917,397,3.574,484,3.071,559,2.241,699,3.574,704,3.14,705,3.071,707,3.098,708,2.576,3030,5.728,3031,6.264,3032,8.484,3033,8.484,3034,6.264,3035,5.728,3036,6.264,3037,6.264,3038,6.264,3039,5.728,3040,6.264]],["t/1448",[51,0.912,60,3.492,185,3.245,467,3.2,3041,8.764,3042,8.764,3043,8.764,3044,8.764,3045,8.764]],["t/1450",[3,1.984,33,2.246,51,0.895,104,1.879,130,3.12,166,6.081,583,4.822,639,8.797,823,2.77,919,6.647,920,5.408,3035,8.797,3039,8.797]],["t/1452",[104,1.776]],["t/1454",[3,2.172,20,2.106,60,3.309,192,5.356,356,3.866,398,4.116,622,3.792,699,4.738,751,5.15,766,3.985,886,7.125,1448,5.15,2518,6.497,3046,8.303,3047,7.125,3048,8.303,3049,8.303]],["t/1456",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1458",[3,1.444,20,1.972,23,1.741,35,1.292,48,1.874,50,1.01,51,0.927,59,1.267,60,3.098,64,1.498,66,2.251,73,1.414,80,1.629,81,1.483,104,1.383,110,1.429,111,2.059,148,2.64,159,2.382,336,4.653,337,3.62,356,2.57,397,3.15,559,1.975,704,2.767,705,2.707,707,2.839,708,2.27,2518,6.083,2697,4.505,3050,5.52,3051,5.52,3052,7.11,3053,5.52,3054,7.775,3055,5.52,3056,5.52]],["t/1460",[3,1.843,33,1.425,35,1.127,49,3.906,50,1.525,51,0.913,80,1.009,81,0.918,104,1.483,106,2.666,107,2.363,108,1.7,109,2.199,110,0.885,111,1.795,112,1.402,130,2.898,147,2.171,225,1.667,327,3.513,346,1.677,359,3.532,461,3.517,501,3.632,751,4.37,771,5.148,823,1.758,943,2.932,965,3.327,1350,5.751,1378,3.632,1482,4.455,1500,3.929,1616,4.403,2518,7.178,2697,8.324,2698,6.444,2850,3.416,3047,4.131,3057,4.814,3058,4.814,3059,4.814,3060,4.814,3061,4.403,3062,4.814,3063,4.814,3064,4.814]],["t/1462",[51,0.838,104,1.613,106,3.429,112,2.639,183,3.138,467,3.31,827,4.026,2697,7.398]],["t/1464",[3,2.043,20,1.981,40,3.089,64,2.119,66,2.261,88,3.02,145,4.457,185,3.628,355,4.526,505,5.266,622,3.567,936,6.374,1072,6.112,1288,4.844,1751,5.038,2082,5.147,2545,5.706,2880,6.112,3065,7.143,3066,7.143,3067,7.811,3068,7.143]],["t/1466",[72,1.311,105,4.173,175,4.404]],["t/1468",[3,1.341,20,1.87,23,1.617,40,2.027,50,1.349,51,0.887,59,0.836,64,1.391,66,2.135,73,1.313,80,1.074,81,0.978,110,0.942,150,3.018,159,1.571,312,2.387,356,2.387,378,4.011,387,2.513,456,5.086,467,2.693,559,1.834,704,2.57,705,2.513,707,1.872,708,2.108,764,4.399,912,3.837,920,2.882,1184,2.541,2140,8.591,2165,3.868,2545,3.745,3065,6.745,3068,4.688,3069,5.127,3070,5.127,3071,5.127,3072,5.127,3073,5.127,3074,5.127,3075,5.127,3076,5.127,3077,5.127,3078,5.127,3079,7.376,3080,7.376,3081,5.127,3082,5.127,3083,5.127,3084,5.127,3085,5.127]],["t/1470",[3,2.501,33,2.225,35,1.759,51,0.912,80,1.574,81,1.433,104,1.871,106,3.617,107,2.519,108,2.653,109,3.432,110,1.381,111,2.802,112,2.188,130,3.932,225,2.601,823,2.744]],["t/1472",[51,0.849,104,1.651,106,3.509,112,2.701,467,3.388,827,4.12]],["t/1474",[3,2.76,14,3.029,20,1.682,35,1.552,48,2.252,50,1.213,84,3.119,109,3.029,132,2.945,147,3.051,220,3.402,244,3.675,261,3.119,307,4.582,314,3.058,484,3.251,518,4.706,751,4.113,793,4.192,914,3.904,1225,5.004,1542,6.065,1751,4.278,2765,5.691,3086,9.649,3087,6.632,3088,6.632,3089,5.691,3090,7.564,3091,6.632,3092,6.632,3093,6.632]],["t/1476",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1478",[3,1.859,20,2.34,23,2.242,35,1.664,39,3.343,48,2.414,50,1.3,51,0.877,64,1.929,66,2.671,73,1.821,104,1.642,314,3.278,356,3.31,397,4.056,559,2.543,704,3.563,705,3.485,707,3.369,708,2.924,3090,7.917,3094,7.109,3095,7.109,3096,7.109]],["t/1480",[3,1.827,33,1.408,35,2.274,37,1.572,39,3.285,40,1.881,51,0.943,60,1.895,80,0.997,81,0.907,88,1.839,104,1.473,106,2.642,107,1.595,108,1.679,109,2.172,110,0.874,111,1.774,112,2.033,130,3.404,148,1.615,216,1.483,225,3.516,300,3.007,314,3.221,470,0.842,500,3.882,751,4.332,823,1.737,985,4.35,1162,3.882,1163,3.007,1721,4.35,1776,3.068,2138,3.287,2736,4.082,2864,5.465,3086,7.569,3090,4.082,3097,7.827,3098,4.756,3099,4.35]],["t/1482",[39,3.989,51,0.867,104,1.509,106,3.208,112,2.469,300,5.361,314,3.911,467,3.097,827,3.767,2138,5.86,2864,6.637,3099,7.756,3100,8.481]],["t/1484",[3,1.947,20,1.888,39,3.5,40,3.758,51,0.742,100,3.061,111,2.776,145,4.247,181,4.247,216,2.321,225,2.577,239,3.247,314,3.432,346,2.593,441,4.705,716,4.533,808,3.963,1173,3.649,1314,4.801,1476,6.807,1751,4.801,1769,4.705,1841,4.382,2772,6.807,3097,6.388,3101,7.443]],["t/1486",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1488",[3,1.518,20,2.042,21,3.376,23,1.831,48,1.971,50,1.691,51,0.847,64,1.575,66,2.331,73,1.487,100,2.387,104,1.433,111,2.164,132,2.578,249,3.312,356,2.702,397,3.312,519,2.877,559,2.077,704,2.909,705,2.846,707,2.12,708,2.387,738,3.051,832,5.308,848,4.01,919,4.01,980,3.535,1175,3.417,1473,4.379,1652,4.819,1728,4.379,1763,4.542,1793,4.119,1798,5.308,3102,4.24,3103,8.052,3104,8.052,3105,5.308,3106,5.804,3107,4.981,3108,5.308,3109,5.804]],["t/1490",[21,1.848,23,1.596,39,4.033,51,0.905,64,1.373,65,2.597,66,1.465,72,0.682,73,1.297,74,2.032,95,1.836,111,1.887,156,3.697,244,4.05,261,2.38,299,2.404,314,3.369,467,2.669,773,3.697,1074,3.412,1175,5.864,1262,5.963,1275,3.199,1277,5.718,1314,4.714,1652,4.374,1717,4.343,1728,3.819,1752,6.999,1763,3.96,2082,4.816,3102,3.697,3107,4.343,3108,4.628,3110,5.061,3111,5.061,3112,4.628,3113,5.061,3114,4.343,3115,5.061,3116,5.514,3117,5.061,3118,5.061,3119,5.061,3120,6.271,3121,5.061,3122,5.061,3123,5.061]],["t/1492",[23,2.489,51,0.923,64,2.14,65,3.504,66,2.284,72,1.062,73,2.021,74,3.168,299,3.748,1199,7.214,1201,7.214,1652,4.722,3102,5.763,3116,5.952,3124,6.438,3125,7.889]],["t/1494",[23,2.44,51,0.919,64,2.099,65,3.461,66,2.239,72,1.042,73,1.982,74,3.106,299,3.674,1205,7.073,1206,7.073,1652,4.63,1779,6.637,3102,5.651,3116,5.836,3124,6.312,3126,7.735,3127,7.735]],["t/1496",[23,2.489,51,0.923,64,2.14,65,3.504,66,2.284,72,1.062,73,2.021,74,3.168,299,3.748,1209,7.214,1210,7.214,1652,4.722,3102,5.763,3116,5.952,3124,6.438,3128,7.889]],["t/1498",[21,2.852,23,2.464,51,0.921,64,2.119,65,3.482,66,2.261,72,1.052,73,2.001,74,3.137,299,3.711,1214,7.143,1652,4.675,3102,5.706,3116,5.894,3124,6.374,3129,7.811,3130,7.811]],["t/1500",[21,2.362,23,2.041,50,1.183,51,0.938,64,1.755,65,3.081,66,1.873,67,3.489,72,0.871,73,1.657,74,2.598,108,2.284,112,1.883,156,4.726,189,3.85,256,2.847,299,3.073,812,3.691,1288,4.012,1564,5.279,1652,3.872,3102,4.726,3116,4.881,3131,6.469,3132,6.469,3133,6.469,3134,6.469,3135,6.469,3136,6.469,3137,8.67,3138,6.469]],["t/1502",[3,1.434,21,1.265,33,1.623,35,2.28,37,1.469,39,4.217,40,1.37,50,1.245,51,0.954,60,2.185,80,0.726,81,0.661,104,1.211,106,2.074,107,1.838,108,1.223,109,1.582,110,1.008,111,1.292,112,1.596,119,2.336,130,3.182,131,1.844,132,1.539,148,1.862,174,1.894,181,1.977,183,1.199,185,2.03,190,1.391,216,1.709,225,3.251,244,1.92,346,2.371,355,2.007,387,1.698,398,1.717,575,2.336,713,3.168,730,2.394,738,2.882,751,2.148,823,1.265,964,2.039,1162,2.827,1277,2.711,1314,4.389,1652,3.282,1728,4.137,1751,2.235,1763,2.711,1769,2.19,1776,2.235,1785,3.168,1787,3.168,1793,3.891,1794,2.973,3097,4.705,3105,3.168,3107,2.973,3120,4.705,3139,3.464,3140,3.464,3141,3.464,3142,3.168,3143,3.464]],["t/1504",[51,0.889,104,1.447,106,3.076,112,2.925,183,2.815,387,3.987,467,2.97,738,4.275,827,3.612,1652,4.868,1728,6.136,1763,6.363,1793,5.771,3120,6.979,3142,7.437]],["t/1506",[3,2.371,73,2.323,148,3.078,185,3.357,216,2.826,760,6.432,986,6.622,1137,7.398,3144,9.065]],["t/1508",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1510",[23,2.37,51,0.927,59,1.225,64,2.039,65,3.398,66,2.175,72,1.012,73,1.925,74,3.018,80,1.574,81,1.433,110,1.381,159,2.302,353,4.498,453,5.88,456,4.424,469,3.249,1729,5.066,3145,7.514,3146,7.514]],["t/1512",[3,1.201,12,1.974,13,5.502,14,1.27,33,0.824,35,2.549,37,1.939,51,0.942,53,1.758,94,2.387,104,1.043,106,1.737,107,2.282,108,0.982,109,1.27,112,0.81,130,1.888,174,1.521,183,2.03,190,1.117,225,3.803,274,4.432,325,2.032,346,3.794,387,2.251,461,2.032,551,2.387,565,1.427,598,2.27,708,1.144,823,1.016,912,1.235,913,2.27,943,2.796,1499,3.345,1691,2.099,1776,1.794,2552,2.544,2553,5.553,2554,1.974,2653,2.544,2654,2.544,3147,4.199,3148,4.199,3149,2.544,3150,4.199,3151,4.199,3152,4.591,3153,4.591,3154,4.591,3155,4.591,3156,4.591,3157,5.361,3158,2.782,3159,2.782,3160,2.544,3161,2.544,3162,2.544,3163,2.544,3164,2.544,3165,2.544,3166,2.544,3167,2.544,3168,2.544]],["t/1514",[51,0.737,104,1.312,174,4.031,274,5.164,387,3.615,467,2.693,598,6.018,827,3.275,912,3.275,943,5.753,2582,6.743,3147,6.743,3148,6.743,3149,6.743,3150,6.743,3151,6.743,3157,6.743,3160,6.743,3161,6.743,3162,6.743,3163,6.743,3164,6.743,3165,6.743,3166,6.743,3167,6.743,3168,6.743]],["t/1516",[3,1.81,20,1.755,51,0.708,147,2.133,148,2.35,177,2.428,180,3.733,317,3.594,417,3.51,470,1.226,515,5.223,565,3.551,607,3.784,622,3.161,914,4.075,943,4.216,1133,3.892,1177,5.223,1412,5.94,1472,5.649,2736,5.94,2880,7.095,3169,7.781,3170,6.922,3171,6.922,3172,6.33,3173,5.94,3174,6.922,3175,6.922,3176,6.922,3177,6.922,3178,5.649,3179,6.922]],["t/1518",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1520",[3,2.149,20,2.564,23,2.592,50,1.503,51,0.789,64,2.229,66,2.927,73,2.105,356,3.826,559,2.94,704,4.119,705,4.029,707,3.001,708,3.379,3180,8.217]],["t/1522",[3181,9.98]],["t/1524",[51,0.926,243,7.175,2863,6.507,3182,9.17,3183,8.386]],["t/1526",[3,1.871,33,1.108,35,2.264,37,1.106,51,0.932,59,0.61,60,2.322,80,0.784,81,0.714,95,1.358,104,1.273,106,2.204,107,1.255,108,2.85,109,2.661,110,0.688,111,1.396,112,1.09,121,3.84,130,2.942,147,1.153,148,2.97,167,1.313,177,3.068,185,1.386,224,2.656,225,3.348,227,1.565,243,5.598,254,2.734,256,1.647,274,2.046,359,1.876,393,1.539,694,2.824,757,2.46,777,1.993,793,3.683,823,1.367,849,2.524,898,6.139,980,2.28,1105,2.656,1227,2.414,1387,2.414,1499,2.136,1599,3.055,1622,2.929,2863,2.656,2882,2.929,2930,2.929,3169,7.95,3184,5.328,3185,5.328,3186,3.423,3187,3.212,3188,5.328,3189,3.743,3190,5.826]],["t/1528",[3,1.283,27,3.959,37,0.931,50,0.897,51,0.928,59,0.799,80,1.028,81,0.935,95,1.779,104,0.873,106,1.855,107,1.644,109,2.24,110,1.548,112,2.694,147,1.511,177,1.72,185,1.816,216,2.227,224,3.48,243,3.837,256,3.144,361,3.48,386,5.829,467,1.791,757,1.687,827,3.741,885,5.589,898,4.208,1105,3.48,1499,2.798,1685,5.589,1692,3.583,2165,5.389,2863,3.48,3003,4.485,3169,4.208,3184,4.485,3185,4.485,3186,6.532,3187,4.208,3188,4.485,3191,4.904,3192,8.424,3193,8.424,3194,4.904,3195,4.485,3196,4.485,3197,4.904]],["t/1530",[3,2.427,83,5.462,132,4.12,177,3.815,358,7,712,5.754]],["t/1532",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1534",[0,4.862,3,1.008,20,0.977,23,1.215,37,0.731,51,0.932,59,0.971,64,1.045,65,2.118,66,1.115,72,0.802,73,0.987,74,1.547,80,0.807,81,1.137,83,3.508,107,1.292,110,1.339,111,1.437,112,1.122,130,2.45,159,1.18,177,3.109,180,3.929,183,1.334,194,2,220,1.976,248,1.559,312,1.794,353,2.306,359,1.931,363,5.497,364,2.907,456,4.289,467,1.407,469,1.666,470,1.055,484,1.889,583,1.931,699,2.198,717,3.35,766,1.849,912,1.711,1151,2.166,1729,4.912,2122,2.907,2852,2.907,2947,2.597,3198,3.306,3199,3.306,3200,3.306,3201,3.306,3202,5.449,3203,5.449,3204,5.449,3205,3.523,3206,3.306,3207,3.306,3208,5.113,3209,3.306,3210,3.306,3211,3.306,3212,5.449,3213,3.523,3214,3.523,3215,3.523,3216,3.306,3217,5.958,3218,3.523,3219,3.306,3220,3.853,3221,3.523,3222,3.853,3223,3.853,3224,3.853]],["t/1536",[23,1.009,37,0.977,50,0.585,51,0.95,59,1.205,64,0.868,65,1.828,66,0.926,67,1.725,72,0.869,73,0.819,74,1.284,80,1.352,81,1.546,83,5.75,104,0.569,106,1.21,107,1.725,108,1.129,110,1.672,111,1.918,112,0.931,159,0.98,177,1.122,183,1.781,191,1.681,231,2.395,329,2.61,353,1.914,359,1.603,378,2.502,453,2.502,456,3.799,464,2.744,467,1.168,665,1.883,697,1.681,699,3.682,717,2.892,912,1.42,1345,2.925,1376,2.502,1482,2.022,1729,2.156,2724,2.744,2852,2.413,2947,2.156,3198,2.744,3199,2.744,3200,2.744,3201,2.744,3202,5.901,3203,5.901,3204,5.901,3205,2.925,3206,2.744,3207,2.744,3208,4.414,3209,2.744,3210,2.744,3211,2.744,3212,2.925,3213,2.925,3214,2.925,3215,2.925,3216,4.414,3218,4.704,3219,4.414,3225,5.144,3226,3.198,3227,5.144,3228,3.198,3229,3.198,3230,3.198,3231,3.198,3232,2.925,3233,3.198,3234,3.198,3235,3.198,3236,3.198,3237,3.198,3238,3.198,3239,3.198]],["t/1538",[23,1.415,37,0.852,51,0.955,59,1.304,64,1.217,65,2.377,66,1.299,72,0.604,73,1.149,74,1.802,80,1.676,81,1.526,83,5.219,107,1.504,110,1.629,111,1.673,112,1.306,148,1.523,159,1.374,177,2.805,183,1.553,353,2.685,359,2.249,405,3.184,406,3.511,453,3.511,456,3.938,464,3.85,537,4.747,565,2.302,697,2.358,699,3.817,912,1.993,1729,3.025,2176,3.278,3198,3.85,3199,3.85,3200,3.85,3201,3.85,3206,3.85,3207,3.85,3208,5.74,3209,3.85,3210,3.85,3211,3.85,3216,3.85,3219,3.85,3240,6.689,3241,6.689,3242,4.487,3243,4.487,3244,4.487]],["t/1540",[3,1.588,33,1.169,35,2.216,37,1.702,48,1.341,50,1.354,51,0.935,53,3.839,59,0.99,104,1.317,105,1.693,106,2.297,107,2.036,108,2.933,109,1.803,112,1.768,130,3.687,147,1.217,148,1.341,177,3.32,225,3.277,238,3.635,346,2.578,357,3.518,359,4.164,361,4.309,362,2.802,379,4.956,380,3.01,381,4.094,382,1.936,392,2.802,393,1.624,401,2.288,402,3.389,403,3.611,404,5.211,405,2.802,406,3.09,597,3.09,708,1.624,823,1.442,2947,4.094,2956,3.389,2957,3.389,2958,3.611,2959,3.611,2960,3.389,3245,3.949,3246,3.949]],["t/1542",[51,0.934,59,1.614,80,1.847,81,1.681,104,1.18,110,1.82,148,2.252,177,2.326,180,3.577,189,3.915,286,4.278,357,3.842,379,5.412,381,4.471,382,3.251,392,4.706,404,5.691,406,5.189,467,2.422,827,2.945,2947,4.471,3247,6.632,3248,6.632,3249,6.632,3250,6.632]],["t/1544",[3,2.506,20,1.576,35,1.975,44,3.968,50,1.753,64,1.686,100,2.556,129,2.711,147,1.915,180,4.551,213,4.009,256,2.735,300,3.929,312,2.894,317,3.227,356,2.894,455,3.601,470,1.101,484,4.137,563,3.494,665,3.659,699,3.546,757,2.137,760,4.41,779,2.421,793,3.929,887,3.854,931,5.072,953,5.988,1074,4.19,1153,3.929,1448,3.854,1548,4.41,2758,5.333,2881,4.863,3251,6.215,3252,6.215,3253,5.683,3254,6.215,3255,6.215]],["t/1546",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1548",[3,1.454,20,1.981,23,1.754,35,1.301,37,1.055,48,1.888,50,1.017,51,0.928,59,0.906,64,1.508,66,2.262,73,1.424,80,1.893,81,1.723,104,1.39,106,2.103,107,1.864,110,1.66,222,3.945,230,2.696,356,2.588,382,2.726,397,3.172,559,1.989,704,2.787,705,2.726,707,2.853,708,2.286,757,1.912,1008,3.273,1105,3.945,1222,4.061,2138,3.841,2703,4.061,2871,3.663,3256,5.559,3257,5.559,3258,4.771,3259,5.559,3260,4.771,3261,5.559,3262,5.559]],["t/1550",[50,1.128,51,0.883,56,4.063,147,2.586,181,3.518,213,3.977,230,2.991,249,3.518,382,4.115,470,1.092,509,4.063,512,7.676,769,3.467,771,4.505,841,5.032,887,3.824,895,6.333,1071,4.505,1105,4.375,1222,4.505,1607,7.676,2138,4.261,3258,5.291,3263,5.291,3264,8.727,3265,6.166,3266,5.291,3267,6.166,3268,6.166,3269,6.166,3270,7.676,3271,8.394,3272,8.394,3273,6.166]],["t/1552",[3,1.898,33,0.917,35,2.323,37,0.952,48,1.702,49,1.717,50,1.155,51,0.951,53,1.958,59,0.505,60,1.234,80,1.323,81,1.205,104,1.124,105,1.328,106,1.896,107,2.118,108,1.094,109,1.415,110,1.161,111,2.355,112,0.902,121,2.041,128,2.485,129,1.351,130,2.062,147,2.236,175,1.401,177,1.086,183,1.736,190,1.244,216,1.563,220,1.589,225,1.072,227,1.295,253,1.536,254,2.263,259,4.302,364,3.783,382,2.458,393,2.985,417,1.571,442,1.824,470,0.549,484,1.519,565,1.589,575,2.089,757,1.724,766,1.487,784,1.742,793,3.169,823,1.831,850,1.854,912,1.376,942,2.337,953,4.481,964,1.824,1037,2.658,1788,2.198,2122,2.337,2138,3.464,2140,4.302,2370,2.833,2703,3.663,2856,3.923,2863,2.198,2871,3.304,2878,2.833,2881,2.424,2882,2.424,2930,2.424,3260,4.302,3263,2.658,3264,2.833,3266,4.302,3270,2.833,3274,3.098,3275,3.098,3276,2.833,3277,2.833,3278,2.833,3279,3.098,3280,3.098]],["t/1554",[37,1.35,51,0.915,59,1.159,80,1.933,81,1.76,104,1.265,110,1.696,183,3.194,382,3.485,467,2.596,827,3.157,912,3.157,942,5.364,2138,4.912,2703,5.193,2863,5.044,2871,4.685,3260,6.1,3266,6.1,3276,6.501,3277,6.501,3278,6.501,3281,7.109]],["t/1556",[50,1.586,51,0.875,64,2.352,757,4.097,1119,6.782,1120,7.073,3258,7.438]],["t/1558",[3,2.427,20,2.353,185,3.436,261,4.363,307,6.411,2122,7,3282,9.278]],["t/1560",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1562",[3,1.32,12,2.216,20,1.28,23,0.985,35,1.181,37,0.593,39,3.429,48,2.476,50,0.571,51,0.932,59,0.509,64,0.847,66,1.461,73,0.8,80,0.654,81,0.962,95,2.303,104,1.13,110,0.574,111,1.164,112,0.909,147,0.962,189,2.82,190,1.254,192,2.014,193,3.297,225,1.081,248,1.264,256,1.374,261,3.429,271,0.997,309,1.684,312,1.454,327,1.316,356,1.454,397,1.781,491,2.105,505,4.916,519,2.501,521,2.216,559,1.117,589,1.602,625,2.855,634,2.057,704,1.565,705,1.531,707,1.843,708,1.284,766,1.499,809,1.514,923,2.548,1020,2.014,1288,3.129,1299,3.686,1322,3.486,1380,2.679,1497,2.679,1619,2.855,1692,2.281,1738,2.548,1984,2.855,2678,2.548,2704,2.356,2753,2.679,3178,2.548,3283,2.855,3284,2.281,3285,3.122,3286,2.855,3287,3.122,3288,9.01,3289,2.855,3290,4.118,3291,2.855,3292,4.33,3293,3.122,3294,3.122,3295,5.449,3296,5.449,3297,3.122,3298,2.855,3299,2.855,3300,2.679,3301,3.122,3302,3.122,3303,3.122,3304,3.122,3305,3.122,3306,2.855,3307,3.122,3308,3.122,3309,3.122,3310,2.855,3311,2.855,3312,2.855,3313,3.122,3314,3.122,3315,3.122,3316,2.855,3317,3.122,3318,3.122,3319,2.679]],["t/1564",[3,1.359,33,1.538,35,2.296,37,1.736,48,1.099,51,0.936,59,0.528,80,1.088,81,1.241,95,1.174,104,1.158,106,1.965,107,2.497,108,1.834,109,1.478,110,0.595,111,1.207,112,1.512,130,3.353,147,0.998,151,1.605,183,1.121,190,1.3,193,1.681,220,1.661,225,3.165,227,1.353,253,1.605,256,1.425,261,3.834,271,1.033,327,1.365,416,1.906,417,2.634,429,1.321,505,3.502,583,1.623,688,2.088,823,1.182,887,2.008,1156,2.443,1177,2.443,1299,5.44,1322,3.589,1380,4.458,1381,2.642,1543,2.778,1692,3.795,2124,2.778,2377,2.365,2640,2.443,2678,2.642,3290,2.642,3295,4.458,3296,4.458,3299,2.96,3300,2.778,3306,2.96,3310,2.96,3311,2.96,3312,2.96,3316,2.96,3319,4.458,3320,3.237,3321,5.195,3322,2.237,3323,3.237,3324,3.237,3325,2.96,3326,3.237,3327,3.237,3328,4.751,3329,2.96,3330,3.237,3331,2.96,3332,3.237,3333,3.237,3334,3.237,3335,3.237,3336,3.237,3337,3.237]],["t/1566",[51,0.821,95,2.725,104,1.337,106,2.842,111,2.802,112,2.783,193,3.901,417,3.81,467,2.744,505,5.066,688,4.847,827,3.337,1299,5.489,1692,5.489,2124,6.448,2377,5.489,3290,6.132,3295,6.448,3296,6.448,3319,6.448,3322,5.192,3325,6.872,3328,6.872,3331,6.872]],["t/1568",[40,1.324,50,0.612,51,0.972,59,0.545,60,2.651,61,3.097,95,1.214,147,2.855,148,2.577,150,3.916,151,1.659,186,2.731,193,2.77,248,1.355,249,1.91,307,2.313,314,1.543,331,2.872,401,3.091,417,1.697,589,1.717,607,1.829,688,2.159,717,2.999,722,2.525,779,1.304,817,1.659,920,1.882,2176,2.445,2662,3.061,2678,2.731,2704,4.025,3292,2.872,3322,2.313,3338,3.347,3339,3.347,3340,3.347,3341,3.347,3342,3.347,3343,5.335,3344,3.347,3345,3.347,3346,3.347,3347,3.347,3348,3.347,3349,3.347,3350,3.347,3351,3.347,3352,6.652,3353,4.879,3354,3.347,3355,3.347,3356,3.347,3357,3.347,3358,3.347,3359,3.347,3360,3.347,3361,3.347,3362,3.347,3363,3.347,3364,3.347,3365,3.347,3366,3.347,3367,3.347,3368,3.347,3369,3.347,3370,3.347,3371,3.347,3372,3.347,3373,3.347,3374,3.347,3375,3.347,3376,3.347,3377,3.347,3378,3.347,3379,3.347,3380,3.347,3381,3.347,3382,3.347,3383,3.347,3384,3.347,3385,3.347,3386,3.347]],["t/1570",[3,2.172,20,2.106,180,4.478,192,5.356,193,4.311,588,6.497,622,3.792,877,6.265,965,5.737,1538,5.356,1700,7.593,1841,4.888,3387,10.063,3388,7.125,3389,8.303]],["t/1572",[72,1.311,105,4.173,175,4.404]],["t/1574",[3,2.319,20,1.934,23,1.694,35,1.257,48,1.824,50,0.982,51,0.884,64,1.457,66,2.207,73,1.376,104,1.357,110,0.987,149,3.539,180,2.896,192,3.464,244,2.976,356,2.501,397,3.064,456,3.161,463,3.923,559,1.921,562,3.621,665,3.161,704,2.692,705,2.633,707,2.784,708,2.209,1191,3.112,1499,3.064,1600,6.543,1730,5.268,3292,4.609,3388,8.281,3390,5.37,3391,7.625,3392,5.37,3393,7.625,3394,5.37,3395,5.37,3396,5.37,3397,5.37,3398,5.37,3399,4.911,3400,5.37,3401,5.37,3402,5.37,3403,5.37,3404,5.37]],["t/1576",[3,1.632,20,1.038,33,1.211,35,2.338,37,1.73,40,3.346,48,1.389,50,1.142,51,0.945,80,0.857,81,0.781,104,1.346,106,2.361,107,2.092,108,1.445,109,1.869,110,0.752,111,1.526,112,1.191,130,2.566,180,2.207,183,1.416,194,2.125,214,2.827,225,3.457,227,1.71,314,2.877,461,2.989,583,3.128,649,3.202,738,2.151,772,2.696,823,1.494,855,2.538,964,2.409,1139,2.099,1191,3.616,1195,3.087,1238,2.371,1480,2.989,1650,5.355,1730,2.827,2545,2.989,3387,5.707,3388,3.511,3405,5.707,3406,4.092,3407,3.742,3408,4.092,3409,3.742,3410,5.707,3411,4.092,3412,4.092,3413,5.707,3414,4.092,3415,4.092]],["t/1578",[51,0.821,104,1.337,106,2.842,112,2.188,183,2.601,467,2.744,738,3.95,827,3.337,1191,4.354,3405,6.872,3407,6.872,3409,6.872,3410,6.872,3413,6.872,3416,9.561,3417,9.561,3418,9.561,3419,9.561,3420,9.561,3421,7.514]],["t/1580",[3,1.965,20,1.906,40,2.972,64,2.039,66,2.175,88,2.905,145,4.287,185,3.54,256,3.307,505,5.066,622,3.432,667,6.132,936,6.132,1072,5.88,1288,4.66,1317,5.489,1751,4.847,2082,4.952,2880,5.88,3066,6.872,3422,9.561,3423,7.514,3424,7.514,3425,6.872,3426,6.448]],["t/1582",[72,1.311,105,4.173,175,4.404]],["t/1584",[3,1.613,20,2.129,23,1.945,35,1.965,40,2.438,48,2.094,50,1.128,51,0.863,64,1.673,66,2.43,73,1.58,104,1.493,309,3.326,314,3.87,356,2.871,397,3.518,470,1.092,559,2.206,665,5.618,697,3.241,704,3.091,705,3.023,707,3.065,708,2.536,730,4.261,1133,3.467,1241,3.755,1769,6.032,1859,5.639,3426,5.291,3427,6.166,3428,6.166,3429,6.166,3430,6.166,3431,6.166]],["t/1586",[3,2.184,20,1.552,33,1.811,35,1.955,37,1.162,51,0.936,80,1.282,81,1.167,104,1.691,106,3.158,107,2.051,108,2.16,109,2.794,110,1.125,111,2.282,112,1.781,130,3.909,220,3.139,225,2.89,314,2.821,470,1.084,484,3,730,4.228,823,2.234,1330,3.795,1480,4.47,1769,6.008,3426,5.251,3432,6.118,3433,6.118]],["t/1588",[51,0.849,104,1.651,106,3.509,112,2.701,467,3.388,827,4.12]],["t/1590",[3,2.398,20,2.326,147,2.826,565,4.704,622,4.188,1133,5.155,2492,7.891]],["t/1592",[37,1.849,51,0.76,55,2.531,59,1.261,60,3.743,72,1.312,81,1.476,104,0.616,105,3.317,147,2.894,185,3.803,190,1.391,222,2.458,226,3.177,227,1.448,317,4.877,435,1.169,536,2.531,559,1.239,622,1.582,712,3.4,769,6.228,896,4.29,914,5.278,962,2.711,1037,2.973,1057,6.88,1133,1.948,1788,2.458,1887,4.705,2137,5.014,2139,2.336,2554,2.458,2754,5.84,3434,3.464,3435,3.464,3436,8.431,3437,3.464,3438,8.589,3439,3.464,3440,3.464,3441,3.464,3442,3.464,3443,3.464,3444,2.973,3445,3.464,3446,3.464,3447,3.464,3448,3.464,3449,3.464,3450,2.973,3451,2.973,3452,3.464]],["t/1594",[3,0.584,20,0.968,23,0.704,37,0.724,48,1.697,50,1.416,51,0.945,55,1.631,59,1.18,60,2.357,64,0.606,66,1.105,73,0.572,80,1.517,81,1.381,88,0.863,110,1.622,111,2.478,112,2.57,147,1.822,148,2.008,185,1.851,189,4.147,191,1.173,220,1.958,222,4.197,226,1.293,230,1.083,239,2.58,250,1.542,253,1.106,314,2.727,317,1.981,356,1.039,384,1.584,397,1.273,417,1.132,559,1.365,622,3.534,688,1.44,699,1.273,704,1.119,705,1.094,707,0.815,708,0.918,855,1.384,867,1.821,896,1.746,937,2.041,942,2.879,964,1.314,1067,1.915,1068,1.584,1151,1.255,1173,1.094,1411,5.075,1419,2.041,1473,1.684,1475,1.684,1714,1.915,1729,1.505,1795,1.821,1974,1.915,2139,1.505,2492,3.651,2498,1.821,2554,1.584,2703,1.631,2704,1.684,2754,4.289,3438,2.041,3450,1.915,3451,1.915,3453,2.232,3454,3.816,3455,2.232,3456,2.232,3457,2.232,3458,2.232,3459,3.816,3460,3.816,3461,3.816,3462,3.816,3463,2.232,3464,2.232,3465,2.232,3466,2.232,3467,2.232,3468,2.232,3469,6.645,3470,4.998,3471,2.232,3472,2.232,3473,2.232,3474,2.232,3475,2.041,3476,2.232,3477,3.816,3478,4.998,3479,4.998,3480,4.998,3481,1.915,3482,2.232,3483,2.041,3484,2.232,3485,2.232]],["t/1596",[3,1.41,33,1.004,35,1.789,37,0.644,48,1.151,50,1.227,51,0.936,60,2.148,80,0.71,81,0.647,104,1.484,105,2.311,106,2.039,107,1.137,108,1.197,109,1.548,110,0.623,111,1.264,112,1.953,130,2.759,131,1.805,147,2.067,148,1.83,174,1.853,185,1.996,190,2.164,216,1.057,225,2.646,226,4.429,227,1.417,253,1.68,317,5.018,442,1.996,470,0.6,484,1.662,565,2.765,622,3.491,694,5.062,717,1.906,784,3.03,823,1.238,849,2.286,912,1.506,953,2.406,964,1.996,968,2.558,980,2.065,984,2.143,987,2.286,996,2.558,1051,4.217,1089,3.634,1110,5.249,1318,2.909,1441,3.1,1795,4.398,1796,4.929,2492,2.477,2730,4.929,2755,4.929,2756,4.929,2757,3.1,2758,2.909,2759,3.1,2777,4.929,3450,2.909,3451,2.909,3481,4.625,3486,3.39,3487,3.39,3488,3.39,3489,3.39,3490,3.39]],["t/1598",[51,0.815,104,1.542,106,3.279,112,3.264,226,5.022,467,3.165,827,3.849,1795,7.073,3481,7.438,3491,8.667]],["t/1600",[3,2.292,20,2.222,145,5,217,8.581,381,5.908,1445,6.857,1456,7.52,1776,5.653,1893,6.612,3492,7.52,3493,7.52]],["t/1602",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1604",[3,2.385,20,2.313,23,2.203,35,1.635,50,1.277,51,0.894,59,1.486,64,1.895,66,2.64,73,1.789,80,1.463,81,1.332,104,1.243,159,2.139,356,3.251,559,2.499,704,3.5,705,3.424,707,3.33,708,2.872,3492,5.993,3494,6.386,3495,6.386,3496,6.386,3497,6.983]],["t/1606",[3,2.117,33,1.731,35,2.173,51,0.929,80,1.696,81,1.544,104,1.651,106,3.061,107,2.713,108,2.857,109,2.67,110,1.075,111,2.18,112,1.702,129,2.551,130,3.817,145,4.618,181,3.336,183,2.024,225,3.213,823,2.135,1893,6.106,1916,6.332,3498,7.401,3499,7.401,3500,5.347,3501,4.772]],["t/1608",[51,0.826,104,1.577,106,3.352,112,2.58,183,3.068,467,3.236,827,3.936,3498,8.104,3499,8.104,3500,8.104]],["t/1610",[3,2.546,20,2.469,2139,6.563]],["t/1612",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1614",[23,1.93,51,0.943,59,1.361,64,1.66,65,2.967,66,1.771,72,0.824,73,1.568,74,2.457,80,1.749,81,1.593,110,1.535,166,3.868,175,2.768,336,3.662,337,2.849,353,3.662,456,4.915,469,2.646,1697,4.788,1749,4.993,2270,5.251,2856,4.788,3502,6.118,3503,6.118,3504,7.165,3505,5.595,3506,7.165,3507,5.595,3508,5.595,3509,5.595]],["t/1616",[3,1.956,33,1.548,35,1.751,40,2.068,51,0.932,53,3.305,104,1.554,106,1.978,107,1.753,108,1.846,109,2.388,112,1.522,130,3.592,146,3.613,166,3.305,174,2.858,175,2.365,180,2.82,190,2.1,193,2.715,194,2.715,225,2.589,231,2.434,314,2.411,346,1.822,378,4.091,470,0.926,518,3.71,738,2.748,823,1.909,912,3.322,929,4.091,1020,3.372,1583,4.781,1697,6.834,2139,5.043,2273,4.091,2856,4.091,3504,4.487,3510,4.781,3511,4.091,3512,5.228,3513,5.228,3514,5.228,3515,5.228,3516,4.781,3517,5.228,3518,5.228]],["t/1618",[51,0.849,104,1.651,467,3.388,827,4.12,2856,7.26,3516,8.484]],["t/1620",[3,2.455,20,2.381,60,3.741,309,5.063,3519,8.056,3520,9.388]],["t/1622",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1624",[3,1.734,20,2.235,23,2.092,35,1.552,37,1.259,48,2.993,49,3.675,50,1.213,51,0.9,64,1.799,66,2.552,72,0.893,73,1.699,104,1.568,110,1.219,148,2.993,356,3.088,397,3.784,559,2.373,634,4.37,704,3.324,705,3.251,707,3.219,708,2.727,1499,3.784,1752,5.412,3291,6.065,3521,6.632,3522,6.632]],["t/1626",[3,1.911,33,1.498,35,2.199,37,1.387,49,4.753,50,0.926,51,0.933,72,0.682,80,1.06,81,0.965,104,1.526,106,2.764,107,1.697,108,2.58,109,2.311,110,0.93,111,1.887,112,1.473,129,2.208,130,3.863,147,2.894,148,2.912,177,2.563,225,3.251,392,5.185,393,2.081,414,5.963,634,5.652,688,3.264,823,1.848,1151,2.845,1499,2.888,2849,4.343,2953,3.96,3519,4.343,3523,5.061]],["t/1628",[35,1.695,49,5.727,50,1.708,51,0.729,104,1.661,106,2.738,112,2.107,147,2.231,148,2.458,346,2.522,392,5.137,467,2.644,622,3.306,827,3.215,850,4.333,857,5.664,1472,5.907,2545,5.288,2927,6.212,2953,5.664,3187,6.212,3519,6.212,3524,7.239,3525,7.239,3526,6.212,3527,7.239]],["t/1630",[3,2.195,34,5.204,40,3.318,132,3.727,314,3.869,435,2.831,712,5.204,766,4.028,836,5.955,1137,6.848,1697,6.566,2663,6.848,3510,9.366,3528,8.391,3529,8.391]],["t/1632",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1634",[23,1.96,51,0.945,59,1.375,64,1.686,65,2.999,66,1.799,72,0.837,73,1.592,74,2.496,80,1.768,81,1.61,110,1.551,166,3.929,175,2.811,336,3.72,337,2.894,353,3.72,456,4.968,469,2.687,1697,4.863,1749,5.072,3504,7.241,3505,5.683,3506,7.241,3507,5.683,3508,5.683,3509,5.683,3530,6.215,3531,6.215]],["t/1636",[3,2.787,20,1.962,35,1.811,44,4.579,50,1.415,64,2.099,100,3.181,129,3.374,213,4.989,256,3.404,312,3.601,470,1.37,484,3.792,757,2.66,760,5.488,793,4.889,1074,5.215,1153,4.889,1448,4.797,1548,5.488,2961,5.836]],["t/1638",[21,1.848,33,1.498,37,1.891,59,1.623,72,1.576,81,0.965,104,0.9,107,1.697,129,4.097,177,1.775,346,1.763,393,4.096,634,3.335,703,2.248,745,6.339,770,2.805,774,2.805,775,2.805,778,2.845,779,1.971,953,3.591,1448,3.139,1680,4.343,1841,2.979,2961,8.55,3532,5.061,3533,5.061,3534,4.628,3535,5.061,3536,4.628,3537,5.061]],["t/1640",[3,1.141,20,1.661,23,1.376,35,1.021,50,0.798,51,0.961,59,0.711,64,1.184,66,1.896,73,1.118,80,0.914,81,0.832,104,0.776,110,0.802,112,2.29,159,1.337,167,2.297,177,2.759,189,4.37,216,2.042,231,2.031,346,1.52,356,2.031,382,2.139,393,2.694,432,2.418,491,2.941,559,1.561,704,2.187,705,2.139,707,2.392,708,1.794,757,1.5,776,2.706,876,3.99,1151,2.453,1448,2.706,1564,6.419,2961,7.07,3534,3.99,3538,4.363,3539,4.363,3540,4.363,3541,4.363,3542,4.363,3543,4.363,3544,4.363,3545,4.363,3546,4.363,3547,4.363,3548,4.363,3549,4.363,3550,4.363]],["t/1642",[3,0.836,33,0.947,35,2.347,37,1.797,40,1.265,49,1.772,50,0.941,51,0.935,72,0.431,104,1.148,107,2.164,111,1.193,129,1.395,130,2.116,147,0.985,167,1.122,177,1.122,183,2.234,185,1.184,186,2.61,214,2.21,216,0.997,225,3.47,227,1.337,256,1.408,346,3.636,382,2.522,393,1.315,401,1.853,402,2.744,518,2.269,565,1.641,597,2.502,606,1.725,634,3.39,708,1.315,717,4.866,757,1.769,805,1.702,823,1.168,835,4.869,897,2.336,986,2.336,1001,2.61,1788,2.269,2554,2.269,2850,3.65,2871,3.39,2882,2.502,2915,2.502,2937,5.579,2947,4.351,2949,2.502,2950,2.61,2951,2.413,2952,2.336,2956,2.744,2957,2.744,2960,2.744,2961,6.531,2962,2.925,2963,2.925,2964,2.925,2965,2.744,2966,2.61,2967,2.925,2968,2.925,2969,2.925,3526,2.744,3551,2.925,3552,2.925,3553,2.925]],["t/1644",[51,0.859,104,1.477,382,4.071,467,3.032,717,4.668,827,3.688,835,6.265,2871,5.472,2947,5.598,2952,6.066,3526,7.125,3551,7.593,3552,7.593,3553,7.593,3554,8.303]],["t/1646",[51,0.924,148,2.88,150,4.993,717,4.768,835,8.38,2176,6.196,3555,8.481,3556,8.481,3557,8.481]],["t/1648",[50,1.838,51,0.889,64,2.206,312,3.787,393,4.132,470,1.44,757,4.024,1119,6.363,1120,6.637,3558,8.133]],["t/1650",[3,2.398,20,2.326,88,3.546,109,4.933,111,3.42,2775,7.869,3559,9.17]],["t/1652",[72,1.235,80,1.921,81,1.749,105,4.631,107,3.075,1225,6.919,3560,8.386]],["t/1654",[3,1.454,20,1.981,23,1.754,50,1.017,51,0.921,59,1.273,64,1.508,65,1.976,66,2.262,72,1.052,73,2.002,74,2.233,81,1.723,95,2.834,107,1.864,109,2.539,110,1.66,142,5.399,145,3.172,147,2.784,156,4.061,159,1.703,248,2.25,299,2.641,356,2.588,470,0.985,485,4.194,559,1.989,572,5.084,704,2.787,705,2.726,707,2.03,708,2.286,2932,5.084,3284,4.061,3561,5.559,3562,5.559,3563,7.813,3564,5.559]],["t/1656",[3,1.434,20,1.39,50,1.003,59,1.261,88,2.12,105,3.317,110,1.422,128,2.717,145,3.128,151,2.717,175,2.48,185,2.03,186,4.474,187,2.717,216,2.412,222,5.49,226,5.951,238,4.631,253,2.717,329,4.474,380,4.444,381,5.216,429,3.156,435,1.85,483,3.128,509,5.098,654,3.89,769,4.349,824,3.339,1378,4.136,1707,4.704,1788,5.49,1841,3.227,2131,7.075,2775,4.704,2930,4.29,3493,6.639,3565,5.482,3566,5.482,3567,5.482,3568,5.482,3569,5.482,3570,5.013,3571,5.482,3572,5.013,3573,5.482,3574,4.704]],["t/1658",[59,1.669,72,1.379,105,4.935,226,5.934,227,4.282,3560,7.674,3575,10.242,3576,8.391]],["t/1660",[3,0.66,20,1.074,23,0.796,48,0.857,50,0.775,51,0.962,59,1.404,64,0.685,65,1.944,66,1.226,67,2.951,72,0.961,73,1.641,74,2.197,80,0.887,81,1.044,88,0.976,110,1.747,112,2.607,142,1.744,147,1.305,185,1.568,189,3.431,227,1.77,238,1.511,253,1.251,299,2.599,356,1.175,380,2.099,391,2.166,456,3.771,463,3.094,467,0.922,469,1.831,513,3.456,559,0.903,654,3.005,682,3.901,704,1.265,705,1.238,707,0.922,708,1.038,824,2.579,1828,2.166,2165,3.195,2314,2.308,2565,3.314,3196,3.873,3574,2.166,3577,2.524,3578,6.405,3579,4.235,3580,3.005,3581,2.524,3582,4.235,3583,2.524,3584,4.235,3585,2.524,3586,4.235,3587,4.235,3588,4.235,3589,4.235,3590,6.405,3591,2.524,3592,2.524,3593,2.524,3594,5.471,3595,2.524,3596,2.524,3597,2.524,3598,2.524,3599,2.308,3600,2.524,3601,2.524,3602,5.471,3603,2.524,3604,2.524,3605,2.524,3606,6.405,3607,2.524,3608,2.524,3609,2.524,3610,2.524]],["t/1663",[0,4.474,20,1.39,44,2.578,49,3.038,51,0.428,114,2.578,128,2.717,132,2.435,179,3.227,213,3.536,233,3.339,240,3.788,244,3.038,355,3.176,356,2.553,380,2.717,469,2.371,471,4.005,476,4.474,482,2.997,622,2.504,697,2.882,705,3.793,761,4.704,822,2.748,833,5.013,835,4.136,887,3.4,914,3.227,915,4.136,1090,4.474,1347,4.474,1350,4.474,1364,4.29,1459,4.29,1999,4.704,2880,4.29,3253,5.013,3511,4.29,3611,5.482,3612,5.013,3613,5.482,3614,5.482,3615,5.482,3616,5.482,3617,5.482,3618,5.482,3619,5.482,3620,5.482,3621,5.482,3622,5.013,3623,5.013,3624,5.013,3625,5.482,3626,5.482,3627,5.482,3628,5.482,3629,5.482,3630,5.482,3631,5.482,3632,5.482,3633,5.482,3634,5.482,3635,5.013,3636,5.482]],["t/1665",[20,1.516,50,1.094,60,3.743,147,2.533,174,3.269,185,2.214,248,2.42,312,2.784,469,3.554,521,4.243,675,5.131,759,4.368,771,4.368,914,4.839,919,4.132,964,4.839,965,5.679,1089,5.541,1167,5.131,1223,6.201,1413,5.468,1489,5.131,1538,3.857,1695,5.468,1733,5.468,2158,5.131,3322,5.679,3580,5.832,3612,5.468,3635,5.468,3637,8.219,3638,5.98,3639,5.468,3640,5.98,3641,5.98,3642,5.468,3643,5.98,3644,5.98,3645,5.98,3646,5.98,3647,5.98,3648,5.98]],["t/1667",[20,2.041,60,3.978,145,5.696,964,5.877,1089,6.731,1223,7.533,1538,5.192,3322,6.898,3580,7.084,3649,8.05,3650,8.05,3651,8.05,3652,8.05]],["t/1669",[20,2.041,60,3.978,145,5.696,964,5.877,1089,6.731,1223,7.533,1538,5.192,3322,6.898,3580,7.084,3653,8.05,3654,8.05,3655,8.05,3656,8.05]],["t/1671",[20,2.041,60,3.978,145,5.696,964,5.877,1089,6.731,1223,7.533,1538,5.192,2339,7.361,3322,6.898,3580,7.084,3657,8.05,3658,8.05,3659,8.05]],["t/1673",[20,2.041,60,3.978,145,5.696,964,5.877,1089,6.731,1223,7.533,1538,5.192,3322,6.898,3580,7.084,3660,8.05,3661,8.05,3662,8.05,3663,8.05]],["t/1675",[4,3.79,21,1.769,51,0.553,88,1.873,121,5.512,181,4.039,185,2.621,317,3.675,356,3.895,387,2.375,417,4.665,469,4.421,483,2.764,622,3.233,682,2.95,697,4.397,705,2.375,809,2.35,822,2.428,900,4.43,955,4.43,1090,5.777,1105,3.437,1124,5.539,1153,4.475,1217,4.43,1472,5.777,1685,5.539,2377,3.539,2685,6.473,3322,3.347,3399,4.43,3483,4.43,3580,6.945,3622,4.43,3623,4.43,3624,4.43,3642,6.473,3664,4.844,3665,4.844,3666,4.844,3667,4.844,3668,4.844,3669,4.844,3670,4.844,3671,4.844,3672,7.079,3673,7.079,3674,4.844,3675,4.844,3676,4.43,3677,4.844,3678,4.844]],["t/1678",[4,5.146,20,2.223,39,3.093,50,1.203,63,6.014,179,5.16,180,3.547,239,2.869,242,6.014,248,2.662,470,1.165,559,2.353,673,3.457,698,6.614,708,2.705,877,4.962,1151,3.697,1203,5.146,1293,5.644,1314,4.242,1320,5.644,1459,5.146,1519,5.146,2733,6.014,2765,5.644,2876,6.014,3679,8.766,3680,6.014,3681,6.577,3682,6.577,3683,6.577,3684,6.577,3685,6.577,3686,6.577,3687,6.577,3688,6.577,3689,6.577,3690,6.577]],["t/1680",[3,1.625,48,2.11,50,1.544,51,0.659,59,1.751,60,2.477,81,1.185,88,3.263,108,2.979,110,1.142,128,3.081,145,4.815,249,3.546,309,3.352,312,3.929,470,1.101,699,4.815,766,2.983,834,5.683,935,6.886,1153,5.334,1366,5.072,1818,4.41,1893,4.689,2122,4.689,2302,6.603,3061,5.683,3511,4.863,3691,5.683,3692,6.215,3693,6.215,3694,5.683,3695,6.215,3696,6.215,3697,6.215]],["t/1682",[0,3.069,20,2.354,21,2.62,39,3.374,50,1.481,51,0.849,121,2.478,167,1.319,179,4.224,192,3.772,194,3.036,213,4.628,239,2.551,371,1.67,435,1.973,470,1.271,476,3.069,483,2.146,559,2.092,575,2.536,766,1.805,835,5.414,881,6.158,915,2.838,919,2.599,951,4.272,1031,3.439,1084,2.748,1139,1.929,1196,3.069,1203,5.615,1241,2.29,1314,2.426,1330,2.332,1353,3.439,1367,2.943,1372,3.227,1384,2.377,1414,3.439,1496,5.348,1652,2.251,1687,2.838,1691,2.838,1730,2.599,1779,3.227,2750,3.439,3047,5.018,3329,3.439,3425,5.348,3580,2.669,3599,3.439,3639,3.439,3676,3.439,3698,10.289,3699,3.439,3700,5.348,3701,3.761,3702,3.439,3703,3.761,3704,3.761,3705,5.848,3706,3.761,3707,3.761,3708,3.761,3709,5.848,3710,3.761,3711,5.848,3712,3.761,3713,3.761,3714,3.761,3715,3.761,3716,3.761,3717,3.761,3718,3.761,3719,3.761,3720,3.761]],["t/1684",[20,2.286,35,2.111,51,0.835,59,1.81,73,1.758,80,1.438,81,1.309,88,2.653,104,1.221,110,1.261,132,3.048,145,5.144,175,3.104,189,3.048,233,4.179,312,3.195,381,4.626,470,1.215,707,2.506,846,5.396,1186,3.751,1384,4.338,1730,4.741,1999,5.889,3721,6.862,3722,6.862]],["t/1686",[3,2.043,20,2.485,50,1.429,56,5.147,100,3.212,114,5.035,312,3.637,560,3.673,766,3.749,1139,4.007,1140,5.894,1141,5.894,1142,5.543,1143,6.112,1144,5.894,1145,5.706,1146,5.894,1194,6.703,2215,5.543,3723,7.811]],["t/1688",[51,0.784,57,6.363,191,4.275,622,3.714,762,5.771,836,5.771,947,7.437,1475,6.136,2082,5.359,2888,7.437,3680,7.437,3724,7.437,3725,8.133,3726,8.133,3727,8.133,3728,8.133,3729,7.437,3730,8.133]],["t/1690",[20,0.927,23,1.153,27,2.027,33,1.082,51,0.966,59,1.299,64,0.992,65,2.033,66,1.059,72,0.492,73,0.937,74,3.201,80,1.477,81,1.521,95,2.556,101,2.189,110,1.59,112,1.666,180,3.086,193,3.659,261,1.72,299,1.737,394,2.311,470,1.013,505,4.751,515,2.759,606,1.972,607,1.999,622,1.67,699,2.086,766,1.755,817,4.289,823,1.335,1384,2.311,1748,3.344,1818,2.595,2498,2.984,2807,3.138,3283,3.344,3289,6.445,3290,5.751,3724,3.344,3731,3.657,3732,3.657,3733,3.657,3734,3.657,3735,3.657,3736,5.721,3737,3.657,3738,3.657,3739,3.657,3740,3.657,3741,3.657,3742,3.657,3743,3.657,3744,3.657,3745,3.657,3746,3.657,3747,3.657,3748,3.657,3749,3.657,3750,3.657,3751,3.657]],["t/1693",[3,1.626,20,2.305,23,1.284,35,1.455,48,1.382,50,1.137,51,0.885,59,1.562,64,1.104,65,2.209,66,1.179,72,0.548,73,1.043,74,1.635,80,1.58,81,1.438,88,2.915,108,1.437,110,1.551,121,2.683,145,2.323,159,2.31,187,2.018,193,3.227,194,3.227,217,5.073,223,2.813,225,1.409,248,1.648,261,1.914,299,1.934,315,4.295,429,3.076,470,1.335,483,2.323,548,2.525,575,2.745,649,3.185,699,2.323,772,2.683,823,1.487,1153,2.573,1185,3.322,1443,3.723,1622,3.185,1725,3.723,1893,3.071,1923,3.493,2302,3.185,2386,5.684,2883,3.493,2970,3.493,3492,6.471,3494,3.723,3495,3.723,3496,3.723,3752,6.216,3753,3.493,3754,4.071,3755,4.071,3756,4.071,3757,4.071,3758,4.071,3759,4.071,3760,6.216,3761,4.071]],["t/1695",[20,1.275,33,2.153,35,2.001,48,1.708,51,0.904,59,1.782,60,2.899,80,1.054,81,0.959,88,2.812,110,1.337,132,3.231,146,3.475,189,2.233,193,4.862,194,5.377,216,1.568,223,3.475,315,5.026,398,2.493,467,2.656,470,0.891,523,4.104,622,2.297,1071,3.674,1489,6.242,2204,3.674,2214,4.104,2215,3.568,2377,5.314,2726,4.315,3501,5.936,3762,7.815,3763,4.599,3764,4.599,3765,4.599,3766,5.029,3767,5.029,3768,5.029]],["t/1697",[20,1.43,33,1.67,35,1.63,48,3.091,50,0.657,51,0.915,59,1.8,60,2.247,73,0.92,81,0.685,88,3.316,104,1.003,110,1.28,112,1.642,142,2.481,145,2.048,146,2.481,175,1.624,189,3.093,191,1.887,193,2.928,194,4.453,216,1.119,223,2.481,233,3.434,261,1.688,317,1.864,355,2.08,366,2.548,367,2.809,369,3.283,372,3.283,381,2.42,435,1.211,442,4.1,467,1.311,470,0.999,509,2.366,559,1.285,622,1.64,682,3.434,705,1.76,707,1.311,762,4.002,846,2.149,877,2.709,929,4.413,982,2.93,1177,2.709,1186,1.962,1241,2.186,1372,3.081,1478,3.081,1538,2.316,1586,3.081,1730,4.812,1777,3.283,2102,3.081,2377,2.623,3493,3.081,3501,4.602,3511,2.809,3699,3.283,3762,5.157,3763,3.283,3764,3.283,3765,3.283,3769,3.59,3770,3.59,3771,3.59,3772,3.59,3773,3.59]],["t/1700",[2,5.093,20,1.505,21,2.167,23,1.872,35,1.389,50,1.496,51,0.853,64,1.61,65,2.906,66,2.367,72,0.799,73,1.521,355,5.42,470,1.051,848,4.101,914,3.494,935,4.843,1071,4.336,1186,3.244,1195,7.606,1429,5.427,1514,5.427,1535,5.093,1775,5.427,2143,5.093,2147,5.093,2734,5.427,2735,5.427,3173,5.093,3691,5.427,3774,8.177,3775,5.935,3776,5.427,3777,5.935,3778,5.427,3779,5.935,3780,5.935,3781,5.935,3782,5.935,3783,5.935,3784,5.935]],["t/1702",[48,3.853,139,7.533,179,5.877,216,3.537,317,5.184,355,6.574,441,6.311]],["t/1704",[20,2.396,49,4.087,93,4.756,108,2.603,248,2.985,501,5.564,521,5.233,705,3.615,767,3.926,771,5.387,980,4.491,1074,4.972,1173,3.615,1518,6.743,1521,6.743,1737,6.328,1769,4.661,1844,7.595,2993,6.328,3785,8.639,3786,9.532,3787,7.374]],["t/1706",[3,2.064,40,2.601,51,0.953,59,1.072,65,2.338,72,0.886,73,1.685,74,2.642,88,4.159,101,4.723,180,5.066,216,1.368,225,1.519,239,1.914,248,1.776,299,3.125,370,5.453,483,2.503,697,2.306,808,2.335,913,3.58,1841,2.583,1844,4.545,1846,5.368,1847,5.368,1848,5.368,1849,5.368,1850,5.368,1851,5.368,1852,5.368,1853,5.645,1854,5.645,1855,5.645,1856,5.645,1857,5.645,1858,5.645,2302,3.433,3788,4.387]],["t/1708",[3,1.564,40,2.365,50,1.094,51,0.945,59,1.34,65,2.125,72,0.805,73,1.532,74,2.401,80,1.722,81,1.568,88,3.91,106,2.262,110,1.511,180,4.433,248,2.42,286,3.857,298,5.131,299,2.841,370,5.679,730,4.132,1844,4.132,1846,4.88,1847,4.88,1848,4.88,1849,4.88,1850,4.88,1851,4.88,1852,4.88,2987,5.468,3789,5.98,3790,5.98]],["t/1710",[20,2.062,27,4.507,48,2.761,84,3.824,95,2.95,108,2.871,380,4.031,483,4.64,980,4.953,1987,5.359,3791,8.133,3792,7.437,3793,7.437,3794,7.437,3795,7.437,3796,7.437,3797,7.437,3798,7.437,3799,7.437]],["t/1712",[20,1.641,33,3.446,51,0.92,59,1.775,72,0.871,88,2.501,108,2.284,130,2.66,435,2.183,1863,5.916,1987,4.263,3800,7.928,3801,5.916,3802,7.928,3803,6.469,3804,5.916,3805,7.928,3806,5.916,3807,6.469,3808,5.916,3809,5.916,3810,6.469]],["t/1714",[32,4.215,72,1.107,73,2.591,84,3.864,108,2.901,151,4.073,248,4.433,380,4.073,482,4.492,702,1.722,1987,5.415,3792,7.514,3800,7.514,3811,7.514,3812,8.217]],["t/1716",[23,1.376,32,2.238,51,0.943,59,1.527,64,1.184,65,2.328,66,1.263,72,0.882,73,2.015,74,1.752,80,1.648,81,1.5,84,2.052,95,2.376,108,1.54,110,1.722,112,1.907,151,2.163,159,1.337,167,3.066,248,3.539,260,3.414,380,2.163,470,0.773,482,2.385,697,2.293,702,0.914,776,2.706,1286,3.414,1384,2.758,1841,2.568,1844,3.015,1866,5.99,1925,3.99,1987,2.875,3793,7.193,3801,3.99,3813,4.363,3814,7.865,3815,6.551,3816,4.363,3817,4.363,3818,4.363,3819,4.363,3820,4.363,3821,4.363,3822,4.363,3823,4.363,3824,4.363,3825,4.363,3826,4.363]],["t/1718",[32,4.215,72,1.107,73,2.591,84,3.864,108,2.901,151,4.073,380,4.073,482,4.492,702,1.722,1844,7.568,1987,5.415,3794,7.514,3802,7.514,3811,7.514,3827,8.217]],["t/1720",[32,3.968,72,1.042,73,2.495,84,3.637,108,2.731,151,3.834,167,3.415,248,3.131,380,3.834,482,4.228,702,1.621,1384,4.889,1841,4.553,1844,7.729,1987,5.097,3795,8.905,3804,7.073,3828,7.735]],["t/1722",[72,1.155,73,2.659,84,4.032,108,3.027,380,4.25,702,1.796,825,5.834,1932,7.84,1987,5.65,3796,7.84,3805,7.84,3829,8.573]],["t/1724",[72,1.18,73,2.694,84,4.121,108,3.094,380,4.344,702,1.836,1987,5.775,3797,8.014,3806,8.014,3830,8.764,3831,8.764]],["t/1726",[72,1.18,73,2.694,84,4.121,108,3.094,380,4.344,702,1.836,1877,8.014,1987,5.775,3798,8.014,3808,8.014,3832,8.764]],["t/1728",[23,1.465,40,3.228,50,0.85,51,0.89,59,0.757,64,1.26,65,2.439,66,1.345,72,0.924,73,2.74,84,2.184,108,1.64,110,0.854,112,1.352,121,3.061,151,2.302,159,1.423,175,3.105,228,3.634,248,2.778,260,3.634,380,2.302,429,1.895,463,3.393,470,0.823,519,2.302,697,2.442,702,0.973,1330,2.881,1384,2.936,1769,2.936,1824,8.369,1831,6.276,1841,2.734,1844,4.742,1987,5.379,2790,8.246,2807,3.986,3799,6.276,3809,4.247,3833,4.645,3834,4.645,3835,4.645,3836,6.863,3837,4.645,3838,4.645,3839,4.645,3840,4.645,3841,4.645,3842,4.645,3843,4.645,3844,4.645]],["t/1731",[3,0.669,37,1.813,40,1.693,48,0.868,50,0.783,51,0.875,59,1.346,64,0.694,72,1.316,73,2.871,80,1.629,81,1.575,88,4.359,95,2.342,100,1.052,110,1.518,129,1.115,147,2.215,148,0.868,156,1.868,180,2.309,185,2.045,232,1.929,248,2.235,286,4.637,309,1.379,346,0.891,432,1.417,470,0.758,482,1.398,565,1.312,702,0.897,883,3.038,943,1.557,996,1.929,1092,3.493,1133,2.407,1151,1.437,1156,1.929,1288,2.655,1317,1.868,1330,2.655,1375,4.102,1735,2.706,1765,6.302,1769,3.49,1799,2.194,1800,2.194,1801,2.194,1802,2.194,1803,2.194,1804,2.194,1805,2.194,1806,2.194,1807,2.194,1808,2.194,1809,2.194,1810,2.194,1811,2.194,1812,3.673,1813,2.194,1814,2.194,1815,2.087,1816,2.194,1817,2.194,1818,1.814,1819,3.673,1820,3.493,1821,2.194,1822,2.087,1823,2.194]],["t/1733",[37,1.545,40,3.974,51,0.866,59,1.326,80,1.705,81,1.552,93,2.978,95,1.675,110,1.495,130,1.899,147,3.096,151,2.289,159,1.415,248,4.555,249,2.635,470,0.818,510,4.223,521,4.849,606,2.49,665,2.718,704,3.426,705,2.264,712,2.864,767,2.458,777,2.458,920,3.842,923,3.768,968,3.484,1375,5.13,1376,3.613,1652,2.764,2927,3.963,2993,3.963,3052,4.223,3263,3.963,3286,4.223,3753,3.963,3785,4.223,3786,6.249,3845,4.618,3846,4.618,3847,4.618,3848,4.618,3849,4.618,3850,4.618,3851,4.618,3852,4.618]],["t/1735",[26,1.604,40,1.352,48,1.161,50,1.327,51,0.925,56,1.295,59,1.252,80,1.609,81,1.465,84,0.924,88,2.098,95,0.713,108,0.694,110,1.412,112,1.58,121,1.295,130,0.808,146,1.358,147,1.054,151,4.881,167,2.366,177,0.689,180,1.844,191,1.033,225,2.336,231,1.592,248,3.783,314,0.906,336,1.176,346,1.581,366,1.395,370,3.75,384,3.221,469,0.85,470,0.348,583,1.714,660,1.797,682,1.197,690,1.604,704,0.985,708,2.529,716,4.109,745,1.074,759,1.436,761,1.687,767,1.82,773,1.436,807,1.074,887,2.121,897,1.436,912,1.519,1362,1.687,1375,1.122,1387,5.195,1401,1.797,1436,1.797,1482,1.243,1503,1.538,1538,3.501,1550,4.429,1677,1.797,1744,1.687,1747,1.797,1765,2.206,2058,2.935,2850,1.395,2883,1.687,2951,1.483,2981,1.687,3112,1.797,3511,1.538,3776,1.797,3853,1.966,3854,1.797,3855,2.935,3856,1.604,3857,1.966,3858,3.127,3859,1.797,3860,5.427,3861,5.427,3862,1.966,3863,1.966,3864,1.966,3865,1.966,3866,5.018,3867,3.704,3868,1.966,3869,2.791,3870,3.42,3871,1.604,3872,1.797,3873,1.966,3874,3.127,3875,1.966,3876,1.966,3877,1.966,3878,1.966,3879,1.966,3880,1.966,3881,1.966,3882,1.604,3883,1.966,3884,1.966,3885,1.966,3886,1.966,3887,1.966,3888,1.966,3889,1.966,3890,3.42,3891,1.966,3892,1.966,3893,1.966,3894,1.966,3895,1.966,3896,1.966,3897,1.966,3898,1.966,3899,1.966,3900,1.966,3901,1.966,3902,1.966,3903,1.966,3904,1.966,3905,1.966,3906,1.966,3907,1.966,3908,1.966,3909,1.797,3910,1.797,3911,1.797,3912,1.797,3913,1.966,3914,1.966,3915,1.966]],["t/1737",[20,0.963,37,0.421,40,0.878,50,0.91,51,0.918,59,0.96,80,1.235,81,1.124,88,0.858,107,0.744,110,1.217,150,1.307,151,3.283,190,0.891,220,1.139,225,1.315,248,2.385,314,1.751,346,2.308,357,1.286,359,1.904,380,1.1,416,1.307,456,5.345,469,1.642,470,1.044,519,1.1,682,1.352,766,2.828,877,1.675,912,1.687,914,1.307,1074,1.496,1133,2.135,1151,1.248,1288,1.376,1347,1.811,1348,1.621,1368,2.03,1375,2.84,1387,4.272,1407,3.473,1438,3.532,1439,2.03,1499,5.18,1503,1.737,1512,2.03,1538,1.432,1729,1.496,1841,2.236,2064,2.03,2215,1.575,2302,1.737,2692,1.905,2981,1.905,3025,2.03,3178,1.811,3183,2.03,3221,2.03,3753,1.905,3882,1.811,3916,9.079,3917,2.219,3918,2.219,3919,2.219,3920,3.797,3921,2.219,3922,3.797,3923,2.219,3924,2.219,3925,2.219,3926,2.219,3927,3.797,3928,2.219,3929,2.219,3930,2.219,3931,2.219,3932,2.219,3933,2.219,3934,2.219,3935,2.219,3936,2.219,3937,2.219,3938,2.219,3939,2.219,3940,2.219,3941,2.219,3942,2.219,3943,2.219,3944,3.797,3945,2.219,3946,2.219,3947,3.797,3948,3.797,3949,2.219,3950,2.219,3951,2.219,3952,2.219,3953,2.219,3954,2.219,3955,2.219,3956,1.905,3957,3.797,3958,2.219,3959,3.473,3960,2.219,3961,2.219,3962,2.219,3963,5.892,3964,3.797,3965,4.977,3966,4.977,3967,4.977,3968,2.219,3969,4.977,3970,2.219,3971,3.797,3972,2.219,3973,2.219,3974,2.219,3975,2.219,3976,2.219,3977,2.219,3978,2.219,3979,2.219,3980,2.219,3981,2.219,3982,2.219,3983,2.219,3984,2.219,3985,2.219,3986,2.219,3987,2.219,3988,2.219,3989,2.219,3990,2.219,3991,2.219]],["t/1739",[3,2.555,20,1.4,21,2.016,40,3.559,48,2.64,50,1.01,51,0.834,56,3.638,59,1.267,60,3.098,80,1.157,81,1.483,95,2.002,106,3.404,108,3.636,110,1.429,147,2.396,148,2.64,159,1.691,192,3.561,216,1.721,239,2.408,248,2.234,253,3.854,286,3.561,336,3.304,337,3.62,380,2.736,470,0.978,759,4.033,953,3.917,1184,2.736,1317,4.033,1375,3.15,1765,3.561,1769,3.49,1818,3.917,1822,4.505,1824,4.32,2724,4.737]],["t/1741",[3,2.476,50,1.111,51,0.941,65,2.158,72,0.818,73,1.556,74,2.438,88,3.935,101,3.634,180,4.479,248,2.457,299,2.884,370,4.195,394,3.838,665,3.574,766,2.914,1459,4.751,1844,5.739,1846,4.955,1847,4.955,1848,4.955,1849,4.955,1850,4.955,1851,4.955,1852,4.955,1853,5.21,1854,5.21,1855,5.21,1856,5.21,1857,5.21,1858,5.21,3882,4.955,3992,6.071]],["t/1744",[20,2.015,33,1.313,37,1.259,50,1.213,51,0.842,59,1.295,73,1.699,80,0.929,81,0.846,95,2.406,104,0.789,108,2.805,110,0.815,114,4.438,129,3.846,130,1.824,132,2.946,149,2.923,159,1.359,167,1.556,181,2.531,216,1.383,225,1.536,250,4.583,256,1.953,337,2.066,346,1.546,380,2.199,429,2.706,536,5.804,560,4.146,673,5.395,688,2.861,707,1.62,736,3.471,777,2.362,836,3.148,846,2.655,962,3.471,1166,5.306,1171,6.652,1184,2.199,1185,3.62,1186,2.425,1187,4.057,1189,2.804,1190,2.57,1193,2.923,1615,4.057,2745,4.057,2776,4.057,3993,4.436,3994,4.436,3995,4.436]],["t/1746",[20,1.206,21,1.737,23,1.5,51,0.924,59,0.775,61,3.252,64,1.895,65,2.482,66,1.377,72,0.641,73,1.219,80,0.997,81,0.907,110,0.874,114,4.289,132,2.112,159,1.457,175,2.152,191,2.5,261,2.237,299,2.26,337,2.215,345,3.722,435,1.605,470,0.842,559,1.702,560,4.937,673,2.5,707,1.737,738,2.5,1071,3.475,1133,2.674,1139,4.984,1140,3.589,1141,3.589,1142,5.873,1143,3.722,1144,3.589,1145,3.475,1146,3.589,1157,4.082,1161,4.082,1166,2.674,1184,2.358,1186,2.6,1189,3.007,1190,2.756,1191,2.756,1237,3.068,1261,4.082,1293,4.082,1323,3.882,1324,4.082,1617,4.35,3570,4.35]],["t/1749",[20,0.75,27,2.677,33,2.304,34,1.835,37,1.585,44,1.391,50,1.292,51,0.936,59,1.361,64,0.803,67,1.596,72,0.65,81,0.564,84,3.322,107,1.619,110,1.43,112,1.782,167,1.038,183,1.024,189,3.457,190,1.188,239,1.291,256,2.126,311,1.518,315,2.044,346,1.683,359,4.416,371,1.314,393,1.217,398,1.467,456,2.843,463,2.161,467,2.235,469,1.279,470,0.855,476,2.414,483,1.688,559,1.059,562,1.995,697,1.555,777,1.575,784,1.663,823,2.579,969,2.161,982,2.414,1084,2.161,1153,1.87,1312,2.706,1322,2.044,1366,2.414,1482,1.87,1499,1.688,1586,2.539,1622,2.315,1631,2.706,1686,2.539,1730,2.044,1735,1.87,1982,2.539,2122,3.644,2852,2.232,3854,4.417,3996,2.959,3997,6.12,3998,4.83,3999,2.959,4000,2.959,4001,2.959,4002,2.959,4003,2.959,4004,2.959,4005,2.959,4006,2.959,4007,2.959,4008,2.959,4009,7.063,4010,2.959,4011,2.959,4012,2.959,4013,2.959,4014,2.959,4015,2.959,4016,2.959,4017,2.959,4018,2.959,4019,2.959,4020,2.959,4021,2.959,4022,2.959,4023,2.959,4024,2.959,4025,2.959,4026,2.959,4027,2.959,4028,2.959,4029,2.959,4030,2.959,4031,2.959]],["t/1751",[3,0.669,37,1.813,40,1.693,48,0.868,50,0.783,51,0.875,59,1.346,64,0.694,72,1.316,73,2.871,80,1.629,81,1.575,88,4.359,95,2.342,100,1.052,110,1.518,129,1.115,147,2.215,148,0.868,156,1.868,180,2.309,185,2.045,232,1.929,248,2.235,286,4.637,309,1.379,346,0.891,432,1.417,470,0.758,482,1.398,565,1.312,702,0.897,883,3.038,943,1.557,996,1.929,1092,3.493,1133,2.407,1151,1.437,1156,1.929,1288,2.655,1317,1.868,1330,2.655,1375,4.102,1735,2.706,1765,6.302,1769,3.49,1799,2.194,1800,2.194,1801,2.194,1802,2.194,1803,2.194,1804,2.194,1805,2.194,1806,2.194,1807,2.194,1808,2.194,1809,2.194,1810,2.194,1811,2.194,1812,3.673,1813,2.194,1814,2.194,1815,2.087,1816,2.194,1817,2.194,1818,1.814,1819,3.673,1820,3.493,1821,2.194,1822,2.087,1823,2.194]],["t/1754",[20,0.805,33,0.939,37,1.791,51,0.941,59,1.046,72,0.991,80,1.345,81,1.224,93,2.046,108,1.12,120,2.589,132,1.409,148,1.735,149,6.418,159,1.966,185,1.175,231,1.477,271,2.349,330,2.192,355,1.838,387,1.555,398,1.572,441,2.005,470,0.905,553,4.386,562,6.115,571,2.452,583,1.59,702,0.665,712,1.967,767,1.689,773,2.318,809,1.539,912,2.27,1139,1.627,1151,1.783,1158,2.394,1287,2.901,1296,2.901,1375,1.81,1618,2.394,1627,5.726,2204,2.318,2215,3.627,2533,2.722,2893,2.722,3173,6.315,4032,2.722,4033,3.172,4034,3.172,4035,3.172,4036,3.172,4037,3.172,4038,3.172,4039,3.172,4040,3.172,4041,3.172,4042,5.111,4043,5.111,4044,3.172,4045,5.111,4046,3.172,4047,3.172,4048,3.172,4049,3.172,4050,2.901,4051,6.418,4052,6.418,4053,3.172,4054,3.172,4055,3.172,4056,6.418,4057,5.111,4058,3.172,4059,3.172,4060,3.172,4061,3.172]],["t/1756",[50,1.595,51,0.946,59,1.421,72,0.878,80,1.827,81,1.663,95,2.366,151,3.233,166,4.123,167,2.288,248,2.64,271,2.082,470,1.155,571,2.173,702,1.367,716,5.98,912,2.897,3869,5.323,3871,5.323,4062,6.522,4063,5.964,4064,8.718,4065,5.964,4066,5.964,4067,5.964]],["t/1758",[51,0.77,59,1.286,72,1.062,73,2.755,80,1.653,81,1.505,110,1.812,179,4.644,216,2.459,244,4.372,271,2.518,470,1.397,571,2.629,607,4.312,702,1.653,4068,7.889,4069,7.889,4070,7.889]],["t/1760",[37,1.611,51,0.902,59,1.021,60,2.496,72,0.844,80,1.312,81,1.195,148,3.267,159,1.919,185,2.319,216,1.953,271,2,311,3.214,346,3.352,435,2.113,469,3.669,470,1.109,571,2.087,583,4.253,702,1.312,836,6.02,1841,3.688,1974,8.255,2103,5.375,2712,5.375,3475,8.797,4071,6.264,4072,8.484]],["t/1762",[33,1.963,37,1.259,51,0.934,59,1.081,60,2.643,72,0.893,80,1.39,81,1.265,148,2.252,159,2.032,185,2.456,216,2.067,232,7.471,271,2.117,311,3.402,398,5.23,470,1.175,571,2.21,702,1.39,2560,8.497,4073,6.632,4074,6.632,4075,6.632,4076,6.632,4077,6.065]],["t/1764",[37,1.804,51,0.925,59,1.213,72,1.002,80,1.56,81,1.42,110,1.368,159,2.28,271,2.376,314,3.432,470,1.318,571,2.48,702,1.56,712,4.616,722,5.616,817,3.69,912,3.306,2175,6.807,4078,7.443,4079,7.443,4080,7.443]],["t/1766",[35,1.49,50,1.164,51,0.871,59,1.581,72,0.857,80,1.334,81,1.636,95,2.308,110,1.17,114,2.993,131,3.388,159,1.95,271,2.032,309,3.433,337,2.964,389,6.085,467,3.132,470,1.127,560,2.993,571,2.121,673,3.346,702,1.334,736,4.98,920,4.821,1117,5.82,1166,4.821,1184,3.155,1190,3.688,1191,4.969,1818,4.516,4081,6.365,4082,6.365,4083,6.365]],["t/1768",[50,1.146,51,0.841,59,1.021,61,4.479,72,0.844,80,1.312,81,1.195,88,2.422,110,1.768,131,3.335,147,2.614,216,1.953,239,2.733,249,3.574,271,2,327,2.64,346,2.183,359,3.14,393,2.576,456,3.688,470,1.109,571,2.087,607,3.424,702,1.312,766,3.007,1173,3.071,1499,3.574,1693,4.04,1706,4.04,1735,5.363,1924,4.128,2165,4.726,2705,7.28,4084,6.264,4085,6.264,4086,6.264,4087,6.264]],["t/1770",[33,2.558,37,0.974,50,0.938,51,0.887,59,0.836,61,2.387,66,0.922,72,0.429,80,0.667,81,0.608,88,1.232,110,0.942,112,0.927,129,1.389,131,1.696,147,0.981,167,1.798,189,2.858,191,1.674,216,0.993,239,1.389,249,1.817,253,1.579,256,3.247,271,1.017,311,3.302,346,1.11,355,2.971,359,1.597,393,1.31,398,4.008,401,4.274,416,3.018,429,2.092,432,1.765,433,2.054,456,5.086,463,4.701,469,1.377,470,0.908,483,1.817,559,1.14,562,3.457,571,1.061,583,1.597,607,1.741,702,0.667,712,1.975,736,2.492,766,1.529,823,2.953,1084,2.327,1173,1.562,1322,3.543,1330,1.975,1339,2.599,1499,4.614,1507,2.599,1693,2.054,1706,2.054,1729,2.147,1735,5.111,1924,2.099,2074,4.184,2075,4.184,2078,4.4,2079,4.184,2080,4.4,2092,2.733,2201,2.913,2852,2.403,3114,4.4,4088,5.127,4089,3.185,4090,2.733,4091,2.733,4092,2.913,4093,2.913,4094,3.185,4095,3.185,4096,3.185,4097,2.733,4098,3.185,4099,2.733,4100,2.733,4101,3.185,4102,6.436,4103,3.185,4104,3.185,4105,3.185,4106,3.185,4107,3.185]],["t/1772",[37,0.769,50,0.741,51,0.922,59,1.225,72,0.545,80,1.575,81,1.434,111,2.309,159,1.241,167,2.952,216,1.93,225,1.402,231,1.886,271,1.293,317,3.215,346,2.157,356,1.886,357,3.587,382,4.689,435,1.366,470,1.097,501,3.056,519,2.007,571,1.349,702,0.849,717,5.769,769,2.277,772,2.669,776,2.512,807,2.214,826,3.771,1133,2.277,1151,2.277,1152,3.475,1153,2.56,1225,3.056,1618,3.056,1622,3.169,1793,2.874,1841,2.384,2640,3.056,2915,3.169,2939,3.704,2951,4.672,2952,4.523,2961,3.056,2966,5.053,2970,3.475,3016,5.662,4108,4.05,4109,4.05,4110,4.05,4111,4.05,4112,4.05,4113,4.05,4114,4.05,4115,4.05,4116,4.05,4117,4.05,4118,3.704,4119,5.662,4120,4.05,4121,4.05,4122,4.05,4123,4.05]],["t/1774",[51,0.884,59,1.09,72,0.901,80,1.401,81,1.276,110,1.229,179,3.937,271,2.135,315,4.621,394,5.603,470,1.184,521,4.746,571,2.228,607,3.656,702,1.401,766,3.21,777,3.56,823,3.237,1198,3.875,1519,5.233,1738,5.458,3882,5.458,4124,9.943,4125,6.688,4126,6.688,4127,6.688,4128,6.688,4129,6.688,4130,6.116,4131,6.688,4132,6.688]],["t/1776",[72,1.032,110,1.408,129,3.342,131,4.078,174,4.187,180,4.131,238,4.585,271,2.445,346,2.669,394,4.842,571,2.552,606,4.131,654,5.435,702,1.605,715,5.779,766,3.676,767,4.078,1198,4.438,1887,6.573,1927,8.305,2097,7.005,2663,6.251,3574,6.573,4133,7.66]],["t/1778",[33,1.548,37,1.915,40,2.068,51,0.919,59,0.852,72,0.704,80,1.095,81,0.997,107,2.929,159,1.602,167,1.834,190,2.1,216,2.332,271,1.669,346,1.822,382,2.563,432,2.898,433,3.372,435,1.764,470,0.926,571,1.742,702,1.095,717,5.9,823,1.909,986,3.82,1793,3.71,1794,4.487,2554,3.71,2952,3.82,2966,4.267,3444,4.487,4092,4.781,4118,4.781,4119,4.781,4134,5.228,4135,5.228,4136,5.228,4137,5.228,4138,5.228,4139,5.228,4140,5.228,4141,5.228,4142,5.228,4143,5.228,4144,5.228,4145,5.228,4146,5.228,4147,5.228,4148,5.228]],["t/1780",[35,1.4,37,1.783,50,1.094,51,0.876,59,0.975,72,0.805,80,1.253,81,1.141,88,2.312,110,1.511,131,3.183,159,1.832,177,3.294,187,2.964,216,1.864,225,2.07,239,2.609,249,3.412,271,1.909,346,3.272,359,2.997,393,2.459,429,2.44,432,3.314,433,5.302,470,1.059,571,1.992,607,3.269,702,1.253,717,5.28,766,2.87,1173,2.932,1693,3.857,1706,3.857,4149,5.98,4150,4.132,4151,5.98,4152,5.98]],["t/1782",[35,1.895,37,1.537,39,3.806,40,3.2,51,0.849,59,1.319,72,0.787,80,1.225,81,1.115,84,2.75,110,1.487,148,1.985,151,4.012,159,1.791,232,4.412,271,1.867,398,2.898,470,1.036,571,1.948,588,4.575,702,1.225,846,3.5,936,6.604,1371,7.574,1691,7.003,2560,5.018,2625,5.018,2915,6.332,4153,5.847,4154,5.847,4155,5.847,4156,5.847,4157,8.093,4158,9.281,4159,8.093]],["t/1784",[50,1.451,51,0.932,59,1.293,72,0.765,80,1.19,81,1.083,129,2.477,148,2.693,149,6.857,159,1.74,185,2.103,271,1.813,337,4.845,398,2.815,470,1.006,505,5.347,513,4.634,514,6.806,562,3.829,571,1.892,583,2.847,702,1.19,767,3.023,914,3.343,1087,5.193,1184,3.931,1341,5.193,1627,4.03,2204,5.794,4160,5.679,4161,9.138,4162,5.679]],["t/1786",[37,1.238,39,5.137,51,0.853,59,1.421,72,0.878,80,1.367,81,1.244,110,1.602,146,4.507,167,2.288,177,2.288,189,2.897,271,2.082,311,3.346,401,3.779,470,1.155,571,2.173,702,1.367,769,3.667,809,4.228,1198,3.779,1314,4.207,1448,4.045,1652,3.904,1924,4.298,2090,5.597,4163,6.522,4164,5.323,4165,6.522,4166,5.597,4167,5.323,4168,5.323]],["t/1788",[37,1.783,50,1.094,51,0.892,59,0.975,72,0.805,80,1.253,81,1.141,88,2.312,110,1.511,131,3.183,146,4.132,167,2.883,177,2.097,187,2.964,216,1.864,239,2.609,249,3.412,271,1.909,311,3.068,346,3.524,359,2.997,393,2.459,401,4.762,432,3.314,470,1.059,571,1.992,607,3.269,702,1.253,766,2.87,769,3.362,809,3.987,1173,2.932,1693,3.857,1706,3.857,1924,3.94,4150,4.132,4169,5.98,4170,5.98]],["t/1790",[72,1.249,107,3.111,271,2.962,571,3.091,702,1.944,3536,8.484,4171,9.278]],["t/1792",[33,2.421,37,1.776,50,1.086,51,0.874,59,0.967,72,0.799,80,1.243,81,1.132,88,2.295,110,1.503,131,3.159,147,1.829,148,2.015,159,1.818,185,2.198,216,1.85,239,2.589,249,3.386,271,1.895,311,3.045,346,2.068,359,2.975,393,2.441,432,4.532,470,1.051,571,1.977,583,2.975,607,3.244,682,3.614,702,1.243,766,2.849,770,3.289,1173,2.91,1375,3.386,1693,3.828,1706,3.828,2204,5.973,3284,4.336,3956,5.093,4150,4.101,4172,8.177,4173,5.935]],["t/1794",[72,1.207,110,1.647,147,2.762,148,3.043,166,5.665,185,3.319,271,2.861,571,2.986,702,1.878,4174,8.962]],["t/1796",[33,1.693,37,1.742,50,1.046,51,0.865,59,0.932,60,2.279,72,0.77,80,1.199,81,1.091,88,2.212,110,1.465,131,3.045,147,1.763,148,1.942,159,1.752,185,2.118,216,1.783,239,2.495,249,3.264,271,1.826,311,2.934,346,1.993,359,2.867,393,2.352,432,4.417,470,1.013,571,1.906,583,2.867,607,3.127,634,3.769,682,3.484,702,1.199,766,2.745,1173,2.804,1375,3.264,1693,3.69,1706,3.69,2204,4.179,3284,4.179,3956,4.909,4150,3.952,4175,5.72,4176,5.72,4177,5.72,4178,5.72,4179,5.72,4180,5.72,4181,5.72,4182,5.72,4183,5.72]],["t/1798",[60,3.571,72,1.207,110,1.647,148,3.043,166,5.665,185,3.319,271,2.861,571,2.986,702,1.878,4184,8.962]],["t/1800",[37,1.552,49,3.289,51,0.853,59,1.643,67,3.201,72,0.799,80,1.96,81,1.784,110,1.853,151,2.942,159,1.818,167,2.081,248,2.402,271,1.895,314,3.77,389,4.211,469,2.566,470,1.448,571,1.977,702,1.243,716,3.614,912,2.636,1650,5.093,1730,4.101,2565,4.644,4185,5.935,4186,5.935,4187,5.427,4188,5.935,4189,5.093,4190,5.935,4191,5.935,4192,5.427,4193,5.935,4194,5.935,4195,5.935,4196,5.935]],["t/1802",[37,1.259,50,1.213,51,0.882,59,1.081,72,0.893,80,1.39,81,1.265,88,2.564,110,1.62,131,3.53,148,2.252,159,2.032,185,2.456,216,2.067,239,2.893,249,3.784,271,2.117,346,2.311,359,3.324,393,2.727,470,1.175,571,2.21,607,3.625,702,1.39,766,3.183,817,3.287,1173,3.251,1693,4.278,1706,4.278,2718,6.065,4197,8.815,4198,6.065,4199,6.632,4200,6.632]],["t/1804",[20,2.235,37,1.259,51,0.9,59,1.081,72,0.893,73,2.258,80,1.39,81,1.265,110,1.62,147,2.716,148,2.993,159,2.032,213,4.278,271,2.117,470,1.175,571,2.21,702,1.39,1008,3.904,1075,6.255,1186,3.625,1288,4.113,2492,4.845,2703,4.845,2704,7.471,2717,6.065,2753,5.691,4201,6.632]],["t/1806",[37,1.326,51,0.894,59,1.138,72,0.94,80,1.463,81,1.332,110,1.283,147,2.152,148,2.371,159,2.139,222,6.471,271,2.229,470,1.237,571,2.327,583,3.5,702,1.463,1008,5.369,1075,4.955,1463,5.699,1499,5.204,2703,5.102,2704,6.881,4202,9.12,4203,9.12]],["t/1808",[33,3.147,37,1.144,51,0.894,59,0.982,61,2.805,72,0.811,80,1.262,81,1.149,107,2.02,110,1.518,111,3.081,147,1.857,148,2.046,151,2.987,159,1.846,183,2.86,185,2.231,271,1.923,311,3.091,398,4.674,470,1.067,571,2.008,583,3.02,702,1.262,767,3.208,1375,4.714,1627,4.275,2198,5.171,2214,4.917,2215,4.275,2692,5.171,4032,5.171,4204,6.025,4205,6.025,4206,6.025,4207,6.025]],["t/1810",[51,0.905,59,1.191,72,0.984,80,1.531,81,1.394,107,2.45,110,1.907,111,3.502,147,2.894,159,2.238,183,2.529,271,2.332,470,1.294,571,2.434,702,1.531,4208,9.391,4209,9.391,4210,7.306,4211,7.306]],["t/1812",[33,2.521,37,1.375,50,0.914,51,0.931,59,1.18,64,1.356,72,0.673,80,1.047,81,0.953,110,1.331,129,3.159,148,1.697,167,3.476,216,1.558,256,3.187,271,1.595,355,4.933,398,4.221,435,1.686,470,0.885,562,5.741,571,1.665,702,1.047,767,2.66,823,2.644,1222,6.821,1404,7.477,2773,3.546,3778,4.57,4212,4.997,4213,6.213,4214,4.288,4215,4.997,4216,8.012,4217,4.997,4218,4.997]],["t/1814",[33,1.508,35,1.192,37,1.634,51,0.897,59,1.197,60,2.03,72,0.686,80,1.067,81,0.972,95,2.663,100,3.019,110,1.349,129,2.222,159,1.56,167,3.304,256,3.231,271,1.626,355,4.254,429,2.078,435,1.719,442,2.999,470,0.902,501,3.843,504,3.986,571,1.697,702,1.067,823,2.681,846,3.049,1222,6.288,1404,7.107,1738,7.687,4213,6.3,4214,4.371,4216,7.387,4219,7.341,4220,5.094,4221,5.094,4222,5.094,4223,7.341,4224,5.094,4225,5.094,4226,5.094]],["t/1816",[32,3.49,37,1.292,51,0.905,59,1.109,72,0.916,80,1.425,81,1.298,106,2.573,148,2.31,159,2.084,185,2.519,271,2.172,311,3.49,470,1.205,559,2.434,571,2.267,702,1.425,805,3.622,836,7.115,3729,6.221,4227,6.803,4228,6.221,4229,6.803,4230,6.803,4231,8.965,4232,8.965,4233,6.803,4234,6.803]],["t/1818",[3,1.576,50,1.102,51,0.878,59,1.347,72,0.811,80,1.262,81,1.576,95,2.185,106,2.279,110,1.733,129,4.113,147,2.546,191,3.167,240,4.163,248,2.439,256,2.652,271,1.923,286,3.886,346,2.099,393,2.478,429,2.458,436,7.114,470,1.067,571,2.008,702,1.262,920,3.387,1151,3.387,1375,3.438,1497,5.171,1818,4.275,3284,4.402,4235,6.025,4236,6.025,4237,8.262,4238,6.025,4239,6.025,4240,6.025]],["t/1820",[37,1.454,40,3.029,51,0.756,59,1.248,60,3.052,72,1.032,80,1.605,81,1.461,110,1.408,112,2.23,148,2.601,151,3.797,185,2.836,216,2.388,271,2.445,470,1.357,571,2.552,583,3.84,702,1.605,1924,5.048,2565,5.994,4241,7.66,4242,7.66,4243,7.66]],["t/1822",[37,2.044,51,0.894,59,1.138,72,0.94,80,1.463,81,1.332,95,3.308,110,1.283,147,2.152,185,2.586,225,2.417,271,2.229,429,2.849,470,1.237,571,2.327,702,1.463,846,4.18,1734,5.993,1735,5.765,1924,4.602,4244,5.699,4245,6.983,4246,9.12,4247,6.983]],["t/1824",[37,0.824,39,4.618,51,0.959,59,1.063,67,2.34,72,0.584,80,0.909,81,0.828,110,1.441,112,1.899,177,2.749,189,4.361,244,2.405,271,1.385,346,2.273,357,2.514,387,2.127,401,4.542,413,2.998,416,3.84,470,0.768,571,1.446,702,0.909,769,2.439,1196,3.541,1198,2.514,1448,2.691,1482,2.743,1547,3.395,1548,3.079,1924,2.859,2090,5.598,2091,5.105,2886,3.968,3089,3.723,4164,3.541,4166,3.723,4167,3.541,4168,3.541,4248,4.339,4249,5.598,4250,3.723,4251,4.339,4252,4.339,4253,4.339,4254,3.723,4255,3.723,4256,3.723,4257,3.723,4258,3.723,4259,3.723,4260,3.723,4261,3.723]],["t/1826",[51,0.849,56,3.853,59,1.773,72,0.787,80,1.945,81,1.77,88,2.261,95,2.935,106,3.511,110,1.706,159,2.843,248,4.054,253,4.012,271,1.867,286,5.22,336,3.5,337,2.722,380,2.898,429,2.385,470,1.036,571,1.948,702,1.225,823,2.135,1173,2.867,1375,3.336,1445,4.575,1480,4.271,1893,4.412,4262,5.847,4263,5.847,4264,5.847]],["t/1828",[37,1.281,50,1.234,51,0.886,59,1.099,72,0.908,80,1.413,81,1.287,88,2.608,110,1.638,131,3.591,147,2.078,159,2.066,216,2.103,239,2.942,249,3.848,271,2.153,274,3.687,314,3.11,346,2.35,359,3.381,393,2.774,470,1.195,571,2.247,607,3.687,702,1.413,766,3.237,1173,3.307,1693,4.351,1706,4.351,3232,6.168,4265,6.745,4266,6.745,4267,6.745]],["t/1830",[35,1.438,37,1.59,50,1.124,51,0.93,59,1.217,72,0.54,80,1.565,81,1.425,82,3.271,88,1.55,95,1.454,110,1.129,131,2.134,151,4.15,177,1.406,187,3.045,216,1.25,225,1.388,239,1.749,244,2.222,248,3.389,249,2.287,271,1.28,346,2.602,359,2.009,393,1.649,429,1.636,470,1.323,571,1.336,607,2.191,702,0.84,716,3.741,766,1.924,767,2.134,772,2.642,773,2.929,809,2.98,940,3.025,1173,1.965,1299,2.929,1387,3.963,1550,3.271,1693,2.586,1706,2.586,1744,3.44,1749,5.013,2663,3.271,3855,5.272,3858,3.666,3859,5.618,3869,3.271,3871,3.271,3909,3.666,3910,3.666,3911,3.666,3912,3.666,4063,3.666,4065,3.666,4066,3.666,4067,5.618,4150,2.77,4268,4.009,4269,6.143,4270,4.009,4271,4.009,4272,4.009,4273,4.009]],["t/1832",[35,1.379,37,1.118,50,1.488,51,0.872,59,1.638,72,0.793,80,1.234,81,1.124,95,2.95,110,1.495,147,1.815,151,4.619,187,2.92,189,2.616,190,3.267,248,2.384,271,1.88,387,2.888,470,1.043,484,2.888,571,1.963,606,3.177,634,3.882,659,5.055,702,1.234,716,3.587,767,3.136,850,3.526,940,4.444,1438,5.772,1464,7.03,1500,4.807,4189,5.055,4274,5.891,4275,5.891,4276,5.891,4277,5.891,4278,5.891]],["t/1834",[40,3.319,50,1.536,51,0.883,59,1.368,66,1.785,72,0.83,80,1.292,81,1.176,95,2.236,129,2.69,151,4.161,191,3.241,253,3.056,271,1.968,311,4.306,416,3.63,429,2.516,470,1.487,571,2.055,634,5.531,702,1.292,716,5.112,823,3.485,1322,4.261,1618,4.652,2890,5.639,4189,5.291,4279,5.291,4280,6.166,4281,6.166,4282,6.166,4283,6.166,4284,6.166,4285,6.166]],["t/1836",[37,1.872,40,3.467,51,0.898,59,1.072,72,0.886,80,1.378,81,1.254,84,3.093,106,2.488,147,2.026,191,3.457,225,2.277,249,3.752,253,3.26,271,2.099,314,3.032,429,2.683,432,3.645,470,1.165,523,5.367,571,2.191,702,1.378,704,3.297,777,3.501,846,3.936,2139,4.434,2857,7.154,3869,5.367,4286,6.014,4287,6.577,4288,6.577,4289,6.577]],["t/1838",[37,1.804,51,0.91,59,1.213,72,1.002,80,1.56,81,1.42,147,2.928,159,2.28,185,3.877,271,2.376,470,1.318,571,2.48,702,1.56,722,7.17,777,3.963,984,4.705,2716,6.388,4290,7.443]],["t/1840",[32,1.986,37,0.735,51,0.965,59,1.531,72,0.805,80,1.722,81,1.695,108,1.367,110,0.712,150,4.302,151,1.919,159,2.722,166,2.447,183,1.34,248,1.567,271,1.909,432,2.146,470,1.574,482,2.116,571,1.29,702,0.811,777,2.061,831,2.497,855,3.709,4291,3.54,4292,8.886,4293,8.886,4294,3.871,4295,3.871,4296,3.871,4297,3.871,4298,3.871,4299,3.871,4300,3.871,4301,3.871,4302,3.871,4303,3.871,4304,3.871,4305,3.871,4306,3.871,4307,3.871,4308,3.871,4309,3.871,4310,5.981,4311,3.871,4312,3.871,4313,3.871,4314,7.308,4315,3.871,4316,3.871,4317,5.981,4318,3.871]],["t/1842",[32,3.931,35,1.266,37,2.015,50,0.989,51,0.87,59,0.881,72,0.728,80,1.133,81,1.031,88,2.091,110,1.635,131,2.879,150,5.238,151,2.68,159,1.656,177,1.896,187,2.68,216,1.686,225,1.872,239,2.359,248,2.189,249,3.085,271,1.726,346,2.67,359,2.71,393,2.224,429,2.206,470,0.958,482,2.956,571,1.802,607,2.956,702,1.133,766,2.595,767,2.879,772,3.563,777,2.879,831,3.488,1173,2.651,1693,3.488,1706,3.488,4150,3.736,4319,5.407,4320,5.407,4321,5.407,4322,5.407,4323,5.407,4324,8.898,4325,5.407]],["t/1844",[32,3.838,35,1.224,37,0.993,51,0.902,59,0.852,72,0.704,80,1.095,81,0.997,107,2.508,110,1.605,111,3.762,147,1.611,150,4.404,151,4.33,159,1.602,177,1.834,183,3.633,187,2.592,225,1.81,248,2.116,271,1.669,346,1.822,429,2.133,470,0.926,482,2.858,484,2.563,571,1.742,606,2.82,702,1.095,777,2.783,831,3.372,965,3.613,1437,5.853,1780,4.091,1841,3.078,2773,3.71,4150,3.613,4291,4.781,4326,4.487,4327,5.228,4328,7.48,4329,7.48,4330,7.48]],["t/1846",[32,3.749,35,1.711,37,0.961,51,0.885,59,0.825,72,0.682,80,1.06,81,0.965,110,1.576,147,1.559,150,4.302,151,4.251,159,1.55,177,1.775,187,3.622,225,1.752,248,2.048,271,1.616,346,1.763,387,3.583,429,2.065,470,0.896,482,2.766,484,2.481,571,1.686,606,2.73,702,1.06,716,3.082,767,2.694,777,2.694,831,3.264,850,3.029,855,5.319,912,3.809,940,3.819,965,3.497,1464,5.514,1780,3.96,1841,2.979,2773,3.591,4150,3.497,4326,4.343,4331,9.392,4332,5.061,4333,5.061,4334,7.307,4335,7.307,4336,7.307,4337,5.061]],["t/1848",[32,3.802,35,1.735,37,0.98,51,0.875,59,0.841,72,0.695,80,1.081,81,0.984,110,1.594,147,1.59,150,4.362,151,4.298,159,1.581,177,1.81,187,3.673,190,2.976,225,1.786,231,2.403,248,2.089,271,1.647,346,1.798,387,3.633,429,2.105,470,0.914,482,2.821,484,2.53,571,1.719,606,2.783,702,1.081,716,3.143,767,2.747,777,2.747,831,3.328,850,3.089,912,4.64,940,3.893,965,3.565,1438,5.258,1464,5.591,1780,4.038,1841,3.038,2773,3.662,4150,3.565,4326,4.428,4338,5.16,4339,5.16,4340,5.16,4341,5.16,4342,7.41]],["t/1850",[33,1.391,37,1.561,50,1.267,51,0.928,59,1.128,66,1.361,72,0.633,80,0.985,81,0.896,95,1.705,110,0.864,112,1.368,129,2.05,150,4.839,151,3.432,159,1.44,167,2.428,189,3.651,191,2.471,253,2.33,271,1.5,311,4.217,416,2.767,429,2.825,432,2.605,433,3.032,456,4.076,469,2.032,470,1.226,471,3.434,483,2.682,559,1.682,571,1.566,702,0.985,823,3.002,1084,3.434,1322,3.248,1330,2.915,1339,3.835,1507,3.835,1618,3.546,4090,4.033,4091,4.033,4097,4.033,4099,4.033,4100,4.033,4279,4.033,4343,6.924,4344,4.7,4345,4.7,4346,4.7,4347,4.7,4348,4.298,4349,4.298,4350,4.298,4351,4.7]],["t/1852",[33,1.9,51,0.937,59,1.405,72,0.864,80,1.344,81,1.224,110,1.179,159,1.966,190,2.577,271,2.048,327,2.705,413,4.434,470,1.136,571,2.138,702,1.344,777,3.416,823,2.343,1482,6.582,1568,4.841,1605,5.868,2377,4.687,4352,6.416,4353,6.416,4354,9.739,4355,6.416,4356,6.416,4357,6.416,4358,6.416,4359,6.416]],["t/1854",[35,1.292,37,1.048,40,2.183,51,0.857,59,1.592,72,0.743,80,1.886,81,1.717,110,1.963,159,1.691,185,2.044,190,2.217,193,5.072,194,2.866,271,1.762,314,2.545,470,1.377,571,1.839,575,3.722,583,4.511,702,1.157,766,2.65,767,2.939,1438,3.917,2139,3.722,2270,4.737,2273,4.32,3856,4.505,4198,5.048,4244,4.505,4360,5.52,4361,5.52,4362,5.52,4363,5.52,4364,5.52,4365,5.52,4366,5.52,4367,5.52,4368,5.52,4369,7.775]],["t/1856",[20,1.787,33,1.425,35,1.127,37,0.914,51,0.86,59,1.495,72,0.648,80,1.746,81,1.59,110,1.532,150,5.401,151,2.386,159,1.475,166,3.043,167,2.472,177,1.689,185,1.783,190,1.933,191,2.531,193,4.763,194,2.5,248,2.852,271,1.537,309,2.597,432,2.668,433,3.105,442,2.834,469,2.082,470,0.853,571,1.604,575,3.246,583,3.532,690,3.929,702,1.009,716,4.292,767,3.752,822,2.413,1151,2.707,1190,4.829,1438,3.416,2139,3.246,2273,3.767,3856,3.929,3871,3.929,3872,4.403,4244,3.929,4370,4.814,4371,4.814,4372,7.047,4373,4.814,4374,4.814,4375,4.814,4376,4.814,4377,4.814]],["t/1858",[33,1.646,35,1.301,37,1.055,51,0.836,59,1.597,72,0.749,80,1.893,81,1.723,110,1.66,148,1.888,159,1.703,185,2.059,187,2.756,190,2.233,193,5.088,194,2.886,271,1.775,314,3.603,385,5.084,470,0.985,571,1.852,575,3.748,583,3.916,607,4.271,702,1.165,767,2.959,940,4.194,1438,3.945,1627,3.945,1730,3.841,2139,5.268,2273,4.35,2774,5.084,3856,4.537,4187,5.084,4192,5.084,4244,4.537,4378,5.559,4379,5.084,4380,5.559,4381,5.559,4382,5.559,4383,5.559]],["t/1860",[3,1.843,21,2.573,35,2.147,37,1.742,50,1.678,54,5.513,59,1.148,60,2.808,72,0.949,114,4.314,129,3.074,191,3.703,256,3.101,271,2.249,442,4.148,509,4.643,560,4.314,571,2.348,606,3.8,673,4.822,684,5.75,702,1.476,736,5.513,1166,5.157,1171,5.316,1627,4.999,4384,7.045]],["t/1862",[51,0.883,59,1.299,72,1.073,80,1.67,81,1.52,110,1.465,147,3.057,159,2.441,271,2.544,470,1.411,571,2.655,702,1.67,1462,6.838,4385,9.921,4386,7.969,4387,7.969]],["t/1864",[33,1.321,37,1.513,50,1.219,51,0.92,59,1.086,66,1.292,72,0.601,80,0.935,81,0.851,95,1.618,110,0.82,112,1.299,129,1.946,147,2.052,148,2.262,159,1.367,167,2.796,189,3.54,191,2.345,253,2.211,271,1.424,311,4.089,416,2.626,429,3.252,432,3.692,433,4.297,456,3.921,463,5.823,469,1.929,470,1.18,471,4.866,483,2.545,559,1.596,571,1.486,702,0.935,823,2.911,1084,3.259,1322,3.083,1330,2.767,1339,3.641,1507,3.641,1618,3.366,1729,3.008,3353,4.08,4090,3.828,4091,3.828,4097,3.828,4099,3.828,4100,3.828,4279,3.828,4348,4.08,4349,4.08,4350,4.08,4388,6.661,4389,4.461,4390,4.461,4391,4.461,4392,4.461,4393,4.461]],["t/1866",[51,0.87,59,1.248,60,3.857,72,1.032,80,1.605,81,1.461,110,1.779,112,2.23,159,2.347,271,2.445,337,4.506,470,1.357,571,2.552,702,1.605,1184,3.797,1462,6.573,4394,9.678,4395,7.66]],["t/1868",[40,2.401,51,0.795,56,4.001,59,1.543,72,0.818,80,1.74,81,1.584,88,2.347,95,3.012,106,3.142,110,1.526,175,2.747,248,2.457,249,3.464,253,3.01,271,1.938,380,4.692,470,1.075,484,2.977,523,4.955,571,2.023,697,3.192,702,1.272,809,2.945,846,3.634,1137,4.955,1375,3.464,1547,4.751,2129,5.552,2139,4.093,3501,4.955,3506,5.21,3700,5.552,4286,7.595,4396,6.071,4397,6.071,4398,6.071,4399,6.071,4400,6.071]],["t/1870",[3,1.386,51,0.944,59,1.231,72,1.017,80,1.582,81,1.44,88,2.049,105,2.272,110,1.763,167,1.858,189,3.354,220,2.718,248,3.882,253,2.626,271,1.691,286,4.871,380,2.626,470,1.337,571,1.765,702,1.11,805,2.821,823,1.935,1375,3.023,1568,3.998,1614,4.845,1841,3.119,4401,5.298,4402,5.298,4403,8.799,4404,5.298,4405,5.298,4406,5.298,4407,5.298,4408,7.552,4409,5.298,4410,5.298,4411,7.552,4412,5.298]],["t/1872",[37,0.914,39,4.955,40,1.904,50,0.881,51,0.957,59,1.149,67,2.597,72,0.648,80,1.009,81,0.918,95,1.746,110,1.295,112,2.052,177,1.689,189,4.53,271,1.537,401,4.083,416,2.834,470,0.853,571,1.604,702,1.009,1198,2.789,1448,4.37,1482,3.043,1547,3.767,1548,3.416,1924,3.173,2091,5.514,3089,6.047,4164,5.751,4166,4.131,4167,3.929,4168,3.929,4249,4.131,4250,4.131,4254,4.131,4255,4.131,4256,4.131,4257,4.131,4258,4.131,4259,4.131,4260,4.131,4261,4.131,4413,4.814]],["t/1874",[37,0.872,39,4.881,40,1.815,50,0.84,51,0.955,59,1.109,67,2.476,72,0.618,80,0.962,81,0.876,95,1.665,110,1.251,112,1.981,177,1.61,189,4.454,271,1.466,401,3.942,416,2.703,470,0.813,516,4.198,571,1.53,702,0.962,757,3.449,1001,3.746,1198,2.66,1241,2.796,1448,4.22,1482,2.902,1547,3.592,1548,3.258,1924,3.025,2091,5.324,4164,5.553,4167,3.746,4168,3.746,4249,3.94,4250,3.94,4254,3.94,4255,3.94,4256,3.94,4257,3.94,4258,3.94,4259,3.94,4260,3.94,4261,3.94,4414,4.591,4415,4.591]],["t/1876",[32,4.088,51,0.843,72,1.073,95,2.89,107,2.672,111,2.972,185,2.951,271,2.544,470,1.411,571,2.655,702,1.67,784,4.48,983,7.287,984,5.037,986,7.248,1437,6.235,1500,6.503,2716,6.838]],["t/1878",[20,1.292,33,1.508,37,0.967,50,0.932,51,0.886,59,1.627,60,2.03,61,2.372,72,1.159,80,1.538,81,1.4,95,1.847,110,1.582,132,2.262,159,2.249,185,1.886,190,2.046,216,1.588,271,2.748,327,2.147,336,3.049,337,4.843,470,1.3,546,4.371,549,4.157,571,2.868,694,3.843,699,2.906,702,1.538,848,3.519,885,3.986,914,2.999,1184,4.267,2705,4.371,3284,3.721,3702,4.658,4416,5.094,4417,5.094,4418,5.094,4419,5.094,4420,5.094,4421,5.094,4422,5.094,4423,5.094]],["t/1880",[33,1.558,35,1.232,37,0.999,39,4.123,40,2.972,50,0.963,51,0.789,59,1.429,60,2.097,72,0.709,80,1.575,81,1.434,95,1.909,107,1.765,108,1.858,110,1.611,111,1.963,148,1.787,181,3.003,183,1.822,185,1.949,216,2.343,220,2.7,271,1.68,311,2.7,314,3.466,330,5.193,398,2.609,429,2.147,470,1.331,571,1.754,575,3.548,702,1.103,712,3.264,767,2.802,769,2.959,777,2.802,1020,3.395,1151,2.959,1158,3.971,1371,4.295,1387,3.395,1841,3.098,2102,4.517,2625,4.517,2893,4.517,3195,4.813,3874,4.813,4424,5.263,4425,5.263,4426,4.813,4427,5.263,4428,5.263,4429,5.263,4430,5.263]],["t/1882",[27,3.444,33,1.84,50,1.137,51,0.865,59,1.375,60,2.477,61,3.929,72,0.837,80,1.302,81,1.185,110,1.551,190,2.496,193,4.975,194,4.381,216,1.937,271,1.984,315,5.831,336,3.72,337,3.929,470,1.101,571,2.071,575,4.19,702,1.302,772,4.095,1184,3.081,1366,5.072,2335,7.717,2852,4.689,3284,4.54,4426,5.683,4431,6.215,4432,8.438,4433,6.215,4434,6.215]],["t/1884",[33,2.731,37,1.752,51,0.899,59,1.159,72,0.957,80,1.489,81,1.356,148,2.414,159,2.178,177,2.493,185,2.632,216,2.216,271,2.269,311,3.647,346,2.477,398,3.524,470,1.259,571,2.369,583,3.563,702,1.489,774,3.94,775,3.94,2204,6.74,4228,6.501,4379,6.501]],["t/1886",[33,2.129,37,1.765,48,1.681,50,0.558,51,0.914,59,0.807,61,1.42,72,0.667,80,1.037,81,0.944,104,0.543,107,1.66,110,1.557,111,1.846,112,0.888,129,1.331,132,1.355,139,3.735,189,2.199,216,0.951,225,1.056,309,2.67,346,1.725,417,2.51,443,4.04,456,2.914,467,2.282,470,0.877,480,5.715,491,2.056,505,3.338,565,1.565,702,0.639,708,1.254,712,1.892,822,2.482,823,1.114,1191,1.767,1222,3.617,1288,1.892,1499,2.825,1599,2.489,1735,1.928,2165,3.735,2594,2.789,2640,2.301,2773,4.434,3114,5.363,3178,4.04,3298,2.789,3444,2.617,3959,4.527,4435,3.05,4436,3.05,4437,4.951,4438,3.05,4439,3.05,4440,4.951,4441,4.951,4442,4.951,4443,6.249,4444,6.249,4445,4.951,4446,3.05,4447,8.47,4448,3.05,4449,4.951,4450,3.05,4451,3.05,4452,3.05,4453,3.05,4454,3.05,4455,3.05,4456,3.05,4457,3.05,4458,3.05,4459,3.05,4460,3.05,4461,3.05,4462,3.05,4463,3.05,4464,3.05,4465,4.951,4466,4.951,4467,4.951,4468,3.05,4469,3.05,4470,3.05,4471,3.05,4472,3.05,4473,3.05,4474,3.05]],["t/1888",[27,4.049,51,0.905,59,1.191,72,0.984,80,1.531,81,1.394,84,3.436,128,4.655,129,3.187,159,2.238,216,2.278,238,5.621,271,2.332,470,1.294,571,3.458,583,3.662,654,5.184,702,1.531,4475,7.306,4476,7.306,4477,7.306]],["t/1890",[72,1.249,107,3.111,271,2.962,571,3.091,702,1.944,4478,9.278,4479,9.278]],["t/1892",[51,0.882,59,1.614,60,2.643,72,0.893,80,2.075,81,1.889,95,2.405,110,1.82,112,1.931,147,2.043,185,2.456,190,2.663,193,3.443,216,2.067,271,2.117,470,1.175,571,2.937,702,1.39,767,3.53,4130,6.065,4480,6.632,4481,6.632,4482,6.632,4483,6.632,4484,6.632,4485,6.632,4486,6.632]],["t/1894",[32,3.319,35,1.514,37,1.646,50,1.183,51,0.894,59,1.054,72,0.871,80,1.355,81,1.234,110,1.189,147,1.993,159,1.982,167,2.269,179,3.808,190,2.598,231,3.012,271,2.065,413,4.47,470,1.146,571,2.155,702,1.355,817,3.207,1317,4.726,1731,5.279,2554,4.59,3855,5.551,4487,9.779,4488,6.469,4489,6.469,4490,6.469,4491,6.469,4492,6.469,4493,8.67,4494,6.469]],["t/1896",[27,3.417,33,2.485,37,1.594,39,2.9,51,0.937,59,1.005,72,0.83,80,1.292,81,1.176,148,2.094,159,1.889,185,2.283,216,1.922,271,1.968,398,3.056,470,1.092,562,4.157,571,2.797,583,3.091,702,1.292,980,3.755,1158,4.652,1627,5.956,2198,5.291,2214,5.032,2215,5.956,2533,5.291,4050,5.639,4077,5.639,4495,6.166,4496,6.166,4497,6.166,4498,6.166,4499,6.166]],["t/1898",[51,0.888,59,1.109,72,0.916,80,1.425,81,1.298,84,4.216,110,1.648,112,1.98,128,4.444,159,2.084,216,3.126,238,6.001,271,2.172,328,5.323,470,1.205,571,3.341,654,4.827,702,1.425,772,4.483,3572,8.198,3694,8.198,4500,6.803]],["t/1900",[14,4.407,37,1.02,51,0.923,56,3.539,59,0.875,60,2.14,72,0.723,80,1.125,81,1.024,84,4.169,148,3.01,149,5.842,159,1.645,271,1.714,274,5.275,309,2.896,311,3.912,441,4.82,470,0.951,565,2.755,571,1.789,702,1.125,767,2.859,769,3.019,969,3.923,980,4.643,1133,3.019,1397,4.911,2103,4.609,2527,9.32,2565,4.202,2712,4.609,3172,4.911,4501,5.37,4502,7.625,4503,5.37,4504,5.37]],["t/1902",[51,0.872,59,1.486,72,0.94,80,1.463,81,1.332,129,3.046,159,2.139,189,3.101,190,2.804,271,2.229,327,2.944,337,5.013,470,1.237,571,2.327,702,1.463,968,5.269,1184,5.034,1286,5.464,3300,5.993,3866,5.699,3867,5.699,4505,5.993,4506,6.983,4507,6.983,4508,5.993]],["t/1904",[37,1.683,51,0.884,59,1.445,72,0.901,80,1.401,81,1.276,129,2.918,159,2.049,189,2.97,190,2.686,271,2.135,337,5.271,470,1.184,571,2.228,702,1.401,745,3.656,920,3.76,1184,4.928,1286,5.233,3866,5.458,3867,5.458,4505,5.739,4508,5.739,4509,6.688,4510,6.688,4511,6.688]],["t/1906",[37,1.742,51,0.874,59,1.495,72,0.949,80,1.476,81,1.344,159,2.158,189,3.129,190,2.829,271,2.249,337,5.03,470,1.248,571,2.348,702,1.476,1184,5.056,1286,5.513,3866,5.75,3867,5.75,4505,6.046,4508,6.046,4512,7.045,4513,7.045,4514,7.045]],["t/1908",[32,3.49,51,0.888,59,1.109,72,0.916,80,1.425,81,1.298,107,2.281,111,3.343,147,3.09,148,2.31,159,2.084,271,2.172,311,3.49,317,3.532,470,1.205,515,5.133,571,2.267,702,1.425,887,4.219,1195,5.133,1437,5.323,1499,5.115,1582,6.221,2850,4.827,4032,5.838,4515,8.965,4516,6.803,4517,6.803]],["t/1910",[20,1.981,33,1.646,37,1.483,50,1.017,51,0.913,59,1.273,64,1.508,72,0.749,80,1.165,81,1.06,110,1.022,129,3.408,148,1.888,159,1.703,167,2.74,216,1.733,256,3.439,271,1.775,398,2.756,435,1.876,470,0.985,571,1.852,702,1.165,767,2.959,823,2.853,1071,4.061,1222,4.061,1404,5.895,2074,6.376,2075,4.537,2773,3.945,4093,5.084,4213,6.705,4214,4.771,4216,4.771,4518,5.559,4519,5.559,4520,5.559,4521,5.559,4522,5.559,4523,5.559,4524,5.559,4525,5.559,4526,5.559]]],"invertedIndex":[["",{"_index":51,"t":{"733":{"position":[[258,1],[333,2]]},"737":{"position":[[20,1],[159,1],[173,1],[179,2],[200,2],[383,1],[385,2],[421,2],[424,2],[570,1],[572,2],[588,2],[591,1],[759,1],[761,2],[777,2],[780,1],[802,1]]},"739":{"position":[[20,1],[159,1],[173,1],[179,2],[200,2],[383,1],[385,2],[421,2],[424,2],[427,2],[536,1],[538,2],[554,2],[557,1],[579,1]]},"741":{"position":[[20,1],[159,1],[173,1],[179,2],[200,2],[383,1],[385,2],[421,2],[424,2],[513,1],[515,2],[531,2],[534,1],[556,1]]},"751":{"position":[[20,1],[160,1],[174,1],[180,2],[373,3],[377,1],[417,1],[476,2],[524,1],[686,2],[689,3],[693,2],[725,1]]},"759":{"position":[[82,2]]},"761":{"position":[[20,1],[95,1],[109,1],[115,2],[170,1],[199,2],[206,2],[323,1],[377,1]]},"763":{"position":[[20,1],[138,1],[152,1],[171,2],[336,1],[342,2],[397,1],[426,2],[433,2],[483,1],[537,1]]},"771":{"position":[[458,1]]},"773":{"position":[[626,1],[780,1],[794,1],[798,1],[839,3],[919,1],[937,2],[944,1],[955,2],[1020,1],[1022,2],[1129,1],[1131,1],[1165,2],[1205,2],[1212,2],[1309,3],[1332,2],[1360,1],[1369,2],[1410,2],[1417,1],[1473,1],[1491,1],[1554,1],[1571,2],[1612,1],[1621,2],[1662,2],[1669,1],[1711,1],[1853,2],[1856,1],[1894,2],[1928,1]]},"775":{"position":[[134,1],[152,2],[159,1],[170,2],[235,1],[237,2],[321,1],[323,1],[338,2],[341,2]]},"785":{"position":[[20,1],[114,1],[128,1],[134,2],[159,2],[236,3],[279,1],[318,2],[352,1]]},"795":{"position":[[20,1],[118,1],[132,1],[138,2],[160,2],[277,3],[320,1],[359,2],[369,2],[397,2],[404,1],[453,1],[455,1]]},"799":{"position":[[34,1]]},"805":{"position":[[20,1],[131,1],[145,1],[151,2],[166,2],[207,2],[257,2],[366,3],[370,2],[446,1],[479,1],[486,2],[514,2],[537,2],[574,2],[584,2],[592,2],[601,1],[649,1],[651,2],[679,2],[764,1],[778,1],[780,2],[802,2],[855,2],[913,2],[960,2],[967,1],[1022,1],[1061,1],[1099,1],[1135,1],[1173,1],[1180,2],[1220,2],[1256,2],[1312,1],[1314,1],[1322,1]]},"807":{"position":[[125,1],[244,1]]},"809":{"position":[[20,1],[164,1],[170,1],[172,2],[245,2],[324,2],[410,1],[424,1],[430,2],[445,2],[536,2],[581,1],[617,2],[624,1],[665,1],[667,2],[708,2],[758,2],[893,2],[896,3],[900,2],[976,1],[1009,1],[1016,2],[1044,2],[1067,2],[1104,2],[1114,2],[1122,2],[1131,1],[1179,1],[1181,2],[1209,2],[1294,1],[1308,1],[1310,2],[1332,2],[1385,2],[1443,2],[1484,2],[1491,1],[1588,1],[1627,1],[1665,1],[1701,1],[1739,1],[1746,2],[1786,2],[1822,2],[1878,1],[1880,1],[1888,1]]},"815":{"position":[[691,1],[801,1],[815,1],[821,2],[898,3],[942,1],[970,2],[973,1],[1008,1],[1057,1],[1059,2],[1112,2],[1129,1],[1207,1],[1209,2],[1294,2],[1337,1],[1339,1]]},"823":{"position":[[365,2]]},"827":{"position":[[85,1],[134,1],[157,2],[171,1],[238,1],[240,1],[262,1],[332,1],[346,1],[352,2],[374,2],[377,1],[415,2],[430,1],[445,2],[454,1],[456,1],[462,2],[792,1],[869,2],[876,2],[879,1],[948,1],[977,2],[1000,1]]},"839":{"position":[[20,1],[507,1],[520,1],[562,1],[567,2],[596,1],[605,2],[647,2],[654,1],[715,1],[717,3],[725,2],[817,1],[844,2],[894,1],[899,2],[922,2],[1001,2],[1035,1],[1080,1],[1096,2],[1143,2],[1150,1],[1167,1],[1172,2],[1397,3],[1401,1],[1560,1],[1614,1],[1624,2],[1733,2],[1742,1],[1770,1],[1789,1]]},"859":{"position":[[77,1],[146,1],[181,2]]},"863":{"position":[[4,2],[33,4],[94,1]]},"869":{"position":[[20,1],[97,1],[111,1],[117,2],[172,1],[174,2],[223,2],[306,1],[350,1],[384,2],[444,1],[446,2],[523,2],[559,2],[592,2],[633,2],[636,2],[639,2],[737,1],[767,1],[773,1],[791,1],[814,2],[821,1],[855,1],[892,1],[923,2],[930,1],[965,1],[967,1],[969,3],[1004,2],[1069,2],[1108,1]]},"871":{"position":[[130,2],[207,1],[256,2],[259,3],[320,4]]},"874":{"position":[[114,2],[187,2],[280,1],[282,2],[323,2],[409,2],[463,2],[515,2],[624,2],[671,2],[760,2],[823,2],[885,2],[935,1]]},"886":{"position":[[134,2],[169,2],[187,2],[221,2],[369,1],[384,2]]},"888":{"position":[[19,1],[21,2],[57,2],[60,2],[115,2],[152,2],[155,2],[193,2],[212,2],[215,2],[239,2],[258,2],[277,2],[280,2],[304,2],[323,2],[340,2],[343,2],[391,2],[410,2],[413,2],[471,2],[528,2],[531,2],[572,2],[609,2],[612,2],[639,1],[678,1]]},"890":{"position":[[48,1],[173,1],[188,1]]},"900":{"position":[[135,2],[170,2],[189,2],[223,2],[362,2],[365,2]]},"902":{"position":[[19,1],[21,2],[61,2],[97,2],[118,2],[207,2],[227,2],[295,2],[352,2],[393,2],[477,2],[539,2],[634,2],[676,1]]},"904":{"position":[[18,1],[37,3],[52,3],[66,3],[119,1]]},"914":{"position":[[132,2],[167,2],[183,2],[217,2],[303,1],[318,2]]},"916":{"position":[[19,1],[21,2],[38,2],[41,2],[98,2],[150,2],[153,2],[194,2],[231,2],[234,2],[261,1],[300,2],[351,2],[354,2],[447,2],[494,2],[497,2],[546,2],[593,2],[596,2],[641,1]]},"918":{"position":[[18,1],[85,1],[203,1]]},"928":{"position":[[131,2],[166,2],[181,2],[215,2],[305,2]]},"930":{"position":[[0,2],[61,1],[63,2],[80,2],[83,2],[134,2],[155,2],[158,2],[212,2],[276,2],[315,2],[318,2],[345,1],[382,2],[418,2],[421,2],[465,2],[518,2],[521,2],[562,1]]},"932":{"position":[[0,2],[57,1],[126,1],[172,1]]},"942":{"position":[[135,2],[170,2],[189,2],[246,2],[315,3],[329,3],[406,2]]},"944":{"position":[[19,1],[21,2],[101,2],[181,2],[244,2],[298,2],[385,2],[475,1]]},"946":{"position":[[0,2],[57,1],[176,1],[204,1],[219,1]]},"948":{"position":[[302,4]]},"956":{"position":[[134,2],[163,2],[196,2]]},"958":{"position":[[19,1],[21,2],[72,2],[158,2],[179,2],[258,2],[311,2],[342,2],[397,2],[469,2],[571,2],[639,2],[695,2],[707,3],[739,2],[823,2],[826,2],[888,2],[983,2],[986,2],[1028,2],[1081,2],[1084,2],[1125,2],[1160,2],[1234,2],[1338,2],[1400,2],[1583,2],[1821,2],[1856,2],[1930,2],[2034,2],[2096,2],[2279,2],[2518,2],[2570,2],[2680,2],[2756,2],[2830,2],[2942,2],[3010,2],[3068,1],[3094,1],[3136,1]]},"960":{"position":[[18,1],[193,1]]},"970":{"position":[[130,2],[165,2],[179,2],[213,2],[272,2]]},"972":{"position":[[19,1],[21,2],[72,2],[167,2],[229,2],[291,2],[359,1]]},"974":{"position":[[18,1],[82,1],[107,3],[121,3],[135,1]]},"984":{"position":[[134,2],[169,2],[187,2],[221,2],[282,2]]},"986":{"position":[[19,1],[21,2],[47,1],[49,2],[86,2],[89,2],[146,2],[198,2],[201,2],[242,1]]},"988":{"position":[[18,1],[56,1]]},"998":{"position":[[132,2],[167,2],[183,2],[217,2],[261,1],[276,2]]},"1000":{"position":[[19,1],[21,2],[58,2],[61,2],[78,1],[117,1]]},"1002":{"position":[[18,1],[43,1],[58,1]]},"1012":{"position":[[133,2],[168,2],[185,2],[219,2],[344,2],[347,2],[405,2],[556,2]]},"1014":{"position":[[19,1],[21,2],[111,2],[114,2],[138,2],[162,2],[198,2],[201,2],[249,2],[286,2],[289,2],[328,2],[347,2],[350,2],[374,2],[393,2],[412,2],[415,2],[439,2],[458,2],[475,2],[478,2],[526,2],[545,2],[548,2],[606,2],[658,2],[661,2],[702,1]]},"1016":{"position":[[18,1],[43,3],[141,1]]},"1026":{"position":[[131,2],[166,2],[181,2],[215,2],[345,1],[380,2],[383,2],[441,2],[570,1],[585,2]]},"1028":{"position":[[0,2],[61,1],[63,2],[153,2],[156,2],[180,2],[204,2],[240,2],[243,2],[291,2],[328,2],[331,2],[369,2],[388,2],[391,2],[415,2],[434,2],[453,2],[456,2],[480,2],[499,2],[516,2],[519,2],[543,2],[562,2],[579,2],[582,2],[630,2],[644,2],[647,2],[700,2],[752,2],[755,2],[796,2],[833,2],[836,2],[863,1],[902,2],[937,2],[940,2],[989,1]]},"1030":{"position":[[18,1],[43,3],[150,1],[185,1]]},"1040":{"position":[[131,2],[166,2],[181,2],[215,2],[345,1],[360,2],[363,2],[421,2],[538,1],[553,2],[556,2],[614,2],[688,2],[752,1],[767,2]]},"1042":{"position":[[19,1],[21,2],[99,2],[102,2],[141,2],[231,2],[234,2],[258,2],[282,2],[318,2],[321,2],[369,2],[406,2],[409,2],[447,2],[466,2],[469,2],[493,2],[512,2],[531,2],[534,2],[558,2],[577,2],[594,2],[597,2],[645,2],[659,2],[662,2],[715,2],[767,2],[770,2],[811,2],[848,2],[851,2],[878,1],[917,1]]},"1044":{"position":[[18,1],[43,3],[150,1],[165,1]]},"1054":{"position":[[132,2],[167,2],[183,2],[217,2],[296,2]]},"1056":{"position":[[19,1],[21,2],[38,2],[41,2],[84,2],[130,2],[133,2],[197,1]]},"1058":{"position":[[18,1],[78,1]]},"1068":{"position":[[137,2],[172,2],[190,2],[224,2],[322,1],[337,2]]},"1070":{"position":[[0,2],[61,1],[63,2],[146,2],[149,2],[194,2],[284,2],[287,2],[311,2],[335,2],[371,2],[374,2],[422,2],[459,2],[462,2],[500,2],[519,2],[522,2],[546,2],[565,2],[584,2],[587,2],[611,2],[630,2],[647,2],[650,2],[698,2],[712,2],[715,2],[768,2],[803,2],[806,2],[855,2],[907,2],[910,2],[951,2],[988,2],[991,2],[1018,1],[1057,1]]},"1072":{"position":[[0,2],[57,1],[82,3],[209,1],[224,1]]},"1082":{"position":[[145,2],[180,2],[195,2],[229,2],[297,3],[311,3],[371,1],[396,2],[399,2],[441,2],[521,2],[524,2],[565,2],[627,2],[630,2],[679,2],[741,2],[748,1],[774,1],[783,2],[893,1],[901,1],[1010,2],[1013,2],[1077,1],[1167,2]]},"1084":{"position":[[19,1],[21,2],[57,2],[60,2],[108,2],[145,2],[148,2],[186,2],[205,2],[208,2],[232,2],[251,2],[270,2],[273,2],[297,2],[316,2],[375,2],[378,2],[417,2],[549,2],[552,2],[606,2],[630,2],[644,2],[756,2],[759,2],[809,2],[853,2],[856,2],[880,2],[901,2],[983,2],[986,2],[1010,2],[1031,2],[1051,2],[1054,2],[1078,2],[1105,2],[1125,2],[1128,2],[1152,2],[1179,2],[1236,2],[1239,2],[1280,2],[1335,2],[1338,2],[1388,2],[1429,2],[1432,2],[1543,1]]},"1086":{"position":[[18,1],[69,3],[83,3],[92,3],[152,1],[208,3],[224,3],[246,3],[268,3],[272,1]]},"1096":{"position":[[135,2],[170,2],[189,2],[223,2],[276,2],[334,2],[341,2],[390,2],[424,2]]},"1098":{"position":[[19,1],[21,2],[98,2],[152,2],[216,1]]},"1100":{"position":[[18,1],[57,2],[97,1]]},"1110":{"position":[[128,2],[163,2],[175,2],[209,2],[315,2]]},"1112":{"position":[[0,2],[61,1],[63,2],[95,2],[127,2],[155,2],[174,2],[177,2],[245,2],[298,2],[301,2],[342,2],[426,2],[429,2],[491,2],[586,2],[589,2],[631,1],[657,1],[699,1]]},"1114":{"position":[[109,2],[166,1],[184,3],[196,3],[210,3],[291,1]]},"1124":{"position":[[133,2],[168,2],[185,2],[219,2],[332,1],[404,1],[419,2]]},"1126":{"position":[[19,1],[21,2],[38,2],[41,2],[89,2],[103,2],[106,2],[159,2],[211,2],[214,2],[255,2],[292,2],[295,2],[322,1],[361,2],[364,34],[399,2],[433,2],[436,2],[439,34],[474,2],[558,2],[561,2],[607,2],[684,2],[687,2],[733,2],[812,2],[815,2],[879,1]]},"1128":{"position":[[18,1],[110,1],[182,1],[197,1]]},"1130":{"position":[[155,1],[194,1]]},"1134":{"position":[[20,1],[58,2],[119,2],[156,2],[198,2],[207,2],[296,1],[310,1],[312,2],[366,2],[435,2],[467,2],[516,2],[583,2],[635,2],[716,2],[744,2],[832,2],[860,2],[966,2],[996,2],[1078,5],[1084,2],[1124,2],[1239,1],[1256,1],[1258,1],[1265,1],[1267,3],[1271,2],[1274,2],[1352,2],[1394,2],[1397,2],[1459,2],[1558,1],[1622,2],[1625,2],[1628,2],[1702,1],[1766,2],[1785,2],[1819,1]]},"1138":{"position":[[205,1],[307,1],[321,1],[330,2],[386,2],[428,2],[431,2],[444,2],[456,1],[540,1],[645,1],[659,1],[668,2],[737,2],[779,2],[782,2],[795,2],[807,1],[896,1],[1001,1],[1015,1],[1024,2],[1096,2],[1138,2],[1141,2],[1162,2],[1174,1],[1260,1],[1333,2],[1393,1],[1407,1],[1416,2],[1464,2],[1506,2],[1509,2],[1557,1]]},"1144":{"position":[[18,1],[52,1],[68,1],[102,1],[205,1],[276,1],[351,1],[365,1],[367,2],[397,2],[427,2],[457,2],[502,2],[512,2],[563,2],[599,2],[641,2],[682,1],[684,2],[762,2],[765,2],[812,1],[814,2],[912,2],[931,2],[965,1]]},"1148":{"position":[[271,1],[348,1],[362,1],[364,2],[394,2],[428,2],[458,2],[503,2],[513,2],[566,2],[602,2],[644,2],[685,1],[687,2],[765,2],[768,2],[815,1],[817,2],[915,2],[934,2],[968,1]]},"1152":{"position":[[21,2],[57,2],[81,2],[117,2],[353,1],[431,1],[445,1],[447,2],[477,2],[513,2],[543,2],[588,2],[598,2],[652,2],[688,2],[730,2],[771,1],[773,2],[851,2],[854,2],[901,1],[903,2],[1001,2],[1020,2],[1054,1]]},"1154":{"position":[[15,2],[87,2],[97,2],[100,2],[481,1],[578,1],[635,1],[637,2],[667,2],[742,2],[778,2],[820,2],[861,1],[863,2],[946,2],[949,2],[983,1]]},"1156":{"position":[[0,2],[63,1],[76,2],[98,1],[139,4],[148,1],[157,2],[160,1],[162,2],[192,2],[228,2],[285,2],[321,2],[462,2],[562,2],[578,2]]},"1160":{"position":[[18,3],[40,2],[62,3],[84,2],[311,1],[393,1],[407,1],[409,2],[439,2],[476,2],[506,2],[551,2],[561,2],[612,2],[648,2],[690,2],[731,1],[733,2],[811,2],[814,2],[861,1],[863,2],[961,2],[980,2],[1014,1]]},"1164":{"position":[[48,3],[101,3],[332,1],[408,1],[422,1],[424,2],[454,2],[486,2],[516,2],[561,2],[571,2],[623,2],[659,2],[701,2],[742,1],[744,2],[822,2],[825,2],[872,1],[874,2],[972,2],[991,2],[1025,1]]},"1166":{"position":[[20,1],[112,1],[166,1],[175,2],[224,2],[260,2],[302,2],[343,1],[345,2],[458,2],[461,2],[495,1],[604,3],[663,3]]},"1168":{"position":[[20,1],[128,1],[182,1],[191,2],[256,2],[322,1],[348,2],[351,1],[353,2],[389,2],[469,1],[471,2],[562,2],[565,2],[599,1]]},"1174":{"position":[[470,2]]},"1178":{"position":[[207,1],[213,1],[289,1],[449,1],[856,2],[878,1],[900,1],[909,2],[927,2],[956,1],[980,2],[1002,1],[1227,2],[1309,1],[1498,1],[1597,1],[1626,2],[1799,2],[1829,1],[1831,1],[1844,3],[1861,2],[1934,2],[1958,2],[1961,2]]},"1180":{"position":[[18,4],[204,2],[207,1],[209,3],[310,2],[324,3],[407,2],[434,2],[560,2],[563,3],[740,2],[743,3],[831,1],[888,2]]},"1182":{"position":[[558,2],[892,2],[913,2],[1327,1],[1351,1],[1374,1],[1401,1],[1856,5]]},"1184":{"position":[[577,1],[605,1],[619,1],[625,2],[734,1],[1022,1],[1072,1],[1085,1],[1108,1],[1116,1],[1725,2],[1767,2],[1774,2]]},"1186":{"position":[[240,2],[262,3],[296,2],[334,2],[372,1],[409,2],[447,1],[484,2],[591,2],[679,2],[693,2]]},"1188":{"position":[[674,2],[759,2],[1465,1],[1641,1],[1872,2],[1891,1],[1922,1],[1985,1],[2016,1],[2047,1],[2069,2],[2076,1],[2089,1],[2155,1],[2210,1],[2259,1],[2310,1],[2726,2],[2738,1],[2755,1]]},"1190":{"position":[[198,1],[220,1],[271,1],[284,2],[299,1],[313,1],[320,1],[335,1],[337,1],[1076,2],[1108,1],[1120,1],[1139,1],[1193,1],[1195,2],[1232,2],[1301,2],[1379,1],[1392,2],[1407,1],[1421,1],[1436,2],[1439,2],[1442,1],[1444,2],[1492,2],[2159,1],[2455,2],[2524,1],[2633,1],[2646,2],[2651,2],[2662,2],[2677,1],[2691,1],[2706,2],[3006,2],[3044,2],[3672,1],[3770,1],[3785,2],[4068,1],[4405,1],[4456,2],[4509,1],[4514,2],[4532,2],[4615,1],[4628,2],[4633,2],[4644,2],[4659,1],[4673,1],[4688,2],[4716,2],[4723,1],[4784,1],[4786,1]]},"1194":{"position":[[278,2],[289,2],[328,1],[403,1],[417,1],[419,2],[449,2],[479,2],[509,2],[554,2],[564,2],[614,2],[650,2],[692,2],[733,1],[735,2],[813,2],[816,2],[863,1],[865,2],[963,2],[982,2],[1016,1]]},"1198":{"position":[[23,3],[49,2],[71,3],[97,2],[341,1],[421,1],[435,1],[437,2],[467,2],[507,2],[537,2],[624,2],[706,2],[716,2],[789,2],[825,2],[867,2],[908,1],[910,2],[988,2],[991,2],[1038,1],[1040,2],[1138,2],[1157,2],[1191,1]]},"1202":{"position":[[256,1],[288,1],[363,2],[377,2],[396,1],[410,1],[412,2],[442,2],[472,2],[502,2],[547,2],[557,2],[607,2],[643,2],[685,2],[726,1],[728,2],[806,2],[809,2],[856,1],[858,2],[956,2],[975,2],[1009,1]]},"1206":{"position":[[19,2],[56,1],[64,2],[130,1],[171,1],[275,1],[307,1],[383,2],[397,2],[416,1],[430,1],[432,2],[462,2],[494,2],[524,2],[569,2],[579,2],[631,2],[667,2],[709,2],[750,1],[752,2],[830,2],[833,2],[880,1],[882,2],[980,2],[999,2],[1033,1]]},"1212":{"position":[[531,1],[533,2],[586,2],[605,2],[608,3],[612,1],[810,1],[812,2],[865,2],[884,2],[906,2],[967,2],[985,2],[1018,2],[1021,3],[1025,1],[1167,1],[1169,2],[1205,2],[1242,2],[1245,3],[1249,2],[1461,2],[1505,2]]},"1214":{"position":[[143,1],[149,2],[202,1],[241,2],[264,1]]},"1216":{"position":[[329,2],[639,2],[685,3],[727,1],[766,2],[780,2],[867,1],[897,1],[899,1],[920,2],[923,2],[962,2],[984,2],[1062,1],[1084,2],[1087,2],[1090,1],[1119,1],[1121,1],[1141,2],[1144,2],[1158,1],[1198,2],[1211,2],[1297,1],[1330,1],[1332,1],[1349,2],[1352,2],[1375,2]]},"1218":{"position":[[271,2]]},"1223":{"position":[[349,2],[352,2],[388,2],[391,2],[429,2],[432,2],[480,2],[549,2],[868,2],[871,2],[914,2],[917,2],[962,2],[965,2],[1188,2],[1276,1],[1278,2],[1366,2],[1444,2],[1509,2],[1559,2],[1627,2],[1676,2],[1738,2],[1784,2],[1850,2],[1905,2],[1974,2],[2025,2],[2072,2],[2075,2],[2105,1],[2172,2],[2219,2],[2286,2],[2289,2],[2347,2],[2423,2],[2426,2],[2475,2],[2546,2],[2549,2],[2598,1],[2608,2],[2752,1],[2781,2]]},"1225":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"1227":{"position":[[133,1],[139,2],[160,2],[201,2],[219,1],[271,1],[309,2],[343,1]]},"1229":{"position":[[156,1],[162,2],[181,2],[200,2],[221,2],[325,2],[351,2],[383,2],[419,2],[422,2],[425,1]]},"1231":{"position":[[146,1],[152,2],[171,2],[201,2],[212,2],[241,2],[277,2],[318,2],[337,2],[366,2],[402,2],[443,2],[490,1]]},"1233":{"position":[[186,1],[192,2],[249,1],[288,2],[355,2],[385,2],[428,1]]},"1235":{"position":[[119,1],[125,2],[167,1],[171,2],[174,3],[178,1]]},"1241":{"position":[[112,1],[139,1],[152,1],[166,1],[172,2],[257,2],[292,3],[296,1],[298,2],[347,1],[356,1],[358,1],[360,1],[411,1],[419,1],[421,1],[423,2],[426,1],[428,1],[480,1],[488,1],[490,1],[492,2],[495,1],[497,1],[553,1],[555,1],[557,1]]},"1243":{"position":[[126,1],[153,1],[166,1],[180,1],[186,2],[373,2],[451,2],[486,3],[490,1],[492,2],[539,1],[548,1],[550,1],[552,1],[596,4],[616,2],[619,1],[685,2],[688,1],[760,1],[762,2],[765,1],[767,1],[795,3],[807,4],[827,2],[830,1],[858,3],[893,2],[896,1],[924,3],[962,1],[964,2],[979,1],[981,1],[1055,1],[1057,2],[1072,1],[1074,1],[1148,1],[1150,2],[1158,1]]},"1245":{"position":[[111,1],[138,1],[151,1],[165,1],[171,2],[230,2],[275,3],[279,1],[281,2],[328,1],[337,1],[381,4],[401,1]]},"1247":{"position":[[211,1],[217,2],[272,1],[336,2],[379,3],[383,1],[385,2],[412,1],[421,1],[423,1],[468,4],[488,1],[490,1]]},"1249":{"position":[[39,1],[51,2]]},"1253":{"position":[[113,2],[157,2]]},"1255":{"position":[[307,1],[349,1],[453,2],[456,1]]},"1257":{"position":[[194,1],[236,1],[340,2],[343,1]]},"1259":{"position":[[390,1],[432,1],[607,2],[610,1]]},"1261":{"position":[[439,1],[481,1],[656,2],[659,1]]},"1263":{"position":[[205,2],[295,1]]},"1265":{"position":[[347,2],[427,1],[454,2],[457,2],[516,2],[519,2],[562,2],[565,2],[585,2],[681,2],[706,2],[723,2],[772,2],[790,1],[800,2],[855,2],[858,2],[875,1]]},"1270":{"position":[[58,2]]},"1274":{"position":[[40,2],[62,2],[156,2],[174,2],[181,1],[194,1],[213,2],[226,2],[229,3]]},"1276":{"position":[[380,2],[383,3]]},"1278":{"position":[[448,2],[460,2],[470,2],[480,2],[490,2]]},"1280":{"position":[[134,2],[137,3]]},"1282":{"position":[[190,2],[193,3]]},"1284":{"position":[[429,2],[432,3]]},"1286":{"position":[[197,2],[200,3]]},"1288":{"position":[[210,2],[213,3]]},"1290":{"position":[[158,2],[161,3]]},"1292":{"position":[[201,2],[204,3]]},"1294":{"position":[[241,2],[244,3]]},"1296":{"position":[[148,2],[214,2],[217,2],[235,2],[297,2],[325,2],[328,2],[343,1],[386,2],[389,2],[459,2],[490,2],[493,2],[737,2],[740,3]]},"1298":{"position":[[182,2],[185,3]]},"1300":{"position":[[178,2],[181,3]]},"1302":{"position":[[109,2],[166,2],[169,2],[236,2],[331,2],[388,2],[391,3]]},"1304":{"position":[[162,2],[228,2],[231,2],[298,2],[402,2],[468,2],[471,3],[772,2],[775,3],[1153,2],[1156,3],[1225,2],[1289,1],[1291,2],[1347,2],[1387,2],[1436,1],[1448,2],[1502,2],[1505,2],[1580,2],[1690,2],[1754,2],[1859,2],[1862,3]]},"1306":{"position":[[168,2],[171,3]]},"1308":{"position":[[138,2],[141,3]]},"1310":{"position":[[217,2],[220,3]]},"1312":{"position":[[188,2],[191,3]]},"1314":{"position":[[98,2],[131,2],[175,2],[229,1],[255,2],[258,3]]},"1316":{"position":[[157,2],[160,3]]},"1318":{"position":[[154,2],[157,3]]},"1320":{"position":[[158,2],[161,3]]},"1322":{"position":[[97,2],[116,2],[119,3]]},"1324":{"position":[[255,2],[300,2],[303,3]]},"1326":{"position":[[190,1],[216,2],[219,3]]},"1328":{"position":[[158,2],[175,2],[178,3]]},"1330":{"position":[[146,2],[164,2],[167,3]]},"1332":{"position":[[232,2],[252,2],[255,3]]},"1334":{"position":[[268,1],[287,2],[312,2],[315,2],[318,3]]},"1336":{"position":[[46,1],[58,1],[66,2],[96,1],[105,2],[135,1],[144,2],[173,1],[181,2],[212,1],[222,2],[247,1],[258,2],[291,1],[303,2],[336,1],[348,2],[379,1],[389,2],[418,1],[426,1],[468,1],[482,1],[508,1],[536,1],[570,1],[610,1],[657,1],[704,1],[758,1],[805,1],[852,1],[904,1],[958,1],[1018,1],[1084,1],[1157,1],[1199,1],[1252,1],[1269,1],[1275,2],[1319,1],[1325,2],[1361,1],[1367,2],[1402,1],[1408,2],[1429,1],[1435,2],[1468,1],[1474,2],[1508,1],[1514,2],[1567,1],[1573,2],[1608,1],[1614,2],[1652,1],[1658,2],[1698,1],[1704,2],[1739,1],[1745,2],[1785,1],[1791,2],[1821,1],[1827,2],[1869,1],[1875,2],[1917,1],[1923,2],[1954,1],[1960,2],[1994,1],[2000,2],[2037,1],[2043,2],[2075,1],[2081,2],[2124,1],[2130,2],[2173,1],[2179,2],[2211,1],[2217,2],[2255,1],[2261,2],[2300,1],[2306,2],[2341,1],[2347,2],[2381,1],[2387,2],[2429,1],[2435,2],[2474,1],[2480,2],[2523,1],[2529,2],[2567,1],[2573,2],[2607,1],[2613,2],[2643,1],[2649,2],[2689,1],[2695,2],[2740,1],[2746,2],[2791,1],[2797,2],[2841,1],[2847,2],[2894,1],[2900,2],[2955,1],[2961,2],[3002,1],[3008,2],[3041,1],[3047,2],[3091,1],[3097,2],[3142,1],[3148,2],[3179,1],[3185,2],[3226,1],[3232,2],[3265,1],[3271,2],[3311,1],[3317,2],[3364,1],[3370,2],[3407,1],[3413,2],[3462,1],[3468,2],[3516,1],[3522,2],[3563,1],[3569,2],[3609,1],[3615,2],[3651,1],[3657,2],[3701,1],[3707,2],[3747,1],[3753,2],[3802,1],[3808,2],[3855,1],[3861,2],[3904,1],[3910,2],[3947,1],[3953,2],[3988,1],[3994,2],[4045,1],[4051,2],[4066,1],[4079,1],[4095,1],[4124,2],[4159,1],[4190,2],[4226,1],[4260,2],[4292,1],[4320,2],[4351,1],[4378,2],[4417,1],[4452,2],[4488,1],[4520,2],[4560,1],[4596,2],[4631,1],[4664,2],[4695,1],[4722,2],[4749,1],[4772,2],[4809,1],[4842,2],[4884,1],[4921,2],[4963,1],[5003,2],[5044,1],[5080,2],[5124,1],[5163,2],[5215,1],[5262,2],[5300,1],[5336,2],[5366,1],[5391,2],[5432,1],[5469,2],[5511,1],[5549,2],[5577,1],[5602,2],[5640,1],[5675,2],[5705,1],[5732,2],[5769,1],[5803,2],[5847,1],[5886,2],[5920,1],[5954,2],[6000,1],[6046,2],[6091,1],[6136,2],[6174,1],[6212,2],[6249,1],[6282,2],[6315,1],[6344,2],[6385,1],[6422,2],[6459,1],[6492,2],[6538,1],[6580,2],[6624,1],[6664,2],[6704,1],[6742,2],[6776,1],[6807,2],[6839,1],[6869,2],[6917,1],[6965,2],[6980,1],[7028,1],[7050,1],[7092,1],[7140,1],[7186,1],[7217,1],[7244,1],[7282,1],[7316,1],[7341,1],[7366,1],[7393,1],[7430,1],[7470,1],[7496,1],[7520,1],[7550,1],[7584,1],[7615,1],[7636,1],[7659,1],[7694,1],[7734,1],[7776,1],[7819,1],[7848,1],[7874,1],[7905,1],[7933,1],[7964,1],[8004,1],[8045,1],[8078,1],[8102,1],[8131,1],[8164,1],[8215,1],[8284,1],[8349,1],[8413,1],[8478,1],[8538,1],[8599,1],[8667,1],[8714,1],[8749,1],[8809,1],[8857,1],[8874,1],[8906,1],[8952,1],[8995,1],[9036,1],[9077,1],[9116,1],[9149,1],[9173,1],[9201,1],[9242,1],[9285,1],[9332,1],[9377,1],[9414,1],[9446,1],[9470,1],[9490,1],[9513,1],[9546,1],[9582,1],[9609,1],[9632,1],[9662,1],[9699,1],[9731,1],[9756,1],[9794,1],[9860,1],[9932,1],[9980,1],[10014,1],[10053,1],[10103,1],[10165,1],[10225,1],[10281,1],[10331,1],[10374,1],[10411,1],[10449,1],[10488,1],[10516,1],[10539,1],[10566,1],[10593,1],[10616,1],[10637,1],[10672,1],[10719,1],[10773,1],[10824,1],[10873,1],[10926,1],[10970,1],[11010,1],[11055,1],[11089,1],[11112,1],[11133,1],[11165,1],[11197,1],[11223,1],[11256,1],[11291,1],[11325,1],[11359,1],[11394,1],[11422,1],[11460,1],[11503,1],[11535,1],[11573,1],[11611,1],[11648,1],[11668,1]]},"1339":{"position":[[155,2],[177,2],[192,2],[195,3]]},"1341":{"position":[[76,2],[97,2],[231,2],[234,2],[237,3],[346,2],[507,1],[514,1],[999,1],[1334,1],[5037,1],[5332,2],[5335,2],[5916,2],[6900,2]]},"1343":{"position":[[174,1],[227,2]]},"1345":{"position":[[104,2],[146,2],[188,2],[211,1],[251,1],[258,1],[295,1],[297,2],[300,3]]},"1349":{"position":[[95,1],[195,1],[325,1],[412,1],[510,1],[591,1],[704,1],[846,1]]},"1352":{"position":[[20,1],[118,1],[132,1],[134,2],[155,2],[170,2],[187,1],[253,2],[274,1],[339,2],[382,1],[430,1],[459,1],[512,1],[544,1]]},"1354":{"position":[[20,1],[118,1],[132,1],[134,2],[155,2],[170,2],[190,1],[253,2],[296,1],[349,1],[420,1],[473,2],[476,1]]},"1356":{"position":[[20,1],[112,1],[126,1],[128,2],[146,1],[207,2],[225,1],[302,2],[359,1],[392,1],[430,1]]},"1358":{"position":[[20,1],[112,1],[126,1],[132,2],[172,2],[247,1],[280,1],[318,1]]},"1360":{"position":[[20,1],[112,1],[126,1],[132,2],[183,2],[258,1],[302,1],[317,2],[360,2],[367,1],[380,1],[416,1],[418,1],[442,1]]},"1366":{"position":[[77,1],[160,1],[238,2],[366,2],[369,3],[373,2],[516,2],[580,1],[590,2],[600,2],[608,2],[617,1],[631,1],[641,2],[652,2],[660,2],[672,1],[686,1],[701,2],[743,1],[786,2],[841,3]]},"1368":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[236,2],[239,2],[305,2],[366,2],[425,2],[475,2],[478,2],[527,2],[573,2],[619,2],[669,2],[724,2],[770,2],[773,2],[837,2],[907,2],[992,2],[995,2],[1048,2],[1106,2],[1109,2],[1165,2],[1223,2],[1226,2],[1282,1]]},"1370":{"position":[[18,1],[182,1]]},"1376":{"position":[[77,1],[156,1],[234,2],[284,2],[389,1],[417,2],[427,2],[445,1],[480,3],[638,1],[656,2],[729,1],[759,2],[802,1],[838,2],[841,3],[883,1],[957,2]]},"1378":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[255,2],[258,2],[282,1],[321,2],[427,2],[430,2],[456,2],[459,2],[508,2],[567,2],[570,2],[616,2],[687,2],[690,2],[728,1],[730,2],[767,2],[770,1],[809,2],[898,2],[901,2],[977,2],[1031,2],[1034,2],[1109,2],[1181,1],[1191,2],[1194,2],[1238,2],[1335,2],[1408,2],[1428,2],[1431,2],[1459,2],[1501,2],[1572,2],[1575,2],[1648,1]]},"1380":{"position":[[18,1],[53,1],[153,1],[189,2],[328,1]]},"1386":{"position":[[77,1],[159,1],[237,2],[290,2],[403,2],[408,3],[412,2],[519,1],[537,2],[557,2],[592,2],[597,3]]},"1388":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[240,2],[243,2],[278,2],[299,2],[318,2],[339,2],[376,1]]},"1390":{"position":[[18,1],[60,1]]},"1392":{"position":[[0,2],[28,1],[44,1],[62,1],[81,1],[106,1],[110,1]]},"1398":{"position":[[77,1],[155,1],[233,2],[282,2],[458,3],[959,1],[993,2],[1010,2],[1013,3]]},"1400":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[282,2],[352,2],[355,2],[449,2],[488,2],[491,2],[559,2],[630,2],[633,2],[660,3],[684,2],[760,2],[812,2],[815,2],[895,2],[967,2],[1041,2],[1044,2],[1071,3],[1095,2],[1168,2],[1242,2],[1314,2],[1363,2],[1366,2],[1422,2],[1495,2],[1506,2],[1509,2],[1536,3],[1561,2],[1638,2],[1656,2],[1659,2],[1700,1]]},"1402":{"position":[[18,1],[76,4],[227,2],[230,5],[250,3],[294,3],[309,1]]},"1408":{"position":[[77,1],[155,1],[233,2],[282,2],[447,1],[532,1],[534,3],[538,2],[541,3]]},"1410":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[265,2],[333,2],[353,2],[374,2],[394,2],[414,2],[433,2],[454,2],[457,2],[503,2],[506,2],[567,2],[634,2],[688,2],[718,2],[745,3],[769,2],[797,2],[824,3],[846,2],[885,2],[937,2],[979,2],[1033,2],[1087,2],[1143,2],[1211,2],[1271,2],[1331,2],[1334,2],[1358,1],[1395,2],[1449,2],[1452,2],[1509,2],[1568,2],[1623,2],[1626,2],[1648,2],[1669,2],[1710,2],[1713,2],[1773,2],[1809,2],[1812,2],[1885,2],[1888,2],[1999,1]]},"1412":{"position":[[18,1],[49,1],[121,1],[234,1]]},"1414":{"position":[[6,1],[19,1],[36,1]]},"1416":{"position":[[58,2],[75,2],[166,3]]},"1418":{"position":[[1107,1],[1138,1]]},"1422":{"position":[[77,1],[160,1],[238,2],[292,2],[401,2],[404,3],[408,3]]},"1424":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[264,2],[267,2],[396,2],[484,2],[487,2],[648,2],[712,2],[715,2],[768,1]]},"1426":{"position":[[18,1],[65,1],[99,2],[125,2],[168,1],[208,2],[237,1]]},"1428":{"position":[[6,1],[26,1],[64,1],[70,1]]},"1432":{"position":[[0,2],[72,2]]},"1434":{"position":[[77,1],[164,1],[242,2],[270,2],[389,2],[500,2],[698,3],[702,2],[709,1],[782,1],[813,1],[834,2],[837,2],[845,1],[914,1],[974,2],[988,2]]},"1436":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[249,2],[252,2],[300,2],[339,1],[357,2],[360,2],[439,2],[551,2],[590,2],[593,2],[689,2],[728,2],[731,2],[827,1]]},"1438":{"position":[[18,1],[71,3],[127,1]]},"1440":{"position":[[307,2],[330,3],[432,3]]},"1446":{"position":[[77,1],[157,1],[235,2],[305,2],[443,3],[529,4],[534,3],[538,1]]},"1448":{"position":[[24,1],[34,1],[106,1],[108,1]]},"1450":{"position":[[0,2],[64,1],[66,2],[164,2],[268,1]]},"1458":{"position":[[77,1],[155,1],[233,2],[282,2],[289,1],[379,1],[418,2],[421,2],[506,3],[510,2],[517,1],[610,1],[649,2]]},"1460":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[264,2],[328,2],[394,2],[462,2],[529,2],[595,2],[661,2],[704,1]]},"1462":{"position":[[18,1],[52,1]]},"1468":{"position":[[77,1],[166,1],[254,1],[341,1],[429,2],[592,1],[689,5],[695,1],[732,1],[765,1]]},"1470":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,1]]},"1472":{"position":[[18,1],[39,1]]},"1478":{"position":[[77,1],[158,1],[236,2],[288,2],[411,3]]},"1480":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[259,2],[262,2],[284,2],[299,2],[326,2],[329,2],[377,2],[457,2],[522,2],[525,2],[578,2],[661,2],[664,2],[733,1]]},"1482":{"position":[[18,1],[45,3],[103,1]]},"1484":{"position":[[98,1],[262,1]]},"1488":{"position":[[77,1],[161,1],[239,2],[337,3],[341,2],[529,3]]},"1490":{"position":[[110,1],[227,1],[229,2],[289,2],[370,1],[376,2],[456,3],[460,2],[558,2],[614,2],[780,3],[815,1]]},"1492":{"position":[[55,1],[168,1],[182,1],[188,2],[284,3],[319,1]]},"1494":{"position":[[55,1],[171,1],[185,1],[191,2],[301,3],[336,1]]},"1496":{"position":[[58,1],[174,1],[188,1],[194,2],[306,3],[341,1]]},"1498":{"position":[[55,1],[174,1],[188,1],[194,2],[290,3],[325,1]]},"1500":{"position":[[53,1],[137,2],[260,1],[274,1],[290,2],[309,2],[316,1],[329,1],[335,2],[413,3],[448,1]]},"1502":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[240,2],[285,2],[288,2],[343,2],[346,2],[408,2],[447,2],[450,2],[485,2],[488,2],[509,2],[551,2],[581,2],[584,2],[640,2],[679,2],[682,2],[745,2],[792,2],[859,2],[862,2],[920,2],[978,2],[981,2],[1003,2],[1050,2],[1096,2],[1132,2],[1135,2],[1157,2],[1216,1]]},"1504":{"position":[[18,1],[62,3],[134,3],[138,1]]},"1510":{"position":[[20,1],[100,1],[114,1],[120,2],[195,1],[229,2],[252,1]]},"1512":{"position":[[0,2],[64,1],[66,2],[113,2],[166,2],[183,2],[236,2],[258,2],[322,2],[339,2],[380,2],[460,2],[474,2],[519,2],[544,2],[605,2],[630,2],[657,3],[690,2],[707,2],[760,2],[782,2],[840,2],[858,2],[925,2],[947,2],[974,3],[1002,2],[1034,2],[1110,2],[1140,2],[1213,2],[1245,2],[1320,2],[1344,2],[1403,2],[1429,2],[1490,2],[1512,2],[1573,2],[1610,2],[1674,1]]},"1514":{"position":[[18,1],[377,1]]},"1516":{"position":[[89,1],[147,1]]},"1520":{"position":[[77,1],[162,1]]},"1524":{"position":[[57,1],[72,2],[75,3],[79,3]]},"1526":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[258,2],[317,2],[320,2],[345,1],[382,2],[456,2],[459,2],[516,2],[606,2],[609,2],[749,2],[841,2],[844,2],[921,2],[955,2],[958,2],[1035,2],[1087,2],[1090,2],[1178,1]]},"1528":{"position":[[18,1],[58,1],[60,2],[166,2],[182,1],[269,1],[280,2],[297,2],[303,1],[305,2],[374,2],[415,1],[428,2],[468,2],[538,2],[594,1]]},"1534":{"position":[[20,1],[133,1],[139,1],[148,1],[181,1],[243,1],[258,2],[301,2],[392,2],[397,1],[416,1],[468,1],[482,1],[488,2],[503,2],[687,3],[729,1],[782,2],[805,1],[813,1],[837,1],[878,2],[990,2],[1092,2]]},"1536":{"position":[[159,1],[291,1],[297,1],[306,1],[353,1],[445,1],[447,1],[509,1],[524,2],[567,2],[658,2],[663,1],[682,1],[734,1],[771,1],[785,2],[836,2],[859,1],[897,1],[912,1],[914,1],[928,1],[942,1],[948,2],[1078,3],[1120,1],[1153,2],[1207,1],[1260,2],[1306,1],[1361,2],[1384,1],[1408,1],[1410,1],[1473,2],[1484,1],[1621,2],[1652,1],[1777,2]]},"1538":{"position":[[20,1],[133,1],[141,1],[150,1],[174,1],[188,1],[194,2],[224,2],[311,1],[326,2],[369,2],[460,2],[465,1],[484,1],[536,2],[539,2],[580,1],[613,2],[677,1],[730,2],[753,1],[777,1],[779,1],[842,2],[853,1],[982,2]]},"1540":{"position":[[0,2],[64,1],[66,2],[113,2],[166,2],[238,2],[293,2],[366,2],[410,2],[491,2],[562,2],[598,2],[649,2],[669,2],[690,2],[710,2],[729,2],[749,2],[787,2],[841,2],[896,2],[989,2],[1058,2],[1107,1]]},"1542":{"position":[[18,1],[69,1],[87,2],[140,1],[149,2],[180,1],[248,1],[333,2],[357,1],[429,1]]},"1548":{"position":[[77,1],[158,1],[236,2],[288,2],[397,1],[413,2],[428,2],[455,1],[510,1],[544,2],[586,1],[624,2],[655,3]]},"1550":{"position":[[195,1],[254,3],[407,1],[442,1],[459,1],[478,1],[503,1]]},"1552":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[287,2],[290,2],[312,2],[390,2],[393,2],[431,1],[433,2],[450,2],[453,1],[492,2],[568,2],[571,2],[585,1],[624,2],[680,2],[683,2],[720,1],[722,2],[774,2],[777,1],[806,2],[852,2],[877,2],[880,2],[922,2],[968,1],[992,2],[995,2],[1041,2],[1095,2],[1098,2],[1173,2],[1244,2],[1247,2],[1324,1]]},"1554":{"position":[[18,1],[50,1],[105,1],[121,2],[163,1],[214,2],[309,1]]},"1556":{"position":[[58,2],[75,2],[172,3]]},"1562":{"position":[[77,1],[157,1],[416,2],[467,2],[510,2],[633,3],[637,2],[718,2],[833,3],[837,2],[858,1],[1012,3],[1016,2],[1048,2],[1124,2],[1131,1],[1175,1],[1244,3],[1248,2],[1446,1],[1496,2],[1499,2],[1502,3],[1506,2],[1673,1],[1704,2],[1722,1],[1756,1],[1758,2],[1761,3],[1765,2],[1872,3]]},"1564":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[289,2],[330,2],[333,2],[401,2],[447,2],[450,2],[521,2],[556,2],[559,2],[648,2],[734,2],[737,2],[786,2],[879,2],[882,2],[928,2],[989,2],[992,2],[1018,1],[1064,2],[1109,2],[1112,2],[1151,2],[1215,2],[1218,2],[1324,1]]},"1566":{"position":[[18,1],[175,1],[235,1]]},"1568":{"position":[[0,2],[26,1],[35,1],[51,1],[71,1],[95,1],[116,1],[131,1],[145,1],[161,1],[180,1],[199,1],[215,1],[229,1],[247,1],[269,1],[280,2],[310,1],[322,2],[353,1],[389,1],[405,2],[441,1],[450,2],[479,1],[510,1],[537,1],[556,1],[566,2],[616,1],[628,2],[659,1],[674,2],[706,1],[722,2],[750,1],[761,2],[786,1],[796,2],[822,1],[834,2],[862,1],[874,2],[893,1],[910,1],[927,1],[947,1],[966,1],[986,1],[1006,1],[1024,1],[1043,1],[1053,1]]},"1574":{"position":[[77,1],[158,1],[236,2],[336,2],[379,2],[416,2],[740,2],[749,1],[846,2]]},"1576":{"position":[[0,2],[64,1],[66,2],[88,2],[91,2],[142,2],[160,2],[163,2],[217,2],[279,2],[282,2],[323,2],[394,2],[397,2],[452,2],[500,2],[503,2],[549,2],[598,1],[631,2],[634,2],[745,2],[799,1],[832,2],[835,2],[955,1]]},"1578":{"position":[[18,1],[297,3],[301,1]]},"1584":{"position":[[77,1],[156,1],[234,2],[284,2],[327,2],[501,2]]},"1586":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[255,2],[317,2],[348,2],[351,2],[373,2],[390,1]]},"1588":{"position":[[18,1],[39,1]]},"1592":{"position":[[0,2],[110,2],[257,2],[400,2],[634,2],[822,2],[1020,2],[1212,2]]},"1594":{"position":[[77,1],[156,1],[234,2],[301,2],[404,2],[407,2],[586,2],[589,2],[673,2],[846,2],[1034,3],[1038,2],[1110,1],[1116,2],[1171,2],[1196,2],[1203,1],[1216,1],[1218,2],[1311,2],[1314,2],[1406,1],[1415,2],[1468,2],[1475,1],[1488,1],[1490,2],[1583,2],[1586,2],[1695,1],[1704,2],[1763,1],[1773,2],[1780,1],[1793,1],[1795,2],[1888,2],[1891,2],[1984,1],[1993,2],[2070,2],[2077,1],[2090,1],[2092,2],[2185,2],[2188,2],[2351,2],[2354,3],[2358,2],[2534,2],[2577,1],[2634,2],[2678,1],[2735,2],[2738,3],[2742,2],[2950,3]]},"1596":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[256,2],[259,2],[302,2],[355,2],[358,2],[387,2],[436,2],[439,2],[493,2],[544,2],[547,2],[602,2],[671,2],[674,2],[727,2],[780,2],[825,2],[891,2],[965,2],[1039,2],[1096,2],[1154,2],[1231,2],[1300,1]]},"1598":{"position":[[18,1],[122,1]]},"1604":{"position":[[77,1],[158,1],[236,2],[288,2],[373,1],[397,2]]},"1606":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[244,2],[247,2],[297,2],[359,2],[362,2],[461,1]]},"1608":{"position":[[18,1],[109,1]]},"1614":{"position":[[20,1],[102,1],[116,1],[122,2],[238,2],[258,3],[303,1],[342,2],[388,1],[421,1],[423,1],[440,2],[463,1]]},"1616":{"position":[[0,2],[64,1],[66,2],[115,2],[168,2],[252,2],[297,2],[319,2],[338,2],[358,2],[396,2],[465,2],[501,2],[544,2],[642,1]]},"1618":{"position":[[18,1],[59,1]]},"1624":{"position":[[77,1],[160,1],[238,2],[292,2],[427,1],[448,2],[451,3]]},"1626":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[262,2],[265,2],[316,2],[383,2],[386,2],[443,2],[509,2],[547,2],[550,2],[605,1]]},"1628":{"position":[[199,1],[300,1]]},"1634":{"position":[[20,1],[101,1],[115,1],[121,2],[235,2],[238,3],[283,1],[322,2],[368,1],[401,1],[403,1],[420,2],[443,1]]},"1640":{"position":[[77,1],[158,1],[236,2],[265,2],[313,2],[368,1],[370,2],[408,2],[431,2],[438,1],[451,1],[453,2],[471,2],[491,2],[533,2],[554,2],[569,2],[603,2],[629,2],[652,2],[659,1],[672,1],[674,2],[748,1],[753,2],[776,2],[796,2],[803,1],[816,1],[871,2]]},"1642":{"position":[[0,2],[64,1],[66,2],[94,2],[124,1],[161,2],[208,2],[270,2],[341,2],[384,2],[455,2],[520,2],[550,2],[577,3],[601,2],[629,2],[656,3],[678,2],[717,2],[769,2],[811,2],[865,2],[894,2],[950,2],[1018,2],[1055,2],[1112,2],[1155,2],[1222,2],[1276,2],[1339,2],[1378,1]]},"1644":{"position":[[18,1],[43,1],[161,1]]},"1646":{"position":[[6,1],[28,1],[59,1],[92,1],[102,1]]},"1648":{"position":[[58,2],[75,2],[124,2],[173,2]]},"1654":{"position":[[77,1],[155,1],[245,1],[251,2],[323,1],[345,2],[364,3],[408,1],[457,2],[491,1],[533,1],[586,1]]},"1660":{"position":[[77,1],[158,1],[248,1],[254,2],[271,2],[299,1],[314,2],[358,1],[373,2],[426,2],[433,1],[481,1],[494,1],[585,1],[653,1],[661,2],[688,1],[695,1],[726,1],[728,1],[738,1],[777,1],[788,1],[801,1],[1026,1],[1075,1],[1081,2],[1098,2],[1126,1],[1141,2],[1185,1],[1200,2],[1268,2],[1275,1],[1323,1],[1336,1],[1453,1],[1536,1],[1544,2],[1571,1],[1578,1],[1609,1],[1611,1],[1621,1],[1649,1],[1660,1],[1673,1],[1716,1],[1722,2],[1743,2],[1825,2],[1855,1],[1862,2],[1915,1],[1962,2],[1969,1],[1989,1],[1999,1],[2027,2],[2034,1],[2054,1],[2067,1],[2165,1]]},"1663":{"position":[[497,1]]},"1675":{"position":[[0,2],[94,1]]},"1680":{"position":[[415,1],[492,2]]},"1682":{"position":[[545,1],[562,1],[564,3],[576,1],[596,1],[622,2],[629,1],[650,1],[657,1],[674,1],[716,1],[762,1]]},"1684":{"position":[[142,2],[219,1],[294,2],[297,2]]},"1688":{"position":[[180,1],[194,2]]},"1690":{"position":[[77,1],[163,1],[182,1],[201,1],[215,1],[217,2],[232,2],[254,2],[262,2],[269,2],[281,2],[389,3],[421,1],[472,1],[501,2],[504,2],[513,2],[521,2],[535,2],[644,3],[677,1],[730,1],[760,2],[763,2],[775,2],[786,2],[803,2],[912,3],[940,1],[993,1],[1026,2],[1029,2],[1043,2],[1091,1],[1098,2],[1129,2],[1136,1],[1180,1],[1187,1],[1234,1],[1236,2],[1270,1]]},"1693":{"position":[[244,1],[246,2],[310,2],[492,1],[579,1],[593,1],[599,2],[675,1],[716,2],[750,1],[1021,1],[1023,2],[1085,2],[1175,2]]},"1695":{"position":[[226,2],[275,1],[313,1],[315,2],[351,2],[386,2],[485,1],[492,1],[501,1],[503,2],[613,2],[700,1]]},"1697":{"position":[[539,2],[593,2],[620,2],[706,1],[708,2],[744,2],[779,2],[878,1],[885,1],[894,1],[896,2],[926,1],[993,2],[1000,1],[1002,2],[1119,1],[1121,2],[1155,2],[1158,2],[1161,2],[1164,3],[1195,1]]},"1700":{"position":[[480,1],[486,2],[569,2],[572,1],[574,3],[578,1]]},"1706":{"position":[[79,1],[85,2],[104,2],[137,2],[148,2],[180,2],[216,2],[257,2],[276,2],[308,2],[344,2],[385,2],[432,1],[493,1],[499,2],[518,2],[539,2],[550,2],[570,2],[606,2],[647,2],[666,2],[686,2],[722,2],[763,2],[810,1]]},"1708":{"position":[[131,1],[137,2],[160,2],[188,1],[226,1],[232,2],[253,2],[264,2],[309,1],[311,2],[376,2],[404,2],[445,2],[492,1]]},"1712":{"position":[[0,2],[77,1],[116,1],[153,1],[197,1],[235,1],[269,1],[310,1],[348,1]]},"1716":{"position":[[271,1],[309,1],[323,1],[329,2],[382,1],[482,1],[501,1],[503,1],[512,1],[514,2],[517,2],[531,2],[579,1],[600,1],[602,1],[613,1],[632,2],[681,1],[791,1],[872,1],[874,2],[886,2],[916,2]]},"1728":{"position":[[308,1],[346,1],[360,1],[366,2],[424,2],[525,1],[586,2],[589,3],[604,2],[633,1],[635,2],[646,2]]},"1731":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"1733":{"position":[[185,2],[243,4],[286,1],[316,2],[319,2],[414,1],[445,2],[448,2],[553,1],[589,2]]},"1735":{"position":[[372,2],[415,2],[418,2],[425,1],[658,4],[841,2],[916,1],[1012,2],[1015,2],[1091,1],[1128,2],[1131,2],[1202,1],[1242,2],[1245,2],[1321,1],[1358,2],[1361,2],[1553,1],[1595,2],[1620,1],[1622,1],[1636,3],[1796,4],[1928,2],[2037,1],[2116,2],[2134,2],[2137,2],[2233,1],[2306,2],[2317,2],[2476,2],[2607,1],[2683,2],[2694,2],[2915,2],[2927,2],[2946,1],[2948,4],[2962,1],[3002,2],[3017,2],[3036,1],[3074,2],[3105,2],[3122,1],[3143,1],[3185,2],[3217,2],[3234,1],[3253,1]]},"1737":{"position":[[1339,1],[1379,2],[1382,2],[1422,2],[1428,2],[1467,2],[1496,1],[1587,1],[1627,2],[1630,2],[1674,2],[1696,2],[1735,2],[1752,2],[1793,2],[1986,1],[2026,2],[2029,2],[2070,2],[2089,2],[2131,2],[2151,2],[2199,2],[2236,2],[2306,3],[2310,2],[2313,2],[2316,2],[2319,2],[2322,2],[2325,2],[2328,2],[2331,2],[2334,3],[2497,1],[2537,2],[2540,2],[2580,2],[2586,2],[2624,2],[2627,2],[2668,2]]},"1739":{"position":[[279,1],[281,2],[363,2],[405,2],[446,1],[485,2]]},"1741":{"position":[[82,1],[88,2],[107,2],[140,2],[151,2],[183,2],[219,2],[260,2],[279,2],[311,2],[347,2],[388,2],[435,1]]},"1744":{"position":[[97,1],[168,1],[298,2],[341,2],[383,2],[507,2],[867,1],[923,3],[927,2]]},"1746":{"position":[[188,1],[264,1],[278,1],[280,2],[334,2],[366,2],[423,2],[458,2],[468,2],[508,2],[550,2],[591,1],[593,2],[680,2],[683,2],[717,1]]},"1749":{"position":[[407,1],[474,2],[548,2],[750,1],[778,1],[823,1],[838,1],[904,1],[938,2],[970,2],[977,1],[990,2],[1032,1],[1080,1],[1116,1],[1142,1],[1163,1],[1190,1],[1192,1],[1208,1],[1243,1],[1272,2],[1292,2],[1319,2],[1326,1],[1417,2],[1420,1],[1429,2],[1464,2],[1471,1],[1526,1],[1587,1],[1589,2],[1640,2],[1779,2],[1793,2]]},"1751":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"1754":{"position":[[349,2],[469,1],[489,2],[522,2],[563,2],[603,2],[669,2],[730,2],[733,2],[753,2],[756,2],[759,2],[762,3],[766,2],[779,2],[827,4],[874,1],[920,2],[1005,2],[1063,2],[1066,3],[1077,3],[1118,2],[1121,3],[1125,2],[1191,2],[1234,2],[1275,2],[1350,1],[1394,2],[1447,2],[1498,2],[1506,2],[1509,3],[1513,2]]},"1756":{"position":[[141,2],[226,1],[242,2],[265,2],[268,3],[272,2],[275,2],[360,1],[376,2],[401,2],[404,3],[408,2]]},"1758":{"position":[[166,1],[199,2]]},"1760":{"position":[[262,1],[322,2],[325,2],[395,2],[398,2],[449,2],[452,3],[456,2]]},"1762":{"position":[[172,1],[189,2],[192,2],[268,2],[271,2],[327,2],[330,2],[357,2],[360,3],[364,2]]},"1764":{"position":[[31,1],[101,2],[181,1],[195,2],[218,2],[221,3],[225,2]]},"1766":{"position":[[211,1],[257,2],[260,2],[301,1],[344,2],[378,2]]},"1768":{"position":[[76,2],[166,1],[168,2],[227,2],[250,2]]},"1770":{"position":[[452,2],[524,1],[624,1],[665,1],[669,2],[691,2],[715,2],[722,1],[735,1],[757,2],[785,2],[792,2],[795,3],[799,2],[802,2],[848,2],[961,2],[1085,2],[1197,2],[1260,2]]},"1772":{"position":[[151,1],[153,2],[192,2],[249,2],[343,2],[346,3],[350,2],[718,1],[808,1],[855,2],[858,2],[861,3],[865,2],[912,1],[953,2],[1020,1],[1060,2],[1063,2],[1066,3],[1070,2]]},"1774":{"position":[[330,2],[405,1],[411,2],[434,2],[437,3],[441,2]]},"1778":{"position":[[77,1],[387,1],[435,1],[437,2],[461,2],[494,1],[516,1],[539,1],[559,1],[572,2],[603,2],[606,3],[610,2]]},"1780":{"position":[[243,1],[245,2],[285,2],[321,2],[330,2],[333,3],[337,2]]},"1782":{"position":[[398,1],[447,2],[450,2],[540,2],[543,2],[566,2]]},"1784":{"position":[[286,1],[288,2],[336,2],[339,2],[356,2],[403,2],[406,2],[430,2],[484,2],[487,2],[506,2],[509,2],[512,2]]},"1786":{"position":[[216,1],[218,2],[274,2],[300,2],[392,2]]},"1788":{"position":[[214,1],[216,2],[279,2],[282,2],[295,2],[311,2],[314,2],[317,2]]},"1792":{"position":[[208,1],[232,2],[270,2],[313,2],[323,2],[326,2],[329,2]]},"1796":{"position":[[219,1],[253,2],[327,2],[380,2],[390,2],[393,2],[396,2]]},"1800":{"position":[[222,1],[319,1],[420,1],[434,2],[514,2],[517,2]]},"1802":{"position":[[106,2],[176,1],[191,2],[207,2],[210,3],[214,2]]},"1804":{"position":[[128,1],[137,2],[152,2],[155,3],[159,2],[289,2],[356,2]]},"1806":{"position":[[129,2],[213,1],[223,2],[260,2],[263,3],[267,2]]},"1808":{"position":[[256,2],[336,1],[351,2],[373,2],[394,2],[403,2],[406,3],[410,2]]},"1810":{"position":[[87,1],[135,1],[137,2],[218,2],[221,3],[225,2]]},"1812":{"position":[[218,1],[242,1],[286,1],[288,2],[316,2],[355,1],[377,2],[380,2],[414,2],[417,2],[504,2],[507,2],[510,2],[544,2],[547,2],[581,2]]},"1814":{"position":[[336,1],[360,1],[400,1],[402,2],[430,2],[469,1],[492,2],[495,2],[572,2],[575,2],[619,2]]},"1816":{"position":[[184,1],[289,1],[291,2],[351,2],[404,2],[407,3],[411,2]]},"1818":{"position":[[331,1],[375,2],[421,1],[443,2],[454,1],[518,1],[563,2]]},"1820":{"position":[[165,1],[234,2]]},"1822":{"position":[[261,1],[274,2],[311,2],[318,2],[321,3],[325,2]]},"1824":{"position":[[279,1],[281,2],[323,2],[349,2],[356,1],[358,2],[361,2],[389,2],[424,1],[428,1],[430,2],[470,1],[472,2],[517,2],[543,2],[546,2],[573,2],[608,2],[623,1],[695,2],[698,2],[741,2],[775,2],[836,2],[843,1],[856,1],[858,1],[860,1],[873,2]]},"1826":{"position":[[279,1],[323,2],[364,1],[408,2],[449,1],[514,2]]},"1828":{"position":[[87,2],[170,1],[188,2],[213,2],[216,3],[220,2]]},"1830":{"position":[[174,5],[290,2],[375,1],[394,2],[405,2],[408,3],[412,2],[415,2],[500,1],[516,2],[546,2],[561,2],[564,3],[568,2],[599,2],[672,2],[695,2],[743,2],[771,2],[978,1],[994,2],[1046,2]]},"1832":{"position":[[343,2],[424,1],[434,2],[455,2],[479,2],[482,3],[486,2]]},"1834":{"position":[[302,2],[383,1],[391,2],[450,2],[467,2],[470,3],[474,2]]},"1836":{"position":[[247,2],[332,1],[343,2],[380,2],[391,2],[394,3],[398,2]]},"1838":{"position":[[120,2],[184,1],[199,2],[209,2],[212,3],[216,2]]},"1840":{"position":[[182,2],[278,1],[282,2],[307,2],[333,2],[352,2],[355,2],[358,2],[361,3],[365,2],[376,2],[484,1],[488,2],[515,2],[539,2],[549,2],[560,2],[698,1],[702,2],[729,2],[750,2],[769,2],[780,2],[791,2],[905,1],[909,2],[949,2],[984,2],[998,2],[1009,2],[1217,1],[1221,2],[1246,2],[1288,2],[1340,2],[1368,2],[1418,2],[1428,2]]},"1842":{"position":[[334,2],[421,1],[440,2],[467,2],[502,2],[512,2],[515,3],[519,2]]},"1844":{"position":[[458,2],[554,1],[582,2],[623,2],[652,2],[687,2],[713,2],[746,2],[754,2],[757,3],[761,2]]},"1846":{"position":[[526,2],[618,1],[643,2],[678,2],[711,2],[737,2],[764,2],[769,2],[772,3],[776,2]]},"1848":{"position":[[516,2],[608,1],[638,2],[665,2],[690,2],[712,2],[717,2],[720,3],[724,2]]},"1850":{"position":[[302,2],[374,1],[467,1],[507,1],[511,2],[533,2],[558,2],[565,1],[578,1],[600,2],[628,2],[659,2],[674,2],[677,3],[681,2],[684,2],[729,2]]},"1852":{"position":[[132,2],[203,1],[207,2],[234,2],[245,1],[253,2],[271,1],[288,2],[302,1],[304,1],[306,2]]},"1854":{"position":[[313,1],[344,2],[391,1],[454,4],[459,2],[514,1],[661,2]]},"1856":{"position":[[449,1],[451,2],[526,2],[529,2],[582,1],[584,2],[796,2],[799,2],[850,1]]},"1858":{"position":[[347,1],[382,2],[427,1],[512,2],[557,1],[586,2]]},"1862":{"position":[[143,1],[173,2],[176,2],[193,2]]},"1864":{"position":[[312,2],[384,1],[489,1],[529,1],[533,2],[555,2],[584,2],[591,1],[604,1],[626,2],[654,2],[685,2],[700,2],[703,3],[707,2],[710,2],[755,2]]},"1866":{"position":[[147,1],[206,2],[209,2],[239,2]]},"1868":{"position":[[398,1],[433,2],[477,1],[520,2]]},"1870":{"position":[[81,2],[161,1],[165,2],[230,2],[265,2],[268,3],[272,2],[434,1],[468,1],[481,2],[499,2],[510,3],[518,2],[540,2],[558,2],[595,1],[597,1]]},"1872":{"position":[[176,1],[178,2],[220,2],[246,2],[253,1],[255,2],[258,2],[277,2],[322,2],[348,2],[351,2],[378,2],[413,2],[428,1],[500,2],[503,2],[546,2],[580,2],[641,2],[648,1],[661,1],[663,1],[676,1],[678,2]]},"1874":{"position":[[201,2],[256,1],[258,2],[300,2],[326,2],[333,1],[335,2],[338,2],[357,2],[402,2],[428,2],[431,2],[458,2],[493,2],[508,1],[580,2],[583,2],[626,2],[663,2],[742,2],[749,1],[762,1],[764,1],[777,1],[779,2]]},"1876":{"position":[[32,1],[116,2],[166,2]]},"1878":{"position":[[123,1],[164,2],[167,2],[186,2],[504,1],[543,2],[546,2],[627,2],[630,2],[649,2]]},"1880":{"position":[[322,1],[364,2],[436,2],[635,1],[690,2]]},"1882":{"position":[[262,1],[289,2],[292,2],[379,2],[382,2],[405,2]]},"1884":{"position":[[165,1],[203,2],[206,2],[236,2],[239,3],[243,2]]},"1886":{"position":[[314,2],[353,2],[390,2],[467,1],[471,2],[507,1],[509,2],[594,1],[629,1],[677,2],[717,2],[724,1],[752,1],[777,1],[790,2],[863,1],[865,2],[1024,2],[1027,2],[1118,1],[1244,1],[1289,1],[1375,2],[1421,1],[1508,2],[1511,2],[1601,2]]},"1888":{"position":[[168,1],[174,2],[220,2],[268,2],[271,3],[275,2]]},"1892":{"position":[[166,1],[204,1],[249,1],[317,1],[362,1],[434,2]]},"1894":{"position":[[268,2],[342,1],[359,2],[398,2],[410,2],[413,3],[417,2]]},"1896":{"position":[[207,1],[225,2],[228,2],[258,2],[261,2],[290,2],[293,2],[332,2],[335,2],[372,2],[375,3],[379,2]]},"1898":{"position":[[238,1],[244,2],[263,2],[308,2],[311,3],[315,2]]},"1900":{"position":[[288,1],[307,2],[310,2],[347,2],[350,2],[378,2],[412,2],[415,2],[479,2],[482,2],[535,2],[538,3],[542,2]]},"1902":{"position":[[139,1],[174,2],[177,2],[236,2],[268,2]]},"1904":{"position":[[164,1],[172,2],[213,2],[216,2],[275,2],[307,2]]},"1906":{"position":[[141,1],[174,2],[177,2],[236,2],[268,2]]},"1908":{"position":[[220,2],[294,1],[304,2],[312,2],[315,3],[319,2]]},"1910":{"position":[[222,1],[302,1],[342,1],[344,2],[372,2],[411,1],[432,2],[443,2],[465,2],[482,2],[494,2]]}}}],["0",{"_index":387,"t":{"803":{"position":[[457,2]]},"874":{"position":[[492,1]]},"902":{"position":[[251,1]]},"904":{"position":[[86,2]]},"942":{"position":[[341,2]]},"1082":{"position":[[325,2]]},"1084":{"position":[[402,1]]},"1086":{"position":[[106,2]]},"1112":{"position":[[201,1]]},"1114":{"position":[[274,2]]},"1182":{"position":[[216,2]]},"1223":{"position":[[2316,2]]},"1296":{"position":[[238,2],[345,2]]},"1378":{"position":[[1411,1],[1443,1]]},"1380":{"position":[[271,2]]},"1388":{"position":[[316,1]]},"1392":{"position":[[64,1]]},"1400":{"position":[[1686,2]]},"1402":{"position":[[306,2]]},"1418":{"position":[[74,3],[296,1]]},"1468":{"position":[[674,2]]},"1502":{"position":[[889,2]]},"1504":{"position":[[111,2]]},"1512":{"position":[[210,4],[501,2]]},"1514":{"position":[[43,4]]},"1675":{"position":[[176,1]]},"1754":{"position":[[1098,1]]},"1824":{"position":[[426,1]]},"1832":{"position":[[243,4]]},"1846":{"position":[[405,4],[740,1]]},"1848":{"position":[[405,4],[715,1]]}}}],["0.1.7",{"_index":3915,"t":{"1735":{"position":[[3499,5]]}}}],["0.4",{"_index":3661,"t":{"1673":{"position":[[72,3]]}}}],["0.7",{"_index":3658,"t":{"1671":{"position":[[70,3]]}}}],["01",{"_index":3959,"t":{"1737":{"position":[[1108,4],[1126,2]]},"1886":{"position":[[570,2],[697,2]]}}}],["02",{"_index":3178,"t":{"1516":{"position":[[324,2]]},"1562":{"position":[[967,3]]},"1737":{"position":[[1113,4]]},"1886":{"position":[[573,2],[700,4]]}}}],["0666",{"_index":3303,"t":{"1562":{"position":[[1111,5]]}}}],["08",{"_index":3965,"t":{"1737":{"position":[[1185,2],[2193,2],[2207,2]]}}}],["0rtt",{"_index":2991,"t":{"1418":{"position":[[835,5]]}}}],["1",{"_index":912,"t":{"942":{"position":[[390,2]]},"946":{"position":[[202,1]]},"1096":{"position":[[332,1]]},"1100":{"position":[[55,1],[94,2]]},"1124":{"position":[[402,1]]},"1126":{"position":[[839,1]]},"1128":{"position":[[180,1]]},"1156":{"position":[[145,2]]},"1190":{"position":[[1261,2],[2649,1],[4469,2],[4631,1]]},"1235":{"position":[[169,1]]},"1265":{"position":[[222,1]]},"1296":{"position":[[734,2]]},"1378":{"position":[[280,1]]},"1380":{"position":[[51,1]]},"1386":{"position":[[406,1],[595,1]]},"1388":{"position":[[297,1],[337,1]]},"1392":{"position":[[47,1],[83,1]]},"1408":{"position":[[445,1]]},"1410":{"position":[[1356,1]]},"1412":{"position":[[119,1]]},"1418":{"position":[[277,1]]},"1424":{"position":[[355,4]]},"1428":{"position":[[66,3]]},"1468":{"position":[[559,1],[623,2],[763,1]]},"1512":{"position":[[1371,5]]},"1514":{"position":[[284,5]]},"1534":{"position":[[395,1]]},"1536":{"position":[[661,1]]},"1538":{"position":[[463,1]]},"1552":{"position":[[583,1]]},"1554":{"position":[[48,1]]},"1596":{"position":[[696,1]]},"1616":{"position":[[279,3],[351,6]]},"1735":{"position":[[3116,4],[3228,4]]},"1737":{"position":[[1481,2],[1749,2]]},"1754":{"position":[[1390,3],[1407,2]]},"1756":{"position":[[379,7]]},"1764":{"position":[[141,1]]},"1800":{"position":[[480,3]]},"1846":{"position":[[368,2],[708,2],[714,1]]},"1848":{"position":[[368,2],[635,2],[662,2],[668,1],[687,2],[693,1]]}}}],["1,001.01e8",{"_index":3932,"t":{"1737":{"position":[[510,10]]}}}],["1,146,667",{"_index":3660,"t":{"1673":{"position":[[14,9]]}}}],["1,2,3",{"_index":4307,"t":{"1840":{"position":[[772,7]]}}}],["1.0",{"_index":734,"t":{"869":{"position":[[595,3]]}}}],["1.1",{"_index":3663,"t":{"1673":{"position":[[152,3]]}}}],["1.14/1.15",{"_index":806,"t":{"884":{"position":[[33,11]]}}}],["1.16",{"_index":3107,"t":{"1488":{"position":[[557,6]]},"1490":{"position":[[84,5]]},"1502":{"position":[[471,4]]}}}],["1.17",{"_index":1148,"t":{"1132":{"position":[[11,4]]},"1210":{"position":[[39,4]]}}}],["1.18",{"_index":539,"t":{"817":{"position":[[55,4]]},"892":{"position":[[82,4]]}}}],["1.234",{"_index":3931,"t":{"1737":{"position":[[502,6]]}}}],["1.3",{"_index":2978,"t":{"1418":{"position":[[152,3]]}}}],["1.3'",{"_index":2973,"t":{"1418":{"position":[[57,5]]}}}],["10",{"_index":822,"t":{"886":{"position":[[366,2]]},"888":{"position":[[636,2]]},"890":{"position":[[170,2]]},"914":{"position":[[300,2]]},"916":{"position":[[258,2]]},"918":{"position":[[82,2]]},"998":{"position":[[258,2]]},"1000":{"position":[[75,2]]},"1002":{"position":[[40,2]]},"1026":{"position":[[342,2],[567,2]]},"1028":{"position":[[860,2]]},"1030":{"position":[[147,2]]},"1040":{"position":[[342,2],[535,2],[749,2]]},"1042":{"position":[[875,2]]},"1044":{"position":[[147,2]]},"1068":{"position":[[319,2]]},"1070":{"position":[[1015,2]]},"1072":{"position":[[206,2]]},"1082":{"position":[[368,2]]},"1084":{"position":[[1456,2]]},"1086":{"position":[[149,2]]},"1124":{"position":[[329,2]]},"1126":{"position":[[319,2]]},"1128":{"position":[[107,2]]},"1223":{"position":[[2102,2],[2749,2]]},"1663":{"position":[[565,2]]},"1675":{"position":[[182,2]]},"1856":{"position":[[774,5]]},"1886":{"position":[[1568,2],[1677,2]]}}}],["10*time.second",{"_index":3610,"t":{"1660":{"position":[[2117,16]]}}}],["10.1",{"_index":2229,"t":{"1336":{"position":[[1380,4]]}}}],["10.4.1",{"_index":2265,"t":{"1336":{"position":[[1840,6]]}}}],["100",{"_index":1124,"t":{"1124":{"position":[[361,4],[380,4]]},"1126":{"position":[[585,4],[711,4]]},"1128":{"position":[[139,4],[158,4]]},"1336":{"position":[[1271,3]]},"1675":{"position":[[189,3],[580,4]]}}}],["1000",{"_index":3676,"t":{"1675":{"position":[[585,5]]},"1682":{"position":[[652,4]]}}}],["101",{"_index":2224,"t":{"1336":{"position":[[1321,3]]}}}],["102",{"_index":2227,"t":{"1336":{"position":[[1363,3]]}}}],["1024",{"_index":2673,"t":{"1341":{"position":[[509,4],[516,4],[1001,4]]}}}],["103",{"_index":2231,"t":{"1336":{"position":[[1404,3]]}}}],["10m",{"_index":1103,"t":{"1096":{"position":[[316,6]]},"1098":{"position":[[73,6]]}}}],["11",{"_index":1512,"t":{"1184":{"position":[[724,3]]},"1737":{"position":[[1123,2]]}}}],["11,846",{"_index":3649,"t":{"1667":{"position":[[14,6]]}}}],["11.1",{"_index":2257,"t":{"1336":{"position":[[1758,4]]}}}],["11.2",{"_index":2353,"t":{"1336":{"position":[[3161,4],[5562,4]]}}}],["11.3",{"_index":2356,"t":{"1336":{"position":[[3198,4],[5615,4]]}}}],["11.4",{"_index":2359,"t":{"1336":{"position":[[3245,4],[5688,4]]}}}],["11.5",{"_index":2400,"t":{"1336":{"position":[[3923,4],[6755,4]]}}}],["111",{"_index":4285,"t":{"1834":{"position":[[461,5]]}}}],["117.2",{"_index":3656,"t":{"1669":{"position":[[148,5]]}}}],["12",{"_index":1407,"t":{"1178":{"position":[[923,3],[1025,3]]},"1737":{"position":[[723,2],[1425,2]]}}}],["120",{"_index":3948,"t":{"1737":{"position":[[867,4],[962,4]]}}}],["120000",{"_index":3974,"t":{"1737":{"position":[[1688,7]]}}}],["123",{"_index":659,"t":{"839":{"position":[[1736,5]]},"869":{"position":[[562,3]]},"1832":{"position":[[462,3]]}}}],["12345.pdf",{"_index":4158,"t":{"1782":{"position":[[434,12],[469,9],[513,11]]}}}],["123456",{"_index":916,"t":{"946":{"position":[[120,9]]},"1366":{"position":[[356,9],[506,9],[663,8]]}}}],["123456789",{"_index":3922,"t":{"1737":{"position":[[377,10],[389,9]]}}}],["125",{"_index":3983,"t":{"1737":{"position":[[2084,4]]}}}],["127.0.0.1",{"_index":1008,"t":{"1012":{"position":[[256,12]]},"1014":{"position":[[225,11]]},"1016":{"position":[[53,12]]},"1026":{"position":[[248,12]]},"1028":{"position":[[267,11]]},"1030":{"position":[[53,12]]},"1040":{"position":[[248,12]]},"1042":{"position":[[345,11]]},"1044":{"position":[[53,12]]},"1070":{"position":[[398,11]]},"1072":{"position":[[92,12]]},"1082":{"position":[[262,12]]},"1084":{"position":[[84,11]]},"1086":{"position":[[34,12]]},"1548":{"position":[[416,11]]},"1804":{"position":[[140,11]]},"1806":{"position":[[157,10],[237,12]]}}}],["127.0.0.1:11211",{"_index":999,"t":{"986":{"position":[[113,17]]},"988":{"position":[[37,18]]}}}],["127.0.0.1:3000",{"_index":3077,"t":{"1468":{"position":[[525,14]]}}}],["127.0.0.1:3000/debug/var",{"_index":3078,"t":{"1468":{"position":[[566,25]]}}}],["127.0.0.1:3000/debug/vars?r=c",{"_index":3085,"t":{"1468":{"position":[[702,29]]}}}],["127.0.0.1:8091",{"_index":909,"t":{"942":{"position":[[287,17]]},"946":{"position":[[73,17]]}}}],["13",{"_index":3053,"t":{"1458":{"position":[[306,3]]}}}],["1433",{"_index":1018,"t":{"1026":{"position":[[267,5]]},"1028":{"position":[[355,4]]},"1030":{"position":[[72,5]]}}}],["15",{"_index":963,"t":{"958":{"position":[[2668,2],[2722,2]]}}}],["15:04:05",{"_index":3325,"t":{"1564":{"position":[[759,8]]},"1566":{"position":[[126,11]]}}}],["15th",{"_index":1689,"t":{"1208":{"position":[[363,5]]}}}],["16",{"_index":4059,"t":{"1754":{"position":[[1375,4]]}}}],["1638",{"_index":3927,"t":{"1737":{"position":[[453,4],[463,4]]}}}],["18",{"_index":3944,"t":{"1737":{"position":[[798,3],[942,2]]}}}],["18.04.3",{"_index":3630,"t":{"1663":{"position":[[523,7]]}}}],["1831710635",{"_index":3054,"t":{"1458":{"position":[[310,11],[541,11]]}}}],["185",{"_index":1724,"t":{"1212":{"position":[[1552,5]]},"1341":{"position":[[4103,5]]}}}],["19",{"_index":3943,"t":{"1737":{"position":[[763,2]]}}}],["19,664",{"_index":3653,"t":{"1669":{"position":[[14,6]]}}}],["1;q=0.2",{"_index":4053,"t":{"1754":{"position":[[1226,7]]}}}],["1e7",{"_index":1100,"t":{"1096":{"position":[[271,4]]},"1100":{"position":[[41,4]]}}}],["1gb",{"_index":1107,"t":{"1096":{"position":[[366,6]]},"1098":{"position":[[131,6]]}}}],["1s",{"_index":1968,"t":{"1265":{"position":[[168,2]]}}}],["2",{"_index":231,"t":{"771":{"position":[[460,1]]},"849":{"position":[[1145,2]]},"884":{"position":[[26,1]]},"898":{"position":[[43,1]]},"912":{"position":[[24,1]]},"926":{"position":[[23,1]]},"940":{"position":[[27,1]]},"954":{"position":[[26,1]]},"958":{"position":[[175,3]]},"968":{"position":[[22,1]]},"974":{"position":[[80,1]]},"982":{"position":[[24,1]]},"996":{"position":[[24,1]]},"1010":{"position":[[25,1]]},"1024":{"position":[[23,1]]},"1038":{"position":[[23,1]]},"1052":{"position":[[24,1]]},"1066":{"position":[[26,1]]},"1080":{"position":[[23,1]]},"1094":{"position":[[27,1]]},"1108":{"position":[[20,1]]},"1122":{"position":[[25,1]]},"1184":{"position":[[371,3],[471,1],[540,1]]},"1190":{"position":[[3533,1]]},"1388":{"position":[[364,1]]},"1392":{"position":[[108,1]]},"1434":{"position":[[677,1]]},"1440":{"position":[[258,1]]},"1536":{"position":[[1356,4],[1807,2]]},"1616":{"position":[[283,2]]},"1640":{"position":[[750,2]]},"1735":{"position":[[3137,4],[3247,4]]},"1754":{"position":[[777,1]]},"1772":{"position":[[1022,4]]},"1848":{"position":[[641,1]]},"1894":{"position":[[133,2]]}}}],["2*time.second",{"_index":3584,"t":{"1660":{"position":[[538,15],[1391,14]]}}}],["2,066",{"_index":3651,"t":{"1667":{"position":[[94,5]]}}}],["2.0",{"_index":3646,"t":{"1665":{"position":[[444,3]]}}}],["2.20ghz",{"_index":3626,"t":{"1663":{"position":[[499,7]]}}}],["2.3.3",{"_index":2346,"t":{"1336":{"position":[[3060,5],[5404,5]]}}}],["2.30ghz",{"_index":3666,"t":{"1675":{"position":[[96,7]]}}}],["20",{"_index":1222,"t":{"1140":{"position":[[87,2]]},"1548":{"position":[[436,3]]},"1550":{"position":[[176,3]]},"1812":{"position":[[351,3],[446,4],[500,3],[576,4]]},"1814":{"position":[[465,3],[532,4],[614,4]]},"1886":{"position":[[1571,2],[1680,3]]},"1910":{"position":[[407,3]]}}}],["200",{"_index":1828,"t":{"1227":{"position":[[221,3]]},"1336":{"position":[[1431,3]]},"1660":{"position":[[813,3]]}}}],["2005",{"_index":3960,"t":{"1737":{"position":[[1118,4]]}}}],["2006",{"_index":3298,"t":{"1562":{"position":[[975,6]]},"1886":{"position":[[565,4]]}}}],["201",{"_index":2236,"t":{"1336":{"position":[[1470,3]]}}}],["202",{"_index":2239,"t":{"1336":{"position":[[1510,3]]}}}],["2020",{"_index":1690,"t":{"1208":{"position":[[369,5]]}}}],["2022",{"_index":3964,"t":{"1737":{"position":[[1180,4],[2202,4]]}}}],["203",{"_index":2242,"t":{"1336":{"position":[[1569,3]]}}}],["204",{"_index":2245,"t":{"1336":{"position":[[1610,3]]}}}],["2048",{"_index":489,"t":{"809":{"position":[[604,5]]}}}],["205",{"_index":2248,"t":{"1336":{"position":[[1654,3]]}}}],["206",{"_index":2251,"t":{"1336":{"position":[[1700,3]]}}}],["207",{"_index":2255,"t":{"1336":{"position":[[1741,3]]}}}],["208",{"_index":2259,"t":{"1336":{"position":[[1787,3]]}}}],["226",{"_index":2263,"t":{"1336":{"position":[[1823,3]]}}}],["2295",{"_index":2396,"t":{"1336":{"position":[[3868,5],[6671,5]]}}}],["23",{"_index":1455,"t":{"1180":{"position":[[938,3],[966,2]]}}}],["24",{"_index":3551,"t":{"1642":{"position":[[121,2]]},"1644":{"position":[[40,2]]}}}],["244,847",{"_index":3662,"t":{"1673":{"position":[[96,7]]}}}],["25",{"_index":945,"t":{"958":{"position":[[1341,2],[2037,2]]}}}],["25.7",{"_index":3654,"t":{"1669":{"position":[[69,4]]}}}],["250",{"_index":3976,"t":{"1737":{"position":[[1796,3]]}}}],["2518",{"_index":2228,"t":{"1336":{"position":[[1374,5]]}}}],["256",{"_index":2686,"t":{"1341":{"position":[[995,3]]}}}],["27",{"_index":3966,"t":{"1737":{"position":[[1188,2],[2196,2],[2210,2]]}}}],["27017",{"_index":1009,"t":{"1012":{"position":[[275,6]]},"1014":{"position":[[313,5]]},"1016":{"position":[[72,6]]}}}],["2774",{"_index":2406,"t":{"1336":{"position":[[4001,5],[6876,5]]}}}],["28",{"_index":3620,"t":{"1663":{"position":[[454,2]]}}}],["2]string",{"_index":693,"t":{"849":{"position":[[1095,9]]}}}],["2beb887efd54",{"_index":4181,"t":{"1796":{"position":[[281,13]]}}}],["3",{"_index":855,"t":{"902":{"position":[[658,1]]},"904":{"position":[[116,2]]},"942":{"position":[[363,2]]},"946":{"position":[[174,1]]},"958":{"position":[[1010,1]]},"960":{"position":[[93,2]]},"1112":{"position":[[613,1]]},"1114":{"position":[[255,2]]},"1184":{"position":[[473,1]]},"1336":{"position":[[2192,1],[3383,1],[3535,1],[5899,1],[6149,1]]},"1576":{"position":[[185,1]]},"1594":{"position":[[1460,3]]},"1840":{"position":[[732,3],[753,3]]},"1846":{"position":[[675,2],[761,2],[767,1]]}}}],["3.1",{"_index":2294,"t":{"1336":{"position":[[2274,3],[4203,3]]}}}],["3.2",{"_index":2312,"t":{"1336":{"position":[[2542,3],[4609,3]]}}}],["30",{"_index":1105,"t":{"1096":{"position":[[337,3]]},"1100":{"position":[[60,3]]},"1376":{"position":[[442,2]]},"1526":{"position":[[342,2]]},"1528":{"position":[[179,2]]},"1548":{"position":[[452,2]]},"1550":{"position":[[192,2]]},"1675":{"position":[[537,2]]}}}],["300",{"_index":2267,"t":{"1336":{"position":[[1871,3]]}}}],["3000",{"_index":1961,"t":{"1263":{"position":[[226,8]]},"1352":{"position":[[357,4]]},"1354":{"position":[[271,4]]},"1356":{"position":[[320,4]]},"1358":{"position":[[190,4]]},"1360":{"position":[[201,4]]}}}],["301",{"_index":2270,"t":{"1336":{"position":[[1919,3]]},"1614":{"position":[[253,4]]},"1854":{"position":[[656,4]]}}}],["302",{"_index":2273,"t":{"1336":{"position":[[1956,3]]},"1616":{"position":[[566,3]]},"1854":{"position":[[179,3]]},"1856":{"position":[[187,3]]},"1858":{"position":[[215,3]]}}}],["303",{"_index":2276,"t":{"1336":{"position":[[1996,3]]}}}],["304",{"_index":2279,"t":{"1336":{"position":[[2039,3]]}}}],["305",{"_index":2282,"t":{"1336":{"position":[[2077,3]]}}}],["307",{"_index":2285,"t":{"1336":{"position":[[2126,3]]}}}],["308",{"_index":2288,"t":{"1336":{"position":[[2175,3]]}}}],["32",{"_index":2701,"t":{"1341":{"position":[[1952,4]]},"1432":{"position":[[92,2]]},"1434":{"position":[[289,2],[426,3]]},"1436":{"position":[[391,2],[476,3]]}}}],["32.23",{"_index":4335,"t":{"1846":{"position":[[646,5],[681,5]]}}}],["3229",{"_index":2264,"t":{"1336":{"position":[[1834,5]]}}}],["32gb",{"_index":3627,"t":{"1663":{"position":[[507,4]]}}}],["33",{"_index":3082,"t":{"1468":{"position":[[648,3]]}}}],["3306",{"_index":1027,"t":{"1040":{"position":[[267,5]]},"1042":{"position":[[433,4]]},"1044":{"position":[[72,5]]}}}],["339222389",{"_index":4004,"t":{"1749":{"position":[[623,9]]}}}],["354.1",{"_index":3648,"t":{"1665":{"position":[[518,5]]}}}],["36",{"_index":3186,"t":{"1526":{"position":[[670,2]]},"1528":{"position":[[291,3],[323,2]]}}}],["3600",{"_index":1798,"t":{"1223":{"position":[[2775,5]]},"1488":{"position":[[523,5]]}}}],["360641",{"_index":4260,"t":{"1824":{"position":[[716,6]]},"1872":{"position":[[521,6]]},"1874":{"position":[[601,6]]}}}],["367,069",{"_index":3647,"t":{"1665":{"position":[[462,7]]}}}],["368,647",{"_index":3657,"t":{"1671":{"position":[[14,7]]}}}],["390.44",{"_index":3652,"t":{"1667":{"position":[[148,6]]}}}],["3rd",{"_index":1514,"t":{"1184":{"position":[[793,3]]},"1700":{"position":[[158,3]]}}}],["4",{"_index":1503,"t":{"1184":{"position":[[475,3]]},"1336":{"position":[[3426,1],[5967,1]]},"1341":{"position":[[505,1]]},"1735":{"position":[[3514,2]]},"1737":{"position":[[579,1]]}}}],["4,302",{"_index":3655,"t":{"1669":{"position":[[94,5]]}}}],["4.1",{"_index":2253,"t":{"1336":{"position":[[1717,3],[2056,3]]}}}],["4.15.0",{"_index":3631,"t":{"1663":{"position":[[531,6]]}}}],["4.2",{"_index":2327,"t":{"1336":{"position":[[2759,3],[4934,3]]}}}],["4.3.1",{"_index":2179,"t":{"1336":{"position":[[79,5]]}}}],["4.3.2",{"_index":2181,"t":{"1336":{"position":[[118,5]]}}}],["4.3.3",{"_index":2183,"t":{"1336":{"position":[[157,5]]}}}],["4.3.4",{"_index":2185,"t":{"1336":{"position":[[194,5]]}}}],["4.3.5",{"_index":2190,"t":{"1336":{"position":[[271,5]]}}}],["4.3.6",{"_index":2192,"t":{"1336":{"position":[[316,5]]}}}],["4.3.7",{"_index":2194,"t":{"1336":{"position":[[361,5]]}}}],["4.3.8",{"_index":2196,"t":{"1336":{"position":[[402,5]]}}}],["4.4",{"_index":2339,"t":{"1336":{"position":[[2974,3],[5275,3]]},"1671":{"position":[[149,3]]}}}],["400",{"_index":364,"t":{"797":{"position":[[212,4]]},"823":{"position":[[271,3]]},"843":{"position":[[221,4]]},"1336":{"position":[[2213,3]]},"1534":{"position":[[839,3]]},"1552":{"position":[[855,3],[970,3]]}}}],["401",{"_index":362,"t":{"797":{"position":[[154,4]]},"803":{"position":[[333,3]]},"843":{"position":[[163,4]]},"849":{"position":[[330,3]]},"1336":{"position":[[2257,3]]},"1362":{"position":[[138,3]]},"1368":{"position":[[943,3]]},"1540":{"position":[[432,3]]}}}],["402",{"_index":2296,"t":{"1336":{"position":[[2302,3]]}}}],["403",{"_index":2299,"t":{"1336":{"position":[[2343,3]]}}}],["404",{"_index":2302,"t":{"1336":{"position":[[2383,3]]},"1680":{"position":[[229,3],[360,3]]},"1693":{"position":[[951,4]]},"1706":{"position":[[860,3]]},"1737":{"position":[[316,3]]}}}],["404.html",{"_index":3106,"t":{"1488":{"position":[[503,11]]}}}],["405",{"_index":2305,"t":{"1336":{"position":[[2431,3]]}}}],["406",{"_index":2308,"t":{"1336":{"position":[[2476,3]]}}}],["407",{"_index":2311,"t":{"1336":{"position":[[2525,3]]}}}],["408",{"_index":2314,"t":{"1336":{"position":[[2569,3]]},"1660":{"position":[[904,3]]}}}],["409",{"_index":2317,"t":{"1336":{"position":[[2609,3]]}}}],["4096",{"_index":2760,"t":{"1341":{"position":[[5564,4],[6974,4]]}}}],["410",{"_index":2320,"t":{"1336":{"position":[[2645,3]]}}}],["411",{"_index":2323,"t":{"1336":{"position":[[2691,3]]}}}],["412",{"_index":2326,"t":{"1336":{"position":[[2742,3]]}}}],["413",{"_index":2329,"t":{"1336":{"position":[[2793,3]]},"1341":{"position":[[464,3]]}}}],["414",{"_index":2332,"t":{"1336":{"position":[[2843,3]]}}}],["415",{"_index":2335,"t":{"1336":{"position":[[2896,3]]},"1882":{"position":[[295,3],[385,3]]}}}],["416",{"_index":2338,"t":{"1336":{"position":[[2957,3]]}}}],["417",{"_index":2341,"t":{"1336":{"position":[[3004,3]]}}}],["418",{"_index":2344,"t":{"1336":{"position":[[3043,3]]}}}],["42",{"_index":3183,"t":{"1524":{"position":[[54,2]]},"1737":{"position":[[2583,2]]}}}],["42.8",{"_index":3650,"t":{"1667":{"position":[[69,4]]}}}],["421",{"_index":2348,"t":{"1336":{"position":[[3093,3]]}}}],["422",{"_index":2352,"t":{"1336":{"position":[[3144,3]]}}}],["423",{"_index":2355,"t":{"1336":{"position":[[3181,3]]}}}],["424",{"_index":2358,"t":{"1336":{"position":[[3228,3]]}}}],["425",{"_index":2361,"t":{"1336":{"position":[[3267,3]]}}}],["426",{"_index":1723,"t":{"1212":{"position":[[1543,4]]},"1336":{"position":[[3313,3]]}}}],["428",{"_index":2367,"t":{"1336":{"position":[[3366,3]]}}}],["429",{"_index":2370,"t":{"1336":{"position":[[3409,3]]},"1552":{"position":[[274,3]]}}}],["431",{"_index":2372,"t":{"1336":{"position":[[3464,3]]}}}],["443",{"_index":594,"t":{"835":{"position":[[545,3]]}}}],["450b",{"_index":4179,"t":{"1796":{"position":[[271,4]]}}}],["451",{"_index":2374,"t":{"1336":{"position":[[3518,3]]}}}],["4918",{"_index":2256,"t":{"1336":{"position":[[1752,5],[3155,5],[3192,5],[3239,5],[3917,5],[5556,5],[5609,5],[5682,5],[6749,5]]}}}],["4gb",{"_index":3668,"t":{"1675":{"position":[[108,3]]}}}],["5",{"_index":942,"t":{"958":{"position":[[1246,2],[1942,2]]},"960":{"position":[[129,2],[152,2]]},"1336":{"position":[[3481,1],[6059,1]]},"1552":{"position":[[302,1]]},"1554":{"position":[[33,2]]},"1594":{"position":[[1624,1],[1765,3]]}}}],["5.2",{"_index":2363,"t":{"1336":{"position":[[3284,4],[5745,4]]}}}],["500",{"_index":2377,"t":{"1336":{"position":[[3565,3]]},"1564":{"position":[[1014,3]]},"1566":{"position":[[171,3]]},"1675":{"position":[[197,3]]},"1695":{"position":[[90,3],[342,3]]},"1697":{"position":[[735,3]]},"1852":{"position":[[291,5]]}}}],["5000",{"_index":3672,"t":{"1675":{"position":[[261,5],[591,4]]}}}],["501",{"_index":2380,"t":{"1336":{"position":[[3611,3]]}}}],["502",{"_index":2383,"t":{"1336":{"position":[[3653,3]]}}}],["503",{"_index":2386,"t":{"1336":{"position":[[3703,3]]},"1693":{"position":[[1026,3],[1088,3]]}}}],["504",{"_index":2389,"t":{"1336":{"position":[[3749,3]]}}}],["505",{"_index":2392,"t":{"1336":{"position":[[3804,3]]}}}],["506",{"_index":2395,"t":{"1336":{"position":[[3857,3]]}}}],["507",{"_index":2399,"t":{"1336":{"position":[[3906,3]]}}}],["508",{"_index":2402,"t":{"1336":{"position":[[3949,3]]}}}],["510",{"_index":2405,"t":{"1336":{"position":[[3990,3]]}}}],["511",{"_index":2409,"t":{"1336":{"position":[[4047,3]]}}}],["5120",{"_index":3625,"t":{"1663":{"position":[[488,4]]}}}],["5432",{"_index":1044,"t":{"1070":{"position":[[486,4]]},"1072":{"position":[[111,5]]}}}],["57,880",{"_index":3659,"t":{"1671":{"position":[[94,6]]}}}],["5789",{"_index":2188,"t":{"1336":{"position":[[229,4]]}}}],["5842",{"_index":2260,"t":{"1336":{"position":[[1798,5],[3960,5],[6814,5]]}}}],["6",{"_index":1431,"t":{"1178":{"position":[[1810,3],[1856,4]]},"1336":{"position":[[4064,1],[6978,1]]}}}],["6,162,556",{"_index":3645,"t":{"1665":{"position":[[386,9]]}}}],["6.2.1",{"_index":2222,"t":{"1336":{"position":[[1288,5]]}}}],["6.2.2",{"_index":2225,"t":{"1336":{"position":[[1338,5]]}}}],["6.3.1",{"_index":2234,"t":{"1336":{"position":[[1448,5]]}}}],["6.3.2",{"_index":2237,"t":{"1336":{"position":[[1487,5]]}}}],["6.3.3",{"_index":2240,"t":{"1336":{"position":[[1527,5]]}}}],["6.3.4",{"_index":2243,"t":{"1336":{"position":[[1586,5]]}}}],["6.3.5",{"_index":2246,"t":{"1336":{"position":[[1627,5]]}}}],["6.3.6",{"_index":2249,"t":{"1336":{"position":[[1671,5]]}}}],["6.4.1",{"_index":2268,"t":{"1336":{"position":[[1888,5]]}}}],["6.4.2",{"_index":2271,"t":{"1336":{"position":[[1936,5]]}}}],["6.4.3",{"_index":2274,"t":{"1336":{"position":[[1973,5]]}}}],["6.4.4",{"_index":2277,"t":{"1336":{"position":[[2013,5]]}}}],["6.4.5",{"_index":2283,"t":{"1336":{"position":[[2094,5]]}}}],["6.4.7",{"_index":2286,"t":{"1336":{"position":[[2143,5]]}}}],["6.5.1",{"_index":2291,"t":{"1336":{"position":[[2230,5],[4137,5]]}}}],["6.5.10",{"_index":2324,"t":{"1336":{"position":[[2708,6],[4855,6]]}}}],["6.5.11",{"_index":2330,"t":{"1336":{"position":[[2810,6],[5016,6]]}}}],["6.5.12",{"_index":2333,"t":{"1336":{"position":[[2860,6],[5093,6]]}}}],["6.5.13",{"_index":2336,"t":{"1336":{"position":[[2913,6],[5176,6]]}}}],["6.5.14",{"_index":2342,"t":{"1336":{"position":[[3021,6],[5349,6]]}}}],["6.5.15",{"_index":2365,"t":{"1336":{"position":[[3330,6],[5816,6]]}}}],["6.5.2",{"_index":2297,"t":{"1336":{"position":[[2319,5],[4273,5]]}}}],["6.5.3",{"_index":2300,"t":{"1336":{"position":[[2360,5],[4333,5]]}}}],["6.5.4",{"_index":2303,"t":{"1336":{"position":[[2400,5],[4391,5]]}}}],["6.5.5",{"_index":2306,"t":{"1336":{"position":[[2448,5],[4465,5]]}}}],["6.5.6",{"_index":2309,"t":{"1336":{"position":[[2493,5],[4533,5]]}}}],["6.5.7",{"_index":2315,"t":{"1336":{"position":[[2586,5],[4677,5]]}}}],["6.5.8",{"_index":2318,"t":{"1336":{"position":[[2626,5],[4735,5]]}}}],["6.5.9",{"_index":2321,"t":{"1336":{"position":[[2662,5],[4785,5]]}}}],["6.6.1",{"_index":2378,"t":{"1336":{"position":[[3582,5],[6225,5]]}}}],["6.6.2",{"_index":2381,"t":{"1336":{"position":[[3628,5],[6295,5]]}}}],["6.6.3",{"_index":2384,"t":{"1336":{"position":[[3670,5],[6357,5]]}}}],["6.6.4",{"_index":2387,"t":{"1336":{"position":[[3720,5],[6435,5]]}}}],["6.6.5",{"_index":2390,"t":{"1336":{"position":[[3766,5],[6505,5]]}}}],["6.6.6",{"_index":2393,"t":{"1336":{"position":[[3821,5],[6593,5]]}}}],["60",{"_index":901,"t":{"930":{"position":[[342,2]]},"932":{"position":[[123,2]]}}}],["600",{"_index":2869,"t":{"1376":{"position":[[702,7]]}}}],["6000",{"_index":2874,"t":{"1376":{"position":[[923,7]]}}}],["6140",{"_index":3665,"t":{"1675":{"position":[[85,4]]}}}],["6379",{"_index":1050,"t":{"1082":{"position":[[281,5]]},"1084":{"position":[[172,4]]},"1086":{"position":[[53,5]]}}}],["6380",{"_index":1059,"t":{"1082":{"position":[[617,9]]}}}],["64",{"_index":1109,"t":{"1096":{"position":[[386,3]]},"1100":{"position":[[77,3]]}}}],["6585",{"_index":2368,"t":{"1336":{"position":[[3377,5],[3420,5],[3475,5],[4058,5],[5893,5],[5961,5],[6053,5],[6972,5]]}}}],["7",{"_index":2407,"t":{"1336":{"position":[[4007,1],[6882,1]]}}}],["7.0",{"_index":3991,"t":{"1737":{"position":[[2682,4]]}}}],["7.1",{"_index":2261,"t":{"1336":{"position":[[1804,3]]}}}],["7.2",{"_index":2403,"t":{"1336":{"position":[[3966,3],[6820,3]]}}}],["700",{"_index":4354,"t":{"1852":{"position":[[152,4],[157,3],[297,4]]}}}],["7168",{"_index":2345,"t":{"1336":{"position":[[3054,5],[5398,5]]}}}],["72).unix",{"_index":439,"t":{"805":{"position":[[766,11]]},"809":{"position":[[1296,11]]}}}],["7231",{"_index":2178,"t":{"1336":{"position":[[73,5],[112,5],[151,5],[188,5],[265,5],[310,5],[355,5],[396,5],[1282,5],[1332,5],[1442,5],[1481,5],[1521,5],[1580,5],[1621,5],[1665,5],[1882,5],[1930,5],[1967,5],[2007,5],[2088,5],[2137,5],[2224,5],[2313,5],[2354,5],[2394,5],[2442,5],[2487,5],[2580,5],[2620,5],[2656,5],[2702,5],[2804,5],[2854,5],[2907,5],[3015,5],[3324,5],[3576,5],[3622,5],[3664,5],[3714,5],[3760,5],[3815,5],[4131,5],[4267,5],[4327,5],[4385,5],[4459,5],[4527,5],[4671,5],[4729,5],[4779,5],[4849,5],[5010,5],[5087,5],[5170,5],[5343,5],[5810,5],[6219,5],[6289,5],[6351,5],[6429,5],[6499,5],[6587,5]]}}}],["7232",{"_index":2280,"t":{"1336":{"position":[[2050,5],[2753,5],[4928,5]]}}}],["7233",{"_index":2252,"t":{"1336":{"position":[[1711,5],[2968,5],[5269,5]]}}}],["7235",{"_index":2293,"t":{"1336":{"position":[[2268,5],[2536,5],[4197,5],[4603,5]]}}}],["72d5",{"_index":3928,"t":{"1737":{"position":[[458,4]]}}}],["750",{"_index":3751,"t":{"1690":{"position":[[1330,4]]}}}],["7517",{"_index":507,"t":{"813":{"position":[[174,5]]}}}],["7538",{"_index":2289,"t":{"1336":{"position":[[2186,5]]}}}],["7540",{"_index":2349,"t":{"1336":{"position":[[3104,5],[5476,5]]}}}],["7725",{"_index":2375,"t":{"1336":{"position":[[3529,5],[6143,5]]}}}],["8",{"_index":2215,"t":{"1336":{"position":[[877,2],[930,2],[985,2],[1050,2],[1117,2],[1196,2]]},"1418":{"position":[[731,1]]},"1686":{"position":[[25,1]]},"1695":{"position":[[548,1]]},"1737":{"position":[[657,1]]},"1754":{"position":[[428,2],[1214,2]]},"1808":{"position":[[296,1]]},"1896":{"position":[[328,3],[369,2]]}}}],["8\">20worldworld!{{.name}}${{.price}}.new(dir",{"_index":1159,"t":{"1134":{"position":[[398,17]]}}}],["enhancesentryev",{"_index":281,"t":{"773":{"position":[[1313,18],[1509,19]]}}}],["ensur",{"_index":1622,"t":{"1190":{"position":[[3876,7]]},"1526":{"position":[[648,7]]},"1693":{"position":[[18,6]]},"1749":{"position":[[53,6]]},"1772":{"position":[[638,6]]}}}],["entir",{"_index":1610,"t":{"1190":{"position":[[2228,6]]}}}],["entiti",{"_index":2672,"t":{"1341":{"position":[[478,6]]}}}],["entri",{"_index":2886,"t":{"1378":{"position":[[1338,7]]},"1824":{"position":[[25,8]]}}}],["environ",{"_index":919,"t":{"948":{"position":[[131,11]]},"958":{"position":[[224,11],[261,11]]},"1102":{"position":[[125,11]]},"1341":{"position":[[4936,11]]},"1442":{"position":[[55,11]]},"1450":{"position":[[94,11],[193,11]]},"1488":{"position":[[541,11]]},"1665":{"position":[[338,12]]},"1682":{"position":[[1184,12]]}}}],["envoy",{"_index":3223,"t":{"1534":{"position":[[1231,5]]}}}],["envvar",{"_index":3030,"t":{"1442":{"position":[[0,6]]},"1446":{"position":[[588,6]]}}}],["envvar.config",{"_index":3034,"t":{"1446":{"position":[[387,14]]}}}],["envvar.new",{"_index":3033,"t":{"1446":{"position":[[291,13],[375,11]]}}}],["eq",{"_index":1529,"t":{"1186":{"position":[[266,2],[508,2],[594,2]]}}}],["equal",{"_index":1923,"t":{"1247":{"position":[[119,5]]},"1424":{"position":[[348,6]]},"1693":{"position":[[956,6]]}}}],["equiv=\"cont",{"_index":1433,"t":{"1178":{"position":[[1875,14]]}}}],["equival",{"_index":1500,"t":{"1184":{"position":[[381,10],[482,10],[1563,10]]},"1460":{"position":[[509,11]]},"1832":{"position":[[504,10]]},"1876":{"position":[[138,10]]}}}],["err",{"_index":189,"t":{"759":{"position":[[336,3]]},"763":{"position":[[167,3]]},"795":{"position":[[365,3],[393,3]]},"805":{"position":[[909,3],[956,3]]},"809":{"position":[[555,3],[577,3],[613,3],[660,4],[1439,3],[1480,3],[1530,4]]},"839":{"position":[[601,3],[643,3],[710,4],[1092,3],[1139,3]]},"869":{"position":[[757,3],[787,3],[810,3],[844,4],[888,3],[919,3],[954,4]]},"1082":{"position":[[675,3],[737,3]]},"1174":{"position":[[466,3]]},"1178":{"position":[[1494,3]]},"1180":{"position":[[884,3]]},"1188":{"position":[[1991,3],[2012,3],[2065,3]]},"1190":{"position":[[1488,3],[2520,3],[3668,3],[4528,3],[4712,3]]},"1274":{"position":[[152,3],[170,3],[208,4]]},"1328":{"position":[[119,4],[153,4]]},"1330":{"position":[[141,4]]},"1332":{"position":[[182,4],[227,4]]},"1360":{"position":[[313,3],[356,3],[376,3]]},"1500":{"position":[[286,3],[305,3]]},"1542":{"position":[[123,3],[145,3]]},"1562":{"position":[[1044,3],[1120,3],[1170,4]]},"1594":{"position":[[1167,3],[1192,3],[1212,3],[1411,3],[1464,3],[1484,3],[1700,3],[1769,3],[1789,3],[1989,3],[2066,3],[2086,3]]},"1640":{"position":[[404,3],[427,3],[625,3],[648,3],[772,3],[792,3]]},"1660":{"position":[[369,3],[422,3],[476,4],[1196,3],[1264,3],[1318,4]]},"1684":{"position":[[202,3]]},"1695":{"position":[[296,3]]},"1697":{"position":[[689,3],[922,3],[989,3]]},"1749":{"position":[[934,3],[966,3],[986,3],[1288,3],[1315,3]]},"1770":{"position":[[687,3],[711,3],[731,3]]},"1786":{"position":[[270,3]]},"1824":{"position":[[319,3],[345,3],[771,3],[832,3],[852,3],[869,3]]},"1832":{"position":[[430,3]]},"1850":{"position":[[529,3],[554,3],[574,3]]},"1864":{"position":[[551,3],[580,3],[600,3]]},"1870":{"position":[[514,3],[591,3]]},"1872":{"position":[[216,3],[242,3],[576,3],[637,3],[657,3],[672,3]]},"1874":{"position":[[296,3],[322,3],[659,3],[738,3],[758,3],[773,3]]},"1886":{"position":[[673,3],[713,3]]},"1902":{"position":[[82,3]]},"1904":{"position":[[107,3]]},"1906":{"position":[[84,3]]}}}],["err.(validator.validationerror",{"_index":4014,"t":{"1749":{"position":[[999,32]]}}}],["err.error",{"_index":1631,"t":{"1190":{"position":[[4739,12]]},"1749":{"position":[[1404,12]]}}}],["err.param",{"_index":4020,"t":{"1749":{"position":[[1144,11]]}}}],["err.structnamespac",{"_index":4016,"t":{"1749":{"position":[[1082,21]]}}}],["err.tag",{"_index":4018,"t":{"1749":{"position":[[1118,9]]}}}],["errbadgateway",{"_index":2472,"t":{"1336":{"position":[[6301,13]]}}}],["errbadrequest",{"_index":2410,"t":{"1336":{"position":[[4081,13]]}}}],["errconflict",{"_index":2428,"t":{"1336":{"position":[[4683,11]]}}}],["errexpectationfail",{"_index":2444,"t":{"1336":{"position":[[5279,20]]}}}],["errfaileddepend",{"_index":2454,"t":{"1336":{"position":[[5620,19]]}}}],["errfootimeout",{"_index":3594,"t":{"1660":{"position":[[1012,13],[1406,15],[1630,13]]}}}],["errforbidden",{"_index":2416,"t":{"1336":{"position":[[4279,12]]}}}],["errgatewaytimeout",{"_index":2476,"t":{"1336":{"position":[[6441,17]]}}}],["errgon",{"_index":2430,"t":{"1336":{"position":[[4741,7]]}}}],["errhttpversionnotsupport",{"_index":2478,"t":{"1336":{"position":[[6511,26]]}}}],["errinsufficientstorag",{"_index":2482,"t":{"1336":{"position":[[6681,22]]}}}],["errinternalservererror",{"_index":2468,"t":{"1336":{"position":[[6151,22]]}}}],["errinvalididempotencykey",{"_index":3197,"t":{"1528":{"position":[[382,25]]}}}],["errlengthrequir",{"_index":2432,"t":{"1336":{"position":[[4791,17]]}}}],["errlock",{"_index":2452,"t":{"1336":{"position":[[5567,9]]}}}],["errloopdetect",{"_index":2484,"t":{"1336":{"position":[[6760,15]]}}}],["errmethodnotallow",{"_index":2420,"t":{"1336":{"position":[[4397,19]]}}}],["errmisdirectedrequest",{"_index":2448,"t":{"1336":{"position":[[5410,21]]}}}],["errmissingormalformedapikey",{"_index":3247,"t":{"1542":{"position":[[152,27]]}}}],["errnetworkauthenticationrequir",{"_index":2488,"t":{"1336":{"position":[[6884,32]]}}}],["errnotaccept",{"_index":2422,"t":{"1336":{"position":[[4471,16]]}}}],["errnotextend",{"_index":2486,"t":{"1336":{"position":[[6824,14]]}}}],["errnotfound",{"_index":2418,"t":{"1336":{"position":[[4339,11]]}}}],["errnotimpl",{"_index":2470,"t":{"1336":{"position":[[6231,17]]}}}],["erron",{"_index":3174,"t":{"1516":{"position":[[156,11]]}}}],["error",{"_index":59,"t":{"733":{"position":[[366,5],[453,5]]},"737":{"position":[[564,5],[753,5]]},"739":{"position":[[530,5]]},"741":{"position":[[507,5]]},"751":{"position":[[411,5],[518,5]]},"759":{"position":[[340,6]]},"761":{"position":[[164,5]]},"763":{"position":[[391,5]]},"773":{"position":[[1354,5],[1548,5],[1606,5]]},"783":{"position":[[337,7],[353,7]]},"785":{"position":[[273,5]]},"793":{"position":[[454,8],[524,7],[540,7]]},"795":{"position":[[314,5],[445,7]]},"797":{"position":[[175,6],[232,6]]},"801":{"position":[[55,5]]},"803":{"position":[[137,5],[248,6],[255,5]]},"805":{"position":[[473,5],[560,5],[1093,5],[1167,5]]},"809":{"position":[[559,5],[1003,5],[1090,5],[1659,5],[1733,5]]},"815":{"position":[[936,5],[1050,6]]},"823":{"position":[[578,6]]},"825":{"position":[[67,6]]},"827":{"position":[[785,6],[942,5]]},"839":{"position":[[32,8],[811,5],[888,5]]},"843":{"position":[[184,6],[240,6]]},"847":{"position":[[61,5]]},"849":{"position":[[129,5],[245,6],[252,5]]},"851":{"position":[[510,6]]},"869":{"position":[[166,5],[761,5]]},"871":{"position":[[15,5]]},"874":{"position":[[402,6],[564,6],[618,5],[688,5],[754,5],[817,5],[929,5]]},"882":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"896":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"910":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"924":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"938":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"952":{"position":[[75,6],[147,5],[190,5],[222,5],[254,5]]},"958":{"position":[[2737,5],[3002,7]]},"966":{"position":[[79,6],[151,5],[194,5],[226,5],[258,5]]},"980":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"994":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1008":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1022":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1036":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1050":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1064":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1078":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1092":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1106":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1120":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1134":{"position":[[1552,5],[1696,5]]},"1144":{"position":[[676,5],[806,5]]},"1148":{"position":[[679,5],[809,5]]},"1152":{"position":[[765,5],[895,5]]},"1154":{"position":[[855,5]]},"1160":{"position":[[725,5],[855,5]]},"1164":{"position":[[736,5],[866,5]]},"1166":{"position":[[337,5]]},"1168":{"position":[[463,5]]},"1188":{"position":[[1995,5]]},"1190":{"position":[[2448,6]]},"1194":{"position":[[727,5],[857,5]]},"1198":{"position":[[902,5],[1032,5]]},"1202":{"position":[[720,5],[850,5]]},"1206":{"position":[[744,5],[874,5]]},"1212":{"position":[[525,5],[804,5],[1161,5]]},"1214":{"position":[[196,5]]},"1216":{"position":[[395,6],[539,5],[721,5],[861,5],[1056,5],[1291,5]]},"1225":{"position":[[1000,5],[1121,5],[1454,5],[1552,5],[1705,5],[1795,5],[1885,5]]},"1227":{"position":[[265,5]]},"1237":{"position":[[445,5],[510,5],[573,5]]},"1241":{"position":[[133,5]]},"1243":{"position":[[147,5]]},"1245":{"position":[[132,5]]},"1247":{"position":[[266,5]]},"1253":{"position":[[98,5]]},"1255":{"position":[[192,5]]},"1257":{"position":[[71,5]]},"1259":{"position":[[240,5]]},"1261":{"position":[[288,5]]},"1263":{"position":[[184,5]]},"1265":{"position":[[331,6],[421,5]]},"1328":{"position":[[46,6],[124,8]]},"1330":{"position":[[48,6],[112,8]]},"1332":{"position":[[47,6],[187,8]]},"1334":{"position":[[62,6]]},"1336":{"position":[[4068,6]]},"1341":{"position":[[3397,5],[3449,5]]},"1343":{"position":[[121,6],[168,5],[211,5]]},"1349":{"position":[[686,6]]},"1356":{"position":[[386,5]]},"1358":{"position":[[274,5]]},"1360":{"position":[[296,5]]},"1366":{"position":[[737,5]]},"1376":{"position":[[877,5]]},"1404":{"position":[[361,6]]},"1408":{"position":[[525,6]]},"1410":{"position":[[1992,6]]},"1422":{"position":[[375,6]]},"1424":{"position":[[651,5],[756,5],[762,5]]},"1426":{"position":[[211,6]]},"1434":{"position":[[776,5],[908,5]]},"1436":{"position":[[682,6],[820,6]]},"1458":{"position":[[373,5],[604,5]]},"1468":{"position":[[335,5]]},"1510":{"position":[[189,5]]},"1526":{"position":[[743,5]]},"1528":{"position":[[263,5]]},"1534":{"position":[[236,6],[723,5]]},"1536":{"position":[[502,6],[1114,5],[1201,5],[1300,5]]},"1538":{"position":[[304,6],[574,5],[671,5]]},"1540":{"position":[[403,6],[982,6]]},"1542":{"position":[[63,5],[127,6],[134,5]]},"1548":{"position":[[580,5]]},"1552":{"position":[[714,5]]},"1554":{"position":[[157,5]]},"1562":{"position":[[1439,6]]},"1564":{"position":[[1421,6]]},"1568":{"position":[[558,7]]},"1592":{"position":[[394,5],[628,5],[816,5],[1014,5]]},"1594":{"position":[[1104,5],[1400,5],[1689,5],[1978,5],[2571,5],[2672,5]]},"1604":{"position":[[367,5],[389,7]]},"1614":{"position":[[297,5],[382,5]]},"1634":{"position":[[277,5],[362,5]]},"1638":{"position":[[123,6],[154,5],[322,5],[359,5],[390,5]]},"1640":{"position":[[362,5]]},"1654":{"position":[[402,5],[527,5]]},"1656":{"position":[[187,5],[548,5]]},"1658":{"position":[[69,9],[173,9]]},"1660":{"position":[[293,5],[468,7],[647,5],[1001,6],[1120,5],[1310,7],[1530,5],[1849,5]]},"1680":{"position":[[78,5],[142,5],[198,5],[233,7],[409,5]]},"1684":{"position":[[24,5],[206,6],[213,5],[340,5],[375,5]]},"1690":{"position":[[466,5],[724,5],[987,5],[1085,5]]},"1693":{"position":[[48,6],[238,5],[254,5],[669,5],[781,5],[1015,5]]},"1695":{"position":[[18,5],[59,6],[110,6],[124,5],[237,5],[300,6],[307,5],[640,5]]},"1697":{"position":[[9,5],[112,5],[166,5],[240,6],[317,5],[409,5],[488,5],[523,7],[640,5],[693,6],[700,5],[911,5],[1111,7],[1241,5]]},"1706":{"position":[[864,6],[894,6]]},"1708":{"position":[[182,5],[303,5]]},"1712":{"position":[[91,5],[167,5],[244,5],[281,5],[361,5]]},"1716":{"position":[[376,5],[476,5],[573,5],[675,5],[785,5]]},"1728":{"position":[[519,5]]},"1731":{"position":[[1000,5],[1121,5],[1454,5],[1552,5],[1705,5],[1795,5],[1885,5]]},"1733":{"position":[[280,5],[408,5],[547,5]]},"1735":{"position":[[910,5],[1085,5],[1196,5],[1315,5],[1547,5],[2031,5],[2227,5],[2601,5]]},"1737":{"position":[[1333,5],[1581,5],[1980,5],[2491,5]]},"1739":{"position":[[273,5],[440,5]]},"1744":{"position":[[106,5],[162,5],[861,5]]},"1746":{"position":[[585,5]]},"1749":{"position":[[910,6],[1156,6],[1201,6],[1237,5],[1422,6],[1457,6]]},"1751":{"position":[[1000,5],[1121,5],[1454,5],[1552,5],[1705,5],[1795,5],[1885,5]]},"1754":{"position":[[463,5],[868,5],[1344,5]]},"1756":{"position":[[220,5],[354,5]]},"1758":{"position":[[160,5]]},"1760":{"position":[[256,5]]},"1762":{"position":[[166,5]]},"1764":{"position":[[175,5]]},"1766":{"position":[[164,5],[205,5],[295,5]]},"1768":{"position":[[160,5]]},"1770":{"position":[[438,5],[659,5]]},"1772":{"position":[[145,5],[712,5],[906,5]]},"1774":{"position":[[399,5]]},"1778":{"position":[[429,5]]},"1780":{"position":[[237,5]]},"1782":{"position":[[346,5],[392,5]]},"1784":{"position":[[234,5],[280,5]]},"1786":{"position":[[162,6],[210,5]]},"1788":{"position":[[208,5]]},"1792":{"position":[[202,5]]},"1796":{"position":[[213,5]]},"1800":{"position":[[169,6],[216,5],[313,5],[414,5]]},"1802":{"position":[[170,5]]},"1804":{"position":[[122,5]]},"1806":{"position":[[207,5]]},"1808":{"position":[[330,5]]},"1810":{"position":[[129,5]]},"1812":{"position":[[181,5],[280,5]]},"1814":{"position":[[299,5],[394,5]]},"1816":{"position":[[178,5]]},"1818":{"position":[[325,5],[415,5]]},"1820":{"position":[[159,5]]},"1822":{"position":[[255,5]]},"1824":{"position":[[225,6],[273,5]]},"1826":{"position":[[110,5],[181,5],[227,5],[273,5],[358,5],[443,5]]},"1828":{"position":[[164,5]]},"1830":{"position":[[369,5],[494,5],[972,5]]},"1832":{"position":[[186,5],[328,6],[418,5],[473,5]]},"1834":{"position":[[288,5],[377,5]]},"1836":{"position":[[326,5]]},"1838":{"position":[[178,5]]},"1840":{"position":[[167,6],[272,5],[478,5],[692,5],[899,5],[1211,5]]},"1842":{"position":[[415,5]]},"1844":{"position":[[548,5]]},"1846":{"position":[[612,5]]},"1848":{"position":[[602,5]]},"1850":{"position":[[288,5],[501,5]]},"1852":{"position":[[117,6],[197,5]]},"1854":{"position":[[255,5],[307,5],[385,5],[508,5]]},"1856":{"position":[[397,5],[443,5],[576,5],[844,5]]},"1858":{"position":[[295,5],[341,5],[421,5],[551,5]]},"1860":{"position":[[280,5]]},"1862":{"position":[[137,5]]},"1864":{"position":[[298,5],[523,5]]},"1866":{"position":[[141,5]]},"1868":{"position":[[343,5],[392,5],[471,5]]},"1870":{"position":[[155,5],[462,5]]},"1872":{"position":[[123,5],[170,5]]},"1874":{"position":[[179,5],[250,5]]},"1878":{"position":[[71,5],[117,5],[390,5],[452,5],[498,5]]},"1880":{"position":[[261,5],[316,5],[629,5]]},"1882":{"position":[[201,5],[256,5]]},"1884":{"position":[[159,5]]},"1886":{"position":[[1283,5],[1415,5]]},"1888":{"position":[[162,5]]},"1892":{"position":[[160,5],[243,5],[356,5]]},"1894":{"position":[[336,5]]},"1896":{"position":[[201,5]]},"1898":{"position":[[232,5]]},"1900":{"position":[[282,5]]},"1902":{"position":[[86,6],[133,5]]},"1904":{"position":[[111,6],[158,5]]},"1906":{"position":[[88,6],[135,5]]},"1908":{"position":[[288,5]]},"1910":{"position":[[185,5],[336,5]]}}}],["errorhandl",{"_index":381,"t":{"803":{"position":[[218,12],[261,12]]},"849":{"position":[[215,12],[258,12]]},"1341":{"position":[[3338,12],[3351,12],[3364,12]]},"1412":{"position":[[160,13]]},"1540":{"position":[[296,12],[459,12]]},"1542":{"position":[[90,13]]},"1600":{"position":[[126,13]]},"1656":{"position":[[233,13],[594,13]]},"1684":{"position":[[169,13]]},"1697":{"position":[[654,13]]}}}],["errorrespons",{"_index":4009,"t":{"1749":{"position":[[757,13],[887,16],[917,16],[1046,13]]}}}],["errors.as(err",{"_index":3764,"t":{"1695":{"position":[[466,14]]},"1697":{"position":[[859,14]]}}}],["errors.new(\"abc",{"_index":632,"t":{"839":{"position":[[826,17]]}}}],["errors.new(\"foo",{"_index":3595,"t":{"1660":{"position":[[1028,15]]}}}],["errorstatuscodehandl",{"_index":188,"t":{"759":{"position":[[294,22]]}}}],["errpaymentrequir",{"_index":2414,"t":{"1336":{"position":[[4207,18]]}}}],["errpreconditionfail",{"_index":2434,"t":{"1336":{"position":[[4862,21]]}}}],["errpreconditionrequir",{"_index":2460,"t":{"1336":{"position":[[5823,23]]}}}],["errproxyauthrequir",{"_index":2424,"t":{"1336":{"position":[[4539,20]]}}}],["errrequestedrangenotsatisfi",{"_index":2442,"t":{"1336":{"position":[[5183,31]]}}}],["errrequestentitytoolarg",{"_index":2436,"t":{"1336":{"position":[[4938,24]]}}}],["errrequestheaderfieldstoolarg",{"_index":2464,"t":{"1336":{"position":[[5969,30]]}}}],["errrequesttimeout",{"_index":2426,"t":{"1336":{"position":[[4613,17]]}}}],["errrequesturitoolong",{"_index":2438,"t":{"1336":{"position":[[5023,20]]}}}],["errserviceunavail",{"_index":2474,"t":{"1336":{"position":[[6363,21]]}}}],["errteapot",{"_index":2446,"t":{"1336":{"position":[[5356,9]]}}}],["errtooearli",{"_index":2456,"t":{"1336":{"position":[[5693,11]]}}}],["errtoomanyrequest",{"_index":2462,"t":{"1336":{"position":[[5901,18]]}}}],["errunauthor",{"_index":2412,"t":{"1336":{"position":[[4143,15]]}}}],["errunavailableforlegalreason",{"_index":2466,"t":{"1336":{"position":[[6061,29]]}}}],["errunprocessableent",{"_index":2450,"t":{"1336":{"position":[[5488,22]]}}}],["errunsupportedmediatyp",{"_index":2440,"t":{"1336":{"position":[[5100,23]]}}}],["errupgraderequir",{"_index":2458,"t":{"1336":{"position":[[5750,18]]}}}],["errvariantalsonegoti",{"_index":2480,"t":{"1336":{"position":[[6599,24]]}}}],["escap",{"_index":3874,"t":{"1735":{"position":[[1473,7],[1783,7]]},"1880":{"position":[[503,6]]}}}],["especi",{"_index":934,"t":{"958":{"position":[[480,10]]}}}],["essenti",{"_index":1725,"t":{"1214":{"position":[[18,11]]},"1693":{"position":[[5,9]]}}}],["establish",{"_index":983,"t":{"972":{"position":[[117,9]]},"1876":{"position":[[57,12]]}}}],["etag",{"_index":2518,"t":{"1336":{"position":[[7638,6]]},"1341":{"position":[[1818,4],[1846,4],[1897,5],[1962,5]]},"1454":{"position":[[0,4]]},"1458":{"position":[[300,5],[528,5]]},"1460":{"position":[[249,5],[427,4],[573,5],[644,5]]}}}],["etc",{"_index":1156,"t":{"1134":{"position":[[201,5]]},"1216":{"position":[[181,6],[480,4]]},"1225":{"position":[[1335,3]]},"1564":{"position":[[875,3]]},"1731":{"position":[[1335,3]]},"1751":{"position":[[1335,3]]}}}],["etcd",{"_index":791,"t":{"876":{"position":[[51,4]]},"920":{"position":[[29,4]]},"962":{"position":[[2,4],[28,4]]},"968":{"position":[[0,4],[189,4]]}}}],["etcd.new",{"_index":977,"t":{"970":{"position":[[168,10]]}}}],["etcd.new(config",{"_index":978,"t":{"970":{"position":[[216,16]]}}}],["ethernet",{"_index":3635,"t":{"1663":{"position":[[573,8]]},"1665":{"position":[[317,8]]}}}],["evalu",{"_index":1470,"t":{"1182":{"position":[[582,8]]},"1184":{"position":[[1615,9]]}}}],["event",{"_index":228,"t":{"771":{"position":[[421,5]]},"773":{"position":[[1159,5]]},"775":{"position":[[332,5]]},"1336":{"position":[[10496,5]]},"1728":{"position":[[77,5]]}}}],["exactli",{"_index":2064,"t":{"1296":{"position":[[274,7]]},"1737":{"position":[[714,8]]}}}],["exampl",{"_index":470,"t":{"809":{"position":[[206,8]]},"827":{"position":[[41,7]]},"837":{"position":[[16,7]]},"841":{"position":[[267,8],[554,8]]},"855":{"position":[[11,8]]},"880":{"position":[[24,8]]},"894":{"position":[[24,8]]},"908":{"position":[[24,8]]},"922":{"position":[[24,8]]},"936":{"position":[[24,8]]},"950":{"position":[[24,8]]},"958":{"position":[[1407,7],[2103,7]]},"964":{"position":[[24,8]]},"978":{"position":[[24,8]]},"992":{"position":[[24,8]]},"1006":{"position":[[24,8]]},"1020":{"position":[[24,8]]},"1034":{"position":[[24,8]]},"1048":{"position":[[24,8]]},"1062":{"position":[[24,8]]},"1076":{"position":[[24,8]]},"1084":{"position":[[555,8]]},"1090":{"position":[[24,8]]},"1104":{"position":[[24,8]]},"1118":{"position":[[24,8]]},"1134":{"position":[[218,7],[523,8],[1650,7]]},"1136":{"position":[[22,9]]},"1144":{"position":[[493,8]]},"1148":{"position":[[494,8]]},"1152":{"position":[[579,8]]},"1160":{"position":[[542,8]]},"1164":{"position":[[552,8]]},"1170":{"position":[[319,8]]},"1178":{"position":[[195,7]]},"1180":{"position":[[950,7]]},"1182":{"position":[[1935,8]]},"1184":{"position":[[746,7]]},"1188":{"position":[[123,8],[1043,8],[1851,7],[2397,7]]},"1190":{"position":[[1198,7],[3512,7]]},"1194":{"position":[[545,8]]},"1202":{"position":[[538,8]]},"1206":{"position":[[560,8]]},"1208":{"position":[[33,8]]},"1212":{"position":[[489,8],[744,7]]},"1223":{"position":[[471,8],[825,8],[2600,7]]},"1225":{"position":[[929,8],[1397,8]]},"1227":{"position":[[112,8]]},"1229":{"position":[[135,8]]},"1231":{"position":[[125,8]]},"1233":{"position":[[165,8]]},"1235":{"position":[[98,8]]},"1241":{"position":[[91,8]]},"1243":{"position":[[105,8]]},"1245":{"position":[[90,8]]},"1247":{"position":[[190,8]]},"1253":{"position":[[104,8]]},"1255":{"position":[[198,8]]},"1257":{"position":[[77,8]]},"1259":{"position":[[246,8]]},"1261":{"position":[[294,8]]},"1263":{"position":[[190,8]]},"1265":{"position":[[338,8]]},"1276":{"position":[[248,7]]},"1278":{"position":[[316,7]]},"1280":{"position":[[102,7]]},"1282":{"position":[[157,7]]},"1284":{"position":[[360,7]]},"1286":{"position":[[148,7]]},"1288":{"position":[[169,7]]},"1290":{"position":[[124,7]]},"1292":{"position":[[164,7]]},"1294":{"position":[[203,7]]},"1296":{"position":[[616,7]]},"1298":{"position":[[135,7]]},"1300":{"position":[[132,7]]},"1302":{"position":[[318,7]]},"1304":{"position":[[389,7],[715,7],[1052,7],[1678,7]]},"1306":{"position":[[146,7]]},"1308":{"position":[[103,7]]},"1310":{"position":[[195,7]]},"1312":{"position":[[153,7]]},"1314":{"position":[[90,7]]},"1316":{"position":[[122,7]]},"1318":{"position":[[114,7]]},"1320":{"position":[[116,7]]},"1322":{"position":[[85,7]]},"1324":{"position":[[242,7]]},"1326":{"position":[[192,7]]},"1328":{"position":[[133,7]]},"1330":{"position":[[121,7]]},"1332":{"position":[[196,7]]},"1334":{"position":[[188,7]]},"1339":{"position":[[147,7]]},"1341":{"position":[[68,7],[5541,8]]},"1343":{"position":[[128,7]]},"1345":{"position":[[96,7]]},"1398":{"position":[[507,7],[556,8]]},"1404":{"position":[[836,8]]},"1440":{"position":[[181,8]]},"1480":{"position":[[463,7]]},"1516":{"position":[[95,7]]},"1534":{"position":[[1144,8],[1273,7]]},"1544":{"position":[[393,8]]},"1550":{"position":[[101,7]]},"1552":{"position":[[1419,7]]},"1584":{"position":[[334,8]]},"1586":{"position":[[320,8]]},"1596":{"position":[[923,8]]},"1616":{"position":[[310,8]]},"1636":{"position":[[209,8]]},"1648":{"position":[[202,9]]},"1654":{"position":[[660,7]]},"1678":{"position":[[353,8]]},"1680":{"position":[[374,7]]},"1682":{"position":[[455,8],[988,7],[1087,7]]},"1684":{"position":[[130,7]]},"1690":{"position":[[25,9],[40,7]]},"1693":{"position":[[198,7],[464,7],[975,7]]},"1695":{"position":[[218,7]]},"1697":{"position":[[459,7],[531,7]]},"1700":{"position":[[376,7]]},"1716":{"position":[[243,7]]},"1728":{"position":[[280,7]]},"1731":{"position":[[929,8],[1397,8]]},"1733":{"position":[[144,8]]},"1735":{"position":[[794,7]]},"1737":{"position":[[340,7],[348,7],[1223,8],[2381,7]]},"1739":{"position":[[213,7]]},"1746":{"position":[[143,7]]},"1749":{"position":[[148,12],[295,7]]},"1751":{"position":[[929,8],[1397,8]]},"1754":{"position":[[341,7],[769,7]]},"1756":{"position":[[133,7]]},"1758":{"position":[[115,7]]},"1760":{"position":[[216,7]]},"1762":{"position":[[126,7]]},"1764":{"position":[[93,7]]},"1766":{"position":[[170,7]]},"1768":{"position":[[68,7]]},"1770":{"position":[[130,8],[444,7]]},"1772":{"position":[[105,7],[669,7]]},"1774":{"position":[[322,7]]},"1778":{"position":[[389,7]]},"1780":{"position":[[197,7]]},"1782":{"position":[[352,7]]},"1784":{"position":[[240,7]]},"1786":{"position":[[169,7]]},"1788":{"position":[[167,7]]},"1792":{"position":[[162,7]]},"1796":{"position":[[173,7]]},"1800":{"position":[[72,8],[176,7]]},"1802":{"position":[[98,7]]},"1804":{"position":[[82,7]]},"1806":{"position":[[121,7]]},"1808":{"position":[[248,7]]},"1810":{"position":[[89,7]]},"1812":{"position":[[187,7]]},"1814":{"position":[[305,7]]},"1816":{"position":[[138,7]]},"1818":{"position":[[290,7]]},"1820":{"position":[[118,7]]},"1822":{"position":[[214,7]]},"1824":{"position":[[232,7]]},"1826":{"position":[[233,7]]},"1828":{"position":[[79,7]]},"1830":{"position":[[282,7],[664,7],[921,7]]},"1832":{"position":[[335,7]]},"1834":{"position":[[115,8],[294,7]]},"1836":{"position":[[239,7]]},"1838":{"position":[[112,7]]},"1840":{"position":[[174,7],[368,7],[552,7],[783,7],[1001,7]]},"1842":{"position":[[326,7]]},"1844":{"position":[[450,7]]},"1846":{"position":[[518,7]]},"1848":{"position":[[508,7]]},"1850":{"position":[[115,8],[294,7]]},"1852":{"position":[[124,7]]},"1854":{"position":[[261,7],[467,8]]},"1856":{"position":[[403,7]]},"1858":{"position":[[301,7]]},"1862":{"position":[[97,7]]},"1864":{"position":[[118,8],[304,7]]},"1866":{"position":[[101,7]]},"1868":{"position":[[349,7]]},"1870":{"position":[[73,7],[392,7]]},"1872":{"position":[[129,7]]},"1874":{"position":[[185,7]]},"1876":{"position":[[108,7]]},"1878":{"position":[[77,7],[458,7]]},"1880":{"position":[[267,7],[570,7]]},"1882":{"position":[[207,7]]},"1884":{"position":[[119,7]]},"1886":{"position":[[356,7],[1030,7]]},"1888":{"position":[[122,7]]},"1892":{"position":[[115,7]]},"1894":{"position":[[260,7]]},"1896":{"position":[[161,7]]},"1898":{"position":[[192,7]]},"1900":{"position":[[242,7]]},"1902":{"position":[[93,7]]},"1904":{"position":[[118,7]]},"1906":{"position":[[95,7]]},"1908":{"position":[[212,7]]},"1910":{"position":[[191,7]]}}}],["example.authz",{"_index":564,"t":{"827":{"position":[[387,13]]}}}],["example.html",{"_index":3324,"t":{"1564":{"position":[[721,12]]}}}],["example/loc",{"_index":116,"t":{"749":{"position":[[169,20]]},"751":{"position":[[247,21]]}}}],["exce",{"_index":2671,"t":{"1341":{"position":[[425,7]]}}}],["excecut",{"_index":3111,"t":{"1490":{"position":[[54,12]]}}}],["exceed",{"_index":1888,"t":{"1237":{"position":[[408,9]]}}}],["excel",{"_index":1760,"t":{"1220":{"position":[[82,9]]}}}],["except",{"_index":504,"t":{"813":{"position":[[55,9]]},"1436":{"position":[[284,6]]},"1438":{"position":[[39,7]]},"1440":{"position":[[140,6],[279,7]]},"1814":{"position":[[76,6]]}}}],["exclud",{"_index":1225,"t":{"1140":{"position":[[159,8]]},"1341":{"position":[[1100,8],[1212,8]]},"1440":{"position":[[310,7]]},"1474":{"position":[[227,7]]},"1652":{"position":[[32,7]]},"1772":{"position":[[499,9]]}}}],["exclude_dir",{"_index":3713,"t":{"1682":{"position":[[662,11]]}}}],["exclude_regex",{"_index":3716,"t":{"1682":{"position":[[748,13]]}}}],["excludevar",{"_index":3039,"t":{"1446":{"position":[[484,12]]},"1450":{"position":[[167,11],[238,11]]}}}],["exclus",{"_index":3092,"t":{"1474":{"position":[[345,11]]}}}],["execut",{"_index":380,"t":{"803":{"position":[[186,8],[302,8]]},"849":{"position":[[178,8],[299,8]]},"1084":{"position":[[920,7]]},"1172":{"position":[[31,9]]},"1174":{"position":[[569,8]]},"1176":{"position":[[0,7],[84,7],[127,8],[307,9],[396,7],[467,8]]},"1188":{"position":[[1584,8],[1770,8],[2360,8]]},"1190":{"position":[[1447,9],[2969,8]]},"1216":{"position":[[244,8],[591,8]]},"1341":{"position":[[3380,8]]},"1418":{"position":[[996,9]]},"1540":{"position":[[212,8],[337,8]]},"1656":{"position":[[452,10],[640,11],[663,10]]},"1660":{"position":[[458,9],[1300,9]]},"1663":{"position":[[81,9]]},"1710":{"position":[[28,7]]},"1714":{"position":[[21,7]]},"1716":{"position":[[20,7]]},"1718":{"position":[[21,7]]},"1720":{"position":[[25,7]]},"1722":{"position":[[22,7]]},"1724":{"position":[[20,7]]},"1726":{"position":[[24,7]]},"1728":{"position":[[21,7]]},"1737":{"position":[[18,7]]},"1739":{"position":[[154,8]]},"1744":{"position":[[229,8]]},"1826":{"position":[[24,8]]},"1868":{"position":[[11,9],[80,9],[247,8]]},"1870":{"position":[[376,8]]}}}],["execute(w",{"_index":1629,"t":{"1190":{"position":[[4691,13]]}}}],["exercis",{"_index":3638,"t":{"1665":{"position":[[25,8]]}}}],["exist",{"_index":187,"t":{"759":{"position":[[267,8]]},"874":{"position":[[371,5]]},"888":{"position":[[491,8],[508,8]]},"902":{"position":[[315,8],[332,8]]},"916":{"position":[[118,8],[135,8]]},"930":{"position":[[485,8],[502,8]]},"958":{"position":[[1048,8],[1065,8],[1200,5],[1896,5],[2542,5],[2710,5]]},"986":{"position":[[166,8],[183,8]]},"1014":{"position":[[626,8],[643,8]]},"1028":{"position":[[720,8],[737,8]]},"1042":{"position":[[735,8],[752,8]]},"1052":{"position":[[224,8]]},"1070":{"position":[[875,8],[892,8]]},"1084":{"position":[[1199,8],[1216,8]]},"1112":{"position":[[265,8],[282,8]]},"1126":{"position":[[179,8],[196,8]]},"1162":{"position":[[327,6]]},"1182":{"position":[[156,5],[384,6]]},"1223":{"position":[[687,5]]},"1656":{"position":[[6,5]]},"1693":{"position":[[302,7]]},"1780":{"position":[[115,6]]},"1788":{"position":[[305,5]]},"1830":{"position":[[137,6],[201,6]]},"1832":{"position":[[269,6]]},"1842":{"position":[[184,6]]},"1844":{"position":[[185,6]]},"1846":{"position":[[185,6],[431,6]]},"1848":{"position":[[185,6],[431,6]]},"1858":{"position":[[82,7]]}}}],["exit",{"_index":672,"t":{"841":{"position":[[407,6]]}}}],["exp",{"_index":437,"t":{"805":{"position":[[732,6]]},"809":{"position":[[1262,6]]},"874":{"position":[[599,3]]},"882":{"position":[[131,3]]},"896":{"position":[[131,3]]},"910":{"position":[[131,3]]},"924":{"position":[[131,3]]},"938":{"position":[[131,3]]},"952":{"position":[[128,3]]},"966":{"position":[[132,3]]},"980":{"position":[[131,3]]},"994":{"position":[[131,3]]},"1008":{"position":[[131,3]]},"1022":{"position":[[131,3]]},"1036":{"position":[[131,3]]},"1050":{"position":[[131,3]]},"1064":{"position":[[131,3]]},"1078":{"position":[[131,3]]},"1092":{"position":[[131,3]]},"1106":{"position":[[131,3]]},"1120":{"position":[[131,3]]}}}],["expand",{"_index":1401,"t":{"1178":{"position":[[738,8]]},"1735":{"position":[[2861,7]]}}}],["expect",{"_index":667,"t":{"841":{"position":[[162,6]]},"1336":{"position":[[8104,8],[9982,7]]},"1368":{"position":[[679,8]]},"1580":{"position":[[96,8]]}}}],["expir",{"_index":382,"t":{"803":{"position":[[348,7]]},"849":{"position":[[345,7]]},"874":{"position":[[474,10],[503,11]]},"888":{"position":[[596,7]]},"916":{"position":[[218,7]]},"1000":{"position":[[45,7]]},"1028":{"position":[[820,7]]},"1042":{"position":[[835,7]]},"1070":{"position":[[975,7]]},"1126":{"position":[[279,7]]},"1223":{"position":[[1977,10]]},"1237":{"position":[[309,8]]},"1336":{"position":[[7318,9]]},"1376":{"position":[[430,11],[510,6]]},"1378":{"position":[[198,10],[296,10],[842,10],[876,10],[1363,10]]},"1380":{"position":[[39,11]]},"1404":{"position":[[596,8]]},"1408":{"position":[[433,11]]},"1410":{"position":[[1222,10],[1274,10],[1324,6],[1370,10]]},"1412":{"position":[[107,11]]},"1540":{"position":[[447,7]]},"1542":{"position":[[315,7]]},"1548":{"position":[[440,11]]},"1550":{"position":[[180,11],[461,11]]},"1552":{"position":[[495,10],[599,10]]},"1554":{"position":[[36,11]]},"1640":{"position":[[693,10]]},"1642":{"position":[[136,10],[1029,10]]},"1644":{"position":[[28,11]]},"1772":{"position":[[0,6],[195,6],[252,6],[509,7],[781,8],[984,8]]},"1778":{"position":[[217,7]]}}}],["expirationgener",{"_index":2865,"t":{"1376":{"position":[[565,20]]},"1378":{"position":[[917,19]]},"1380":{"position":[[192,20]]}}}],["expiri",{"_index":4121,"t":{"1772":{"position":[[960,6]]}}}],["explain",{"_index":3722,"t":{"1684":{"position":[[325,10]]}}}],["explan",{"_index":3692,"t":{"1680":{"position":[[127,11]]}}}],["explicitli",{"_index":2919,"t":{"1398":{"position":[[820,10]]},"1400":{"position":[[438,10]]},"1408":{"position":[[592,10]]},"1410":{"position":[[487,10]]}}}],["explor",{"_index":1416,"t":{"1178":{"position":[[1217,9],[1282,8]]}}}],["export",{"_index":639,"t":{"839":{"position":[[1082,9]]},"1450":{"position":[[128,6],[231,6]]}}}],["exportvar",{"_index":3035,"t":{"1446":{"position":[[402,11]]},"1450":{"position":[[69,10],[135,10]]}}}],["expos",{"_index":2545,"t":{"1336":{"position":[[8496,6]]},"1400":{"position":[[1178,7]]},"1442":{"position":[[48,6]]},"1464":{"position":[[68,7]]},"1468":{"position":[[501,7]]},"1576":{"position":[[247,6]]},"1628":{"position":[[57,6]]}}}],["exposehead",{"_index":2928,"t":{"1400":{"position":[[1425,13],[1540,13]]},"1402":{"position":[[279,14]]}}}],["express",{"_index":1538,"t":{"1186":{"position":[[656,11]]},"1208":{"position":[[112,7]]},"1220":{"position":[[115,7]]},"1570":{"position":[[70,7]]},"1665":{"position":[[452,7]]},"1667":{"position":[[78,7]]},"1669":{"position":[[78,7]]},"1671":{"position":[[78,7]]},"1673":{"position":[[80,7]]},"1697":{"position":[[1197,7]]},"1735":{"position":[[3342,7],[3412,12],[3505,8],[3531,7]]},"1737":{"position":[[1211,11]]}}}],["expressj",{"_index":3785,"t":{"1704":{"position":[[71,10],[341,10]]},"1733":{"position":[[604,9]]}}}],["expvar",{"_index":3065,"t":{"1464":{"position":[[0,6]]},"1468":{"position":[[395,6],[546,6]]}}}],["expvar.newint(\"count",{"_index":3071,"t":{"1468":{"position":[[256,22]]}}}],["expvarhandlercal",{"_index":3081,"t":{"1468":{"position":[[626,21]]}}}],["expvarmw",{"_index":3069,"t":{"1468":{"position":[[109,8]]}}}],["expvarregexperror",{"_index":3083,"t":{"1468":{"position":[[652,21]]}}}],["ext",{"_index":1160,"t":{"1134":{"position":[[416,3]]}}}],["extauthz",{"_index":3224,"t":{"1534":{"position":[[1237,8]]}}}],["extend",{"_index":397,"t":{"803":{"position":[[683,10]]},"1140":{"position":[[8,9],[177,8]]},"1154":{"position":[[90,6]]},"1366":{"position":[[379,6]]},"1376":{"position":[[290,6]]},"1386":{"position":[[296,6]]},"1398":{"position":[[288,6]]},"1408":{"position":[[288,6]]},"1422":{"position":[[298,6]]},"1446":{"position":[[311,6]]},"1458":{"position":[[427,6]]},"1478":{"position":[[294,6]]},"1488":{"position":[[347,6]]},"1548":{"position":[[294,6]]},"1562":{"position":[[473,6]]},"1574":{"position":[[342,6]]},"1584":{"position":[[290,6]]},"1594":{"position":[[2364,6]]},"1624":{"position":[[298,6]]}}}],["extens",{"_index":1158,"t":{"1134":{"position":[[382,9]]},"1174":{"position":[[43,9],[172,9],[349,9]]},"1336":{"position":[[10790,11]]},"1754":{"position":[[25,10]]},"1880":{"position":[[112,10]]},"1896":{"position":[[85,10]]}}}],["extern",{"_index":516,"t":{"815":{"position":[[251,8]]},"1874":{"position":[[48,8]]}}}],["extract",{"_index":597,"t":{"835":{"position":[[635,10]]},"849":{"position":[[1164,7]]},"1410":{"position":[[296,8]]},"1540":{"position":[[568,7]]},"1642":{"position":[[347,7]]}}}],["extractor",{"_index":2954,"t":{"1408":{"position":[[486,10],[579,9]]},"1410":{"position":[[281,9],[474,9],[1776,9],[1855,9],[1924,9],[1954,9]]},"1412":{"position":[[195,10]]}}}],["extraparam",{"_index":3312,"t":{"1562":{"position":[[1414,10]]},"1564":{"position":[[1396,10]]}}}],["eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9.eyjlehaioje0nje5ntcxmzz9.rb3arc4",{"_index":459,"t":{"807":{"position":[[136,70],[382,69]]}}}],["f",{"_index":3114,"t":{"1490":{"position":[[278,1]]},"1770":{"position":[[1214,1],[1227,1]]},"1886":{"position":[[1528,1],[1543,1],[1556,1]]}}}],["f2",{"_index":2109,"t":{"1304":{"position":[[1126,6]]}}}],["factor",{"_index":4049,"t":{"1754":{"position":[[1091,6]]}}}],["fail",{"_index":982,"t":{"972":{"position":[[106,7]]},"1154":{"position":[[111,5]]},"1697":{"position":[[1026,5]]},"1749":{"position":[[524,4]]}}}],["failedfield",{"_index":4010,"t":{"1749":{"position":[[780,11]]}}}],["failedfield\":\"user.email\",\"tag\":\"required\",\"value\":\"\"},{\"failedfield\":\"user.job.salary\",\"tag\":\"required\",\"value\":\"\"},{\"failedfield\":\"user.job.type\",\"tag\":\"required\",\"valu",{"_index":4031,"t":{"1749":{"position":[[1796,181]]}}}],["failov",{"_index":1054,"t":{"1082":{"position":[[419,8]]}}}],["failovercli",{"_index":1078,"t":{"1084":{"position":[[723,14]]}}}],["failur",{"_index":853,"t":{"902":{"position":[[604,8]]},"958":{"position":[[953,8]]},"1112":{"position":[[556,8]]}}}],["fallback",{"_index":385,"t":{"803":{"position":[[422,8]]},"1858":{"position":[[45,8]]}}}],["fals",{"_index":183,"t":{"759":{"position":[[175,5]]},"771":{"position":[[156,5],[370,6],[377,5]]},"823":{"position":[[190,5]]},"827":{"position":[[418,5]]},"886":{"position":[[347,6]]},"888":{"position":[[555,5]]},"890":{"position":[[151,6]]},"902":{"position":[[376,5]]},"904":{"position":[[96,6]]},"914":{"position":[[281,6]]},"916":{"position":[[177,5],[620,5]]},"918":{"position":[[63,6],[196,6]]},"928":{"position":[[298,6]]},"930":{"position":[[445,5],[545,5]]},"932":{"position":[[151,6],[165,6]]},"958":{"position":[[1108,5],[2786,6]]},"960":{"position":[[103,6]]},"986":{"position":[[225,5]]},"1012":{"position":[[337,6],[549,6]]},"1014":{"position":[[685,5]]},"1016":{"position":[[134,6]]},"1026":{"position":[[323,6],[548,6]]},"1028":{"position":[[779,5]]},"1030":{"position":[[128,6]]},"1040":{"position":[[323,6],[516,6],[730,6]]},"1042":{"position":[[794,5]]},"1044":{"position":[[128,6]]},"1068":{"position":[[300,6]]},"1070":{"position":[[934,5]]},"1072":{"position":[[187,6]]},"1082":{"position":[[335,6],[1003,6],[1160,6]]},"1084":{"position":[[1263,5]]},"1086":{"position":[[116,6]]},"1110":{"position":[[308,6]]},"1112":{"position":[[325,5]]},"1114":{"position":[[284,6]]},"1124":{"position":[[310,6]]},"1126":{"position":[[238,5]]},"1128":{"position":[[88,6]]},"1134":{"position":[[738,5],[854,5]]},"1182":{"position":[[209,6]]},"1184":{"position":[[1398,5]]},"1190":{"position":[[329,5],[1430,5],[2700,5],[3779,5],[3989,5],[4682,5]]},"1223":{"position":[[1471,5],[1586,5],[1703,6],[1811,6]]},"1341":{"position":[[640,5],[1128,5],[1240,5],[1349,5],[1499,5],[1721,5],[1812,5],[1998,5],[2434,5],[2550,5],[3332,5],[3770,5],[4109,5],[4676,5],[5091,5],[6071,5],[6214,5],[6609,5]]},"1360":{"position":[[346,6]]},"1366":{"position":[[695,5]]},"1368":{"position":[[706,5]]},"1378":{"position":[[592,5],[1206,5]]},"1380":{"position":[[106,6],[240,6]]},"1400":{"position":[[1393,6]]},"1402":{"position":[[272,6]]},"1410":{"position":[[912,6],[1006,6]]},"1462":{"position":[[45,6]]},"1502":{"position":[[606,5]]},"1504":{"position":[[74,6]]},"1512":{"position":[[571,6],[734,6],[809,6]]},"1534":{"position":[[425,6]]},"1536":{"position":[[691,6],[906,5]]},"1538":{"position":[[493,6]]},"1552":{"position":[[892,5],[1007,5]]},"1554":{"position":[[237,6],[268,6]]},"1564":{"position":[[1230,5]]},"1576":{"position":[[304,5]]},"1578":{"position":[[170,6]]},"1606":{"position":[[269,5]]},"1608":{"position":[[57,6]]},"1642":{"position":[[744,6],[838,6],[1082,6]]},"1749":{"position":[[533,7]]},"1808":{"position":[[191,6],[397,5]]},"1810":{"position":[[196,5]]},"1840":{"position":[[336,7]]},"1844":{"position":[[253,5],[370,6],[585,5],[626,5],[655,5],[716,5]]},"1880":{"position":[[428,7]]}}}],["far",{"_index":3058,"t":{"1460":{"position":[[288,3]]}}}],["fast",{"_index":857,"t":{"906":{"position":[[2,4]]},"920":{"position":[[165,5]]},"1046":{"position":[[2,4]]},"1208":{"position":[[232,4]]},"1628":{"position":[[26,4]]}}}],["faster",{"_index":3702,"t":{"1682":{"position":[[135,6]]},"1878":{"position":[[322,6]]}}}],["fastest",{"_index":1682,"t":{"1208":{"position":[[173,7]]}}}],["fasthttp",{"_index":715,"t":{"865":{"position":[[9,8]]},"1208":{"position":[[159,9]]},"1235":{"position":[[30,8]]},"1334":{"position":[[117,8]]},"1341":{"position":[[3259,8]]},"1776":{"position":[[248,8]]}}}],["fasthttp'",{"_index":1994,"t":{"1272":{"position":[[25,10]]}}}],["fasthttp.client",{"_index":3438,"t":{"1592":{"position":[[222,20],[373,20],[607,20],[795,20],[993,20],[1177,20],[1371,20]]},"1594":{"position":[[954,17]]}}}],["fasthttp.defaultlbclienttimeout",{"_index":3491,"t":{"1598":{"position":[[89,32]]}}}],["fasthttp.lbclient",{"_index":3490,"t":{"1596":{"position":[[1281,18]]}}}],["fasthttp.request",{"_index":4385,"t":{"1862":{"position":[[19,17],[79,17]]}}}],["fasthttp.request.uri().host",{"_index":2722,"t":{"1341":{"position":[[3302,29]]}}}],["fasthttp.requestctx",{"_index":1927,"t":{"1251":{"position":[[68,20]]},"1349":{"position":[[807,21],[848,19]]},"1776":{"position":[[8,20],[206,20]]}}}],["fasthttp.requesthandl",{"_index":1928,"t":{"1251":{"position":[[135,23]]}}}],["fasthttp.respons",{"_index":4394,"t":{"1866":{"position":[[20,18],[82,18]]}}}],["fasthttp.serv",{"_index":1875,"t":{"1235":{"position":[[81,16]]}}}],["fault",{"_index":3170,"t":{"1516":{"position":[[44,5]]}}}],["favicon",{"_index":3086,"t":{"1474":{"position":[[0,7],[42,7],[391,8],[436,7]]},"1480":{"position":[[231,7],[310,7],[445,7]]}}}],["favicon.ico",{"_index":3090,"t":{"1474":{"position":[[163,11],[413,12]]},"1478":{"position":[[373,16],[395,15]]},"1480":{"position":[[351,14]]}}}],["favnum",{"_index":1506,"t":{"1184":{"position":[[531,8],[591,7],[823,7]]}}}],["favourit",{"_index":1515,"t":{"1184":{"position":[[797,9]]}}}],["fd.test",{"_index":1914,"t":{"1243":{"position":[[715,10]]}}}],["featur",{"_index":1348,"t":{"1170":{"position":[[340,8]]},"1190":{"position":[[276,7],[287,8],[461,8],[627,7],[735,7],[1384,7],[1395,8],[1838,8],[2005,7],[2612,7],[2654,7],[2665,8],[2797,7],[3032,8],[3068,8],[3504,7],[4636,7],[4647,8],[5022,8]]},"1336":{"position":[[10016,8]]},"1398":{"position":[[757,7]]},"1400":{"position":[[375,7]]},"1418":{"position":[[84,8]]},"1737":{"position":[[139,7]]}}}],["feder",{"_index":3433,"t":{"1586":{"position":[[329,11]]}}}],["feel",{"_index":3728,"t":{"1688":{"position":[[150,4]]}}}],["feet",{"_index":1701,"t":{"1212":{"position":[[472,5]]}}}],["fenni",{"_index":4065,"t":{"1756":{"position":[[255,9]]},"1830":{"position":[[397,7]]}}}],["fenny/123",{"_index":4067,"t":{"1756":{"position":[[387,13]]},"1830":{"position":[[519,11],[549,11]]}}}],["ferret",{"_index":4492,"t":{"1894":{"position":[[362,11]]}}}],["fetch",{"_index":82,"t":{"737":{"position":[[388,5]]},"739":{"position":[[388,5]]},"741":{"position":[[388,5]]},"1830":{"position":[[609,7]]}}}],["ff1",{"_index":2116,"t":{"1304":{"position":[[1686,3]]}}}],["ff2",{"_index":2119,"t":{"1304":{"position":[[1750,3],[1834,5]]}}}],["ffffffffffffffffffffffffffffffffffffffff",{"_index":198,"t":{"761":{"position":[[240,43]]}}}],["fiber",{"_index":20,"t":{"727":{"position":[[22,6]]},"743":{"position":[[20,6]]},"745":{"position":[[25,5]]},"753":{"position":[[21,6]]},"759":{"position":[[127,5]]},"765":{"position":[[19,6]]},"767":{"position":[[25,5]]},"777":{"position":[[24,6]]},"779":{"position":[[25,5]]},"787":{"position":[[28,6]]},"789":{"position":[[25,5]]},"799":{"position":[[25,5]]},"817":{"position":[[30,6]]},"827":{"position":[[4,5]]},"829":{"position":[[26,6]]},"831":{"position":[[25,5]]},"841":{"position":[[29,5],[217,5],[234,5],[303,5],[316,5],[333,5],[385,5],[441,5],[487,5]]},"845":{"position":[[25,5]]},"853":{"position":[[23,6]]},"859":{"position":[[50,5],[162,5],[221,5]]},"865":{"position":[[32,5]]},"874":{"position":[[95,5]]},"886":{"position":[[302,8]]},"888":{"position":[[367,7]]},"890":{"position":[[106,8]]},"1012":{"position":[[292,8],[504,8]]},"1014":{"position":[[502,7]]},"1016":{"position":[[89,8]]},"1026":{"position":[[283,8]]},"1028":{"position":[[606,7]]},"1030":{"position":[[88,8]]},"1040":{"position":[[283,8]]},"1042":{"position":[[621,7]]},"1044":{"position":[[88,8]]},"1070":{"position":[[674,7]]},"1072":{"position":[[127,8]]},"1126":{"position":[[65,7]]},"1130":{"position":[[82,5]]},"1156":{"position":[[407,8],[449,5],[721,5]]},"1208":{"position":[[82,5],[100,5],[321,5]]},"1212":{"position":[[75,5]]},"1214":{"position":[[55,5]]},"1216":{"position":[[424,5]]},"1220":{"position":[[53,6],[144,6]]},"1227":{"position":[[14,5]]},"1304":{"position":[[493,5]]},"1341":{"position":[[52,5],[195,8],[2603,5],[3443,5]]},"1347":{"position":[[40,5]]},"1349":{"position":[[580,5]]},"1352":{"position":[[141,5]]},"1354":{"position":[[141,5]]},"1362":{"position":[[36,5]]},"1366":{"position":[[50,5],[186,5]]},"1372":{"position":[[21,5],[243,5]]},"1376":{"position":[[50,5],[182,5]]},"1382":{"position":[[27,5]]},"1386":{"position":[[50,5],[185,5]]},"1394":{"position":[[20,5]]},"1398":{"position":[[50,5],[181,5]]},"1404":{"position":[[20,5]]},"1408":{"position":[[50,5],[181,5]]},"1418":{"position":[[30,5]]},"1422":{"position":[[50,5],[186,5]]},"1430":{"position":[[23,5]]},"1434":{"position":[[50,5],[190,5]]},"1442":{"position":[[22,5]]},"1446":{"position":[[50,5],[183,5]]},"1454":{"position":[[20,5]]},"1458":{"position":[[50,5],[181,5]]},"1464":{"position":[[22,5]]},"1468":{"position":[[50,5],[192,5]]},"1474":{"position":[[23,5]]},"1478":{"position":[[50,5],[184,5]]},"1484":{"position":[[26,5]]},"1488":{"position":[[50,5],[187,5]]},"1516":{"position":[[27,5]]},"1520":{"position":[[50,5],[188,5]]},"1534":{"position":[[1225,5]]},"1544":{"position":[[23,5]]},"1548":{"position":[[50,5],[184,5]]},"1558":{"position":[[22,5]]},"1562":{"position":[[50,5],[364,5]]},"1570":{"position":[[23,5]]},"1574":{"position":[[50,5],[184,5]]},"1576":{"position":[[113,6]]},"1580":{"position":[[21,5]]},"1584":{"position":[[50,5],[182,5]]},"1586":{"position":[[341,6]]},"1590":{"position":[[21,5]]},"1594":{"position":[[50,5],[182,5]]},"1600":{"position":[[23,5]]},"1604":{"position":[[50,5],[184,5]]},"1610":{"position":[[27,6]]},"1620":{"position":[[25,5]]},"1624":{"position":[[50,5],[186,5]]},"1636":{"position":[[23,6]]},"1640":{"position":[[50,5],[184,5]]},"1650":{"position":[[20,5]]},"1654":{"position":[[50,5],[181,5]]},"1656":{"position":[[63,6]]},"1660":{"position":[[50,5],[184,5]]},"1663":{"position":[[440,5]]},"1665":{"position":[[378,5]]},"1667":{"position":[[0,5]]},"1669":{"position":[[0,5]]},"1671":{"position":[[0,5]]},"1673":{"position":[[0,5]]},"1678":{"position":[[162,5],[474,5]]},"1682":{"position":[[178,5],[538,6],[790,5],[1030,5],[1056,5],[1135,5]]},"1684":{"position":[[114,5],[364,6]]},"1686":{"position":[[0,5],[169,6]]},"1690":{"position":[[184,5]]},"1693":{"position":[[30,5],[163,5],[263,5],[313,5],[708,7]]},"1695":{"position":[[0,5]]},"1697":{"position":[[69,5],[555,5]]},"1700":{"position":[[6,5]]},"1704":{"position":[[44,5],[311,5]]},"1710":{"position":[[5,5]]},"1712":{"position":[[50,6]]},"1737":{"position":[[302,5],[1800,5]]},"1739":{"position":[[118,5]]},"1744":{"position":[[0,5],[241,5],[698,5]]},"1746":{"position":[[0,5]]},"1749":{"position":[[0,5]]},"1754":{"position":[[1128,5]]},"1804":{"position":[[211,5],[263,6]]},"1856":{"position":[[518,7],[695,8]]},"1878":{"position":[[189,5]]},"1910":{"position":[[435,7],[485,8]]}}}],["fiber'",{"_index":1185,"t":{"1134":{"position":[[1327,7]]},"1418":{"position":[[331,7]]},"1693":{"position":[[766,7]]},"1744":{"position":[[316,7]]}}}],["fiber.app",{"_index":2807,"t":{"1349":{"position":[[551,11]]},"1690":{"position":[[190,10]]},"1728":{"position":[[507,11]]}}}],["fiber.badg",{"_index":864,"t":{"914":{"position":[[256,17]]},"916":{"position":[[65,16]]},"918":{"position":[[38,17]]}}}],["fiber.config",{"_index":3101,"t":{"1484":{"position":[[229,13]]}}}],["fiber.ctx",{"_index":81,"t":{"737":{"position":[[364,11],[552,11],[741,11]]},"739":{"position":[[364,11],[518,11]]},"741":{"position":[[364,11],[495,11]]},"749":{"position":[[46,11],[750,11],[833,10]]},"751":{"position":[[399,11],[506,11]]},"759":{"position":[[324,11]]},"761":{"position":[[152,11]]},"763":{"position":[[379,11]]},"773":{"position":[[1342,11],[1536,11],[1594,11]]},"783":{"position":[[564,11]]},"785":{"position":[[261,11]]},"793":{"position":[[751,11]]},"795":{"position":[[302,11]]},"805":{"position":[[461,11],[1081,11],[1155,11]]},"809":{"position":[[991,11],[1647,11],[1721,11]]},"815":{"position":[[924,11]]},"823":{"position":[[541,11]]},"825":{"position":[[30,11]]},"827":{"position":[[748,11],[930,11]]},"839":{"position":[[799,11],[876,11]]},"865":{"position":[[53,10]]},"869":{"position":[[154,11]]},"871":{"position":[[190,11]]},"1134":{"position":[[1540,11],[1684,11]]},"1144":{"position":[[664,11],[794,11]]},"1148":{"position":[[667,11],[797,11]]},"1152":{"position":[[753,11],[883,11]]},"1154":{"position":[[843,11]]},"1160":{"position":[[713,11],[843,11]]},"1164":{"position":[[724,11],[854,11]]},"1166":{"position":[[325,11]]},"1168":{"position":[[451,11]]},"1194":{"position":[[715,11],[845,11]]},"1198":{"position":[[890,11],[1020,11]]},"1202":{"position":[[708,11],[838,11]]},"1206":{"position":[[732,11],[862,11]]},"1212":{"position":[[26,10],[137,9],[513,11],[792,11],[1149,11]]},"1214":{"position":[[184,11]]},"1216":{"position":[[709,11],[849,11],[1044,11],[1279,11]]},"1225":{"position":[[988,11],[1109,11],[1442,11],[1540,11],[1693,11],[1783,11],[1873,11]]},"1227":{"position":[[253,11]]},"1241":{"position":[[121,11]]},"1243":{"position":[[135,11]]},"1245":{"position":[[120,11]]},"1247":{"position":[[254,11]]},"1265":{"position":[[409,11]]},"1341":{"position":[[4591,9]]},"1343":{"position":[[156,11]]},"1349":{"position":[[642,11],[693,9]]},"1356":{"position":[[374,11]]},"1358":{"position":[[262,11]]},"1360":{"position":[[284,11]]},"1366":{"position":[[725,11]]},"1368":{"position":[[178,11]]},"1376":{"position":[[372,11],[593,11],[783,11],[865,11]]},"1378":{"position":[[178,11],[709,11]]},"1380":{"position":[[134,11]]},"1386":{"position":[[502,11]]},"1388":{"position":[[178,11]]},"1400":{"position":[[178,11]]},"1408":{"position":[[504,11]]},"1410":{"position":[[178,11],[1971,11]]},"1424":{"position":[[178,11],[379,11],[631,11]]},"1426":{"position":[[48,11],[151,11]]},"1434":{"position":[[764,11],[896,11]]},"1436":{"position":[[178,11]]},"1458":{"position":[[361,11],[592,11]]},"1460":{"position":[[178,11]]},"1468":{"position":[[323,11]]},"1470":{"position":[[178,11]]},"1480":{"position":[[178,11]]},"1502":{"position":[[178,11]]},"1510":{"position":[[177,11]]},"1526":{"position":[[241,11]]},"1528":{"position":[[41,11]]},"1534":{"position":[[205,11],[711,11]]},"1536":{"position":[[471,11],[754,11],[1102,11],[1189,11],[1288,11]]},"1538":{"position":[[273,11],[562,11],[659,11]]},"1542":{"position":[[51,11],[111,11]]},"1548":{"position":[[380,11],[491,11],[568,11]]},"1552":{"position":[[178,11],[412,11],[702,11]]},"1554":{"position":[[86,11],[145,11]]},"1562":{"position":[[1383,11],[1643,11]]},"1564":{"position":[[178,11],[371,11],[1365,11]]},"1576":{"position":[[435,11]]},"1586":{"position":[[178,11]]},"1592":{"position":[[340,11],[551,11],[742,11],[937,11]]},"1594":{"position":[[1092,11],[1388,11],[1677,11],[1966,11],[2559,11],[2660,11]]},"1596":{"position":[[178,11]]},"1604":{"position":[[355,11]]},"1606":{"position":[[178,11],[434,11]]},"1614":{"position":[[285,11],[370,11]]},"1626":{"position":[[178,11]]},"1634":{"position":[[265,11],[350,11]]},"1638":{"position":[[100,11]]},"1640":{"position":[[350,11]]},"1652":{"position":[[47,11]]},"1654":{"position":[[306,11],[390,11],[515,11]]},"1660":{"position":[[281,11],[1108,11],[1837,11]]},"1680":{"position":[[397,11]]},"1684":{"position":[[190,11]]},"1690":{"position":[[454,11],[712,11],[975,11],[1073,11]]},"1693":{"position":[[226,11],[657,11],[1003,11]]},"1695":{"position":[[284,11]]},"1697":{"position":[[677,11]]},"1708":{"position":[[170,11],[291,11]]},"1716":{"position":[[364,11],[663,11],[773,11]]},"1731":{"position":[[988,11],[1109,11],[1442,11],[1540,11],[1693,11],[1783,11],[1873,11]]},"1733":{"position":[[268,11],[396,11],[535,11]]},"1735":{"position":[[898,11],[1073,11],[1184,11],[1303,11],[1535,11],[2019,11],[2215,11],[2589,11]]},"1737":{"position":[[1321,11],[1569,11],[1968,11],[2479,11]]},"1739":{"position":[[261,11],[428,11]]},"1744":{"position":[[849,11]]},"1746":{"position":[[573,11]]},"1749":{"position":[[1225,11]]},"1751":{"position":[[988,11],[1109,11],[1442,11],[1540,11],[1693,11],[1783,11],[1873,11]]},"1754":{"position":[[451,11],[856,11],[1332,11]]},"1756":{"position":[[208,11],[342,11]]},"1758":{"position":[[148,11]]},"1760":{"position":[[244,11]]},"1762":{"position":[[154,11]]},"1764":{"position":[[163,11]]},"1766":{"position":[[193,11],[283,11]]},"1768":{"position":[[148,11]]},"1770":{"position":[[647,11]]},"1772":{"position":[[133,11],[700,11],[894,11]]},"1774":{"position":[[387,11]]},"1778":{"position":[[417,11]]},"1780":{"position":[[225,11]]},"1782":{"position":[[380,11]]},"1784":{"position":[[268,11]]},"1786":{"position":[[198,11]]},"1788":{"position":[[196,11]]},"1792":{"position":[[190,11]]},"1796":{"position":[[201,11]]},"1800":{"position":[[204,11],[301,11],[402,11]]},"1802":{"position":[[158,11]]},"1804":{"position":[[110,11]]},"1806":{"position":[[195,11]]},"1808":{"position":[[318,11]]},"1810":{"position":[[117,11]]},"1812":{"position":[[268,11]]},"1814":{"position":[[382,11]]},"1816":{"position":[[166,11]]},"1818":{"position":[[313,11],[403,11]]},"1820":{"position":[[147,11]]},"1822":{"position":[[243,11]]},"1824":{"position":[[261,11]]},"1826":{"position":[[261,11],[346,11],[431,11]]},"1828":{"position":[[152,11]]},"1830":{"position":[[357,11],[482,11],[960,11]]},"1832":{"position":[[406,11]]},"1834":{"position":[[365,11]]},"1836":{"position":[[314,11]]},"1838":{"position":[[166,11]]},"1840":{"position":[[260,11],[466,11],[680,11],[887,11],[1199,11]]},"1842":{"position":[[403,11]]},"1844":{"position":[[536,11]]},"1846":{"position":[[600,11]]},"1848":{"position":[[590,11]]},"1850":{"position":[[489,11]]},"1852":{"position":[[185,11]]},"1854":{"position":[[295,11],[373,11],[496,11]]},"1856":{"position":[[431,11],[564,11],[832,11]]},"1858":{"position":[[329,11],[409,11],[539,11]]},"1862":{"position":[[125,11]]},"1864":{"position":[[511,11]]},"1866":{"position":[[129,11]]},"1868":{"position":[[380,11],[459,11]]},"1870":{"position":[[143,11],[450,11]]},"1872":{"position":[[158,11]]},"1874":{"position":[[238,11]]},"1878":{"position":[[105,11],[486,11]]},"1880":{"position":[[304,11],[617,11]]},"1882":{"position":[[244,11]]},"1884":{"position":[[147,11]]},"1886":{"position":[[1271,11],[1403,11]]},"1888":{"position":[[150,11]]},"1892":{"position":[[148,11],[231,11],[344,11]]},"1894":{"position":[[324,11]]},"1896":{"position":[[189,11]]},"1898":{"position":[[220,11]]},"1900":{"position":[[270,11]]},"1902":{"position":[[121,11]]},"1904":{"position":[[146,11]]},"1906":{"position":[[123,11]]},"1908":{"position":[[276,11]]},"1910":{"position":[[324,11]]}}}],["fiber.db",{"_index":894,"t":{"930":{"position":[[107,10]]},"932":{"position":[[77,11]]}}}],["fiber.errforbidden",{"_index":2941,"t":{"1404":{"position":[[342,18]]}}}],["fiber.error",{"_index":3762,"t":{"1695":{"position":[[141,12],[431,12],[450,12]]},"1697":{"position":[[824,12],[843,12]]}}}],["fiber.errorhandl",{"_index":3245,"t":{"1540":{"position":[[472,18]]}}}],["fiber.errserviceunavail",{"_index":3759,"t":{"1693":{"position":[[1057,27]]}}}],["fiber.errtooearli",{"_index":2998,"t":{"1422":{"position":[[382,18]]},"1424":{"position":[[737,18]]},"1426":{"position":[[218,18]]}}}],["fiber.errupgraderequir",{"_index":725,"t":{"869":{"position":[[359,24]]}}}],["fiber.gz",{"_index":2684,"t":{"1341":{"position":[[925,11]]}}}],["fiber.handl",{"_index":105,"t":{"747":{"position":[[33,13]]},"757":{"position":[[47,13]]},"769":{"position":[[34,13]]},"781":{"position":[[31,13]]},"791":{"position":[[35,13]]},"821":{"position":[[37,13]]},"833":{"position":[[37,13]]},"857":{"position":[[27,13]]},"1341":{"position":[[3420,14]]},"1349":{"position":[[67,13],[97,13],[163,13],[197,13],[278,13],[327,13],[369,14],[397,13],[463,14],[495,13]]},"1352":{"position":[[189,13],[276,13]]},"1354":{"position":[[192,13]]},"1356":{"position":[[131,13],[210,13]]},"1364":{"position":[[24,13]]},"1368":{"position":[[1034,13]]},"1374":{"position":[[27,13]]},"1384":{"position":[[27,13]]},"1396":{"position":[[27,13]]},"1406":{"position":[[27,13]]},"1420":{"position":[[27,13]]},"1432":{"position":[[58,13]]},"1444":{"position":[[27,13]]},"1456":{"position":[[27,13]]},"1466":{"position":[[11,13]]},"1476":{"position":[[27,13]]},"1486":{"position":[[24,13]]},"1508":{"position":[[27,13]]},"1518":{"position":[[27,13]]},"1532":{"position":[[27,13]]},"1540":{"position":[[279,13]]},"1546":{"position":[[27,13]]},"1552":{"position":[[792,13]]},"1560":{"position":[[27,13]]},"1572":{"position":[[11,13]]},"1582":{"position":[[11,13]]},"1592":{"position":[[96,13],[243,13],[1198,13],[1392,13]]},"1596":{"position":[[479,13],[588,13]]},"1602":{"position":[[27,13]]},"1612":{"position":[[27,13]]},"1622":{"position":[[27,13]]},"1632":{"position":[[27,13]]},"1652":{"position":[[17,14],[65,13]]},"1656":{"position":[[82,13],[333,13]]},"1658":{"position":[[17,14],[79,13],[121,14],[183,13]]},"1870":{"position":[[420,13]]}}}],["fiber.headerauthor",{"_index":3250,"t":{"1542":{"position":[[359,26]]}}}],["fiber.headerxforwardedfor",{"_index":4201,"t":{"1804":{"position":[[329,26]]}}}],["fiber.headerxrequestid",{"_index":3527,"t":{"1628":{"position":[[228,23]]}}}],["fiber.ischild",{"_index":2788,"t":{"1345":{"position":[[194,16]]}}}],["fiber.ismethodsafe(c.method",{"_index":3003,"t":{"1426":{"position":[[177,30]]},"1528":{"position":[[135,30]]}}}],["fiber.map",{"_index":1190,"t":{"1134":{"position":[[1585,10],[1729,10]]},"1144":{"position":[[725,10],[875,10]]},"1148":{"position":[[728,10],[878,10]]},"1152":{"position":[[814,10],[964,10]]},"1154":{"position":[[914,10]]},"1156":{"position":[[396,10]]},"1160":{"position":[[774,10],[924,10]]},"1164":{"position":[[785,10],[935,10]]},"1166":{"position":[[421,10]]},"1168":{"position":[[518,10]]},"1194":{"position":[[776,10],[926,10]]},"1198":{"position":[[951,10],[1101,10]]},"1202":{"position":[[769,10],[919,10]]},"1206":{"position":[[793,10],[943,10]]},"1744":{"position":[[894,10]]},"1746":{"position":[[643,10]]},"1766":{"position":[[331,12]]},"1856":{"position":[[371,10],[499,10],[676,10]]}}}],["fiber.map{\"id",{"_index":4194,"t":{"1800":{"position":[[464,15]]}}}],["fiber.methoddelet",{"_index":2935,"t":{"1402":{"position":[[188,19]]}}}],["fiber.methodget",{"_index":2932,"t":{"1402":{"position":[[118,16]]},"1654":{"position":[[348,15]]}}}],["fiber.methodhead",{"_index":2892,"t":{"1378":{"position":[[1613,17]]},"1380":{"position":[[309,18]]},"1402":{"position":[[153,17]]}}}],["fiber.methodpatch",{"_index":2936,"t":{"1402":{"position":[[208,18]]}}}],["fiber.methodpost",{"_index":2933,"t":{"1402":{"position":[[135,17]]}}}],["fiber.methodput",{"_index":2934,"t":{"1402":{"position":[[171,16]]}}}],["fiber.mimetextplaincharsetutf8",{"_index":3767,"t":{"1695":{"position":[[581,31]]}}}],["fiber.new",{"_index":74,"t":{"737":{"position":[[182,11]]},"739":{"position":[[182,11]]},"741":{"position":[[182,11]]},"751":{"position":[[183,11]]},"761":{"position":[[118,11]]},"763":{"position":[[345,11]]},"773":{"position":[[1215,11]]},"785":{"position":[[137,11]]},"795":{"position":[[141,11]]},"805":{"position":[[154,11]]},"809":{"position":[[433,11]]},"815":{"position":[[824,11]]},"827":{"position":[[355,11]]},"839":{"position":[[728,11]]},"859":{"position":[[184,12]]},"869":{"position":[[120,11]]},"871":{"position":[[133,11]]},"1214":{"position":[[152,11]]},"1218":{"position":[[274,11]]},"1227":{"position":[[142,11],[163,11]]},"1229":{"position":[[165,11],[184,11],[203,11],[224,11]]},"1231":{"position":[[155,11]]},"1233":{"position":[[195,11]]},"1235":{"position":[[128,11]]},"1241":{"position":[[175,11]]},"1243":{"position":[[189,11]]},"1245":{"position":[[174,11]]},"1247":{"position":[[220,11]]},"1339":{"position":[[180,11]]},"1352":{"position":[[158,11]]},"1354":{"position":[[158,11]]},"1358":{"position":[[135,11]]},"1360":{"position":[[135,11]]},"1490":{"position":[[379,11]]},"1492":{"position":[[191,11]]},"1494":{"position":[[194,11]]},"1496":{"position":[[197,11]]},"1498":{"position":[[197,11]]},"1500":{"position":[[338,11]]},"1510":{"position":[[123,11]]},"1534":{"position":[[491,11]]},"1536":{"position":[[951,11]]},"1538":{"position":[[197,11]]},"1614":{"position":[[125,11]]},"1634":{"position":[[124,11]]},"1654":{"position":[[254,11]]},"1660":{"position":[[257,11],[1084,11],[1725,11]]},"1690":{"position":[[284,11],[538,11],[806,11],[1046,11]]},"1693":{"position":[[602,11]]},"1706":{"position":[[88,11],[502,11]]},"1708":{"position":[[140,11]]},"1716":{"position":[[332,11]]},"1741":{"position":[[91,11]]}}}],["fiber.new(fiber.config",{"_index":1186,"t":{"1134":{"position":[[1355,23]]},"1138":{"position":[[389,23],[740,23],[1099,23],[1467,23]]},"1144":{"position":[[602,23]]},"1148":{"position":[[605,23]]},"1152":{"position":[[691,23]]},"1154":{"position":[[781,23]]},"1160":{"position":[[651,23]]},"1164":{"position":[[662,23]]},"1166":{"position":[[263,23]]},"1194":{"position":[[653,23]]},"1198":{"position":[[828,23]]},"1202":{"position":[[646,23]]},"1206":{"position":[[670,23]]},"1212":{"position":[[1464,23]]},"1341":{"position":[[100,23]]},"1345":{"position":[[149,23]]},"1684":{"position":[[145,23]]},"1697":{"position":[[596,23]]},"1700":{"position":[[489,23]]},"1744":{"position":[[344,23]]},"1746":{"position":[[511,23]]},"1804":{"position":[[292,23]]}}}],["fiber.new(fiber.config{view",{"_index":1291,"t":{"1156":{"position":[[324,29]]},"1168":{"position":[[392,29]]}}}],["fiber.newerror",{"_index":3757,"t":{"1693":{"position":[[834,17]]}}}],["fiber.newerror(782",{"_index":2785,"t":{"1343":{"position":[[183,19]]}}}],["fiber.newerror(fiber.statusserviceunavail",{"_index":3761,"t":{"1693":{"position":[[1112,46]]}}}],["fiber.parserconfig",{"_index":4439,"t":{"1886":{"position":[[177,19]]}}}],["fiber.parsertyp",{"_index":4442,"t":{"1886":{"position":[[232,19],[793,17]]}}}],["fiber.parsertype{customtim",{"_index":4455,"t":{"1886":{"position":[[975,31]]}}}],["fiber.request",{"_index":2173,"t":{"1334":{"position":[[247,15]]}}}],["fiber.rout",{"_index":1866,"t":{"1233":{"position":[[235,13]]},"1716":{"position":[[463,12],[560,12]]}}}],["fiber.setparserdecoder(fiber.parserconfig",{"_index":4454,"t":{"1886":{"position":[[895,42]]}}}],["fiber.sqlite3",{"_index":1122,"t":{"1124":{"position":[[260,18]]},"1128":{"position":[[38,18]]}}}],["fiber.stat",{"_index":1778,"t":{"1223":{"position":[[1124,12],[1173,14],[2653,13]]}}}],["fiber.statusforbidden",{"_index":569,"t":{"827":{"position":[[608,22]]}}}],["fiber.statusfound",{"_index":3516,"t":{"1616":{"position":[[570,19]]},"1618":{"position":[[40,18]]}}}],["fiber.statusinternalservererror",{"_index":3763,"t":{"1695":{"position":[[354,31]]},"1697":{"position":[[747,31]]}}}],["fiber.statusok",{"_index":1984,"t":{"1265":{"position":[[775,14]]},"1562":{"position":[[1707,14]]}}}],["fiber.storag",{"_index":2882,"t":{"1378":{"position":[[1095,13]]},"1410":{"position":[[1495,13]]},"1526":{"position":[[1164,13]]},"1552":{"position":[[1159,13]]},"1642":{"position":[[256,13]]}}}],["fiber_storag",{"_index":820,"t":{"886":{"position":[[323,16]]},"888":{"position":[[437,15]]},"890":{"position":[[127,16]]},"930":{"position":[[182,15]]},"932":{"position":[[97,16]]},"946":{"position":[[138,16]]},"958":{"position":[[354,16]]},"960":{"position":[[35,16]]},"1012":{"position":[[313,16],[525,16]]},"1014":{"position":[[572,15]]},"1016":{"position":[[110,16]]},"1026":{"position":[[299,16]]},"1028":{"position":[[671,15]]},"1030":{"position":[[104,16]]},"1040":{"position":[[299,16]]},"1042":{"position":[[686,15]]},"1044":{"position":[[104,16]]},"1068":{"position":[[276,16]]},"1070":{"position":[[739,15]]},"1072":{"position":[[143,16]]},"1124":{"position":[[286,16]]},"1126":{"position":[[130,15]]},"1128":{"position":[[64,16]]}}}],["fiberapp",{"_index":2805,"t":{"1349":{"position":[[529,8]]}}}],["fiberapp(app",{"_index":2806,"t":{"1349":{"position":[[538,12]]}}}],["fiberhandl",{"_index":2801,"t":{"1349":{"position":[[341,12]]}}}],["fiberhandler(h",{"_index":2802,"t":{"1349":{"position":[[354,14]]}}}],["fiberhandlerfunc",{"_index":2803,"t":{"1349":{"position":[[427,16]]}}}],["fiberhandlerfunc(h",{"_index":2804,"t":{"1349":{"position":[[444,18]]}}}],["fiberi18n",{"_index":6,"t":{"725":{"position":[[7,9]]}}}],["fiberi18n.new(&fiberi18n.config",{"_index":157,"t":{"751":{"position":[[204,32]]}}}],["fiberi18n.new(config",{"_index":103,"t":{"747":{"position":[[0,20]]}}}],["fibernewrelic.config",{"_index":172,"t":{"757":{"position":[[25,21]]},"761":{"position":[[209,21]]},"763":{"position":[[436,21]]}}}],["fibernewrelic.new(config",{"_index":171,"t":{"757":{"position":[[0,24]]}}}],["fibersentri",{"_index":7,"t":{"725":{"position":[[17,11]]},"773":{"position":[[0,11],[593,12]]}}}],["fibersentry.gethubfromcontext",{"_index":245,"t":{"773":{"position":[[232,31]]}}}],["fibersentry.gethubfromcontext(c",{"_index":283,"t":{"773":{"position":[[1372,33],[1624,33]]}}}],["fibersentry.new(config",{"_index":211,"t":{"769":{"position":[[0,22]]}}}],["fiberzap",{"_index":8,"t":{"725":{"position":[[29,8]]}}}],["fiberzap.new(config",{"_index":305,"t":{"781":{"position":[[0,19]]}}}],["fiberzerolog",{"_index":9,"t":{"725":{"position":[[38,12]]}}}],["fiberzerolog.new(config",{"_index":341,"t":{"791":{"position":[[0,23]]}}}],["field",{"_index":311,"t":{"783":{"position":[[183,6],[203,6]]},"793":{"position":[[361,6],[381,6]]},"803":{"position":[[546,5]]},"890":{"position":[[23,6]]},"948":{"position":[[67,6],[206,6]]},"1070":{"position":[[139,6]]},"1102":{"position":[[61,6],[200,6]]},"1180":{"position":[[253,6],[299,5]]},"1304":{"position":[[1080,6],[1111,6],[1319,5],[1716,6],[1780,6]]},"1341":{"position":[[248,6]]},"1749":{"position":[[231,6]]},"1760":{"position":[[56,6]]},"1762":{"position":[[50,5]]},"1770":{"position":[[179,5],[221,5],[455,5]]},"1786":{"position":[[246,5]]},"1788":{"position":[[245,5]]},"1792":{"position":[[49,6]]},"1796":{"position":[[50,6]]},"1808":{"position":[[86,5]]},"1816":{"position":[[85,6]]},"1834":{"position":[[169,5],[211,5]]},"1850":{"position":[[170,5],[212,5],[305,5]]},"1864":{"position":[[172,5],[214,5],[315,5]]},"1880":{"position":[[83,5]]},"1884":{"position":[[32,5]]},"1900":{"position":[[22,5],[175,6]]},"1908":{"position":[[75,5]]}}}],["fieldnam",{"_index":1444,"t":{"1180":{"position":[[313,10]]},"1304":{"position":[[957,9],[1294,9],[1330,9]]}}}],["file",{"_index":39,"t":{"733":{"position":[[61,4]]},"735":{"position":[[13,4]]},"749":{"position":[[370,5],[553,5],[707,6]]},"930":{"position":[[265,4]]},"958":{"position":[[216,4]]},"1134":{"position":[[570,5]]},"1140":{"position":[[140,5]]},"1154":{"position":[[402,6]]},"1174":{"position":[[38,4]]},"1188":{"position":[[1302,4],[1389,6],[1867,4],[2273,5],[2436,4]]},"1198":{"position":[[610,5]]},"1218":{"position":[[16,5],[58,6],[102,4],[230,5],[356,5]]},"1223":{"position":[[38,5],[127,5],[285,5],[489,5],[558,5],[569,9],[606,10],[700,4],[717,5],[1099,6],[1359,6],[1875,4],[2010,4],[2241,4]]},"1255":{"position":[[118,5]]},"1259":{"position":[[145,4]]},"1261":{"position":[[160,4]]},"1265":{"position":[[93,5]]},"1304":{"position":[[145,6],[221,6],[536,6],[808,4],[898,6],[1187,4],[1263,4],[1468,5]]},"1341":{"position":[[843,4],[895,4],[914,4]]},"1478":{"position":[[367,5]]},"1480":{"position":[[198,4],[287,4]]},"1482":{"position":[[39,5]]},"1484":{"position":[[58,5]]},"1490":{"position":[[36,5],[247,4],[470,4]]},"1502":{"position":[[262,5],[421,4],[649,4],[814,4],[923,4],[1118,4]]},"1562":{"position":[[1026,4],[1038,5],[1159,5],[1238,5]]},"1678":{"position":[[276,5]]},"1682":{"position":[[387,4],[432,4],[517,4]]},"1782":{"position":[[14,4],[171,4]]},"1786":{"position":[[14,5],[56,4],[231,4],[264,5],[308,4]]},"1824":{"position":[[483,5],[511,5],[589,6],[603,4],[617,5],[753,5]]},"1872":{"position":[[37,4],[288,5],[316,5],[394,6],[408,4],[422,5],[558,5]]},"1874":{"position":[[37,4],[368,5],[396,5],[474,6],[488,4],[502,5],[638,5]]},"1880":{"position":[[14,4],[451,4],[532,4]]},"1896":{"position":[[80,4]]}}}],["file'",{"_index":2113,"t":{"1304":{"position":[[1312,6],[1363,6],[1406,6]]}}}],["file.clos",{"_index":3305,"t":{"1562":{"position":[[1183,12]]}}}],["file.filenam",{"_index":4168,"t":{"1786":{"position":[[376,15]]},"1824":{"position":[[815,16]]},"1872":{"position":[[620,16]]},"1874":{"position":[[712,15]]}}}],["file.header[\"cont",{"_index":4257,"t":{"1824":{"position":[[663,20]]},"1872":{"position":[[468,20]]},"1874":{"position":[[548,20]]}}}],["file.s",{"_index":4256,"t":{"1824":{"position":[[652,10]]},"1872":{"position":[[457,10]]},"1874":{"position":[[537,10]]}}}],["fileb0x",{"_index":1213,"t":{"1138":{"position":[[1176,8],[1549,7]]}}}],["filedata",{"_index":2110,"t":{"1304":{"position":[[1160,9],[1170,8],[1451,8]]}}}],["filedata(formfil",{"_index":2115,"t":{"1304":{"position":[[1638,18]]}}}],["filenam",{"_index":1371,"t":{"1174":{"position":[[523,8],[675,9]]},"1188":{"position":[[1100,9]]},"1782":{"position":[[144,9],[260,8],[326,8]]},"1880":{"position":[[102,9]]}}}],["filename///stat",{"_index":1215,"t":{"1138":{"position":[[1359,33]]}}}],["github.com/casbin/xorm",{"_index":28,"t":{"729":{"position":[[120,22]]},"737":{"position":[[123,23]]},"739":{"position":[[123,23]]},"741":{"position":[[123,23]]}}}],["github.com/geertjohan/go.ric",{"_index":1210,"t":{"1138":{"position":[[969,31]]},"1496":{"position":[[142,31]]}}}],["github.com/getsentry/sentri",{"_index":210,"t":{"767":{"position":[[132,27]]},"773":{"position":[[640,28]]}}}],["github.com/go",{"_index":68,"t":{"737":{"position":[[90,14]]},"739":{"position":[[90,14]]},"741":{"position":[[90,14]]}}}],["github.com/gobuffalo/packr/v2",{"_index":1206,"t":{"1138":{"position":[[613,31]]},"1494":{"position":[[139,31]]}}}],["github.com/goccy/go",{"_index":3784,"t":{"1700":{"position":[[441,20]]}}}],["github.com/gofiber/compress",{"_index":1781,"t":{"1223":{"position":[[1401,30]]}}}],["github.com/gofiber/contrib/casbin",{"_index":24,"t":{"729":{"position":[[48,33]]},"737":{"position":[[52,35]]},"739":{"position":[[52,35]]},"741":{"position":[[52,35]]}}}],["github.com/gofiber/contrib/fiberi18n",{"_index":102,"t":{"745":{"position":[[83,36]]},"751":{"position":[[22,38]]}}}],["github.com/gofiber/contrib/fibernewrel",{"_index":170,"t":{"755":{"position":[[48,40]]},"761":{"position":[[52,42]]},"763":{"position":[[52,42]]}}}],["github.com/gofiber/contrib/fibersentri",{"_index":209,"t":{"767":{"position":[[83,38]]},"773":{"position":[[673,40]]}}}],["github.com/gofiber/contrib/fiberzap",{"_index":303,"t":{"779":{"position":[[83,35]]},"785":{"position":[[58,37]]}}}],["github.com/gofiber/contrib/fiberzerolog",{"_index":339,"t":{"789":{"position":[[83,39]]},"795":{"position":[[52,41]]}}}],["github.com/gofiber/contrib/jwt",{"_index":373,"t":{"799":{"position":[[109,30]]},"805":{"position":[[67,32]]},"809":{"position":[[131,32]]},"815":{"position":[[737,32]]}}}],["github.com/gofiber/contrib/opafib",{"_index":540,"t":{"819":{"position":[[48,35]]},"827":{"position":[[294,37]]}}}],["github.com/gofiber/contrib/otelfib",{"_index":577,"t":{"831":{"position":[[45,36]]},"839":{"position":[[117,38]]}}}],["github.com/gofiber/contrib/paseto",{"_index":677,"t":{"845":{"position":[[83,33]]}}}],["github.com/gofiber/contrib/swagg",{"_index":706,"t":{"859":{"position":[[109,36]]}}}],["github.com/gofiber/contrib/websocket",{"_index":718,"t":{"867":{"position":[[48,36]]},"869":{"position":[[58,38]]}}}],["github.com/gofiber/emb",{"_index":1242,"t":{"1144":{"position":[[464,24]]},"1148":{"position":[[465,24]]},"1152":{"position":[[550,24]]},"1160":{"position":[[513,24]]},"1164":{"position":[[523,24]]},"1194":{"position":[[516,24]]},"1202":{"position":[[509,24]]},"1206":{"position":[[531,24]]}}}],["github.com/gofiber/fiber/v2",{"_index":23,"t":{"729":{"position":[[10,27]]},"737":{"position":[[22,29]]},"739":{"position":[[22,29]]},"741":{"position":[[22,29]]},"745":{"position":[[45,27]]},"751":{"position":[[61,29]]},"755":{"position":[[10,27]]},"761":{"position":[[22,29]]},"763":{"position":[[22,29]]},"767":{"position":[[45,27]]},"773":{"position":[[714,29]]},"779":{"position":[[45,27]]},"785":{"position":[[28,29]]},"789":{"position":[[45,27]]},"795":{"position":[[22,29]]},"799":{"position":[[71,27]]},"805":{"position":[[29,29]]},"809":{"position":[[62,29]]},"815":{"position":[[699,29]]},"819":{"position":[[10,27]]},"827":{"position":[[264,29]]},"839":{"position":[[87,29]]},"845":{"position":[[45,27]]},"859":{"position":[[79,29]]},"867":{"position":[[10,27]]},"869":{"position":[[28,29]]},"1132":{"position":[[49,27]]},"1134":{"position":[[28,29]]},"1138":{"position":[[213,29],[548,29],[904,29],[1268,29]]},"1144":{"position":[[284,29]]},"1148":{"position":[[279,29]]},"1152":{"position":[[361,29]]},"1154":{"position":[[508,29]]},"1160":{"position":[[319,29]]},"1164":{"position":[[340,29]]},"1166":{"position":[[47,29]]},"1168":{"position":[[63,29]]},"1194":{"position":[[336,29]]},"1198":{"position":[[349,29]]},"1202":{"position":[[296,29]]},"1206":{"position":[[315,29]]},"1210":{"position":[[121,27]]},"1214":{"position":[[101,29]]},"1352":{"position":[[39,29]]},"1354":{"position":[[39,29]]},"1356":{"position":[[33,29]]},"1358":{"position":[[33,29]]},"1360":{"position":[[33,29]]},"1366":{"position":[[79,29]]},"1376":{"position":[[79,29]]},"1386":{"position":[[79,29]]},"1398":{"position":[[79,29]]},"1408":{"position":[[79,29]]},"1422":{"position":[[79,29]]},"1434":{"position":[[79,29]]},"1446":{"position":[[79,29]]},"1458":{"position":[[79,29]]},"1468":{"position":[[79,29]]},"1478":{"position":[[79,29]]},"1488":{"position":[[79,29]]},"1490":{"position":[[145,29]]},"1492":{"position":[[57,29]]},"1494":{"position":[[57,29]]},"1496":{"position":[[60,29]]},"1498":{"position":[[57,29]]},"1500":{"position":[[55,29]]},"1510":{"position":[[22,29]]},"1520":{"position":[[79,29]]},"1534":{"position":[[54,29]]},"1536":{"position":[[193,29]]},"1538":{"position":[[54,29]]},"1548":{"position":[[79,29]]},"1562":{"position":[[79,29]]},"1574":{"position":[[79,29]]},"1584":{"position":[[79,29]]},"1594":{"position":[[79,29]]},"1604":{"position":[[79,29]]},"1614":{"position":[[22,29]]},"1624":{"position":[[79,29]]},"1634":{"position":[[22,29]]},"1640":{"position":[[79,29]]},"1654":{"position":[[79,29]]},"1660":{"position":[[79,29]]},"1690":{"position":[[85,29]]},"1693":{"position":[[500,29]]},"1700":{"position":[[404,29]]},"1716":{"position":[[279,29]]},"1728":{"position":[[316,29]]},"1746":{"position":[[196,29]]}}}],["github.com/gofiber/fiber/v2/middleware/adaptor",{"_index":2814,"t":{"1352":{"position":[[69,48]]},"1354":{"position":[[69,48]]},"1356":{"position":[[63,48]]},"1358":{"position":[[63,48]]},"1360":{"position":[[63,48]]}}}],["github.com/gofiber/fiber/v2/middleware/basicauth",{"_index":2841,"t":{"1366":{"position":[[109,50]]}}}],["github.com/gofiber/fiber/v2/middleware/cach",{"_index":2860,"t":{"1376":{"position":[[109,46]]}}}],["github.com/gofiber/fiber/v2/middleware/compress",{"_index":2896,"t":{"1386":{"position":[[109,49]]}}}],["github.com/gofiber/fiber/v2/middleware/cor",{"_index":2907,"t":{"1398":{"position":[[109,45]]}}}],["github.com/gofiber/fiber/v2/middleware/csrf",{"_index":2944,"t":{"1408":{"position":[[109,45]]}}}],["github.com/gofiber/fiber/v2/middleware/earlydata",{"_index":2995,"t":{"1422":{"position":[[109,50]]}}}],["github.com/gofiber/fiber/v2/middleware/encryptcooki",{"_index":3008,"t":{"1434":{"position":[[109,54]]}}}],["github.com/gofiber/fiber/v2/middleware/envvar",{"_index":3031,"t":{"1446":{"position":[[109,47]]}}}],["github.com/gofiber/fiber/v2/middleware/etag",{"_index":3050,"t":{"1458":{"position":[[109,45]]}}}],["github.com/gofiber/fiber/v2/middleware/expvar",{"_index":3070,"t":{"1468":{"position":[[118,47]]}}}],["github.com/gofiber/fiber/v2/middleware/favicon",{"_index":3094,"t":{"1478":{"position":[[109,48]]}}}],["github.com/gofiber/fiber/v2/middleware/filesystem",{"_index":3102,"t":{"1488":{"position":[[109,51]]},"1490":{"position":[[175,51]]},"1492":{"position":[[87,51]]},"1494":{"position":[[87,51]]},"1496":{"position":[[90,51]]},"1498":{"position":[[87,51]]},"1500":{"position":[[85,51]]}}}],["github.com/gofiber/fiber/v2/middleware/helmet",{"_index":3145,"t":{"1510":{"position":[[52,47]]}}}],["github.com/gofiber/fiber/v2/middleware/idempot",{"_index":3180,"t":{"1520":{"position":[[109,52]]}}}],["github.com/gofiber/fiber/v2/middleware/keyauth",{"_index":3200,"t":{"1534":{"position":[[84,48]]},"1536":{"position":[[223,48]]},"1538":{"position":[[84,48]]}}}],["github.com/gofiber/fiber/v2/middleware/limit",{"_index":3256,"t":{"1548":{"position":[[109,48]]}}}],["github.com/gofiber/fiber/v2/middleware/logg",{"_index":3283,"t":{"1562":{"position":[[109,47]]},"1690":{"position":[[115,47]]}}}],["github.com/gofiber/fiber/v2/middleware/monitor",{"_index":3390,"t":{"1574":{"position":[[109,48]]}}}],["github.com/gofiber/fiber/v2/middleware/pprof",{"_index":3427,"t":{"1584":{"position":[[109,46]]}}}],["github.com/gofiber/fiber/v2/middleware/proxi",{"_index":3453,"t":{"1594":{"position":[[109,46]]}}}],["github.com/gofiber/fiber/v2/middleware/recov",{"_index":3494,"t":{"1604":{"position":[[109,48]]},"1693":{"position":[[530,48]]}}}],["github.com/gofiber/fiber/v2/middleware/redirect",{"_index":3502,"t":{"1614":{"position":[[52,49]]}}}],["github.com/gofiber/fiber/v2/middleware/requestid",{"_index":3521,"t":{"1624":{"position":[[109,50]]}}}],["github.com/gofiber/fiber/v2/middleware/rewrit",{"_index":3530,"t":{"1634":{"position":[[52,48]]}}}],["github.com/gofiber/fiber/v2/middleware/sess",{"_index":3538,"t":{"1640":{"position":[[109,48]]}}}],["github.com/gofiber/fiber/v2/middleware/skip",{"_index":3561,"t":{"1654":{"position":[[109,45]]}}}],["github.com/gofiber/fiber/v2/middleware/timeout",{"_index":3577,"t":{"1660":{"position":[[109,48]]}}}],["github.com/gofiber/fiber/v2/util",{"_index":262,"t":{"773":{"position":[[744,35]]}}}],["github.com/gofiber/recip",{"_index":3222,"t":{"1534":{"position":[[1166,26]]}}}],["github.com/gofiber/storage/arangodb",{"_index":814,"t":{"884":{"position":[[234,35]]},"886":{"position":[[35,37]]}}}],["github.com/gofiber/storage/azureblob",{"_index":838,"t":{"898":{"position":[[244,36]]},"900":{"position":[[35,38]]}}}],["github.com/gofiber/storage/badg",{"_index":861,"t":{"912":{"position":[[221,33]]},"914":{"position":[[35,35]]}}}],["github.com/gofiber/storage/bbolt",{"_index":889,"t":{"926":{"position":[[216,32]]},"928":{"position":[[35,34]]}}}],["github.com/gofiber/storage/couchbas",{"_index":906,"t":{"940":{"position":[[227,36]]},"942":{"position":[[35,38]]}}}],["github.com/gofiber/storage/dynamodb",{"_index":925,"t":{"954":{"position":[[225,35]]},"956":{"position":[[35,37]]}}}],["github.com/gofiber/storage/etcd",{"_index":976,"t":{"968":{"position":[[217,31]]},"970":{"position":[[35,33]]}}}],["github.com/gofiber/storage/memcach",{"_index":991,"t":{"984":{"position":[[35,37]]}}}],["github.com/gofiber/storage/memori",{"_index":990,"t":{"982":{"position":[[221,33]]},"996":{"position":[[221,33]]},"998":{"position":[[35,35]]}}}],["github.com/gofiber/storage/mongodb",{"_index":1005,"t":{"1010":{"position":[[223,34]]},"1012":{"position":[[35,36]]}}}],["github.com/gofiber/storage/mssql",{"_index":1015,"t":{"1024":{"position":[[219,32]]},"1026":{"position":[[35,34]]}}}],["github.com/gofiber/storage/mysql",{"_index":1024,"t":{"1038":{"position":[[219,32]]},"1040":{"position":[[35,34]]}}}],["github.com/gofiber/storage/pebbl",{"_index":1032,"t":{"1052":{"position":[[292,33]]},"1054":{"position":[[35,35]]}}}],["github.com/gofiber/storage/postgres/v2",{"_index":1040,"t":{"1066":{"position":[[225,38]]},"1068":{"position":[[35,40]]}}}],["github.com/gofiber/storage/redis/v2",{"_index":1047,"t":{"1080":{"position":[[219,35]]},"1082":{"position":[[35,37]]}}}],["github.com/gofiber/storage/ristretto",{"_index":1096,"t":{"1094":{"position":[[227,36]]},"1096":{"position":[[35,38]]}}}],["github.com/gofiber/storage/s3",{"_index":1113,"t":{"1108":{"position":[[213,29]]},"1110":{"position":[[35,31]]}}}],["github.com/gofiber/storage/sqlite3",{"_index":1119,"t":{"1122":{"position":[[223,34]]},"1124":{"position":[[35,36]]},"1416":{"position":[[83,34]]},"1556":{"position":[[83,34]]},"1648":{"position":[[83,34]]}}}],["github.com/gofiber/template/ace/v2",{"_index":1239,"t":{"1144":{"position":[[314,36]]}}}],["github.com/gofiber/template/amber/v2",{"_index":1248,"t":{"1148":{"position":[[309,38]]}}}],["github.com/gofiber/template/any_template_engine/vx",{"_index":1150,"t":{"1132":{"position":[[87,50]]}}}],["github.com/gofiber/template/django/v3",{"_index":1260,"t":{"1152":{"position":[[391,39]]},"1154":{"position":[[538,39]]}}}],["github.com/gofiber/template/handlebars/v2",{"_index":1309,"t":{"1160":{"position":[[349,43]]}}}],["github.com/gofiber/template/html",{"_index":1200,"t":{"1138":{"position":[[243,34],[578,34],[934,34],[1298,34]]},"1166":{"position":[[77,34]]},"1168":{"position":[[93,34]]}}}],["github.com/gofiber/template/html/v2",{"_index":1157,"t":{"1134":{"position":[[258,37]]},"1164":{"position":[[370,37]]},"1746":{"position":[[226,37]]}}}],["github.com/gofiber/template/jet/v2",{"_index":1639,"t":{"1194":{"position":[[366,36]]}}}],["github.com/gofiber/template/mustach",{"_index":1155,"t":{"1134":{"position":[[159,38]]}}}],["github.com/gofiber/template/mustache/v2",{"_index":1647,"t":{"1198":{"position":[[379,41]]}}}],["github.com/gofiber/template/pug",{"_index":1154,"t":{"1134":{"position":[[122,33]]}}}],["github.com/gofiber/template/pug/v2",{"_index":1663,"t":{"1202":{"position":[[326,36]]}}}],["github.com/gofiber/template/slim/v2",{"_index":1674,"t":{"1206":{"position":[[345,37]]}}}],["github.com/golang",{"_index":374,"t":{"799":{"position":[[150,17]]},"805":{"position":[[100,18]]},"809":{"position":[[92,18]]},"815":{"position":[[770,18]]}}}],["github.com/markbates/pkg",{"_index":1201,"t":{"1138":{"position":[[278,28]]},"1492":{"position":[[139,28]]}}}],["github.com/newrelic/go",{"_index":201,"t":{"763":{"position":[[95,23]]}}}],["github.com/nicksnyder/go",{"_index":153,"t":{"751":{"position":[[91,25]]}}}],["github.com/o1egl/paseto",{"_index":678,"t":{"845":{"position":[[127,23]]}}}],["github.com/rakyll/statik/f",{"_index":3136,"t":{"1500":{"position":[[230,29]]}}}],["github.com/rs/zerolog",{"_index":351,"t":{"795":{"position":[[94,23]]}}}],["github.com/rs/zerolog/log",{"_index":340,"t":{"789":{"position":[[133,25]]}}}],["given",{"_index":769,"t":{"874":{"position":[[312,5],[427,5],[447,5],[660,5]]},"948":{"position":[[93,6],[228,6]]},"1102":{"position":[[87,6],[222,6]]},"1253":{"position":[[37,5]]},"1255":{"position":[[41,5]]},"1259":{"position":[[47,5]]},"1261":{"position":[[62,5]]},"1276":{"position":[[13,5]]},"1278":{"position":[[13,5]]},"1332":{"position":[[101,5]]},"1341":{"position":[[5167,5],[5903,5],[6026,5]]},"1550":{"position":[[353,5]]},"1592":{"position":[[134,5],[167,5],[276,5],[309,5],[428,5],[461,5],[661,5],[708,5],[848,5],[896,5],[1041,5],[1073,5],[1100,5],[1244,5],[1304,5]]},"1656":{"position":[[149,5],[510,5]]},"1772":{"position":[[436,5]]},"1786":{"position":[[70,5]]},"1788":{"position":[[67,5]]},"1824":{"position":[[120,5]]},"1880":{"position":[[28,5]]},"1900":{"position":[[9,5]]}}}],["glob",{"_index":1549,"t":{"1188":{"position":[[1070,4]]}}}],["global",{"_index":250,"t":{"773":{"position":[[379,6]]},"835":{"position":[[253,6],[381,6],[704,6]]},"1134":{"position":[[1169,6]]},"1178":{"position":[[1350,10]]},"1184":{"position":[[51,6]]},"1190":{"position":[[2181,6],[3144,11]]},"1341":{"position":[[6776,6]]},"1594":{"position":[[429,6]]},"1744":{"position":[[406,6],[626,6]]}}}],["go",{"_index":21,"t":{"729":{"position":[[0,2],[38,2],[110,2]]},"743":{"position":[[0,2]]},"745":{"position":[[35,2],[73,2]]},"755":{"position":[[0,2],[38,2]]},"767":{"position":[[35,2],[73,2],[122,2],[160,2]]},"773":{"position":[[669,3]]},"779":{"position":[[35,2],[73,2],[119,2]]},"789":{"position":[[35,2],[73,2],[123,2]]},"799":{"position":[[61,2],[99,2],[140,2]]},"817":{"position":[[52,2]]},"819":{"position":[[0,2],[38,2]]},"831":{"position":[[35,2]]},"845":{"position":[[35,2],[73,2],[117,2]]},"867":{"position":[[0,2],[38,2]]},"884":{"position":[[45,2],[147,2],[227,2]]},"892":{"position":[[79,2]]},"898":{"position":[[50,2],[152,2],[237,2]]},"912":{"position":[[31,2],[133,2],[214,2]]},"920":{"position":[[59,2]]},"926":{"position":[[30,2],[132,2],[209,2]]},"940":{"position":[[34,2],[136,2],[220,2]]},"948":{"position":[[44,2]]},"954":{"position":[[33,2],[135,2],[218,2]]},"968":{"position":[[29,2],[131,2],[210,2]]},"982":{"position":[[31,2],[133,2],[214,2]]},"996":{"position":[[31,2],[133,2],[214,2]]},"1004":{"position":[[45,2]]},"1010":{"position":[[32,2],[134,2],[216,2]]},"1024":{"position":[[30,2],[132,2],[212,2]]},"1032":{"position":[[46,2]]},"1038":{"position":[[30,2],[132,2],[212,2]]},"1052":{"position":[[31,2],[133,2],[285,2]]},"1066":{"position":[[33,2],[135,2],[218,2]]},"1074":{"position":[[29,2]]},"1080":{"position":[[30,2],[132,2],[212,2]]},"1094":{"position":[[34,2],[136,2],[220,2]]},"1102":{"position":[[38,2]]},"1108":{"position":[[27,2],[129,2],[206,2]]},"1122":{"position":[[32,2],[134,2],[216,2]]},"1132":{"position":[[0,2],[39,2],[77,2]]},"1138":{"position":[[447,2],[798,2],[1159,2],[1165,2]]},"1162":{"position":[[21,2]]},"1170":{"position":[[4,2]]},"1174":{"position":[[57,2],[121,2],[281,2]]},"1178":{"position":[[350,2],[539,2],[666,2],[859,2]]},"1180":{"position":[[139,2]]},"1182":{"position":[[20,2],[1198,2],[1295,2]]},"1184":{"position":[[1047,2]]},"1190":{"position":[[1543,2],[1726,2]]},"1208":{"position":[[197,3]]},"1210":{"position":[[35,3],[98,2],[114,2]]},"1214":{"position":[[266,2]]},"1220":{"position":[[45,2],[136,2]]},"1341":{"position":[[4765,2]]},"1488":{"position":[[553,3],[596,2],[668,2]]},"1490":{"position":[[81,2]]},"1498":{"position":[[146,2]]},"1500":{"position":[[211,2]]},"1502":{"position":[[468,2]]},"1638":{"position":[[551,2]]},"1675":{"position":[[112,2]]},"1682":{"position":[[53,2],[598,3],[718,6]]},"1700":{"position":[[359,2]]},"1739":{"position":[[366,2]]},"1746":{"position":[[303,2]]},"1860":{"position":[[92,2]]}}}],["go#hub",{"_index":236,"t":{"773":{"position":[[95,7]]}}}],["go.opentelemetry.io/otel",{"_index":609,"t":{"839":{"position":[[156,26]]}}}],["go.opentelemetry.io/otel/attribut",{"_index":610,"t":{"839":{"position":[[183,36]]}}}],["go.opentelemetry.io/otel/exporters/jaeg",{"_index":613,"t":{"839":{"position":[[283,45]]}}}],["go.opentelemetry.io/otel/exporters/stdout/stdouttrac",{"_index":612,"t":{"839":{"position":[[227,55]]}}}],["go.opentelemetry.io/otel/propag",{"_index":614,"t":{"839":{"position":[[329,38]]}}}],["go.opentelemetry.io/otel/sdk/resourc",{"_index":608,"t":{"839":{"position":[[47,39]]}}}],["go.opentelemetry.io/otel/sdk/trac",{"_index":616,"t":{"839":{"position":[[377,36]]}}}],["go.opentelemetry.io/otel/semconv/v1.4.0",{"_index":618,"t":{"839":{"position":[[422,41]]}}}],["go.opentelemetry.io/otel/trac",{"_index":620,"t":{"839":{"position":[[474,32]]}}}],["go.ric",{"_index":1208,"t":{"1138":{"position":[[809,8]]}}}],["go.uber.org/zap",{"_index":304,"t":{"779":{"position":[[129,15]]},"785":{"position":[[96,17]]}}}],["go1.13.6",{"_index":3669,"t":{"1675":{"position":[[115,8]]}}}],["go:emb",{"_index":1262,"t":{"1154":{"position":[[18,8],[580,10]]},"1166":{"position":[[114,10]]},"1168":{"position":[[130,10]]},"1490":{"position":[[252,10],[310,10]]}}}],["goal",{"_index":882,"t":{"920":{"position":[[121,4]]}}}],["gocb.clust",{"_index":905,"t":{"938":{"position":[[288,13]]}}}],["goccy/go",{"_index":3778,"t":{"1700":{"position":[[279,8]]},"1812":{"position":[[51,8]]}}}],["godoc",{"_index":1356,"t":{"1174":{"position":[[160,7]]}}}],["gofib",{"_index":662,"t":{"841":{"position":[[21,7]]}}}],["gofiber/boilerpl",{"_index":3686,"t":{"1678":{"position":[[379,19]]}}}],["gofiber/templ",{"_index":3723,"t":{"1686":{"position":[[51,16]]}}}],["gofiber/util",{"_index":1718,"t":{"1212":{"position":[[1110,14]]}}}],["gohtml",{"_index":1357,"t":{"1174":{"position":[[182,7]]},"1188":{"position":[[2049,12],[2265,7]]}}}],["gokv",{"_index":941,"t":{"958":{"position":[[1228,5],[1924,5],[2553,4],[2606,4],[2793,4]]}}}],["golang",{"_index":3110,"t":{"1490":{"position":[[47,6]]}}}],["golang.org/x/text/languag",{"_index":155,"t":{"751":{"position":[[131,28]]}}}],["gold",{"_index":3624,"t":{"1663":{"position":[[483,4]]},"1675":{"position":[[80,4]]}}}],["good",{"_index":1167,"t":{"1134":{"position":[[675,4],[794,4]]},"1174":{"position":[[388,4]]},"1665":{"position":[[248,4]]}}}],["googl",{"_index":3881,"t":{"1735":{"position":[[1903,6]]}}}],["google.com",{"_index":4200,"t":{"1802":{"position":[[194,12]]}}}],["gorm",{"_index":63,"t":{"735":{"position":[[0,4]]},"1678":{"position":[[465,4]]}}}],["gorm.config",{"_index":3601,"t":{"1660":{"position":[[1801,15]]}}}],["gorm.open(postgres.open(\"postgres://localhost/foodb",{"_index":3600,"t":{"1660":{"position":[[1746,54]]}}}],["gosublim",{"_index":1360,"t":{"1174":{"position":[[236,9]]}}}],["go’",{"_index":1386,"t":{"1178":{"position":[[21,4]]}}}],["gracefulli",{"_index":1878,"t":{"1237":{"position":[[9,10]]}}}],["grame",{"_index":4216,"t":{"1812":{"position":[[337,8],[430,8],[484,8],[560,8]]},"1814":{"position":[[451,8],[516,8],[598,8]]},"1910":{"position":[[393,8]]}}}],["graph",{"_index":3677,"t":{"1675":{"position":[[671,5]]}}}],["great",{"_index":3996,"t":{"1749":{"position":[[15,5]]}}}],["greatli",{"_index":3904,"t":{"1735":{"position":[[2853,7]]}}}],["greedi",{"_index":3860,"t":{"1735":{"position":[[470,6],[786,7],[1025,6],[1259,6]]}}}],["green",{"_index":3375,"t":{"1568":{"position":[[929,7]]}}}],["greet",{"_index":1281,"t":{"1154":{"position":[[925,11]]},"1156":{"position":[[704,11]]},"1358":{"position":[[165,6]]}}}],["greet(c",{"_index":2832,"t":{"1356":{"position":[[366,7]]},"1358":{"position":[[254,7]]}}}],["greet(w",{"_index":2820,"t":{"1352":{"position":[[466,7]]}}}],["greetwithhttpreq",{"_index":2835,"t":{"1360":{"position":[[165,17]]}}}],["greetwithhttpreq(c",{"_index":2836,"t":{"1360":{"position":[[265,18]]}}}],["group",{"_index":1844,"t":{"1231":{"position":[[8,5],[35,6]]},"1704":{"position":[[21,5],[82,6],[147,5],[302,5]]},"1706":{"position":[[14,6],[436,5]]},"1708":{"position":[[0,5]]},"1716":{"position":[[169,7]]},"1718":{"position":[[52,5],[90,5],[110,5]]},"1720":{"position":[[56,5],[87,5],[107,5],[167,7]]},"1728":{"position":[[195,5],[825,6]]},"1741":{"position":[[63,6],[472,8]]}}}],["group(prefix",{"_index":1845,"t":{"1231":{"position":[[76,12]]}}}],["gt",{"_index":1533,"t":{"1186":{"position":[[417,2]]}}}],["guid",{"_index":3882,"t":{"1735":{"position":[[1921,6]]},"1737":{"position":[[429,4]]},"1741":{"position":[[481,5]]},"1774":{"position":[[76,5]]}}}],["guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/howitworks.provisionedthroughput",{"_index":952,"t":{"958":{"position":[[1486,96],[2182,96]]}}}],["guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/limits.md#capac",{"_index":954,"t":{"958":{"position":[[1655,81],[2351,81]]}}}],["gzip",{"_index":2893,"t":{"1382":{"position":[[71,5]]},"1754":{"position":[[1254,5]]},"1880":{"position":[[150,8]]}}}],["h",{"_index":463,"t":{"807":{"position":[[357,1]]},"1574":{"position":[[605,1]]},"1660":{"position":[[269,1],[1096,1]]},"1728":{"position":[[226,2]]},"1749":{"position":[[1657,1]]},"1770":{"position":[[865,1],[978,1],[1102,1]]},"1864":{"position":[[789,1],[805,1],[820,1]]}}}],["h1",{"_index":1231,"t":{"1144":{"position":[[54,2],[132,2],[170,2]]},"1148":{"position":[[51,2],[124,2],[164,2]]},"1152":{"position":[[60,6],[73,7]]},"1180":{"position":[[747,4],[794,5]]},"1184":{"position":[[542,7]]},"1194":{"position":[[48,6],[61,7]]},"1202":{"position":[[46,2]]},"1206":{"position":[[53,2]]}}}],["h1>a",{"_index":1389,"t":{"1178":{"position":[[218,6],[426,5]]}}}],["h1>filler",{"_index":1579,"t":{"1188":{"position":[[2672,10]]}}}],["h1>hello",{"_index":1465,"t":{"1182":{"position":[[308,10],[858,10]]}}}],["h1>{{.title}}{{.}}{{index",{"_index":1505,"t":{"1184":{"position":[[519,11]]}}}],["h1>{{title}}footerheaderfeatur",{"_index":1590,"t":{"1190":{"position":[[497,11],[595,11],[1875,11],[1973,11]]}}}],["handi",{"_index":3699,"t":{"1682":{"position":[[9,5]]},"1697":{"position":[[192,5]]}}}],["handl",{"_index":145,"t":{"749":{"position":[[822,7]]},"853":{"position":[[45,7]]},"1182":{"position":[[760,6]]},"1341":{"position":[[3185,7]]},"1464":{"position":[[202,7]]},"1484":{"position":[[157,6]]},"1580":{"position":[[235,7]]},"1600":{"position":[[87,7]]},"1606":{"position":[[223,8],[340,6]]},"1654":{"position":[[605,6]]},"1656":{"position":[[679,6]]},"1667":{"position":[[6,7],[86,7]]},"1669":{"position":[[6,7],[86,7]]},"1671":{"position":[[6,7],[86,7]]},"1673":{"position":[[6,7],[88,7]]},"1680":{"position":[[148,9],[351,6]]},"1684":{"position":[[346,8],[381,9]]},"1693":{"position":[[328,6]]},"1697":{"position":[[1247,9]]}}}],["handlebar",{"_index":1143,"t":{"1130":{"position":[[272,10]]},"1136":{"position":[[103,10]]},"1158":{"position":[[0,10]]},"1686":{"position":[[97,10]]},"1746":{"position":[[115,10]]}}}],["handlebars.new(\"./view",{"_index":1310,"t":{"1160":{"position":[[442,25]]}}}],["handler",{"_index":88,"t":{"737":{"position":[[580,7],[769,7]]},"739":{"position":[[546,7]]},"741":{"position":[[523,7]]},"797":{"position":[[115,8]]},"843":{"position":[[124,8]]},"1156":{"position":[[370,7]]},"1188":{"position":[[2112,8],[2379,7]]},"1190":{"position":[[4200,7],[4262,7],[4796,7],[5134,7]]},"1212":{"position":[[277,8],[355,8],[571,7],[661,8],[850,7]]},"1216":{"position":[[217,7]]},"1218":{"position":[[87,7]]},"1223":{"position":[[2015,9],[2467,7]]},"1225":{"position":[[111,8],[120,11],[173,8],[182,11],[235,8],[244,11],[296,8],[305,11],[360,8],[369,11],[425,8],[434,11],[490,8],[499,11],[553,8],[562,11],[616,8],[625,11],[733,8],[742,11],[901,8],[910,11],[952,7],[1068,7],[1751,8]]},"1231":{"position":[[97,8],[106,11],[192,8],[232,8],[268,8],[309,8],[357,8],[393,8],[434,8]]},"1239":{"position":[[45,9]]},"1241":{"position":[[104,7],[209,8],[240,8]]},"1243":{"position":[[118,7],[214,8]]},"1245":{"position":[[103,7]]},"1251":{"position":[[0,7],[27,7],[125,9]]},"1341":{"position":[[2540,9],[3455,8],[4084,8],[6006,7]]},"1347":{"position":[[23,8],[54,9]]},"1362":{"position":[[104,7]]},"1378":{"position":[[1183,7]]},"1418":{"position":[[1011,8]]},"1464":{"position":[[188,9]]},"1480":{"position":[[318,7]]},"1580":{"position":[[221,9]]},"1594":{"position":[[1061,7]]},"1650":{"position":[[47,7]]},"1656":{"position":[[119,7]]},"1660":{"position":[[1817,7]]},"1675":{"position":[[223,9]]},"1680":{"position":[[84,8],[204,7]]},"1684":{"position":[[30,8]]},"1693":{"position":[[86,8],[139,7],[392,7]]},"1695":{"position":[[24,7],[243,7]]},"1697":{"position":[[15,7],[118,7],[172,7],[646,7],[1136,7]]},"1706":{"position":[[207,8],[248,8],[335,8],[376,8],[472,8],[597,8],[638,8],[713,8],[754,8]]},"1708":{"position":[[6,8],[152,7],[395,8],[436,8]]},"1712":{"position":[[3,8]]},"1731":{"position":[[111,8],[120,11],[173,8],[182,11],[235,8],[244,11],[296,8],[305,11],[360,8],[369,11],[425,8],[434,11],[490,8],[499,11],[553,8],[562,11],[616,8],[625,11],[733,8],[742,11],[901,8],[910,11],[952,7],[1068,7],[1751,8]]},"1735":{"position":[[2993,8],[3065,8],[3176,8],[3289,8]]},"1737":{"position":[[320,8]]},"1741":{"position":[[210,8],[251,8],[338,8],[379,8]]},"1751":{"position":[[111,8],[120,11],[173,8],[182,11],[235,8],[244,11],[296,8],[305,11],[360,8],[369,11],[425,8],[434,11],[490,8],[499,11],[553,8],[562,11],[616,8],[625,11],[733,8],[742,11],[901,8],[910,11],[952,7],[1068,7],[1751,8]]},"1768":{"position":[[293,8]]},"1770":{"position":[[1360,8]]},"1780":{"position":[[380,8]]},"1788":{"position":[[360,8]]},"1792":{"position":[[372,8]]},"1796":{"position":[[439,8]]},"1802":{"position":[[257,8]]},"1826":{"position":[[187,8]]},"1828":{"position":[[263,8]]},"1830":{"position":[[1089,8]]},"1842":{"position":[[562,8]]},"1868":{"position":[[229,8]]},"1870":{"position":[[250,7]]}}}],["handler(c",{"_index":1702,"t":{"1212":{"position":[[503,9],[782,9]]}}}],["handler(f",{"_index":2818,"t":{"1352":{"position":[[389,9]]}}}],["handler(w",{"_index":1567,"t":{"1188":{"position":[[2162,9]]},"1190":{"position":[[4357,9]]}}}],["handler).name(\"bar",{"_index":1872,"t":{"1233":{"position":[[334,20]]}}}],["handler).name(\"delet",{"_index":1908,"t":{"1243":{"position":[[347,23]]}}}],["handler).name(\"foo",{"_index":1868,"t":{"1233":{"position":[[267,20]]}}}],["handler).name(\"hom",{"_index":1904,"t":{"1243":{"position":[[257,21]]}}}],["handler).name(\"index",{"_index":1919,"t":{"1245":{"position":[[199,22]]}}}],["handler).name(\"test",{"_index":1912,"t":{"1243":{"position":[[421,21]]}}}],["handler).name(\"tracert",{"_index":1906,"t":{"1243":{"position":[[300,24]]}}}],["handlerscount",{"_index":1891,"t":{"1239":{"position":[[81,15]]}}}],["handshak",{"_index":750,"t":{"871":{"position":[[36,9]]}}}],["hang",{"_index":3726,"t":{"1688":{"position":[[46,4]]}}}],["happi",{"_index":3777,"t":{"1700":{"position":[[193,5]]}}}],["hardwar",{"_index":3617,"t":{"1663":{"position":[[317,9]]}}}],["hash",{"_index":2699,"t":{"1341":{"position":[[1932,7]]}}}],["hashedapikey",{"_index":3206,"t":{"1534":{"position":[[245,12]]},"1536":{"position":[[511,12]]},"1538":{"position":[[313,12]]}}}],["hashedkey",{"_index":3208,"t":{"1534":{"position":[[291,9],[378,13]]},"1536":{"position":[[557,9],[644,13]]},"1538":{"position":[[359,9],[446,13]]}}}],["haspermiss",{"_index":1597,"t":{"1190":{"position":[[713,13],[821,13],[945,13],[1161,13],[1315,13],[1338,14],[2492,13],[2579,16],[2829,15],[3012,13],[3099,13],[3585,13],[3727,16],[3896,13],[4115,13],[4572,16],[4904,13],[5008,13]]}}}],["haspermission(featur",{"_index":1587,"t":{"1190":{"position":[[236,21]]}}}],["hat",{"_index":4350,"t":{"1850":{"position":[[669,4]]},"1864":{"position":[[695,4]]}}}],["have",{"_index":1625,"t":{"1190":{"position":[[4220,6],[5070,6]]}}}],["hb",{"_index":1311,"t":{"1160":{"position":[[468,7],[603,8]]}}}],["head",{"_index":1238,"t":{"1144":{"position":[[225,4]]},"1148":{"position":[[219,4]]},"1152":{"position":[[265,6],[292,7]]},"1160":{"position":[[223,6],[250,7]]},"1164":{"position":[[244,6],[271,7]]},"1188":{"position":[[2497,6],[2627,7]]},"1194":{"position":[[235,6],[263,7]]},"1198":{"position":[[251,6],[278,7]]},"1202":{"position":[[206,4]]},"1206":{"position":[[224,4]]},"1241":{"position":[[440,7]]},"1243":{"position":[[779,7],[842,7],[908,7]]},"1296":{"position":[[514,4]]},"1316":{"position":[[54,5]]},"1336":{"position":[[98,6]]},"1404":{"position":[[252,5]]},"1418":{"position":[[1114,5]]},"1576":{"position":[[475,4]]}}}],["head(path",{"_index":1800,"t":{"1225":{"position":[[155,9]]},"1731":{"position":[[155,9]]},"1751":{"position":[[155,9]]}}}],["head(url",{"_index":1989,"t":{"1270":{"position":[[138,8]]}}}],["head>back/static/image.png",{"_index":3119,"t":{"1490":{"position":[[522,35]]}}}],["http:///static/static/image.png",{"_index":3121,"t":{"1490":{"position":[[617,42]]}}}],["http://api.example.com/users?page=2",{"_index":4231,"t":{"1816":{"position":[[195,38],[300,38]]}}}],["http://api.example.com/users?page=5",{"_index":4232,"t":{"1816":{"position":[[242,38],[354,38]]}}}],["http://example.com",{"_index":4290,"t":{"1838":{"position":[[127,18]]}}}],["http://example.com/?field1=value1&field1=value2&field2=value3",{"_index":4298,"t":{"1840":{"position":[[383,61]]}}}],["http://example.com/?list_a=1&list_a=2&list_a=3&list_b[]=1&list_b[]=2&list_b[]=3&list_c=1,2,3",{"_index":4303,"t":{"1840":{"position":[[567,92]]}}}],["http://example.com/?name=alex&amount=32.23&id",{"_index":4333,"t":{"1846":{"position":[[533,46]]}}}],["http://example.com/?name=alex&wanna_cake=2&id",{"_index":4339,"t":{"1848":{"position":[[523,46]]}}}],["http://example.com/?name=alex&want_pizza=false&id",{"_index":4291,"t":{"1840":{"position":[[189,50]]},"1844":{"position":[[465,50]]}}}],["http://example.com/?order=desc&brand=nik",{"_index":4320,"t":{"1842":{"position":[[341,41]]}}}],["http://example.com/hello",{"_index":4129,"t":{"1774":{"position":[[337,24]]}}}],["http://example.com/search?q=someth",{"_index":4265,"t":{"1828":{"position":[[94,37]]}}}],["http://example.com/user/111",{"_index":4282,"t":{"1834":{"position":[[309,27]]}}}],["http://example.com/user/123",{"_index":4275,"t":{"1832":{"position":[[350,27]]}}}],["http://example.com/user/fenni",{"_index":4063,"t":{"1756":{"position":[[148,29]]},"1830":{"position":[[297,29]]}}}],["http://example.com/user/fenny/123",{"_index":4066,"t":{"1756":{"position":[[282,33]]},"1830":{"position":[[422,33]]}}}],["http://example.com/users?sort=desc",{"_index":4288,"t":{"1836":{"position":[[254,34]]}}}],["http://google.com",{"_index":1974,"t":{"1265":{"position":[[460,17],[615,20]]},"1594":{"position":[[1439,20]]},"1760":{"position":[[281,20],[352,17],[425,18]]}}}],["http://google.com/search",{"_index":4199,"t":{"1802":{"position":[[113,24]]}}}],["http://localhost",{"_index":3475,"t":{"1594":{"position":[[2016,19]]},"1760":{"position":[[302,19],[334,17],[407,17]]}}}],["http://localhost:3000",{"_index":1729,"t":{"1214":{"position":[[293,21]]},"1398":{"position":[[589,21],[717,22]]},"1510":{"position":[[268,21]]},"1534":{"position":[[856,21],[968,21],[1070,21]]},"1536":{"position":[[1451,21]]},"1538":{"position":[[820,21]]},"1594":{"position":[[1726,24]]},"1737":{"position":[[2601,22]]},"1770":{"position":[[1238,21]]},"1864":{"position":[[763,24]]}}}],["http://localhost:3000/1",{"_index":3971,"t":{"1737":{"position":[[1443,23],[1711,23]]}}}],["http://localhost:3000/12",{"_index":3970,"t":{"1737":{"position":[[1397,24]]}}}],["http://localhost:3000/120000",{"_index":3973,"t":{"1737":{"position":[[1645,28]]}}}],["http://localhost:3000/125",{"_index":3982,"t":{"1737":{"position":[[2044,25]]}}}],["http://localhost:3000/2022",{"_index":3985,"t":{"1737":{"position":[[2166,26]]}}}],["http://localhost:3000/250",{"_index":3975,"t":{"1737":{"position":[[1767,25]]}}}],["http://localhost:3000/42",{"_index":3989,"t":{"1737":{"position":[[2555,24]]}}}],["http://localhost:3000/7.0",{"_index":3990,"t":{"1737":{"position":[[2642,25]]}}}],["http://localhost:3000/?name=john&pass=do",{"_index":4107,"t":{"1770":{"position":[[1276,43]]}}}],["http://localhost:3000/?name=john&pass=doe&products=shoe,hat",{"_index":4351,"t":{"1850":{"position":[[737,61]]}}}],["http://localhost:3000/allow",{"_index":3244,"t":{"1538":{"position":[[952,29]]}}}],["http://localhost:3000/api/user/john",{"_index":1746,"t":{"1216":{"position":[[1218,35]]}}}],["http://localhost:3000/auth2",{"_index":3239,"t":{"1536":{"position":[[1749,27]]}}}],["http://localhost:3000/authent",{"_index":3237,"t":{"1536":{"position":[[1585,35]]}}}],["http://localhost:3000/bodi",{"_index":4473,"t":{"1886":{"position":[[1574,26]]}}}],["http://localhost:3000/css/style.css",{"_index":1768,"t":{"1223":{"position":[[435,35]]}}}],["http://localhost:3000/flights/lax",{"_index":3889,"t":{"1735":{"position":[[2140,33]]}}}],["http://localhost:3000/foo/1000",{"_index":3592,"t":{"1660":{"position":[[861,32]]}}}],["http://localhost:3000/foo/3000",{"_index":3593,"t":{"1660":{"position":[[952,32]]}}}],["http://localhost:3000/hello.html",{"_index":1766,"t":{"1223":{"position":[[355,32]]}}}],["http://localhost:3000/john",{"_index":1743,"t":{"1216":{"position":[[991,26]]}}}],["http://localhost:3000/js/jquery.j",{"_index":1767,"t":{"1223":{"position":[[394,34]]}}}],["http://localhost:3000/login",{"_index":458,"t":{"807":{"position":[[88,27]]}}}],["http://localhost:3000/metr",{"_index":3395,"t":{"1574":{"position":[[634,29]]}}}],["http://localhost:3000/old",{"_index":3508,"t":{"1614":{"position":[[476,25]]},"1634":{"position":[[456,25]]}}}],["http://localhost:3000/old/hello",{"_index":3509,"t":{"1614":{"position":[[507,31]]},"1634":{"position":[[487,31]]}}}],["http://localhost:3000/plantae/prunus.persica",{"_index":3883,"t":{"1735":{"position":[[1931,44]]}}}],["http://localhost:3000/query?title=title&body=body&date=2021",{"_index":4474,"t":{"1886":{"position":[[1616,60]]}}}],["http://localhost:3000/shop/product/color:blue/size:x",{"_index":3897,"t":{"1735":{"position":[[2479,53]]}}}],["http://localhost:3000/static/css/style.css",{"_index":1773,"t":{"1223":{"position":[[968,42]]}}}],["http://localhost:3000/static/hello.html",{"_index":1771,"t":{"1223":{"position":[[874,39]]}}}],["http://localhost:3000/static/js/jquery.j",{"_index":1772,"t":{"1223":{"position":[[920,41]]}}}],["http://localhost:3000/test",{"_index":3984,"t":{"1737":{"position":[[2104,26]]}}}],["http://localhost:3001",{"_index":3478,"t":{"1594":{"position":[[2276,24],[2459,24],[2875,24]]}}}],["http://localhost:3002",{"_index":3479,"t":{"1594":{"position":[[2301,24],[2484,24],[2900,24]]}}}],["http://localhost:3003",{"_index":3480,"t":{"1594":{"position":[[2326,24],[2509,24],[2925,24]]}}}],["http://localhost:8000",{"_index":937,"t":{"958":{"position":[[614,24]]},"1594":{"position":[[820,25]]}}}],["http://localhost:8080",{"_index":4084,"t":{"1768":{"position":[[92,21]]}}}],["http://localhost:8080/css/style.css",{"_index":1759,"t":{"1218":{"position":[[466,35]]}}}],["http://localhost:8080/hello",{"_index":4401,"t":{"1870":{"position":[[84,27]]}}}],["http://localhost:8080/hello%20world",{"_index":1739,"t":{"1216":{"position":[[787,35]]}}}],["http://localhost:8080/hello.html",{"_index":1757,"t":{"1218":{"position":[[398,32]]}}}],["http://localhost:8080/js/jquery.j",{"_index":1758,"t":{"1218":{"position":[[431,34]]}}}],["http://localhost:8080/register/us",{"_index":4030,"t":{"1749":{"position":[[1743,35]]}}}],["http://www.foobar.com",{"_index":3489,"t":{"1596":{"position":[[332,22]]}}}],["httpapi",{"_index":3177,"t":{"1516":{"position":[[293,7]]}}}],["httperror",{"_index":2783,"t":{"1343":{"position":[[23,9]]}}}],["httphandler",{"_index":2792,"t":{"1349":{"position":[[27,11]]}}}],["httphandler(h",{"_index":2793,"t":{"1349":{"position":[[39,13]]}}}],["httphandlerfunc",{"_index":2795,"t":{"1349":{"position":[[111,15]]}}}],["httphandlerfunc(h",{"_index":2796,"t":{"1349":{"position":[[127,17]]}}}],["httphandlerfunc(mw",{"_index":2799,"t":{"1349":{"position":[[226,18]]}}}],["httpmiddlewar",{"_index":2798,"t":{"1349":{"position":[[211,14]]}}}],["httponli",{"_index":4119,"t":{"1772":{"position":[[822,9],[1027,9]]},"1778":{"position":[[280,8]]}}}],["httpreq",{"_index":2837,"t":{"1360":{"position":[[304,8]]}}}],["httpreq.url.str",{"_index":2840,"t":{"1360":{"position":[[420,21]]}}}],["https://blog.trailofbits.com/2019/03/25/what",{"_index":2989,"t":{"1418":{"position":[[733,44]]}}}],["https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/chart.bundle.min.j",{"_index":3415,"t":{"1576":{"position":[[857,66]]}}}],["https://datatracker.ietf.org/doc/html/draft",{"_index":3175,"t":{"1516":{"position":[[244,43]]}}}],["https://datatracker.ietf.org/doc/html/rfc8446#sect",{"_index":2988,"t":{"1418":{"position":[[677,53]]}}}],["https://docs.aws.amazon.com/general/latest/gr/rande.html#ddb_region",{"_index":928,"t":{"958":{"position":[[89,68]]}}}],["https://example.com",{"_index":2175,"t":{"1334":{"position":[[290,21]]},"1764":{"position":[[198,19]]}}}],["https://example.com/page#chapt",{"_index":4079,"t":{"1764":{"position":[[108,32]]}}}],["https://expressjs.com/en/4x/api.html#req.fresh",{"_index":4171,"t":{"1790":{"position":[[0,46]]}}}],["https://expressjs.com/en/4x/api.html#req.stal",{"_index":4478,"t":{"1890":{"position":[[0,46]]}}}],["https://fonts.googleapis.com/css2?family=roboto:wght@400;900&display=swap",{"_index":3412,"t":{"1576":{"position":[[656,73]]}}}],["https://foobar.com",{"_index":3488,"t":{"1596":{"position":[[311,20]]}}}],["https://github.com/awsdocs/amazon",{"_index":950,"t":{"958":{"position":[[1433,33],[1602,33],[2129,33],[2298,33]]}}}],["https://github.com/geertjohan/go.ric",{"_index":1209,"t":{"1138":{"position":[[838,37]]},"1496":{"position":[[0,37]]}}}],["https://github.com/go",{"_index":4002,"t":{"1749":{"position":[[556,21]]}}}],["https://github.com/gobuffalo/packr",{"_index":1205,"t":{"1138":{"position":[[485,34]]},"1494":{"position":[[0,34]]}}}],["https://github.com/gofiber/storag",{"_index":765,"t":{"874":{"position":[[207,34]]}}}],["https://github.com/markbates/pkg",{"_index":1199,"t":{"1138":{"position":[[150,34]]},"1492":{"position":[[0,34]]}}}],["https://github.com/rakyll/statik",{"_index":3131,"t":{"1500":{"position":[[0,32]]}}}],["https://github.com/smallnest/go",{"_index":3664,"t":{"1675":{"position":[[3,31]]}}}],["https://github.com/unnoted/fileb0x",{"_index":1214,"t":{"1138":{"position":[[1205,34]]},"1498":{"position":[[0,34]]}}}],["https://godoc.org/github.com/getsentry/sentri",{"_index":235,"t":{"773":{"position":[[48,46]]}}}],["https://gofiber.io",{"_index":2911,"t":{"1398":{"position":[[369,20]]}}}],["https://gofiber.net",{"_index":2912,"t":{"1398":{"position":[[390,21]]}}}],["https://hub.docker.com/r/amazon/dynamodb",{"_index":938,"t":{"958":{"position":[[646,40]]}}}],["https://i.imgur.com/\"+c.params(\"id\")+\".gif",{"_index":3467,"t":{"1594":{"position":[[1119,44]]}}}],["https://pkg.go.dev/github.com/fasthttp/websocket?tab=doc#pkg",{"_index":737,"t":{"869":{"position":[[666,60]]}}}],["https://programming.guide/go/format",{"_index":3323,"t":{"1564":{"position":[[662,35]]}}}],["https://storageaccountname.blob.core.windows.net",{"_index":844,"t":{"902":{"position":[[140,50]]}}}],["https://www.websocket.org/echo.html",{"_index":749,"t":{"869":{"position":[[1072,35]]}}}],["httptest.newrequest(\"get",{"_index":1978,"t":{"1265":{"position":[[588,26]]}}}],["hub",{"_index":282,"t":{"773":{"position":[[1365,3],[1406,3],[1617,3],[1658,3]]}}}],["hub.capturemessage(\"us",{"_index":295,"t":{"773":{"position":[[1767,24]]}}}],["hub.scope().settag(\"somerandomtag",{"_index":284,"t":{"773":{"position":[[1419,35]]}}}],["hub.withscope(func(scop",{"_index":291,"t":{"773":{"position":[[1671,24]]}}}],["hyphen",{"_index":3876,"t":{"1735":{"position":[[1613,6]]}}}],["i.",{"_index":996,"t":{"986":{"position":[[52,4]]},"1225":{"position":[[1292,4]]},"1418":{"position":[[965,4]]},"1596":{"position":[[305,5]]},"1731":{"position":[[1292,4]]},"1751":{"position":[[1292,4]]}}}],["i18n",{"_index":99,"t":{"743":{"position":[[3,4]]},"749":{"position":[[142,4]]}}}],["i18n.unmarshalfunc",{"_index":138,"t":{"749":{"position":[[648,18]]}}}],["i18n/v2/i18n",{"_index":154,"t":{"751":{"position":[[117,13]]}}}],["icon",{"_index":3087,"t":{"1474":{"position":[[80,4]]}}}],["id",{"_index":634,"t":{"839":{"position":[[896,2],[950,3],[984,3],[1596,2],[1704,5],[1730,2]]},"1190":{"position":[[200,2],[1141,2],[1257,3],[4465,3],[4827,2]]},"1336":{"position":[[10502,3],[11548,3]]},"1562":{"position":[[656,2]]},"1624":{"position":[[444,3]]},"1626":{"position":[[259,2],[298,3],[503,2]]},"1638":{"position":[[445,4]]},"1642":{"position":[[363,2],[1322,2]]},"1796":{"position":[[248,4]]},"1832":{"position":[[426,3]]},"1834":{"position":[[401,3],[453,7]]}}}],["idjohndoe/myembeddedfil",{"_index":3129,"t":{"1498":{"position":[[149,24]]}}}],["module>/statik",{"_index":3135,"t":{"1500":{"position":[[214,15]]}}}],["mongo.databas",{"_index":1004,"t":{"1008":{"position":[[288,15]]}}}],["mongodb",{"_index":794,"t":{"876":{"position":[[72,7]]},"1004":{"position":[[2,7]]},"1010":{"position":[[0,7],[192,7]]}}}],["mongodb.new",{"_index":1006,"t":{"1012":{"position":[[171,13]]}}}],["mongodb.new(mongodb.config",{"_index":1007,"t":{"1012":{"position":[[222,27],[408,27]]}}}],["mongodb/mongo",{"_index":1003,"t":{"1004":{"position":[[31,13]]}}}],["mongodb://user:password@127.0.0.1:27017",{"_index":1011,"t":{"1012":{"position":[[451,42]]}}}],["monitor",{"_index":3387,"t":{"1570":{"position":[[0,7],[85,7],[101,7]]},"1576":{"position":[[120,8],[263,10]]}}}],["monitor.new",{"_index":3392,"t":{"1574":{"position":[[321,14]]}}}],["monitor.new(monitor.config{titl",{"_index":3394,"t":{"1574":{"position":[[488,33]]}}}],["month",{"_index":1450,"t":{"1180":{"position":[[788,5]]}}}],["more",{"_index":766,"t":{"874":{"position":[[246,4]]},"1136":{"position":[[8,4],[76,4]]},"1184":{"position":[[416,4]]},"1186":{"position":[[535,4]]},"1212":{"position":[[1512,4]]},"1220":{"position":[[4,4]]},"1223":{"position":[[1044,4]]},"1229":{"position":[[39,4]]},"1341":{"position":[[4812,4],[5056,4]]},"1454":{"position":[[46,4]]},"1534":{"position":[[1130,4]]},"1552":{"position":[[1399,4]]},"1562":{"position":[[725,4]]},"1630":{"position":[[140,4]]},"1680":{"position":[[113,4]]},"1682":{"position":[[146,4]]},"1686":{"position":[[139,4]]},"1690":{"position":[[1275,4]]},"1737":{"position":[[647,4],[857,4],[952,4],[1022,4]]},"1741":{"position":[[437,4]]},"1768":{"position":[[386,7]]},"1770":{"position":[[1453,7]]},"1774":{"position":[[218,4]]},"1776":{"position":[[275,4]]},"1780":{"position":[[473,7]]},"1788":{"position":[[453,7]]},"1792":{"position":[[465,7]]},"1796":{"position":[[532,7]]},"1802":{"position":[[350,7]]},"1828":{"position":[[356,7]]},"1830":{"position":[[1182,7]]},"1842":{"position":[[655,7]]},"1854":{"position":[[462,4]]}}}],["mount",{"_index":1824,"t":{"1227":{"position":[[8,5],[43,6]]},"1229":{"position":[[81,8],[435,8],[497,5],[536,8]]},"1341":{"position":[[3435,7]]},"1728":{"position":[[49,8],[71,5],[108,7],[201,9],[649,5],[728,5],[795,5],[848,5]]},"1739":{"position":[[509,6]]}}}],["mount(prefix",{"_index":1825,"t":{"1227":{"position":[[74,12]]}}}],["mountpath",{"_index":1830,"t":{"1229":{"position":[[4,9],[116,11],[467,10]]}}}],["move",{"_index":221,"t":{"771":{"position":[[255,6]]}}}],["ms",{"_index":3580,"t":{"1660":{"position":[[360,5],[1187,5]]},"1665":{"position":[[448,3],[524,3]]},"1667":{"position":[[74,3],[155,3]]},"1669":{"position":[[74,3],[154,3]]},"1671":{"position":[[74,3],[153,3]]},"1673":{"position":[[76,3],[156,3]]},"1675":{"position":[[178,3],[185,3],[193,3],[201,2],[540,2]]},"1682":{"position":[[659,2]]}}}],["msg",{"_index":740,"t":{"869":{"position":[[746,3],[782,4],[880,4],[913,5]]}}}],["mssql",{"_index":795,"t":{"876":{"position":[[80,5]]},"1018":{"position":[[2,5]]},"1024":{"position":[[0,5],[190,5]]}}}],["mssql.new",{"_index":1016,"t":{"1026":{"position":[[169,11]]}}}],["mssql.new(mssql.config",{"_index":1017,"t":{"1026":{"position":[[218,23],[444,23]]}}}],["mssqldb",{"_index":1013,"t":{"1018":{"position":[[42,8]]}}}],["mstimeout",{"_index":1971,"t":{"1265":{"position":[[296,9]]}}}],["mt",{"_index":739,"t":{"869":{"position":[[739,2],[778,3]]}}}],["multi",{"_index":2755,"t":{"1341":{"position":[[5491,5],[5519,5]]},"1596":{"position":[[870,5],[901,5]]}}}],["multipart",{"_index":2091,"t":{"1304":{"position":[[20,9],[185,9],[632,9],[833,9],[1201,9],[1248,9],[1478,9]]},"1341":{"position":[[1558,9],[1649,9]]},"1824":{"position":[[10,9],[294,9]]},"1872":{"position":[[27,9],[191,9]]},"1874":{"position":[[27,9],[271,9]]}}}],["multipart.filehead",{"_index":4164,"t":{"1786":{"position":[[138,23]]},"1824":{"position":[[549,23]]},"1872":{"position":[[87,22],[354,23]]},"1874":{"position":[[126,22],[434,23]]}}}],["multipart.form",{"_index":4249,"t":{"1824":{"position":[[207,17],[364,15]]},"1872":{"position":[[261,15]]},"1874":{"position":[[341,15]]}}}],["multipart/form",{"_index":2092,"t":{"1304":{"position":[[81,14]]},"1336":{"position":[[807,15]]},"1770":{"position":[[306,14]]}}}],["multipartform",{"_index":2090,"t":{"1304":{"position":[[0,13],[165,13],[580,14]]},"1786":{"position":[[0,13]]},"1824":{"position":[[64,16],[191,15]]}}}],["multipartform(arg",{"_index":2095,"t":{"1304":{"position":[[356,18]]}}}],["multipartform(nil",{"_index":2100,"t":{"1304":{"position":[[752,19],[1133,19],[1840,18]]}}}],["multipl",{"_index":1133,"t":{"1130":{"position":[[47,8]]},"1174":{"position":[[608,8]]},"1180":{"position":[[378,8]]},"1216":{"position":[[208,8]]},"1223":{"position":[[500,8]]},"1225":{"position":[[1625,9],[1742,8]]},"1278":{"position":[[38,8]]},"1284":{"position":[[68,8]]},"1304":{"position":[[889,8]]},"1341":{"position":[[4756,8]]},"1516":{"position":[[200,8]]},"1584":{"position":[[369,8]]},"1590":{"position":[[64,8]]},"1592":{"position":[[41,8]]},"1731":{"position":[[1625,9],[1742,8]]},"1737":{"position":[[1250,8],[1502,8]]},"1746":{"position":[[66,8]]},"1751":{"position":[[1625,9],[1742,8]]},"1772":{"position":[[259,8]]},"1900":{"position":[[166,8]]}}}],["mustach",{"_index":1145,"t":{"1130":{"position":[[287,8]]},"1136":{"position":[[118,8]]},"1140":{"position":[[146,8]]},"1196":{"position":[[0,8]]},"1198":{"position":[[494,12],[762,13],[776,12]]},"1686":{"position":[[117,8]]},"1746":{"position":[[130,8]]}}}],["mustache.new(\"./view",{"_index":1648,"t":{"1198":{"position":[[470,23]]}}}],["mustache.newfilesystem(http.dir(\"./view",{"_index":1653,"t":{"1198":{"position":[[719,42]]}}}],["my_database.db",{"_index":892,"t":{"928":{"position":[[252,17]]}}}],["mycustomapi",{"_index":199,"t":{"761":{"position":[[293,14]]}}}],["mycustomstorag",{"_index":3262,"t":{"1548":{"position":[[636,18]]}}}],["myembeddedfiles.http",{"_index":3130,"t":{"1498":{"position":[[268,21]]}}}],["myfil",{"_index":3937,"t":{"1737":{"position":[[628,6]]}}}],["mymiddlewar",{"_index":4409,"t":{"1870":{"position":[[405,14]]}}}],["myservic",{"_index":3393,"t":{"1574":{"position":[[443,10],[522,10]]}}}],["mysql",{"_index":796,"t":{"876":{"position":[[86,5]]},"884":{"position":[[205,5]]},"920":{"position":[[268,6]]},"1032":{"position":[[2,5]]},"1038":{"position":[[0,5],[190,5]]}}}],["mysql.new",{"_index":1025,"t":{"1040":{"position":[[169,11]]}}}],["mysql.new(mysql.config",{"_index":1026,"t":{"1040":{"position":[[218,23],[424,23],[691,23]]}}}],["n",{"_index":1286,"t":{"1156":{"position":[[128,5]]},"1716":{"position":[[615,5]]},"1902":{"position":[[74,2]]},"1904":{"position":[[99,2]]},"1906":{"position":[[76,2]]}}}],["name",{"_index":167,"t":{"751":{"position":[[658,7]]},"759":{"position":[[122,4]]},"805":{"position":[[697,7],[1251,4],[1316,5]]},"809":{"position":[[1227,7],[1817,4],[1882,5]]},"827":{"position":[[136,7]]},"835":{"position":[[979,4]]},"839":{"position":[[917,4],[988,5],[994,6]]},"888":{"position":[[29,4],[335,4],[405,4]]},"902":{"position":[[40,5],[74,5]]},"916":{"position":[[33,4]]},"930":{"position":[[150,4]]},"944":{"position":[[251,4]]},"958":{"position":[[314,4]]},"1014":{"position":[[170,4],[470,4],[540,4]]},"1028":{"position":[[212,4],[511,4],[574,4],[639,4]]},"1042":{"position":[[290,4],[589,4],[654,4]]},"1056":{"position":[[33,4]]},"1070":{"position":[[343,4],[642,4],[707,4]]},"1082":{"position":[[488,6]]},"1084":{"position":[[29,4],[848,4]]},"1112":{"position":[[76,4]]},"1126":{"position":[[33,4],[98,4]]},"1134":{"position":[[891,4],[1260,4]]},"1162":{"position":[[315,4]]},"1174":{"position":[[0,6]]},"1176":{"position":[[319,5],[366,5],[428,4]]},"1178":{"position":[[880,4]]},"1180":{"position":[[305,4]]},"1182":{"position":[[324,7],[332,9],[378,5],[403,4],[443,4],[874,7],[882,9],[995,4],[1329,4],[1376,4],[1427,4],[1746,4],[1903,9]]},"1184":{"position":[[365,5],[465,5],[579,4]]},"1186":{"position":[[149,5]]},"1188":{"position":[[363,5],[787,4],[858,7],[990,4],[1307,6],[1332,5],[1367,5],[1447,4],[1536,4],[1746,4]]},"1190":{"position":[[2319,5]]},"1218":{"position":[[251,5]]},"1223":{"position":[[306,5],[1857,4]]},"1233":{"position":[[142,4],[301,6],[368,6]]},"1243":{"position":[[24,4],[571,7],[638,7],[707,7],[787,7],[850,7],[916,7],[1003,7],[1095,7]]},"1245":{"position":[[30,5],[356,7]]},"1247":{"position":[[443,7]]},"1304":{"position":[[1087,6],[1325,4],[1350,4],[1370,4],[1375,4]]},"1312":{"position":[[93,5]]},"1339":{"position":[[30,5]]},"1341":{"position":[[329,4],[848,4],[919,5],[1298,5],[2531,4]]},"1349":{"position":[[0,4]]},"1410":{"position":[[570,4]]},"1430":{"position":[[105,6]]},"1434":{"position":[[940,5]]},"1440":{"position":[[106,5]]},"1526":{"position":[[402,4]]},"1640":{"position":[[466,4],[864,6]]},"1642":{"position":[[1354,4]]},"1682":{"position":[[444,6]]},"1716":{"position":[[57,7],[150,6],[889,5],[919,5]]},"1720":{"position":[[62,7],[160,6]]},"1735":{"position":[[62,5],[75,5],[254,4],[611,5],[3028,6],[3057,7]]},"1744":{"position":[[591,4]]},"1749":{"position":[[427,4]]},"1756":{"position":[[245,9]]},"1770":{"position":[[461,5],[526,4]]},"1772":{"position":[[221,5],[279,6],[744,5],[938,5]]},"1778":{"position":[[79,4]]},"1786":{"position":[[40,5]]},"1788":{"position":[[36,5],[251,7]]},"1800":{"position":[[18,5]]},"1812":{"position":[[220,4],[331,5],[420,9],[476,7],[550,9]]},"1814":{"position":[[151,4],[203,5],[338,4],[445,5]]},"1850":{"position":[[311,5],[376,4]]},"1856":{"position":[[510,7],[687,7]]},"1864":{"position":[[321,5],[386,4],[791,6]]},"1870":{"position":[[258,6]]},"1894":{"position":[[51,4]]},"1910":{"position":[[255,4],[387,5]]}}}],["name\":\"sam",{"_index":1409,"t":{"1178":{"position":[[1004,14]]}}}],["name(\"addus",{"_index":3821,"t":{"1716":{"position":[[719,18]]}}}],["name(\"destroyus",{"_index":3823,"t":{"1716":{"position":[[829,22]]}}}],["name(\"hom",{"_index":4188,"t":{"1800":{"position":[[257,15]]}}}],["name(\"index",{"_index":1925,"t":{"1247":{"position":[[311,16]]},"1716":{"position":[[420,16]]}}}],["name(\"us",{"_index":4377,"t":{"1856":{"position":[[890,15]]}}}],["name(\"user.show",{"_index":4191,"t":{"1800":{"position":[[357,20]]}}}],["name(nam",{"_index":1901,"t":{"1243":{"position":[[80,9]]}}}],["name1",{"_index":2108,"t":{"1304":{"position":[[1118,7],[1723,7]]}}}],["name2",{"_index":1469,"t":{"1182":{"position":[[551,6]]},"1304":{"position":[[1787,7]]}}}],["namegramefiller",{"_index":1580,"t":{"1188":{"position":[[2695,9]]}}}],["p>hello",{"_index":1341,"t":{"1168":{"position":[[713,9]]},"1784":{"position":[[409,9]]}}}],["p>here",{"_index":1544,"t":{"1188":{"position":[[308,7]]}}}],["p>some",{"_index":1592,"t":{"1190":{"position":[[516,7],[1894,7]]}}}],["p>to",{"_index":1595,"t":{"1190":{"position":[[614,5],[1992,5]]}}}],["packag",{"_index":64,"t":{"737":{"position":[[0,7]]},"739":{"position":[[0,7]]},"741":{"position":[[0,7]]},"751":{"position":[[0,7]]},"761":{"position":[[0,7]]},"763":{"position":[[0,7]]},"773":{"position":[[606,7]]},"785":{"position":[[0,7]]},"795":{"position":[[0,7]]},"805":{"position":[[0,7]]},"809":{"position":[[0,7]]},"815":{"position":[[671,7]]},"827":{"position":[[242,7],[379,7]]},"839":{"position":[[0,7]]},"859":{"position":[[22,7]]},"869":{"position":[[0,7]]},"886":{"position":[[19,8]]},"900":{"position":[[19,8]]},"914":{"position":[[19,8]]},"928":{"position":[[19,8]]},"942":{"position":[[19,8]]},"956":{"position":[[19,8]]},"970":{"position":[[19,8]]},"984":{"position":[[19,8]]},"998":{"position":[[19,8]]},"1012":{"position":[[19,8]]},"1026":{"position":[[19,8]]},"1040":{"position":[[19,8]]},"1054":{"position":[[19,8]]},"1068":{"position":[[19,8]]},"1082":{"position":[[19,8]]},"1096":{"position":[[19,8]]},"1110":{"position":[[19,8]]},"1124":{"position":[[19,8]]},"1130":{"position":[[5,7]]},"1134":{"position":[[0,7]]},"1138":{"position":[[185,7],[520,7],[876,7],[1240,7],[1351,7]]},"1144":{"position":[[256,7]]},"1148":{"position":[[251,7]]},"1152":{"position":[[333,7]]},"1154":{"position":[[461,7]]},"1160":{"position":[[291,7]]},"1164":{"position":[[312,7]]},"1166":{"position":[[0,7]]},"1168":{"position":[[0,7]]},"1170":{"position":[[42,8],[89,7],[170,7],[269,8]]},"1178":{"position":[[40,7],[556,7],[1079,7]]},"1184":{"position":[[13,7]]},"1186":{"position":[[31,7]]},"1188":{"position":[[1893,7]]},"1190":{"position":[[1743,8]]},"1194":{"position":[[308,7]]},"1198":{"position":[[321,7]]},"1202":{"position":[[268,7]]},"1206":{"position":[[287,7]]},"1214":{"position":[[81,7]]},"1225":{"position":[[1206,8]]},"1352":{"position":[[0,7]]},"1354":{"position":[[0,7]]},"1356":{"position":[[0,7]]},"1358":{"position":[[0,7]]},"1360":{"position":[[0,7]]},"1366":{"position":[[22,7]]},"1376":{"position":[[22,7]]},"1386":{"position":[[22,7]]},"1398":{"position":[[22,7]]},"1404":{"position":[[695,7]]},"1408":{"position":[[22,7]]},"1416":{"position":[[41,8]]},"1422":{"position":[[22,7]]},"1434":{"position":[[22,7]]},"1446":{"position":[[22,7]]},"1458":{"position":[[22,7]]},"1464":{"position":[[109,7]]},"1468":{"position":[[22,7]]},"1478":{"position":[[22,7]]},"1488":{"position":[[22,7]]},"1490":{"position":[[90,7]]},"1492":{"position":[[35,7]]},"1494":{"position":[[35,7]]},"1496":{"position":[[38,7]]},"1498":{"position":[[35,7]]},"1500":{"position":[[33,7]]},"1510":{"position":[[0,7]]},"1520":{"position":[[22,7]]},"1534":{"position":[[0,7]]},"1536":{"position":[[139,7]]},"1538":{"position":[[0,7]]},"1544":{"position":[[252,7]]},"1548":{"position":[[22,7]]},"1556":{"position":[[41,8]]},"1562":{"position":[[22,7]]},"1574":{"position":[[22,7]]},"1580":{"position":[[142,7]]},"1584":{"position":[[22,7]]},"1594":{"position":[[22,7]]},"1604":{"position":[[22,7]]},"1614":{"position":[[0,7]]},"1624":{"position":[[22,7]]},"1634":{"position":[[0,7]]},"1636":{"position":[[68,7]]},"1640":{"position":[[22,7]]},"1648":{"position":[[41,8]]},"1654":{"position":[[22,7]]},"1660":{"position":[[22,7]]},"1690":{"position":[[57,7]]},"1693":{"position":[[472,7]]},"1700":{"position":[[384,7]]},"1716":{"position":[[251,7]]},"1728":{"position":[[288,7]]},"1731":{"position":[[1206,8]]},"1746":{"position":[[31,7],[168,7]]},"1749":{"position":[[42,7]]},"1751":{"position":[[1206,8]]},"1812":{"position":[[65,8]]},"1910":{"position":[[72,8]]}}}],["packr",{"_index":1204,"t":{"1138":{"position":[[458,6],[789,5]]}}}],["packr.new(\"asset",{"_index":3126,"t":{"1494":{"position":[[265,17]]}}}],["page",{"_index":1730,"t":{"1214":{"position":[[355,5]]},"1574":{"position":[[462,5],[541,8]]},"1576":{"position":[[77,4]]},"1682":{"position":[[313,4]]},"1684":{"position":[[320,4]]},"1697":{"position":[[415,4],[494,5],[917,4]]},"1749":{"position":[[123,4]]},"1800":{"position":[[250,6]]},"1858":{"position":[[375,6]]}}}],["pair",{"_index":473,"t":{"809":{"position":[[309,4],[498,4]]}}}],["panic",{"_index":3492,"t":{"1600":{"position":[[48,6]]},"1604":{"position":[[296,5]]},"1693":{"position":[[335,6],[372,5],[689,5]]}}}],["panic(\"i",{"_index":288,"t":{"773":{"position":[[1556,8]]}}}],["panic(\"i'm",{"_index":3497,"t":{"1604":{"position":[[375,10]]}}}],["panic(\"thi",{"_index":3756,"t":{"1693":{"position":[[677,11]]}}}],["panic(err",{"_index":1564,"t":{"1188":{"position":[[2078,10]]},"1274":{"position":[[183,10]]},"1500":{"position":[[318,10]]},"1640":{"position":[[440,10],[661,10],[805,10]]}}}],["panick",{"_index":275,"t":{"773":{"position":[[1071,8]]},"775":{"position":[[286,8]]}}}],["paragraph:@127.0.0.1:6379/:@localhost:6379/://::a",{"_index":1394,"t":{"1178":{"position":[[373,20]]}}}],["template.html(html",{"_index":1427,"t":{"1178":{"position":[[1606,19]]}}}],["template.must(template.parsefiles(\"templatenam",{"_index":1452,"t":{"1180":{"position":[[833,50]]}}}],["template.must(template.parseglob(\"*.gohtml",{"_index":1508,"t":{"1184":{"position":[[628,45]]}}}],["template.new(\"hello.gohtml\").funcs(template.funcmap",{"_index":1425,"t":{"1178":{"position":[[1500,52]]},"1190":{"position":[[2526,52],[3674,52]]}}}],["template.parse(filenam",{"_index":1370,"t":{"1174":{"position":[[473,24]]}}}],["template.parsefiles(fil",{"_index":1551,"t":{"1188":{"position":[[1240,29]]}}}],["template.parsefiles(filenam",{"_index":1373,"t":{"1174":{"position":[[628,30]]}}}],["template.parseglob(layoutdir",{"_index":1563,"t":{"1188":{"position":[[2018,28]]}}}],["template.parseglob(pattern",{"_index":1374,"t":{"1174":{"position":[[711,27]]},"1188":{"position":[[1140,26]]}}}],["template.templ",{"_index":1451,"t":{"1180":{"position":[[808,18]]},"1188":{"position":[[1954,18]]}}}],["templatedata",{"_index":165,"t":{"751":{"position":[[625,13]]}}}],["templatenam",{"_index":1454,"t":{"1180":{"position":[[922,15]]},"1188":{"position":[[1499,16],[1620,15]]}}}],["templatesgo",{"_index":1573,"t":{"1188":{"position":[[2504,9]]}}}],["title>maintitle:@tcp(:)/: that is used \"header:Authorization\" AuthScheme string AuthScheme to be used in the Authorization header. The default value (\"Bearer\") will only be used in conjuction with the default TokenLookup value. \"Bearer\" KeyFunc func() jwt.Keyfunc KeyFunc defines a user-defined function that supplies the public key for a token validation. jwtKeyFunc JWKSetURLs []string A slice of unique JSON Web Key (JWK) Set URLs to used to parse JWTs. nil","s":"Config","u":"/contrib/jwt/","h":"#config","p":796},{"i":805,"t":"package main import ( \"time\" \"github.com/gofiber/fiber/v2\" jwtware \"github.com/gofiber/contrib/jwt\" \"github.com/golang-jwt/jwt/v5\" ) func main() { app := fiber.New() // Login route app.Post(\"/login\", login) // Unauthenticated route app.Get(\"/\", accessible) // JWT Middleware app.Use(jwtware.New(jwtware.Config{ SigningKey: jwtware.SigningKey{Key: []byte(\"secret\")}, })) // Restricted Routes app.Get(\"/restricted\", restricted) app.Listen(\":3000\") } func login(c *fiber.Ctx) error { user := c.FormValue(\"user\") pass := c.FormValue(\"pass\") // Throws Unauthorized error if user != \"john\" || pass != \"doe\" { return c.SendStatus(fiber.StatusUnauthorized) } // Create the Claims claims := jwt.MapClaims{ \"name\": \"John Doe\", \"admin\": true, \"exp\": time.Now().Add(time.Hour * 72).Unix(), } // Create token token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) // Generate encoded token and send it as response. t, err := token.SignedString([]byte(\"secret\")) if err != nil { return c.SendStatus(fiber.StatusInternalServerError) } return c.JSON(fiber.Map{\"token\": t}) } func accessible(c *fiber.Ctx) error { return c.SendString(\"Accessible\") } func restricted(c *fiber.Ctx) error { user := c.Locals(\"user\").(*jwt.Token) claims := user.Claims.(jwt.MapClaims) name := claims[\"name\"].(string) return c.SendString(\"Welcome \" + name) }","s":"HS256 Example","u":"/contrib/jwt/","h":"#hs256-example","p":796},{"i":807,"t":"Login using username and password to retrieve a token. curl --data \"user=john&pass=doe\" http://localhost:3000/login Response { \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NjE5NTcxMzZ9.RB3arc4-OyzASAaUhC2W3ReWaXAt_z2Fd3BN4aWTgEY\" } Request a restricted resource using the token in Authorization request header. curl localhost:3000/restricted -H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NjE5NTcxMzZ9.RB3arc4-OyzASAaUhC2W3ReWaXAt_z2Fd3BN4aWTgEY\" Response Welcome John Doe","s":"HS256 Test","u":"/contrib/jwt/","h":"#hs256-test","p":796},{"i":809,"t":"package main import ( \"crypto/rand\" \"crypto/rsa\" \"log\" \"time\" \"github.com/gofiber/fiber/v2\" \"github.com/golang-jwt/jwt/v5\" jwtware \"github.com/gofiber/contrib/jwt\" ) var ( // Obviously, this is just a test example. Do not do this in production. // In production, you would have the private key and public key pair generated // in advance. NEVER add a private key to any GitHub repo. privateKey *rsa.PrivateKey ) func main() { app := fiber.New() // Just as a demo, generate a new private/public key pair on each run. See note above. rng := rand.Reader var err error privateKey, err = rsa.GenerateKey(rng, 2048) if err != nil { log.Fatalf(\"rsa.GenerateKey: %v\", err) } // Login route app.Post(\"/login\", login) // Unauthenticated route app.Get(\"/\", accessible) // JWT Middleware app.Use(jwtware.New(jwtware.Config{ SigningKey: jwtware.SigningKey{ JWTAlg: jwtware.RS256, Key: privateKey.Public(), }, })) // Restricted Routes app.Get(\"/restricted\", restricted) app.Listen(\":3000\") } func login(c *fiber.Ctx) error { user := c.FormValue(\"user\") pass := c.FormValue(\"pass\") // Throws Unauthorized error if user != \"john\" || pass != \"doe\" { return c.SendStatus(fiber.StatusUnauthorized) } // Create the Claims claims := jwt.MapClaims{ \"name\": \"John Doe\", \"admin\": true, \"exp\": time.Now().Add(time.Hour * 72).Unix(), } // Create token token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) // Generate encoded token and send it as response. t, err := token.SignedString(privateKey) if err != nil { log.Printf(\"token.SignedString: %v\", err) return c.SendStatus(fiber.StatusInternalServerError) } return c.JSON(fiber.Map{\"token\": t}) } func accessible(c *fiber.Ctx) error { return c.SendString(\"Accessible\") } func restricted(c *fiber.Ctx) error { user := c.Locals(\"user\").(*jwt.Token) claims := user.Claims.(jwt.MapClaims) name := claims[\"name\"].(string) return c.SendString(\"Welcome \" + name) }","s":"RS256 Example","u":"/contrib/jwt/","h":"#rs256-example","p":796},{"i":811,"t":"The RS256 is actually identical to the HS256 test above.","s":"RS256 Test","u":"/contrib/jwt/","h":"#rs256-test","p":796},{"i":813,"t":"The tests are identical to basic JWT tests above, with exception that JWKSetURLs to valid public keys collection in JSON Web Key (JWK) Set format should be supplied. See RFC 7517.","s":"JWK Set Test","u":"/contrib/jwt/","h":"#jwk-set-test","p":796},{"i":815,"t":"KeyFunc defines a user-defined function that supplies the public key for a token validation. The function shall take care of verifying the signing algorithm and selecting the proper key. A user-defined KeyFunc can be useful if tokens are issued by an external party. When a user-defined KeyFunc is provided, SigningKey, SigningKeys, and SigningMethod are ignored. This is one of the three options to provide a token validation key. The order of precedence is a user-defined KeyFunc, SigningKeys and SigningKey. Required if neither SigningKeys nor SigningKey is provided. Default to an internal implementation verifying the signing algorithm and selecting the proper key. package main import ( \"fmt\" \"github.com/gofiber/fiber/v2\" jwtware \"github.com/gofiber/contrib/jwt\" \"github.com/golang-jwt/jwt/v5\" ) func main() { app := fiber.New() app.Use(jwtware.New(jwtware.Config{ KeyFunc: customKeyFunc(), })) app.Get(\"/ok\", func(c *fiber.Ctx) error { return c.SendString(\"OK\") }) } func customKeyFunc() jwt.Keyfunc { return func(t *jwt.Token) (interface{}, error) { // Always check the signing method if t.Method.Alg() != jwtware.HS256 { return nil, fmt.Errorf(\"Unexpected jwt signing method=%v\", t.Header[\"alg\"]) } // TODO custom implementation of loading signing key like from a database signingKey := \"secret\" return []byte(signingKey), nil } }","s":"Custom KeyFunc example","u":"/contrib/jwt/","h":"#custom-keyfunc-example","p":796},{"i":817,"t":"Open Policy Agent support for Fiber. Note: Requires Go 1.18 and above","s":"Opafiber","u":"/contrib/opafiber/","h":"","p":816},{"i":819,"t":"go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/opafiber","s":"Install","u":"/contrib/opafiber/","h":"#install","p":816},{"i":821,"t":"opafiber.New(config opafiber.Config) fiber.Handler","s":"Signature","u":"/contrib/opafiber/","h":"#signature","p":816},{"i":823,"t":"Property Type Description Default RegoQuery string Required - Rego query - RegoPolicy io.Reader Required - Rego policy - IncludeQueryString bool Include query string as input to rego policy false DeniedStatusCode int Http status code to return when policy denies request 400 DeniedResponseMessage string Http response body text to return when policy denies request \"\" IncludeHeaders []string Include headers as input to rego policy - InputCreationMethod InputCreationFunc Use your own function to provide input for OPA func defaultInput(ctx *fiber.Ctx) (map[string]interface{}, error)","s":"Config","u":"/contrib/opafiber/","h":"#config","p":816},{"i":825,"t":"type InputCreationFunc func(c *fiber.Ctx) (map[string]interface{}, error)","s":"Types","u":"/contrib/opafiber/","h":"#types","p":816},{"i":827,"t":"OPA Fiber middleware sends the following example data to the policy engine as input: { \"method\": \"GET\", \"path\": \"/somePath\", \"query\": { \"name\": [\"John Doe\"] }, \"headers\": { \"Accept\": \"application/json\", \"Content-Type\": \"application/json\" } } package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/opafiber\" ) func main() { app := fiber.New() module := ` package example.authz default allow := false allow { input.method == \"GET\" } ` cfg := opafiber.Config{ RegoQuery: \"data.example.authz.allow\", RegoPolicy: bytes.NewBufferString(module), IncludeQueryString: true, DeniedStatusCode: fiber.StatusForbidden, DeniedResponseMessage: \"status forbidden\", IncludeHeaders: []string{\"Authorization\"}, InputCreationMethod: func (ctx *fiber.Ctx) (map[string]interface{}, error) { return map[string]interface{}{ \"method\": ctx.Method(), \"path\": ctx.Path(), }, nil }, } app.Use(opafiber.New(cfg)) app.Get(\"/\", func(ctx *fiber.Ctx) error { return ctx.SendStatus(200) }) app.Listen(\":8080\") }","s":"Usage","u":"/contrib/opafiber/","h":"#usage","p":816},{"i":829,"t":"OpenTelemetry support for Fiber. Can be found on OpenTelemetry Registry.","s":"Otelfiber","u":"/contrib/otelfiber/","h":"","p":828},{"i":831,"t":"This middleware supports Fiber v2. go get -u github.com/gofiber/contrib/otelfiber","s":"Install","u":"/contrib/otelfiber/","h":"#install","p":828},{"i":833,"t":"otelfiber.Middleware(opts ...Option) fiber.Handler","s":"Signature","u":"/contrib/otelfiber/","h":"#signature","p":828},{"i":835,"t":"Property Type Description Default Next func(*fiber.Ctx) bool Define a function to skip this middleware when returned trueRequired - Rego quer nil TracerProvider oteltrace.TracerProvider Specifies a tracer provider to use for creating a tracer nil - the global tracer provider is used MeterProvider otelmetric.MeterProvider Specifies a meter provider to use for reporting nil - the global meter provider is used Port *int Specifies the value to use when setting the net.host.port attribute on metrics/spans Required: If not default (80 for http, 443 for https) Propagators propagation.TextMapPropagator Specifies propagators to use for extracting information from the HTTP requests If none are specified, global ones will be used ServerName *string specifies the value to use when setting the http.server_name attribute on metrics/spans - SpanNameFormatter func(*fiber.Ctx) string Takes a function that will be called on every request and the returned string will become the Span Name default formatter returns the route pathRaw","s":"Config","u":"/contrib/otelfiber/","h":"#config","p":828},{"i":837,"t":"Please refer to example","s":"Usage","u":"/contrib/otelfiber/","h":"#usage","p":828},{"i":839,"t":"package main import ( \"context\" \"errors\" \"log\" \"go.opentelemetry.io/otel/sdk/resource\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/otelfiber\" \"go.opentelemetry.io/otel\" \"go.opentelemetry.io/otel/attribute\" stdout \"go.opentelemetry.io/otel/exporters/stdout/stdouttrace\" //\"go.opentelemetry.io/otel/exporters/jaeger\" \"go.opentelemetry.io/otel/propagation\" sdktrace \"go.opentelemetry.io/otel/sdk/trace\" semconv \"go.opentelemetry.io/otel/semconv/v1.4.0\" oteltrace \"go.opentelemetry.io/otel/trace\" ) var tracer = otel.Tracer(\"fiber-server\") func main() { tp := initTracer() defer func() { if err := tp.Shutdown(context.Background()); err != nil { log.Printf(\"Error shutting down tracer provider: %v\", err) } }() app := fiber.New() app.Use(otelfiber.Middleware()) app.Get(\"/error\", func(ctx *fiber.Ctx) error { return errors.New(\"abc\") }) app.Get(\"/users/:id\", func(c *fiber.Ctx) error { id := c.Params(\"id\") name := getUser(c.UserContext(), id) return c.JSON(fiber.Map{\"id\": id, name: name}) }) log.Fatal(app.Listen(\":3000\")) } func initTracer() *sdktrace.TracerProvider { exporter, err := stdout.New(stdout.WithPrettyPrint()) if err != nil { log.Fatal(err) } tp := sdktrace.NewTracerProvider( sdktrace.WithSampler(sdktrace.AlwaysSample()), sdktrace.WithBatcher(exporter), sdktrace.WithResource( resource.NewWithAttributes( semconv.SchemaURL, semconv.ServiceNameKey.String(\"my-service\"), )), ) otel.SetTracerProvider(tp) otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})) return tp } func getUser(ctx context.Context, id string) string { _, span := tracer.Start(ctx, \"getUser\", oteltrace.WithAttributes(attribute.String(\"id\", id))) defer span.End() if id == \"123\" { return \"otelfiber tester\" } return \"unknown\" }","s":"Example","u":"/contrib/otelfiber/","h":"#example","p":828},{"i":841,"t":"An HTTP server using gofiber fiber and instrumentation. The server has a /users/:id endpoint. The server generates span information to stdout. These instructions expect you have docker-compose installed. Bring up the fiber-server and fiber-client services to run the example: docker-compose up --detach fiber-server fiber-client The fiber-client service sends just one HTTP request to fiber-server and then exits. View the span generated by fiber-server in the logs: docker-compose logs fiber-server Shut down the services when you are finished with the example: docker-compose down","s":"Example","u":"/contrib/otelfiber/example/","h":"","p":840},{"i":843,"t":"PASETO returns a Web Token (PASETO) auth middleware. For valid token, it sets the payload data in Ctx.Locals and calls next handler. For invalid token, it returns \"401 - Unauthorized\" error. For missing token, it returns \"400 - BadRequest\" error.","s":"Paseto","u":"/contrib/paseto/","h":"","p":842},{"i":845,"t":"This middleware supports Fiber v2. go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/paseto go get -u github.com/o1egl/paseto","s":"Install","u":"/contrib/paseto/","h":"#install","p":842},{"i":847,"t":"pasetoware.New(config ...pasetoware.Config) func(*fiber.Ctx) error","s":"Signature","u":"/contrib/paseto/","h":"#signature","p":842},{"i":849,"t":"Property Type Description Default Next func(*Ctx) bool Defines a function to skip middleware nil SuccessHandler func(*fiber.Ctx) error SuccessHandler defines a function which is executed for a valid token. c.Next() ErrorHandler func(*fiber.Ctx, error) error ErrorHandler defines a function which is executed for an invalid token. 401 Invalid or expired PASETO Validate PayloadValidator Defines a function to validate if payload is valid. Optional. In case payload used is created using CreateToken function. If token is created using another function, this function must be provided. nil SymmetricKey []byte Secret key to encrypt token. If present the middleware will generate local tokens. nil PrivateKey ed25519.PrivateKey Secret key to sign the tokens. If present (along with its PublicKey) the middleware will generate public tokens. nil PublicKey crypto.PublicKey Public key to verify the tokens. If present (along with PrivateKey) the middleware will generate public tokens. nil ContextKey string Context key to store user information from the token into context. \"auth-token\" TokenLookup [2]string TokenLookup is a string slice with size 2, that is used to extract token from the request [\"header\",\"Authorization\"]","s":"Config","u":"/contrib/paseto/","h":"#config","p":842},{"i":851,"t":"When using this middleware, and creating a token for authentication, you can use the function pasetoware.CreateToken, that will create a token, encrypt or sign it and returns the PASETO token. Passing a SymmetricKey in the Config results in a local (encrypted) token, while passing a PublicKey and PrivateKey results in a public (signed) token. In case you want to use your own data structure, is needed to provide the Validate function in paseware.Config, that will return the data stored in the token, and a error.","s":"Instructions","u":"/contrib/paseto/","h":"#instructions","p":842},{"i":853,"t":"Swagger middleware for Fiber. The middleware handles Swagger UI.","s":"Swagger","u":"/contrib/swagger/","h":"","p":852},{"i":855,"t":"Signatures Examples","s":"Table of Contents","u":"/contrib/swagger/","h":"#table-of-contents","p":852},{"i":857,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/contrib/swagger/","h":"#signatures","p":852},{"i":859,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/swagger\" ) Then create a Fiber app with app := fiber.New(). After you initiate your Fiber app, you can use the following possibilities:","s":"Examples","u":"/contrib/swagger/","h":"#examples","p":852},{"i":861,"t":"app.Use(swagger.New(cfg))","s":"Default Config","u":"/contrib/swagger/","h":"#default-config","p":852},{"i":863,"t":"cfg := swagger.Config{ BasePath: \"/\", //swagger ui base path FilePath: \"./docs/swagger.json\", } app.Use(swagger.New(cfg))","s":"Custom Config","u":"/contrib/swagger/","h":"#custom-config","p":852},{"i":865,"t":"Based on Fasthttp WebSocket for Fiber with available *fiber.Ctx methods like Locals, Params, Query and Cookies.","s":"Websocket","u":"/contrib/websocket/","h":"","p":864},{"i":867,"t":"go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/contrib/websocket","s":"Install","u":"/contrib/websocket/","h":"#install","p":864},{"i":869,"t":"package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/contrib/websocket\" ) func main() { app := fiber.New() app.Use(\"/ws\", func(c *fiber.Ctx) error { // IsWebSocketUpgrade returns true if the client // requested upgrade to the WebSocket protocol. if websocket.IsWebSocketUpgrade(c) { c.Locals(\"allowed\", true) return c.Next() } return fiber.ErrUpgradeRequired }) app.Get(\"/ws/:id\", websocket.New(func(c *websocket.Conn) { // c.Locals is added to the *websocket.Conn log.Println(c.Locals(\"allowed\")) // true log.Println(c.Params(\"id\")) // 123 log.Println(c.Query(\"v\")) // 1.0 log.Println(c.Cookies(\"session\")) // \"\" // websocket.Conn bindings https://pkg.go.dev/github.com/fasthttp/websocket?tab=doc#pkg-index var ( mt int msg []byte err error ) for { if mt, msg, err = c.ReadMessage(); err != nil { log.Println(\"read:\", err) break } log.Printf(\"recv: %s\", msg) if err = c.WriteMessage(mt, msg); err != nil { log.Println(\"write:\", err) break } } })) log.Fatal(app.Listen(\":3000\")) // Access the websocket server: ws://localhost:3000/ws/123?v=1.0 // https://www.websocket.org/echo.html }","s":"Example","u":"/contrib/websocket/","h":"#example","p":864},{"i":871,"t":"If you get the error websocket: bad handshake when using the cache middleware, please use config.Next to skip websocket path. app := fiber.New() app.Use(cache.New(cache.Config{ Next: func(c *fiber.Ctx) bool { return strings.Contains(c.Route().Path, \"/ws\") }, })) app.Get(\"/ws/:id\", websocket.New(func(c *websocket.Conn) {}))","s":"Note with cache middleware","u":"/contrib/websocket/","h":"#note-with-cache-middleware","p":864},{"i":874,"t":"Premade storage drivers that implement the Storage interface, designed to be used with various Fiber middlewares. // Storage interface for communicating with different database/key-value // providers. Visit https://github.com/gofiber/storage for more info. type Storage interface { // Get gets the value for the given key. // `nil, nil` is returned when the key does not exist Get(key string) ([]byte, error) // Set stores the given value for the given key along // with an expiration value, 0 means no expiration. // Empty key or value will be ignored without an error. Set(key string, val []byte, exp time.Duration) error // Delete deletes the value for the given key. // It returns no error if the storage does not contain the key, Delete(key string) error // Reset resets the storage and delete all keys. Reset() error // Close closes the storage and will stop any running garbage // collectors and open connections. Close() error }","s":"πŸ“¦ Storage","u":"/storage/","h":"","p":872},{"i":876,"t":"ArangoDB AzureBlob Badger Bbolt Couchbase DynamoDB Etcd Memcache Memory MongoDB MSSQL MySQL Pebble Postgres Redis S3 SQLite3","s":"πŸ“‘ Storage Implementations","u":"/storage/","h":"#-storage-implementations","p":872},{"i":878,"t":"A ArangoDB storage driver using arangodb/go-driver and arangodb/go-driver.","s":"ArangoDB","u":"/storage/arangodb/","h":"","p":877},{"i":880,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/arangodb/","h":"#table-of-contents","p":877},{"i":882,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() driver.Client","s":"Signatures","u":"/storage/arangodb/","h":"#signatures","p":877},{"i":884,"t":"ArangoDB is tested on the 2 last (1.14/1.15) Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the mysql implementation: go get github.com/gofiber/storage/arangodb","s":"Installation","u":"/storage/arangodb/","h":"#installation","p":877},{"i":886,"t":"Import the storage package. import \"github.com/gofiber/storage/arangodb\" You can use the following possibilities to create a storage: // Initialize default config store := arangodb.New() // Initialize custom config store := arangodb.New(arangodb.Config{ Host: \"http://127.0.0.1\", Port: 8529, Database: \"fiber\", Collection: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/arangodb/","h":"#examples","p":877},{"i":888,"t":"type Config struct { // Host name where the DB is hosted // // Optional. Default is \"http://127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 8529 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Database name // // Optional. Default is \"fiber\" Database string // Collection name // // Optional. Default is \"fiber_storage\" Collection string // Reset clears any existing keys in existing collection // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration }","s":"Config","u":"/storage/arangodb/","h":"#config","p":877},{"i":890,"t":"Used only for optional fields var ConfigDefault = Config{ Host: \"http://127.0.0.1\", Port: 8529, Database: \"fiber\", Collection: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, }","s":"Default Config","u":"/storage/arangodb/","h":"#default-config","p":877},{"i":892,"t":"Azure Blob storage is Microsoft's object storage solution for the cloud. NOTE: Go 1.18 or later is required. Source: link","s":"Azure Blob","u":"/storage/azureblob/","h":"","p":891},{"i":894,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/azureblob/","h":"#table-of-contents","p":891},{"i":896,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *azblob.Client","s":"Signatures","u":"/storage/azureblob/","h":"#signatures","p":891},{"i":898,"t":"Azure blob storage driver is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the azure blob implementation: go get github.com/gofiber/storage/azureblob","s":"Installation","u":"/storage/azureblob/","h":"#installation","p":891},{"i":900,"t":"Import the storage package. import \"github.com/gofiber/storage/azureblob\" You can use the following possibilities to create a storage: // Initialize default config store := azureblob.New() // Initialize custom config store := azureblob.New(azureblob.Config{ Account: \"test\", Container: \"test\", Credentials: Credentials{ Account: \"test\", Key: \"YXp1cml0ZWtleQo=\", }, })","s":"Examples","u":"/storage/azureblob/","h":"#examples","p":891},{"i":902,"t":"type Config struct { // Storage account name. Account string // Container name. Container string // Storage endpoint. // Optional. Default: \"https://STORAGEACCOUNTNAME.blob.core.windows.net\" Endpoint string // Request timeout. // Optional. Default is 0 (no timeout) RequestTimeout time.Duration // Reset clears any existing keys in existing container. // Optional. Default is false Reset bool // Credentials overrides AWS access key and AWS secret access key. Not recommended. // Optional. Default is Credentials{} Credentials Credentials // The maximum number of times requests that encounter retryable failures should be attempted. // Optional. Default is 3 MaxAttempts int }","s":"Config","u":"/storage/azureblob/","h":"#config","p":891},{"i":904,"t":"var ConfigDefault = Config{ Account: \"\", Container: \"\", Endpoint: \"\", RequestTimeout: 0, Reset: false, MaxAttempts: 3, }","s":"Default Config","u":"/storage/azureblob/","h":"#default-config","p":891},{"i":906,"t":"A fast key-value DB using dgraph-io/badger","s":"Badger","u":"/storage/badger/","h":"","p":905},{"i":908,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/badger/","h":"#table-of-contents","p":905},{"i":910,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *badger.DB","s":"Signatures","u":"/storage/badger/","h":"#signatures","p":905},{"i":912,"t":"Badger is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the badger implementation: go get github.com/gofiber/storage/badger","s":"Installation","u":"/storage/badger/","h":"#installation","p":905},{"i":914,"t":"Import the storage package. import \"github.com/gofiber/storage/badger\" You can use the following possibilities to create a storage: // Initialize default config store := badger.New() // Initialize custom config store := badger.New(badger.Config{ Database: \"./fiber.badger\", Reset: false, GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/badger/","h":"#examples","p":905},{"i":916,"t":"type Config struct { // Database name // // Optional. Default is \"./fiber.badger\" Database string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration // BadgerOptions is a way to set options in badger // // Optional. Default is badger.DefaultOptions(\"./fiber.badger\") BadgerOptions badger.Options // Logger is the default logger used by badger // // Optional. Default is nil Logger badger.Logger // UseLogger define if any logger will be used // // Optional. Default is false UseLogger bool }","s":"Config","u":"/storage/badger/","h":"#config","p":905},{"i":918,"t":"var ConfigDefault = Config{ Database: \"./fiber.badger\", Reset: false, GCInterval: 10 * time.Second, BadgerOptions: badger.DefaultOptions(\"./fiber.badger\").WithLogger(nil), Logger: nil, UseLogger: false, }","s":"Default Config","u":"/storage/badger/","h":"#default-config","p":905},{"i":920,"t":"A Bbolt storage driver using etcd-io/bbolt. Bolt is a pure Go key/value store inspired by Howard Chu's LMDB project. The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL.","s":"Bbolt","u":"/storage/bbolt/","h":"","p":919},{"i":922,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/bbolt/","h":"#table-of-contents","p":919},{"i":924,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *bbolt.DB","s":"Signatures","u":"/storage/bbolt/","h":"#signatures","p":919},{"i":926,"t":"Bbolt is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the s3 implementation: go get github.com/gofiber/storage/bbolt","s":"Installation","u":"/storage/bbolt/","h":"#installation","p":919},{"i":928,"t":"Import the storage package. import \"github.com/gofiber/storage/bbolt\" You can use the following possibilities to create a storage: // Initialize default config store := bbolt.New() // Initialize custom config store := bbolt.New(bbolt.Config{ Database: \"my_database.db\", Bucket: \"my-bucket\", Reset: false, })","s":"Examples","u":"/storage/bbolt/","h":"#examples","p":919},{"i":930,"t":"// Config defines the config for storage. type Config struct { // Database path // // Optional. Default is \"fiber.db\" Database string // Bbolt bucket name // // Optional. Default is \"fiber_storage\" Bucket string // Timeout is the amount of time to wait to obtain a file lock. // Only available on Darwin and Linux. // // Optional. Default is 60 * time.Second. Timeout time.Duration // Open database in read-only mode. // // Optional. Default is false ReadOnly bool // Reset clears any existing keys in existing Bucket // // Optional. Default is false Reset bool }","s":"Config","u":"/storage/bbolt/","h":"#config","p":919},{"i":932,"t":"// ConfigDefault is the default config var ConfigDefault = Config{ Database: \"fiber.db\", Bucket: \"fiber_storage\", Timeout: 60 * time.Second, ReadOnly: false, Reset: false, }","s":"Default Config","u":"/storage/bbolt/","h":"#default-config","p":919},{"i":934,"t":"A Couchbase storage driver using couchbase/gocb.","s":"Couchbase","u":"/storage/couchbase/","h":"","p":933},{"i":936,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/couchbase/","h":"#table-of-contents","p":933},{"i":938,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *gocb.Cluster","s":"Signatures","u":"/storage/couchbase/","h":"#signatures","p":933},{"i":940,"t":"Couchbase is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the Couchbase implementation: go get github.com/gofiber/storage/couchbase","s":"Installation","u":"/storage/couchbase/","h":"#installation","p":933},{"i":942,"t":"Import the storage package. import \"github.com/gofiber/storage/couchbase\" You can use the following possibilities to create a storage: // Initialize default config store := couchbase.New() // Initialize Couchbase storage with custom config store := couchbase.New(couchbase.Config{ Host: \"127.0.0.1:8091\", Username: \"\", Password: \"\", Bucket: 0, ConnectionTimeout: 3* time.Second, KVTimeout: 1* time.Second, })","s":"Examples","u":"/storage/couchbase/","h":"#examples","p":933},{"i":944,"t":"type Config struct { // The application username to Connect to the Couchbase cluster Username string // The application password to Connect to the Couchbase cluster Password string // The connection string for the Couchbase cluster Host string // The name of the bucket to Connect to Bucket string // The timeout for connecting to the Couchbase cluster ConnectionTimeout time.Duration // The timeout for performing operations on the Couchbase cluster KVTimeout time.Duration }","s":"Config","u":"/storage/couchbase/","h":"#config","p":933},{"i":946,"t":"// ConfigDefault is the default config var ConfigDefault = Config{ Host: \"127.0.0.1:8091\", Username: \"admin\", Password: \"123456\", Bucket: \"fiber_storage\", ConnectionTimeout: 3 * time.Second, KVTimeout: 1 * time.Second, }","s":"Default Config","u":"/storage/couchbase/","h":"#default-config","p":933},{"i":948,"t":"A DynamoDB storage driver using aws/aws-sdk-go-v2. Note: If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: specifying credentials ....","s":"DynamoDB","u":"/storage/dynamodb/","h":"","p":947},{"i":950,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/dynamodb/","h":"#table-of-contents","p":947},{"i":952,"t":"func New(config Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *awsdynamodb.Client","s":"Signatures","u":"/storage/dynamodb/","h":"#signatures","p":947},{"i":954,"t":"DynamoDB is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the dynamodb implementation: go get github.com/gofiber/storage/dynamodb","s":"Installation","u":"/storage/dynamodb/","h":"#installation","p":947},{"i":956,"t":"Import the storage package. import \"github.com/gofiber/storage/dynamodb\" You can use the following possibilities to create a storage: // Initialize dynamodb store := dynamodb.New(dynamodb.Config{ })","s":"Examples","u":"/storage/dynamodb/","h":"#examples","p":947},{"i":958,"t":"type Config struct { // Region of the DynamoDB service you want to use. // Valid values: https://docs.aws.amazon.com/general/latest/gr/rande.html#ddb_region. // E.g. \"us-west-2\". // Optional (read from shared config file or environment variable if not set). // Environment variable: \"AWS_REGION\". Region string // Name of the DynamoDB table. // Optional (\"fiber_storage\" by default). Table string // CustomEndpoint allows you to set a custom DynamoDB service endpoint. // This is especially useful if you're running a \"DynamoDB local\" Docker container for local testing. // Typical value for the Docker container: \"http://localhost:8000\". // See https://hub.docker.com/r/amazon/dynamodb-local/. // Optional (\"\" by default) Endpoint string // Credentials overrides AWS access key and AWS secret access key. Not recommended. // // Optional. Default is Credentials{} Credentials Credentials // The maximum number of times requests that encounter retryable failures should be attempted. // // Optional. Default is 3 MaxAttempts int // Reset clears any existing keys in existing Bucket // // Optional. Default is false Reset bool // ReadCapacityUnits of the table. // Only required when the table doesn't exist yet and is created by gokv. // Optional (5 by default, which is the same default value as when creating a table in the web console) // 25 RCUs are included in the free tier (across all tables). // For example calculations, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/HowItWorks.ProvisionedThroughput. // For limits, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/Limits.md#capacity-units-and-provisioned-throughput.md#provisioned-throughput. ReadCapacityUnits int64 // ReadCapacityUnits of the table. // Only required when the table doesn't exist yet and is created by gokv. // Optional (5 by default, which is the same default value as when creating a table in the web console) // 25 RCUs are included in the free tier (across all tables). // For example calculations, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/HowItWorks.ProvisionedThroughput. // For limits, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/Limits.md#capacity-units-and-provisioned-throughput.md#provisioned-throughput. WriteCapacityUnits int64 // If the table doesn't exist yet, gokv creates it. // If WaitForTableCreation is true, gokv will block until the table is created, with a timeout of 15 seconds. // If the table still doesn't exist after 15 seconds, an error is returned. // If WaitForTableCreation is false, gokv returns the client immediately. // In the latter case you need to make sure that you don't read from or write to the table before it's created, // because otherwise you will get ResourceNotFoundException errors. // Optional (true by default). WaitForTableCreation *bool } type Credentials struct { AccessKey string SecretAccessKey string }","s":"Config","u":"/storage/dynamodb/","h":"#config","p":947},{"i":960,"t":"var ConfigDefault = Config{ Table: \"fiber_storage\", Credentials: Credentials{}, MaxAttempts: 3, Reset: false, ReadCapacityUnits: 5, WriteCapacityUnits: 5, WaitForTableCreation: aws.Bool(true), }","s":"Default Config","u":"/storage/dynamodb/","h":"#default-config","p":947},{"i":962,"t":"A Etcd storage driver using etcd-io/etcd.","s":"Etcd","u":"/storage/etcd/","h":"","p":961},{"i":964,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/etcd/","h":"#table-of-contents","p":961},{"i":966,"t":"func New(config ...Config) *Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *clientv3.Client","s":"Signatures","u":"/storage/etcd/","h":"#signatures","p":961},{"i":968,"t":"Etcd is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the etcd implementation: go get github.com/gofiber/storage/etcd","s":"Installation","u":"/storage/etcd/","h":"#installation","p":961},{"i":970,"t":"Import the storage package. import \"github.com/gofiber/storage/etcd\" You can use the following possibilities to create a storage: // Initialize default config store := etcd.New() // Initialize custom config store := etcd.New(Config{ Endpoints: []string{\"localhost:2379\"}, })","s":"Examples","u":"/storage/etcd/","h":"#examples","p":961},{"i":972,"t":"type Config struct { // Endpoints is a list of URLs. Endpoints []string // DialTimeout is the timeout for failing to establish a connection. DialTimeout time.Duration // Username is a username for authentication. Username string // Password is a password for authentication. Password string // TLS holds the client secure credentials, if any. TLS *tls.Config }","s":"Config","u":"/storage/etcd/","h":"#config","p":961},{"i":974,"t":"var ConfigDefault = Config{ Endpoints: []string{\"localhost:2379\"}, DialTimeout: 2 * time.Second, Username: \"\", Password: \"\", TLS: nil, }","s":"Default Config","u":"/storage/etcd/","h":"#default-config","p":961},{"i":976,"t":"A Memcache storage driver using bradfitz/gomemcache.","s":"Memcache","u":"/storage/memcache/","h":"","p":975},{"i":978,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/memcache/","h":"#table-of-contents","p":975},{"i":980,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *mc.Client","s":"Signatures","u":"/storage/memcache/","h":"#signatures","p":975},{"i":982,"t":"Memory is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the memory implementation: go get github.com/gofiber/storage/memory","s":"Installation","u":"/storage/memcache/","h":"#installation","p":975},{"i":984,"t":"Import the storage package. import \"github.com/gofiber/storage/memcache\" You can use the following possibilities to create a storage: // Initialize default config store := memcache.New() // Initialize custom config store := memcache.New(memcache.Config{ Servers: \"localhost:11211\", })","s":"Examples","u":"/storage/memcache/","h":"#examples","p":975},{"i":986,"t":"type Config struct { // Server list divided by , // i.e. server1:11211, server2:11212 // // Optional. Default is \"127.0.0.1:11211\" Servers string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool }","s":"Config","u":"/storage/memcache/","h":"#config","p":975},{"i":988,"t":"var ConfigDefault = Config{ Servers: \"127.0.0.1:11211\", }","s":"Default Config","u":"/storage/memcache/","h":"#default-config","p":975},{"i":990,"t":"An in-memory storage driver.","s":"Memory","u":"/storage/memory/","h":"","p":989},{"i":992,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/memory/","h":"#table-of-contents","p":989},{"i":994,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() map[string]entry","s":"Signatures","u":"/storage/memory/","h":"#signatures","p":989},{"i":996,"t":"Memory is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the memory implementation: go get github.com/gofiber/storage/memory","s":"Installation","u":"/storage/memory/","h":"#installation","p":989},{"i":998,"t":"Import the storage package. import \"github.com/gofiber/storage/memory\" You can use the following possibilities to create a storage: // Initialize default config store := memory.New() // Initialize custom config store := memory.New(memory.Config{ GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/memory/","h":"#examples","p":989},{"i":1000,"t":"type Config struct { // Time before deleting expired keys // // Default is 10 * time.Second GCInterval time.Duration }","s":"Config","u":"/storage/memory/","h":"#config","p":989},{"i":1002,"t":"var ConfigDefault = Config{ GCInterval: 10 * time.Second, }","s":"Default Config","u":"/storage/memory/","h":"#default-config","p":989},{"i":1004,"t":"A MongoDB storage driver using mongodb/mongo-go-driver.","s":"MongoDB","u":"/storage/mongodb/","h":"","p":1003},{"i":1006,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/mongodb/","h":"#table-of-contents","p":1003},{"i":1008,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *mongo.Database","s":"Signatures","u":"/storage/mongodb/","h":"#signatures","p":1003},{"i":1010,"t":"MongoDB is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the mongodb implementation: go get github.com/gofiber/storage/mongodb","s":"Installation","u":"/storage/mongodb/","h":"#installation","p":1003},{"i":1012,"t":"Import the storage package. import \"github.com/gofiber/storage/mongodb\" You can use the following possibilities to create a storage: // Initialize default config store := mongodb.New() // Initialize custom config store := mongodb.New(mongodb.Config{ Host: \"127.0.0.1\", Port: 27017, Database: \"fiber\", Collection: \"fiber_storage\", Reset: false, }) // Initialize custom config using connection string store := mongodb.New(mongodb.Config{ ConnectionURI: \"mongodb://user:password@127.0.0.1:27017\", Database: \"fiber\", Collection: \"fiber_storage\", Reset: false, })","s":"Examples","u":"/storage/mongodb/","h":"#examples","p":1003},{"i":1014,"t":"type Config struct { // Connection string to use for DB. Will override all other authentication values if used // // Optional. Default is \"\" ConnectionURI string // Host name where the DB is hosted // // Optional. Default is \"127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 27017 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Database name // // Optional. Default is \"fiber\" Database string // Collection name // // Optional. Default is \"fiber_storage\" Collection string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool }","s":"Config","u":"/storage/mongodb/","h":"#config","p":1003},{"i":1016,"t":"var ConfigDefault = Config{ ConnectionURI: \"\", Host: \"127.0.0.1\", Port: 27017, Database: \"fiber\", Collection: \"fiber_storage\", Reset: false, }","s":"Default Config","u":"/storage/mongodb/","h":"#default-config","p":1003},{"i":1018,"t":"A MSSQL storage driver using microsoft/go-mssqldb.","s":"MSSQL","u":"/storage/mssql/","h":"","p":1017},{"i":1020,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/mssql/","h":"#table-of-contents","p":1017},{"i":1022,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *sql.DB","s":"Signatures","u":"/storage/mssql/","h":"#signatures","p":1017},{"i":1024,"t":"MSSQL is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the mssql implementation: go get github.com/gofiber/storage/mssql","s":"Installation","u":"/storage/mssql/","h":"#installation","p":1017},{"i":1026,"t":"Import the storage package. import \"github.com/gofiber/storage/mssql\" You can use the following possibilities to create a storage: // Initialize default config store := mssql.New() // Initialize custom config store := mssql.New(mssql.Config{ Host: \"127.0.0.1\", Port: 1433, Database: \"fiber\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, SslMode: \"disable\", }) // Initialize custom config using connection string store := mssql.New(mssql.Config{ ConnectionURI: \"sqlserver://user:password@localhost:1433?database=fiber\" Reset: false, GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/mssql/","h":"#examples","p":1017},{"i":1028,"t":"// Config defines the config for storage. type Config struct { // Connection string to use for DB. Will override all other authentication values if used // // Optional. Default is \"\" ConnectionURI string // Host name where the DB is hosted // // Optional. Default is \"127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 1433 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Instance name // // Optional. Default is \"\" Instance string // Database name // // Optional. Default is \"fiber\" Database string // Table name // // Optional. Default is \"fiber_storage\" Table string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration // The SSL mode for the connection // // Optional. Default is \"disable\" SslMode string }","s":"Config","u":"/storage/mssql/","h":"#config","p":1017},{"i":1030,"t":"var ConfigDefault = Config{ ConnectionURI: \"\", Host: \"127.0.0.1\", Port: 1433, Database: \"fiber\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, SslMode: \"disable\", }","s":"Default Config","u":"/storage/mssql/","h":"#default-config","p":1017},{"i":1032,"t":"A MySQL storage driver using database/sql and go-sql-driver/mysql.","s":"MySQL","u":"/storage/mysql/","h":"","p":1031},{"i":1034,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/mysql/","h":"#table-of-contents","p":1031},{"i":1036,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *sql.DB","s":"Signatures","u":"/storage/mysql/","h":"#signatures","p":1031},{"i":1038,"t":"MySQL is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the mysql implementation: go get github.com/gofiber/storage/mysql","s":"Installation","u":"/storage/mysql/","h":"#installation","p":1031},{"i":1040,"t":"Import the storage package. import \"github.com/gofiber/storage/mysql\" You can use the following possibilities to create a storage: // Initialize default config store := mysql.New() // Initialize custom config store := mysql.New(mysql.Config{ Host: \"127.0.0.1\", Port: 3306, Database: \"fiber\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, }) // Initialize custom config using connection string store := mysql.New(mysql.Config{ ConnectionURI: \":@tcp(:)/\" Reset: false, GCInterval: 10 * time.Second, }) // Initialize custom config using sql db connection db, _ := sql.Open(\"mysql\", \":@tcp(:)/\") store := mysql.New(mysql.Config{ Db: db, Reset: false, GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/mysql/","h":"#examples","p":1031},{"i":1042,"t":"type Config struct { // DB Will override ConnectionURI and all other authentication values if used // // Optional. Default is nil Db *sql.DB // Connection string to use for DB. Will override all other authentication values if used // // Optional. Default is \"\" ConnectionURI string // Host name where the DB is hosted // // Optional. Default is \"127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 3306 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Database name // // Optional. Default is \"fiber\" Database string // Table name // // Optional. Default is \"fiber_storage\" Table string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration }","s":"Config","u":"/storage/mysql/","h":"#config","p":1031},{"i":1044,"t":"var ConfigDefault = Config{ ConnectionURI: \"\", Host: \"127.0.0.1\", Port: 3306, Database: \"fiber\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, }","s":"Default Config","u":"/storage/mysql/","h":"#default-config","p":1031},{"i":1046,"t":"A fast key-value DB using cockroachdb/pebble","s":"Pebble","u":"/storage/pebble/","h":"","p":1045},{"i":1048,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/pebble/","h":"#table-of-contents","p":1045},{"i":1050,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *badger.DB","s":"Signatures","u":"/storage/pebble/","h":"#signatures","p":1045},{"i":1052,"t":"Pebble is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// Note: This step is only required if you don't have an existing module. And then install the Pebble implementation: go get github.com/gofiber/storage/pebble","s":"Installation","u":"/storage/pebble/","h":"#installation","p":1045},{"i":1054,"t":"Import the storage package. import \"github.com/gofiber/storage/pebble\" You can use the following possibilities to create a storage: // Initialize default config store := pebble.New() // Initialize custom config store := pebble.New(pebble.Config{ Path: \"db\", WriteOptions: &pebble.WriteOptions{}, })","s":"Examples","u":"/storage/pebble/","h":"#examples","p":1045},{"i":1056,"t":"type Config struct { // Database name // // Optional. Default is \"./db\" Path string // Pass write options during write operations // // Optional. Default is nil WriteOptions &pebble.WriteOptions{} }","s":"Config","u":"/storage/pebble/","h":"#config","p":1045},{"i":1058,"t":"var ConfigDefault = Config{ Path: \"db\", WriteOptions: &pebble.WriteOptions{}, }","s":"Default Config","u":"/storage/pebble/","h":"#default-config","p":1045},{"i":1060,"t":"A Postgres storage driver using jackc/pgx.","s":"Postgres","u":"/storage/postgres/","h":"","p":1059},{"i":1062,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/postgres/","h":"#table-of-contents","p":1059},{"i":1064,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *pgxpool.Pool","s":"Signatures","u":"/storage/postgres/","h":"#signatures","p":1059},{"i":1066,"t":"Postgres is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the postgres implementation: go get github.com/gofiber/storage/postgres/v2","s":"Installation","u":"/storage/postgres/","h":"#installation","p":1059},{"i":1068,"t":"Import the storage package. import \"github.com/gofiber/storage/postgres/v2\" You can use the following possibilities to create a storage: // Initialize default config store := postgres.New() // Initialize custom config store := postgres.New(postgres.Config{ Db: dbPool, Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, })","s":"Examples","u":"/storage/postgres/","h":"#examples","p":1059},{"i":1070,"t":"// Config defines the config for storage. type Config struct { // DB pgxpool.Pool object will override connection uri and other connection fields // // Optional. Default is nil DB *pgxpool.Pool // Connection string to use for DB. Will override all other authentication values if used // // Optional. Default is \"\" ConnectionURI string // Host name where the DB is hosted // // Optional. Default is \"127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 5432 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Database name // // Optional. Default is \"fiber\" Database string // Table name // // Optional. Default is \"fiber_storage\" Table string // The SSL mode for the connection // // Optional. Default is \"disable\" SSLMode string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration }","s":"Config","u":"/storage/postgres/","h":"#config","p":1059},{"i":1072,"t":"// ConfigDefault is the default config var ConfigDefault = Config{ ConnectionURI: \"\", Host: \"127.0.0.1\", Port: 5432, Database: \"fiber\", Table: \"fiber_storage\", SSLMode: \"disable\", Reset: false, GCInterval: 10 * time.Second, }","s":"Default Config","u":"/storage/postgres/","h":"#default-config","p":1059},{"i":1074,"t":"A Redis storage driver using go-redis/redis.","s":"Redis","u":"/storage/redis/","h":"","p":1073},{"i":1076,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/redis/","h":"#table-of-contents","p":1073},{"i":1078,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() redis.UniversalClient","s":"Signatures","u":"/storage/redis/","h":"#signatures","p":1073},{"i":1080,"t":"Redis is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the redis implementation: go get github.com/gofiber/storage/redis/v2","s":"Installation","u":"/storage/redis/","h":"#installation","p":1073},{"i":1082,"t":"Import the storage package. import \"github.com/gofiber/storage/redis/v2\" You can use the one of the following options to create a Redis Storage: // Initialize default config store := redis.New() // Initialize custom config store := redis.New(redis.Config{ Host: \"127.0.0.1\", Port: 6379, Username: \"\", Password: \"\", Database: 0, Reset: false, TLSConfig: nil, PoolSize: 10 * runtime.GOMAXPROCS(0), }) // Initialize Redis Failover Client store := redis.New(redis.Config{ MasterName: \"master-name\", Addrs: []string{\":6379\"}, }) // Initialize Redis Cluster Client store := redis.New(redis.Config{ Addrs: []string{\":6379\", \":6380\"}, }) // Create a client with support for TLS cer, err := tls.LoadX509KeyPair(\"./client.crt\", \"./client.key\") if err != nil { log.Println(err) return } tlsCfg := &tls.Config{ MinVersion: tls.VersionTLS12, InsecureSkipVerify: true, Certificates: []tls.Certificate{cer}, } store = redis.New(redis.Config{ URL: \"redis://:@127.0.0.1:6379/\", TLSConfig: tlsCfg, Reset: false, }) // Create a client with a Redis URL with all information. store = redis.New(redis.Config{ URL: \"redis://:@127.0.0.1:6379/\", Reset: false, })","s":"Examples","u":"/storage/redis/","h":"#examples","p":1073},{"i":1084,"t":"type Config struct { // Host name where the DB is hosted // // Optional. Default is \"127.0.0.1\" Host string // Port where the DB is listening on // // Optional. Default is 6379 Port int // Server username // // Optional. Default is \"\" Username string // Server password // // Optional. Default is \"\" Password string // Database to be selected after connecting to the server. // // Optional. Default is 0 Database int // URL standard format Redis URL. If this is set all other config options, Host, Port, Username, Password, Database have no effect. // // Example: redis://:@localhost:6379/ // Optional. Default is \"\" URL string // Either a single address or a seed list of host:port addresses, this enables FailoverClient and ClusterClient // // Optional. Default is []string{} Addrs []string // MasterName is the sentinel master's name // // Optional. Default is \"\" MasterName string // ClientName will execute the `CLIENT SETNAME ClientName` command for each conn. // // Optional. Default is \"\" ClientName string // SentinelUsername // // Optional. Default is \"\" SentinelUsername string // SentinelPassword // // Optional. Default is \"\" SentinelPassword string // Reset clears any existing keys in existing Collection // // Optional. Default is false Reset bool // TLS Config to use. When set TLS will be negotiated. // // Optional. Default is nil TLSConfig *tls.Config // Maximum number of socket connections. // // Optional. Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS. PoolSize int }","s":"Config","u":"/storage/redis/","h":"#config","p":1073},{"i":1086,"t":"var ConfigDefault = Config{ Host: \"127.0.0.1\", Port: 6379, Username: \"\", Password: \"\", URL: \"\", Database: 0, Reset: false, TLSConfig: nil, PoolSize: 10 * runtime.GOMAXPROCS(0), Addrs: []string{}, MasterName: \"\", ClientName: \"\", SentinelUsername: \"\", SentinelPassword: \"\", }","s":"Default Config","u":"/storage/redis/","h":"#default-config","p":1073},{"i":1088,"t":"A Memory-bound storage driver using dgraph-io/ristretto.","s":"Ristretto","u":"/storage/ristretto/","h":"","p":1087},{"i":1090,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/ristretto/","h":"#table-of-contents","p":1087},{"i":1092,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *ristretto.Cache","s":"Signatures","u":"/storage/ristretto/","h":"#signatures","p":1087},{"i":1094,"t":"Ristretto is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the ristretto implementation: go get github.com/gofiber/storage/ristretto","s":"Installation","u":"/storage/ristretto/","h":"#installation","p":1087},{"i":1096,"t":"Import the storage package. import \"github.com/gofiber/storage/ristretto\" You can use the following possibilities to create a storage: // Initialize default config store := ristretto.New() // Initialize custom config store := ristretto.New(ristretto.Config{ NumCounters: 1e7, // number of keys to track frequency of (10M). MaxCost: 1 << 30, // maximum cost of cache (1GB). BufferItems: 64, // number of keys per Get buffer. })","s":"Examples","u":"/storage/ristretto/","h":"#examples","p":1087},{"i":1098,"t":"type Config struct { // NumCounters number of keys to track frequency of (10M). NumCounters int64 // MaxCost maximum cost of cache (1GB). MaxCost int64 // BufferItems number of keys per Get buffer. BufferItems int64 }","s":"Config","u":"/storage/ristretto/","h":"#config","p":1087},{"i":1100,"t":"var ConfigDefault = Config{ NumCounters: 1e7, MaxCost: 1 << 30, BufferItems: 64, DefaultCost: 1, }","s":"Default Config","u":"/storage/ristretto/","h":"#default-config","p":1087},{"i":1102,"t":"A S3 storage driver using aws/aws-sdk-go-v2. Note: If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: specifying credentials","s":"S3","u":"/storage/s3/","h":"","p":1101},{"i":1104,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/s3/","h":"#table-of-contents","p":1101},{"i":1106,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *s3.Client","s":"Signatures","u":"/storage/s3/","h":"#signatures","p":1101},{"i":1108,"t":"S3 is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the s3 implementation: go get github.com/gofiber/storage/s3","s":"Installation","u":"/storage/s3/","h":"#installation","p":1101},{"i":1110,"t":"Import the storage package. import \"github.com/gofiber/storage/s3\" You can use the following possibilities to create a storage: // Initialize default config store := s3.New() // Initialize custom config store := s3.New(s3.Config{ Bucket: \"my-bucket-url\", Endpoint: \"my-endpoint\", Region: \"my-region\", Reset: false, })","s":"Examples","u":"/storage/s3/","h":"#examples","p":1101},{"i":1112,"t":"// Config defines the config for storage. type Config struct { // S3 bucket name Bucket string // AWS endpoint Endpoint string // AWS region Region string // Request timeout // // Optional. Default is 0 (no timeout) RequestTimeout time.Duration // Reset clears any existing keys in existing Bucket // // Optional. Default is false Reset bool // Credentials overrides AWS access key and AWS secret access key. Not recommended. // // Optional. Default is Credentials{} Credentials Credentials // The maximum number of times requests that encounter retryable failures should be attempted. // // Optional. Default is 3 MaxAttempts int } type Credentials struct { AccessKey string SecretAccessKey string }","s":"Config","u":"/storage/s3/","h":"#config","p":1101},{"i":1114,"t":"The default configuration lacks Bucket, Region, and Endpoint which are all required and must be overwritten: // ConfigDefault is the default config var ConfigDefault = Config{ Bucket: \"\", Region: \"\", Endpoint: \"\", Credentials: Credentials{}, MaxAttempts: 3, RequestTimeout: 0, Reset: false, }","s":"Default Config","u":"/storage/s3/","h":"#default-config","p":1101},{"i":1116,"t":"A SQLite3 storage driver using mattn/go-sqlite3.","s":"SQLite3","u":"/storage/sqlite3/","h":"","p":1115},{"i":1118,"t":"Signatures Installation Examples Config Default Config","s":"Table of Contents","u":"/storage/sqlite3/","h":"#table-of-contents","p":1115},{"i":1120,"t":"func New(config ...Config) Storage func (s *Storage) Get(key string) ([]byte, error) func (s *Storage) Set(key string, val []byte, exp time.Duration) error func (s *Storage) Delete(key string) error func (s *Storage) Reset() error func (s *Storage) Close() error func (s *Storage) Conn() *sql.DB","s":"Signatures","u":"/storage/sqlite3/","h":"#signatures","p":1115},{"i":1122,"t":"SQLite3 is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet: go mod init github.com// And then install the sqlite3 implementation: go get github.com/gofiber/storage/sqlite3","s":"Installation","u":"/storage/sqlite3/","h":"#installation","p":1115},{"i":1124,"t":"Import the storage package. import \"github.com/gofiber/storage/sqlite3\" You can use the following possibilities to create a storage: // Initialize default config store := sqlite3.New() // Initialize custom config store := sqlite3.New(sqlite3.Config{ Database: \"./fiber.sqlite3\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, MaxOpenConns: 100, MaxIdleConns: 100, ConnMaxLifetime: 1 * time.Second, })","s":"Examples","u":"/storage/sqlite3/","h":"#examples","p":1115},{"i":1126,"t":"type Config struct { // Database name // // Optional. Default is \"fiber\" Database string // Table name // // Optional. Default is \"fiber_storage\" Table string // Reset clears any existing keys in existing Table // // Optional. Default is false Reset bool // Time before deleting expired keys // // Optional. Default is 10 * time.Second GCInterval time.Duration // ////////////////////////////////// // Adaptor related config options // // ////////////////////////////////// // MaxIdleConns sets the maximum number of connections in the idle connection pool. // // Optional. Default is 100. MaxIdleConns int // MaxOpenConns sets the maximum number of open connections to the database. // // Optional. Default is 100. MaxOpenConns int // ConnMaxLifetime sets the maximum amount of time a connection may be reused. // // Optional. Default is 1 second. ConnMaxLifetime time.Duration }","s":"Config","u":"/storage/sqlite3/","h":"#config","p":1115},{"i":1128,"t":"var ConfigDefault = Config{ Database: \"./fiber.sqlite3\", Table: \"fiber_storage\", Reset: false, GCInterval: 10 * time.Second, MaxOpenConns: 100, MaxIdleConns: 100, ConnMaxLifetime: 1 * time.Second, }","s":"Default Config","u":"/storage/sqlite3/","h":"#default-config","p":1115},{"i":1130,"t":"This package provides universal methods to use multiple template engines with the Fiber web framework using the new Views interface that is available from > v1.11.1. Special thanks to @bdtomlin & @arsmn for helping! 9 template engines are supported: ace amber django handlebars html jet mustache pug slim","s":"πŸ‘‹ Welcome","u":"/template/","h":"","p":1129},{"i":1132,"t":"Go version 1.17 or higher is required. go get -u github.com/gofiber/fiber/v2 go get -u github.com/gofiber/template/any_template_engine/vX","s":"Installation","u":"/template/","h":"#installation","p":1129},{"i":1134,"t":"package main import ( \"log\" \"github.com/gofiber/fiber/v2\" // To use a specific template engine, import as shown below: // \"github.com/gofiber/template/pug\" // \"github.com/gofiber/template/mustache\" // etc.. // In this example we use the html template engine \"github.com/gofiber/template/html/v2\" ) func main() { // Create a new engine by passing the template folder // and template extension using .New(dir, ext string) engine := html.New(\"./views\", \".html\") // We also support the http.FileSystem interface // See examples below to load templates from embedded files engine := html.NewFileSystem(http.Dir(\"./views\"), \".html\") // Reload the templates on each render, good for development engine.Reload(true) // Optional. Default: false // Debug will print each template that is parsed, good for debugging engine.Debug(true) // Optional. Default: false // Layout defines the variable name that is used to yield templates within layouts engine.Layout(\"embed\") // Optional. Default: \"embed\" // Delims sets the action delimiters to the specified strings engine.Delims(\"{{\", \"}}\") // Optional. Default: engine delimiters // AddFunc adds a function to the template's global function map. engine.AddFunc(\"greet\", func(name string) string { return \"Hello, \" + name + \"!\" }) // After you created your engine, you can pass it to Fiber's Views Engine app := fiber.New(fiber.Config{ Views: engine, }) // To render a template, you can call the ctx.Render function // Render(tmpl string, values interface{}, layout ...string) app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) // Render with layout example app.Get(\"/layout\", func(c *fiber.Ctx) error { return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Example","u":"/template/","h":"#example","p":1129},{"i":1136,"t":"To view more specific examples, you could visit each engine folder to learn more html ace amber django handlebars jet mustache pug slim","s":"More Examples","u":"/template/","h":"#more-examples","p":1129},{"i":1138,"t":"We support the http.FileSystem interface, so you can use different libraries to load the templates from embedded binaries. pkger​ Read documentation: https://github.com/markbates/pkger package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" \"github.com/markbates/pkger\" ) func main() { engine := html.NewFileSystem(pkger.Dir(\"/views\"), \".html\") app := fiber.New(fiber.Config{ Views: engine, }) // run pkger && go build } packr​ Read documentation: https://github.com/gobuffalo/packr package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" \"github.com/gobuffalo/packr/v2\" ) func main() { engine := html.NewFileSystem(packr.New(\"Templates\", \"/views\"), \".html\") app := fiber.New(fiber.Config{ Views: engine, }) // run packr && go build } go.rice​ Read documentation: https://github.com/GeertJohan/go.rice package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" \"github.com/GeertJohan/go.rice\" ) func main() { engine := html.NewFileSystem(rice.MustFindBox(\"views\").HTTPBox(), \".html\") app := fiber.New(fiber.Config{ Views: engine, }) // run rice embed-go && go build } fileb0x​ Read documentation: https://github.com/UnnoTed/fileb0x package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" // your generated package \"github.com///static\" ) func main() { engine := html.NewFileSystem(static.HTTP, \".html\") app := fiber.New(fiber.Config{ Views: engine, }) // Read the documentation on how to use fileb0x }","s":"embedded Systems","u":"/template/","h":"#embedded-systems","p":1129},{"i":1140,"t":"Simple​ Extended​ Benchmarks were ran on Apple Macbook M1. Each engine was benchmarked 20 times and the results averaged into a single xlsx file. Mustache was excluded from the extended benchmark","s":"Benchmarks","u":"/template/","h":"#benchmarks","p":1129},{"i":1142,"t":"Ace is a template engine create by yossi, to see the original syntax documentation please click here","s":"Ace","u":"/template/ace/","h":"","p":1141},{"i":1144,"t":"./views/index.ace = include ./views/partials/header . h1 {{.Title}} = include ./views/partials/footer . ./views/partials/header.ace h1 Header ./views/partials/footer.ace h1 Footer ./views/layouts/main.ace = doctype html html head title Main body {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/ace/v2\" ) func main() { // Create a new engine engine := ace.New(\"./views\", \".ace\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := html.NewFileSystem(http.Dir(\"./views\", \".ace\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/ace/","h":"#basic-example","p":1141},{"i":1146,"t":"Amber is a template engine create by eknkc, to see the original syntax documentation please click here","s":"Amber","u":"/template/amber/","h":"","p":1145},{"i":1148,"t":"./views/index.amber import ./views/partials/header h1 #{Title} import ./views/partials/footer ./views/partials/header.amber h1 Header ./views/partials/footer.amber h1 Footer ./views/layouts/main.amber doctype html html head title Main body #{embed()} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/amber/v2\" ) func main() { // Create a new engine engine := amber.New(\"./views\", \".amber\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := html.NewFileSystem(http.Dir(\"./views\", \".amber\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/amber/","h":"#basic-example","p":1145},{"i":1150,"t":"Django is a template engine create by flosch, to see the original syntax documentation please click here","s":"Django","u":"/template/django/","h":"","p":1149},{"i":1152,"t":"./views/index.django {% include \"partials/header.django\" %}

{{ Title }}

{% include \"partials/footer.django\" %} ./views/partials/header.django

Header

./views/partials/footer.django

Footer

./views/layouts/main.django Main {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/django/v3\" ) func main() { // Create a new engine engine := django.New(\"./views\", \".django\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := html.NewFileSystem(http.Dir(\"./views\", \".django\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/django/","h":"#basic-example","p":1149},{"i":1154,"t":"When using the // go:embed directive, resolution of inherited templates using django's {% extend '' %} keyword fails when instantiating the template engine with django.NewFileSystem(). In that case, use the django.NewPathForwardingFileSystem() function to instantiate the template engine. This function provides the proper configuration for resolving inherited templates. Assume you have the following files: views/ancenstor.django views/descendant.djando then package main import ( \"log\" \"embed\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/django/v3\" ) //go:embed views var viewsAsssets embed.FS func main() { // Create a new engine engine := NewPathForwardingFileSystem(http.FS(viewsAsssets), \"/views\", \".django\") // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render descendant return c.Render(\"descendant\", fiber.Map{ \"greeting\": \"World\", }) }) log.Fatal(app.Listen(\":3000\")) }","s":"Using embedded file system (1.16+ only)","u":"/template/django/","h":"#using-embedded-file-system-116-only","p":1149},{"i":1156,"t":"// My custom function func Nl2brHtml(value interface{}) string { if str, ok := value.(string); ok { return strings.Replace(str, \"\\n\", \"
\", -1) } return \"\" } // Create a new engine engine := django.New(\"./views\", \".django\") // register functions engine.AddFunc(\"nl2br\", Nl2brHtml) // Pass the engine to the Views app := fiber.New(fiber.Config{Views: engine}) in the handler c.Render(\"index\", fiber.Map{ \"Fiber\": \"Hello, World!\\n\\nGreetings from Fiber Team\", }) ./views/index.django {{ nl2br(Fiber) }} Output: Hello, World!

Greetings from Fiber Team ","s":"Register and use custom functions","u":"/template/django/","h":"#register-and-use-custom-functions","p":1149},{"i":1158,"t":"Handlebars is a template engine create by aymerick, to see the original syntax documentation please click here","s":"Handlebars","u":"/template/handlebars/","h":"","p":1157},{"i":1160,"t":"./views/index.hbs {{> 'partials/header' }}

{{Title}}

{{> 'partials/footer' }} ./views/partials/header.hbs

Header

./views/partials/footer.hbs

Footer

./views/layouts/main.hbs Main {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/handlebars/v2\" ) func main() { // Create a new engine engine := handlebars.New(\"./views\", \".hbs\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := html.NewFileSystem(http.Dir(\"./views\", \".hbs\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/handlebars/","h":"#basic-example","p":1157},{"i":1162,"t":"HTML is the official Go template engine html/template, to see the original syntax documentation please click here Info: All templates within the specified view directory are analyzed and compiled at the beginning to increase the performance when using them. Thus it should be noted that no definition with the same name should exist, otherwise they will overwrite each other. For templating the {{embed}} tag should be used","s":"HTML","u":"/template/html/","h":"","p":1161},{"i":1164,"t":"./views/index.html {{template \"partials/header\" .}}

{{.Title}}

{{template \"partials/footer\" .}} ./views/partials/header.html

Header

./views/partials/footer.html

Footer

./views/layouts/main.html Main {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html/v2\" ) func main() { // Create a new engine engine := html.New(\"./views\", \".html\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := html.NewFileSystem(http.Dir(\"./views\", \".html\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/html/","h":"#basic-example","p":1161},{"i":1166,"t":"package main import ( \"log\" \"net/http\" \"embed\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" ) //go:embed views/* var viewsfs embed.FS func main() { engine := html.NewFileSystem(http.FS(viewsfs), \".html\") // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index - start with views directory return c.Render(\"views/index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) log.Fatal(app.Listen(\":3000\")) } and change the starting point to the views directory ./views/index.html {{template \"views/partials/header\" .}}

{{.Title}}

{{template \"views/partials/footer\" .}}","s":"Example with embed.FS","u":"/template/html/","h":"#example-with-embedfs","p":1161},{"i":1168,"t":"package main import ( \"embed\" \"html/template\" \"log\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html\" ) //go:embed views/* var viewsfs embed.FS func main() { engine := html.NewFileSystem(http.FS(viewsfs), \".html\") engine.AddFunc( // add unescape function \"unescape\", func(s string) template.HTML { return template.HTML(s) }, ) // Pass the engine to the Views app := fiber.New(fiber.Config{Views: engine}) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"views/index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) log.Fatal(app.Listen(\":3000\")) } and change the starting point to the views directory ./views/index.html

{{ unescape .Title}}

html output

Hello, World!

","s":"Example with innerHTML","u":"/template/html/","h":"#example-with-innerhtml","p":1161},{"i":1170,"t":"The Go standard library provides a set of packages to generate output. The text/template package implements templates for generating text output, while the html/template package implements templates for generating HTML output that is safe against certain attacks. Both packages use the same interface but the following examples of the core features are directed towards HTML applications.","s":"Golang Templates Cheatsheet","u":"/template/html/TEMPLATES_CHEATSHEET","h":"","p":1169},{"i":1172,"t":"Parsing and Creating Templates Executing Templates Template Encoding and HTML Template Variables Template Actions Template Functions Template Comparison Functions Nested Templates and Layouts Templates Calling Functions","s":"Table of Contents","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#table-of-contents","p":1169},{"i":1174,"t":"Naming Templates​ There is no defined file extension for Go templates. One of the most popular is .tmpl supported by vim-go and referenced in the text/template godocs. The extension .gohtml supports syntax highlighting in both Atom and GoSublime editors. Finally analysis of large Go codebases finds that .tpl is often used by developers. While the extension is not important it is still good to be consistent within a project for clarity. Creating a Template​ tpl, err := template.Parse(filename) will get the template at filename and store it in tpl. tpl can then be executed to show the template. Parsing Multiple Templates​ template.ParseFiles(filenames) takes a list of filenames and stores all templates. template.ParseGlob(pattern) will find all templates matching the pattern and store the templates.","s":"Parsing and Creating Templates","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#parsing-and-creating-templates","p":1169},{"i":1176,"t":"Execute a Single Template​ Once a template has been parsed there are two options to execute them. A single template tpl can be executed using tpl.Execute(io.Writer, data). The content of tpl will be written to the io.Writer. Data is an interface passed to the template that will be useable in the template. Executing a Named Template​ tpl.ExecuteTemplate(io.Writer, name, data) works the same as execute but allows for a string name of the template the user wants to execute.","s":"Executing Templates","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#executing-templates","p":1169},{"i":1178,"t":"Contextual Encoding​ Go’s html/template package does encoding based on the context of the code. As a result, html/template encodes any characters that need encoding to be rendered correctly. For example the < and > in \"

A header!

\" will be encoded as <h1>A header!</h1> . Type template.HTML can be used to skip encoding by telling Go the string is safe. template.HTML(\"

A Safe header

\") will then be

A Safe header

. Using this type with user input is dangerous and leaves the application vulnerable. The go html/template package is aware of attributes within the template and will encode values differently based on the attribute. Go templates can also be used with javascript. Structs and maps will be expanded into JSON objects and quotes will be added to strings for use in function parameters and as variable values. // Go type Cat struct { Name string Age int } kitten := Cat{\"Sam\", 12} // Template // Javascript var cat = {\"Name\":\"Sam\", \"Age\" 12} Safe Strings and HTML Comments​ The html/template package will remove any comments from a template by default. This can cause issues when comments are necessary such as detecting internet explorer. We can use the Custom Functions method (Globally) to create a function that returns html preserving comments. Define a function htmlSafe in the FuncMap of the template. testTemplate, err = template.New(\"hello.gohtml\").Funcs(template.FuncMap{ \"htmlSafe\": func(html string) template.HTML { return template.HTML(html) }, }).ParseFiles(\"hello.gohtml\") This function takes a string and produces the unaltered HTML code. This function can be used in a template like so to preserve the comments : {{htmlSafe \"\" }}","s":"Template Encoding and HTML","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-encoding-and-html","p":1169},{"i":1180,"t":"The dot character (.)​ A template variable can be a boolean, string, character, integer, floating-point, imaginary, or complex constant in Go syntax. Data passed to the template can be accessed using dot {{ . }}. If the data is a complex type then it’s fields can be accessed using the dot with the field name {{ .FieldName }}. Dots can be chained together if the data contains multiple complex structures. {{ .Struct.StructTwo.Field }} Variables in Templates​ Data passed to the template can be saved in a variable and used throughout the template. {{$number := .}} We use the $number to create a variable then initialize it with the value passed to the template. To use the variable we call it in the template with {{$number}}. {{$number := .}}

It is day number {{$number}} of the month

var tpl *template.Template tpl = template.Must(template.ParseFiles(\"templateName\")) err := tpl.ExecuteTemplate(os.Stdout, \"templateName\", 23) In this example we pass 23 to the template and stored in the $number variable which can be used anywhere in the template","s":"Template Variables","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-variables","p":1169},{"i":1182,"t":"If/Else Statements​ Go templates support if/else statements like many programming languages. We can use the if statement to check for values, if it doesn’t exist we can use an else value. The empty values are false, 0, any nil pointer or interface value, and any array, slice, map, or string of length zero.

Hello, {{if .Name}} {{.Name}} {{else}} Anonymous {{end}}!

If .Name exists then Hello, Name will be printed (replaced with the name value) otherwise it will print Hello, Anonymous. Templates also provide the else if statment {{else if .Name2 }} which can be used to evaluate other options after an if. Removing Whitespace​ Adding different values to a template can add various amounts of whitespace. We can either change our template to better handle it, by ignoring or minimizing effects, or we can use the minus sign - within out template.

Hello, {{if .Name}} {{.Name}} {{- else}} Anonymous {{- end}}!

Here we are telling the template to remove all spaces between the Name variable and whatever comes after it. We are doing the same with the end keyword. This allows us to have whitespace within the template for easier reading but remove it in production. Range Blocks​ Go templates have a range keyword to iterate over all objects in a structure. Suppose we had the Go structures: type Item struct { Name string Price int } type ViewData struct { Name string Items []Item } We have an Item, with a name and price, then a ViewData which is the structure sent to the template. Consider the template containing the following: {{range .Items}}

{{.Name}}

${{.Price}}
{{end}} For each Item in the range of Items (in the ViewData structure) get the Name and Price of that item and create html for each Item automatically. Within a range each Item becomes the {{.}} and the item properties therefore become {{.Name}} or {{.Price}} in this example.","s":"Template Actions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-actions","p":1169},{"i":1184,"t":"The template package provides a list of predefined global functions. Below are some of the most used. Indexing structures in Templates​ If the data passed to the template is a map, slice, or array it can be indexed from the template. We use {{index x number}} where index is the keyword, x is the data and number is a integer for the index value. If we had {{index names 2}} it is equivalent to names[2]. We can add more integers to index deeper into data. {{index names 2 3 4}} is equivalent to names[2][3][4].

{{index .FavNums 2 }}

type person struct { Name string FavNums []int } func main() { tpl := template.Must(template.ParseGlob(\"*.gohtml\")) tpl.Execute(os.Stdout, &person{\"Curtis\", []int{7, 11, 94}}) } This code example passes a person structure and gets the 3rd favourite number from the FavNums slice. The and Function​ The and function returns the boolean AND of its arguments by returning the first empty argument or the last argument. and x y behaves logically as if x then y else x . Consider the following go code type User struct { Admin bool } type ViewData struct { *User } Pass a ViewData with a User that has Admin set true to the following template {{if and .User .User.Admin}} You are an admin user! {{else}} Access denied! {{end}} The result will be You are an admin user!. However if the ViewData did not include a *User object or Admin was set as false then the result will be Access denied!. The or Function​ The or function operates similarly to the and function however will stop at the first true. or x y is equivalent to if x then x else y so y will never be evaluated if x is not empty. The not Function​ The not function returns the boolean negation of the argument. {{ if not .Authenticated}} Access Denied! {{ end }}","s":"Template Functions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-functions","p":1169},{"i":1186,"t":"Comparisons​ The html/template package provides a variety of functions to do comparisons between operators. The operators may only be basic types or named basic types such as type Temp float32 Remember that template functions take the form {{ function arg1 arg2 }}. eq Returns the result of arg1 == arg2 ne Returns the result of arg1 != arg2 lt Returns the result of arg1 < arg2 le Returns the result of arg1 <= arg2 gt Returns the result of arg1 > arg2 ge Returns the result of arg1 >= arg2 Of special note eq can be used with two or more arguments by comparing all arguments to the first. {{ eq arg1 arg2 arg3 arg4}} will result in the following logical expression: arg1==arg2 || arg1==arg3 || arg1==arg4","s":"Template Comparison Functions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#template-comparison-functions","p":1169},{"i":1188,"t":"Nesting Templates​ Nested templates can be used for parts of code frequently used across templates, a footer or header for example. Rather than updating each template separately we can use a nested template that all other templates can use. You can define a template as follows: {{define \"footer\"}}

Here is the footer

{{end}} A template named β€œfooter” is defined which can be used in other templates like so to add the footer template content into the other template: {{template \"footer\"}} Passing Variables between Templates​ The template action used to include nested templates also allows a second parameter to pass data to the nested template. // Define a nested template called header {{define \"header\"}}

{{.}}

{{end}} // Call template and pass a name parameter {{range .Items}}
{{template \"header\" .Name}} ${{.Price}}
{{end}} We use the same range to loop through Items as before but we pass the name to the header template each time in this simple example. Creating Layouts​ Glob patterns specify sets of filenames with wildcard characters. The template.ParseGlob(pattern string) function will parse all templates that match the string pattern. template.ParseFiles(files...) can also be used with a list of file names. The templates are named by default based on the base names of the argument files. This mean views/layouts/hello.gohtml will have the name hello.gohtml . If the template has a `{{define β€œtemplateName”}} within it then that name will be usable. A specific template can be executed using t.ExecuteTemplate(w, \"templateName\", nil) . t is an object of type Template, w is type io.Writer such as an http.ResponseWriter, Then there is the name of the template to execute, and finally passing any data to the template, in this case a nil value. Example main.go file // Omitted imports & package var LayoutDir string = \"views/layouts\" var bootstrap *template.Template func main() { var err error bootstrap, err = template.ParseGlob(LayoutDir + \"/*.gohtml\") if err != nil { panic(err) } http.HandleFunc(\"/\", handler) http.ListenAndServe(\":8080\", nil) } func handler(w http.ResponseWriter, r *http.Request) { bootstrap.ExecuteTemplate(w, \"bootstrap\", nil) } All .gohtml files are parsed in main. When route / is reached the template defined as bootstrap is executed using the handler function. Example views/layouts/bootstrap.gohtml file {{define \"bootstrap\"}} Go Templates

Filler header

Filler paragraph

{{end}}","s":"Nested Templates and Layouts","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#nested-templates-and-layouts","p":1169},{"i":1190,"t":"Function Variables (calling struct methods)​ We can use templates to call the methods of objects in the template to return data. Consider the User struct with the following method. type User struct { ID int Email string } func (u User) HasPermission(feature string) bool { if feature == \"feature-a\" { return true } else { return false } } When a type User has been passed to the template we can then call this method from the template. {{if .User.HasPermission \"feature-a\"}}

Feature A

Some other stuff here...

{{else}}

Feature A

To enable Feature A please upgrade your plan

{{end}} The template checks if the User HasPermission for the feature and renders depending on the result. Function Variables (call)​ If the Method HasPermission has to change at times then the Function Variables (Methods) implementation may not fit the design. Instead a HasPermission func(string) bool attribute can be added on the User type. This can then have a function assigned to it at creation. // Structs type ViewData struct { User User } type User struct { ID int Email string HasPermission func(string) bool } // Example of creating a ViewData vd := ViewData{ User: User{ ID: 1, Email: \"curtis.vermeeren@gmail.com\", // Create the HasPermission function HasPermission: func(feature string) bool { if feature == \"feature-b\" { return true } return false }, }, } // Executing the ViewData with the template err := testTemplate.Execute(w, vd) We need to tell the Go template that we want to call this function so we must change the template from the Function Variables (Methods) implementation to do this. We use the call keyword supplied by the go html/template package. Changing the previous template to use call results in: {{if (call .User.HasPermission \"feature-b\")}}

Feature B

Some other stuff here...

{{else}}

Feature B

To enable Feature B please upgrade your plan

{{end}} Custom Functions​ Another way to call functions is to create custom functions with template.FuncMap . This method creates global methods that can be used throughout the entire application. FuncMap has type map[string]interface{} mapping a string, the function name, to a function. The mapped functions must have either a single return value, or two return values where the second has type error. // Creating a template with function hasPermission testTemplate, err = template.New(\"hello.gohtml\").Funcs(template.FuncMap{ \"hasPermission\": func(user User, feature string) bool { if user.ID == 1 && feature == \"feature-a\" { return true } return false }, }).ParseFiles(\"hello.gohtml\") Here the function to check if a user has permission for a feature is mapped to the string \"hasPermission\" and stored in the FuncMap. Note that the custom functions must be created before calling ParseFiles() The function could be executed in the template as follows: {{ if hasPermission .User \"feature-a\" }} The .User and string \"feature-a\" are both passed to hasPermission as arguments. Custom Functions (Globally)​ The previous two methods of custom functions rely on .User being passed to the template. This works in many cases but in a large application passing too many objects to a template can become difficult to maintain across many templates. We can change the implementation of the custom function to work without the .User being passed. Using a similar feature example as the other 2 sections first you would have to create a default hasPermission function and define it in the template’s function map. testTemplate, err = template.New(\"hello.gohtml\").Funcs(template.FuncMap{ \"hasPermission\": func(feature string) bool { return false }, }).ParseFiles(\"hello.gohtml\") This function could be placed in main() or somewhere that ensures the default hasPermission is created in the hello.gohtml function map. The default function just returns false but it defines the function and implementation that doesn’t require User . Next a closure could be used to redefine the hasPermission function. It would use the User data available when it is created in a handler rather than having User data passed to it. Within the handler for the template you can redefine any functions to use the information available. func handler(w http.ResponseWriter, r *http.Request) { w.Header().Set(\"Content-Type\", \"text/html\") user := User{ ID: 1, Email: \"Curtis.vermeeren@gmail.com\", } vd := ViewData{} err := testTemplate.Funcs(template.FuncMap{ \"hasPermission\": func(feature string) bool { if user.ID == 1 && feature == \"feature-a\" { return true } return false }, }).Execute(w, vd) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } } In this handler a User is created with ID and Email, Then a ViewData is created without passing the user to it. The hasPermission function is redefined using user.ID which is available when the function is created. {{if hasPermission \"feature-a\"}} can be used in a template without having to pass a User to the template as the User object in the handler is used instead.","s":"Templates Calling Functions","u":"/template/html/TEMPLATES_CHEATSHEET","h":"#templates-calling-functions","p":1169},{"i":1192,"t":"Jet is a template engine create by cloudykit, to see the original syntax documentation please click here","s":"Jet","u":"/template/jet/","h":"","p":1191},{"i":1194,"t":"./views/index.jet {{include \"partials/header\"}}

{{ Title }}

{{include \"partials/footer\"}} ./views/partials/header.jet

Header

./views/partials/footer.jet

Footer

./views/layouts/main.jet Title {{ embed() }} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/jet/v2\" ) func main() { // Create a new engine engine := jet.New(\"./views\", \".jet\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := jet.NewFileSystem(http.Dir(\"./views\", \".jet\")) // Pass the engine to the views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/jet/","h":"#basic-example","p":1191},{"i":1196,"t":"Mustache is a template engine created by hoisie/cbroglie, to see the original syntax documentation please click here","s":"Mustache","u":"/template/mustache/","h":"","p":1195},{"i":1198,"t":"./views/index.mustache {{> views/partials/header }}

{{Title}}

{{> views/partials/footer }} ./views/partials/header.mustache

Header

./views/partials/footer.mustache

Footer

./views/layouts/main.mustache Main {{{embed}}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/mustache/v2\" ) func main() { // Create a new engine engine := mustache.New(\"./views\", \".mustache\") // Or from an embedded system // Note that with an embedded system the partials included from template files must be // specified relative to the filesystem's root, not the current working directory // engine := mustache.NewFileSystem(http.Dir(\"./views\", \".mustache\"), \".mustache\") // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/mustache/","h":"#basic-example","p":1195},{"i":1200,"t":"Pug is a template engine create by joker, to see the original syntax documentation please click here","s":"Pug","u":"/template/pug/","h":"","p":1199},{"i":1202,"t":"./views/index.pug include partials/header.pug h1 #{.Title} include partials/footer.pug ./views/partials/header.pug h2 Header ./views/partials/footer.pug h2 Footer ./views/layouts/main.pug doctype html html head title Main include ../partials/meta.pug body | {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/pug/v2\" // \"net/http\" // embedded system ) func main() { // Create a new engine engine := pug.New(\"./views\", \".pug\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := pug.NewFileSystem(http.Dir(\"./views\", \".pug\")) // Pass the engine to the views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/pug/","h":"#basic-example","p":1199},{"i":1204,"t":"Slim is a template engine created by mattn, to see the original syntax documentation please click here","s":"Slim","u":"/template/slim/","h":"","p":1203},{"i":1206,"t":"./views/index.slim == render(\"partials/header.slim\") h1 = Title == render(\"partials/footer.slim\") ./views/partials/header.slim h2 = Header ./views/partials/footer.slim h2 = Footer ./views/layouts/main.slim doctype html html head title Main include ../partials/meta.slim body | {{embed}} package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/slim/v2\" // \"net/http\" // embedded system ) func main() { // Create a new engine engine := slim.New(\"./views\", \".slim\") // Or from an embedded system // See github.com/gofiber/embed for examples // engine := slim.NewFileSystem(http.Dir(\"./views\", \".slim\")) // Pass the engine to the Views app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/layout\", func(c *fiber.Ctx) error { // Render index within layouts/main return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }, \"layouts/main\") }) log.Fatal(app.Listen(\":3000\")) }","s":"Basic Example","u":"/template/slim/","h":"#basic-example","p":1203},{"i":1208,"t":"An online API documentation with examples so you can start building web apps with Fiber right away! Fiber is an Express inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development with zero memory allocation and performance in mind. These docs are for Fiber v2, which was released on September 15th, 2020.","s":"πŸ‘‹ Welcome","u":"/","h":"","p":1207},{"i":1210,"t":"First of all, download and install Go. 1.17 or higher is required. Installation is done using the go get command: go get github.com/gofiber/fiber/v2","s":"Installation","u":"/","h":"#installation","p":1207},{"i":1212,"t":"Some values returned from *fiber.Ctx are not immutable by default. Because fiber is optimized for high-performance, values returned from fiber.Ctx are not immutable by default and will be re-used across requests. As a rule of thumb, you must only use context values within the handler, and you must not keep any references. As soon as you return from the handler, any values you have obtained from the context will be re-used in future requests and will change below your feet. Here is an example: func handler(c *fiber.Ctx) error { // Variable is only valid within this handler result := c.Params(\"foo\") // ... } If you need to persist such values outside the handler, make copies of their underlying buffer using the copy builtin. Here is an example for persisting a string: func handler(c *fiber.Ctx) error { // Variable is only valid within this handler result := c.Params(\"foo\") // Make a copy buffer := make([]byte, len(result)) copy(buffer, result) resultCopy := string(buffer) // Variable is now valid forever // ... } We created a custom CopyString function that does the above and is available under gofiber/utils. app.Get(\"/:foo\", func(c *fiber.Ctx) error { // Variable is now immutable result := utils.CopyString(c.Params(\"foo\")) // ... }) Alternatively, you can also use the Immutable setting. It will make all values returned from the context immutable, allowing you to persist them anywhere. Of course, this comes at the cost of performance. app := fiber.New(fiber.Config{ Immutable: true, }) For more information, please check #426 and #185.","s":"Zero Allocation","u":"/","h":"#zero-allocation","p":1207},{"i":1214,"t":"Embedded below is essentially the most straightforward Fiber app you can create: package main import \"github.com/gofiber/fiber/v2\" func main() { app := fiber.New() app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) app.Listen(\":3000\") } go run server.go Browse to http://localhost:3000 and you should see Hello, World! on the page.","s":"Hello, World!","u":"/","h":"#hello-world","p":1207},{"i":1216,"t":"Routing refers to determining how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (GET, PUT, POST, etc.). Each route can have multiple handler functions that are executed when the route is matched. Route definition takes the following structures: // Function signature app.Method(path string, ...func(*fiber.Ctx) error) app is an instance of Fiber Method is an HTTP request method: GET, PUT, POST, etc. path is a virtual path on the server func(*fiber.Ctx) error is a callback function containing the Context executed when the route is matched Simple route // Respond with \"Hello, World!\" on root path, \"/\" app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) Parameters // GET http://localhost:8080/hello%20world app.Get(\"/:value\", func(c *fiber.Ctx) error { return c.SendString(\"value: \" + c.Params(\"value\")) // => Get request with value: hello world }) Optional parameter // GET http://localhost:3000/john app.Get(\"/:name?\", func(c *fiber.Ctx) error { if c.Params(\"name\") != \"\" { return c.SendString(\"Hello \" + c.Params(\"name\")) // => Hello john } return c.SendString(\"Where is john?\") }) Wildcards // GET http://localhost:3000/api/user/john app.Get(\"/api/*\", func(c *fiber.Ctx) error { return c.SendString(\"API path: \" + c.Params(\"*\")) // => API path: user/john })","s":"Basic routing","u":"/","h":"#basic-routing","p":1207},{"i":1218,"t":"To serve static files such as images, CSS, and JavaScript files, replace your function handler with a file or directory string. Function signature: app.Static(prefix, root string, config ...Static) Use the following code to serve files in a directory named ./public: app := fiber.New() app.Static(\"/\", \"./public\") app.Listen(\":3000\") Now, you can load the files that are in the ./public directory: http://localhost:8080/hello.html http://localhost:8080/js/jquery.js http://localhost:8080/css/style.css","s":"Static files","u":"/","h":"#static-files","p":1207},{"i":1220,"t":"For more information on how to build APIs in Go with Fiber, please check out this excellent article on building an express-style API in Go with Fiber.","s":"Note","u":"/","h":"#note","p":1207},{"i":1223,"t":"Use the Static method to serve static files such as images, CSS, and JavaScript. info By default, Static will serve index.html files in response to a request on a directory. Signature func (app *App) Static(prefix, root string, config ...Static) Router Use the following code to serve files in a directory named ./public app.Static(\"/\", \"./public\") // => http://localhost:3000/hello.html // => http://localhost:3000/js/jquery.js // => http://localhost:3000/css/style.css Examples // Serve files from multiple directories app.Static(\"/\", \"./public\") // Serve files from \"./files\" directory: app.Static(\"/\", \"./files\") You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below: Examples app.Static(\"/static\", \"./public\") // => http://localhost:3000/static/hello.html // => http://localhost:3000/static/js/jquery.js // => http://localhost:3000/static/css/style.css If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings. fiber.Static{} // Static defines configuration options when defining static assets. type Static struct { // When set to true, the server tries minimizing CPU usage by caching compressed files. // This works differently than the github.com/gofiber/compression middleware. // Optional. Default value false Compress bool `json:\"compress\"` // When set to true, enables byte range requests. // Optional. Default value false ByteRange bool `json:\"byte_range\"` // When set to true, enables directory browsing. // Optional. Default value false. Browse bool `json:\"browse\"` // When set to true, enables direct download. // Optional. Default value false. Download bool `json:\"download\"` // The name of the index file for serving a directory. // Optional. Default value \"index.html\". Index string `json:\"index\"` // Expiration duration for inactive file handlers. // Use a negative time.Duration to disable it. // // Optional. Default value 10 * time.Second. CacheDuration time.Duration `json:\"cache_duration\"` // The value for the Cache-Control HTTP-header // that is set on the file response. MaxAge is defined in seconds. // // Optional. Default value 0. MaxAge int `json:\"max_age\"` // ModifyResponse defines a function that allows you to alter the response. // // Optional. Default: nil ModifyResponse Handler // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *Ctx) bool } Example // Custom config app.Static(\"/\", \"./public\", fiber.Static{ Compress: true, ByteRange: true, Browse: true, Index: \"john.html\", CacheDuration: 10 * time.Second, MaxAge: 3600, })","s":"Static","u":"/api/app","h":"#static","p":1221},{"i":1225,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Route Handlers","u":"/api/app","h":"#route-handlers","p":1221},{"i":1227,"t":"You can Mount Fiber instance by creating a *Mount Signature func (a *App) Mount(prefix string, app *App) Router Examples func main() { app := fiber.New() micro := fiber.New() app.Mount(\"/john\", micro) // GET /john/doe -> 200 OK micro.Get(\"/doe\", func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusOK) }) log.Fatal(app.Listen(\":3000\")) }","s":"Mount","u":"/api/app","h":"#mount","p":1221},{"i":1229,"t":"The MountPath property contains one or more path patterns on which a sub-app was mounted. Signature func (app *App) MountPath() string Examples func main() { app := fiber.New() one := fiber.New() two := fiber.New() three := fiber.New() two.Mount(\"/three\", three) one.Mount(\"/two\", two) app.Mount(\"/one\", one) one.MountPath() // \"/one\" two.MountPath() // \"/one/two\" three.MountPath() // \"/one/two/three\" app.MountPath() // \"\" } caution Mounting order is important for MountPath. If you want to get mount paths properly, you should start mounting from the deepest app.","s":"MountPath","u":"/api/app","h":"#mountpath","p":1221},{"i":1231,"t":"You can group routes by creating a *Group struct. Signature func (app *App) Group(prefix string, handlers ...Handler) Router Examples func main() { app := fiber.New() api := app.Group(\"/api\", handler) // /api v1 := api.Group(\"/v1\", handler) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", handler) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) }","s":"Group","u":"/api/app","h":"#group","p":1221},{"i":1233,"t":"You can define routes with a common prefix inside the common function. Signature func (app *App) Route(prefix string, fn func(router Router), name ...string) Router Examples func main() { app := fiber.New() app.Route(\"/test\", func(api fiber.Router) { api.Get(\"/foo\", handler).Name(\"foo\") // /test/foo (name: test.foo) api.Get(\"/bar\", handler).Name(\"bar\") // /test/bar (name: test.bar) }, \"test.\") log.Fatal(app.Listen(\":3000\")) }","s":"Route","u":"/api/app","h":"#route","p":1221},{"i":1235,"t":"Server returns the underlying fasthttp server Signature func (app *App) Server() *fasthttp.Server Examples func main() { app := fiber.New() app.Server().MaxConnsPerIP = 1 // ... }","s":"Server","u":"/api/app","h":"#server","p":1221},{"i":1237,"t":"Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners and then waits indefinitely for all connections to return to idle before shutting down. ShutdownWithTimeout will forcefully close any active connections after the timeout expires. ShutdownWithContext shuts down the server including by force if the context's deadline is exceeded. func (app *App) Shutdown() error func (app *App) ShutdownWithTimeout(timeout time.Duration) error func (app *App) ShutdownWithContext(ctx context.Context) error","s":"Server Shutdown","u":"/api/app","h":"#server-shutdown","p":1221},{"i":1239,"t":"This method returns the amount of registered handlers. Signature func (app *App) HandlersCount() uint32","s":"HandlersCount","u":"/api/app","h":"#handlerscount","p":1221},{"i":1241,"t":"This method returns the original router stack Signature func (app *App) Stack() [][]*Route Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/john/:age\", handler) app.Post(\"/register\", handler) data, _ := json.MarshalIndent(app.Stack(), \"\", \" \") fmt.Println(string(data)) app.Listen(\":3000\") } Result [ [ { \"method\": \"GET\", \"path\": \"/john/:age\", \"params\": [ \"age\" ] } ], [ { \"method\": \"HEAD\", \"path\": \"/john/:age\", \"params\": [ \"age\" ] } ], [ { \"method\": \"POST\", \"path\": \"/register\", \"params\": null } ] ]","s":"Stack","u":"/api/app","h":"#stack","p":1221},{"i":1243,"t":"This method assigns the name of latest created route. Signature func (app *App) Name(name string) Router Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/\", handler) app.Name(\"index\") app.Get(\"/doe\", handler).Name(\"home\") app.Trace(\"/tracer\", handler).Name(\"tracert\") app.Delete(\"/delete\", handler).Name(\"delete\") a := app.Group(\"/a\") a.Name(\"fd.\") a.Get(\"/test\", handler).Name(\"test\") data, _ := json.MarshalIndent(app.Stack(), \"\", \" \") fmt.Print(string(data)) app.Listen(\":3000\") } Result [ [ { \"method\": \"GET\", \"name\": \"index\", \"path\": \"/\", \"params\": null }, { \"method\": \"GET\", \"name\": \"home\", \"path\": \"/doe\", \"params\": null }, { \"method\": \"GET\", \"name\": \"fd.test\", \"path\": \"/a/test\", \"params\": null } ], [ { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/\", \"params\": null }, { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/doe\", \"params\": null }, { \"method\": \"HEAD\", \"name\": \"\", \"path\": \"/a/test\", \"params\": null } ], null, null, [ { \"method\": \"DELETE\", \"name\": \"delete\", \"path\": \"/delete\", \"params\": null } ], null, null, [ { \"method\": \"TRACE\", \"name\": \"tracert\", \"path\": \"/tracer\", \"params\": null } ], null ]","s":"Name","u":"/api/app","h":"#name","p":1221},{"i":1245,"t":"This method gets the route by name. Signature func (app *App) GetRoute(name string) Route Examples var handler = func(c *fiber.Ctx) error { return nil } func main() { app := fiber.New() app.Get(\"/\", handler).Name(\"index\") data, _ := json.MarshalIndent(app.GetRoute(\"index\"), \"\", \" \") fmt.Print(string(data)) app.Listen(\":3000\") } Result { \"method\": \"GET\", \"name\": \"index\", \"path\": \"/\", \"params\": null }","s":"GetRoute","u":"/api/app","h":"#getroute","p":1221},{"i":1247,"t":"This method gets all routes. Signature func (app *App) GetRoutes(filterUseOption ...bool) []Route When filterUseOption equal to true, it will filter the routes registered by the middleware. Examples func main() { app := fiber.New() app.Post(\"/\", func (c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }).Name(\"index\") data, _ := json.MarshalIndent(app.GetRoutes(true), \"\", \" \") fmt.Print(string(data)) } Result [ { \"method\": \"POST\", \"name\": \"index\", \"path\": \"/\", \"params\": null } ]","s":"GetRoutes","u":"/api/app","h":"#getroutes","p":1221},{"i":1249,"t":"Config returns the app config as value ( read-only ). Signature func (app *App) Config() Config","s":"Config","u":"/api/app","h":"#config","p":1221},{"i":1251,"t":"Handler returns the server handler that can be used to serve custom *fasthttp.RequestCtx requests. Signature func (app *App) Handler() fasthttp.RequestHandler","s":"Handler","u":"/api/app","h":"#handler","p":1221},{"i":1253,"t":"Listen serves HTTP requests from the given address. Signature func (app *App) Listen(addr string) error Examples // Listen on port :8080 app.Listen(\":8080\") // Custom host app.Listen(\"127.0.0.1:8080\")","s":"Listen","u":"/api/app","h":"#listen","p":1221},{"i":1255,"t":"ListenTLS serves HTTPs requests from the given address using certFile and keyFile paths to as TLS certificate and key file. Signature func (app *App) ListenTLS(addr, certFile, keyFile string) error Examples app.ListenTLS(\":443\", \"./cert.pem\", \"./cert.key\"); Using ListenTLS defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, Certificates: []tls.Certificate{ cert, }, }","s":"ListenTLS","u":"/api/app","h":"#listentls","p":1221},{"i":1257,"t":"Signature func (app *App) ListenTLS(addr string, cert tls.Certificate) error Examples app.ListenTLSWithCertificate(\":443\", cert); Using ListenTLSWithCertificate defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, Certificates: []tls.Certificate{ cert, }, }","s":"ListenTLSWithCertificate","u":"/api/app","h":"#listentlswithcertificate","p":1221},{"i":1259,"t":"ListenMutualTLS serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file Signature func (app *App) ListenMutualTLS(addr, certFile, keyFile, clientCertFile string) error Examples app.ListenMutualTLS(\":443\", \"./cert.pem\", \"./cert.key\", \"./ca-chain-cert.pem\"); Using ListenMutualTLS defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, ClientAuth: tls.RequireAndVerifyClientCert, ClientCAs: clientCertPool, Certificates: []tls.Certificate{ cert, }, }","s":"ListenMutualTLS","u":"/api/app","h":"#listenmutualtls","p":1221},{"i":1261,"t":"ListenMutualTLSWithCertificate serves HTTPs requests from the given address using certFile, keyFile and clientCertFile are the paths to TLS certificate and key file Signature func (app *App) ListenMutualTLSWithCertificate(addr string, cert tls.Certificate, clientCertPool *x509.CertPool) error Examples app.ListenMutualTLSWithCertificate(\":443\", cert, clientCertPool); Using ListenMutualTLSWithCertificate defaults to the following config ( use Listener to provide your own config ) Default *tls.Config &tls.Config{ MinVersion: tls.VersionTLS12, ClientAuth: tls.RequireAndVerifyClientCert, ClientCAs: clientCertPool, Certificates: []tls.Certificate{ cert, }, }","s":"ListenMutualTLSWithCertificate","u":"/api/app","h":"#listenmutualtlswithcertificate","p":1221},{"i":1263,"t":"You can pass your own net.Listener using the Listener method. This method can be used to enable TLS/HTTPS with a custom tls.Config. Signature func (app *App) Listener(ln net.Listener) error Examples ln, _ := net.Listen(\"tcp\", \":3000\") cer, _:= tls.LoadX509KeyPair(\"server.crt\", \"server.key\") ln = tls.NewListener(ln, &tls.Config{Certificates: []tls.Certificate{cer}}) app.Listener(ln)","s":"Listener","u":"/api/app","h":"#listener","p":1221},{"i":1265,"t":"Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 1s if you want to disable a timeout altogether, pass -1 as a second argument. Signature func (app *App) Test(req *http.Request, msTimeout ...int) (*http.Response, error) Examples // Create route with GET method for test: app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(c.BaseURL()) // => http://google.com fmt.Println(c.Get(\"X-Custom-Header\")) // => hi return c.SendString(\"hello, World!\") }) // http.Request req := httptest.NewRequest(\"GET\", \"http://google.com\", nil) req.Header.Set(\"X-Custom-Header\", \"hi\") // http.Response resp, _ := app.Test(req) // Do something with results: if resp.StatusCode == fiber.StatusOK { body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) // => Hello, World! }","s":"Test","u":"/api/app","h":"#test","p":1221},{"i":1267,"t":"Hooks is a method to return hooks property. Signature func (app *App) Hooks() *Hooks","s":"Hooks","u":"/api/app","h":"#hooks","p":1221},{"i":1270,"t":"Start a http request with http method and url. Signatures // Client http methods func (c *Client) Get(url string) *Agent func (c *Client) Head(url string) *Agent func (c *Client) Post(url string) *Agent func (c *Client) Put(url string) *Agent func (c *Client) Patch(url string) *Agent func (c *Client) Delete(url string) *Agent","s":"Start request","u":"/api/client","h":"#start-request","p":1268},{"i":1272,"t":"Agent is built on top of FastHTTP's HostClient which has lots of convenient helper methods such as dedicated methods for request methods.","s":"✨ Agent","u":"/api/client","h":"#-agent","p":1268},{"i":1274,"t":"Parse initializes a HostClient. Parse a := AcquireAgent() req := a.Request() req.Header.SetMethod(MethodGet) req.SetRequestURI(\"http://example.com\") if err := a.Parse(); err != nil { panic(err) } code, body, errs := a.Bytes() // ...","s":"Parse","u":"/api/client","h":"#parse","p":1268},{"i":1276,"t":"Set sets the given key: value header. Signature func (a *Agent) Set(k, v string) *Agent func (a *Agent) SetBytesK(k []byte, v string) *Agent func (a *Agent) SetBytesV(k string, v []byte) *Agent func (a *Agent) SetBytesKV(k []byte, v []byte) *Agent Example agent.Set(\"k1\", \"v1\"). SetBytesK([]byte(\"k1\"), \"v1\"). SetBytesV(\"k1\", []byte(\"v1\")). SetBytesKV([]byte(\"k2\"), []byte(\"v2\")) // ...","s":"Set","u":"/api/client","h":"#set","p":1268},{"i":1278,"t":"Add adds the given key: value header. Multiple headers with the same key may be added with this function. Signature func (a *Agent) Add(k, v string) *Agent func (a *Agent) AddBytesK(k []byte, v string) *Agent func (a *Agent) AddBytesV(k string, v []byte) *Agent func (a *Agent) AddBytesKV(k []byte, v []byte) *Agent Example agent.Add(\"k1\", \"v1\"). AddBytesK([]byte(\"k1\"), \"v1\"). AddBytesV(\"k1\", []byte(\"v1\")). AddBytesKV([]byte(\"k2\"), []byte(\"v2\")) // Headers: // K1: v1 // K1: v1 // K1: v1 // K2: v2","s":"Add","u":"/api/client","h":"#add","p":1268},{"i":1280,"t":"ConnectionClose adds the Connection: close header. Signature func (a *Agent) ConnectionClose() *Agent Example agent.ConnectionClose() // ...","s":"ConnectionClose","u":"/api/client","h":"#connectionclose","p":1268},{"i":1282,"t":"UserAgent sets User-Agent header value. Signature func (a *Agent) UserAgent(userAgent string) *Agent func (a *Agent) UserAgentBytes(userAgent []byte) *Agent Example agent.UserAgent(\"fiber\") // ...","s":"UserAgent","u":"/api/client","h":"#useragent","p":1268},{"i":1284,"t":"Cookie sets a cookie in key: value form. Cookies can be used to set multiple cookies. Signature func (a *Agent) Cookie(key, value string) *Agent func (a *Agent) CookieBytesK(key []byte, value string) *Agent func (a *Agent) CookieBytesKV(key, value []byte) *Agent func (a *Agent) Cookies(kv ...string) *Agent func (a *Agent) CookiesBytesKV(kv ...[]byte) *Agent Example agent.Cookie(\"k\", \"v\") agent.Cookies(\"k1\", \"v1\", \"k2\", \"v2\") // ...","s":"Cookie","u":"/api/client","h":"#cookie","p":1268},{"i":1286,"t":"Referer sets the Referer header value. Signature func (a *Agent) Referer(referer string) *Agent func (a *Agent) RefererBytes(referer []byte) *Agent Example agent.Referer(\"https://docs.gofiber.io\") // ...","s":"Referer","u":"/api/client","h":"#referer","p":1268},{"i":1288,"t":"ContentType sets Content-Type header value. Signature func (a *Agent) ContentType(contentType string) *Agent func (a *Agent) ContentTypeBytes(contentType []byte) *Agent Example agent.ContentType(\"custom-type\") // ...","s":"ContentType","u":"/api/client","h":"#contenttype","p":1268},{"i":1290,"t":"Host sets the Host header. Signature func (a *Agent) Host(host string) *Agent func (a *Agent) HostBytes(host []byte) *Agent Example agent.Host(\"example.com\") // ...","s":"Host","u":"/api/client","h":"#host","p":1268},{"i":1292,"t":"QueryString sets the URI query string. Signature func (a *Agent) QueryString(queryString string) *Agent func (a *Agent) QueryStringBytes(queryString []byte) *Agent Example agent.QueryString(\"foo=bar\") // ...","s":"QueryString","u":"/api/client","h":"#querystring","p":1268},{"i":1294,"t":"BasicAuth sets the URI username and password using HTTP Basic Auth. Signature func (a *Agent) BasicAuth(username, password string) *Agent func (a *Agent) BasicAuthBytes(username, password []byte) *Agent Example agent.BasicAuth(\"foo\", \"bar\") // ...","s":"BasicAuth","u":"/api/client","h":"#basicauth","p":1268},{"i":1296,"t":"There are several ways to set request body. Signature func (a *Agent) BodyString(bodyString string) *Agent func (a *Agent) Body(body []byte) *Agent // BodyStream sets request body stream and, optionally body size. // // If bodySize is >= 0, then the bodyStream must provide exactly bodySize bytes // before returning io.EOF. // // If bodySize < 0, then bodyStream is read until io.EOF. // // bodyStream.Close() is called after finishing reading all body data // if it implements io.Closer. // // Note that GET and HEAD requests cannot have body. func (a *Agent) BodyStream(bodyStream io.Reader, bodySize int) *Agent Example agent.BodyString(\"foo=bar\") agent.Body([]byte(\"bar=baz\")) agent.BodyStream(strings.NewReader(\"body=stream\"), -1) // ...","s":"Body","u":"/api/client","h":"#body","p":1268},{"i":1298,"t":"JSON sends a JSON request by setting the Content-Type header to application/json. Signature func (a *Agent) JSON(v interface{}) *Agent Example agent.JSON(fiber.Map{\"success\": true}) // ...","s":"JSON","u":"/api/client","h":"#json","p":1268},{"i":1300,"t":"XML sends an XML request by setting the Content-Type header to application/xml. Signature func (a *Agent) XML(v interface{}) *Agent Example agent.XML(fiber.Map{\"success\": true}) // ...","s":"XML","u":"/api/client","h":"#xml","p":1268},{"i":1302,"t":"Form sends a form request by setting the Content-Type header to application/x-www-form-urlencoded. Signature // Form sends form request with body if args is non-nil. // // It is recommended obtaining args via AcquireArgs and release it // manually in performance-critical code. func (a *Agent) Form(args *Args) *Agent Example args := AcquireArgs() args.Set(\"foo\", \"bar\") agent.Form(args) // ... ReleaseArgs(args)","s":"Form","u":"/api/client","h":"#form","p":1268},{"i":1304,"t":"MultipartForm sends multipart form request by setting the Content-Type header to multipart/form-data. These requests can include key-value's and files. Signature // MultipartForm sends multipart form request with k-v and files. // // It is recommended to obtain args via AcquireArgs and release it // manually in performance-critical code. func (a *Agent) MultipartForm(args *Args) *Agent Example args := AcquireArgs() args.Set(\"foo\", \"bar\") agent.MultipartForm(args) // ... ReleaseArgs(args) Fiber provides several methods for sending files. Note that they must be called before MultipartForm. Boundary​ Boundary sets boundary for multipart form request. Signature func (a *Agent) Boundary(boundary string) *Agent Example agent.Boundary(\"myBoundary\") .MultipartForm(nil) // ... SendFile(s)​ SendFile read a file and appends it to a multipart form request. Sendfiles can be used to append multiple files. Signature func (a *Agent) SendFile(filename string, fieldname ...string) *Agent func (a *Agent) SendFiles(filenamesAndFieldnames ...string) *Agent Example agent.SendFile(\"f\", \"field name\") .SendFiles(\"f1\", \"field name1\", \"f2\"). .MultipartForm(nil) // ... FileData​ FileData appends file data for multipart form request. // FormFile represents multipart form file type FormFile struct { // Fieldname is form file's field name Fieldname string // Name is form file's name Name string // Content is form file's content Content []byte } Signature // FileData appends files for multipart form request. // // It is recommended obtaining formFile via AcquireFormFile and release it // manually in performance-critical code. func (a *Agent) FileData(formFiles ...*FormFile) *Agent Example ff1 := &FormFile{\"filename1\", \"field name1\", []byte(\"content\")} ff2 := &FormFile{\"filename2\", \"field name2\", []byte(\"content\")} agent.FileData(ff1, ff2). MultipartForm(nil) // ...","s":"MultipartForm","u":"/api/client","h":"#multipartform","p":1268},{"i":1306,"t":"Debug mode enables logging request and response detail to io.writer(default is os.Stdout). Signature func (a *Agent) Debug(w ...io.Writer) *Agent Example agent.Debug() // ...","s":"Debug","u":"/api/client","h":"#debug","p":1268},{"i":1308,"t":"Timeout sets request timeout duration. Signature func (a *Agent) Timeout(timeout time.Duration) *Agent Example agent.Timeout(time.Second) // ...","s":"Timeout","u":"/api/client","h":"#timeout","p":1268},{"i":1310,"t":"Reuse enables the Agent instance to be used again after one request. If agent is reusable, then it should be released manually when it is no longer used. Signature func (a *Agent) Reuse() *Agent Example agent.Reuse() // ...","s":"Reuse","u":"/api/client","h":"#reuse","p":1268},{"i":1312,"t":"InsecureSkipVerify controls whether the Agent verifies the server certificate chain and host name. Signature func (a *Agent) InsecureSkipVerify() *Agent Example agent.InsecureSkipVerify() // ...","s":"InsecureSkipVerify","u":"/api/client","h":"#insecureskipverify","p":1268},{"i":1314,"t":"TLSConfig sets tls config. Signature func (a *Agent) TLSConfig(config *tls.Config) *Agent Example // Create tls certificate cer, _ := tls.LoadX509KeyPair(\"pem\", \"key\") config := &tls.Config{ Certificates: []tls.Certificate{cer}, } agent.TLSConfig(config) // ...","s":"TLSConfig","u":"/api/client","h":"#tlsconfig","p":1268},{"i":1316,"t":"MaxRedirectsCount sets max redirect count for GET and HEAD. Signature func (a *Agent) MaxRedirectsCount(count int) *Agent Example agent.MaxRedirectsCount(7) // ...","s":"MaxRedirectsCount","u":"/api/client","h":"#maxredirectscount","p":1268},{"i":1318,"t":"JSONEncoder sets custom json encoder. Signature func (a *Agent) JSONEncoder(jsonEncoder utils.JSONMarshal) *Agent Example agent.JSONEncoder(json.Marshal) // ...","s":"JSONEncoder","u":"/api/client","h":"#jsonencoder","p":1268},{"i":1320,"t":"JSONDecoder sets custom json decoder. Signature func (a *Agent) JSONDecoder(jsonDecoder utils.JSONUnmarshal) *Agent Example agent.JSONDecoder(json.Unmarshal) // ...","s":"JSONDecoder","u":"/api/client","h":"#jsondecoder","p":1268},{"i":1322,"t":"Request returns Agent request instance. Signature func (a *Agent) Request() *Request Example req := agent.Request() // ...","s":"Request","u":"/api/client","h":"#request","p":1268},{"i":1324,"t":"SetResponse sets custom response for the Agent instance. It is recommended obtaining custom response via AcquireResponse and release it manually in performance-critical code. Signature func (a *Agent) SetResponse(customResp *Response) *Agent Example resp := AcquireResponse() agent.SetResponse(resp) // ... ReleaseResponse(resp)","s":"SetResponse","u":"/api/client","h":"#setresponse","p":1268},{"i":1326,"t":"Dest sets custom dest. The contents of dest will be replaced by the response body, if the dest is too small a new slice will be allocated. Signature func (a *Agent) Dest(dest []byte) *Agent { Example agent.Dest(nil) // ...","s":"Dest","u":"/api/client","h":"#dest","p":1268},{"i":1328,"t":"Bytes returns the status code, bytes body and errors of url. Signature func (a *Agent) Bytes() (code int, body []byte, errs []error) Example code, body, errs := agent.Bytes() // ...","s":"Bytes","u":"/api/client","h":"#bytes","p":1268},{"i":1330,"t":"String returns the status code, string body and errors of url. Signature func (a *Agent) String() (int, string, []error) Example code, body, errs := agent.String() // ...","s":"String","u":"/api/client","h":"#string","p":1268},{"i":1332,"t":"Struct returns the status code, bytes body and errors of url. And bytes body will be unmarshalled to given v. Signature func (a *Agent) Struct(v interface{}) (code int, body []byte, errs []error) Example var d data code, body, errs := agent.Struct(&d) // ...","s":"Struct","u":"/api/client","h":"#struct","p":1268},{"i":1334,"t":"RetryIf controls whether a retry should be attempted after an error. By default, will use isIdempotent function from fasthttp Signature func (a *Agent) RetryIf(retryIf RetryIfFunc) *Agent Example agent.Get(\"https://example.com\").RetryIf(func (req *fiber.Request) bool { return req.URI() == \"https://example.com\" }) // ...","s":"RetryIf","u":"/api/client","h":"#retryif","p":1268},{"i":1336,"t":"HTTP methods were copied from net/http. const ( MethodGet = \"GET\" // RFC 7231, 4.3.1 MethodHead = \"HEAD\" // RFC 7231, 4.3.2 MethodPost = \"POST\" // RFC 7231, 4.3.3 MethodPut = \"PUT\" // RFC 7231, 4.3.4 MethodPatch = \"PATCH\" // RFC 5789 MethodDelete = \"DELETE\" // RFC 7231, 4.3.5 MethodConnect = \"CONNECT\" // RFC 7231, 4.3.6 MethodOptions = \"OPTIONS\" // RFC 7231, 4.3.7 MethodTrace = \"TRACE\" // RFC 7231, 4.3.8 methodUse = \"USE\" ) MIME types that are commonly used const ( MIMETextXML = \"text/xml\" MIMETextHTML = \"text/html\" MIMETextPlain = \"text/plain\" MIMEApplicationXML = \"application/xml\" MIMEApplicationJSON = \"application/json\" MIMEApplicationJavaScript = \"application/javascript\" MIMEApplicationForm = \"application/x-www-form-urlencoded\" MIMEOctetStream = \"application/octet-stream\" MIMEMultipartForm = \"multipart/form-data\" MIMETextXMLCharsetUTF8 = \"text/xml; charset=utf-8\" MIMETextHTMLCharsetUTF8 = \"text/html; charset=utf-8\" MIMETextPlainCharsetUTF8 = \"text/plain; charset=utf-8\" MIMEApplicationXMLCharsetUTF8 = \"application/xml; charset=utf-8\" MIMEApplicationJSONCharsetUTF8 = \"application/json; charset=utf-8\" MIMEApplicationJavaScriptCharsetUTF8 = \"application/javascript; charset=utf-8\" ) HTTP status codes were copied from net/http. const ( StatusContinue = 100 // RFC 7231, 6.2.1 StatusSwitchingProtocols = 101 // RFC 7231, 6.2.2 StatusProcessing = 102 // RFC 2518, 10.1 StatusEarlyHints = 103 // RFC 8297 StatusOK = 200 // RFC 7231, 6.3.1 StatusCreated = 201 // RFC 7231, 6.3.2 StatusAccepted = 202 // RFC 7231, 6.3.3 StatusNonAuthoritativeInformation = 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 StatusTemporaryRedirect = 307 // RFC 7231, 6.4.7 StatusPermanentRedirect = 308 // RFC 7538, 3 StatusBadRequest = 400 // RFC 7231, 6.5.1 StatusUnauthorized = 401 // RFC 7235, 3.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 StatusMisdirectedRequest = 421 // RFC 7540, 9.1.2 StatusUnprocessableEntity = 422 // RFC 4918, 11.2 StatusLocked = 423 // RFC 4918, 11.3 StatusFailedDependency = 424 // RFC 4918, 11.4 StatusTooEarly = 425 // RFC 8470, 5.2. StatusUpgradeRequired = 426 // RFC 7231, 6.5.15 StatusPreconditionRequired = 428 // RFC 6585, 3 StatusTooManyRequests = 429 // RFC 6585, 4 StatusRequestHeaderFieldsTooLarge = 431 // RFC 6585, 5 StatusUnavailableForLegalReasons = 451 // RFC 7725, 3 StatusInternalServerError = 500 // RFC 7231, 6.6.1 StatusNotImplemented = 501 // RFC 7231, 6.6.2 StatusBadGateway = 502 // RFC 7231, 6.6.3 StatusServiceUnavailable = 503 // RFC 7231, 6.6.4 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 ) Errors var ( ErrBadRequest = NewError(StatusBadRequest) // RFC 7231, 6.5.1 ErrUnauthorized = NewError(StatusUnauthorized) // RFC 7235, 3.1 ErrPaymentRequired = NewError(StatusPaymentRequired) // RFC 7231, 6.5.2 ErrForbidden = NewError(StatusForbidden) // RFC 7231, 6.5.3 ErrNotFound = NewError(StatusNotFound) // RFC 7231, 6.5.4 ErrMethodNotAllowed = NewError(StatusMethodNotAllowed) // RFC 7231, 6.5.5 ErrNotAcceptable = NewError(StatusNotAcceptable) // RFC 7231, 6.5.6 ErrProxyAuthRequired = NewError(StatusProxyAuthRequired) // RFC 7235, 3.2 ErrRequestTimeout = NewError(StatusRequestTimeout) // RFC 7231, 6.5.7 ErrConflict = NewError(StatusConflict) // RFC 7231, 6.5.8 ErrGone = NewError(StatusGone) // RFC 7231, 6.5.9 ErrLengthRequired = NewError(StatusLengthRequired) // RFC 7231, 6.5.10 ErrPreconditionFailed = NewError(StatusPreconditionFailed) // RFC 7232, 4.2 ErrRequestEntityTooLarge = NewError(StatusRequestEntityTooLarge) // RFC 7231, 6.5.11 ErrRequestURITooLong = NewError(StatusRequestURITooLong) // RFC 7231, 6.5.12 ErrUnsupportedMediaType = NewError(StatusUnsupportedMediaType) // RFC 7231, 6.5.13 ErrRequestedRangeNotSatisfiable = NewError(StatusRequestedRangeNotSatisfiable) // RFC 7233, 4.4 ErrExpectationFailed = NewError(StatusExpectationFailed) // RFC 7231, 6.5.14 ErrTeapot = NewError(StatusTeapot) // RFC 7168, 2.3.3 ErrMisdirectedRequest = NewError(StatusMisdirectedRequest) // RFC 7540, 9.1.2 ErrUnprocessableEntity = NewError(StatusUnprocessableEntity) // RFC 4918, 11.2 ErrLocked = NewError(StatusLocked) // RFC 4918, 11.3 ErrFailedDependency = NewError(StatusFailedDependency) // RFC 4918, 11.4 ErrTooEarly = NewError(StatusTooEarly) // RFC 8470, 5.2. ErrUpgradeRequired = NewError(StatusUpgradeRequired) // RFC 7231, 6.5.15 ErrPreconditionRequired = NewError(StatusPreconditionRequired) // RFC 6585, 3 ErrTooManyRequests = NewError(StatusTooManyRequests) // RFC 6585, 4 ErrRequestHeaderFieldsTooLarge = NewError(StatusRequestHeaderFieldsTooLarge) // RFC 6585, 5 ErrUnavailableForLegalReasons = NewError(StatusUnavailableForLegalReasons) // RFC 7725, 3 ErrInternalServerError = NewError(StatusInternalServerError) // RFC 7231, 6.6.1 ErrNotImplemented = NewError(StatusNotImplemented) // RFC 7231, 6.6.2 ErrBadGateway = NewError(StatusBadGateway) // RFC 7231, 6.6.3 ErrServiceUnavailable = NewError(StatusServiceUnavailable) // RFC 7231, 6.6.4 ErrGatewayTimeout = NewError(StatusGatewayTimeout) // RFC 7231, 6.6.5 ErrHTTPVersionNotSupported = NewError(StatusHTTPVersionNotSupported) // RFC 7231, 6.6.6 ErrVariantAlsoNegotiates = NewError(StatusVariantAlsoNegotiates) // RFC 2295, 8.1 ErrInsufficientStorage = NewError(StatusInsufficientStorage) // RFC 4918, 11.5 ErrLoopDetected = NewError(StatusLoopDetected) // RFC 5842, 7.2 ErrNotExtended = NewError(StatusNotExtended) // RFC 2774, 7 ErrNetworkAuthenticationRequired = NewError(StatusNetworkAuthenticationRequired) // RFC 6585, 6 ) HTTP Headers were copied from net/http. const ( HeaderAuthorization = \"Authorization\" HeaderProxyAuthenticate = \"Proxy-Authenticate\" HeaderProxyAuthorization = \"Proxy-Authorization\" HeaderWWWAuthenticate = \"WWW-Authenticate\" HeaderAge = \"Age\" HeaderCacheControl = \"Cache-Control\" HeaderClearSiteData = \"Clear-Site-Data\" HeaderExpires = \"Expires\" HeaderPragma = \"Pragma\" HeaderWarning = \"Warning\" HeaderAcceptCH = \"Accept-CH\" HeaderAcceptCHLifetime = \"Accept-CH-Lifetime\" HeaderContentDPR = \"Content-DPR\" HeaderDPR = \"DPR\" HeaderEarlyData = \"Early-Data\" HeaderSaveData = \"Save-Data\" HeaderViewportWidth = \"Viewport-Width\" HeaderWidth = \"Width\" HeaderETag = \"ETag\" HeaderIfMatch = \"If-Match\" HeaderIfModifiedSince = \"If-Modified-Since\" HeaderIfNoneMatch = \"If-None-Match\" HeaderIfUnmodifiedSince = \"If-Unmodified-Since\" HeaderLastModified = \"Last-Modified\" HeaderVary = \"Vary\" HeaderConnection = \"Connection\" HeaderKeepAlive = \"Keep-Alive\" HeaderAccept = \"Accept\" HeaderAcceptCharset = \"Accept-Charset\" HeaderAcceptEncoding = \"Accept-Encoding\" HeaderAcceptLanguage = \"Accept-Language\" HeaderCookie = \"Cookie\" HeaderExpect = \"Expect\" HeaderMaxForwards = \"Max-Forwards\" HeaderSetCookie = \"Set-Cookie\" 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\" HeaderOrigin = \"Origin\" HeaderTimingAllowOrigin = \"Timing-Allow-Origin\" HeaderXPermittedCrossDomainPolicies = \"X-Permitted-Cross-Domain-Policies\" HeaderDNT = \"DNT\" HeaderTk = \"Tk\" HeaderContentDisposition = \"Content-Disposition\" HeaderContentEncoding = \"Content-Encoding\" HeaderContentLanguage = \"Content-Language\" HeaderContentLength = \"Content-Length\" HeaderContentLocation = \"Content-Location\" HeaderContentType = \"Content-Type\" HeaderForwarded = \"Forwarded\" HeaderVia = \"Via\" HeaderXForwardedFor = \"X-Forwarded-For\" HeaderXForwardedHost = \"X-Forwarded-Host\" HeaderXForwardedProto = \"X-Forwarded-Proto\" HeaderXForwardedProtocol = \"X-Forwarded-Protocol\" HeaderXForwardedSsl = \"X-Forwarded-Ssl\" HeaderXUrlScheme = \"X-Url-Scheme\" HeaderLocation = \"Location\" HeaderFrom = \"From\" HeaderHost = \"Host\" HeaderReferer = \"Referer\" HeaderReferrerPolicy = \"Referrer-Policy\" HeaderUserAgent = \"User-Agent\" HeaderAllow = \"Allow\" HeaderServer = \"Server\" HeaderAcceptRanges = \"Accept-Ranges\" HeaderContentRange = \"Content-Range\" HeaderIfRange = \"If-Range\" HeaderRange = \"Range\" HeaderContentSecurityPolicy = \"Content-Security-Policy\" HeaderContentSecurityPolicyReportOnly = \"Content-Security-Policy-Report-Only\" HeaderCrossOriginResourcePolicy = \"Cross-Origin-Resource-Policy\" HeaderExpectCT = \"Expect-CT\" HeaderFeaturePolicy = \"Feature-Policy\" HeaderPublicKeyPins = \"Public-Key-Pins\" HeaderPublicKeyPinsReportOnly = \"Public-Key-Pins-Report-Only\" HeaderStrictTransportSecurity = \"Strict-Transport-Security\" HeaderUpgradeInsecureRequests = \"Upgrade-Insecure-Requests\" HeaderXContentTypeOptions = \"X-Content-Type-Options\" HeaderXDownloadOptions = \"X-Download-Options\" HeaderXFrameOptions = \"X-Frame-Options\" HeaderXPoweredBy = \"X-Powered-By\" HeaderXXSSProtection = \"X-XSS-Protection\" HeaderLastEventID = \"Last-Event-ID\" HeaderNEL = \"NEL\" HeaderPingFrom = \"Ping-From\" HeaderPingTo = \"Ping-To\" HeaderReportTo = \"Report-To\" HeaderTE = \"TE\" HeaderTrailer = \"Trailer\" HeaderTransferEncoding = \"Transfer-Encoding\" HeaderSecWebSocketAccept = \"Sec-WebSocket-Accept\" HeaderSecWebSocketExtensions = \"Sec-WebSocket-Extensions\" HeaderSecWebSocketKey = \"Sec-WebSocket-Key\" HeaderSecWebSocketProtocol = \"Sec-WebSocket-Protocol\" HeaderSecWebSocketVersion = \"Sec-WebSocket-Version\" HeaderAcceptPatch = \"Accept-Patch\" HeaderAcceptPushPolicy = \"Accept-Push-Policy\" HeaderAcceptSignature = \"Accept-Signature\" HeaderAltSvc = \"Alt-Svc\" HeaderDate = \"Date\" HeaderIndex = \"Index\" HeaderLargeAllocation = \"Large-Allocation\" HeaderLink = \"Link\" HeaderPushPolicy = \"Push-Policy\" HeaderRetryAfter = \"Retry-After\" HeaderServerTiming = \"Server-Timing\" HeaderSignature = \"Signature\" HeaderSignedHeaders = \"Signed-Headers\" HeaderSourceMap = \"SourceMap\" HeaderUpgrade = \"Upgrade\" HeaderXDNSPrefetchControl = \"X-DNS-Prefetch-Control\" HeaderXPingback = \"X-Pingback\" HeaderXRequestID = \"X-Request-ID\" HeaderXRequestedWith = \"X-Requested-With\" HeaderXRobotsTag = \"X-Robots-Tag\" HeaderXUACompatible = \"X-UA-Compatible\" )","s":"πŸ“‹ Constants","u":"/api/constants","h":"","p":1335},{"i":1339,"t":"This method creates a new App named instance. You can pass optional config when creating a new instance. Signature func New(config ...Config) *App Example // Default config app := fiber.New() // ...","s":"New","u":"/api/fiber","h":"#new","p":1337},{"i":1341,"t":"You can pass an optional Config when creating a new Fiber instance. Example // Custom config app := fiber.New(fiber.Config{ Prefork: true, CaseSensitive: true, StrictRouting: true, ServerHeader: \"Fiber\", AppName: \"Test App v1.0.1\" }) // ... Config fields Property Type Description Default AppName string This allows to setup app name for the app \"\" BodyLimit int Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response. 4 * 1024 * 1024 CaseSensitive bool When enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same. false ColorScheme Colors You can define custom color scheme. They'll be used for startup message, route list and some middlewares. DefaultColors CompressedFileSuffix string Adds a suffix to the original file name and tries saving the resulting compressed file under the new file name. \".fiber.gz\" Concurrency int Maximum number of concurrent connections. 256 * 1024 DisableDefaultContentType bool When set to true, causes the default Content-Type header to be excluded from the Response. false DisableDefaultDate bool When set to true causes the default date header to be excluded from the response. false DisableHeaderNormalizing bool By default all header names are normalized: conteNT-tYPE -> Content-Type false DisableKeepalive bool Disable keep-alive connections, the server will close incoming connections after sending the first response to the client false DisablePreParseMultipartForm bool Will not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data. false DisableStartupMessage bool When set to true, it will not print out debug information false ETag bool Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled. false EnableIPValidation bool If set to true, c.IP() and c.IPs() will validate IP addresses before returning them. Also, c.IP() will return only the first valid IP rather than just the raw header value that may be a comma seperated string. WARNING: There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header. false EnablePrintRoutes bool EnablePrintRoutes enables print all routes with their method, path, name and handler.. false EnableTrustedProxyCheck bool When set to true, fiber will check whether proxy is trusted, using TrustedProxies list. By default c.Protocol() will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header, c.IP() will get value from ProxyHeader header, c.Hostname() will get value from X-Forwarded-Host header. If EnableTrustedProxyCheck is true, and RemoteIP is in the list of TrustedProxies c.Protocol(), c.IP(), and c.Hostname() will have the same behaviour when EnableTrustedProxyCheck disabled, if RemoteIP isn't in the list, c.Protocol() will return https in case when tls connection is handled by the app, or http otherwise, c.IP() will return RemoteIP() from fasthttp context, c.Hostname() will return fasthttp.Request.URI().Host() false ErrorHandler ErrorHandler ErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests. DefaultErrorHandler GETOnly bool Rejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set. false IdleTimeout time.Duration The maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used. nil Immutable bool When enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue #185. false JSONDecoder utils.JSONUnmarshal Allowing for flexibility in using another json library for decoding. json.Unmarshal JSONEncoder utils.JSONMarshal Allowing for flexibility in using another json library for encoding. json.Marshal Network string Known networks are \"tcp\", \"tcp4\" (IPv4-only), \"tcp6\" (IPv6-only) WARNING: When prefork is set to true, only \"tcp4\" and \"tcp6\" can be chosen. NetworkTCP4 PassLocalsToViews bool PassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our Template Middleware for supported engines. false Prefork bool Enables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding. NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with CMD ./app or CMD [\"sh\", \"-c\", \"/app\"]. For more info, see this issue comment. false ProxyHeader string This will enable c.IP() to return the value of the given header key. By default c.IP()will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. X-Forwarded-*. \"\" ReadBufferSize int per-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies). 4096 ReadTimeout time.Duration The amount of time allowed to read the full request, including the body. The default timeout is unlimited. nil RequestMethods []string RequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish. DefaultMethods ServerHeader string Enables the Server HTTP header with the given value. \"\" StreamRequestBody bool StreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit. false StrictRouting bool When enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same. false TrustedProxies []string Contains the list of trusted proxy IP's. Look at EnableTrustedProxyCheck doc. It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses. []string*__* UnescapePath bool Converts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special characters false Views Views Views is the interface that wraps the Render function. See our Template Middleware for supported engines. nil ViewsLayout string Views Layout is the global layout for all template render until override on Render function. See our Template Middleware for supported engines. \"\" WriteBufferSize int Per-connection buffer size for responses' writing. 4096 WriteTimeout time.Duration The maximum duration before timing out writes of the response. The default timeout is unlimited. nil XMLEncoder utils.XMLMarshal Allowing for flexibility in using another XML library for encoding. xml.Marshal","s":"Config","u":"/api/fiber","h":"#config","p":1337},{"i":1343,"t":"NewError creates a new HTTPError instance with an optional message. Signature func NewError(code int, message ...string) *Error Example app.Get(\"/\", func(c *fiber.Ctx) error { return fiber.NewError(782, \"Custom error message\") })","s":"NewError","u":"/api/fiber","h":"#newerror","p":1337},{"i":1345,"t":"IsChild determines if the current process is a result of Prefork. Signature func IsChild() bool Example // Prefork will spawn child processes app := fiber.New(fiber.Config{ Prefork: true, }) if !fiber.IsChild() { fmt.Println(\"I'm the parent process\") } else { fmt.Println(\"I'm a child process\") } // ...","s":"IsChild","u":"/api/fiber","h":"#ischild","p":1337},{"i":1347,"t":"Converter for net/http handlers to/from Fiber request handlers, special thanks to @arsmn!","s":"Adaptor","u":"/api/middleware/adaptor","h":"","p":1346},{"i":1349,"t":"Name Signature Description HTTPHandler HTTPHandler(h http.Handler) fiber.Handler http.Handler -> fiber.Handler HTTPHandlerFunc HTTPHandlerFunc(h http.HandlerFunc) fiber.Handler http.HandlerFunc -> fiber.Handler HTTPMiddleware HTTPHandlerFunc(mw func(http.Handler) http.Handler) fiber.Handler func(http.Handler) http.Handler -> fiber.Handler FiberHandler FiberHandler(h fiber.Handler) http.Handler fiber.Handler -> http.Handler FiberHandlerFunc FiberHandlerFunc(h fiber.Handler) http.HandlerFunc fiber.Handler -> http.HandlerFunc FiberApp FiberApp(app *fiber.App) http.HandlerFunc Fiber app -> http.HandlerFunc ConvertRequest ConvertRequest(c *fiber.Ctx, forServer bool) (*http.Request, error) fiber.Ctx -> http.Request CopyContextToFiberContext CopyContextToFiberContext(context interface{}, requestContext *fasthttp.RequestCtx) context.Context -> fasthttp.RequestCtx","s":"Signatures","u":"/api/middleware/adaptor","h":"#signatures","p":1346},{"i":1352,"t":"package main import ( \"fmt\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // New fiber app app := fiber.New() // http.Handler -> fiber.Handler app.Get(\"/\", adaptor.HTTPHandler(handler(greet))) // http.HandlerFunc -> fiber.Handler app.Get(\"/func\", adaptor.HTTPHandlerFunc(greet)) // Listen on port 3000 app.Listen(\":3000\") } func handler(f http.HandlerFunc) http.Handler { return http.HandlerFunc(f) } func greet(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, \"Hello World!\") }","s":"net/http to Fiber","u":"/api/middleware/adaptor","h":"#nethttp-to-fiber","p":1346},{"i":1354,"t":"package main import ( \"log\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // New fiber app app := fiber.New() // http middleware -> fiber.Handler app.Use(adaptor.HTTPMiddleware(logMiddleware)) // Listen on port 3000 app.Listen(\":3000\") } func logMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { log.Println(\"log middleware\") next.ServeHTTP(w, r) }) }","s":"net/http middleware to Fiber","u":"/api/middleware/adaptor","h":"#nethttp-middleware-to-fiber","p":1346},{"i":1356,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { // fiber.Handler -> http.Handler http.Handle(\"/\", adaptor.FiberHandler(greet)) // fiber.Handler -> http.HandlerFunc http.HandleFunc(\"/func\", adaptor.FiberHandlerFunc(greet)) // Listen on port 3000 http.ListenAndServe(\":3000\", nil) } func greet(c *fiber.Ctx) error { return c.SendString(\"Hello World!\") }","s":"Fiber Handler to net/http","u":"/api/middleware/adaptor","h":"#fiber-handler-to-nethttp","p":1346},{"i":1358,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { app := fiber.New() app.Get(\"/greet\", greet) // Listen on port 3000 http.ListenAndServe(\":3000\", adaptor.FiberApp(app)) } func greet(c *fiber.Ctx) error { return c.SendString(\"Hello World!\") }","s":"Fiber App to net/http","u":"/api/middleware/adaptor","h":"#fiber-app-to-nethttp","p":1346},{"i":1360,"t":"package main import ( \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/adaptor\" ) func main() { app := fiber.New() app.Get(\"/greet\", greetWithHTTPReq) // Listen on port 3000 http.ListenAndServe(\":3000\", adaptor.FiberApp(app)) } func greetWithHTTPReq(c *fiber.Ctx) error { httpReq, err := adaptor.ConvertRequest(c, false) if err != nil { return err } return c.SendString(\"Request URL: \" + httpReq.URL.String()) }","s":"Fiber Context to (net/http).Request","u":"/api/middleware/adaptor","h":"#fiber-context-to-nethttprequest","p":1346},{"i":1362,"t":"Basic Authentication middleware for Fiber that provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized or a custom response for missing or invalid credentials.","s":"BasicAuth","u":"/api/middleware/basicauth","h":"","p":1361},{"i":1364,"t":"func New(config Config) fiber.Handler","s":"Signatures","u":"/api/middleware/basicauth","h":"#signatures","p":1361},{"i":1366,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/basicauth\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config app.Use(basicauth.New(basicauth.Config{ Users: map[string]string{ \"john\": \"doe\", \"admin\": \"123456\", }, })) // Or extend your config for customization app.Use(basicauth.New(basicauth.Config{ Users: map[string]string{ \"john\": \"doe\", \"admin\": \"123456\", }, Realm: \"Forbidden\", Authorizer: func(user, pass string) bool { if user == \"john\" && pass == \"doe\" { return true } if user == \"admin\" && pass == \"123456\" { return true } return false }, Unauthorized: func(c *fiber.Ctx) error { return c.SendFile(\"./unauthorized.html\") }, ContextUsername: \"_user\", ContextPassword: \"_pass\", }))","s":"Examples","u":"/api/middleware/basicauth","h":"#examples","p":1361},{"i":1368,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Users defines the allowed credentials // // Required. Default: map[string]string{} Users map[string]string // Realm is a string to define realm attribute of BasicAuth. // the realm identifies the system to authenticate against // and can be used by clients to save credentials // // Optional. Default: \"Restricted\". Realm string // Authorizer defines a function you can pass // to check the credentials however you want. // It will be called with a username and password // and is expected to return true or false to indicate // that the credentials were approved or not. // // Optional. Default: nil. Authorizer func(string, string) bool // Unauthorized defines the response body for unauthorized responses. // By default it will return with a 401 Unauthorized and the correct WWW-Auth header // // Optional. Default: nil Unauthorized fiber.Handler // ContextUser is the key to store the username in Locals // // Optional. Default: \"username\" ContextUsername string // ContextPass is the key to store the password in Locals // // Optional. Default: \"password\" ContextPassword string }","s":"Config","u":"/api/middleware/basicauth","h":"#config","p":1361},{"i":1370,"t":"var ConfigDefault = Config{ Next: nil, Users: map[string]string{}, Realm: \"Restricted\", Authorizer: nil, Unauthorized: nil, ContextUsername: \"username\", ContextPassword: \"password\", }","s":"Default Config","u":"/api/middleware/basicauth","h":"#default-config","p":1361},{"i":1372,"t":"Cache middleware for Fiber designed to intercept responses and cache them. This middleware will cache the Body, Content-Type and StatusCode using the c.Path() as unique identifier. Special thanks to @codemicro for creating this middleware for Fiber core! Request Directives Cache-Control: no-cache will return the up-to-date response but still caches it. You will always get a miss cache status. Cache-Control: no-store will refrain from caching. You will always get the up-to-date response.","s":"Cache","u":"/api/middleware/cache","h":"","p":1371},{"i":1374,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/cache","h":"#signatures","p":1371},{"i":1376,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/cache\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(cache.New()) // Or extend your config for customization app.Use(cache.New(cache.Config{ Next: func(c *fiber.Ctx) bool { return c.Query(\"refresh\") == \"true\" }, Expiration: 30 * time.Minute, CacheControl: true, })) Or you can custom key and expire time like this: app.Use(cache.New(cache.Config{ ExpirationGenerator: func(c *fiber.Ctx, cfg *cache.Config) time.Duration { newCacheTime, _ := strconv.Atoi(c.GetRespHeader(\"Cache-Time\", \"600\")) return time.Second * time.Duration(newCacheTime) }, KeyGenerator: func(c *fiber.Ctx) string { return utils.CopyString(c.Path()) }, })) app.Get(\"/\", func(c *fiber.Ctx) error { c.Response().Header.Add(\"Cache-Time\", \"6000\") return c.SendString(\"hi\") })","s":"Examples","u":"/api/middleware/cache","h":"#examples","p":1371},{"i":1378,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Expiration is the time that an cached response will live // // Optional. Default: 1 * time.Minute Expiration time.Duration // CacheHeader header on response header, indicate cache status, with the following possible return value // // hit, miss, unreachable // // Optional. Default: X-Cache CacheHeader string // CacheControl enables client side caching if set to true // // Optional. Default: false CacheControl bool // Key allows you to generate custom keys, by default c.Path() is used // // Default: func(c *fiber.Ctx) string { // return utils.CopyString(c.Path()) // } KeyGenerator func(*fiber.Ctx) string // allows you to generate custom Expiration Key By Key, default is Expiration (Optional) // // Default: nil ExpirationGenerator func(*fiber.Ctx, *Config) time.Duration // Store is used to store the state of the middleware // // Default: an in memory store for this process only Storage fiber.Storage // allows you to store additional headers generated by next middlewares & handler // // Default: false StoreResponseHeaders bool // Max number of bytes of response bodies simultaneously stored in cache. When limit is reached, // entries with the nearest expiration are deleted to make room for new. // 0 means no limit // // Default: 0 MaxBytes uint // You can specify HTTP methods to cache. // The middleware just caches the routes of its methods in this slice. // // Default: []string{fiber.MethodGet, fiber.MethodHead} Methods []string }","s":"Config","u":"/api/middleware/cache","h":"#config","p":1371},{"i":1380,"t":"var ConfigDefault = Config{ Next: nil, Expiration: 1 * time.Minute, CacheHeader: \"X-Cache\", CacheControl: false, KeyGenerator: func(c *fiber.Ctx) string { return utils.CopyString(c.Path()) }, ExpirationGenerator: nil, StoreResponseHeaders: false, Storage: nil, MaxBytes: 0, Methods: []string{fiber.MethodGet, fiber.MethodHead}, }","s":"Default Config","u":"/api/middleware/cache","h":"#default-config","p":1371},{"i":1382,"t":"Compression middleware for Fiber that will compress the response using gzip, deflate and brotli compression depending on the Accept-Encoding header.","s":"Compress","u":"/api/middleware/compress","h":"","p":1381},{"i":1384,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/compress","h":"#signatures","p":1381},{"i":1386,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/compress\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(compress.New()) // Or extend your config for customization app.Use(compress.New(compress.Config{ Level: compress.LevelBestSpeed, // 1 })) // Skip middleware for specific routes app.Use(compress.New(compress.Config{ Next: func(c *fiber.Ctx) bool { return c.Path() == \"/dont_compress\" }, Level: compress.LevelBestSpeed, // 1 }))","s":"Examples","u":"/api/middleware/compress","h":"#examples","p":1381},{"i":1388,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Level determines the compression algoritm // // Optional. Default: LevelDefault // LevelDisabled: -1 // LevelDefault: 0 // LevelBestSpeed: 1 // LevelBestCompression: 2 Level int }","s":"Config","u":"/api/middleware/compress","h":"#config","p":1381},{"i":1390,"t":"var ConfigDefault = Config{ Next: nil, Level: LevelDefault, }","s":"Default Config","u":"/api/middleware/compress","h":"#default-config","p":1381},{"i":1392,"t":"// Compression levels const ( LevelDisabled = -1 LevelDefault = 0 LevelBestSpeed = 1 LevelBestCompression = 2 )","s":"Constants","u":"/api/middleware/compress","h":"#constants","p":1381},{"i":1394,"t":"CORS middleware for Fiber that can be used to enable Cross-Origin Resource Sharing with various options.","s":"CORS","u":"/api/middleware/cors","h":"","p":1393},{"i":1396,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/cors","h":"#signatures","p":1393},{"i":1398,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/cors\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(cors.New()) // Or extend your config for customization app.Use(cors.New(cors.Config{ AllowOrigins: \"https://gofiber.io, https://gofiber.net\", AllowHeaders: \"Origin, Content-Type, Accept\", })) Using the AllowOriginsFunc function. In this example any origin will be allowed via CORS. For example, if a browser running on http://localhost:3000 sends a request, this will be accepted and the access-control-allow-origin response header will be set to http://localhost:3000. Note: Using this feature is discouraged in production and it's best practice to explicitly set CORS origins via AllowOrigins. app.Use(cors.New()) app.Use(cors.New(cors.Config{ AllowOriginsFunc: func(origin string) bool { return os.Getenv(\"ENVIRONMENT\") == \"development\" }, }))","s":"Examples","u":"/api/middleware/cors","h":"#examples","p":1393},{"i":1400,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // AllowOriginsFunc defines a function that will set the 'access-control-allow-origin' // response header to the 'origin' request header when returned true. // // Note: Using this feature is discouraged in production and it's best practice to explicitly // set CORS origins via 'AllowOrigins' // // Optional. Default: nil AllowOriginsFunc func(origin string) bool // AllowOrigin defines a list of origins that may access the resource. // // Optional. Default value \"*\" AllowOrigins string // AllowMethods defines a list methods allowed when accessing the resource. // This is used in response to a preflight request. // // Optional. Default value \"GET,POST,HEAD,PUT,DELETE,PATCH\" AllowMethods string // AllowHeaders defines a list of request headers that can be used when // making the actual request. This is in response to a preflight request. // // Optional. Default value \"\". AllowHeaders string // AllowCredentials indicates whether or not the response to the request // can be exposed when the credentials flag is true. When used as part of // a response to a preflight request, this indicates whether or not the // actual request can be made using credentials. // // Optional. Default value false. AllowCredentials bool // ExposeHeaders defines a whitelist headers that clients are allowed to // access. // // Optional. Default value \"\". ExposeHeaders string // MaxAge indicates how long (in seconds) the results of a preflight request // can be cached. // // Optional. Default value 0. MaxAge int }","s":"Config","u":"/api/middleware/cors","h":"#config","p":1393},{"i":1402,"t":"var ConfigDefault = Config{ Next: nil, AllowOriginsFunc: nil, AllowOrigins: \"*\", AllowMethods: strings.Join([]string{ fiber.MethodGet, fiber.MethodPost, fiber.MethodHead, fiber.MethodPut, fiber.MethodDelete, fiber.MethodPatch, }, \",\"), AllowHeaders: \"\", AllowCredentials: false, ExposeHeaders: \"\", MaxAge: 0, }","s":"Default Config","u":"/api/middleware/cors","h":"#default-config","p":1393},{"i":1404,"t":"CSRF middleware for Fiber that provides Cross-site request forgery protection by passing a csrf token via cookies. This cookie value will be used to compare against the client csrf token on requests, other than those defined as \"safe\" by RFC7231 (GET, HEAD, OPTIONS, or TRACE). When the csrf token is invalid, this middleware will return the fiber.ErrForbidden error. CSRF Tokens are generated on GET requests. You can retrieve the CSRF token with c.Locals(contextKey), where contextKey is the string you set in the config (see Custom Config below). When no csrf_ cookie is set, or the token has expired, a new token will be generated and csrf_ cookie set. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.","s":"CSRF","u":"/api/middleware/csrf","h":"","p":1403},{"i":1406,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/csrf","h":"#signatures","p":1403},{"i":1408,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/csrf\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(csrf.New()) // Or extend your config for customization app.Use(csrf.New(csrf.Config{ KeyLookup: \"header:X-Csrf-Token\", CookieName: \"csrf_\", CookieSameSite: \"Lax\", Expiration: 1 * time.Hour, KeyGenerator: utils.UUID, Extractor: func(c *fiber.Ctx) (string, error) { ... }, })) note KeyLookup will be ignored if Extractor is explicitly set.","s":"Examples","u":"/api/middleware/csrf","h":"#examples","p":1403},{"i":1410,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // KeyLookup is a string in the form of \":\" that is used // to create an Extractor that extracts the token from the request. // Possible values: // - \"header:\" // - \"query:\" // - \"param:\" // - \"form:\" // - \"cookie:\" // // Ignored if an Extractor is explicitly set. // // Optional. Default: \"header:X-CSRF-Token\" KeyLookup string // Name of the session cookie. This cookie will store session key. // Optional. Default value \"csrf_\". CookieName string // Domain of the CSRF cookie. // Optional. Default value \"\". CookieDomain string // Path of the CSRF cookie. // Optional. Default value \"\". CookiePath string // Indicates if CSRF cookie is secure. // Optional. Default value false. CookieSecure bool // Indicates if CSRF cookie is HTTP only. // Optional. Default value false. CookieHTTPOnly bool // Indicates if CSRF cookie is requested by SameSite. // Optional. Default value \"Lax\". CookieSameSite string // Decides whether cookie should last for only the browser sesison. // Ignores Expiration if set to true CookieSessionOnly bool // Expiration is the duration before csrf token will expire // // Optional. Default: 1 * time.Hour Expiration time.Duration // Store is used to store the state of the middleware // // Optional. Default: memory.New() Storage fiber.Storage // Context key to store generated CSRF token into context. // If left empty, token will not be stored in context. // // Optional. Default: \"\" ContextKey string // KeyGenerator creates a new CSRF token // // Optional. Default: utils.UUID KeyGenerator func() string // Extractor returns the csrf token // // If set this will be used in place of an Extractor based on KeyLookup. // // Optional. Default will create an Extractor based on KeyLookup. Extractor func(c *fiber.Ctx) (string, error) }","s":"Config","u":"/api/middleware/csrf","h":"#config","p":1403},{"i":1412,"t":"var ConfigDefault = Config{ KeyLookup: \"header:\" + HeaderName, CookieName: \"csrf_\", CookieSameSite: \"Lax\", Expiration: 1 * time.Hour, KeyGenerator: utils.UUID, ErrorHandler: defaultErrorHandler, Extractor: CsrfFromHeader(HeaderName), }","s":"Default Config","u":"/api/middleware/csrf","h":"#default-config","p":1403},{"i":1414,"t":"const ( HeaderName = \"X-Csrf-Token\" )","s":"Constants","u":"/api/middleware/csrf","h":"#constants","p":1403},{"i":1416,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 app.Use(csrf.New(csrf.Config{ Storage: storage, }))","s":"Custom Storage/Database","u":"/api/middleware/csrf","h":"#custom-storagedatabase","p":1403},{"i":1418,"t":"The Early Data middleware for Fiber adds support for TLS 1.3's early data (\"0-RTT\") feature. Citing RFC 8446, when a client and server share a PSK, TLS 1.3 allows clients to send data on the first flight (\"early data\") to speed up the request, effectively reducing the regular 1-RTT request to a 0-RTT request. Make sure to enable fiber's EnableTrustedProxyCheck config option before using this middleware in order to not trust bogus HTTP request headers of the client. Also be aware that enabling support for early data in your reverse proxy (e.g. nginx, as done with a simple ssl_early_data on;) makes requests replayable. Refer to the following documents before continuing: https://datatracker.ietf.org/doc/html/rfc8446#section-8 https://blog.trailofbits.com/2019/03/25/what-application-developers-need-to-know-about-tls-early-data-0rtt/ By default, this middleware allows early data requests on safe HTTP request methods only and rejects the request otherwise, i.e. aborts the request before executing your handler. This behavior can be controlled by the AllowEarlyData config option. Safe HTTP methods β€” GET, HEAD, OPTIONS and TRACE β€” should not modify a state on the server.","s":"EarlyData","u":"/api/middleware/earlydata","h":"","p":1417},{"i":1420,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/earlydata","h":"#signatures","p":1417},{"i":1422,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/earlydata\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(earlydata.New()) // Or extend your config for customization app.Use(earlydata.New(earlydata.Config{ Error: fiber.ErrTooEarly, // ... }))","s":"Examples","u":"/api/middleware/earlydata","h":"#examples","p":1417},{"i":1424,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // IsEarlyData returns whether the request is an early-data request. // // Optional. Default: a function which checks if the \"Early-Data\" request header equals \"1\". IsEarlyData func(c *fiber.Ctx) bool // AllowEarlyData returns whether the early-data request should be allowed or rejected. // // Optional. Default: a function which rejects the request on unsafe and allows the request on safe HTTP request methods. AllowEarlyData func(c *fiber.Ctx) bool // Error is returned in case an early-data request is rejected. // // Optional. Default: fiber.ErrTooEarly. Error error }","s":"Config","u":"/api/middleware/earlydata","h":"#config","p":1417},{"i":1426,"t":"var ConfigDefault = Config{ IsEarlyData: func(c *fiber.Ctx) bool { return c.Get(DefaultHeaderName) == DefaultHeaderTrueValue }, AllowEarlyData: func(c *fiber.Ctx) bool { return fiber.IsMethodSafe(c.Method()) }, Error: fiber.ErrTooEarly, }","s":"Default Config","u":"/api/middleware/earlydata","h":"#default-config","p":1417},{"i":1428,"t":"const ( DefaultHeaderName = \"Early-Data\" DefaultHeaderTrueValue = \"1\" )","s":"Constants","u":"/api/middleware/earlydata","h":"#constants","p":1417},{"i":1430,"t":"Encrypt middleware for Fiber which encrypts cookie values. Note: this middleware does not encrypt cookie names.","s":"Encrypt Cookie","u":"/api/middleware/encryptcookie","h":"","p":1429},{"i":1432,"t":"// Intitializes the middleware func New(config ...Config) fiber.Handler // Returns a random 32 character long string func GenerateKey() string","s":"Signatures","u":"/api/middleware/encryptcookie","h":"#signatures","p":1429},{"i":1434,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/encryptcookie\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config // `Key` must be a 32 character string. It's used to encrypt the values, so make sure it is random and keep it secret. // You can run `openssl rand -base64 32` or call `encryptcookie.GenerateKey()` to create a random key for you. // Make sure not to set `Key` to `encryptcookie.GenerateKey()` because that will create a new key every run. app.Use(encryptcookie.New(encryptcookie.Config{ Key: \"secret-thirty-2-character-string\", })) // Get / reading out the encrypted cookie app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"value=\" + c.Cookies(\"test\")) }) // Post / create the encrypted cookie app.Post(\"/\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"test\", Value: \"SomeThing\", }) return nil })","s":"Examples","u":"/api/middleware/encryptcookie","h":"#examples","p":1429},{"i":1436,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Array of cookie keys that should not be encrypted. // // Optional. Default: [\"csrf_\"] Except []string // Base64 encoded unique key to encode & decode cookies. // // Required. The key should be 32 bytes of random data in base64-encoded form. // You may run `openssl rand -base64 32` or use `encryptcookie.GenerateKey()` to generate a new key. Key string // Custom function to encrypt cookies. // // Optional. Default: EncryptCookie Encryptor func(decryptedString, key string) (string, error) // Custom function to decrypt cookies. // // Optional. Default: DecryptCookie Decryptor func(encryptedString, key string) (string, error) }","s":"Config","u":"/api/middleware/encryptcookie","h":"#config","p":1429},{"i":1438,"t":"var ConfigDefault = Config{ Next: nil, Except: []string{\"csrf_\"}, Key: \"\", Encryptor: EncryptCookie, Decryptor: DecryptCookie, }","s":"Default Config","u":"/api/middleware/encryptcookie","h":"#default-config","p":1429},{"i":1440,"t":"Normally, encryptcookie middleware skips csrf_ cookies. However, it won't work when you use custom cookie names for CSRF. You should update Except config to avoid this problem. For example: app.Use(encryptcookie.New(encryptcookie.Config{ Key: \"secret-thirty-2-character-string\", Except: []string{\"csrf_1\"}, // exclude CSRF cookie })) app.Use(csrf.New(csrf.Config{ KeyLookup: \"form:test\", CookieName: \"csrf_1\", CookieHTTPOnly: true, }))","s":"Usage of CSRF and Encryptcookie Middlewares with Custom Cookie Names","u":"/api/middleware/encryptcookie","h":"#usage-of-csrf-and-encryptcookie-middlewares-with-custom-cookie-names","p":1429},{"i":1442,"t":"EnvVar middleware for Fiber that can be used to expose environment variables with various options.","s":"EnvVar","u":"/api/middleware/envvar","h":"","p":1441},{"i":1444,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/envvar","h":"#signatures","p":1441},{"i":1446,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/envvar\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(\"/expose/envvars\", envvar.New()) // Or extend your config for customization app.Use(\"/expose/envvars\", envvar.New( envvar.Config{ ExportVars: map[string]string{\"testKey\": \"\", \"testDefaultKey\": \"testDefaultVal\"}, ExcludeVars: map[string]string{\"excludeKey\": \"\"}, }), ) note You will need to provide a path to use the envvar middleware.","s":"Examples","u":"/api/middleware/envvar","h":"#examples","p":1441},{"i":1448,"t":"Http response contract: { \"vars\": { \"someEnvVariable\": \"someValue\", \"anotherEnvVariable\": \"anotherValue\", } }","s":"Response","u":"/api/middleware/envvar","h":"#response","p":1441},{"i":1450,"t":"// Config defines the config for middleware. type Config struct { // ExportVars specifies the environment variables that should export ExportVars map[string]string // ExcludeVars specifies the environment variables that should not export ExcludeVars map[string]string }","s":"Config","u":"/api/middleware/envvar","h":"#config","p":1441},{"i":1452,"t":"Config{}","s":"Default Config","u":"/api/middleware/envvar","h":"#default-config","p":1441},{"i":1454,"t":"ETag middleware for Fiber that lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.","s":"ETag","u":"/api/middleware/etag","h":"","p":1453},{"i":1456,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/etag","h":"#signatures","p":1453},{"i":1458,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/etag\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(etag.New()) // Get / receives Etag: \"13-1831710635\" in response header app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) // Or extend your config for customization app.Use(etag.New(etag.Config{ Weak: true, })) // Get / receives Etag: \"W/\"13-1831710635\" in response header app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") })","s":"Examples","u":"/api/middleware/etag","h":"#examples","p":1453},{"i":1460,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Weak indicates that a weak validator is used. Weak etags are easy // to generate, but are far less useful for comparisons. Strong // validators are ideal for comparisons but can be very difficult // to generate efficiently. Weak ETag values of two representations // of the same resources might be semantically equivalent, but not // byte-for-byte identical. This means weak etags prevent caching // when byte range requests are used, but strong etags mean range // requests can still be cached. Weak bool }","s":"Config","u":"/api/middleware/etag","h":"#config","p":1453},{"i":1462,"t":"var ConfigDefault = Config{ Next: nil, Weak: false, }","s":"Default Config","u":"/api/middleware/etag","h":"#default-config","p":1453},{"i":1464,"t":"Expvar middleware for Fiber that serves via its HTTP server runtime exposed variants in the JSON format. The package is typically only imported for the side effect of registering its HTTP handlers. The handled path is /debug/vars.","s":"ExpVar","u":"/api/middleware/expvar","h":"","p":1463},{"i":1466,"t":"func New() fiber.Handler","s":"Signatures","u":"/api/middleware/expvar","h":"#signatures","p":1463},{"i":1468,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" expvarmw \"github.com/gofiber/fiber/v2/middleware/expvar\" ) After you initiate your Fiber app, you can use the following possibilities: var count = expvar.NewInt(\"count\") app.Use(expvarmw.New()) app.Get(\"/\", func(c *fiber.Ctx) error { count.Add(1) return c.SendString(fmt.Sprintf(\"hello expvar count %d\", count.Value())) }) Visit path /debug/vars to see all vars and use query r=key to filter exposed variables. curl 127.0.0.1:3000 hello expvar count 1 curl 127.0.0.1:3000/debug/vars { \"cmdline\": [\"xxx\"], \"count\": 1, \"expvarHandlerCalls\": 33, \"expvarRegexpErrors\": 0, \"memstats\": {...} } curl 127.0.0.1:3000/debug/vars?r=c { \"cmdline\": [\"xxx\"], \"count\": 1 }","s":"Examples","u":"/api/middleware/expvar","h":"#examples","p":1463},{"i":1470,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool }","s":"Config","u":"/api/middleware/expvar","h":"#config","p":1463},{"i":1472,"t":"var ConfigDefault = Config{ Next: nil, }","s":"Default Config","u":"/api/middleware/expvar","h":"#default-config","p":1463},{"i":1474,"t":"Favicon middleware for Fiber that ignores favicon requests or caches a provided icon in memory to improve performance by skipping disk access. User agents request favicon.ico frequently and indiscriminately, so you may wish to exclude these requests from your logs by using this middleware before your logger middleware. note This middleware is exclusively for serving the default, implicit favicon, which is GET /favicon.ico or custom favicon URL.","s":"Favicon","u":"/api/middleware/favicon","h":"","p":1473},{"i":1476,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/favicon","h":"#signatures","p":1473},{"i":1478,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/favicon\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(favicon.New()) // Or extend your config for customization app.Use(favicon.New(favicon.Config{ File: \"./favicon.ico\", URL: \"/favicon.ico\", }))","s":"Examples","u":"/api/middleware/favicon","h":"#examples","p":1473},{"i":1480,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // File holds the path to an actual favicon that will be cached // // Optional. Default: \"\" File string // URL for favicon handler // // Optional. Default: \"/favicon.ico\" URL string // FileSystem is an optional alternate filesystem to search for the favicon in. // An example of this could be an embedded or network filesystem // // Optional. Default: nil FileSystem http.FileSystem // CacheControl defines how the Cache-Control header in the response should be set // // Optional. Default: \"public, max-age=31536000\" CacheControl string }","s":"Config","u":"/api/middleware/favicon","h":"#config","p":1473},{"i":1482,"t":"var ConfigDefault = Config{ Next: nil, File: \"\", URL: fPath, CacheControl: \"public, max-age=31536000\", }","s":"Default Config","u":"/api/middleware/favicon","h":"#default-config","p":1473},{"i":1484,"t":"Filesystem middleware for Fiber that enables you to serve files from a directory. caution :params & :optionals? within the prefix path are not supported! To handle paths with spaces (or other url encoded values) make sure to set fiber.Config{ UnescapePath: true }","s":"FileSystem","u":"/api/middleware/filesystem","h":"","p":1483},{"i":1486,"t":"func New(config Config) fiber.Handler","s":"Signatures","u":"/api/middleware/filesystem","h":"#signatures","p":1483},{"i":1488,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" ) After you initiate your Fiber app, you can use the following possibilities: // Provide a minimal config app.Use(filesystem.New(filesystem.Config{ Root: http.Dir(\"./assets\"), })) // Or extend your config for customization app.Use(filesystem.New(filesystem.Config{ Root: http.Dir(\"./assets\"), Browse: true, Index: \"index.html\", NotFoundFile: \"404.html\", MaxAge: 3600, })) If your environment (Go 1.16+) supports it, we recommend using Go Embed instead of the other solutions listed as this one is native to Go and the easiest to use.","s":"Examples","u":"/api/middleware/filesystem","h":"#examples","p":1483},{"i":1490,"t":"Embed is the native method to embed files in a Golang excecutable. Introduced in Go 1.16. package main import ( \"embed\" \"io/fs\" \"log\" \"net/http\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" ) // Embed a single file //go:embed index.html var f embed.FS // Embed a directory //go:embed static/* var embedDirStatic embed.FS func main() { app := fiber.New() app.Use(\"/\", filesystem.New(filesystem.Config{ Root: http.FS(f), })) // Access file \"image.png\" under `static/` directory via URL: `http:///static/image.png`. // Without `PathPrefix`, you have to access it via URL: // `http:///static/static/image.png`. app.Use(\"/static\", filesystem.New(filesystem.Config{ Root: http.FS(embedDirStatic), PathPrefix: \"static\", Browse: true, })) log.Fatal(app.Listen(\":3000\")) }","s":"embed","u":"/api/middleware/filesystem","h":"#embed","p":1483},{"i":1492,"t":"https://github.com/markbates/pkger package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/markbates/pkger\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: pkger.Dir(\"/assets\"), })) log.Fatal(app.Listen(\":3000\")) }","s":"pkger","u":"/api/middleware/filesystem","h":"#pkger","p":1483},{"i":1494,"t":"https://github.com/gobuffalo/packr package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/gobuffalo/packr/v2\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: packr.New(\"Assets Box\", \"/assets\"), })) log.Fatal(app.Listen(\":3000\")) }","s":"packr","u":"/api/middleware/filesystem","h":"#packr","p":1483},{"i":1496,"t":"https://github.com/GeertJohan/go.rice package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"github.com/GeertJohan/go.rice\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: rice.MustFindBox(\"assets\").HTTPBox(), })) log.Fatal(app.Listen(\":3000\")) }","s":"go.rice","u":"/api/middleware/filesystem","h":"#gorice","p":1483},{"i":1498,"t":"https://github.com/UnnoTed/fileb0x package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" \"/myEmbeddedFiles\" ) func main() { app := fiber.New() app.Use(\"/assets\", filesystem.New(filesystem.Config{ Root: myEmbeddedFiles.HTTP, })) log.Fatal(app.Listen(\":3000\")) }","s":"fileb0x","u":"/api/middleware/filesystem","h":"#fileb0x","p":1483},{"i":1500,"t":"https://github.com/rakyll/statik package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/filesystem\" // Use blank to invoke init function and register data to statik _ \"/statik\" \"github.com/rakyll/statik/fs\" ) func main() { statikFS, err := fs.New() if err != nil { panic(err) } app := fiber.New() app.Use(\"/\", filesystem.New(filesystem.Config{ Root: statikFS, })) log.Fatal(app.Listen(\":3000\")) }","s":"statik","u":"/api/middleware/filesystem","h":"#statik","p":1483},{"i":1502,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Root is a FileSystem that provides access // to a collection of files and directories. // // Required. Default: nil Root http.FileSystem `json:\"-\"` // PathPrefix defines a prefix to be added to a filepath when // reading a file from the FileSystem. // // Use when using Go 1.16 embed.FS // // Optional. Default \"\" PathPrefix string `json:\"path_prefix\"` // Enable directory browsing. // // Optional. Default: false Browse bool `json:\"browse\"` // Index file for serving a directory. // // Optional. Default: \"index.html\" Index string `json:\"index\"` // The value for the Cache-Control HTTP-header // that is set on the file response. MaxAge is defined in seconds. // // Optional. Default value 0. MaxAge int `json:\"max_age\"` // File to return if path is not found. Useful for SPA's. // // Optional. Default: \"\" NotFoundFile string `json:\"not_found_file\"` // The value for the Content-Type HTTP-header // that is set on the file response // // Optional. Default: \"\" ContentTypeCharset string `json:\"content_type_charset\"` }","s":"Config","u":"/api/middleware/filesystem","h":"#config","p":1483},{"i":1504,"t":"var ConfigDefault = Config{ Next: nil, Root: nil, PathPrefix: \"\", Browse: false, Index: \"/index.html\", MaxAge: 0, ContentTypeCharset: \"\", }","s":"Default Config","u":"/api/middleware/filesystem","h":"#default-config","p":1483},{"i":1506,"t":"Helmet middleware helps secure your apps by setting various HTTP headers.","s":"Helmet","u":"/api/middleware/helmet","h":"","p":1505},{"i":1508,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/helmet","h":"#signatures","p":1505},{"i":1510,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/helmet\" ) func main() { app := fiber.New() app.Use(helmet.New()) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome!\") }) app.Listen(\":3000\") } Test: curl -I http://localhost:3000","s":"Examples","u":"/api/middleware/helmet","h":"#examples","p":1505},{"i":1512,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // XSSProtection // Optional. Default value \"0\". XSSProtection string // ContentTypeNosniff // Optional. Default value \"nosniff\". ContentTypeNosniff string // XFrameOptions // Optional. Default value \"SAMEORIGIN\". // Possible values: \"SAMEORIGIN\", \"DENY\", \"ALLOW-FROM uri\" XFrameOptions string // HSTSMaxAge // Optional. Default value 0. HSTSMaxAge int // HSTSExcludeSubdomains // Optional. Default value false. HSTSExcludeSubdomains bool // ContentSecurityPolicy // Optional. Default value \"\". ContentSecurityPolicy string // CSPReportOnly // Optional. Default value false. CSPReportOnly bool // HSTSPreloadEnabled // Optional. Default value false. HSTSPreloadEnabled bool // ReferrerPolicy // Optional. Default value \"ReferrerPolicy\". ReferrerPolicy string // Permissions-Policy // Optional. Default value \"\". PermissionPolicy string // Cross-Origin-Embedder-Policy // Optional. Default value \"require-corp\". CrossOriginEmbedderPolicy string // Cross-Origin-Opener-Policy // Optional. Default value \"same-origin\". CrossOriginOpenerPolicy string // Cross-Origin-Resource-Policy // Optional. Default value \"same-origin\". CrossOriginResourcePolicy string // Origin-Agent-Cluster // Optional. Default value \"?1\". OriginAgentCluster string // X-DNS-Prefetch-Control // Optional. Default value \"off\". XDNSPrefetchControl string // X-Download-Options // Optional. Default value \"noopen\". XDownloadOptions string // X-Permitted-Cross-Domain-Policies // Optional. Default value \"none\". XPermittedCrossDomain string }","s":"Config","u":"/api/middleware/helmet","h":"#config","p":1505},{"i":1514,"t":"var ConfigDefault = Config{ XSSProtection: \"0\", ContentTypeNosniff: \"nosniff\", XFrameOptions: \"SAMEORIGIN\", ReferrerPolicy: \"no-referrer\", CrossOriginEmbedderPolicy: \"require-corp\", CrossOriginOpenerPolicy: \"same-origin\", CrossOriginResourcePolicy: \"same-origin\", OriginAgentCluster: \"?1\", XDNSPrefetchControl: \"off\", XDownloadOptions: \"noopen\", XPermittedCrossDomain: \"none\", }","s":"Default Config","u":"/api/middleware/helmet","h":"#default-config","p":1505},{"i":1516,"t":"Idempotency middleware for Fiber allows for fault-tolerant APIs where duplicate requests β€” for example due to networking issues on the client-side β€” do not erroneously cause the same action performed multiple times on the server-side. Refer to https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-02 for a better understanding.","s":"Idempotency","u":"/api/middleware/idempotency","h":"","p":1515},{"i":1518,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/idempotency","h":"#signatures","p":1515},{"i":1520,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/idempotency\" ) After you initiate your Fiber app, you can use the following possibilities:","s":"Examples","u":"/api/middleware/idempotency","h":"#examples","p":1515},{"i":1522,"t":"app.Use(idempotency.New())","s":"Default Config","u":"/api/middleware/idempotency","h":"#default-config","p":1515},{"i":1524,"t":"app.Use(idempotency.New(idempotency.Config{ Lifetime: 42 * time.Minute, // ... }))","s":"Custom Config","u":"/api/middleware/idempotency","h":"#custom-config","p":1515},{"i":1526,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: a function which skips the middleware on safe HTTP request method. Next func(c *fiber.Ctx) bool // Lifetime is the maximum lifetime of an idempotency key. // // Optional. Default: 30 * time.Minute Lifetime time.Duration // KeyHeader is the name of the header that contains the idempotency key. // // Optional. Default: X-Idempotency-Key KeyHeader string // KeyHeaderValidate defines a function to validate the syntax of the idempotency header. // // Optional. Default: a function which ensures the header is 36 characters long (the size of an UUID). KeyHeaderValidate func(string) error // KeepResponseHeaders is a list of headers that should be kept from the original response. // // Optional. Default: nil (to keep all headers) KeepResponseHeaders []string // Lock locks an idempotency key. // // Optional. Default: an in-memory locker for this process only. Lock Locker // Storage stores response data by idempotency key. // // Optional. Default: an in-memory storage for this process only. Storage fiber.Storage }","s":"Config","u":"/api/middleware/idempotency","h":"#config","p":1515},{"i":1528,"t":"var ConfigDefault = Config{ Next: func(c *fiber.Ctx) bool { // Skip middleware if the request was done using a safe HTTP method return fiber.IsMethodSafe(c.Method()) }, Lifetime: 30 * time.Minute, KeyHeader: \"X-Idempotency-Key\", KeyHeaderValidate: func(k string) error { if l, wl := len(k), 36; l != wl { // UUID length is 36 chars return fmt.Errorf(\"%w: invalid length: %d != %d\", ErrInvalidIdempotencyKey, l, wl) } return nil }, KeepResponseHeaders: nil, Lock: nil, // Set in configDefault so we don't allocate data here. Storage: nil, // Set in configDefault so we don't allocate data here. }","s":"Default Config","u":"/api/middleware/idempotency","h":"#default-config-1","p":1515},{"i":1530,"t":"Key auth middleware provides a key based authentication.","s":"Keyauth","u":"/api/middleware/keyauth","h":"","p":1529},{"i":1532,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/keyauth","h":"#signatures","p":1529},{"i":1534,"t":"package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" ) var ( apiKey = \"correct horse battery staple\" ) func validateAPIKey(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey } func main() { app := fiber.New() // note that the keyauth middleware needs to be defined before the routes are defined! app.Use(keyauth.New(keyauth.Config{ KeyLookup: \"cookie:access_token\", Validator: validateAPIKey, })) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Listen(\":3000\") } Test: # No api-key specified -> 400 missing curl http://localhost:3000 #> missing or malformed API Key curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000 #> Successfully authenticated! curl --cookie \"access_token=Clearly A Wrong Key\" http://localhost:3000 #> missing or malformed API Key For a more detailed example, see also the github.com/gofiber/recipes repository and specifically the fiber-envoy-extauthz repository and the keyauth example code.","s":"Examples","u":"/api/middleware/keyauth","h":"#examples","p":1529},{"i":1536,"t":"If you want to authenticate only certain endpoints, you can use the Config of keyauth and apply a filter function (eg. authFilter) like so package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" \"regexp\" \"strings\" ) var ( apiKey = \"correct horse battery staple\" protectedURLs = []*regexp.Regexp{ regexp.MustCompile(\"^/authenticated$\"), regexp.MustCompile(\"^/auth2$\"), } ) func validateAPIKey(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey } func authFilter(c *fiber.Ctx) bool { originalURL := strings.ToLower(c.OriginalURL()) for _, pattern := range protectedURLs { if pattern.MatchString(originalURL) { return false } } return true } func main() { app := fiber.New() app.Use(keyauth.New(keyauth.Config{ Next: authFilter, KeyLookup: \"cookie:access_token\", Validator: validateAPIKey, })) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome\") }) app.Get(\"/authenticated\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Get(\"/auth2\", func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated 2!\") }) app.Listen(\":3000\") } Which results in this # / does not need to be authenticated curl http://localhost:3000 #> Welcome # /authenticated needs to be authenticated curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000/authenticated #> Successfully authenticated! # /auth2 needs to be authenticated too curl --cookie \"access_token=correct horse battery staple\" http://localhost:3000/auth2 #> Successfully authenticated 2!","s":"Authenticate only certain endpoints","u":"/api/middleware/keyauth","h":"#authenticate-only-certain-endpoints","p":1529},{"i":1538,"t":"package main import ( \"crypto/sha256\" \"crypto/subtle\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/keyauth\" ) const ( apiKey = \"my-super-secret-key\" ) func main() { app := fiber.New() authMiddleware := keyauth.New(keyauth.Config{ Validator: func(c *fiber.Ctx, key string) (bool, error) { hashedAPIKey := sha256.Sum256([]byte(apiKey)) hashedKey := sha256.Sum256([]byte(key)) if subtle.ConstantTimeCompare(hashedAPIKey[:], hashedKey[:]) == 1 { return true, nil } return false, keyauth.ErrMissingOrMalformedAPIKey }, }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Welcome\") }) app.Get(\"/allowed\", authMiddleware, func(c *fiber.Ctx) error { return c.SendString(\"Successfully authenticated!\") }) app.Listen(\":3000\") } Which results in this # / does not need to be authenticated curl http://localhost:3000 #> Welcome # /allowed needs to be authenticated too curl --header \"Authorization: Bearer my-super-secret-key\" http://localhost:3000/allowed #> Successfully authenticated!","s":"Specifying middleware in the handler","u":"/api/middleware/keyauth","h":"#specifying-middleware-in-the-handler","p":1529},{"i":1540,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // SuccessHandler defines a function which is executed for a valid key. // Optional. Default: nil SuccessHandler fiber.Handler // ErrorHandler defines a function which is executed for an invalid key. // It may be used to define a custom error. // Optional. Default: 401 Invalid or expired key ErrorHandler fiber.ErrorHandler // KeyLookup is a string in the form of \":\" that is used // to extract key from the request. // Optional. Default value \"header:Authorization\". // Possible values: // - \"header:\" // - \"query:\" // - \"form:\" // - \"param:\" // - \"cookie:\" KeyLookup string // AuthScheme to be used in the Authorization header. // Optional. Default value \"Bearer\". AuthScheme string // Validator is a function to validate key. Validator func(*fiber.Ctx, string) (bool, error) // Context key to store the bearertoken from the token into context. // Optional. Default: \"token\". ContextKey string }","s":"Config","u":"/api/middleware/keyauth","h":"#config","p":1529},{"i":1542,"t":"var ConfigDefault = Config{ SuccessHandler: func(c *fiber.Ctx) error { return c.Next() }, ErrorHandler: func(c *fiber.Ctx, err error) error { if err == ErrMissingOrMalformedAPIKey { return c.Status(fiber.StatusUnauthorized).SendString(err.Error()) } return c.Status(fiber.StatusUnauthorized).SendString(\"Invalid or expired API Key\") }, KeyLookup: \"header:\" + fiber.HeaderAuthorization, AuthScheme: \"Bearer\", ContextKey: \"token\", }","s":"Default Config","u":"/api/middleware/keyauth","h":"#default-config","p":1529},{"i":1544,"t":"Limiter middleware for Fiber that is used to limit repeat requests to public APIs and/or endpoints such as password reset. It is also useful for API clients, web crawling, or other tasks that need to be throttled. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases. note This module does not share state with other processes/servers by default.","s":"Limiter","u":"/api/middleware/limiter","h":"","p":1543},{"i":1546,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/limiter","h":"#signatures","p":1543},{"i":1548,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/limiter\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(limiter.New()) // Or extend your config for customization app.Use(limiter.New(limiter.Config{ Next: func(c *fiber.Ctx) bool { return c.IP() == \"127.0.0.1\" }, Max: 20, Expiration: 30 * time.Second, KeyGenerator: func(c *fiber.Ctx) string { return c.Get(\"x-forwarded-for\") }, LimitReached: func(c *fiber.Ctx) error { return c.SendFile(\"./toofast.html\") }, Storage: myCustomStorage{}, }))","s":"Examples","u":"/api/middleware/limiter","h":"#examples","p":1543},{"i":1550,"t":"Instead of using the standard fixed window algorithm, you can enable the sliding window algorithm. A example of such configuration is: app.Use(limiter.New(limiter.Config{ Max: 20, Expiration: 30 * time.Second, LimiterMiddleware: limiter.SlidingWindow{}, })) This means that every window will take into account the previous window(if there was any). The given formula for the rate is: weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration) rate = weightOfPreviousWindpw + current window's amount request.","s":"Sliding window","u":"/api/middleware/limiter","h":"#sliding-window","p":1543},{"i":1552,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Max number of recent connections during `Duration` seconds before sending a 429 response // // Default: 5 Max int // KeyGenerator allows you to generate custom keys, by default c.IP() is used // // Default: func(c *fiber.Ctx) string { // return c.IP() // } KeyGenerator func(*fiber.Ctx) string // Expiration is the time on how long to keep records of requests in memory // // Default: 1 * time.Minute Expiration time.Duration // LimitReached is called when a request hits the limit // // Default: func(c *fiber.Ctx) error { // return c.SendStatus(fiber.StatusTooManyRequests) // } LimitReached fiber.Handler // When set to true, requests with StatusCode >= 400 won't be counted. // // Default: false SkipFailedRequests bool // When set to true, requests with StatusCode < 400 won't be counted. // // Default: false SkipSuccessfulRequests bool // Store is used to store the state of the middleware // // Default: an in memory store for this process only Storage fiber.Storage // LimiterMiddleware is the struct that implements limiter middleware. // // Default: a new Fixed Window Rate Limiter LimiterMiddleware LimiterHandler } note A custom store can be used if it implements the Storage interface - more details and an example can be found in store.go.","s":"Config","u":"/api/middleware/limiter","h":"#config","p":1543},{"i":1554,"t":"var ConfigDefault = Config{ Max: 5, Expiration: 1 * time.Minute, KeyGenerator: func(c *fiber.Ctx) string { return c.IP() }, LimitReached: func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusTooManyRequests) }, SkipFailedRequests: false, SkipSuccessfulRequests: false, LimiterMiddleware: FixedWindow{}, }","s":"Default Config","u":"/api/middleware/limiter","h":"#default-config","p":1543},{"i":1556,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 app.Use(limiter.New(limiter.Config{ Storage: storage, }))","s":"Custom Storage/Database","u":"/api/middleware/limiter","h":"#custom-storagedatabase","p":1543},{"i":1558,"t":"Logger middleware for Fiber that logs HTTP request/response details.","s":"Logger","u":"/api/middleware/logger","h":"","p":1557},{"i":1560,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/logger","h":"#signatures","p":1557},{"i":1562,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/logger\" ) tip The order of registration plays a role. Only all routes that are registered after this one will be logged. The middleware should therefore be one of the first to be registered. After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(logger.New()) // Or extend your config for customization // Logging remote IP and Port app.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) // Logging Request ID app.Use(requestid.New()) app.Use(logger.New(logger.Config{ // For more options, see the Config section Format: \"${pid} ${locals:requestid} ${status} - ${method} ${path}​\\n\", })) // Changing TimeZone & TimeFormat app.Use(logger.New(logger.Config{ Format: \"${pid} ${status} - ${method} ${path}\\n\", TimeFormat: \"02-Jan-2006\", TimeZone: \"America/New_York\", })) // Custom File Writer file, err := os.OpenFile(\"./123.log\", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) if err != nil { log.Fatalf(\"error opening file: %v\", err) } defer file.Close() app.Use(logger.New(logger.Config{ Output: file, })) // Add Custom Tags app.Use(logger.New(logger.Config{ CustomTags: map[string]logger.LogFunc{ \"custom_tag\": func(output logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error) { return output.WriteString(\"it is a custom tag\") }, }, })) // Callback after log is written app.Use(logger.New(logger.Config{ TimeFormat: time.RFC3339Nano, TimeZone: \"Asia/Shanghai\", Done: func(c *fiber.Ctx, logString []byte) { if c.Response().StatusCode() != fiber.StatusOK { reporter.SendToSlack(logString) } }, })) // Disable colors when outputting to default format app.Use(logger.New(logger.Config{ DisableColors: true, }))","s":"Examples","u":"/api/middleware/logger","h":"#examples","p":1557},{"i":1564,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Done is a function that is called after the log string for a request is written to Output, // and pass the log string as parameter. // // Optional. Default: nil Done func(c *fiber.Ctx, logString []byte) // tagFunctions defines the custom tag action // // Optional. Default: map[string]LogFunc CustomTags map[string]LogFunc // Format defines the logging tags // // Optional. Default: [${time}] ${status} - ${latency} ${method} ${path}\\n Format string // TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html // // Optional. Default: 15:04:05 TimeFormat string // TimeZone can be specified, such as \"UTC\" and \"America/New_York\" and \"Asia/Chongqing\", etc // // Optional. Default: \"Local\" TimeZone string // TimeInterval is the delay before the timestamp is updated // // Optional. Default: 500 * time.Millisecond TimeInterval time.Duration // Output is a writer where logs are written // // Default: os.Stdout Output io.Writer // DisableColors defines if the logs output should be colorized // // Default: false DisableColors bool enableColors bool enableLatency bool timeZoneLocation *time.Location } type LogFunc func(buf logger.Buffer, c *fiber.Ctx, data *logger.Data, extraParam string) (int, error)","s":"Config","u":"/api/middleware/logger","h":"#config","p":1557},{"i":1566,"t":"var ConfigDefault = Config{ Next: nil, Done: nil, Format: \"[${time}] ${status} - ${latency} ${method} ${path}\\n\", TimeFormat: \"15:04:05\", TimeZone: \"Local\", TimeInterval: 500 * time.Millisecond, Output: os.Stdout, DisableColors: true, }","s":"Default Config","u":"/api/middleware/logger","h":"#default-config","p":1557},{"i":1568,"t":"// Logger variables const ( TagPid = \"pid\" TagTime = \"time\" TagReferer = \"referer\" TagProtocol = \"protocol\" TagPort = \"port\" TagIP = \"ip\" TagIPs = \"ips\" TagHost = \"host\" TagMethod = \"method\" TagPath = \"path\" TagURL = \"url\" TagUA = \"ua\" TagLatency = \"latency\" TagStatus = \"status\" // response status TagResBody = \"resBody\" // response body TagReqHeaders = \"reqHeaders\" TagQueryStringParams = \"queryParams\" // request query parameters TagBody = \"body\" // request body TagBytesSent = \"bytesSent\" TagBytesReceived = \"bytesReceived\" TagRoute = \"route\" TagError = \"error\" // DEPRECATED: Use TagReqHeader instead TagHeader = \"header:\" // request header TagReqHeader = \"reqHeader:\" // request header TagRespHeader = \"respHeader:\" // response header TagQuery = \"query:\" // request query TagForm = \"form:\" // request form TagCookie = \"cookie:\" // request cookie TagLocals = \"locals:\" // colors TagBlack = \"black\" TagRed = \"red\" TagGreen = \"green\" TagYellow = \"yellow\" TagBlue = \"blue\" TagMagenta = \"magenta\" TagCyan = \"cyan\" TagWhite = \"white\" TagReset = \"reset\" )","s":"Constants","u":"/api/middleware/logger","h":"#constants","p":1557},{"i":1570,"t":"Monitor middleware for Fiber that reports server metrics, inspired by express-status-monitor caution Monitor is still in beta, API might change in the future!","s":"Monitor","u":"/api/middleware/monitor","h":"","p":1569},{"i":1572,"t":"func New() fiber.Handler","s":"Signatures","u":"/api/middleware/monitor","h":"#signatures","p":1569},{"i":1574,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/monitor\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config (Assign the middleware to /metrics) app.Get(\"/metrics\", monitor.New()) // Or extend your config for customization // Assign the middleware to /metrics // and change the Title to `MyService Metrics Page` app.Get(\"/metrics\", monitor.New(monitor.Config{Title: \"MyService Metrics Page\"})) You can also access the API endpoint with curl -X GET -H \"Accept: application/json\" http://localhost:3000/metrics which returns: {\"pid\":{ \"cpu\":0.4568381746582226, \"ram\":20516864, \"conns\":3 }, \"os\": { \"cpu\":8.759124087593099, \"ram\":3997155328, \"conns\":44, \"total_ram\":8245489664, \"load_avg\":0.51 }}","s":"Examples","u":"/api/middleware/monitor","h":"#examples","p":1569},{"i":1576,"t":"// Config defines the config for middleware. type Config struct { // Metrics page title // // Optional. Default: \"Fiber Monitor\" Title string // Refresh period // // Optional. Default: 3 seconds Refresh time.Duration // Whether the service should expose only the monitoring API. // // Optional. Default: false APIOnly bool // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Custom HTML Code to Head Section(Before End) // // Optional. Default: empty CustomHead string // FontURL for specify font resource path or URL . also you can use relative path // // Optional. Default: https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap FontURL string // ChartJsURL for specify ChartJS library path or URL . also you can use relative path // // Optional. Default: https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/Chart.bundle.min.js ChartJsURL string index string }","s":"Config","u":"/api/middleware/monitor","h":"#config","p":1569},{"i":1578,"t":"var ConfigDefault = Config{ Title: defaultTitle, Refresh: defaultRefresh, FontURL: defaultFontURL, ChartJsURL: defaultChartJSURL, CustomHead: defaultCustomHead, APIOnly: false, Next: nil, index: newIndex(viewBag{ defaultTitle, defaultRefresh, defaultFontURL, defaultChartJSURL, defaultCustomHead, }), }","s":"Default Config","u":"/api/middleware/monitor","h":"#default-config","p":1569},{"i":1580,"t":"Pprof middleware for Fiber that serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/.","s":"Pprof","u":"/api/middleware/pprof","h":"","p":1579},{"i":1582,"t":"func New() fiber.Handler","s":"Signatures","u":"/api/middleware/pprof","h":"#signatures","p":1579},{"i":1584,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/pprof\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(pprof.New()) // Or extend your config for customization // For example, in systems where you have multiple ingress endpoints, it is common to add a URL prefix, like so: app.Use(pprof.New(pprof.Config{Prefix: \"/endpoint-prefix\"})) // This prefix will be added to the default path of \"/debug/pprof/\", for a resulting URL of: \"/endpoint-prefix/debug/pprof/\".","s":"Examples","u":"/api/middleware/pprof","h":"#examples","p":1579},{"i":1586,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Prefix defines a URL prefix added before \"/debug/pprof\". // Note that it should start with (but not end with) a slash. // Example: \"/federated-fiber\" // // Optional. Default: \"\" Prefix string }","s":"Config","u":"/api/middleware/pprof","h":"#config","p":1579},{"i":1588,"t":"var ConfigDefault = Config{ Next: nil, }","s":"Default Config","u":"/api/middleware/pprof","h":"#default-config","p":1579},{"i":1590,"t":"Proxy middleware for Fiber that allows you to proxy requests to multiple servers.","s":"Proxy","u":"/api/middleware/proxy","h":"","p":1589},{"i":1592,"t":"// Balancer create a load balancer among multiple upstrem servers. func Balancer(config Config) fiber.Handler // Forward performs the given http request and fills the given http response. func Forward(addr string, clients ...*fasthttp.Client) fiber.Handler // Do performs the given http request and fills the given http response. func Do(c *fiber.Ctx, addr string, clients ...*fasthttp.Client) error // DoRedirects performs the given http request and fills the given http response while following up to maxRedirectsCount redirects. func DoRedirects(c *fiber.Ctx, addr string, maxRedirectsCount int, clients ...*fasthttp.Client) error // DoDeadline performs the given request and waits for response until the given deadline. func DoDeadline(c *fiber.Ctx, addr string, deadline time.Time, clients ...*fasthttp.Client) error // DoTimeout performs the given request and waits for response during the given timeout duration. func DoTimeout(c *fiber.Ctx, addr string, timeout time.Duration, clients ...*fasthttp.Client) error // DomainForward the given http request based on the given domain and fills the given http response func DomainForward(hostname string, addr string, clients ...*fasthttp.Client) fiber.Handler // BalancerForward performs the given http request based round robin balancer and fills the given http response func BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler","s":"Signatures","u":"/api/middleware/proxy","h":"#signatures","p":1589},{"i":1594,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/proxy\" ) After you initiate your Fiber app, you can use the following possibilities: // if target https site uses a self-signed certificate, you should // call WithTlsConfig before Do and Forward proxy.WithTlsConfig(&tls.Config{ InsecureSkipVerify: true, }) // if you need to use global self-custom client, you should use proxy.WithClient. proxy.WithClient(&fasthttp.Client{ NoDefaultUserAgentHeader: true, DisablePathNormalizing: true, }) // Forward to url app.Get(\"/gif\", proxy.Forward(\"https://i.imgur.com/IWaBepg.gif\")) // If you want to forward with a specific domain. You have to use proxy.DomainForward. app.Get(\"/payments\", proxy.DomainForward(\"docs.gofiber.io\", \"http://localhost:8000\")) // Forward to url with local custom client app.Get(\"/gif\", proxy.Forward(\"https://i.imgur.com/IWaBepg.gif\", &fasthttp.Client{ NoDefaultUserAgentHeader: true, DisablePathNormalizing: true, })) // Make request within handler app.Get(\"/:id\", func(c *fiber.Ctx) error { url := \"https://i.imgur.com/\"+c.Params(\"id\")+\".gif\" if err := proxy.Do(c, url); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests while following redirects app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoRedirects(c, \"http://google.com\", 3); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests and wait up to 5 seconds before timing out app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoTimeout(c, \"http://localhost:3000\", time.Second * 5); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Make proxy requests, timeout a minute from now app.Get(\"/proxy\", func(c *fiber.Ctx) error { if err := proxy.DoDeadline(c, \"http://localhost\", time.Now().Add(time.Minute)); err != nil { return err } // Remove Server header from response c.Response().Header.Del(fiber.HeaderServer) return nil }) // Minimal round robin balancer app.Use(proxy.Balancer(proxy.Config{ Servers: []string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }, })) // Or extend your balancer for customization app.Use(proxy.Balancer(proxy.Config{ Servers: []string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }, ModifyRequest: func(c *fiber.Ctx) error { c.Request().Header.Add(\"X-Real-IP\", c.IP()) return nil }, ModifyResponse: func(c *fiber.Ctx) error { c.Response().Header.Del(fiber.HeaderServer) return nil }, })) // Or this way if the balancer is using https and the destination server is only using http. app.Use(proxy.BalancerForward([]string{ \"http://localhost:3001\", \"http://localhost:3002\", \"http://localhost:3003\", }))","s":"Examples","u":"/api/middleware/proxy","h":"#examples","p":1589},{"i":1596,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Servers defines a list of :// HTTP servers, // // which are used in a round-robin manner. // i.e.: \"https://foobar.com, http://www.foobar.com\" // // Required Servers []string // ModifyRequest allows you to alter the request // // Optional. Default: nil ModifyRequest fiber.Handler // ModifyResponse allows you to alter the response // // Optional. Default: nil ModifyResponse fiber.Handler // Timeout is the request timeout used when calling the proxy client // // Optional. Default: 1 second Timeout time.Duration // Per-connection buffer size for requests' reading. // This also limits the maximum header size. // Increase this buffer if your clients send multi-KB RequestURIs // and/or multi-KB headers (for example, BIG cookies). ReadBufferSize int // Per-connection buffer size for responses' writing. WriteBufferSize int // tls config for the http client. TlsConfig *tls.Config // Client is custom client when client config is complex. // Note that Servers, Timeout, WriteBufferSize, ReadBufferSize and TlsConfig // will not be used if the client are set. Client *fasthttp.LBClient }","s":"Config","u":"/api/middleware/proxy","h":"#config","p":1589},{"i":1598,"t":"var ConfigDefault = Config{ Next: nil, ModifyRequest: nil, ModifyResponse: nil, Timeout: fasthttp.DefaultLBClientTimeout, }","s":"Default Config","u":"/api/middleware/proxy","h":"#default-config","p":1589},{"i":1600,"t":"Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.","s":"Recover","u":"/api/middleware/recover","h":"","p":1599},{"i":1602,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/recover","h":"#signatures","p":1599},{"i":1604,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/recover\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(recover.New()) // This panic will be caught by the middleware app.Get(\"/\", func(c *fiber.Ctx) error { panic(\"I'm an error\") })","s":"Examples","u":"/api/middleware/recover","h":"#examples","p":1599},{"i":1606,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // EnableStackTrace enables handling stack trace // // Optional. Default: false EnableStackTrace bool // StackTraceHandler defines a function to handle stack trace // // Optional. Default: defaultStackTraceHandler StackTraceHandler func(c *fiber.Ctx, e interface{}) }","s":"Config","u":"/api/middleware/recover","h":"#config","p":1599},{"i":1608,"t":"var ConfigDefault = Config{ Next: nil, EnableStackTrace: false, StackTraceHandler: defaultStackTraceHandler, }","s":"Default Config","u":"/api/middleware/recover","h":"#default-config","p":1599},{"i":1610,"t":"Redirection middleware for Fiber.","s":"Redirect","u":"/api/middleware/redirect","h":"","p":1609},{"i":1612,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/redirect","h":"#signatures","p":1609},{"i":1614,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/redirect\" ) func main() { app := fiber.New() app.Use(redirect.New(redirect.Config{ Rules: map[string]string{ \"/old\": \"/new\", \"/old/*\": \"/new/$1\", }, StatusCode: 301, })) app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) app.Get(\"/new/*\", func(c *fiber.Ctx) error { return c.SendString(\"Wildcard: \" + c.Params(\"*\")) }) app.Listen(\":3000\") } Test: curl http://localhost:3000/old curl http://localhost:3000/old/hello","s":"Examples","u":"/api/middleware/redirect","h":"#examples","p":1609},{"i":1616,"t":"// Config defines the config for middleware. type Config struct { // Filter defines a function to skip middleware. // Optional. Default: nil Next func(*fiber.Ctx) bool // Rules defines the URL path rewrite rules. The values captured in asterisk can be // retrieved by index e.g. $1, $2 and so on. // Required. Example: // \"/old\": \"/new\", // \"/api/*\": \"/$1\", // \"/js/*\": \"/public/javascripts/$1\", // \"/users/*/orders/*\": \"/user/$1/order/$2\", Rules map[string]string // The status code when redirecting // This is ignored if Redirect is disabled // Optional. Default: 302 (fiber.StatusFound) StatusCode int rulesRegex map[*regexp.Regexp]string }","s":"Config","u":"/api/middleware/redirect","h":"#config","p":1609},{"i":1618,"t":"var ConfigDefault = Config{ StatusCode: fiber.StatusFound, }","s":"Default Config","u":"/api/middleware/redirect","h":"#default-config","p":1609},{"i":1620,"t":"RequestID middleware for Fiber that adds an indentifier to the response.","s":"RequestID","u":"/api/middleware/requestid","h":"","p":1619},{"i":1622,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/requestid","h":"#signatures","p":1619},{"i":1624,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/requestid\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config app.Use(requestid.New()) // Or extend your config for customization app.Use(requestid.New(requestid.Config{ Header: \"X-Custom-Header\", Generator: func() string { return \"static-id\" }, }))","s":"Examples","u":"/api/middleware/requestid","h":"#examples","p":1619},{"i":1626,"t":"// Config defines the config for middleware. type Config struct { // Next defines a function to skip this middleware when returned true. // // Optional. Default: nil Next func(c *fiber.Ctx) bool // Header is the header key where to get/set the unique request ID // // Optional. Default: \"X-Request-ID\" Header string // Generator defines a function to generate the unique identifier. // // Optional. Default: utils.UUID Generator func() string // ContextKey defines the key used when storing the request ID in // the locals for a specific request. // // Optional. Default: requestid ContextKey interface{} }","s":"Config","u":"/api/middleware/requestid","h":"#config","p":1619},{"i":1628,"t":"The default config uses a fast UUID generator which will expose the number of requests made to the server. To conceal this value for better privacy, use the utils.UUIDv4 generator. var ConfigDefault = Config{ Next: nil, Header: fiber.HeaderXRequestID, Generator: utils.UUID, ContextKey: \"requestid\", }","s":"Default Config","u":"/api/middleware/requestid","h":"#default-config","p":1619},{"i":1630,"t":"Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links.","s":"Rewrite","u":"/api/middleware/rewrite","h":"","p":1629},{"i":1632,"t":"func New(config ...Config) fiber.Handler","s":"Signatures","u":"/api/middleware/rewrite","h":"#signatures","p":1629},{"i":1634,"t":"package main import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/rewrite\" ) func main() { app := fiber.New() app.Use(rewrite.New(rewrite.Config{ Rules: map[string]string{ \"/old\": \"/new\", \"/old/*\": \"/new/$1\", }, })) app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) app.Get(\"/new/*\", func(c *fiber.Ctx) error { return c.SendString(\"Wildcard: \" + c.Params(\"*\")) }) app.Listen(\":3000\") } Test: curl http://localhost:3000/old curl http://localhost:3000/old/hello","s":"Examples","u":"/api/middleware/rewrite","h":"#examples","p":1629},{"i":1636,"t":"Session middleware for Fiber. note This middleware uses our Storage package to support various databases through a single interface. The default configuration for this middleware saves data to memory, see the examples below for other databases.","s":"Session","u":"/api/middleware/session","h":"","p":1635},{"i":1638,"t":"func New(config ...Config) *Store func (s *Store) RegisterType(i interface{}) func (s *Store) Get(c *fiber.Ctx) (*Session, error) func (s *Store) Reset() error func (s *Session) Get(key string) interface{} func (s *Session) Set(key string, val interface{}) func (s *Session) Delete(key string) func (s *Session) Destroy() error func (s *Session) Regenerate() error func (s *Session) Save() error func (s *Session) Fresh() bool func (s *Session) ID() string func (s *Session) Keys() []string caution Storing interface{} values are limited to built-ins Go types.","s":"Signatures","u":"/api/middleware/session","h":"#signatures","p":1635},{"i":1640,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/session\" ) After you initiate your Fiber app, you can use the following possibilities: // Initialize default config // This stores all of your app's sessions store := session.New() app.Get(\"/\", func(c *fiber.Ctx) error { // Get session from storage sess, err := store.Get(c) if err != nil { panic(err) } // Get value name := sess.Get(\"name\") // Set key/value sess.Set(\"name\", \"john\") // Get all Keys keys := sess.Keys() // Delete key sess.Delete(\"name\") // Destroy session if err := sess.Destroy(); err != nil { panic(err) } // Sets a specific expiration for this session sess.SetExpiry(time.Second * 2) // Save session if err := sess.Save(); err != nil { panic(err) } return c.SendString(fmt.Sprintf(\"Welcome %v\", name)) })","s":"Examples","u":"/api/middleware/session","h":"#examples","p":1635},{"i":1642,"t":"// Config defines the config for middleware. type Config struct { // Allowed session duration // Optional. Default value 24 * time.Hour Expiration time.Duration // Storage interface to store the session data // Optional. Default value memory.New() Storage fiber.Storage // KeyLookup is a string in the form of \":\" that is used // to extract session id from the request. // Possible values: \"header:\", \"query:\" or \"cookie:\" // Optional. Default value \"cookie:session_id\". KeyLookup string // Domain of the CSRF cookie. // Optional. Default value \"\". CookieDomain string // Path of the CSRF cookie. // Optional. Default value \"\". CookiePath string // Indicates if CSRF cookie is secure. // Optional. Default value false. CookieSecure bool // Indicates if CSRF cookie is HTTP only. // Optional. Default value false. CookieHTTPOnly bool // Value of SameSite cookie. // Optional. Default value \"Lax\". CookieSameSite string // Decides whether cookie should last for only the browser sesison. // Ignores Expiration if set to true // Optional. Default value false. CookieSessionOnly bool // KeyGenerator generates the session key. // Optional. Default value utils.UUIDv4 KeyGenerator func() string // Deprecated: Please use KeyLookup CookieName string // Source defines where to obtain the session id source Source // The session name sessionName string }","s":"Config","u":"/api/middleware/session","h":"#config","p":1635},{"i":1644,"t":"var ConfigDefault = Config{ Expiration: 24 * time.Hour, KeyLookup: \"cookie:session_id\", KeyGenerator: utils.UUIDv4, source: \"cookie\", sessionName: \"session_id\", }","s":"Default Config","u":"/api/middleware/session","h":"#default-config","p":1635},{"i":1646,"t":"const ( SourceCookie Source = \"cookie\" SourceHeader Source = \"header\" SourceURLQuery Source = \"query\" )","s":"Constants","u":"/api/middleware/session","h":"#constants","p":1635},{"i":1648,"t":"You can use any storage from our storage package. storage := sqlite3.New() // From github.com/gofiber/storage/sqlite3 store := session.New(session.Config{ Storage: storage, }) To use the store, see the Examples.","s":"Custom Storage/Database","u":"/api/middleware/session","h":"#custom-storagedatabase","p":1635},{"i":1650,"t":"Skip middleware for Fiber that skips a wrapped handler if a predicate is true.","s":"Skip","u":"/api/middleware/skip","h":"","p":1649},{"i":1652,"t":"func New(handler fiber.Handler, exclude func(c *fiber.Ctx) bool) fiber.Handler","s":"Signatures","u":"/api/middleware/skip","h":"#signatures","p":1649},{"i":1654,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/skip\" ) After you initiate your Fiber app, you can use the following possibilities: func main() { app := fiber.New() app.Use(skip.New(BasicHandler, func(ctx *fiber.Ctx) bool { return ctx.Method() == fiber.MethodGet })) app.Get(\"/\", func(ctx *fiber.Ctx) error { return ctx.SendString(\"It was a GET request!\") }) log.Fatal(app.Listen(\":3000\")) } func BasicHandler(ctx *fiber.Ctx) error { return ctx.SendString(\"It was not a GET request!\") } tip app.Use will handle requests from any route, and any method. In the example above, it will only skip if the method is GET.","s":"Examples","u":"/api/middleware/skip","h":"#examples","p":1649},{"i":1656,"t":"There exist two distinct implementations of timeout middleware Fiber. New Wraps a fiber.Handler with a timeout. If the handler takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler. caution This has been deprecated since it raises race conditions. NewWithContext As a fiber.Handler wrapper, it creates a context with context.WithTimeout and pass it in UserContext. If the context passed executions (eg. DB ops, Http calls) takes longer than the given duration to return, the timeout error is set and forwarded to the centralized ErrorHandler. It does not cancel long running executions. Underlying executions must handle timeout by using context.Context parameter.","s":"Timeout","u":"/api/middleware/timeout","h":"","p":1655},{"i":1658,"t":"func New(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler func NewWithContext(handler fiber.Handler, timeout time.Duration, timeoutErrors ...error) fiber.Handler","s":"Signatures","u":"/api/middleware/timeout","h":"#signatures","p":1655},{"i":1660,"t":"Import the middleware package that is part of the Fiber web framework import ( \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/timeout\" ) After you initiate your Fiber app, you can use the following possibilities: func main() { app := fiber.New() h := func(c *fiber.Ctx) error { sleepTime, _ := time.ParseDuration(c.Params(\"sleepTime\") + \"ms\") if err := sleepWithContext(c.UserContext(), sleepTime); err != nil { return fmt.Errorf(\"%w: execution error\", err) } return nil } app.Get(\"/foo/:sleepTime\", timeout.New(h, 2*time.Second)) log.Fatal(app.Listen(\":3000\")) } func sleepWithContext(ctx context.Context, d time.Duration) error { timer := time.NewTimer(d) select { case <-ctx.Done(): if !timer.Stop() { <-timer.C } return context.DeadlineExceeded case <-timer.C: } return nil } Test http 200 with curl: curl --location -I --request GET 'http://localhost:3000/foo/1000' Test http 408 with curl: curl --location -I --request GET 'http://localhost:3000/foo/3000' Use with custom error: var ErrFooTimeOut = errors.New(\"foo context canceled\") func main() { app := fiber.New() h := func(c *fiber.Ctx) error { sleepTime, _ := time.ParseDuration(c.Params(\"sleepTime\") + \"ms\") if err := sleepWithContextWithCustomError(c.UserContext(), sleepTime); err != nil { return fmt.Errorf(\"%w: execution error\", err) } return nil } app.Get(\"/foo/:sleepTime\", timeout.NewWithContext(h, 2*time.Second, ErrFooTimeOut)) log.Fatal(app.Listen(\":3000\")) } func sleepWithContextWithCustomError(ctx context.Context, d time.Duration) error { timer := time.NewTimer(d) select { case <-ctx.Done(): if !timer.Stop() { <-timer.C } return ErrFooTimeOut case <-timer.C: } return nil } Sample usage with a DB call: func main() { app := fiber.New() db, _ := gorm.Open(postgres.Open(\"postgres://localhost/foodb\"), &gorm.Config{}) handler := func(ctx *fiber.Ctx) error { tran := db.WithContext(ctx.UserContext()).Begin() if tran = tran.Exec(\"SELECT pg_sleep(50)\"); tran.Error != nil { return tran.Error } if tran = tran.Commit(); tran.Error != nil { return tran.Error } return nil } app.Get(\"/foo\", timeout.NewWithContext(handler, 10*time.Second)) log.Fatal(app.Listen(\":3000\")) }","s":"Examples","u":"/api/middleware/timeout","h":"#examples","p":1655},{"i":1663,"t":"TechEmpower provides a performance comparison of many web application frameworks executing fundamental tasks such as JSON serialization, database access, and server-side template composition. Each framework is operating in a realistic production configuration. Results are captured on cloud instances and on physical hardware. The test implementations are largely community-contributed and all source is available at the GitHub repository. Fiber v1.10.0 28 HT Cores Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz 32GB RAM Ubuntu 18.04.3 4.15.0-88-generic Dedicated Cisco 10-Gbit Ethernet switch.","s":"TechEmpower","u":"/extra/benchmarks","h":"#techempower","p":1661},{"i":1665,"t":"The Plaintext test is an exercise of the request-routing fundamentals only, designed to demonstrate the capacity of high-performance platforms in particular. Requests will be sent using HTTP pipelining. The response payload is still small, meaning good performance is still necessary in order to saturate the gigabit Ethernet of the test environment. See Plaintext requirements Fiber - 6,162,556 responses per second with an average latency of 2.0 ms. Express - 367,069 responses per second with an average latency of 354.1 ms.","s":"Plaintext","u":"/extra/benchmarks","h":"#plaintext","p":1661},{"i":1667,"t":"Fiber handled 11,846 responses per second with an average latency of 42.8 ms. Express handled 2,066 responses per second with an average latency of 390.44 ms.","s":"Data Updates","u":"/extra/benchmarks","h":"#data-updates","p":1661},{"i":1669,"t":"Fiber handled 19,664 responses per second with an average latency of 25.7 ms. Express handled 4,302 responses per second with an average latency of 117.2 ms.","s":"Multiple Queries","u":"/extra/benchmarks","h":"#multiple-queries","p":1661},{"i":1671,"t":"Fiber handled 368,647 responses per second with an average latency of 0.7 ms. Express handled 57,880 responses per second with an average latency of 4.4 ms.","s":"Single Query","u":"/extra/benchmarks","h":"#single-query","p":1661},{"i":1673,"t":"Fiber handled 1,146,667 responses per second with an average latency of 0.4 ms. Express handled 244,847 responses per second with an average latency of 1.1 ms.","s":"JSON Serialization","u":"/extra/benchmarks","h":"#json-serialization","p":1661},{"i":1675,"t":"πŸ”— https://github.com/smallnest/go-web-framework-benchmark CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz MEM 4GB GO go1.13.6 linux/amd64 OS Linux The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers. The concurrency clients are 5000. Latency is the time of real processing time by web servers. The smaller is the better. Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better. If we enable http pipelining, test result as below: Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is: If we enable http pipelining, test result as below: Dependency graph for v1.9.0","s":"Go web framework benchmark","u":"/extra/benchmarks","h":"#go-web-framework-benchmark","p":1661},{"i":1678,"t":"There is no definitive answer to this question. The answer depends on the scale of your application and the team that is involved. To be as flexible as possible, Fiber makes no assumptions in terms of structure. Routes and other application-specific logic can live in as many files as you wish, in any directory structure you prefer. View the following examples for inspiration: gofiber/boilerplate thomasvvugt/fiber-boilerplate Youtube - Building a REST API using Gorm and Fiber embedmode/fiberseed","s":"How should I structure my application?","u":"/extra/faq","h":"#how-should-i-structure-my-application","p":1676},{"i":1680,"t":"If you're using v2.32.0 or later, all you need to do is to implement a custom error handler. See below, or see a more detailed explanation at Error Handling. If you're using v2.31.0 or earlier, the error handler will not capture 404 errors. Instead, you need to add a middleware function at the very bottom of the stack (below all other functions) to handle a 404 response: Example app.Use(func(c *fiber.Ctx) error { return c.Status(fiber.StatusNotFound).SendString(\"Sorry can't find that!\") })","s":"How do I handle custom 404 responses?","u":"/extra/faq","h":"#how-do-i-handle-custom-404-responses","p":1676},{"i":1682,"t":"Air is a handy tool that automatically restarts your Go applications whenever the source code changes, making your development process faster and more efficient. To use Air in a Fiber project, follow these steps: Install Air by downloading the appropriate binary for your operating system from the GitHub release page or by building the tool directly from source. Create a configuration file for Air in your project directory. This file can be named, for example, .air.toml or air.conf. Here's a sample configuration file that works with Fiber: # .air.toml root = \".\" tmp_dir = \"tmp\" [build] cmd = \"go build -o ./tmp/main .\" bin = \"./tmp/main\" delay = 1000 # ms exclude_dir = [\"assets\", \"tmp\", \"vendor\"] include_ext = [\"go\", \"tpl\", \"tmpl\", \"html\"] exclude_regex = [\"_test\\\\.go\"] Start your Fiber application using Air by running the following command in the terminal: air As you make changes to your source code, Air will detect them and automatically restart the application. A complete example demonstrating the use of Air with Fiber can be found in the Fiber Recipes repository. This example shows how to configure and use Air in a Fiber project to create an efficient development environment.","s":"How can i use live reload ?","u":"/extra/faq","h":"#how-can-i-use-live-reload-","p":1676},{"i":1684,"t":"To override the default error handler, you can override the default when providing a Config when initiating a new Fiber instance. Example app := fiber.New(fiber.Config{ ErrorHandler: func(c *fiber.Ctx, err error) error { return c.Status(fiber.StatusInternalServerError).SendString(err.Error()) }, }) We have a dedicated page explaining how error handling works in Fiber, see Error Handling.","s":"How do I set up an error handler?","u":"/extra/faq","h":"#how-do-i-set-up-an-error-handler","p":1676},{"i":1686,"t":"Fiber currently supports 8 template engines in our gofiber/template middleware: Ace Amber Django Handlebars HTML Jet Mustache Pug To learn more about using Templates in Fiber, see Templates.","s":"Which template engines does Fiber support?","u":"/extra/faq","h":"#which-template-engines-does-fiber-support","p":1676},{"i":1688,"t":"Yes, we have our own Discord server, where we hang out. We have different rooms for every subject. If you have questions or just want to have a chat, feel free to join us via this > invite link <.","s":"Does Fiber have a community chat?","u":"/extra/faq","h":"#does-fiber-have-a-community-chat","p":1676},{"i":1690,"t":"Yes we do, here are some examples: This example works v2 package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/logger\" ) type Host struct { Fiber *fiber.App } func main() { // Hosts hosts := map[string]*Host{} //----- // API //----- api := fiber.New() api.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"api.localhost:3000\"] = &Host{api} api.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"API\") }) //------ // Blog //------ blog := fiber.New() blog.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"blog.localhost:3000\"] = &Host{blog} blog.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Blog\") }) //--------- // Website //--------- site := fiber.New() site.Use(logger.New(logger.Config{ Format: \"[${ip}]:${port} ${status} - ${method} ${path}\\n\", })) hosts[\"localhost:3000\"] = &Host{site} site.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Website\") }) // Server app := fiber.New() app.Use(func(c *fiber.Ctx) error { host := hosts[c.Hostname()] if host == nil { return c.SendStatus(fiber.StatusNotFound) } else { host.Fiber.Handler()(c.Context()) return nil } }) log.Fatal(app.Listen(\":3000\")) } If more information is needed, please refer to this issue #750","s":"Does fiber support sub domain routing ?","u":"/extra/faq","h":"#does-fiber-support-sub-domain-routing-","p":1676},{"i":1693,"t":"It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them. Example app.Get(\"/\", func(c *fiber.Ctx) error { // Pass error to Fiber return c.SendFile(\"file-does-not-exist\") }) Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below: Example package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/fiber/v2/middleware/recover\" ) func main() { app := fiber.New() app.Use(recover.New()) app.Get(\"/\", func(c *fiber.Ctx) error { panic(\"This panic is caught by fiber\") }) log.Fatal(app.Listen(\":3000\")) } You could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found). Example app.Get(\"/\", func(c *fiber.Ctx) error { // 503 Service Unavailable return fiber.ErrServiceUnavailable // 503 On vacation! return fiber.NewError(fiber.StatusServiceUnavailable, \"On vacation!\") })","s":"Catching Errors","u":"/guide/error-handling","h":"#catching-errors","p":1691},{"i":1695,"t":"Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If the error is of type fiber.Error, the response is sent with the provided status code and message. Example // Default error handler var DefaultErrorHandler = func(c *fiber.Ctx, err error) error { // Status code defaults to 500 code := fiber.StatusInternalServerError // Retrieve the custom status code if it's a *fiber.Error var e *fiber.Error if errors.As(err, &e) { code = e.Code } // Set Content-Type: text/plain; charset=utf-8 c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8) // Return status code with error message return c.Status(code).SendString(err.Error()) }","s":"Default Error Handler","u":"/guide/error-handling","h":"#default-error-handler","p":1691},{"i":1697,"t":"A custom error handler can be set using a Config when initializing a Fiber instance. In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response. The following example shows how to display error pages for different types of errors. Example // Create a new fiber instance with custom config app := fiber.New(fiber.Config{ // Override default error handler ErrorHandler: func(ctx *fiber.Ctx, err error) error { // Status code defaults to 500 code := fiber.StatusInternalServerError // Retrieve the custom status code if it's a *fiber.Error var e *fiber.Error if errors.As(err, &e) { code = e.Code } // Send custom error page err = ctx.Status(code).SendFile(fmt.Sprintf(\"./%d.html\", code)) if err != nil { // In case the SendFile fails return ctx.Status(fiber.StatusInternalServerError).SendString(\"Internal Server Error\") } // Return from handler return nil }, }) // ... Special thanks to the Echo & Express framework for inspiration regarding error handling.","s":"Custom Error Handler","u":"/guide/error-handling","h":"#custom-error-handler","p":1691},{"i":1700,"t":"Since Fiber v2.32.0, we use encoding/json as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of encoding/json, we recommend you to use these libraries: goccy/go-json bytedance/sonic segmentio/encoding mailru/easyjson minio/simdjson-go wI2L/jettison Example package main import \"github.com/gofiber/fiber/v2\" import \"github.com/goccy/go-json\" func main() { app := fiber.New(fiber.Config{ JSONEncoder: json.Marshal, JSONDecoder: json.Unmarshal, }) # ... }","s":"Custom JSON Encoder/Decoder","u":"/guide/faster-fiber","h":"#custom-json-encoderdecoder","p":1698},{"i":1702,"t":"Set custom JSON encoder for client Set custom JSON decoder for client Set custom JSON encoder for application Set custom JSON decoder for application","s":"References","u":"/guide/faster-fiber","h":"#references","p":1698},{"i":1704,"t":"info In general, the Group functionality in Fiber behaves similarly to ExpressJS. Groups are declared virtually and all routes declared within the group are flattened into a single list with a prefix, which is then checked by the framework in the order it was declared. This means that the behavior of Group in Fiber is identical to that of ExpressJS.","s":"🎭 Grouping","u":"/guide/grouping","h":"","p":1703},{"i":1706,"t":"Like Routing, groups can also have paths that belong to a cluster. func main() { app := fiber.New() api := app.Group(\"/api\", middleware) // /api v1 := api.Group(\"/v1\", middleware) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", middleware) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } A Group of paths can have an optional handler. func main() { app := fiber.New() api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\") // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\") // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } caution Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.","s":"Paths","u":"/guide/grouping","h":"#paths","p":1703},{"i":1708,"t":"Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue. func main() { app := fiber.New() handler := func(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusOK) } api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\", func(c *fiber.Ctx) error { // middleware for /api/v1 c.Set(\"Version\", \"v1\") return c.Next() }) v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user log.Fatal(app.Listen(\":3000\")) }","s":"Group Handlers","u":"/guide/grouping","h":"#group-handlers","p":1703},{"i":1710,"t":"With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks: OnRoute OnName OnGroup OnGroupName OnListen OnFork OnShutdown OnMount","s":"πŸͺ Hooks","u":"/guide/hooks","h":"","p":1709},{"i":1712,"t":"// Handlers define a function to create hooks for Fiber. type OnRouteHandler = func(Route) error type OnNameHandler = OnRouteHandler type OnGroupHandler = func(Group) error type OnGroupNameHandler = OnGroupHandler type OnListenHandler = func() error type OnForkHandler = func(int) error type OnShutdownHandler = OnListenHandler type OnMountHandler = func(*App) error","s":"Constants","u":"/guide/hooks","h":"#constants","p":1709},{"i":1714,"t":"OnRoute is a hook to execute user functions on each route registeration. Also you can get route properties by route parameter. Signature func (app *App) OnRoute(handler ...OnRouteHandler)","s":"OnRoute","u":"/guide/hooks","h":"#onroute","p":1709},{"i":1716,"t":"OnName is a hook to execute user functions on each route naming. Also you can get route properties by route parameter. caution OnName only works with naming routes, not groups. Signature func (app *App) OnName(handler ...OnNameHandler) OnName Example package main import ( \"fmt\" \"github.com/gofiber/fiber/v2\" ) func main() { app := fiber.New() app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"index\") app.Hooks().OnName(func(r fiber.Route) error { fmt.Print(\"Name: \" + r.Name + \", \") return nil }) app.Hooks().OnName(func(r fiber.Route) error { fmt.Print(\"Method: \" + r.Method + \"\\n\") return nil }) app.Get(\"/add/user\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"addUser\") app.Delete(\"/destroy/user\", func(c *fiber.Ctx) error { return c.SendString(c.Route().Name) }).Name(\"destroyUser\") app.Listen(\":5000\") } // Results: // Name: addUser, Method: GET // Name: destroyUser, Method: DELETE","s":"OnName","u":"/guide/hooks","h":"#onname","p":1709},{"i":1718,"t":"OnGroup is a hook to execute user functions on each group registeration. Also you can get group properties by group parameter. Signature func (app *App) OnGroup(handler ...OnGroupHandler)","s":"OnGroup","u":"/guide/hooks","h":"#ongroup","p":1709},{"i":1720,"t":"OnGroupName is a hook to execute user functions on each group naming. Also you can get group properties by group parameter. caution OnGroupName only works with naming groups, not routes. Signature func (app *App) OnGroupName(handler ...OnGroupNameHandler)","s":"OnGroupName","u":"/guide/hooks","h":"#ongroupname","p":1709},{"i":1722,"t":"OnListen is a hook to execute user functions on Listen, ListenTLS, Listener. Signature func (app *App) OnListen(handler ...OnListenHandler)","s":"OnListen","u":"/guide/hooks","h":"#onlisten","p":1709},{"i":1724,"t":"OnFork is a hook to execute user functions on Fork. Signature func (app *App) OnFork(handler ...OnForkHandler)","s":"OnFork","u":"/guide/hooks","h":"#onfork","p":1709},{"i":1726,"t":"OnShutdown is a hook to execute user functions after Shutdown. Signature func (app *App) OnShutdown(handler ...OnShutdownHandler)","s":"OnShutdown","u":"/guide/hooks","h":"#onshutdown","p":1709},{"i":1728,"t":"OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent app. The parent app is passed as a parameter. It works for app and group mounting. Signature func (h *Hooks) OnMount(handler ...OnMountHandler) OnMount Example package main import ( \"fmt\" \"github.com/gofiber/fiber/v2\" ) func main() { app := New() app.Get(\"/\", testSimpleHandler).Name(\"x\") subApp := New() subApp.Get(\"/test\", testSimpleHandler) subApp.Hooks().OnMount(func(parent *fiber.App) error { fmt.Print(\"Mount path of parent app: \"+parent.MountPath()) // ... return nil }) app.Mount(\"/sub\", subApp) } // Result: // Mount path of parent app: caution OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.","s":"OnMount","u":"/guide/hooks","h":"#onmount","p":1709},{"i":1731,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Handlers","u":"/guide/routing","h":"#handlers","p":1729},{"i":1733,"t":"Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns. Examples of route paths based on strings // This route path will match requests to the root route, \"/\": app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"root\") }) // This route path will match requests to \"/about\": app.Get(\"/about\", func(c *fiber.Ctx) error { return c.SendString(\"about\") }) // This route path will match requests to \"/random.txt\": app.Get(\"/random.txt\", func(c *fiber.Ctx) error { return c.SendString(\"random.txt\") }) As with the expressJs framework, the order of the route declaration plays a role. When a request is received, the routes are checked in the order in which they are declared. info So please be careful to write routes with variable parameters after the routes that contain fixed parts, so that these variable parts do not match instead and unexpected behavior occurs.","s":"Paths","u":"/guide/routing","h":"#paths","p":1729},{"i":1735,"t":"Route parameters are dynamic elements in the route, which are named or not named segments. This segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys or for unnamed parameters the character(*, +) and the counter of this. The characters :, +, and * are characters that introduce a parameter. Greedy parameters are indicated by wildcard(*) or plus(+) signs. The routing also offers the possibility to use optional parameters, for the named parameters these are marked with a final \"?\", unlike the plus sign which is not optional, you can use the wildcard character for a parameter range which is optional and greedy. Example of define routes with route parameters // Parameters app.Get(\"/user/:name/books/:title\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s\\n\", c.Params(\"name\")) fmt.Fprintf(c, \"%s\\n\", c.Params(\"title\")) return nil }) // Plus - greedy - not optional app.Get(\"/user/+\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"+\")) }) // Optional parameter app.Get(\"/user/:name?\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"name\")) }) // Wildcard - greedy - optional app.Get(\"/user/*\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"*\")) }) // This route path will match requests to \"/v1/some/resource/name:customVerb\", since the parameter character is escaped app.Get(\"/v1/some/resource/name\\\\:customVerb\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, Community\") }) info Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes. info All special parameter characters can also be escaped with \"\\\\\" and lose their value, so you can use them in the route if you want, like in the custom methods of the google api design guide. // http://localhost:3000/plantae/prunus.persica app.Get(\"/plantae/:genus.:species\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s.%s\\n\", c.Params(\"genus\"), c.Params(\"species\")) return nil // prunus.persica }) // http://localhost:3000/flights/LAX-SFO app.Get(\"/flights/:from-:to\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s-%s\\n\", c.Params(\"from\"), c.Params(\"to\")) return nil // LAX-SFO }) Our intelligent router recognizes that the introductory parameter characters should be part of the request route in this case and can process them as such. // http://localhost:3000/shop/product/color:blue/size:xs app.Get(\"/shop/product/color::color/size::size\", func(c *fiber.Ctx) error { fmt.Fprintf(c, \"%s:%s\\n\", c.Params(\"color\"), c.Params(\"size\")) return nil // blue:xs }) In addition, several parameters in a row and several unnamed parameter characters in the route, such as the wildcard or plus character, are possible, which greatly expands the possibilities of the router for the user. // GET /@v1 // Params: \"sign\" -> \"@\", \"param\" -> \"v1\" app.Get(\"/:sign:param\", handler) // GET /api-v1 // Params: \"name\" -> \"v1\" app.Get(\"/api-:name\", handler) // GET /customer/v1/cart/proxy // Params: \"*1\" -> \"customer/\", \"*2\" -> \"/cart\" app.Get(\"/*v1*/proxy\", handler) // GET /v1/brand/4/shop/blue/xs // Params: \"*1\" -> \"brand/4\", \"*2\" -> \"blue/xs\" app.Get(\"/v1/*/shop/*\", handler) We have adapted the routing strongly to the express routing, but currently without the possibility of the regular expressions, because they are quite slow. The possibilities can be tested with version 0.1.7 (express 4) in the online Express route tester.","s":"Parameters","u":"/guide/routing","h":"#parameters","p":1729},{"i":1737,"t":"Route constraints execute when a match has occurred to the incoming URL and the URL path is tokenized into route values by parameters. The feature was intorduced in v2.37.0 and inspired by .NET Core. caution Constraints aren't validation for parameters. If constraint aren't valid for parameter value, Fiber returns 404 handler. Constraint Example Example matches int :id 123456789, -123456789 bool :active true,false guid :id CD2C1638-1638-72D5-1638-DEADBEEF1638 float :weight 1.234, -1,001.01e8 minLen(value) :username Test (must be at least 4 characters) maxLen(value) :filename MyFile (must be no more than 8 characters len(length) :filename somefile.txt (exactly 12 characters) min(value) :age 19 (Integer value must be at least 18) max(value) :age 91 (Integer value must be no more than 120) range(min,max) :age 91 (Integer value must be at least 18 but no more than 120) alpha :name Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive) datetime :dob 2005-11-01 regex(expression) :date 2022-08-27 (Must match regular expression) Examples Single Constraint Multiple Constraints Regex Constraint app.Get(\"/:test\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/12 // 12 // curl -X GET http://localhost:3000/1 // Cannot GET /1 You can use ; for multiple constraints. app.Get(\"/:test\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/120000 // Cannot GET /120000 // curl -X GET http://localhost:3000/1 // Cannot GET /1 // curl -X GET http://localhost:3000/250 // 250 Fiber precompiles regex query when to register routes. So there're no performance overhead for regex constraint. app.Get(\"/:date\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"date\")) }) // curl -X GET http://localhost:3000/125 // Cannot GET /125 // curl -X GET http://localhost:3000/test // Cannot GET /test // curl -X GET http://localhost:3000/2022-08-27 // 2022-08-27 caution You should use \\\\ before routing-specific characters when to use datetime constraint (*, +, ?, :, /, <, >, ;, (, )), to avoid wrong parsing. Optional Parameter Example You can impose constraints on optional parameters as well. app.Get(\"/:test?\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"test\")) }) // curl -X GET http://localhost:3000/42 // 42 // curl -X GET http://localhost:3000/ // // curl -X GET http://localhost:3000/7.0 // Cannot GET /7.0","s":"Constraints","u":"/guide/routing","h":"#constraints","p":1729},{"i":1739,"t":"Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route. Example of a middleware function app.Use(func(c *fiber.Ctx) error { // Set a custom header on all responses: c.Set(\"X-Custom-Header\", \"Hello, World\") // Go to next middleware: return c.Next() }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") }) Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.","s":"Middleware","u":"/guide/routing","h":"#middleware","p":1729},{"i":1741,"t":"If you have many endpoints, you can organize your routes using Group. func main() { app := fiber.New() api := app.Group(\"/api\", middleware) // /api v1 := api.Group(\"/v1\", middleware) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", middleware) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user log.Fatal(app.Listen(\":3000\")) } More information about this in our Grouping Guide","s":"Grouping","u":"/guide/routing","h":"#grouping","p":1729},{"i":1744,"t":"Fiber provides a Views interface to provide your own template engine: Views type Views interface { Load() error Render(io.Writer, string, interface{}, ...string) error } Views interface contains a Load and Render method, Load is executed by Fiber on app initialization to load/parse the templates. // Pass engine to Fiber's Views Engine app := fiber.New(fiber.Config{ Views: engine, // Views Layout is the global layout for all template render until override on Render function. ViewsLayout: \"layouts/main\" }) The Render method is linked to the ctx.Render() function that accepts a template name and binding data. It will use global layout if layout is not being defined in Render function. If the Fiber config option PassLocalsToViews is enabled, then all locals set using ctx.Locals(key, value) will be passed to the template. app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"index\", fiber.Map{ \"hello\": \"world\", }); })","s":"Template interfaces","u":"/guide/templates","h":"#template-interfaces","p":1742},{"i":1746,"t":"Fiber team maintains templates package that provides wrappers for multiple template engines: html ace amber django handlebars jet mustache pug Example views/index.html package main import ( \"log\" \"github.com/gofiber/fiber/v2\" \"github.com/gofiber/template/html/v2\" ) func main() { // Initialize standard Go html template engine engine := html.New(\"./views\", \".html\") // If you want other engine, just replace with following // Create a new engine with django // engine := django.New(\"./views\", \".django\") app := fiber.New(fiber.Config{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) error { // Render index template return c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) log.Fatal(app.Listen(\":3000\")) }

{{.Title}}

","s":"Engines","u":"/guide/templates","h":"#engines","p":1742},{"i":1749,"t":"Fiber can make great use of the validator package to ensure correct validation of data to store. Official validator Github page (Installation, use, examples..). You can find the detailed descriptions of the validations used in the fields contained on the structs below: Detailed docs Validation Example type Job struct{ Type string `validate:\"required,min=3,max=32\"` Salary int `validate:\"required,number\"` } type User struct{ Name string `validate:\"required,min=3,max=32\"` // use `*bool` here otherwise the validation will fail for `false` values // Ref: https://github.com/go-playground/validator/issues/319#issuecomment-339222389 IsActive *bool `validate:\"required\"` Email string `validate:\"required,email,min=6,max=32\"` Job Job `validate:\"dive\"` } type ErrorResponse struct { FailedField string Tag string Value string } var validate = validator.New() func ValidateStruct(user User) []*ErrorResponse { var errors []*ErrorResponse err := validate.Struct(user) if err != nil { for _, err := range err.(validator.ValidationErrors) { var element ErrorResponse element.FailedField = err.StructNamespace() element.Tag = err.Tag() element.Value = err.Param() errors = append(errors, &element) } } return errors } func AddUser(c *fiber.Ctx) error { //Connect to database user := new(User) if err := c.BodyParser(user); err != nil { return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{ \"message\": err.Error(), }) } errors := ValidateStruct(*user) if errors != nil { return c.Status(fiber.StatusBadRequest).JSON(errors) } //Do something else here //Return user return c.JSON(user) } // Running a test with the following curl commands // curl -X POST -H \"Content-Type: application/json\" --data \"{\\\"name\\\":\\\"john\\\",\\\"isactive\\\":\\\"True\\\"}\" http://localhost:8080/register/user // Results in // [{\"FailedField\":\"User.Email\",\"Tag\":\"required\",\"Value\":\"\"},{\"FailedField\":\"User.Job.Salary\",\"Tag\":\"required\",\"Value\":\"\"},{\"FailedField\":\"User.Job.Type\",\"Tag\":\"required\",\"Value\":\"\"}]⏎","s":"Validator package","u":"/guide/validation","h":"#validator-package","p":1747},{"i":1751,"t":"Registers a route bound to a specific HTTP method. Signatures // HTTP methods func (app *App) Get(path string, handlers ...Handler) Router func (app *App) Head(path string, handlers ...Handler) Router func (app *App) Post(path string, handlers ...Handler) Router func (app *App) Put(path string, handlers ...Handler) Router func (app *App) Delete(path string, handlers ...Handler) Router func (app *App) Connect(path string, handlers ...Handler) Router func (app *App) Options(path string, handlers ...Handler) Router func (app *App) Trace(path string, handlers ...Handler) Router func (app *App) Patch(path string, handlers ...Handler) Router // Add allows you to specifiy a method as value func (app *App) Add(method, path string, handlers ...Handler) Router // All will register the route on all HTTP methods // Almost the same as app.Use but not bound to prefixes func (app *App) All(path string, handlers ...Handler) Router Examples // Simple GET handler app.Get(\"/api/list\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a GET request!\") }) // Simple POST handler app.Post(\"/api/register\", func(c *fiber.Ctx) error { return c.SendString(\"I'm a POST request!\") }) Use can be used for middleware packages and prefix catchers. These routes will only match the beginning of each path i.e. /john will match /john/doe, /johnnnnn etc Signature func (app *App) Use(args ...interface{}) Router Examples // Match any request app.Use(func(c *fiber.Ctx) error { return c.Next() }) // Match request starting with /api app.Use(\"/api\", func(c *fiber.Ctx) error { return c.Next() }) // Match requests starting with /api or /home (multiple-prefix support) app.Use([]string{\"/api\", \"/home\"}, func(c *fiber.Ctx) error { return c.Next() }) // Attach multiple handlers app.Use(\"/api\", func(c *fiber.Ctx) error { c.Set(\"X-Custom-Header\", random.String(32)) return c.Next() }, func(c *fiber.Ctx) error { return c.Next() })","s":"Route Handlers","u":"/partials/routing/route-handlers","h":"","p":1750},{"i":1754,"t":"Checks, if the specified extensions or content types are acceptable. info Based on the request’s Accept HTTP header. Signature func (c *Ctx) Accepts(offers ...string) string func (c *Ctx) AcceptsCharsets(offers ...string) string func (c *Ctx) AcceptsEncodings(offers ...string) string func (c *Ctx) AcceptsLanguages(offers ...string) string Example // Accept: text/html, application/json; q=0.8, text/plain; q=0.5; charset=\"utf-8\" app.Get(\"/\", func(c *fiber.Ctx) error { c.Accepts(\"html\") // \"html\" c.Accepts(\"text/html\") // \"text/html\" c.Accepts(\"json\", \"text\") // \"json\" c.Accepts(\"application/json\") // \"application/json\" c.Accepts(\"text/plain\", \"application/json\") // \"application/json\", due to quality c.Accepts(\"image/png\") // \"\" c.Accepts(\"png\") // \"\" // ... }) Example 2 // Accept: text/html, text/*, application/json, */*; q=0 app.Get(\"/\", func(c *fiber.Ctx) error { c.Accepts(\"text/plain\", \"application/json\") // \"application/json\", due to specificity c.Accepts(\"application/json\", \"text/html\") // \"text/html\", due to first match c.Accepts(\"image/png\") // \"\", due to */* without q factor 0 is Not Acceptable // ... }) Fiber provides similar functions for the other accept headers. // Accept-Charset: utf-8, iso-8859-1;q=0.2 // Accept-Encoding: gzip, compress;q=0.2 // Accept-Language: en;q=0.8, nl, ru app.Get(\"/\", func(c *fiber.Ctx) error { c.AcceptsCharsets(\"utf-16\", \"iso-8859-1\") // \"iso-8859-1\" c.AcceptsEncodings(\"compress\", \"br\") // \"compress\" c.AcceptsLanguages(\"pt\", \"nl\", \"ru\") // \"nl\" // ... })","s":"Accepts","u":"/api/ctx","h":"#accepts","p":1752},{"i":1756,"t":"Params is used to get all route parameters. Using Params method to get params. Signature func (c *Ctx) AllParams() map[string]string Example // GET http://example.com/user/fenny app.Get(\"/user/:name\", func(c *fiber.Ctx) error { c.AllParams() // \"{\"name\": \"fenny\"}\" // ... }) // GET http://example.com/user/fenny/123 app.Get(\"/user/*\", func(c *fiber.Ctx) error { c.AllParams() // \"{\"*1\": \"fenny/123\"}\" // ... })","s":"AllParams","u":"/api/ctx","h":"#allparams","p":1752},{"i":1758,"t":"Returns the *App reference so you could easily access all application settings. Signature func (c *Ctx) App() *App Example app.Get(\"/stack\", func(c *fiber.Ctx) error { return c.JSON(c.App().Stack()) })","s":"App","u":"/api/ctx","h":"#app","p":1752},{"i":1760,"t":"Appends the specified value to the HTTP response header field. caution If the header is not already set, it creates the header with the specified value. Signature func (c *Ctx) Append(field string, values ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Append(\"Link\", \"http://google.com\", \"http://localhost\") // => Link: http://localhost, http://google.com c.Append(\"Link\", \"Test\") // => Link: http://localhost, http://google.com, Test // ... })","s":"Append","u":"/api/ctx","h":"#append","p":1752},{"i":1762,"t":"Sets the HTTP response Content-Disposition header field to attachment. Signature func (c *Ctx) Attachment(filename ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Attachment() // => Content-Disposition: attachment c.Attachment(\"./upload/images/logo.png\") // => Content-Disposition: attachment; filename=\"logo.png\" // => Content-Type: image/png // ... })","s":"Attachment","u":"/api/ctx","h":"#attachment","p":1752},{"i":1764,"t":"Returns the base URL (protocol + host) as a string. Signature func (c *Ctx) BaseURL() string Example // GET https://example.com/page#chapter-1 app.Get(\"/\", func(c *fiber.Ctx) error { c.BaseURL() // https://example.com // ... })","s":"BaseURL","u":"/api/ctx","h":"#baseurl","p":1752},{"i":1766,"t":"Add vars to default view var map binding to template engine. Variables are read by the Render method and may be overwritten. Signature func (c *Ctx) Bind(vars Map) error Example app.Use(func(c *fiber.Ctx) error { c.Bind(fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"xxx.tmpl\", fiber.Map{}) // Render will use Title variable })","s":"Bind","u":"/api/ctx","h":"#bind","p":1752},{"i":1768,"t":"Returns the raw request body. Signature func (c *Ctx) Body() []byte Example // curl -X POST http://localhost:8080 -d user=john app.Post(\"/\", func(c *fiber.Ctx) error { // Get raw body from POST request: return c.Send(c.Body()) // []byte(\"user=john\") }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Body","u":"/api/ctx","h":"#body","p":1752},{"i":1770,"t":"Binds the request body to a struct. It is important to specify the correct struct tag based on the content type to be parsed. For example, if you want to parse a JSON body with a field called Pass, you would use a struct field of json:\"pass\". content-type struct tag application/x-www-form-urlencoded form multipart/form-data form application/json json application/xml xml text/xml xml Signature func (c *Ctx) BodyParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `json:\"name\" xml:\"name\" form:\"name\"` Pass string `json:\"pass\" xml:\"pass\" form:\"pass\"` } app.Post(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.BodyParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe // ... }) // Run tests with the following curl commands // curl -X POST -H \"Content-Type: application/json\" --data \"{\\\"name\\\":\\\"john\\\",\\\"pass\\\":\\\"doe\\\"}\" localhost:3000 // curl -X POST -H \"Content-Type: application/xml\" --data \"johndoe\" localhost:3000 // curl -X POST -H \"Content-Type: application/x-www-form-urlencoded\" --data \"name=john&pass=doe\" localhost:3000 // curl -X POST -F name=john -F pass=doe http://localhost:3000 // curl -X POST \"http://localhost:3000/?name=john&pass=doe\" Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"BodyParser","u":"/api/ctx","h":"#bodyparser","p":1752},{"i":1772,"t":"Expire a client cookie (or all cookies if left empty) Signature func (c *Ctx) ClearCookie(key ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { // Clears all cookies: c.ClearCookie() // Expire specific cookie by name: c.ClearCookie(\"user\") // Expire multiple cookies by names: c.ClearCookie(\"token\", \"session\", \"track_id\", \"version\") // ... }) caution Web browsers and other compliant clients will only clear the cookie if the given options are identical to those when creating the cookie, excluding expires and maxAge. ClearCookie will not set these values for you - a technique similar to the one shown below should be used to ensure your cookie is deleted. Example app.Get(\"/set\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"token\", Value: \"randomvalue\", Expires: time.Now().Add(24 * time.Hour), HTTPOnly: true, SameSite: \"lax\", }) // ... }) app.Get(\"/delete\", func(c *fiber.Ctx) error { c.Cookie(&fiber.Cookie{ Name: \"token\", // Set expiry date to the past Expires: time.Now().Add(-(time.Hour * 2)), HTTPOnly: true, SameSite: \"lax\", }) // ... })","s":"ClearCookie","u":"/api/ctx","h":"#clearcookie","p":1752},{"i":1774,"t":"ClientHelloInfo contains information from a ClientHello message in order to guide application logic in the GetCertificate and GetConfigForClient callbacks. You can refer to the ClientHelloInfo struct documentation for more information on the returned struct. Signature func (c *Ctx) ClientHelloInfo() *tls.ClientHelloInfo Example // GET http://example.com/hello app.Get(\"/hello\", func(c *fiber.Ctx) error { chi := c.ClientHelloInfo() // ... })","s":"ClientHelloInfo","u":"/api/ctx","h":"#clienthelloinfo","p":1752},{"i":1776,"t":"Returns *fasthttp.RequestCtx that is compatible with the context.Context interface that requires a deadline, a cancellation signal, and other values across API boundaries. Signature func (c *Ctx) Context() *fasthttp.RequestCtx info Please read the Fasthttp Documentation for more information.","s":"Context","u":"/api/ctx","h":"#context","p":1752},{"i":1778,"t":"Set cookie Signature func (c *Ctx) Cookie(cookie *Cookie) type Cookie struct { Name string `json:\"name\"` Value string `json:\"value\"` Path string `json:\"path\"` Domain string `json:\"domain\"` MaxAge int `json:\"max_age\"` Expires time.Time `json:\"expires\"` Secure bool `json:\"secure\"` HTTPOnly bool `json:\"http_only\"` SameSite string `json:\"same_site\"` SessionOnly bool `json:\"session_only\"` } Example app.Get(\"/\", func(c *fiber.Ctx) error { // Create cookie cookie := new(fiber.Cookie) cookie.Name = \"john\" cookie.Value = \"doe\" cookie.Expires = time.Now().Add(24 * time.Hour) // Set cookie c.Cookie(cookie) // ... })","s":"Cookie","u":"/api/ctx","h":"#cookie","p":1752},{"i":1780,"t":"Get cookie value by key, you could pass an optional default value that will be returned if the cookie key does not exist. Signature func (c *Ctx) Cookies(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { // Get cookie by key: c.Cookies(\"name\") // \"john\" c.Cookies(\"empty\", \"doe\") // \"doe\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Cookies","u":"/api/ctx","h":"#cookies","p":1752},{"i":1782,"t":"Transfers the file from path as an attachment. Typically, browsers will prompt the user to download. By default, the Content-Disposition header filename= parameter is the file path (this typically appears in the browser dialog). Override this default with the filename parameter. Signature func (c *Ctx) Download(file string, filename ...string) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.Download(\"./files/report-12345.pdf\"); // => Download report-12345.pdf return c.Download(\"./files/report-12345.pdf\", \"report.pdf\"); // => Download report.pdf })","s":"Download","u":"/api/ctx","h":"#download","p":1752},{"i":1784,"t":"Performs content-negotiation on the Accept HTTP header. It uses Accepts to select a proper format. info If the header is not specified or there is no proper format, text/plain is used. Signature func (c *Ctx) Format(body interface{}) error Example app.Get(\"/\", func(c *fiber.Ctx) error { // Accept: text/plain c.Format(\"Hello, World!\") // => Hello, World! // Accept: text/html c.Format(\"Hello, World!\") // =>

Hello, World!

// Accept: application/json c.Format(\"Hello, World!\") // => \"Hello, World!\" // .. })","s":"Format","u":"/api/ctx","h":"#format","p":1752},{"i":1786,"t":"MultipartForm files can be retrieved by name, the first file from the given key is returned. Signature func (c *Ctx) FormFile(key string) (*multipart.FileHeader, error) Example app.Post(\"/\", func(c *fiber.Ctx) error { // Get first file from form field \"document\": file, err := c.FormFile(\"document\") // Save file to root directory: return c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)) })","s":"FormFile","u":"/api/ctx","h":"#formfile","p":1752},{"i":1788,"t":"Any form values can be retrieved by name, the first value from the given key is returned. Signature func (c *Ctx) FormValue(key string, defaultValue ...string) string Example app.Post(\"/\", func(c *fiber.Ctx) error { // Get first value from form field \"name\": c.FormValue(\"name\") // => \"john\" or \"\" if not exist // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"FormValue","u":"/api/ctx","h":"#formvalue","p":1752},{"i":1790,"t":"https://expressjs.com/en/4x/api.html#req.fresh Signature func (c *Ctx) Fresh() bool","s":"Fresh","u":"/api/ctx","h":"#fresh","p":1752},{"i":1792,"t":"Returns the HTTP request header specified by the field. tip The match is case-insensitive. Signature func (c *Ctx) Get(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Get(\"Content-Type\") // \"text/plain\" c.Get(\"CoNtEnT-TypE\") // \"text/plain\" c.Get(\"something\", \"john\") // \"john\" // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Get","u":"/api/ctx","h":"#get","p":1752},{"i":1794,"t":"Returns the HTTP request headers. Signature func (c *Ctx) GetReqHeaders() map[string]string","s":"GetReqHeaders","u":"/api/ctx","h":"#getreqheaders","p":1752},{"i":1796,"t":"Returns the HTTP response header specified by the field. tip The match is case-insensitive. Signature func (c *Ctx) GetRespHeader(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.GetRespHeader(\"X-Request-Id\") // \"8d7ad5e3-aaf3-450b-a241-2beb887efd54\" c.GetRespHeader(\"Content-Type\") // \"text/plain\" c.GetRespHeader(\"something\", \"john\") // \"john\" // .. }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"GetRespHeader","u":"/api/ctx","h":"#getrespheader","p":1752},{"i":1798,"t":"Returns the HTTP response headers. Signature func (c *Ctx) GetRespHeaders() map[string]string","s":"GetRespHeaders","u":"/api/ctx","h":"#getrespheaders","p":1752},{"i":1800,"t":"Generates URLs to named routes, with parameters. URLs are relative, for example: \"/user/1831\" Signature func (c *Ctx) GetRouteURL(routeName string, params Map) (string, error) Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Home page\") }).Name(\"home\") app.Get(\"/user/:id\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"id\")) }).Name(\"user.show\") app.Get(\"/test\", func(c *fiber.Ctx) error { location, _ := c.GetRouteURL(\"user.show\", fiber.Map{\"id\": 1}) return c.SendString(location) }) // /test returns \"/user/1\"","s":"GetRouteURL","u":"/api/ctx","h":"#getrouteurl","p":1752},{"i":1802,"t":"Returns the hostname derived from the Host HTTP header. Signature func (c *Ctx) Hostname() string Example // GET http://google.com/search app.Get(\"/\", func(c *fiber.Ctx) error { c.Hostname() // \"google.com\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Hostname","u":"/api/ctx","h":"#hostname","p":1752},{"i":1804,"t":"Returns the remote IP address of the request. Signature func (c *Ctx) IP() string Example app.Get(\"/\", func(c *fiber.Ctx) error { c.IP() // \"127.0.0.1\" // ... }) When registering the proxy request header in the fiber app, the ip address of the header is returned (Fiber configuration) app := fiber.New(fiber.Config{ ProxyHeader: fiber.HeaderXForwardedFor, })","s":"IP","u":"/api/ctx","h":"#ip","p":1752},{"i":1806,"t":"Returns an array of IP addresses specified in the X-Forwarded-For request header. Signature func (c *Ctx) IPs() []string Example // X-Forwarded-For: proxy1, 127.0.0.1, proxy3 app.Get(\"/\", func(c *fiber.Ctx) error { c.IPs() // [\"proxy1\", \"127.0.0.1\", \"proxy3\"] // ... })","s":"IPs","u":"/api/ctx","h":"#ips","p":1752},{"i":1808,"t":"Returns the matching content type, if the incoming request’s Content-Type HTTP header field matches the MIME type specified by the type parameter. info If the request has no body, it returns false. Signature func (c *Ctx) Is(extension string) bool Example // Content-Type: text/html; charset=utf-8 app.Get(\"/\", func(c *fiber.Ctx) error { c.Is(\"html\") // true c.Is(\".html\") // true c.Is(\"json\") // false // ... })","s":"Is","u":"/api/ctx","h":"#is","p":1752},{"i":1810,"t":"Returns true if request came from localhost Signature func (c *Ctx) IsFromLocal() bool { Example app.Get(\"/\", func(c *fiber.Ctx) error { // If request came from localhost, return true else return false c.IsFromLocal() // ... })","s":"IsFromLocal","u":"/api/ctx","h":"#isfromlocal","p":1752},{"i":1812,"t":"Converts any interface or string to JSON using the goccy/go-json package. info JSON also sets the content header to application/json. Signature func (c *Ctx) JSON(data interface{}) error Example type SomeStruct struct { Name string Age uint8 } app.Get(\"/json\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ Name: \"Grame\", Age: 20, } return c.JSON(data) // => Content-Type: application/json // => \"{\"Name\": \"Grame\", \"Age\": 20}\" return c.JSON(fiber.Map{ \"name\": \"Grame\", \"age\": 20, }) // => Content-Type: application/json // => \"{\"name\": \"Grame\", \"age\": 20}\" })","s":"JSON","u":"/api/ctx","h":"#json","p":1752},{"i":1814,"t":"Sends a JSON response with JSONP support. This method is identical to JSON, except that it opts-in to JSONP callback support. By default, the callback name is simply callback. Override this by passing a named string in the method. Signature func (c *Ctx) JSONP(data interface{}, callback ...string) error Example type SomeStruct struct { name string age uint8 } app.Get(\"/\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ name: \"Grame\", age: 20, } return c.JSONP(data) // => callback({\"name\": \"Grame\", \"age\": 20}) return c.JSONP(data, \"customFunc\") // => customFunc({\"name\": \"Grame\", \"age\": 20}) })","s":"JSONP","u":"/api/ctx","h":"#jsonp","p":1752},{"i":1816,"t":"Joins the links followed by the property to populate the response’s Link HTTP header field. Signature func (c *Ctx) Links(link ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Links( \"http://api.example.com/users?page=2\", \"next\", \"http://api.example.com/users?page=5\", \"last\", ) // Link: ; rel=\"next\", // ; rel=\"last\" // ... })","s":"Links","u":"/api/ctx","h":"#links","p":1752},{"i":1818,"t":"A method that stores variables scoped to the request and, therefore, are available only to the routes that match the request. tip This is useful if you want to pass some specific data to the next middleware. Signature func (c *Ctx) Locals(key interface{}, value ...interface{}) interface{} Example app.Use(func(c *fiber.Ctx) error { c.Locals(\"user\", \"admin\") return c.Next() }) app.Get(\"/admin\", func(c *fiber.Ctx) error { if c.Locals(\"user\") == \"admin\" { return c.Status(fiber.StatusOK).SendString(\"Welcome, admin!\") } return c.SendStatus(fiber.StatusForbidden) })","s":"Locals","u":"/api/ctx","h":"#locals","p":1752},{"i":1820,"t":"Sets the response Location HTTP header to the specified path parameter. Signature func (c *Ctx) Location(path string) Example app.Post(\"/\", func(c *fiber.Ctx) error { c.Location(\"http://example.com\") c.Location(\"/foo/bar\") return nil })","s":"Location","u":"/api/ctx","h":"#location","p":1752},{"i":1822,"t":"Returns a string corresponding to the HTTP method of the request: GET, POST, PUT, and so on. Optionally, you could override the method by passing a string. Signature func (c *Ctx) Method(override ...string) string Example app.Post(\"/\", func(c *fiber.Ctx) error { c.Method() // \"POST\" c.Method(\"GET\") c.Method() // GET // ... })","s":"Method","u":"/api/ctx","h":"#method","p":1752},{"i":1824,"t":"To access multipart form entries, you can parse the binary with MultipartForm(). This returns a map[string][]string, so given a key, the value will be a string slice. Signature func (c *Ctx) MultipartForm() (*multipart.Form, error) Example app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form if token := form.Value[\"token\"]; len(token) > 0 { // Get key value: fmt.Println(token[0]) } // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: if err := c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)); err != nil { return err } } } return err })","s":"MultipartForm","u":"/api/ctx","h":"#multipartform","p":1752},{"i":1826,"t":"When Next is called, it executes the next method in the stack that matches the current route. You can pass an error struct within the method that will end the chaining and call the error handler. Signature func (c *Ctx) Next() error Example app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(\"1st route!\") return c.Next() }) app.Get(\"*\", func(c *fiber.Ctx) error { fmt.Println(\"2nd route!\") return c.Next() }) app.Get(\"/\", func(c *fiber.Ctx) error { fmt.Println(\"3rd route!\") return c.SendString(\"Hello, World!\") })","s":"Next","u":"/api/ctx","h":"#next","p":1752},{"i":1828,"t":"Returns the original request URL. Signature func (c *Ctx) OriginalURL() string Example // GET http://example.com/search?q=something app.Get(\"/\", func(c *fiber.Ctx) error { c.OriginalURL() // \"/search?q=something\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"OriginalURL","u":"/api/ctx","h":"#originalurl","p":1752},{"i":1830,"t":"Method can be used to get the route parameters, you could pass an optional default value that will be returned if the param key does not exist. info Defaults to empty string (\"\"), if the param doesn't exist. Signature func (c *Ctx) Params(key string, defaultValue ...string) string Example // GET http://example.com/user/fenny app.Get(\"/user/:name\", func(c *fiber.Ctx) error { c.Params(\"name\") // \"fenny\" // ... }) // GET http://example.com/user/fenny/123 app.Get(\"/user/*\", func(c *fiber.Ctx) error { c.Params(\"*\") // \"fenny/123\" c.Params(\"*1\") // \"fenny/123\" // ... }) Unnamed route parameters(*, +) can be fetched by the character and the counter in the route. Example // ROUTE: /v1/*/shop/* // GET: /v1/brand/4/shop/blue/xs c.Params(\"*1\") // \"brand/4\" c.Params(\"*2\") // \"blue/xs\" For reasons of downward compatibility, the first parameter segment for the parameter character can also be accessed without the counter. Example app.Get(\"/v1/*/shop/*\", func(c *fiber.Ctx) error { c.Params(\"*\") // outputs the values of the first wildcard segment }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Params","u":"/api/ctx","h":"#params","p":1752},{"i":1832,"t":"Method can be used to get an integer from the route parameters. Please note if that parameter is not in the request, zero will be returned. If the parameter is NOT a number, zero and an error will be returned info Defaults to the integer zero (0), if the param doesn't exist. Signature func (c *Ctx) ParamsInt(key string) (int, error) Example // GET http://example.com/user/123 app.Get(\"/user/:id\", func(c *fiber.Ctx) error { id, err := c.ParamsInt(\"id\") // int 123 and no error // ... }) This method is equivalent of using atoi with ctx.Params","s":"ParamsInt","u":"/api/ctx","h":"#paramsint","p":1752},{"i":1834,"t":"This method is similar to BodyParser, but for path parameters. It is important to use the struct tag \"params\". For example, if you want to parse a path parameter with a field called Pass, you would use a struct field of params:\"pass\" Signature func (c *Ctx) ParamsParser(out interface{}) error Example // GET http://example.com/user/111 app.Get(\"/user/:id\", func(c *fiber.Ctx) error { param := struct {ID uint `params:\"id\"`}{} c.ParamsParser(¶m) // \"{\"id\": 111}\" // ... })","s":"ParamsParser","u":"/api/ctx","h":"#paramsparser","p":1752},{"i":1836,"t":"Contains the path part of the request URL. Optionally, you could override the path by passing a string. For internal redirects, you might want to call RestartRouting instead of Next. Signature func (c *Ctx) Path(override ...string) string Example // GET http://example.com/users?sort=desc app.Get(\"/users\", func(c *fiber.Ctx) error { c.Path() // \"/users\" c.Path(\"/john\") c.Path() // \"/john\" // ... })","s":"Path","u":"/api/ctx","h":"#path","p":1752},{"i":1838,"t":"Contains the request protocol string: http or https for TLS requests. Signature func (c *Ctx) Protocol() string Example // GET http://example.com app.Get(\"/\", func(c *fiber.Ctx) error { c.Protocol() // \"http\" // ... })","s":"Protocol","u":"/api/ctx","h":"#protocol","p":1752},{"i":1840,"t":"Queries is a function that returns an object containing a property for each query string parameter in the route. Signature func (c *Ctx) Queries() (map[string]string, error) Example // GET http://example.com/?name=alex&want_pizza=false&id= app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"name\"] // \"alex\" m[\"want_pizza\"] // \"false\" m[\"id\"] // \"\" // ... }) Example // GET http://example.com/?field1=value1&field1=value2&field2=value3 app.Get(\"/\", func (c *fiber.Ctx) error { m := c.Queries() m[\"field1\"] // \"value2\" m[\"field2\"] // value3 }) Example // GET http://example.com/?list_a=1&list_a=2&list_a=3&list_b[]=1&list_b[]=2&list_b[]=3&list_c=1,2,3 app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"list_a\"] // \"3\" m[\"list_b[]\"] // \"3\" m[\"list_c\"] // \"1,2,3\" }) Example // GET /api/posts?filters.author.name=John&filters.category.name=Technology app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"filters.author.name\"] // John m[\"filters.category.name\"] // Technology }) Example // GET /api/posts?tags=apple,orange,banana&filters[tags]=apple,orange,banana&filters[category][name]=fruits&filters.tags=apple,orange,banana&filters.category.name=fruits app.Get(\"/\", func(c *fiber.Ctx) error { m := c.Queries() m[\"tags\"] // apple,orange,banana m[\"filters[tags]\"] // apple,orange,banana m[\"filters[category][name]\"] // fruits m[\"filters.tags\"] // apple,orange,banana m[\"filters.category.name\"] // fruits })","s":"Queries","u":"/api/ctx","h":"#queries","p":1752},{"i":1842,"t":"This property is an object containing a property for each query string parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. info If there is no query string, it returns an empty string. Signature func (c *Ctx) Query(key string, defaultValue ...string) string Example // GET http://example.com/?order=desc&brand=nike app.Get(\"/\", func(c *fiber.Ctx) error { c.Query(\"order\") // \"desc\" c.Query(\"brand\") // \"nike\" c.Query(\"empty\", \"nike\") // \"nike\" // ... }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Query","u":"/api/ctx","h":"#query","p":1752},{"i":1844,"t":"This property is an object containing a property for each query boolean parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, false will be returned. If the parameter is not a boolean, it is still tried to be converted and usually returned as false. Signature func (c *Ctx) QueryBool(key string, defaultValue ...bool) bool Example // GET http://example.com/?name=alex&want_pizza=false&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryBool(\"want_pizza\") // false c.QueryBool(\"want_pizza\", true) // false c.QueryBool(\"name\") // false c.QueryBool(\"name\", true) // true c.QueryBool(\"id\") // false c.QueryBool(\"id\", true) // true // ... })","s":"QueryBool","u":"/api/ctx","h":"#querybool","p":1752},{"i":1846,"t":"This property is an object containing a property for each query float64 parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, zero will be returned. If the parameter is not a number, it is still tried to be converted and usually returned as 1. info Defaults to the float64 zero (0), if the param doesn't exist. Signature func (c *Ctx) QueryFloat(key string, defaultValue ...float64) float64 Example // GET http://example.com/?name=alex&amount=32.23&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryFloat(\"amount\") // 32.23 c.QueryFloat(\"amount\", 3) // 32.23 c.QueryFloat(\"name\", 1) // 1 c.QueryFloat(\"name\") // 0 c.QueryFloat(\"id\", 3) // 3 // ... })","s":"QueryFloat","u":"/api/ctx","h":"#queryfloat","p":1752},{"i":1848,"t":"This property is an object containing a property for each query integer parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. caution Please note if that parameter is not in the request, zero will be returned. If the parameter is not a number, it is still tried to be converted and usually returned as 1. info Defaults to the integer zero (0), if the param doesn't exist. Signature func (c *Ctx) QueryInt(key string, defaultValue ...int) int Example // GET http://example.com/?name=alex&wanna_cake=2&id= app.Get(\"/\", func(c *fiber.Ctx) error { c.QueryInt(\"wanna_cake\", 1) // 2 c.QueryInt(\"name\", 1) // 1 c.QueryInt(\"id\", 1) // 1 c.QueryInt(\"id\") // 0 // ... })","s":"QueryInt","u":"/api/ctx","h":"#queryint","p":1752},{"i":1850,"t":"This method is similar to BodyParser, but for query parameters. It is important to use the struct tag \"query\". For example, if you want to parse a query parameter with a field called Pass, you would use a struct field of query:\"pass\". Signature func (c *Ctx) QueryParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `query:\"name\"` Pass string `query:\"pass\"` Products []string `query:\"products\"` } app.Get(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.QueryParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe log.Println(p.Products) // [shoe, hat] // ... }) // Run tests with the following curl command // curl \"http://localhost:3000/?name=john&pass=doe&products=shoe,hat\"","s":"QueryParser","u":"/api/ctx","h":"#queryparser","p":1752},{"i":1852,"t":"A struct containing the type and a slice of ranges will be returned. Signature func (c *Ctx) Range(size int) (Range, error) Example // Range: bytes=500-700, 700-900 app.Get(\"/\", func(c *fiber.Ctx) error { b := c.Range(1000) if b.Type == \"bytes\" { for r := range r.Ranges { fmt.Println(r) // [500, 700] } } })","s":"Range","u":"/api/ctx","h":"#range","p":1752},{"i":1854,"t":"Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. Signature func (c *Ctx) Redirect(location string, status ...int) error Example app.Get(\"/coffee\", func(c *fiber.Ctx) error { return c.Redirect(\"/teapot\") }) app.Get(\"/teapot\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusTeapot).Send(\"🍡 short and stout 🍡\") }) More examples app.Get(\"/\", func(c *fiber.Ctx) error { return c.Redirect(\"/foo/bar\") return c.Redirect(\"../login\") return c.Redirect(\"http://example.com\") return c.Redirect(\"http://example.com\", 301) })","s":"Redirect","u":"/api/ctx","h":"#redirect","p":1752},{"i":1856,"t":"Redirects to the specific route along with the parameters and with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. info If you want to send queries to route, you must add \"queries\" key typed as map[string]string to params. Signature func (c *Ctx) RedirectToRoute(routeName string, params fiber.Map, status ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { // /user/fiber return c.RedirectToRoute(\"user\", fiber.Map{ \"name\": \"fiber\" }) }) app.Get(\"/with-queries\", func(c *fiber.Ctx) error { // /user/fiber?data[0][name]=john&data[0][age]=10&test=doe return c.RedirectToRoute(\"user\", fiber.Map{ \"name\": \"fiber\", \"queries\": map[string]string{\"data[0][name]\": \"john\", \"data[0][age]\": \"10\", \"test\": \"doe\"}, }) }) app.Get(\"/user/:name\", func(c *fiber.Ctx) error { return c.SendString(c.Params(\"name\")) }).Name(\"user\")","s":"RedirectToRoute","u":"/api/ctx","h":"#redirecttoroute","p":1752},{"i":1858,"t":"Redirects back to refer URL. It redirects to fallback URL if refer header doesn't exists, with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. Signature func (c *Ctx) RedirectBack(fallback string, status ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Home page\") }) app.Get(\"/test\", func(c *fiber.Ctx) error { c.Set(\"Content-Type\", \"text/html\") return c.SendString(`Back`) }) app.Get(\"/back\", func(c *fiber.Ctx) error { return c.RedirectBack(\"/\") })","s":"RedirectBack","u":"/api/ctx","h":"#redirectback","p":1752},{"i":1860,"t":"Renders a view with data and sends a text/html response. By default Render uses the default Go Template engine. If you want to use another View engine, please take a look at our Template middleware. Signature func (c *Ctx) Render(name string, bind interface{}, layouts ...string) error","s":"Render","u":"/api/ctx","h":"#render","p":1752},{"i":1862,"t":"Request return the *fasthttp.Request pointer Signature func (c *Ctx) Request() *fasthttp.Request Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Request().Header.Method() // => []byte(\"GET\") })","s":"Request","u":"/api/ctx","h":"#request","p":1752},{"i":1864,"t":"This method is similar to BodyParser, but for request headers. It is important to use the struct tag \"reqHeader\". For example, if you want to parse a request header with a field called Pass, you would use a struct field of reqHeader:\"pass\". Signature func (c *Ctx) ReqHeaderParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `reqHeader:\"name\"` Pass string `reqHeader:\"pass\"` Products []string `reqHeader:\"products\"` } app.Get(\"/\", func(c *fiber.Ctx) error { p := new(Person) if err := c.ReqHeaderParser(p); err != nil { return err } log.Println(p.Name) // john log.Println(p.Pass) // doe log.Println(p.Products) // [shoe, hat] // ... }) // Run tests with the following curl command // curl \"http://localhost:3000/\" -H \"name: john\" -H \"pass: doe\" -H \"products: shoe,hat\"","s":"ReqHeaderParser","u":"/api/ctx","h":"#reqheaderparser","p":1752},{"i":1866,"t":"Response return the *fasthttp.Response pointer Signature func (c *Ctx) Response() *fasthttp.Response Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Response().BodyWriter().Write([]byte(\"Hello, World!\")) // => \"Hello, World!\" return nil })","s":"Response","u":"/api/ctx","h":"#response","p":1752},{"i":1868,"t":"Instead of executing the next method when calling Next, RestartRouting restarts execution from the first method that matches the current route. This may be helpful after overriding the path, i. e. an internal redirect. Note that handlers might be executed again which could result in an infinite loop. Signature func (c *Ctx) RestartRouting() error Example app.Get(\"/new\", func(c *fiber.Ctx) error { return c.SendString(\"From /new\") }) app.Get(\"/old\", func(c *fiber.Ctx) error { c.Path(\"/new\") return c.RestartRouting() })","s":"RestartRouting","u":"/api/ctx","h":"#restartrouting","p":1752},{"i":1870,"t":"Returns the matched Route struct. Signature func (c *Ctx) Route() *Route Example // http://localhost:8080/hello app.Get(\"/hello/:name\", func(c *fiber.Ctx) error { r := c.Route() fmt.Println(r.Method, r.Path, r.Params, r.Handlers) // GET /hello/:name handler [name] // ... }) caution Do not rely on c.Route() in middlewares before calling c.Next() - c.Route() returns the last executed route. Example func MyMiddleware() fiber.Handler { return func(c *fiber.Ctx) error { beforeNext := c.Route().Path // Will be '/' err := c.Next() afterNext := c.Route().Path // Will be '/hello/:name' return err } }","s":"Route","u":"/api/ctx","h":"#route","p":1752},{"i":1872,"t":"Method is used to save any multipart file to disk. Signature func (c *Ctx) SaveFile(fh *multipart.FileHeader, path string) error Example app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: if err := c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)); err != nil { return err } } return err } })","s":"SaveFile","u":"/api/ctx","h":"#savefile","p":1752},{"i":1874,"t":"Method is used to save any multipart file to an external storage system. Signature func (c *Ctx) SaveFileToStorage(fileheader *multipart.FileHeader, path string, storage Storage) error Example storage := memory.New() app.Post(\"/\", func(c *fiber.Ctx) error { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to storage: if err := c.SaveFileToStorage(file, fmt.Sprintf(\"./%s\", file.Filename), storage); err != nil { return err } } return err } })","s":"SaveFileToStorage","u":"/api/ctx","h":"#savefiletostorage","p":1752},{"i":1876,"t":"A boolean property that is true , if a TLS connection is established. Signature func (c *Ctx) Secure() bool Example // Secure() method is equivalent to: c.Protocol() == \"https\"","s":"Secure","u":"/api/ctx","h":"#secure","p":1752},{"i":1878,"t":"Sets the HTTP response body. Signature func (c *Ctx) Send(body []byte) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.Send([]byte(\"Hello, World!\")) // => \"Hello, World!\" }) Fiber also provides SendString and SendStream methods for raw inputs. tip Use this if you don't need type assertion, recommended for faster performance. Signature func (c *Ctx) SendString(body string) error func (c *Ctx) SendStream(stream io.Reader, size ...int) error Example app.Get(\"/\", func(c *fiber.Ctx) error { return c.SendString(\"Hello, World!\") // => \"Hello, World!\" return c.SendStream(bytes.NewReader([]byte(\"Hello, World!\"))) // => \"Hello, World!\" })","s":"Send","u":"/api/ctx","h":"#send","p":1752},{"i":1880,"t":"Transfers the file from the given path. Sets the Content-Type response HTTP header field based on the filenames extension. caution Method doesnΒ΄t use gzipping by default, set it to true to enable. Signature func (c *Ctx) SendFile(file string, compress ...bool) error Example app.Get(\"/not-found\", func(c *fiber.Ctx) error { return c.SendFile(\"./public/404.html\"); // Disable compression return c.SendFile(\"./static/index.html\", false); }) info If the file contains an url specific character you have to escape it before passing the file path into the sendFile function. Example app.Get(\"/file-with-url-chars\", func(c *fiber.Ctx) error { return c.SendFile(url.PathEscape(\"hash_sign_#.txt\")) })","s":"SendFile","u":"/api/ctx","h":"#sendfile","p":1752},{"i":1882,"t":"Sets the status code and the correct status message in the body, if the response body is empty. tip You can find all used status codes and messages here. Signature func (c *Ctx) SendStatus(status int) error Example app.Get(\"/not-found\", func(c *fiber.Ctx) error { return c.SendStatus(415) // => 415 \"Unsupported Media Type\" c.SendString(\"Hello, World!\") return c.SendStatus(415) // => 415 \"Hello, World!\" })","s":"SendStatus","u":"/api/ctx","h":"#sendstatus","p":1752},{"i":1884,"t":"Sets the response’s HTTP header field to the specified key, value. Signature func (c *Ctx) Set(key string, val string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Set(\"Content-Type\", \"text/plain\") // => \"Content-type: text/plain\" // ... })","s":"Set","u":"/api/ctx","h":"#set","p":1752},{"i":1886,"t":"Allow you to config BodyParser/QueryParser decoder, base on schema's options, providing possibility to add custom type for pausing. Signature func SetParserDecoder(parserConfig fiber.ParserConfig{ IgnoreUnknownKeys bool, ParserType []fiber.ParserType{ Customtype interface{}, Converter func(string) reflect.Value, }, ZeroEmpty bool, SetAliasTag string, }) Example type CustomTime time.Time // String() returns the time in string func (ct *CustomTime) String() string { t := time.Time(*ct).String() return t } // Register the converter for CustomTime type format as 2006-01-02 var timeConverter = func(value string) reflect.Value { fmt.Println(\"timeConverter\", value) if v, err := time.Parse(\"2006-01-02\", value); err == nil { return reflect.ValueOf(v) } return reflect.Value{} } customTime := fiber.ParserType{ Customtype: CustomTime{}, Converter: timeConverter, } // Add setting to the Decoder fiber.SetParserDecoder(fiber.ParserConfig{ IgnoreUnknownKeys: true, ParserType: []fiber.ParserType{customTime}, ZeroEmpty: true, }) // Example to use CustomType, you pause custom time format not in RFC3339 type Demo struct { Date CustomTime `form:\"date\" query:\"date\"` Title string `form:\"title\" query:\"title\"` Body string `form:\"body\" query:\"body\"` } app.Post(\"/body\", func(c *fiber.Ctx) error { var d Demo c.BodyParser(&d) fmt.Println(\"d.Date\", d.Date.String()) return c.JSON(d) }) app.Get(\"/query\", func(c *fiber.Ctx) error { var d Demo c.QueryParser(&d) fmt.Println(\"d.Date\", d.Date.String()) return c.JSON(d) }) // curl -X POST -F title=title -F body=body -F date=2021-10-20 http://localhost:3000/body // curl -X GET \"http://localhost:3000/query?title=title&body=body&date=2021-10-20\"","s":"SetParserDecoder","u":"/api/ctx","h":"#setparserdecoder","p":1752},{"i":1888,"t":"Sets the user specified implementation for context interface. Signature func (c *Ctx) SetUserContext(ctx context.Context) Example app.Get(\"/\", func(c *fiber.Ctx) error { ctx := context.Background() c.SetUserContext(ctx) // Here ctx could be any context implementation // ... })","s":"SetUserContext","u":"/api/ctx","h":"#setusercontext","p":1752},{"i":1890,"t":"https://expressjs.com/en/4x/api.html#req.stale Signature func (c *Ctx) Stale() bool","s":"Stale","u":"/api/ctx","h":"#stale","p":1752},{"i":1892,"t":"Sets the HTTP status for the response. info Method is a chainable. Signature func (c *Ctx) Status(status int) *Ctx Example app.Get(\"/fiber\", func(c *fiber.Ctx) error { c.Status(fiber.StatusOK) return nil } app.Get(\"/hello\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusBadRequest).SendString(\"Bad Request\") } app.Get(\"/world\", func(c *fiber.Ctx) error { return c.Status(fiber.StatusNotFound).SendFile(\"./public/gopher.png\") })","s":"Status","u":"/api/ctx","h":"#status","p":1752},{"i":1894,"t":"Returns a string slice of subdomains in the domain name of the request. The application property subdomain offset, which defaults to 2, is used for determining the beginning of the subdomain segments. Signature func (c *Ctx) Subdomains(offset ...int) []string Example // Host: \"tobi.ferrets.example.com\" app.Get(\"/\", func(c *fiber.Ctx) error { c.Subdomains() // [\"ferrets\", \"tobi\"] c.Subdomains(1) // [\"tobi\"] // ... })","s":"Subdomains","u":"/api/ctx","h":"#subdomains","p":1752},{"i":1896,"t":"Sets the Content-Type HTTP header to the MIME type listed here specified by the file extension. Signature func (c *Ctx) Type(ext string, charset ...string) *Ctx Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Type(\".html\") // => \"text/html\" c.Type(\"html\") // => \"text/html\" c.Type(\"png\") // => \"image/png\" c.Type(\"json\", \"utf-8\") // => \"application/json; charset=utf-8\" // ... })","s":"Type","u":"/api/ctx","h":"#type","p":1752},{"i":1898,"t":"UserContext returns a context implementation that was set by user earlier or returns a non-nil, empty context, if it was not set earlier. Signature func (c *Ctx) UserContext() context.Context Example app.Get(\"/\", func(c *fiber.Ctx) error { ctx := c.UserContext() // ctx is context implementation set by user // ... })","s":"UserContext","u":"/api/ctx","h":"#usercontext","p":1752},{"i":1900,"t":"Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location. info Multiple fields are allowed. Signature func (c *Ctx) Vary(fields ...string) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Vary(\"Origin\") // => Vary: Origin c.Vary(\"User-Agent\") // => Vary: Origin, User-Agent // No duplicates c.Vary(\"Origin\") // => Vary: Origin, User-Agent c.Vary(\"Accept-Encoding\", \"Accept\") // => Vary: Origin, User-Agent, Accept-Encoding, Accept // ... })","s":"Vary","u":"/api/ctx","h":"#vary","p":1752},{"i":1902,"t":"Write adopts the Writer interface Signature func (c *Ctx) Write(p []byte) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.Write([]byte(\"Hello, World!\")) // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"Write","u":"/api/ctx","h":"#write","p":1752},{"i":1904,"t":"Writef adopts the string with variables Signature func (c *Ctx) Writef(f string, a ...interface{}) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { world := \"World!\" c.Writef(\"Hello, %s\", world) // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"Writef","u":"/api/ctx","h":"#writef","p":1752},{"i":1906,"t":"WriteString adopts the string Signature func (c *Ctx) WriteString(s string) (n int, err error) Example app.Get(\"/\", func(c *fiber.Ctx) error { c.WriteString(\"Hello, World!\") // => \"Hello, World!\" fmt.Fprintf(c, \"%s\\n\", \"Hello, World!\") // \"Hello, World!Hello, World!\" })","s":"WriteString","u":"/api/ctx","h":"#writestring","p":1752},{"i":1908,"t":"A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery). Signature func (c *Ctx) XHR() bool Example // X-Requested-With: XMLHttpRequest app.Get(\"/\", func(c *fiber.Ctx) error { c.XHR() // true // ... })","s":"XHR","u":"/api/ctx","h":"#xhr","p":1752},{"i":1910,"t":"Converts any interface or string to XML using the standard encoding/xml package. info XML also sets the content header to application/xml. Signature func (c *Ctx) XML(data interface{}) error Example type SomeStruct struct { XMLName xml.Name `xml:\"Fiber\"` Name string `xml:\"Name\"` Age uint8 `xml:\"Age\"` } app.Get(\"/\", func(c *fiber.Ctx) error { // Create data struct: data := SomeStruct{ Name: \"Grame\", Age: 20, } return c.XML(data) // // Grame // 20 // })","s":"XML","u":"/api/ctx","h":"#xml","p":1752}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/723",[0,7.753,1,9.501,2,8.153,3,2.485,4,7.434]],["t/725",[5,7.278,6,8.481,7,7.756,8,8.481,9,8.481,10,6.196,11,7.278,12,6.018,13,6.196,14,3.873,15,7.756,16,7.756,17,6.921,18,7.278,19,6.637]],["t/727",[3,2.546,5,8.354,20,2.469]],["t/729",[21,4.094,22,7.087,23,2.734,24,7.073,25,7.926,26,8.524,27,4.804,28,7.073]],["t/731",[29,9.735,30,9.735,31,9.735]],["t/733",[3,1.588,5,5.21,13,4.436,26,4.955,32,3.115,33,1.797,34,3.765,35,1.421,36,6.778,37,1.577,38,6.071,39,2.855,40,2.401,41,6.071,42,6.778,43,6.071,44,2.855,45,6.071,46,9.467,47,6.071,48,2.062,49,3.365,50,1.111,51,0.648,52,4.955,53,5.984,54,4.751,55,4.436,56,4.001,57,4.751,58,6.541,59,1.354,60,4.056,61,3.867,62,8.124]],["t/735",[26,9.063,39,4.522,63,8.794]],["t/737",[23,1.754,24,4.537,28,4.537,36,4.537,37,1.055,42,4.537,51,0.954,52,4.537,57,4.35,59,1.273,64,1.508,65,2.777,66,1.609,67,2.998,68,4.771,69,4.35,70,4.537,71,4.771,72,0.749,73,1.424,74,2.233,75,4.771,76,4.771,77,4.771,78,4.771,79,4.771,80,1.893,81,1.723,82,4.537,83,3.273,84,2.614,85,5.084,86,7.813,87,5.559,88,3.021,89,5.559,90,5.559,91,5.559,92,4.061]],["t/739",[23,1.858,24,4.807,28,4.807,36,4.807,37,1.118,40,2.329,42,4.807,51,0.948,52,4.807,57,4.609,59,0.96,64,1.598,65,2.891,66,1.705,67,3.177,68,5.055,69,4.609,70,4.807,71,5.055,72,0.793,73,1.509,74,2.366,75,5.055,76,5.055,77,5.055,78,5.055,79,5.055,80,1.704,81,1.552,82,4.807,83,3.468,84,2.77,85,5.387,88,2.278,92,4.303,93,3.8,94,5.055,95,2.136,96,5.891]],["t/741",[23,1.93,24,4.993,28,4.993,36,4.993,37,1.162,42,4.993,51,0.948,52,4.993,57,4.788,59,0.997,64,1.66,65,2.967,66,1.771,67,3.3,68,5.251,69,4.788,70,4.993,71,5.251,72,0.824,73,1.568,74,2.457,75,5.251,76,5.251,77,5.251,78,5.251,79,5.251,80,1.749,81,1.593,82,4.993,83,3.602,84,2.877,88,2.366,92,4.47,97,6.118,98,6.118]],["t/743",[20,2.439,21,3.512,99,8.794,100,3.955]],["t/745",[3,2.344,20,2.273,21,3.892,22,6.736,23,2.827,100,3.686,101,5.364,102,8.196]],["t/747",[103,9.735,104,1.732,105,4.173]],["t/749",[3,1.291,32,2.532,33,2.503,34,3.06,35,1.68,37,1.762,39,3.976,40,1.951,50,1.313,80,1.034,81,1.613,99,4.513,106,1.867,107,1.655,108,2.533,109,2.254,110,1.319,111,1.84,112,1.437,113,4.513,114,3.976,115,4.235,116,4.513,117,4.513,118,7.175,119,3.327,120,7.575,121,3.252,122,4.513,123,6.561,124,4.935,125,4.935,126,4.513,127,8.454,128,2.446,129,2.153,130,2.029,131,2.627,132,2.192,133,3.861,134,4.935,135,4.935,136,4.935,137,4.935,138,4.935,139,3.723,140,4.935,141,4.935,142,3.41,143,7.175,144,4.935,145,2.816,146,3.41,147,1.521,148,1.676,149,3.252,150,2.905,151,2.446,152,4.935]],["t/751",[23,1.901,51,0.94,59,1.347,64,1.635,65,2.936,66,1.744,72,0.811,73,1.544,74,2.42,80,1.262,81,1.576,102,5.51,110,1.518,113,5.51,116,5.51,117,5.51,122,5.51,123,5.51,126,5.51,142,4.163,153,6.025,154,6.025,155,6.025,156,4.402,157,6.025,158,6.025,159,1.846,160,6.025,161,5.51,162,6.025,163,6.025,164,6.025,165,6.025,166,3.809,167,2.113,168,6.025,169,6.025]],["t/753",[11,8.354,20,2.469,100,4.004]],["t/755",[21,3.999,22,6.923,23,2.961,170,8.056]],["t/757",[105,4.173,171,9.735,172,8.354]],["t/759",[11,5.21,20,1.54,32,3.115,33,1.797,34,3.765,35,1.421,37,1.797,50,1.111,51,0.474,59,0.99,73,1.556,80,1.272,81,1.158,107,2.036,112,1.768,167,2.129,173,7.595,174,3.319,175,4.604,176,10.178,177,2.129,178,5.21,179,5.573,180,3.275,181,3.464,182,6.071,183,2.102,184,6.071,185,3.505,186,4.955,187,3.01,188,6.071,189,2.696,190,2.438,191,3.192,192,3.916,193,3.152,194,3.152,195,6.071]],["t/761",[23,2.222,51,0.936,59,1.148,64,1.912,65,3.26,66,2.04,72,0.949,73,1.805,74,2.829,81,1.344,92,5.147,110,1.295,111,2.627,142,4.868,159,2.158,170,6.046,172,6.046,173,6.443,178,6.046,181,4.02,196,6.046,197,5.513,198,7.045,199,7.045,200,6.443]],["t/763",[23,2.11,51,0.943,59,1.09,64,1.814,65,3.15,66,1.936,72,0.901,73,1.713,74,2.686,81,1.276,92,4.886,110,1.229,142,4.621,159,2.049,170,5.739,172,5.739,179,3.937,189,2.97,196,5.739,197,5.233,200,6.116,201,6.688,202,6.688,203,8.864,204,6.688,205,6.688,206,6.688,207,6.688]],["t/765",[20,2.469,100,4.004,208,8.902]],["t/767",[3,2.242,20,2.174,21,4.235,22,7.054,23,2.705,100,3.526,101,5.132,209,7.84,210,7.84]],["t/769",[104,1.732,105,4.173,211,9.735]],["t/771",[3,2.207,32,3.188,33,1.84,34,3.854,35,1.455,50,1.544,51,0.485,60,2.477,107,2.829,109,2.838,111,2.318,147,2.6,183,3.317,191,3.267,208,5.683,212,8.762,213,5.443,214,5.831,215,6.215,216,2.631,217,6.886,218,7.717,219,5.333,220,3.188,221,6.215,222,4.41,223,4.294,224,4.41,225,2.151,226,4.889,227,2.598,228,4.863,229,6.215,230,3.014,231,2.894]],["t/773",[3,1.363,7,4.766,21,1.187,23,1.025,37,0.617,50,0.953,51,0.944,59,1.063,64,0.882,65,1.852,66,0.941,67,1.753,72,0.438,73,0.833,74,1.305,80,1.367,81,1.244,95,1.179,110,1.199,111,2.783,112,1.899,132,1.444,147,1.002,150,1.914,209,2.973,210,2.973,212,2.973,217,2.653,218,2.973,220,1.668,228,2.544,232,3.932,233,1.98,234,5.212,235,3.251,236,3.251,237,5.212,238,3.905,239,1.418,240,3.601,241,2.789,242,2.973,243,2.544,244,2.889,245,3.251,246,3.251,247,3.251,248,1.316,249,1.855,250,2.246,251,3.251,252,3.251,253,1.611,254,3.808,255,2.973,256,1.431,257,2.653,258,2.973,259,2.789,260,2.544,261,1.529,262,3.251,263,2.973,264,2.973,265,2.973,266,2.973,267,4.766,268,2.973,269,2.973,270,2.973,271,1.038,272,4.253,273,2.973,274,1.777,275,2.973,276,3.251,277,3.251,278,2.544,279,3.251,280,3.251,281,5.212,282,7.464,283,5.212,284,3.251,285,3.251,286,2.097,287,3.251,288,3.251,289,3.251,290,3.251,291,3.251,292,3.251,293,3.251,294,3.251,295,3.251,296,3.251,297,3.251,298,2.789,299,1.544]],["t/775",[51,0.946,110,1.307,112,2.07,228,5.562,238,4.255,244,3.94,263,6.501,264,8.437,265,6.501,266,6.501,267,8.437,268,6.501,269,6.501,270,6.501,271,2.269,272,7.529,273,6.501,274,3.886,275,6.501,300,4.494,301,7.109]],["t/777",[20,2.439,100,3.955,261,4.522,302,8.794]],["t/779",[3,2.267,20,2.198,21,4.094,22,7.087,23,2.734,100,3.565,101,5.188,303,7.926,304,7.926]],["t/781",[104,1.732,105,4.173,305,9.735]],["t/783",[3,1.911,32,2.596,33,1.498,34,3.139,35,1.185,37,1.783,48,2.912,50,0.926,59,1.191,60,3.418,61,2.356,72,0.682,80,1.06,81,0.965,95,1.836,106,1.914,107,1.697,108,2.58,109,3.337,110,1.343,111,1.887,112,2.497,130,3.005,191,2.66,193,2.628,216,1.578,261,2.38,302,4.628,306,4.343,307,5.049,308,5.061,309,3.941,310,5.061,311,3.749,312,2.356,313,4.628,314,2.334,315,5.049,316,4.628,317,2.628,318,4.628,319,5.338,320,5.061,321,5.061,322,5.061,323,5.061,324,4.628,325,3.697,326,6.683,327,2.133,328,3.96,329,4.13,330,3.497,331,6.271,332,4.628,333,4.628]],["t/785",[23,2.203,51,0.934,59,1.138,64,1.895,65,3.241,66,2.022,67,3.766,72,1.228,73,1.789,74,2.804,81,1.332,110,1.283,159,2.139,261,3.284,271,2.229,299,3.317,303,6.386,304,6.386,307,7.017,334,6.983,335,6.983,336,4.18,337,3.251]],["t/787",[20,2.439,100,3.955,261,4.522,338,8.794]],["t/789",[3,2.267,20,2.198,21,4.094,22,7.087,23,2.734,100,3.565,101,5.188,339,7.926,340,8.667]],["t/791",[104,1.732,105,4.173,341,9.735]],["t/793",[3,1.787,32,2.369,33,1.367,34,2.864,35,1.081,37,1.707,48,3.053,50,0.845,53,2.919,59,1.326,60,3.242,61,2.15,72,0.622,80,0.968,81,0.881,95,1.675,106,1.747,107,1.548,108,2.413,109,3.121,110,1.495,111,1.722,112,2.618,130,3.346,191,2.427,193,2.398,216,1.44,223,3.191,261,2.171,306,3.963,307,6.632,309,3.686,311,3.506,312,2.15,313,4.223,314,2.129,315,4.722,316,4.223,317,2.398,318,4.223,319,4.992,324,4.223,325,3.373,326,6.249,327,1.946,328,3.613,329,3.768,330,3.191,331,5.864,332,4.223,333,4.223,338,6.249,342,6.834,343,4.223,344,4.618,345,3.613,346,1.609,347,4.618,348,4.618,349,4.618,350,4.618]],["t/795",[23,2.057,51,0.952,59,1.421,64,1.77,65,3.098,66,1.888,72,1.174,73,2.234,74,2.619,81,1.244,110,1.199,112,1.899,159,1.998,189,3.872,271,2.082,307,6.785,336,3.904,337,3.037,339,5.964,343,5.964,351,6.522,352,6.522,353,3.904,354,6.522]],["t/797",[3,1.859,10,6.74,58,4.912,59,1.504,84,3.343,88,2.749,106,2.689,110,1.883,147,2.19,216,2.216,253,3.524,355,4.119,356,3.31,357,6.281,358,5.364,359,3.563,360,6.501,361,5.044,362,5.044,363,5.364,364,5.364,365,6.501,366,5.044,367,5.562,368,7.109,369,6.501]],["t/799",[3,2.149,20,2.084,21,4,22,6.924,23,2.592,51,0.641,100,3.379,101,4.918,370,5.678,371,3.649,372,7.514,373,6.706,374,6.706,375,6.706]],["t/801",[53,6.079,59,1.567,376,9.616,377,9.616]],["t/803",[3,0.993,10,4.304,32,1.948,33,1.124,34,2.355,35,1.69,37,1.672,50,1.611,53,4.563,59,1.177,72,0.511,84,3.395,107,1.273,108,2.872,109,1.734,112,2.564,129,1.656,130,3.832,148,1.289,177,3.089,216,1.184,238,3.526,256,1.671,300,2.4,311,1.948,314,1.751,346,2.053,355,2.2,356,1.768,357,5.633,359,4.078,361,4.181,362,2.694,378,2.971,379,4.808,380,2.92,381,3.972,382,1.862,383,5.891,384,4.181,385,3.472,386,3.099,387,1.862,388,2.971,389,2.694,390,3.797,391,3.258,392,2.694,393,1.562,394,2.4,395,6.195,396,3.797,397,2.166,398,1.882,399,3.258,400,6.602,401,2.2,402,3.258,403,3.472,404,5.056,405,2.694,406,4.61,407,3.797,408,5.388,409,3.472,410,3.099,411,3.797,412,3.472,413,2.624,414,3.099,415,3.472,416,2.235]],["t/805",[3,0.948,10,2.647,23,1.143,49,2.008,51,0.963,58,2.503,59,1.293,60,1.444,64,0.983,65,2.019,66,1.049,72,1.068,73,0.928,74,1.455,81,1.336,84,3.295,110,1.583,111,1.351,112,1.055,159,1.11,167,2.457,189,2.523,244,2.008,248,2.836,353,2.169,357,4.059,373,2.957,374,2.957,375,2.957,383,2.957,395,6.806,399,3.109,417,1.837,418,3.109,419,4.874,420,3.313,421,3.313,422,3.109,423,3.623,424,3.623,425,4.444,426,3.313,427,3.313,428,3.313,429,2.317,430,3.313,431,3.313,432,3.148,433,3.664,434,3.313,435,1.916,436,2.734,437,2.008,438,3.313,439,3.313,440,3.623,441,2.29,442,2.133,443,4.635,444,3.623,445,3.313,446,3.313,447,3.313,448,3.313,449,3.313,450,3.313,451,3.313,452,3.313,453,2.835]],["t/807",[50,1.668,51,0.712,60,3.634,146,4.825,147,2.81,148,2.371,256,3.074,357,5.884,405,6.471,406,5.464,419,5.993,425,5.464,432,3.87,433,4.504,454,4.111,455,4.046,456,5.369,457,6.983,458,6.983,459,9.12,460,9.12,461,5.102,462,6.983,463,5.102,464,5.993]],["t/809",[3,0.725,10,2.025,23,0.874,49,3.241,51,0.957,58,1.915,59,1.225,60,1.105,64,0.752,65,1.627,66,0.803,72,0.914,73,0.71,74,1.113,81,1.116,84,2.75,110,1.382,111,1.034,112,1.333,159,0.849,167,2.051,175,1.254,177,2.636,189,3.804,244,1.536,248,2.367,261,1.304,300,1.752,309,1.495,312,1.291,353,1.659,357,3.388,373,2.262,374,2.262,375,2.262,383,2.262,395,5.827,399,2.379,417,1.405,418,2.379,419,3.929,420,2.535,421,2.535,422,2.379,425,3.582,426,2.535,427,2.535,428,2.535,429,1.868,430,2.535,431,2.535,432,2.537,433,2.953,434,2.535,435,1.545,436,2.091,437,1.536,438,2.535,439,2.535,441,1.752,442,1.632,443,3.736,445,2.535,446,2.535,447,2.535,448,2.535,449,2.535,450,2.535,451,2.535,452,2.535,453,2.169,465,2.772,466,2.772,467,1.672,468,2.772,469,1.199,470,0.491,471,3.345,472,4.578,473,4.578,474,2.772,475,2.535,476,2.262,477,2.772,478,3.929,479,2.772,480,2.535,481,2.772,482,1.515,483,1.582,484,1.359,485,2.091,486,2.772,487,2.772,488,2.772,489,2.772,490,2.772,491,3.087,492,2.772,493,2.772,494,2.772,495,2.772,496,2.772,497,2.772,498,2.772]],["t/811",[469,4.06,485,7.083,499,9.388,500,7.661,501,7.083,502,9.388]],["t/813",[10,5.763,119,5.319,177,3.458,216,2.459,300,4.987,312,3.673,355,4.571,356,3.673,359,3.955,410,6.438,412,7.214,415,7.214,469,4.263,485,5.952,501,5.952,503,6.438,504,6.173,505,5.319,506,6.77,507,7.889]],["t/815",[2,3.167,10,2.696,23,1.164,35,0.864,44,1.736,48,1.253,50,0.675,51,0.898,59,0.939,64,1.001,65,2.048,66,1.068,72,0.776,73,0.946,74,1.482,80,0.773,81,0.704,84,3.768,93,2.381,95,1.339,108,2.035,110,1.473,112,1.678,128,2.857,129,1.61,130,3.574,132,3.149,174,2.017,177,3.048,225,1.278,260,2.888,300,2.333,357,4.108,359,2.889,373,3.012,374,3.012,375,3.012,383,7.852,384,6.167,408,7.947,409,3.375,410,3.012,418,3.167,422,3.167,508,3.691,509,2.432,510,3.375,511,4.945,512,5.27,513,4.703,514,4.945,515,2.785,516,3.375,517,3.691,518,2.619,519,1.829,520,3.375,521,2.619,522,3.691,523,3.012,524,5.763,525,3.691,526,3.691,527,3.691,528,3.691,529,3.375,530,3.691,531,3.691,532,3.691,533,3.691,534,3.691,535,3.691,536,2.696,537,2.619,538,3.691]],["t/817",[12,6.36,13,6.547,14,4.093,20,2.273,21,3.273,100,3.686,174,4.899,484,4.394,485,6.762,539,8.196]],["t/819",[21,3.999,22,6.923,23,2.961,540,8.585]],["t/821",[105,4.173,541,9.735,542,8.902]],["t/823",[13,7.562,32,2.872,33,1.657,34,3.472,35,1.311,37,1.866,50,1.024,51,0.437,59,0.912,60,2.231,61,2.607,72,0.754,81,1.068,107,1.877,108,1.977,110,1.443,132,2.486,147,2.419,148,1.901,150,4.622,174,4.292,183,1.938,185,2.907,190,2.248,193,2.907,194,2.907,364,4.224,388,4.381,543,5.12,544,8.989,545,5.12,546,4.804,547,5.12,548,4.869,549,7.4,550,5.12,551,6.738,552,5.12,553,4.804,554,5.12,555,5.12,556,5.12,557,5.12,558,5.599]],["t/825",[33,2.779,59,1.53,80,1.967,81,1.791,388,7.346,556,8.585]],["t/827",[3,1.154,13,3.223,20,1.119,23,1.392,33,1.306,35,1.033,40,2.612,51,0.951,59,1.077,62,3.786,64,1.792,65,2.348,66,1.277,72,0.89,73,1.13,74,1.772,81,1.26,92,3.223,95,2.396,110,1.214,111,1.645,112,1.284,142,3.048,148,1.498,149,2.907,150,2.597,159,1.351,167,1.547,183,1.527,193,2.291,196,3.786,197,3.452,256,1.942,388,5.169,398,2.187,432,2.445,433,2.845,442,2.597,470,0.781,540,4.034,542,4.034,543,4.034,545,4.034,547,4.034,549,3.6,550,4.034,552,4.034,554,4.034,555,4.034,557,4.034,559,1.578,560,2.075,561,4.411,562,4.453,563,2.48,564,4.411,565,3.389,566,4.411,567,4.411,568,4.411,569,4.411,570,4.411,571,1.47,572,4.034,573,4.411,574,4.411]],["t/829",[16,10.015,20,2.381,100,3.861,575,6.329,576,9.388]],["t/831",[3,2.427,20,2.353,21,3.388,22,5.865,100,3.816,101,5.553,577,8.484]],["t/833",[105,4.173,225,3.37,578,9.735]],["t/835",[3,1.187,32,2.328,33,1.343,34,2.814,35,1.885,37,1.529,50,1.943,53,4.265,106,1.717,107,1.522,108,2.382,109,2.072,110,1.48,112,2.344,130,1.866,132,3.96,147,2.079,167,1.592,174,2.481,185,2.982,190,1.822,216,2.103,248,1.837,250,5.564,253,2.249,346,2.351,394,2.869,435,1.531,509,2.99,519,2.249,544,4.15,579,4.538,580,4.538,581,4.538,582,4.538,583,5.005,584,6.91,585,4.538,586,4.538,587,6.746,588,3.551,589,2.328,590,4.538,591,5.505,592,6.746,593,4.538,594,4.538,595,6.746,596,4.538,597,3.551,598,3.703,599,4.538,600,4.538,601,4.538,602,3.894,603,3.551,604,4.538,605,4.538]],["t/837",[470,1.724,606,5.25,607,5.321]],["t/839",[15,3.254,23,1.122,37,1.063,51,0.951,59,1.129,64,0.965,65,1.99,66,1.03,67,1.919,72,1.058,73,0.912,74,1.429,80,0.745,81,1.068,110,1.57,112,1.63,132,1.58,142,2.458,167,2.428,189,3.793,238,2.129,261,1.673,299,1.69,467,1.299,491,2.399,577,3.254,584,4.805,603,2.784,608,3.558,609,3.558,610,3.558,611,3.254,612,3.558,613,3.558,614,3.558,615,3.558,616,3.558,617,3.558,618,3.558,619,3.558,620,3.558,621,3.558,622,1.625,623,6.924,624,5.6,625,5.121,626,3.558,627,3.558,628,3.053,629,3.053,630,3.558,631,3.558,632,3.558,633,3.558,634,5.976,635,3.558,636,3.558,637,3.558,638,3.558,639,3.254,640,3.558,641,3.558,642,3.558,643,3.558,644,3.558,645,3.558,646,3.558,647,3.558,648,3.558,649,2.784,650,3.558,651,3.558,652,3.558,653,3.558,654,2.525,655,3.558,656,3.558,657,3.558,658,3.558,659,3.053,660,3.254,661,3.558]],["t/841",[20,2.889,49,4.309,50,1.01,55,5.68,147,1.701,185,2.879,261,3.656,317,4.673,371,2.452,394,3.49,442,3.25,470,1.377,483,3.15,519,2.736,603,6.083,611,5.048,622,5.118,628,4.737,629,6.672,649,7.042,662,5.52,663,5.52,664,5.52,665,3.25,666,5.52,667,4.505,668,8.383,669,9.769,670,5.52,671,5.52,672,5.52,673,2.902,674,5.048]],["t/843",[3,1.947,17,7.756,58,5.143,59,1.549,88,2.878,106,2.816,110,1.924,216,2.321,253,3.69,256,3.276,356,3.466,357,6.391,358,5.616,359,3.731,360,6.807,361,5.282,362,5.282,363,5.616,364,5.616,675,6.388,676,7.443]],["t/845",[3,2.267,20,2.198,21,4.094,22,7.087,23,2.734,100,3.565,101,5.188,677,8.667,678,8.667]],["t/847",[53,6.079,59,1.567,679,9.616,680,9.616]],["t/849",[3,2.173,17,3.222,32,2.026,33,1.169,34,2.449,35,0.924,37,1.153,49,4.101,50,1.52,53,3.839,59,1.206,84,1.857,106,1.494,107,1.324,108,3.481,109,1.803,112,2.61,130,3.416,132,1.754,147,1.217,177,2.913,225,1.367,231,1.839,238,3.635,286,2.547,300,4.677,306,3.389,327,1.664,357,6.377,358,2.979,359,4.164,361,4.309,362,2.802,379,4.956,380,3.01,381,4.094,382,1.936,384,2.802,392,2.802,393,1.624,394,2.496,400,5.553,413,2.728,435,2.049,478,5.211,511,3.389,537,4.309,597,3.09,675,5.211,681,3.949,682,2.405,683,3.949,684,3.222,685,3.611,686,3.09,687,7.399,688,2.547,689,3.949,690,4.956,691,5.553,692,3.949,693,3.949,694,2.979,695,3.949]],["t/851",[3,1.692,17,5.279,50,1.789,59,1.054,83,3.808,104,1.151,108,3.061,110,1.593,132,2.873,191,3.4,256,3.816,300,4.089,357,6.497,359,3.243,384,6.152,393,2.66,429,3.537,435,2.925,478,5.551,682,3.94,685,5.916,686,6.784,688,4.173,691,5.916,696,6.469,697,4.557,698,4.881,699,3.691,700,6.469]],["t/853",[3,2.845,18,9.333,20,2.353,145,5.294,701,8.484]],["t/855",[470,1.746,702,2.065]],["t/857",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/859",[3,2.023,20,2.703,23,2.44,50,1.415,51,0.832,64,2.099,66,2.819,73,2.731,74,3.106,356,3.601,435,2.61,559,2.767,704,3.877,705,3.792,706,7.735,707,2.825,708,3.181]],["t/861",[709,9.127]],["t/863",[18,7.438,40,3.428,51,0.875,197,6.782,701,7.926,709,7.926,710,8.667,711,8.667,712,5.375,713,7.926,714,8.667]],["t/865",[19,6.934,20,2.247,81,1.69,95,3.214,150,5.217,240,6.123,688,5.716,712,5.496,715,6.686,716,5.397,717,4.982]],["t/867",[21,3.999,22,6.923,23,2.961,718,8.585]],["t/869",[19,4.922,23,1.304,51,0.964,59,1.025,64,1.122,65,2.236,66,1.197,72,0.557,73,1.059,74,1.66,80,0.866,81,0.789,110,1.399,111,2.839,112,1.831,147,1.274,189,4.451,190,1.66,244,2.292,261,1.944,286,2.667,299,1.964,317,2.147,327,1.743,467,1.51,622,1.888,659,3.548,718,3.781,719,4.135,720,4.135,721,3.548,722,3.12,723,4.135,724,4.135,725,4.135,726,3.781,727,3.781,728,6.962,729,4.135,730,2.857,731,4.135,732,4.135,733,4.135,734,4.135,735,4.135,736,3.235,737,4.135,738,2.173,739,6.29,740,8.508,741,4.135,742,4.135,743,6.29,744,4.135,745,2.26,746,4.135,747,4.135,748,4.135,749,4.135]],["t/871",[3,1.893,19,7.305,40,2.863,50,1.708,51,0.882,59,1.18,73,1.855,74,2.907,80,1.517,81,1.381,106,2.738,107,2.427,109,3.306,110,1.33,365,6.62,606,3.904,726,6.62,727,6.62,728,6.62,750,7.239,751,4.489,752,7.239,753,6.62,754,7.239,755,7.239]],["t/874",[3,1.11,12,3.013,20,1.077,33,1.257,37,1.469,50,0.777,51,0.892,59,1.648,110,1.18,112,1.868,128,2.104,129,3.375,132,1.886,177,3.547,187,2.104,216,1.324,227,1.775,327,2.705,346,3.394,382,3.146,387,2.082,393,1.746,437,2.353,483,2.422,518,3.013,690,3.465,756,4.246,757,3.478,758,2.499,759,3.102,760,3.013,761,3.643,762,3.013,763,4.246,764,3.643,765,4.246,766,2.038,767,2.26,768,3.322,769,4.848,770,2.353,771,3.102,772,2.798,773,3.102,774,2.353,775,2.353,776,4.798,777,2.26,778,2.387,779,3.014,780,4.229,781,3.883,782,4.246,783,4.246,784,2.387]],["t/876",[785,7.125,786,8.303,787,7.125,788,6.776,789,6.497,790,6.497,791,6.776,792,7.593,793,5.249,794,7.125,795,7.125,796,6.497,797,7.593,798,6.776,799,6.497,800,6.497,801,7.125]],["t/878",[50,1.678,757,3.154,758,6.76,785,7.869,802,10.802]],["t/880",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/882",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,804,6.577]],["t/884",[21,3.892,100,3.181,128,3.834,231,3.601,239,3.374,371,3.435,469,3.345,519,3.834,563,4.348,707,2.825,785,6.637,796,6.052,805,4.118,806,7.735,807,4.228,808,4.118,809,3.752,810,4.481,811,4.481,812,4.413,813,4.481,814,7.073]],["t/886",[20,1.711,35,1.579,44,3.172,48,2.29,50,1.234,51,0.886,64,1.83,66,2.581,104,1.586,119,4.547,183,2.335,230,3.272,393,3.666,435,2.276,559,2.413,589,3.46,707,3.255,708,2.774,757,3.066,779,2.627,814,6.168,815,6.745,816,6.745,817,3.343,818,5.788,819,5.788,820,3.638,821,3.738,822,3.381]],["t/888",[20,1.144,33,1.336,35,2.483,37,1.805,44,3.159,51,0.962,104,0.803,107,1.513,119,5.411,167,2.815,177,2.356,183,1.562,187,3.33,190,1.812,220,2.315,225,3.671,227,1.886,230,2.189,382,2.212,417,2.288,454,3.955,455,3.892,589,3.446,622,3.068,776,2.798,779,2.617,817,3.978,818,3.872,819,3.872,820,2.434,821,2.501,822,2.262,823,1.648,824,4.091,825,2.537,826,2.748]],["t/890",[20,2.001,44,3.71,50,1.443,51,0.84,104,1.404,119,5.319,183,2.731,225,2.731,230,3.827,311,4.047,467,2.881,589,4.047,779,3.073,817,3.91,818,6.77,819,6.77,820,4.255,821,4.372,822,3.955,827,3.504]],["t/892",[21,3.097,174,4.636,484,4.158,539,7.756,757,3.546,828,7.756,829,7.278,830,8.481,831,5.471,832,7.756,833,7.756,834,7.756,835,6.399,836,6.018]],["t/894",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/896",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,837,6.577]],["t/898",[21,3.84,100,3.09,128,3.725,231,3.499,239,3.278,371,3.337,469,3.249,519,3.725,563,4.224,707,2.744,757,2.584,758,4.424,805,4,807,4.107,808,4,809,3.645,810,4.354,811,4.354,812,4.287,813,4.354,828,8.743,829,8.205,838,6.872]],["t/900",[35,1.62,48,2.35,50,1.266,51,0.892,64,1.878,66,2.625,104,1.613,177,2.428,393,3.729,435,2.336,469,4.373,559,2.477,707,3.311,708,2.847,757,3.119,777,3.685,838,6.33,839,6.922,840,6.922,841,7.4,842,5.732,843,6.922]],["t/902",[33,1.479,35,2.32,37,1.617,51,0.919,104,0.889,107,1.675,147,2.231,167,2.539,177,2.986,183,1.73,187,3.589,190,2.007,225,3.431,226,4.195,227,2.089,244,4.013,387,2.45,417,2.534,537,3.546,665,4.262,757,2.49,777,4.533,779,2.82,823,1.825,826,3.043,841,5.909,842,5.902,844,4.997,845,4.078,846,2.991,847,6.213,848,3.453,849,3.369,850,2.991,851,4.288,852,4.288,853,4.288,854,4.078,855,3.099,856,3.77]],["t/904",[51,0.919,104,1.477,183,2.874,387,4.071,467,3.032,665,4.888,777,4.42,779,3.234,827,3.688,841,6.776,845,6.776,855,5.15,856,6.265]],["t/906",[50,1.697,177,3.254,346,3.233,824,5.65,857,7.26,858,8.484,859,9.278]],["t/908",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/910",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,860,6.014]],["t/912",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,787,8.408,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,861,7.143]],["t/914",[35,1.664,44,3.343,48,2.414,50,1.3,51,0.899,64,1.929,66,2.671,104,1.642,183,2.461,230,3.448,393,3.794,435,2.399,559,2.543,707,3.369,708,2.924,757,3.173,779,2.769,821,3.94,822,3.563,861,6.501,862,7.109,863,7.109,864,6.1]],["t/916",[33,1.461,35,2.486,37,0.937,44,3.374,50,1.313,51,0.951,104,0.878,107,2.406,112,1.437,130,2.029,167,1.731,177,2.516,183,2.484,187,3.556,216,1.538,220,2.532,225,3.676,227,2.063,230,2.394,307,6.413,382,2.419,417,2.502,776,3.06,779,2.795,787,6.157,821,2.735,822,2.474,823,1.802,826,3.005,864,4.235,865,2.905,866,6.561,867,4.027,868,4.935,869,4.935,870,4.935,871,6.561]],["t/918",[44,3.824,51,0.851,104,1.447,112,2.368,183,3.478,230,3.945,307,5.619,467,2.97,779,3.168,821,4.507,822,4.077,827,3.612,864,6.979,866,7.437,871,7.437,872,8.133]],["t/920",[21,2.62,44,4.364,50,1.312,132,3.186,174,3.921,393,2.95,622,3.276,757,2.467,758,4.223,788,5.854,791,5.854,796,5.613,798,5.854,857,5.613,873,7.173,874,7.173,875,7.173,876,6.56,877,5.412,878,7.173,879,7.173,880,7.173,881,8.828,882,7.173,883,5.09,884,7.173,885,5.613,886,6.156,887,4.449]],["t/922",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/924",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,888,6.577]],["t/926",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,788,6.374,800,6.112,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,889,7.143]],["t/928",[35,1.695,44,3.404,48,2.458,50,1.324,51,0.882,64,1.964,66,2.703,104,1.661,183,2.506,393,3.839,435,2.442,559,2.59,707,3.409,708,2.977,757,3.211,779,2.82,889,6.62,890,7.239,891,7.239,892,7.239,893,6.294]],["t/930",[12,3.591,33,1.498,35,2.332,37,1.387,39,2.38,40,2.001,44,4.033,51,0.95,104,1.526,107,2.45,130,2.081,131,2.694,167,1.775,177,1.775,183,2.53,187,3.622,225,3.448,226,4.234,227,2.116,230,2.455,240,3.497,417,2.566,757,1.741,779,2.846,788,4.13,820,2.73,823,1.848,826,3.082,893,5.782,894,4.628,895,3.819,896,3.96,897,3.697,898,4.343,899,5.061,900,4.628,901,4.628,902,3.96,903,4.628]],["t/932",[35,1.865,44,3.747,51,0.883,104,1.765,183,3.434,226,4.617,230,3.865,467,2.91,779,3.104,820,4.298,827,4.406,893,5.373,894,7.287,901,7.287,903,7.287]],["t/934",[50,1.738,757,3.268,758,5.593,789,7.434,904,9.501]],["t/936",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/938",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,905,6.577]],["t/940",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,789,7.667,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,906,7.143]],["t/942",[35,1.552,48,2.252,50,1.213,51,0.9,64,1.799,66,2.552,104,1.568,230,4.276,387,3.251,393,3.625,435,2.238,454,3.904,455,3.842,559,2.373,707,3.219,708,2.727,757,3.405,789,5.189,817,3.287,855,4.113,893,4.471,906,6.065,907,6.632,908,6.632,909,6.065,910,5.691,911,5.691,912,2.945]],["t/944",[33,1.84,37,2.04,51,0.9,104,1.106,167,2.18,179,4.968,226,4.889,227,3.528,454,4.968,455,4.889,784,6.041,789,8.408,817,3.081,823,2.269,893,5.689,910,5.333,911,5.333,913,8.769,914,3.659,915,4.689]],["t/946",[35,1.793,51,0.897,104,1.722,230,4.694,436,5.779,454,4.509,455,4.438,467,2.797,817,3.797,820,4.131,827,4.298,855,4.75,893,5.164,909,7.005,910,6.573,911,6.573,912,3.402,916,7.005]],["t/948",[21,2.62,50,1.882,51,0.56,54,5.613,101,4.293,104,1.83,233,4.369,311,4.761,484,3.517,583,3.596,757,2.467,758,4.223,769,5.217,790,5.613,842,7.122,917,6.56,918,6.56,919,4.957,920,4.033,921,6.56,922,6.56,923,5.854]],["t/950",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/952",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,924,6.577]],["t/954",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,790,7.667,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,925,7.143]],["t/956",[50,1.519,51,0.859,64,2.253,66,2.946,393,3.415,435,2.802,559,2.971,707,3.032,708,3.415,757,3.5,790,6.497,925,7.593,926,8.303]],["t/958",[33,1.093,35,2.034,37,1.233,39,1.01,48,0.729,50,0.675,51,0.921,59,0.602,104,0.657,107,1.238,110,0.678,111,1.376,131,1.965,147,0.662,167,0.753,174,2.018,177,1.703,183,1.278,187,3.514,190,0.862,191,1.129,216,1.151,219,1.843,220,1.102,223,1.484,225,2.899,226,1.244,231,1,239,0.937,244,2.046,312,3.023,317,1.115,346,2.008,356,1.719,359,1.076,417,1.089,435,2.561,469,0.928,470,0.654,483,1.225,537,1.524,548,2.289,565,1.102,649,2.888,665,2.173,668,3.167,682,1.308,688,3.131,699,1.225,777,1.965,779,1.438,790,6.27,808,1.143,820,1.158,823,1.348,826,1.308,842,4.104,846,1.285,847,3.167,848,1.484,849,1.448,850,1.285,851,1.843,852,1.843,853,1.843,854,1.752,855,1.332,856,1.62,865,5.664,885,1.68,893,1.448,919,2.55,920,2.075,927,3.012,928,2.147,929,1.68,930,2.147,931,1.752,932,2.147,933,2.147,934,2.147,935,1.752,936,1.752,937,1.963,938,2.147,939,4.44,940,4.348,941,6.492,942,2.785,943,2.248,944,3.691,945,3.691,946,3.691,947,3.375,948,3.691,949,3.691,950,5.763,951,4.21,952,3.691,953,2.619,954,3.691,955,3.375,956,3.691,957,3.691,958,3.691,959,3.375,960,1.963,961,4.44,962,1.68,963,3.691,964,2.173,965,1.484,966,2.147,967,2.147,968,1.62,969,1.569,970,2.147,971,1.963,972,1.963]],["t/960",[51,0.784,104,1.447,183,2.815,467,2.97,779,3.168,820,4.386,827,3.612,842,6.351,855,5.044,856,6.136,865,4.788,939,7.437,942,7.581,960,7.437,961,7.437,973,8.133]],["t/962",[50,1.717,757,3.229,758,5.527,791,8.937,974,9.388]],["t/964",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/966",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,975,6.577]],["t/968",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,791,7.996,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,976,7.143]],["t/970",[35,1.759,48,2.551,50,1.375,51,0.892,64,2.039,66,2.768,104,1.701,393,3.932,435,2.535,559,2.689,665,4.424,707,3.492,708,3.09,757,3.288,976,6.872,977,7.514,978,7.514,979,6.872]],["t/972",[33,1.997,37,1.896,51,0.903,83,5.248,104,1.2,226,3.908,227,2.82,314,3.11,317,3.502,454,5.878,455,5.785,665,5.248,784,3.792,823,2.463,842,4.264,980,4.108,981,8.152,982,5.504,983,6.168,984,5.635,985,6.168,986,4.927,987,4.547]],["t/974",[51,0.919,104,1.477,112,2.417,230,4.028,231,3.866,454,4.888,455,4.811,467,3.032,665,4.888,827,3.688,979,7.593,981,7.593,984,5.249]],["t/976",[50,1.738,757,3.268,758,5.593,792,8.688,988,9.501]],["t/978",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/980",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,989,6.577]],["t/982",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,793,6.194,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,990,6.703]],["t/984",[35,1.759,48,2.551,50,1.375,51,0.892,64,2.039,66,2.768,104,1.701,393,3.932,435,2.535,559,2.689,622,3.432,707,3.492,708,3.09,757,3.288,991,7.514,992,7.514,993,7.514,994,7.514]],["t/986",[33,2.067,35,2.135,37,1.326,51,0.943,104,1.243,107,2.341,177,2.449,183,2.417,187,4.521,225,3.157,622,4.165,779,3.552,823,2.55,826,4.253,865,4.111,980,4.253,995,6.983,996,5.269,997,6.983,998,6.983,999,6.386]],["t/988",[51,0.849,104,1.651,467,3.388,622,4.237,827,4.12,999,8.484]],["t/990",[757,3.348,758,5.731,793,6.154]],["t/992",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/994",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1000,6.577]],["t/996",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,793,6.194,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,990,6.703]],["t/998",[35,1.726,48,2.504,50,1.349,51,0.908,64,2.001,66,2.735,104,1.681,230,3.577,393,3.885,435,2.488,559,2.638,707,3.45,708,3.033,757,3.249,821,4.087,822,3.696,990,6.328,1001,6.018,1002,7.374]],["t/1000",[33,2.408,35,1.904,51,0.93,104,1.447,177,2.852,220,4.172,227,3.4,230,3.945,382,3.987,417,4.123,776,5.044,821,4.507,822,4.077,823,2.97]],["t/1002",[51,0.892,104,1.613,230,4.397,467,3.31,821,5.024,822,4.544,827,4.026]],["t/1004",[21,3.388,50,1.697,757,3.191,758,6.403,794,7.962,1003,9.278]],["t/1006",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1008",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1004,6.577]],["t/1010",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,794,8.408,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1005,7.143]],["t/1012",[20,2.084,35,1.4,37,1.135,44,3.865,48,2.791,50,1.504,51,0.892,64,1.622,66,2.38,104,1.671,119,5.541,183,2.845,393,3.862,435,2.018,559,2.139,589,3.068,707,3.43,708,2.459,757,2.827,779,3.202,784,3.362,817,2.964,820,4.433,1005,5.468,1006,5.98,1007,8.219,1008,3.52,1009,5.131,1010,3.94,1011,5.98]],["t/1014",[20,1.138,33,1.328,35,2.479,37,1.956,44,3.146,50,1.224,51,0.962,83,2.641,104,0.798,107,1.504,119,4.51,167,2.805,177,1.574,183,1.553,187,3.316,190,1.802,225,3.665,346,1.563,454,3.938,455,3.876,589,3.432,622,3.055,779,2.606,784,2.522,817,3.965,820,2.42,823,1.638,824,4.871,825,2.522,826,2.732,846,2.685,865,2.641,1008,2.641,1009,3.85,1010,2.957]],["t/1016",[20,2.106,44,3.905,51,0.859,104,1.477,119,5.598,183,2.874,467,3.032,589,4.26,779,3.234,817,4.116,820,4.478,827,3.688,1008,4.888,1009,7.125,1010,5.472]],["t/1018",[50,1.717,757,3.229,758,5.527,795,8.056,1012,9.388,1013,9.388]],["t/1020",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1022",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1014,5.367]],["t/1024",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,795,8.408,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1015,7.143]],["t/1026",[20,1.451,35,1.339,37,1.086,44,2.69,48,2.706,50,1.458,51,0.908,64,1.552,66,2.308,104,1.632,183,2.759,230,3.866,393,3.773,435,1.93,559,2.047,589,2.934,707,3.35,708,2.352,757,2.741,779,3.105,784,3.216,817,2.835,820,3.085,821,4.417,822,3.995,865,3.367,1008,3.367,1010,3.769,1015,5.231,1016,5.72,1017,7.971,1018,4.909,1019,4.476,1020,3.69,1021,5.72]],["t/1028",[20,0.923,33,1.078,35,2.486,37,1.934,44,2.681,50,1.043,51,0.964,83,2.143,104,1.25,107,1.22,130,1.497,167,2.789,177,1.999,183,1.26,187,2.826,190,1.462,220,1.867,225,3.676,227,1.521,230,1.765,233,3.472,346,1.268,382,1.784,417,1.845,454,3.356,455,3.303,589,2.924,622,2.603,757,1.252,776,2.257,779,2.22,784,3.205,817,3.483,820,1.963,821,2.017,822,1.824,823,1.329,824,4.279,825,2.046,826,2.217,846,2.179,865,4.136,902,2.848,1008,2.143,1010,2.398,1018,3.123,1019,2.848,1020,2.348,1022,2.97]],["t/1030",[20,1.981,44,3.673,51,0.876,104,1.39,183,2.704,230,3.789,467,2.852,589,4.007,779,3.043,817,3.872,820,4.213,821,4.329,822,3.915,827,3.469,865,4.598,1008,4.598,1010,5.147,1018,6.703,1019,6.112,1020,5.038]],["t/1032",[21,3.349,50,1.678,69,7.175,70,7.483,757,3.154,758,5.398,796,7.175,1023,9.17]],["t/1034",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1036",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1014,5.367]],["t/1038",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,796,7.667,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1024,7.143]],["t/1040",[20,1.244,35,1.148,37,0.931,44,2.306,48,2.86,50,1.541,51,0.923,64,1.331,66,2.068,67,2.645,69,3.837,104,1.647,183,2.916,230,4.086,393,3.806,435,1.655,559,1.755,589,2.516,707,3.38,708,2.017,757,2.457,779,3.281,784,4.015,817,2.431,820,2.645,821,4.669,822,4.223,824,5.636,865,2.887,1008,2.887,1010,3.232,1024,4.485,1025,4.904,1026,8.424,1027,4.208,1028,7.142,1029,4.904]],["t/1042",[20,0.977,33,1.141,35,2.479,37,1.856,44,2.802,50,1.333,51,0.961,83,3.508,104,0.685,107,1.292,112,1.122,167,2.555,177,2.09,183,1.334,187,2.953,190,1.547,220,1.976,225,3.665,227,1.61,230,1.869,346,2.076,382,1.889,417,1.953,454,3.508,455,3.452,589,3.057,622,2.721,776,2.389,779,2.321,784,2.166,817,3.611,820,2.078,821,2.135,822,1.931,823,1.407,824,5.399,825,2.166,826,2.346,846,3.566,865,4.289,1008,2.268,1010,3.926,1014,3.144,1027,3.306]],["t/1044",[20,2.021,44,3.747,51,0.883,104,1.418,183,2.758,230,3.865,467,2.91,589,4.088,779,3.104,817,3.95,820,4.298,821,4.416,822,3.994,827,3.539,865,4.691,1008,4.691,1010,5.251,1027,6.838]],["t/1046",[50,1.717,177,3.293,346,3.271,824,5.717,857,7.346,1030,9.388]],["t/1048",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1050",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,860,6.014]],["t/1052",[21,3.806,100,3.033,128,3.655,174,4.031,187,3.655,231,3.433,239,3.217,371,3.275,469,3.189,484,3.615,519,3.655,563,5.311,707,2.693,797,8.639,805,3.926,807,4.031,808,3.926,809,3.577,810,4.272,811,4.272,812,4.207,813,4.272,885,5.77,1031,6.743,1032,6.743]],["t/1054",[35,1.726,40,2.916,48,2.504,50,1.349,51,0.887,64,2.001,66,2.735,104,1.681,393,3.885,435,2.488,559,2.638,707,3.45,708,3.033,757,3.249,824,4.491,1032,6.743,1033,7.374,1034,7.374,1035,6.328,1036,6.328]],["t/1056",[33,2.183,35,2.211,37,1.4,40,2.916,44,3.468,51,0.934,104,1.312,112,2.147,167,2.586,225,3.608,429,3.008,823,2.693,824,4.491,915,5.564,968,7.128,1035,6.328,1036,6.328,1037,6.328]],["t/1058",[40,3.585,51,0.838,104,1.613,467,3.31,824,5.521,827,4.026,1035,7.779,1036,7.779]],["t/1060",[50,1.738,757,3.268,758,5.593,798,7.753,1038,9.501]],["t/1062",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1064",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1039,6.014]],["t/1066",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,798,7.996,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1040,7.143]],["t/1068",[35,1.635,48,2.371,50,1.277,51,0.894,64,1.895,66,2.64,104,1.623,183,2.417,230,3.387,393,3.751,435,2.356,559,2.499,707,3.33,708,2.872,757,3.137,779,2.72,820,3.766,821,3.87,822,3.5,824,4.253,865,4.111,1040,6.386,1041,6.983,1042,6.983,1043,6.983]],["t/1070",[20,0.898,33,1.049,35,2.468,37,1.864,44,2.624,50,1.021,51,0.961,83,2.085,104,1.228,107,1.188,112,1.031,130,1.457,167,2.421,177,1.957,183,1.226,187,2.766,190,1.422,220,1.817,225,3.65,227,1.481,230,1.718,311,1.817,325,2.587,346,1.234,382,1.737,417,1.796,454,3.285,455,3.233,589,2.863,622,2.548,757,1.218,776,2.197,779,2.173,784,4.404,817,3.422,820,1.91,821,1.963,822,1.775,823,1.293,824,5.19,825,1.991,826,2.157,831,2.285,846,3.34,865,4.064,902,2.771,1008,2.085,1010,2.334,1019,2.771,1020,2.285,1022,2.89,1039,5.103,1044,3.239]],["t/1072",[20,1.906,35,1.759,44,3.534,51,0.892,104,1.701,183,2.601,230,3.645,467,2.744,589,3.855,779,2.927,817,3.725,820,4.053,821,4.165,822,3.767,827,4.246,865,4.424,1008,4.424,1010,4.952,1019,5.88,1020,4.847,1044,6.872]],["t/1074",[21,3.428,50,1.717,757,3.229,758,5.527,799,7.346,1045,9.388]],["t/1076",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1078",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1046,6.577]],["t/1080",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,799,7.667,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1047,7.143]],["t/1082",[35,0.924,44,1.857,48,1.341,50,0.722,51,0.942,64,1.071,66,1.758,100,1.624,104,1.08,110,0.726,111,1.473,112,1.768,167,1.385,183,2.561,189,2.697,225,1.367,314,3.412,317,4.313,387,1.936,393,3.894,394,2.496,435,2.497,454,2.325,455,2.288,519,1.957,559,1.413,589,2.026,707,3.033,757,2.089,779,2.882,799,6.5,817,1.957,822,1.979,913,3.222,984,2.496,987,2.662,1008,2.325,1047,3.611,1048,3.949,1049,8.966,1050,3.389,1051,4.752,1052,3.389,1053,3.611,1054,3.949,1055,3.389,1056,3.949,1057,4.956,1058,6.073,1059,3.949,1060,3.389,1061,3.949,1062,3.949,1063,3.949,1064,6.073,1065,3.09,1066,3.09,1067,3.389,1068,2.802,1069,3.389,1070,6.073]],["t/1084",[33,0.86,35,2.457,37,1.845,44,2.841,50,0.531,51,0.961,104,1.075,107,0.974,112,0.846,119,1.958,167,1.668,177,1.019,181,1.657,183,1.005,187,2.358,190,2.427,216,1.483,225,3.683,240,2.007,314,2.786,317,1.508,380,1.44,387,1.424,454,3.557,455,3.501,470,0.514,482,1.588,505,1.958,513,2.37,588,2.273,589,3.1,622,2.759,779,1.853,784,3.397,799,2.273,803,1.657,817,3.463,822,1.456,823,1.061,824,2.897,825,1.633,826,1.769,849,1.958,850,1.738,980,1.769,984,3.007,987,1.958,1008,1.71,1050,2.492,1051,2.273,1052,2.492,1055,4.082,1057,2.37,1071,2.122,1072,2.273,1073,2.904,1074,1.958,1075,3.376,1076,2.904,1077,2.904,1078,2.904,1079,2.904,1080,2.904,1081,2.904,1082,5.525,1083,2.904,1084,2.122,1085,4.35,1086,4.35,1087,2.656,1088,2.656,1089,1.958,1090,2.37,1091,2.904]],["t/1086",[37,1.326,44,3.284,51,0.943,104,1.243,112,2.033,183,2.417,314,3.22,387,3.424,454,4.111,455,4.046,467,2.55,589,3.582,779,2.72,817,3.461,822,3.5,827,3.101,1008,4.111,1050,5.993,1051,5.464,1052,5.993,1053,6.386,1055,5.993,1057,5.699,1082,6.386,1085,6.386,1086,6.386]],["t/1088",[50,1.697,757,3.191,758,5.462,793,5.865,858,8.484,1092,7.571,1093,9.278]],["t/1090",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1092",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1094,6.577]],["t/1094",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1095,9.798,1096,7.143]],["t/1096",[35,1.455,48,2.11,50,1.137,51,0.913,64,1.686,66,2.443,104,1.501,177,2.96,393,3.47,435,2.097,559,2.224,707,3.082,708,2.556,751,3.854,757,2.902,849,4.19,850,5.051,912,2.76,1089,4.19,1096,5.683,1097,6.215,1098,6.215,1099,5.333,1100,5.683,1101,5.683,1102,5.683,1103,5.683,1104,5.333,1105,4.41,1106,5.072,1107,5.683,1108,5.333,1109,5.683,1110,4.863]],["t/1098",[33,2.163,51,0.885,104,1.3,177,3.293,751,4.531,823,2.668,849,4.926,850,5.621,959,9.49,1089,4.926,1099,8.059,1101,6.681,1102,6.681,1103,6.681,1104,8.059,1106,5.962,1107,6.681,1108,8.059,1110,5.717]],["t/1100",[51,0.867,104,1.509,467,3.097,827,3.767,912,4.578,1099,7.278,1100,7.756,1104,7.278,1105,6.018,1108,7.278,1109,7.756,1111,8.481]],["t/1102",[21,2.644,50,1.89,54,5.664,101,4.333,104,1.838,233,4.409,311,4.789,484,3.549,583,3.629,757,2.49,758,4.261,769,5.248,800,5.664,842,7.142,917,6.62,918,6.62,919,5.002,920,4.07,921,6.62,922,6.62,923,5.907]],["t/1104",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1106",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1112,6.577]],["t/1108",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,800,7.667,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1113,7.143]],["t/1110",[35,1.649,48,2.392,50,1.289,51,0.874,64,1.912,66,2.656,104,1.632,183,2.439,314,3.249,393,3.772,435,2.377,559,2.521,665,5.4,707,3.35,708,2.898,757,3.155,779,2.744,893,6.184,927,7.486,1113,6.443,1114,7.045,1115,7.045]],["t/1112",[33,2.014,35,2.099,37,1.818,51,0.938,104,1.443,107,1.539,130,1.888,147,2.097,167,1.61,177,2.843,183,1.589,187,3.373,190,1.844,225,3.104,226,3.942,227,1.919,244,3.771,387,2.251,417,2.328,537,3.258,665,4.006,757,1.579,779,2.65,800,3.592,823,2.485,826,2.796,842,6.052,845,3.746,846,2.748,847,7.694,848,3.172,849,3.095,850,2.748,851,3.94,852,3.94,853,3.94,854,3.746,855,2.847,856,3.464,893,5.466,927,5.553,971,4.198,972,4.198]],["t/1114",[35,2.185,51,0.903,104,1.661,174,3.957,183,2.506,213,4.669,387,3.549,467,2.644,665,5.496,779,2.82,827,4.146,842,5.901,845,5.907,855,4.489,856,5.462,893,6.294,927,7.618,1116,7.239,1117,6.62]],["t/1116",[50,1.717,757,3.229,758,5.527,801,9.398,1118,9.388]],["t/1118",[35,2.198,104,1.949,371,4.169,470,1.663,702,1.967]],["t/1120",[37,1.872,59,1.785,72,1.549,104,1.17,227,2.749,327,3.695,437,3.645,703,2.921,745,6.158,757,3.955,770,3.645,774,3.645,775,3.645,778,3.697,779,2.562,780,3.595,803,3.752,1014,5.367]],["t/1122",[21,3.91,100,3.212,128,3.872,231,3.637,239,3.408,371,3.469,469,3.378,519,3.872,563,4.391,707,2.852,801,8.408,805,4.158,807,4.27,808,4.158,809,3.789,810,4.526,811,4.526,812,4.457,813,4.526,1119,6.112]],["t/1124",[35,1.527,44,3.067,48,2.215,50,1.193,51,0.896,64,1.77,66,2.524,104,1.551,183,2.258,230,4.228,393,3.585,435,2.201,559,2.334,707,3.184,708,2.682,757,2.998,779,2.541,820,3.518,821,3.615,822,3.269,865,3.84,912,2.897,1119,5.104,1120,5.323,1121,6.522,1122,5.964,1123,5.597,1124,6.821,1125,5.597,1126,5.597]],["t/1126",[12,2.965,20,1.06,33,1.237,35,2.355,37,1.204,44,3.603,51,0.957,104,1.128,107,1.401,167,2.224,177,2.224,183,1.446,187,3.143,190,2.546,216,2.389,220,2.144,225,3.587,227,2.651,230,2.027,382,2.049,417,3.215,776,2.591,779,2.47,784,4.809,820,2.254,821,2.316,822,2.094,823,1.526,826,2.545,849,5.166,850,3.795,865,4.511,895,3.153,912,1.856,964,2.46,1123,5.441,1124,4.961,1125,5.441,1126,5.441,1127,4.178,1128,4.178,1129,3.821,1130,4.178,1131,3.821]],["t/1128",[44,3.673,51,0.876,104,1.39,183,2.704,230,4.753,467,2.852,779,3.043,820,4.213,821,4.329,822,3.915,827,3.469,865,4.598,912,3.469,1122,7.143,1123,6.703,1124,7.667,1125,6.703,1126,6.703]],["t/1130",[20,1.74,50,1.649,51,0.704,64,1.862,95,2.489,100,2.822,114,4.24,129,2.993,132,3.048,175,3.104,240,4.741,356,3.195,366,4.869,367,5.369,560,4.24,673,3.607,705,3.364,1132,6.862,1133,3.858,1134,6.862,1135,6.862,1136,6.275,1137,5.6,1138,6.862,1139,5.177,1140,5.177,1141,4.869,1142,5.369,1143,3.52,1144,5.177,1145,5.013,1146,5.177,1147,5.6]],["t/1132",[21,4.133,22,6.691,23,2.795,174,4.844,807,4.844,1148,8.104,1149,8.104,1150,8.862]],["t/1134",[23,0.9,35,1.617,37,1.558,39,1.341,50,1.264,51,0.946,59,0.764,64,0.774,65,1.666,66,1.357,72,0.384,73,0.731,80,0.982,81,0.894,100,1.173,108,2.106,110,1.097,114,4.411,115,2.447,129,2.045,130,1.173,159,0.874,167,1.644,175,1.29,183,1.622,216,0.889,225,2.392,250,1.971,253,1.414,261,1.341,278,3.667,299,1.355,309,1.538,312,1.328,337,2.182,346,0.994,389,2.024,416,1.679,429,1.912,435,1.581,470,1.057,482,2.562,536,2.083,560,4.411,583,1.43,673,2.464,920,1.603,951,2.083,1143,3.061,1151,1.603,1152,2.447,1153,2.963,1154,2.852,1155,2.852,1156,2.152,1157,2.447,1158,2.152,1159,2.852,1160,2.852,1161,2.447,1162,2.327,1163,1.803,1164,2.152,1165,2.852,1166,3.354,1167,4.022,1168,2.852,1169,2.447,1170,2.852,1171,5.213,1172,2.852,1173,1.398,1174,2.852,1175,1.679,1176,2.852,1177,2.152,1178,4.687,1179,2.852,1180,2.852,1181,2.852,1182,2.852,1183,2.852,1184,2.957,1185,2.327,1186,1.559,1187,2.608,1188,2.852,1189,2.963,1190,2.715,1191,2.715,1192,1.923,1193,1.879]],["t/1136",[115,6.979,470,1.44,482,4.445,560,3.824,673,4.275,764,6.979,766,4.822,1139,6.136,1140,6.136,1141,5.771,1142,6.363,1143,4.172,1144,6.136,1145,5.941,1146,6.136,1147,6.637,1151,4.572,1194,6.979]],["t/1138",[21,2.846,23,2.459,49,1.946,50,1.014,51,0.953,64,2.302,65,3.478,66,2.257,72,1.05,73,1.997,100,1.444,114,1.651,129,1.531,131,4.517,261,3.666,483,3.916,536,2.565,560,4.602,673,4.46,762,2.491,1143,3.999,1162,2.865,1163,2.219,1175,2.067,1186,4.261,1195,2.649,1196,2.865,1197,5.541,1198,4.916,1199,3.21,1200,6.689,1201,3.21,1202,3.51,1203,5.371,1204,5.541,1205,3.21,1206,3.21,1207,3.51,1208,3.51,1209,3.21,1210,3.21,1211,3.51,1212,3.51,1213,5.541,1214,3.21,1215,3.51,1216,3.51]],["t/1140",[39,3.747,397,5.661,417,4.04,482,4.356,560,3.747,697,4.189,883,5.654,1074,5.373,1145,5.821,1217,9.879,1218,7.287,1219,7.969,1220,7.969,1221,7.969,1222,5.821,1223,6.012,1224,7.969,1225,6.012]],["t/1142",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1139,6.612,1198,5.077,1226,8.764,1227,5.653,1228,6.055]],["t/1144",[23,1.361,51,0.951,59,1.059,61,2.009,64,1.171,65,2.777,66,1.249,72,0.581,73,1.106,80,1.361,81,1.239,110,1.194,148,1.465,159,1.322,175,1.952,261,2.029,299,2.05,312,2.009,337,3.025,429,1.76,435,1.456,470,0.764,548,4.029,560,4.386,673,3.415,738,3.415,1139,4.902,1143,3.333,1163,2.728,1164,3.256,1166,3.653,1173,2.116,1175,2.54,1184,3.22,1186,2.359,1189,4.107,1190,3.764,1191,5.038,1192,2.909,1193,4.281,1229,4.315,1230,3.521,1231,5.544,1232,3.521,1233,4.315,1234,4.315,1235,3.376,1236,4.315,1237,2.783,1238,2.5,1239,4.315,1240,4.315,1241,2.628,1242,3.062]],["t/1146",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1140,6.612,1198,5.077,1227,5.653,1228,6.055,1243,8.764]],["t/1148",[23,1.399,51,0.938,59,1.081,61,2.066,64,1.204,65,2.824,66,2.3,72,0.597,73,1.137,80,1.39,81,1.265,110,1.219,148,1.506,159,1.359,175,2.007,261,2.086,299,2.107,312,2.066,337,3.088,429,1.81,435,1.497,470,0.786,560,4.438,673,3.487,738,3.487,1140,5.005,1143,3.403,1163,2.804,1164,3.347,1166,3.729,1173,2.175,1175,2.612,1184,3.288,1186,2.425,1189,4.193,1190,3.843,1191,5.108,1192,2.991,1193,4.371,1230,3.62,1231,5.637,1232,3.62,1235,3.471,1237,2.861,1238,2.57,1241,2.702,1242,3.148,1244,4.436,1245,4.436,1246,4.436,1247,4.436,1248,4.436,1249,4.436]],["t/1150",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1141,6.219,1198,5.077,1227,5.653,1228,6.055,1250,8.764]],["t/1152",[23,1.361,51,0.948,59,1.059,61,3.025,64,1.171,65,2.309,66,1.249,72,0.581,73,1.106,80,1.361,81,1.239,110,1.194,159,1.322,175,1.952,261,2.029,299,2.05,312,2.009,337,3.025,429,1.76,435,1.456,470,0.764,548,4.029,560,4.386,673,3.415,738,3.415,1141,4.61,1143,4.009,1163,2.728,1164,3.256,1166,3.653,1173,2.116,1175,2.54,1184,3.22,1186,2.359,1189,4.107,1190,3.764,1191,4.527,1192,2.909,1193,4.281,1231,4.61,1237,2.783,1238,3.764,1241,2.628,1242,3.062,1251,3.946,1252,4.315,1253,4.315,1254,4.315,1255,3.376,1256,4.315,1257,3.376,1258,4.315,1259,3.521,1260,3.946,1261,3.703]],["t/1154",[23,1.465,39,2.184,50,1.493,51,0.926,59,0.757,64,1.26,65,2.439,66,1.345,72,0.625,73,1.19,80,0.973,81,0.886,108,2.423,110,0.854,114,4.24,132,2.063,159,1.423,175,2.101,213,2.996,261,2.184,299,2.206,337,2.163,397,2.65,429,1.895,435,1.567,467,1.696,514,3.986,559,1.662,560,4.736,673,4.74,682,2.829,982,3.79,1141,3.296,1166,2.611,1175,2.734,1186,2.539,1190,2.691,1260,4.247,1262,5.601,1263,3.79,1264,4.645,1265,6.863,1266,4.645,1267,3.79,1268,6.863,1269,4.645,1270,4.645,1271,4.645,1272,4.645,1273,4.645,1274,4.645,1275,2.936,1276,4.645,1277,3.634,1278,4.645,1279,4.645,1280,4.645,1281,3.986]],["t/1156",[20,2.121,37,0.92,48,1.645,51,0.927,61,4.284,72,0.652,73,1.241,88,1.873,108,2.499,110,1.301,129,2.113,175,2.191,272,5.777,429,1.976,435,1.634,560,4.327,673,2.546,912,2.151,1141,3.437,1143,5.244,1184,3.509,1189,3.062,1190,2.806,1237,4.566,1251,4.43,1261,4.157,1281,4.157,1282,4.844,1283,4.844,1284,4.844,1285,4.844,1286,3.79,1287,6.473,1288,3.004,1289,4.844,1290,4.844,1291,4.43,1292,4.844,1293,6.074,1294,6.473,1295,7.079,1296,6.473,1297,7.079,1298,4.844,1299,3.539,1300,4.844]],["t/1158",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1142,6.857,1198,5.077,1227,5.653,1228,6.055,1301,8.764]],["t/1160",[23,1.392,51,0.951,59,1.077,61,3.076,64,1.197,65,2.348,66,1.277,72,0.594,73,1.13,80,1.384,81,1.26,110,1.214,159,1.351,175,1.996,261,2.075,299,2.096,312,2.054,337,3.076,429,1.8,435,1.488,470,0.781,560,4.427,673,3.472,738,3.472,1143,4.062,1163,2.789,1164,3.328,1166,3.714,1173,2.163,1175,2.597,1184,3.274,1186,2.411,1189,4.176,1190,3.827,1191,3.827,1192,2.974,1193,4.353,1237,2.845,1238,3.827,1241,2.687,1242,3.13,1255,3.452,1257,3.452,1259,3.6,1302,4.411,1303,3.786,1304,4.034,1305,3.786,1306,4.411,1307,4.411,1308,4.411,1309,4.411,1310,4.411,1311,6.605]],["t/1162",[21,2.484,27,3.77,50,1.64,114,4.715,167,2.386,187,3.372,274,3.719,312,3.168,482,3.719,484,3.335,560,3.199,583,3.41,606,3.669,673,3.576,767,3.622,914,4.005,943,4.143,969,4.97,1143,3.49,1173,3.335,1175,4.005,1198,3.942,1227,4.388,1228,4.701,1312,6.221,1313,5.133,1314,4.388,1315,6.803,1316,6.803,1317,4.97,1318,5.838,1319,6.803,1320,5.838,1321,6.803,1322,4.701]],["t/1164",[23,1.392,51,0.945,59,1.077,61,3.076,64,1.197,65,2.348,66,1.277,72,0.594,73,1.13,80,1.384,81,1.26,110,1.214,114,3.106,159,1.351,175,1.996,261,2.075,299,2.096,312,2.054,337,3.076,429,1.8,435,1.488,470,0.781,560,4.427,673,3.472,738,3.472,1143,4.83,1157,3.786,1161,3.786,1163,2.789,1164,3.328,1166,3.714,1173,2.163,1175,2.597,1184,3.274,1186,2.411,1189,4.176,1190,3.827,1191,3.827,1192,2.974,1193,4.353,1237,2.845,1238,3.827,1241,2.687,1242,3.13,1255,3.452,1257,3.452,1259,3.6,1303,3.786,1305,3.786,1323,3.6,1324,3.786,1325,4.411,1326,4.411,1327,4.411]],["t/1166",[23,1.729,51,0.933,59,0.893,64,1.487,65,2.75,66,1.587,72,0.738,73,1.405,80,1.149,81,1.046,110,1.008,114,3.638,159,1.679,192,3.536,261,2.578,299,2.604,337,2.553,429,2.237,467,2.002,560,4.216,673,5.399,738,2.882,1143,2.812,1166,3.082,1175,3.227,1184,2.717,1186,2.997,1190,3.176,1191,3.176,1200,4.704,1230,4.474,1232,4.474,1262,4.474,1275,3.465,1277,4.29,1314,4.99,1323,4.474,1324,4.704,1328,5.013,1329,5.013,1330,4.798,1331,5.013,1332,4.704]],["t/1168",[23,1.617,37,0.973,51,0.929,59,0.836,64,1.391,65,2.621,66,1.484,72,0.69,73,1.313,80,1.074,81,0.978,108,1.81,110,1.356,159,1.571,192,3.307,261,2.411,299,2.435,309,2.765,429,2.092,467,1.872,560,4.063,673,4.541,738,2.695,1143,3.784,1166,2.882,1175,3.018,1184,2.541,1190,2.97,1191,2.97,1200,4.399,1262,4.184,1275,3.241,1277,4.011,1291,4.688,1299,3.745,1313,3.868,1314,3.307,1323,4.184,1328,4.688,1329,4.688,1330,3.179,1331,4.688,1332,4.399,1333,5.127,1334,8.639,1335,5.127,1336,4.688,1337,5.127,1338,5.127,1339,4.184,1340,5.127,1341,4.688,1342,5.127]],["t/1170",[21,2.463,49,5.534,50,1.234,64,2.882,114,4.192,128,4.419,129,2.942,132,2.996,133,5.278,179,3.971,216,2.103,224,4.786,470,1.195,553,5.788,559,2.413,943,4.108,1071,4.927,1143,4.573,1195,5.089,1263,5.504,1299,7.294,1313,5.089,1343,6.168,1344,5.788,1345,6.168,1346,6.745,1347,5.504,1348,4.927,1349,6.745]],["t/1172",[108,3.78,114,5.744,253,3.872,380,3.872,416,4.598,435,2.636,441,4.938,920,4.391,1143,4.007,1171,5.894,1177,5.894,1350,6.374,1351,7.143]],["t/1174",[21,3.201,39,2.475,50,0.963,51,0.411,66,1.524,100,3.091,114,5.298,130,2.165,133,4.118,167,1.846,189,2.337,380,2.609,393,3.605,416,3.098,435,1.776,509,3.468,519,2.609,881,4.517,951,3.845,965,3.637,980,3.205,1133,2.959,1158,6.615,1167,4.517,1173,2.58,1227,3.395,1343,4.813,1352,5.263,1353,4.813,1354,5.263,1355,5.263,1356,5.263,1357,4.813,1358,5.263,1359,5.263,1360,5.263,1361,5.263,1362,4.517,1363,5.263,1364,4.118,1365,5.263,1366,6.133,1367,7.482,1368,4.813,1369,5.263,1370,5.263,1371,6.133,1372,4.517,1373,5.263,1374,4.813,1375,3.003,1376,4.118]],["t/1176",[37,1.259,50,1.213,84,3.119,114,5.42,129,2.893,167,3.473,225,2.296,256,4.358,380,5.598,398,3.287,416,3.904,429,2.706,565,3.402,943,4.039,1074,5.943,1367,6.897,1377,6.632,1378,5.004,1379,6.632,1380,5.691,1381,5.412,1382,6.632,1383,6.632,1384,4.192]],["t/1178",[21,2.507,27,1.564,33,2.032,35,0.66,37,1.55,48,0.958,50,1.494,51,0.895,64,1.607,84,2.185,95,1.023,108,2.882,109,1.288,110,0.854,114,3.839,130,1.16,151,1.399,167,0.99,179,1.661,185,1.045,189,1.253,190,1.133,194,2.412,224,4.871,238,1.689,250,1.949,346,1.619,355,1.635,389,2.002,398,1.399,435,0.952,441,5.456,467,1.696,470,0.5,509,1.859,515,2.129,549,2.302,591,3.791,697,1.483,699,1.61,712,2.881,730,1.949,762,2.002,823,1.696,831,1.82,887,1.75,920,1.586,1143,3.038,1166,1.586,1173,1.383,1313,5.179,1336,4.248,1385,2.821,1386,2.821,1387,1.82,1388,2.821,1389,4.645,1390,2.821,1391,2.821,1392,2.821,1393,2.421,1394,2.821,1395,4.248,1396,2.821,1397,2.58,1398,2.821,1399,2.58,1400,3.986,1401,2.58,1402,2.821,1403,5.921,1404,3.505,1405,4.645,1406,2.821,1407,4.248,1408,4.248,1409,2.821,1410,6.94,1411,2.421,1412,2.421,1413,2.58,1414,2.58,1415,4.645,1416,4.645,1417,5.921,1418,2.421,1419,2.58,1420,5.921,1421,4.645,1422,6.864,1423,2.58,1424,2.58,1425,2.58,1426,2.821,1427,2.821,1428,2.58,1429,2.58,1430,2.821,1431,4.248,1432,2.821,1433,2.821,1434,2.821,1435,2.821]],["t/1180",[21,1.576,33,1.277,37,0.819,50,1.793,51,0.895,114,5.035,167,1.513,189,1.916,241,3.703,244,3.601,253,2.139,256,3.827,311,3.333,346,1.504,393,1.775,429,3.547,435,1.456,467,1.576,470,0.764,698,3.256,707,1.576,777,2.297,850,6.087,920,5.51,1133,2.426,1227,2.783,1231,4.61,1332,3.703,1367,5.084,1387,4.191,1436,7.951,1437,3.376,1438,3.062,1439,3.946,1440,4.315,1441,7.145,1442,4.315,1443,3.946,1444,3.946,1445,3.376,1446,4.315,1447,4.315,1448,2.676,1449,4.315,1450,4.315,1451,3.946,1452,4.315,1453,4.315,1454,3.946,1455,6.497,1456,3.703]],["t/1182",[21,2.241,27,1.646,32,1.524,33,1.434,37,1.165,50,1.295,51,0.718,93,1.916,100,1.221,112,0.865,114,4.603,120,2.424,129,1.296,131,1.581,132,1.319,145,1.694,167,3.648,183,1.028,187,2.401,190,1.193,192,1.916,219,2.548,225,1.028,257,2.424,309,1.602,345,2.324,346,2.915,384,2.107,386,2.424,387,1.456,389,2.107,413,2.052,435,1.002,470,0.526,471,2.17,482,3.354,518,2.107,559,1.063,565,1.524,602,4.157,603,2.324,698,5.341,730,2.052,760,2.107,762,2.107,772,1.957,777,1.581,823,1.769,831,1.916,895,2.241,920,1.67,943,1.809,969,2.17,1072,2.324,1143,1.524,1169,4.157,1173,3.008,1184,2.401,1267,3.954,1393,2.548,1411,5.265,1457,4.845,1458,6.136,1459,2.324,1460,2.97,1461,2.716,1462,2.548,1463,2.424,1464,2.241,1465,4.845,1466,6.136,1467,4.845,1468,2.97,1469,2.716,1470,2.716,1471,6.136,1472,2.424,1473,2.241,1474,2.97,1475,2.241,1476,2.716,1477,2.97,1478,2.548,1479,2.716,1480,3.539,1481,2.97,1482,4.93,1483,2.716,1484,2.97,1485,2.97,1486,9.164,1487,7.079,1488,5.265,1489,2.548,1490,2.548,1491,4.157,1492,2.716,1493,2.97,1494,2.97,1495,2.716,1496,2.716,1497,2.548]],["t/1184",[21,1.101,33,1.835,37,0.572,50,0.897,51,0.815,61,2.284,64,0.818,65,1.072,72,0.406,83,1.775,84,4.176,107,1.011,108,3.268,110,1.139,111,1.829,114,3.697,132,1.339,167,2.174,183,1.044,190,1.211,194,2.547,216,1.529,231,2.887,244,3.436,250,2.083,256,2.729,309,1.626,346,1.051,389,2.139,413,3.389,429,2.529,436,5.931,470,0.534,475,2.757,548,1.87,551,5.321,559,1.755,697,2.578,698,3.701,738,4.865,766,1.447,768,2.359,772,3.232,781,2.757,805,1.605,809,2.379,823,2.264,831,1.945,850,3.711,855,1.87,915,2.275,980,1.836,1153,1.906,1231,2.139,1267,2.461,1367,2.359,1437,3.838,1438,3.48,1463,2.461,1470,2.757,1480,3.583,1488,5.321,1490,2.587,1498,3.015,1499,5.46,1500,5.06,1501,3.015,1502,3.015,1503,2.359,1504,3.015,1505,3.015,1506,6.2,1507,4.003,1508,3.015,1509,3.015,1510,3.015,1511,3.015,1512,2.757,1513,3.015,1514,2.757,1515,3.015,1516,5.589,1517,7.861,1518,2.757,1519,2.359,1520,3.015,1521,2.757,1522,3.015]],["t/1186",[33,2.433,50,0.86,51,0.882,64,1.275,108,2.902,110,1.859,114,2.21,132,2.087,167,1.648,257,3.835,366,3.335,401,2.723,484,2.304,503,5.65,509,3.097,559,1.682,697,5.497,766,2.256,809,2.28,887,2.915,915,5.224,1313,3.546,1350,5.65,1378,3.546,1516,5.417,1519,3.678,1523,4.7,1524,4.7,1525,4.7,1526,4.7,1527,10.731,1528,10.731,1529,8.22,1530,4.7,1531,4.7,1532,4.7,1533,4.7,1534,4.7,1535,4.033,1536,4.7,1537,4.7,1538,3.032,1539,4.7,1540,4.7,1541,4.7]],["t/1188",[33,1.132,35,0.524,37,0.951,39,3.13,50,1.617,51,0.825,59,0.365,61,1.781,64,0.607,65,1.359,66,0.648,72,0.515,88,1.479,108,1.35,112,1.938,114,5.264,130,3.359,148,2.26,151,1.896,167,3.099,189,2.224,194,1.162,216,0.698,220,1.148,248,0.906,253,1.896,255,2.047,256,1.684,257,1.827,309,1.207,346,0.78,380,2.483,398,1.109,416,2.252,417,1.135,429,2.716,435,0.755,443,1.827,467,1.829,470,1.049,482,2.091,548,1.388,559,0.801,565,1.148,583,1.122,603,1.751,682,1.363,704,1.122,712,2.372,771,1.635,831,1.444,836,1.588,883,1.588,887,1.388,920,1.258,943,1.363,964,1.318,980,1.363,1143,2.569,1151,1.258,1171,1.689,1173,1.097,1177,1.689,1235,6.063,1237,1.444,1238,2.216,1294,2.047,1351,6.632,1357,3.498,1362,1.921,1371,1.827,1374,2.047,1375,1.277,1376,2.993,1381,1.827,1387,1.444,1395,2.047,1408,5.419,1451,2.047,1454,3.498,1480,4.329,1482,2.418,1486,3.498,1491,5.085,1492,2.047,1495,2.047,1516,1.751,1542,2.047,1543,1.921,1544,2.238,1545,2.238,1546,2.238,1547,1.751,1548,1.588,1549,2.238,1550,1.827,1551,2.238,1552,2.238,1553,2.047,1554,2.238,1555,2.238,1556,2.238,1557,3.121,1558,2.238,1559,2.238,1560,2.238,1561,2.238,1562,7.253,1563,2.238,1564,1.827,1565,2.238,1566,2.238,1567,2.047,1568,1.689,1569,1.689,1570,2.238,1571,2.047,1572,2.238,1573,2.238,1574,2.238,1575,2.238,1576,2.238,1577,2.238,1578,2.238,1579,2.238,1580,2.238,1581,2.238,1582,2.047,1583,2.047,1584,2.238,1585,2.238]],["t/1190",[4,1.031,21,0.874,22,0.833,27,0.73,33,1.833,35,0.771,37,1.315,48,1.788,50,1.324,51,0.888,59,0.215,64,0.357,65,0.468,72,0.322,84,4.594,88,1.566,93,1.544,94,1.13,95,2.511,106,0.498,107,1.93,108,3.571,110,1.429,111,1.511,112,0.383,114,4.044,128,2.008,130,0.985,133,1.031,167,0.462,174,0.72,179,1.41,181,1.366,183,1.822,189,2.088,190,0.962,191,0.692,192,2.613,220,0.676,231,0.613,240,2.274,241,1.13,249,1.366,250,1.654,253,3.432,256,1.449,346,0.834,380,1.187,388,1.031,389,3.336,393,0.542,394,0.833,410,1.075,417,0.668,429,2.526,435,2.536,470,0.424,484,0.646,559,0.857,591,1.075,602,1.13,606,1.291,634,3.098,682,0.802,684,1.075,697,1.259,699,0.752,721,2.055,730,0.91,759,0.962,773,2.405,809,0.639,823,1.923,831,2.123,867,1.075,912,1.799,920,2.277,964,0.775,1020,1.544,1074,0.888,1166,0.741,1173,0.646,1267,1.075,1313,0.994,1348,6.52,1364,1.031,1378,1.807,1384,1.514,1393,1.13,1418,1.13,1423,2.19,1424,2.19,1425,2.19,1428,2.19,1459,2.576,1461,1.205,1480,1.749,1488,4.518,1490,1.13,1491,5.314,1516,1.031,1553,1.205,1557,1.075,1567,1.205,1568,0.994,1569,0.994,1586,4.034,1587,1.317,1588,2.394,1589,4.051,1590,4.051,1591,2.394,1592,2.394,1593,2.394,1594,2.394,1595,2.394,1596,2.394,1597,8.768,1598,1.317,1599,1.954,1600,1.13,1601,1.317,1602,4.051,1603,2.394,1604,3.292,1605,3.01,1606,1.317,1607,2.19,1608,2.394,1609,1.317,1610,1.317,1611,1.205,1612,3.292,1613,1.317,1614,1.205,1615,2.19,1616,1.205,1617,1.205,1618,0.994,1619,1.205,1620,1.317,1621,1.317,1622,1.031,1623,1.317,1624,3.292,1625,2.394,1626,1.317,1627,0.935,1628,1.317,1629,1.317,1630,1.317,1631,1.205,1632,1.317]],["t/1192",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1144,6.612,1198,5.077,1227,5.653,1228,6.055,1633,8.764]],["t/1194",[23,1.376,51,0.943,59,1.068,61,3.05,64,1.184,65,2.328,66,1.263,72,0.588,73,1.118,80,1.373,81,1.25,110,1.204,159,1.337,175,1.974,261,2.052,299,2.073,312,2.031,337,3.05,429,1.78,435,1.472,470,0.773,548,4.063,560,4.406,673,3.443,738,3.443,1143,4.035,1144,4.942,1163,2.758,1166,3.683,1173,2.139,1175,2.568,1184,3.247,1186,2.385,1189,4.141,1190,3.795,1191,4.557,1192,2.941,1193,4.317,1231,4.648,1237,2.814,1238,3.795,1241,2.657,1242,3.096,1255,3.414,1257,3.414,1303,3.744,1305,3.744,1634,4.363,1635,4.363,1636,4.363,1637,4.363,1638,4.363,1639,4.363,1640,4.363,1641,4.363]],["t/1196",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1145,6.402,1198,5.077,1227,5.653,1228,6.055,1642,8.764]],["t/1198",[23,1.297,39,1.934,51,0.946,56,2.71,59,1.021,61,2.917,64,1.116,65,2.227,66,1.191,72,0.554,73,1.054,80,1.313,81,1.195,110,1.151,114,1.934,159,1.26,175,1.861,261,1.934,299,1.954,337,2.917,429,1.678,435,1.388,484,2.017,548,2.551,560,4.294,583,2.062,673,3.293,738,3.293,1143,3.893,1145,5.544,1163,3.96,1166,3.522,1173,2.017,1175,2.421,1184,3.106,1186,2.248,1189,3.96,1190,3.63,1191,3.63,1192,2.773,1193,4.129,1230,3.357,1232,3.357,1237,2.653,1238,3.63,1241,3.816,1255,3.218,1257,3.218,1259,3.357,1304,3.761,1314,2.653,1384,2.6,1643,4.113,1644,4.113,1645,4.113,1646,4.113,1647,4.113,1648,4.113,1649,4.113,1650,3.53,1651,4.113,1652,2.462,1653,4.113]],["t/1200",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1146,6.612,1198,5.077,1227,5.653,1228,6.055,1654,8.764]],["t/1202",[23,1.339,51,0.943,59,1.046,61,1.977,64,1.152,65,2.75,66,1.229,72,0.572,73,1.088,80,1.345,81,1.224,110,1.18,148,1.442,159,1.301,175,1.921,261,1.997,299,2.017,312,1.977,337,2.988,429,1.732,435,1.433,470,0.752,548,4.798,560,4.355,673,3.374,738,3.374,1143,3.292,1146,4.842,1163,4.057,1166,3.608,1173,2.082,1175,2.499,1184,3.181,1186,2.321,1189,4.057,1190,3.718,1191,4.996,1192,2.862,1193,4.229,1231,3.013,1235,3.322,1237,2.739,1238,2.46,1241,3.908,1242,3.013,1275,2.684,1655,4.246,1656,4.246,1657,4.246,1658,4.246,1659,5.869,1660,4.246,1661,4.246,1662,4.246,1663,4.246,1664,4.246,1665,4.246]],["t/1204",[27,4.857,114,4.121,274,4.79,312,4.08,435,2.957,560,4.121,606,4.726,1147,7.152,1198,5.077,1227,5.653,1228,6.055,1666,8.764]],["t/1206",[23,1.318,51,0.955,59,1.033,61,1.945,64,1.134,65,2.723,66,1.21,72,0.563,73,1.071,80,1.328,81,1.209,110,1.165,148,1.419,159,1.28,175,1.89,261,1.965,299,1.985,312,1.945,337,2.952,429,1.705,435,1.41,470,0.74,548,2.591,560,4.324,673,3.333,738,3.333,1143,3.253,1147,5.174,1163,4.008,1166,3.565,1173,2.049,1175,2.46,1184,3.143,1186,2.284,1189,4.008,1190,3.674,1191,4.956,1192,2.817,1193,4.178,1231,2.965,1235,3.269,1237,2.695,1238,2.421,1241,3.861,1242,2.965,1275,2.641,1659,5.798,1667,4.178,1668,4.178,1669,4.178,1670,4.178,1671,4.178,1672,4.178,1673,4.178,1674,4.178,1675,4.178,1676,4.178]],["t/1208",[20,2.511,21,2.422,55,4.845,73,1.699,101,3.969,180,3.577,185,2.456,258,6.065,356,4.104,470,1.175,560,3.119,705,3.251,715,5.004,759,4.845,793,4.192,857,5.189,877,5.004,914,3.904,951,4.845,1198,3.842,1203,5.189,1330,4.113,1464,5.004,1538,4.278,1677,6.065,1678,6.632,1679,6.632,1680,5.691,1681,5.691,1682,6.632,1683,6.632,1684,6.632,1685,5.189,1686,5.691,1687,5.004,1688,6.632,1689,6.632,1690,6.632]],["t/1210",[21,4.075,23,2.705,50,1.568,174,4.686,371,4.609,809,4.159,1084,6.263,1148,7.84,1149,7.84,1691,6.469,1692,6.263]],["t/1212",[20,0.849,27,2.957,35,1.249,37,0.635,48,1.136,50,1.516,51,0.914,59,1.084,72,0.718,73,0.858,80,0.701,81,1.581,88,3.205,93,2.159,108,1.182,110,1.395,111,1.248,147,1.644,192,2.159,216,1.043,238,3.982,239,2.902,240,2.313,254,2.445,346,3.078,359,3.334,394,2.116,435,1.129,470,0.945,485,2.525,565,1.717,606,1.805,607,1.829,697,3.989,699,1.91,766,1.606,887,2.076,897,2.445,914,3.141,920,4.267,1106,2.731,1110,4.175,1153,2.116,1173,3.261,1186,1.829,1456,2.872,1478,2.872,1693,5.697,1694,3.347,1695,3.061,1696,5.335,1697,2.619,1698,3.347,1699,3.347,1700,3.061,1701,3.347,1702,5.335,1703,5.335,1704,6.652,1705,3.347,1706,4.291,1707,2.872,1708,3.347,1709,3.347,1710,3.347,1711,3.347,1712,3.347,1713,3.347,1714,4.578,1715,3.347,1716,3.347,1717,2.872,1718,3.347,1719,3.347,1720,3.347,1721,3.061,1722,3.347,1723,3.061,1724,3.061]],["t/1214",[20,1.74,21,2.506,23,2.165,51,0.867,59,1.118,64,1.862,65,3.204,66,1.987,72,0.924,73,2.31,74,2.756,80,1.438,81,1.309,110,1.261,159,2.102,312,3.195,336,4.107,337,4.198,353,4.107,435,2.315,483,3.915,1153,4.338,1163,4.338,1184,3.401,1725,6.275,1726,6.862,1727,6.862,1728,5.177,1729,4.626,1730,4.741]],["t/1216",[20,0.894,37,0.669,40,3.573,51,0.94,53,3.515,59,1.473,73,0.903,80,1.637,81,1.49,88,1.363,95,2.497,108,2.43,110,1.563,147,2.408,151,2.756,159,1.08,161,3.225,179,2.076,180,1.902,185,2.059,225,1.221,233,2.147,238,2.11,248,3.657,317,1.831,325,2.576,336,3.328,337,3.205,346,1.229,380,2.756,432,3.082,482,1.927,509,2.324,559,1.262,607,1.927,622,1.61,665,2.076,698,2.66,702,0.739,777,1.877,883,2.502,1133,1.982,1151,1.982,1156,4.195,1184,3.412,1320,3.026,1375,3.172,1550,2.878,1652,2.11,1731,2.878,1732,5.56,1733,3.225,1734,4.771,1735,3.515,1736,3.526,1737,3.026,1738,2.878,1739,3.526,1740,3.526,1741,3.225,1742,3.526,1743,3.526,1744,4.771,1745,3.526,1746,3.526,1747,3.225,1748,3.225,1749,2.878,1750,3.526]],["t/1218",[37,1.655,39,5.137,50,1.193,51,0.509,73,1.671,74,2.619,88,2.522,104,1.161,108,3.078,167,2.288,194,3.387,300,6.207,345,5.104,353,3.904,536,4.765,559,2.334,702,1.367,887,4.045,1314,6.334,1400,5.597,1652,3.904,1714,5.597,1751,5.623,1752,7.114,1753,5.964,1754,5.964,1755,6.522,1756,5.964,1757,6.522,1758,6.522,1759,6.522]],["t/1220",[20,2.581,21,3.716,93,5.356,180,5.488,394,5.249,606,4.478,766,3.985,1203,7.963,1475,6.265,1538,5.356,1760,8.303,1761,8.303,1762,8.303]],["t/1223",[3,0.937,33,0.614,35,2.006,37,0.68,39,4.474,40,1.87,48,0.704,50,1.163,51,0.919,60,1.884,72,0.279,73,0.918,80,0.435,88,1.385,95,1.299,104,0.637,106,1.355,107,2.131,108,1.265,109,0.947,110,0.381,111,2.94,112,1.043,130,2.614,147,1.104,148,0.704,167,1.256,181,3.212,183,1.949,185,0.768,187,1.028,190,0.833,191,1.09,194,1.077,213,1.338,216,2.325,225,2.966,227,1.498,230,1.738,300,4.018,327,0.874,330,3.268,346,2.747,382,1.017,387,1.017,391,1.78,470,0.838,500,1.692,559,0.742,565,1.064,571,0.691,583,1.04,622,0.947,702,0.435,738,2.486,751,2.222,762,1.472,766,0.995,767,1.104,822,1.796,823,1.308,887,1.286,964,1.221,1020,1.338,1090,1.692,1133,1.166,1151,1.166,1152,1.78,1153,1.311,1241,1.263,1263,1.692,1314,4.81,1384,1.311,1400,1.78,1473,1.565,1482,1.311,1652,1.241,1691,2.703,1728,3.568,1737,1.78,1751,5.084,1752,6.992,1753,1.897,1754,1.897,1756,5.148,1763,2.803,1764,2.074,1765,1.338,1766,2.074,1767,2.074,1768,2.074,1769,2.265,1770,2.074,1771,2.074,1772,2.074,1773,2.074,1774,2.074,1775,1.897,1776,2.311,1777,1.897,1778,4.729,1779,1.78,1780,1.623,1781,2.074,1782,2.074,1783,3.582,1784,2.074,1785,1.897,1786,2.074,1787,1.897,1788,1.472,1789,2.074,1790,2.074,1791,3.582,1792,2.074,1793,3.356,1794,1.78,1795,2.923,1796,1.897,1797,2.074,1798,1.897]],["t/1225",[3,0.669,37,1.813,40,1.693,48,0.868,50,0.783,51,0.875,59,1.346,64,0.694,72,1.316,73,2.871,80,1.629,81,1.575,88,4.359,95,2.342,100,1.052,110,1.518,129,1.115,147,2.215,148,0.868,156,1.868,180,2.309,185,2.045,232,1.929,248,2.235,286,4.637,309,1.379,346,0.891,432,1.417,470,0.758,482,1.398,565,1.312,702,0.897,883,3.038,943,1.557,996,1.929,1092,3.493,1133,2.407,1151,1.437,1156,1.929,1288,2.655,1317,1.868,1330,2.655,1375,4.102,1735,2.706,1765,6.302,1769,3.49,1799,2.194,1800,2.194,1801,2.194,1802,2.194,1803,2.194,1804,2.194,1805,2.194,1806,2.194,1807,2.194,1808,2.194,1809,2.194,1810,2.194,1811,2.194,1812,3.673,1813,2.194,1814,2.194,1815,2.087,1816,2.194,1817,2.194,1818,1.814,1819,3.673,1820,3.493,1821,2.194,1822,2.087,1823,2.194]],["t/1227",[20,1.696,37,1.27,51,0.915,59,1.09,65,2.377,72,1.194,73,2.712,74,3.56,80,1.401,81,1.276,110,1.229,233,4.073,272,5.458,298,5.739,299,3.177,435,2.257,470,1.184,702,1.401,1765,4.314,1815,5.458,1824,6.936,1825,6.688,1826,8.864,1827,6.688,1828,5.739,1829,6.688]],["t/1229",[32,2.852,37,1.055,40,3.09,51,0.913,65,1.976,66,1.609,72,1.052,73,2.645,74,3.935,191,2.922,470,0.985,519,4.857,520,7.145,521,3.945,702,1.165,766,2.668,777,2.959,1330,3.448,1376,4.35,1378,5.895,1824,7.668,1830,9.034,1831,5.084,1832,5.559,1833,5.559,1834,5.559,1835,5.559,1836,5.559,1837,5.559,1838,5.559,1839,5.559,1840,5.559,1841,3.273,1842,5.559,1843,5.559]],["t/1231",[37,1.11,51,0.936,65,2.078,72,1.09,73,2.378,74,2.348,88,4.462,101,3.5,180,4.365,248,2.367,299,2.778,370,4.04,435,1.973,470,1.036,702,1.225,823,2.135,1765,3.771,1844,5.592,1845,5.847,1846,4.772,1847,4.772,1848,4.772,1849,4.772,1850,4.772,1851,4.772,1852,4.772,1853,5.018,1854,5.018,1855,5.018,1856,5.018,1857,5.018,1858,5.018]],["t/1233",[37,1.628,51,0.89,65,2.262,72,1.155,73,2.485,74,2.556,108,2.247,130,2.618,167,3.402,248,2.576,299,3.024,469,2.752,470,1.127,702,1.334,1765,5.532,1769,4.023,1859,7.842,1860,6.365,1861,6.365,1862,6.365,1863,5.82,1864,6.365,1865,6.365,1866,5.82,1867,6.365,1868,6.365,1869,6.365,1870,6.365,1871,6.365,1872,6.365,1873,6.365,1874,6.365]],["t/1235",[51,0.919,65,2.749,72,1.311,73,2.731,74,3.106,110,1.422,470,1.37,622,4.867,702,1.621,715,5.836,912,3.435,1707,6.637,1875,7.735,1876,7.735]],["t/1237",[12,4.18,59,1.519,72,1.255,73,2.794,110,1.083,220,3.022,226,3.413,227,2.462,382,2.888,548,3.653,622,3.715,628,7.996,629,7.996,654,4.18,773,4.303,780,4.446,784,5.238,809,2.857,825,3.312,896,4.609,1129,5.387,1384,3.724,1877,8.521,1878,5.891,1879,5.891,1880,8.135,1881,5.891,1882,5.891,1883,5.891,1884,5.891,1885,5.891,1886,5.891,1887,5.055,1888,5.891,1889,5.891,1890,5.891]],["t/1239",[72,1.193,73,2.712,88,3.426,95,3.214,110,1.629,702,1.857,895,6.686,1288,5.496,1891,8.862,1892,8.862]],["t/1241",[40,3.392,51,0.97,59,0.825,65,1.799,67,2.73,72,0.984,73,2.197,74,2.032,80,1.06,81,0.965,88,3.316,95,3.406,110,1.343,112,1.473,248,2.048,256,2.228,274,2.766,353,3.029,467,1.848,470,0.896,697,2.66,702,1.06,716,5.223,1238,2.932,1288,3.139,1404,5.514,1735,3.199,1765,3.264,1893,5.514,1894,5.061,1895,5.061,1896,4.628,1897,5.061,1898,7.307,1899,4.13]],["t/1243",[37,0.666,40,3.87,51,0.963,59,0.572,65,1.248,67,1.893,72,0.746,73,1.759,74,1.41,80,0.736,81,0.67,88,2.142,95,3.653,110,0.645,112,1.022,159,1.075,167,3.532,248,1.421,256,1.545,353,2.101,433,3.574,435,1.184,467,1.282,470,0.622,584,3.012,697,1.845,702,0.736,716,5.959,738,1.845,776,4.257,1238,3.977,1600,3.012,1765,2.264,1820,2.865,1896,3.21,1899,8.855,1900,3.51,1901,3.51,1902,3.51,1903,3.51,1904,3.51,1905,3.51,1906,3.51,1907,3.51,1908,3.51,1909,3.51,1910,3.51,1911,3.51,1912,3.51,1913,3.012,1914,3.51,1915,5.541,1916,2.747,1917,3.51]],["t/1245",[37,1.171,40,2.438,51,0.944,59,1.005,65,2.191,67,3.326,72,1.13,73,2.445,74,2.476,80,1.292,81,1.176,88,2.384,95,3.044,110,1.133,112,1.795,159,1.889,167,2.944,248,3.397,256,2.714,353,3.691,467,2.252,470,1.092,697,3.241,702,1.292,716,3.755,738,3.241,768,4.825,1899,5.032,1913,5.291,1918,6.166,1919,6.166,1920,6.166]],["t/1247",[3,1.541,40,2.329,51,0.937,59,0.96,65,2.094,67,3.177,72,1.255,73,2.387,74,2.366,81,1.124,95,2.95,107,1.975,110,1.083,111,2.197,167,2.066,248,3.771,256,2.593,271,1.88,336,3.526,337,2.743,378,4.609,470,1.043,697,3.096,702,1.234,716,3.587,738,3.096,768,4.609,1288,3.653,1735,3.724,1899,4.807,1913,5.055,1921,5.891,1922,5.891,1923,5.055,1924,3.882,1925,5.387,1926,5.891]],["t/1249",[51,0.81,72,1.155,73,2.859,104,2.063,110,1.576,131,4.564,346,2.987,702,1.796]],["t/1251",[48,2.88,50,1.552,72,1.142,73,2.641,88,4.294,110,1.559,147,2.613,622,3.873,702,1.777,1751,5.471,1927,7.278,1928,8.481]],["t/1253",[37,1.483,48,2.652,51,0.765,59,1.273,72,1.052,73,2.51,92,5.706,147,2.407,185,2.892,470,1.383,589,4.007,702,1.637,769,4.391,817,3.872,825,5.508,1075,5.543,1751,5.038,1929,7.811,1930,7.811,1931,7.811]],["t/1255",[35,1.986,37,1.189,39,2.946,40,2.477,50,1.76,51,0.805,59,1.021,72,0.844,73,2.174,104,1.509,132,2.782,147,1.93,177,2.197,185,2.319,470,1.109,559,2.241,702,1.312,769,3.522,825,3.522,984,3.96,987,5.72,1065,4.901,1066,4.901,1068,6.02,1075,4.445,1751,4.04,1932,7.758,1933,7.28,1934,7.28,1935,5.728,1936,6.264,1937,5.728,1938,5.728,1939,5.112,1940,5.112]],["t/1257",[35,2.16,37,1.35,50,1.688,51,0.846,59,1.159,72,0.957,73,2.364,104,1.642,132,3.157,470,1.259,559,2.543,702,1.489,825,3.997,987,6.22,1065,5.562,1066,5.562,1068,5.044,1935,6.501,1939,7.529,1940,8.359,1941,7.109,1942,7.109]],["t/1259",[35,1.895,37,1.11,39,2.75,40,2.312,50,1.698,51,0.782,59,0.953,72,0.787,73,2.073,104,1.44,132,2.597,147,1.802,177,2.051,185,2.165,470,1.036,559,2.092,702,1.225,769,3.287,825,3.287,984,3.696,987,5.456,1065,4.575,1066,4.575,1068,5.743,1075,4.149,1445,4.575,1751,3.771,1933,6.945,1934,6.945,1937,7.401,1938,5.347,1939,4.772,1940,4.772,1943,8.093,1944,7.401,1945,5.847,1946,5.847,1947,5.847,1948,5.347,1949,5.347,1950,5.347,1951,5.347]],["t/1261",[35,1.914,37,1.127,39,2.791,40,2.347,50,1.711,51,0.787,59,0.967,72,0.799,73,2.095,104,1.455,132,2.636,147,1.829,177,2.081,185,2.198,470,1.051,559,2.123,702,1.243,769,3.337,825,3.337,984,3.752,987,5.513,1065,4.644,1066,4.644,1068,5.802,1075,4.211,1751,3.828,1933,5.093,1934,5.093,1939,6.673,1940,7.634,1944,5.427,1948,5.427,1949,5.427,1950,5.427,1951,8.555,1952,8.177,1953,5.935,1954,5.935,1955,5.935]],["t/1263",[48,2.392,50,1.678,51,0.716,59,1.148,67,4.947,72,0.949,73,2.35,95,3.327,181,4.02,429,2.874,470,1.248,702,1.476,825,3.961,987,4.75,1060,6.046,1069,6.046,1956,9.173,1957,7.045,1958,7.045,1959,9.173,1960,7.045,1961,5.316,1962,7.045,1963,7.045,1964,7.045,1965,7.045,1966,7.045]],["t/1265",[35,1.075,39,2.159,48,2.31,50,0.84,51,0.93,59,1.109,61,2.138,67,3.67,72,0.618,73,1.743,80,0.962,81,0.876,95,2.94,110,0.844,112,1.336,148,2.31,159,1.406,179,2.703,190,1.844,191,2.413,226,3.942,248,2.754,278,3.592,336,2.748,337,3.168,429,1.873,435,2.296,469,3.506,470,0.813,697,2.413,699,2.619,702,0.962,912,2.039,964,2.703,1020,2.961,1184,2.276,1516,3.592,1519,3.592,1569,5.134,1692,3.354,1967,4.591,1968,4.591,1969,4.591,1970,4.591,1971,4.591,1972,6.804,1973,4.591,1974,5.839,1975,4.591,1976,6.804,1977,3.746,1978,4.591,1979,4.591,1980,4.198,1981,4.591,1982,3.94,1983,4.591,1984,4.198,1985,4.591,1986,4.591]],["t/1267",[32,4.546,72,1.193,73,2.712,95,3.214,110,1.629,702,1.857,1987,7.727]],["t/1270",[14,5.085,37,2.114,51,0.493,72,1.499,95,3.094,147,1.946,185,3.577,271,3.554,314,2.911,317,5.91,702,1.323,1330,3.916,1988,6.314,1989,6.314,1990,6.314,1991,6.314,1992,6.314,1993,6.314]],["t/1272",[14,3.915,95,4.047,147,2.642,887,5.317,1680,7.357,1681,7.357,1994,8.573,1995,7.84,1996,8.573,1997,8.573,1998,8.573,1999,7.357]],["t/1274",[51,0.947,61,3.499,112,2.188,189,4.67,194,3.901,416,5.628,707,2.744,1564,6.132,1977,6.132,1995,6.872,2000,7.514,2001,7.514,2002,7.514,2003,7.514,2004,7.514,2005,7.514]],["t/1276",[14,5.306,37,1.849,51,0.673,72,1.402,148,2.179,177,2.25,216,2.688,327,4.389,346,2.236,370,5.958,470,1.136,491,7.02,702,1.344,769,3.607,2006,6.416,2007,6.416,2008,6.416,2009,6.416,2010,6.416,2011,6.416,2012,6.416,2013,5.868,2014,6.416,2015,5.868]],["t/1278",[14,5.136,37,1.722,51,0.808,72,1.324,101,3.351,108,1.977,148,3.079,177,2.754,309,4.235,327,4.143,346,1.951,370,7.153,470,0.992,491,6.627,702,1.173,730,3.868,769,3.148,943,3.41,1133,3.148,2013,5.12,2015,5.12,2016,5.599,2017,5.599,2018,5.599,2019,5.599,2020,5.599,2021,5.599,2022,5.599,2023,5.599,2024,9.068,2025,5.12]],["t/1280",[14,4.739,51,0.81,72,1.155,148,2.911,309,4.624,470,1.518,702,1.796,780,4.686,784,4.82,2026,10.377,2027,8.573]],["t/1282",[14,5.312,37,1.513,51,0.774,72,1.336,84,3.747,148,2.706,216,2.484,327,3.359,346,2.776,470,1.411,702,1.67,2028,7.969,2029,7.969,2030,7.969,2031,7.969]],["t/1284",[14,5.391,37,1.812,50,1.128,51,0.655,72,1.443,101,3.691,177,2.163,216,2.617,327,4.022,346,3.569,370,4.261,401,3.573,470,1.092,491,4.157,702,1.292,717,5.759,1133,3.467,2025,5.639,2032,6.166,2033,6.166,2034,6.166,2035,6.166,2036,6.166,2037,6.166,2038,6.166]],["t/1286",[14,5.182,37,1.528,51,0.779,72,1.344,148,2.733,216,2.51,327,3.393,346,2.805,470,1.426,607,5.457,702,1.687,2039,8.05,2040,8.05,2041,8.05]],["t/1288",[14,5.145,33,2.919,37,1.498,51,0.77,72,1.328,148,2.679,216,2.459,327,3.325,346,2.749,398,3.91,470,1.397,702,1.653,2042,7.889,2043,7.889,2044,7.889,2045,7.889]],["t/1290",[14,5.2,37,1.544,51,0.784,72,1.353,148,2.761,216,2.535,327,3.428,470,1.44,702,1.704,817,4.98,2046,8.133,2047,8.133,2048,8.133]],["t/1292",[14,5.182,37,1.896,51,0.779,72,1.344,150,4.739,216,2.51,325,5.881,327,3.393,470,1.426,702,1.687,2049,8.05,2050,8.05,2051,8.05,2052,8.05]],["t/1294",[14,5.055,37,1.427,50,1.375,51,0.746,72,1.288,185,2.782,216,2.343,325,5.489,327,3.167,358,5.669,454,4.424,455,6.093,470,1.331,503,6.132,702,1.574,2053,6.872,2054,7.514,2055,7.514,2056,7.514,2057,6.448]],["t/1296",[14,4.73,37,0.955,51,0.926,61,4.626,72,1.151,110,0.924,128,2.493,131,3.872,132,2.233,147,2.633,190,2.02,216,2.268,220,2.58,225,1.741,253,2.493,256,2.213,327,3.066,387,3.566,470,0.891,484,2.466,546,4.315,674,4.599,694,3.794,702,1.054,867,4.104,912,2.233,962,3.935,1238,2.914,2058,4.315,2059,5.029,2060,5.029,2061,8.546,2062,4.315,2063,9.364,2064,4.599,2065,7.274,2066,5.029,2067,5.029,2068,5.029,2069,5.029,2070,5.029,2071,5.029]],["t/1298",[14,4.559,33,2.383,51,0.779,72,1.084,111,3.002,129,3.512,147,2.48,148,2.733,216,2.51,355,5.784,398,3.99,442,4.739,470,1.426,562,5.427,702,1.687,2072,8.05,2073,8.05]],["t/1300",[14,4.559,33,2.383,51,0.779,72,1.084,111,3.002,129,3.512,147,2.48,148,2.733,216,2.51,398,3.99,442,4.739,470,1.426,702,1.687,2074,8.147,2075,6.569,2076,8.05,2077,8.05]],["t/1302",[14,3.833,33,1.825,51,0.883,61,2.871,72,0.83,112,1.795,147,2.586,148,2.094,194,3.202,216,1.922,328,4.825,398,3.056,401,6.209,442,4.941,470,1.092,702,1.292,848,4.261,897,4.505,914,3.63,1687,4.652,2057,5.291,2078,5.291,2079,5.032,2080,5.291,2081,9.368,2082,4.063,2083,7.676,2084,5.032,2085,5.291,2086,6.166,2087,5.639,2088,6.166,2089,5.639]],["t/1304",[14,4.383,20,0.71,33,1.367,37,1.545,39,4.229,50,0.512,51,0.894,72,1.018,95,1.016,131,1.491,132,1.244,147,2.651,148,0.951,167,2.651,177,0.983,194,2.398,216,1.44,220,1.437,253,1.389,256,2.033,311,3.878,327,1.181,398,3.388,401,5.561,442,3.469,470,1.21,484,1.373,491,1.889,548,1.737,702,1.432,823,1.023,848,3.191,897,3.374,914,2.719,1133,1.575,1444,5.388,1469,2.562,1687,3.484,2057,2.404,2058,2.404,2081,5.388,2082,3.043,2083,4.223,2084,3.769,2085,3.963,2087,2.562,2089,2.562,2090,5.056,2091,6.732,2092,2.404,2093,2.801,2094,2.801,2095,2.801,2096,2.801,2097,5.388,2098,2.801,2099,2.801,2100,5.892,2101,2.801,2102,3.963,2103,5.865,2104,2.801,2105,2.801,2106,2.801,2107,2.801,2108,4.618,2109,2.801,2110,5.892,2111,6.834,2112,2.801,2113,5.892,2114,2.801,2115,2.801,2116,2.801,2117,2.801,2118,4.618,2119,4.618,2120,2.801,2121,2.801]],["t/1306",[14,4.588,51,0.784,60,3.241,72,1.095,147,2.506,181,4.64,261,3.824,278,6.363,470,1.44,702,1.704,902,6.363,1381,6.637,2122,6.136,2123,8.133,2124,6.979,2125,8.133,2126,8.133]],["t/1308",[14,4.708,51,0.805,72,1.142,147,2.613,216,2.644,226,5.973,227,3.545,470,1.502,702,1.777,1788,6.018,2127,8.481,2128,8.481]],["t/1310",[14,5.127,50,1.792,51,0.765,72,1.052,147,2.407,181,4.457,233,4.757,470,1.383,519,3.872,702,1.637,1131,8.96,1687,5.894,2084,6.374,2129,7.143,2130,7.811,2131,7.143,2132,7.811]],["t/1312",[14,4.979,51,0.784,72,1.095,167,2.852,214,5.619,470,1.44,511,6.979,622,3.714,702,1.704,817,4.031,1067,8.622,1068,5.771,1445,6.363,1776,5.246,2133,8.133]],["t/1314",[14,4.314,51,0.908,67,3.977,72,0.993,104,1.681,177,2.586,216,2.299,435,2.488,470,1.306,702,1.545,984,5.972,987,6.369,1051,5.77,1060,6.328,1068,6.703,1069,6.328,2134,7.374,2135,7.374,2136,7.374]],["t/1316",[14,4.678,51,0.8,72,1.13,190,3.37,216,2.616,470,1.486,702,1.758,1238,4.862,2137,7.674,2138,5.798,2139,5.658,2140,7.201,2141,8.391,2142,8.391]],["t/1318",[14,4.708,48,2.88,51,0.805,72,1.142,216,2.644,355,4.914,441,5.361,470,1.502,702,1.777,2143,7.278,2144,8.481,2145,7.756,2146,8.481]],["t/1320",[14,4.708,48,2.88,51,0.805,72,1.142,139,6.399,216,2.644,355,4.914,470,1.502,702,1.777,2147,7.278,2148,8.481,2149,7.756,2150,8.481]],["t/1322",[14,4.678,51,0.863,72,1.13,110,1.542,147,3.547,233,5.11,470,1.486,702,1.758,1977,6.848,2151,8.391]],["t/1324",[14,4.719,48,3.17,51,0.807,60,4.118,72,0.975,194,3.759,216,2.257,233,4.409,470,1.282,702,1.517,848,5.002,897,5.288,914,4.261,1687,5.462,1980,6.62,2082,4.77,2084,5.907,2085,6.212,2152,7.239,2153,9.335,2154,7.239,2155,7.239,2156,7.239]],["t/1326",[14,4.42,48,2.601,51,0.828,60,3.052,61,3.567,72,1.032,175,3.465,216,2.388,327,3.229,345,5.994,398,3.797,413,5.293,470,1.357,702,1.605,1685,5.994,2157,11.147,2158,6.573,2159,7.66,2160,7.66]],["t/1328",[14,3.465,51,0.825,59,1.568,61,4.918,72,1.022,110,1.394,189,4.272,190,3.047,193,3.939,194,5.484,314,3.498,327,4.682,470,1.344,702,1.59,2161,7.586]],["t/1330",[14,3.567,37,2.131,51,0.836,59,1.597,61,4.562,72,1.052,110,1.436,189,3.469,190,3.137,193,4.056,194,5.087,314,3.602,470,1.383,702,1.637,2162,7.811]],["t/1332",[14,3.189,51,0.793,59,1.486,61,5.013,72,0.94,110,1.283,129,3.046,189,4.05,190,2.804,193,3.626,194,5.273,256,3.074,314,3.22,327,4.281,467,2.55,470,1.237,491,4.708,702,1.463,769,3.926,823,2.55,2163,6.983,2164,6.983,2165,5.269,2166,6.983]],["t/1334",[14,4.289,35,1.71,50,1.337,51,0.885,59,1.191,72,0.984,107,2.45,108,2.579,110,1.343,214,5.048,470,1.294,702,1.531,715,5.512,854,5.962,1776,4.712,1977,5.962,2167,7.306,2168,6.681,2169,7.306,2170,7.306,2171,7.306,2172,7.306,2173,7.306,2174,7.306,2175,6.681]],["t/1336",[13,2.47,14,0.249,19,1.83,33,0.447,50,0.192,51,0.966,59,0.089,83,0.617,84,0.257,95,0.548,120,0.855,147,0.721,148,0.794,149,2.794,177,0.53,185,0.56,193,0.283,194,0.283,216,0.17,222,2.169,225,0.672,228,0.427,243,0.427,244,1.874,254,0.399,256,0.854,274,1.061,300,0.662,314,0.252,362,0.387,364,0.412,382,0.267,384,0.387,386,0.445,398,2.102,401,0.316,405,0.743,417,0.531,441,0.955,461,0.399,467,0.199,506,9.335,562,0.706,565,1.391,588,1.182,598,0.445,607,0.298,622,0.478,634,0.69,667,0.855,702,0.219,717,0.589,721,0.899,722,0.79,738,0.287,751,0.338,776,0.338,784,0.589,805,0.558,807,0.298,817,0.519,826,0.332,836,0.387,842,0.345,855,1.451,942,0.79,986,1.104,1022,0.445,1124,0.427,1158,0.412,1238,0.316,1275,0.955,1322,0.377,1348,0.399,1364,0.427,1375,0.598,1404,0.79,1431,0.958,1448,0.338,1482,1.227,1499,3.285,1503,0.82,1627,0.743,1685,0.427,1691,0.412,1706,0.975,1723,0.499,1734,0.468,1735,0.345,1776,2.562,1828,0.468,1916,0.427,2062,0.468,2075,0.855,2078,0.468,2079,0.855,2080,0.468,2082,0.359,2092,0.468,2138,0.724,2168,0.499,2176,1.418,2177,0.546,2178,9.657,2179,0.546,2180,0.546,2181,0.546,2182,0.546,2183,0.546,2184,0.546,2185,0.546,2186,0.546,2187,1.048,2188,0.546,2189,0.546,2190,0.546,2191,0.546,2192,0.546,2193,0.546,2194,0.546,2195,0.546,2196,0.546,2197,0.546,2198,0.468,2199,0.546,2200,0.546,2201,0.958,2202,0.546,2203,0.546,2204,0.765,2205,0.546,2206,0.546,2207,0.546,2208,1.048,2209,0.546,2210,0.546,2211,0.546,2212,0.546,2213,0.546,2214,2.212,2215,1.923,2216,0.546,2217,0.546,2218,0.546,2219,0.546,2220,0.546,2221,0.546,2222,0.546,2223,0.546,2224,0.546,2225,0.546,2226,0.546,2227,0.546,2228,0.546,2229,0.546,2230,0.546,2231,0.546,2232,0.546,2233,0.546,2234,0.546,2235,0.546,2236,0.546,2237,0.546,2238,0.546,2239,0.546,2240,0.546,2241,0.546,2242,0.546,2243,0.546,2244,0.546,2245,0.546,2246,0.546,2247,0.546,2248,0.546,2249,0.546,2250,0.546,2251,0.546,2252,1.511,2253,1.048,2254,0.546,2255,0.546,2256,3.686,2257,0.546,2258,0.546,2259,0.546,2260,1.511,2261,0.546,2262,0.546,2263,0.546,2264,0.546,2265,0.546,2266,0.546,2267,0.546,2268,0.546,2269,0.546,2270,0.468,2271,0.546,2272,0.546,2273,0.427,2274,0.546,2275,0.546,2276,0.546,2277,0.546,2278,0.546,2279,0.546,2280,1.511,2281,0.546,2282,0.546,2283,0.546,2284,0.546,2285,0.546,2286,0.546,2287,0.546,2288,0.546,2289,0.546,2290,0.546,2291,1.048,2292,0.546,2293,1.94,2294,1.048,2295,0.546,2296,0.546,2297,1.048,2298,0.546,2299,0.546,2300,1.048,2301,0.546,2302,0.427,2303,1.048,2304,0.546,2305,0.546,2306,1.048,2307,0.546,2308,0.546,2309,1.048,2310,0.546,2311,0.546,2312,1.048,2313,0.546,2314,0.499,2315,1.048,2316,0.546,2317,0.546,2318,1.048,2319,0.546,2320,0.546,2321,1.048,2322,0.546,2323,0.546,2324,1.048,2325,0.546,2326,0.546,2327,1.048,2328,0.546,2329,0.499,2330,1.048,2331,0.546,2332,0.546,2333,1.048,2334,0.546,2335,0.499,2336,1.048,2337,0.546,2338,0.546,2339,0.958,2340,0.546,2341,0.546,2342,1.048,2343,0.546,2344,0.546,2345,1.048,2346,1.048,2347,0.546,2348,0.546,2349,1.048,2350,1.048,2351,0.546,2352,0.546,2353,1.048,2354,0.546,2355,0.546,2356,1.048,2357,0.546,2358,0.546,2359,1.048,2360,0.546,2361,0.546,2362,1.048,2363,1.048,2364,0.546,2365,1.048,2366,0.546,2367,0.546,2368,3.382,2369,0.546,2370,0.499,2371,0.546,2372,0.546,2373,0.546,2374,0.546,2375,1.048,2376,0.546,2377,0.399,2378,1.048,2379,0.546,2380,0.546,2381,1.048,2382,0.546,2383,0.546,2384,1.048,2385,0.546,2386,0.499,2387,1.048,2388,0.546,2389,0.546,2390,1.048,2391,0.546,2392,0.546,2393,1.048,2394,0.546,2395,0.546,2396,1.048,2397,1.048,2398,0.546,2399,0.546,2400,1.048,2401,0.546,2402,0.546,2403,1.048,2404,0.546,2405,0.546,2406,1.048,2407,1.048,2408,0.546,2409,0.546,2410,0.546,2411,0.546,2412,0.546,2413,0.546,2414,0.546,2415,0.546,2416,0.546,2417,0.546,2418,0.546,2419,0.546,2420,0.546,2421,0.546,2422,0.546,2423,0.546,2424,0.546,2425,0.546,2426,0.546,2427,0.546,2428,0.546,2429,0.546,2430,0.546,2431,0.546,2432,0.546,2433,0.546,2434,0.546,2435,0.546,2436,0.546,2437,0.546,2438,0.546,2439,0.546,2440,0.546,2441,0.546,2442,0.546,2443,0.546,2444,0.546,2445,0.546,2446,0.546,2447,0.546,2448,0.546,2449,0.546,2450,0.546,2451,0.546,2452,0.546,2453,0.546,2454,0.546,2455,0.546,2456,0.546,2457,0.546,2458,0.546,2459,0.546,2460,0.546,2461,0.546,2462,0.546,2463,0.546,2464,0.546,2465,0.546,2466,0.546,2467,0.546,2468,0.546,2469,0.546,2470,0.546,2471,0.546,2472,0.546,2473,0.546,2474,0.546,2475,0.546,2476,0.546,2477,0.546,2478,0.546,2479,0.546,2480,0.546,2481,0.546,2482,0.546,2483,0.546,2484,0.546,2485,0.546,2486,0.546,2487,0.546,2488,0.546,2489,0.546,2490,0.546,2491,0.546,2492,0.765,2493,0.546,2494,0.546,2495,0.546,2496,0.546,2497,0.546,2498,0.445,2499,0.546,2500,0.546,2501,0.546,2502,0.546,2503,0.499,2504,0.546,2505,1.048,2506,0.546,2507,0.546,2508,1.048,2509,0.546,2510,0.546,2511,0.445,2512,0.546,2513,0.546,2514,0.546,2515,1.048,2516,0.546,2517,0.546,2518,0.427,2519,0.546,2520,0.546,2521,0.958,2522,0.546,2523,0.546,2524,0.546,2525,0.546,2526,0.546,2527,0.499,2528,0.546,2529,0.546,2530,0.499,2531,0.546,2532,0.546,2533,0.468,2534,0.546,2535,0.546,2536,0.546,2537,0.546,2538,0.546,2539,0.546,2540,0.546,2541,0.546,2542,0.546,2543,0.546,2544,0.546,2545,0.399,2546,0.546,2547,0.546,2548,0.546,2549,0.546,2550,0.546,2551,0.546,2552,0.499,2553,0.855,2554,0.387,2555,0.546,2556,0.546,2557,0.546,2558,0.546,2559,0.546,2560,0.468,2561,0.546,2562,0.546,2563,0.546,2564,0.546,2565,0.82,2566,0.546,2567,0.546,2568,0.546,2569,0.546,2570,0.546,2571,0.546,2572,0.499,2573,0.546,2574,0.546,2575,0.546,2576,0.499,2577,0.546,2578,0.546,2579,0.546,2580,0.546,2581,0.546,2582,0.499,2583,0.546,2584,0.546,2585,0.546,2586,0.546,2587,0.546,2588,0.546,2589,0.546,2590,0.546,2591,0.546,2592,0.546,2593,0.546,2594,0.499,2595,0.546,2596,0.546,2597,1.048,2598,0.546,2599,0.546,2600,0.546,2601,0.546,2602,0.546,2603,0.546,2604,0.546,2605,0.546,2606,0.546,2607,0.546,2608,0.546,2609,0.546,2610,0.546,2611,0.546,2612,0.468,2613,0.546,2614,0.546,2615,0.546,2616,0.546,2617,1.048,2618,0.546,2619,0.546,2620,0.546,2621,0.546,2622,0.546,2623,0.546,2624,0.546,2625,0.468,2626,0.546,2627,2.339,2628,0.546,2629,0.546,2630,0.546,2631,0.546,2632,0.546,2633,0.546,2634,1.048,2635,0.546,2636,0.546,2637,0.546,2638,0.546,2639,0.546,2640,0.412,2641,0.546,2642,0.546,2643,0.546,2644,0.546,2645,0.546,2646,0.546,2647,0.546,2648,0.546,2649,0.546,2650,0.546,2651,0.546,2652,0.546,2653,0.499,2654,0.499,2655,0.546,2656,0.546,2657,0.546,2658,0.546,2659,0.546,2660,0.546,2661,0.546,2662,0.499,2663,0.445]],["t/1339",[35,1.776,51,0.867,72,1.022,73,2.706,74,3.047,95,2.751,104,1.879,167,2.661,175,4.352,225,2.626,233,5.858,429,3.095,435,3.246,470,1.344,702,1.59,703,3.369]],["t/1341",[3,0.823,20,0.798,21,0.35,25,0.877,32,0.917,33,0.932,34,0.595,35,1.355,37,1.035,39,1.181,40,0.707,48,0.607,49,0.991,50,1.168,51,0.556,54,0.751,56,0.632,59,0.291,60,1.68,61,1.466,73,1.396,81,0.183,88,1.217,93,0.619,95,1.346,100,1.033,104,0.447,105,0.411,106,0.363,107,2.583,108,0.631,110,1.064,111,2.381,112,0.916,114,1.746,121,0.632,129,0.418,130,0.394,131,0.952,132,0.426,133,0.751,139,0.724,145,0.547,147,1.784,148,2.257,149,0.632,167,1.302,175,0.809,177,0.336,178,1.534,179,1.053,181,3.793,183,2.667,185,1.166,190,1.264,213,0.619,214,0.663,216,2.072,220,1.288,222,2.634,225,1.09,226,1.036,227,1.05,233,0.584,238,1.503,239,0.418,248,1.503,250,0.663,253,0.475,254,1.834,256,1.105,271,0.306,274,0.524,278,0.751,309,0.517,311,0.492,312,1.728,314,0.824,315,0.663,317,0.928,319,0.701,328,0.751,330,0.663,346,1.77,355,1.036,359,1.861,366,0.681,380,0.475,381,1.693,394,0.606,398,1.245,401,1.036,416,1.053,417,1.273,429,0.729,435,0.324,441,1.99,442,1.478,469,0.415,470,0.317,484,0.47,509,0.632,515,1.349,536,0.701,548,0.595,560,1.48,565,2.163,589,0.492,622,1.437,668,0.823,673,1.655,682,0.584,684,2.049,688,0.619,694,3.181,697,0.504,699,0.547,708,0.394,715,0.724,717,0.539,722,0.724,762,1.269,766,0.858,767,0.511,768,0.751,769,1.412,777,0.511,780,0.524,784,2.625,808,0.511,809,0.867,817,0.475,825,0.539,829,0.823,846,0.574,849,2.503,850,0.574,886,0.823,895,1.349,896,0.751,902,0.751,914,0.565,919,0.663,920,0.539,929,0.751,935,0.783,943,2.261,953,2.233,962,1.399,968,1.349,969,1.306,980,2.261,984,0.606,1020,2.394,1022,0.783,1075,1.782,1088,0.877,1089,1.205,1106,0.783,1110,1.965,1133,0.539,1166,1.412,1169,1.534,1171,1.349,1186,0.524,1194,0.823,1195,1.895,1196,0.783,1218,1.635,1225,1.349,1318,0.823,1364,0.751,1384,0.606,1387,1.153,1410,0.877,1412,1.534,1448,0.595,1464,0.724,1475,1.349,1479,1.635,1482,1.13,1483,0.877,1499,2.406,1503,0.751,1548,0.681,1681,0.823,1686,0.823,1693,1.153,1717,0.823,1724,0.877,1765,1.153,1769,0.606,1780,0.751,1788,0.681,1824,0.751,2062,0.823,2074,0.783,2091,1.399,2143,0.823,2145,0.877,2147,0.823,2149,0.877,2158,0.823,2329,0.877,2492,1.834,2503,1.635,2518,2.463,2530,1.635,2572,0.877,2576,1.635,2612,0.823,2640,0.724,2664,2.878,2665,1.788,2666,1.788,2667,1.788,2668,0.959,2669,0.959,2670,0.959,2671,0.959,2672,0.959,2673,2.511,2674,4.669,2675,0.959,2676,3.148,2677,0.959,2678,1.459,2679,0.959,2680,0.959,2681,0.959,2682,0.959,2683,0.959,2684,0.959,2685,1.635,2686,0.959,2687,0.959,2688,0.959,2689,0.959,2690,0.877,2691,0.959,2692,0.823,2693,0.959,2694,0.959,2695,0.959,2696,0.959,2697,1.459,2698,0.877,2699,0.959,2700,0.959,2701,0.783,2702,0.959,2703,3.411,2704,3.181,2705,0.823,2706,0.959,2707,0.959,2708,0.877,2709,0.959,2710,1.788,2711,2.296,2712,0.823,2713,1.788,2714,2.878,2715,2.511,2716,2.155,2717,1.635,2718,2.296,2719,2.511,2720,0.959,2721,0.959,2722,0.959,2723,0.959,2724,0.823,2725,0.959,2726,0.823,2727,1.788,2728,0.823,2729,0.959,2730,1.635,2731,1.788,2732,1.788,2733,2.296,2734,0.877,2735,0.877,2736,1.534,2737,0.959,2738,1.788,2739,1.788,2740,0.959,2741,1.788,2742,0.959,2743,0.959,2744,0.959,2745,1.635,2746,0.959,2747,0.877,2748,0.959,2749,0.959,2750,1.635,2751,0.959,2752,0.959,2753,0.823,2754,0.823,2755,1.635,2756,1.635,2757,0.877,2758,0.823,2759,0.877,2760,1.788,2761,1.788,2762,1.788,2763,0.959,2764,0.959,2765,0.823,2766,0.959,2767,1.788,2768,0.959,2769,0.959,2770,0.959,2771,0.959,2772,0.877,2773,0.681,2774,0.877,2775,0.823,2776,0.877,2777,0.877,2778,0.959,2779,0.959,2780,0.959,2781,0.959]],["t/1343",[37,1.44,48,2.576,51,0.751,59,1.722,72,1.022,80,1.59,81,1.447,110,1.394,159,2.324,175,3.432,190,3.047,225,2.626,233,4.62,315,7.298,435,2.56,470,1.344,702,1.59,2782,7.586,2783,7.586,2784,7.586,2785,7.586]],["t/1345",[51,0.934,56,4.602,72,0.94,73,1.789,107,2.341,111,2.604,121,7.095,470,1.237,697,3.671,702,1.463,1186,3.817,1731,5.699,2664,9.287,2747,6.386,2786,9.12,2787,9.12,2788,6.983,2789,9.12,2790,6.386]],["t/1347",[20,2.273,88,4.12,147,2.762,366,6.36,367,7.013,1136,8.196,1275,5.665,2773,6.36,2791,8.962]],["t/1349",[20,1.39,34,3.4,51,0.873,59,0.893,73,1.405,81,1.476,105,4.943,107,1.838,129,2.392,167,1.923,654,3.89,702,1.149,1569,5.837,1927,6.639,2792,5.482,2793,5.482,2794,8.698,2795,5.482,2796,5.482,2797,9.147,2798,5.482,2799,5.482,2800,7.737,2801,5.482,2802,5.482,2803,5.482,2804,5.482,2805,5.482,2806,5.482,2807,4.704,2808,5.482,2809,5.482,2810,5.482,2811,5.482,2812,5.482,2813,5.482]],["t/1352",[20,1.505,23,1.872,51,0.949,64,1.61,65,2.906,66,1.718,72,1.26,73,2.095,74,2.383,105,3.505,110,1.091,159,1.818,175,2.685,260,4.644,337,2.763,353,3.552,589,3.045,825,3.337,1184,2.942,1275,3.752,1557,4.843,1568,4.478,1569,4.478,1961,4.478,2794,6.673,2797,7.017,2814,4.644,2815,5.935,2816,5.935,2817,5.935,2818,5.935,2819,5.935,2820,5.935,2821,5.935]],["t/1354",[3,2.219,20,1.589,23,1.976,51,0.946,64,1.699,65,3.015,66,1.813,72,1.142,73,2.174,74,2.516,105,2.685,110,1.151,175,2.834,185,2.319,261,2.946,353,3.749,589,3.214,825,3.522,1275,3.96,1557,5.112,1568,6.401,1569,4.726,1961,4.726,2794,6.923,2814,4.901,2822,6.264,2823,6.264,2824,6.264,2825,6.264,2826,6.264]],["t/1356",[23,2.128,51,0.944,59,1.099,64,1.83,65,3.168,66,1.953,72,1.2,81,1.287,105,3.822,110,1.24,112,1.964,336,4.037,337,3.141,589,3.46,825,3.792,1275,4.264,1961,5.089,2794,5.504,2797,5.788,2814,5.278,2827,6.745,2828,6.745,2829,6.745,2830,6.745,2831,5.788,2832,6.168]],["t/1358",[23,2.263,51,0.929,59,1.169,64,1.946,65,3.298,66,2.077,72,1.25,73,1.838,74,2.881,81,1.368,110,1.318,336,4.293,337,3.34,589,3.68,825,4.033,1275,4.534,1281,6.156,1961,5.412,2814,5.613,2831,6.156,2832,6.56,2833,6.56,2834,6.56]],["t/1360",[23,1.992,51,0.952,59,1.029,64,1.713,65,3.031,66,1.828,72,1.149,73,1.618,74,2.536,81,1.204,110,1.568,112,1.838,183,2.186,189,4.29,314,2.911,589,3.239,825,3.55,1275,3.991,1961,4.764,2814,4.94,2831,5.418,2833,5.774,2834,5.774,2835,6.314,2836,6.314,2837,6.314,2838,6.314,2839,6.314,2840,6.314]],["t/1362",[3,2.105,20,2.041,48,2.733,58,5.562,60,3.208,83,5.877,88,3.112,106,3.045,132,3.575,185,2.981,253,3.99,359,4.035,361,5.712,362,5.712,363,6.074,503,8.147,842,6.311]],["t/1364",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1366",[3,1.237,20,1.764,23,1.491,37,0.898,48,1.605,50,0.865,51,0.949,58,3.267,59,0.771,62,4.057,64,1.283,66,2.013,73,1.211,80,0.991,81,0.902,84,4.277,104,1.237,107,1.585,110,1.672,111,2.593,132,2.1,166,4.396,183,1.637,356,2.201,397,2.698,405,3.355,429,3.365,432,4.571,433,5.32,436,6.223,559,1.692,704,2.37,705,2.318,707,1.727,708,1.944,916,7.543,1473,3.567,1611,4.324,2841,4.728,2842,6.954,2843,4.057,2844,4.728,2845,4.057,2846,4.728,2847,4.057,2848,4.728]],["t/1368",[3,1.465,33,1.053,35,2.301,37,1.621,50,0.651,51,0.944,58,5.426,60,2.231,61,1.657,80,0.745,81,0.679,83,2.094,84,2.633,93,2.295,104,1.232,105,1.525,106,2.118,107,1.877,108,1.977,109,1.625,110,1.273,111,2.088,112,2.016,130,3.73,148,1.208,166,3.54,174,1.945,177,1.964,183,1.232,191,1.87,225,3.139,253,1.764,317,1.847,358,2.684,362,2.525,393,2.303,405,3.973,425,2.784,429,1.452,454,4.076,455,4.012,565,1.825,591,2.903,667,2.903,688,3.612,823,1.299,842,4.964,1241,2.167,1344,3.053,1448,2.206,1599,2.903,2053,3.254,2079,2.903,2843,6.739,2845,3.053,2847,3.053,2849,3.053,2850,2.525,2851,3.558,2852,2.684,2853,3.558,2854,3.558]],["t/1370",[51,0.784,58,5.619,84,3.824,104,1.447,106,3.076,112,3.174,166,5.141,405,5.771,425,6.363,454,4.788,455,4.712,467,2.97,827,3.612,2843,6.979,2845,6.979,2847,6.979]],["t/1372",[3,2.516,20,2.151,33,1.854,50,1.146,55,6.198,60,3.834,61,2.917,110,1.151,147,1.93,193,3.252,363,4.726,366,4.445,367,4.901,393,2.576,398,3.105,414,5.112,435,2.113,529,7.758,751,7.263,759,4.576,965,4.328,1263,5.112,1347,5.112,1776,5.472,2640,6.401,2849,5.375,2855,6.264,2856,4.901,2857,5.112,2858,6.264,2859,6.264]],["t/1374",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1376",[3,1.244,20,1.771,23,1.5,35,1.113,37,0.903,48,2.372,50,0.87,51,0.934,59,0.775,64,1.29,66,2.022,67,2.565,73,1.219,80,1.911,81,1.74,104,1.243,106,1.799,107,1.595,110,1.676,111,2.605,159,1.457,177,1.668,197,3.722,227,1.988,230,2.307,356,2.215,382,3.424,397,2.714,417,4.197,559,1.702,704,2.384,705,2.332,707,2.551,708,1.956,753,6.387,1105,3.375,2860,4.756,2861,4.756,2862,4.756,2863,3.375,2864,3.722,2865,4.082,2866,4.756,2867,4.756,2868,4.756,2869,4.756,2870,4.756,2871,3.134,2872,4.082,2873,4.756,2874,4.756,2875,4.756]],["t/1378",[3,1.989,33,0.838,35,2.36,37,1.306,48,1.582,49,3.29,50,0.852,51,0.947,53,2.945,60,2.366,61,1.318,80,0.976,81,0.889,88,1.095,95,2.153,104,1.224,106,2.245,107,1.99,108,1,109,1.293,110,1.091,111,1.737,112,1.356,121,1.866,130,1.916,148,2.016,175,1.281,177,2.413,181,1.616,183,1.613,185,1.048,193,1.47,216,0.883,225,2.632,227,1.948,239,1.235,248,1.146,317,1.47,327,1.194,346,0.987,363,2.136,382,3.728,387,2.284,393,3.127,413,1.956,417,1.436,559,1.013,565,3.045,583,1.419,708,1.164,751,5.361,757,0.974,771,2.069,776,1.756,793,1.79,823,1.034,850,1.695,912,1.258,953,3.306,1499,1.616,1571,2.589,2138,1.956,2850,2.009,2857,2.311,2863,2.009,2864,3.646,2865,2.43,2871,1.866,2872,2.43,2876,2.589,2877,4.261,2878,2.589,2879,2.831,2880,2.216,2881,2.216,2882,2.216,2883,2.43,2884,2.589,2885,2.831,2886,2.589,2887,2.831,2888,2.589,2889,2.589,2890,2.589,2891,2.589,2892,2.43]],["t/1380",[37,1.326,51,0.872,80,1.463,81,1.332,95,2.533,104,1.243,106,2.642,110,1.283,112,2.957,183,3.157,382,3.424,387,3.424,467,2.55,751,4.331,757,2.402,827,3.101,912,3.101,1499,3.984,2863,4.955,2864,5.464,2865,5.993,2871,4.602,2872,5.993,2877,6.386,2884,6.386,2889,6.386,2891,6.386,2892,5.993]],["t/1382",[3,2.242,4,6.709,20,2.174,50,1.568,60,3.417,148,2.911,149,5.65,330,7.711,441,5.42,2893,7.357,2894,8.573,2895,8.573]],["t/1384",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1386",[3,2.15,20,2.084,23,1.886,35,1.4,48,2.03,50,1.094,51,0.933,64,1.622,66,2.38,73,1.532,80,1.253,81,1.141,104,1.462,106,2.262,107,2.005,109,2.731,110,1.099,248,2.42,319,6.004,356,2.784,397,3.412,559,2.139,704,2.997,705,2.932,707,3.001,708,2.459,912,3.65,1151,3.362,2857,4.88,2896,5.98,2897,5.98,2898,8.219,2899,8.219,2900,5.98]],["t/1388",[3,2.184,33,1.811,35,1.955,51,0.943,80,1.282,81,1.167,104,1.691,106,3.158,107,2.051,108,2.16,109,2.794,110,1.125,111,2.282,112,1.781,130,3.434,190,2.457,225,2.89,231,2.849,319,6.1,330,4.228,387,3,823,2.234,912,3.708,1731,4.993,2901,6.118,2902,7.165,2903,5.595,2904,5.595,2905,5.595]],["t/1390",[51,0.838,104,1.613,106,3.429,112,2.639,319,6.622,467,3.31,827,4.026,2902,7.779]],["t/1392",[51,0.945,231,3.826,319,6.003,330,5.678,387,4.029,912,4.491,2176,6.003,2902,7.051,2903,7.514,2904,7.514,2905,7.514]],["t/1394",[3,2.318,20,2.247,50,1.621,181,5.056,225,3.068,274,4.844,461,6.474,760,6.288,931,7.232,2553,7.232,2906,7.605]],["t/1396",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1398",[3,1.252,20,1.779,23,1.51,33,1.417,35,1.12,37,0.909,48,1.625,50,1.52,51,0.859,60,1.907,64,1.298,66,2.031,73,1.226,104,1.248,107,1.604,108,1.689,110,0.879,147,1.474,148,1.625,149,4.623,216,2.187,223,3.306,244,2.652,274,5,356,2.228,397,2.73,398,2.372,442,2.817,470,1.243,471,3.496,483,2.73,484,2.346,559,1.712,565,3.599,704,2.399,705,2.346,707,2.562,708,1.968,951,3.496,1348,3.496,1729,4.73,1776,3.087,2082,4.623,2906,6.02,2907,4.785,2908,7.016,2909,7.016,2910,6.02,2911,4.785,2912,4.785,2913,4.106,2914,6.02,2915,3.744,2916,4.376,2917,4.376,2918,4.376,2919,3.905,2920,4.376,2921,4.785]],["t/1400",[3,1.237,33,0.854,35,2.129,37,1.458,50,1.405,51,0.944,60,3.06,80,0.604,81,0.55,95,1.046,104,1.07,106,1.789,107,2.016,108,1.669,109,1.317,110,0.869,111,2.242,112,1.377,130,3.583,147,2.902,148,2.362,183,0.998,190,1.158,214,3.267,216,1.474,223,1.992,225,3.149,239,1.258,244,3.854,274,3.802,317,1.497,346,2.874,387,1.414,461,3.455,471,2.106,484,1.414,500,3.859,565,3.084,697,1.516,704,1.445,751,1.788,823,1.053,842,2.989,964,1.697,980,3.661,1348,2.106,1776,1.86,1793,3.355,2082,1.9,2545,2.106,2850,4.266,2906,2.474,2910,5.159,2913,4.058,2914,4.058,2916,2.637,2917,2.637,2918,2.637,2919,2.353,2920,2.637,2922,4.324,2923,6.955,2924,2.883,2925,4.324,2926,2.883,2927,2.474,2928,4.324,2929,2.883,2930,2.256]],["t/1402",[51,0.923,104,1.312,106,2.789,112,2.75,183,2.553,387,3.615,467,2.693,827,3.275,1793,5.233,2892,6.328,2910,6.328,2913,6.328,2914,6.328,2922,6.743,2925,6.743,2928,6.743,2931,7.374,2932,6.743,2933,7.374,2934,7.374,2935,7.374,2936,7.374]],["t/1404",[3,2.406,20,1.228,35,1.134,37,0.92,44,3.329,48,1.645,49,3.923,50,1.295,59,0.789,64,1.314,100,1.992,104,1.259,110,0.89,129,2.113,130,1.992,132,2.151,146,3.347,147,2.577,175,2.191,213,3.124,216,2.608,224,3.437,225,1.677,256,2.132,312,3.296,317,2.515,346,1.688,357,6.117,361,3.437,382,2.375,392,3.437,429,1.976,470,0.858,484,2.375,717,5.173,757,1.666,760,3.437,793,3.062,1074,3.266,1153,4.475,1238,2.806,1344,4.157,1448,3.004,1535,4.157,1548,3.437,1916,3.79,2082,3.192,2498,3.953,2553,3.953,2612,4.157,2937,7.713,2938,4.844,2939,4.43,2940,4.844,2941,4.844,2942,4.844,2943,5.341]],["t/1406",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1408",[3,1.529,20,2.052,23,1.844,35,1.369,37,1.11,48,1.985,50,1.07,51,0.901,59,0.953,64,1.586,66,2.343,73,1.498,80,1.225,81,1.115,104,1.44,216,1.823,356,2.722,357,3.388,382,2.867,397,3.336,484,2.867,518,4.149,559,2.092,704,2.931,705,2.867,707,2.955,708,2.405,912,2.597,2871,3.853,2919,4.772,2937,4.412,2943,4.412,2944,5.847,2945,5.847,2946,5.018,2947,5.456,2948,5.347,2949,4.575,2950,4.772,2951,4.412,2952,4.271,2953,4.575,2954,6.945]],["t/1410",[3,1.399,33,0.724,35,2.302,37,1.679,40,0.967,49,1.356,50,0.978,51,0.949,59,0.399,72,0.329,80,0.864,81,0.787,104,0.951,106,1.56,107,2.105,108,0.864,109,1.117,110,0.758,111,1.538,112,0.712,130,1.696,147,1.271,167,0.858,175,1.107,177,1.446,183,1.428,185,0.906,214,1.69,216,1.667,220,1.255,225,3.404,227,1.023,238,3.201,346,2.818,357,4.686,382,3.078,392,1.736,393,2.883,401,1.417,435,1.804,518,2.927,597,1.914,708,1.006,712,2.558,717,4.777,757,0.841,772,1.612,805,1.302,823,0.893,912,1.086,986,1.787,1001,1.996,1418,2.099,1788,1.736,2554,1.736,2850,3.794,2871,2.718,2881,1.914,2882,1.914,2915,1.914,2919,1.996,2937,6.898,2943,1.846,2947,4.233,2948,2.237,2949,1.914,2950,1.996,2951,1.846,2952,1.787,2953,1.914,2954,6.523,2955,2.446,2956,2.099,2957,2.099,2958,2.237,2959,2.237,2960,2.099,2961,3.112,2962,2.237,2963,2.237,2964,2.237,2965,2.099,2966,1.996,2967,2.237,2968,2.237,2969,2.237,2970,2.099]],["t/1412",[51,0.876,104,1.39,148,2.652,381,5.266,382,3.83,467,2.852,827,3.469,912,3.469,2726,6.703,2871,5.147,2943,5.894,2947,5.266,2949,6.112,2950,6.374,2951,5.894,2952,5.706,2953,6.112,2954,6.703,2971,7.143,2972,7.811]],["t/1414",[51,0.896,357,5.313,1499,5.232,2176,6.699,2937,6.919,2971,8.386]],["t/1416",[50,1.586,51,0.875,64,2.352,757,4.097,1119,6.782,1120,7.073,2946,7.438]],["t/1418",[3,1.917,20,0.987,35,0.911,50,0.712,51,0.469,55,2.842,88,1.504,95,2.177,100,2.469,104,1.068,147,3.203,148,1.321,179,2.29,181,3.425,185,2.715,220,3.761,224,4.26,225,2.538,239,2.619,256,4.317,309,2.098,317,3.806,380,1.928,387,2.943,442,2.29,506,3.339,521,2.761,559,1.392,565,3.08,607,2.127,622,2.742,699,2.22,808,2.071,809,1.887,883,2.761,912,1.728,929,3.044,931,3.175,951,2.842,969,2.842,984,4.634,996,2.935,1072,3.044,1185,3.175,1198,2.254,1238,2.254,1348,2.842,1399,3.558,1692,2.842,1776,2.509,1916,3.044,2215,2.761,2492,2.842,2511,7.68,2521,3.558,2708,3.558,2711,3.558,2714,3.558,2728,3.339,2881,3.044,2973,3.89,2974,7.331,2975,3.89,2976,3.89,2977,3.89,2978,3.89,2979,3.89,2980,3.89,2981,3.339,2982,3.89,2983,3.89,2984,3.89,2985,3.89,2986,3.89,2987,3.558,2988,3.89,2989,3.89,2990,3.89,2991,3.89,2992,3.89,2993,3.339,2994,3.339]],["t/1420",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1422",[3,1.859,20,2.34,23,2.242,35,1.664,48,2.414,50,1.3,51,0.915,59,1.159,64,1.929,66,2.671,73,1.821,104,1.642,356,3.31,397,4.056,559,2.543,704,3.563,705,3.485,707,3.369,708,2.924,2995,7.109,2996,7.109,2997,7.109,2998,6.1]],["t/1424",[3,1.787,33,1.367,35,2.105,51,0.913,59,1.326,80,1.705,81,1.552,93,2.978,95,1.675,104,1.447,106,2.585,107,2.728,108,2.872,109,2.109,110,1.653,111,1.722,112,1.344,130,2.81,147,3.29,148,1.568,185,1.71,214,4.722,224,3.277,225,3.113,256,3.957,565,3.506,682,2.812,823,1.686,912,2.051,1923,3.963,2511,7.338,2728,6.981,2994,5.864,2998,3.963,2999,6.249,3000,4.618]],["t/1426",[51,0.931,59,1.248,80,2.028,81,1.846,104,1.363,107,3.245,110,1.779,467,2.797,827,3.402,2994,6.573,2998,6.573,2999,7.005,3001,7.66,3002,7.005,3003,7.005]],["t/1428",[51,0.919,256,3.945,912,3.98,2176,6.547,2511,7.314,3002,8.196,3004,8.962]],["t/1430",[3,2.768,20,2.247,167,3.108,346,3.088,484,4.345,686,8.857,717,5.951]],["t/1432",[3,2.172,37,1.932,51,0.794,72,1.37,104,1.477,105,3.56,110,1.526,703,3.688,1387,5.356,2701,6.776,2930,6.497,3005,8.303,3006,7.125,3007,8.303]],["t/1434",[3,1.154,20,1.675,23,1.392,37,1.254,50,1.208,51,0.919,59,1.077,64,1.197,66,1.912,73,1.13,80,1.384,81,1.26,104,0.785,110,1.214,112,1.284,131,2.348,132,1.959,159,1.351,167,1.547,175,1.996,177,3.302,216,1.375,223,3.048,231,2.054,239,2.882,253,2.187,254,3.223,346,2.301,356,2.054,435,2.672,469,1.908,483,3.769,537,4.687,559,1.578,686,6.196,704,2.211,705,2.163,707,1.611,708,1.814,717,3.714,808,3.516,1387,4.261,1473,3.328,1475,3.328,1735,2.789,1741,4.034,1924,2.907,1982,3.786,2701,5.39,3006,5.668,3008,4.411,3009,4.034,3010,4.034,3011,4.034,3012,6.04,3013,4.034,3014,4.034,3015,4.411,3016,4.034]],["t/1436",[3,1.706,33,1.284,35,2.041,37,1.864,48,2.215,49,2.405,50,0.794,51,0.931,59,1.063,80,0.909,81,0.828,104,1.395,106,2.468,107,1.455,108,2.768,109,1.981,110,0.797,111,1.618,112,1.263,130,2.683,139,3.274,174,2.372,175,1.963,177,3.573,225,3.018,256,1.91,327,1.829,401,2.514,414,3.541,441,4.956,483,2.476,504,3.395,686,5.105,717,4.902,823,1.584,1463,3.541,2701,5.324,2943,3.274,3006,3.723,3009,3.968,3010,3.968,3011,7.169,3012,3.968,3017,3.723,3018,3.968,3019,4.339,3020,4.339,3021,3.968,3022,3.968,3023,4.339]],["t/1438",[51,0.867,104,1.509,106,3.208,112,2.469,177,2.975,467,3.097,504,6.637,827,3.767,3017,7.278,3018,7.756,3021,7.756,3022,7.756,3024,8.481]],["t/1440",[3,1.734,37,1.259,48,2.252,50,1.213,51,0.773,104,1.18,109,3.029,111,2.473,167,2.326,177,2.326,231,3.088,259,5.691,470,1.175,504,6.897,537,4.706,717,5.566,1225,5.004,1384,4.192,1387,4.278,1543,5.691,2690,6.065,2937,6.651,2943,5.004,2946,5.691,2947,4.471,2949,5.189,2965,5.691,3013,6.065,3014,6.065,3017,5.691,3025,6.065,3026,6.632,3027,6.632,3028,6.632,3029,6.632]],["t/1442",[3,2.371,20,2.299,50,1.658,225,3.138,760,6.432,919,6.264,920,5.096,2545,6.622,3030,8.29]],["t/1444",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1446",[3,2.219,20,2.151,23,1.976,35,1.466,40,2.477,48,2.127,50,1.552,51,0.902,64,1.699,66,2.456,73,1.605,104,1.509,132,2.782,356,2.917,397,3.574,484,3.071,559,2.241,699,3.574,704,3.14,705,3.071,707,3.098,708,2.576,3030,5.728,3031,6.264,3032,8.484,3033,8.484,3034,6.264,3035,5.728,3036,6.264,3037,6.264,3038,6.264,3039,5.728,3040,6.264]],["t/1448",[51,0.912,60,3.492,185,3.245,467,3.2,3041,8.764,3042,8.764,3043,8.764,3044,8.764,3045,8.764]],["t/1450",[3,1.984,33,2.246,51,0.895,104,1.879,130,3.12,166,6.081,583,4.822,639,8.797,823,2.77,919,6.647,920,5.408,3035,8.797,3039,8.797]],["t/1452",[104,1.776]],["t/1454",[3,2.172,20,2.106,60,3.309,192,5.356,356,3.866,398,4.116,622,3.792,699,4.738,751,5.15,766,3.985,886,7.125,1448,5.15,2518,6.497,3046,8.303,3047,7.125,3048,8.303,3049,8.303]],["t/1456",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1458",[3,1.444,20,1.972,23,1.741,35,1.292,48,1.874,50,1.01,51,0.927,59,1.267,60,3.098,64,1.498,66,2.251,73,1.414,80,1.629,81,1.483,104,1.383,110,1.429,111,2.059,148,2.64,159,2.382,336,4.653,337,3.62,356,2.57,397,3.15,559,1.975,704,2.767,705,2.707,707,2.839,708,2.27,2518,6.083,2697,4.505,3050,5.52,3051,5.52,3052,7.11,3053,5.52,3054,7.775,3055,5.52,3056,5.52]],["t/1460",[3,1.843,33,1.425,35,1.127,49,3.906,50,1.525,51,0.913,80,1.009,81,0.918,104,1.483,106,2.666,107,2.363,108,1.7,109,2.199,110,0.885,111,1.795,112,1.402,130,2.898,147,2.171,225,1.667,327,3.513,346,1.677,359,3.532,461,3.517,501,3.632,751,4.37,771,5.148,823,1.758,943,2.932,965,3.327,1350,5.751,1378,3.632,1482,4.455,1500,3.929,1616,4.403,2518,7.178,2697,8.324,2698,6.444,2850,3.416,3047,4.131,3057,4.814,3058,4.814,3059,4.814,3060,4.814,3061,4.403,3062,4.814,3063,4.814,3064,4.814]],["t/1462",[51,0.838,104,1.613,106,3.429,112,2.639,183,3.138,467,3.31,827,4.026,2697,7.398]],["t/1464",[3,2.043,20,1.981,40,3.089,64,2.119,66,2.261,88,3.02,145,4.457,185,3.628,355,4.526,505,5.266,622,3.567,936,6.374,1072,6.112,1288,4.844,1751,5.038,2082,5.147,2545,5.706,2880,6.112,3065,7.143,3066,7.143,3067,7.811,3068,7.143]],["t/1466",[72,1.311,105,4.173,175,4.404]],["t/1468",[3,1.341,20,1.87,23,1.617,40,2.027,50,1.349,51,0.887,59,0.836,64,1.391,66,2.135,73,1.313,80,1.074,81,0.978,110,0.942,150,3.018,159,1.571,312,2.387,356,2.387,378,4.011,387,2.513,456,5.086,467,2.693,559,1.834,704,2.57,705,2.513,707,1.872,708,2.108,764,4.399,912,3.837,920,2.882,1184,2.541,2140,8.591,2165,3.868,2545,3.745,3065,6.745,3068,4.688,3069,5.127,3070,5.127,3071,5.127,3072,5.127,3073,5.127,3074,5.127,3075,5.127,3076,5.127,3077,5.127,3078,5.127,3079,7.376,3080,7.376,3081,5.127,3082,5.127,3083,5.127,3084,5.127,3085,5.127]],["t/1470",[3,2.501,33,2.225,35,1.759,51,0.912,80,1.574,81,1.433,104,1.871,106,3.617,107,2.519,108,2.653,109,3.432,110,1.381,111,2.802,112,2.188,130,3.932,225,2.601,823,2.744]],["t/1472",[51,0.849,104,1.651,106,3.509,112,2.701,467,3.388,827,4.12]],["t/1474",[3,2.76,14,3.029,20,1.682,35,1.552,48,2.252,50,1.213,84,3.119,109,3.029,132,2.945,147,3.051,220,3.402,244,3.675,261,3.119,307,4.582,314,3.058,484,3.251,518,4.706,751,4.113,793,4.192,914,3.904,1225,5.004,1542,6.065,1751,4.278,2765,5.691,3086,9.649,3087,6.632,3088,6.632,3089,5.691,3090,7.564,3091,6.632,3092,6.632,3093,6.632]],["t/1476",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1478",[3,1.859,20,2.34,23,2.242,35,1.664,39,3.343,48,2.414,50,1.3,51,0.877,64,1.929,66,2.671,73,1.821,104,1.642,314,3.278,356,3.31,397,4.056,559,2.543,704,3.563,705,3.485,707,3.369,708,2.924,3090,7.917,3094,7.109,3095,7.109,3096,7.109]],["t/1480",[3,1.827,33,1.408,35,2.274,37,1.572,39,3.285,40,1.881,51,0.943,60,1.895,80,0.997,81,0.907,88,1.839,104,1.473,106,2.642,107,1.595,108,1.679,109,2.172,110,0.874,111,1.774,112,2.033,130,3.404,148,1.615,216,1.483,225,3.516,300,3.007,314,3.221,470,0.842,500,3.882,751,4.332,823,1.737,985,4.35,1162,3.882,1163,3.007,1721,4.35,1776,3.068,2138,3.287,2736,4.082,2864,5.465,3086,7.569,3090,4.082,3097,7.827,3098,4.756,3099,4.35]],["t/1482",[39,3.989,51,0.867,104,1.509,106,3.208,112,2.469,300,5.361,314,3.911,467,3.097,827,3.767,2138,5.86,2864,6.637,3099,7.756,3100,8.481]],["t/1484",[3,1.947,20,1.888,39,3.5,40,3.758,51,0.742,100,3.061,111,2.776,145,4.247,181,4.247,216,2.321,225,2.577,239,3.247,314,3.432,346,2.593,441,4.705,716,4.533,808,3.963,1173,3.649,1314,4.801,1476,6.807,1751,4.801,1769,4.705,1841,4.382,2772,6.807,3097,6.388,3101,7.443]],["t/1486",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1488",[3,1.518,20,2.042,21,3.376,23,1.831,48,1.971,50,1.691,51,0.847,64,1.575,66,2.331,73,1.487,100,2.387,104,1.433,111,2.164,132,2.578,249,3.312,356,2.702,397,3.312,519,2.877,559,2.077,704,2.909,705,2.846,707,2.12,708,2.387,738,3.051,832,5.308,848,4.01,919,4.01,980,3.535,1175,3.417,1473,4.379,1652,4.819,1728,4.379,1763,4.542,1793,4.119,1798,5.308,3102,4.24,3103,8.052,3104,8.052,3105,5.308,3106,5.804,3107,4.981,3108,5.308,3109,5.804]],["t/1490",[21,1.848,23,1.596,39,4.033,51,0.905,64,1.373,65,2.597,66,1.465,72,0.682,73,1.297,74,2.032,95,1.836,111,1.887,156,3.697,244,4.05,261,2.38,299,2.404,314,3.369,467,2.669,773,3.697,1074,3.412,1175,5.864,1262,5.963,1275,3.199,1277,5.718,1314,4.714,1652,4.374,1717,4.343,1728,3.819,1752,6.999,1763,3.96,2082,4.816,3102,3.697,3107,4.343,3108,4.628,3110,5.061,3111,5.061,3112,4.628,3113,5.061,3114,4.343,3115,5.061,3116,5.514,3117,5.061,3118,5.061,3119,5.061,3120,6.271,3121,5.061,3122,5.061,3123,5.061]],["t/1492",[23,2.489,51,0.923,64,2.14,65,3.504,66,2.284,72,1.062,73,2.021,74,3.168,299,3.748,1199,7.214,1201,7.214,1652,4.722,3102,5.763,3116,5.952,3124,6.438,3125,7.889]],["t/1494",[23,2.44,51,0.919,64,2.099,65,3.461,66,2.239,72,1.042,73,1.982,74,3.106,299,3.674,1205,7.073,1206,7.073,1652,4.63,1779,6.637,3102,5.651,3116,5.836,3124,6.312,3126,7.735,3127,7.735]],["t/1496",[23,2.489,51,0.923,64,2.14,65,3.504,66,2.284,72,1.062,73,2.021,74,3.168,299,3.748,1209,7.214,1210,7.214,1652,4.722,3102,5.763,3116,5.952,3124,6.438,3128,7.889]],["t/1498",[21,2.852,23,2.464,51,0.921,64,2.119,65,3.482,66,2.261,72,1.052,73,2.001,74,3.137,299,3.711,1214,7.143,1652,4.675,3102,5.706,3116,5.894,3124,6.374,3129,7.811,3130,7.811]],["t/1500",[21,2.362,23,2.041,50,1.183,51,0.938,64,1.755,65,3.081,66,1.873,67,3.489,72,0.871,73,1.657,74,2.598,108,2.284,112,1.883,156,4.726,189,3.85,256,2.847,299,3.073,812,3.691,1288,4.012,1564,5.279,1652,3.872,3102,4.726,3116,4.881,3131,6.469,3132,6.469,3133,6.469,3134,6.469,3135,6.469,3136,6.469,3137,8.67,3138,6.469]],["t/1502",[3,1.434,21,1.265,33,1.623,35,2.28,37,1.469,39,4.217,40,1.37,50,1.245,51,0.954,60,2.185,80,0.726,81,0.661,104,1.211,106,2.074,107,1.838,108,1.223,109,1.582,110,1.008,111,1.292,112,1.596,119,2.336,130,3.182,131,1.844,132,1.539,148,1.862,174,1.894,181,1.977,183,1.199,185,2.03,190,1.391,216,1.709,225,3.251,244,1.92,346,2.371,355,2.007,387,1.698,398,1.717,575,2.336,713,3.168,730,2.394,738,2.882,751,2.148,823,1.265,964,2.039,1162,2.827,1277,2.711,1314,4.389,1652,3.282,1728,4.137,1751,2.235,1763,2.711,1769,2.19,1776,2.235,1785,3.168,1787,3.168,1793,3.891,1794,2.973,3097,4.705,3105,3.168,3107,2.973,3120,4.705,3139,3.464,3140,3.464,3141,3.464,3142,3.168,3143,3.464]],["t/1504",[51,0.889,104,1.447,106,3.076,112,2.925,183,2.815,387,3.987,467,2.97,738,4.275,827,3.612,1652,4.868,1728,6.136,1763,6.363,1793,5.771,3120,6.979,3142,7.437]],["t/1506",[3,2.371,73,2.323,148,3.078,185,3.357,216,2.826,760,6.432,986,6.622,1137,7.398,3144,9.065]],["t/1508",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1510",[23,2.37,51,0.927,59,1.225,64,2.039,65,3.398,66,2.175,72,1.012,73,1.925,74,3.018,80,1.574,81,1.433,110,1.381,159,2.302,353,4.498,453,5.88,456,4.424,469,3.249,1729,5.066,3145,7.514,3146,7.514]],["t/1512",[3,1.201,12,1.974,13,5.502,14,1.27,33,0.824,35,2.549,37,1.939,51,0.942,53,1.758,94,2.387,104,1.043,106,1.737,107,2.282,108,0.982,109,1.27,112,0.81,130,1.888,174,1.521,183,2.03,190,1.117,225,3.803,274,4.432,325,2.032,346,3.794,387,2.251,461,2.032,551,2.387,565,1.427,598,2.27,708,1.144,823,1.016,912,1.235,913,2.27,943,2.796,1499,3.345,1691,2.099,1776,1.794,2552,2.544,2553,5.553,2554,1.974,2653,2.544,2654,2.544,3147,4.199,3148,4.199,3149,2.544,3150,4.199,3151,4.199,3152,4.591,3153,4.591,3154,4.591,3155,4.591,3156,4.591,3157,5.361,3158,2.782,3159,2.782,3160,2.544,3161,2.544,3162,2.544,3163,2.544,3164,2.544,3165,2.544,3166,2.544,3167,2.544,3168,2.544]],["t/1514",[51,0.737,104,1.312,174,4.031,274,5.164,387,3.615,467,2.693,598,6.018,827,3.275,912,3.275,943,5.753,2582,6.743,3147,6.743,3148,6.743,3149,6.743,3150,6.743,3151,6.743,3157,6.743,3160,6.743,3161,6.743,3162,6.743,3163,6.743,3164,6.743,3165,6.743,3166,6.743,3167,6.743,3168,6.743]],["t/1516",[3,1.81,20,1.755,51,0.708,147,2.133,148,2.35,177,2.428,180,3.733,317,3.594,417,3.51,470,1.226,515,5.223,565,3.551,607,3.784,622,3.161,914,4.075,943,4.216,1133,3.892,1177,5.223,1412,5.94,1472,5.649,2736,5.94,2880,7.095,3169,7.781,3170,6.922,3171,6.922,3172,6.33,3173,5.94,3174,6.922,3175,6.922,3176,6.922,3177,6.922,3178,5.649,3179,6.922]],["t/1518",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1520",[3,2.149,20,2.564,23,2.592,50,1.503,51,0.789,64,2.229,66,2.927,73,2.105,356,3.826,559,2.94,704,4.119,705,4.029,707,3.001,708,3.379,3180,8.217]],["t/1522",[3181,9.98]],["t/1524",[51,0.926,243,7.175,2863,6.507,3182,9.17,3183,8.386]],["t/1526",[3,1.871,33,1.108,35,2.264,37,1.106,51,0.932,59,0.61,60,2.322,80,0.784,81,0.714,95,1.358,104,1.273,106,2.204,107,1.255,108,2.85,109,2.661,110,0.688,111,1.396,112,1.09,121,3.84,130,2.942,147,1.153,148,2.97,167,1.313,177,3.068,185,1.386,224,2.656,225,3.348,227,1.565,243,5.598,254,2.734,256,1.647,274,2.046,359,1.876,393,1.539,694,2.824,757,2.46,777,1.993,793,3.683,823,1.367,849,2.524,898,6.139,980,2.28,1105,2.656,1227,2.414,1387,2.414,1499,2.136,1599,3.055,1622,2.929,2863,2.656,2882,2.929,2930,2.929,3169,7.95,3184,5.328,3185,5.328,3186,3.423,3187,3.212,3188,5.328,3189,3.743,3190,5.826]],["t/1528",[3,1.283,27,3.959,37,0.931,50,0.897,51,0.928,59,0.799,80,1.028,81,0.935,95,1.779,104,0.873,106,1.855,107,1.644,109,2.24,110,1.548,112,2.694,147,1.511,177,1.72,185,1.816,216,2.227,224,3.48,243,3.837,256,3.144,361,3.48,386,5.829,467,1.791,757,1.687,827,3.741,885,5.589,898,4.208,1105,3.48,1499,2.798,1685,5.589,1692,3.583,2165,5.389,2863,3.48,3003,4.485,3169,4.208,3184,4.485,3185,4.485,3186,6.532,3187,4.208,3188,4.485,3191,4.904,3192,8.424,3193,8.424,3194,4.904,3195,4.485,3196,4.485,3197,4.904]],["t/1530",[3,2.427,83,5.462,132,4.12,177,3.815,358,7,712,5.754]],["t/1532",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1534",[0,4.862,3,1.008,20,0.977,23,1.215,37,0.731,51,0.932,59,0.971,64,1.045,65,2.118,66,1.115,72,0.802,73,0.987,74,1.547,80,0.807,81,1.137,83,3.508,107,1.292,110,1.339,111,1.437,112,1.122,130,2.45,159,1.18,177,3.109,180,3.929,183,1.334,194,2,220,1.976,248,1.559,312,1.794,353,2.306,359,1.931,363,5.497,364,2.907,456,4.289,467,1.407,469,1.666,470,1.055,484,1.889,583,1.931,699,2.198,717,3.35,766,1.849,912,1.711,1151,2.166,1729,4.912,2122,2.907,2852,2.907,2947,2.597,3198,3.306,3199,3.306,3200,3.306,3201,3.306,3202,5.449,3203,5.449,3204,5.449,3205,3.523,3206,3.306,3207,3.306,3208,5.113,3209,3.306,3210,3.306,3211,3.306,3212,5.449,3213,3.523,3214,3.523,3215,3.523,3216,3.306,3217,5.958,3218,3.523,3219,3.306,3220,3.853,3221,3.523,3222,3.853,3223,3.853,3224,3.853]],["t/1536",[23,1.009,37,0.977,50,0.585,51,0.95,59,1.205,64,0.868,65,1.828,66,0.926,67,1.725,72,0.869,73,0.819,74,1.284,80,1.352,81,1.546,83,5.75,104,0.569,106,1.21,107,1.725,108,1.129,110,1.672,111,1.918,112,0.931,159,0.98,177,1.122,183,1.781,191,1.681,231,2.395,329,2.61,353,1.914,359,1.603,378,2.502,453,2.502,456,3.799,464,2.744,467,1.168,665,1.883,697,1.681,699,3.682,717,2.892,912,1.42,1345,2.925,1376,2.502,1482,2.022,1729,2.156,2724,2.744,2852,2.413,2947,2.156,3198,2.744,3199,2.744,3200,2.744,3201,2.744,3202,5.901,3203,5.901,3204,5.901,3205,2.925,3206,2.744,3207,2.744,3208,4.414,3209,2.744,3210,2.744,3211,2.744,3212,2.925,3213,2.925,3214,2.925,3215,2.925,3216,4.414,3218,4.704,3219,4.414,3225,5.144,3226,3.198,3227,5.144,3228,3.198,3229,3.198,3230,3.198,3231,3.198,3232,2.925,3233,3.198,3234,3.198,3235,3.198,3236,3.198,3237,3.198,3238,3.198,3239,3.198]],["t/1538",[23,1.415,37,0.852,51,0.955,59,1.304,64,1.217,65,2.377,66,1.299,72,0.604,73,1.149,74,1.802,80,1.676,81,1.526,83,5.219,107,1.504,110,1.629,111,1.673,112,1.306,148,1.523,159,1.374,177,2.805,183,1.553,353,2.685,359,2.249,405,3.184,406,3.511,453,3.511,456,3.938,464,3.85,537,4.747,565,2.302,697,2.358,699,3.817,912,1.993,1729,3.025,2176,3.278,3198,3.85,3199,3.85,3200,3.85,3201,3.85,3206,3.85,3207,3.85,3208,5.74,3209,3.85,3210,3.85,3211,3.85,3216,3.85,3219,3.85,3240,6.689,3241,6.689,3242,4.487,3243,4.487,3244,4.487]],["t/1540",[3,1.588,33,1.169,35,2.216,37,1.702,48,1.341,50,1.354,51,0.935,53,3.839,59,0.99,104,1.317,105,1.693,106,2.297,107,2.036,108,2.933,109,1.803,112,1.768,130,3.687,147,1.217,148,1.341,177,3.32,225,3.277,238,3.635,346,2.578,357,3.518,359,4.164,361,4.309,362,2.802,379,4.956,380,3.01,381,4.094,382,1.936,392,2.802,393,1.624,401,2.288,402,3.389,403,3.611,404,5.211,405,2.802,406,3.09,597,3.09,708,1.624,823,1.442,2947,4.094,2956,3.389,2957,3.389,2958,3.611,2959,3.611,2960,3.389,3245,3.949,3246,3.949]],["t/1542",[51,0.934,59,1.614,80,1.847,81,1.681,104,1.18,110,1.82,148,2.252,177,2.326,180,3.577,189,3.915,286,4.278,357,3.842,379,5.412,381,4.471,382,3.251,392,4.706,404,5.691,406,5.189,467,2.422,827,2.945,2947,4.471,3247,6.632,3248,6.632,3249,6.632,3250,6.632]],["t/1544",[3,2.506,20,1.576,35,1.975,44,3.968,50,1.753,64,1.686,100,2.556,129,2.711,147,1.915,180,4.551,213,4.009,256,2.735,300,3.929,312,2.894,317,3.227,356,2.894,455,3.601,470,1.101,484,4.137,563,3.494,665,3.659,699,3.546,757,2.137,760,4.41,779,2.421,793,3.929,887,3.854,931,5.072,953,5.988,1074,4.19,1153,3.929,1448,3.854,1548,4.41,2758,5.333,2881,4.863,3251,6.215,3252,6.215,3253,5.683,3254,6.215,3255,6.215]],["t/1546",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1548",[3,1.454,20,1.981,23,1.754,35,1.301,37,1.055,48,1.888,50,1.017,51,0.928,59,0.906,64,1.508,66,2.262,73,1.424,80,1.893,81,1.723,104,1.39,106,2.103,107,1.864,110,1.66,222,3.945,230,2.696,356,2.588,382,2.726,397,3.172,559,1.989,704,2.787,705,2.726,707,2.853,708,2.286,757,1.912,1008,3.273,1105,3.945,1222,4.061,2138,3.841,2703,4.061,2871,3.663,3256,5.559,3257,5.559,3258,4.771,3259,5.559,3260,4.771,3261,5.559,3262,5.559]],["t/1550",[50,1.128,51,0.883,56,4.063,147,2.586,181,3.518,213,3.977,230,2.991,249,3.518,382,4.115,470,1.092,509,4.063,512,7.676,769,3.467,771,4.505,841,5.032,887,3.824,895,6.333,1071,4.505,1105,4.375,1222,4.505,1607,7.676,2138,4.261,3258,5.291,3263,5.291,3264,8.727,3265,6.166,3266,5.291,3267,6.166,3268,6.166,3269,6.166,3270,7.676,3271,8.394,3272,8.394,3273,6.166]],["t/1552",[3,1.898,33,0.917,35,2.323,37,0.952,48,1.702,49,1.717,50,1.155,51,0.951,53,1.958,59,0.505,60,1.234,80,1.323,81,1.205,104,1.124,105,1.328,106,1.896,107,2.118,108,1.094,109,1.415,110,1.161,111,2.355,112,0.902,121,2.041,128,2.485,129,1.351,130,2.062,147,2.236,175,1.401,177,1.086,183,1.736,190,1.244,216,1.563,220,1.589,225,1.072,227,1.295,253,1.536,254,2.263,259,4.302,364,3.783,382,2.458,393,2.985,417,1.571,442,1.824,470,0.549,484,1.519,565,1.589,575,2.089,757,1.724,766,1.487,784,1.742,793,3.169,823,1.831,850,1.854,912,1.376,942,2.337,953,4.481,964,1.824,1037,2.658,1788,2.198,2122,2.337,2138,3.464,2140,4.302,2370,2.833,2703,3.663,2856,3.923,2863,2.198,2871,3.304,2878,2.833,2881,2.424,2882,2.424,2930,2.424,3260,4.302,3263,2.658,3264,2.833,3266,4.302,3270,2.833,3274,3.098,3275,3.098,3276,2.833,3277,2.833,3278,2.833,3279,3.098,3280,3.098]],["t/1554",[37,1.35,51,0.915,59,1.159,80,1.933,81,1.76,104,1.265,110,1.696,183,3.194,382,3.485,467,2.596,827,3.157,912,3.157,942,5.364,2138,4.912,2703,5.193,2863,5.044,2871,4.685,3260,6.1,3266,6.1,3276,6.501,3277,6.501,3278,6.501,3281,7.109]],["t/1556",[50,1.586,51,0.875,64,2.352,757,4.097,1119,6.782,1120,7.073,3258,7.438]],["t/1558",[3,2.427,20,2.353,185,3.436,261,4.363,307,6.411,2122,7,3282,9.278]],["t/1560",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1562",[3,1.32,12,2.216,20,1.28,23,0.985,35,1.181,37,0.593,39,3.429,48,2.476,50,0.571,51,0.932,59,0.509,64,0.847,66,1.461,73,0.8,80,0.654,81,0.962,95,2.303,104,1.13,110,0.574,111,1.164,112,0.909,147,0.962,189,2.82,190,1.254,192,2.014,193,3.297,225,1.081,248,1.264,256,1.374,261,3.429,271,0.997,309,1.684,312,1.454,327,1.316,356,1.454,397,1.781,491,2.105,505,4.916,519,2.501,521,2.216,559,1.117,589,1.602,625,2.855,634,2.057,704,1.565,705,1.531,707,1.843,708,1.284,766,1.499,809,1.514,923,2.548,1020,2.014,1288,3.129,1299,3.686,1322,3.486,1380,2.679,1497,2.679,1619,2.855,1692,2.281,1738,2.548,1984,2.855,2678,2.548,2704,2.356,2753,2.679,3178,2.548,3283,2.855,3284,2.281,3285,3.122,3286,2.855,3287,3.122,3288,9.01,3289,2.855,3290,4.118,3291,2.855,3292,4.33,3293,3.122,3294,3.122,3295,5.449,3296,5.449,3297,3.122,3298,2.855,3299,2.855,3300,2.679,3301,3.122,3302,3.122,3303,3.122,3304,3.122,3305,3.122,3306,2.855,3307,3.122,3308,3.122,3309,3.122,3310,2.855,3311,2.855,3312,2.855,3313,3.122,3314,3.122,3315,3.122,3316,2.855,3317,3.122,3318,3.122,3319,2.679]],["t/1564",[3,1.359,33,1.538,35,2.296,37,1.736,48,1.099,51,0.936,59,0.528,80,1.088,81,1.241,95,1.174,104,1.158,106,1.965,107,2.497,108,1.834,109,1.478,110,0.595,111,1.207,112,1.512,130,3.353,147,0.998,151,1.605,183,1.121,190,1.3,193,1.681,220,1.661,225,3.165,227,1.353,253,1.605,256,1.425,261,3.834,271,1.033,327,1.365,416,1.906,417,2.634,429,1.321,505,3.502,583,1.623,688,2.088,823,1.182,887,2.008,1156,2.443,1177,2.443,1299,5.44,1322,3.589,1380,4.458,1381,2.642,1543,2.778,1692,3.795,2124,2.778,2377,2.365,2640,2.443,2678,2.642,3290,2.642,3295,4.458,3296,4.458,3299,2.96,3300,2.778,3306,2.96,3310,2.96,3311,2.96,3312,2.96,3316,2.96,3319,4.458,3320,3.237,3321,5.195,3322,2.237,3323,3.237,3324,3.237,3325,2.96,3326,3.237,3327,3.237,3328,4.751,3329,2.96,3330,3.237,3331,2.96,3332,3.237,3333,3.237,3334,3.237,3335,3.237,3336,3.237,3337,3.237]],["t/1566",[51,0.821,95,2.725,104,1.337,106,2.842,111,2.802,112,2.783,193,3.901,417,3.81,467,2.744,505,5.066,688,4.847,827,3.337,1299,5.489,1692,5.489,2124,6.448,2377,5.489,3290,6.132,3295,6.448,3296,6.448,3319,6.448,3322,5.192,3325,6.872,3328,6.872,3331,6.872]],["t/1568",[40,1.324,50,0.612,51,0.972,59,0.545,60,2.651,61,3.097,95,1.214,147,2.855,148,2.577,150,3.916,151,1.659,186,2.731,193,2.77,248,1.355,249,1.91,307,2.313,314,1.543,331,2.872,401,3.091,417,1.697,589,1.717,607,1.829,688,2.159,717,2.999,722,2.525,779,1.304,817,1.659,920,1.882,2176,2.445,2662,3.061,2678,2.731,2704,4.025,3292,2.872,3322,2.313,3338,3.347,3339,3.347,3340,3.347,3341,3.347,3342,3.347,3343,5.335,3344,3.347,3345,3.347,3346,3.347,3347,3.347,3348,3.347,3349,3.347,3350,3.347,3351,3.347,3352,6.652,3353,4.879,3354,3.347,3355,3.347,3356,3.347,3357,3.347,3358,3.347,3359,3.347,3360,3.347,3361,3.347,3362,3.347,3363,3.347,3364,3.347,3365,3.347,3366,3.347,3367,3.347,3368,3.347,3369,3.347,3370,3.347,3371,3.347,3372,3.347,3373,3.347,3374,3.347,3375,3.347,3376,3.347,3377,3.347,3378,3.347,3379,3.347,3380,3.347,3381,3.347,3382,3.347,3383,3.347,3384,3.347,3385,3.347,3386,3.347]],["t/1570",[3,2.172,20,2.106,180,4.478,192,5.356,193,4.311,588,6.497,622,3.792,877,6.265,965,5.737,1538,5.356,1700,7.593,1841,4.888,3387,10.063,3388,7.125,3389,8.303]],["t/1572",[72,1.311,105,4.173,175,4.404]],["t/1574",[3,2.319,20,1.934,23,1.694,35,1.257,48,1.824,50,0.982,51,0.884,64,1.457,66,2.207,73,1.376,104,1.357,110,0.987,149,3.539,180,2.896,192,3.464,244,2.976,356,2.501,397,3.064,456,3.161,463,3.923,559,1.921,562,3.621,665,3.161,704,2.692,705,2.633,707,2.784,708,2.209,1191,3.112,1499,3.064,1600,6.543,1730,5.268,3292,4.609,3388,8.281,3390,5.37,3391,7.625,3392,5.37,3393,7.625,3394,5.37,3395,5.37,3396,5.37,3397,5.37,3398,5.37,3399,4.911,3400,5.37,3401,5.37,3402,5.37,3403,5.37,3404,5.37]],["t/1576",[3,1.632,20,1.038,33,1.211,35,2.338,37,1.73,40,3.346,48,1.389,50,1.142,51,0.945,80,0.857,81,0.781,104,1.346,106,2.361,107,2.092,108,1.445,109,1.869,110,0.752,111,1.526,112,1.191,130,2.566,180,2.207,183,1.416,194,2.125,214,2.827,225,3.457,227,1.71,314,2.877,461,2.989,583,3.128,649,3.202,738,2.151,772,2.696,823,1.494,855,2.538,964,2.409,1143,2.099,1191,3.616,1195,3.087,1238,2.371,1480,2.989,1650,5.355,1730,2.827,2545,2.989,3387,5.707,3388,3.511,3405,5.707,3406,4.092,3407,3.742,3408,4.092,3409,3.742,3410,5.707,3411,4.092,3412,4.092,3413,5.707,3414,4.092,3415,4.092]],["t/1578",[51,0.821,104,1.337,106,2.842,112,2.188,183,2.601,467,2.744,738,3.95,827,3.337,1191,4.354,3405,6.872,3407,6.872,3409,6.872,3410,6.872,3413,6.872,3416,9.561,3417,9.561,3418,9.561,3419,9.561,3420,9.561,3421,7.514]],["t/1580",[3,1.965,20,1.906,40,2.972,64,2.039,66,2.175,88,2.905,145,4.287,185,3.54,256,3.307,505,5.066,622,3.432,667,6.132,936,6.132,1072,5.88,1288,4.66,1317,5.489,1751,4.847,2082,4.952,2880,5.88,3066,6.872,3422,9.561,3423,7.514,3424,7.514,3425,6.872,3426,6.448]],["t/1582",[72,1.311,105,4.173,175,4.404]],["t/1584",[3,1.613,20,2.129,23,1.945,35,1.965,40,2.438,48,2.094,50,1.128,51,0.863,64,1.673,66,2.43,73,1.58,104,1.493,309,3.326,314,3.87,356,2.871,397,3.518,470,1.092,559,2.206,665,5.618,697,3.241,704,3.091,705,3.023,707,3.065,708,2.536,730,4.261,1133,3.467,1241,3.755,1769,6.032,1859,5.639,3426,5.291,3427,6.166,3428,6.166,3429,6.166,3430,6.166,3431,6.166]],["t/1586",[3,2.184,20,1.552,33,1.811,35,1.955,37,1.162,51,0.936,80,1.282,81,1.167,104,1.691,106,3.158,107,2.051,108,2.16,109,2.794,110,1.125,111,2.282,112,1.781,130,3.909,220,3.139,225,2.89,314,2.821,470,1.084,484,3,730,4.228,823,2.234,1330,3.795,1480,4.47,1769,6.008,3426,5.251,3432,6.118,3433,6.118]],["t/1588",[51,0.849,104,1.651,106,3.509,112,2.701,467,3.388,827,4.12]],["t/1590",[3,2.398,20,2.326,147,2.826,565,4.704,622,4.188,1133,5.155,2492,7.891]],["t/1592",[37,1.849,51,0.76,55,2.531,59,1.261,60,3.743,72,1.312,81,1.476,104,0.616,105,3.317,147,2.894,185,3.803,190,1.391,222,2.458,226,3.177,227,1.448,317,4.877,435,1.169,536,2.531,559,1.239,622,1.582,712,3.4,769,6.228,896,4.29,914,5.278,962,2.711,1037,2.973,1057,6.88,1133,1.948,1788,2.458,1887,4.705,2137,5.014,2139,2.336,2554,2.458,2754,5.84,3434,3.464,3435,3.464,3436,8.431,3437,3.464,3438,8.589,3439,3.464,3440,3.464,3441,3.464,3442,3.464,3443,3.464,3444,2.973,3445,3.464,3446,3.464,3447,3.464,3448,3.464,3449,3.464,3450,2.973,3451,2.973,3452,3.464]],["t/1594",[3,0.584,20,0.968,23,0.704,37,0.724,48,1.697,50,1.416,51,0.945,55,1.631,59,1.18,60,2.357,64,0.606,66,1.105,73,0.572,80,1.517,81,1.381,88,0.863,110,1.622,111,2.478,112,2.57,147,1.822,148,2.008,185,1.851,189,4.147,191,1.173,220,1.958,222,4.197,226,1.293,230,1.083,239,2.58,250,1.542,253,1.106,314,2.727,317,1.981,356,1.039,384,1.584,397,1.273,417,1.132,559,1.365,622,3.534,688,1.44,699,1.273,704,1.119,705,1.094,707,0.815,708,0.918,855,1.384,867,1.821,896,1.746,937,2.041,942,2.879,964,1.314,1067,1.915,1068,1.584,1151,1.255,1173,1.094,1411,5.075,1419,2.041,1473,1.684,1475,1.684,1714,1.915,1729,1.505,1795,1.821,1974,1.915,2139,1.505,2492,3.651,2498,1.821,2554,1.584,2703,1.631,2704,1.684,2754,4.289,3438,2.041,3450,1.915,3451,1.915,3453,2.232,3454,3.816,3455,2.232,3456,2.232,3457,2.232,3458,2.232,3459,3.816,3460,3.816,3461,3.816,3462,3.816,3463,2.232,3464,2.232,3465,2.232,3466,2.232,3467,2.232,3468,2.232,3469,6.645,3470,4.998,3471,2.232,3472,2.232,3473,2.232,3474,2.232,3475,2.041,3476,2.232,3477,3.816,3478,4.998,3479,4.998,3480,4.998,3481,1.915,3482,2.232,3483,2.041,3484,2.232,3485,2.232]],["t/1596",[3,1.41,33,1.004,35,1.789,37,0.644,48,1.151,50,1.227,51,0.936,60,2.148,80,0.71,81,0.647,104,1.484,105,2.311,106,2.039,107,1.137,108,1.197,109,1.548,110,0.623,111,1.264,112,1.953,130,2.759,131,1.805,147,2.067,148,1.83,174,1.853,185,1.996,190,2.164,216,1.057,225,2.646,226,4.429,227,1.417,253,1.68,317,5.018,442,1.996,470,0.6,484,1.662,565,2.765,622,3.491,694,5.062,717,1.906,784,3.03,823,1.238,849,2.286,912,1.506,953,2.406,964,1.996,968,2.558,980,2.065,984,2.143,987,2.286,996,2.558,1051,4.217,1089,3.634,1110,5.249,1318,2.909,1441,3.1,1795,4.398,1796,4.929,2492,2.477,2730,4.929,2755,4.929,2756,4.929,2757,3.1,2758,2.909,2759,3.1,2777,4.929,3450,2.909,3451,2.909,3481,4.625,3486,3.39,3487,3.39,3488,3.39,3489,3.39,3490,3.39]],["t/1598",[51,0.815,104,1.542,106,3.279,112,3.264,226,5.022,467,3.165,827,3.849,1795,7.073,3481,7.438,3491,8.667]],["t/1600",[3,2.292,20,2.222,145,5,217,8.581,381,5.908,1445,6.857,1456,7.52,1776,5.653,1893,6.612,3492,7.52,3493,7.52]],["t/1602",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1604",[3,2.385,20,2.313,23,2.203,35,1.635,50,1.277,51,0.894,59,1.486,64,1.895,66,2.64,73,1.789,80,1.463,81,1.332,104,1.243,159,2.139,356,3.251,559,2.499,704,3.5,705,3.424,707,3.33,708,2.872,3492,5.993,3494,6.386,3495,6.386,3496,6.386,3497,6.983]],["t/1606",[3,2.117,33,1.731,35,2.173,51,0.929,80,1.696,81,1.544,104,1.651,106,3.061,107,2.713,108,2.857,109,2.67,110,1.075,111,2.18,112,1.702,129,2.551,130,3.817,145,4.618,181,3.336,183,2.024,225,3.213,823,2.135,1893,6.106,1916,6.332,3498,7.401,3499,7.401,3500,5.347,3501,4.772]],["t/1608",[51,0.826,104,1.577,106,3.352,112,2.58,183,3.068,467,3.236,827,3.936,3498,8.104,3499,8.104,3500,8.104]],["t/1610",[3,2.546,20,2.469,2139,6.563]],["t/1612",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1614",[23,1.93,51,0.943,59,1.361,64,1.66,65,2.967,66,1.771,72,0.824,73,1.568,74,2.457,80,1.749,81,1.593,110,1.535,166,3.868,175,2.768,336,3.662,337,2.849,353,3.662,456,4.915,469,2.646,1697,4.788,1749,4.993,2270,5.251,2856,4.788,3502,6.118,3503,6.118,3504,7.165,3505,5.595,3506,7.165,3507,5.595,3508,5.595,3509,5.595]],["t/1616",[3,1.956,33,1.548,35,1.751,40,2.068,51,0.932,53,3.305,104,1.554,106,1.978,107,1.753,108,1.846,109,2.388,112,1.522,130,3.592,146,3.613,166,3.305,174,2.858,175,2.365,180,2.82,190,2.1,193,2.715,194,2.715,225,2.589,231,2.434,314,2.411,346,1.822,378,4.091,470,0.926,518,3.71,738,2.748,823,1.909,912,3.322,929,4.091,1020,3.372,1583,4.781,1697,6.834,2139,5.043,2273,4.091,2856,4.091,3504,4.487,3510,4.781,3511,4.091,3512,5.228,3513,5.228,3514,5.228,3515,5.228,3516,4.781,3517,5.228,3518,5.228]],["t/1618",[51,0.849,104,1.651,467,3.388,827,4.12,2856,7.26,3516,8.484]],["t/1620",[3,2.455,20,2.381,60,3.741,309,5.063,3519,8.056,3520,9.388]],["t/1622",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1624",[3,1.734,20,2.235,23,2.092,35,1.552,37,1.259,48,2.993,49,3.675,50,1.213,51,0.9,64,1.799,66,2.552,72,0.893,73,1.699,104,1.568,110,1.219,148,2.993,356,3.088,397,3.784,559,2.373,634,4.37,704,3.324,705,3.251,707,3.219,708,2.727,1499,3.784,1752,5.412,3291,6.065,3521,6.632,3522,6.632]],["t/1626",[3,1.911,33,1.498,35,2.199,37,1.387,49,4.753,50,0.926,51,0.933,72,0.682,80,1.06,81,0.965,104,1.526,106,2.764,107,1.697,108,2.58,109,2.311,110,0.93,111,1.887,112,1.473,129,2.208,130,3.863,147,2.894,148,2.912,177,2.563,225,3.251,392,5.185,393,2.081,414,5.963,634,5.652,688,3.264,823,1.848,1151,2.845,1499,2.888,2849,4.343,2953,3.96,3519,4.343,3523,5.061]],["t/1628",[35,1.695,49,5.727,50,1.708,51,0.729,104,1.661,106,2.738,112,2.107,147,2.231,148,2.458,346,2.522,392,5.137,467,2.644,622,3.306,827,3.215,850,4.333,857,5.664,1472,5.907,2545,5.288,2927,6.212,2953,5.664,3187,6.212,3519,6.212,3524,7.239,3525,7.239,3526,6.212,3527,7.239]],["t/1630",[3,2.195,34,5.204,40,3.318,132,3.727,314,3.869,435,2.831,712,5.204,766,4.028,836,5.955,1137,6.848,1697,6.566,2663,6.848,3510,9.366,3528,8.391,3529,8.391]],["t/1632",[72,1.295,104,1.711,105,4.123,703,4.271]],["t/1634",[23,1.96,51,0.945,59,1.375,64,1.686,65,2.999,66,1.799,72,0.837,73,1.592,74,2.496,80,1.768,81,1.61,110,1.551,166,3.929,175,2.811,336,3.72,337,2.894,353,3.72,456,4.968,469,2.687,1697,4.863,1749,5.072,3504,7.241,3505,5.683,3506,7.241,3507,5.683,3508,5.683,3509,5.683,3530,6.215,3531,6.215]],["t/1636",[3,2.787,20,1.962,35,1.811,44,4.579,50,1.415,64,2.099,100,3.181,129,3.374,213,4.989,256,3.404,312,3.601,470,1.37,484,3.792,757,2.66,760,5.488,793,4.889,1074,5.215,1153,4.889,1448,4.797,1548,5.488,2961,5.836]],["t/1638",[21,1.848,33,1.498,37,1.891,59,1.623,72,1.576,81,0.965,104,0.9,107,1.697,129,4.097,177,1.775,346,1.763,393,4.096,634,3.335,703,2.248,745,6.339,770,2.805,774,2.805,775,2.805,778,2.845,779,1.971,953,3.591,1448,3.139,1680,4.343,1841,2.979,2961,8.55,3532,5.061,3533,5.061,3534,4.628,3535,5.061,3536,4.628,3537,5.061]],["t/1640",[3,1.141,20,1.661,23,1.376,35,1.021,50,0.798,51,0.961,59,0.711,64,1.184,66,1.896,73,1.118,80,0.914,81,0.832,104,0.776,110,0.802,112,2.29,159,1.337,167,2.297,177,2.759,189,4.37,216,2.042,231,2.031,346,1.52,356,2.031,382,2.139,393,2.694,432,2.418,491,2.941,559,1.561,704,2.187,705,2.139,707,2.392,708,1.794,757,1.5,776,2.706,876,3.99,1151,2.453,1448,2.706,1564,6.419,2961,7.07,3534,3.99,3538,4.363,3539,4.363,3540,4.363,3541,4.363,3542,4.363,3543,4.363,3544,4.363,3545,4.363,3546,4.363,3547,4.363,3548,4.363,3549,4.363,3550,4.363]],["t/1642",[3,0.836,33,0.947,35,2.347,37,1.797,40,1.265,49,1.772,50,0.941,51,0.935,72,0.431,104,1.148,107,2.164,111,1.193,129,1.395,130,2.116,147,0.985,167,1.122,177,1.122,183,2.234,185,1.184,186,2.61,214,2.21,216,0.997,225,3.47,227,1.337,256,1.408,346,3.636,382,2.522,393,1.315,401,1.853,402,2.744,518,2.269,565,1.641,597,2.502,606,1.725,634,3.39,708,1.315,717,4.866,757,1.769,805,1.702,823,1.168,835,4.869,897,2.336,986,2.336,1001,2.61,1788,2.269,2554,2.269,2850,3.65,2871,3.39,2882,2.502,2915,2.502,2937,5.579,2947,4.351,2949,2.502,2950,2.61,2951,2.413,2952,2.336,2956,2.744,2957,2.744,2960,2.744,2961,6.531,2962,2.925,2963,2.925,2964,2.925,2965,2.744,2966,2.61,2967,2.925,2968,2.925,2969,2.925,3526,2.744,3551,2.925,3552,2.925,3553,2.925]],["t/1644",[51,0.859,104,1.477,382,4.071,467,3.032,717,4.668,827,3.688,835,6.265,2871,5.472,2947,5.598,2952,6.066,3526,7.125,3551,7.593,3552,7.593,3553,7.593,3554,8.303]],["t/1646",[51,0.924,148,2.88,150,4.993,717,4.768,835,8.38,2176,6.196,3555,8.481,3556,8.481,3557,8.481]],["t/1648",[50,1.838,51,0.889,64,2.206,312,3.787,393,4.132,470,1.44,757,4.024,1119,6.363,1120,6.637,3558,8.133]],["t/1650",[3,2.398,20,2.326,88,3.546,109,4.933,111,3.42,2775,7.869,3559,9.17]],["t/1652",[72,1.235,80,1.921,81,1.749,105,4.631,107,3.075,1225,6.919,3560,8.386]],["t/1654",[3,1.454,20,1.981,23,1.754,50,1.017,51,0.921,59,1.273,64,1.508,65,1.976,66,2.262,72,1.052,73,2.002,74,2.233,81,1.723,95,2.834,107,1.864,109,2.539,110,1.66,142,5.399,145,3.172,147,2.784,156,4.061,159,1.703,248,2.25,299,2.641,356,2.588,470,0.985,485,4.194,559,1.989,572,5.084,704,2.787,705,2.726,707,2.03,708,2.286,2932,5.084,3284,4.061,3561,5.559,3562,5.559,3563,7.813,3564,5.559]],["t/1656",[3,1.434,20,1.39,50,1.003,59,1.261,88,2.12,105,3.317,110,1.422,128,2.717,145,3.128,151,2.717,175,2.48,185,2.03,186,4.474,187,2.717,216,2.412,222,5.49,226,5.951,238,4.631,253,2.717,329,4.474,380,4.444,381,5.216,429,3.156,435,1.85,483,3.128,509,5.098,654,3.89,769,4.349,824,3.339,1378,4.136,1707,4.704,1788,5.49,1841,3.227,2131,7.075,2775,4.704,2930,4.29,3493,6.639,3565,5.482,3566,5.482,3567,5.482,3568,5.482,3569,5.482,3570,5.013,3571,5.482,3572,5.013,3573,5.482,3574,4.704]],["t/1658",[59,1.669,72,1.379,105,4.935,226,5.934,227,4.282,3560,7.674,3575,10.242,3576,8.391]],["t/1660",[3,0.66,20,1.074,23,0.796,48,0.857,50,0.775,51,0.962,59,1.404,64,0.685,65,1.944,66,1.226,67,2.951,72,0.961,73,1.641,74,2.197,80,0.887,81,1.044,88,0.976,110,1.747,112,2.607,142,1.744,147,1.305,185,1.568,189,3.431,227,1.77,238,1.511,253,1.251,299,2.599,356,1.175,380,2.099,391,2.166,456,3.771,463,3.094,467,0.922,469,1.831,513,3.456,559,0.903,654,3.005,682,3.901,704,1.265,705,1.238,707,0.922,708,1.038,824,2.579,1828,2.166,2165,3.195,2314,2.308,2565,3.314,3196,3.873,3574,2.166,3577,2.524,3578,6.405,3579,4.235,3580,3.005,3581,2.524,3582,4.235,3583,2.524,3584,4.235,3585,2.524,3586,4.235,3587,4.235,3588,4.235,3589,4.235,3590,6.405,3591,2.524,3592,2.524,3593,2.524,3594,5.471,3595,2.524,3596,2.524,3597,2.524,3598,2.524,3599,2.308,3600,2.524,3601,2.524,3602,5.471,3603,2.524,3604,2.524,3605,2.524,3606,6.405,3607,2.524,3608,2.524,3609,2.524,3610,2.524]],["t/1663",[0,4.474,20,1.39,44,2.578,49,3.038,51,0.428,114,2.578,128,2.717,132,2.435,179,3.227,213,3.536,233,3.339,240,3.788,244,3.038,355,3.176,356,2.553,380,2.717,469,2.371,471,4.005,476,4.474,482,2.997,622,2.504,697,2.882,705,3.793,761,4.704,822,2.748,833,5.013,835,4.136,887,3.4,914,3.227,915,4.136,1090,4.474,1347,4.474,1350,4.474,1364,4.29,1459,4.29,1999,4.704,2880,4.29,3253,5.013,3511,4.29,3611,5.482,3612,5.013,3613,5.482,3614,5.482,3615,5.482,3616,5.482,3617,5.482,3618,5.482,3619,5.482,3620,5.482,3621,5.482,3622,5.013,3623,5.013,3624,5.013,3625,5.482,3626,5.482,3627,5.482,3628,5.482,3629,5.482,3630,5.482,3631,5.482,3632,5.482,3633,5.482,3634,5.482,3635,5.013,3636,5.482]],["t/1665",[20,1.516,50,1.094,60,3.743,147,2.533,174,3.269,185,2.214,248,2.42,312,2.784,469,3.554,521,4.243,675,5.131,759,4.368,771,4.368,914,4.839,919,4.132,964,4.839,965,5.679,1089,5.541,1167,5.131,1223,6.201,1413,5.468,1489,5.131,1538,3.857,1695,5.468,1733,5.468,2158,5.131,3322,5.679,3580,5.832,3612,5.468,3635,5.468,3637,8.219,3638,5.98,3639,5.468,3640,5.98,3641,5.98,3642,5.468,3643,5.98,3644,5.98,3645,5.98,3646,5.98,3647,5.98,3648,5.98]],["t/1667",[20,2.041,60,3.978,145,5.696,964,5.877,1089,6.731,1223,7.533,1538,5.192,3322,6.898,3580,7.084,3649,8.05,3650,8.05,3651,8.05,3652,8.05]],["t/1669",[20,2.041,60,3.978,145,5.696,964,5.877,1089,6.731,1223,7.533,1538,5.192,3322,6.898,3580,7.084,3653,8.05,3654,8.05,3655,8.05,3656,8.05]],["t/1671",[20,2.041,60,3.978,145,5.696,964,5.877,1089,6.731,1223,7.533,1538,5.192,2339,7.361,3322,6.898,3580,7.084,3657,8.05,3658,8.05,3659,8.05]],["t/1673",[20,2.041,60,3.978,145,5.696,964,5.877,1089,6.731,1223,7.533,1538,5.192,3322,6.898,3580,7.084,3660,8.05,3661,8.05,3662,8.05,3663,8.05]],["t/1675",[4,3.79,21,1.769,51,0.553,88,1.873,121,5.512,181,4.039,185,2.621,317,3.675,356,3.895,387,2.375,417,4.665,469,4.421,483,2.764,622,3.233,682,2.95,697,4.397,705,2.375,809,2.35,822,2.428,900,4.43,955,4.43,1090,5.777,1105,3.437,1124,5.539,1153,4.475,1217,4.43,1472,5.777,1685,5.539,2377,3.539,2685,6.473,3322,3.347,3399,4.43,3483,4.43,3580,6.945,3622,4.43,3623,4.43,3624,4.43,3642,6.473,3664,4.844,3665,4.844,3666,4.844,3667,4.844,3668,4.844,3669,4.844,3670,4.844,3671,4.844,3672,7.079,3673,7.079,3674,4.844,3675,4.844,3676,4.43,3677,4.844,3678,4.844]],["t/1678",[4,5.146,20,2.223,39,3.093,50,1.203,63,6.014,179,5.16,180,3.547,239,2.869,242,6.014,248,2.662,470,1.165,559,2.353,673,3.457,698,6.614,708,2.705,877,4.962,1151,3.697,1203,5.146,1293,5.644,1314,4.242,1320,5.644,1459,5.146,1519,5.146,2733,6.014,2765,5.644,2876,6.014,3679,8.766,3680,6.014,3681,6.577,3682,6.577,3683,6.577,3684,6.577,3685,6.577,3686,6.577,3687,6.577,3688,6.577,3689,6.577,3690,6.577]],["t/1680",[3,1.625,48,2.11,50,1.544,51,0.659,59,1.751,60,2.477,81,1.185,88,3.263,108,2.979,110,1.142,128,3.081,145,4.815,249,3.546,309,3.352,312,3.929,470,1.101,699,4.815,766,2.983,834,5.683,935,6.886,1153,5.334,1366,5.072,1818,4.41,1893,4.689,2122,4.689,2302,6.603,3061,5.683,3511,4.863,3691,5.683,3692,6.215,3693,6.215,3694,5.683,3695,6.215,3696,6.215,3697,6.215]],["t/1682",[0,3.069,20,2.354,21,2.62,39,3.374,50,1.481,51,0.849,121,2.478,167,1.319,179,4.224,192,3.772,194,3.036,213,4.628,239,2.551,371,1.67,435,1.973,470,1.271,476,3.069,483,2.146,559,2.092,575,2.536,766,1.805,835,5.414,881,6.158,915,2.838,919,2.599,951,4.272,1031,3.439,1084,2.748,1143,1.929,1196,3.069,1203,5.615,1241,2.29,1314,2.426,1330,2.332,1353,3.439,1367,2.943,1372,3.227,1384,2.377,1414,3.439,1496,5.348,1652,2.251,1687,2.838,1691,2.838,1730,2.599,1779,3.227,2750,3.439,3047,5.018,3329,3.439,3425,5.348,3580,2.669,3599,3.439,3639,3.439,3676,3.439,3698,10.289,3699,3.439,3700,5.348,3701,3.761,3702,3.439,3703,3.761,3704,3.761,3705,5.848,3706,3.761,3707,3.761,3708,3.761,3709,5.848,3710,3.761,3711,5.848,3712,3.761,3713,3.761,3714,3.761,3715,3.761,3716,3.761,3717,3.761,3718,3.761,3719,3.761,3720,3.761]],["t/1684",[20,2.286,35,2.111,51,0.835,59,1.81,73,1.758,80,1.438,81,1.309,88,2.653,104,1.221,110,1.261,132,3.048,145,5.144,175,3.104,189,3.048,233,4.179,312,3.195,381,4.626,470,1.215,707,2.506,846,5.396,1186,3.751,1384,4.338,1730,4.741,1999,5.889,3721,6.862,3722,6.862]],["t/1686",[3,2.043,20,2.485,50,1.429,56,5.147,100,3.212,114,5.035,312,3.637,560,3.673,766,3.749,1139,5.894,1140,5.894,1141,5.543,1142,6.112,1143,4.007,1144,5.894,1145,5.706,1146,5.894,1194,6.703,2215,5.543,3723,7.811]],["t/1688",[51,0.784,57,6.363,191,4.275,622,3.714,762,5.771,836,5.771,947,7.437,1475,6.136,2082,5.359,2888,7.437,3680,7.437,3724,7.437,3725,8.133,3726,8.133,3727,8.133,3728,8.133,3729,7.437,3730,8.133]],["t/1690",[20,0.927,23,1.153,27,2.027,33,1.082,51,0.966,59,1.299,64,0.992,65,2.033,66,1.059,72,0.492,73,0.937,74,3.201,80,1.477,81,1.521,95,2.556,101,2.189,110,1.59,112,1.666,180,3.086,193,3.659,261,1.72,299,1.737,394,2.311,470,1.013,505,4.751,515,2.759,606,1.972,607,1.999,622,1.67,699,2.086,766,1.755,817,4.289,823,1.335,1384,2.311,1748,3.344,1818,2.595,2498,2.984,2807,3.138,3283,3.344,3289,6.445,3290,5.751,3724,3.344,3731,3.657,3732,3.657,3733,3.657,3734,3.657,3735,3.657,3736,5.721,3737,3.657,3738,3.657,3739,3.657,3740,3.657,3741,3.657,3742,3.657,3743,3.657,3744,3.657,3745,3.657,3746,3.657,3747,3.657,3748,3.657,3749,3.657,3750,3.657,3751,3.657]],["t/1693",[3,1.626,20,2.305,23,1.284,35,1.455,48,1.382,50,1.137,51,0.885,59,1.562,64,1.104,65,2.209,66,1.179,72,0.548,73,1.043,74,1.635,80,1.58,81,1.438,88,2.915,108,1.437,110,1.551,121,2.683,145,2.323,159,2.31,187,2.018,193,3.227,194,3.227,217,5.073,223,2.813,225,1.409,248,1.648,261,1.914,299,1.934,315,4.295,429,3.076,470,1.335,483,2.323,548,2.525,575,2.745,649,3.185,699,2.323,772,2.683,823,1.487,1153,2.573,1185,3.322,1443,3.723,1622,3.185,1725,3.723,1893,3.071,1923,3.493,2302,3.185,2386,5.684,2883,3.493,2970,3.493,3492,6.471,3494,3.723,3495,3.723,3496,3.723,3752,6.216,3753,3.493,3754,4.071,3755,4.071,3756,4.071,3757,4.071,3758,4.071,3759,4.071,3760,6.216,3761,4.071]],["t/1695",[20,1.275,33,2.153,35,2.001,48,1.708,51,0.904,59,1.782,60,2.899,80,1.054,81,0.959,88,2.812,110,1.337,132,3.231,146,3.475,189,2.233,193,4.862,194,5.377,216,1.568,223,3.475,315,5.026,398,2.493,467,2.656,470,0.891,523,4.104,622,2.297,1071,3.674,1489,6.242,2204,3.674,2214,4.104,2215,3.568,2377,5.314,2726,4.315,3501,5.936,3762,7.815,3763,4.599,3764,4.599,3765,4.599,3766,5.029,3767,5.029,3768,5.029]],["t/1697",[20,1.43,33,1.67,35,1.63,48,3.091,50,0.657,51,0.915,59,1.8,60,2.247,73,0.92,81,0.685,88,3.316,104,1.003,110,1.28,112,1.642,142,2.481,145,2.048,146,2.481,175,1.624,189,3.093,191,1.887,193,2.928,194,4.453,216,1.119,223,2.481,233,3.434,261,1.688,317,1.864,355,2.08,366,2.548,367,2.809,369,3.283,372,3.283,381,2.42,435,1.211,442,4.1,467,1.311,470,0.999,509,2.366,559,1.285,622,1.64,682,3.434,705,1.76,707,1.311,762,4.002,846,2.149,877,2.709,929,4.413,982,2.93,1177,2.709,1186,1.962,1241,2.186,1372,3.081,1478,3.081,1538,2.316,1586,3.081,1730,4.812,1777,3.283,2102,3.081,2377,2.623,3493,3.081,3501,4.602,3511,2.809,3699,3.283,3762,5.157,3763,3.283,3764,3.283,3765,3.283,3769,3.59,3770,3.59,3771,3.59,3772,3.59,3773,3.59]],["t/1700",[2,5.093,20,1.505,21,2.167,23,1.872,35,1.389,50,1.496,51,0.853,64,1.61,65,2.906,66,2.367,72,0.799,73,1.521,355,5.42,470,1.051,848,4.101,914,3.494,935,4.843,1071,4.336,1186,3.244,1195,7.606,1429,5.427,1514,5.427,1535,5.093,1775,5.427,2143,5.093,2147,5.093,2734,5.427,2735,5.427,3173,5.093,3691,5.427,3774,8.177,3775,5.935,3776,5.427,3777,5.935,3778,5.427,3779,5.935,3780,5.935,3781,5.935,3782,5.935,3783,5.935,3784,5.935]],["t/1702",[48,3.853,139,7.533,179,5.877,216,3.537,317,5.184,355,6.574,441,6.311]],["t/1704",[20,2.396,49,4.087,93,4.756,108,2.603,248,2.985,501,5.564,521,5.233,705,3.615,767,3.926,771,5.387,980,4.491,1074,4.972,1173,3.615,1518,6.743,1521,6.743,1737,6.328,1769,4.661,1844,7.595,2993,6.328,3785,8.639,3786,9.532,3787,7.374]],["t/1706",[3,2.064,40,2.601,51,0.953,59,1.072,65,2.338,72,0.886,73,1.685,74,2.642,88,4.159,101,4.723,180,5.066,216,1.368,225,1.519,239,1.914,248,1.776,299,3.125,370,5.453,483,2.503,697,2.306,808,2.335,913,3.58,1841,2.583,1844,4.545,1846,5.368,1847,5.368,1848,5.368,1849,5.368,1850,5.368,1851,5.368,1852,5.368,1853,5.645,1854,5.645,1855,5.645,1856,5.645,1857,5.645,1858,5.645,2302,3.433,3788,4.387]],["t/1708",[3,1.564,40,2.365,50,1.094,51,0.945,59,1.34,65,2.125,72,0.805,73,1.532,74,2.401,80,1.722,81,1.568,88,3.91,106,2.262,110,1.511,180,4.433,248,2.42,286,3.857,298,5.131,299,2.841,370,5.679,730,4.132,1844,4.132,1846,4.88,1847,4.88,1848,4.88,1849,4.88,1850,4.88,1851,4.88,1852,4.88,2987,5.468,3789,5.98,3790,5.98]],["t/1710",[20,2.062,27,4.507,48,2.761,84,3.824,95,2.95,108,2.871,380,4.031,483,4.64,980,4.953,1987,5.359,3791,8.133,3792,7.437,3793,7.437,3794,7.437,3795,7.437,3796,7.437,3797,7.437,3798,7.437,3799,7.437]],["t/1712",[20,1.641,33,3.446,51,0.92,59,1.775,72,0.871,88,2.501,108,2.284,130,2.66,435,2.183,1863,5.916,1987,4.263,3800,7.928,3801,5.916,3802,7.928,3803,6.469,3804,5.916,3805,7.928,3806,5.916,3807,6.469,3808,5.916,3809,5.916,3810,6.469]],["t/1714",[32,4.215,72,1.107,73,2.591,84,3.864,108,2.901,151,4.073,248,4.433,380,4.073,482,4.492,702,1.722,1987,5.415,3792,7.514,3800,7.514,3811,7.514,3812,8.217]],["t/1716",[23,1.376,32,2.238,51,0.943,59,1.527,64,1.184,65,2.328,66,1.263,72,0.882,73,2.015,74,1.752,80,1.648,81,1.5,84,2.052,95,2.376,108,1.54,110,1.722,112,1.907,151,2.163,159,1.337,167,3.066,248,3.539,260,3.414,380,2.163,470,0.773,482,2.385,697,2.293,702,0.914,776,2.706,1286,3.414,1384,2.758,1841,2.568,1844,3.015,1866,5.99,1925,3.99,1987,2.875,3793,7.193,3801,3.99,3813,4.363,3814,7.865,3815,6.551,3816,4.363,3817,4.363,3818,4.363,3819,4.363,3820,4.363,3821,4.363,3822,4.363,3823,4.363,3824,4.363,3825,4.363,3826,4.363]],["t/1718",[32,4.215,72,1.107,73,2.591,84,3.864,108,2.901,151,4.073,380,4.073,482,4.492,702,1.722,1844,7.568,1987,5.415,3794,7.514,3802,7.514,3811,7.514,3827,8.217]],["t/1720",[32,3.968,72,1.042,73,2.495,84,3.637,108,2.731,151,3.834,167,3.415,248,3.131,380,3.834,482,4.228,702,1.621,1384,4.889,1841,4.553,1844,7.729,1987,5.097,3795,8.905,3804,7.073,3828,7.735]],["t/1722",[72,1.155,73,2.659,84,4.032,108,3.027,380,4.25,702,1.796,825,5.834,1932,7.84,1987,5.65,3796,7.84,3805,7.84,3829,8.573]],["t/1724",[72,1.18,73,2.694,84,4.121,108,3.094,380,4.344,702,1.836,1987,5.775,3797,8.014,3806,8.014,3830,8.764,3831,8.764]],["t/1726",[72,1.18,73,2.694,84,4.121,108,3.094,380,4.344,702,1.836,1877,8.014,1987,5.775,3798,8.014,3808,8.014,3832,8.764]],["t/1728",[23,1.465,40,3.228,50,0.85,51,0.89,59,0.757,64,1.26,65,2.439,66,1.345,72,0.924,73,2.74,84,2.184,108,1.64,110,0.854,112,1.352,121,3.061,151,2.302,159,1.423,175,3.105,228,3.634,248,2.778,260,3.634,380,2.302,429,1.895,463,3.393,470,0.823,519,2.302,697,2.442,702,0.973,1330,2.881,1384,2.936,1769,2.936,1824,8.369,1831,6.276,1841,2.734,1844,4.742,1987,5.379,2790,8.246,2807,3.986,3799,6.276,3809,4.247,3833,4.645,3834,4.645,3835,4.645,3836,6.863,3837,4.645,3838,4.645,3839,4.645,3840,4.645,3841,4.645,3842,4.645,3843,4.645,3844,4.645]],["t/1731",[3,0.669,37,1.813,40,1.693,48,0.868,50,0.783,51,0.875,59,1.346,64,0.694,72,1.316,73,2.871,80,1.629,81,1.575,88,4.359,95,2.342,100,1.052,110,1.518,129,1.115,147,2.215,148,0.868,156,1.868,180,2.309,185,2.045,232,1.929,248,2.235,286,4.637,309,1.379,346,0.891,432,1.417,470,0.758,482,1.398,565,1.312,702,0.897,883,3.038,943,1.557,996,1.929,1092,3.493,1133,2.407,1151,1.437,1156,1.929,1288,2.655,1317,1.868,1330,2.655,1375,4.102,1735,2.706,1765,6.302,1769,3.49,1799,2.194,1800,2.194,1801,2.194,1802,2.194,1803,2.194,1804,2.194,1805,2.194,1806,2.194,1807,2.194,1808,2.194,1809,2.194,1810,2.194,1811,2.194,1812,3.673,1813,2.194,1814,2.194,1815,2.087,1816,2.194,1817,2.194,1818,1.814,1819,3.673,1820,3.493,1821,2.194,1822,2.087,1823,2.194]],["t/1733",[37,1.545,40,3.974,51,0.866,59,1.326,80,1.705,81,1.552,93,2.978,95,1.675,110,1.495,130,1.899,147,3.096,151,2.289,159,1.415,248,4.555,249,2.635,470,0.818,510,4.223,521,4.849,606,2.49,665,2.718,704,3.426,705,2.264,712,2.864,767,2.458,777,2.458,920,3.842,923,3.768,968,3.484,1375,5.13,1376,3.613,1652,2.764,2927,3.963,2993,3.963,3052,4.223,3263,3.963,3286,4.223,3753,3.963,3785,4.223,3786,6.249,3845,4.618,3846,4.618,3847,4.618,3848,4.618,3849,4.618,3850,4.618,3851,4.618,3852,4.618]],["t/1735",[26,1.604,40,1.352,48,1.161,50,1.327,51,0.925,56,1.295,59,1.252,80,1.609,81,1.465,84,0.924,88,2.098,95,0.713,108,0.694,110,1.412,112,1.58,121,1.295,130,0.808,146,1.358,147,1.054,151,4.881,167,2.366,177,0.689,180,1.844,191,1.033,225,2.336,231,1.592,248,3.783,314,0.906,336,1.176,346,1.581,366,1.395,370,3.75,384,3.221,469,0.85,470,0.348,583,1.714,660,1.797,682,1.197,690,1.604,704,0.985,708,2.529,716,4.109,745,1.074,759,1.436,761,1.687,767,1.82,773,1.436,807,1.074,887,2.121,897,1.436,912,1.519,1362,1.687,1375,1.122,1387,5.195,1401,1.797,1436,1.797,1482,1.243,1503,1.538,1538,3.501,1550,4.429,1677,1.797,1744,1.687,1747,1.797,1765,2.206,2058,2.935,2850,1.395,2883,1.687,2951,1.483,2981,1.687,3112,1.797,3511,1.538,3776,1.797,3853,1.966,3854,1.797,3855,2.935,3856,1.604,3857,1.966,3858,3.127,3859,1.797,3860,5.427,3861,5.427,3862,1.966,3863,1.966,3864,1.966,3865,1.966,3866,5.018,3867,3.704,3868,1.966,3869,2.791,3870,3.42,3871,1.604,3872,1.797,3873,1.966,3874,3.127,3875,1.966,3876,1.966,3877,1.966,3878,1.966,3879,1.966,3880,1.966,3881,1.966,3882,1.604,3883,1.966,3884,1.966,3885,1.966,3886,1.966,3887,1.966,3888,1.966,3889,1.966,3890,3.42,3891,1.966,3892,1.966,3893,1.966,3894,1.966,3895,1.966,3896,1.966,3897,1.966,3898,1.966,3899,1.966,3900,1.966,3901,1.966,3902,1.966,3903,1.966,3904,1.966,3905,1.966,3906,1.966,3907,1.966,3908,1.966,3909,1.797,3910,1.797,3911,1.797,3912,1.797,3913,1.966,3914,1.966,3915,1.966]],["t/1737",[20,0.963,37,0.421,40,0.878,50,0.91,51,0.918,59,0.96,80,1.235,81,1.124,88,0.858,107,0.744,110,1.217,150,1.307,151,3.283,190,0.891,220,1.139,225,1.315,248,2.385,314,1.751,346,2.308,357,1.286,359,1.904,380,1.1,416,1.307,456,5.345,469,1.642,470,1.044,519,1.1,682,1.352,766,2.828,877,1.675,912,1.687,914,1.307,1074,1.496,1133,2.135,1151,1.248,1288,1.376,1347,1.811,1348,1.621,1368,2.03,1375,2.84,1387,4.272,1407,3.473,1438,3.532,1439,2.03,1499,5.18,1503,1.737,1512,2.03,1538,1.432,1729,1.496,1841,2.236,2064,2.03,2215,1.575,2302,1.737,2692,1.905,2981,1.905,3025,2.03,3178,1.811,3183,2.03,3221,2.03,3753,1.905,3882,1.811,3916,9.079,3917,2.219,3918,2.219,3919,2.219,3920,3.797,3921,2.219,3922,3.797,3923,2.219,3924,2.219,3925,2.219,3926,2.219,3927,3.797,3928,2.219,3929,2.219,3930,2.219,3931,2.219,3932,2.219,3933,2.219,3934,2.219,3935,2.219,3936,2.219,3937,2.219,3938,2.219,3939,2.219,3940,2.219,3941,2.219,3942,2.219,3943,2.219,3944,3.797,3945,2.219,3946,2.219,3947,3.797,3948,3.797,3949,2.219,3950,2.219,3951,2.219,3952,2.219,3953,2.219,3954,2.219,3955,2.219,3956,1.905,3957,3.797,3958,2.219,3959,3.473,3960,2.219,3961,2.219,3962,2.219,3963,5.892,3964,3.797,3965,4.977,3966,4.977,3967,4.977,3968,2.219,3969,4.977,3970,2.219,3971,3.797,3972,2.219,3973,2.219,3974,2.219,3975,2.219,3976,2.219,3977,2.219,3978,2.219,3979,2.219,3980,2.219,3981,2.219,3982,2.219,3983,2.219,3984,2.219,3985,2.219,3986,2.219,3987,2.219,3988,2.219,3989,2.219,3990,2.219,3991,2.219]],["t/1739",[3,2.555,20,1.4,21,2.016,40,3.559,48,2.64,50,1.01,51,0.834,56,3.638,59,1.267,60,3.098,80,1.157,81,1.483,95,2.002,106,3.404,108,3.636,110,1.429,147,2.396,148,2.64,159,1.691,192,3.561,216,1.721,239,2.408,248,2.234,253,3.854,286,3.561,336,3.304,337,3.62,380,2.736,470,0.978,759,4.033,953,3.917,1184,2.736,1317,4.033,1375,3.15,1765,3.561,1769,3.49,1818,3.917,1822,4.505,1824,4.32,2724,4.737]],["t/1741",[3,2.476,50,1.111,51,0.941,65,2.158,72,0.818,73,1.556,74,2.438,88,3.935,101,3.634,180,4.479,248,2.457,299,2.884,370,4.195,394,3.838,665,3.574,766,2.914,1459,4.751,1844,5.739,1846,4.955,1847,4.955,1848,4.955,1849,4.955,1850,4.955,1851,4.955,1852,4.955,1853,5.21,1854,5.21,1855,5.21,1856,5.21,1857,5.21,1858,5.21,3882,4.955,3992,6.071]],["t/1744",[20,2.015,33,1.313,37,1.259,50,1.213,51,0.842,59,1.295,73,1.699,80,0.929,81,0.846,95,2.406,104,0.789,108,2.805,110,0.815,114,4.438,129,3.846,130,1.824,132,2.946,149,2.923,159,1.359,167,1.556,181,2.531,216,1.383,225,1.536,250,4.583,256,1.953,337,2.066,346,1.546,380,2.199,429,2.706,536,5.804,560,4.146,673,5.395,688,2.861,707,1.62,736,3.471,777,2.362,836,3.148,846,2.655,962,3.471,1166,5.306,1171,6.652,1184,2.199,1185,3.62,1186,2.425,1187,4.057,1189,2.804,1190,2.57,1193,2.923,1615,4.057,2745,4.057,2776,4.057,3993,4.436,3994,4.436,3995,4.436]],["t/1746",[20,1.206,21,1.737,23,1.5,51,0.924,59,0.775,61,3.252,64,1.895,65,2.482,66,1.377,72,0.641,73,1.219,80,0.997,81,0.907,110,0.874,114,4.289,132,2.112,159,1.457,175,2.152,191,2.5,261,2.237,299,2.26,337,2.215,345,3.722,435,1.605,470,0.842,559,1.702,560,4.937,673,2.5,707,1.737,738,2.5,1071,3.475,1133,2.674,1139,3.589,1140,3.589,1141,5.873,1142,3.722,1143,4.984,1144,3.589,1145,3.475,1146,3.589,1157,4.082,1161,4.082,1166,2.674,1184,2.358,1186,2.6,1189,3.007,1190,2.756,1191,2.756,1237,3.068,1261,4.082,1293,4.082,1323,3.882,1324,4.082,1617,4.35,3570,4.35]],["t/1749",[20,0.75,27,2.677,33,2.304,34,1.835,37,1.585,44,1.391,50,1.292,51,0.936,59,1.361,64,0.803,67,1.596,72,0.65,81,0.564,84,3.322,107,1.619,110,1.43,112,1.782,167,1.038,183,1.024,189,3.457,190,1.188,239,1.291,256,2.126,311,1.518,315,2.044,346,1.683,359,4.416,371,1.314,393,1.217,398,1.467,456,2.843,463,2.161,467,2.235,469,1.279,470,0.855,476,2.414,483,1.688,559,1.059,562,1.995,697,1.555,777,1.575,784,1.663,823,2.579,969,2.161,982,2.414,1084,2.161,1153,1.87,1312,2.706,1322,2.044,1366,2.414,1482,1.87,1499,1.688,1586,2.539,1622,2.315,1631,2.706,1686,2.539,1730,2.044,1735,1.87,1982,2.539,2122,3.644,2852,2.232,3854,4.417,3996,2.959,3997,6.12,3998,4.83,3999,2.959,4000,2.959,4001,2.959,4002,2.959,4003,2.959,4004,2.959,4005,2.959,4006,2.959,4007,2.959,4008,2.959,4009,7.063,4010,2.959,4011,2.959,4012,2.959,4013,2.959,4014,2.959,4015,2.959,4016,2.959,4017,2.959,4018,2.959,4019,2.959,4020,2.959,4021,2.959,4022,2.959,4023,2.959,4024,2.959,4025,2.959,4026,2.959,4027,2.959,4028,2.959,4029,2.959,4030,2.959,4031,2.959]],["t/1751",[3,0.669,37,1.813,40,1.693,48,0.868,50,0.783,51,0.875,59,1.346,64,0.694,72,1.316,73,2.871,80,1.629,81,1.575,88,4.359,95,2.342,100,1.052,110,1.518,129,1.115,147,2.215,148,0.868,156,1.868,180,2.309,185,2.045,232,1.929,248,2.235,286,4.637,309,1.379,346,0.891,432,1.417,470,0.758,482,1.398,565,1.312,702,0.897,883,3.038,943,1.557,996,1.929,1092,3.493,1133,2.407,1151,1.437,1156,1.929,1288,2.655,1317,1.868,1330,2.655,1375,4.102,1735,2.706,1765,6.302,1769,3.49,1799,2.194,1800,2.194,1801,2.194,1802,2.194,1803,2.194,1804,2.194,1805,2.194,1806,2.194,1807,2.194,1808,2.194,1809,2.194,1810,2.194,1811,2.194,1812,3.673,1813,2.194,1814,2.194,1815,2.087,1816,2.194,1817,2.194,1818,1.814,1819,3.673,1820,3.493,1821,2.194,1822,2.087,1823,2.194]],["t/1754",[20,0.805,33,0.939,37,1.791,51,0.941,59,1.046,72,0.991,80,1.345,81,1.224,93,2.046,108,1.12,120,2.589,132,1.409,148,1.735,149,6.418,159,1.966,185,1.175,231,1.477,271,2.349,330,2.192,355,1.838,387,1.555,398,1.572,441,2.005,470,0.905,553,4.386,562,6.115,571,2.452,583,1.59,702,0.665,712,1.967,767,1.689,773,2.318,809,1.539,912,2.27,1143,1.627,1151,1.783,1158,2.394,1287,2.901,1296,2.901,1375,1.81,1618,2.394,1627,5.726,2204,2.318,2215,3.627,2533,2.722,2893,2.722,3173,6.315,4032,2.722,4033,3.172,4034,3.172,4035,3.172,4036,3.172,4037,3.172,4038,3.172,4039,3.172,4040,3.172,4041,3.172,4042,5.111,4043,5.111,4044,3.172,4045,5.111,4046,3.172,4047,3.172,4048,3.172,4049,3.172,4050,2.901,4051,6.418,4052,6.418,4053,3.172,4054,3.172,4055,3.172,4056,6.418,4057,5.111,4058,3.172,4059,3.172,4060,3.172,4061,3.172]],["t/1756",[50,1.595,51,0.946,59,1.421,72,0.878,80,1.827,81,1.663,95,2.366,151,3.233,166,4.123,167,2.288,248,2.64,271,2.082,470,1.155,571,2.173,702,1.367,716,5.98,912,2.897,3869,5.323,3871,5.323,4062,6.522,4063,5.964,4064,8.718,4065,5.964,4066,5.964,4067,5.964]],["t/1758",[51,0.77,59,1.286,72,1.062,73,2.755,80,1.653,81,1.505,110,1.812,179,4.644,216,2.459,244,4.372,271,2.518,470,1.397,571,2.629,607,4.312,702,1.653,4068,7.889,4069,7.889,4070,7.889]],["t/1760",[37,1.611,51,0.902,59,1.021,60,2.496,72,0.844,80,1.312,81,1.195,148,3.267,159,1.919,185,2.319,216,1.953,271,2,311,3.214,346,3.352,435,2.113,469,3.669,470,1.109,571,2.087,583,4.253,702,1.312,836,6.02,1841,3.688,1974,8.255,2103,5.375,2712,5.375,3475,8.797,4071,6.264,4072,8.484]],["t/1762",[33,1.963,37,1.259,51,0.934,59,1.081,60,2.643,72,0.893,80,1.39,81,1.265,148,2.252,159,2.032,185,2.456,216,2.067,232,7.471,271,2.117,311,3.402,398,5.23,470,1.175,571,2.21,702,1.39,2560,8.497,4073,6.632,4074,6.632,4075,6.632,4076,6.632,4077,6.065]],["t/1764",[37,1.804,51,0.925,59,1.213,72,1.002,80,1.56,81,1.42,110,1.368,159,2.28,271,2.376,314,3.432,470,1.318,571,2.48,702,1.56,712,4.616,722,5.616,817,3.69,912,3.306,2175,6.807,4078,7.443,4079,7.443,4080,7.443]],["t/1766",[35,1.49,50,1.164,51,0.871,59,1.581,72,0.857,80,1.334,81,1.636,95,2.308,110,1.17,114,2.993,131,3.388,159,1.95,271,2.032,309,3.433,337,2.964,389,6.085,467,3.132,470,1.127,560,2.993,571,2.121,673,3.346,702,1.334,736,4.98,920,4.821,1117,5.82,1166,4.821,1184,3.155,1190,3.688,1191,4.969,1818,4.516,4081,6.365,4082,6.365,4083,6.365]],["t/1768",[50,1.146,51,0.841,59,1.021,61,4.479,72,0.844,80,1.312,81,1.195,88,2.422,110,1.768,131,3.335,147,2.614,216,1.953,239,2.733,249,3.574,271,2,327,2.64,346,2.183,359,3.14,393,2.576,456,3.688,470,1.109,571,2.087,607,3.424,702,1.312,766,3.007,1173,3.071,1499,3.574,1693,4.04,1706,4.04,1735,5.363,1924,4.128,2165,4.726,2705,7.28,4084,6.264,4085,6.264,4086,6.264,4087,6.264]],["t/1770",[33,2.558,37,0.974,50,0.938,51,0.887,59,0.836,61,2.387,66,0.922,72,0.429,80,0.667,81,0.608,88,1.232,110,0.942,112,0.927,129,1.389,131,1.696,147,0.981,167,1.798,189,2.858,191,1.674,216,0.993,239,1.389,249,1.817,253,1.579,256,3.247,271,1.017,311,3.302,346,1.11,355,2.971,359,1.597,393,1.31,398,4.008,401,4.274,416,3.018,429,2.092,432,1.765,433,2.054,456,5.086,463,4.701,469,1.377,470,0.908,483,1.817,559,1.14,562,3.457,571,1.061,583,1.597,607,1.741,702,0.667,712,1.975,736,2.492,766,1.529,823,2.953,1084,2.327,1173,1.562,1322,3.543,1330,1.975,1339,2.599,1499,4.614,1507,2.599,1693,2.054,1706,2.054,1729,2.147,1735,5.111,1924,2.099,2074,4.184,2075,4.184,2078,4.4,2079,4.184,2080,4.4,2092,2.733,2201,2.913,2852,2.403,3114,4.4,4088,5.127,4089,3.185,4090,2.733,4091,2.733,4092,2.913,4093,2.913,4094,3.185,4095,3.185,4096,3.185,4097,2.733,4098,3.185,4099,2.733,4100,2.733,4101,3.185,4102,6.436,4103,3.185,4104,3.185,4105,3.185,4106,3.185,4107,3.185]],["t/1772",[37,0.769,50,0.741,51,0.922,59,1.225,72,0.545,80,1.575,81,1.434,111,2.309,159,1.241,167,2.952,216,1.93,225,1.402,231,1.886,271,1.293,317,3.215,346,2.157,356,1.886,357,3.587,382,4.689,435,1.366,470,1.097,501,3.056,519,2.007,571,1.349,702,0.849,717,5.769,769,2.277,772,2.669,776,2.512,807,2.214,826,3.771,1133,2.277,1151,2.277,1152,3.475,1153,2.56,1225,3.056,1618,3.056,1622,3.169,1793,2.874,1841,2.384,2640,3.056,2915,3.169,2939,3.704,2951,4.672,2952,4.523,2961,3.056,2966,5.053,2970,3.475,3016,5.662,4108,4.05,4109,4.05,4110,4.05,4111,4.05,4112,4.05,4113,4.05,4114,4.05,4115,4.05,4116,4.05,4117,4.05,4118,3.704,4119,5.662,4120,4.05,4121,4.05,4122,4.05,4123,4.05]],["t/1774",[51,0.884,59,1.09,72,0.901,80,1.401,81,1.276,110,1.229,179,3.937,271,2.135,315,4.621,394,5.603,470,1.184,521,4.746,571,2.228,607,3.656,702,1.401,766,3.21,777,3.56,823,3.237,1198,3.875,1519,5.233,1738,5.458,3882,5.458,4124,9.943,4125,6.688,4126,6.688,4127,6.688,4128,6.688,4129,6.688,4130,6.116,4131,6.688,4132,6.688]],["t/1776",[72,1.032,110,1.408,129,3.342,131,4.078,174,4.187,180,4.131,238,4.585,271,2.445,346,2.669,394,4.842,571,2.552,606,4.131,654,5.435,702,1.605,715,5.779,766,3.676,767,4.078,1198,4.438,1887,6.573,1927,8.305,2097,7.005,2663,6.251,3574,6.573,4133,7.66]],["t/1778",[33,1.548,37,1.915,40,2.068,51,0.919,59,0.852,72,0.704,80,1.095,81,0.997,107,2.929,159,1.602,167,1.834,190,2.1,216,2.332,271,1.669,346,1.822,382,2.563,432,2.898,433,3.372,435,1.764,470,0.926,571,1.742,702,1.095,717,5.9,823,1.909,986,3.82,1793,3.71,1794,4.487,2554,3.71,2952,3.82,2966,4.267,3444,4.487,4092,4.781,4118,4.781,4119,4.781,4134,5.228,4135,5.228,4136,5.228,4137,5.228,4138,5.228,4139,5.228,4140,5.228,4141,5.228,4142,5.228,4143,5.228,4144,5.228,4145,5.228,4146,5.228,4147,5.228,4148,5.228]],["t/1780",[35,1.4,37,1.783,50,1.094,51,0.876,59,0.975,72,0.805,80,1.253,81,1.141,88,2.312,110,1.511,131,3.183,159,1.832,177,3.294,187,2.964,216,1.864,225,2.07,239,2.609,249,3.412,271,1.909,346,3.272,359,2.997,393,2.459,429,2.44,432,3.314,433,5.302,470,1.059,571,1.992,607,3.269,702,1.253,717,5.28,766,2.87,1173,2.932,1693,3.857,1706,3.857,4149,5.98,4150,4.132,4151,5.98,4152,5.98]],["t/1782",[35,1.895,37,1.537,39,3.806,40,3.2,51,0.849,59,1.319,72,0.787,80,1.225,81,1.115,84,2.75,110,1.487,148,1.985,151,4.012,159,1.791,232,4.412,271,1.867,398,2.898,470,1.036,571,1.948,588,4.575,702,1.225,846,3.5,936,6.604,1371,7.574,1691,7.003,2560,5.018,2625,5.018,2915,6.332,4153,5.847,4154,5.847,4155,5.847,4156,5.847,4157,8.093,4158,9.281,4159,8.093]],["t/1784",[50,1.451,51,0.932,59,1.293,72,0.765,80,1.19,81,1.083,129,2.477,148,2.693,149,6.857,159,1.74,185,2.103,271,1.813,337,4.845,398,2.815,470,1.006,505,5.347,513,4.634,514,6.806,562,3.829,571,1.892,583,2.847,702,1.19,767,3.023,914,3.343,1087,5.193,1184,3.931,1341,5.193,1627,4.03,2204,5.794,4160,5.679,4161,9.138,4162,5.679]],["t/1786",[37,1.238,39,5.137,51,0.853,59,1.421,72,0.878,80,1.367,81,1.244,110,1.602,146,4.507,167,2.288,177,2.288,189,2.897,271,2.082,311,3.346,401,3.779,470,1.155,571,2.173,702,1.367,769,3.667,809,4.228,1198,3.779,1314,4.207,1448,4.045,1652,3.904,1924,4.298,2090,5.597,4163,6.522,4164,5.323,4165,6.522,4166,5.597,4167,5.323,4168,5.323]],["t/1788",[37,1.783,50,1.094,51,0.892,59,0.975,72,0.805,80,1.253,81,1.141,88,2.312,110,1.511,131,3.183,146,4.132,167,2.883,177,2.097,187,2.964,216,1.864,239,2.609,249,3.412,271,1.909,311,3.068,346,3.524,359,2.997,393,2.459,401,4.762,432,3.314,470,1.059,571,1.992,607,3.269,702,1.253,766,2.87,769,3.362,809,3.987,1173,2.932,1693,3.857,1706,3.857,1924,3.94,4150,4.132,4169,5.98,4170,5.98]],["t/1790",[72,1.249,107,3.111,271,2.962,571,3.091,702,1.944,3536,8.484,4171,9.278]],["t/1792",[33,2.421,37,1.776,50,1.086,51,0.874,59,0.967,72,0.799,80,1.243,81,1.132,88,2.295,110,1.503,131,3.159,147,1.829,148,2.015,159,1.818,185,2.198,216,1.85,239,2.589,249,3.386,271,1.895,311,3.045,346,2.068,359,2.975,393,2.441,432,4.532,470,1.051,571,1.977,583,2.975,607,3.244,682,3.614,702,1.243,766,2.849,770,3.289,1173,2.91,1375,3.386,1693,3.828,1706,3.828,2204,5.973,3284,4.336,3956,5.093,4150,4.101,4172,8.177,4173,5.935]],["t/1794",[72,1.207,110,1.647,147,2.762,148,3.043,166,5.665,185,3.319,271,2.861,571,2.986,702,1.878,4174,8.962]],["t/1796",[33,1.693,37,1.742,50,1.046,51,0.865,59,0.932,60,2.279,72,0.77,80,1.199,81,1.091,88,2.212,110,1.465,131,3.045,147,1.763,148,1.942,159,1.752,185,2.118,216,1.783,239,2.495,249,3.264,271,1.826,311,2.934,346,1.993,359,2.867,393,2.352,432,4.417,470,1.013,571,1.906,583,2.867,607,3.127,634,3.769,682,3.484,702,1.199,766,2.745,1173,2.804,1375,3.264,1693,3.69,1706,3.69,2204,4.179,3284,4.179,3956,4.909,4150,3.952,4175,5.72,4176,5.72,4177,5.72,4178,5.72,4179,5.72,4180,5.72,4181,5.72,4182,5.72,4183,5.72]],["t/1798",[60,3.571,72,1.207,110,1.647,148,3.043,166,5.665,185,3.319,271,2.861,571,2.986,702,1.878,4184,8.962]],["t/1800",[37,1.552,49,3.289,51,0.853,59,1.643,67,3.201,72,0.799,80,1.96,81,1.784,110,1.853,151,2.942,159,1.818,167,2.081,248,2.402,271,1.895,314,3.77,389,4.211,469,2.566,470,1.448,571,1.977,702,1.243,716,3.614,912,2.636,1650,5.093,1730,4.101,2565,4.644,4185,5.935,4186,5.935,4187,5.427,4188,5.935,4189,5.093,4190,5.935,4191,5.935,4192,5.427,4193,5.935,4194,5.935,4195,5.935,4196,5.935]],["t/1802",[37,1.259,50,1.213,51,0.882,59,1.081,72,0.893,80,1.39,81,1.265,88,2.564,110,1.62,131,3.53,148,2.252,159,2.032,185,2.456,216,2.067,239,2.893,249,3.784,271,2.117,346,2.311,359,3.324,393,2.727,470,1.175,571,2.21,607,3.625,702,1.39,766,3.183,817,3.287,1173,3.251,1693,4.278,1706,4.278,2718,6.065,4197,8.815,4198,6.065,4199,6.632,4200,6.632]],["t/1804",[20,2.235,37,1.259,51,0.9,59,1.081,72,0.893,73,2.258,80,1.39,81,1.265,110,1.62,147,2.716,148,2.993,159,2.032,213,4.278,271,2.117,470,1.175,571,2.21,702,1.39,1008,3.904,1075,6.255,1186,3.625,1288,4.113,2492,4.845,2703,4.845,2704,7.471,2717,6.065,2753,5.691,4201,6.632]],["t/1806",[37,1.326,51,0.894,59,1.138,72,0.94,80,1.463,81,1.332,110,1.283,147,2.152,148,2.371,159,2.139,222,6.471,271,2.229,470,1.237,571,2.327,583,3.5,702,1.463,1008,5.369,1075,4.955,1463,5.699,1499,5.204,2703,5.102,2704,6.881,4202,9.12,4203,9.12]],["t/1808",[33,3.147,37,1.144,51,0.894,59,0.982,61,2.805,72,0.811,80,1.262,81,1.149,107,2.02,110,1.518,111,3.081,147,1.857,148,2.046,151,2.987,159,1.846,183,2.86,185,2.231,271,1.923,311,3.091,398,4.674,470,1.067,571,2.008,583,3.02,702,1.262,767,3.208,1375,4.714,1627,4.275,2198,5.171,2214,4.917,2215,4.275,2692,5.171,4032,5.171,4204,6.025,4205,6.025,4206,6.025,4207,6.025]],["t/1810",[51,0.905,59,1.191,72,0.984,80,1.531,81,1.394,107,2.45,110,1.907,111,3.502,147,2.894,159,2.238,183,2.529,271,2.332,470,1.294,571,2.434,702,1.531,4208,9.391,4209,9.391,4210,7.306,4211,7.306]],["t/1812",[33,2.521,37,1.375,50,0.914,51,0.931,59,1.18,64,1.356,72,0.673,80,1.047,81,0.953,110,1.331,129,3.159,148,1.697,167,3.476,216,1.558,256,3.187,271,1.595,355,4.933,398,4.221,435,1.686,470,0.885,562,5.741,571,1.665,702,1.047,767,2.66,823,2.644,1222,6.821,1404,7.477,2773,3.546,3778,4.57,4212,4.997,4213,6.213,4214,4.288,4215,4.997,4216,8.012,4217,4.997,4218,4.997]],["t/1814",[33,1.508,35,1.192,37,1.634,51,0.897,59,1.197,60,2.03,72,0.686,80,1.067,81,0.972,95,2.663,100,3.019,110,1.349,129,2.222,159,1.56,167,3.304,256,3.231,271,1.626,355,4.254,429,2.078,435,1.719,442,2.999,470,0.902,501,3.843,504,3.986,571,1.697,702,1.067,823,2.681,846,3.049,1222,6.288,1404,7.107,1738,7.687,4213,6.3,4214,4.371,4216,7.387,4219,7.341,4220,5.094,4221,5.094,4222,5.094,4223,7.341,4224,5.094,4225,5.094,4226,5.094]],["t/1816",[32,3.49,37,1.292,51,0.905,59,1.109,72,0.916,80,1.425,81,1.298,106,2.573,148,2.31,159,2.084,185,2.519,271,2.172,311,3.49,470,1.205,559,2.434,571,2.267,702,1.425,805,3.622,836,7.115,3729,6.221,4227,6.803,4228,6.221,4229,6.803,4230,6.803,4231,8.965,4232,8.965,4233,6.803,4234,6.803]],["t/1818",[3,1.576,50,1.102,51,0.878,59,1.347,72,0.811,80,1.262,81,1.576,95,2.185,106,2.279,110,1.733,129,4.113,147,2.546,191,3.167,240,4.163,248,2.439,256,2.652,271,1.923,286,3.886,346,2.099,393,2.478,429,2.458,436,7.114,470,1.067,571,2.008,702,1.262,920,3.387,1151,3.387,1375,3.438,1497,5.171,1818,4.275,3284,4.402,4235,6.025,4236,6.025,4237,8.262,4238,6.025,4239,6.025,4240,6.025]],["t/1820",[37,1.454,40,3.029,51,0.756,59,1.248,60,3.052,72,1.032,80,1.605,81,1.461,110,1.408,112,2.23,148,2.601,151,3.797,185,2.836,216,2.388,271,2.445,470,1.357,571,2.552,583,3.84,702,1.605,1924,5.048,2565,5.994,4241,7.66,4242,7.66,4243,7.66]],["t/1822",[37,2.044,51,0.894,59,1.138,72,0.94,80,1.463,81,1.332,95,3.308,110,1.283,147,2.152,185,2.586,225,2.417,271,2.229,429,2.849,470,1.237,571,2.327,702,1.463,846,4.18,1734,5.993,1735,5.765,1924,4.602,4244,5.699,4245,6.983,4246,9.12,4247,6.983]],["t/1824",[37,0.824,39,4.618,51,0.959,59,1.063,67,2.34,72,0.584,80,0.909,81,0.828,110,1.441,112,1.899,177,2.749,189,4.361,244,2.405,271,1.385,346,2.273,357,2.514,387,2.127,401,4.542,413,2.998,416,3.84,470,0.768,571,1.446,702,0.909,769,2.439,1196,3.541,1198,2.514,1448,2.691,1482,2.743,1547,3.395,1548,3.079,1924,2.859,2090,5.598,2091,5.105,2886,3.968,3089,3.723,4164,3.541,4166,3.723,4167,3.541,4168,3.541,4248,4.339,4249,5.598,4250,3.723,4251,4.339,4252,4.339,4253,4.339,4254,3.723,4255,3.723,4256,3.723,4257,3.723,4258,3.723,4259,3.723,4260,3.723,4261,3.723]],["t/1826",[51,0.849,56,3.853,59,1.773,72,0.787,80,1.945,81,1.77,88,2.261,95,2.935,106,3.511,110,1.706,159,2.843,248,4.054,253,4.012,271,1.867,286,5.22,336,3.5,337,2.722,380,2.898,429,2.385,470,1.036,571,1.948,702,1.225,823,2.135,1173,2.867,1375,3.336,1445,4.575,1480,4.271,1893,4.412,4262,5.847,4263,5.847,4264,5.847]],["t/1828",[37,1.281,50,1.234,51,0.886,59,1.099,72,0.908,80,1.413,81,1.287,88,2.608,110,1.638,131,3.591,147,2.078,159,2.066,216,2.103,239,2.942,249,3.848,271,2.153,274,3.687,314,3.11,346,2.35,359,3.381,393,2.774,470,1.195,571,2.247,607,3.687,702,1.413,766,3.237,1173,3.307,1693,4.351,1706,4.351,3232,6.168,4265,6.745,4266,6.745,4267,6.745]],["t/1830",[35,1.438,37,1.59,50,1.124,51,0.93,59,1.217,72,0.54,80,1.565,81,1.425,82,3.271,88,1.55,95,1.454,110,1.129,131,2.134,151,4.15,177,1.406,187,3.045,216,1.25,225,1.388,239,1.749,244,2.222,248,3.389,249,2.287,271,1.28,346,2.602,359,2.009,393,1.649,429,1.636,470,1.323,571,1.336,607,2.191,702,0.84,716,3.741,766,1.924,767,2.134,772,2.642,773,2.929,809,2.98,940,3.025,1173,1.965,1299,2.929,1387,3.963,1550,3.271,1693,2.586,1706,2.586,1744,3.44,1749,5.013,2663,3.271,3855,5.272,3858,3.666,3859,5.618,3869,3.271,3871,3.271,3909,3.666,3910,3.666,3911,3.666,3912,3.666,4063,3.666,4065,3.666,4066,3.666,4067,5.618,4150,2.77,4268,4.009,4269,6.143,4270,4.009,4271,4.009,4272,4.009,4273,4.009]],["t/1832",[35,1.379,37,1.118,50,1.488,51,0.872,59,1.638,72,0.793,80,1.234,81,1.124,95,2.95,110,1.495,147,1.815,151,4.619,187,2.92,189,2.616,190,3.267,248,2.384,271,1.88,387,2.888,470,1.043,484,2.888,571,1.963,606,3.177,634,3.882,659,5.055,702,1.234,716,3.587,767,3.136,850,3.526,940,4.444,1438,5.772,1464,7.03,1500,4.807,4189,5.055,4274,5.891,4275,5.891,4276,5.891,4277,5.891,4278,5.891]],["t/1834",[40,3.319,50,1.536,51,0.883,59,1.368,66,1.785,72,0.83,80,1.292,81,1.176,95,2.236,129,2.69,151,4.161,191,3.241,253,3.056,271,1.968,311,4.306,416,3.63,429,2.516,470,1.487,571,2.055,634,5.531,702,1.292,716,5.112,823,3.485,1322,4.261,1618,4.652,2890,5.639,4189,5.291,4279,5.291,4280,6.166,4281,6.166,4282,6.166,4283,6.166,4284,6.166,4285,6.166]],["t/1836",[37,1.872,40,3.467,51,0.898,59,1.072,72,0.886,80,1.378,81,1.254,84,3.093,106,2.488,147,2.026,191,3.457,225,2.277,249,3.752,253,3.26,271,2.099,314,3.032,429,2.683,432,3.645,470,1.165,523,5.367,571,2.191,702,1.378,704,3.297,777,3.501,846,3.936,2139,4.434,2857,7.154,3869,5.367,4286,6.014,4287,6.577,4288,6.577,4289,6.577]],["t/1838",[37,1.804,51,0.91,59,1.213,72,1.002,80,1.56,81,1.42,147,2.928,159,2.28,185,3.877,271,2.376,470,1.318,571,2.48,702,1.56,722,7.17,777,3.963,984,4.705,2716,6.388,4290,7.443]],["t/1840",[32,1.986,37,0.735,51,0.965,59,1.531,72,0.805,80,1.722,81,1.695,108,1.367,110,0.712,150,4.302,151,1.919,159,2.722,166,2.447,183,1.34,248,1.567,271,1.909,432,2.146,470,1.574,482,2.116,571,1.29,702,0.811,777,2.061,831,2.497,855,3.709,4291,3.54,4292,8.886,4293,8.886,4294,3.871,4295,3.871,4296,3.871,4297,3.871,4298,3.871,4299,3.871,4300,3.871,4301,3.871,4302,3.871,4303,3.871,4304,3.871,4305,3.871,4306,3.871,4307,3.871,4308,3.871,4309,3.871,4310,5.981,4311,3.871,4312,3.871,4313,3.871,4314,7.308,4315,3.871,4316,3.871,4317,5.981,4318,3.871]],["t/1842",[32,3.931,35,1.266,37,2.015,50,0.989,51,0.87,59,0.881,72,0.728,80,1.133,81,1.031,88,2.091,110,1.635,131,2.879,150,5.238,151,2.68,159,1.656,177,1.896,187,2.68,216,1.686,225,1.872,239,2.359,248,2.189,249,3.085,271,1.726,346,2.67,359,2.71,393,2.224,429,2.206,470,0.958,482,2.956,571,1.802,607,2.956,702,1.133,766,2.595,767,2.879,772,3.563,777,2.879,831,3.488,1173,2.651,1693,3.488,1706,3.488,4150,3.736,4319,5.407,4320,5.407,4321,5.407,4322,5.407,4323,5.407,4324,8.898,4325,5.407]],["t/1844",[32,3.838,35,1.224,37,0.993,51,0.902,59,0.852,72,0.704,80,1.095,81,0.997,107,2.508,110,1.605,111,3.762,147,1.611,150,4.404,151,4.33,159,1.602,177,1.834,183,3.633,187,2.592,225,1.81,248,2.116,271,1.669,346,1.822,429,2.133,470,0.926,482,2.858,484,2.563,571,1.742,606,2.82,702,1.095,777,2.783,831,3.372,965,3.613,1437,5.853,1780,4.091,1841,3.078,2773,3.71,4150,3.613,4291,4.781,4326,4.487,4327,5.228,4328,7.48,4329,7.48,4330,7.48]],["t/1846",[32,3.749,35,1.711,37,0.961,51,0.885,59,0.825,72,0.682,80,1.06,81,0.965,110,1.576,147,1.559,150,4.302,151,4.251,159,1.55,177,1.775,187,3.622,225,1.752,248,2.048,271,1.616,346,1.763,387,3.583,429,2.065,470,0.896,482,2.766,484,2.481,571,1.686,606,2.73,702,1.06,716,3.082,767,2.694,777,2.694,831,3.264,850,3.029,855,5.319,912,3.809,940,3.819,965,3.497,1464,5.514,1780,3.96,1841,2.979,2773,3.591,4150,3.497,4326,4.343,4331,9.392,4332,5.061,4333,5.061,4334,7.307,4335,7.307,4336,7.307,4337,5.061]],["t/1848",[32,3.802,35,1.735,37,0.98,51,0.875,59,0.841,72,0.695,80,1.081,81,0.984,110,1.594,147,1.59,150,4.362,151,4.298,159,1.581,177,1.81,187,3.673,190,2.976,225,1.786,231,2.403,248,2.089,271,1.647,346,1.798,387,3.633,429,2.105,470,0.914,482,2.821,484,2.53,571,1.719,606,2.783,702,1.081,716,3.143,767,2.747,777,2.747,831,3.328,850,3.089,912,4.64,940,3.893,965,3.565,1438,5.258,1464,5.591,1780,4.038,1841,3.038,2773,3.662,4150,3.565,4326,4.428,4338,5.16,4339,5.16,4340,5.16,4341,5.16,4342,7.41]],["t/1850",[33,1.391,37,1.561,50,1.267,51,0.928,59,1.128,66,1.361,72,0.633,80,0.985,81,0.896,95,1.705,110,0.864,112,1.368,129,2.05,150,4.839,151,3.432,159,1.44,167,2.428,189,3.651,191,2.471,253,2.33,271,1.5,311,4.217,416,2.767,429,2.825,432,2.605,433,3.032,456,4.076,469,2.032,470,1.226,471,3.434,483,2.682,559,1.682,571,1.566,702,0.985,823,3.002,1084,3.434,1322,3.248,1330,2.915,1339,3.835,1507,3.835,1618,3.546,4090,4.033,4091,4.033,4097,4.033,4099,4.033,4100,4.033,4279,4.033,4343,6.924,4344,4.7,4345,4.7,4346,4.7,4347,4.7,4348,4.298,4349,4.298,4350,4.298,4351,4.7]],["t/1852",[33,1.9,51,0.937,59,1.405,72,0.864,80,1.344,81,1.224,110,1.179,159,1.966,190,2.577,271,2.048,327,2.705,413,4.434,470,1.136,571,2.138,702,1.344,777,3.416,823,2.343,1482,6.582,1568,4.841,1605,5.868,2377,4.687,4352,6.416,4353,6.416,4354,9.739,4355,6.416,4356,6.416,4357,6.416,4358,6.416,4359,6.416]],["t/1854",[35,1.292,37,1.048,40,2.183,51,0.857,59,1.592,72,0.743,80,1.886,81,1.717,110,1.963,159,1.691,185,2.044,190,2.217,193,5.072,194,2.866,271,1.762,314,2.545,470,1.377,571,1.839,575,3.722,583,4.511,702,1.157,766,2.65,767,2.939,1438,3.917,2139,3.722,2270,4.737,2273,4.32,3856,4.505,4198,5.048,4244,4.505,4360,5.52,4361,5.52,4362,5.52,4363,5.52,4364,5.52,4365,5.52,4366,5.52,4367,5.52,4368,5.52,4369,7.775]],["t/1856",[20,1.787,33,1.425,35,1.127,37,0.914,51,0.86,59,1.495,72,0.648,80,1.746,81,1.59,110,1.532,150,5.401,151,2.386,159,1.475,166,3.043,167,2.472,177,1.689,185,1.783,190,1.933,191,2.531,193,4.763,194,2.5,248,2.852,271,1.537,309,2.597,432,2.668,433,3.105,442,2.834,469,2.082,470,0.853,571,1.604,575,3.246,583,3.532,690,3.929,702,1.009,716,4.292,767,3.752,822,2.413,1151,2.707,1190,4.829,1438,3.416,2139,3.246,2273,3.767,3856,3.929,3871,3.929,3872,4.403,4244,3.929,4370,4.814,4371,4.814,4372,7.047,4373,4.814,4374,4.814,4375,4.814,4376,4.814,4377,4.814]],["t/1858",[33,1.646,35,1.301,37,1.055,51,0.836,59,1.597,72,0.749,80,1.893,81,1.723,110,1.66,148,1.888,159,1.703,185,2.059,187,2.756,190,2.233,193,5.088,194,2.886,271,1.775,314,3.603,385,5.084,470,0.985,571,1.852,575,3.748,583,3.916,607,4.271,702,1.165,767,2.959,940,4.194,1438,3.945,1627,3.945,1730,3.841,2139,5.268,2273,4.35,2774,5.084,3856,4.537,4187,5.084,4192,5.084,4244,4.537,4378,5.559,4379,5.084,4380,5.559,4381,5.559,4382,5.559,4383,5.559]],["t/1860",[3,1.843,21,2.573,35,2.147,37,1.742,50,1.678,54,5.513,59,1.148,60,2.808,72,0.949,114,4.314,129,3.074,191,3.703,256,3.101,271,2.249,442,4.148,509,4.643,560,4.314,571,2.348,606,3.8,673,4.822,684,5.75,702,1.476,736,5.513,1166,5.157,1171,5.316,1627,4.999,4384,7.045]],["t/1862",[51,0.883,59,1.299,72,1.073,80,1.67,81,1.52,110,1.465,147,3.057,159,2.441,271,2.544,470,1.411,571,2.655,702,1.67,1462,6.838,4385,9.921,4386,7.969,4387,7.969]],["t/1864",[33,1.321,37,1.513,50,1.219,51,0.92,59,1.086,66,1.292,72,0.601,80,0.935,81,0.851,95,1.618,110,0.82,112,1.299,129,1.946,147,2.052,148,2.262,159,1.367,167,2.796,189,3.54,191,2.345,253,2.211,271,1.424,311,4.089,416,2.626,429,3.252,432,3.692,433,4.297,456,3.921,463,5.823,469,1.929,470,1.18,471,4.866,483,2.545,559,1.596,571,1.486,702,0.935,823,2.911,1084,3.259,1322,3.083,1330,2.767,1339,3.641,1507,3.641,1618,3.366,1729,3.008,3353,4.08,4090,3.828,4091,3.828,4097,3.828,4099,3.828,4100,3.828,4279,3.828,4348,4.08,4349,4.08,4350,4.08,4388,6.661,4389,4.461,4390,4.461,4391,4.461,4392,4.461,4393,4.461]],["t/1866",[51,0.87,59,1.248,60,3.857,72,1.032,80,1.605,81,1.461,110,1.779,112,2.23,159,2.347,271,2.445,337,4.506,470,1.357,571,2.552,702,1.605,1184,3.797,1462,6.573,4394,9.678,4395,7.66]],["t/1868",[40,2.401,51,0.795,56,4.001,59,1.543,72,0.818,80,1.74,81,1.584,88,2.347,95,3.012,106,3.142,110,1.526,175,2.747,248,2.457,249,3.464,253,3.01,271,1.938,380,4.692,470,1.075,484,2.977,523,4.955,571,2.023,697,3.192,702,1.272,809,2.945,846,3.634,1137,4.955,1375,3.464,1547,4.751,2129,5.552,2139,4.093,3501,4.955,3506,5.21,3700,5.552,4286,7.595,4396,6.071,4397,6.071,4398,6.071,4399,6.071,4400,6.071]],["t/1870",[3,1.386,51,0.944,59,1.231,72,1.017,80,1.582,81,1.44,88,2.049,105,2.272,110,1.763,167,1.858,189,3.354,220,2.718,248,3.882,253,2.626,271,1.691,286,4.871,380,2.626,470,1.337,571,1.765,702,1.11,805,2.821,823,1.935,1375,3.023,1568,3.998,1614,4.845,1841,3.119,4401,5.298,4402,5.298,4403,8.799,4404,5.298,4405,5.298,4406,5.298,4407,5.298,4408,7.552,4409,5.298,4410,5.298,4411,7.552,4412,5.298]],["t/1872",[37,0.914,39,4.955,40,1.904,50,0.881,51,0.957,59,1.149,67,2.597,72,0.648,80,1.009,81,0.918,95,1.746,110,1.295,112,2.052,177,1.689,189,4.53,271,1.537,401,4.083,416,2.834,470,0.853,571,1.604,702,1.009,1198,2.789,1448,4.37,1482,3.043,1547,3.767,1548,3.416,1924,3.173,2091,5.514,3089,6.047,4164,5.751,4166,4.131,4167,3.929,4168,3.929,4249,4.131,4250,4.131,4254,4.131,4255,4.131,4256,4.131,4257,4.131,4258,4.131,4259,4.131,4260,4.131,4261,4.131,4413,4.814]],["t/1874",[37,0.872,39,4.881,40,1.815,50,0.84,51,0.955,59,1.109,67,2.476,72,0.618,80,0.962,81,0.876,95,1.665,110,1.251,112,1.981,177,1.61,189,4.454,271,1.466,401,3.942,416,2.703,470,0.813,516,4.198,571,1.53,702,0.962,757,3.449,1001,3.746,1198,2.66,1241,2.796,1448,4.22,1482,2.902,1547,3.592,1548,3.258,1924,3.025,2091,5.324,4164,5.553,4167,3.746,4168,3.746,4249,3.94,4250,3.94,4254,3.94,4255,3.94,4256,3.94,4257,3.94,4258,3.94,4259,3.94,4260,3.94,4261,3.94,4414,4.591,4415,4.591]],["t/1876",[32,4.088,51,0.843,72,1.073,95,2.89,107,2.672,111,2.972,185,2.951,271,2.544,470,1.411,571,2.655,702,1.67,784,4.48,983,7.287,984,5.037,986,7.248,1437,6.235,1500,6.503,2716,6.838]],["t/1878",[20,1.292,33,1.508,37,0.967,50,0.932,51,0.886,59,1.627,60,2.03,61,2.372,72,1.159,80,1.538,81,1.4,95,1.847,110,1.582,132,2.262,159,2.249,185,1.886,190,2.046,216,1.588,271,2.748,327,2.147,336,3.049,337,4.843,470,1.3,546,4.371,549,4.157,571,2.868,694,3.843,699,2.906,702,1.538,848,3.519,885,3.986,914,2.999,1184,4.267,2705,4.371,3284,3.721,3702,4.658,4416,5.094,4417,5.094,4418,5.094,4419,5.094,4420,5.094,4421,5.094,4422,5.094,4423,5.094]],["t/1880",[33,1.558,35,1.232,37,0.999,39,4.123,40,2.972,50,0.963,51,0.789,59,1.429,60,2.097,72,0.709,80,1.575,81,1.434,95,1.909,107,1.765,108,1.858,110,1.611,111,1.963,148,1.787,181,3.003,183,1.822,185,1.949,216,2.343,220,2.7,271,1.68,311,2.7,314,3.466,330,5.193,398,2.609,429,2.147,470,1.331,571,1.754,575,3.548,702,1.103,712,3.264,767,2.802,769,2.959,777,2.802,1020,3.395,1151,2.959,1158,3.971,1371,4.295,1387,3.395,1841,3.098,2102,4.517,2625,4.517,2893,4.517,3195,4.813,3874,4.813,4424,5.263,4425,5.263,4426,4.813,4427,5.263,4428,5.263,4429,5.263,4430,5.263]],["t/1882",[27,3.444,33,1.84,50,1.137,51,0.865,59,1.375,60,2.477,61,3.929,72,0.837,80,1.302,81,1.185,110,1.551,190,2.496,193,4.975,194,4.381,216,1.937,271,1.984,315,5.831,336,3.72,337,3.929,470,1.101,571,2.071,575,4.19,702,1.302,772,4.095,1184,3.081,1366,5.072,2335,7.717,2852,4.689,3284,4.54,4426,5.683,4431,6.215,4432,8.438,4433,6.215,4434,6.215]],["t/1884",[33,2.731,37,1.752,51,0.899,59,1.159,72,0.957,80,1.489,81,1.356,148,2.414,159,2.178,177,2.493,185,2.632,216,2.216,271,2.269,311,3.647,346,2.477,398,3.524,470,1.259,571,2.369,583,3.563,702,1.489,774,3.94,775,3.94,2204,6.74,4228,6.501,4379,6.501]],["t/1886",[33,2.129,37,1.765,48,1.681,50,0.558,51,0.914,59,0.807,61,1.42,72,0.667,80,1.037,81,0.944,104,0.543,107,1.66,110,1.557,111,1.846,112,0.888,129,1.331,132,1.355,139,3.735,189,2.199,216,0.951,225,1.056,309,2.67,346,1.725,417,2.51,443,4.04,456,2.914,467,2.282,470,0.877,480,5.715,491,2.056,505,3.338,565,1.565,702,0.639,708,1.254,712,1.892,822,2.482,823,1.114,1191,1.767,1222,3.617,1288,1.892,1499,2.825,1599,2.489,1735,1.928,2165,3.735,2594,2.789,2640,2.301,2773,4.434,3114,5.363,3178,4.04,3298,2.789,3444,2.617,3959,4.527,4435,3.05,4436,3.05,4437,4.951,4438,3.05,4439,3.05,4440,4.951,4441,4.951,4442,4.951,4443,6.249,4444,6.249,4445,4.951,4446,3.05,4447,8.47,4448,3.05,4449,4.951,4450,3.05,4451,3.05,4452,3.05,4453,3.05,4454,3.05,4455,3.05,4456,3.05,4457,3.05,4458,3.05,4459,3.05,4460,3.05,4461,3.05,4462,3.05,4463,3.05,4464,3.05,4465,4.951,4466,4.951,4467,4.951,4468,3.05,4469,3.05,4470,3.05,4471,3.05,4472,3.05,4473,3.05,4474,3.05]],["t/1888",[27,4.049,51,0.905,59,1.191,72,0.984,80,1.531,81,1.394,84,3.436,128,4.655,129,3.187,159,2.238,216,2.278,238,5.621,271,2.332,470,1.294,571,3.458,583,3.662,654,5.184,702,1.531,4475,7.306,4476,7.306,4477,7.306]],["t/1890",[72,1.249,107,3.111,271,2.962,571,3.091,702,1.944,4478,9.278,4479,9.278]],["t/1892",[51,0.882,59,1.614,60,2.643,72,0.893,80,2.075,81,1.889,95,2.405,110,1.82,112,1.931,147,2.043,185,2.456,190,2.663,193,3.443,216,2.067,271,2.117,470,1.175,571,2.937,702,1.39,767,3.53,4130,6.065,4480,6.632,4481,6.632,4482,6.632,4483,6.632,4484,6.632,4485,6.632,4486,6.632]],["t/1894",[32,3.319,35,1.514,37,1.646,50,1.183,51,0.894,59,1.054,72,0.871,80,1.355,81,1.234,110,1.189,147,1.993,159,1.982,167,2.269,179,3.808,190,2.598,231,3.012,271,2.065,413,4.47,470,1.146,571,2.155,702,1.355,817,3.207,1317,4.726,1731,5.279,2554,4.59,3855,5.551,4487,9.779,4488,6.469,4489,6.469,4490,6.469,4491,6.469,4492,6.469,4493,8.67,4494,6.469]],["t/1896",[27,3.417,33,2.485,37,1.594,39,2.9,51,0.937,59,1.005,72,0.83,80,1.292,81,1.176,148,2.094,159,1.889,185,2.283,216,1.922,271,1.968,398,3.056,470,1.092,562,4.157,571,2.797,583,3.091,702,1.292,980,3.755,1158,4.652,1627,5.956,2198,5.291,2214,5.032,2215,5.956,2533,5.291,4050,5.639,4077,5.639,4495,6.166,4496,6.166,4497,6.166,4498,6.166,4499,6.166]],["t/1898",[51,0.888,59,1.109,72,0.916,80,1.425,81,1.298,84,4.216,110,1.648,112,1.98,128,4.444,159,2.084,216,3.126,238,6.001,271,2.172,328,5.323,470,1.205,571,3.341,654,4.827,702,1.425,772,4.483,3572,8.198,3694,8.198,4500,6.803]],["t/1900",[14,4.407,37,1.02,51,0.923,56,3.539,59,0.875,60,2.14,72,0.723,80,1.125,81,1.024,84,4.169,148,3.01,149,5.842,159,1.645,271,1.714,274,5.275,309,2.896,311,3.912,441,4.82,470,0.951,565,2.755,571,1.789,702,1.125,767,2.859,769,3.019,969,3.923,980,4.643,1133,3.019,1397,4.911,2103,4.609,2527,9.32,2565,4.202,2712,4.609,3172,4.911,4501,5.37,4502,7.625,4503,5.37,4504,5.37]],["t/1902",[51,0.872,59,1.486,72,0.94,80,1.463,81,1.332,129,3.046,159,2.139,189,3.101,190,2.804,271,2.229,327,2.944,337,5.013,470,1.237,571,2.327,702,1.463,968,5.269,1184,5.034,1286,5.464,3300,5.993,3866,5.699,3867,5.699,4505,5.993,4506,6.983,4507,6.983,4508,5.993]],["t/1904",[37,1.683,51,0.884,59,1.445,72,0.901,80,1.401,81,1.276,129,2.918,159,2.049,189,2.97,190,2.686,271,2.135,337,5.271,470,1.184,571,2.228,702,1.401,745,3.656,920,3.76,1184,4.928,1286,5.233,3866,5.458,3867,5.458,4505,5.739,4508,5.739,4509,6.688,4510,6.688,4511,6.688]],["t/1906",[37,1.742,51,0.874,59,1.495,72,0.949,80,1.476,81,1.344,159,2.158,189,3.129,190,2.829,271,2.249,337,5.03,470,1.248,571,2.348,702,1.476,1184,5.056,1286,5.513,3866,5.75,3867,5.75,4505,6.046,4508,6.046,4512,7.045,4513,7.045,4514,7.045]],["t/1908",[32,3.49,51,0.888,59,1.109,72,0.916,80,1.425,81,1.298,107,2.281,111,3.343,147,3.09,148,2.31,159,2.084,271,2.172,311,3.49,317,3.532,470,1.205,515,5.133,571,2.267,702,1.425,887,4.219,1195,5.133,1437,5.323,1499,5.115,1582,6.221,2850,4.827,4032,5.838,4515,8.965,4516,6.803,4517,6.803]],["t/1910",[20,1.981,33,1.646,37,1.483,50,1.017,51,0.913,59,1.273,64,1.508,72,0.749,80,1.165,81,1.06,110,1.022,129,3.408,148,1.888,159,1.703,167,2.74,216,1.733,256,3.439,271,1.775,398,2.756,435,1.876,470,0.985,571,1.852,702,1.165,767,2.959,823,2.853,1071,4.061,1222,4.061,1404,5.895,2074,6.376,2075,4.537,2773,3.945,4093,5.084,4213,6.705,4214,4.771,4216,4.771,4518,5.559,4519,5.559,4520,5.559,4521,5.559,4522,5.559,4523,5.559,4524,5.559,4525,5.559,4526,5.559]]],"invertedIndex":[["",{"_index":51,"t":{"733":{"position":[[258,1],[333,2]]},"737":{"position":[[20,1],[159,1],[173,1],[179,2],[200,2],[383,1],[385,2],[421,2],[424,2],[570,1],[572,2],[588,2],[591,1],[759,1],[761,2],[777,2],[780,1],[802,1]]},"739":{"position":[[20,1],[159,1],[173,1],[179,2],[200,2],[383,1],[385,2],[421,2],[424,2],[427,2],[536,1],[538,2],[554,2],[557,1],[579,1]]},"741":{"position":[[20,1],[159,1],[173,1],[179,2],[200,2],[383,1],[385,2],[421,2],[424,2],[513,1],[515,2],[531,2],[534,1],[556,1]]},"751":{"position":[[20,1],[160,1],[174,1],[180,2],[373,3],[377,1],[417,1],[476,2],[524,1],[686,2],[689,3],[693,2],[725,1]]},"759":{"position":[[82,2]]},"761":{"position":[[20,1],[95,1],[109,1],[115,2],[170,1],[199,2],[206,2],[323,1],[377,1]]},"763":{"position":[[20,1],[138,1],[152,1],[171,2],[336,1],[342,2],[397,1],[426,2],[433,2],[483,1],[537,1]]},"771":{"position":[[458,1]]},"773":{"position":[[626,1],[780,1],[794,1],[798,1],[839,3],[919,1],[937,2],[944,1],[955,2],[1020,1],[1022,2],[1129,1],[1131,1],[1165,2],[1205,2],[1212,2],[1309,3],[1332,2],[1360,1],[1369,2],[1410,2],[1417,1],[1473,1],[1491,1],[1554,1],[1571,2],[1612,1],[1621,2],[1662,2],[1669,1],[1711,1],[1853,2],[1856,1],[1894,2],[1928,1]]},"775":{"position":[[134,1],[152,2],[159,1],[170,2],[235,1],[237,2],[321,1],[323,1],[338,2],[341,2]]},"785":{"position":[[20,1],[114,1],[128,1],[134,2],[159,2],[236,3],[279,1],[318,2],[352,1]]},"795":{"position":[[20,1],[118,1],[132,1],[138,2],[160,2],[277,3],[320,1],[359,2],[369,2],[397,2],[404,1],[453,1],[455,1]]},"799":{"position":[[34,1]]},"805":{"position":[[20,1],[131,1],[145,1],[151,2],[166,2],[207,2],[257,2],[366,3],[370,2],[446,1],[479,1],[486,2],[514,2],[537,2],[574,2],[584,2],[592,2],[601,1],[649,1],[651,2],[679,2],[764,1],[778,1],[780,2],[802,2],[855,2],[913,2],[960,2],[967,1],[1022,1],[1061,1],[1099,1],[1135,1],[1173,1],[1180,2],[1220,2],[1256,2],[1312,1],[1314,1],[1322,1]]},"807":{"position":[[125,1],[244,1]]},"809":{"position":[[20,1],[164,1],[170,1],[172,2],[245,2],[324,2],[410,1],[424,1],[430,2],[445,2],[536,2],[581,1],[617,2],[624,1],[665,1],[667,2],[708,2],[758,2],[893,2],[896,3],[900,2],[976,1],[1009,1],[1016,2],[1044,2],[1067,2],[1104,2],[1114,2],[1122,2],[1131,1],[1179,1],[1181,2],[1209,2],[1294,1],[1308,1],[1310,2],[1332,2],[1385,2],[1443,2],[1484,2],[1491,1],[1588,1],[1627,1],[1665,1],[1701,1],[1739,1],[1746,2],[1786,2],[1822,2],[1878,1],[1880,1],[1888,1]]},"815":{"position":[[691,1],[801,1],[815,1],[821,2],[898,3],[942,1],[970,2],[973,1],[1008,1],[1057,1],[1059,2],[1112,2],[1129,1],[1207,1],[1209,2],[1294,2],[1337,1],[1339,1]]},"823":{"position":[[365,2]]},"827":{"position":[[85,1],[134,1],[157,2],[171,1],[238,1],[240,1],[262,1],[332,1],[346,1],[352,2],[374,2],[377,1],[415,2],[430,1],[445,2],[454,1],[456,1],[462,2],[792,1],[869,2],[876,2],[879,1],[948,1],[977,2],[1000,1]]},"839":{"position":[[20,1],[507,1],[520,1],[562,1],[567,2],[596,1],[605,2],[647,2],[654,1],[715,1],[717,3],[725,2],[817,1],[844,2],[894,1],[899,2],[922,2],[1001,2],[1035,1],[1080,1],[1096,2],[1143,2],[1150,1],[1167,1],[1172,2],[1397,3],[1401,1],[1560,1],[1614,1],[1624,2],[1733,2],[1742,1],[1770,1],[1789,1]]},"859":{"position":[[77,1],[146,1],[181,2]]},"863":{"position":[[4,2],[33,4],[94,1]]},"869":{"position":[[20,1],[97,1],[111,1],[117,2],[172,1],[174,2],[223,2],[306,1],[350,1],[384,2],[444,1],[446,2],[523,2],[559,2],[592,2],[633,2],[636,2],[639,2],[737,1],[767,1],[773,1],[791,1],[814,2],[821,1],[855,1],[892,1],[923,2],[930,1],[965,1],[967,1],[969,3],[1004,2],[1069,2],[1108,1]]},"871":{"position":[[130,2],[207,1],[256,2],[259,3],[320,4]]},"874":{"position":[[114,2],[187,2],[280,1],[282,2],[323,2],[409,2],[463,2],[515,2],[624,2],[671,2],[760,2],[823,2],[885,2],[935,1]]},"886":{"position":[[134,2],[169,2],[187,2],[221,2],[369,1],[384,2]]},"888":{"position":[[19,1],[21,2],[57,2],[60,2],[115,2],[152,2],[155,2],[193,2],[212,2],[215,2],[239,2],[258,2],[277,2],[280,2],[304,2],[323,2],[340,2],[343,2],[391,2],[410,2],[413,2],[471,2],[528,2],[531,2],[572,2],[609,2],[612,2],[639,1],[678,1]]},"890":{"position":[[48,1],[173,1],[188,1]]},"900":{"position":[[135,2],[170,2],[189,2],[223,2],[362,2],[365,2]]},"902":{"position":[[19,1],[21,2],[61,2],[97,2],[118,2],[207,2],[227,2],[295,2],[352,2],[393,2],[477,2],[539,2],[634,2],[676,1]]},"904":{"position":[[18,1],[37,3],[52,3],[66,3],[119,1]]},"914":{"position":[[132,2],[167,2],[183,2],[217,2],[303,1],[318,2]]},"916":{"position":[[19,1],[21,2],[38,2],[41,2],[98,2],[150,2],[153,2],[194,2],[231,2],[234,2],[261,1],[300,2],[351,2],[354,2],[447,2],[494,2],[497,2],[546,2],[593,2],[596,2],[641,1]]},"918":{"position":[[18,1],[85,1],[203,1]]},"928":{"position":[[131,2],[166,2],[181,2],[215,2],[305,2]]},"930":{"position":[[0,2],[61,1],[63,2],[80,2],[83,2],[134,2],[155,2],[158,2],[212,2],[276,2],[315,2],[318,2],[345,1],[382,2],[418,2],[421,2],[465,2],[518,2],[521,2],[562,1]]},"932":{"position":[[0,2],[57,1],[126,1],[172,1]]},"942":{"position":[[135,2],[170,2],[189,2],[246,2],[315,3],[329,3],[406,2]]},"944":{"position":[[19,1],[21,2],[101,2],[181,2],[244,2],[298,2],[385,2],[475,1]]},"946":{"position":[[0,2],[57,1],[176,1],[204,1],[219,1]]},"948":{"position":[[302,4]]},"956":{"position":[[134,2],[163,2],[196,2]]},"958":{"position":[[19,1],[21,2],[72,2],[158,2],[179,2],[258,2],[311,2],[342,2],[397,2],[469,2],[571,2],[639,2],[695,2],[707,3],[739,2],[823,2],[826,2],[888,2],[983,2],[986,2],[1028,2],[1081,2],[1084,2],[1125,2],[1160,2],[1234,2],[1338,2],[1400,2],[1583,2],[1821,2],[1856,2],[1930,2],[2034,2],[2096,2],[2279,2],[2518,2],[2570,2],[2680,2],[2756,2],[2830,2],[2942,2],[3010,2],[3068,1],[3094,1],[3136,1]]},"960":{"position":[[18,1],[193,1]]},"970":{"position":[[130,2],[165,2],[179,2],[213,2],[272,2]]},"972":{"position":[[19,1],[21,2],[72,2],[167,2],[229,2],[291,2],[359,1]]},"974":{"position":[[18,1],[82,1],[107,3],[121,3],[135,1]]},"984":{"position":[[134,2],[169,2],[187,2],[221,2],[282,2]]},"986":{"position":[[19,1],[21,2],[47,1],[49,2],[86,2],[89,2],[146,2],[198,2],[201,2],[242,1]]},"988":{"position":[[18,1],[56,1]]},"998":{"position":[[132,2],[167,2],[183,2],[217,2],[261,1],[276,2]]},"1000":{"position":[[19,1],[21,2],[58,2],[61,2],[78,1],[117,1]]},"1002":{"position":[[18,1],[43,1],[58,1]]},"1012":{"position":[[133,2],[168,2],[185,2],[219,2],[344,2],[347,2],[405,2],[556,2]]},"1014":{"position":[[19,1],[21,2],[111,2],[114,2],[138,2],[162,2],[198,2],[201,2],[249,2],[286,2],[289,2],[328,2],[347,2],[350,2],[374,2],[393,2],[412,2],[415,2],[439,2],[458,2],[475,2],[478,2],[526,2],[545,2],[548,2],[606,2],[658,2],[661,2],[702,1]]},"1016":{"position":[[18,1],[43,3],[141,1]]},"1026":{"position":[[131,2],[166,2],[181,2],[215,2],[345,1],[380,2],[383,2],[441,2],[570,1],[585,2]]},"1028":{"position":[[0,2],[61,1],[63,2],[153,2],[156,2],[180,2],[204,2],[240,2],[243,2],[291,2],[328,2],[331,2],[369,2],[388,2],[391,2],[415,2],[434,2],[453,2],[456,2],[480,2],[499,2],[516,2],[519,2],[543,2],[562,2],[579,2],[582,2],[630,2],[644,2],[647,2],[700,2],[752,2],[755,2],[796,2],[833,2],[836,2],[863,1],[902,2],[937,2],[940,2],[989,1]]},"1030":{"position":[[18,1],[43,3],[150,1],[185,1]]},"1040":{"position":[[131,2],[166,2],[181,2],[215,2],[345,1],[360,2],[363,2],[421,2],[538,1],[553,2],[556,2],[614,2],[688,2],[752,1],[767,2]]},"1042":{"position":[[19,1],[21,2],[99,2],[102,2],[141,2],[231,2],[234,2],[258,2],[282,2],[318,2],[321,2],[369,2],[406,2],[409,2],[447,2],[466,2],[469,2],[493,2],[512,2],[531,2],[534,2],[558,2],[577,2],[594,2],[597,2],[645,2],[659,2],[662,2],[715,2],[767,2],[770,2],[811,2],[848,2],[851,2],[878,1],[917,1]]},"1044":{"position":[[18,1],[43,3],[150,1],[165,1]]},"1054":{"position":[[132,2],[167,2],[183,2],[217,2],[296,2]]},"1056":{"position":[[19,1],[21,2],[38,2],[41,2],[84,2],[130,2],[133,2],[197,1]]},"1058":{"position":[[18,1],[78,1]]},"1068":{"position":[[137,2],[172,2],[190,2],[224,2],[322,1],[337,2]]},"1070":{"position":[[0,2],[61,1],[63,2],[146,2],[149,2],[194,2],[284,2],[287,2],[311,2],[335,2],[371,2],[374,2],[422,2],[459,2],[462,2],[500,2],[519,2],[522,2],[546,2],[565,2],[584,2],[587,2],[611,2],[630,2],[647,2],[650,2],[698,2],[712,2],[715,2],[768,2],[803,2],[806,2],[855,2],[907,2],[910,2],[951,2],[988,2],[991,2],[1018,1],[1057,1]]},"1072":{"position":[[0,2],[57,1],[82,3],[209,1],[224,1]]},"1082":{"position":[[145,2],[180,2],[195,2],[229,2],[297,3],[311,3],[371,1],[396,2],[399,2],[441,2],[521,2],[524,2],[565,2],[627,2],[630,2],[679,2],[741,2],[748,1],[774,1],[783,2],[893,1],[901,1],[1010,2],[1013,2],[1077,1],[1167,2]]},"1084":{"position":[[19,1],[21,2],[57,2],[60,2],[108,2],[145,2],[148,2],[186,2],[205,2],[208,2],[232,2],[251,2],[270,2],[273,2],[297,2],[316,2],[375,2],[378,2],[417,2],[549,2],[552,2],[606,2],[630,2],[644,2],[756,2],[759,2],[809,2],[853,2],[856,2],[880,2],[901,2],[983,2],[986,2],[1010,2],[1031,2],[1051,2],[1054,2],[1078,2],[1105,2],[1125,2],[1128,2],[1152,2],[1179,2],[1236,2],[1239,2],[1280,2],[1335,2],[1338,2],[1388,2],[1429,2],[1432,2],[1543,1]]},"1086":{"position":[[18,1],[69,3],[83,3],[92,3],[152,1],[208,3],[224,3],[246,3],[268,3],[272,1]]},"1096":{"position":[[135,2],[170,2],[189,2],[223,2],[276,2],[334,2],[341,2],[390,2],[424,2]]},"1098":{"position":[[19,1],[21,2],[98,2],[152,2],[216,1]]},"1100":{"position":[[18,1],[57,2],[97,1]]},"1110":{"position":[[128,2],[163,2],[175,2],[209,2],[315,2]]},"1112":{"position":[[0,2],[61,1],[63,2],[95,2],[127,2],[155,2],[174,2],[177,2],[245,2],[298,2],[301,2],[342,2],[426,2],[429,2],[491,2],[586,2],[589,2],[631,1],[657,1],[699,1]]},"1114":{"position":[[109,2],[166,1],[184,3],[196,3],[210,3],[291,1]]},"1124":{"position":[[133,2],[168,2],[185,2],[219,2],[332,1],[404,1],[419,2]]},"1126":{"position":[[19,1],[21,2],[38,2],[41,2],[89,2],[103,2],[106,2],[159,2],[211,2],[214,2],[255,2],[292,2],[295,2],[322,1],[361,2],[364,34],[399,2],[433,2],[436,2],[439,34],[474,2],[558,2],[561,2],[607,2],[684,2],[687,2],[733,2],[812,2],[815,2],[879,1]]},"1128":{"position":[[18,1],[110,1],[182,1],[197,1]]},"1130":{"position":[[155,1],[194,1]]},"1134":{"position":[[20,1],[58,2],[119,2],[156,2],[198,2],[207,2],[296,1],[310,1],[312,2],[366,2],[435,2],[467,2],[516,2],[583,2],[635,2],[716,2],[744,2],[832,2],[860,2],[966,2],[996,2],[1078,5],[1084,2],[1124,2],[1239,1],[1256,1],[1258,1],[1265,1],[1267,3],[1271,2],[1274,2],[1352,2],[1394,2],[1397,2],[1459,2],[1558,1],[1622,2],[1625,2],[1628,2],[1702,1],[1766,2],[1785,2],[1819,1]]},"1138":{"position":[[205,1],[307,1],[321,1],[330,2],[386,2],[428,2],[431,2],[444,2],[456,1],[540,1],[645,1],[659,1],[668,2],[737,2],[779,2],[782,2],[795,2],[807,1],[896,1],[1001,1],[1015,1],[1024,2],[1096,2],[1138,2],[1141,2],[1162,2],[1174,1],[1260,1],[1333,2],[1393,1],[1407,1],[1416,2],[1464,2],[1506,2],[1509,2],[1557,1]]},"1144":{"position":[[18,1],[52,1],[68,1],[102,1],[205,1],[276,1],[351,1],[365,1],[367,2],[397,2],[427,2],[457,2],[502,2],[512,2],[563,2],[599,2],[641,2],[682,1],[684,2],[762,2],[765,2],[812,1],[814,2],[912,2],[931,2],[965,1]]},"1148":{"position":[[271,1],[348,1],[362,1],[364,2],[394,2],[428,2],[458,2],[503,2],[513,2],[566,2],[602,2],[644,2],[685,1],[687,2],[765,2],[768,2],[815,1],[817,2],[915,2],[934,2],[968,1]]},"1152":{"position":[[21,2],[57,2],[81,2],[117,2],[353,1],[431,1],[445,1],[447,2],[477,2],[513,2],[543,2],[588,2],[598,2],[652,2],[688,2],[730,2],[771,1],[773,2],[851,2],[854,2],[901,1],[903,2],[1001,2],[1020,2],[1054,1]]},"1154":{"position":[[15,2],[87,2],[97,2],[100,2],[481,1],[578,1],[635,1],[637,2],[667,2],[742,2],[778,2],[820,2],[861,1],[863,2],[946,2],[949,2],[983,1]]},"1156":{"position":[[0,2],[63,1],[76,2],[98,1],[139,4],[148,1],[157,2],[160,1],[162,2],[192,2],[228,2],[285,2],[321,2],[462,2],[562,2],[578,2]]},"1160":{"position":[[18,3],[40,2],[62,3],[84,2],[311,1],[393,1],[407,1],[409,2],[439,2],[476,2],[506,2],[551,2],[561,2],[612,2],[648,2],[690,2],[731,1],[733,2],[811,2],[814,2],[861,1],[863,2],[961,2],[980,2],[1014,1]]},"1164":{"position":[[48,3],[101,3],[332,1],[408,1],[422,1],[424,2],[454,2],[486,2],[516,2],[561,2],[571,2],[623,2],[659,2],[701,2],[742,1],[744,2],[822,2],[825,2],[872,1],[874,2],[972,2],[991,2],[1025,1]]},"1166":{"position":[[20,1],[112,1],[166,1],[175,2],[224,2],[260,2],[302,2],[343,1],[345,2],[458,2],[461,2],[495,1],[604,3],[663,3]]},"1168":{"position":[[20,1],[128,1],[182,1],[191,2],[256,2],[322,1],[348,2],[351,1],[353,2],[389,2],[469,1],[471,2],[562,2],[565,2],[599,1]]},"1174":{"position":[[470,2]]},"1178":{"position":[[207,1],[213,1],[289,1],[449,1],[856,2],[878,1],[900,1],[909,2],[927,2],[956,1],[980,2],[1002,1],[1227,2],[1309,1],[1498,1],[1597,1],[1626,2],[1799,2],[1829,1],[1831,1],[1844,3],[1861,2],[1934,2],[1958,2],[1961,2]]},"1180":{"position":[[18,4],[204,2],[207,1],[209,3],[310,2],[324,3],[407,2],[434,2],[560,2],[563,3],[740,2],[743,3],[831,1],[888,2]]},"1182":{"position":[[558,2],[892,2],[913,2],[1327,1],[1351,1],[1374,1],[1401,1],[1856,5]]},"1184":{"position":[[577,1],[605,1],[619,1],[625,2],[734,1],[1022,1],[1072,1],[1085,1],[1108,1],[1116,1],[1725,2],[1767,2],[1774,2]]},"1186":{"position":[[240,2],[262,3],[296,2],[334,2],[372,1],[409,2],[447,1],[484,2],[591,2],[679,2],[693,2]]},"1188":{"position":[[674,2],[759,2],[1465,1],[1641,1],[1872,2],[1891,1],[1922,1],[1985,1],[2016,1],[2047,1],[2069,2],[2076,1],[2089,1],[2155,1],[2210,1],[2259,1],[2310,1],[2726,2],[2738,1],[2755,1]]},"1190":{"position":[[198,1],[220,1],[271,1],[284,2],[299,1],[313,1],[320,1],[335,1],[337,1],[1076,2],[1108,1],[1120,1],[1139,1],[1193,1],[1195,2],[1232,2],[1301,2],[1379,1],[1392,2],[1407,1],[1421,1],[1436,2],[1439,2],[1442,1],[1444,2],[1492,2],[2159,1],[2455,2],[2524,1],[2633,1],[2646,2],[2651,2],[2662,2],[2677,1],[2691,1],[2706,2],[3006,2],[3044,2],[3672,1],[3770,1],[3785,2],[4068,1],[4405,1],[4456,2],[4509,1],[4514,2],[4532,2],[4615,1],[4628,2],[4633,2],[4644,2],[4659,1],[4673,1],[4688,2],[4716,2],[4723,1],[4784,1],[4786,1]]},"1194":{"position":[[278,2],[289,2],[328,1],[403,1],[417,1],[419,2],[449,2],[479,2],[509,2],[554,2],[564,2],[614,2],[650,2],[692,2],[733,1],[735,2],[813,2],[816,2],[863,1],[865,2],[963,2],[982,2],[1016,1]]},"1198":{"position":[[23,3],[49,2],[71,3],[97,2],[341,1],[421,1],[435,1],[437,2],[467,2],[507,2],[537,2],[624,2],[706,2],[716,2],[789,2],[825,2],[867,2],[908,1],[910,2],[988,2],[991,2],[1038,1],[1040,2],[1138,2],[1157,2],[1191,1]]},"1202":{"position":[[256,1],[288,1],[363,2],[377,2],[396,1],[410,1],[412,2],[442,2],[472,2],[502,2],[547,2],[557,2],[607,2],[643,2],[685,2],[726,1],[728,2],[806,2],[809,2],[856,1],[858,2],[956,2],[975,2],[1009,1]]},"1206":{"position":[[19,2],[56,1],[64,2],[130,1],[171,1],[275,1],[307,1],[383,2],[397,2],[416,1],[430,1],[432,2],[462,2],[494,2],[524,2],[569,2],[579,2],[631,2],[667,2],[709,2],[750,1],[752,2],[830,2],[833,2],[880,1],[882,2],[980,2],[999,2],[1033,1]]},"1212":{"position":[[531,1],[533,2],[586,2],[605,2],[608,3],[612,1],[810,1],[812,2],[865,2],[884,2],[906,2],[967,2],[985,2],[1018,2],[1021,3],[1025,1],[1167,1],[1169,2],[1205,2],[1242,2],[1245,3],[1249,2],[1461,2],[1505,2]]},"1214":{"position":[[143,1],[149,2],[202,1],[241,2],[264,1]]},"1216":{"position":[[329,2],[639,2],[685,3],[727,1],[766,2],[780,2],[867,1],[897,1],[899,1],[920,2],[923,2],[962,2],[984,2],[1062,1],[1084,2],[1087,2],[1090,1],[1119,1],[1121,1],[1141,2],[1144,2],[1158,1],[1198,2],[1211,2],[1297,1],[1330,1],[1332,1],[1349,2],[1352,2],[1375,2]]},"1218":{"position":[[271,2]]},"1223":{"position":[[349,2],[352,2],[388,2],[391,2],[429,2],[432,2],[480,2],[549,2],[868,2],[871,2],[914,2],[917,2],[962,2],[965,2],[1188,2],[1276,1],[1278,2],[1366,2],[1444,2],[1509,2],[1559,2],[1627,2],[1676,2],[1738,2],[1784,2],[1850,2],[1905,2],[1974,2],[2025,2],[2072,2],[2075,2],[2105,1],[2172,2],[2219,2],[2286,2],[2289,2],[2347,2],[2423,2],[2426,2],[2475,2],[2546,2],[2549,2],[2598,1],[2608,2],[2752,1],[2781,2]]},"1225":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"1227":{"position":[[133,1],[139,2],[160,2],[201,2],[219,1],[271,1],[309,2],[343,1]]},"1229":{"position":[[156,1],[162,2],[181,2],[200,2],[221,2],[325,2],[351,2],[383,2],[419,2],[422,2],[425,1]]},"1231":{"position":[[146,1],[152,2],[171,2],[201,2],[212,2],[241,2],[277,2],[318,2],[337,2],[366,2],[402,2],[443,2],[490,1]]},"1233":{"position":[[186,1],[192,2],[249,1],[288,2],[355,2],[385,2],[428,1]]},"1235":{"position":[[119,1],[125,2],[167,1],[171,2],[174,3],[178,1]]},"1241":{"position":[[112,1],[139,1],[152,1],[166,1],[172,2],[257,2],[292,3],[296,1],[298,2],[347,1],[356,1],[358,1],[360,1],[411,1],[419,1],[421,1],[423,2],[426,1],[428,1],[480,1],[488,1],[490,1],[492,2],[495,1],[497,1],[553,1],[555,1],[557,1]]},"1243":{"position":[[126,1],[153,1],[166,1],[180,1],[186,2],[373,2],[451,2],[486,3],[490,1],[492,2],[539,1],[548,1],[550,1],[552,1],[596,4],[616,2],[619,1],[685,2],[688,1],[760,1],[762,2],[765,1],[767,1],[795,3],[807,4],[827,2],[830,1],[858,3],[893,2],[896,1],[924,3],[962,1],[964,2],[979,1],[981,1],[1055,1],[1057,2],[1072,1],[1074,1],[1148,1],[1150,2],[1158,1]]},"1245":{"position":[[111,1],[138,1],[151,1],[165,1],[171,2],[230,2],[275,3],[279,1],[281,2],[328,1],[337,1],[381,4],[401,1]]},"1247":{"position":[[211,1],[217,2],[272,1],[336,2],[379,3],[383,1],[385,2],[412,1],[421,1],[423,1],[468,4],[488,1],[490,1]]},"1249":{"position":[[39,1],[51,2]]},"1253":{"position":[[113,2],[157,2]]},"1255":{"position":[[307,1],[349,1],[453,2],[456,1]]},"1257":{"position":[[194,1],[236,1],[340,2],[343,1]]},"1259":{"position":[[390,1],[432,1],[607,2],[610,1]]},"1261":{"position":[[439,1],[481,1],[656,2],[659,1]]},"1263":{"position":[[205,2],[295,1]]},"1265":{"position":[[347,2],[427,1],[454,2],[457,2],[516,2],[519,2],[562,2],[565,2],[585,2],[681,2],[706,2],[723,2],[772,2],[790,1],[800,2],[855,2],[858,2],[875,1]]},"1270":{"position":[[58,2]]},"1274":{"position":[[40,2],[62,2],[156,2],[174,2],[181,1],[194,1],[213,2],[226,2],[229,3]]},"1276":{"position":[[380,2],[383,3]]},"1278":{"position":[[448,2],[460,2],[470,2],[480,2],[490,2]]},"1280":{"position":[[134,2],[137,3]]},"1282":{"position":[[190,2],[193,3]]},"1284":{"position":[[429,2],[432,3]]},"1286":{"position":[[197,2],[200,3]]},"1288":{"position":[[210,2],[213,3]]},"1290":{"position":[[158,2],[161,3]]},"1292":{"position":[[201,2],[204,3]]},"1294":{"position":[[241,2],[244,3]]},"1296":{"position":[[148,2],[214,2],[217,2],[235,2],[297,2],[325,2],[328,2],[343,1],[386,2],[389,2],[459,2],[490,2],[493,2],[737,2],[740,3]]},"1298":{"position":[[182,2],[185,3]]},"1300":{"position":[[178,2],[181,3]]},"1302":{"position":[[109,2],[166,2],[169,2],[236,2],[331,2],[388,2],[391,3]]},"1304":{"position":[[162,2],[228,2],[231,2],[298,2],[402,2],[468,2],[471,3],[772,2],[775,3],[1153,2],[1156,3],[1225,2],[1289,1],[1291,2],[1347,2],[1387,2],[1436,1],[1448,2],[1502,2],[1505,2],[1580,2],[1690,2],[1754,2],[1859,2],[1862,3]]},"1306":{"position":[[168,2],[171,3]]},"1308":{"position":[[138,2],[141,3]]},"1310":{"position":[[217,2],[220,3]]},"1312":{"position":[[188,2],[191,3]]},"1314":{"position":[[98,2],[131,2],[175,2],[229,1],[255,2],[258,3]]},"1316":{"position":[[157,2],[160,3]]},"1318":{"position":[[154,2],[157,3]]},"1320":{"position":[[158,2],[161,3]]},"1322":{"position":[[97,2],[116,2],[119,3]]},"1324":{"position":[[255,2],[300,2],[303,3]]},"1326":{"position":[[190,1],[216,2],[219,3]]},"1328":{"position":[[158,2],[175,2],[178,3]]},"1330":{"position":[[146,2],[164,2],[167,3]]},"1332":{"position":[[232,2],[252,2],[255,3]]},"1334":{"position":[[268,1],[287,2],[312,2],[315,2],[318,3]]},"1336":{"position":[[46,1],[58,1],[66,2],[96,1],[105,2],[135,1],[144,2],[173,1],[181,2],[212,1],[222,2],[247,1],[258,2],[291,1],[303,2],[336,1],[348,2],[379,1],[389,2],[418,1],[426,1],[468,1],[482,1],[508,1],[536,1],[570,1],[610,1],[657,1],[704,1],[758,1],[805,1],[852,1],[904,1],[958,1],[1018,1],[1084,1],[1157,1],[1199,1],[1252,1],[1269,1],[1275,2],[1319,1],[1325,2],[1361,1],[1367,2],[1402,1],[1408,2],[1429,1],[1435,2],[1468,1],[1474,2],[1508,1],[1514,2],[1567,1],[1573,2],[1608,1],[1614,2],[1652,1],[1658,2],[1698,1],[1704,2],[1739,1],[1745,2],[1785,1],[1791,2],[1821,1],[1827,2],[1869,1],[1875,2],[1917,1],[1923,2],[1954,1],[1960,2],[1994,1],[2000,2],[2037,1],[2043,2],[2075,1],[2081,2],[2124,1],[2130,2],[2173,1],[2179,2],[2211,1],[2217,2],[2255,1],[2261,2],[2300,1],[2306,2],[2341,1],[2347,2],[2381,1],[2387,2],[2429,1],[2435,2],[2474,1],[2480,2],[2523,1],[2529,2],[2567,1],[2573,2],[2607,1],[2613,2],[2643,1],[2649,2],[2689,1],[2695,2],[2740,1],[2746,2],[2791,1],[2797,2],[2841,1],[2847,2],[2894,1],[2900,2],[2955,1],[2961,2],[3002,1],[3008,2],[3041,1],[3047,2],[3091,1],[3097,2],[3142,1],[3148,2],[3179,1],[3185,2],[3226,1],[3232,2],[3265,1],[3271,2],[3311,1],[3317,2],[3364,1],[3370,2],[3407,1],[3413,2],[3462,1],[3468,2],[3516,1],[3522,2],[3563,1],[3569,2],[3609,1],[3615,2],[3651,1],[3657,2],[3701,1],[3707,2],[3747,1],[3753,2],[3802,1],[3808,2],[3855,1],[3861,2],[3904,1],[3910,2],[3947,1],[3953,2],[3988,1],[3994,2],[4045,1],[4051,2],[4066,1],[4079,1],[4095,1],[4124,2],[4159,1],[4190,2],[4226,1],[4260,2],[4292,1],[4320,2],[4351,1],[4378,2],[4417,1],[4452,2],[4488,1],[4520,2],[4560,1],[4596,2],[4631,1],[4664,2],[4695,1],[4722,2],[4749,1],[4772,2],[4809,1],[4842,2],[4884,1],[4921,2],[4963,1],[5003,2],[5044,1],[5080,2],[5124,1],[5163,2],[5215,1],[5262,2],[5300,1],[5336,2],[5366,1],[5391,2],[5432,1],[5469,2],[5511,1],[5549,2],[5577,1],[5602,2],[5640,1],[5675,2],[5705,1],[5732,2],[5769,1],[5803,2],[5847,1],[5886,2],[5920,1],[5954,2],[6000,1],[6046,2],[6091,1],[6136,2],[6174,1],[6212,2],[6249,1],[6282,2],[6315,1],[6344,2],[6385,1],[6422,2],[6459,1],[6492,2],[6538,1],[6580,2],[6624,1],[6664,2],[6704,1],[6742,2],[6776,1],[6807,2],[6839,1],[6869,2],[6917,1],[6965,2],[6980,1],[7028,1],[7050,1],[7092,1],[7140,1],[7186,1],[7217,1],[7244,1],[7282,1],[7316,1],[7341,1],[7366,1],[7393,1],[7430,1],[7470,1],[7496,1],[7520,1],[7550,1],[7584,1],[7615,1],[7636,1],[7659,1],[7694,1],[7734,1],[7776,1],[7819,1],[7848,1],[7874,1],[7905,1],[7933,1],[7964,1],[8004,1],[8045,1],[8078,1],[8102,1],[8131,1],[8164,1],[8215,1],[8284,1],[8349,1],[8413,1],[8478,1],[8538,1],[8599,1],[8667,1],[8714,1],[8749,1],[8809,1],[8857,1],[8874,1],[8906,1],[8952,1],[8995,1],[9036,1],[9077,1],[9116,1],[9149,1],[9173,1],[9201,1],[9242,1],[9285,1],[9332,1],[9377,1],[9414,1],[9446,1],[9470,1],[9490,1],[9513,1],[9546,1],[9582,1],[9609,1],[9632,1],[9662,1],[9699,1],[9731,1],[9756,1],[9794,1],[9860,1],[9932,1],[9980,1],[10014,1],[10053,1],[10103,1],[10165,1],[10225,1],[10281,1],[10331,1],[10374,1],[10411,1],[10449,1],[10488,1],[10516,1],[10539,1],[10566,1],[10593,1],[10616,1],[10637,1],[10672,1],[10719,1],[10773,1],[10824,1],[10873,1],[10926,1],[10970,1],[11010,1],[11055,1],[11089,1],[11112,1],[11133,1],[11165,1],[11197,1],[11223,1],[11256,1],[11291,1],[11325,1],[11359,1],[11394,1],[11422,1],[11460,1],[11503,1],[11535,1],[11573,1],[11611,1],[11648,1],[11668,1]]},"1339":{"position":[[155,2],[177,2],[192,2],[195,3]]},"1341":{"position":[[76,2],[97,2],[231,2],[234,2],[237,3],[346,2],[507,1],[514,1],[999,1],[1334,1],[5037,1],[5332,2],[5335,2],[5916,2],[6900,2]]},"1343":{"position":[[174,1],[227,2]]},"1345":{"position":[[104,2],[146,2],[188,2],[211,1],[251,1],[258,1],[295,1],[297,2],[300,3]]},"1349":{"position":[[95,1],[195,1],[325,1],[412,1],[510,1],[591,1],[704,1],[846,1]]},"1352":{"position":[[20,1],[118,1],[132,1],[134,2],[155,2],[170,2],[187,1],[253,2],[274,1],[339,2],[382,1],[430,1],[459,1],[512,1],[544,1]]},"1354":{"position":[[20,1],[118,1],[132,1],[134,2],[155,2],[170,2],[190,1],[253,2],[296,1],[349,1],[420,1],[473,2],[476,1]]},"1356":{"position":[[20,1],[112,1],[126,1],[128,2],[146,1],[207,2],[225,1],[302,2],[359,1],[392,1],[430,1]]},"1358":{"position":[[20,1],[112,1],[126,1],[132,2],[172,2],[247,1],[280,1],[318,1]]},"1360":{"position":[[20,1],[112,1],[126,1],[132,2],[183,2],[258,1],[302,1],[317,2],[360,2],[367,1],[380,1],[416,1],[418,1],[442,1]]},"1366":{"position":[[77,1],[160,1],[238,2],[366,2],[369,3],[373,2],[516,2],[580,1],[590,2],[600,2],[608,2],[617,1],[631,1],[641,2],[652,2],[660,2],[672,1],[686,1],[701,2],[743,1],[786,2],[841,3]]},"1368":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[236,2],[239,2],[305,2],[366,2],[425,2],[475,2],[478,2],[527,2],[573,2],[619,2],[669,2],[724,2],[770,2],[773,2],[837,2],[907,2],[992,2],[995,2],[1048,2],[1106,2],[1109,2],[1165,2],[1223,2],[1226,2],[1282,1]]},"1370":{"position":[[18,1],[182,1]]},"1376":{"position":[[77,1],[156,1],[234,2],[284,2],[389,1],[417,2],[427,2],[445,1],[480,3],[638,1],[656,2],[729,1],[759,2],[802,1],[838,2],[841,3],[883,1],[957,2]]},"1378":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[255,2],[258,2],[282,1],[321,2],[427,2],[430,2],[456,2],[459,2],[508,2],[567,2],[570,2],[616,2],[687,2],[690,2],[728,1],[730,2],[767,2],[770,1],[809,2],[898,2],[901,2],[977,2],[1031,2],[1034,2],[1109,2],[1181,1],[1191,2],[1194,2],[1238,2],[1335,2],[1408,2],[1428,2],[1431,2],[1459,2],[1501,2],[1572,2],[1575,2],[1648,1]]},"1380":{"position":[[18,1],[53,1],[153,1],[189,2],[328,1]]},"1386":{"position":[[77,1],[159,1],[237,2],[290,2],[403,2],[408,3],[412,2],[519,1],[537,2],[557,2],[592,2],[597,3]]},"1388":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[240,2],[243,2],[278,2],[299,2],[318,2],[339,2],[376,1]]},"1390":{"position":[[18,1],[60,1]]},"1392":{"position":[[0,2],[28,1],[44,1],[62,1],[81,1],[106,1],[110,1]]},"1398":{"position":[[77,1],[155,1],[233,2],[282,2],[458,3],[959,1],[993,2],[1010,2],[1013,3]]},"1400":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[282,2],[352,2],[355,2],[449,2],[488,2],[491,2],[559,2],[630,2],[633,2],[660,3],[684,2],[760,2],[812,2],[815,2],[895,2],[967,2],[1041,2],[1044,2],[1071,3],[1095,2],[1168,2],[1242,2],[1314,2],[1363,2],[1366,2],[1422,2],[1495,2],[1506,2],[1509,2],[1536,3],[1561,2],[1638,2],[1656,2],[1659,2],[1700,1]]},"1402":{"position":[[18,1],[76,4],[227,2],[230,5],[250,3],[294,3],[309,1]]},"1408":{"position":[[77,1],[155,1],[233,2],[282,2],[447,1],[532,1],[534,3],[538,2],[541,3]]},"1410":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[265,2],[333,2],[353,2],[374,2],[394,2],[414,2],[433,2],[454,2],[457,2],[503,2],[506,2],[567,2],[634,2],[688,2],[718,2],[745,3],[769,2],[797,2],[824,3],[846,2],[885,2],[937,2],[979,2],[1033,2],[1087,2],[1143,2],[1211,2],[1271,2],[1331,2],[1334,2],[1358,1],[1395,2],[1449,2],[1452,2],[1509,2],[1568,2],[1623,2],[1626,2],[1648,2],[1669,2],[1710,2],[1713,2],[1773,2],[1809,2],[1812,2],[1885,2],[1888,2],[1999,1]]},"1412":{"position":[[18,1],[49,1],[121,1],[234,1]]},"1414":{"position":[[6,1],[19,1],[36,1]]},"1416":{"position":[[58,2],[75,2],[166,3]]},"1418":{"position":[[1107,1],[1138,1]]},"1422":{"position":[[77,1],[160,1],[238,2],[292,2],[401,2],[404,3],[408,3]]},"1424":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[264,2],[267,2],[396,2],[484,2],[487,2],[648,2],[712,2],[715,2],[768,1]]},"1426":{"position":[[18,1],[65,1],[99,2],[125,2],[168,1],[208,2],[237,1]]},"1428":{"position":[[6,1],[26,1],[64,1],[70,1]]},"1432":{"position":[[0,2],[72,2]]},"1434":{"position":[[77,1],[164,1],[242,2],[270,2],[389,2],[500,2],[698,3],[702,2],[709,1],[782,1],[813,1],[834,2],[837,2],[845,1],[914,1],[974,2],[988,2]]},"1436":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[249,2],[252,2],[300,2],[339,1],[357,2],[360,2],[439,2],[551,2],[590,2],[593,2],[689,2],[728,2],[731,2],[827,1]]},"1438":{"position":[[18,1],[71,3],[127,1]]},"1440":{"position":[[307,2],[330,3],[432,3]]},"1446":{"position":[[77,1],[157,1],[235,2],[305,2],[443,3],[529,4],[534,3],[538,1]]},"1448":{"position":[[24,1],[34,1],[106,1],[108,1]]},"1450":{"position":[[0,2],[64,1],[66,2],[164,2],[268,1]]},"1458":{"position":[[77,1],[155,1],[233,2],[282,2],[289,1],[379,1],[418,2],[421,2],[506,3],[510,2],[517,1],[610,1],[649,2]]},"1460":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[264,2],[328,2],[394,2],[462,2],[529,2],[595,2],[661,2],[704,1]]},"1462":{"position":[[18,1],[52,1]]},"1468":{"position":[[77,1],[166,1],[254,1],[341,1],[429,2],[592,1],[689,5],[695,1],[732,1],[765,1]]},"1470":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,1]]},"1472":{"position":[[18,1],[39,1]]},"1478":{"position":[[77,1],[158,1],[236,2],[288,2],[411,3]]},"1480":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[259,2],[262,2],[284,2],[299,2],[326,2],[329,2],[377,2],[457,2],[522,2],[525,2],[578,2],[661,2],[664,2],[733,1]]},"1482":{"position":[[18,1],[45,3],[103,1]]},"1484":{"position":[[98,1],[262,1]]},"1488":{"position":[[77,1],[161,1],[239,2],[337,3],[341,2],[529,3]]},"1490":{"position":[[110,1],[227,1],[229,2],[289,2],[370,1],[376,2],[456,3],[460,2],[558,2],[614,2],[780,3],[815,1]]},"1492":{"position":[[55,1],[168,1],[182,1],[188,2],[284,3],[319,1]]},"1494":{"position":[[55,1],[171,1],[185,1],[191,2],[301,3],[336,1]]},"1496":{"position":[[58,1],[174,1],[188,1],[194,2],[306,3],[341,1]]},"1498":{"position":[[55,1],[174,1],[188,1],[194,2],[290,3],[325,1]]},"1500":{"position":[[53,1],[137,2],[260,1],[274,1],[290,2],[309,2],[316,1],[329,1],[335,2],[413,3],[448,1]]},"1502":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[240,2],[285,2],[288,2],[343,2],[346,2],[408,2],[447,2],[450,2],[485,2],[488,2],[509,2],[551,2],[581,2],[584,2],[640,2],[679,2],[682,2],[745,2],[792,2],[859,2],[862,2],[920,2],[978,2],[981,2],[1003,2],[1050,2],[1096,2],[1132,2],[1135,2],[1157,2],[1216,1]]},"1504":{"position":[[18,1],[62,3],[134,3],[138,1]]},"1510":{"position":[[20,1],[100,1],[114,1],[120,2],[195,1],[229,2],[252,1]]},"1512":{"position":[[0,2],[64,1],[66,2],[113,2],[166,2],[183,2],[236,2],[258,2],[322,2],[339,2],[380,2],[460,2],[474,2],[519,2],[544,2],[605,2],[630,2],[657,3],[690,2],[707,2],[760,2],[782,2],[840,2],[858,2],[925,2],[947,2],[974,3],[1002,2],[1034,2],[1110,2],[1140,2],[1213,2],[1245,2],[1320,2],[1344,2],[1403,2],[1429,2],[1490,2],[1512,2],[1573,2],[1610,2],[1674,1]]},"1514":{"position":[[18,1],[377,1]]},"1516":{"position":[[89,1],[147,1]]},"1520":{"position":[[77,1],[162,1]]},"1524":{"position":[[57,1],[72,2],[75,3],[79,3]]},"1526":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[258,2],[317,2],[320,2],[345,1],[382,2],[456,2],[459,2],[516,2],[606,2],[609,2],[749,2],[841,2],[844,2],[921,2],[955,2],[958,2],[1035,2],[1087,2],[1090,2],[1178,1]]},"1528":{"position":[[18,1],[58,1],[60,2],[166,2],[182,1],[269,1],[280,2],[297,2],[303,1],[305,2],[374,2],[415,1],[428,2],[468,2],[538,2],[594,1]]},"1534":{"position":[[20,1],[133,1],[139,1],[148,1],[181,1],[243,1],[258,2],[301,2],[392,2],[397,1],[416,1],[468,1],[482,1],[488,2],[503,2],[687,3],[729,1],[782,2],[805,1],[813,1],[837,1],[878,2],[990,2],[1092,2]]},"1536":{"position":[[159,1],[291,1],[297,1],[306,1],[353,1],[445,1],[447,1],[509,1],[524,2],[567,2],[658,2],[663,1],[682,1],[734,1],[771,1],[785,2],[836,2],[859,1],[897,1],[912,1],[914,1],[928,1],[942,1],[948,2],[1078,3],[1120,1],[1153,2],[1207,1],[1260,2],[1306,1],[1361,2],[1384,1],[1408,1],[1410,1],[1473,2],[1484,1],[1621,2],[1652,1],[1777,2]]},"1538":{"position":[[20,1],[133,1],[141,1],[150,1],[174,1],[188,1],[194,2],[224,2],[311,1],[326,2],[369,2],[460,2],[465,1],[484,1],[536,2],[539,2],[580,1],[613,2],[677,1],[730,2],[753,1],[777,1],[779,1],[842,2],[853,1],[982,2]]},"1540":{"position":[[0,2],[64,1],[66,2],[113,2],[166,2],[238,2],[293,2],[366,2],[410,2],[491,2],[562,2],[598,2],[649,2],[669,2],[690,2],[710,2],[729,2],[749,2],[787,2],[841,2],[896,2],[989,2],[1058,2],[1107,1]]},"1542":{"position":[[18,1],[69,1],[87,2],[140,1],[149,2],[180,1],[248,1],[333,2],[357,1],[429,1]]},"1548":{"position":[[77,1],[158,1],[236,2],[288,2],[397,1],[413,2],[428,2],[455,1],[510,1],[544,2],[586,1],[624,2],[655,3]]},"1550":{"position":[[195,1],[254,3],[407,1],[442,1],[459,1],[478,1],[503,1]]},"1552":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[287,2],[290,2],[312,2],[390,2],[393,2],[431,1],[433,2],[450,2],[453,1],[492,2],[568,2],[571,2],[585,1],[624,2],[680,2],[683,2],[720,1],[722,2],[774,2],[777,1],[806,2],[852,2],[877,2],[880,2],[922,2],[968,1],[992,2],[995,2],[1041,2],[1095,2],[1098,2],[1173,2],[1244,2],[1247,2],[1324,1]]},"1554":{"position":[[18,1],[50,1],[105,1],[121,2],[163,1],[214,2],[309,1]]},"1556":{"position":[[58,2],[75,2],[172,3]]},"1562":{"position":[[77,1],[157,1],[416,2],[467,2],[510,2],[633,3],[637,2],[718,2],[833,3],[837,2],[858,1],[1012,3],[1016,2],[1048,2],[1124,2],[1131,1],[1175,1],[1244,3],[1248,2],[1446,1],[1496,2],[1499,2],[1502,3],[1506,2],[1673,1],[1704,2],[1722,1],[1756,1],[1758,2],[1761,3],[1765,2],[1872,3]]},"1564":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[289,2],[330,2],[333,2],[401,2],[447,2],[450,2],[521,2],[556,2],[559,2],[648,2],[734,2],[737,2],[786,2],[879,2],[882,2],[928,2],[989,2],[992,2],[1018,1],[1064,2],[1109,2],[1112,2],[1151,2],[1215,2],[1218,2],[1324,1]]},"1566":{"position":[[18,1],[175,1],[235,1]]},"1568":{"position":[[0,2],[26,1],[35,1],[51,1],[71,1],[95,1],[116,1],[131,1],[145,1],[161,1],[180,1],[199,1],[215,1],[229,1],[247,1],[269,1],[280,2],[310,1],[322,2],[353,1],[389,1],[405,2],[441,1],[450,2],[479,1],[510,1],[537,1],[556,1],[566,2],[616,1],[628,2],[659,1],[674,2],[706,1],[722,2],[750,1],[761,2],[786,1],[796,2],[822,1],[834,2],[862,1],[874,2],[893,1],[910,1],[927,1],[947,1],[966,1],[986,1],[1006,1],[1024,1],[1043,1],[1053,1]]},"1574":{"position":[[77,1],[158,1],[236,2],[336,2],[379,2],[416,2],[740,2],[749,1],[846,2]]},"1576":{"position":[[0,2],[64,1],[66,2],[88,2],[91,2],[142,2],[160,2],[163,2],[217,2],[279,2],[282,2],[323,2],[394,2],[397,2],[452,2],[500,2],[503,2],[549,2],[598,1],[631,2],[634,2],[745,2],[799,1],[832,2],[835,2],[955,1]]},"1578":{"position":[[18,1],[297,3],[301,1]]},"1584":{"position":[[77,1],[156,1],[234,2],[284,2],[327,2],[501,2]]},"1586":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[255,2],[317,2],[348,2],[351,2],[373,2],[390,1]]},"1588":{"position":[[18,1],[39,1]]},"1592":{"position":[[0,2],[110,2],[257,2],[400,2],[634,2],[822,2],[1020,2],[1212,2]]},"1594":{"position":[[77,1],[156,1],[234,2],[301,2],[404,2],[407,2],[586,2],[589,2],[673,2],[846,2],[1034,3],[1038,2],[1110,1],[1116,2],[1171,2],[1196,2],[1203,1],[1216,1],[1218,2],[1311,2],[1314,2],[1406,1],[1415,2],[1468,2],[1475,1],[1488,1],[1490,2],[1583,2],[1586,2],[1695,1],[1704,2],[1763,1],[1773,2],[1780,1],[1793,1],[1795,2],[1888,2],[1891,2],[1984,1],[1993,2],[2070,2],[2077,1],[2090,1],[2092,2],[2185,2],[2188,2],[2351,2],[2354,3],[2358,2],[2534,2],[2577,1],[2634,2],[2678,1],[2735,2],[2738,3],[2742,2],[2950,3]]},"1596":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[256,2],[259,2],[302,2],[355,2],[358,2],[387,2],[436,2],[439,2],[493,2],[544,2],[547,2],[602,2],[671,2],[674,2],[727,2],[780,2],[825,2],[891,2],[965,2],[1039,2],[1096,2],[1154,2],[1231,2],[1300,1]]},"1598":{"position":[[18,1],[122,1]]},"1604":{"position":[[77,1],[158,1],[236,2],[288,2],[373,1],[397,2]]},"1606":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[244,2],[247,2],[297,2],[359,2],[362,2],[461,1]]},"1608":{"position":[[18,1],[109,1]]},"1614":{"position":[[20,1],[102,1],[116,1],[122,2],[238,2],[258,3],[303,1],[342,2],[388,1],[421,1],[423,1],[440,2],[463,1]]},"1616":{"position":[[0,2],[64,1],[66,2],[115,2],[168,2],[252,2],[297,2],[319,2],[338,2],[358,2],[396,2],[465,2],[501,2],[544,2],[642,1]]},"1618":{"position":[[18,1],[59,1]]},"1624":{"position":[[77,1],[160,1],[238,2],[292,2],[427,1],[448,2],[451,3]]},"1626":{"position":[[0,2],[64,1],[66,2],[137,2],[140,2],[195,2],[262,2],[265,2],[316,2],[383,2],[386,2],[443,2],[509,2],[547,2],[550,2],[605,1]]},"1628":{"position":[[199,1],[300,1]]},"1634":{"position":[[20,1],[101,1],[115,1],[121,2],[235,2],[238,3],[283,1],[322,2],[368,1],[401,1],[403,1],[420,2],[443,1]]},"1640":{"position":[[77,1],[158,1],[236,2],[265,2],[313,2],[368,1],[370,2],[408,2],[431,2],[438,1],[451,1],[453,2],[471,2],[491,2],[533,2],[554,2],[569,2],[603,2],[629,2],[652,2],[659,1],[672,1],[674,2],[748,1],[753,2],[776,2],[796,2],[803,1],[816,1],[871,2]]},"1642":{"position":[[0,2],[64,1],[66,2],[94,2],[124,1],[161,2],[208,2],[270,2],[341,2],[384,2],[455,2],[520,2],[550,2],[577,3],[601,2],[629,2],[656,3],[678,2],[717,2],[769,2],[811,2],[865,2],[894,2],[950,2],[1018,2],[1055,2],[1112,2],[1155,2],[1222,2],[1276,2],[1339,2],[1378,1]]},"1644":{"position":[[18,1],[43,1],[161,1]]},"1646":{"position":[[6,1],[28,1],[59,1],[92,1],[102,1]]},"1648":{"position":[[58,2],[75,2],[124,2],[173,2]]},"1654":{"position":[[77,1],[155,1],[245,1],[251,2],[323,1],[345,2],[364,3],[408,1],[457,2],[491,1],[533,1],[586,1]]},"1660":{"position":[[77,1],[158,1],[248,1],[254,2],[271,2],[299,1],[314,2],[358,1],[373,2],[426,2],[433,1],[481,1],[494,1],[585,1],[653,1],[661,2],[688,1],[695,1],[726,1],[728,1],[738,1],[777,1],[788,1],[801,1],[1026,1],[1075,1],[1081,2],[1098,2],[1126,1],[1141,2],[1185,1],[1200,2],[1268,2],[1275,1],[1323,1],[1336,1],[1453,1],[1536,1],[1544,2],[1571,1],[1578,1],[1609,1],[1611,1],[1621,1],[1649,1],[1660,1],[1673,1],[1716,1],[1722,2],[1743,2],[1825,2],[1855,1],[1862,2],[1915,1],[1962,2],[1969,1],[1989,1],[1999,1],[2027,2],[2034,1],[2054,1],[2067,1],[2165,1]]},"1663":{"position":[[497,1]]},"1675":{"position":[[0,2],[94,1]]},"1680":{"position":[[415,1],[492,2]]},"1682":{"position":[[545,1],[562,1],[564,3],[576,1],[596,1],[622,2],[629,1],[650,1],[657,1],[674,1],[716,1],[762,1]]},"1684":{"position":[[142,2],[219,1],[294,2],[297,2]]},"1688":{"position":[[180,1],[194,2]]},"1690":{"position":[[77,1],[163,1],[182,1],[201,1],[215,1],[217,2],[232,2],[254,2],[262,2],[269,2],[281,2],[389,3],[421,1],[472,1],[501,2],[504,2],[513,2],[521,2],[535,2],[644,3],[677,1],[730,1],[760,2],[763,2],[775,2],[786,2],[803,2],[912,3],[940,1],[993,1],[1026,2],[1029,2],[1043,2],[1091,1],[1098,2],[1129,2],[1136,1],[1180,1],[1187,1],[1234,1],[1236,2],[1270,1]]},"1693":{"position":[[244,1],[246,2],[310,2],[492,1],[579,1],[593,1],[599,2],[675,1],[716,2],[750,1],[1021,1],[1023,2],[1085,2],[1175,2]]},"1695":{"position":[[226,2],[275,1],[313,1],[315,2],[351,2],[386,2],[485,1],[492,1],[501,1],[503,2],[613,2],[700,1]]},"1697":{"position":[[539,2],[593,2],[620,2],[706,1],[708,2],[744,2],[779,2],[878,1],[885,1],[894,1],[896,2],[926,1],[993,2],[1000,1],[1002,2],[1119,1],[1121,2],[1155,2],[1158,2],[1161,2],[1164,3],[1195,1]]},"1700":{"position":[[480,1],[486,2],[569,2],[572,1],[574,3],[578,1]]},"1706":{"position":[[79,1],[85,2],[104,2],[137,2],[148,2],[180,2],[216,2],[257,2],[276,2],[308,2],[344,2],[385,2],[432,1],[493,1],[499,2],[518,2],[539,2],[550,2],[570,2],[606,2],[647,2],[666,2],[686,2],[722,2],[763,2],[810,1]]},"1708":{"position":[[131,1],[137,2],[160,2],[188,1],[226,1],[232,2],[253,2],[264,2],[309,1],[311,2],[376,2],[404,2],[445,2],[492,1]]},"1712":{"position":[[0,2],[77,1],[116,1],[153,1],[197,1],[235,1],[269,1],[310,1],[348,1]]},"1716":{"position":[[271,1],[309,1],[323,1],[329,2],[382,1],[482,1],[501,1],[503,1],[512,1],[514,2],[517,2],[531,2],[579,1],[600,1],[602,1],[613,1],[632,2],[681,1],[791,1],[872,1],[874,2],[886,2],[916,2]]},"1728":{"position":[[308,1],[346,1],[360,1],[366,2],[424,2],[525,1],[586,2],[589,3],[604,2],[633,1],[635,2],[646,2]]},"1731":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"1733":{"position":[[185,2],[243,4],[286,1],[316,2],[319,2],[414,1],[445,2],[448,2],[553,1],[589,2]]},"1735":{"position":[[372,2],[415,2],[418,2],[425,1],[658,4],[841,2],[916,1],[1012,2],[1015,2],[1091,1],[1128,2],[1131,2],[1202,1],[1242,2],[1245,2],[1321,1],[1358,2],[1361,2],[1553,1],[1595,2],[1620,1],[1622,1],[1636,3],[1796,4],[1928,2],[2037,1],[2116,2],[2134,2],[2137,2],[2233,1],[2306,2],[2317,2],[2476,2],[2607,1],[2683,2],[2694,2],[2915,2],[2927,2],[2946,1],[2948,4],[2962,1],[3002,2],[3017,2],[3036,1],[3074,2],[3105,2],[3122,1],[3143,1],[3185,2],[3217,2],[3234,1],[3253,1]]},"1737":{"position":[[1339,1],[1379,2],[1382,2],[1422,2],[1428,2],[1467,2],[1496,1],[1587,1],[1627,2],[1630,2],[1674,2],[1696,2],[1735,2],[1752,2],[1793,2],[1986,1],[2026,2],[2029,2],[2070,2],[2089,2],[2131,2],[2151,2],[2199,2],[2236,2],[2306,3],[2310,2],[2313,2],[2316,2],[2319,2],[2322,2],[2325,2],[2328,2],[2331,2],[2334,3],[2497,1],[2537,2],[2540,2],[2580,2],[2586,2],[2624,2],[2627,2],[2668,2]]},"1739":{"position":[[279,1],[281,2],[363,2],[405,2],[446,1],[485,2]]},"1741":{"position":[[82,1],[88,2],[107,2],[140,2],[151,2],[183,2],[219,2],[260,2],[279,2],[311,2],[347,2],[388,2],[435,1]]},"1744":{"position":[[97,1],[168,1],[298,2],[341,2],[383,2],[507,2],[867,1],[923,3],[927,2]]},"1746":{"position":[[188,1],[264,1],[278,1],[280,2],[334,2],[366,2],[423,2],[458,2],[468,2],[508,2],[550,2],[591,1],[593,2],[680,2],[683,2],[717,1]]},"1749":{"position":[[407,1],[474,2],[548,2],[750,1],[778,1],[823,1],[838,1],[904,1],[938,2],[970,2],[977,1],[990,2],[1032,1],[1080,1],[1116,1],[1142,1],[1163,1],[1190,1],[1192,1],[1208,1],[1243,1],[1272,2],[1292,2],[1319,2],[1326,1],[1417,2],[1420,1],[1429,2],[1464,2],[1471,1],[1526,1],[1587,1],[1589,2],[1640,2],[1779,2],[1793,2]]},"1751":{"position":[[62,2],[644,2],[761,2],[812,2],[938,2],[1006,1],[1050,2],[1053,2],[1127,1],[1172,2],[1406,2],[1460,1],[1478,2],[1481,2],[1558,1],[1576,2],[1579,2],[1711,1],[1729,2],[1732,2],[1801,1],[1863,2],[1891,1],[1909,2]]},"1754":{"position":[[349,2],[469,1],[489,2],[522,2],[563,2],[603,2],[669,2],[730,2],[733,2],[753,2],[756,2],[759,2],[762,3],[766,2],[779,2],[827,4],[874,1],[920,2],[1005,2],[1063,2],[1066,3],[1077,3],[1118,2],[1121,3],[1125,2],[1191,2],[1234,2],[1275,2],[1350,1],[1394,2],[1447,2],[1498,2],[1506,2],[1509,3],[1513,2]]},"1756":{"position":[[141,2],[226,1],[242,2],[265,2],[268,3],[272,2],[275,2],[360,1],[376,2],[401,2],[404,3],[408,2]]},"1758":{"position":[[166,1],[199,2]]},"1760":{"position":[[262,1],[322,2],[325,2],[395,2],[398,2],[449,2],[452,3],[456,2]]},"1762":{"position":[[172,1],[189,2],[192,2],[268,2],[271,2],[327,2],[330,2],[357,2],[360,3],[364,2]]},"1764":{"position":[[31,1],[101,2],[181,1],[195,2],[218,2],[221,3],[225,2]]},"1766":{"position":[[211,1],[257,2],[260,2],[301,1],[344,2],[378,2]]},"1768":{"position":[[76,2],[166,1],[168,2],[227,2],[250,2]]},"1770":{"position":[[452,2],[524,1],[624,1],[665,1],[669,2],[691,2],[715,2],[722,1],[735,1],[757,2],[785,2],[792,2],[795,3],[799,2],[802,2],[848,2],[961,2],[1085,2],[1197,2],[1260,2]]},"1772":{"position":[[151,1],[153,2],[192,2],[249,2],[343,2],[346,3],[350,2],[718,1],[808,1],[855,2],[858,2],[861,3],[865,2],[912,1],[953,2],[1020,1],[1060,2],[1063,2],[1066,3],[1070,2]]},"1774":{"position":[[330,2],[405,1],[411,2],[434,2],[437,3],[441,2]]},"1778":{"position":[[77,1],[387,1],[435,1],[437,2],[461,2],[494,1],[516,1],[539,1],[559,1],[572,2],[603,2],[606,3],[610,2]]},"1780":{"position":[[243,1],[245,2],[285,2],[321,2],[330,2],[333,3],[337,2]]},"1782":{"position":[[398,1],[447,2],[450,2],[540,2],[543,2],[566,2]]},"1784":{"position":[[286,1],[288,2],[336,2],[339,2],[356,2],[403,2],[406,2],[430,2],[484,2],[487,2],[506,2],[509,2],[512,2]]},"1786":{"position":[[216,1],[218,2],[274,2],[300,2],[392,2]]},"1788":{"position":[[214,1],[216,2],[279,2],[282,2],[295,2],[311,2],[314,2],[317,2]]},"1792":{"position":[[208,1],[232,2],[270,2],[313,2],[323,2],[326,2],[329,2]]},"1796":{"position":[[219,1],[253,2],[327,2],[380,2],[390,2],[393,2],[396,2]]},"1800":{"position":[[222,1],[319,1],[420,1],[434,2],[514,2],[517,2]]},"1802":{"position":[[106,2],[176,1],[191,2],[207,2],[210,3],[214,2]]},"1804":{"position":[[128,1],[137,2],[152,2],[155,3],[159,2],[289,2],[356,2]]},"1806":{"position":[[129,2],[213,1],[223,2],[260,2],[263,3],[267,2]]},"1808":{"position":[[256,2],[336,1],[351,2],[373,2],[394,2],[403,2],[406,3],[410,2]]},"1810":{"position":[[87,1],[135,1],[137,2],[218,2],[221,3],[225,2]]},"1812":{"position":[[218,1],[242,1],[286,1],[288,2],[316,2],[355,1],[377,2],[380,2],[414,2],[417,2],[504,2],[507,2],[510,2],[544,2],[547,2],[581,2]]},"1814":{"position":[[336,1],[360,1],[400,1],[402,2],[430,2],[469,1],[492,2],[495,2],[572,2],[575,2],[619,2]]},"1816":{"position":[[184,1],[289,1],[291,2],[351,2],[404,2],[407,3],[411,2]]},"1818":{"position":[[331,1],[375,2],[421,1],[443,2],[454,1],[518,1],[563,2]]},"1820":{"position":[[165,1],[234,2]]},"1822":{"position":[[261,1],[274,2],[311,2],[318,2],[321,3],[325,2]]},"1824":{"position":[[279,1],[281,2],[323,2],[349,2],[356,1],[358,2],[361,2],[389,2],[424,1],[428,1],[430,2],[470,1],[472,2],[517,2],[543,2],[546,2],[573,2],[608,2],[623,1],[695,2],[698,2],[741,2],[775,2],[836,2],[843,1],[856,1],[858,1],[860,1],[873,2]]},"1826":{"position":[[279,1],[323,2],[364,1],[408,2],[449,1],[514,2]]},"1828":{"position":[[87,2],[170,1],[188,2],[213,2],[216,3],[220,2]]},"1830":{"position":[[174,5],[290,2],[375,1],[394,2],[405,2],[408,3],[412,2],[415,2],[500,1],[516,2],[546,2],[561,2],[564,3],[568,2],[599,2],[672,2],[695,2],[743,2],[771,2],[978,1],[994,2],[1046,2]]},"1832":{"position":[[343,2],[424,1],[434,2],[455,2],[479,2],[482,3],[486,2]]},"1834":{"position":[[302,2],[383,1],[391,2],[450,2],[467,2],[470,3],[474,2]]},"1836":{"position":[[247,2],[332,1],[343,2],[380,2],[391,2],[394,3],[398,2]]},"1838":{"position":[[120,2],[184,1],[199,2],[209,2],[212,3],[216,2]]},"1840":{"position":[[182,2],[278,1],[282,2],[307,2],[333,2],[352,2],[355,2],[358,2],[361,3],[365,2],[376,2],[484,1],[488,2],[515,2],[539,2],[549,2],[560,2],[698,1],[702,2],[729,2],[750,2],[769,2],[780,2],[791,2],[905,1],[909,2],[949,2],[984,2],[998,2],[1009,2],[1217,1],[1221,2],[1246,2],[1288,2],[1340,2],[1368,2],[1418,2],[1428,2]]},"1842":{"position":[[334,2],[421,1],[440,2],[467,2],[502,2],[512,2],[515,3],[519,2]]},"1844":{"position":[[458,2],[554,1],[582,2],[623,2],[652,2],[687,2],[713,2],[746,2],[754,2],[757,3],[761,2]]},"1846":{"position":[[526,2],[618,1],[643,2],[678,2],[711,2],[737,2],[764,2],[769,2],[772,3],[776,2]]},"1848":{"position":[[516,2],[608,1],[638,2],[665,2],[690,2],[712,2],[717,2],[720,3],[724,2]]},"1850":{"position":[[302,2],[374,1],[467,1],[507,1],[511,2],[533,2],[558,2],[565,1],[578,1],[600,2],[628,2],[659,2],[674,2],[677,3],[681,2],[684,2],[729,2]]},"1852":{"position":[[132,2],[203,1],[207,2],[234,2],[245,1],[253,2],[271,1],[288,2],[302,1],[304,1],[306,2]]},"1854":{"position":[[313,1],[344,2],[391,1],[454,4],[459,2],[514,1],[661,2]]},"1856":{"position":[[449,1],[451,2],[526,2],[529,2],[582,1],[584,2],[796,2],[799,2],[850,1]]},"1858":{"position":[[347,1],[382,2],[427,1],[512,2],[557,1],[586,2]]},"1862":{"position":[[143,1],[173,2],[176,2],[193,2]]},"1864":{"position":[[312,2],[384,1],[489,1],[529,1],[533,2],[555,2],[584,2],[591,1],[604,1],[626,2],[654,2],[685,2],[700,2],[703,3],[707,2],[710,2],[755,2]]},"1866":{"position":[[147,1],[206,2],[209,2],[239,2]]},"1868":{"position":[[398,1],[433,2],[477,1],[520,2]]},"1870":{"position":[[81,2],[161,1],[165,2],[230,2],[265,2],[268,3],[272,2],[434,1],[468,1],[481,2],[499,2],[510,3],[518,2],[540,2],[558,2],[595,1],[597,1]]},"1872":{"position":[[176,1],[178,2],[220,2],[246,2],[253,1],[255,2],[258,2],[277,2],[322,2],[348,2],[351,2],[378,2],[413,2],[428,1],[500,2],[503,2],[546,2],[580,2],[641,2],[648,1],[661,1],[663,1],[676,1],[678,2]]},"1874":{"position":[[201,2],[256,1],[258,2],[300,2],[326,2],[333,1],[335,2],[338,2],[357,2],[402,2],[428,2],[431,2],[458,2],[493,2],[508,1],[580,2],[583,2],[626,2],[663,2],[742,2],[749,1],[762,1],[764,1],[777,1],[779,2]]},"1876":{"position":[[32,1],[116,2],[166,2]]},"1878":{"position":[[123,1],[164,2],[167,2],[186,2],[504,1],[543,2],[546,2],[627,2],[630,2],[649,2]]},"1880":{"position":[[322,1],[364,2],[436,2],[635,1],[690,2]]},"1882":{"position":[[262,1],[289,2],[292,2],[379,2],[382,2],[405,2]]},"1884":{"position":[[165,1],[203,2],[206,2],[236,2],[239,3],[243,2]]},"1886":{"position":[[314,2],[353,2],[390,2],[467,1],[471,2],[507,1],[509,2],[594,1],[629,1],[677,2],[717,2],[724,1],[752,1],[777,1],[790,2],[863,1],[865,2],[1024,2],[1027,2],[1118,1],[1244,1],[1289,1],[1375,2],[1421,1],[1508,2],[1511,2],[1601,2]]},"1888":{"position":[[168,1],[174,2],[220,2],[268,2],[271,3],[275,2]]},"1892":{"position":[[166,1],[204,1],[249,1],[317,1],[362,1],[434,2]]},"1894":{"position":[[268,2],[342,1],[359,2],[398,2],[410,2],[413,3],[417,2]]},"1896":{"position":[[207,1],[225,2],[228,2],[258,2],[261,2],[290,2],[293,2],[332,2],[335,2],[372,2],[375,3],[379,2]]},"1898":{"position":[[238,1],[244,2],[263,2],[308,2],[311,3],[315,2]]},"1900":{"position":[[288,1],[307,2],[310,2],[347,2],[350,2],[378,2],[412,2],[415,2],[479,2],[482,2],[535,2],[538,3],[542,2]]},"1902":{"position":[[139,1],[174,2],[177,2],[236,2],[268,2]]},"1904":{"position":[[164,1],[172,2],[213,2],[216,2],[275,2],[307,2]]},"1906":{"position":[[141,1],[174,2],[177,2],[236,2],[268,2]]},"1908":{"position":[[220,2],[294,1],[304,2],[312,2],[315,3],[319,2]]},"1910":{"position":[[222,1],[302,1],[342,1],[344,2],[372,2],[411,1],[432,2],[443,2],[465,2],[482,2],[494,2]]}}}],["0",{"_index":387,"t":{"803":{"position":[[457,2]]},"874":{"position":[[492,1]]},"902":{"position":[[251,1]]},"904":{"position":[[86,2]]},"942":{"position":[[341,2]]},"1082":{"position":[[325,2]]},"1084":{"position":[[402,1]]},"1086":{"position":[[106,2]]},"1112":{"position":[[201,1]]},"1114":{"position":[[274,2]]},"1182":{"position":[[216,2]]},"1223":{"position":[[2316,2]]},"1296":{"position":[[238,2],[345,2]]},"1378":{"position":[[1411,1],[1443,1]]},"1380":{"position":[[271,2]]},"1388":{"position":[[316,1]]},"1392":{"position":[[64,1]]},"1400":{"position":[[1686,2]]},"1402":{"position":[[306,2]]},"1418":{"position":[[74,3],[296,1]]},"1468":{"position":[[674,2]]},"1502":{"position":[[889,2]]},"1504":{"position":[[111,2]]},"1512":{"position":[[210,4],[501,2]]},"1514":{"position":[[43,4]]},"1675":{"position":[[176,1]]},"1754":{"position":[[1098,1]]},"1824":{"position":[[426,1]]},"1832":{"position":[[243,4]]},"1846":{"position":[[405,4],[740,1]]},"1848":{"position":[[405,4],[715,1]]}}}],["0.1.7",{"_index":3915,"t":{"1735":{"position":[[3499,5]]}}}],["0.4",{"_index":3661,"t":{"1673":{"position":[[72,3]]}}}],["0.7",{"_index":3658,"t":{"1671":{"position":[[70,3]]}}}],["01",{"_index":3959,"t":{"1737":{"position":[[1108,4],[1126,2]]},"1886":{"position":[[570,2],[697,2]]}}}],["02",{"_index":3178,"t":{"1516":{"position":[[324,2]]},"1562":{"position":[[967,3]]},"1737":{"position":[[1113,4]]},"1886":{"position":[[573,2],[700,4]]}}}],["0666",{"_index":3303,"t":{"1562":{"position":[[1111,5]]}}}],["08",{"_index":3965,"t":{"1737":{"position":[[1185,2],[2193,2],[2207,2]]}}}],["0rtt",{"_index":2991,"t":{"1418":{"position":[[835,5]]}}}],["1",{"_index":912,"t":{"942":{"position":[[390,2]]},"946":{"position":[[202,1]]},"1096":{"position":[[332,1]]},"1100":{"position":[[55,1],[94,2]]},"1124":{"position":[[402,1]]},"1126":{"position":[[839,1]]},"1128":{"position":[[180,1]]},"1156":{"position":[[145,2]]},"1190":{"position":[[1261,2],[2649,1],[4469,2],[4631,1]]},"1235":{"position":[[169,1]]},"1265":{"position":[[222,1]]},"1296":{"position":[[734,2]]},"1378":{"position":[[280,1]]},"1380":{"position":[[51,1]]},"1386":{"position":[[406,1],[595,1]]},"1388":{"position":[[297,1],[337,1]]},"1392":{"position":[[47,1],[83,1]]},"1408":{"position":[[445,1]]},"1410":{"position":[[1356,1]]},"1412":{"position":[[119,1]]},"1418":{"position":[[277,1]]},"1424":{"position":[[355,4]]},"1428":{"position":[[66,3]]},"1468":{"position":[[559,1],[623,2],[763,1]]},"1512":{"position":[[1371,5]]},"1514":{"position":[[284,5]]},"1534":{"position":[[395,1]]},"1536":{"position":[[661,1]]},"1538":{"position":[[463,1]]},"1552":{"position":[[583,1]]},"1554":{"position":[[48,1]]},"1596":{"position":[[696,1]]},"1616":{"position":[[279,3],[351,6]]},"1735":{"position":[[3116,4],[3228,4]]},"1737":{"position":[[1481,2],[1749,2]]},"1754":{"position":[[1390,3],[1407,2]]},"1756":{"position":[[379,7]]},"1764":{"position":[[141,1]]},"1800":{"position":[[480,3]]},"1846":{"position":[[368,2],[708,2],[714,1]]},"1848":{"position":[[368,2],[635,2],[662,2],[668,1],[687,2],[693,1]]}}}],["1,001.01e8",{"_index":3932,"t":{"1737":{"position":[[510,10]]}}}],["1,146,667",{"_index":3660,"t":{"1673":{"position":[[14,9]]}}}],["1,2,3",{"_index":4307,"t":{"1840":{"position":[[772,7]]}}}],["1.0",{"_index":734,"t":{"869":{"position":[[595,3]]}}}],["1.1",{"_index":3663,"t":{"1673":{"position":[[152,3]]}}}],["1.14/1.15",{"_index":806,"t":{"884":{"position":[[33,11]]}}}],["1.16",{"_index":3107,"t":{"1488":{"position":[[557,6]]},"1490":{"position":[[84,5]]},"1502":{"position":[[471,4]]}}}],["1.17",{"_index":1148,"t":{"1132":{"position":[[11,4]]},"1210":{"position":[[39,4]]}}}],["1.18",{"_index":539,"t":{"817":{"position":[[55,4]]},"892":{"position":[[82,4]]}}}],["1.234",{"_index":3931,"t":{"1737":{"position":[[502,6]]}}}],["1.3",{"_index":2978,"t":{"1418":{"position":[[152,3]]}}}],["1.3'",{"_index":2973,"t":{"1418":{"position":[[57,5]]}}}],["10",{"_index":822,"t":{"886":{"position":[[366,2]]},"888":{"position":[[636,2]]},"890":{"position":[[170,2]]},"914":{"position":[[300,2]]},"916":{"position":[[258,2]]},"918":{"position":[[82,2]]},"998":{"position":[[258,2]]},"1000":{"position":[[75,2]]},"1002":{"position":[[40,2]]},"1026":{"position":[[342,2],[567,2]]},"1028":{"position":[[860,2]]},"1030":{"position":[[147,2]]},"1040":{"position":[[342,2],[535,2],[749,2]]},"1042":{"position":[[875,2]]},"1044":{"position":[[147,2]]},"1068":{"position":[[319,2]]},"1070":{"position":[[1015,2]]},"1072":{"position":[[206,2]]},"1082":{"position":[[368,2]]},"1084":{"position":[[1456,2]]},"1086":{"position":[[149,2]]},"1124":{"position":[[329,2]]},"1126":{"position":[[319,2]]},"1128":{"position":[[107,2]]},"1223":{"position":[[2102,2],[2749,2]]},"1663":{"position":[[565,2]]},"1675":{"position":[[182,2]]},"1856":{"position":[[774,5]]},"1886":{"position":[[1568,2],[1677,2]]}}}],["10*time.second",{"_index":3610,"t":{"1660":{"position":[[2117,16]]}}}],["10.1",{"_index":2229,"t":{"1336":{"position":[[1380,4]]}}}],["10.4.1",{"_index":2265,"t":{"1336":{"position":[[1840,6]]}}}],["100",{"_index":1124,"t":{"1124":{"position":[[361,4],[380,4]]},"1126":{"position":[[585,4],[711,4]]},"1128":{"position":[[139,4],[158,4]]},"1336":{"position":[[1271,3]]},"1675":{"position":[[189,3],[580,4]]}}}],["1000",{"_index":3676,"t":{"1675":{"position":[[585,5]]},"1682":{"position":[[652,4]]}}}],["101",{"_index":2224,"t":{"1336":{"position":[[1321,3]]}}}],["102",{"_index":2227,"t":{"1336":{"position":[[1363,3]]}}}],["1024",{"_index":2673,"t":{"1341":{"position":[[509,4],[516,4],[1001,4]]}}}],["103",{"_index":2231,"t":{"1336":{"position":[[1404,3]]}}}],["10m",{"_index":1103,"t":{"1096":{"position":[[316,6]]},"1098":{"position":[[73,6]]}}}],["11",{"_index":1512,"t":{"1184":{"position":[[724,3]]},"1737":{"position":[[1123,2]]}}}],["11,846",{"_index":3649,"t":{"1667":{"position":[[14,6]]}}}],["11.1",{"_index":2257,"t":{"1336":{"position":[[1758,4]]}}}],["11.2",{"_index":2353,"t":{"1336":{"position":[[3161,4],[5562,4]]}}}],["11.3",{"_index":2356,"t":{"1336":{"position":[[3198,4],[5615,4]]}}}],["11.4",{"_index":2359,"t":{"1336":{"position":[[3245,4],[5688,4]]}}}],["11.5",{"_index":2400,"t":{"1336":{"position":[[3923,4],[6755,4]]}}}],["111",{"_index":4285,"t":{"1834":{"position":[[461,5]]}}}],["117.2",{"_index":3656,"t":{"1669":{"position":[[148,5]]}}}],["12",{"_index":1407,"t":{"1178":{"position":[[923,3],[1025,3]]},"1737":{"position":[[723,2],[1425,2]]}}}],["120",{"_index":3948,"t":{"1737":{"position":[[867,4],[962,4]]}}}],["120000",{"_index":3974,"t":{"1737":{"position":[[1688,7]]}}}],["123",{"_index":659,"t":{"839":{"position":[[1736,5]]},"869":{"position":[[562,3]]},"1832":{"position":[[462,3]]}}}],["12345.pdf",{"_index":4158,"t":{"1782":{"position":[[434,12],[469,9],[513,11]]}}}],["123456",{"_index":916,"t":{"946":{"position":[[120,9]]},"1366":{"position":[[356,9],[506,9],[663,8]]}}}],["123456789",{"_index":3922,"t":{"1737":{"position":[[377,10],[389,9]]}}}],["125",{"_index":3983,"t":{"1737":{"position":[[2084,4]]}}}],["127.0.0.1",{"_index":1008,"t":{"1012":{"position":[[256,12]]},"1014":{"position":[[225,11]]},"1016":{"position":[[53,12]]},"1026":{"position":[[248,12]]},"1028":{"position":[[267,11]]},"1030":{"position":[[53,12]]},"1040":{"position":[[248,12]]},"1042":{"position":[[345,11]]},"1044":{"position":[[53,12]]},"1070":{"position":[[398,11]]},"1072":{"position":[[92,12]]},"1082":{"position":[[262,12]]},"1084":{"position":[[84,11]]},"1086":{"position":[[34,12]]},"1548":{"position":[[416,11]]},"1804":{"position":[[140,11]]},"1806":{"position":[[157,10],[237,12]]}}}],["127.0.0.1:11211",{"_index":999,"t":{"986":{"position":[[113,17]]},"988":{"position":[[37,18]]}}}],["127.0.0.1:3000",{"_index":3077,"t":{"1468":{"position":[[525,14]]}}}],["127.0.0.1:3000/debug/var",{"_index":3078,"t":{"1468":{"position":[[566,25]]}}}],["127.0.0.1:3000/debug/vars?r=c",{"_index":3085,"t":{"1468":{"position":[[702,29]]}}}],["127.0.0.1:8091",{"_index":909,"t":{"942":{"position":[[287,17]]},"946":{"position":[[73,17]]}}}],["13",{"_index":3053,"t":{"1458":{"position":[[306,3]]}}}],["1433",{"_index":1018,"t":{"1026":{"position":[[267,5]]},"1028":{"position":[[355,4]]},"1030":{"position":[[72,5]]}}}],["15",{"_index":963,"t":{"958":{"position":[[2668,2],[2722,2]]}}}],["15:04:05",{"_index":3325,"t":{"1564":{"position":[[759,8]]},"1566":{"position":[[126,11]]}}}],["15th",{"_index":1689,"t":{"1208":{"position":[[363,5]]}}}],["16",{"_index":4059,"t":{"1754":{"position":[[1375,4]]}}}],["1638",{"_index":3927,"t":{"1737":{"position":[[453,4],[463,4]]}}}],["18",{"_index":3944,"t":{"1737":{"position":[[798,3],[942,2]]}}}],["18.04.3",{"_index":3630,"t":{"1663":{"position":[[523,7]]}}}],["1831710635",{"_index":3054,"t":{"1458":{"position":[[310,11],[541,11]]}}}],["185",{"_index":1724,"t":{"1212":{"position":[[1552,5]]},"1341":{"position":[[4103,5]]}}}],["19",{"_index":3943,"t":{"1737":{"position":[[763,2]]}}}],["19,664",{"_index":3653,"t":{"1669":{"position":[[14,6]]}}}],["1;q=0.2",{"_index":4053,"t":{"1754":{"position":[[1226,7]]}}}],["1e7",{"_index":1100,"t":{"1096":{"position":[[271,4]]},"1100":{"position":[[41,4]]}}}],["1gb",{"_index":1107,"t":{"1096":{"position":[[366,6]]},"1098":{"position":[[131,6]]}}}],["1s",{"_index":1968,"t":{"1265":{"position":[[168,2]]}}}],["2",{"_index":231,"t":{"771":{"position":[[460,1]]},"849":{"position":[[1145,2]]},"884":{"position":[[26,1]]},"898":{"position":[[43,1]]},"912":{"position":[[24,1]]},"926":{"position":[[23,1]]},"940":{"position":[[27,1]]},"954":{"position":[[26,1]]},"958":{"position":[[175,3]]},"968":{"position":[[22,1]]},"974":{"position":[[80,1]]},"982":{"position":[[24,1]]},"996":{"position":[[24,1]]},"1010":{"position":[[25,1]]},"1024":{"position":[[23,1]]},"1038":{"position":[[23,1]]},"1052":{"position":[[24,1]]},"1066":{"position":[[26,1]]},"1080":{"position":[[23,1]]},"1094":{"position":[[27,1]]},"1108":{"position":[[20,1]]},"1122":{"position":[[25,1]]},"1184":{"position":[[371,3],[471,1],[540,1]]},"1190":{"position":[[3533,1]]},"1388":{"position":[[364,1]]},"1392":{"position":[[108,1]]},"1434":{"position":[[677,1]]},"1440":{"position":[[258,1]]},"1536":{"position":[[1356,4],[1807,2]]},"1616":{"position":[[283,2]]},"1640":{"position":[[750,2]]},"1735":{"position":[[3137,4],[3247,4]]},"1754":{"position":[[777,1]]},"1772":{"position":[[1022,4]]},"1848":{"position":[[641,1]]},"1894":{"position":[[133,2]]}}}],["2*time.second",{"_index":3584,"t":{"1660":{"position":[[538,15],[1391,14]]}}}],["2,066",{"_index":3651,"t":{"1667":{"position":[[94,5]]}}}],["2.0",{"_index":3646,"t":{"1665":{"position":[[444,3]]}}}],["2.20ghz",{"_index":3626,"t":{"1663":{"position":[[499,7]]}}}],["2.3.3",{"_index":2346,"t":{"1336":{"position":[[3060,5],[5404,5]]}}}],["2.30ghz",{"_index":3666,"t":{"1675":{"position":[[96,7]]}}}],["20",{"_index":1222,"t":{"1140":{"position":[[87,2]]},"1548":{"position":[[436,3]]},"1550":{"position":[[176,3]]},"1812":{"position":[[351,3],[446,4],[500,3],[576,4]]},"1814":{"position":[[465,3],[532,4],[614,4]]},"1886":{"position":[[1571,2],[1680,3]]},"1910":{"position":[[407,3]]}}}],["200",{"_index":1828,"t":{"1227":{"position":[[221,3]]},"1336":{"position":[[1431,3]]},"1660":{"position":[[813,3]]}}}],["2005",{"_index":3960,"t":{"1737":{"position":[[1118,4]]}}}],["2006",{"_index":3298,"t":{"1562":{"position":[[975,6]]},"1886":{"position":[[565,4]]}}}],["201",{"_index":2236,"t":{"1336":{"position":[[1470,3]]}}}],["202",{"_index":2239,"t":{"1336":{"position":[[1510,3]]}}}],["2020",{"_index":1690,"t":{"1208":{"position":[[369,5]]}}}],["2022",{"_index":3964,"t":{"1737":{"position":[[1180,4],[2202,4]]}}}],["203",{"_index":2242,"t":{"1336":{"position":[[1569,3]]}}}],["204",{"_index":2245,"t":{"1336":{"position":[[1610,3]]}}}],["2048",{"_index":489,"t":{"809":{"position":[[604,5]]}}}],["205",{"_index":2248,"t":{"1336":{"position":[[1654,3]]}}}],["206",{"_index":2251,"t":{"1336":{"position":[[1700,3]]}}}],["207",{"_index":2255,"t":{"1336":{"position":[[1741,3]]}}}],["208",{"_index":2259,"t":{"1336":{"position":[[1787,3]]}}}],["226",{"_index":2263,"t":{"1336":{"position":[[1823,3]]}}}],["2295",{"_index":2396,"t":{"1336":{"position":[[3868,5],[6671,5]]}}}],["23",{"_index":1455,"t":{"1180":{"position":[[938,3],[966,2]]}}}],["24",{"_index":3551,"t":{"1642":{"position":[[121,2]]},"1644":{"position":[[40,2]]}}}],["244,847",{"_index":3662,"t":{"1673":{"position":[[96,7]]}}}],["25",{"_index":945,"t":{"958":{"position":[[1341,2],[2037,2]]}}}],["25.7",{"_index":3654,"t":{"1669":{"position":[[69,4]]}}}],["250",{"_index":3976,"t":{"1737":{"position":[[1796,3]]}}}],["2518",{"_index":2228,"t":{"1336":{"position":[[1374,5]]}}}],["256",{"_index":2686,"t":{"1341":{"position":[[995,3]]}}}],["27",{"_index":3966,"t":{"1737":{"position":[[1188,2],[2196,2],[2210,2]]}}}],["27017",{"_index":1009,"t":{"1012":{"position":[[275,6]]},"1014":{"position":[[313,5]]},"1016":{"position":[[72,6]]}}}],["2774",{"_index":2406,"t":{"1336":{"position":[[4001,5],[6876,5]]}}}],["28",{"_index":3620,"t":{"1663":{"position":[[454,2]]}}}],["2]string",{"_index":693,"t":{"849":{"position":[[1095,9]]}}}],["2beb887efd54",{"_index":4181,"t":{"1796":{"position":[[281,13]]}}}],["3",{"_index":855,"t":{"902":{"position":[[658,1]]},"904":{"position":[[116,2]]},"942":{"position":[[363,2]]},"946":{"position":[[174,1]]},"958":{"position":[[1010,1]]},"960":{"position":[[93,2]]},"1112":{"position":[[613,1]]},"1114":{"position":[[255,2]]},"1184":{"position":[[473,1]]},"1336":{"position":[[2192,1],[3383,1],[3535,1],[5899,1],[6149,1]]},"1576":{"position":[[185,1]]},"1594":{"position":[[1460,3]]},"1840":{"position":[[732,3],[753,3]]},"1846":{"position":[[675,2],[761,2],[767,1]]}}}],["3.1",{"_index":2294,"t":{"1336":{"position":[[2274,3],[4203,3]]}}}],["3.2",{"_index":2312,"t":{"1336":{"position":[[2542,3],[4609,3]]}}}],["30",{"_index":1105,"t":{"1096":{"position":[[337,3]]},"1100":{"position":[[60,3]]},"1376":{"position":[[442,2]]},"1526":{"position":[[342,2]]},"1528":{"position":[[179,2]]},"1548":{"position":[[452,2]]},"1550":{"position":[[192,2]]},"1675":{"position":[[537,2]]}}}],["300",{"_index":2267,"t":{"1336":{"position":[[1871,3]]}}}],["3000",{"_index":1961,"t":{"1263":{"position":[[226,8]]},"1352":{"position":[[357,4]]},"1354":{"position":[[271,4]]},"1356":{"position":[[320,4]]},"1358":{"position":[[190,4]]},"1360":{"position":[[201,4]]}}}],["301",{"_index":2270,"t":{"1336":{"position":[[1919,3]]},"1614":{"position":[[253,4]]},"1854":{"position":[[656,4]]}}}],["302",{"_index":2273,"t":{"1336":{"position":[[1956,3]]},"1616":{"position":[[566,3]]},"1854":{"position":[[179,3]]},"1856":{"position":[[187,3]]},"1858":{"position":[[215,3]]}}}],["303",{"_index":2276,"t":{"1336":{"position":[[1996,3]]}}}],["304",{"_index":2279,"t":{"1336":{"position":[[2039,3]]}}}],["305",{"_index":2282,"t":{"1336":{"position":[[2077,3]]}}}],["307",{"_index":2285,"t":{"1336":{"position":[[2126,3]]}}}],["308",{"_index":2288,"t":{"1336":{"position":[[2175,3]]}}}],["32",{"_index":2701,"t":{"1341":{"position":[[1952,4]]},"1432":{"position":[[92,2]]},"1434":{"position":[[289,2],[426,3]]},"1436":{"position":[[391,2],[476,3]]}}}],["32.23",{"_index":4335,"t":{"1846":{"position":[[646,5],[681,5]]}}}],["3229",{"_index":2264,"t":{"1336":{"position":[[1834,5]]}}}],["32gb",{"_index":3627,"t":{"1663":{"position":[[507,4]]}}}],["33",{"_index":3082,"t":{"1468":{"position":[[648,3]]}}}],["3306",{"_index":1027,"t":{"1040":{"position":[[267,5]]},"1042":{"position":[[433,4]]},"1044":{"position":[[72,5]]}}}],["339222389",{"_index":4004,"t":{"1749":{"position":[[623,9]]}}}],["354.1",{"_index":3648,"t":{"1665":{"position":[[518,5]]}}}],["36",{"_index":3186,"t":{"1526":{"position":[[670,2]]},"1528":{"position":[[291,3],[323,2]]}}}],["3600",{"_index":1798,"t":{"1223":{"position":[[2775,5]]},"1488":{"position":[[523,5]]}}}],["360641",{"_index":4260,"t":{"1824":{"position":[[716,6]]},"1872":{"position":[[521,6]]},"1874":{"position":[[601,6]]}}}],["367,069",{"_index":3647,"t":{"1665":{"position":[[462,7]]}}}],["368,647",{"_index":3657,"t":{"1671":{"position":[[14,7]]}}}],["390.44",{"_index":3652,"t":{"1667":{"position":[[148,6]]}}}],["3rd",{"_index":1514,"t":{"1184":{"position":[[793,3]]},"1700":{"position":[[158,3]]}}}],["4",{"_index":1503,"t":{"1184":{"position":[[475,3]]},"1336":{"position":[[3426,1],[5967,1]]},"1341":{"position":[[505,1]]},"1735":{"position":[[3514,2]]},"1737":{"position":[[579,1]]}}}],["4,302",{"_index":3655,"t":{"1669":{"position":[[94,5]]}}}],["4.1",{"_index":2253,"t":{"1336":{"position":[[1717,3],[2056,3]]}}}],["4.15.0",{"_index":3631,"t":{"1663":{"position":[[531,6]]}}}],["4.2",{"_index":2327,"t":{"1336":{"position":[[2759,3],[4934,3]]}}}],["4.3.1",{"_index":2179,"t":{"1336":{"position":[[79,5]]}}}],["4.3.2",{"_index":2181,"t":{"1336":{"position":[[118,5]]}}}],["4.3.3",{"_index":2183,"t":{"1336":{"position":[[157,5]]}}}],["4.3.4",{"_index":2185,"t":{"1336":{"position":[[194,5]]}}}],["4.3.5",{"_index":2190,"t":{"1336":{"position":[[271,5]]}}}],["4.3.6",{"_index":2192,"t":{"1336":{"position":[[316,5]]}}}],["4.3.7",{"_index":2194,"t":{"1336":{"position":[[361,5]]}}}],["4.3.8",{"_index":2196,"t":{"1336":{"position":[[402,5]]}}}],["4.4",{"_index":2339,"t":{"1336":{"position":[[2974,3],[5275,3]]},"1671":{"position":[[149,3]]}}}],["400",{"_index":364,"t":{"797":{"position":[[212,4]]},"823":{"position":[[271,3]]},"843":{"position":[[221,4]]},"1336":{"position":[[2213,3]]},"1534":{"position":[[839,3]]},"1552":{"position":[[855,3],[970,3]]}}}],["401",{"_index":362,"t":{"797":{"position":[[154,4]]},"803":{"position":[[333,3]]},"843":{"position":[[163,4]]},"849":{"position":[[330,3]]},"1336":{"position":[[2257,3]]},"1362":{"position":[[138,3]]},"1368":{"position":[[943,3]]},"1540":{"position":[[432,3]]}}}],["402",{"_index":2296,"t":{"1336":{"position":[[2302,3]]}}}],["403",{"_index":2299,"t":{"1336":{"position":[[2343,3]]}}}],["404",{"_index":2302,"t":{"1336":{"position":[[2383,3]]},"1680":{"position":[[229,3],[360,3]]},"1693":{"position":[[951,4]]},"1706":{"position":[[860,3]]},"1737":{"position":[[316,3]]}}}],["404.html",{"_index":3106,"t":{"1488":{"position":[[503,11]]}}}],["405",{"_index":2305,"t":{"1336":{"position":[[2431,3]]}}}],["406",{"_index":2308,"t":{"1336":{"position":[[2476,3]]}}}],["407",{"_index":2311,"t":{"1336":{"position":[[2525,3]]}}}],["408",{"_index":2314,"t":{"1336":{"position":[[2569,3]]},"1660":{"position":[[904,3]]}}}],["409",{"_index":2317,"t":{"1336":{"position":[[2609,3]]}}}],["4096",{"_index":2760,"t":{"1341":{"position":[[5564,4],[6974,4]]}}}],["410",{"_index":2320,"t":{"1336":{"position":[[2645,3]]}}}],["411",{"_index":2323,"t":{"1336":{"position":[[2691,3]]}}}],["412",{"_index":2326,"t":{"1336":{"position":[[2742,3]]}}}],["413",{"_index":2329,"t":{"1336":{"position":[[2793,3]]},"1341":{"position":[[464,3]]}}}],["414",{"_index":2332,"t":{"1336":{"position":[[2843,3]]}}}],["415",{"_index":2335,"t":{"1336":{"position":[[2896,3]]},"1882":{"position":[[295,3],[385,3]]}}}],["416",{"_index":2338,"t":{"1336":{"position":[[2957,3]]}}}],["417",{"_index":2341,"t":{"1336":{"position":[[3004,3]]}}}],["418",{"_index":2344,"t":{"1336":{"position":[[3043,3]]}}}],["42",{"_index":3183,"t":{"1524":{"position":[[54,2]]},"1737":{"position":[[2583,2]]}}}],["42.8",{"_index":3650,"t":{"1667":{"position":[[69,4]]}}}],["421",{"_index":2348,"t":{"1336":{"position":[[3093,3]]}}}],["422",{"_index":2352,"t":{"1336":{"position":[[3144,3]]}}}],["423",{"_index":2355,"t":{"1336":{"position":[[3181,3]]}}}],["424",{"_index":2358,"t":{"1336":{"position":[[3228,3]]}}}],["425",{"_index":2361,"t":{"1336":{"position":[[3267,3]]}}}],["426",{"_index":1723,"t":{"1212":{"position":[[1543,4]]},"1336":{"position":[[3313,3]]}}}],["428",{"_index":2367,"t":{"1336":{"position":[[3366,3]]}}}],["429",{"_index":2370,"t":{"1336":{"position":[[3409,3]]},"1552":{"position":[[274,3]]}}}],["431",{"_index":2372,"t":{"1336":{"position":[[3464,3]]}}}],["443",{"_index":594,"t":{"835":{"position":[[545,3]]}}}],["450b",{"_index":4179,"t":{"1796":{"position":[[271,4]]}}}],["451",{"_index":2374,"t":{"1336":{"position":[[3518,3]]}}}],["4918",{"_index":2256,"t":{"1336":{"position":[[1752,5],[3155,5],[3192,5],[3239,5],[3917,5],[5556,5],[5609,5],[5682,5],[6749,5]]}}}],["4gb",{"_index":3668,"t":{"1675":{"position":[[108,3]]}}}],["5",{"_index":942,"t":{"958":{"position":[[1246,2],[1942,2]]},"960":{"position":[[129,2],[152,2]]},"1336":{"position":[[3481,1],[6059,1]]},"1552":{"position":[[302,1]]},"1554":{"position":[[33,2]]},"1594":{"position":[[1624,1],[1765,3]]}}}],["5.2",{"_index":2363,"t":{"1336":{"position":[[3284,4],[5745,4]]}}}],["500",{"_index":2377,"t":{"1336":{"position":[[3565,3]]},"1564":{"position":[[1014,3]]},"1566":{"position":[[171,3]]},"1675":{"position":[[197,3]]},"1695":{"position":[[90,3],[342,3]]},"1697":{"position":[[735,3]]},"1852":{"position":[[291,5]]}}}],["5000",{"_index":3672,"t":{"1675":{"position":[[261,5],[591,4]]}}}],["501",{"_index":2380,"t":{"1336":{"position":[[3611,3]]}}}],["502",{"_index":2383,"t":{"1336":{"position":[[3653,3]]}}}],["503",{"_index":2386,"t":{"1336":{"position":[[3703,3]]},"1693":{"position":[[1026,3],[1088,3]]}}}],["504",{"_index":2389,"t":{"1336":{"position":[[3749,3]]}}}],["505",{"_index":2392,"t":{"1336":{"position":[[3804,3]]}}}],["506",{"_index":2395,"t":{"1336":{"position":[[3857,3]]}}}],["507",{"_index":2399,"t":{"1336":{"position":[[3906,3]]}}}],["508",{"_index":2402,"t":{"1336":{"position":[[3949,3]]}}}],["510",{"_index":2405,"t":{"1336":{"position":[[3990,3]]}}}],["511",{"_index":2409,"t":{"1336":{"position":[[4047,3]]}}}],["5120",{"_index":3625,"t":{"1663":{"position":[[488,4]]}}}],["5432",{"_index":1044,"t":{"1070":{"position":[[486,4]]},"1072":{"position":[[111,5]]}}}],["57,880",{"_index":3659,"t":{"1671":{"position":[[94,6]]}}}],["5789",{"_index":2188,"t":{"1336":{"position":[[229,4]]}}}],["5842",{"_index":2260,"t":{"1336":{"position":[[1798,5],[3960,5],[6814,5]]}}}],["6",{"_index":1431,"t":{"1178":{"position":[[1810,3],[1856,4]]},"1336":{"position":[[4064,1],[6978,1]]}}}],["6,162,556",{"_index":3645,"t":{"1665":{"position":[[386,9]]}}}],["6.2.1",{"_index":2222,"t":{"1336":{"position":[[1288,5]]}}}],["6.2.2",{"_index":2225,"t":{"1336":{"position":[[1338,5]]}}}],["6.3.1",{"_index":2234,"t":{"1336":{"position":[[1448,5]]}}}],["6.3.2",{"_index":2237,"t":{"1336":{"position":[[1487,5]]}}}],["6.3.3",{"_index":2240,"t":{"1336":{"position":[[1527,5]]}}}],["6.3.4",{"_index":2243,"t":{"1336":{"position":[[1586,5]]}}}],["6.3.5",{"_index":2246,"t":{"1336":{"position":[[1627,5]]}}}],["6.3.6",{"_index":2249,"t":{"1336":{"position":[[1671,5]]}}}],["6.4.1",{"_index":2268,"t":{"1336":{"position":[[1888,5]]}}}],["6.4.2",{"_index":2271,"t":{"1336":{"position":[[1936,5]]}}}],["6.4.3",{"_index":2274,"t":{"1336":{"position":[[1973,5]]}}}],["6.4.4",{"_index":2277,"t":{"1336":{"position":[[2013,5]]}}}],["6.4.5",{"_index":2283,"t":{"1336":{"position":[[2094,5]]}}}],["6.4.7",{"_index":2286,"t":{"1336":{"position":[[2143,5]]}}}],["6.5.1",{"_index":2291,"t":{"1336":{"position":[[2230,5],[4137,5]]}}}],["6.5.10",{"_index":2324,"t":{"1336":{"position":[[2708,6],[4855,6]]}}}],["6.5.11",{"_index":2330,"t":{"1336":{"position":[[2810,6],[5016,6]]}}}],["6.5.12",{"_index":2333,"t":{"1336":{"position":[[2860,6],[5093,6]]}}}],["6.5.13",{"_index":2336,"t":{"1336":{"position":[[2913,6],[5176,6]]}}}],["6.5.14",{"_index":2342,"t":{"1336":{"position":[[3021,6],[5349,6]]}}}],["6.5.15",{"_index":2365,"t":{"1336":{"position":[[3330,6],[5816,6]]}}}],["6.5.2",{"_index":2297,"t":{"1336":{"position":[[2319,5],[4273,5]]}}}],["6.5.3",{"_index":2300,"t":{"1336":{"position":[[2360,5],[4333,5]]}}}],["6.5.4",{"_index":2303,"t":{"1336":{"position":[[2400,5],[4391,5]]}}}],["6.5.5",{"_index":2306,"t":{"1336":{"position":[[2448,5],[4465,5]]}}}],["6.5.6",{"_index":2309,"t":{"1336":{"position":[[2493,5],[4533,5]]}}}],["6.5.7",{"_index":2315,"t":{"1336":{"position":[[2586,5],[4677,5]]}}}],["6.5.8",{"_index":2318,"t":{"1336":{"position":[[2626,5],[4735,5]]}}}],["6.5.9",{"_index":2321,"t":{"1336":{"position":[[2662,5],[4785,5]]}}}],["6.6.1",{"_index":2378,"t":{"1336":{"position":[[3582,5],[6225,5]]}}}],["6.6.2",{"_index":2381,"t":{"1336":{"position":[[3628,5],[6295,5]]}}}],["6.6.3",{"_index":2384,"t":{"1336":{"position":[[3670,5],[6357,5]]}}}],["6.6.4",{"_index":2387,"t":{"1336":{"position":[[3720,5],[6435,5]]}}}],["6.6.5",{"_index":2390,"t":{"1336":{"position":[[3766,5],[6505,5]]}}}],["6.6.6",{"_index":2393,"t":{"1336":{"position":[[3821,5],[6593,5]]}}}],["60",{"_index":901,"t":{"930":{"position":[[342,2]]},"932":{"position":[[123,2]]}}}],["600",{"_index":2869,"t":{"1376":{"position":[[702,7]]}}}],["6000",{"_index":2874,"t":{"1376":{"position":[[923,7]]}}}],["6140",{"_index":3665,"t":{"1675":{"position":[[85,4]]}}}],["6379",{"_index":1050,"t":{"1082":{"position":[[281,5]]},"1084":{"position":[[172,4]]},"1086":{"position":[[53,5]]}}}],["6380",{"_index":1059,"t":{"1082":{"position":[[617,9]]}}}],["64",{"_index":1109,"t":{"1096":{"position":[[386,3]]},"1100":{"position":[[77,3]]}}}],["6585",{"_index":2368,"t":{"1336":{"position":[[3377,5],[3420,5],[3475,5],[4058,5],[5893,5],[5961,5],[6053,5],[6972,5]]}}}],["7",{"_index":2407,"t":{"1336":{"position":[[4007,1],[6882,1]]}}}],["7.0",{"_index":3991,"t":{"1737":{"position":[[2682,4]]}}}],["7.1",{"_index":2261,"t":{"1336":{"position":[[1804,3]]}}}],["7.2",{"_index":2403,"t":{"1336":{"position":[[3966,3],[6820,3]]}}}],["700",{"_index":4354,"t":{"1852":{"position":[[152,4],[157,3],[297,4]]}}}],["7168",{"_index":2345,"t":{"1336":{"position":[[3054,5],[5398,5]]}}}],["72).unix",{"_index":439,"t":{"805":{"position":[[766,11]]},"809":{"position":[[1296,11]]}}}],["7231",{"_index":2178,"t":{"1336":{"position":[[73,5],[112,5],[151,5],[188,5],[265,5],[310,5],[355,5],[396,5],[1282,5],[1332,5],[1442,5],[1481,5],[1521,5],[1580,5],[1621,5],[1665,5],[1882,5],[1930,5],[1967,5],[2007,5],[2088,5],[2137,5],[2224,5],[2313,5],[2354,5],[2394,5],[2442,5],[2487,5],[2580,5],[2620,5],[2656,5],[2702,5],[2804,5],[2854,5],[2907,5],[3015,5],[3324,5],[3576,5],[3622,5],[3664,5],[3714,5],[3760,5],[3815,5],[4131,5],[4267,5],[4327,5],[4385,5],[4459,5],[4527,5],[4671,5],[4729,5],[4779,5],[4849,5],[5010,5],[5087,5],[5170,5],[5343,5],[5810,5],[6219,5],[6289,5],[6351,5],[6429,5],[6499,5],[6587,5]]}}}],["7232",{"_index":2280,"t":{"1336":{"position":[[2050,5],[2753,5],[4928,5]]}}}],["7233",{"_index":2252,"t":{"1336":{"position":[[1711,5],[2968,5],[5269,5]]}}}],["7235",{"_index":2293,"t":{"1336":{"position":[[2268,5],[2536,5],[4197,5],[4603,5]]}}}],["72d5",{"_index":3928,"t":{"1737":{"position":[[458,4]]}}}],["750",{"_index":3751,"t":{"1690":{"position":[[1330,4]]}}}],["7517",{"_index":507,"t":{"813":{"position":[[174,5]]}}}],["7538",{"_index":2289,"t":{"1336":{"position":[[2186,5]]}}}],["7540",{"_index":2349,"t":{"1336":{"position":[[3104,5],[5476,5]]}}}],["7725",{"_index":2375,"t":{"1336":{"position":[[3529,5],[6143,5]]}}}],["8",{"_index":2215,"t":{"1336":{"position":[[877,2],[930,2],[985,2],[1050,2],[1117,2],[1196,2]]},"1418":{"position":[[731,1]]},"1686":{"position":[[25,1]]},"1695":{"position":[[548,1]]},"1737":{"position":[[657,1]]},"1754":{"position":[[428,2],[1214,2]]},"1808":{"position":[[296,1]]},"1896":{"position":[[328,3],[369,2]]}}}],["8\">20worldworld!{{.name}}${{.price}}.new(dir",{"_index":1159,"t":{"1134":{"position":[[398,17]]}}}],["enhancesentryev",{"_index":281,"t":{"773":{"position":[[1313,18],[1509,19]]}}}],["ensur",{"_index":1622,"t":{"1190":{"position":[[3876,7]]},"1526":{"position":[[648,7]]},"1693":{"position":[[18,6]]},"1749":{"position":[[53,6]]},"1772":{"position":[[638,6]]}}}],["entir",{"_index":1610,"t":{"1190":{"position":[[2228,6]]}}}],["entiti",{"_index":2672,"t":{"1341":{"position":[[478,6]]}}}],["entri",{"_index":2886,"t":{"1378":{"position":[[1338,7]]},"1824":{"position":[[25,8]]}}}],["environ",{"_index":919,"t":{"948":{"position":[[131,11]]},"958":{"position":[[224,11],[261,11]]},"1102":{"position":[[125,11]]},"1341":{"position":[[4936,11]]},"1442":{"position":[[55,11]]},"1450":{"position":[[94,11],[193,11]]},"1488":{"position":[[541,11]]},"1665":{"position":[[338,12]]},"1682":{"position":[[1184,12]]}}}],["envoy",{"_index":3223,"t":{"1534":{"position":[[1231,5]]}}}],["envvar",{"_index":3030,"t":{"1442":{"position":[[0,6]]},"1446":{"position":[[588,6]]}}}],["envvar.config",{"_index":3034,"t":{"1446":{"position":[[387,14]]}}}],["envvar.new",{"_index":3033,"t":{"1446":{"position":[[291,13],[375,11]]}}}],["eq",{"_index":1529,"t":{"1186":{"position":[[266,2],[508,2],[594,2]]}}}],["equal",{"_index":1923,"t":{"1247":{"position":[[119,5]]},"1424":{"position":[[348,6]]},"1693":{"position":[[956,6]]}}}],["equiv=\"cont",{"_index":1433,"t":{"1178":{"position":[[1875,14]]}}}],["equival",{"_index":1500,"t":{"1184":{"position":[[381,10],[482,10],[1563,10]]},"1460":{"position":[[509,11]]},"1832":{"position":[[504,10]]},"1876":{"position":[[138,10]]}}}],["err",{"_index":189,"t":{"759":{"position":[[336,3]]},"763":{"position":[[167,3]]},"795":{"position":[[365,3],[393,3]]},"805":{"position":[[909,3],[956,3]]},"809":{"position":[[555,3],[577,3],[613,3],[660,4],[1439,3],[1480,3],[1530,4]]},"839":{"position":[[601,3],[643,3],[710,4],[1092,3],[1139,3]]},"869":{"position":[[757,3],[787,3],[810,3],[844,4],[888,3],[919,3],[954,4]]},"1082":{"position":[[675,3],[737,3]]},"1174":{"position":[[466,3]]},"1178":{"position":[[1494,3]]},"1180":{"position":[[884,3]]},"1188":{"position":[[1991,3],[2012,3],[2065,3]]},"1190":{"position":[[1488,3],[2520,3],[3668,3],[4528,3],[4712,3]]},"1274":{"position":[[152,3],[170,3],[208,4]]},"1328":{"position":[[119,4],[153,4]]},"1330":{"position":[[141,4]]},"1332":{"position":[[182,4],[227,4]]},"1360":{"position":[[313,3],[356,3],[376,3]]},"1500":{"position":[[286,3],[305,3]]},"1542":{"position":[[123,3],[145,3]]},"1562":{"position":[[1044,3],[1120,3],[1170,4]]},"1594":{"position":[[1167,3],[1192,3],[1212,3],[1411,3],[1464,3],[1484,3],[1700,3],[1769,3],[1789,3],[1989,3],[2066,3],[2086,3]]},"1640":{"position":[[404,3],[427,3],[625,3],[648,3],[772,3],[792,3]]},"1660":{"position":[[369,3],[422,3],[476,4],[1196,3],[1264,3],[1318,4]]},"1684":{"position":[[202,3]]},"1695":{"position":[[296,3]]},"1697":{"position":[[689,3],[922,3],[989,3]]},"1749":{"position":[[934,3],[966,3],[986,3],[1288,3],[1315,3]]},"1770":{"position":[[687,3],[711,3],[731,3]]},"1786":{"position":[[270,3]]},"1824":{"position":[[319,3],[345,3],[771,3],[832,3],[852,3],[869,3]]},"1832":{"position":[[430,3]]},"1850":{"position":[[529,3],[554,3],[574,3]]},"1864":{"position":[[551,3],[580,3],[600,3]]},"1870":{"position":[[514,3],[591,3]]},"1872":{"position":[[216,3],[242,3],[576,3],[637,3],[657,3],[672,3]]},"1874":{"position":[[296,3],[322,3],[659,3],[738,3],[758,3],[773,3]]},"1886":{"position":[[673,3],[713,3]]},"1902":{"position":[[82,3]]},"1904":{"position":[[107,3]]},"1906":{"position":[[84,3]]}}}],["err.(validator.validationerror",{"_index":4014,"t":{"1749":{"position":[[999,32]]}}}],["err.error",{"_index":1631,"t":{"1190":{"position":[[4739,12]]},"1749":{"position":[[1404,12]]}}}],["err.param",{"_index":4020,"t":{"1749":{"position":[[1144,11]]}}}],["err.structnamespac",{"_index":4016,"t":{"1749":{"position":[[1082,21]]}}}],["err.tag",{"_index":4018,"t":{"1749":{"position":[[1118,9]]}}}],["errbadgateway",{"_index":2472,"t":{"1336":{"position":[[6301,13]]}}}],["errbadrequest",{"_index":2410,"t":{"1336":{"position":[[4081,13]]}}}],["errconflict",{"_index":2428,"t":{"1336":{"position":[[4683,11]]}}}],["errexpectationfail",{"_index":2444,"t":{"1336":{"position":[[5279,20]]}}}],["errfaileddepend",{"_index":2454,"t":{"1336":{"position":[[5620,19]]}}}],["errfootimeout",{"_index":3594,"t":{"1660":{"position":[[1012,13],[1406,15],[1630,13]]}}}],["errforbidden",{"_index":2416,"t":{"1336":{"position":[[4279,12]]}}}],["errgatewaytimeout",{"_index":2476,"t":{"1336":{"position":[[6441,17]]}}}],["errgon",{"_index":2430,"t":{"1336":{"position":[[4741,7]]}}}],["errhttpversionnotsupport",{"_index":2478,"t":{"1336":{"position":[[6511,26]]}}}],["errinsufficientstorag",{"_index":2482,"t":{"1336":{"position":[[6681,22]]}}}],["errinternalservererror",{"_index":2468,"t":{"1336":{"position":[[6151,22]]}}}],["errinvalididempotencykey",{"_index":3197,"t":{"1528":{"position":[[382,25]]}}}],["errlengthrequir",{"_index":2432,"t":{"1336":{"position":[[4791,17]]}}}],["errlock",{"_index":2452,"t":{"1336":{"position":[[5567,9]]}}}],["errloopdetect",{"_index":2484,"t":{"1336":{"position":[[6760,15]]}}}],["errmethodnotallow",{"_index":2420,"t":{"1336":{"position":[[4397,19]]}}}],["errmisdirectedrequest",{"_index":2448,"t":{"1336":{"position":[[5410,21]]}}}],["errmissingormalformedapikey",{"_index":3247,"t":{"1542":{"position":[[152,27]]}}}],["errnetworkauthenticationrequir",{"_index":2488,"t":{"1336":{"position":[[6884,32]]}}}],["errnotaccept",{"_index":2422,"t":{"1336":{"position":[[4471,16]]}}}],["errnotextend",{"_index":2486,"t":{"1336":{"position":[[6824,14]]}}}],["errnotfound",{"_index":2418,"t":{"1336":{"position":[[4339,11]]}}}],["errnotimpl",{"_index":2470,"t":{"1336":{"position":[[6231,17]]}}}],["erron",{"_index":3174,"t":{"1516":{"position":[[156,11]]}}}],["error",{"_index":59,"t":{"733":{"position":[[366,5],[453,5]]},"737":{"position":[[564,5],[753,5]]},"739":{"position":[[530,5]]},"741":{"position":[[507,5]]},"751":{"position":[[411,5],[518,5]]},"759":{"position":[[340,6]]},"761":{"position":[[164,5]]},"763":{"position":[[391,5]]},"773":{"position":[[1354,5],[1548,5],[1606,5]]},"783":{"position":[[337,7],[353,7]]},"785":{"position":[[273,5]]},"793":{"position":[[454,8],[524,7],[540,7]]},"795":{"position":[[314,5],[445,7]]},"797":{"position":[[175,6],[232,6]]},"801":{"position":[[55,5]]},"803":{"position":[[137,5],[248,6],[255,5]]},"805":{"position":[[473,5],[560,5],[1093,5],[1167,5]]},"809":{"position":[[559,5],[1003,5],[1090,5],[1659,5],[1733,5]]},"815":{"position":[[936,5],[1050,6]]},"823":{"position":[[578,6]]},"825":{"position":[[67,6]]},"827":{"position":[[785,6],[942,5]]},"839":{"position":[[32,8],[811,5],[888,5]]},"843":{"position":[[184,6],[240,6]]},"847":{"position":[[61,5]]},"849":{"position":[[129,5],[245,6],[252,5]]},"851":{"position":[[510,6]]},"869":{"position":[[166,5],[761,5]]},"871":{"position":[[15,5]]},"874":{"position":[[402,6],[564,6],[618,5],[688,5],[754,5],[817,5],[929,5]]},"882":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"896":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"910":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"924":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"938":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"952":{"position":[[75,6],[147,5],[190,5],[222,5],[254,5]]},"958":{"position":[[2737,5],[3002,7]]},"966":{"position":[[79,6],[151,5],[194,5],[226,5],[258,5]]},"980":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"994":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1008":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1022":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1036":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1050":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1064":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1078":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1092":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1106":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1120":{"position":[[78,6],[150,5],[193,5],[225,5],[257,5]]},"1134":{"position":[[1552,5],[1696,5]]},"1144":{"position":[[676,5],[806,5]]},"1148":{"position":[[679,5],[809,5]]},"1152":{"position":[[765,5],[895,5]]},"1154":{"position":[[855,5]]},"1160":{"position":[[725,5],[855,5]]},"1164":{"position":[[736,5],[866,5]]},"1166":{"position":[[337,5]]},"1168":{"position":[[463,5]]},"1188":{"position":[[1995,5]]},"1190":{"position":[[2448,6]]},"1194":{"position":[[727,5],[857,5]]},"1198":{"position":[[902,5],[1032,5]]},"1202":{"position":[[720,5],[850,5]]},"1206":{"position":[[744,5],[874,5]]},"1212":{"position":[[525,5],[804,5],[1161,5]]},"1214":{"position":[[196,5]]},"1216":{"position":[[395,6],[539,5],[721,5],[861,5],[1056,5],[1291,5]]},"1225":{"position":[[1000,5],[1121,5],[1454,5],[1552,5],[1705,5],[1795,5],[1885,5]]},"1227":{"position":[[265,5]]},"1237":{"position":[[445,5],[510,5],[573,5]]},"1241":{"position":[[133,5]]},"1243":{"position":[[147,5]]},"1245":{"position":[[132,5]]},"1247":{"position":[[266,5]]},"1253":{"position":[[98,5]]},"1255":{"position":[[192,5]]},"1257":{"position":[[71,5]]},"1259":{"position":[[240,5]]},"1261":{"position":[[288,5]]},"1263":{"position":[[184,5]]},"1265":{"position":[[331,6],[421,5]]},"1328":{"position":[[46,6],[124,8]]},"1330":{"position":[[48,6],[112,8]]},"1332":{"position":[[47,6],[187,8]]},"1334":{"position":[[62,6]]},"1336":{"position":[[4068,6]]},"1341":{"position":[[3397,5],[3449,5]]},"1343":{"position":[[121,6],[168,5],[211,5]]},"1349":{"position":[[686,6]]},"1356":{"position":[[386,5]]},"1358":{"position":[[274,5]]},"1360":{"position":[[296,5]]},"1366":{"position":[[737,5]]},"1376":{"position":[[877,5]]},"1404":{"position":[[361,6]]},"1408":{"position":[[525,6]]},"1410":{"position":[[1992,6]]},"1422":{"position":[[375,6]]},"1424":{"position":[[651,5],[756,5],[762,5]]},"1426":{"position":[[211,6]]},"1434":{"position":[[776,5],[908,5]]},"1436":{"position":[[682,6],[820,6]]},"1458":{"position":[[373,5],[604,5]]},"1468":{"position":[[335,5]]},"1510":{"position":[[189,5]]},"1526":{"position":[[743,5]]},"1528":{"position":[[263,5]]},"1534":{"position":[[236,6],[723,5]]},"1536":{"position":[[502,6],[1114,5],[1201,5],[1300,5]]},"1538":{"position":[[304,6],[574,5],[671,5]]},"1540":{"position":[[403,6],[982,6]]},"1542":{"position":[[63,5],[127,6],[134,5]]},"1548":{"position":[[580,5]]},"1552":{"position":[[714,5]]},"1554":{"position":[[157,5]]},"1562":{"position":[[1439,6]]},"1564":{"position":[[1421,6]]},"1568":{"position":[[558,7]]},"1592":{"position":[[394,5],[628,5],[816,5],[1014,5]]},"1594":{"position":[[1104,5],[1400,5],[1689,5],[1978,5],[2571,5],[2672,5]]},"1604":{"position":[[367,5],[389,7]]},"1614":{"position":[[297,5],[382,5]]},"1634":{"position":[[277,5],[362,5]]},"1638":{"position":[[123,6],[154,5],[322,5],[359,5],[390,5]]},"1640":{"position":[[362,5]]},"1654":{"position":[[402,5],[527,5]]},"1656":{"position":[[187,5],[548,5]]},"1658":{"position":[[69,9],[173,9]]},"1660":{"position":[[293,5],[468,7],[647,5],[1001,6],[1120,5],[1310,7],[1530,5],[1849,5]]},"1680":{"position":[[78,5],[142,5],[198,5],[233,7],[409,5]]},"1684":{"position":[[24,5],[206,6],[213,5],[340,5],[375,5]]},"1690":{"position":[[466,5],[724,5],[987,5],[1085,5]]},"1693":{"position":[[48,6],[238,5],[254,5],[669,5],[781,5],[1015,5]]},"1695":{"position":[[18,5],[59,6],[110,6],[124,5],[237,5],[300,6],[307,5],[640,5]]},"1697":{"position":[[9,5],[112,5],[166,5],[240,6],[317,5],[409,5],[488,5],[523,7],[640,5],[693,6],[700,5],[911,5],[1111,7],[1241,5]]},"1706":{"position":[[864,6],[894,6]]},"1708":{"position":[[182,5],[303,5]]},"1712":{"position":[[91,5],[167,5],[244,5],[281,5],[361,5]]},"1716":{"position":[[376,5],[476,5],[573,5],[675,5],[785,5]]},"1728":{"position":[[519,5]]},"1731":{"position":[[1000,5],[1121,5],[1454,5],[1552,5],[1705,5],[1795,5],[1885,5]]},"1733":{"position":[[280,5],[408,5],[547,5]]},"1735":{"position":[[910,5],[1085,5],[1196,5],[1315,5],[1547,5],[2031,5],[2227,5],[2601,5]]},"1737":{"position":[[1333,5],[1581,5],[1980,5],[2491,5]]},"1739":{"position":[[273,5],[440,5]]},"1744":{"position":[[106,5],[162,5],[861,5]]},"1746":{"position":[[585,5]]},"1749":{"position":[[910,6],[1156,6],[1201,6],[1237,5],[1422,6],[1457,6]]},"1751":{"position":[[1000,5],[1121,5],[1454,5],[1552,5],[1705,5],[1795,5],[1885,5]]},"1754":{"position":[[463,5],[868,5],[1344,5]]},"1756":{"position":[[220,5],[354,5]]},"1758":{"position":[[160,5]]},"1760":{"position":[[256,5]]},"1762":{"position":[[166,5]]},"1764":{"position":[[175,5]]},"1766":{"position":[[164,5],[205,5],[295,5]]},"1768":{"position":[[160,5]]},"1770":{"position":[[438,5],[659,5]]},"1772":{"position":[[145,5],[712,5],[906,5]]},"1774":{"position":[[399,5]]},"1778":{"position":[[429,5]]},"1780":{"position":[[237,5]]},"1782":{"position":[[346,5],[392,5]]},"1784":{"position":[[234,5],[280,5]]},"1786":{"position":[[162,6],[210,5]]},"1788":{"position":[[208,5]]},"1792":{"position":[[202,5]]},"1796":{"position":[[213,5]]},"1800":{"position":[[169,6],[216,5],[313,5],[414,5]]},"1802":{"position":[[170,5]]},"1804":{"position":[[122,5]]},"1806":{"position":[[207,5]]},"1808":{"position":[[330,5]]},"1810":{"position":[[129,5]]},"1812":{"position":[[181,5],[280,5]]},"1814":{"position":[[299,5],[394,5]]},"1816":{"position":[[178,5]]},"1818":{"position":[[325,5],[415,5]]},"1820":{"position":[[159,5]]},"1822":{"position":[[255,5]]},"1824":{"position":[[225,6],[273,5]]},"1826":{"position":[[110,5],[181,5],[227,5],[273,5],[358,5],[443,5]]},"1828":{"position":[[164,5]]},"1830":{"position":[[369,5],[494,5],[972,5]]},"1832":{"position":[[186,5],[328,6],[418,5],[473,5]]},"1834":{"position":[[288,5],[377,5]]},"1836":{"position":[[326,5]]},"1838":{"position":[[178,5]]},"1840":{"position":[[167,6],[272,5],[478,5],[692,5],[899,5],[1211,5]]},"1842":{"position":[[415,5]]},"1844":{"position":[[548,5]]},"1846":{"position":[[612,5]]},"1848":{"position":[[602,5]]},"1850":{"position":[[288,5],[501,5]]},"1852":{"position":[[117,6],[197,5]]},"1854":{"position":[[255,5],[307,5],[385,5],[508,5]]},"1856":{"position":[[397,5],[443,5],[576,5],[844,5]]},"1858":{"position":[[295,5],[341,5],[421,5],[551,5]]},"1860":{"position":[[280,5]]},"1862":{"position":[[137,5]]},"1864":{"position":[[298,5],[523,5]]},"1866":{"position":[[141,5]]},"1868":{"position":[[343,5],[392,5],[471,5]]},"1870":{"position":[[155,5],[462,5]]},"1872":{"position":[[123,5],[170,5]]},"1874":{"position":[[179,5],[250,5]]},"1878":{"position":[[71,5],[117,5],[390,5],[452,5],[498,5]]},"1880":{"position":[[261,5],[316,5],[629,5]]},"1882":{"position":[[201,5],[256,5]]},"1884":{"position":[[159,5]]},"1886":{"position":[[1283,5],[1415,5]]},"1888":{"position":[[162,5]]},"1892":{"position":[[160,5],[243,5],[356,5]]},"1894":{"position":[[336,5]]},"1896":{"position":[[201,5]]},"1898":{"position":[[232,5]]},"1900":{"position":[[282,5]]},"1902":{"position":[[86,6],[133,5]]},"1904":{"position":[[111,6],[158,5]]},"1906":{"position":[[88,6],[135,5]]},"1908":{"position":[[288,5]]},"1910":{"position":[[185,5],[336,5]]}}}],["errorhandl",{"_index":381,"t":{"803":{"position":[[218,12],[261,12]]},"849":{"position":[[215,12],[258,12]]},"1341":{"position":[[3338,12],[3351,12],[3364,12]]},"1412":{"position":[[160,13]]},"1540":{"position":[[296,12],[459,12]]},"1542":{"position":[[90,13]]},"1600":{"position":[[126,13]]},"1656":{"position":[[233,13],[594,13]]},"1684":{"position":[[169,13]]},"1697":{"position":[[654,13]]}}}],["errorrespons",{"_index":4009,"t":{"1749":{"position":[[757,13],[887,16],[917,16],[1046,13]]}}}],["errors.as(err",{"_index":3764,"t":{"1695":{"position":[[466,14]]},"1697":{"position":[[859,14]]}}}],["errors.new(\"abc",{"_index":632,"t":{"839":{"position":[[826,17]]}}}],["errors.new(\"foo",{"_index":3595,"t":{"1660":{"position":[[1028,15]]}}}],["errorstatuscodehandl",{"_index":188,"t":{"759":{"position":[[294,22]]}}}],["errpaymentrequir",{"_index":2414,"t":{"1336":{"position":[[4207,18]]}}}],["errpreconditionfail",{"_index":2434,"t":{"1336":{"position":[[4862,21]]}}}],["errpreconditionrequir",{"_index":2460,"t":{"1336":{"position":[[5823,23]]}}}],["errproxyauthrequir",{"_index":2424,"t":{"1336":{"position":[[4539,20]]}}}],["errrequestedrangenotsatisfi",{"_index":2442,"t":{"1336":{"position":[[5183,31]]}}}],["errrequestentitytoolarg",{"_index":2436,"t":{"1336":{"position":[[4938,24]]}}}],["errrequestheaderfieldstoolarg",{"_index":2464,"t":{"1336":{"position":[[5969,30]]}}}],["errrequesttimeout",{"_index":2426,"t":{"1336":{"position":[[4613,17]]}}}],["errrequesturitoolong",{"_index":2438,"t":{"1336":{"position":[[5023,20]]}}}],["errserviceunavail",{"_index":2474,"t":{"1336":{"position":[[6363,21]]}}}],["errteapot",{"_index":2446,"t":{"1336":{"position":[[5356,9]]}}}],["errtooearli",{"_index":2456,"t":{"1336":{"position":[[5693,11]]}}}],["errtoomanyrequest",{"_index":2462,"t":{"1336":{"position":[[5901,18]]}}}],["errunauthor",{"_index":2412,"t":{"1336":{"position":[[4143,15]]}}}],["errunavailableforlegalreason",{"_index":2466,"t":{"1336":{"position":[[6061,29]]}}}],["errunprocessableent",{"_index":2450,"t":{"1336":{"position":[[5488,22]]}}}],["errunsupportedmediatyp",{"_index":2440,"t":{"1336":{"position":[[5100,23]]}}}],["errupgraderequir",{"_index":2458,"t":{"1336":{"position":[[5750,18]]}}}],["errvariantalsonegoti",{"_index":2480,"t":{"1336":{"position":[[6599,24]]}}}],["escap",{"_index":3874,"t":{"1735":{"position":[[1473,7],[1783,7]]},"1880":{"position":[[503,6]]}}}],["especi",{"_index":934,"t":{"958":{"position":[[480,10]]}}}],["essenti",{"_index":1725,"t":{"1214":{"position":[[18,11]]},"1693":{"position":[[5,9]]}}}],["establish",{"_index":983,"t":{"972":{"position":[[117,9]]},"1876":{"position":[[57,12]]}}}],["etag",{"_index":2518,"t":{"1336":{"position":[[7638,6]]},"1341":{"position":[[1818,4],[1846,4],[1897,5],[1962,5]]},"1454":{"position":[[0,4]]},"1458":{"position":[[300,5],[528,5]]},"1460":{"position":[[249,5],[427,4],[573,5],[644,5]]}}}],["etc",{"_index":1156,"t":{"1134":{"position":[[201,5]]},"1216":{"position":[[181,6],[480,4]]},"1225":{"position":[[1335,3]]},"1564":{"position":[[875,3]]},"1731":{"position":[[1335,3]]},"1751":{"position":[[1335,3]]}}}],["etcd",{"_index":791,"t":{"876":{"position":[[51,4]]},"920":{"position":[[29,4]]},"962":{"position":[[2,4],[28,4]]},"968":{"position":[[0,4],[189,4]]}}}],["etcd.new",{"_index":977,"t":{"970":{"position":[[168,10]]}}}],["etcd.new(config",{"_index":978,"t":{"970":{"position":[[216,16]]}}}],["ethernet",{"_index":3635,"t":{"1663":{"position":[[573,8]]},"1665":{"position":[[317,8]]}}}],["evalu",{"_index":1470,"t":{"1182":{"position":[[582,8]]},"1184":{"position":[[1615,9]]}}}],["event",{"_index":228,"t":{"771":{"position":[[421,5]]},"773":{"position":[[1159,5]]},"775":{"position":[[332,5]]},"1336":{"position":[[10496,5]]},"1728":{"position":[[77,5]]}}}],["exactli",{"_index":2064,"t":{"1296":{"position":[[274,7]]},"1737":{"position":[[714,8]]}}}],["exampl",{"_index":470,"t":{"809":{"position":[[206,8]]},"827":{"position":[[41,7]]},"837":{"position":[[16,7]]},"841":{"position":[[267,8],[554,8]]},"855":{"position":[[11,8]]},"880":{"position":[[24,8]]},"894":{"position":[[24,8]]},"908":{"position":[[24,8]]},"922":{"position":[[24,8]]},"936":{"position":[[24,8]]},"950":{"position":[[24,8]]},"958":{"position":[[1407,7],[2103,7]]},"964":{"position":[[24,8]]},"978":{"position":[[24,8]]},"992":{"position":[[24,8]]},"1006":{"position":[[24,8]]},"1020":{"position":[[24,8]]},"1034":{"position":[[24,8]]},"1048":{"position":[[24,8]]},"1062":{"position":[[24,8]]},"1076":{"position":[[24,8]]},"1084":{"position":[[555,8]]},"1090":{"position":[[24,8]]},"1104":{"position":[[24,8]]},"1118":{"position":[[24,8]]},"1134":{"position":[[218,7],[523,8],[1650,7]]},"1136":{"position":[[22,9]]},"1144":{"position":[[493,8]]},"1148":{"position":[[494,8]]},"1152":{"position":[[579,8]]},"1160":{"position":[[542,8]]},"1164":{"position":[[552,8]]},"1170":{"position":[[319,8]]},"1178":{"position":[[195,7]]},"1180":{"position":[[950,7]]},"1182":{"position":[[1935,8]]},"1184":{"position":[[746,7]]},"1188":{"position":[[123,8],[1043,8],[1851,7],[2397,7]]},"1190":{"position":[[1198,7],[3512,7]]},"1194":{"position":[[545,8]]},"1202":{"position":[[538,8]]},"1206":{"position":[[560,8]]},"1208":{"position":[[33,8]]},"1212":{"position":[[489,8],[744,7]]},"1223":{"position":[[471,8],[825,8],[2600,7]]},"1225":{"position":[[929,8],[1397,8]]},"1227":{"position":[[112,8]]},"1229":{"position":[[135,8]]},"1231":{"position":[[125,8]]},"1233":{"position":[[165,8]]},"1235":{"position":[[98,8]]},"1241":{"position":[[91,8]]},"1243":{"position":[[105,8]]},"1245":{"position":[[90,8]]},"1247":{"position":[[190,8]]},"1253":{"position":[[104,8]]},"1255":{"position":[[198,8]]},"1257":{"position":[[77,8]]},"1259":{"position":[[246,8]]},"1261":{"position":[[294,8]]},"1263":{"position":[[190,8]]},"1265":{"position":[[338,8]]},"1276":{"position":[[248,7]]},"1278":{"position":[[316,7]]},"1280":{"position":[[102,7]]},"1282":{"position":[[157,7]]},"1284":{"position":[[360,7]]},"1286":{"position":[[148,7]]},"1288":{"position":[[169,7]]},"1290":{"position":[[124,7]]},"1292":{"position":[[164,7]]},"1294":{"position":[[203,7]]},"1296":{"position":[[616,7]]},"1298":{"position":[[135,7]]},"1300":{"position":[[132,7]]},"1302":{"position":[[318,7]]},"1304":{"position":[[389,7],[715,7],[1052,7],[1678,7]]},"1306":{"position":[[146,7]]},"1308":{"position":[[103,7]]},"1310":{"position":[[195,7]]},"1312":{"position":[[153,7]]},"1314":{"position":[[90,7]]},"1316":{"position":[[122,7]]},"1318":{"position":[[114,7]]},"1320":{"position":[[116,7]]},"1322":{"position":[[85,7]]},"1324":{"position":[[242,7]]},"1326":{"position":[[192,7]]},"1328":{"position":[[133,7]]},"1330":{"position":[[121,7]]},"1332":{"position":[[196,7]]},"1334":{"position":[[188,7]]},"1339":{"position":[[147,7]]},"1341":{"position":[[68,7],[5541,8]]},"1343":{"position":[[128,7]]},"1345":{"position":[[96,7]]},"1398":{"position":[[507,7],[556,8]]},"1404":{"position":[[836,8]]},"1440":{"position":[[181,8]]},"1480":{"position":[[463,7]]},"1516":{"position":[[95,7]]},"1534":{"position":[[1144,8],[1273,7]]},"1544":{"position":[[393,8]]},"1550":{"position":[[101,7]]},"1552":{"position":[[1419,7]]},"1584":{"position":[[334,8]]},"1586":{"position":[[320,8]]},"1596":{"position":[[923,8]]},"1616":{"position":[[310,8]]},"1636":{"position":[[209,8]]},"1648":{"position":[[202,9]]},"1654":{"position":[[660,7]]},"1678":{"position":[[353,8]]},"1680":{"position":[[374,7]]},"1682":{"position":[[455,8],[988,7],[1087,7]]},"1684":{"position":[[130,7]]},"1690":{"position":[[25,9],[40,7]]},"1693":{"position":[[198,7],[464,7],[975,7]]},"1695":{"position":[[218,7]]},"1697":{"position":[[459,7],[531,7]]},"1700":{"position":[[376,7]]},"1716":{"position":[[243,7]]},"1728":{"position":[[280,7]]},"1731":{"position":[[929,8],[1397,8]]},"1733":{"position":[[144,8]]},"1735":{"position":[[794,7]]},"1737":{"position":[[340,7],[348,7],[1223,8],[2381,7]]},"1739":{"position":[[213,7]]},"1746":{"position":[[143,7]]},"1749":{"position":[[148,12],[295,7]]},"1751":{"position":[[929,8],[1397,8]]},"1754":{"position":[[341,7],[769,7]]},"1756":{"position":[[133,7]]},"1758":{"position":[[115,7]]},"1760":{"position":[[216,7]]},"1762":{"position":[[126,7]]},"1764":{"position":[[93,7]]},"1766":{"position":[[170,7]]},"1768":{"position":[[68,7]]},"1770":{"position":[[130,8],[444,7]]},"1772":{"position":[[105,7],[669,7]]},"1774":{"position":[[322,7]]},"1778":{"position":[[389,7]]},"1780":{"position":[[197,7]]},"1782":{"position":[[352,7]]},"1784":{"position":[[240,7]]},"1786":{"position":[[169,7]]},"1788":{"position":[[167,7]]},"1792":{"position":[[162,7]]},"1796":{"position":[[173,7]]},"1800":{"position":[[72,8],[176,7]]},"1802":{"position":[[98,7]]},"1804":{"position":[[82,7]]},"1806":{"position":[[121,7]]},"1808":{"position":[[248,7]]},"1810":{"position":[[89,7]]},"1812":{"position":[[187,7]]},"1814":{"position":[[305,7]]},"1816":{"position":[[138,7]]},"1818":{"position":[[290,7]]},"1820":{"position":[[118,7]]},"1822":{"position":[[214,7]]},"1824":{"position":[[232,7]]},"1826":{"position":[[233,7]]},"1828":{"position":[[79,7]]},"1830":{"position":[[282,7],[664,7],[921,7]]},"1832":{"position":[[335,7]]},"1834":{"position":[[115,8],[294,7]]},"1836":{"position":[[239,7]]},"1838":{"position":[[112,7]]},"1840":{"position":[[174,7],[368,7],[552,7],[783,7],[1001,7]]},"1842":{"position":[[326,7]]},"1844":{"position":[[450,7]]},"1846":{"position":[[518,7]]},"1848":{"position":[[508,7]]},"1850":{"position":[[115,8],[294,7]]},"1852":{"position":[[124,7]]},"1854":{"position":[[261,7],[467,8]]},"1856":{"position":[[403,7]]},"1858":{"position":[[301,7]]},"1862":{"position":[[97,7]]},"1864":{"position":[[118,8],[304,7]]},"1866":{"position":[[101,7]]},"1868":{"position":[[349,7]]},"1870":{"position":[[73,7],[392,7]]},"1872":{"position":[[129,7]]},"1874":{"position":[[185,7]]},"1876":{"position":[[108,7]]},"1878":{"position":[[77,7],[458,7]]},"1880":{"position":[[267,7],[570,7]]},"1882":{"position":[[207,7]]},"1884":{"position":[[119,7]]},"1886":{"position":[[356,7],[1030,7]]},"1888":{"position":[[122,7]]},"1892":{"position":[[115,7]]},"1894":{"position":[[260,7]]},"1896":{"position":[[161,7]]},"1898":{"position":[[192,7]]},"1900":{"position":[[242,7]]},"1902":{"position":[[93,7]]},"1904":{"position":[[118,7]]},"1906":{"position":[[95,7]]},"1908":{"position":[[212,7]]},"1910":{"position":[[191,7]]}}}],["example.authz",{"_index":564,"t":{"827":{"position":[[387,13]]}}}],["example.html",{"_index":3324,"t":{"1564":{"position":[[721,12]]}}}],["example/loc",{"_index":116,"t":{"749":{"position":[[169,20]]},"751":{"position":[[247,21]]}}}],["exce",{"_index":2671,"t":{"1341":{"position":[[425,7]]}}}],["excecut",{"_index":3111,"t":{"1490":{"position":[[54,12]]}}}],["exceed",{"_index":1888,"t":{"1237":{"position":[[408,9]]}}}],["excel",{"_index":1760,"t":{"1220":{"position":[[82,9]]}}}],["except",{"_index":504,"t":{"813":{"position":[[55,9]]},"1436":{"position":[[284,6]]},"1438":{"position":[[39,7]]},"1440":{"position":[[140,6],[279,7]]},"1814":{"position":[[76,6]]}}}],["exclud",{"_index":1225,"t":{"1140":{"position":[[159,8]]},"1341":{"position":[[1100,8],[1212,8]]},"1440":{"position":[[310,7]]},"1474":{"position":[[227,7]]},"1652":{"position":[[32,7]]},"1772":{"position":[[499,9]]}}}],["exclude_dir",{"_index":3713,"t":{"1682":{"position":[[662,11]]}}}],["exclude_regex",{"_index":3716,"t":{"1682":{"position":[[748,13]]}}}],["excludevar",{"_index":3039,"t":{"1446":{"position":[[484,12]]},"1450":{"position":[[167,11],[238,11]]}}}],["exclus",{"_index":3092,"t":{"1474":{"position":[[345,11]]}}}],["execut",{"_index":380,"t":{"803":{"position":[[186,8],[302,8]]},"849":{"position":[[178,8],[299,8]]},"1084":{"position":[[920,7]]},"1172":{"position":[[31,9]]},"1174":{"position":[[569,8]]},"1176":{"position":[[0,7],[84,7],[127,8],[307,9],[396,7],[467,8]]},"1188":{"position":[[1584,8],[1770,8],[2360,8]]},"1190":{"position":[[1447,9],[2969,8]]},"1216":{"position":[[244,8],[591,8]]},"1341":{"position":[[3380,8]]},"1418":{"position":[[996,9]]},"1540":{"position":[[212,8],[337,8]]},"1656":{"position":[[452,10],[640,11],[663,10]]},"1660":{"position":[[458,9],[1300,9]]},"1663":{"position":[[81,9]]},"1710":{"position":[[28,7]]},"1714":{"position":[[21,7]]},"1716":{"position":[[20,7]]},"1718":{"position":[[21,7]]},"1720":{"position":[[25,7]]},"1722":{"position":[[22,7]]},"1724":{"position":[[20,7]]},"1726":{"position":[[24,7]]},"1728":{"position":[[21,7]]},"1737":{"position":[[18,7]]},"1739":{"position":[[154,8]]},"1744":{"position":[[229,8]]},"1826":{"position":[[24,8]]},"1868":{"position":[[11,9],[80,9],[247,8]]},"1870":{"position":[[376,8]]}}}],["execute(w",{"_index":1629,"t":{"1190":{"position":[[4691,13]]}}}],["exercis",{"_index":3638,"t":{"1665":{"position":[[25,8]]}}}],["exist",{"_index":187,"t":{"759":{"position":[[267,8]]},"874":{"position":[[371,5]]},"888":{"position":[[491,8],[508,8]]},"902":{"position":[[315,8],[332,8]]},"916":{"position":[[118,8],[135,8]]},"930":{"position":[[485,8],[502,8]]},"958":{"position":[[1048,8],[1065,8],[1200,5],[1896,5],[2542,5],[2710,5]]},"986":{"position":[[166,8],[183,8]]},"1014":{"position":[[626,8],[643,8]]},"1028":{"position":[[720,8],[737,8]]},"1042":{"position":[[735,8],[752,8]]},"1052":{"position":[[224,8]]},"1070":{"position":[[875,8],[892,8]]},"1084":{"position":[[1199,8],[1216,8]]},"1112":{"position":[[265,8],[282,8]]},"1126":{"position":[[179,8],[196,8]]},"1162":{"position":[[327,6]]},"1182":{"position":[[156,5],[384,6]]},"1223":{"position":[[687,5]]},"1656":{"position":[[6,5]]},"1693":{"position":[[302,7]]},"1780":{"position":[[115,6]]},"1788":{"position":[[305,5]]},"1830":{"position":[[137,6],[201,6]]},"1832":{"position":[[269,6]]},"1842":{"position":[[184,6]]},"1844":{"position":[[185,6]]},"1846":{"position":[[185,6],[431,6]]},"1848":{"position":[[185,6],[431,6]]},"1858":{"position":[[82,7]]}}}],["exit",{"_index":672,"t":{"841":{"position":[[407,6]]}}}],["exp",{"_index":437,"t":{"805":{"position":[[732,6]]},"809":{"position":[[1262,6]]},"874":{"position":[[599,3]]},"882":{"position":[[131,3]]},"896":{"position":[[131,3]]},"910":{"position":[[131,3]]},"924":{"position":[[131,3]]},"938":{"position":[[131,3]]},"952":{"position":[[128,3]]},"966":{"position":[[132,3]]},"980":{"position":[[131,3]]},"994":{"position":[[131,3]]},"1008":{"position":[[131,3]]},"1022":{"position":[[131,3]]},"1036":{"position":[[131,3]]},"1050":{"position":[[131,3]]},"1064":{"position":[[131,3]]},"1078":{"position":[[131,3]]},"1092":{"position":[[131,3]]},"1106":{"position":[[131,3]]},"1120":{"position":[[131,3]]}}}],["expand",{"_index":1401,"t":{"1178":{"position":[[738,8]]},"1735":{"position":[[2861,7]]}}}],["expect",{"_index":667,"t":{"841":{"position":[[162,6]]},"1336":{"position":[[8104,8],[9982,7]]},"1368":{"position":[[679,8]]},"1580":{"position":[[96,8]]}}}],["expir",{"_index":382,"t":{"803":{"position":[[348,7]]},"849":{"position":[[345,7]]},"874":{"position":[[474,10],[503,11]]},"888":{"position":[[596,7]]},"916":{"position":[[218,7]]},"1000":{"position":[[45,7]]},"1028":{"position":[[820,7]]},"1042":{"position":[[835,7]]},"1070":{"position":[[975,7]]},"1126":{"position":[[279,7]]},"1223":{"position":[[1977,10]]},"1237":{"position":[[309,8]]},"1336":{"position":[[7318,9]]},"1376":{"position":[[430,11],[510,6]]},"1378":{"position":[[198,10],[296,10],[842,10],[876,10],[1363,10]]},"1380":{"position":[[39,11]]},"1404":{"position":[[596,8]]},"1408":{"position":[[433,11]]},"1410":{"position":[[1222,10],[1274,10],[1324,6],[1370,10]]},"1412":{"position":[[107,11]]},"1540":{"position":[[447,7]]},"1542":{"position":[[315,7]]},"1548":{"position":[[440,11]]},"1550":{"position":[[180,11],[461,11]]},"1552":{"position":[[495,10],[599,10]]},"1554":{"position":[[36,11]]},"1640":{"position":[[693,10]]},"1642":{"position":[[136,10],[1029,10]]},"1644":{"position":[[28,11]]},"1772":{"position":[[0,6],[195,6],[252,6],[509,7],[781,8],[984,8]]},"1778":{"position":[[217,7]]}}}],["expirationgener",{"_index":2865,"t":{"1376":{"position":[[565,20]]},"1378":{"position":[[917,19]]},"1380":{"position":[[192,20]]}}}],["expiri",{"_index":4121,"t":{"1772":{"position":[[960,6]]}}}],["explain",{"_index":3722,"t":{"1684":{"position":[[325,10]]}}}],["explan",{"_index":3692,"t":{"1680":{"position":[[127,11]]}}}],["explicitli",{"_index":2919,"t":{"1398":{"position":[[820,10]]},"1400":{"position":[[438,10]]},"1408":{"position":[[592,10]]},"1410":{"position":[[487,10]]}}}],["explor",{"_index":1416,"t":{"1178":{"position":[[1217,9],[1282,8]]}}}],["export",{"_index":639,"t":{"839":{"position":[[1082,9]]},"1450":{"position":[[128,6],[231,6]]}}}],["exportvar",{"_index":3035,"t":{"1446":{"position":[[402,11]]},"1450":{"position":[[69,10],[135,10]]}}}],["expos",{"_index":2545,"t":{"1336":{"position":[[8496,6]]},"1400":{"position":[[1178,7]]},"1442":{"position":[[48,6]]},"1464":{"position":[[68,7]]},"1468":{"position":[[501,7]]},"1576":{"position":[[247,6]]},"1628":{"position":[[57,6]]}}}],["exposehead",{"_index":2928,"t":{"1400":{"position":[[1425,13],[1540,13]]},"1402":{"position":[[279,14]]}}}],["express",{"_index":1538,"t":{"1186":{"position":[[656,11]]},"1208":{"position":[[112,7]]},"1220":{"position":[[115,7]]},"1570":{"position":[[70,7]]},"1665":{"position":[[452,7]]},"1667":{"position":[[78,7]]},"1669":{"position":[[78,7]]},"1671":{"position":[[78,7]]},"1673":{"position":[[80,7]]},"1697":{"position":[[1197,7]]},"1735":{"position":[[3342,7],[3412,12],[3505,8],[3531,7]]},"1737":{"position":[[1211,11]]}}}],["expressj",{"_index":3785,"t":{"1704":{"position":[[71,10],[341,10]]},"1733":{"position":[[604,9]]}}}],["expvar",{"_index":3065,"t":{"1464":{"position":[[0,6]]},"1468":{"position":[[395,6],[546,6]]}}}],["expvar.newint(\"count",{"_index":3071,"t":{"1468":{"position":[[256,22]]}}}],["expvarhandlercal",{"_index":3081,"t":{"1468":{"position":[[626,21]]}}}],["expvarmw",{"_index":3069,"t":{"1468":{"position":[[109,8]]}}}],["expvarregexperror",{"_index":3083,"t":{"1468":{"position":[[652,21]]}}}],["ext",{"_index":1160,"t":{"1134":{"position":[[416,3]]}}}],["extauthz",{"_index":3224,"t":{"1534":{"position":[[1237,8]]}}}],["extend",{"_index":397,"t":{"803":{"position":[[683,10]]},"1140":{"position":[[8,9],[177,8]]},"1154":{"position":[[90,6]]},"1366":{"position":[[379,6]]},"1376":{"position":[[290,6]]},"1386":{"position":[[296,6]]},"1398":{"position":[[288,6]]},"1408":{"position":[[288,6]]},"1422":{"position":[[298,6]]},"1446":{"position":[[311,6]]},"1458":{"position":[[427,6]]},"1478":{"position":[[294,6]]},"1488":{"position":[[347,6]]},"1548":{"position":[[294,6]]},"1562":{"position":[[473,6]]},"1574":{"position":[[342,6]]},"1584":{"position":[[290,6]]},"1594":{"position":[[2364,6]]},"1624":{"position":[[298,6]]}}}],["extens",{"_index":1158,"t":{"1134":{"position":[[382,9]]},"1174":{"position":[[43,9],[172,9],[349,9]]},"1336":{"position":[[10790,11]]},"1754":{"position":[[25,10]]},"1880":{"position":[[112,10]]},"1896":{"position":[[85,10]]}}}],["extern",{"_index":516,"t":{"815":{"position":[[251,8]]},"1874":{"position":[[48,8]]}}}],["extract",{"_index":597,"t":{"835":{"position":[[635,10]]},"849":{"position":[[1164,7]]},"1410":{"position":[[296,8]]},"1540":{"position":[[568,7]]},"1642":{"position":[[347,7]]}}}],["extractor",{"_index":2954,"t":{"1408":{"position":[[486,10],[579,9]]},"1410":{"position":[[281,9],[474,9],[1776,9],[1855,9],[1924,9],[1954,9]]},"1412":{"position":[[195,10]]}}}],["extraparam",{"_index":3312,"t":{"1562":{"position":[[1414,10]]},"1564":{"position":[[1396,10]]}}}],["eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9.eyjlehaioje0nje5ntcxmzz9.rb3arc4",{"_index":459,"t":{"807":{"position":[[136,70],[382,69]]}}}],["f",{"_index":3114,"t":{"1490":{"position":[[278,1]]},"1770":{"position":[[1214,1],[1227,1]]},"1886":{"position":[[1528,1],[1543,1],[1556,1]]}}}],["f2",{"_index":2109,"t":{"1304":{"position":[[1126,6]]}}}],["factor",{"_index":4049,"t":{"1754":{"position":[[1091,6]]}}}],["fail",{"_index":982,"t":{"972":{"position":[[106,7]]},"1154":{"position":[[111,5]]},"1697":{"position":[[1026,5]]},"1749":{"position":[[524,4]]}}}],["failedfield",{"_index":4010,"t":{"1749":{"position":[[780,11]]}}}],["failedfield\":\"user.email\",\"tag\":\"required\",\"value\":\"\"},{\"failedfield\":\"user.job.salary\",\"tag\":\"required\",\"value\":\"\"},{\"failedfield\":\"user.job.type\",\"tag\":\"required\",\"valu",{"_index":4031,"t":{"1749":{"position":[[1796,181]]}}}],["failov",{"_index":1054,"t":{"1082":{"position":[[419,8]]}}}],["failovercli",{"_index":1078,"t":{"1084":{"position":[[723,14]]}}}],["failur",{"_index":853,"t":{"902":{"position":[[604,8]]},"958":{"position":[[953,8]]},"1112":{"position":[[556,8]]}}}],["fallback",{"_index":385,"t":{"803":{"position":[[422,8]]},"1858":{"position":[[45,8]]}}}],["fals",{"_index":183,"t":{"759":{"position":[[175,5]]},"771":{"position":[[156,5],[370,6],[377,5]]},"823":{"position":[[190,5]]},"827":{"position":[[418,5]]},"886":{"position":[[347,6]]},"888":{"position":[[555,5]]},"890":{"position":[[151,6]]},"902":{"position":[[376,5]]},"904":{"position":[[96,6]]},"914":{"position":[[281,6]]},"916":{"position":[[177,5],[620,5]]},"918":{"position":[[63,6],[196,6]]},"928":{"position":[[298,6]]},"930":{"position":[[445,5],[545,5]]},"932":{"position":[[151,6],[165,6]]},"958":{"position":[[1108,5],[2786,6]]},"960":{"position":[[103,6]]},"986":{"position":[[225,5]]},"1012":{"position":[[337,6],[549,6]]},"1014":{"position":[[685,5]]},"1016":{"position":[[134,6]]},"1026":{"position":[[323,6],[548,6]]},"1028":{"position":[[779,5]]},"1030":{"position":[[128,6]]},"1040":{"position":[[323,6],[516,6],[730,6]]},"1042":{"position":[[794,5]]},"1044":{"position":[[128,6]]},"1068":{"position":[[300,6]]},"1070":{"position":[[934,5]]},"1072":{"position":[[187,6]]},"1082":{"position":[[335,6],[1003,6],[1160,6]]},"1084":{"position":[[1263,5]]},"1086":{"position":[[116,6]]},"1110":{"position":[[308,6]]},"1112":{"position":[[325,5]]},"1114":{"position":[[284,6]]},"1124":{"position":[[310,6]]},"1126":{"position":[[238,5]]},"1128":{"position":[[88,6]]},"1134":{"position":[[738,5],[854,5]]},"1182":{"position":[[209,6]]},"1184":{"position":[[1398,5]]},"1190":{"position":[[329,5],[1430,5],[2700,5],[3779,5],[3989,5],[4682,5]]},"1223":{"position":[[1471,5],[1586,5],[1703,6],[1811,6]]},"1341":{"position":[[640,5],[1128,5],[1240,5],[1349,5],[1499,5],[1721,5],[1812,5],[1998,5],[2434,5],[2550,5],[3332,5],[3770,5],[4109,5],[4676,5],[5091,5],[6071,5],[6214,5],[6609,5]]},"1360":{"position":[[346,6]]},"1366":{"position":[[695,5]]},"1368":{"position":[[706,5]]},"1378":{"position":[[592,5],[1206,5]]},"1380":{"position":[[106,6],[240,6]]},"1400":{"position":[[1393,6]]},"1402":{"position":[[272,6]]},"1410":{"position":[[912,6],[1006,6]]},"1462":{"position":[[45,6]]},"1502":{"position":[[606,5]]},"1504":{"position":[[74,6]]},"1512":{"position":[[571,6],[734,6],[809,6]]},"1534":{"position":[[425,6]]},"1536":{"position":[[691,6],[906,5]]},"1538":{"position":[[493,6]]},"1552":{"position":[[892,5],[1007,5]]},"1554":{"position":[[237,6],[268,6]]},"1564":{"position":[[1230,5]]},"1576":{"position":[[304,5]]},"1578":{"position":[[170,6]]},"1606":{"position":[[269,5]]},"1608":{"position":[[57,6]]},"1642":{"position":[[744,6],[838,6],[1082,6]]},"1749":{"position":[[533,7]]},"1808":{"position":[[191,6],[397,5]]},"1810":{"position":[[196,5]]},"1840":{"position":[[336,7]]},"1844":{"position":[[253,5],[370,6],[585,5],[626,5],[655,5],[716,5]]},"1880":{"position":[[428,7]]}}}],["far",{"_index":3058,"t":{"1460":{"position":[[288,3]]}}}],["fast",{"_index":857,"t":{"906":{"position":[[2,4]]},"920":{"position":[[165,5]]},"1046":{"position":[[2,4]]},"1208":{"position":[[232,4]]},"1628":{"position":[[26,4]]}}}],["faster",{"_index":3702,"t":{"1682":{"position":[[135,6]]},"1878":{"position":[[322,6]]}}}],["fastest",{"_index":1682,"t":{"1208":{"position":[[173,7]]}}}],["fasthttp",{"_index":715,"t":{"865":{"position":[[9,8]]},"1208":{"position":[[159,9]]},"1235":{"position":[[30,8]]},"1334":{"position":[[117,8]]},"1341":{"position":[[3259,8]]},"1776":{"position":[[248,8]]}}}],["fasthttp'",{"_index":1994,"t":{"1272":{"position":[[25,10]]}}}],["fasthttp.client",{"_index":3438,"t":{"1592":{"position":[[222,20],[373,20],[607,20],[795,20],[993,20],[1177,20],[1371,20]]},"1594":{"position":[[954,17]]}}}],["fasthttp.defaultlbclienttimeout",{"_index":3491,"t":{"1598":{"position":[[89,32]]}}}],["fasthttp.lbclient",{"_index":3490,"t":{"1596":{"position":[[1281,18]]}}}],["fasthttp.request",{"_index":4385,"t":{"1862":{"position":[[19,17],[79,17]]}}}],["fasthttp.request.uri().host",{"_index":2722,"t":{"1341":{"position":[[3302,29]]}}}],["fasthttp.requestctx",{"_index":1927,"t":{"1251":{"position":[[68,20]]},"1349":{"position":[[807,21],[848,19]]},"1776":{"position":[[8,20],[206,20]]}}}],["fasthttp.requesthandl",{"_index":1928,"t":{"1251":{"position":[[135,23]]}}}],["fasthttp.respons",{"_index":4394,"t":{"1866":{"position":[[20,18],[82,18]]}}}],["fasthttp.serv",{"_index":1875,"t":{"1235":{"position":[[81,16]]}}}],["fault",{"_index":3170,"t":{"1516":{"position":[[44,5]]}}}],["favicon",{"_index":3086,"t":{"1474":{"position":[[0,7],[42,7],[391,8],[436,7]]},"1480":{"position":[[231,7],[310,7],[445,7]]}}}],["favicon.ico",{"_index":3090,"t":{"1474":{"position":[[163,11],[413,12]]},"1478":{"position":[[373,16],[395,15]]},"1480":{"position":[[351,14]]}}}],["favnum",{"_index":1506,"t":{"1184":{"position":[[531,8],[591,7],[823,7]]}}}],["favourit",{"_index":1515,"t":{"1184":{"position":[[797,9]]}}}],["fd.test",{"_index":1914,"t":{"1243":{"position":[[715,10]]}}}],["featur",{"_index":1348,"t":{"1170":{"position":[[340,8]]},"1190":{"position":[[276,7],[287,8],[461,8],[627,7],[735,7],[1384,7],[1395,8],[1838,8],[2005,7],[2612,7],[2654,7],[2665,8],[2797,7],[3032,8],[3068,8],[3504,7],[4636,7],[4647,8],[5022,8]]},"1336":{"position":[[10016,8]]},"1398":{"position":[[757,7]]},"1400":{"position":[[375,7]]},"1418":{"position":[[84,8]]},"1737":{"position":[[139,7]]}}}],["feder",{"_index":3433,"t":{"1586":{"position":[[329,11]]}}}],["feel",{"_index":3728,"t":{"1688":{"position":[[150,4]]}}}],["feet",{"_index":1701,"t":{"1212":{"position":[[472,5]]}}}],["fenni",{"_index":4065,"t":{"1756":{"position":[[255,9]]},"1830":{"position":[[397,7]]}}}],["fenny/123",{"_index":4067,"t":{"1756":{"position":[[387,13]]},"1830":{"position":[[519,11],[549,11]]}}}],["ferret",{"_index":4492,"t":{"1894":{"position":[[362,11]]}}}],["fetch",{"_index":82,"t":{"737":{"position":[[388,5]]},"739":{"position":[[388,5]]},"741":{"position":[[388,5]]},"1830":{"position":[[609,7]]}}}],["ff1",{"_index":2116,"t":{"1304":{"position":[[1686,3]]}}}],["ff2",{"_index":2119,"t":{"1304":{"position":[[1750,3],[1834,5]]}}}],["ffffffffffffffffffffffffffffffffffffffff",{"_index":198,"t":{"761":{"position":[[240,43]]}}}],["fiber",{"_index":20,"t":{"727":{"position":[[22,6]]},"743":{"position":[[20,6]]},"745":{"position":[[25,5]]},"753":{"position":[[21,6]]},"759":{"position":[[127,5]]},"765":{"position":[[19,6]]},"767":{"position":[[25,5]]},"777":{"position":[[24,6]]},"779":{"position":[[25,5]]},"787":{"position":[[28,6]]},"789":{"position":[[25,5]]},"799":{"position":[[25,5]]},"817":{"position":[[30,6]]},"827":{"position":[[4,5]]},"829":{"position":[[26,6]]},"831":{"position":[[25,5]]},"841":{"position":[[29,5],[217,5],[234,5],[303,5],[316,5],[333,5],[385,5],[441,5],[487,5]]},"845":{"position":[[25,5]]},"853":{"position":[[23,6]]},"859":{"position":[[50,5],[162,5],[221,5]]},"865":{"position":[[32,5]]},"874":{"position":[[95,5]]},"886":{"position":[[302,8]]},"888":{"position":[[367,7]]},"890":{"position":[[106,8]]},"1012":{"position":[[292,8],[504,8]]},"1014":{"position":[[502,7]]},"1016":{"position":[[89,8]]},"1026":{"position":[[283,8]]},"1028":{"position":[[606,7]]},"1030":{"position":[[88,8]]},"1040":{"position":[[283,8]]},"1042":{"position":[[621,7]]},"1044":{"position":[[88,8]]},"1070":{"position":[[674,7]]},"1072":{"position":[[127,8]]},"1126":{"position":[[65,7]]},"1130":{"position":[[82,5]]},"1156":{"position":[[407,8],[449,5],[721,5]]},"1208":{"position":[[82,5],[100,5],[321,5]]},"1212":{"position":[[75,5]]},"1214":{"position":[[55,5]]},"1216":{"position":[[424,5]]},"1220":{"position":[[53,6],[144,6]]},"1227":{"position":[[14,5]]},"1304":{"position":[[493,5]]},"1341":{"position":[[52,5],[195,8],[2603,5],[3443,5]]},"1347":{"position":[[40,5]]},"1349":{"position":[[580,5]]},"1352":{"position":[[141,5]]},"1354":{"position":[[141,5]]},"1362":{"position":[[36,5]]},"1366":{"position":[[50,5],[186,5]]},"1372":{"position":[[21,5],[243,5]]},"1376":{"position":[[50,5],[182,5]]},"1382":{"position":[[27,5]]},"1386":{"position":[[50,5],[185,5]]},"1394":{"position":[[20,5]]},"1398":{"position":[[50,5],[181,5]]},"1404":{"position":[[20,5]]},"1408":{"position":[[50,5],[181,5]]},"1418":{"position":[[30,5]]},"1422":{"position":[[50,5],[186,5]]},"1430":{"position":[[23,5]]},"1434":{"position":[[50,5],[190,5]]},"1442":{"position":[[22,5]]},"1446":{"position":[[50,5],[183,5]]},"1454":{"position":[[20,5]]},"1458":{"position":[[50,5],[181,5]]},"1464":{"position":[[22,5]]},"1468":{"position":[[50,5],[192,5]]},"1474":{"position":[[23,5]]},"1478":{"position":[[50,5],[184,5]]},"1484":{"position":[[26,5]]},"1488":{"position":[[50,5],[187,5]]},"1516":{"position":[[27,5]]},"1520":{"position":[[50,5],[188,5]]},"1534":{"position":[[1225,5]]},"1544":{"position":[[23,5]]},"1548":{"position":[[50,5],[184,5]]},"1558":{"position":[[22,5]]},"1562":{"position":[[50,5],[364,5]]},"1570":{"position":[[23,5]]},"1574":{"position":[[50,5],[184,5]]},"1576":{"position":[[113,6]]},"1580":{"position":[[21,5]]},"1584":{"position":[[50,5],[182,5]]},"1586":{"position":[[341,6]]},"1590":{"position":[[21,5]]},"1594":{"position":[[50,5],[182,5]]},"1600":{"position":[[23,5]]},"1604":{"position":[[50,5],[184,5]]},"1610":{"position":[[27,6]]},"1620":{"position":[[25,5]]},"1624":{"position":[[50,5],[186,5]]},"1636":{"position":[[23,6]]},"1640":{"position":[[50,5],[184,5]]},"1650":{"position":[[20,5]]},"1654":{"position":[[50,5],[181,5]]},"1656":{"position":[[63,6]]},"1660":{"position":[[50,5],[184,5]]},"1663":{"position":[[440,5]]},"1665":{"position":[[378,5]]},"1667":{"position":[[0,5]]},"1669":{"position":[[0,5]]},"1671":{"position":[[0,5]]},"1673":{"position":[[0,5]]},"1678":{"position":[[162,5],[474,5]]},"1682":{"position":[[178,5],[538,6],[790,5],[1030,5],[1056,5],[1135,5]]},"1684":{"position":[[114,5],[364,6]]},"1686":{"position":[[0,5],[169,6]]},"1690":{"position":[[184,5]]},"1693":{"position":[[30,5],[163,5],[263,5],[313,5],[708,7]]},"1695":{"position":[[0,5]]},"1697":{"position":[[69,5],[555,5]]},"1700":{"position":[[6,5]]},"1704":{"position":[[44,5],[311,5]]},"1710":{"position":[[5,5]]},"1712":{"position":[[50,6]]},"1737":{"position":[[302,5],[1800,5]]},"1739":{"position":[[118,5]]},"1744":{"position":[[0,5],[241,5],[698,5]]},"1746":{"position":[[0,5]]},"1749":{"position":[[0,5]]},"1754":{"position":[[1128,5]]},"1804":{"position":[[211,5],[263,6]]},"1856":{"position":[[518,7],[695,8]]},"1878":{"position":[[189,5]]},"1910":{"position":[[435,7],[485,8]]}}}],["fiber'",{"_index":1185,"t":{"1134":{"position":[[1327,7]]},"1418":{"position":[[331,7]]},"1693":{"position":[[766,7]]},"1744":{"position":[[316,7]]}}}],["fiber.app",{"_index":2807,"t":{"1349":{"position":[[551,11]]},"1690":{"position":[[190,10]]},"1728":{"position":[[507,11]]}}}],["fiber.badg",{"_index":864,"t":{"914":{"position":[[256,17]]},"916":{"position":[[65,16]]},"918":{"position":[[38,17]]}}}],["fiber.config",{"_index":3101,"t":{"1484":{"position":[[229,13]]}}}],["fiber.ctx",{"_index":81,"t":{"737":{"position":[[364,11],[552,11],[741,11]]},"739":{"position":[[364,11],[518,11]]},"741":{"position":[[364,11],[495,11]]},"749":{"position":[[46,11],[750,11],[833,10]]},"751":{"position":[[399,11],[506,11]]},"759":{"position":[[324,11]]},"761":{"position":[[152,11]]},"763":{"position":[[379,11]]},"773":{"position":[[1342,11],[1536,11],[1594,11]]},"783":{"position":[[564,11]]},"785":{"position":[[261,11]]},"793":{"position":[[751,11]]},"795":{"position":[[302,11]]},"805":{"position":[[461,11],[1081,11],[1155,11]]},"809":{"position":[[991,11],[1647,11],[1721,11]]},"815":{"position":[[924,11]]},"823":{"position":[[541,11]]},"825":{"position":[[30,11]]},"827":{"position":[[748,11],[930,11]]},"839":{"position":[[799,11],[876,11]]},"865":{"position":[[53,10]]},"869":{"position":[[154,11]]},"871":{"position":[[190,11]]},"1134":{"position":[[1540,11],[1684,11]]},"1144":{"position":[[664,11],[794,11]]},"1148":{"position":[[667,11],[797,11]]},"1152":{"position":[[753,11],[883,11]]},"1154":{"position":[[843,11]]},"1160":{"position":[[713,11],[843,11]]},"1164":{"position":[[724,11],[854,11]]},"1166":{"position":[[325,11]]},"1168":{"position":[[451,11]]},"1194":{"position":[[715,11],[845,11]]},"1198":{"position":[[890,11],[1020,11]]},"1202":{"position":[[708,11],[838,11]]},"1206":{"position":[[732,11],[862,11]]},"1212":{"position":[[26,10],[137,9],[513,11],[792,11],[1149,11]]},"1214":{"position":[[184,11]]},"1216":{"position":[[709,11],[849,11],[1044,11],[1279,11]]},"1225":{"position":[[988,11],[1109,11],[1442,11],[1540,11],[1693,11],[1783,11],[1873,11]]},"1227":{"position":[[253,11]]},"1241":{"position":[[121,11]]},"1243":{"position":[[135,11]]},"1245":{"position":[[120,11]]},"1247":{"position":[[254,11]]},"1265":{"position":[[409,11]]},"1341":{"position":[[4591,9]]},"1343":{"position":[[156,11]]},"1349":{"position":[[642,11],[693,9]]},"1356":{"position":[[374,11]]},"1358":{"position":[[262,11]]},"1360":{"position":[[284,11]]},"1366":{"position":[[725,11]]},"1368":{"position":[[178,11]]},"1376":{"position":[[372,11],[593,11],[783,11],[865,11]]},"1378":{"position":[[178,11],[709,11]]},"1380":{"position":[[134,11]]},"1386":{"position":[[502,11]]},"1388":{"position":[[178,11]]},"1400":{"position":[[178,11]]},"1408":{"position":[[504,11]]},"1410":{"position":[[178,11],[1971,11]]},"1424":{"position":[[178,11],[379,11],[631,11]]},"1426":{"position":[[48,11],[151,11]]},"1434":{"position":[[764,11],[896,11]]},"1436":{"position":[[178,11]]},"1458":{"position":[[361,11],[592,11]]},"1460":{"position":[[178,11]]},"1468":{"position":[[323,11]]},"1470":{"position":[[178,11]]},"1480":{"position":[[178,11]]},"1502":{"position":[[178,11]]},"1510":{"position":[[177,11]]},"1526":{"position":[[241,11]]},"1528":{"position":[[41,11]]},"1534":{"position":[[205,11],[711,11]]},"1536":{"position":[[471,11],[754,11],[1102,11],[1189,11],[1288,11]]},"1538":{"position":[[273,11],[562,11],[659,11]]},"1542":{"position":[[51,11],[111,11]]},"1548":{"position":[[380,11],[491,11],[568,11]]},"1552":{"position":[[178,11],[412,11],[702,11]]},"1554":{"position":[[86,11],[145,11]]},"1562":{"position":[[1383,11],[1643,11]]},"1564":{"position":[[178,11],[371,11],[1365,11]]},"1576":{"position":[[435,11]]},"1586":{"position":[[178,11]]},"1592":{"position":[[340,11],[551,11],[742,11],[937,11]]},"1594":{"position":[[1092,11],[1388,11],[1677,11],[1966,11],[2559,11],[2660,11]]},"1596":{"position":[[178,11]]},"1604":{"position":[[355,11]]},"1606":{"position":[[178,11],[434,11]]},"1614":{"position":[[285,11],[370,11]]},"1626":{"position":[[178,11]]},"1634":{"position":[[265,11],[350,11]]},"1638":{"position":[[100,11]]},"1640":{"position":[[350,11]]},"1652":{"position":[[47,11]]},"1654":{"position":[[306,11],[390,11],[515,11]]},"1660":{"position":[[281,11],[1108,11],[1837,11]]},"1680":{"position":[[397,11]]},"1684":{"position":[[190,11]]},"1690":{"position":[[454,11],[712,11],[975,11],[1073,11]]},"1693":{"position":[[226,11],[657,11],[1003,11]]},"1695":{"position":[[284,11]]},"1697":{"position":[[677,11]]},"1708":{"position":[[170,11],[291,11]]},"1716":{"position":[[364,11],[663,11],[773,11]]},"1731":{"position":[[988,11],[1109,11],[1442,11],[1540,11],[1693,11],[1783,11],[1873,11]]},"1733":{"position":[[268,11],[396,11],[535,11]]},"1735":{"position":[[898,11],[1073,11],[1184,11],[1303,11],[1535,11],[2019,11],[2215,11],[2589,11]]},"1737":{"position":[[1321,11],[1569,11],[1968,11],[2479,11]]},"1739":{"position":[[261,11],[428,11]]},"1744":{"position":[[849,11]]},"1746":{"position":[[573,11]]},"1749":{"position":[[1225,11]]},"1751":{"position":[[988,11],[1109,11],[1442,11],[1540,11],[1693,11],[1783,11],[1873,11]]},"1754":{"position":[[451,11],[856,11],[1332,11]]},"1756":{"position":[[208,11],[342,11]]},"1758":{"position":[[148,11]]},"1760":{"position":[[244,11]]},"1762":{"position":[[154,11]]},"1764":{"position":[[163,11]]},"1766":{"position":[[193,11],[283,11]]},"1768":{"position":[[148,11]]},"1770":{"position":[[647,11]]},"1772":{"position":[[133,11],[700,11],[894,11]]},"1774":{"position":[[387,11]]},"1778":{"position":[[417,11]]},"1780":{"position":[[225,11]]},"1782":{"position":[[380,11]]},"1784":{"position":[[268,11]]},"1786":{"position":[[198,11]]},"1788":{"position":[[196,11]]},"1792":{"position":[[190,11]]},"1796":{"position":[[201,11]]},"1800":{"position":[[204,11],[301,11],[402,11]]},"1802":{"position":[[158,11]]},"1804":{"position":[[110,11]]},"1806":{"position":[[195,11]]},"1808":{"position":[[318,11]]},"1810":{"position":[[117,11]]},"1812":{"position":[[268,11]]},"1814":{"position":[[382,11]]},"1816":{"position":[[166,11]]},"1818":{"position":[[313,11],[403,11]]},"1820":{"position":[[147,11]]},"1822":{"position":[[243,11]]},"1824":{"position":[[261,11]]},"1826":{"position":[[261,11],[346,11],[431,11]]},"1828":{"position":[[152,11]]},"1830":{"position":[[357,11],[482,11],[960,11]]},"1832":{"position":[[406,11]]},"1834":{"position":[[365,11]]},"1836":{"position":[[314,11]]},"1838":{"position":[[166,11]]},"1840":{"position":[[260,11],[466,11],[680,11],[887,11],[1199,11]]},"1842":{"position":[[403,11]]},"1844":{"position":[[536,11]]},"1846":{"position":[[600,11]]},"1848":{"position":[[590,11]]},"1850":{"position":[[489,11]]},"1852":{"position":[[185,11]]},"1854":{"position":[[295,11],[373,11],[496,11]]},"1856":{"position":[[431,11],[564,11],[832,11]]},"1858":{"position":[[329,11],[409,11],[539,11]]},"1862":{"position":[[125,11]]},"1864":{"position":[[511,11]]},"1866":{"position":[[129,11]]},"1868":{"position":[[380,11],[459,11]]},"1870":{"position":[[143,11],[450,11]]},"1872":{"position":[[158,11]]},"1874":{"position":[[238,11]]},"1878":{"position":[[105,11],[486,11]]},"1880":{"position":[[304,11],[617,11]]},"1882":{"position":[[244,11]]},"1884":{"position":[[147,11]]},"1886":{"position":[[1271,11],[1403,11]]},"1888":{"position":[[150,11]]},"1892":{"position":[[148,11],[231,11],[344,11]]},"1894":{"position":[[324,11]]},"1896":{"position":[[189,11]]},"1898":{"position":[[220,11]]},"1900":{"position":[[270,11]]},"1902":{"position":[[121,11]]},"1904":{"position":[[146,11]]},"1906":{"position":[[123,11]]},"1908":{"position":[[276,11]]},"1910":{"position":[[324,11]]}}}],["fiber.db",{"_index":894,"t":{"930":{"position":[[107,10]]},"932":{"position":[[77,11]]}}}],["fiber.errforbidden",{"_index":2941,"t":{"1404":{"position":[[342,18]]}}}],["fiber.error",{"_index":3762,"t":{"1695":{"position":[[141,12],[431,12],[450,12]]},"1697":{"position":[[824,12],[843,12]]}}}],["fiber.errorhandl",{"_index":3245,"t":{"1540":{"position":[[472,18]]}}}],["fiber.errserviceunavail",{"_index":3759,"t":{"1693":{"position":[[1057,27]]}}}],["fiber.errtooearli",{"_index":2998,"t":{"1422":{"position":[[382,18]]},"1424":{"position":[[737,18]]},"1426":{"position":[[218,18]]}}}],["fiber.errupgraderequir",{"_index":725,"t":{"869":{"position":[[359,24]]}}}],["fiber.gz",{"_index":2684,"t":{"1341":{"position":[[925,11]]}}}],["fiber.handl",{"_index":105,"t":{"747":{"position":[[33,13]]},"757":{"position":[[47,13]]},"769":{"position":[[34,13]]},"781":{"position":[[31,13]]},"791":{"position":[[35,13]]},"821":{"position":[[37,13]]},"833":{"position":[[37,13]]},"857":{"position":[[27,13]]},"1341":{"position":[[3420,14]]},"1349":{"position":[[67,13],[97,13],[163,13],[197,13],[278,13],[327,13],[369,14],[397,13],[463,14],[495,13]]},"1352":{"position":[[189,13],[276,13]]},"1354":{"position":[[192,13]]},"1356":{"position":[[131,13],[210,13]]},"1364":{"position":[[24,13]]},"1368":{"position":[[1034,13]]},"1374":{"position":[[27,13]]},"1384":{"position":[[27,13]]},"1396":{"position":[[27,13]]},"1406":{"position":[[27,13]]},"1420":{"position":[[27,13]]},"1432":{"position":[[58,13]]},"1444":{"position":[[27,13]]},"1456":{"position":[[27,13]]},"1466":{"position":[[11,13]]},"1476":{"position":[[27,13]]},"1486":{"position":[[24,13]]},"1508":{"position":[[27,13]]},"1518":{"position":[[27,13]]},"1532":{"position":[[27,13]]},"1540":{"position":[[279,13]]},"1546":{"position":[[27,13]]},"1552":{"position":[[792,13]]},"1560":{"position":[[27,13]]},"1572":{"position":[[11,13]]},"1582":{"position":[[11,13]]},"1592":{"position":[[96,13],[243,13],[1198,13],[1392,13]]},"1596":{"position":[[479,13],[588,13]]},"1602":{"position":[[27,13]]},"1612":{"position":[[27,13]]},"1622":{"position":[[27,13]]},"1632":{"position":[[27,13]]},"1652":{"position":[[17,14],[65,13]]},"1656":{"position":[[82,13],[333,13]]},"1658":{"position":[[17,14],[79,13],[121,14],[183,13]]},"1870":{"position":[[420,13]]}}}],["fiber.headerauthor",{"_index":3250,"t":{"1542":{"position":[[359,26]]}}}],["fiber.headerxforwardedfor",{"_index":4201,"t":{"1804":{"position":[[329,26]]}}}],["fiber.headerxrequestid",{"_index":3527,"t":{"1628":{"position":[[228,23]]}}}],["fiber.ischild",{"_index":2788,"t":{"1345":{"position":[[194,16]]}}}],["fiber.ismethodsafe(c.method",{"_index":3003,"t":{"1426":{"position":[[177,30]]},"1528":{"position":[[135,30]]}}}],["fiber.map",{"_index":1190,"t":{"1134":{"position":[[1585,10],[1729,10]]},"1144":{"position":[[725,10],[875,10]]},"1148":{"position":[[728,10],[878,10]]},"1152":{"position":[[814,10],[964,10]]},"1154":{"position":[[914,10]]},"1156":{"position":[[396,10]]},"1160":{"position":[[774,10],[924,10]]},"1164":{"position":[[785,10],[935,10]]},"1166":{"position":[[421,10]]},"1168":{"position":[[518,10]]},"1194":{"position":[[776,10],[926,10]]},"1198":{"position":[[951,10],[1101,10]]},"1202":{"position":[[769,10],[919,10]]},"1206":{"position":[[793,10],[943,10]]},"1744":{"position":[[894,10]]},"1746":{"position":[[643,10]]},"1766":{"position":[[331,12]]},"1856":{"position":[[371,10],[499,10],[676,10]]}}}],["fiber.map{\"id",{"_index":4194,"t":{"1800":{"position":[[464,15]]}}}],["fiber.methoddelet",{"_index":2935,"t":{"1402":{"position":[[188,19]]}}}],["fiber.methodget",{"_index":2932,"t":{"1402":{"position":[[118,16]]},"1654":{"position":[[348,15]]}}}],["fiber.methodhead",{"_index":2892,"t":{"1378":{"position":[[1613,17]]},"1380":{"position":[[309,18]]},"1402":{"position":[[153,17]]}}}],["fiber.methodpatch",{"_index":2936,"t":{"1402":{"position":[[208,18]]}}}],["fiber.methodpost",{"_index":2933,"t":{"1402":{"position":[[135,17]]}}}],["fiber.methodput",{"_index":2934,"t":{"1402":{"position":[[171,16]]}}}],["fiber.mimetextplaincharsetutf8",{"_index":3767,"t":{"1695":{"position":[[581,31]]}}}],["fiber.new",{"_index":74,"t":{"737":{"position":[[182,11]]},"739":{"position":[[182,11]]},"741":{"position":[[182,11]]},"751":{"position":[[183,11]]},"761":{"position":[[118,11]]},"763":{"position":[[345,11]]},"773":{"position":[[1215,11]]},"785":{"position":[[137,11]]},"795":{"position":[[141,11]]},"805":{"position":[[154,11]]},"809":{"position":[[433,11]]},"815":{"position":[[824,11]]},"827":{"position":[[355,11]]},"839":{"position":[[728,11]]},"859":{"position":[[184,12]]},"869":{"position":[[120,11]]},"871":{"position":[[133,11]]},"1214":{"position":[[152,11]]},"1218":{"position":[[274,11]]},"1227":{"position":[[142,11],[163,11]]},"1229":{"position":[[165,11],[184,11],[203,11],[224,11]]},"1231":{"position":[[155,11]]},"1233":{"position":[[195,11]]},"1235":{"position":[[128,11]]},"1241":{"position":[[175,11]]},"1243":{"position":[[189,11]]},"1245":{"position":[[174,11]]},"1247":{"position":[[220,11]]},"1339":{"position":[[180,11]]},"1352":{"position":[[158,11]]},"1354":{"position":[[158,11]]},"1358":{"position":[[135,11]]},"1360":{"position":[[135,11]]},"1490":{"position":[[379,11]]},"1492":{"position":[[191,11]]},"1494":{"position":[[194,11]]},"1496":{"position":[[197,11]]},"1498":{"position":[[197,11]]},"1500":{"position":[[338,11]]},"1510":{"position":[[123,11]]},"1534":{"position":[[491,11]]},"1536":{"position":[[951,11]]},"1538":{"position":[[197,11]]},"1614":{"position":[[125,11]]},"1634":{"position":[[124,11]]},"1654":{"position":[[254,11]]},"1660":{"position":[[257,11],[1084,11],[1725,11]]},"1690":{"position":[[284,11],[538,11],[806,11],[1046,11]]},"1693":{"position":[[602,11]]},"1706":{"position":[[88,11],[502,11]]},"1708":{"position":[[140,11]]},"1716":{"position":[[332,11]]},"1741":{"position":[[91,11]]}}}],["fiber.new(fiber.config",{"_index":1186,"t":{"1134":{"position":[[1355,23]]},"1138":{"position":[[389,23],[740,23],[1099,23],[1467,23]]},"1144":{"position":[[602,23]]},"1148":{"position":[[605,23]]},"1152":{"position":[[691,23]]},"1154":{"position":[[781,23]]},"1160":{"position":[[651,23]]},"1164":{"position":[[662,23]]},"1166":{"position":[[263,23]]},"1194":{"position":[[653,23]]},"1198":{"position":[[828,23]]},"1202":{"position":[[646,23]]},"1206":{"position":[[670,23]]},"1212":{"position":[[1464,23]]},"1341":{"position":[[100,23]]},"1345":{"position":[[149,23]]},"1684":{"position":[[145,23]]},"1697":{"position":[[596,23]]},"1700":{"position":[[489,23]]},"1744":{"position":[[344,23]]},"1746":{"position":[[511,23]]},"1804":{"position":[[292,23]]}}}],["fiber.new(fiber.config{view",{"_index":1291,"t":{"1156":{"position":[[324,29]]},"1168":{"position":[[392,29]]}}}],["fiber.newerror",{"_index":3757,"t":{"1693":{"position":[[834,17]]}}}],["fiber.newerror(782",{"_index":2785,"t":{"1343":{"position":[[183,19]]}}}],["fiber.newerror(fiber.statusserviceunavail",{"_index":3761,"t":{"1693":{"position":[[1112,46]]}}}],["fiber.parserconfig",{"_index":4439,"t":{"1886":{"position":[[177,19]]}}}],["fiber.parsertyp",{"_index":4442,"t":{"1886":{"position":[[232,19],[793,17]]}}}],["fiber.parsertype{customtim",{"_index":4455,"t":{"1886":{"position":[[975,31]]}}}],["fiber.request",{"_index":2173,"t":{"1334":{"position":[[247,15]]}}}],["fiber.rout",{"_index":1866,"t":{"1233":{"position":[[235,13]]},"1716":{"position":[[463,12],[560,12]]}}}],["fiber.setparserdecoder(fiber.parserconfig",{"_index":4454,"t":{"1886":{"position":[[895,42]]}}}],["fiber.sqlite3",{"_index":1122,"t":{"1124":{"position":[[260,18]]},"1128":{"position":[[38,18]]}}}],["fiber.stat",{"_index":1778,"t":{"1223":{"position":[[1124,12],[1173,14],[2653,13]]}}}],["fiber.statusforbidden",{"_index":569,"t":{"827":{"position":[[608,22]]}}}],["fiber.statusfound",{"_index":3516,"t":{"1616":{"position":[[570,19]]},"1618":{"position":[[40,18]]}}}],["fiber.statusinternalservererror",{"_index":3763,"t":{"1695":{"position":[[354,31]]},"1697":{"position":[[747,31]]}}}],["fiber.statusok",{"_index":1984,"t":{"1265":{"position":[[775,14]]},"1562":{"position":[[1707,14]]}}}],["fiber.storag",{"_index":2882,"t":{"1378":{"position":[[1095,13]]},"1410":{"position":[[1495,13]]},"1526":{"position":[[1164,13]]},"1552":{"position":[[1159,13]]},"1642":{"position":[[256,13]]}}}],["fiber_storag",{"_index":820,"t":{"886":{"position":[[323,16]]},"888":{"position":[[437,15]]},"890":{"position":[[127,16]]},"930":{"position":[[182,15]]},"932":{"position":[[97,16]]},"946":{"position":[[138,16]]},"958":{"position":[[354,16]]},"960":{"position":[[35,16]]},"1012":{"position":[[313,16],[525,16]]},"1014":{"position":[[572,15]]},"1016":{"position":[[110,16]]},"1026":{"position":[[299,16]]},"1028":{"position":[[671,15]]},"1030":{"position":[[104,16]]},"1040":{"position":[[299,16]]},"1042":{"position":[[686,15]]},"1044":{"position":[[104,16]]},"1068":{"position":[[276,16]]},"1070":{"position":[[739,15]]},"1072":{"position":[[143,16]]},"1124":{"position":[[286,16]]},"1126":{"position":[[130,15]]},"1128":{"position":[[64,16]]}}}],["fiberapp",{"_index":2805,"t":{"1349":{"position":[[529,8]]}}}],["fiberapp(app",{"_index":2806,"t":{"1349":{"position":[[538,12]]}}}],["fiberhandl",{"_index":2801,"t":{"1349":{"position":[[341,12]]}}}],["fiberhandler(h",{"_index":2802,"t":{"1349":{"position":[[354,14]]}}}],["fiberhandlerfunc",{"_index":2803,"t":{"1349":{"position":[[427,16]]}}}],["fiberhandlerfunc(h",{"_index":2804,"t":{"1349":{"position":[[444,18]]}}}],["fiberi18n",{"_index":6,"t":{"725":{"position":[[7,9]]}}}],["fiberi18n.new(&fiberi18n.config",{"_index":157,"t":{"751":{"position":[[204,32]]}}}],["fiberi18n.new(config",{"_index":103,"t":{"747":{"position":[[0,20]]}}}],["fibernewrelic.config",{"_index":172,"t":{"757":{"position":[[25,21]]},"761":{"position":[[209,21]]},"763":{"position":[[436,21]]}}}],["fibernewrelic.new(config",{"_index":171,"t":{"757":{"position":[[0,24]]}}}],["fibersentri",{"_index":7,"t":{"725":{"position":[[17,11]]},"773":{"position":[[0,11],[593,12]]}}}],["fibersentry.gethubfromcontext",{"_index":245,"t":{"773":{"position":[[232,31]]}}}],["fibersentry.gethubfromcontext(c",{"_index":283,"t":{"773":{"position":[[1372,33],[1624,33]]}}}],["fibersentry.new(config",{"_index":211,"t":{"769":{"position":[[0,22]]}}}],["fiberzap",{"_index":8,"t":{"725":{"position":[[29,8]]}}}],["fiberzap.new(config",{"_index":305,"t":{"781":{"position":[[0,19]]}}}],["fiberzerolog",{"_index":9,"t":{"725":{"position":[[38,12]]}}}],["fiberzerolog.new(config",{"_index":341,"t":{"791":{"position":[[0,23]]}}}],["field",{"_index":311,"t":{"783":{"position":[[183,6],[203,6]]},"793":{"position":[[361,6],[381,6]]},"803":{"position":[[546,5]]},"890":{"position":[[23,6]]},"948":{"position":[[67,6],[206,6]]},"1070":{"position":[[139,6]]},"1102":{"position":[[61,6],[200,6]]},"1180":{"position":[[253,6],[299,5]]},"1304":{"position":[[1080,6],[1111,6],[1319,5],[1716,6],[1780,6]]},"1341":{"position":[[248,6]]},"1749":{"position":[[231,6]]},"1760":{"position":[[56,6]]},"1762":{"position":[[50,5]]},"1770":{"position":[[179,5],[221,5],[455,5]]},"1786":{"position":[[246,5]]},"1788":{"position":[[245,5]]},"1792":{"position":[[49,6]]},"1796":{"position":[[50,6]]},"1808":{"position":[[86,5]]},"1816":{"position":[[85,6]]},"1834":{"position":[[169,5],[211,5]]},"1850":{"position":[[170,5],[212,5],[305,5]]},"1864":{"position":[[172,5],[214,5],[315,5]]},"1880":{"position":[[83,5]]},"1884":{"position":[[32,5]]},"1900":{"position":[[22,5],[175,6]]},"1908":{"position":[[75,5]]}}}],["fieldnam",{"_index":1444,"t":{"1180":{"position":[[313,10]]},"1304":{"position":[[957,9],[1294,9],[1330,9]]}}}],["file",{"_index":39,"t":{"733":{"position":[[61,4]]},"735":{"position":[[13,4]]},"749":{"position":[[370,5],[553,5],[707,6]]},"930":{"position":[[265,4]]},"958":{"position":[[216,4]]},"1134":{"position":[[570,5]]},"1140":{"position":[[140,5]]},"1154":{"position":[[402,6]]},"1174":{"position":[[38,4]]},"1188":{"position":[[1302,4],[1389,6],[1867,4],[2273,5],[2436,4]]},"1198":{"position":[[610,5]]},"1218":{"position":[[16,5],[58,6],[102,4],[230,5],[356,5]]},"1223":{"position":[[38,5],[127,5],[285,5],[489,5],[558,5],[569,9],[606,10],[700,4],[717,5],[1099,6],[1359,6],[1875,4],[2010,4],[2241,4]]},"1255":{"position":[[118,5]]},"1259":{"position":[[145,4]]},"1261":{"position":[[160,4]]},"1265":{"position":[[93,5]]},"1304":{"position":[[145,6],[221,6],[536,6],[808,4],[898,6],[1187,4],[1263,4],[1468,5]]},"1341":{"position":[[843,4],[895,4],[914,4]]},"1478":{"position":[[367,5]]},"1480":{"position":[[198,4],[287,4]]},"1482":{"position":[[39,5]]},"1484":{"position":[[58,5]]},"1490":{"position":[[36,5],[247,4],[470,4]]},"1502":{"position":[[262,5],[421,4],[649,4],[814,4],[923,4],[1118,4]]},"1562":{"position":[[1026,4],[1038,5],[1159,5],[1238,5]]},"1678":{"position":[[276,5]]},"1682":{"position":[[387,4],[432,4],[517,4]]},"1782":{"position":[[14,4],[171,4]]},"1786":{"position":[[14,5],[56,4],[231,4],[264,5],[308,4]]},"1824":{"position":[[483,5],[511,5],[589,6],[603,4],[617,5],[753,5]]},"1872":{"position":[[37,4],[288,5],[316,5],[394,6],[408,4],[422,5],[558,5]]},"1874":{"position":[[37,4],[368,5],[396,5],[474,6],[488,4],[502,5],[638,5]]},"1880":{"position":[[14,4],[451,4],[532,4]]},"1896":{"position":[[80,4]]}}}],["file'",{"_index":2113,"t":{"1304":{"position":[[1312,6],[1363,6],[1406,6]]}}}],["file.clos",{"_index":3305,"t":{"1562":{"position":[[1183,12]]}}}],["file.filenam",{"_index":4168,"t":{"1786":{"position":[[376,15]]},"1824":{"position":[[815,16]]},"1872":{"position":[[620,16]]},"1874":{"position":[[712,15]]}}}],["file.header[\"cont",{"_index":4257,"t":{"1824":{"position":[[663,20]]},"1872":{"position":[[468,20]]},"1874":{"position":[[548,20]]}}}],["file.s",{"_index":4256,"t":{"1824":{"position":[[652,10]]},"1872":{"position":[[457,10]]},"1874":{"position":[[537,10]]}}}],["fileb0x",{"_index":1213,"t":{"1138":{"position":[[1176,8],[1549,7]]}}}],["filedata",{"_index":2110,"t":{"1304":{"position":[[1160,9],[1170,8],[1451,8]]}}}],["filedata(formfil",{"_index":2115,"t":{"1304":{"position":[[1638,18]]}}}],["filenam",{"_index":1371,"t":{"1174":{"position":[[523,8],[675,9]]},"1188":{"position":[[1100,9]]},"1782":{"position":[[144,9],[260,8],[326,8]]},"1880":{"position":[[102,9]]}}}],["filename///stat",{"_index":1215,"t":{"1138":{"position":[[1359,33]]}}}],["github.com/casbin/xorm",{"_index":28,"t":{"729":{"position":[[120,22]]},"737":{"position":[[123,23]]},"739":{"position":[[123,23]]},"741":{"position":[[123,23]]}}}],["github.com/geertjohan/go.ric",{"_index":1210,"t":{"1138":{"position":[[969,31]]},"1496":{"position":[[142,31]]}}}],["github.com/getsentry/sentri",{"_index":210,"t":{"767":{"position":[[132,27]]},"773":{"position":[[640,28]]}}}],["github.com/go",{"_index":68,"t":{"737":{"position":[[90,14]]},"739":{"position":[[90,14]]},"741":{"position":[[90,14]]}}}],["github.com/gobuffalo/packr/v2",{"_index":1206,"t":{"1138":{"position":[[613,31]]},"1494":{"position":[[139,31]]}}}],["github.com/goccy/go",{"_index":3784,"t":{"1700":{"position":[[441,20]]}}}],["github.com/gofiber/compress",{"_index":1781,"t":{"1223":{"position":[[1401,30]]}}}],["github.com/gofiber/contrib/casbin",{"_index":24,"t":{"729":{"position":[[48,33]]},"737":{"position":[[52,35]]},"739":{"position":[[52,35]]},"741":{"position":[[52,35]]}}}],["github.com/gofiber/contrib/fiberi18n",{"_index":102,"t":{"745":{"position":[[83,36]]},"751":{"position":[[22,38]]}}}],["github.com/gofiber/contrib/fibernewrel",{"_index":170,"t":{"755":{"position":[[48,40]]},"761":{"position":[[52,42]]},"763":{"position":[[52,42]]}}}],["github.com/gofiber/contrib/fibersentri",{"_index":209,"t":{"767":{"position":[[83,38]]},"773":{"position":[[673,40]]}}}],["github.com/gofiber/contrib/fiberzap",{"_index":303,"t":{"779":{"position":[[83,35]]},"785":{"position":[[58,37]]}}}],["github.com/gofiber/contrib/fiberzerolog",{"_index":339,"t":{"789":{"position":[[83,39]]},"795":{"position":[[52,41]]}}}],["github.com/gofiber/contrib/jwt",{"_index":373,"t":{"799":{"position":[[109,30]]},"805":{"position":[[67,32]]},"809":{"position":[[131,32]]},"815":{"position":[[737,32]]}}}],["github.com/gofiber/contrib/opafib",{"_index":540,"t":{"819":{"position":[[48,35]]},"827":{"position":[[294,37]]}}}],["github.com/gofiber/contrib/otelfib",{"_index":577,"t":{"831":{"position":[[45,36]]},"839":{"position":[[117,38]]}}}],["github.com/gofiber/contrib/paseto",{"_index":677,"t":{"845":{"position":[[83,33]]}}}],["github.com/gofiber/contrib/swagg",{"_index":706,"t":{"859":{"position":[[109,36]]}}}],["github.com/gofiber/contrib/websocket",{"_index":718,"t":{"867":{"position":[[48,36]]},"869":{"position":[[58,38]]}}}],["github.com/gofiber/emb",{"_index":1242,"t":{"1144":{"position":[[464,24]]},"1148":{"position":[[465,24]]},"1152":{"position":[[550,24]]},"1160":{"position":[[513,24]]},"1164":{"position":[[523,24]]},"1194":{"position":[[516,24]]},"1202":{"position":[[509,24]]},"1206":{"position":[[531,24]]}}}],["github.com/gofiber/fiber/v2",{"_index":23,"t":{"729":{"position":[[10,27]]},"737":{"position":[[22,29]]},"739":{"position":[[22,29]]},"741":{"position":[[22,29]]},"745":{"position":[[45,27]]},"751":{"position":[[61,29]]},"755":{"position":[[10,27]]},"761":{"position":[[22,29]]},"763":{"position":[[22,29]]},"767":{"position":[[45,27]]},"773":{"position":[[714,29]]},"779":{"position":[[45,27]]},"785":{"position":[[28,29]]},"789":{"position":[[45,27]]},"795":{"position":[[22,29]]},"799":{"position":[[71,27]]},"805":{"position":[[29,29]]},"809":{"position":[[62,29]]},"815":{"position":[[699,29]]},"819":{"position":[[10,27]]},"827":{"position":[[264,29]]},"839":{"position":[[87,29]]},"845":{"position":[[45,27]]},"859":{"position":[[79,29]]},"867":{"position":[[10,27]]},"869":{"position":[[28,29]]},"1132":{"position":[[49,27]]},"1134":{"position":[[28,29]]},"1138":{"position":[[213,29],[548,29],[904,29],[1268,29]]},"1144":{"position":[[284,29]]},"1148":{"position":[[279,29]]},"1152":{"position":[[361,29]]},"1154":{"position":[[508,29]]},"1160":{"position":[[319,29]]},"1164":{"position":[[340,29]]},"1166":{"position":[[47,29]]},"1168":{"position":[[63,29]]},"1194":{"position":[[336,29]]},"1198":{"position":[[349,29]]},"1202":{"position":[[296,29]]},"1206":{"position":[[315,29]]},"1210":{"position":[[121,27]]},"1214":{"position":[[101,29]]},"1352":{"position":[[39,29]]},"1354":{"position":[[39,29]]},"1356":{"position":[[33,29]]},"1358":{"position":[[33,29]]},"1360":{"position":[[33,29]]},"1366":{"position":[[79,29]]},"1376":{"position":[[79,29]]},"1386":{"position":[[79,29]]},"1398":{"position":[[79,29]]},"1408":{"position":[[79,29]]},"1422":{"position":[[79,29]]},"1434":{"position":[[79,29]]},"1446":{"position":[[79,29]]},"1458":{"position":[[79,29]]},"1468":{"position":[[79,29]]},"1478":{"position":[[79,29]]},"1488":{"position":[[79,29]]},"1490":{"position":[[145,29]]},"1492":{"position":[[57,29]]},"1494":{"position":[[57,29]]},"1496":{"position":[[60,29]]},"1498":{"position":[[57,29]]},"1500":{"position":[[55,29]]},"1510":{"position":[[22,29]]},"1520":{"position":[[79,29]]},"1534":{"position":[[54,29]]},"1536":{"position":[[193,29]]},"1538":{"position":[[54,29]]},"1548":{"position":[[79,29]]},"1562":{"position":[[79,29]]},"1574":{"position":[[79,29]]},"1584":{"position":[[79,29]]},"1594":{"position":[[79,29]]},"1604":{"position":[[79,29]]},"1614":{"position":[[22,29]]},"1624":{"position":[[79,29]]},"1634":{"position":[[22,29]]},"1640":{"position":[[79,29]]},"1654":{"position":[[79,29]]},"1660":{"position":[[79,29]]},"1690":{"position":[[85,29]]},"1693":{"position":[[500,29]]},"1700":{"position":[[404,29]]},"1716":{"position":[[279,29]]},"1728":{"position":[[316,29]]},"1746":{"position":[[196,29]]}}}],["github.com/gofiber/fiber/v2/middleware/adaptor",{"_index":2814,"t":{"1352":{"position":[[69,48]]},"1354":{"position":[[69,48]]},"1356":{"position":[[63,48]]},"1358":{"position":[[63,48]]},"1360":{"position":[[63,48]]}}}],["github.com/gofiber/fiber/v2/middleware/basicauth",{"_index":2841,"t":{"1366":{"position":[[109,50]]}}}],["github.com/gofiber/fiber/v2/middleware/cach",{"_index":2860,"t":{"1376":{"position":[[109,46]]}}}],["github.com/gofiber/fiber/v2/middleware/compress",{"_index":2896,"t":{"1386":{"position":[[109,49]]}}}],["github.com/gofiber/fiber/v2/middleware/cor",{"_index":2907,"t":{"1398":{"position":[[109,45]]}}}],["github.com/gofiber/fiber/v2/middleware/csrf",{"_index":2944,"t":{"1408":{"position":[[109,45]]}}}],["github.com/gofiber/fiber/v2/middleware/earlydata",{"_index":2995,"t":{"1422":{"position":[[109,50]]}}}],["github.com/gofiber/fiber/v2/middleware/encryptcooki",{"_index":3008,"t":{"1434":{"position":[[109,54]]}}}],["github.com/gofiber/fiber/v2/middleware/envvar",{"_index":3031,"t":{"1446":{"position":[[109,47]]}}}],["github.com/gofiber/fiber/v2/middleware/etag",{"_index":3050,"t":{"1458":{"position":[[109,45]]}}}],["github.com/gofiber/fiber/v2/middleware/expvar",{"_index":3070,"t":{"1468":{"position":[[118,47]]}}}],["github.com/gofiber/fiber/v2/middleware/favicon",{"_index":3094,"t":{"1478":{"position":[[109,48]]}}}],["github.com/gofiber/fiber/v2/middleware/filesystem",{"_index":3102,"t":{"1488":{"position":[[109,51]]},"1490":{"position":[[175,51]]},"1492":{"position":[[87,51]]},"1494":{"position":[[87,51]]},"1496":{"position":[[90,51]]},"1498":{"position":[[87,51]]},"1500":{"position":[[85,51]]}}}],["github.com/gofiber/fiber/v2/middleware/helmet",{"_index":3145,"t":{"1510":{"position":[[52,47]]}}}],["github.com/gofiber/fiber/v2/middleware/idempot",{"_index":3180,"t":{"1520":{"position":[[109,52]]}}}],["github.com/gofiber/fiber/v2/middleware/keyauth",{"_index":3200,"t":{"1534":{"position":[[84,48]]},"1536":{"position":[[223,48]]},"1538":{"position":[[84,48]]}}}],["github.com/gofiber/fiber/v2/middleware/limit",{"_index":3256,"t":{"1548":{"position":[[109,48]]}}}],["github.com/gofiber/fiber/v2/middleware/logg",{"_index":3283,"t":{"1562":{"position":[[109,47]]},"1690":{"position":[[115,47]]}}}],["github.com/gofiber/fiber/v2/middleware/monitor",{"_index":3390,"t":{"1574":{"position":[[109,48]]}}}],["github.com/gofiber/fiber/v2/middleware/pprof",{"_index":3427,"t":{"1584":{"position":[[109,46]]}}}],["github.com/gofiber/fiber/v2/middleware/proxi",{"_index":3453,"t":{"1594":{"position":[[109,46]]}}}],["github.com/gofiber/fiber/v2/middleware/recov",{"_index":3494,"t":{"1604":{"position":[[109,48]]},"1693":{"position":[[530,48]]}}}],["github.com/gofiber/fiber/v2/middleware/redirect",{"_index":3502,"t":{"1614":{"position":[[52,49]]}}}],["github.com/gofiber/fiber/v2/middleware/requestid",{"_index":3521,"t":{"1624":{"position":[[109,50]]}}}],["github.com/gofiber/fiber/v2/middleware/rewrit",{"_index":3530,"t":{"1634":{"position":[[52,48]]}}}],["github.com/gofiber/fiber/v2/middleware/sess",{"_index":3538,"t":{"1640":{"position":[[109,48]]}}}],["github.com/gofiber/fiber/v2/middleware/skip",{"_index":3561,"t":{"1654":{"position":[[109,45]]}}}],["github.com/gofiber/fiber/v2/middleware/timeout",{"_index":3577,"t":{"1660":{"position":[[109,48]]}}}],["github.com/gofiber/fiber/v2/util",{"_index":262,"t":{"773":{"position":[[744,35]]}}}],["github.com/gofiber/recip",{"_index":3222,"t":{"1534":{"position":[[1166,26]]}}}],["github.com/gofiber/storage/arangodb",{"_index":814,"t":{"884":{"position":[[234,35]]},"886":{"position":[[35,37]]}}}],["github.com/gofiber/storage/azureblob",{"_index":838,"t":{"898":{"position":[[244,36]]},"900":{"position":[[35,38]]}}}],["github.com/gofiber/storage/badg",{"_index":861,"t":{"912":{"position":[[221,33]]},"914":{"position":[[35,35]]}}}],["github.com/gofiber/storage/bbolt",{"_index":889,"t":{"926":{"position":[[216,32]]},"928":{"position":[[35,34]]}}}],["github.com/gofiber/storage/couchbas",{"_index":906,"t":{"940":{"position":[[227,36]]},"942":{"position":[[35,38]]}}}],["github.com/gofiber/storage/dynamodb",{"_index":925,"t":{"954":{"position":[[225,35]]},"956":{"position":[[35,37]]}}}],["github.com/gofiber/storage/etcd",{"_index":976,"t":{"968":{"position":[[217,31]]},"970":{"position":[[35,33]]}}}],["github.com/gofiber/storage/memcach",{"_index":991,"t":{"984":{"position":[[35,37]]}}}],["github.com/gofiber/storage/memori",{"_index":990,"t":{"982":{"position":[[221,33]]},"996":{"position":[[221,33]]},"998":{"position":[[35,35]]}}}],["github.com/gofiber/storage/mongodb",{"_index":1005,"t":{"1010":{"position":[[223,34]]},"1012":{"position":[[35,36]]}}}],["github.com/gofiber/storage/mssql",{"_index":1015,"t":{"1024":{"position":[[219,32]]},"1026":{"position":[[35,34]]}}}],["github.com/gofiber/storage/mysql",{"_index":1024,"t":{"1038":{"position":[[219,32]]},"1040":{"position":[[35,34]]}}}],["github.com/gofiber/storage/pebbl",{"_index":1032,"t":{"1052":{"position":[[292,33]]},"1054":{"position":[[35,35]]}}}],["github.com/gofiber/storage/postgres/v2",{"_index":1040,"t":{"1066":{"position":[[225,38]]},"1068":{"position":[[35,40]]}}}],["github.com/gofiber/storage/redis/v2",{"_index":1047,"t":{"1080":{"position":[[219,35]]},"1082":{"position":[[35,37]]}}}],["github.com/gofiber/storage/ristretto",{"_index":1096,"t":{"1094":{"position":[[227,36]]},"1096":{"position":[[35,38]]}}}],["github.com/gofiber/storage/s3",{"_index":1113,"t":{"1108":{"position":[[213,29]]},"1110":{"position":[[35,31]]}}}],["github.com/gofiber/storage/sqlite3",{"_index":1119,"t":{"1122":{"position":[[223,34]]},"1124":{"position":[[35,36]]},"1416":{"position":[[83,34]]},"1556":{"position":[[83,34]]},"1648":{"position":[[83,34]]}}}],["github.com/gofiber/template/ace/v2",{"_index":1239,"t":{"1144":{"position":[[314,36]]}}}],["github.com/gofiber/template/amber/v2",{"_index":1248,"t":{"1148":{"position":[[309,38]]}}}],["github.com/gofiber/template/any_template_engine/vx",{"_index":1150,"t":{"1132":{"position":[[87,50]]}}}],["github.com/gofiber/template/django/v3",{"_index":1260,"t":{"1152":{"position":[[391,39]]},"1154":{"position":[[538,39]]}}}],["github.com/gofiber/template/handlebars/v2",{"_index":1309,"t":{"1160":{"position":[[349,43]]}}}],["github.com/gofiber/template/html",{"_index":1200,"t":{"1138":{"position":[[243,34],[578,34],[934,34],[1298,34]]},"1166":{"position":[[77,34]]},"1168":{"position":[[93,34]]}}}],["github.com/gofiber/template/html/v2",{"_index":1157,"t":{"1134":{"position":[[258,37]]},"1164":{"position":[[370,37]]},"1746":{"position":[[226,37]]}}}],["github.com/gofiber/template/jet/v2",{"_index":1639,"t":{"1194":{"position":[[366,36]]}}}],["github.com/gofiber/template/mustach",{"_index":1155,"t":{"1134":{"position":[[159,38]]}}}],["github.com/gofiber/template/mustache/v2",{"_index":1647,"t":{"1198":{"position":[[379,41]]}}}],["github.com/gofiber/template/pug",{"_index":1154,"t":{"1134":{"position":[[122,33]]}}}],["github.com/gofiber/template/pug/v2",{"_index":1663,"t":{"1202":{"position":[[326,36]]}}}],["github.com/gofiber/template/slim/v2",{"_index":1674,"t":{"1206":{"position":[[345,37]]}}}],["github.com/golang",{"_index":374,"t":{"799":{"position":[[150,17]]},"805":{"position":[[100,18]]},"809":{"position":[[92,18]]},"815":{"position":[[770,18]]}}}],["github.com/markbates/pkg",{"_index":1201,"t":{"1138":{"position":[[278,28]]},"1492":{"position":[[139,28]]}}}],["github.com/newrelic/go",{"_index":201,"t":{"763":{"position":[[95,23]]}}}],["github.com/nicksnyder/go",{"_index":153,"t":{"751":{"position":[[91,25]]}}}],["github.com/o1egl/paseto",{"_index":678,"t":{"845":{"position":[[127,23]]}}}],["github.com/rakyll/statik/f",{"_index":3136,"t":{"1500":{"position":[[230,29]]}}}],["github.com/rs/zerolog",{"_index":351,"t":{"795":{"position":[[94,23]]}}}],["github.com/rs/zerolog/log",{"_index":340,"t":{"789":{"position":[[133,25]]}}}],["given",{"_index":769,"t":{"874":{"position":[[312,5],[427,5],[447,5],[660,5]]},"948":{"position":[[93,6],[228,6]]},"1102":{"position":[[87,6],[222,6]]},"1253":{"position":[[37,5]]},"1255":{"position":[[41,5]]},"1259":{"position":[[47,5]]},"1261":{"position":[[62,5]]},"1276":{"position":[[13,5]]},"1278":{"position":[[13,5]]},"1332":{"position":[[101,5]]},"1341":{"position":[[5167,5],[5903,5],[6026,5]]},"1550":{"position":[[353,5]]},"1592":{"position":[[134,5],[167,5],[276,5],[309,5],[428,5],[461,5],[661,5],[708,5],[848,5],[896,5],[1041,5],[1073,5],[1100,5],[1244,5],[1304,5]]},"1656":{"position":[[149,5],[510,5]]},"1772":{"position":[[436,5]]},"1786":{"position":[[70,5]]},"1788":{"position":[[67,5]]},"1824":{"position":[[120,5]]},"1880":{"position":[[28,5]]},"1900":{"position":[[9,5]]}}}],["glob",{"_index":1549,"t":{"1188":{"position":[[1070,4]]}}}],["global",{"_index":250,"t":{"773":{"position":[[379,6]]},"835":{"position":[[253,6],[381,6],[704,6]]},"1134":{"position":[[1169,6]]},"1178":{"position":[[1350,10]]},"1184":{"position":[[51,6]]},"1190":{"position":[[2181,6],[3144,11]]},"1341":{"position":[[6776,6]]},"1594":{"position":[[429,6]]},"1744":{"position":[[406,6],[626,6]]}}}],["go",{"_index":21,"t":{"729":{"position":[[0,2],[38,2],[110,2]]},"743":{"position":[[0,2]]},"745":{"position":[[35,2],[73,2]]},"755":{"position":[[0,2],[38,2]]},"767":{"position":[[35,2],[73,2],[122,2],[160,2]]},"773":{"position":[[669,3]]},"779":{"position":[[35,2],[73,2],[119,2]]},"789":{"position":[[35,2],[73,2],[123,2]]},"799":{"position":[[61,2],[99,2],[140,2]]},"817":{"position":[[52,2]]},"819":{"position":[[0,2],[38,2]]},"831":{"position":[[35,2]]},"845":{"position":[[35,2],[73,2],[117,2]]},"867":{"position":[[0,2],[38,2]]},"884":{"position":[[45,2],[147,2],[227,2]]},"892":{"position":[[79,2]]},"898":{"position":[[50,2],[152,2],[237,2]]},"912":{"position":[[31,2],[133,2],[214,2]]},"920":{"position":[[59,2]]},"926":{"position":[[30,2],[132,2],[209,2]]},"940":{"position":[[34,2],[136,2],[220,2]]},"948":{"position":[[44,2]]},"954":{"position":[[33,2],[135,2],[218,2]]},"968":{"position":[[29,2],[131,2],[210,2]]},"982":{"position":[[31,2],[133,2],[214,2]]},"996":{"position":[[31,2],[133,2],[214,2]]},"1004":{"position":[[45,2]]},"1010":{"position":[[32,2],[134,2],[216,2]]},"1024":{"position":[[30,2],[132,2],[212,2]]},"1032":{"position":[[46,2]]},"1038":{"position":[[30,2],[132,2],[212,2]]},"1052":{"position":[[31,2],[133,2],[285,2]]},"1066":{"position":[[33,2],[135,2],[218,2]]},"1074":{"position":[[29,2]]},"1080":{"position":[[30,2],[132,2],[212,2]]},"1094":{"position":[[34,2],[136,2],[220,2]]},"1102":{"position":[[38,2]]},"1108":{"position":[[27,2],[129,2],[206,2]]},"1122":{"position":[[32,2],[134,2],[216,2]]},"1132":{"position":[[0,2],[39,2],[77,2]]},"1138":{"position":[[447,2],[798,2],[1159,2],[1165,2]]},"1162":{"position":[[21,2]]},"1170":{"position":[[4,2]]},"1174":{"position":[[57,2],[121,2],[281,2]]},"1178":{"position":[[350,2],[539,2],[666,2],[859,2]]},"1180":{"position":[[139,2]]},"1182":{"position":[[20,2],[1198,2],[1295,2]]},"1184":{"position":[[1047,2]]},"1190":{"position":[[1543,2],[1726,2]]},"1208":{"position":[[197,3]]},"1210":{"position":[[35,3],[98,2],[114,2]]},"1214":{"position":[[266,2]]},"1220":{"position":[[45,2],[136,2]]},"1341":{"position":[[4765,2]]},"1488":{"position":[[553,3],[596,2],[668,2]]},"1490":{"position":[[81,2]]},"1498":{"position":[[146,2]]},"1500":{"position":[[211,2]]},"1502":{"position":[[468,2]]},"1638":{"position":[[551,2]]},"1675":{"position":[[112,2]]},"1682":{"position":[[53,2],[598,3],[718,6]]},"1700":{"position":[[359,2]]},"1739":{"position":[[366,2]]},"1746":{"position":[[303,2]]},"1860":{"position":[[92,2]]}}}],["go#hub",{"_index":236,"t":{"773":{"position":[[95,7]]}}}],["go.opentelemetry.io/otel",{"_index":609,"t":{"839":{"position":[[156,26]]}}}],["go.opentelemetry.io/otel/attribut",{"_index":610,"t":{"839":{"position":[[183,36]]}}}],["go.opentelemetry.io/otel/exporters/jaeg",{"_index":613,"t":{"839":{"position":[[283,45]]}}}],["go.opentelemetry.io/otel/exporters/stdout/stdouttrac",{"_index":612,"t":{"839":{"position":[[227,55]]}}}],["go.opentelemetry.io/otel/propag",{"_index":614,"t":{"839":{"position":[[329,38]]}}}],["go.opentelemetry.io/otel/sdk/resourc",{"_index":608,"t":{"839":{"position":[[47,39]]}}}],["go.opentelemetry.io/otel/sdk/trac",{"_index":616,"t":{"839":{"position":[[377,36]]}}}],["go.opentelemetry.io/otel/semconv/v1.4.0",{"_index":618,"t":{"839":{"position":[[422,41]]}}}],["go.opentelemetry.io/otel/trac",{"_index":620,"t":{"839":{"position":[[474,32]]}}}],["go.ric",{"_index":1208,"t":{"1138":{"position":[[809,8]]}}}],["go.uber.org/zap",{"_index":304,"t":{"779":{"position":[[129,15]]},"785":{"position":[[96,17]]}}}],["go1.13.6",{"_index":3669,"t":{"1675":{"position":[[115,8]]}}}],["go:emb",{"_index":1262,"t":{"1154":{"position":[[18,8],[580,10]]},"1166":{"position":[[114,10]]},"1168":{"position":[[130,10]]},"1490":{"position":[[252,10],[310,10]]}}}],["goal",{"_index":882,"t":{"920":{"position":[[121,4]]}}}],["gocb.clust",{"_index":905,"t":{"938":{"position":[[288,13]]}}}],["goccy/go",{"_index":3778,"t":{"1700":{"position":[[279,8]]},"1812":{"position":[[51,8]]}}}],["godoc",{"_index":1356,"t":{"1174":{"position":[[160,7]]}}}],["gofib",{"_index":662,"t":{"841":{"position":[[21,7]]}}}],["gofiber/boilerpl",{"_index":3686,"t":{"1678":{"position":[[379,19]]}}}],["gofiber/templ",{"_index":3723,"t":{"1686":{"position":[[51,16]]}}}],["gofiber/util",{"_index":1718,"t":{"1212":{"position":[[1110,14]]}}}],["gohtml",{"_index":1357,"t":{"1174":{"position":[[182,7]]},"1188":{"position":[[2049,12],[2265,7]]}}}],["gokv",{"_index":941,"t":{"958":{"position":[[1228,5],[1924,5],[2553,4],[2606,4],[2793,4]]}}}],["golang",{"_index":3110,"t":{"1490":{"position":[[47,6]]}}}],["golang.org/x/text/languag",{"_index":155,"t":{"751":{"position":[[131,28]]}}}],["gold",{"_index":3624,"t":{"1663":{"position":[[483,4]]},"1675":{"position":[[80,4]]}}}],["good",{"_index":1167,"t":{"1134":{"position":[[675,4],[794,4]]},"1174":{"position":[[388,4]]},"1665":{"position":[[248,4]]}}}],["googl",{"_index":3881,"t":{"1735":{"position":[[1903,6]]}}}],["google.com",{"_index":4200,"t":{"1802":{"position":[[194,12]]}}}],["gorm",{"_index":63,"t":{"735":{"position":[[0,4]]},"1678":{"position":[[465,4]]}}}],["gorm.config",{"_index":3601,"t":{"1660":{"position":[[1801,15]]}}}],["gorm.open(postgres.open(\"postgres://localhost/foodb",{"_index":3600,"t":{"1660":{"position":[[1746,54]]}}}],["gosublim",{"_index":1360,"t":{"1174":{"position":[[236,9]]}}}],["go’",{"_index":1386,"t":{"1178":{"position":[[21,4]]}}}],["gracefulli",{"_index":1878,"t":{"1237":{"position":[[9,10]]}}}],["grame",{"_index":4216,"t":{"1812":{"position":[[337,8],[430,8],[484,8],[560,8]]},"1814":{"position":[[451,8],[516,8],[598,8]]},"1910":{"position":[[393,8]]}}}],["graph",{"_index":3677,"t":{"1675":{"position":[[671,5]]}}}],["great",{"_index":3996,"t":{"1749":{"position":[[15,5]]}}}],["greatli",{"_index":3904,"t":{"1735":{"position":[[2853,7]]}}}],["greedi",{"_index":3860,"t":{"1735":{"position":[[470,6],[786,7],[1025,6],[1259,6]]}}}],["green",{"_index":3375,"t":{"1568":{"position":[[929,7]]}}}],["greet",{"_index":1281,"t":{"1154":{"position":[[925,11]]},"1156":{"position":[[704,11]]},"1358":{"position":[[165,6]]}}}],["greet(c",{"_index":2832,"t":{"1356":{"position":[[366,7]]},"1358":{"position":[[254,7]]}}}],["greet(w",{"_index":2820,"t":{"1352":{"position":[[466,7]]}}}],["greetwithhttpreq",{"_index":2835,"t":{"1360":{"position":[[165,17]]}}}],["greetwithhttpreq(c",{"_index":2836,"t":{"1360":{"position":[[265,18]]}}}],["group",{"_index":1844,"t":{"1231":{"position":[[8,5],[35,6]]},"1704":{"position":[[21,5],[82,6],[147,5],[302,5]]},"1706":{"position":[[14,6],[436,5]]},"1708":{"position":[[0,5]]},"1716":{"position":[[169,7]]},"1718":{"position":[[52,5],[90,5],[110,5]]},"1720":{"position":[[56,5],[87,5],[107,5],[167,7]]},"1728":{"position":[[195,5],[825,6]]},"1741":{"position":[[63,6],[472,8]]}}}],["group(prefix",{"_index":1845,"t":{"1231":{"position":[[76,12]]}}}],["gt",{"_index":1533,"t":{"1186":{"position":[[417,2]]}}}],["guid",{"_index":3882,"t":{"1735":{"position":[[1921,6]]},"1737":{"position":[[429,4]]},"1741":{"position":[[481,5]]},"1774":{"position":[[76,5]]}}}],["guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/howitworks.provisionedthroughput",{"_index":952,"t":{"958":{"position":[[1486,96],[2182,96]]}}}],["guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/limits.md#capac",{"_index":954,"t":{"958":{"position":[[1655,81],[2351,81]]}}}],["gzip",{"_index":2893,"t":{"1382":{"position":[[71,5]]},"1754":{"position":[[1254,5]]},"1880":{"position":[[150,8]]}}}],["h",{"_index":463,"t":{"807":{"position":[[357,1]]},"1574":{"position":[[605,1]]},"1660":{"position":[[269,1],[1096,1]]},"1728":{"position":[[226,2]]},"1749":{"position":[[1657,1]]},"1770":{"position":[[865,1],[978,1],[1102,1]]},"1864":{"position":[[789,1],[805,1],[820,1]]}}}],["h1",{"_index":1231,"t":{"1144":{"position":[[54,2],[132,2],[170,2]]},"1148":{"position":[[51,2],[124,2],[164,2]]},"1152":{"position":[[60,6],[73,7]]},"1180":{"position":[[747,4],[794,5]]},"1184":{"position":[[542,7]]},"1194":{"position":[[48,6],[61,7]]},"1202":{"position":[[46,2]]},"1206":{"position":[[53,2]]}}}],["h1>a",{"_index":1389,"t":{"1178":{"position":[[218,6],[426,5]]}}}],["h1>filler",{"_index":1579,"t":{"1188":{"position":[[2672,10]]}}}],["h1>hello",{"_index":1465,"t":{"1182":{"position":[[308,10],[858,10]]}}}],["h1>{{.title}}{{.}}{{index",{"_index":1505,"t":{"1184":{"position":[[519,11]]}}}],["h1>{{title}}footerheaderfeatur",{"_index":1590,"t":{"1190":{"position":[[497,11],[595,11],[1875,11],[1973,11]]}}}],["handi",{"_index":3699,"t":{"1682":{"position":[[9,5]]},"1697":{"position":[[192,5]]}}}],["handl",{"_index":145,"t":{"749":{"position":[[822,7]]},"853":{"position":[[45,7]]},"1182":{"position":[[760,6]]},"1341":{"position":[[3185,7]]},"1464":{"position":[[202,7]]},"1484":{"position":[[157,6]]},"1580":{"position":[[235,7]]},"1600":{"position":[[87,7]]},"1606":{"position":[[223,8],[340,6]]},"1654":{"position":[[605,6]]},"1656":{"position":[[679,6]]},"1667":{"position":[[6,7],[86,7]]},"1669":{"position":[[6,7],[86,7]]},"1671":{"position":[[6,7],[86,7]]},"1673":{"position":[[6,7],[88,7]]},"1680":{"position":[[148,9],[351,6]]},"1684":{"position":[[346,8],[381,9]]},"1693":{"position":[[328,6]]},"1697":{"position":[[1247,9]]}}}],["handlebar",{"_index":1142,"t":{"1130":{"position":[[267,10]]},"1136":{"position":[[103,10]]},"1158":{"position":[[0,10]]},"1686":{"position":[[97,10]]},"1746":{"position":[[115,10]]}}}],["handlebars.new(\"./view",{"_index":1310,"t":{"1160":{"position":[[442,25]]}}}],["handler",{"_index":88,"t":{"737":{"position":[[580,7],[769,7]]},"739":{"position":[[546,7]]},"741":{"position":[[523,7]]},"797":{"position":[[115,8]]},"843":{"position":[[124,8]]},"1156":{"position":[[370,7]]},"1188":{"position":[[2112,8],[2379,7]]},"1190":{"position":[[4200,7],[4262,7],[4796,7],[5134,7]]},"1212":{"position":[[277,8],[355,8],[571,7],[661,8],[850,7]]},"1216":{"position":[[217,7]]},"1218":{"position":[[87,7]]},"1223":{"position":[[2015,9],[2467,7]]},"1225":{"position":[[111,8],[120,11],[173,8],[182,11],[235,8],[244,11],[296,8],[305,11],[360,8],[369,11],[425,8],[434,11],[490,8],[499,11],[553,8],[562,11],[616,8],[625,11],[733,8],[742,11],[901,8],[910,11],[952,7],[1068,7],[1751,8]]},"1231":{"position":[[97,8],[106,11],[192,8],[232,8],[268,8],[309,8],[357,8],[393,8],[434,8]]},"1239":{"position":[[45,9]]},"1241":{"position":[[104,7],[209,8],[240,8]]},"1243":{"position":[[118,7],[214,8]]},"1245":{"position":[[103,7]]},"1251":{"position":[[0,7],[27,7],[125,9]]},"1341":{"position":[[2540,9],[3455,8],[4084,8],[6006,7]]},"1347":{"position":[[23,8],[54,9]]},"1362":{"position":[[104,7]]},"1378":{"position":[[1183,7]]},"1418":{"position":[[1011,8]]},"1464":{"position":[[188,9]]},"1480":{"position":[[318,7]]},"1580":{"position":[[221,9]]},"1594":{"position":[[1061,7]]},"1650":{"position":[[47,7]]},"1656":{"position":[[119,7]]},"1660":{"position":[[1817,7]]},"1675":{"position":[[223,9]]},"1680":{"position":[[84,8],[204,7]]},"1684":{"position":[[30,8]]},"1693":{"position":[[86,8],[139,7],[392,7]]},"1695":{"position":[[24,7],[243,7]]},"1697":{"position":[[15,7],[118,7],[172,7],[646,7],[1136,7]]},"1706":{"position":[[207,8],[248,8],[335,8],[376,8],[472,8],[597,8],[638,8],[713,8],[754,8]]},"1708":{"position":[[6,8],[152,7],[395,8],[436,8]]},"1712":{"position":[[3,8]]},"1731":{"position":[[111,8],[120,11],[173,8],[182,11],[235,8],[244,11],[296,8],[305,11],[360,8],[369,11],[425,8],[434,11],[490,8],[499,11],[553,8],[562,11],[616,8],[625,11],[733,8],[742,11],[901,8],[910,11],[952,7],[1068,7],[1751,8]]},"1735":{"position":[[2993,8],[3065,8],[3176,8],[3289,8]]},"1737":{"position":[[320,8]]},"1741":{"position":[[210,8],[251,8],[338,8],[379,8]]},"1751":{"position":[[111,8],[120,11],[173,8],[182,11],[235,8],[244,11],[296,8],[305,11],[360,8],[369,11],[425,8],[434,11],[490,8],[499,11],[553,8],[562,11],[616,8],[625,11],[733,8],[742,11],[901,8],[910,11],[952,7],[1068,7],[1751,8]]},"1768":{"position":[[293,8]]},"1770":{"position":[[1360,8]]},"1780":{"position":[[380,8]]},"1788":{"position":[[360,8]]},"1792":{"position":[[372,8]]},"1796":{"position":[[439,8]]},"1802":{"position":[[257,8]]},"1826":{"position":[[187,8]]},"1828":{"position":[[263,8]]},"1830":{"position":[[1089,8]]},"1842":{"position":[[562,8]]},"1868":{"position":[[229,8]]},"1870":{"position":[[250,7]]}}}],["handler(c",{"_index":1702,"t":{"1212":{"position":[[503,9],[782,9]]}}}],["handler(f",{"_index":2818,"t":{"1352":{"position":[[389,9]]}}}],["handler(w",{"_index":1567,"t":{"1188":{"position":[[2162,9]]},"1190":{"position":[[4357,9]]}}}],["handler).name(\"bar",{"_index":1872,"t":{"1233":{"position":[[334,20]]}}}],["handler).name(\"delet",{"_index":1908,"t":{"1243":{"position":[[347,23]]}}}],["handler).name(\"foo",{"_index":1868,"t":{"1233":{"position":[[267,20]]}}}],["handler).name(\"hom",{"_index":1904,"t":{"1243":{"position":[[257,21]]}}}],["handler).name(\"index",{"_index":1919,"t":{"1245":{"position":[[199,22]]}}}],["handler).name(\"test",{"_index":1912,"t":{"1243":{"position":[[421,21]]}}}],["handler).name(\"tracert",{"_index":1906,"t":{"1243":{"position":[[300,24]]}}}],["handlerscount",{"_index":1891,"t":{"1239":{"position":[[81,15]]}}}],["handshak",{"_index":750,"t":{"871":{"position":[[36,9]]}}}],["hang",{"_index":3726,"t":{"1688":{"position":[[46,4]]}}}],["happi",{"_index":3777,"t":{"1700":{"position":[[193,5]]}}}],["hardwar",{"_index":3617,"t":{"1663":{"position":[[317,9]]}}}],["hash",{"_index":2699,"t":{"1341":{"position":[[1932,7]]}}}],["hashedapikey",{"_index":3206,"t":{"1534":{"position":[[245,12]]},"1536":{"position":[[511,12]]},"1538":{"position":[[313,12]]}}}],["hashedkey",{"_index":3208,"t":{"1534":{"position":[[291,9],[378,13]]},"1536":{"position":[[557,9],[644,13]]},"1538":{"position":[[359,9],[446,13]]}}}],["haspermiss",{"_index":1597,"t":{"1190":{"position":[[713,13],[821,13],[945,13],[1161,13],[1315,13],[1338,14],[2492,13],[2579,16],[2829,15],[3012,13],[3099,13],[3585,13],[3727,16],[3896,13],[4115,13],[4572,16],[4904,13],[5008,13]]}}}],["haspermission(featur",{"_index":1587,"t":{"1190":{"position":[[236,21]]}}}],["hat",{"_index":4350,"t":{"1850":{"position":[[669,4]]},"1864":{"position":[[695,4]]}}}],["have",{"_index":1625,"t":{"1190":{"position":[[4220,6],[5070,6]]}}}],["hb",{"_index":1311,"t":{"1160":{"position":[[468,7],[603,8]]}}}],["head",{"_index":1238,"t":{"1144":{"position":[[225,4]]},"1148":{"position":[[219,4]]},"1152":{"position":[[265,6],[292,7]]},"1160":{"position":[[223,6],[250,7]]},"1164":{"position":[[244,6],[271,7]]},"1188":{"position":[[2497,6],[2627,7]]},"1194":{"position":[[235,6],[263,7]]},"1198":{"position":[[251,6],[278,7]]},"1202":{"position":[[206,4]]},"1206":{"position":[[224,4]]},"1241":{"position":[[440,7]]},"1243":{"position":[[779,7],[842,7],[908,7]]},"1296":{"position":[[514,4]]},"1316":{"position":[[54,5]]},"1336":{"position":[[98,6]]},"1404":{"position":[[252,5]]},"1418":{"position":[[1114,5]]},"1576":{"position":[[475,4]]}}}],["head(path",{"_index":1800,"t":{"1225":{"position":[[155,9]]},"1731":{"position":[[155,9]]},"1751":{"position":[[155,9]]}}}],["head(url",{"_index":1989,"t":{"1270":{"position":[[138,8]]}}}],["head>back/static/image.png",{"_index":3119,"t":{"1490":{"position":[[522,35]]}}}],["http:///static/static/image.png",{"_index":3121,"t":{"1490":{"position":[[617,42]]}}}],["http://api.example.com/users?page=2",{"_index":4231,"t":{"1816":{"position":[[195,38],[300,38]]}}}],["http://api.example.com/users?page=5",{"_index":4232,"t":{"1816":{"position":[[242,38],[354,38]]}}}],["http://example.com",{"_index":4290,"t":{"1838":{"position":[[127,18]]}}}],["http://example.com/?field1=value1&field1=value2&field2=value3",{"_index":4298,"t":{"1840":{"position":[[383,61]]}}}],["http://example.com/?list_a=1&list_a=2&list_a=3&list_b[]=1&list_b[]=2&list_b[]=3&list_c=1,2,3",{"_index":4303,"t":{"1840":{"position":[[567,92]]}}}],["http://example.com/?name=alex&amount=32.23&id",{"_index":4333,"t":{"1846":{"position":[[533,46]]}}}],["http://example.com/?name=alex&wanna_cake=2&id",{"_index":4339,"t":{"1848":{"position":[[523,46]]}}}],["http://example.com/?name=alex&want_pizza=false&id",{"_index":4291,"t":{"1840":{"position":[[189,50]]},"1844":{"position":[[465,50]]}}}],["http://example.com/?order=desc&brand=nik",{"_index":4320,"t":{"1842":{"position":[[341,41]]}}}],["http://example.com/hello",{"_index":4129,"t":{"1774":{"position":[[337,24]]}}}],["http://example.com/search?q=someth",{"_index":4265,"t":{"1828":{"position":[[94,37]]}}}],["http://example.com/user/111",{"_index":4282,"t":{"1834":{"position":[[309,27]]}}}],["http://example.com/user/123",{"_index":4275,"t":{"1832":{"position":[[350,27]]}}}],["http://example.com/user/fenni",{"_index":4063,"t":{"1756":{"position":[[148,29]]},"1830":{"position":[[297,29]]}}}],["http://example.com/user/fenny/123",{"_index":4066,"t":{"1756":{"position":[[282,33]]},"1830":{"position":[[422,33]]}}}],["http://example.com/users?sort=desc",{"_index":4288,"t":{"1836":{"position":[[254,34]]}}}],["http://google.com",{"_index":1974,"t":{"1265":{"position":[[460,17],[615,20]]},"1594":{"position":[[1439,20]]},"1760":{"position":[[281,20],[352,17],[425,18]]}}}],["http://google.com/search",{"_index":4199,"t":{"1802":{"position":[[113,24]]}}}],["http://localhost",{"_index":3475,"t":{"1594":{"position":[[2016,19]]},"1760":{"position":[[302,19],[334,17],[407,17]]}}}],["http://localhost:3000",{"_index":1729,"t":{"1214":{"position":[[293,21]]},"1398":{"position":[[589,21],[717,22]]},"1510":{"position":[[268,21]]},"1534":{"position":[[856,21],[968,21],[1070,21]]},"1536":{"position":[[1451,21]]},"1538":{"position":[[820,21]]},"1594":{"position":[[1726,24]]},"1737":{"position":[[2601,22]]},"1770":{"position":[[1238,21]]},"1864":{"position":[[763,24]]}}}],["http://localhost:3000/1",{"_index":3971,"t":{"1737":{"position":[[1443,23],[1711,23]]}}}],["http://localhost:3000/12",{"_index":3970,"t":{"1737":{"position":[[1397,24]]}}}],["http://localhost:3000/120000",{"_index":3973,"t":{"1737":{"position":[[1645,28]]}}}],["http://localhost:3000/125",{"_index":3982,"t":{"1737":{"position":[[2044,25]]}}}],["http://localhost:3000/2022",{"_index":3985,"t":{"1737":{"position":[[2166,26]]}}}],["http://localhost:3000/250",{"_index":3975,"t":{"1737":{"position":[[1767,25]]}}}],["http://localhost:3000/42",{"_index":3989,"t":{"1737":{"position":[[2555,24]]}}}],["http://localhost:3000/7.0",{"_index":3990,"t":{"1737":{"position":[[2642,25]]}}}],["http://localhost:3000/?name=john&pass=do",{"_index":4107,"t":{"1770":{"position":[[1276,43]]}}}],["http://localhost:3000/?name=john&pass=doe&products=shoe,hat",{"_index":4351,"t":{"1850":{"position":[[737,61]]}}}],["http://localhost:3000/allow",{"_index":3244,"t":{"1538":{"position":[[952,29]]}}}],["http://localhost:3000/api/user/john",{"_index":1746,"t":{"1216":{"position":[[1218,35]]}}}],["http://localhost:3000/auth2",{"_index":3239,"t":{"1536":{"position":[[1749,27]]}}}],["http://localhost:3000/authent",{"_index":3237,"t":{"1536":{"position":[[1585,35]]}}}],["http://localhost:3000/bodi",{"_index":4473,"t":{"1886":{"position":[[1574,26]]}}}],["http://localhost:3000/css/style.css",{"_index":1768,"t":{"1223":{"position":[[435,35]]}}}],["http://localhost:3000/flights/lax",{"_index":3889,"t":{"1735":{"position":[[2140,33]]}}}],["http://localhost:3000/foo/1000",{"_index":3592,"t":{"1660":{"position":[[861,32]]}}}],["http://localhost:3000/foo/3000",{"_index":3593,"t":{"1660":{"position":[[952,32]]}}}],["http://localhost:3000/hello.html",{"_index":1766,"t":{"1223":{"position":[[355,32]]}}}],["http://localhost:3000/john",{"_index":1743,"t":{"1216":{"position":[[991,26]]}}}],["http://localhost:3000/js/jquery.j",{"_index":1767,"t":{"1223":{"position":[[394,34]]}}}],["http://localhost:3000/login",{"_index":458,"t":{"807":{"position":[[88,27]]}}}],["http://localhost:3000/metr",{"_index":3395,"t":{"1574":{"position":[[634,29]]}}}],["http://localhost:3000/old",{"_index":3508,"t":{"1614":{"position":[[476,25]]},"1634":{"position":[[456,25]]}}}],["http://localhost:3000/old/hello",{"_index":3509,"t":{"1614":{"position":[[507,31]]},"1634":{"position":[[487,31]]}}}],["http://localhost:3000/plantae/prunus.persica",{"_index":3883,"t":{"1735":{"position":[[1931,44]]}}}],["http://localhost:3000/query?title=title&body=body&date=2021",{"_index":4474,"t":{"1886":{"position":[[1616,60]]}}}],["http://localhost:3000/shop/product/color:blue/size:x",{"_index":3897,"t":{"1735":{"position":[[2479,53]]}}}],["http://localhost:3000/static/css/style.css",{"_index":1773,"t":{"1223":{"position":[[968,42]]}}}],["http://localhost:3000/static/hello.html",{"_index":1771,"t":{"1223":{"position":[[874,39]]}}}],["http://localhost:3000/static/js/jquery.j",{"_index":1772,"t":{"1223":{"position":[[920,41]]}}}],["http://localhost:3000/test",{"_index":3984,"t":{"1737":{"position":[[2104,26]]}}}],["http://localhost:3001",{"_index":3478,"t":{"1594":{"position":[[2276,24],[2459,24],[2875,24]]}}}],["http://localhost:3002",{"_index":3479,"t":{"1594":{"position":[[2301,24],[2484,24],[2900,24]]}}}],["http://localhost:3003",{"_index":3480,"t":{"1594":{"position":[[2326,24],[2509,24],[2925,24]]}}}],["http://localhost:8000",{"_index":937,"t":{"958":{"position":[[614,24]]},"1594":{"position":[[820,25]]}}}],["http://localhost:8080",{"_index":4084,"t":{"1768":{"position":[[92,21]]}}}],["http://localhost:8080/css/style.css",{"_index":1759,"t":{"1218":{"position":[[466,35]]}}}],["http://localhost:8080/hello",{"_index":4401,"t":{"1870":{"position":[[84,27]]}}}],["http://localhost:8080/hello%20world",{"_index":1739,"t":{"1216":{"position":[[787,35]]}}}],["http://localhost:8080/hello.html",{"_index":1757,"t":{"1218":{"position":[[398,32]]}}}],["http://localhost:8080/js/jquery.j",{"_index":1758,"t":{"1218":{"position":[[431,34]]}}}],["http://localhost:8080/register/us",{"_index":4030,"t":{"1749":{"position":[[1743,35]]}}}],["http://www.foobar.com",{"_index":3489,"t":{"1596":{"position":[[332,22]]}}}],["httpapi",{"_index":3177,"t":{"1516":{"position":[[293,7]]}}}],["httperror",{"_index":2783,"t":{"1343":{"position":[[23,9]]}}}],["httphandler",{"_index":2792,"t":{"1349":{"position":[[27,11]]}}}],["httphandler(h",{"_index":2793,"t":{"1349":{"position":[[39,13]]}}}],["httphandlerfunc",{"_index":2795,"t":{"1349":{"position":[[111,15]]}}}],["httphandlerfunc(h",{"_index":2796,"t":{"1349":{"position":[[127,17]]}}}],["httphandlerfunc(mw",{"_index":2799,"t":{"1349":{"position":[[226,18]]}}}],["httpmiddlewar",{"_index":2798,"t":{"1349":{"position":[[211,14]]}}}],["httponli",{"_index":4119,"t":{"1772":{"position":[[822,9],[1027,9]]},"1778":{"position":[[280,8]]}}}],["httpreq",{"_index":2837,"t":{"1360":{"position":[[304,8]]}}}],["httpreq.url.str",{"_index":2840,"t":{"1360":{"position":[[420,21]]}}}],["https://blog.trailofbits.com/2019/03/25/what",{"_index":2989,"t":{"1418":{"position":[[733,44]]}}}],["https://cdn.jsdelivr.net/npm/chart.js@2.9/dist/chart.bundle.min.j",{"_index":3415,"t":{"1576":{"position":[[857,66]]}}}],["https://datatracker.ietf.org/doc/html/draft",{"_index":3175,"t":{"1516":{"position":[[244,43]]}}}],["https://datatracker.ietf.org/doc/html/rfc8446#sect",{"_index":2988,"t":{"1418":{"position":[[677,53]]}}}],["https://docs.aws.amazon.com/general/latest/gr/rande.html#ddb_region",{"_index":928,"t":{"958":{"position":[[89,68]]}}}],["https://example.com",{"_index":2175,"t":{"1334":{"position":[[290,21]]},"1764":{"position":[[198,19]]}}}],["https://example.com/page#chapt",{"_index":4079,"t":{"1764":{"position":[[108,32]]}}}],["https://expressjs.com/en/4x/api.html#req.fresh",{"_index":4171,"t":{"1790":{"position":[[0,46]]}}}],["https://expressjs.com/en/4x/api.html#req.stal",{"_index":4478,"t":{"1890":{"position":[[0,46]]}}}],["https://fonts.googleapis.com/css2?family=roboto:wght@400;900&display=swap",{"_index":3412,"t":{"1576":{"position":[[656,73]]}}}],["https://foobar.com",{"_index":3488,"t":{"1596":{"position":[[311,20]]}}}],["https://github.com/awsdocs/amazon",{"_index":950,"t":{"958":{"position":[[1433,33],[1602,33],[2129,33],[2298,33]]}}}],["https://github.com/geertjohan/go.ric",{"_index":1209,"t":{"1138":{"position":[[838,37]]},"1496":{"position":[[0,37]]}}}],["https://github.com/go",{"_index":4002,"t":{"1749":{"position":[[556,21]]}}}],["https://github.com/gobuffalo/packr",{"_index":1205,"t":{"1138":{"position":[[485,34]]},"1494":{"position":[[0,34]]}}}],["https://github.com/gofiber/storag",{"_index":765,"t":{"874":{"position":[[207,34]]}}}],["https://github.com/markbates/pkg",{"_index":1199,"t":{"1138":{"position":[[150,34]]},"1492":{"position":[[0,34]]}}}],["https://github.com/rakyll/statik",{"_index":3131,"t":{"1500":{"position":[[0,32]]}}}],["https://github.com/smallnest/go",{"_index":3664,"t":{"1675":{"position":[[3,31]]}}}],["https://github.com/unnoted/fileb0x",{"_index":1214,"t":{"1138":{"position":[[1205,34]]},"1498":{"position":[[0,34]]}}}],["https://godoc.org/github.com/getsentry/sentri",{"_index":235,"t":{"773":{"position":[[48,46]]}}}],["https://gofiber.io",{"_index":2911,"t":{"1398":{"position":[[369,20]]}}}],["https://gofiber.net",{"_index":2912,"t":{"1398":{"position":[[390,21]]}}}],["https://hub.docker.com/r/amazon/dynamodb",{"_index":938,"t":{"958":{"position":[[646,40]]}}}],["https://i.imgur.com/\"+c.params(\"id\")+\".gif",{"_index":3467,"t":{"1594":{"position":[[1119,44]]}}}],["https://pkg.go.dev/github.com/fasthttp/websocket?tab=doc#pkg",{"_index":737,"t":{"869":{"position":[[666,60]]}}}],["https://programming.guide/go/format",{"_index":3323,"t":{"1564":{"position":[[662,35]]}}}],["https://storageaccountname.blob.core.windows.net",{"_index":844,"t":{"902":{"position":[[140,50]]}}}],["https://www.websocket.org/echo.html",{"_index":749,"t":{"869":{"position":[[1072,35]]}}}],["httptest.newrequest(\"get",{"_index":1978,"t":{"1265":{"position":[[588,26]]}}}],["hub",{"_index":282,"t":{"773":{"position":[[1365,3],[1406,3],[1617,3],[1658,3]]}}}],["hub.capturemessage(\"us",{"_index":295,"t":{"773":{"position":[[1767,24]]}}}],["hub.scope().settag(\"somerandomtag",{"_index":284,"t":{"773":{"position":[[1419,35]]}}}],["hub.withscope(func(scop",{"_index":291,"t":{"773":{"position":[[1671,24]]}}}],["hyphen",{"_index":3876,"t":{"1735":{"position":[[1613,6]]}}}],["i.",{"_index":996,"t":{"986":{"position":[[52,4]]},"1225":{"position":[[1292,4]]},"1418":{"position":[[965,4]]},"1596":{"position":[[305,5]]},"1731":{"position":[[1292,4]]},"1751":{"position":[[1292,4]]}}}],["i18n",{"_index":99,"t":{"743":{"position":[[3,4]]},"749":{"position":[[142,4]]}}}],["i18n.unmarshalfunc",{"_index":138,"t":{"749":{"position":[[648,18]]}}}],["i18n/v2/i18n",{"_index":154,"t":{"751":{"position":[[117,13]]}}}],["icon",{"_index":3087,"t":{"1474":{"position":[[80,4]]}}}],["id",{"_index":634,"t":{"839":{"position":[[896,2],[950,3],[984,3],[1596,2],[1704,5],[1730,2]]},"1190":{"position":[[200,2],[1141,2],[1257,3],[4465,3],[4827,2]]},"1336":{"position":[[10502,3],[11548,3]]},"1562":{"position":[[656,2]]},"1624":{"position":[[444,3]]},"1626":{"position":[[259,2],[298,3],[503,2]]},"1638":{"position":[[445,4]]},"1642":{"position":[[363,2],[1322,2]]},"1796":{"position":[[248,4]]},"1832":{"position":[[426,3]]},"1834":{"position":[[401,3],[453,7]]}}}],["idjohndoe/myembeddedfil",{"_index":3129,"t":{"1498":{"position":[[149,24]]}}}],["module>/statik",{"_index":3135,"t":{"1500":{"position":[[214,15]]}}}],["mongo.databas",{"_index":1004,"t":{"1008":{"position":[[288,15]]}}}],["mongodb",{"_index":794,"t":{"876":{"position":[[72,7]]},"1004":{"position":[[2,7]]},"1010":{"position":[[0,7],[192,7]]}}}],["mongodb.new",{"_index":1006,"t":{"1012":{"position":[[171,13]]}}}],["mongodb.new(mongodb.config",{"_index":1007,"t":{"1012":{"position":[[222,27],[408,27]]}}}],["mongodb/mongo",{"_index":1003,"t":{"1004":{"position":[[31,13]]}}}],["mongodb://user:password@127.0.0.1:27017",{"_index":1011,"t":{"1012":{"position":[[451,42]]}}}],["monitor",{"_index":3387,"t":{"1570":{"position":[[0,7],[85,7],[101,7]]},"1576":{"position":[[120,8],[263,10]]}}}],["monitor.new",{"_index":3392,"t":{"1574":{"position":[[321,14]]}}}],["monitor.new(monitor.config{titl",{"_index":3394,"t":{"1574":{"position":[[488,33]]}}}],["month",{"_index":1450,"t":{"1180":{"position":[[788,5]]}}}],["more",{"_index":766,"t":{"874":{"position":[[246,4]]},"1136":{"position":[[8,4],[76,4]]},"1184":{"position":[[416,4]]},"1186":{"position":[[535,4]]},"1212":{"position":[[1512,4]]},"1220":{"position":[[4,4]]},"1223":{"position":[[1044,4]]},"1229":{"position":[[39,4]]},"1341":{"position":[[4812,4],[5056,4]]},"1454":{"position":[[46,4]]},"1534":{"position":[[1130,4]]},"1552":{"position":[[1399,4]]},"1562":{"position":[[725,4]]},"1630":{"position":[[140,4]]},"1680":{"position":[[113,4]]},"1682":{"position":[[146,4]]},"1686":{"position":[[139,4]]},"1690":{"position":[[1275,4]]},"1737":{"position":[[647,4],[857,4],[952,4],[1022,4]]},"1741":{"position":[[437,4]]},"1768":{"position":[[386,7]]},"1770":{"position":[[1453,7]]},"1774":{"position":[[218,4]]},"1776":{"position":[[275,4]]},"1780":{"position":[[473,7]]},"1788":{"position":[[453,7]]},"1792":{"position":[[465,7]]},"1796":{"position":[[532,7]]},"1802":{"position":[[350,7]]},"1828":{"position":[[356,7]]},"1830":{"position":[[1182,7]]},"1842":{"position":[[655,7]]},"1854":{"position":[[462,4]]}}}],["mount",{"_index":1824,"t":{"1227":{"position":[[8,5],[43,6]]},"1229":{"position":[[81,8],[435,8],[497,5],[536,8]]},"1341":{"position":[[3435,7]]},"1728":{"position":[[49,8],[71,5],[108,7],[201,9],[649,5],[728,5],[795,5],[848,5]]},"1739":{"position":[[509,6]]}}}],["mount(prefix",{"_index":1825,"t":{"1227":{"position":[[74,12]]}}}],["mountpath",{"_index":1830,"t":{"1229":{"position":[[4,9],[116,11],[467,10]]}}}],["move",{"_index":221,"t":{"771":{"position":[[255,6]]}}}],["ms",{"_index":3580,"t":{"1660":{"position":[[360,5],[1187,5]]},"1665":{"position":[[448,3],[524,3]]},"1667":{"position":[[74,3],[155,3]]},"1669":{"position":[[74,3],[154,3]]},"1671":{"position":[[74,3],[153,3]]},"1673":{"position":[[76,3],[156,3]]},"1675":{"position":[[178,3],[185,3],[193,3],[201,2],[540,2]]},"1682":{"position":[[659,2]]}}}],["msg",{"_index":740,"t":{"869":{"position":[[746,3],[782,4],[880,4],[913,5]]}}}],["mssql",{"_index":795,"t":{"876":{"position":[[80,5]]},"1018":{"position":[[2,5]]},"1024":{"position":[[0,5],[190,5]]}}}],["mssql.new",{"_index":1016,"t":{"1026":{"position":[[169,11]]}}}],["mssql.new(mssql.config",{"_index":1017,"t":{"1026":{"position":[[218,23],[444,23]]}}}],["mssqldb",{"_index":1013,"t":{"1018":{"position":[[42,8]]}}}],["mstimeout",{"_index":1971,"t":{"1265":{"position":[[296,9]]}}}],["mt",{"_index":739,"t":{"869":{"position":[[739,2],[778,3]]}}}],["multi",{"_index":2755,"t":{"1341":{"position":[[5491,5],[5519,5]]},"1596":{"position":[[870,5],[901,5]]}}}],["multipart",{"_index":2091,"t":{"1304":{"position":[[20,9],[185,9],[632,9],[833,9],[1201,9],[1248,9],[1478,9]]},"1341":{"position":[[1558,9],[1649,9]]},"1824":{"position":[[10,9],[294,9]]},"1872":{"position":[[27,9],[191,9]]},"1874":{"position":[[27,9],[271,9]]}}}],["multipart.filehead",{"_index":4164,"t":{"1786":{"position":[[138,23]]},"1824":{"position":[[549,23]]},"1872":{"position":[[87,22],[354,23]]},"1874":{"position":[[126,22],[434,23]]}}}],["multipart.form",{"_index":4249,"t":{"1824":{"position":[[207,17],[364,15]]},"1872":{"position":[[261,15]]},"1874":{"position":[[341,15]]}}}],["multipart/form",{"_index":2092,"t":{"1304":{"position":[[81,14]]},"1336":{"position":[[807,15]]},"1770":{"position":[[306,14]]}}}],["multipartform",{"_index":2090,"t":{"1304":{"position":[[0,13],[165,13],[580,14]]},"1786":{"position":[[0,13]]},"1824":{"position":[[64,16],[191,15]]}}}],["multipartform(arg",{"_index":2095,"t":{"1304":{"position":[[356,18]]}}}],["multipartform(nil",{"_index":2100,"t":{"1304":{"position":[[752,19],[1133,19],[1840,18]]}}}],["multipl",{"_index":1133,"t":{"1130":{"position":[[47,8]]},"1174":{"position":[[608,8]]},"1180":{"position":[[378,8]]},"1216":{"position":[[208,8]]},"1223":{"position":[[500,8]]},"1225":{"position":[[1625,9],[1742,8]]},"1278":{"position":[[38,8]]},"1284":{"position":[[68,8]]},"1304":{"position":[[889,8]]},"1341":{"position":[[4756,8]]},"1516":{"position":[[200,8]]},"1584":{"position":[[369,8]]},"1590":{"position":[[64,8]]},"1592":{"position":[[41,8]]},"1731":{"position":[[1625,9],[1742,8]]},"1737":{"position":[[1250,8],[1502,8]]},"1746":{"position":[[66,8]]},"1751":{"position":[[1625,9],[1742,8]]},"1772":{"position":[[259,8]]},"1900":{"position":[[166,8]]}}}],["mustach",{"_index":1145,"t":{"1130":{"position":[[287,8]]},"1136":{"position":[[118,8]]},"1140":{"position":[[146,8]]},"1196":{"position":[[0,8]]},"1198":{"position":[[494,12],[762,13],[776,12]]},"1686":{"position":[[117,8]]},"1746":{"position":[[130,8]]}}}],["mustache.new(\"./view",{"_index":1648,"t":{"1198":{"position":[[470,23]]}}}],["mustache.newfilesystem(http.dir(\"./view",{"_index":1653,"t":{"1198":{"position":[[719,42]]}}}],["my_database.db",{"_index":892,"t":{"928":{"position":[[252,17]]}}}],["mycustomapi",{"_index":199,"t":{"761":{"position":[[293,14]]}}}],["mycustomstorag",{"_index":3262,"t":{"1548":{"position":[[636,18]]}}}],["myembeddedfiles.http",{"_index":3130,"t":{"1498":{"position":[[268,21]]}}}],["myfil",{"_index":3937,"t":{"1737":{"position":[[628,6]]}}}],["mymiddlewar",{"_index":4409,"t":{"1870":{"position":[[405,14]]}}}],["myservic",{"_index":3393,"t":{"1574":{"position":[[443,10],[522,10]]}}}],["mysql",{"_index":796,"t":{"876":{"position":[[86,5]]},"884":{"position":[[205,5]]},"920":{"position":[[268,6]]},"1032":{"position":[[2,5]]},"1038":{"position":[[0,5],[190,5]]}}}],["mysql.new",{"_index":1025,"t":{"1040":{"position":[[169,11]]}}}],["mysql.new(mysql.config",{"_index":1026,"t":{"1040":{"position":[[218,23],[424,23],[691,23]]}}}],["n",{"_index":1286,"t":{"1156":{"position":[[128,5]]},"1716":{"position":[[615,5]]},"1902":{"position":[[74,2]]},"1904":{"position":[[99,2]]},"1906":{"position":[[76,2]]}}}],["name",{"_index":167,"t":{"751":{"position":[[658,7]]},"759":{"position":[[122,4]]},"805":{"position":[[697,7],[1251,4],[1316,5]]},"809":{"position":[[1227,7],[1817,4],[1882,5]]},"827":{"position":[[136,7]]},"835":{"position":[[979,4]]},"839":{"position":[[917,4],[988,5],[994,6]]},"888":{"position":[[29,4],[335,4],[405,4]]},"902":{"position":[[40,5],[74,5]]},"916":{"position":[[33,4]]},"930":{"position":[[150,4]]},"944":{"position":[[251,4]]},"958":{"position":[[314,4]]},"1014":{"position":[[170,4],[470,4],[540,4]]},"1028":{"position":[[212,4],[511,4],[574,4],[639,4]]},"1042":{"position":[[290,4],[589,4],[654,4]]},"1056":{"position":[[33,4]]},"1070":{"position":[[343,4],[642,4],[707,4]]},"1082":{"position":[[488,6]]},"1084":{"position":[[29,4],[848,4]]},"1112":{"position":[[76,4]]},"1126":{"position":[[33,4],[98,4]]},"1134":{"position":[[891,4],[1260,4]]},"1162":{"position":[[315,4]]},"1174":{"position":[[0,6]]},"1176":{"position":[[319,5],[366,5],[428,4]]},"1178":{"position":[[880,4]]},"1180":{"position":[[305,4]]},"1182":{"position":[[324,7],[332,9],[378,5],[403,4],[443,4],[874,7],[882,9],[995,4],[1329,4],[1376,4],[1427,4],[1746,4],[1903,9]]},"1184":{"position":[[365,5],[465,5],[579,4]]},"1186":{"position":[[149,5]]},"1188":{"position":[[363,5],[787,4],[858,7],[990,4],[1307,6],[1332,5],[1367,5],[1447,4],[1536,4],[1746,4]]},"1190":{"position":[[2319,5]]},"1218":{"position":[[251,5]]},"1223":{"position":[[306,5],[1857,4]]},"1233":{"position":[[142,4],[301,6],[368,6]]},"1243":{"position":[[24,4],[571,7],[638,7],[707,7],[787,7],[850,7],[916,7],[1003,7],[1095,7]]},"1245":{"position":[[30,5],[356,7]]},"1247":{"position":[[443,7]]},"1304":{"position":[[1087,6],[1325,4],[1350,4],[1370,4],[1375,4]]},"1312":{"position":[[93,5]]},"1339":{"position":[[30,5]]},"1341":{"position":[[329,4],[848,4],[919,5],[1298,5],[2531,4]]},"1349":{"position":[[0,4]]},"1410":{"position":[[570,4]]},"1430":{"position":[[105,6]]},"1434":{"position":[[940,5]]},"1440":{"position":[[106,5]]},"1526":{"position":[[402,4]]},"1640":{"position":[[466,4],[864,6]]},"1642":{"position":[[1354,4]]},"1682":{"position":[[444,6]]},"1716":{"position":[[57,7],[150,6],[889,5],[919,5]]},"1720":{"position":[[62,7],[160,6]]},"1735":{"position":[[62,5],[75,5],[254,4],[611,5],[3028,6],[3057,7]]},"1744":{"position":[[591,4]]},"1749":{"position":[[427,4]]},"1756":{"position":[[245,9]]},"1770":{"position":[[461,5],[526,4]]},"1772":{"position":[[221,5],[279,6],[744,5],[938,5]]},"1778":{"position":[[79,4]]},"1786":{"position":[[40,5]]},"1788":{"position":[[36,5],[251,7]]},"1800":{"position":[[18,5]]},"1812":{"position":[[220,4],[331,5],[420,9],[476,7],[550,9]]},"1814":{"position":[[151,4],[203,5],[338,4],[445,5]]},"1850":{"position":[[311,5],[376,4]]},"1856":{"position":[[510,7],[687,7]]},"1864":{"position":[[321,5],[386,4],[791,6]]},"1870":{"position":[[258,6]]},"1894":{"position":[[51,4]]},"1910":{"position":[[255,4],[387,5]]}}}],["name\":\"sam",{"_index":1409,"t":{"1178":{"position":[[1004,14]]}}}],["name(\"addus",{"_index":3821,"t":{"1716":{"position":[[719,18]]}}}],["name(\"destroyus",{"_index":3823,"t":{"1716":{"position":[[829,22]]}}}],["name(\"hom",{"_index":4188,"t":{"1800":{"position":[[257,15]]}}}],["name(\"index",{"_index":1925,"t":{"1247":{"position":[[311,16]]},"1716":{"position":[[420,16]]}}}],["name(\"us",{"_index":4377,"t":{"1856":{"position":[[890,15]]}}}],["name(\"user.show",{"_index":4191,"t":{"1800":{"position":[[357,20]]}}}],["name(nam",{"_index":1901,"t":{"1243":{"position":[[80,9]]}}}],["name1",{"_index":2108,"t":{"1304":{"position":[[1118,7],[1723,7]]}}}],["name2",{"_index":1469,"t":{"1182":{"position":[[551,6]]},"1304":{"position":[[1787,7]]}}}],["namegramefiller",{"_index":1580,"t":{"1188":{"position":[[2695,9]]}}}],["p>hello",{"_index":1341,"t":{"1168":{"position":[[713,9]]},"1784":{"position":[[409,9]]}}}],["p>here",{"_index":1544,"t":{"1188":{"position":[[308,7]]}}}],["p>some",{"_index":1592,"t":{"1190":{"position":[[516,7],[1894,7]]}}}],["p>to",{"_index":1595,"t":{"1190":{"position":[[614,5],[1992,5]]}}}],["packag",{"_index":64,"t":{"737":{"position":[[0,7]]},"739":{"position":[[0,7]]},"741":{"position":[[0,7]]},"751":{"position":[[0,7]]},"761":{"position":[[0,7]]},"763":{"position":[[0,7]]},"773":{"position":[[606,7]]},"785":{"position":[[0,7]]},"795":{"position":[[0,7]]},"805":{"position":[[0,7]]},"809":{"position":[[0,7]]},"815":{"position":[[671,7]]},"827":{"position":[[242,7],[379,7]]},"839":{"position":[[0,7]]},"859":{"position":[[22,7]]},"869":{"position":[[0,7]]},"886":{"position":[[19,8]]},"900":{"position":[[19,8]]},"914":{"position":[[19,8]]},"928":{"position":[[19,8]]},"942":{"position":[[19,8]]},"956":{"position":[[19,8]]},"970":{"position":[[19,8]]},"984":{"position":[[19,8]]},"998":{"position":[[19,8]]},"1012":{"position":[[19,8]]},"1026":{"position":[[19,8]]},"1040":{"position":[[19,8]]},"1054":{"position":[[19,8]]},"1068":{"position":[[19,8]]},"1082":{"position":[[19,8]]},"1096":{"position":[[19,8]]},"1110":{"position":[[19,8]]},"1124":{"position":[[19,8]]},"1130":{"position":[[5,7]]},"1134":{"position":[[0,7]]},"1138":{"position":[[185,7],[520,7],[876,7],[1240,7],[1351,7]]},"1144":{"position":[[256,7]]},"1148":{"position":[[251,7]]},"1152":{"position":[[333,7]]},"1154":{"position":[[461,7]]},"1160":{"position":[[291,7]]},"1164":{"position":[[312,7]]},"1166":{"position":[[0,7]]},"1168":{"position":[[0,7]]},"1170":{"position":[[42,8],[89,7],[170,7],[269,8]]},"1178":{"position":[[40,7],[556,7],[1079,7]]},"1184":{"position":[[13,7]]},"1186":{"position":[[31,7]]},"1188":{"position":[[1893,7]]},"1190":{"position":[[1743,8]]},"1194":{"position":[[308,7]]},"1198":{"position":[[321,7]]},"1202":{"position":[[268,7]]},"1206":{"position":[[287,7]]},"1214":{"position":[[81,7]]},"1225":{"position":[[1206,8]]},"1352":{"position":[[0,7]]},"1354":{"position":[[0,7]]},"1356":{"position":[[0,7]]},"1358":{"position":[[0,7]]},"1360":{"position":[[0,7]]},"1366":{"position":[[22,7]]},"1376":{"position":[[22,7]]},"1386":{"position":[[22,7]]},"1398":{"position":[[22,7]]},"1404":{"position":[[695,7]]},"1408":{"position":[[22,7]]},"1416":{"position":[[41,8]]},"1422":{"position":[[22,7]]},"1434":{"position":[[22,7]]},"1446":{"position":[[22,7]]},"1458":{"position":[[22,7]]},"1464":{"position":[[109,7]]},"1468":{"position":[[22,7]]},"1478":{"position":[[22,7]]},"1488":{"position":[[22,7]]},"1490":{"position":[[90,7]]},"1492":{"position":[[35,7]]},"1494":{"position":[[35,7]]},"1496":{"position":[[38,7]]},"1498":{"position":[[35,7]]},"1500":{"position":[[33,7]]},"1510":{"position":[[0,7]]},"1520":{"position":[[22,7]]},"1534":{"position":[[0,7]]},"1536":{"position":[[139,7]]},"1538":{"position":[[0,7]]},"1544":{"position":[[252,7]]},"1548":{"position":[[22,7]]},"1556":{"position":[[41,8]]},"1562":{"position":[[22,7]]},"1574":{"position":[[22,7]]},"1580":{"position":[[142,7]]},"1584":{"position":[[22,7]]},"1594":{"position":[[22,7]]},"1604":{"position":[[22,7]]},"1614":{"position":[[0,7]]},"1624":{"position":[[22,7]]},"1634":{"position":[[0,7]]},"1636":{"position":[[68,7]]},"1640":{"position":[[22,7]]},"1648":{"position":[[41,8]]},"1654":{"position":[[22,7]]},"1660":{"position":[[22,7]]},"1690":{"position":[[57,7]]},"1693":{"position":[[472,7]]},"1700":{"position":[[384,7]]},"1716":{"position":[[251,7]]},"1728":{"position":[[288,7]]},"1731":{"position":[[1206,8]]},"1746":{"position":[[31,7],[168,7]]},"1749":{"position":[[42,7]]},"1751":{"position":[[1206,8]]},"1812":{"position":[[65,8]]},"1910":{"position":[[72,8]]}}}],["packr",{"_index":1204,"t":{"1138":{"position":[[458,6],[789,5]]}}}],["packr.new(\"asset",{"_index":3126,"t":{"1494":{"position":[[265,17]]}}}],["page",{"_index":1730,"t":{"1214":{"position":[[355,5]]},"1574":{"position":[[462,5],[541,8]]},"1576":{"position":[[77,4]]},"1682":{"position":[[313,4]]},"1684":{"position":[[320,4]]},"1697":{"position":[[415,4],[494,5],[917,4]]},"1749":{"position":[[123,4]]},"1800":{"position":[[250,6]]},"1858":{"position":[[375,6]]}}}],["pair",{"_index":473,"t":{"809":{"position":[[309,4],[498,4]]}}}],["panic",{"_index":3492,"t":{"1600":{"position":[[48,6]]},"1604":{"position":[[296,5]]},"1693":{"position":[[335,6],[372,5],[689,5]]}}}],["panic(\"i",{"_index":288,"t":{"773":{"position":[[1556,8]]}}}],["panic(\"i'm",{"_index":3497,"t":{"1604":{"position":[[375,10]]}}}],["panic(\"thi",{"_index":3756,"t":{"1693":{"position":[[677,11]]}}}],["panic(err",{"_index":1564,"t":{"1188":{"position":[[2078,10]]},"1274":{"position":[[183,10]]},"1500":{"position":[[318,10]]},"1640":{"position":[[440,10],[661,10],[805,10]]}}}],["panick",{"_index":275,"t":{"773":{"position":[[1071,8]]},"775":{"position":[[286,8]]}}}],["paragraph:@127.0.0.1:6379/:@localhost:6379/://::a",{"_index":1394,"t":{"1178":{"position":[[373,20]]}}}],["template.html(html",{"_index":1427,"t":{"1178":{"position":[[1606,19]]}}}],["template.must(template.parsefiles(\"templatenam",{"_index":1452,"t":{"1180":{"position":[[833,50]]}}}],["template.must(template.parseglob(\"*.gohtml",{"_index":1508,"t":{"1184":{"position":[[628,45]]}}}],["template.new(\"hello.gohtml\").funcs(template.funcmap",{"_index":1425,"t":{"1178":{"position":[[1500,52]]},"1190":{"position":[[2526,52],[3674,52]]}}}],["template.parse(filenam",{"_index":1370,"t":{"1174":{"position":[[473,24]]}}}],["template.parsefiles(fil",{"_index":1551,"t":{"1188":{"position":[[1240,29]]}}}],["template.parsefiles(filenam",{"_index":1373,"t":{"1174":{"position":[[628,30]]}}}],["template.parseglob(layoutdir",{"_index":1563,"t":{"1188":{"position":[[2018,28]]}}}],["template.parseglob(pattern",{"_index":1374,"t":{"1174":{"position":[[711,27]]},"1188":{"position":[[1140,26]]}}}],["template.templ",{"_index":1451,"t":{"1180":{"position":[[808,18]]},"1188":{"position":[[1954,18]]}}}],["templatedata",{"_index":165,"t":{"751":{"position":[[625,13]]}}}],["templatenam",{"_index":1454,"t":{"1180":{"position":[[922,15]]},"1188":{"position":[[1499,16],[1620,15]]}}}],["templatesgo",{"_index":1573,"t":{"1188":{"position":[[2504,9]]}}}],["title>maintitle:@tcp(:)/Search the documentation - - + + - - + + \ No newline at end of file diff --git a/storage/arangodb/index.html b/storage/arangodb/index.html index ce76841b7c7..a3ac07369b6 100644 --- a/storage/arangodb/index.html +++ b/storage/arangodb/index.html @@ -6,8 +6,8 @@ ArangoDB | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A ArangoDB storage driver using arangodb/go-driver and arangodb/go-driver.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() driver.Client

Installation​

ArangoDB is tested on the 2 last (1.14/1.15) Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the mysql implementation:

go get github.com/gofiber/storage/arangodb

Examples​

Import the storage package.

import "github.com/gofiber/storage/arangodb"

You can use the following possibilities to create a storage:

// Initialize default config
store := arangodb.New()

// Initialize custom config
store := arangodb.New(arangodb.Config{
Host: "http://127.0.0.1",
Port: 8529,
Database: "fiber",
Collection: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
})

Config​

type Config struct {
// Host name where the DB is hosted
//
// Optional. Default is "http://127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 8529
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Database name
//
// Optional. Default is "fiber"
Database string

// Collection name
//
// Optional. Default is "fiber_storage"
Collection string

// Reset clears any existing keys in existing collection
//
// Optional. Default is false
Reset bool
// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration
}

Default Config​

Used only for optional fields

var ConfigDefault = Config{
Host: "http://127.0.0.1",
Port: 8529,
Database: "fiber",
Collection: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
}
- - +Linter

A ArangoDB storage driver using arangodb/go-driver and arangodb/go-driver.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() driver.Client

Installation​

ArangoDB is tested on the 2 last (1.14/1.15) Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the mysql implementation:

go get github.com/gofiber/storage/arangodb

Examples​

Import the storage package.

import "github.com/gofiber/storage/arangodb"

You can use the following possibilities to create a storage:

// Initialize default config
store := arangodb.New()

// Initialize custom config
store := arangodb.New(arangodb.Config{
Host: "http://127.0.0.1",
Port: 8529,
Database: "fiber",
Collection: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
})

Config​

type Config struct {
// Host name where the DB is hosted
//
// Optional. Default is "http://127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 8529
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Database name
//
// Optional. Default is "fiber"
Database string

// Collection name
//
// Optional. Default is "fiber_storage"
Collection string

// Reset clears any existing keys in existing collection
//
// Optional. Default is false
Reset bool
// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration
}

Default Config​

Used only for optional fields

var ConfigDefault = Config{
Host: "http://127.0.0.1",
Port: 8529,
Database: "fiber",
Collection: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
}
+ + \ No newline at end of file diff --git a/storage/azureblob/index.html b/storage/azureblob/index.html index f8d90a7e9f7..b70861f851c 100644 --- a/storage/azureblob/index.html +++ b/storage/azureblob/index.html @@ -6,8 +6,8 @@ Azure Blob | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Azure Blob storage is Microsoft's object storage solution for the cloud.

NOTE: Go 1.18 or later is required. Source: link

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *azblob.Client

Installation​

Azure blob storage driver is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the azure blob implementation:

go get github.com/gofiber/storage/azureblob

Examples​

Import the storage package.

import "github.com/gofiber/storage/azureblob"

You can use the following possibilities to create a storage:

// Initialize default config
store := azureblob.New()

// Initialize custom config
store := azureblob.New(azureblob.Config{
Account: "test",
Container: "test",
Credentials: Credentials{
Account: "test",
Key: "YXp1cml0ZWtleQo=",
},
})

Config​

type Config struct {
// Storage account name.
Account string
// Container name.
Container string
// Storage endpoint.
// Optional. Default: "https://STORAGEACCOUNTNAME.blob.core.windows.net"
Endpoint string
// Request timeout.
// Optional. Default is 0 (no timeout)
RequestTimeout time.Duration
// Reset clears any existing keys in existing container.
// Optional. Default is false
Reset bool
// Credentials overrides AWS access key and AWS secret access key. Not recommended.
// Optional. Default is Credentials{}
Credentials Credentials
// The maximum number of times requests that encounter retryable failures should be attempted.
// Optional. Default is 3
MaxAttempts int
}

Default Config​

var ConfigDefault = Config{
Account: "",
Container: "",
Endpoint: "",
RequestTimeout: 0,
Reset: false,
MaxAttempts: 3,
}
- - +Linter

Azure Blob storage is Microsoft's object storage solution for the cloud.

NOTE: Go 1.18 or later is required. Source: link

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *azblob.Client

Installation​

Azure blob storage driver is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the azure blob implementation:

go get github.com/gofiber/storage/azureblob

Examples​

Import the storage package.

import "github.com/gofiber/storage/azureblob"

You can use the following possibilities to create a storage:

// Initialize default config
store := azureblob.New()

// Initialize custom config
store := azureblob.New(azureblob.Config{
Account: "test",
Container: "test",
Credentials: Credentials{
Account: "test",
Key: "YXp1cml0ZWtleQo=",
},
})

Config​

type Config struct {
// Storage account name.
Account string
// Container name.
Container string
// Storage endpoint.
// Optional. Default: "https://STORAGEACCOUNTNAME.blob.core.windows.net"
Endpoint string
// Request timeout.
// Optional. Default is 0 (no timeout)
RequestTimeout time.Duration
// Reset clears any existing keys in existing container.
// Optional. Default is false
Reset bool
// Credentials overrides AWS access key and AWS secret access key. Not recommended.
// Optional. Default is Credentials{}
Credentials Credentials
// The maximum number of times requests that encounter retryable failures should be attempted.
// Optional. Default is 3
MaxAttempts int
}

Default Config​

var ConfigDefault = Config{
Account: "",
Container: "",
Endpoint: "",
RequestTimeout: 0,
Reset: false,
MaxAttempts: 3,
}
+ + \ No newline at end of file diff --git a/storage/badger/index.html b/storage/badger/index.html index 54054382df5..362d3f93326 100644 --- a/storage/badger/index.html +++ b/storage/badger/index.html @@ -6,8 +6,8 @@ Badger | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A fast key-value DB using dgraph-io/badger

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *badger.DB

Installation​

Badger is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the badger implementation:

go get github.com/gofiber/storage/badger

Examples​

Import the storage package.

import "github.com/gofiber/storage/badger"

You can use the following possibilities to create a storage:

// Initialize default config
store := badger.New()

// Initialize custom config
store := badger.New(badger.Config{
Database: "./fiber.badger",
Reset: false,
GCInterval: 10 * time.Second,
})

Config​

type Config struct {
// Database name
//
// Optional. Default is "./fiber.badger"
Database string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool

// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration

// BadgerOptions is a way to set options in badger
//
// Optional. Default is badger.DefaultOptions("./fiber.badger")
BadgerOptions badger.Options

// Logger is the default logger used by badger
//
// Optional. Default is nil
Logger badger.Logger

// UseLogger define if any logger will be used
//
// Optional. Default is false
UseLogger bool
}

Default Config​

var ConfigDefault = Config{
Database: "./fiber.badger",
Reset: false,
GCInterval: 10 * time.Second,
BadgerOptions: badger.DefaultOptions("./fiber.badger").WithLogger(nil),
Logger: nil,
UseLogger: false,
}
- - +Linter

A fast key-value DB using dgraph-io/badger

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *badger.DB

Installation​

Badger is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the badger implementation:

go get github.com/gofiber/storage/badger

Examples​

Import the storage package.

import "github.com/gofiber/storage/badger"

You can use the following possibilities to create a storage:

// Initialize default config
store := badger.New()

// Initialize custom config
store := badger.New(badger.Config{
Database: "./fiber.badger",
Reset: false,
GCInterval: 10 * time.Second,
})

Config​

type Config struct {
// Database name
//
// Optional. Default is "./fiber.badger"
Database string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool

// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration

// BadgerOptions is a way to set options in badger
//
// Optional. Default is badger.DefaultOptions("./fiber.badger")
BadgerOptions badger.Options

// Logger is the default logger used by badger
//
// Optional. Default is nil
Logger badger.Logger

// UseLogger define if any logger will be used
//
// Optional. Default is false
UseLogger bool
}

Default Config​

var ConfigDefault = Config{
Database: "./fiber.badger",
Reset: false,
GCInterval: 10 * time.Second,
BadgerOptions: badger.DefaultOptions("./fiber.badger").WithLogger(nil),
Logger: nil,
UseLogger: false,
}
+ + \ No newline at end of file diff --git a/storage/bbolt/index.html b/storage/bbolt/index.html index 6af1e3df2a7..e1dd8a7b00f 100644 --- a/storage/bbolt/index.html +++ b/storage/bbolt/index.html @@ -6,8 +6,8 @@ Bbolt | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A Bbolt storage driver using etcd-io/bbolt. Bolt is a pure Go key/value store inspired by Howard Chu's LMDB project. The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *bbolt.DB

Installation​

Bbolt is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the s3 implementation:

go get github.com/gofiber/storage/bbolt

Examples​

Import the storage package.

import "github.com/gofiber/storage/bbolt"

You can use the following possibilities to create a storage:

// Initialize default config
store := bbolt.New()

// Initialize custom config
store := bbolt.New(bbolt.Config{
Database: "my_database.db",
Bucket: "my-bucket",
Reset: false,
})

Config​

// Config defines the config for storage.
type Config struct {
// Database path
//
// Optional. Default is "fiber.db"
Database string

// Bbolt bucket name
//
// Optional. Default is "fiber_storage"
Bucket string

// Timeout is the amount of time to wait to obtain a file lock.
// Only available on Darwin and Linux.
//
// Optional. Default is 60 * time.Second.
Timeout time.Duration

// Open database in read-only mode.
//
// Optional. Default is false
ReadOnly bool

// Reset clears any existing keys in existing Bucket
//
// Optional. Default is false
Reset bool
}

Default Config​

// ConfigDefault is the default config
var ConfigDefault = Config{
Database: "fiber.db",
Bucket: "fiber_storage",
Timeout: 60 * time.Second,
ReadOnly: false,
Reset: false,
}
- - +Linter

A Bbolt storage driver using etcd-io/bbolt. Bolt is a pure Go key/value store inspired by Howard Chu's LMDB project. The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *bbolt.DB

Installation​

Bbolt is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the s3 implementation:

go get github.com/gofiber/storage/bbolt

Examples​

Import the storage package.

import "github.com/gofiber/storage/bbolt"

You can use the following possibilities to create a storage:

// Initialize default config
store := bbolt.New()

// Initialize custom config
store := bbolt.New(bbolt.Config{
Database: "my_database.db",
Bucket: "my-bucket",
Reset: false,
})

Config​

// Config defines the config for storage.
type Config struct {
// Database path
//
// Optional. Default is "fiber.db"
Database string

// Bbolt bucket name
//
// Optional. Default is "fiber_storage"
Bucket string

// Timeout is the amount of time to wait to obtain a file lock.
// Only available on Darwin and Linux.
//
// Optional. Default is 60 * time.Second.
Timeout time.Duration

// Open database in read-only mode.
//
// Optional. Default is false
ReadOnly bool

// Reset clears any existing keys in existing Bucket
//
// Optional. Default is false
Reset bool
}

Default Config​

// ConfigDefault is the default config
var ConfigDefault = Config{
Database: "fiber.db",
Bucket: "fiber_storage",
Timeout: 60 * time.Second,
ReadOnly: false,
Reset: false,
}
+ + \ No newline at end of file diff --git a/storage/couchbase/index.html b/storage/couchbase/index.html index 01e64b3fcb8..48b13abe109 100644 --- a/storage/couchbase/index.html +++ b/storage/couchbase/index.html @@ -6,8 +6,8 @@ Couchbase | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A Couchbase storage driver using couchbase/gocb.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *gocb.Cluster

Installation​

Couchbase is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the Couchbase implementation:

go get github.com/gofiber/storage/couchbase

Examples​

Import the storage package.

import "github.com/gofiber/storage/couchbase"

You can use the following possibilities to create a storage:

// Initialize default config
store := couchbase.New()

// Initialize Couchbase storage with custom config
store := couchbase.New(couchbase.Config{
Host: "127.0.0.1:8091",
Username: "",
Password: "",
Bucket: 0,
ConnectionTimeout: 3* time.Second,
KVTimeout: 1* time.Second,
})

Config​

type Config struct {
// The application username to Connect to the Couchbase cluster
Username string
// The application password to Connect to the Couchbase cluster
Password string
// The connection string for the Couchbase cluster
Host string
// The name of the bucket to Connect to
Bucket string
// The timeout for connecting to the Couchbase cluster
ConnectionTimeout time.Duration
// The timeout for performing operations on the Couchbase cluster
KVTimeout time.Duration
}

Default Config​

// ConfigDefault is the default config
var ConfigDefault = Config{
Host: "127.0.0.1:8091",
Username: "admin",
Password: "123456",
Bucket: "fiber_storage",
ConnectionTimeout: 3 * time.Second,
KVTimeout: 1 * time.Second,
}
- - +Linter

A Couchbase storage driver using couchbase/gocb.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *gocb.Cluster

Installation​

Couchbase is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the Couchbase implementation:

go get github.com/gofiber/storage/couchbase

Examples​

Import the storage package.

import "github.com/gofiber/storage/couchbase"

You can use the following possibilities to create a storage:

// Initialize default config
store := couchbase.New()

// Initialize Couchbase storage with custom config
store := couchbase.New(couchbase.Config{
Host: "127.0.0.1:8091",
Username: "",
Password: "",
Bucket: 0,
ConnectionTimeout: 3* time.Second,
KVTimeout: 1* time.Second,
})

Config​

type Config struct {
// The application username to Connect to the Couchbase cluster
Username string
// The application password to Connect to the Couchbase cluster
Password string
// The connection string for the Couchbase cluster
Host string
// The name of the bucket to Connect to
Bucket string
// The timeout for connecting to the Couchbase cluster
ConnectionTimeout time.Duration
// The timeout for performing operations on the Couchbase cluster
KVTimeout time.Duration
}

Default Config​

// ConfigDefault is the default config
var ConfigDefault = Config{
Host: "127.0.0.1:8091",
Username: "admin",
Password: "123456",
Bucket: "fiber_storage",
ConnectionTimeout: 3 * time.Second,
KVTimeout: 1 * time.Second,
}
+ + \ No newline at end of file diff --git a/storage/dynamodb/index.html b/storage/dynamodb/index.html index c2ef219da37..a93a77a8575 100644 --- a/storage/dynamodb/index.html +++ b/storage/dynamodb/index.html @@ -6,8 +6,8 @@ DynamoDB | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A DynamoDB storage driver using aws/aws-sdk-go-v2.

Note: If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: specifying credentials

....

Table of Contents​

Signatures​

func New(config Config) Storage


func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *awsdynamodb.Client

Installation​

DynamoDB is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the dynamodb implementation:

go get github.com/gofiber/storage/dynamodb

Examples​

Import the storage package.

import "github.com/gofiber/storage/dynamodb"

You can use the following possibilities to create a storage:

// Initialize dynamodb
store := dynamodb.New(dynamodb.Config{

})

Config​

type Config struct {
// Region of the DynamoDB service you want to use.
// Valid values: https://docs.aws.amazon.com/general/latest/gr/rande.html#ddb_region.
// E.g. "us-west-2".
// Optional (read from shared config file or environment variable if not set).
// Environment variable: "AWS_REGION".
Region string

// Name of the DynamoDB table.
// Optional ("fiber_storage" by default).
Table string

// CustomEndpoint allows you to set a custom DynamoDB service endpoint.
// This is especially useful if you're running a "DynamoDB local" Docker container for local testing.
// Typical value for the Docker container: "http://localhost:8000".
// See https://hub.docker.com/r/amazon/dynamodb-local/.
// Optional ("" by default)
Endpoint string

// Credentials overrides AWS access key and AWS secret access key. Not recommended.
//
// Optional. Default is Credentials{}
Credentials Credentials

// The maximum number of times requests that encounter retryable failures should be attempted.
//
// Optional. Default is 3
MaxAttempts int

// Reset clears any existing keys in existing Bucket
//
// Optional. Default is false
Reset bool

// ReadCapacityUnits of the table.
// Only required when the table doesn't exist yet and is created by gokv.
// Optional (5 by default, which is the same default value as when creating a table in the web console)
// 25 RCUs are included in the free tier (across all tables).
// For example calculations, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/HowItWorks.ProvisionedThroughput.
// For limits, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/Limits.md#capacity-units-and-provisioned-throughput.md#provisioned-throughput.
ReadCapacityUnits int64

// ReadCapacityUnits of the table.
// Only required when the table doesn't exist yet and is created by gokv.
// Optional (5 by default, which is the same default value as when creating a table in the web console)
// 25 RCUs are included in the free tier (across all tables).
// For example calculations, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/HowItWorks.ProvisionedThroughput.
// For limits, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/Limits.md#capacity-units-and-provisioned-throughput.md#provisioned-throughput.
WriteCapacityUnits int64

// If the table doesn't exist yet, gokv creates it.
// If WaitForTableCreation is true, gokv will block until the table is created, with a timeout of 15 seconds.
// If the table still doesn't exist after 15 seconds, an error is returned.
// If WaitForTableCreation is false, gokv returns the client immediately.
// In the latter case you need to make sure that you don't read from or write to the table before it's created,
// because otherwise you will get ResourceNotFoundException errors.
// Optional (true by default).
WaitForTableCreation *bool
}

type Credentials struct {
AccessKey string
SecretAccessKey string
}

Default Config​

var ConfigDefault = Config{
Table: "fiber_storage",
Credentials: Credentials{},
MaxAttempts: 3,
Reset: false,
ReadCapacityUnits: 5,
WriteCapacityUnits: 5,
WaitForTableCreation: aws.Bool(true),
}
- - +Linter

A DynamoDB storage driver using aws/aws-sdk-go-v2.

Note: If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: specifying credentials

....

Table of Contents​

Signatures​

func New(config Config) Storage


func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *awsdynamodb.Client

Installation​

DynamoDB is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the dynamodb implementation:

go get github.com/gofiber/storage/dynamodb

Examples​

Import the storage package.

import "github.com/gofiber/storage/dynamodb"

You can use the following possibilities to create a storage:

// Initialize dynamodb
store := dynamodb.New(dynamodb.Config{

})

Config​

type Config struct {
// Region of the DynamoDB service you want to use.
// Valid values: https://docs.aws.amazon.com/general/latest/gr/rande.html#ddb_region.
// E.g. "us-west-2".
// Optional (read from shared config file or environment variable if not set).
// Environment variable: "AWS_REGION".
Region string

// Name of the DynamoDB table.
// Optional ("fiber_storage" by default).
Table string

// CustomEndpoint allows you to set a custom DynamoDB service endpoint.
// This is especially useful if you're running a "DynamoDB local" Docker container for local testing.
// Typical value for the Docker container: "http://localhost:8000".
// See https://hub.docker.com/r/amazon/dynamodb-local/.
// Optional ("" by default)
Endpoint string

// Credentials overrides AWS access key and AWS secret access key. Not recommended.
//
// Optional. Default is Credentials{}
Credentials Credentials

// The maximum number of times requests that encounter retryable failures should be attempted.
//
// Optional. Default is 3
MaxAttempts int

// Reset clears any existing keys in existing Bucket
//
// Optional. Default is false
Reset bool

// ReadCapacityUnits of the table.
// Only required when the table doesn't exist yet and is created by gokv.
// Optional (5 by default, which is the same default value as when creating a table in the web console)
// 25 RCUs are included in the free tier (across all tables).
// For example calculations, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/HowItWorks.ProvisionedThroughput.
// For limits, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/Limits.md#capacity-units-and-provisioned-throughput.md#provisioned-throughput.
ReadCapacityUnits int64

// ReadCapacityUnits of the table.
// Only required when the table doesn't exist yet and is created by gokv.
// Optional (5 by default, which is the same default value as when creating a table in the web console)
// 25 RCUs are included in the free tier (across all tables).
// For example calculations, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/HowItWorks.ProvisionedThroughput.
// For limits, see https://github.com/awsdocs/amazon-dynamodb-developer-guide/blob/c420420a59040c5b3dd44a6e59f7c9e55fc922ef/doc_source/Limits.md#capacity-units-and-provisioned-throughput.md#provisioned-throughput.
WriteCapacityUnits int64

// If the table doesn't exist yet, gokv creates it.
// If WaitForTableCreation is true, gokv will block until the table is created, with a timeout of 15 seconds.
// If the table still doesn't exist after 15 seconds, an error is returned.
// If WaitForTableCreation is false, gokv returns the client immediately.
// In the latter case you need to make sure that you don't read from or write to the table before it's created,
// because otherwise you will get ResourceNotFoundException errors.
// Optional (true by default).
WaitForTableCreation *bool
}

type Credentials struct {
AccessKey string
SecretAccessKey string
}

Default Config​

var ConfigDefault = Config{
Table: "fiber_storage",
Credentials: Credentials{},
MaxAttempts: 3,
Reset: false,
ReadCapacityUnits: 5,
WriteCapacityUnits: 5,
WaitForTableCreation: aws.Bool(true),
}
+ + \ No newline at end of file diff --git a/storage/etcd/index.html b/storage/etcd/index.html index 29bf4f849b2..bf002396974 100644 --- a/storage/etcd/index.html +++ b/storage/etcd/index.html @@ -6,8 +6,8 @@ Etcd | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A Etcd storage driver using etcd-io/etcd.

Table of Contents​

Signatures​

func New(config ...Config) *Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *clientv3.Client

Installation​

Etcd is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the etcd implementation:

go get github.com/gofiber/storage/etcd

Examples​

Import the storage package.

import "github.com/gofiber/storage/etcd"

You can use the following possibilities to create a storage:

// Initialize default config
store := etcd.New()

// Initialize custom config
store := etcd.New(Config{
Endpoints: []string{"localhost:2379"},
})

Config​

type Config struct {
// Endpoints is a list of URLs.
Endpoints []string
// DialTimeout is the timeout for failing to establish a connection.
DialTimeout time.Duration
// Username is a username for authentication.
Username string
// Password is a password for authentication.
Password string
// TLS holds the client secure credentials, if any.
TLS *tls.Config
}

Default Config​

var ConfigDefault = Config{
Endpoints: []string{"localhost:2379"},
DialTimeout: 2 * time.Second,
Username: "",
Password: "",
TLS: nil,
}
- - +Linter

A Etcd storage driver using etcd-io/etcd.

Table of Contents​

Signatures​

func New(config ...Config) *Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *clientv3.Client

Installation​

Etcd is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the etcd implementation:

go get github.com/gofiber/storage/etcd

Examples​

Import the storage package.

import "github.com/gofiber/storage/etcd"

You can use the following possibilities to create a storage:

// Initialize default config
store := etcd.New()

// Initialize custom config
store := etcd.New(Config{
Endpoints: []string{"localhost:2379"},
})

Config​

type Config struct {
// Endpoints is a list of URLs.
Endpoints []string
// DialTimeout is the timeout for failing to establish a connection.
DialTimeout time.Duration
// Username is a username for authentication.
Username string
// Password is a password for authentication.
Password string
// TLS holds the client secure credentials, if any.
TLS *tls.Config
}

Default Config​

var ConfigDefault = Config{
Endpoints: []string{"localhost:2379"},
DialTimeout: 2 * time.Second,
Username: "",
Password: "",
TLS: nil,
}
+ + \ No newline at end of file diff --git a/storage/index.html b/storage/index.html index f358016b6c6..09800e16a4c 100644 --- a/storage/index.html +++ b/storage/index.html @@ -6,13 +6,13 @@ πŸ‘‹ Welcome | Fiber - - + +
-

πŸ‘‹ Welcome

Fiber

πŸ“¦ Storage

Premade storage drivers that implement the Storage interface, designed to be used with various Fiber middlewares.

// Storage interface for communicating with different database/key-value
// providers. Visit https://github.com/gofiber/storage for more info.
type Storage interface {
// Get gets the value for the given key.
// `nil, nil` is returned when the key does not exist
Get(key string) ([]byte, error)

// Set stores the given value for the given key along
// with an expiration value, 0 means no expiration.
// Empty key or value will be ignored without an error.
Set(key string, val []byte, exp time.Duration) error

// Delete deletes the value for the given key.
// It returns no error if the storage does not contain the key,
Delete(key string) error

// Reset resets the storage and delete all keys.
Reset() error

// Close closes the storage and will stop any running garbage
// collectors and open connections.
Close() error
}

πŸ“‘ Storage Implementations​

- - +

πŸ‘‹ Welcome

Fiber

πŸ“¦ Storage

Premade storage drivers that implement the Storage interface, designed to be used with various Fiber middlewares.

// Storage interface for communicating with different database/key-value
// providers. Visit https://github.com/gofiber/storage for more info.
type Storage interface {
// Get gets the value for the given key.
// `nil, nil` is returned when the key does not exist
Get(key string) ([]byte, error)

// Set stores the given value for the given key along
// with an expiration value, 0 means no expiration.
// Empty key or value will be ignored without an error.
Set(key string, val []byte, exp time.Duration) error

// Delete deletes the value for the given key.
// It returns no error if the storage does not contain the key,
Delete(key string) error

// Reset resets the storage and delete all keys.
Reset() error

// Close closes the storage and will stop any running garbage
// collectors and open connections.
Close() error
}

πŸ“‘ Storage Implementations​

+ + \ No newline at end of file diff --git a/storage/memcache/index.html b/storage/memcache/index.html index 65d3ce6bee1..e48ed0141c9 100644 --- a/storage/memcache/index.html +++ b/storage/memcache/index.html @@ -6,8 +6,8 @@ Memcache | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A Memcache storage driver using bradfitz/gomemcache.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *mc.Client

Installation​

Memory is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the memory implementation:

go get github.com/gofiber/storage/memory

Examples​

Import the storage package.

import "github.com/gofiber/storage/memcache"

You can use the following possibilities to create a storage:

// Initialize default config
store := memcache.New()

// Initialize custom config
store := memcache.New(memcache.Config{
Servers: "localhost:11211",
})

Config​

type Config struct {
// Server list divided by ,
// i.e. server1:11211, server2:11212
//
// Optional. Default is "127.0.0.1:11211"
Servers string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool
}

Default Config​

var ConfigDefault = Config{
Servers: "127.0.0.1:11211",
}
- - +Linter

A Memcache storage driver using bradfitz/gomemcache.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *mc.Client

Installation​

Memory is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the memory implementation:

go get github.com/gofiber/storage/memory

Examples​

Import the storage package.

import "github.com/gofiber/storage/memcache"

You can use the following possibilities to create a storage:

// Initialize default config
store := memcache.New()

// Initialize custom config
store := memcache.New(memcache.Config{
Servers: "localhost:11211",
})

Config​

type Config struct {
// Server list divided by ,
// i.e. server1:11211, server2:11212
//
// Optional. Default is "127.0.0.1:11211"
Servers string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool
}

Default Config​

var ConfigDefault = Config{
Servers: "127.0.0.1:11211",
}
+ + \ No newline at end of file diff --git a/storage/memory/index.html b/storage/memory/index.html index c0db3f98185..9eb1b2a1d75 100644 --- a/storage/memory/index.html +++ b/storage/memory/index.html @@ -6,8 +6,8 @@ Memory | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

An in-memory storage driver.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() map[string]entry

Installation​

Memory is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the memory implementation:

go get github.com/gofiber/storage/memory

Examples​

Import the storage package.

import "github.com/gofiber/storage/memory"

You can use the following possibilities to create a storage:

// Initialize default config
store := memory.New()

// Initialize custom config
store := memory.New(memory.Config{
GCInterval: 10 * time.Second,
})

Config​

type Config struct {
// Time before deleting expired keys
//
// Default is 10 * time.Second
GCInterval time.Duration
}

Default Config​

var ConfigDefault = Config{
GCInterval: 10 * time.Second,
}
- - +Linter

An in-memory storage driver.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() map[string]entry

Installation​

Memory is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the memory implementation:

go get github.com/gofiber/storage/memory

Examples​

Import the storage package.

import "github.com/gofiber/storage/memory"

You can use the following possibilities to create a storage:

// Initialize default config
store := memory.New()

// Initialize custom config
store := memory.New(memory.Config{
GCInterval: 10 * time.Second,
})

Config​

type Config struct {
// Time before deleting expired keys
//
// Default is 10 * time.Second
GCInterval time.Duration
}

Default Config​

var ConfigDefault = Config{
GCInterval: 10 * time.Second,
}
+ + \ No newline at end of file diff --git a/storage/mongodb/index.html b/storage/mongodb/index.html index 41c6c820cba..2670c2e2ecf 100644 --- a/storage/mongodb/index.html +++ b/storage/mongodb/index.html @@ -6,8 +6,8 @@ MongoDB | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A MongoDB storage driver using mongodb/mongo-go-driver.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *mongo.Database

Installation​

MongoDB is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the mongodb implementation:

go get github.com/gofiber/storage/mongodb

Examples​

Import the storage package.

import "github.com/gofiber/storage/mongodb"

You can use the following possibilities to create a storage:

// Initialize default config
store := mongodb.New()

// Initialize custom config
store := mongodb.New(mongodb.Config{
Host: "127.0.0.1",
Port: 27017,
Database: "fiber",
Collection: "fiber_storage",
Reset: false,
})

// Initialize custom config using connection string
store := mongodb.New(mongodb.Config{
ConnectionURI: "mongodb://user:password@127.0.0.1:27017",
Database: "fiber",
Collection: "fiber_storage",
Reset: false,
})

Config​

type Config struct {
// Connection string to use for DB. Will override all other authentication values if used
//
// Optional. Default is ""
ConnectionURI string

// Host name where the DB is hosted
//
// Optional. Default is "127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 27017
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Database name
//
// Optional. Default is "fiber"
Database string

// Collection name
//
// Optional. Default is "fiber_storage"
Collection string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool
}

Default Config​

var ConfigDefault = Config{
ConnectionURI: "",
Host: "127.0.0.1",
Port: 27017,
Database: "fiber",
Collection: "fiber_storage",
Reset: false,
}
- - +Linter

A MongoDB storage driver using mongodb/mongo-go-driver.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *mongo.Database

Installation​

MongoDB is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the mongodb implementation:

go get github.com/gofiber/storage/mongodb

Examples​

Import the storage package.

import "github.com/gofiber/storage/mongodb"

You can use the following possibilities to create a storage:

// Initialize default config
store := mongodb.New()

// Initialize custom config
store := mongodb.New(mongodb.Config{
Host: "127.0.0.1",
Port: 27017,
Database: "fiber",
Collection: "fiber_storage",
Reset: false,
})

// Initialize custom config using connection string
store := mongodb.New(mongodb.Config{
ConnectionURI: "mongodb://user:password@127.0.0.1:27017",
Database: "fiber",
Collection: "fiber_storage",
Reset: false,
})

Config​

type Config struct {
// Connection string to use for DB. Will override all other authentication values if used
//
// Optional. Default is ""
ConnectionURI string

// Host name where the DB is hosted
//
// Optional. Default is "127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 27017
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Database name
//
// Optional. Default is "fiber"
Database string

// Collection name
//
// Optional. Default is "fiber_storage"
Collection string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool
}

Default Config​

var ConfigDefault = Config{
ConnectionURI: "",
Host: "127.0.0.1",
Port: 27017,
Database: "fiber",
Collection: "fiber_storage",
Reset: false,
}
+ + \ No newline at end of file diff --git a/storage/mssql/index.html b/storage/mssql/index.html index 2cef1234fd7..fb20f59881d 100644 --- a/storage/mssql/index.html +++ b/storage/mssql/index.html @@ -6,8 +6,8 @@ MSSQL | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A MSSQL storage driver using microsoft/go-mssqldb.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *sql.DB

Installation​

MSSQL is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the mssql implementation:

go get github.com/gofiber/storage/mssql

Examples​

Import the storage package.

import "github.com/gofiber/storage/mssql"

You can use the following possibilities to create a storage:

// Initialize default config
store := mssql.New()

// Initialize custom config
store := mssql.New(mssql.Config{
Host: "127.0.0.1",
Port: 1433,
Database: "fiber",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
SslMode: "disable",
})

// Initialize custom config using connection string
store := mssql.New(mssql.Config{
ConnectionURI: "sqlserver://user:password@localhost:1433?database=fiber"
Reset: false,
GCInterval: 10 * time.Second,
})

Config​

// Config defines the config for storage.
type Config struct {
// Connection string to use for DB. Will override all other authentication values if used
//
// Optional. Default is ""
ConnectionURI string

// Host name where the DB is hosted
//
// Optional. Default is "127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 1433
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Instance name
//
// Optional. Default is ""
Instance string

// Database name
//
// Optional. Default is "fiber"
Database string

// Table name
//
// Optional. Default is "fiber_storage"
Table string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool

// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration

// The SSL mode for the connection
//
// Optional. Default is "disable"
SslMode string
}

Default Config​

var ConfigDefault = Config{
ConnectionURI: "",
Host: "127.0.0.1",
Port: 1433,
Database: "fiber",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
SslMode: "disable",
}
- - +Linter

A MSSQL storage driver using microsoft/go-mssqldb.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *sql.DB

Installation​

MSSQL is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the mssql implementation:

go get github.com/gofiber/storage/mssql

Examples​

Import the storage package.

import "github.com/gofiber/storage/mssql"

You can use the following possibilities to create a storage:

// Initialize default config
store := mssql.New()

// Initialize custom config
store := mssql.New(mssql.Config{
Host: "127.0.0.1",
Port: 1433,
Database: "fiber",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
SslMode: "disable",
})

// Initialize custom config using connection string
store := mssql.New(mssql.Config{
ConnectionURI: "sqlserver://user:password@localhost:1433?database=fiber"
Reset: false,
GCInterval: 10 * time.Second,
})

Config​

// Config defines the config for storage.
type Config struct {
// Connection string to use for DB. Will override all other authentication values if used
//
// Optional. Default is ""
ConnectionURI string

// Host name where the DB is hosted
//
// Optional. Default is "127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 1433
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Instance name
//
// Optional. Default is ""
Instance string

// Database name
//
// Optional. Default is "fiber"
Database string

// Table name
//
// Optional. Default is "fiber_storage"
Table string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool

// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration

// The SSL mode for the connection
//
// Optional. Default is "disable"
SslMode string
}

Default Config​

var ConfigDefault = Config{
ConnectionURI: "",
Host: "127.0.0.1",
Port: 1433,
Database: "fiber",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
SslMode: "disable",
}
+ + \ No newline at end of file diff --git a/storage/mysql/index.html b/storage/mysql/index.html index d92fd1adf5c..a5243e04125 100644 --- a/storage/mysql/index.html +++ b/storage/mysql/index.html @@ -6,8 +6,8 @@ MySQL | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A MySQL storage driver using database/sql and go-sql-driver/mysql.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *sql.DB

Installation​

MySQL is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the mysql implementation:

go get github.com/gofiber/storage/mysql

Examples​

Import the storage package.

import "github.com/gofiber/storage/mysql"

You can use the following possibilities to create a storage:

// Initialize default config
store := mysql.New()

// Initialize custom config
store := mysql.New(mysql.Config{
Host: "127.0.0.1",
Port: 3306,
Database: "fiber",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
})

// Initialize custom config using connection string
store := mysql.New(mysql.Config{
ConnectionURI: "<username>:<pw>@tcp(<HOST>:<port>)/<dbname>"
Reset: false,
GCInterval: 10 * time.Second,
})

// Initialize custom config using sql db connection
db, _ := sql.Open("mysql", "<username>:<pw>@tcp(<HOST>:<port>)/<dbname>")
store := mysql.New(mysql.Config{
Db: db,
Reset: false,
GCInterval: 10 * time.Second,
})

Config​

type Config struct {
// DB Will override ConnectionURI and all other authentication values if used
//
// Optional. Default is nil
Db *sql.DB

// Connection string to use for DB. Will override all other authentication values if used
//
// Optional. Default is ""
ConnectionURI string

// Host name where the DB is hosted
//
// Optional. Default is "127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 3306
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Database name
//
// Optional. Default is "fiber"
Database string

// Table name
//
// Optional. Default is "fiber_storage"
Table string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool

// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration
}

Default Config​

var ConfigDefault = Config{
ConnectionURI: "",
Host: "127.0.0.1",
Port: 3306,
Database: "fiber",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
}
- - +Linter

A MySQL storage driver using database/sql and go-sql-driver/mysql.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *sql.DB

Installation​

MySQL is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the mysql implementation:

go get github.com/gofiber/storage/mysql

Examples​

Import the storage package.

import "github.com/gofiber/storage/mysql"

You can use the following possibilities to create a storage:

// Initialize default config
store := mysql.New()

// Initialize custom config
store := mysql.New(mysql.Config{
Host: "127.0.0.1",
Port: 3306,
Database: "fiber",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
})

// Initialize custom config using connection string
store := mysql.New(mysql.Config{
ConnectionURI: "<username>:<pw>@tcp(<HOST>:<port>)/<dbname>"
Reset: false,
GCInterval: 10 * time.Second,
})

// Initialize custom config using sql db connection
db, _ := sql.Open("mysql", "<username>:<pw>@tcp(<HOST>:<port>)/<dbname>")
store := mysql.New(mysql.Config{
Db: db,
Reset: false,
GCInterval: 10 * time.Second,
})

Config​

type Config struct {
// DB Will override ConnectionURI and all other authentication values if used
//
// Optional. Default is nil
Db *sql.DB

// Connection string to use for DB. Will override all other authentication values if used
//
// Optional. Default is ""
ConnectionURI string

// Host name where the DB is hosted
//
// Optional. Default is "127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 3306
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Database name
//
// Optional. Default is "fiber"
Database string

// Table name
//
// Optional. Default is "fiber_storage"
Table string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool

// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration
}

Default Config​

var ConfigDefault = Config{
ConnectionURI: "",
Host: "127.0.0.1",
Port: 3306,
Database: "fiber",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
}
+ + \ No newline at end of file diff --git a/storage/pebble/index.html b/storage/pebble/index.html index ebc2f812400..518d3a982e7 100644 --- a/storage/pebble/index.html +++ b/storage/pebble/index.html @@ -6,8 +6,8 @@ Pebble | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A fast key-value DB using cockroachdb/pebble

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *badger.DB

Installation​

Pebble is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

Note: This step is only required if you don't have an existing module.

And then install the Pebble implementation:

go get github.com/gofiber/storage/pebble

Examples​

Import the storage package.

import "github.com/gofiber/storage/pebble"

You can use the following possibilities to create a storage:

// Initialize default config
store := pebble.New()

// Initialize custom config
store := pebble.New(pebble.Config{
Path: "db",
WriteOptions: &pebble.WriteOptions{},
})

Config​

type Config struct {
// Database name
//
// Optional. Default is "./db"
Path string

// Pass write options during write operations
//
// Optional. Default is nil
WriteOptions &pebble.WriteOptions{}
}

Default Config​

var ConfigDefault = Config{
Path: "db",
WriteOptions: &pebble.WriteOptions{},
}
- - +Linter

A fast key-value DB using cockroachdb/pebble

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *badger.DB

Installation​

Pebble is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

Note: This step is only required if you don't have an existing module.

And then install the Pebble implementation:

go get github.com/gofiber/storage/pebble

Examples​

Import the storage package.

import "github.com/gofiber/storage/pebble"

You can use the following possibilities to create a storage:

// Initialize default config
store := pebble.New()

// Initialize custom config
store := pebble.New(pebble.Config{
Path: "db",
WriteOptions: &pebble.WriteOptions{},
})

Config​

type Config struct {
// Database name
//
// Optional. Default is "./db"
Path string

// Pass write options during write operations
//
// Optional. Default is nil
WriteOptions &pebble.WriteOptions{}
}

Default Config​

var ConfigDefault = Config{
Path: "db",
WriteOptions: &pebble.WriteOptions{},
}
+ + \ No newline at end of file diff --git a/storage/postgres/index.html b/storage/postgres/index.html index 3c02c55fbac..8888da0262d 100644 --- a/storage/postgres/index.html +++ b/storage/postgres/index.html @@ -6,8 +6,8 @@ Postgres | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A Postgres storage driver using jackc/pgx.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *pgxpool.Pool

Installation​

Postgres is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the postgres implementation:

go get github.com/gofiber/storage/postgres/v2

Examples​

Import the storage package.

import "github.com/gofiber/storage/postgres/v2"

You can use the following possibilities to create a storage:

// Initialize default config
store := postgres.New()

// Initialize custom config
store := postgres.New(postgres.Config{
Db: dbPool,
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
})

Config​

// Config defines the config for storage.
type Config struct {
// DB pgxpool.Pool object will override connection uri and other connection fields
//
// Optional. Default is nil
DB *pgxpool.Pool

// Connection string to use for DB. Will override all other authentication values if used
//
// Optional. Default is ""
ConnectionURI string

// Host name where the DB is hosted
//
// Optional. Default is "127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 5432
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Database name
//
// Optional. Default is "fiber"
Database string

// Table name
//
// Optional. Default is "fiber_storage"
Table string

// The SSL mode for the connection
//
// Optional. Default is "disable"
SSLMode string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool

// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration
}

Default Config​

// ConfigDefault is the default config
var ConfigDefault = Config{
ConnectionURI: "",
Host: "127.0.0.1",
Port: 5432,
Database: "fiber",
Table: "fiber_storage",
SSLMode: "disable",
Reset: false,
GCInterval: 10 * time.Second,
}
- - +Linter

A Postgres storage driver using jackc/pgx.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *pgxpool.Pool

Installation​

Postgres is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the postgres implementation:

go get github.com/gofiber/storage/postgres/v2

Examples​

Import the storage package.

import "github.com/gofiber/storage/postgres/v2"

You can use the following possibilities to create a storage:

// Initialize default config
store := postgres.New()

// Initialize custom config
store := postgres.New(postgres.Config{
Db: dbPool,
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
})

Config​

// Config defines the config for storage.
type Config struct {
// DB pgxpool.Pool object will override connection uri and other connection fields
//
// Optional. Default is nil
DB *pgxpool.Pool

// Connection string to use for DB. Will override all other authentication values if used
//
// Optional. Default is ""
ConnectionURI string

// Host name where the DB is hosted
//
// Optional. Default is "127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 5432
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Database name
//
// Optional. Default is "fiber"
Database string

// Table name
//
// Optional. Default is "fiber_storage"
Table string

// The SSL mode for the connection
//
// Optional. Default is "disable"
SSLMode string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool

// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration
}

Default Config​

// ConfigDefault is the default config
var ConfigDefault = Config{
ConnectionURI: "",
Host: "127.0.0.1",
Port: 5432,
Database: "fiber",
Table: "fiber_storage",
SSLMode: "disable",
Reset: false,
GCInterval: 10 * time.Second,
}
+ + \ No newline at end of file diff --git a/storage/redis/index.html b/storage/redis/index.html index 281baf359b5..a9f676273d7 100644 --- a/storage/redis/index.html +++ b/storage/redis/index.html @@ -6,8 +6,8 @@ Redis | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A Redis storage driver using go-redis/redis.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() redis.UniversalClient

Installation​

Redis is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the redis implementation:

go get github.com/gofiber/storage/redis/v2

Examples​

Import the storage package.

import "github.com/gofiber/storage/redis/v2"

You can use the one of the following options to create a Redis Storage:

// Initialize default config
store := redis.New()

// Initialize custom config
store := redis.New(redis.Config{
Host: "127.0.0.1",
Port: 6379,
Username: "",
Password: "",
Database: 0,
Reset: false,
TLSConfig: nil,
PoolSize: 10 * runtime.GOMAXPROCS(0),
})

// Initialize Redis Failover Client
store := redis.New(redis.Config{
MasterName: "master-name",
Addrs: []string{":6379"},
})

// Initialize Redis Cluster Client
store := redis.New(redis.Config{
Addrs: []string{":6379", ":6380"},
})

// Create a client with support for TLS
cer, err := tls.LoadX509KeyPair("./client.crt", "./client.key")
if err != nil {
log.Println(err)
return
}
tlsCfg := &tls.Config{
MinVersion: tls.VersionTLS12,
InsecureSkipVerify: true,
Certificates: []tls.Certificate{cer},
}
store = redis.New(redis.Config{
URL: "redis://<user>:<pass>@127.0.0.1:6379/<db>",
TLSConfig: tlsCfg,
Reset: false,
})

// Create a client with a Redis URL with all information.
store = redis.New(redis.Config{
URL: "redis://<user>:<pass>@127.0.0.1:6379/<db>",
Reset: false,
})

Config​

type Config struct {
// Host name where the DB is hosted
//
// Optional. Default is "127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 6379
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Database to be selected after connecting to the server.
//
// Optional. Default is 0
Database int

// URL standard format Redis URL. If this is set all other config options, Host, Port, Username, Password, Database have no effect.
//
// Example: redis://<user>:<pass>@localhost:6379/<db>
// Optional. Default is ""
URL string

// Either a single address or a seed list of host:port addresses, this enables FailoverClient and ClusterClient
//
// Optional. Default is []string{}
Addrs []string

// MasterName is the sentinel master's name
//
// Optional. Default is ""
MasterName string

// ClientName will execute the `CLIENT SETNAME ClientName` command for each conn.
//
// Optional. Default is ""
ClientName string

// SentinelUsername
//
// Optional. Default is ""
SentinelUsername string

// SentinelPassword
//
// Optional. Default is ""
SentinelPassword string

// Reset clears any existing keys in existing Collection
//
// Optional. Default is false
Reset bool

// TLS Config to use. When set TLS will be negotiated.
//
// Optional. Default is nil
TLSConfig *tls.Config

// Maximum number of socket connections.
//
// Optional. Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.
PoolSize int
}

Default Config​

var ConfigDefault = Config{
Host: "127.0.0.1",
Port: 6379,
Username: "",
Password: "",
URL: "",
Database: 0,
Reset: false,
TLSConfig: nil,
PoolSize: 10 * runtime.GOMAXPROCS(0),
Addrs: []string{},
MasterName: "",
ClientName: "",
SentinelUsername: "",
SentinelPassword: "",
}
- - +Linter

A Redis storage driver using go-redis/redis.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() redis.UniversalClient

Installation​

Redis is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the redis implementation:

go get github.com/gofiber/storage/redis/v2

Examples​

Import the storage package.

import "github.com/gofiber/storage/redis/v2"

You can use the one of the following options to create a Redis Storage:

// Initialize default config
store := redis.New()

// Initialize custom config
store := redis.New(redis.Config{
Host: "127.0.0.1",
Port: 6379,
Username: "",
Password: "",
Database: 0,
Reset: false,
TLSConfig: nil,
PoolSize: 10 * runtime.GOMAXPROCS(0),
})

// Initialize Redis Failover Client
store := redis.New(redis.Config{
MasterName: "master-name",
Addrs: []string{":6379"},
})

// Initialize Redis Cluster Client
store := redis.New(redis.Config{
Addrs: []string{":6379", ":6380"},
})

// Create a client with support for TLS
cer, err := tls.LoadX509KeyPair("./client.crt", "./client.key")
if err != nil {
log.Println(err)
return
}
tlsCfg := &tls.Config{
MinVersion: tls.VersionTLS12,
InsecureSkipVerify: true,
Certificates: []tls.Certificate{cer},
}
store = redis.New(redis.Config{
URL: "redis://<user>:<pass>@127.0.0.1:6379/<db>",
TLSConfig: tlsCfg,
Reset: false,
})

// Create a client with a Redis URL with all information.
store = redis.New(redis.Config{
URL: "redis://<user>:<pass>@127.0.0.1:6379/<db>",
Reset: false,
})

Config​

type Config struct {
// Host name where the DB is hosted
//
// Optional. Default is "127.0.0.1"
Host string

// Port where the DB is listening on
//
// Optional. Default is 6379
Port int

// Server username
//
// Optional. Default is ""
Username string

// Server password
//
// Optional. Default is ""
Password string

// Database to be selected after connecting to the server.
//
// Optional. Default is 0
Database int

// URL standard format Redis URL. If this is set all other config options, Host, Port, Username, Password, Database have no effect.
//
// Example: redis://<user>:<pass>@localhost:6379/<db>
// Optional. Default is ""
URL string

// Either a single address or a seed list of host:port addresses, this enables FailoverClient and ClusterClient
//
// Optional. Default is []string{}
Addrs []string

// MasterName is the sentinel master's name
//
// Optional. Default is ""
MasterName string

// ClientName will execute the `CLIENT SETNAME ClientName` command for each conn.
//
// Optional. Default is ""
ClientName string

// SentinelUsername
//
// Optional. Default is ""
SentinelUsername string

// SentinelPassword
//
// Optional. Default is ""
SentinelPassword string

// Reset clears any existing keys in existing Collection
//
// Optional. Default is false
Reset bool

// TLS Config to use. When set TLS will be negotiated.
//
// Optional. Default is nil
TLSConfig *tls.Config

// Maximum number of socket connections.
//
// Optional. Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.
PoolSize int
}

Default Config​

var ConfigDefault = Config{
Host: "127.0.0.1",
Port: 6379,
Username: "",
Password: "",
URL: "",
Database: 0,
Reset: false,
TLSConfig: nil,
PoolSize: 10 * runtime.GOMAXPROCS(0),
Addrs: []string{},
MasterName: "",
ClientName: "",
SentinelUsername: "",
SentinelPassword: "",
}
+ + \ No newline at end of file diff --git a/storage/ristretto/index.html b/storage/ristretto/index.html index e55fb28eb7e..7e8f588ce91 100644 --- a/storage/ristretto/index.html +++ b/storage/ristretto/index.html @@ -6,8 +6,8 @@ Ristretto | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A Memory-bound storage driver using dgraph-io/ristretto.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *ristretto.Cache

Installation​

Ristretto is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the ristretto implementation:

go get github.com/gofiber/storage/ristretto

Examples​

Import the storage package.

import "github.com/gofiber/storage/ristretto"

You can use the following possibilities to create a storage:

// Initialize default config
store := ristretto.New()

// Initialize custom config
store := ristretto.New(ristretto.Config{
NumCounters: 1e7, // number of keys to track frequency of (10M).
MaxCost: 1 << 30, // maximum cost of cache (1GB).
BufferItems: 64, // number of keys per Get buffer.
})

Config​

type Config struct {
// NumCounters number of keys to track frequency of (10M).
NumCounters int64

// MaxCost maximum cost of cache (1GB).
MaxCost int64

// BufferItems number of keys per Get buffer.
BufferItems int64
}

Default Config​

var ConfigDefault = Config{
NumCounters: 1e7,
MaxCost: 1 << 30,
BufferItems: 64,
DefaultCost: 1,
}
- - +Linter

A Memory-bound storage driver using dgraph-io/ristretto.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *ristretto.Cache

Installation​

Ristretto is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the ristretto implementation:

go get github.com/gofiber/storage/ristretto

Examples​

Import the storage package.

import "github.com/gofiber/storage/ristretto"

You can use the following possibilities to create a storage:

// Initialize default config
store := ristretto.New()

// Initialize custom config
store := ristretto.New(ristretto.Config{
NumCounters: 1e7, // number of keys to track frequency of (10M).
MaxCost: 1 << 30, // maximum cost of cache (1GB).
BufferItems: 64, // number of keys per Get buffer.
})

Config​

type Config struct {
// NumCounters number of keys to track frequency of (10M).
NumCounters int64

// MaxCost maximum cost of cache (1GB).
MaxCost int64

// BufferItems number of keys per Get buffer.
BufferItems int64
}

Default Config​

var ConfigDefault = Config{
NumCounters: 1e7,
MaxCost: 1 << 30,
BufferItems: 64,
DefaultCost: 1,
}
+ + \ No newline at end of file diff --git a/storage/s3/index.html b/storage/s3/index.html index c7b837b3807..e9442552d7c 100644 --- a/storage/s3/index.html +++ b/storage/s3/index.html @@ -6,8 +6,8 @@ S3 | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A S3 storage driver using aws/aws-sdk-go-v2.

Note: If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: specifying credentials

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *s3.Client

Installation​

S3 is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the s3 implementation:

go get github.com/gofiber/storage/s3

Examples​

Import the storage package.

import "github.com/gofiber/storage/s3"

You can use the following possibilities to create a storage:

// Initialize default config
store := s3.New()

// Initialize custom config
store := s3.New(s3.Config{
Bucket: "my-bucket-url",
Endpoint: "my-endpoint",
Region: "my-region",
Reset: false,
})

Config​

// Config defines the config for storage.
type Config struct {
// S3 bucket name
Bucket string

// AWS endpoint
Endpoint string

// AWS region
Region string

// Request timeout
//
// Optional. Default is 0 (no timeout)
RequestTimeout time.Duration

// Reset clears any existing keys in existing Bucket
//
// Optional. Default is false
Reset bool

// Credentials overrides AWS access key and AWS secret access key. Not recommended.
//
// Optional. Default is Credentials{}
Credentials Credentials

// The maximum number of times requests that encounter retryable failures should be attempted.
//
// Optional. Default is 3
MaxAttempts int

}

type Credentials struct {
AccessKey string
SecretAccessKey string
}

Default Config​

The default configuration lacks Bucket, Region, and Endpoint which are all required and must be overwritten:

// ConfigDefault is the default config
var ConfigDefault = Config{
Bucket: "",
Region: "",
Endpoint: "",
Credentials: Credentials{},
MaxAttempts: 3,
RequestTimeout: 0,
Reset: false,
}
- - +Linter

A S3 storage driver using aws/aws-sdk-go-v2.

Note: If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: specifying credentials

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *s3.Client

Installation​

S3 is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the s3 implementation:

go get github.com/gofiber/storage/s3

Examples​

Import the storage package.

import "github.com/gofiber/storage/s3"

You can use the following possibilities to create a storage:

// Initialize default config
store := s3.New()

// Initialize custom config
store := s3.New(s3.Config{
Bucket: "my-bucket-url",
Endpoint: "my-endpoint",
Region: "my-region",
Reset: false,
})

Config​

// Config defines the config for storage.
type Config struct {
// S3 bucket name
Bucket string

// AWS endpoint
Endpoint string

// AWS region
Region string

// Request timeout
//
// Optional. Default is 0 (no timeout)
RequestTimeout time.Duration

// Reset clears any existing keys in existing Bucket
//
// Optional. Default is false
Reset bool

// Credentials overrides AWS access key and AWS secret access key. Not recommended.
//
// Optional. Default is Credentials{}
Credentials Credentials

// The maximum number of times requests that encounter retryable failures should be attempted.
//
// Optional. Default is 3
MaxAttempts int

}

type Credentials struct {
AccessKey string
SecretAccessKey string
}

Default Config​

The default configuration lacks Bucket, Region, and Endpoint which are all required and must be overwritten:

// ConfigDefault is the default config
var ConfigDefault = Config{
Bucket: "",
Region: "",
Endpoint: "",
Credentials: Credentials{},
MaxAttempts: 3,
RequestTimeout: 0,
Reset: false,
}
+ + \ No newline at end of file diff --git a/storage/sqlite3/index.html b/storage/sqlite3/index.html index c5effe90467..fe6ab725411 100644 --- a/storage/sqlite3/index.html +++ b/storage/sqlite3/index.html @@ -6,8 +6,8 @@ SQLite3 | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

A SQLite3 storage driver using mattn/go-sqlite3.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *sql.DB

Installation​

SQLite3 is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the sqlite3 implementation:

go get github.com/gofiber/storage/sqlite3

Examples​

Import the storage package.

import "github.com/gofiber/storage/sqlite3"

You can use the following possibilities to create a storage:

// Initialize default config
store := sqlite3.New()

// Initialize custom config
store := sqlite3.New(sqlite3.Config{
Database: "./fiber.sqlite3",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
MaxOpenConns: 100,
MaxIdleConns: 100,
ConnMaxLifetime: 1 * time.Second,
})

Config​

type Config struct {
// Database name
//
// Optional. Default is "fiber"
Database string

// Table name
//
// Optional. Default is "fiber_storage"
Table string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool

// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration

// //////////////////////////////////
// Adaptor related config options //
// //////////////////////////////////

// MaxIdleConns sets the maximum number of connections in the idle connection pool.
//
// Optional. Default is 100.
MaxIdleConns int

// MaxOpenConns sets the maximum number of open connections to the database.
//
// Optional. Default is 100.
MaxOpenConns int

// ConnMaxLifetime sets the maximum amount of time a connection may be reused.
//
// Optional. Default is 1 second.
ConnMaxLifetime time.Duration
}

Default Config​

var ConfigDefault = Config{
Database: "./fiber.sqlite3",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
MaxOpenConns: 100,
MaxIdleConns: 100,
ConnMaxLifetime: 1 * time.Second,
}
- - +Linter

A SQLite3 storage driver using mattn/go-sqlite3.

Table of Contents​

Signatures​

func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *sql.DB

Installation​

SQLite3 is tested on the 2 last Go versions with support for modules. So make sure to initialize one first if you didn't do that yet:

go mod init github.com/<user>/<repo>

And then install the sqlite3 implementation:

go get github.com/gofiber/storage/sqlite3

Examples​

Import the storage package.

import "github.com/gofiber/storage/sqlite3"

You can use the following possibilities to create a storage:

// Initialize default config
store := sqlite3.New()

// Initialize custom config
store := sqlite3.New(sqlite3.Config{
Database: "./fiber.sqlite3",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
MaxOpenConns: 100,
MaxIdleConns: 100,
ConnMaxLifetime: 1 * time.Second,
})

Config​

type Config struct {
// Database name
//
// Optional. Default is "fiber"
Database string

// Table name
//
// Optional. Default is "fiber_storage"
Table string

// Reset clears any existing keys in existing Table
//
// Optional. Default is false
Reset bool

// Time before deleting expired keys
//
// Optional. Default is 10 * time.Second
GCInterval time.Duration

// //////////////////////////////////
// Adaptor related config options //
// //////////////////////////////////

// MaxIdleConns sets the maximum number of connections in the idle connection pool.
//
// Optional. Default is 100.
MaxIdleConns int

// MaxOpenConns sets the maximum number of open connections to the database.
//
// Optional. Default is 100.
MaxOpenConns int

// ConnMaxLifetime sets the maximum amount of time a connection may be reused.
//
// Optional. Default is 1 second.
ConnMaxLifetime time.Duration
}

Default Config​

var ConfigDefault = Config{
Database: "./fiber.sqlite3",
Table: "fiber_storage",
Reset: false,
GCInterval: 10 * time.Second,
MaxOpenConns: 100,
MaxIdleConns: 100,
ConnMaxLifetime: 1 * time.Second,
}
+ + \ No newline at end of file diff --git a/sw.js b/sw.js index 2bae4b3ec75..a339dee0fc4 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -(()=>{"use strict";var e={913:()=>{try{self["workbox:core:6.5.3"]&&_()}catch(e){}},977:()=>{try{self["workbox:precaching:6.5.3"]&&_()}catch(e){}},80:()=>{try{self["workbox:routing:6.5.3"]&&_()}catch(e){}},873:()=>{try{self["workbox:strategies:6.5.3"]&&_()}catch(e){}}},t={};function s(a){var n=t[a];if(void 0!==n)return n.exports;var i=t[a]={exports:{}};return e[a](i,i.exports,s),i.exports}(()=>{s(913);const e=(e,...t)=>{let s=e;return t.length>0&&(s+=` :: ${JSON.stringify(t)}`),s};class t extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}const a={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},n=e=>[a.prefix,e,a.suffix].filter((e=>e&&e.length>0)).join("-"),i=e=>e||n(a.precache),r=e=>e||n(a.runtime);function c(e,t){const s=t();return e.waitUntil(s),s}s(977);const o="__WB_REVISION__";function h(e){if(!e)throw new t("add-to-cache-list-unexpected-type",{entry:e});if("string"==typeof e){const t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}const{revision:s,url:a}=e;if(!a)throw new t("add-to-cache-list-unexpected-type",{entry:e});if(!s){const e=new URL(a,location.href);return{cacheKey:e.href,url:e.href}}const n=new URL(a,location.href),i=new URL(a,location.href);return n.searchParams.set(o,s),{cacheKey:n.href,url:i.href}}class l{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if("install"===e.type&&t&&t.originalRequest&&t.originalRequest instanceof Request){const e=t.originalRequest.url;s?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return s}}}class u{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{const s=(null==t?void 0:t.cacheKey)||this._precacheController.getCacheKeyForURL(e.url);return s?new Request(s,{headers:e.headers}):e},this._precacheController=e}}let f;async function d(e,s){let a=null;if(e.url){a=new URL(e.url).origin}if(a!==self.location.origin)throw new t("cross-origin-copy-response",{origin:a});const n=e.clone(),i={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},r=s?s(i):i,c=function(){if(void 0===f){const e=new Response("");if("body"in e)try{new Response(e.body),f=!0}catch(e){f=!1}f=!1}return f}()?n.body:await n.blob();return new Response(c,r)}function p(e,t){const s=new URL(e);for(const e of t)s.searchParams.delete(e);return s.href}class g{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const y=new Set;s(873);function w(e){return"string"==typeof e?new Request(e):e}class _{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new g,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:s}=this;let a=w(e);if("navigate"===a.mode&&s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const n=this.hasCallback("fetchDidFail")?a.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))a=await e({request:a.clone(),event:s})}catch(e){if(e instanceof Error)throw new t("plugin-error-request-will-fetch",{thrownErrorMessage:e.message})}const i=a.clone();try{let e;e=await fetch(a,"navigate"===a.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:s,request:i,response:e});return e}catch(e){throw n&&await this.runCallbacks("fetchDidFail",{error:e,event:s,originalRequest:n.clone(),request:i.clone()}),e}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=w(e);let s;const{cacheName:a,matchOptions:n}=this._strategy,i=await this.getCacheKey(t,"read"),r=Object.assign(Object.assign({},n),{cacheName:a});s=await caches.match(i,r);for(const e of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await e({cacheName:a,matchOptions:n,cachedResponse:s,request:i,event:this.event})||void 0;return s}async cachePut(e,s){const a=w(e);var n;await(n=0,new Promise((e=>setTimeout(e,n))));const i=await this.getCacheKey(a,"write");if(!s)throw new t("cache-put-with-no-response",{url:(r=i.url,new URL(String(r),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var r;const c=await this._ensureResponseSafeToCache(s);if(!c)return!1;const{cacheName:o,matchOptions:h}=this._strategy,l=await self.caches.open(o),u=this.hasCallback("cacheDidUpdate"),f=u?await async function(e,t,s,a){const n=p(t.url,s);if(t.url===n)return e.match(t,a);const i=Object.assign(Object.assign({},a),{ignoreSearch:!0}),r=await e.keys(t,i);for(const t of r)if(n===p(t.url,s))return e.match(t,a)}(l,i.clone(),["__WB_REVISION__"],h):null;try{await l.put(i,u?c.clone():c)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await async function(){for(const e of y)await e()}(),e}for(const e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:o,oldResponse:f,newResponse:c.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){const s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let a=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))a=w(await e({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[s]=a}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"==typeof t[e]){const s=this._pluginStateMap.get(t),a=a=>{const n=Object.assign(Object.assign({},a),{state:s});return t[e](n)};yield a}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&200!==t.status&&(t=void 0),t}}class v{constructor(e={}){this.cacheName=r(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s="string"==typeof e.request?new Request(e.request):e.request,a="params"in e?e.params:void 0,n=new _(this,{event:t,request:s,params:a}),i=this._getResponse(n,s,t);return[i,this._awaitComplete(i,n,s,t)]}async _getResponse(e,s,a){let n;await e.runCallbacks("handlerWillStart",{event:a,request:s});try{if(n=await this._handle(s,e),!n||"error"===n.type)throw new t("no-response",{url:s.url})}catch(t){if(t instanceof Error)for(const i of e.iterateCallbacks("handlerDidError"))if(n=await i({error:t,event:a,request:s}),n)break;if(!n)throw t}for(const t of e.iterateCallbacks("handlerWillRespond"))n=await t({event:a,request:s,response:n});return n}async _awaitComplete(e,t,s,a){let n,i;try{n=await e}catch(i){}try{await t.runCallbacks("handlerDidRespond",{event:a,request:s,response:n}),await t.doneWaiting()}catch(e){e instanceof Error&&(i=e)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:s,response:n,error:i}),t.destroy(),i)throw i}}class m extends v{constructor(e={}){e.cacheName=i(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(m.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const s=await t.cacheMatch(e);return s||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,s){let a;const n=s.params||{};if(!this._fallbackToNetwork)throw new t("missing-precache-entry",{cacheName:this.cacheName,url:e.url});{0;const t=n.integrity,i=e.integrity,r=!i||i===t;if(a=await s.fetch(new Request(e,{integrity:"no-cors"!==e.mode?i||t:void 0})),t&&r&&"no-cors"!==e.mode){this._useDefaultCacheabilityPluginIfNeeded();await s.cachePut(e,a.clone());0}}return a}async _handleInstall(e,s){this._useDefaultCacheabilityPluginIfNeeded();const a=await s.fetch(e);if(!await s.cachePut(e,a.clone()))throw new t("bad-precaching-response",{url:e.url,status:a.status});return a}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,a]of this.plugins.entries())a!==m.copyRedirectedCacheableResponsesPlugin&&(a===m.defaultPrecacheCacheabilityPlugin&&(e=s),a.cacheWillUpdate&&t++);0===t?this.plugins.push(m.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}m.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e},m.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:e})=>e.redirected?await d(e):e};class R{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new m({cacheName:i(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const s=[];for(const a of e){"string"==typeof a?s.push(a):a&&void 0===a.revision&&s.push(a.url);const{cacheKey:e,url:n}=h(a),i="string"!=typeof a&&a.revision?"reload":"default";if(this._urlsToCacheKeys.has(n)&&this._urlsToCacheKeys.get(n)!==e)throw new t("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(n),secondEntry:e});if("string"!=typeof a&&a.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==a.integrity)throw new t("add-to-cache-list-conflicting-integrities",{url:n});this._cacheKeysToIntegrities.set(e,a.integrity)}if(this._urlsToCacheKeys.set(n,e),this._urlsToCacheModes.set(n,i),s.length>0){const e=`Workbox is precaching URLs without revision info: ${s.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return c(e,(async()=>{const t=new l;this.strategy.plugins.push(t);for(const[t,s]of this._urlsToCacheKeys){const a=this._cacheKeysToIntegrities.get(s),n=this._urlsToCacheModes.get(t),i=new Request(t,{integrity:a,cache:n,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:i,event:e}))}const{updatedURLs:s,notUpdatedURLs:a}=t;return{updatedURLs:s,notUpdatedURLs:a}}))}activate(e){return c(e,(async()=>{const e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),a=[];for(const n of t)s.has(n.url)||(await e.delete(n),a.push(n.url));return{deletedURLs:a}}))}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(e){const s=this.getCacheKeyForURL(e);if(!s)throw new t("non-precached-url",{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:s},t.params),this.strategy.handle(t))}}s(80);(async()=>{const e=function(){const e=JSON.parse(new URLSearchParams(self.location.search).get("params"));return e.debug&&console.log("[Docusaurus-PWA][SW]: Service Worker params:",e),e}(),t=[{"revision":"7ecc36bd42522fd342085adf2802c97e","url":"-middleware/index.html"},{"revision":"eb3cd1b81ccd4dfdd8e7bffe251bebfb","url":"404.html"},{"revision":"1e7e3be2bb0e72dab7ec4716d78e952b","url":"api/app/index.html"},{"revision":"de19ab5d9a3abb1450cdb74f98d0cb93","url":"api/client/index.html"},{"revision":"58a7d85e627ed59b3293c90db0b4c784","url":"api/constants/index.html"},{"revision":"ec66d189334d3a3228e6e05366a09b8d","url":"api/ctx/index.html"},{"revision":"30b2fac389159393030b4b039def08c9","url":"api/fiber/index.html"},{"revision":"98e8401c7dfd25480464408c4394941a","url":"api/middleware/adaptor/index.html"},{"revision":"c31a726a10625b534ae6bd76fe772bd3","url":"api/middleware/basicauth/index.html"},{"revision":"614246fc295ca180d872739602d5b8b9","url":"api/middleware/cache/index.html"},{"revision":"eabffc25c9c218a9fb6b36fb817e9a47","url":"api/middleware/compress/index.html"},{"revision":"b30b6fd11c3b95cfac6a7be5865ec61e","url":"api/middleware/cors/index.html"},{"revision":"a59e35dfd2d47ea8d9e3a6fa23aa7143","url":"api/middleware/csrf/index.html"},{"revision":"6fa7aeb05fec656f3552c320e682b310","url":"api/middleware/earlydata/index.html"},{"revision":"0089d2a3f91cf8e60f65714912d5ee2c","url":"api/middleware/encryptcookie/index.html"},{"revision":"d89b8fb0239fcfadad3bc55b3d52136a","url":"api/middleware/envvar/index.html"},{"revision":"7b0740c261d83749f4657a95a133a7c2","url":"api/middleware/etag/index.html"},{"revision":"28f80f2dab1a42e1a47c11bb3fafc04c","url":"api/middleware/expvar/index.html"},{"revision":"ead41d24833c18ffd577ac0c0059c0f2","url":"api/middleware/favicon/index.html"},{"revision":"982b7902ecb386110c92762fb2af982d","url":"api/middleware/filesystem/index.html"},{"revision":"8202505bbcb3b313b5c1efe12fa593d3","url":"api/middleware/helmet/index.html"},{"revision":"c0821f256cb7910f41adf0bddda1530a","url":"api/middleware/idempotency/index.html"},{"revision":"0c1e42802516ca9b0a3c6b9d7fc5d791","url":"api/middleware/keyauth/index.html"},{"revision":"25d7679e678a8f2bde1b15507cfdf845","url":"api/middleware/limiter/index.html"},{"revision":"3964c6c5ef1e20a1104b78b10f99344b","url":"api/middleware/logger/index.html"},{"revision":"836e3d89b4cb28b72d3223172cc9524e","url":"api/middleware/monitor/index.html"},{"revision":"ac404f36aa00f0f613e0e4e8397c705b","url":"api/middleware/pprof/index.html"},{"revision":"b04adb39268bd276cf9ded07ff061737","url":"api/middleware/proxy/index.html"},{"revision":"7c05435e8f543ad774688846282bd25b","url":"api/middleware/recover/index.html"},{"revision":"1683056b26b61d5d220b4a4555f67a1e","url":"api/middleware/redirect/index.html"},{"revision":"b1d000e4573d37d5794bbe190373fdb6","url":"api/middleware/requestid/index.html"},{"revision":"672b39848830ae50033d02f32d41d7c8","url":"api/middleware/rewrite/index.html"},{"revision":"53fd8a0f38e7564df2b8cb59bee27cb1","url":"api/middleware/session/index.html"},{"revision":"0b81b4caac636f3de5d1109e93e89d05","url":"api/middleware/skip/index.html"},{"revision":"9f9d546de9fc9a0451cc2fc14115dcba","url":"api/middleware/timeout/index.html"},{"revision":"ec59863066ac9b918477d77dbb0da288","url":"assets/css/styles.f3bed87e.css"},{"revision":"595c0f86e9fc57a7b06e11795a399b13","url":"assets/js/044897a3.a33c1c99.js"},{"revision":"c23ff9b53b1b00da6ae095ae2479b76d","url":"assets/js/04b03e77.399f66c0.js"},{"revision":"53e5ea5949614e4663bbbfddc30559ef","url":"assets/js/054c93da.1f799190.js"},{"revision":"4ad4004d358c66a72fb69a730ae0ac93","url":"assets/js/05a04cc8.f70d38fb.js"},{"revision":"2b7a13c7b363e3dbe2ad854a28e54b09","url":"assets/js/09303bcf.5170086f.js"},{"revision":"d44f35436a729fba0374e49588869169","url":"assets/js/0c35ae3f.7d98fbac.js"},{"revision":"0614210e23ec2032ce9bc12454688c04","url":"assets/js/0f17a9fe.d3a7354d.js"},{"revision":"e130e2350907568aff3e97936954a70c","url":"assets/js/0faeb6cb.ac01fd04.js"},{"revision":"9cd3ff39a74f31e4854b8c956b0b8727","url":"assets/js/0fb7e018.282bab2b.js"},{"revision":"4911e8b36195b15a66a7ad7f7a1fdf30","url":"assets/js/105f1242.f17a9f3c.js"},{"revision":"2582b7c44210d76dbf6625ff7a0ee6cd","url":"assets/js/11ab8220.770c36de.js"},{"revision":"c3d7913c6b182e077badd8484cf27612","url":"assets/js/14a7e971.9dc2d0a2.js"},{"revision":"6063cdf72863b3e29b087ca446d32864","url":"assets/js/14eb3368.ebc01a7b.js"},{"revision":"855c05852aa97d549b2ed489642601c9","url":"assets/js/15eed0c8.ecdb0f8b.js"},{"revision":"85b94e371def82a408e0fc2ebc28f74c","url":"assets/js/17896441.462cdaa3.js"},{"revision":"7ae3a53ad4256254c88fb3236f60a411","url":"assets/js/187263b9.bfb865ab.js"},{"revision":"7ff1046ef92ebada1aa7d5566d1f7ef3","url":"assets/js/19323918.c5f276d7.js"},{"revision":"67ab61c0e0e1f210a31a9604b8fb393a","url":"assets/js/19e7c5f6.15505080.js"},{"revision":"b99c42a19fc1fc1c8de47af47f814c8e","url":"assets/js/1a4e3797.6d445047.js"},{"revision":"c4a5cda7bfbffb2272368d5217cc84e5","url":"assets/js/1a56c576.e228a4c4.js"},{"revision":"45f439437bc8379cc15f2ba8f40b4df4","url":"assets/js/1a6451b0.be720878.js"},{"revision":"120b61595036514012aaf3f57bcdcb5f","url":"assets/js/1af20617.b7c00b46.js"},{"revision":"21d031f733f2ce29330b23c530fea034","url":"assets/js/1b545511.1cee49e8.js"},{"revision":"e43d77ecf39a48a654feace90aae0aab","url":"assets/js/1be78505.c3eac7b7.js"},{"revision":"7462a2adc52dafebe2d89f99c186ffff","url":"assets/js/1ed4c90d.318ba267.js"},{"revision":"7b5268d1039874c1dff811376cebadc5","url":"assets/js/20b2a36a.41882872.js"},{"revision":"940ce86885ea4672cc6bce584ee759a7","url":"assets/js/20e81fa7.34ed80bb.js"},{"revision":"41106cc0cc7ae768b7cf03d028509ead","url":"assets/js/2155a006.e5dce700.js"},{"revision":"bbe172463923b6b613eb9a423d3c6b92","url":"assets/js/21cbcfa4.fbc8202f.js"},{"revision":"21f65e983e654a0b6825c9e4338f52e5","url":"assets/js/230.06e9bff8.js"},{"revision":"8278edc76fc3c4a2be3323fc17dc643c","url":"assets/js/247783bb.b20f80cc.js"},{"revision":"164bb7ddbc4ee647248c5cd1982de060","url":"assets/js/24847ea2.8309ea55.js"},{"revision":"d3bd5b618e6e4847cb495fb69806ac62","url":"assets/js/26257c43.b5244531.js"},{"revision":"a0bee76bedb4ff10b59034daad1e82a0","url":"assets/js/2804f106.7bd4bea3.js"},{"revision":"fd6519a957744ad80caf8e8724f059a2","url":"assets/js/2930693d.1be6c394.js"},{"revision":"46bf47886c3356c90dcc34065310f447","url":"assets/js/29b92cdb.3d4bbc8b.js"},{"revision":"769ce92b863720b60127313653ea914b","url":"assets/js/2a83b683.1f64dab7.js"},{"revision":"fa4bccae4e2c68af1da89519960fd3cf","url":"assets/js/2ab216cb.38930db4.js"},{"revision":"cd9a53538b2b0c890fe7e52e343e3ad4","url":"assets/js/2b43107e.3630b5dc.js"},{"revision":"3350d9fe146af2938a47374b93374764","url":"assets/js/2bc33efd.648add97.js"},{"revision":"8291f6e52bf384bbcb79061a0fa19e17","url":"assets/js/302308c6.c3a44bda.js"},{"revision":"1d4c6654debe3ecb42bfa2b7277e7556","url":"assets/js/30f87c66.3389cfba.js"},{"revision":"e08d0aee5014e4e0a056be8456fec66c","url":"assets/js/3109af4c.5b4d3f3d.js"},{"revision":"2a0ca80840c07efc60d0ba890556f3ef","url":"assets/js/32e68b93.aac19a73.js"},{"revision":"8608a0f3f8145b80e835589741846d6f","url":"assets/js/354823c1.fabb7265.js"},{"revision":"b9408669a95598bcbbc064a9eb9bc04a","url":"assets/js/354efaa7.d2c58f13.js"},{"revision":"8e3b8f167516f6567f6ff34522196d4d","url":"assets/js/3719c62c.693effe3.js"},{"revision":"f81cbef44017fc0fd4f2308a71a4bdaf","url":"assets/js/3724ddc1.268ab58c.js"},{"revision":"e01ccd3e42dbcd086b219347d6f6404e","url":"assets/js/37662bdc.585f23dd.js"},{"revision":"fa1f3a13da549e6a1f7a5ff4233c4992","url":"assets/js/3a6391d4.283c9326.js"},{"revision":"1c461c7bca9310df74e59963c101ad2d","url":"assets/js/3b70e89f.3eaad028.js"},{"revision":"62181f262a099895633eca2063c96084","url":"assets/js/3d13e7fb.ef6449a5.js"},{"revision":"d13a0b82e439e1243fdf336a7c1e84cb","url":"assets/js/4129286c.6024df0a.js"},{"revision":"9cd8c889b7129a3eaa8cd9be581273c4","url":"assets/js/41a4aef8.f062ed12.js"},{"revision":"972cd40d0e51c2b333ad1dda4113dd09","url":"assets/js/48c6cc07.12cecbda.js"},{"revision":"598c78f8cac1a8020512ca77bb55893a","url":"assets/js/4972.16dfd4ea.js"},{"revision":"846e2e279ab54164c4ccbcedbb4eb209","url":"assets/js/4a6d765c.491fe0f9.js"},{"revision":"4d94ba606e5cd8d0aa91ba94a1f368ee","url":"assets/js/4b0c4837.20531852.js"},{"revision":"0e25458bea1c141feb69c4d7c834f650","url":"assets/js/4b47f78b.bff35553.js"},{"revision":"8a586a383e4e62a3235a9d462a349eb7","url":"assets/js/5131.8aadd48c.js"},{"revision":"5c9b6aa589b8b94732fee2e2769353fa","url":"assets/js/5229ce75.60838400.js"},{"revision":"0933a70374cdd0535785868363a5598d","url":"assets/js/5283.0af36832.js"},{"revision":"1db7139270887fccf88a1866597bed62","url":"assets/js/5525.999d509e.js"},{"revision":"92663469de12886e9da082601efa4c00","url":"assets/js/56cc377d.3d522e68.js"},{"revision":"554aa65abf4fa664ad5ca6c5bbd82775","url":"assets/js/5aebd6e8.260e5eae.js"},{"revision":"b11951714c7cb88df547ecbb998bee14","url":"assets/js/5f49a855.e94d31de.js"},{"revision":"12a3d42b25e568824166ce03e2996ec4","url":"assets/js/61265387.f47ab1ca.js"},{"revision":"e9f1b777e9c4309263aec9edc71f332b","url":"assets/js/615fd3de.9c409b23.js"},{"revision":"e0d58cb02fe821d906e79aa446da15c6","url":"assets/js/61f05610.43c5bf76.js"},{"revision":"31065a46960829505f7256a713d62f45","url":"assets/js/65a2e3ff.8cb8b5c4.js"},{"revision":"27962383908883a6b810d2e10329814f","url":"assets/js/683903ba.cfcdd8f0.js"},{"revision":"1ef9c37ac7d1db6d46d17da7a1c6e271","url":"assets/js/696b59c8.060be796.js"},{"revision":"27c8050c712ed794184c70f8816fcfbc","url":"assets/js/696e1f87.b830bf21.js"},{"revision":"a72744e3ad1a348f42a1805abb383b66","url":"assets/js/697acd1f.8262f63d.js"},{"revision":"fa0b5b0f87d98b7407ef28d081218c16","url":"assets/js/6a9ae4f0.abceec18.js"},{"revision":"aacb39a84fa721ee55a056242f995aa9","url":"assets/js/6b69f1ff.52342e9c.js"},{"revision":"26c8697b11e31931fb5c9215f13bef5f","url":"assets/js/6d7ca528.1de486dc.js"},{"revision":"b0f265a7e30016d397a10bf2614725d8","url":"assets/js/6e0f0a87.b9837daa.js"},{"revision":"35b98518403d8f869be0e54c5e2e9b8e","url":"assets/js/6f9f0f49.7435912c.js"},{"revision":"b0df283be4bebdfbb586751e36d90bae","url":"assets/js/70908c7a.25aa2b77.js"},{"revision":"89a042e26a90bfc954fb7b9047d0356b","url":"assets/js/70bddfb7.d9f3b3ce.js"},{"revision":"85a5fb79f55362e3eae18654964c270d","url":"assets/js/7307607e.1315447c.js"},{"revision":"cba2166f7fba9f4143a25faf12c79759","url":"assets/js/73b0bf71.bb3ee241.js"},{"revision":"fdfdb1caf7c7d447490125e40bdbf8f7","url":"assets/js/7449d9ed.ef4d0dea.js"},{"revision":"a05c7797bcecbfbf3e9920641d43a920","url":"assets/js/7506f0f5.5e479ec2.js"},{"revision":"4e797769df1161c3ed516dbb7842edaa","url":"assets/js/75542ae5.034a0932.js"},{"revision":"740e61075a191b0ade7f19ef095bebc6","url":"assets/js/78d978a7.53c10629.js"},{"revision":"b19b9c592a31c59c452c740306989676","url":"assets/js/7bb2c503.f43c2202.js"},{"revision":"b0155cf04aa430bf7442df66fa4f90ef","url":"assets/js/7d5a5238.77c20edb.js"},{"revision":"414c221c0cee88b4b647f86410117530","url":"assets/js/7d7ae710.bd143ddc.js"},{"revision":"2092b4f06fc8d889dacc0b35a2bbe7be","url":"assets/js/7e307fec.497beffe.js"},{"revision":"b2c8bcb821877fa1c599b17e6e887f81","url":"assets/js/7e6c0027.fa2c31c1.js"},{"revision":"3adbd7844f94ce5d9be782468c4fccdd","url":"assets/js/8231ac58.07c9ac1e.js"},{"revision":"44c53190c78f24f34607015817aa0e68","url":"assets/js/82a52177.8927f077.js"},{"revision":"b85e1f5cf0fbbbd0f26fb82998b39dbb","url":"assets/js/8443.f0fb2769.js"},{"revision":"30299c7294e2dc9770197d08178c276e","url":"assets/js/8498b8c7.dc6093a6.js"},{"revision":"47be660181144672864c23bb4ddce3fa","url":"assets/js/85ea1211.41cb3742.js"},{"revision":"81a2a364f212e0882a0f13f78b9ee7fe","url":"assets/js/8613e059.4f1c2537.js"},{"revision":"27801dc4c21096fda2caca3b4854e547","url":"assets/js/89cfd5bc.b9731d01.js"},{"revision":"577ea37e5ad0cb4d2e47916786f7412f","url":"assets/js/8a0a7bb8.6ece6c3a.js"},{"revision":"e7730ab1a8d8603f46a44a24bd82cdf8","url":"assets/js/8ec8555c.028e8846.js"},{"revision":"49fa2cf8287e996a52ca0121a61348c9","url":"assets/js/8ffdbf67.740a7c05.js"},{"revision":"c10b3abf11b363d0d28c3a7e9cbf41b0","url":"assets/js/9150d950.bae0706f.js"},{"revision":"bf8abd759e9fbf34af7f41421a6bcf9b","url":"assets/js/9169002b.76549c1a.js"},{"revision":"a1211cf5a6d622fa1e090e4e5ae385e4","url":"assets/js/9226f6dc.f30749c7.js"},{"revision":"1a3a90bd22788e3b414c065f3aa8ab6d","url":"assets/js/935f2afb.e6ae511e.js"},{"revision":"9dea6f9ed7d368fd54ba4430867caf26","url":"assets/js/96cc6114.9be8cbd2.js"},{"revision":"312449e95665ab6334f21f10f43e3ab8","url":"assets/js/9717e045.56d847ce.js"},{"revision":"f4648c7793aad543e5a8c842858371c5","url":"assets/js/98ce83f7.f6b99736.js"},{"revision":"46fd9f949ce5daa19ed72d8aa579bfba","url":"assets/js/99c84a64.4d700083.js"},{"revision":"1c7de2a89614ce31a8aa7204a39ba071","url":"assets/js/99d23504.5f4c6a63.js"},{"revision":"b739aa43b5a2cb9c142f6953ab5bb9ec","url":"assets/js/9a4187db.f1382ca0.js"},{"revision":"350ebdfebc5c2572c1e63b0bc39b746b","url":"assets/js/9a57fc4d.7189a71d.js"},{"revision":"a97429c79dcc99a6974415752808a921","url":"assets/js/9c153fbf.137ce857.js"},{"revision":"bf477bced2db1a6549e2e9e06934b18a","url":"assets/js/9e834d3b.92ea5d1f.js"},{"revision":"b27055de996de50f8327146a93bc504e","url":"assets/js/a4976c5b.59828ff1.js"},{"revision":"cf0cc78a17a2affd9cdd116406f4a85d","url":"assets/js/a4f7be8a.62e6a2d6.js"},{"revision":"63e610644d0938fb5670cb92b43d94c0","url":"assets/js/a56e433f.2dcb9115.js"},{"revision":"72b4ebb90520a545c5f021b39d75c94c","url":"assets/js/a623b5ef.48eb1a95.js"},{"revision":"19257e2184849d114774da104366d76c","url":"assets/js/a6514993.e5271e5c.js"},{"revision":"79e58cc132e056115c5ac0b6f559bd7b","url":"assets/js/a900ff2e.8eeb8164.js"},{"revision":"77e39084fe343abfde08dcfa18e8c4c6","url":"assets/js/a947b58e.ab53e9bf.js"},{"revision":"c78ea569af15472860fa34a9d62f2350","url":"assets/js/a98ab587.0a5f0189.js"},{"revision":"327f0785e52739e1b5883c559866753b","url":"assets/js/aa5eb267.0bdba5fa.js"},{"revision":"08005431cb7668c53db802fad0432fb5","url":"assets/js/ab6e749e.5a45a7d4.js"},{"revision":"bc70c0750a3f9bdfc5e3eafb36b27fa8","url":"assets/js/aba14099.0438f9b1.js"},{"revision":"9d8de44f6b7e491e0754c47340172fa8","url":"assets/js/adc35084.de48e8cd.js"},{"revision":"628641d9f6ca8942898a0e8fd4f374d9","url":"assets/js/bafae794.b3fe6e34.js"},{"revision":"539b0aaa9811d5d4c170e150ea7e239f","url":"assets/js/bcaa1a93.6f74021d.js"},{"revision":"72f266ef080ab6e05da2ac3550bd2c8b","url":"assets/js/bd4688e3.fcf60fb6.js"},{"revision":"1048d5dd3c4a0e123de14deea0394ef9","url":"assets/js/bd6d307b.ac09a33d.js"},{"revision":"8647e41758fc20023807dbe772c29564","url":"assets/js/bddcf50a.ece26b11.js"},{"revision":"0dff282c8494c1f831f9add633c5d9b9","url":"assets/js/c6147012.3042127e.js"},{"revision":"5e40790b21b542795f9c15a676bf00bb","url":"assets/js/c664382c.ab326e0f.js"},{"revision":"b7c819d6ada9095cf6341416ae0dee50","url":"assets/js/c8fbcedd.83afc5b2.js"},{"revision":"153b285c2cbb44a9a1f533d3dee66d25","url":"assets/js/c921e1c5.8953c9a7.js"},{"revision":"3943e0e0dc618558cd982a290c6ee4cb","url":"assets/js/cb1fa44a.cd09330f.js"},{"revision":"11e0964c1126bc5b3d180163190dbb20","url":"assets/js/cd01922d.090122dd.js"},{"revision":"4b0f8ea4b70bd75d700623748e5e4786","url":"assets/js/ceb3afff.74448ab9.js"},{"revision":"ef5e1ae4cc21ea3e6bd6b3bd17eb3755","url":"assets/js/cf63ef8e.4c9f3d04.js"},{"revision":"c289c7660785106399b1ac5d14ac6b0c","url":"assets/js/d13e591d.b300fad6.js"},{"revision":"e28ad9b67c035b5429c2bffdf6373ea7","url":"assets/js/d32d6269.3272c812.js"},{"revision":"093ff8fd303a192807daf3aca92e6792","url":"assets/js/d3f7bfd6.be5be210.js"},{"revision":"142ab635e22664b468b1298b7aa1ef1e","url":"assets/js/d56ded4a.cc4917eb.js"},{"revision":"a08348d74b3e8bdd756b1678b797da86","url":"assets/js/d8d851c4.a4171d22.js"},{"revision":"798c97b5651c880f20c816073cc441ad","url":"assets/js/d9c007a6.fd8f54cd.js"},{"revision":"0655e71e6f672cee27197738f82541a5","url":"assets/js/dc18e77a.5e9ea3cd.js"},{"revision":"217c92628ddb2fd2b08b88e9a7d3e324","url":"assets/js/dd6e99a2.d21e82bf.js"},{"revision":"2b469b176833e4268adcc1228bb64fdf","url":"assets/js/def1082f.37baa122.js"},{"revision":"5967ff405c847ba73050cdc5981ca62e","url":"assets/js/df7efcc1.2759e7c6.js"},{"revision":"1cb41e758eac72655843dfbee063e395","url":"assets/js/dff2806d.a818e271.js"},{"revision":"7fb0733ca0877321d23af8672ea35d13","url":"assets/js/e02ba15b.eb1ee8d6.js"},{"revision":"041082db203f72edeb1659fe92cf557a","url":"assets/js/e4fc886a.14528cf7.js"},{"revision":"b965bfaa858be1e132996c1c9a16aa75","url":"assets/js/e5e7af3c.2c0ee055.js"},{"revision":"a12878bed448dece65f6b11166808971","url":"assets/js/e60d8fac.372c8ef2.js"},{"revision":"300e8e5df4a09deca7726b6804bf7f99","url":"assets/js/e75dbc73.cd308ffe.js"},{"revision":"6cc4c90ba77b02e02e8992e255b065ee","url":"assets/js/e77f4328.a9e40a28.js"},{"revision":"dd8175a9eecf425c0fdfd3d64788c038","url":"assets/js/e7e568e4.0574da31.js"},{"revision":"9b84d3eed71118ee9dd47ca8df9c2ca8","url":"assets/js/e986d0bf.10d7fc9f.js"},{"revision":"7240abbea165a94a5ee5c66817aacb85","url":"assets/js/ec1940fc.2ebb096d.js"},{"revision":"2b91b8dab3e58aeb2d6a4c1c7369cab3","url":"assets/js/ec4d7ded.d476fc26.js"},{"revision":"b28fdce09f657a3eb329069c272de0b1","url":"assets/js/ecaa11c6.2f0265af.js"},{"revision":"3e5933d846e3fa42261304d7be305f47","url":"assets/js/ee02910b.444a163b.js"},{"revision":"792658885b6e88fdbe56518b016bb181","url":"assets/js/f283da07.824d7148.js"},{"revision":"e75e3dbed7cf8685aa14a13c0f7cfbd8","url":"assets/js/f36dee5a.86ee28f7.js"},{"revision":"51d9b295fc96a607ee116d7b62256f52","url":"assets/js/f3a8b621.aeec68ca.js"},{"revision":"f8a5022d97969da89511307d9955b8ae","url":"assets/js/f64f61d9.ea4450f2.js"},{"revision":"94b8315c957fd2f838302adaf20271e9","url":"assets/js/f740b2ca.d5ec4806.js"},{"revision":"e9f59a8ea0aee24f41a45dd8029f682d","url":"assets/js/f7cef55a.e9a0e5c9.js"},{"revision":"a969feb4ebba77895bd1dd1340bc19f6","url":"assets/js/f9806908.c8f8f30b.js"},{"revision":"5cd3ee4c23a4302c7f039f6c9217d846","url":"assets/js/fba67bfa.df3fd884.js"},{"revision":"1b7c7687d0e744ecf3ef82930b445972","url":"assets/js/fbe53b78.d7ecff38.js"},{"revision":"a299e86efcd781f82ff00362159965a3","url":"assets/js/fc970c7f.b971081d.js"},{"revision":"a6809eda290e6342e7857a6d6fa5fe66","url":"assets/js/fdc7a41e.9ae2f2f1.js"},{"revision":"1bb6a828dd03c412bbb2e68c782bd92c","url":"assets/js/fe11e29a.25cd7915.js"},{"revision":"4f63b0bbdd190b579138c2a53ccb41ef","url":"assets/js/ffe0a0fd.167b1255.js"},{"revision":"1badabb0722f8337119a821e959a93b0","url":"assets/js/main.b2f8deb3.js"},{"revision":"c37628e0cec836ca959956333885a1ec","url":"assets/js/runtime~main.4ad82296.js"},{"revision":"ecfa3b480509183b1868283608277a56","url":"category/-middleware/index.html"},{"revision":"f786e4ded0b5e252790251cabe13b3b9","url":"category/api/index.html"},{"revision":"8dddbc02b7f6aabcf0c6c4a69ead2718","url":"category/extra/index.html"},{"revision":"28141c456a7434ad5d394bfad727c995","url":"category/guide/index.html"},{"revision":"360d44232755f90b63827e29b1b492bc","url":"contrib/casbin/index.html"},{"revision":"e36f9afd68bc33b87045e9b20f7027cf","url":"contrib/fiberi18n/index.html"},{"revision":"3b071980a46848a957d7198b41998e80","url":"contrib/fibernewrelic/index.html"},{"revision":"1cdef1014e96b40598df3b32c9f5ee6a","url":"contrib/fibersentry/index.html"},{"revision":"ee814b7410471c07926648926c1ac57e","url":"contrib/fiberzap/index.html"},{"revision":"70afa2203aee5650f2b3e061f35b8452","url":"contrib/fiberzerolog/index.html"},{"revision":"a335ba99ebe744143990c213b4994448","url":"contrib/index.html"},{"revision":"863725b062c9d669d6be6329a929e8cd","url":"contrib/jwt/index.html"},{"revision":"e036a009ad13824c8c4fa43e64344b77","url":"contrib/opafiber/index.html"},{"revision":"9f956bdc017c4e930319c2c8c864c8f3","url":"contrib/otelfiber/example/index.html"},{"revision":"d772efb5bbbe7c6f5057622a50b73a0d","url":"contrib/otelfiber/index.html"},{"revision":"2e98500960c22c3c4829827ee8b0b02c","url":"contrib/paseto/index.html"},{"revision":"aa4c1bbf12132451db4bb463df5b2028","url":"contrib/swagger/index.html"},{"revision":"b31639c97e44021365595f4d6d504fa9","url":"contrib/websocket/index.html"},{"revision":"b6e1edb92f0995eef46b84dc443d4bf4","url":"ctx/index.html"},{"revision":"d3483b09d55f93c827a1cb73e4165404","url":"extra/benchmarks/index.html"},{"revision":"e4c44910247bb191bf43902f4c7c9c17","url":"extra/faq/index.html"},{"revision":"94da466000246cadaa9725843fe958eb","url":"guide/error-handling/index.html"},{"revision":"2713f65a55971792f96c834e9ddf5ea2","url":"guide/faster-fiber/index.html"},{"revision":"5cd35640af0b5c43b7ccf0aaf20c8572","url":"guide/grouping/index.html"},{"revision":"8c8fdc3427231286fa2dd83cb9b6e59c","url":"guide/hooks/index.html"},{"revision":"827c101879f3b048acd17b162c8dc736","url":"guide/routing/index.html"},{"revision":"196a64eccf60b5fe1a7420b56385a170","url":"guide/templates/index.html"},{"revision":"fb4e0f00539ad2eae2c9e53eab0acc96","url":"guide/validation/index.html"},{"revision":"6364dadd837ce59f497b2bc3c1735d63","url":"index.html"},{"revision":"f42d1aef9f7789a8723990f4843b6f7a","url":"manifest.json"},{"revision":"e61cd2258ab5238606a554843cfa08d1","url":"next/api/app/index.html"},{"revision":"4fa74433b2511646891cad81353888a6","url":"next/api/client/index.html"},{"revision":"1b1aecbd0370f93ae98a81c1ab20d765","url":"next/api/constants/index.html"},{"revision":"9deb7c53f37318fe1aab3f3400ebb090","url":"next/api/ctx/index.html"},{"revision":"8355b35d09a785eede81ef7f0cf86fb8","url":"next/api/fiber/index.html"},{"revision":"79f92a064a2c9c3671162e50b0ec4a24","url":"next/api/log/index.html"},{"revision":"ab517ed84e7f39ab9b7aa4ace7fa8b38","url":"next/api/middleware/adaptor/index.html"},{"revision":"256d81ecc76f0e0f3523407973eb7c20","url":"next/api/middleware/basicauth/index.html"},{"revision":"82731ebef4c4f75a454d6d4cee1f262c","url":"next/api/middleware/cache/index.html"},{"revision":"290af7e01fabc5b8b6a109a8c495596e","url":"next/api/middleware/compress/index.html"},{"revision":"12de1f7ce67802048ba7a71294ee469f","url":"next/api/middleware/cors/index.html"},{"revision":"9b4e2dc0574031b0459c51662ed438ed","url":"next/api/middleware/csrf/index.html"},{"revision":"6659052483ce010c39643f1171c06893","url":"next/api/middleware/earlydata/index.html"},{"revision":"1f2b022ea309528300373feb8c1a7d6c","url":"next/api/middleware/encryptcookie/index.html"},{"revision":"541d7bfba2e0bcfbc4ec20c18de5b208","url":"next/api/middleware/envvar/index.html"},{"revision":"a0324b054b2f9cc1240783096e93fb28","url":"next/api/middleware/etag/index.html"},{"revision":"0183a4e544359d3e34da65faaf9514ce","url":"next/api/middleware/expvar/index.html"},{"revision":"1d12b04c18a123dbb649c7dc07d38d80","url":"next/api/middleware/favicon/index.html"},{"revision":"7c86d175da88b2b654a2602b5975b5ba","url":"next/api/middleware/filesystem/index.html"},{"revision":"9d73edbe36afc916c9bc134e71f6d97a","url":"next/api/middleware/helmet/index.html"},{"revision":"e91fbe239bf2679a594c911a4cc7c340","url":"next/api/middleware/idempotency/index.html"},{"revision":"a9360c2bb52de295499b9b50865b001f","url":"next/api/middleware/keyauth/index.html"},{"revision":"2eb42f77330bc4a247576fc10e1c9721","url":"next/api/middleware/limiter/index.html"},{"revision":"3fb43767ebb0d417ab026b67dd81c139","url":"next/api/middleware/logger/index.html"},{"revision":"209eb3638b803a55351283b57706d928","url":"next/api/middleware/monitor/index.html"},{"revision":"f5ea80c3db2f8d8a3f610a6c96186a69","url":"next/api/middleware/pprof/index.html"},{"revision":"ac992f29c7eb758d7cec3644d3dc1b0b","url":"next/api/middleware/proxy/index.html"},{"revision":"014f0c97fc82f402762765296cc81317","url":"next/api/middleware/recover/index.html"},{"revision":"6f6af1d21c73e75f8eda2af70d3acdec","url":"next/api/middleware/redirect/index.html"},{"revision":"a71ef46adaded04a1e0b439b845734eb","url":"next/api/middleware/requestid/index.html"},{"revision":"1d1ba147e7e6a49e9b851eca4ad095db","url":"next/api/middleware/rewrite/index.html"},{"revision":"1238cb758d57c067b2917b890a6b719d","url":"next/api/middleware/session/index.html"},{"revision":"c82e2cc91c240d1f14c1b6bdf13ec37f","url":"next/api/middleware/skip/index.html"},{"revision":"9488ca3d253220b216d88384267f74c7","url":"next/api/middleware/timeout/index.html"},{"revision":"d5debfe051e92cbab7680a3e7747d811","url":"next/category/-middleware/index.html"},{"revision":"5ea2fdd4885d56b0fd9939ef7257e5fd","url":"next/category/api/index.html"},{"revision":"cd3027141db549fdfd5213a5287207ba","url":"next/category/extra/index.html"},{"revision":"cf32a28e2ce21a3fd31d8ffb29babab0","url":"next/category/guide/index.html"},{"revision":"9511a9bb7be9848d6508358db400bba1","url":"next/extra/benchmarks/index.html"},{"revision":"82f89582adc6a8ed08a08f622875c189","url":"next/extra/faq/index.html"},{"revision":"66642b429a492ed8551598183721aeed","url":"next/guide/error-handling/index.html"},{"revision":"36893a1ce398fb48a1687983f26b2ee8","url":"next/guide/faster-fiber/index.html"},{"revision":"c7013e443c28e2e7b2cc479740c2c5e6","url":"next/guide/grouping/index.html"},{"revision":"dc07e20863ffbbb157d8d1e5bf1c872f","url":"next/guide/hooks/index.html"},{"revision":"4ef2d2dfaee6439d45e1c0800ced212a","url":"next/guide/routing/index.html"},{"revision":"c1d1675221f7ba4f1af0082640430a85","url":"next/guide/templates/index.html"},{"revision":"0471b91f6c8df4435af0862aaa2ffac6","url":"next/guide/validation/index.html"},{"revision":"ff9c3fb892a6b59e2dcac8b47dbb4f11","url":"next/index.html"},{"revision":"1d4d2037b473b05b0d25892443738891","url":"next/partials/routing/route-handlers/index.html"},{"revision":"f079e9f76cbb5fc46b86144966dc3058","url":"next/search-index.json"},{"revision":"231dcae038e66fe7be956cf4309b3382","url":"partials/routing/route-handlers/index.html"},{"revision":"356e031ffc88212f8de1807330821393","url":"routing/index.html"},{"revision":"3df728d6c10a0a3c7e9d92d04e9ff493","url":"search-index.json"},{"revision":"d7ba83dfdcdf10c567dacac51235a6ea","url":"search/index.html"},{"revision":"85e3fd5d074f9e15f45105b7f58acbb6","url":"storage/arangodb/index.html"},{"revision":"0c07319ce5cec1320b614f243b617e67","url":"storage/azureblob/index.html"},{"revision":"c48851db6dff2b3c9d0465d0929c23e8","url":"storage/badger/index.html"},{"revision":"52508111882a4e33599a4a54c172563c","url":"storage/bbolt/index.html"},{"revision":"8e2307fb84cdb76807145c404692c88e","url":"storage/couchbase/index.html"},{"revision":"e206a57b5def49697683674c72390262","url":"storage/dynamodb/index.html"},{"revision":"f24caef02139672357f942b2702f27e2","url":"storage/etcd/index.html"},{"revision":"91765207c7561e8bd1edb515297e53e3","url":"storage/index.html"},{"revision":"2b6430f4c94d9f7edcd87f2f929d0a08","url":"storage/memcache/index.html"},{"revision":"30dc9eb929cd00c5c56af6ed9cba5cd6","url":"storage/memory/index.html"},{"revision":"9e800a6fd3261fc76ef7530934750900","url":"storage/mongodb/index.html"},{"revision":"28e4985804e1203b37496ec27b4942d1","url":"storage/mssql/index.html"},{"revision":"421c10f6adf2ca70a3629f823834562d","url":"storage/mysql/index.html"},{"revision":"8b914432f5020d645d8ed480f8f35671","url":"storage/pebble/index.html"},{"revision":"2e9a572644047b5a5a811433ec4444b0","url":"storage/postgres/index.html"},{"revision":"21c48004ba9179d5dc5f59331124b2b6","url":"storage/redis/index.html"},{"revision":"488c426251d013cbadf777a26aef9e82","url":"storage/ristretto/index.html"},{"revision":"12a8eb09bb124c2450f74657e36bf28c","url":"storage/s3/index.html"},{"revision":"35de386b44a90e6face266f922341a0c","url":"storage/sqlite3/index.html"},{"revision":"35623f4834808177cdcbe197f1b65204","url":"template/ace/index.html"},{"revision":"6251755a0f3bbeac27e2d9f00d3f8ec0","url":"template/amber/index.html"},{"revision":"89afd52c097250531904790c3a5af929","url":"template/django/index.html"},{"revision":"817fd79fff952227afdfe047d8cea654","url":"template/handlebars/index.html"},{"revision":"484409f157ea97bb1539e2f66fac8255","url":"template/html/index.html"},{"revision":"6e7c79f6eb9a2cac2ee11802652af573","url":"template/html/TEMPLATES_CHEATSHEET/index.html"},{"revision":"9c18138ffc4ef500e544f2639958742f","url":"template/index.html"},{"revision":"216340daca7c93d01f0dd7b6828c0cbe","url":"template/jet/index.html"},{"revision":"7c5ed0451a7d2ec72fca45a074787404","url":"template/mustache/index.html"},{"revision":"08194d1ba9a250131b94ccfe737e545b","url":"template/pug/index.html"},{"revision":"360a9244da83ff2923ee6f56f6349899","url":"template/slim/index.html"},{"revision":"8084f2f83a2f477735ed11e2bf0e8213","url":"v/1.x/api/app/index.html"},{"revision":"08b749d0b0d95853310eb8d8cb6106d8","url":"v/1.x/api/ctx/index.html"},{"revision":"b785b5746370eebb99f2ee0869bd7c1a","url":"v/1.x/api/middleware/index.html"},{"revision":"ea032e7aa0080b3a208b1f36dd4b3e42","url":"v/1.x/category/api/index.html"},{"revision":"05f4a343184e6860b0ff5ee3d300a985","url":"v/1.x/category/guide/index.html"},{"revision":"43020c9060b711302b75140744628b1b","url":"v/1.x/category/misc/index.html"},{"revision":"6ed7cc0b075f329589b4401d334837af","url":"v/1.x/guide/error-handling/index.html"},{"revision":"36bb8767aaf25e55f7243dfbce1f06d1","url":"v/1.x/guide/grouping/index.html"},{"revision":"270595eab09ebe6d8ea33a90976c9797","url":"v/1.x/guide/routing/index.html"},{"revision":"46f9f665213c2a17baa88d4fb42bad58","url":"v/1.x/guide/templates/index.html"},{"revision":"a87db992f4d13bf4aa792129f43a42d9","url":"v/1.x/guide/validating/index.html"},{"revision":"4d5bf161ff11ab65805a05e165db85c0","url":"v/1.x/index.html"},{"revision":"060cd4ea1beb6b3a8224a6e8b6692d10","url":"v/1.x/misc/benchmarks/index.html"},{"revision":"27fe56b7b2ab21f8d3e02c0e09958cef","url":"v/1.x/misc/faq/index.html"},{"revision":"b42788731749596fa043f3b764689aa2","url":"v1.x/api/app/index.html"},{"revision":"a858967298e65df3c834a0598b7b75a4","url":"v1.x/api/ctx/index.html"},{"revision":"cb018f509d60638560ba90b93d9cb7c9","url":"v1.x/api/middleware/index.html"},{"revision":"fe8d7cc18bc4d0b3555edb5c5ba0f26b","url":"v1.x/category/api/index.html"},{"revision":"02ac33775284b8b78751338a000f2130","url":"v1.x/category/guide/index.html"},{"revision":"9ac1c96a5340cd85564dbe4b600bd707","url":"v1.x/category/misc/index.html"},{"revision":"1b6cb0b1500121871c13dc9344fadb7d","url":"v1.x/guide/error-handling/index.html"},{"revision":"8c23fdfd15493f359190d6e763cff85c","url":"v1.x/guide/grouping/index.html"},{"revision":"e1bc18949d86b391cdebb5bff69d9bdd","url":"v1.x/guide/routing/index.html"},{"revision":"a9daa8a734abfd9aeef2ef8ec34b440d","url":"v1.x/guide/templates/index.html"},{"revision":"d0d2e81d8078330ce1675b7a8b45880e","url":"v1.x/guide/validating/index.html"},{"revision":"ebd78d78b02a0a2f328e6e869491cf20","url":"v1.x/index.html"},{"revision":"4312ac0ddfefb79e7aba4782cd85927b","url":"v1.x/misc/benchmarks/index.html"},{"revision":"9e8e5f677f2f69f381f69f01ba834c2b","url":"v1.x/misc/faq/index.html"},{"revision":"d8af2825db600f1ac696d76e2debd8ef","url":"v1.x/search-index.json"},{"revision":"a2d0b99576a1a51f46d2ee84ec167336","url":"assets/images/benchmark_alloc-dec96faa96e07bcec84f40a4dfc8d187.png"},{"revision":"a7a3e37e6499fcf3fa9d793fd24339b9","url":"assets/images/benchmark_latency-b67a470cf1b261c3092b80cbf42ef16b.png"},{"revision":"c5b05974efbe649f1fe9fcbf15a8ff82","url":"assets/images/benchmark-18e23fcf42afc7f5e12ea23aceb27885.png"},{"revision":"2cdc5220f6027f0106431ed9756ef0ff","url":"assets/images/benchmark-pipeline-b49cbb1db36293acdfb0e6c96d844e1a.png"},{"revision":"1276aea996275055bfbb406a62170931","url":"assets/images/concurrency_alloc-6f2d485576803f7de2fe0a1deca21a09.png"},{"revision":"56065bebf88e6d317d32fa056044ab49","url":"assets/images/concurrency_latency-5a223848a8bee8df21cc02451f0db2b6.png"},{"revision":"c16f8be0910b1d55e73abb3cf14fcc81","url":"assets/images/concurrency-1307e1d23c01a561a4b2a0f5bdd7e1bc.png"},{"revision":"52e02024a0fc9efdeb174fbd2cb5eaa8","url":"assets/images/concurrency-pipeline-b0d3c211d9c7cb5474fd191223a41241.png"},{"revision":"f8a5f57ca71eb1e0f38e676552ba8a0b","url":"assets/images/data_updates_express-2f55d1b0975ec391d29d823b48faf617.png"},{"revision":"ef41ee04899eb8d1a4a34acb4d7fc20a","url":"assets/images/data_updates-3be85c418d6971091854c5086af9ed10.png"},{"revision":"716cadd67372190364a5f07efbb477c2","url":"assets/images/graph-afbd400b1c3e1c6f137dae3cfc1890ce.svg"},{"revision":"7a707deb897d8b72d098d0ee46d3b44d","url":"assets/images/json_express-aa631b2de86808970aa4bb7c9c9d3edf.png"},{"revision":"0b57d54569e518d2112a0a515042ea63","url":"assets/images/json-62868f61b34e3790f3a8b3b52b1a3a3b.png"},{"revision":"316f574189fa0067fb53b53d020b193a","url":"assets/images/multiple_queries_express-ec4dc8013e85dc2a2fa4f5eeb55ce8dd.png"},{"revision":"b3beb07717c41c5e0f7561ae6c479fbf","url":"assets/images/multiple_queries-2c2e81674208b90b9aeb1cb791a3f0dc.png"},{"revision":"480e9b557cc822c532a998a2ed724bfc","url":"assets/images/plaintext_express-ef6522843412bb5b14b3c6b6a4f032de.png"},{"revision":"45bd9af55fba9dc062200831ac57c5e6","url":"assets/images/plaintext-e25d187f782d18fdd35b84e3d7c625eb.png"},{"revision":"5b4ee8112e04d79df5a0aa39acca791b","url":"assets/images/single_query_express-d8e41422b4f5c0a9496272e4a66a97c4.png"},{"revision":"8a5d82762f28eca9a722e75f3f12cff8","url":"assets/images/single_query-4f7782d3c3ff91e92ac27e382b09f6ac.png"},{"revision":"79a9ef885732dee2637157a4762faf7e","url":"assets/images/support-discord-baf5f38231088813dfbc3ccdc6966634.png"},{"revision":"a2d0b99576a1a51f46d2ee84ec167336","url":"img/benchmark_alloc.png"},{"revision":"a7a3e37e6499fcf3fa9d793fd24339b9","url":"img/benchmark_latency.png"},{"revision":"2cdc5220f6027f0106431ed9756ef0ff","url":"img/benchmark-pipeline.png"},{"revision":"c5b05974efbe649f1fe9fcbf15a8ff82","url":"img/benchmark.png"},{"revision":"1276aea996275055bfbb406a62170931","url":"img/concurrency_alloc.png"},{"revision":"56065bebf88e6d317d32fa056044ab49","url":"img/concurrency_latency.png"},{"revision":"52e02024a0fc9efdeb174fbd2cb5eaa8","url":"img/concurrency-pipeline.png"},{"revision":"c16f8be0910b1d55e73abb3cf14fcc81","url":"img/concurrency.png"},{"revision":"f8a5f57ca71eb1e0f38e676552ba8a0b","url":"img/data_updates_express.png"},{"revision":"ef41ee04899eb8d1a4a34acb4d7fc20a","url":"img/data_updates.png"},{"revision":"3b4420315b7baefee56d433e4c78f268","url":"img/favicon.png"},{"revision":"716cadd67372190364a5f07efbb477c2","url":"img/graph.svg"},{"revision":"354ea4a4bcaad920949e253d33683869","url":"img/icons/icon-192x192.png"},{"revision":"4039790fa05a5dc7e9259485b4324433","url":"img/icons/icon-256x256.png"},{"revision":"93b99bdaaad38831b46a296dfeab4863","url":"img/icons/icon-384x384.png"},{"revision":"096c82692efe3ec986ab2b4fc5d60aea","url":"img/icons/icon-512x512.png"},{"revision":"7a707deb897d8b72d098d0ee46d3b44d","url":"img/json_express.png"},{"revision":"0b57d54569e518d2112a0a515042ea63","url":"img/json.png"},{"revision":"171b53337ba05d4e62332e230f3c212b","url":"img/logo-dark.svg"},{"revision":"e2c2dc9b6b5f44183247f7c48d65ccef","url":"img/logo.svg"},{"revision":"316f574189fa0067fb53b53d020b193a","url":"img/multiple_queries_express.png"},{"revision":"b3beb07717c41c5e0f7561ae6c479fbf","url":"img/multiple_queries.png"},{"revision":"480e9b557cc822c532a998a2ed724bfc","url":"img/plaintext_express.png"},{"revision":"45bd9af55fba9dc062200831ac57c5e6","url":"img/plaintext.png"},{"revision":"5b4ee8112e04d79df5a0aa39acca791b","url":"img/single_query_express.png"},{"revision":"8a5d82762f28eca9a722e75f3f12cff8","url":"img/single_query.png"},{"revision":"79a9ef885732dee2637157a4762faf7e","url":"img/support-discord.png"}],s=new R({fallbackToNetwork:!0});e.offlineMode&&(s.addToCacheList(t),e.debug&&console.log("[Docusaurus-PWA][SW]: addToCacheList",{precacheManifest:t})),await async function(e){}(),self.addEventListener("install",(t=>{e.debug&&console.log("[Docusaurus-PWA][SW]: install event",{event:t}),t.waitUntil(s.install(t))})),self.addEventListener("activate",(t=>{e.debug&&console.log("[Docusaurus-PWA][SW]: activate event",{event:t}),t.waitUntil(s.activate(t))})),self.addEventListener("fetch",(async t=>{if(e.offlineMode){const a=t.request.url,n=function(e){const t=new URL(e,self.location.href);return t.origin!==self.location.origin?[]:(t.search="",t.hash="",[t.href,`${t.href}${t.pathname.endsWith("/")?"":"/"}index.html`])}(a);for(const i of n){const r=s.getCacheKeyForURL(i);if(r){const s=caches.match(r);e.debug&&console.log("[Docusaurus-PWA][SW]: serving cached asset",{requestURL:a,possibleURL:i,possibleURLs:n,cacheKey:r,cachedResponse:s}),t.respondWith(s);break}}}})),self.addEventListener("message",(async t=>{e.debug&&console.log("[Docusaurus-PWA][SW]: message event",{event:t});const s=t.data?.type;"SKIP_WAITING"===s&&self.skipWaiting()}))})()})()})(); \ No newline at end of file +(()=>{"use strict";var e={913:()=>{try{self["workbox:core:6.5.3"]&&_()}catch(e){}},977:()=>{try{self["workbox:precaching:6.5.3"]&&_()}catch(e){}},80:()=>{try{self["workbox:routing:6.5.3"]&&_()}catch(e){}},873:()=>{try{self["workbox:strategies:6.5.3"]&&_()}catch(e){}}},t={};function s(a){var n=t[a];if(void 0!==n)return n.exports;var i=t[a]={exports:{}};return e[a](i,i.exports,s),i.exports}(()=>{s(913);const e=(e,...t)=>{let s=e;return t.length>0&&(s+=` :: ${JSON.stringify(t)}`),s};class t extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}const a={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},n=e=>[a.prefix,e,a.suffix].filter((e=>e&&e.length>0)).join("-"),i=e=>e||n(a.precache),r=e=>e||n(a.runtime);function c(e,t){const s=t();return e.waitUntil(s),s}s(977);const o="__WB_REVISION__";function h(e){if(!e)throw new t("add-to-cache-list-unexpected-type",{entry:e});if("string"==typeof e){const t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}const{revision:s,url:a}=e;if(!a)throw new t("add-to-cache-list-unexpected-type",{entry:e});if(!s){const e=new URL(a,location.href);return{cacheKey:e.href,url:e.href}}const n=new URL(a,location.href),i=new URL(a,location.href);return n.searchParams.set(o,s),{cacheKey:n.href,url:i.href}}class l{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if("install"===e.type&&t&&t.originalRequest&&t.originalRequest instanceof Request){const e=t.originalRequest.url;s?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return s}}}class u{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{const s=(null==t?void 0:t.cacheKey)||this._precacheController.getCacheKeyForURL(e.url);return s?new Request(s,{headers:e.headers}):e},this._precacheController=e}}let f;async function d(e,s){let a=null;if(e.url){a=new URL(e.url).origin}if(a!==self.location.origin)throw new t("cross-origin-copy-response",{origin:a});const n=e.clone(),i={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},r=s?s(i):i,c=function(){if(void 0===f){const e=new Response("");if("body"in e)try{new Response(e.body),f=!0}catch(e){f=!1}f=!1}return f}()?n.body:await n.blob();return new Response(c,r)}function p(e,t){const s=new URL(e);for(const e of t)s.searchParams.delete(e);return s.href}class g{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const y=new Set;s(873);function w(e){return"string"==typeof e?new Request(e):e}class _{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new g,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:s}=this;let a=w(e);if("navigate"===a.mode&&s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const n=this.hasCallback("fetchDidFail")?a.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))a=await e({request:a.clone(),event:s})}catch(e){if(e instanceof Error)throw new t("plugin-error-request-will-fetch",{thrownErrorMessage:e.message})}const i=a.clone();try{let e;e=await fetch(a,"navigate"===a.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:s,request:i,response:e});return e}catch(e){throw n&&await this.runCallbacks("fetchDidFail",{error:e,event:s,originalRequest:n.clone(),request:i.clone()}),e}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=w(e);let s;const{cacheName:a,matchOptions:n}=this._strategy,i=await this.getCacheKey(t,"read"),r=Object.assign(Object.assign({},n),{cacheName:a});s=await caches.match(i,r);for(const e of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await e({cacheName:a,matchOptions:n,cachedResponse:s,request:i,event:this.event})||void 0;return s}async cachePut(e,s){const a=w(e);var n;await(n=0,new Promise((e=>setTimeout(e,n))));const i=await this.getCacheKey(a,"write");if(!s)throw new t("cache-put-with-no-response",{url:(r=i.url,new URL(String(r),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var r;const c=await this._ensureResponseSafeToCache(s);if(!c)return!1;const{cacheName:o,matchOptions:h}=this._strategy,l=await self.caches.open(o),u=this.hasCallback("cacheDidUpdate"),f=u?await async function(e,t,s,a){const n=p(t.url,s);if(t.url===n)return e.match(t,a);const i=Object.assign(Object.assign({},a),{ignoreSearch:!0}),r=await e.keys(t,i);for(const t of r)if(n===p(t.url,s))return e.match(t,a)}(l,i.clone(),["__WB_REVISION__"],h):null;try{await l.put(i,u?c.clone():c)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await async function(){for(const e of y)await e()}(),e}for(const e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:o,oldResponse:f,newResponse:c.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){const s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let a=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))a=w(await e({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[s]=a}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"==typeof t[e]){const s=this._pluginStateMap.get(t),a=a=>{const n=Object.assign(Object.assign({},a),{state:s});return t[e](n)};yield a}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&200!==t.status&&(t=void 0),t}}class v{constructor(e={}){this.cacheName=r(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s="string"==typeof e.request?new Request(e.request):e.request,a="params"in e?e.params:void 0,n=new _(this,{event:t,request:s,params:a}),i=this._getResponse(n,s,t);return[i,this._awaitComplete(i,n,s,t)]}async _getResponse(e,s,a){let n;await e.runCallbacks("handlerWillStart",{event:a,request:s});try{if(n=await this._handle(s,e),!n||"error"===n.type)throw new t("no-response",{url:s.url})}catch(t){if(t instanceof Error)for(const i of e.iterateCallbacks("handlerDidError"))if(n=await i({error:t,event:a,request:s}),n)break;if(!n)throw t}for(const t of e.iterateCallbacks("handlerWillRespond"))n=await t({event:a,request:s,response:n});return n}async _awaitComplete(e,t,s,a){let n,i;try{n=await e}catch(i){}try{await t.runCallbacks("handlerDidRespond",{event:a,request:s,response:n}),await t.doneWaiting()}catch(e){e instanceof Error&&(i=e)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:s,response:n,error:i}),t.destroy(),i)throw i}}class m extends v{constructor(e={}){e.cacheName=i(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(m.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const s=await t.cacheMatch(e);return s||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,s){let a;const n=s.params||{};if(!this._fallbackToNetwork)throw new t("missing-precache-entry",{cacheName:this.cacheName,url:e.url});{0;const t=n.integrity,i=e.integrity,r=!i||i===t;if(a=await s.fetch(new Request(e,{integrity:"no-cors"!==e.mode?i||t:void 0})),t&&r&&"no-cors"!==e.mode){this._useDefaultCacheabilityPluginIfNeeded();await s.cachePut(e,a.clone());0}}return a}async _handleInstall(e,s){this._useDefaultCacheabilityPluginIfNeeded();const a=await s.fetch(e);if(!await s.cachePut(e,a.clone()))throw new t("bad-precaching-response",{url:e.url,status:a.status});return a}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,a]of this.plugins.entries())a!==m.copyRedirectedCacheableResponsesPlugin&&(a===m.defaultPrecacheCacheabilityPlugin&&(e=s),a.cacheWillUpdate&&t++);0===t?this.plugins.push(m.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}m.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e},m.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:e})=>e.redirected?await d(e):e};class R{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new m({cacheName:i(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const s=[];for(const a of e){"string"==typeof a?s.push(a):a&&void 0===a.revision&&s.push(a.url);const{cacheKey:e,url:n}=h(a),i="string"!=typeof a&&a.revision?"reload":"default";if(this._urlsToCacheKeys.has(n)&&this._urlsToCacheKeys.get(n)!==e)throw new t("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(n),secondEntry:e});if("string"!=typeof a&&a.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==a.integrity)throw new t("add-to-cache-list-conflicting-integrities",{url:n});this._cacheKeysToIntegrities.set(e,a.integrity)}if(this._urlsToCacheKeys.set(n,e),this._urlsToCacheModes.set(n,i),s.length>0){const e=`Workbox is precaching URLs without revision info: ${s.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return c(e,(async()=>{const t=new l;this.strategy.plugins.push(t);for(const[t,s]of this._urlsToCacheKeys){const a=this._cacheKeysToIntegrities.get(s),n=this._urlsToCacheModes.get(t),i=new Request(t,{integrity:a,cache:n,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:i,event:e}))}const{updatedURLs:s,notUpdatedURLs:a}=t;return{updatedURLs:s,notUpdatedURLs:a}}))}activate(e){return c(e,(async()=>{const e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),a=[];for(const n of t)s.has(n.url)||(await e.delete(n),a.push(n.url));return{deletedURLs:a}}))}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(e){const s=this.getCacheKeyForURL(e);if(!s)throw new t("non-precached-url",{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:s},t.params),this.strategy.handle(t))}}s(80);(async()=>{const e=function(){const e=JSON.parse(new URLSearchParams(self.location.search).get("params"));return e.debug&&console.log("[Docusaurus-PWA][SW]: Service Worker params:",e),e}(),t=[{"revision":"7ecc36bd42522fd342085adf2802c97e","url":"-middleware/index.html"},{"revision":"290748ef0f09ed9b932c5db9fe29b55d","url":"404.html"},{"revision":"14b0dbada425934d5c2449a5190a4119","url":"api/app/index.html"},{"revision":"8578b7cad29378de3fda0d3c80d9b1c2","url":"api/client/index.html"},{"revision":"b0c29d79362ee14ef3d6a889dc80c03f","url":"api/constants/index.html"},{"revision":"572683e9cd2eb9b37cd3ef9d5f4315c1","url":"api/ctx/index.html"},{"revision":"d425be09320b5d5a3063bf3c8ae83608","url":"api/fiber/index.html"},{"revision":"eff22248879128ed53b366ac13e3db2c","url":"api/middleware/adaptor/index.html"},{"revision":"7bc0e4cf75e33860a00d03d8d23d897a","url":"api/middleware/basicauth/index.html"},{"revision":"8e4c14f495029d745001507d0ab79f61","url":"api/middleware/cache/index.html"},{"revision":"dac4bd8fb0fbca643ee1b7b18cf6f796","url":"api/middleware/compress/index.html"},{"revision":"984fc8f99dfb4e0298fe9f703c8ef333","url":"api/middleware/cors/index.html"},{"revision":"8330d6950c231a24c9bff3159bf0fddc","url":"api/middleware/csrf/index.html"},{"revision":"a7910e3427ae02b269232aca3ec484ee","url":"api/middleware/earlydata/index.html"},{"revision":"b217cd98d4fb723633d4386e6bf2720f","url":"api/middleware/encryptcookie/index.html"},{"revision":"fd7d0e9dd8f73a93b911348bde10820c","url":"api/middleware/envvar/index.html"},{"revision":"5acd3b26f6064479864a887184c7b99b","url":"api/middleware/etag/index.html"},{"revision":"bd53839cb04348a9eafd333cfce896d2","url":"api/middleware/expvar/index.html"},{"revision":"6f138d47bbee8ef877f918d254ee114d","url":"api/middleware/favicon/index.html"},{"revision":"3101027fcf6f9ed820d17aef9349c9ea","url":"api/middleware/filesystem/index.html"},{"revision":"4180ac2b1f50f6bc3ce5ada28be378e6","url":"api/middleware/helmet/index.html"},{"revision":"33e98b92d6225f7630e5be8958c40e5a","url":"api/middleware/idempotency/index.html"},{"revision":"e21b77224da847da5593d3018b8f0455","url":"api/middleware/keyauth/index.html"},{"revision":"4c51235a598c226d922d650c921387de","url":"api/middleware/limiter/index.html"},{"revision":"9709e67f408ad8e04efd9458438910fd","url":"api/middleware/logger/index.html"},{"revision":"13c2950f4ab3c3ba93ca0bc799636e7b","url":"api/middleware/monitor/index.html"},{"revision":"b6c409a9e5b9f0574063e824a9be7003","url":"api/middleware/pprof/index.html"},{"revision":"bff6a0866afda285237517d727595311","url":"api/middleware/proxy/index.html"},{"revision":"e08f1c47737acab3040ad2e59850ef7c","url":"api/middleware/recover/index.html"},{"revision":"92cdc68aab5856d525fd647be934701e","url":"api/middleware/redirect/index.html"},{"revision":"1a743b0fa26fedd9121118c7faffc0fb","url":"api/middleware/requestid/index.html"},{"revision":"36b5656d6ea5c91c110ca192517bf621","url":"api/middleware/rewrite/index.html"},{"revision":"4227fa404f921273ec9f5b2de39a7e68","url":"api/middleware/session/index.html"},{"revision":"0d7b13f20108e1b6a6361d753851c3a9","url":"api/middleware/skip/index.html"},{"revision":"6fd4e61d07a9318cc274ffb7f456d459","url":"api/middleware/timeout/index.html"},{"revision":"ec59863066ac9b918477d77dbb0da288","url":"assets/css/styles.f3bed87e.css"},{"revision":"bd4c051d95b8750da52095908742b743","url":"assets/js/044897a3.5da13a11.js"},{"revision":"c0eb8da1030225d6ec58c2764b1910c1","url":"assets/js/04b03e77.84d07949.js"},{"revision":"3179c70f49277664cd62d9024d54d70c","url":"assets/js/054c93da.3f06e20c.js"},{"revision":"4ad4004d358c66a72fb69a730ae0ac93","url":"assets/js/05a04cc8.f70d38fb.js"},{"revision":"1b89a4d2103a1f36504acce60ac8d731","url":"assets/js/09303bcf.b2f81c78.js"},{"revision":"95fd1c685a4967e5ae8a409d47770aad","url":"assets/js/0c35ae3f.d4c5f429.js"},{"revision":"7d9186d95e5a5a53916f11fc414d0f76","url":"assets/js/0f17a9fe.e120838e.js"},{"revision":"e130e2350907568aff3e97936954a70c","url":"assets/js/0faeb6cb.ac01fd04.js"},{"revision":"56a1f756ca48e1a73baa60c9c1b80b1c","url":"assets/js/0fb7e018.4a6f79bc.js"},{"revision":"23e66ee7deef3cb9cbc854889ee63afc","url":"assets/js/105f1242.519a9758.js"},{"revision":"ef64b2323f8400bb37bb6e7575ab0d97","url":"assets/js/11ab8220.681eb402.js"},{"revision":"857b8acae5bd3977f43462ff075bcc8a","url":"assets/js/14a7e971.424e0cb1.js"},{"revision":"6063cdf72863b3e29b087ca446d32864","url":"assets/js/14eb3368.ebc01a7b.js"},{"revision":"1773106414cef1120ff2992e01d1c05a","url":"assets/js/15eed0c8.50da9fc6.js"},{"revision":"85b94e371def82a408e0fc2ebc28f74c","url":"assets/js/17896441.462cdaa3.js"},{"revision":"3bc826d3a1b29676215644864e5b9478","url":"assets/js/187263b9.595d2ed3.js"},{"revision":"60746995dfd1a79eb8f4ef1e6424a8f3","url":"assets/js/19323918.ba7383aa.js"},{"revision":"3e72bd1874c7d656b63ee3546a7849e6","url":"assets/js/19e7c5f6.c7165d21.js"},{"revision":"b99c42a19fc1fc1c8de47af47f814c8e","url":"assets/js/1a4e3797.6d445047.js"},{"revision":"91148527fd7338882bfa8f28ef7f34f0","url":"assets/js/1a56c576.8f599ce2.js"},{"revision":"4a81857526af0a3fc6a0bb9120f7783c","url":"assets/js/1a6451b0.118a75c8.js"},{"revision":"fe22fe5dd299bcbd5061c62d822e99d7","url":"assets/js/1af20617.98ba9a9e.js"},{"revision":"001cd45718cf9bf4a2495ef4efab89bf","url":"assets/js/1b545511.c42c72dd.js"},{"revision":"e43d77ecf39a48a654feace90aae0aab","url":"assets/js/1be78505.c3eac7b7.js"},{"revision":"9d1414cb25064997cb4ac363a381fc44","url":"assets/js/1ed4c90d.31934694.js"},{"revision":"399323eaad452bdbe92744806becbb64","url":"assets/js/20b2a36a.a52134d3.js"},{"revision":"1e6a4efed3cfa9dfb1785b499108b494","url":"assets/js/20e81fa7.a687e623.js"},{"revision":"b1176fe80cf7af833bcff04454c48206","url":"assets/js/2155a006.df277a0b.js"},{"revision":"91a62dd4e0904456961f228cb1942ff4","url":"assets/js/21cbcfa4.72a42134.js"},{"revision":"21f65e983e654a0b6825c9e4338f52e5","url":"assets/js/230.06e9bff8.js"},{"revision":"8278edc76fc3c4a2be3323fc17dc643c","url":"assets/js/247783bb.b20f80cc.js"},{"revision":"5eec4a3ad75814528bef644a5a6ee3f5","url":"assets/js/24847ea2.02899d9b.js"},{"revision":"e663cd328201bc23414a044af91aedf1","url":"assets/js/26257c43.f8727559.js"},{"revision":"405b89962c0c9bdacf140a8e6f146fda","url":"assets/js/2804f106.52109486.js"},{"revision":"0a53e5463393050a2229d6d6dcb3cd59","url":"assets/js/2930693d.c0846eb0.js"},{"revision":"410d7694c138b6ba7653fc526c95b310","url":"assets/js/29b92cdb.c97a76be.js"},{"revision":"ecd9d165699be6230b3372d89e35510e","url":"assets/js/2a83b683.fd6ba795.js"},{"revision":"43831cbcdc20838f33560e4bcca55d84","url":"assets/js/2ab216cb.621467ae.js"},{"revision":"42cb0b15b1e93548508fcbb36db8f5ce","url":"assets/js/2b43107e.a1518b5f.js"},{"revision":"79f493574d7c75df17931142a326c9e0","url":"assets/js/2bc33efd.41c78bdf.js"},{"revision":"5d17cbba0310b61a68dd0b15fc4dcf60","url":"assets/js/302308c6.a5fba1d1.js"},{"revision":"b4b8d25233aebfa336628e26dea8f468","url":"assets/js/30f87c66.0e6ddfe1.js"},{"revision":"9b78edad2dee15a5c483fcc7a4316719","url":"assets/js/3109af4c.d3491b4f.js"},{"revision":"9aa01bbcc7c1c62a9c5fe4e6ce8ffc70","url":"assets/js/32e68b93.70ccf828.js"},{"revision":"1fe7200c032b0615c938ccb7bae363dc","url":"assets/js/354823c1.ce8c9cbc.js"},{"revision":"2903d1e9d5fbe59b336b6fb8b6b93680","url":"assets/js/354efaa7.1c1174f4.js"},{"revision":"8e3b8f167516f6567f6ff34522196d4d","url":"assets/js/3719c62c.693effe3.js"},{"revision":"dec11d060aa5b1bb94f24bbb20a17edd","url":"assets/js/3724ddc1.77a264bb.js"},{"revision":"f0e39f96a809ab9c3d1d1889dd414d7e","url":"assets/js/37662bdc.cbc38765.js"},{"revision":"5f918d32b777f472fd591dd0d934cc13","url":"assets/js/3a6391d4.961660fa.js"},{"revision":"8035415899b2f6bcd2abd9395b70c7b8","url":"assets/js/3b70e89f.9d433cd0.js"},{"revision":"36233f7366dd70ee855c5a3b1121b253","url":"assets/js/3d13e7fb.7ec7128b.js"},{"revision":"d13a0b82e439e1243fdf336a7c1e84cb","url":"assets/js/4129286c.6024df0a.js"},{"revision":"af7279d0f071cec96d34d889c52d2e14","url":"assets/js/41a4aef8.be23b4a0.js"},{"revision":"e4fde4d8c80f8cb13af686416b24969d","url":"assets/js/48c6cc07.c9ca9d61.js"},{"revision":"598c78f8cac1a8020512ca77bb55893a","url":"assets/js/4972.16dfd4ea.js"},{"revision":"c0559914ee2ff4b2e78d681f807994c4","url":"assets/js/4a6d765c.d589ba59.js"},{"revision":"3cef2973332628da3c0e9cf5c692b535","url":"assets/js/4b0c4837.a6151aed.js"},{"revision":"94072a28e828dd263b8bb48ef1e7fabb","url":"assets/js/4b47f78b.fb413b0e.js"},{"revision":"8a586a383e4e62a3235a9d462a349eb7","url":"assets/js/5131.8aadd48c.js"},{"revision":"e104f9be27244766f23d2a5fc990b727","url":"assets/js/5229ce75.c9b940d7.js"},{"revision":"0933a70374cdd0535785868363a5598d","url":"assets/js/5283.0af36832.js"},{"revision":"1db7139270887fccf88a1866597bed62","url":"assets/js/5525.999d509e.js"},{"revision":"1c6958529ffc4089376627311ca73180","url":"assets/js/56cc377d.8294ff9d.js"},{"revision":"ce4723ac9266a457c486a80fbc09e34f","url":"assets/js/5aebd6e8.671c1cbc.js"},{"revision":"021471bdf4e57fa443bbd48758f2ce8f","url":"assets/js/5f49a855.f1ee6a8c.js"},{"revision":"3d8722a08c29144de386c88c6d3948be","url":"assets/js/61265387.ab5c3ca2.js"},{"revision":"e9f1b777e9c4309263aec9edc71f332b","url":"assets/js/615fd3de.9c409b23.js"},{"revision":"affbb5db10681c5b22e2b99cac4e008c","url":"assets/js/61f05610.eb4d18cb.js"},{"revision":"31065a46960829505f7256a713d62f45","url":"assets/js/65a2e3ff.8cb8b5c4.js"},{"revision":"9c4248735869f0b773c714ab8ce3ae59","url":"assets/js/683903ba.ec7e6079.js"},{"revision":"1ef9c37ac7d1db6d46d17da7a1c6e271","url":"assets/js/696b59c8.060be796.js"},{"revision":"7a74ebbb7767196cd3abf30775e3ffbc","url":"assets/js/696e1f87.2b083586.js"},{"revision":"a72744e3ad1a348f42a1805abb383b66","url":"assets/js/697acd1f.8262f63d.js"},{"revision":"fa0b5b0f87d98b7407ef28d081218c16","url":"assets/js/6a9ae4f0.abceec18.js"},{"revision":"78a223426a12736a7cddc575a6bf9e69","url":"assets/js/6b69f1ff.074e951f.js"},{"revision":"dce1cadd5e459dd0db6c44f12ffbddf0","url":"assets/js/6d7ca528.8ab0503d.js"},{"revision":"27bff910b0dca8256b63c992db4bed64","url":"assets/js/6e0f0a87.7cb9fbab.js"},{"revision":"b655f7565a28f11504e94b4d49fe1ec0","url":"assets/js/6f9f0f49.5a84496e.js"},{"revision":"25268b0d9ccc27f76e6d45c5b0b908c9","url":"assets/js/70908c7a.6ab84482.js"},{"revision":"c6c0653684dec30a7ae4cad8b53b4a42","url":"assets/js/70bddfb7.ef5b69d8.js"},{"revision":"7cc5230f8f42c39505c1eae82d3e2971","url":"assets/js/7307607e.c91da44a.js"},{"revision":"e554f9bbbfd6564acbaf56a42cfd2de6","url":"assets/js/73b0bf71.b20d00b7.js"},{"revision":"91c0282f7c0edf50621677bc9ad62345","url":"assets/js/7449d9ed.8927871d.js"},{"revision":"96c40027a49d54b5a6a2d378f8b5a5a7","url":"assets/js/7506f0f5.df2e65e9.js"},{"revision":"9cfc73a9ce75ade2770c6eae0e83fa67","url":"assets/js/75542ae5.b4790f88.js"},{"revision":"d59b44579a8770cb6b3f98fa87e61b91","url":"assets/js/78d978a7.52e1e357.js"},{"revision":"03086022930567e88ead424f3dcc25c5","url":"assets/js/7bb2c503.844cbef5.js"},{"revision":"4fe42c7b5386c624f3a09b572ce5fac5","url":"assets/js/7d5a5238.04968e2c.js"},{"revision":"a0d82ed698c79cb977367d13cdb52f8b","url":"assets/js/7d7ae710.c0f1b419.js"},{"revision":"4a0ad55b093e2dd02730c95885b9fd82","url":"assets/js/7e307fec.f9da0633.js"},{"revision":"c008c0245ae5125ad7c0b72400ce3dbd","url":"assets/js/7e6c0027.983f41fe.js"},{"revision":"3614cc88f332058d1a0e82ce77f09e39","url":"assets/js/8231ac58.86f07421.js"},{"revision":"2f75350954e9c1fefdae2df276d845b7","url":"assets/js/82a52177.5bdcae65.js"},{"revision":"b85e1f5cf0fbbbd0f26fb82998b39dbb","url":"assets/js/8443.f0fb2769.js"},{"revision":"b679624feb17ed386f16b7aa05135d80","url":"assets/js/8498b8c7.bc49482e.js"},{"revision":"a09806eb904a34935624692fe71b8cae","url":"assets/js/85ea1211.0ef0165f.js"},{"revision":"8f15fa2da16e25032ee8e8c310301d65","url":"assets/js/8613e059.ecc2df38.js"},{"revision":"1a4c1c50e7c2a0c7e16139422e47d9ab","url":"assets/js/89cfd5bc.b8908d7d.js"},{"revision":"577ea37e5ad0cb4d2e47916786f7412f","url":"assets/js/8a0a7bb8.6ece6c3a.js"},{"revision":"76b94b4f942547a06714f5a0f43268b2","url":"assets/js/8ec8555c.d553c476.js"},{"revision":"145f0aca1b17715546f4a0409b7b1b22","url":"assets/js/8ffdbf67.05ebcf2a.js"},{"revision":"c8d14999116350d8a25085cae1f07ddf","url":"assets/js/9150d950.ee863121.js"},{"revision":"2b627c0fa4dee3935e5ff7fb3f4c17d9","url":"assets/js/9169002b.f02a67c7.js"},{"revision":"a1211cf5a6d622fa1e090e4e5ae385e4","url":"assets/js/9226f6dc.f30749c7.js"},{"revision":"1a3a90bd22788e3b414c065f3aa8ab6d","url":"assets/js/935f2afb.e6ae511e.js"},{"revision":"11550d59d1099e0a6613e48e170973a2","url":"assets/js/96cc6114.3b4ac593.js"},{"revision":"54e5f047233f0e80308922a780d867ec","url":"assets/js/9717e045.0217e75f.js"},{"revision":"45f7e6f41079157676f4606f78f398b7","url":"assets/js/98ce83f7.bfa27ff1.js"},{"revision":"c12d5581278e7e93ec8f8c42884ee32e","url":"assets/js/99c84a64.90813a0c.js"},{"revision":"f732d91bbe847b3b43fc8add80e0006d","url":"assets/js/99d23504.8dcb390c.js"},{"revision":"0c52a57ec9c01ee202b0fca941869e38","url":"assets/js/9a4187db.b187515f.js"},{"revision":"19c39373d6b609f01d4893c175d2e4d0","url":"assets/js/9a57fc4d.32886e70.js"},{"revision":"a97429c79dcc99a6974415752808a921","url":"assets/js/9c153fbf.137ce857.js"},{"revision":"3b0ebdb4034ce3cd7fdac0c479671c20","url":"assets/js/9e834d3b.2a9912df.js"},{"revision":"12d0f47dbf3034a262bafaa0d69c797c","url":"assets/js/a4976c5b.79e3273c.js"},{"revision":"cf0cc78a17a2affd9cdd116406f4a85d","url":"assets/js/a4f7be8a.62e6a2d6.js"},{"revision":"bd218d65ab5eaf1a1b3a41fce4eb5087","url":"assets/js/a56e433f.f7b99126.js"},{"revision":"4c0f53d968232daa790dfd63141bc11b","url":"assets/js/a623b5ef.803ad12f.js"},{"revision":"8b27de48e2fe3af8e89174f8735faac1","url":"assets/js/a6514993.7fc6c021.js"},{"revision":"aed4ee640702dfb4cfaa95303b4f8ade","url":"assets/js/a900ff2e.49512b47.js"},{"revision":"f5f194d896bb209b1704037c3f4711f7","url":"assets/js/a947b58e.5b9f26fc.js"},{"revision":"6148f013c2a3cd9056e35e45f561a657","url":"assets/js/a98ab587.955895af.js"},{"revision":"0cb7160a480ca3f788e06d051e9c6cfe","url":"assets/js/aa5eb267.5bb267a9.js"},{"revision":"79521644fe27b8be129cc793f8725560","url":"assets/js/ab6e749e.22bbbcce.js"},{"revision":"37488ea9e7fe20399bb2f1a20544e873","url":"assets/js/aba14099.1ae5ba76.js"},{"revision":"08149a27e9847139f897a26fc17db6c4","url":"assets/js/adc35084.2d90a470.js"},{"revision":"cf488eb6cce53fe28e2b37ea6092ecd2","url":"assets/js/bafae794.a2992f3f.js"},{"revision":"1b9ec65d7d040844f913633a2844f553","url":"assets/js/bcaa1a93.1ab5c2b6.js"},{"revision":"e2f8ba0e12a1143fa9b93060ddb55aa0","url":"assets/js/bd4688e3.261ff09a.js"},{"revision":"1048d5dd3c4a0e123de14deea0394ef9","url":"assets/js/bd6d307b.ac09a33d.js"},{"revision":"8b95c48a9a42c1b78f7229eebdbbd209","url":"assets/js/bddcf50a.51c4d29d.js"},{"revision":"7b3025cb2134548b2954331afb7f8aa4","url":"assets/js/c6147012.c41ab065.js"},{"revision":"91ae8d267ac6a88053b18de3ac99f5f6","url":"assets/js/c664382c.0d016f08.js"},{"revision":"207f233dcc887a3193d55e224d4451a6","url":"assets/js/c8fbcedd.aa22554e.js"},{"revision":"0252755e5981c316ebd1d0e227ea8539","url":"assets/js/c921e1c5.e1af2cf2.js"},{"revision":"f16778166a4bab6b51c92086473db786","url":"assets/js/cb1fa44a.c4747412.js"},{"revision":"9e16c1c14da9fdf93cd61020819f3cb5","url":"assets/js/cd01922d.07a3c2ca.js"},{"revision":"bdb1ff2d257d0069028b6136c05949d3","url":"assets/js/ceb3afff.a0fb9eb2.js"},{"revision":"0d7ecf368c874889fe65cfd97bc141e2","url":"assets/js/cf63ef8e.f3b18c7a.js"},{"revision":"2b276d1f6e972782823d8a73a6b9b86a","url":"assets/js/d13e591d.e594afae.js"},{"revision":"0d82bb3a319843b7ff48f86e9a0b9ee6","url":"assets/js/d32d6269.1e9d1c81.js"},{"revision":"5b51ed0385b4a15e72eb8529cdb340af","url":"assets/js/d3f7bfd6.9ad928f0.js"},{"revision":"142ab635e22664b468b1298b7aa1ef1e","url":"assets/js/d56ded4a.cc4917eb.js"},{"revision":"9c8ee98e6f409d9f9501823597edf697","url":"assets/js/d8d851c4.9fc5e059.js"},{"revision":"e301710bf018df3eb4120921d7fd9a1a","url":"assets/js/d9c007a6.73ddab58.js"},{"revision":"0655e71e6f672cee27197738f82541a5","url":"assets/js/dc18e77a.5e9ea3cd.js"},{"revision":"ce1ff39fbd2c3ec32b81ade909cae516","url":"assets/js/dd6e99a2.4158a90b.js"},{"revision":"f5fac10007c2a6b213d07c1404bf1707","url":"assets/js/def1082f.71f916d0.js"},{"revision":"9fd8559fc53fc5ed45ee6b0ebddc83cf","url":"assets/js/df7efcc1.24bbe6e1.js"},{"revision":"c93383008a5d03e18db5057654fe6102","url":"assets/js/dff2806d.f40c2d00.js"},{"revision":"e6527298222fb8ecd8ecd0ff411bcb92","url":"assets/js/e02ba15b.df073f5f.js"},{"revision":"d4ea16f5686d6b7109f935f1e0a500a4","url":"assets/js/e4fc886a.fafdcf0c.js"},{"revision":"3d32c01cf571e12069493b31a97a2f5f","url":"assets/js/e5e7af3c.387d2fd1.js"},{"revision":"17b6e9922839a591a10ec740168315f0","url":"assets/js/e60d8fac.2199b4bf.js"},{"revision":"a39349b1d4b47593c7598c5d872e9204","url":"assets/js/e75dbc73.4f6e171c.js"},{"revision":"93653ec9f4cc4810305b02e46963ccb7","url":"assets/js/e77f4328.49adf3fc.js"},{"revision":"ce65066a583597e8ce91c25854c2e0f3","url":"assets/js/e7e568e4.7601caa0.js"},{"revision":"89c85875de65bf12818d07414e0ad48f","url":"assets/js/e986d0bf.bb1cd1ca.js"},{"revision":"4c52fc6cdd875e7e1fac2a962afdf3ee","url":"assets/js/ec1940fc.b1e06480.js"},{"revision":"13fbf4b873db08bc3913d627a693fff5","url":"assets/js/ec4d7ded.2580b4f7.js"},{"revision":"11b15a784601978bdc6b3ceeeb086778","url":"assets/js/ecaa11c6.5d6585a9.js"},{"revision":"a01733806c30ee97ba48e2f85a590108","url":"assets/js/ee02910b.adfa6aff.js"},{"revision":"1d4707df00b6ab3280ea6c05302dfa5c","url":"assets/js/f283da07.11448b77.js"},{"revision":"4ec6cbd09dcffe749da44aa9a7940083","url":"assets/js/f36dee5a.773e4600.js"},{"revision":"51d9b295fc96a607ee116d7b62256f52","url":"assets/js/f3a8b621.aeec68ca.js"},{"revision":"e986031cf3493345c620f29610e4fb1a","url":"assets/js/f64f61d9.afd4d114.js"},{"revision":"94b8315c957fd2f838302adaf20271e9","url":"assets/js/f740b2ca.d5ec4806.js"},{"revision":"7c6f8caaa1a042cd72c79669b18962b9","url":"assets/js/f7cef55a.6bf72dd2.js"},{"revision":"6094e798afa8549f0b54fec44073dd3e","url":"assets/js/f9806908.6bfa4d12.js"},{"revision":"bd5174c77ba02728bb18cb4034baa275","url":"assets/js/fba67bfa.31308a11.js"},{"revision":"1b7c7687d0e744ecf3ef82930b445972","url":"assets/js/fbe53b78.d7ecff38.js"},{"revision":"5a4104a5cbf24203cfebcc6a2ad5a3cc","url":"assets/js/fc970c7f.407799ba.js"},{"revision":"7438c2542bb479cea7f6da474f53766a","url":"assets/js/fdc7a41e.40f45c22.js"},{"revision":"1bb6a828dd03c412bbb2e68c782bd92c","url":"assets/js/fe11e29a.25cd7915.js"},{"revision":"f163fb312f799af519d105addc52d22a","url":"assets/js/ffe0a0fd.8d1eb8f7.js"},{"revision":"8bfeebe2103c9a67f7b50a212d8601cc","url":"assets/js/main.d722dea6.js"},{"revision":"46f9b79dfcf7b0bf859efa785d2baaec","url":"assets/js/runtime~main.12799c53.js"},{"revision":"a42aebfd593528fd1c9dcd71dbaad46b","url":"category/-middleware/index.html"},{"revision":"c65efc5026e4dc524921420cf88b84a8","url":"category/api/index.html"},{"revision":"cf30264c9617406300e361977901f859","url":"category/extra/index.html"},{"revision":"0d72918ae99d55af4c2ebc4e5284d3a5","url":"category/guide/index.html"},{"revision":"cff459ec57ace14aff49b11d00fe9816","url":"contrib/casbin/index.html"},{"revision":"5890c665e1df5babde153d3fb8d973d0","url":"contrib/fiberi18n/index.html"},{"revision":"540630c95b5d562b6395373362ef0432","url":"contrib/fibernewrelic/index.html"},{"revision":"dcd64a12aede5eeb51430beb5ea7031a","url":"contrib/fibersentry/index.html"},{"revision":"d13af282617f897fd6187796b27bdd94","url":"contrib/fiberzap/index.html"},{"revision":"7baf3183a9364569db07876403b5efc6","url":"contrib/fiberzerolog/index.html"},{"revision":"d8e8f43ea51d764875a17798b96c56aa","url":"contrib/index.html"},{"revision":"f2e32af9bb38a9f685f458da3dfb5f0f","url":"contrib/jwt/index.html"},{"revision":"f0939cae7d84d21566f697d44517bbd0","url":"contrib/opafiber/index.html"},{"revision":"7e607b0a7c3dd0a4c2110e845f99bf9b","url":"contrib/otelfiber/example/index.html"},{"revision":"645871f89c304edd28e7dc4a51b677e9","url":"contrib/otelfiber/index.html"},{"revision":"483a5d7b3c8ce01f63746f60f9c11a12","url":"contrib/paseto/index.html"},{"revision":"2799bda96cac62291880b18146dada53","url":"contrib/swagger/index.html"},{"revision":"89475bf8bf2e7e4bff522692b2c96828","url":"contrib/websocket/index.html"},{"revision":"b6e1edb92f0995eef46b84dc443d4bf4","url":"ctx/index.html"},{"revision":"48b549dab053bab36d608848ed47db5b","url":"extra/benchmarks/index.html"},{"revision":"ec82c6b0961a8f9d5573f110d6bff9c1","url":"extra/faq/index.html"},{"revision":"f6fbef3e2b6c14878abac3a02342be40","url":"guide/error-handling/index.html"},{"revision":"7d0e6626c566201231bcae0a25827231","url":"guide/faster-fiber/index.html"},{"revision":"cd12aa9eca69a91c44c4bc9c77c209ca","url":"guide/grouping/index.html"},{"revision":"ae46269d5066ad65fc25100aafcb5b6d","url":"guide/hooks/index.html"},{"revision":"57b55ecb2b85058f035eeae7f9d7c8f6","url":"guide/routing/index.html"},{"revision":"9817b7bc9b43ef857521cbda123ff7b0","url":"guide/templates/index.html"},{"revision":"1fbbff0b87945dda1e7e248c31de5784","url":"guide/validation/index.html"},{"revision":"5bce0404cdad18d09ed904cffe64dc6d","url":"index.html"},{"revision":"f42d1aef9f7789a8723990f4843b6f7a","url":"manifest.json"},{"revision":"1e589a10cffa9badaa3a50676aebf5c4","url":"next/api/app/index.html"},{"revision":"c77d1e528f240effa99d3067f3baa5db","url":"next/api/client/index.html"},{"revision":"fb0f84386695fbf58f065c884764c70d","url":"next/api/constants/index.html"},{"revision":"96ce6fa5ceedcfecb08d85c67dca3153","url":"next/api/ctx/index.html"},{"revision":"94437d87e78e7d67490da0233a008af4","url":"next/api/fiber/index.html"},{"revision":"d7408cf2810a61abe5883c1adec31b8c","url":"next/api/log/index.html"},{"revision":"6891ab99dd390f77d884942e4bbf367f","url":"next/api/middleware/adaptor/index.html"},{"revision":"2a13ad62ddaaf15bc7dc1965d78a8b37","url":"next/api/middleware/basicauth/index.html"},{"revision":"a2e53c6249bd1ea6e889225d79d0f071","url":"next/api/middleware/cache/index.html"},{"revision":"5413cfc6d39e6dd3b93daccef88a74c2","url":"next/api/middleware/compress/index.html"},{"revision":"740d340a2071edd1b8e0642e3bf24a3b","url":"next/api/middleware/cors/index.html"},{"revision":"98720a8c4a917f619e0cae756b6fd5b5","url":"next/api/middleware/csrf/index.html"},{"revision":"a411fc372e427eb95252fbb4073be76b","url":"next/api/middleware/earlydata/index.html"},{"revision":"d7ec49dad1a5d1229141a216669dc1dd","url":"next/api/middleware/encryptcookie/index.html"},{"revision":"31af4ca570230baa5877f3ce8f6afb55","url":"next/api/middleware/envvar/index.html"},{"revision":"1e8a2e57c5cbb73bab4cf4152a54c060","url":"next/api/middleware/etag/index.html"},{"revision":"b1fa7c337f9b143032221383f54f1708","url":"next/api/middleware/expvar/index.html"},{"revision":"8e204ae7cf12757045863712d72fc459","url":"next/api/middleware/favicon/index.html"},{"revision":"6bf372bdb111a7b3cc68ab94e74261ef","url":"next/api/middleware/filesystem/index.html"},{"revision":"e192d4cae68721b65b5a285d1c3d644f","url":"next/api/middleware/helmet/index.html"},{"revision":"3d9a7643f82bea4553c47d468fffc6bf","url":"next/api/middleware/idempotency/index.html"},{"revision":"9405113595cfe68775e4c9001bb07618","url":"next/api/middleware/keyauth/index.html"},{"revision":"fdf6ff7659152e7c66f9ca1a549b3162","url":"next/api/middleware/limiter/index.html"},{"revision":"76c3de02adf0fda0f28b09eed16d9213","url":"next/api/middleware/logger/index.html"},{"revision":"b949e8fbb3238ba915d81a441ce16b20","url":"next/api/middleware/monitor/index.html"},{"revision":"ede75b8eb1c9f90ebc282ed4ef57133d","url":"next/api/middleware/pprof/index.html"},{"revision":"7e8e2e4656bb3ed1f8428a5ac0e5dd62","url":"next/api/middleware/proxy/index.html"},{"revision":"8f319ca214610b71d526712edcc73e0f","url":"next/api/middleware/recover/index.html"},{"revision":"53f73835d210fbf26625a0077fe850a2","url":"next/api/middleware/redirect/index.html"},{"revision":"302b4c9aefd0745e6e4cebe8bb6874e4","url":"next/api/middleware/requestid/index.html"},{"revision":"578e782bc72171bcb03c88524a311f3a","url":"next/api/middleware/rewrite/index.html"},{"revision":"6b354f34a7f06ad6ec3d9b04718d7e7b","url":"next/api/middleware/session/index.html"},{"revision":"e8b3351cf43b758c18443a5b98bb5c3e","url":"next/api/middleware/skip/index.html"},{"revision":"66b9e63ba1b885c99c9ca7adb9423077","url":"next/api/middleware/timeout/index.html"},{"revision":"b72e22bce4e1a8c757210e52ca9748d5","url":"next/category/-middleware/index.html"},{"revision":"21ec1c0e4797886bf8b38d2317738be5","url":"next/category/api/index.html"},{"revision":"a563de2ad05524273b9040c9918bd60e","url":"next/category/extra/index.html"},{"revision":"523fcb596d2dcb1b2ae53ccd697daf08","url":"next/category/guide/index.html"},{"revision":"7a46f1b575d3b0329e480fe0bbc4a113","url":"next/extra/benchmarks/index.html"},{"revision":"543ba835e7e769195a883215357b5352","url":"next/extra/faq/index.html"},{"revision":"3625c574115e4136ac0bc03fd3083e54","url":"next/guide/error-handling/index.html"},{"revision":"423c846f5079cf11f77b53eafcb55b8f","url":"next/guide/faster-fiber/index.html"},{"revision":"5cd25bd31afa8b4f54e520243e328d61","url":"next/guide/grouping/index.html"},{"revision":"625edb9dfad5f86c3a7599088a8b4c1e","url":"next/guide/hooks/index.html"},{"revision":"3fa376984b5f63f0c65e6bd49f761ec4","url":"next/guide/routing/index.html"},{"revision":"4250b6685f9bf944f360d1db5d991847","url":"next/guide/templates/index.html"},{"revision":"37c380e988824728873243defe708b0c","url":"next/guide/validation/index.html"},{"revision":"2e82198a07c99cfcc34c4a5d1af3da6a","url":"next/index.html"},{"revision":"9108abd8b913e1454097156bba78bca0","url":"next/partials/routing/route-handlers/index.html"},{"revision":"876d2b2952ce385f960e4d0916750f4e","url":"next/search-index.json"},{"revision":"2e670c8d5b94d35a495045e2055ce214","url":"partials/routing/route-handlers/index.html"},{"revision":"356e031ffc88212f8de1807330821393","url":"routing/index.html"},{"revision":"850990fd76582270a00b62febc6783d4","url":"search-index.json"},{"revision":"7a81326af9cbc2a3650513af562cffc2","url":"search/index.html"},{"revision":"822c06f8df09efc4f800679f392842fd","url":"storage/arangodb/index.html"},{"revision":"efc172488c3d27ddb5b211b78acfd4eb","url":"storage/azureblob/index.html"},{"revision":"19d6ac9fe6fd078ab170ef2b40224a78","url":"storage/badger/index.html"},{"revision":"805860760747192490a62578e258bdb6","url":"storage/bbolt/index.html"},{"revision":"1b043f2d6c9a20168094ca03ebba1826","url":"storage/couchbase/index.html"},{"revision":"efa2daf766869c7aa81a7ef3d3d66d58","url":"storage/dynamodb/index.html"},{"revision":"f6634277c2511aecd01760925a5de157","url":"storage/etcd/index.html"},{"revision":"f62af6dd01be4e9e6e31eb1883b5b1e6","url":"storage/index.html"},{"revision":"b9e3d12201b470d0971a56921d4cba8c","url":"storage/memcache/index.html"},{"revision":"45c7ae0b7e04122e701b1b717c3010c7","url":"storage/memory/index.html"},{"revision":"6f4cec27cba764afb95209bc68bcf37c","url":"storage/mongodb/index.html"},{"revision":"94d1b8b6ec79d08d162578868198db77","url":"storage/mssql/index.html"},{"revision":"d4e6e16cb5bb0fc742223f837f293ddf","url":"storage/mysql/index.html"},{"revision":"6c28abd180cbc0d73deeadb9c09e29ce","url":"storage/pebble/index.html"},{"revision":"f66a0ee1e244b52f69e694412b87b4f7","url":"storage/postgres/index.html"},{"revision":"2414ba9b9cafe37b372232381c6c906c","url":"storage/redis/index.html"},{"revision":"d0b12971943ee50da509b905c88f7953","url":"storage/ristretto/index.html"},{"revision":"5461a9db522959345ae948e5a526a08f","url":"storage/s3/index.html"},{"revision":"188d6992ce77acc2300723746b05a33f","url":"storage/sqlite3/index.html"},{"revision":"bb0f1c4e460fee84c36e06b7c1147871","url":"template/ace/index.html"},{"revision":"bc8f85ea1288607b800ce0bd2345b73c","url":"template/amber/index.html"},{"revision":"3b53766e3d6830d218c5e57f2f4851df","url":"template/django/index.html"},{"revision":"546e24af570494e90f1805d9917d0911","url":"template/handlebars/index.html"},{"revision":"c944c426508dd8d7546b0a049634cf42","url":"template/html/index.html"},{"revision":"44054e904237a6df2359ccfde61be7fe","url":"template/html/TEMPLATES_CHEATSHEET/index.html"},{"revision":"a28cf2eb0c4cf3483d554eaae4a5e8cf","url":"template/index.html"},{"revision":"2dcc367c4171560e6f3d32629039ceac","url":"template/jet/index.html"},{"revision":"2a6b3ab9f696b96b1c21178f28f9d6b7","url":"template/mustache/index.html"},{"revision":"c7871379a7cf620ec6bbcf489b6a0ad6","url":"template/pug/index.html"},{"revision":"c5f89454026e21f0e29b6914b6b8f9ff","url":"template/slim/index.html"},{"revision":"8084f2f83a2f477735ed11e2bf0e8213","url":"v/1.x/api/app/index.html"},{"revision":"08b749d0b0d95853310eb8d8cb6106d8","url":"v/1.x/api/ctx/index.html"},{"revision":"b785b5746370eebb99f2ee0869bd7c1a","url":"v/1.x/api/middleware/index.html"},{"revision":"ea032e7aa0080b3a208b1f36dd4b3e42","url":"v/1.x/category/api/index.html"},{"revision":"05f4a343184e6860b0ff5ee3d300a985","url":"v/1.x/category/guide/index.html"},{"revision":"43020c9060b711302b75140744628b1b","url":"v/1.x/category/misc/index.html"},{"revision":"6ed7cc0b075f329589b4401d334837af","url":"v/1.x/guide/error-handling/index.html"},{"revision":"36bb8767aaf25e55f7243dfbce1f06d1","url":"v/1.x/guide/grouping/index.html"},{"revision":"270595eab09ebe6d8ea33a90976c9797","url":"v/1.x/guide/routing/index.html"},{"revision":"46f9f665213c2a17baa88d4fb42bad58","url":"v/1.x/guide/templates/index.html"},{"revision":"a87db992f4d13bf4aa792129f43a42d9","url":"v/1.x/guide/validating/index.html"},{"revision":"4d5bf161ff11ab65805a05e165db85c0","url":"v/1.x/index.html"},{"revision":"060cd4ea1beb6b3a8224a6e8b6692d10","url":"v/1.x/misc/benchmarks/index.html"},{"revision":"27fe56b7b2ab21f8d3e02c0e09958cef","url":"v/1.x/misc/faq/index.html"},{"revision":"55147e8971366f9f150a31d58c80db85","url":"v1.x/api/app/index.html"},{"revision":"1d5f1057f151f0575fb870e78001406a","url":"v1.x/api/ctx/index.html"},{"revision":"5eb576ea065b4293a92f189da3b660f2","url":"v1.x/api/middleware/index.html"},{"revision":"017c302b340601b659490dd4e502c153","url":"v1.x/category/api/index.html"},{"revision":"d70aca518bd5bf0c00f6592bf8c7cade","url":"v1.x/category/guide/index.html"},{"revision":"ffcaf981daceb4393128f6e574ef5987","url":"v1.x/category/misc/index.html"},{"revision":"bbcd8b8cd4952dd78dadcca70a4ed551","url":"v1.x/guide/error-handling/index.html"},{"revision":"e9c65ad72124c3417d8641efa64c0822","url":"v1.x/guide/grouping/index.html"},{"revision":"072831a8bced3db31f13b367189403d7","url":"v1.x/guide/routing/index.html"},{"revision":"e6cabdaa08c9cd3d622de71f2539fcac","url":"v1.x/guide/templates/index.html"},{"revision":"0ff113ff586b75949cd179cc4c97ab33","url":"v1.x/guide/validating/index.html"},{"revision":"ee4a2aa87a9058621ca17b7d0620e602","url":"v1.x/index.html"},{"revision":"70cd99bc3bf6474e0ae8127b61b56eb9","url":"v1.x/misc/benchmarks/index.html"},{"revision":"0e218a80eeb24196e172326564157adb","url":"v1.x/misc/faq/index.html"},{"revision":"847c2ed865fdde0d21b6b11011104a43","url":"v1.x/search-index.json"},{"revision":"a2d0b99576a1a51f46d2ee84ec167336","url":"assets/images/benchmark_alloc-dec96faa96e07bcec84f40a4dfc8d187.png"},{"revision":"a7a3e37e6499fcf3fa9d793fd24339b9","url":"assets/images/benchmark_latency-b67a470cf1b261c3092b80cbf42ef16b.png"},{"revision":"c5b05974efbe649f1fe9fcbf15a8ff82","url":"assets/images/benchmark-18e23fcf42afc7f5e12ea23aceb27885.png"},{"revision":"2cdc5220f6027f0106431ed9756ef0ff","url":"assets/images/benchmark-pipeline-b49cbb1db36293acdfb0e6c96d844e1a.png"},{"revision":"1276aea996275055bfbb406a62170931","url":"assets/images/concurrency_alloc-6f2d485576803f7de2fe0a1deca21a09.png"},{"revision":"56065bebf88e6d317d32fa056044ab49","url":"assets/images/concurrency_latency-5a223848a8bee8df21cc02451f0db2b6.png"},{"revision":"c16f8be0910b1d55e73abb3cf14fcc81","url":"assets/images/concurrency-1307e1d23c01a561a4b2a0f5bdd7e1bc.png"},{"revision":"52e02024a0fc9efdeb174fbd2cb5eaa8","url":"assets/images/concurrency-pipeline-b0d3c211d9c7cb5474fd191223a41241.png"},{"revision":"f8a5f57ca71eb1e0f38e676552ba8a0b","url":"assets/images/data_updates_express-2f55d1b0975ec391d29d823b48faf617.png"},{"revision":"ef41ee04899eb8d1a4a34acb4d7fc20a","url":"assets/images/data_updates-3be85c418d6971091854c5086af9ed10.png"},{"revision":"716cadd67372190364a5f07efbb477c2","url":"assets/images/graph-afbd400b1c3e1c6f137dae3cfc1890ce.svg"},{"revision":"7a707deb897d8b72d098d0ee46d3b44d","url":"assets/images/json_express-aa631b2de86808970aa4bb7c9c9d3edf.png"},{"revision":"0b57d54569e518d2112a0a515042ea63","url":"assets/images/json-62868f61b34e3790f3a8b3b52b1a3a3b.png"},{"revision":"316f574189fa0067fb53b53d020b193a","url":"assets/images/multiple_queries_express-ec4dc8013e85dc2a2fa4f5eeb55ce8dd.png"},{"revision":"b3beb07717c41c5e0f7561ae6c479fbf","url":"assets/images/multiple_queries-2c2e81674208b90b9aeb1cb791a3f0dc.png"},{"revision":"480e9b557cc822c532a998a2ed724bfc","url":"assets/images/plaintext_express-ef6522843412bb5b14b3c6b6a4f032de.png"},{"revision":"45bd9af55fba9dc062200831ac57c5e6","url":"assets/images/plaintext-e25d187f782d18fdd35b84e3d7c625eb.png"},{"revision":"5b4ee8112e04d79df5a0aa39acca791b","url":"assets/images/single_query_express-d8e41422b4f5c0a9496272e4a66a97c4.png"},{"revision":"8a5d82762f28eca9a722e75f3f12cff8","url":"assets/images/single_query-4f7782d3c3ff91e92ac27e382b09f6ac.png"},{"revision":"79a9ef885732dee2637157a4762faf7e","url":"assets/images/support-discord-baf5f38231088813dfbc3ccdc6966634.png"},{"revision":"a2d0b99576a1a51f46d2ee84ec167336","url":"img/benchmark_alloc.png"},{"revision":"a7a3e37e6499fcf3fa9d793fd24339b9","url":"img/benchmark_latency.png"},{"revision":"2cdc5220f6027f0106431ed9756ef0ff","url":"img/benchmark-pipeline.png"},{"revision":"c5b05974efbe649f1fe9fcbf15a8ff82","url":"img/benchmark.png"},{"revision":"1276aea996275055bfbb406a62170931","url":"img/concurrency_alloc.png"},{"revision":"56065bebf88e6d317d32fa056044ab49","url":"img/concurrency_latency.png"},{"revision":"52e02024a0fc9efdeb174fbd2cb5eaa8","url":"img/concurrency-pipeline.png"},{"revision":"c16f8be0910b1d55e73abb3cf14fcc81","url":"img/concurrency.png"},{"revision":"f8a5f57ca71eb1e0f38e676552ba8a0b","url":"img/data_updates_express.png"},{"revision":"ef41ee04899eb8d1a4a34acb4d7fc20a","url":"img/data_updates.png"},{"revision":"3b4420315b7baefee56d433e4c78f268","url":"img/favicon.png"},{"revision":"716cadd67372190364a5f07efbb477c2","url":"img/graph.svg"},{"revision":"354ea4a4bcaad920949e253d33683869","url":"img/icons/icon-192x192.png"},{"revision":"4039790fa05a5dc7e9259485b4324433","url":"img/icons/icon-256x256.png"},{"revision":"93b99bdaaad38831b46a296dfeab4863","url":"img/icons/icon-384x384.png"},{"revision":"096c82692efe3ec986ab2b4fc5d60aea","url":"img/icons/icon-512x512.png"},{"revision":"7a707deb897d8b72d098d0ee46d3b44d","url":"img/json_express.png"},{"revision":"0b57d54569e518d2112a0a515042ea63","url":"img/json.png"},{"revision":"171b53337ba05d4e62332e230f3c212b","url":"img/logo-dark.svg"},{"revision":"e2c2dc9b6b5f44183247f7c48d65ccef","url":"img/logo.svg"},{"revision":"316f574189fa0067fb53b53d020b193a","url":"img/multiple_queries_express.png"},{"revision":"b3beb07717c41c5e0f7561ae6c479fbf","url":"img/multiple_queries.png"},{"revision":"480e9b557cc822c532a998a2ed724bfc","url":"img/plaintext_express.png"},{"revision":"45bd9af55fba9dc062200831ac57c5e6","url":"img/plaintext.png"},{"revision":"5b4ee8112e04d79df5a0aa39acca791b","url":"img/single_query_express.png"},{"revision":"8a5d82762f28eca9a722e75f3f12cff8","url":"img/single_query.png"},{"revision":"79a9ef885732dee2637157a4762faf7e","url":"img/support-discord.png"}],s=new R({fallbackToNetwork:!0});e.offlineMode&&(s.addToCacheList(t),e.debug&&console.log("[Docusaurus-PWA][SW]: addToCacheList",{precacheManifest:t})),await async function(e){}(),self.addEventListener("install",(t=>{e.debug&&console.log("[Docusaurus-PWA][SW]: install event",{event:t}),t.waitUntil(s.install(t))})),self.addEventListener("activate",(t=>{e.debug&&console.log("[Docusaurus-PWA][SW]: activate event",{event:t}),t.waitUntil(s.activate(t))})),self.addEventListener("fetch",(async t=>{if(e.offlineMode){const a=t.request.url,n=function(e){const t=new URL(e,self.location.href);return t.origin!==self.location.origin?[]:(t.search="",t.hash="",[t.href,`${t.href}${t.pathname.endsWith("/")?"":"/"}index.html`])}(a);for(const i of n){const r=s.getCacheKeyForURL(i);if(r){const s=caches.match(r);e.debug&&console.log("[Docusaurus-PWA][SW]: serving cached asset",{requestURL:a,possibleURL:i,possibleURLs:n,cacheKey:r,cachedResponse:s}),t.respondWith(s);break}}}})),self.addEventListener("message",(async t=>{e.debug&&console.log("[Docusaurus-PWA][SW]: message event",{event:t});const s=t.data?.type;"SKIP_WAITING"===s&&self.skipWaiting()}))})()})()})(); \ No newline at end of file diff --git a/template/ace/index.html b/template/ace/index.html index c090eceb532..13b121d7dfc 100644 --- a/template/ace/index.html +++ b/template/ace/index.html @@ -6,8 +6,8 @@ Ace | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Ace is a template engine create by yossi, to see the original syntax documentation please click here

Basic Example​

./views/index.ace

= include ./views/partials/header .

h1 {{.Title}}

= include ./views/partials/footer .

./views/partials/header.ace

h1 Header

./views/partials/footer.ace

h1 Footer

./views/layouts/main.ace

= doctype html
html
head
title Main
body
{{embed}}
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/ace/v2"
)

func main() {
// Create a new engine
engine := ace.New("./views", ".ace")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := html.NewFileSystem(http.Dir("./views", ".ace"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

- - +Linter

Ace is a template engine create by yossi, to see the original syntax documentation please click here

Basic Example​

./views/index.ace

= include ./views/partials/header .

h1 {{.Title}}

= include ./views/partials/footer .

./views/partials/header.ace

h1 Header

./views/partials/footer.ace

h1 Footer

./views/layouts/main.ace

= doctype html
html
head
title Main
body
{{embed}}
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/ace/v2"
)

func main() {
// Create a new engine
engine := ace.New("./views", ".ace")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := html.NewFileSystem(http.Dir("./views", ".ace"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

+ + \ No newline at end of file diff --git a/template/amber/index.html b/template/amber/index.html index 14d56909de8..94c976b657b 100644 --- a/template/amber/index.html +++ b/template/amber/index.html @@ -6,8 +6,8 @@ Amber | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Amber is a template engine create by eknkc, to see the original syntax documentation please click here

Basic Example​

./views/index.amber

import ./views/partials/header

h1 #{Title}

import ./views/partials/footer

./views/partials/header.amber

h1 Header

./views/partials/footer.amber

h1 Footer

./views/layouts/main.amber

doctype html
html
head
title Main
body
#{embed()}
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/amber/v2"
)

func main() {
// Create a new engine
engine := amber.New("./views", ".amber")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := html.NewFileSystem(http.Dir("./views", ".amber"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

- - +Linter

Amber is a template engine create by eknkc, to see the original syntax documentation please click here

Basic Example​

./views/index.amber

import ./views/partials/header

h1 #{Title}

import ./views/partials/footer

./views/partials/header.amber

h1 Header

./views/partials/footer.amber

h1 Footer

./views/layouts/main.amber

doctype html
html
head
title Main
body
#{embed()}
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/amber/v2"
)

func main() {
// Create a new engine
engine := amber.New("./views", ".amber")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := html.NewFileSystem(http.Dir("./views", ".amber"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

+ + \ No newline at end of file diff --git a/template/django/index.html b/template/django/index.html index 1153617cbae..f1167c350cb 100644 --- a/template/django/index.html +++ b/template/django/index.html @@ -6,8 +6,8 @@ Django | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Django is a template engine create by flosch, to see the original syntax documentation please click here

Basic Example​

./views/index.django

{% include "partials/header.django" %}

<h1>{{ Title }}</h1>

{% include "partials/footer.django" %}

./views/partials/header.django

<h2>Header</h2>

./views/partials/footer.django

<h2>Footer</h2>

./views/layouts/main.django

<!DOCTYPE html>
<html>

<head>
<title>Main</title>
</head>

<body>
{{embed}}
</body>

</html>
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/django/v3"
)

func main() {
// Create a new engine
engine := django.New("./views", ".django")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := html.NewFileSystem(http.Dir("./views", ".django"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

Using embedded file system (1.16+ only)​

When using the // go:embed directive, resolution of inherited templates using django's {% extend '' %} keyword fails when instantiating the template engine with django.NewFileSystem(). In that case, use the django.NewPathForwardingFileSystem() function to instantiate the template engine.

This function provides the proper configuration for resolving inherited templates.

Assume you have the following files:

then

package main

import (
"log"
"embed"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/django/v3"
)

//go:embed views
var viewsAsssets embed.FS

func main() {
// Create a new engine
engine := NewPathForwardingFileSystem(http.FS(viewsAsssets), "/views", ".django")

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render descendant
return c.Render("descendant", fiber.Map{
"greeting": "World",
})
})

log.Fatal(app.Listen(":3000"))
}

Register and use custom functions​

// My custom function
func Nl2brHtml(value interface{}) string {
if str, ok := value.(string); ok {
return strings.Replace(str, "\n", "<br />", -1)
}
return ""
}

// Create a new engine
engine := django.New("./views", ".django")

// register functions
engine.AddFunc("nl2br", Nl2brHtml)

// Pass the engine to the Views
app := fiber.New(fiber.Config{Views: engine})

in the handler

c.Render("index", fiber.Map{
"Fiber": "Hello, World!\n\nGreetings from Fiber Team",
})

./views/index.django

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"></head>
<body>
{{ nl2br(Fiber) }}
</body>
</html>

Output:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"></head>
<body>
Hello, World!<br /><br />Greetings from Fiber Team
</body>
</html>
- - +Linter

Django is a template engine create by flosch, to see the original syntax documentation please click here

Basic Example​

./views/index.django

{% include "partials/header.django" %}

<h1>{{ Title }}</h1>

{% include "partials/footer.django" %}

./views/partials/header.django

<h2>Header</h2>

./views/partials/footer.django

<h2>Footer</h2>

./views/layouts/main.django

<!DOCTYPE html>
<html>

<head>
<title>Main</title>
</head>

<body>
{{embed}}
</body>

</html>
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/django/v3"
)

func main() {
// Create a new engine
engine := django.New("./views", ".django")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := html.NewFileSystem(http.Dir("./views", ".django"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

Using embedded file system (1.16+ only)​

When using the // go:embed directive, resolution of inherited templates using django's {% extend '' %} keyword fails when instantiating the template engine with django.NewFileSystem(). In that case, use the django.NewPathForwardingFileSystem() function to instantiate the template engine.

This function provides the proper configuration for resolving inherited templates.

Assume you have the following files:

then

package main

import (
"log"
"embed"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/django/v3"
)

//go:embed views
var viewsAsssets embed.FS

func main() {
// Create a new engine
engine := NewPathForwardingFileSystem(http.FS(viewsAsssets), "/views", ".django")

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render descendant
return c.Render("descendant", fiber.Map{
"greeting": "World",
})
})

log.Fatal(app.Listen(":3000"))
}

Register and use custom functions​

// My custom function
func Nl2brHtml(value interface{}) string {
if str, ok := value.(string); ok {
return strings.Replace(str, "\n", "<br />", -1)
}
return ""
}

// Create a new engine
engine := django.New("./views", ".django")

// register functions
engine.AddFunc("nl2br", Nl2brHtml)

// Pass the engine to the Views
app := fiber.New(fiber.Config{Views: engine})

in the handler

c.Render("index", fiber.Map{
"Fiber": "Hello, World!\n\nGreetings from Fiber Team",
})

./views/index.django

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"></head>
<body>
{{ nl2br(Fiber) }}
</body>
</html>

Output:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"></head>
<body>
Hello, World!<br /><br />Greetings from Fiber Team
</body>
</html>
+ + \ No newline at end of file diff --git a/template/handlebars/index.html b/template/handlebars/index.html index 4eaa01acc9d..d3a99861d71 100644 --- a/template/handlebars/index.html +++ b/template/handlebars/index.html @@ -6,8 +6,8 @@ Handlebars | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Handlebars is a template engine create by aymerick, to see the original syntax documentation please click here

Basic Example​

./views/index.hbs

{{> 'partials/header' }}

<h1>{{Title}}</h1>

{{> 'partials/footer' }}

./views/partials/header.hbs

<h2>Header</h2>

./views/partials/footer.hbs

<h2>Footer</h2>

./views/layouts/main.hbs

<!DOCTYPE html>
<html>

<head>
<title>Main</title>
</head>

<body>
{{embed}}
</body>

</html>
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/handlebars/v2"
)

func main() {
// Create a new engine
engine := handlebars.New("./views", ".hbs")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := html.NewFileSystem(http.Dir("./views", ".hbs"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

- - +Linter

Handlebars is a template engine create by aymerick, to see the original syntax documentation please click here

Basic Example​

./views/index.hbs

{{> 'partials/header' }}

<h1>{{Title}}</h1>

{{> 'partials/footer' }}

./views/partials/header.hbs

<h2>Header</h2>

./views/partials/footer.hbs

<h2>Footer</h2>

./views/layouts/main.hbs

<!DOCTYPE html>
<html>

<head>
<title>Main</title>
</head>

<body>
{{embed}}
</body>

</html>
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/handlebars/v2"
)

func main() {
// Create a new engine
engine := handlebars.New("./views", ".hbs")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := html.NewFileSystem(http.Dir("./views", ".hbs"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

+ + \ No newline at end of file diff --git a/template/html/TEMPLATES_CHEATSHEET/index.html b/template/html/TEMPLATES_CHEATSHEET/index.html index 9f8990b359b..79c93143660 100644 --- a/template/html/TEMPLATES_CHEATSHEET/index.html +++ b/template/html/TEMPLATES_CHEATSHEET/index.html @@ -6,13 +6,13 @@ Golang Templates Cheatsheet | Fiber - - + +
-

Golang Templates Cheatsheet

The Go standard library provides a set of packages to generate output. The text/template package implements templates for generating text output, while the html/template package implements templates for generating HTML output that is safe against certain attacks. Both packages use the same interface but the following examples of the core features are directed towards HTML applications.


Table of Contents​


Parsing and Creating Templates​

Naming Templates​

There is no defined file extension for Go templates. One of the most popular is .tmpl supported by vim-go and referenced in the text/template godocs. The extension .gohtml supports syntax highlighting in both Atom and GoSublime editors. Finally analysis of large Go codebases finds that .tpl is often used by developers. While the extension is not important it is still good to be consistent within a project for clarity.


Creating a Template​

tpl, err := template.Parse(filename) will get the template at filename and store it in tpl. tpl can then be executed to show the template.


Parsing Multiple Templates​

template.ParseFiles(filenames) takes a list of filenames and stores all templates. template.ParseGlob(pattern) will find all templates matching the pattern and store the templates.


Executing Templates​

Execute a Single Template​

Once a template has been parsed there are two options to execute them. A single template tpl can be executed using tpl.Execute(io.Writer, data). The content of tpl will be written to the io.Writer. Data is an interface passed to the template that will be useable in the template.


Executing a Named Template​

tpl.ExecuteTemplate(io.Writer, name, data) works the same as execute but allows for a string name of the template the user wants to execute.


Template Encoding and HTML​

Contextual Encoding​

Go’s html/template package does encoding based on the context of the code. As a result, html/template encodes any characters that need encoding to be rendered correctly.

For example the < and > in "<h1>A header!</h1>" will be encoded as &lt;h1&gt;A header!&lt;/h1&gt; .

Type template.HTML can be used to skip encoding by telling Go the string is safe. template.HTML("<h1>A Safe header</h1>") will then be <h1>A Safe header</h1> . Using this type with user input is dangerous and leaves the application vulnerable.

The go html/template package is aware of attributes within the template and will encode values differently based on the attribute.

Go templates can also be used with javascript. Structs and maps will be expanded into JSON objects and quotes will be added to strings for use in function parameters and as variable values.

    // Go
type Cat struct {
Name string
Age int
}

kitten := Cat{"Sam", 12}
// Template
<script>
var cat = {{.kitten}}
</script>
    // Javascript
var cat = {"Name":"Sam", "Age" 12}

Safe Strings and HTML Comments​

The html/template package will remove any comments from a template by default. This can cause issues when comments are necessary such as detecting internet explorer.

<!--[if IE]>
Place content here to target all Internet Explorer users.
<![endif]-->

We can use the Custom Functions method (Globally) to create a function that returns html preserving comments. Define a function htmlSafe in the FuncMap of the template.

    testTemplate, err = template.New("hello.gohtml").Funcs(template.FuncMap{
"htmlSafe": func(html string) template.HTML {
return template.HTML(html)
},
}).ParseFiles("hello.gohtml")

This function takes a string and produces the unaltered HTML code. This function can be used in a template like so to preserve the comments <!--[if IE 6]> and <![endif]--> :

    {{htmlSafe "<!--[if IE 6]>" }}
<meta http-equiv="Content-Type" content="text/html; charset=Unicode">
{{ htmlSafe "<![endif]-->" }}

Template Variables​

The dot character (.)​

A template variable can be a boolean, string, character, integer, floating-point, imaginary, or complex constant in Go syntax. Data passed to the template can be accessed using dot {{ . }}.

If the data is a complex type then it’s fields can be accessed using the dot with the field name {{ .FieldName }}.

Dots can be chained together if the data contains multiple complex structures. {{ .Struct.StructTwo.Field }}


Variables in Templates​

Data passed to the template can be saved in a variable and used throughout the template. {{$number := .}} We use the $number to create a variable then initialize it with the value passed to the template. To use the variable we call it in the template with {{$number}}.

    {{$number := .}}
<h1> It is day number {{$number}} of the month </h1>
    var tpl *template.Template

tpl = template.Must(template.ParseFiles("templateName"))

err := tpl.ExecuteTemplate(os.Stdout, "templateName", 23)

In this example we pass 23 to the template and stored in the $number variable which can be used anywhere in the template


Template Actions​

If/Else Statements​

Go templates support if/else statements like many programming languages. We can use the if statement to check for values, if it doesn’t exist we can use an else value. The empty values are false, 0, any nil pointer or interface value, and any array, slice, map, or string of length zero.

<h1>Hello, {{if .Name}} {{.Name}} {{else}} Anonymous {{end}}!</h1>

If .Name exists then Hello, Name will be printed (replaced with the name value) otherwise it will print Hello, Anonymous.

Templates also provide the else if statment {{else if .Name2 }} which can be used to evaluate other options after an if.


Removing Whitespace​

Adding different values to a template can add various amounts of whitespace. We can either change our template to better handle it, by ignoring or minimizing effects, or we can use the minus sign - within out template.

<h1>Hello, {{if .Name}} {{.Name}} {{- else}} Anonymous {{- end}}!</h1>

Here we are telling the template to remove all spaces between the Name variable and whatever comes after it. We are doing the same with the end keyword. This allows us to have whitespace within the template for easier reading but remove it in production.


Range Blocks​

Go templates have a range keyword to iterate over all objects in a structure. Suppose we had the Go structures:

    type Item struct {
Name string
Price int
}

type ViewData struct {
Name string
Items []Item
}

We have an Item, with a name and price, then a ViewData which is the structure sent to the template. Consider the template containing the following:

{{range .Items}}
<div class="item">
<h3 class="name">{{.Name}}</h3>
<span class="price">${{.Price}}</span>
</div>
{{end}}

For each Item in the range of Items (in the ViewData structure) get the Name and Price of that item and create html for each Item automatically. Within a range each Item becomes the {{.}} and the item properties therefore become {{.Name}} or {{.Price}} in this example.


Template Functions​

The template package provides a list of predefined global functions. Below are some of the most used.


Indexing structures in Templates​

If the data passed to the template is a map, slice, or array it can be indexed from the template. We use {{index x number}} where index is the keyword, x is the data and number is a integer for the index value. If we had {{index names 2}} it is equivalent to names[2]. We can add more integers to index deeper into data. {{index names 2 3 4}} is equivalent to names[2][3][4].

<body>
<h1>{{index .FavNums 2 }}</h1>
</body>
    type person struct {
Name string
FavNums []int
}

func main() {

tpl := template.Must(template.ParseGlob("*.gohtml"))
tpl.Execute(os.Stdout, &person{"Curtis", []int{7, 11, 94}})
}

This code example passes a person structure and gets the 3rd favourite number from the FavNums slice.


The and Function​

The and function returns the boolean AND of its arguments by returning the first empty argument or the last argument. and x y behaves logically as if x then y else x . Consider the following go code

    type User struct {
Admin bool
}

type ViewData struct {
*User
}

Pass a ViewData with a User that has Admin set true to the following template


{{if and .User .User.Admin}}
You are an admin user!
{{else}}
Access denied!
{{end}}

The result will be You are an admin user!. However if the ViewData did not include a *User object or Admin was set as false then the result will be Access denied!.


The or Function​

The or function operates similarly to the and function however will stop at the first true. or x y is equivalent to if x then x else y so y will never be evaluated if x is not empty.


The not Function​

The not function returns the boolean negation of the argument.

    {{ if not .Authenticated}}
Access Denied!
{{ end }}

Template Comparison Functions​

Comparisons​

The html/template package provides a variety of functions to do comparisons between operators. The operators may only be basic types or named basic types such as type Temp float32 Remember that template functions take the form {{ function arg1 arg2 }}.

  • eq Returns the result of arg1 == arg2
  • ne Returns the result of arg1 != arg2
  • lt Returns the result of arg1 < arg2
  • le Returns the result of arg1 <= arg2
  • gt Returns the result of arg1 > arg2
  • ge Returns the result of arg1 >= arg2

Of special note eq can be used with two or more arguments by comparing all arguments to the first. {{ eq arg1 arg2 arg3 arg4}} will result in the following logical expression:

arg1==arg2 || arg1==arg3 || arg1==arg4


Nested Templates and Layouts​

Nesting Templates​

Nested templates can be used for parts of code frequently used across templates, a footer or header for example. Rather than updating each template separately we can use a nested template that all other templates can use. You can define a template as follows:

    {{define "footer"}}
<footer>
<p>Here is the footer</p>
</footer>
{{end}}

A template named β€œfooter” is defined which can be used in other templates like so to add the footer template content into the other template:

    {{template "footer"}}

Passing Variables between Templates​

The template action used to include nested templates also allows a second parameter to pass data to the nested template.

// Define a nested template called header 
{{define "header"}}
<h1>{{.}}</h1>
{{end}}

// Call template and pass a name parameter
{{range .Items}}
<div class="item">
{{template "header" .Name}}
<span class="price">${{.Price}}</span>
</div>
{{end}}

We use the same range to loop through Items as before but we pass the name to the header template each time in this simple example.


Creating Layouts​

Glob patterns specify sets of filenames with wildcard characters. The template.ParseGlob(pattern string) function will parse all templates that match the string pattern. template.ParseFiles(files...) can also be used with a list of file names.

The templates are named by default based on the base names of the argument files. This mean views/layouts/hello.gohtml will have the name hello.gohtml . If the template has a `{{define β€œtemplateName”}} within it then that name will be usable.

A specific template can be executed using t.ExecuteTemplate(w, "templateName", nil) . t is an object of type Template, w is type io.Writer such as an http.ResponseWriter, Then there is the name of the template to execute, and finally passing any data to the template, in this case a nil value.

Example main.go file

    // Omitted imports & package

var LayoutDir string = "views/layouts"
var bootstrap *template.Template

func main() {
var err error
bootstrap, err = template.ParseGlob(LayoutDir + "/*.gohtml")
if err != nil {
panic(err)
}

http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}

func handler(w http.ResponseWriter, r *http.Request) {
bootstrap.ExecuteTemplate(w, "bootstrap", nil)
}

All .gohtml files are parsed in main. When route / is reached the template defined as bootstrap is executed using the handler function.

Example views/layouts/bootstrap.gohtml file

    {{define "bootstrap"}}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Go Templates</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<h1>Filler header</h1>
<p>Filler paragraph</p>
</div>
<!-- jquery & Bootstrap JS -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"
</script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js">
</script>
</body>
</html>
{{end}}

Templates Calling Functions​

Function Variables (calling struct methods)​

We can use templates to call the methods of objects in the template to return data. Consider the User struct with the following method.

    type User struct {
ID int
Email string
}

func (u User) HasPermission(feature string) bool {
if feature == "feature-a" {
return true
} else {
return false
}
}

When a type User has been passed to the template we can then call this method from the template.

{{if .User.HasPermission "feature-a"}}
<div class="feature">
<h3>Feature A</h3>
<p>Some other stuff here...</p>
</div>
{{else}}
<div class="feature disabled">
<h3>Feature A</h3>
<p>To enable Feature A please upgrade your plan</p>
</div>
{{end}}

The template checks if the User HasPermission for the feature and renders depending on the result.


Function Variables (call)​

If the Method HasPermission has to change at times then the Function Variables (Methods) implementation may not fit the design. Instead a HasPermission func(string) bool attribute can be added on the User type. This can then have a function assigned to it at creation.

    // Structs
type ViewData struct {
User User
}

type User struct {
ID int
Email string
HasPermission func(string) bool
}

// Example of creating a ViewData
vd := ViewData{
User: User{
ID: 1,
Email: "curtis.vermeeren@gmail.com",
// Create the HasPermission function
HasPermission: func(feature string) bool {
if feature == "feature-b" {
return true
}
return false
},
},
}

// Executing the ViewData with the template
err := testTemplate.Execute(w, vd)

We need to tell the Go template that we want to call this function so we must change the template from the Function Variables (Methods) implementation to do this. We use the call keyword supplied by the go html/template package. Changing the previous template to use call results in:

{{if (call .User.HasPermission "feature-b")}}
<div class="feature">
<h3>Feature B</h3>
<p>Some other stuff here...</p>
</div>
{{else}}
<div class="feature disabled">
<h3>Feature B</h3>
<p>To enable Feature B please upgrade your plan</p>
</div>
{{end}}

Custom Functions​

Another way to call functions is to create custom functions with template.FuncMap . This method creates global methods that can be used throughout the entire application. FuncMap has type map[string]interface{} mapping a string, the function name, to a function. The mapped functions must have either a single return value, or two return values where the second has type error.

    // Creating a template with function hasPermission
testTemplate, err = template.New("hello.gohtml").Funcs(template.FuncMap{
"hasPermission": func(user User, feature string) bool {
if user.ID == 1 && feature == "feature-a" {
return true
}
return false
},
}).ParseFiles("hello.gohtml")

Here the function to check if a user has permission for a feature is mapped to the string "hasPermission" and stored in the FuncMap. Note that the custom functions must be created before calling ParseFiles()

The function could be executed in the template as follows:

    {{ if hasPermission .User "feature-a" }}

The .User and string "feature-a" are both passed to hasPermission as arguments.


Custom Functions (Globally)​

The previous two methods of custom functions rely on .User being passed to the template. This works in many cases but in a large application passing too many objects to a template can become difficult to maintain across many templates. We can change the implementation of the custom function to work without the .User being passed.

Using a similar feature example as the other 2 sections first you would have to create a default hasPermission function and define it in the template’s function map.

      testTemplate, err = template.New("hello.gohtml").Funcs(template.FuncMap{
"hasPermission": func(feature string) bool {
return false
},
}).ParseFiles("hello.gohtml")

This function could be placed in main() or somewhere that ensures the default hasPermission is created in the hello.gohtml function map. The default function just returns false but it defines the function and implementation that doesn’t require User .

Next a closure could be used to redefine the hasPermission function. It would use the User data available when it is created in a handler rather than having User data passed to it. Within the handler for the template you can redefine any functions to use the information available.

    func handler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")

user := User{
ID: 1,
Email: "Curtis.vermeeren@gmail.com",
}
vd := ViewData{}
err := testTemplate.Funcs(template.FuncMap{
"hasPermission": func(feature string) bool {
if user.ID == 1 && feature == "feature-a" {
return true
}
return false
},
}).Execute(w, vd)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}

In this handler a User is created with ID and Email, Then a ViewData is created without passing the user to it. The hasPermission function is redefined using user.ID which is available when the function is created. {{if hasPermission "feature-a"}} can be used in a template without having to pass a User to the template as the User object in the handler is used instead.


- - +

Golang Templates Cheatsheet

The Go standard library provides a set of packages to generate output. The text/template package implements templates for generating text output, while the html/template package implements templates for generating HTML output that is safe against certain attacks. Both packages use the same interface but the following examples of the core features are directed towards HTML applications.


Table of Contents​


Parsing and Creating Templates​

Naming Templates​

There is no defined file extension for Go templates. One of the most popular is .tmpl supported by vim-go and referenced in the text/template godocs. The extension .gohtml supports syntax highlighting in both Atom and GoSublime editors. Finally analysis of large Go codebases finds that .tpl is often used by developers. While the extension is not important it is still good to be consistent within a project for clarity.


Creating a Template​

tpl, err := template.Parse(filename) will get the template at filename and store it in tpl. tpl can then be executed to show the template.


Parsing Multiple Templates​

template.ParseFiles(filenames) takes a list of filenames and stores all templates. template.ParseGlob(pattern) will find all templates matching the pattern and store the templates.


Executing Templates​

Execute a Single Template​

Once a template has been parsed there are two options to execute them. A single template tpl can be executed using tpl.Execute(io.Writer, data). The content of tpl will be written to the io.Writer. Data is an interface passed to the template that will be useable in the template.


Executing a Named Template​

tpl.ExecuteTemplate(io.Writer, name, data) works the same as execute but allows for a string name of the template the user wants to execute.


Template Encoding and HTML​

Contextual Encoding​

Go’s html/template package does encoding based on the context of the code. As a result, html/template encodes any characters that need encoding to be rendered correctly.

For example the < and > in "<h1>A header!</h1>" will be encoded as &lt;h1&gt;A header!&lt;/h1&gt; .

Type template.HTML can be used to skip encoding by telling Go the string is safe. template.HTML("<h1>A Safe header</h1>") will then be <h1>A Safe header</h1> . Using this type with user input is dangerous and leaves the application vulnerable.

The go html/template package is aware of attributes within the template and will encode values differently based on the attribute.

Go templates can also be used with javascript. Structs and maps will be expanded into JSON objects and quotes will be added to strings for use in function parameters and as variable values.

    // Go
type Cat struct {
Name string
Age int
}

kitten := Cat{"Sam", 12}
// Template
<script>
var cat = {{.kitten}}
</script>
    // Javascript
var cat = {"Name":"Sam", "Age" 12}

Safe Strings and HTML Comments​

The html/template package will remove any comments from a template by default. This can cause issues when comments are necessary such as detecting internet explorer.

<!--[if IE]>
Place content here to target all Internet Explorer users.
<![endif]-->

We can use the Custom Functions method (Globally) to create a function that returns html preserving comments. Define a function htmlSafe in the FuncMap of the template.

    testTemplate, err = template.New("hello.gohtml").Funcs(template.FuncMap{
"htmlSafe": func(html string) template.HTML {
return template.HTML(html)
},
}).ParseFiles("hello.gohtml")

This function takes a string and produces the unaltered HTML code. This function can be used in a template like so to preserve the comments <!--[if IE 6]> and <![endif]--> :

    {{htmlSafe "<!--[if IE 6]>" }}
<meta http-equiv="Content-Type" content="text/html; charset=Unicode">
{{ htmlSafe "<![endif]-->" }}

Template Variables​

The dot character (.)​

A template variable can be a boolean, string, character, integer, floating-point, imaginary, or complex constant in Go syntax. Data passed to the template can be accessed using dot {{ . }}.

If the data is a complex type then it’s fields can be accessed using the dot with the field name {{ .FieldName }}.

Dots can be chained together if the data contains multiple complex structures. {{ .Struct.StructTwo.Field }}


Variables in Templates​

Data passed to the template can be saved in a variable and used throughout the template. {{$number := .}} We use the $number to create a variable then initialize it with the value passed to the template. To use the variable we call it in the template with {{$number}}.

    {{$number := .}}
<h1> It is day number {{$number}} of the month </h1>
    var tpl *template.Template

tpl = template.Must(template.ParseFiles("templateName"))

err := tpl.ExecuteTemplate(os.Stdout, "templateName", 23)

In this example we pass 23 to the template and stored in the $number variable which can be used anywhere in the template


Template Actions​

If/Else Statements​

Go templates support if/else statements like many programming languages. We can use the if statement to check for values, if it doesn’t exist we can use an else value. The empty values are false, 0, any nil pointer or interface value, and any array, slice, map, or string of length zero.

<h1>Hello, {{if .Name}} {{.Name}} {{else}} Anonymous {{end}}!</h1>

If .Name exists then Hello, Name will be printed (replaced with the name value) otherwise it will print Hello, Anonymous.

Templates also provide the else if statment {{else if .Name2 }} which can be used to evaluate other options after an if.


Removing Whitespace​

Adding different values to a template can add various amounts of whitespace. We can either change our template to better handle it, by ignoring or minimizing effects, or we can use the minus sign - within out template.

<h1>Hello, {{if .Name}} {{.Name}} {{- else}} Anonymous {{- end}}!</h1>

Here we are telling the template to remove all spaces between the Name variable and whatever comes after it. We are doing the same with the end keyword. This allows us to have whitespace within the template for easier reading but remove it in production.


Range Blocks​

Go templates have a range keyword to iterate over all objects in a structure. Suppose we had the Go structures:

    type Item struct {
Name string
Price int
}

type ViewData struct {
Name string
Items []Item
}

We have an Item, with a name and price, then a ViewData which is the structure sent to the template. Consider the template containing the following:

{{range .Items}}
<div class="item">
<h3 class="name">{{.Name}}</h3>
<span class="price">${{.Price}}</span>
</div>
{{end}}

For each Item in the range of Items (in the ViewData structure) get the Name and Price of that item and create html for each Item automatically. Within a range each Item becomes the {{.}} and the item properties therefore become {{.Name}} or {{.Price}} in this example.


Template Functions​

The template package provides a list of predefined global functions. Below are some of the most used.


Indexing structures in Templates​

If the data passed to the template is a map, slice, or array it can be indexed from the template. We use {{index x number}} where index is the keyword, x is the data and number is a integer for the index value. If we had {{index names 2}} it is equivalent to names[2]. We can add more integers to index deeper into data. {{index names 2 3 4}} is equivalent to names[2][3][4].

<body>
<h1>{{index .FavNums 2 }}</h1>
</body>
    type person struct {
Name string
FavNums []int
}

func main() {

tpl := template.Must(template.ParseGlob("*.gohtml"))
tpl.Execute(os.Stdout, &person{"Curtis", []int{7, 11, 94}})
}

This code example passes a person structure and gets the 3rd favourite number from the FavNums slice.


The and Function​

The and function returns the boolean AND of its arguments by returning the first empty argument or the last argument. and x y behaves logically as if x then y else x . Consider the following go code

    type User struct {
Admin bool
}

type ViewData struct {
*User
}

Pass a ViewData with a User that has Admin set true to the following template


{{if and .User .User.Admin}}
You are an admin user!
{{else}}
Access denied!
{{end}}

The result will be You are an admin user!. However if the ViewData did not include a *User object or Admin was set as false then the result will be Access denied!.


The or Function​

The or function operates similarly to the and function however will stop at the first true. or x y is equivalent to if x then x else y so y will never be evaluated if x is not empty.


The not Function​

The not function returns the boolean negation of the argument.

    {{ if not .Authenticated}}
Access Denied!
{{ end }}

Template Comparison Functions​

Comparisons​

The html/template package provides a variety of functions to do comparisons between operators. The operators may only be basic types or named basic types such as type Temp float32 Remember that template functions take the form {{ function arg1 arg2 }}.

  • eq Returns the result of arg1 == arg2
  • ne Returns the result of arg1 != arg2
  • lt Returns the result of arg1 < arg2
  • le Returns the result of arg1 <= arg2
  • gt Returns the result of arg1 > arg2
  • ge Returns the result of arg1 >= arg2

Of special note eq can be used with two or more arguments by comparing all arguments to the first. {{ eq arg1 arg2 arg3 arg4}} will result in the following logical expression:

arg1==arg2 || arg1==arg3 || arg1==arg4


Nested Templates and Layouts​

Nesting Templates​

Nested templates can be used for parts of code frequently used across templates, a footer or header for example. Rather than updating each template separately we can use a nested template that all other templates can use. You can define a template as follows:

    {{define "footer"}}
<footer>
<p>Here is the footer</p>
</footer>
{{end}}

A template named β€œfooter” is defined which can be used in other templates like so to add the footer template content into the other template:

    {{template "footer"}}

Passing Variables between Templates​

The template action used to include nested templates also allows a second parameter to pass data to the nested template.

// Define a nested template called header 
{{define "header"}}
<h1>{{.}}</h1>
{{end}}

// Call template and pass a name parameter
{{range .Items}}
<div class="item">
{{template "header" .Name}}
<span class="price">${{.Price}}</span>
</div>
{{end}}

We use the same range to loop through Items as before but we pass the name to the header template each time in this simple example.


Creating Layouts​

Glob patterns specify sets of filenames with wildcard characters. The template.ParseGlob(pattern string) function will parse all templates that match the string pattern. template.ParseFiles(files...) can also be used with a list of file names.

The templates are named by default based on the base names of the argument files. This mean views/layouts/hello.gohtml will have the name hello.gohtml . If the template has a `{{define β€œtemplateName”}} within it then that name will be usable.

A specific template can be executed using t.ExecuteTemplate(w, "templateName", nil) . t is an object of type Template, w is type io.Writer such as an http.ResponseWriter, Then there is the name of the template to execute, and finally passing any data to the template, in this case a nil value.

Example main.go file

    // Omitted imports & package

var LayoutDir string = "views/layouts"
var bootstrap *template.Template

func main() {
var err error
bootstrap, err = template.ParseGlob(LayoutDir + "/*.gohtml")
if err != nil {
panic(err)
}

http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}

func handler(w http.ResponseWriter, r *http.Request) {
bootstrap.ExecuteTemplate(w, "bootstrap", nil)
}

All .gohtml files are parsed in main. When route / is reached the template defined as bootstrap is executed using the handler function.

Example views/layouts/bootstrap.gohtml file

    {{define "bootstrap"}}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Go Templates</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<h1>Filler header</h1>
<p>Filler paragraph</p>
</div>
<!-- jquery & Bootstrap JS -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"
</script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js">
</script>
</body>
</html>
{{end}}

Templates Calling Functions​

Function Variables (calling struct methods)​

We can use templates to call the methods of objects in the template to return data. Consider the User struct with the following method.

    type User struct {
ID int
Email string
}

func (u User) HasPermission(feature string) bool {
if feature == "feature-a" {
return true
} else {
return false
}
}

When a type User has been passed to the template we can then call this method from the template.

{{if .User.HasPermission "feature-a"}}
<div class="feature">
<h3>Feature A</h3>
<p>Some other stuff here...</p>
</div>
{{else}}
<div class="feature disabled">
<h3>Feature A</h3>
<p>To enable Feature A please upgrade your plan</p>
</div>
{{end}}

The template checks if the User HasPermission for the feature and renders depending on the result.


Function Variables (call)​

If the Method HasPermission has to change at times then the Function Variables (Methods) implementation may not fit the design. Instead a HasPermission func(string) bool attribute can be added on the User type. This can then have a function assigned to it at creation.

    // Structs
type ViewData struct {
User User
}

type User struct {
ID int
Email string
HasPermission func(string) bool
}

// Example of creating a ViewData
vd := ViewData{
User: User{
ID: 1,
Email: "curtis.vermeeren@gmail.com",
// Create the HasPermission function
HasPermission: func(feature string) bool {
if feature == "feature-b" {
return true
}
return false
},
},
}

// Executing the ViewData with the template
err := testTemplate.Execute(w, vd)

We need to tell the Go template that we want to call this function so we must change the template from the Function Variables (Methods) implementation to do this. We use the call keyword supplied by the go html/template package. Changing the previous template to use call results in:

{{if (call .User.HasPermission "feature-b")}}
<div class="feature">
<h3>Feature B</h3>
<p>Some other stuff here...</p>
</div>
{{else}}
<div class="feature disabled">
<h3>Feature B</h3>
<p>To enable Feature B please upgrade your plan</p>
</div>
{{end}}

Custom Functions​

Another way to call functions is to create custom functions with template.FuncMap . This method creates global methods that can be used throughout the entire application. FuncMap has type map[string]interface{} mapping a string, the function name, to a function. The mapped functions must have either a single return value, or two return values where the second has type error.

    // Creating a template with function hasPermission
testTemplate, err = template.New("hello.gohtml").Funcs(template.FuncMap{
"hasPermission": func(user User, feature string) bool {
if user.ID == 1 && feature == "feature-a" {
return true
}
return false
},
}).ParseFiles("hello.gohtml")

Here the function to check if a user has permission for a feature is mapped to the string "hasPermission" and stored in the FuncMap. Note that the custom functions must be created before calling ParseFiles()

The function could be executed in the template as follows:

    {{ if hasPermission .User "feature-a" }}

The .User and string "feature-a" are both passed to hasPermission as arguments.


Custom Functions (Globally)​

The previous two methods of custom functions rely on .User being passed to the template. This works in many cases but in a large application passing too many objects to a template can become difficult to maintain across many templates. We can change the implementation of the custom function to work without the .User being passed.

Using a similar feature example as the other 2 sections first you would have to create a default hasPermission function and define it in the template’s function map.

      testTemplate, err = template.New("hello.gohtml").Funcs(template.FuncMap{
"hasPermission": func(feature string) bool {
return false
},
}).ParseFiles("hello.gohtml")

This function could be placed in main() or somewhere that ensures the default hasPermission is created in the hello.gohtml function map. The default function just returns false but it defines the function and implementation that doesn’t require User .

Next a closure could be used to redefine the hasPermission function. It would use the User data available when it is created in a handler rather than having User data passed to it. Within the handler for the template you can redefine any functions to use the information available.

    func handler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")

user := User{
ID: 1,
Email: "Curtis.vermeeren@gmail.com",
}
vd := ViewData{}
err := testTemplate.Funcs(template.FuncMap{
"hasPermission": func(feature string) bool {
if user.ID == 1 && feature == "feature-a" {
return true
}
return false
},
}).Execute(w, vd)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}

In this handler a User is created with ID and Email, Then a ViewData is created without passing the user to it. The hasPermission function is redefined using user.ID which is available when the function is created. {{if hasPermission "feature-a"}} can be used in a template without having to pass a User to the template as the User object in the handler is used instead.


+ + \ No newline at end of file diff --git a/template/html/index.html b/template/html/index.html index 31ccb952455..06b249c7dd3 100644 --- a/template/html/index.html +++ b/template/html/index.html @@ -6,8 +6,8 @@ HTML | Fiber - - + +
@@ -17,8 +17,8 @@ Security Linter

HTML is the official Go template engine html/template, to see the original syntax documentation please click here

Info:

All templates within the specified view directory are analyzed and compiled at the beginning to increase the performance when using them. Thus it should be noted that no definition with the same name should exist, otherwise they will overwrite each other. -For templating the {{embed}} tag should be used

Basic Example​

./views/index.html

{{template "partials/header" .}}

<h1>{{.Title}}</h1>

{{template "partials/footer" .}}

./views/partials/header.html

<h2>Header</h2>

./views/partials/footer.html

<h2>Footer</h2>

./views/layouts/main.html

<!DOCTYPE html>
<html>
<head>
<title>Main</title>
</head>

<body>
{{embed}}
</body>
</html>
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html/v2"
)

func main() {
// Create a new engine
engine := html.New("./views", ".html")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := html.NewFileSystem(http.Dir("./views", ".html"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

Example with embed.FS​

package main

import (
"log"
"net/http"
"embed"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"
)

//go:embed views/*
var viewsfs embed.FS

func main() {
engine := html.NewFileSystem(http.FS(viewsfs), ".html")

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})


app.Get("/", func(c *fiber.Ctx) error {
// Render index - start with views directory
return c.Render("views/index", fiber.Map{
"Title": "Hello, World!",
})
})

log.Fatal(app.Listen(":3000"))
}

and change the starting point to the views directory

./views/index.html

{{template "views/partials/header" .}}

<h1>{{.Title}}</h1>

{{template "views/partials/footer" .}}

Example with innerHTML​

package main

import (
"embed"
"html/template"
"log"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"
)

//go:embed views/*
var viewsfs embed.FS

func main() {
engine := html.NewFileSystem(http.FS(viewsfs), ".html")
engine.AddFunc(
// add unescape function
"unescape", func(s string) template.HTML {
return template.HTML(s)
},
)

// Pass the engine to the Views
app := fiber.New(fiber.Config{Views: engine})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("views/index", fiber.Map{
"Title": "Hello, <b>World</b>!",
})
})

log.Fatal(app.Listen(":3000"))
}

and change the starting point to the views directory

./views/index.html

<p>{{ unescape .Title}}</p>

html output

<p>Hello, <b>World</b>!</p>
- - +For templating the {{embed}} tag should be used

Basic Example​

./views/index.html

{{template "partials/header" .}}

<h1>{{.Title}}</h1>

{{template "partials/footer" .}}

./views/partials/header.html

<h2>Header</h2>

./views/partials/footer.html

<h2>Footer</h2>

./views/layouts/main.html

<!DOCTYPE html>
<html>
<head>
<title>Main</title>
</head>

<body>
{{embed}}
</body>
</html>
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html/v2"
)

func main() {
// Create a new engine
engine := html.New("./views", ".html")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := html.NewFileSystem(http.Dir("./views", ".html"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

Example with embed.FS​

package main

import (
"log"
"net/http"
"embed"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"
)

//go:embed views/*
var viewsfs embed.FS

func main() {
engine := html.NewFileSystem(http.FS(viewsfs), ".html")

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})


app.Get("/", func(c *fiber.Ctx) error {
// Render index - start with views directory
return c.Render("views/index", fiber.Map{
"Title": "Hello, World!",
})
})

log.Fatal(app.Listen(":3000"))
}

and change the starting point to the views directory

./views/index.html

{{template "views/partials/header" .}}

<h1>{{.Title}}</h1>

{{template "views/partials/footer" .}}

Example with innerHTML​

package main

import (
"embed"
"html/template"
"log"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"
)

//go:embed views/*
var viewsfs embed.FS

func main() {
engine := html.NewFileSystem(http.FS(viewsfs), ".html")
engine.AddFunc(
// add unescape function
"unescape", func(s string) template.HTML {
return template.HTML(s)
},
)

// Pass the engine to the Views
app := fiber.New(fiber.Config{Views: engine})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("views/index", fiber.Map{
"Title": "Hello, <b>World</b>!",
})
})

log.Fatal(app.Listen(":3000"))
}

and change the starting point to the views directory

./views/index.html

<p>{{ unescape .Title}}</p>

html output

<p>Hello, <b>World</b>!</p>
+ + \ No newline at end of file diff --git a/template/index.html b/template/index.html index 55100d3b1a3..9e7d0e4033f 100644 --- a/template/index.html +++ b/template/index.html @@ -6,13 +6,13 @@ πŸ‘‹ Welcome | Fiber - - + +
-

πŸ‘‹ Welcome

Fiber

This package provides universal methods to use multiple template engines with the Fiber web framework using the new Views interface that is available from > v1.11.1. Special thanks to @bdtomlin & @arsmn for helping!

9 template engines are supported:

Installation​

Go version 1.17 or higher is required.

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/template/any_template_engine/vX

Example​

package main

import (
"log"

"github.com/gofiber/fiber/v2"

// To use a specific template engine, import as shown below:
// "github.com/gofiber/template/pug"
// "github.com/gofiber/template/mustache"
// etc..

// In this example we use the html template engine
"github.com/gofiber/template/html/v2"
)

func main() {
// Create a new engine by passing the template folder
// and template extension using <engine>.New(dir, ext string)
engine := html.New("./views", ".html")

// We also support the http.FileSystem interface
// See examples below to load templates from embedded files
engine := html.NewFileSystem(http.Dir("./views"), ".html")

// Reload the templates on each render, good for development
engine.Reload(true) // Optional. Default: false

// Debug will print each template that is parsed, good for debugging
engine.Debug(true) // Optional. Default: false

// Layout defines the variable name that is used to yield templates within layouts
engine.Layout("embed") // Optional. Default: "embed"

// Delims sets the action delimiters to the specified strings
engine.Delims("{{", "}}") // Optional. Default: engine delimiters

// AddFunc adds a function to the template's global function map.
engine.AddFunc("greet", func(name string) string {
return "Hello, " + name + "!"
})

// After you created your engine, you can pass it to Fiber's Views Engine
app := fiber.New(fiber.Config{
Views: engine,
})

// To render a template, you can call the ctx.Render function
// Render(tmpl string, values interface{}, layout ...string)
app.Get("/", func(c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

// Render with layout example
app.Get("/layout", func(c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

More Examples​

To view more specific examples, you could visit each engine folder to learn more

embedded Systems​

We support the http.FileSystem interface, so you can use different libraries to load the templates from embedded binaries.

pkger​

Read documentation: https://github.com/markbates/pkger

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"

"github.com/markbates/pkger"
)

func main() {
engine := html.NewFileSystem(pkger.Dir("/views"), ".html")

app := fiber.New(fiber.Config{
Views: engine,
})

// run pkger && go build
}

packr​

Read documentation: https://github.com/gobuffalo/packr

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"

"github.com/gobuffalo/packr/v2"
)

func main() {
engine := html.NewFileSystem(packr.New("Templates", "/views"), ".html")

app := fiber.New(fiber.Config{
Views: engine,
})

// run packr && go build
}

go.rice​

Read documentation: https://github.com/GeertJohan/go.rice

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"

"github.com/GeertJohan/go.rice"
)

func main() {
engine := html.NewFileSystem(rice.MustFindBox("views").HTTPBox(), ".html")

app := fiber.New(fiber.Config{
Views: engine,
})

// run rice embed-go && go build
}

fileb0x​

Read documentation: https://github.com/UnnoTed/fileb0x

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"
// your generated package
"github.com/<user>/<repo>/static"
)

func main() {
engine := html.NewFileSystem(static.HTTP, ".html")

app := fiber.New(fiber.Config{
Views: engine,
})

// Read the documentation on how to use fileb0x
}

Benchmarks​

Simple​

Extended​

Benchmarks were ran on Apple Macbook M1. Each engine was benchmarked 20 times and the results averaged into a single xlsx file. Mustache was excluded from the extended benchmark

- - +

πŸ‘‹ Welcome

Fiber

This package provides universal methods to use multiple template engines with the Fiber web framework using the new Views interface that is available from > v1.11.1. Special thanks to @bdtomlin & @arsmn for helping!

9 template engines are supported:

Installation​

Go version 1.17 or higher is required.

go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/template/any_template_engine/vX

Example​

package main

import (
"log"

"github.com/gofiber/fiber/v2"

// To use a specific template engine, import as shown below:
// "github.com/gofiber/template/pug"
// "github.com/gofiber/template/mustache"
// etc..

// In this example we use the html template engine
"github.com/gofiber/template/html/v2"
)

func main() {
// Create a new engine by passing the template folder
// and template extension using <engine>.New(dir, ext string)
engine := html.New("./views", ".html")

// We also support the http.FileSystem interface
// See examples below to load templates from embedded files
engine := html.NewFileSystem(http.Dir("./views"), ".html")

// Reload the templates on each render, good for development
engine.Reload(true) // Optional. Default: false

// Debug will print each template that is parsed, good for debugging
engine.Debug(true) // Optional. Default: false

// Layout defines the variable name that is used to yield templates within layouts
engine.Layout("embed") // Optional. Default: "embed"

// Delims sets the action delimiters to the specified strings
engine.Delims("{{", "}}") // Optional. Default: engine delimiters

// AddFunc adds a function to the template's global function map.
engine.AddFunc("greet", func(name string) string {
return "Hello, " + name + "!"
})

// After you created your engine, you can pass it to Fiber's Views Engine
app := fiber.New(fiber.Config{
Views: engine,
})

// To render a template, you can call the ctx.Render function
// Render(tmpl string, values interface{}, layout ...string)
app.Get("/", func(c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

// Render with layout example
app.Get("/layout", func(c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

More Examples​

To view more specific examples, you could visit each engine folder to learn more

embedded Systems​

We support the http.FileSystem interface, so you can use different libraries to load the templates from embedded binaries.

pkger​

Read documentation: https://github.com/markbates/pkger

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"

"github.com/markbates/pkger"
)

func main() {
engine := html.NewFileSystem(pkger.Dir("/views"), ".html")

app := fiber.New(fiber.Config{
Views: engine,
})

// run pkger && go build
}

packr​

Read documentation: https://github.com/gobuffalo/packr

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"

"github.com/gobuffalo/packr/v2"
)

func main() {
engine := html.NewFileSystem(packr.New("Templates", "/views"), ".html")

app := fiber.New(fiber.Config{
Views: engine,
})

// run packr && go build
}

go.rice​

Read documentation: https://github.com/GeertJohan/go.rice

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"

"github.com/GeertJohan/go.rice"
)

func main() {
engine := html.NewFileSystem(rice.MustFindBox("views").HTTPBox(), ".html")

app := fiber.New(fiber.Config{
Views: engine,
})

// run rice embed-go && go build
}

fileb0x​

Read documentation: https://github.com/UnnoTed/fileb0x

package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"
// your generated package
"github.com/<user>/<repo>/static"
)

func main() {
engine := html.NewFileSystem(static.HTTP, ".html")

app := fiber.New(fiber.Config{
Views: engine,
})

// Read the documentation on how to use fileb0x
}

Benchmarks​

Simple​

Extended​

Benchmarks were ran on Apple Macbook M1. Each engine was benchmarked 20 times and the results averaged into a single xlsx file. Mustache was excluded from the extended benchmark

+ + \ No newline at end of file diff --git a/template/jet/index.html b/template/jet/index.html index c09c98db2ad..a67318ce900 100644 --- a/template/jet/index.html +++ b/template/jet/index.html @@ -6,8 +6,8 @@ Jet | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Jet is a template engine create by cloudykit, to see the original syntax documentation please click here

Basic Example​

./views/index.jet

{{include "partials/header"}}

<h1>{{ Title }}</h1>

{{include "partials/footer"}}

./views/partials/header.jet

<h2>Header</h2>

./views/partials/footer.jet

<h2>Footer</h2>

./views/layouts/main.jet

<!DOCTYPE html>
<html>

<head>
<title>Title</title>
</head>

<body>
{{ embed() }}
</body>

</html>
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/jet/v2"
)

func main() {
// Create a new engine
engine := jet.New("./views", ".jet")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := jet.NewFileSystem(http.Dir("./views", ".jet"))

// Pass the engine to the views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

- - +Linter

Jet is a template engine create by cloudykit, to see the original syntax documentation please click here

Basic Example​

./views/index.jet

{{include "partials/header"}}

<h1>{{ Title }}</h1>

{{include "partials/footer"}}

./views/partials/header.jet

<h2>Header</h2>

./views/partials/footer.jet

<h2>Footer</h2>

./views/layouts/main.jet

<!DOCTYPE html>
<html>

<head>
<title>Title</title>
</head>

<body>
{{ embed() }}
</body>

</html>
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/jet/v2"
)

func main() {
// Create a new engine
engine := jet.New("./views", ".jet")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := jet.NewFileSystem(http.Dir("./views", ".jet"))

// Pass the engine to the views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

+ + \ No newline at end of file diff --git a/template/mustache/index.html b/template/mustache/index.html index 8fdc8cb804b..ee0894a35b4 100644 --- a/template/mustache/index.html +++ b/template/mustache/index.html @@ -6,8 +6,8 @@ Mustache | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Mustache is a template engine created by hoisie/cbroglie, to see the original syntax documentation please click here

Basic Example​

./views/index.mustache

{{> views/partials/header }}

<h1>{{Title}}</h1>

{{> views/partials/footer }}

./views/partials/header.mustache

<h2>Header</h2>

./views/partials/footer.mustache

<h2>Footer</h2>

./views/layouts/main.mustache

<!DOCTYPE html>
<html>

<head>
<title>Main</title>
</head>

<body>
{{{embed}}}
</body>

</html>
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/mustache/v2"
)

func main() {
// Create a new engine
engine := mustache.New("./views", ".mustache")

// Or from an embedded system
// Note that with an embedded system the partials included from template files must be
// specified relative to the filesystem's root, not the current working directory
// engine := mustache.NewFileSystem(http.Dir("./views", ".mustache"), ".mustache")

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

- - +Linter

Mustache is a template engine created by hoisie/cbroglie, to see the original syntax documentation please click here

Basic Example​

./views/index.mustache

{{> views/partials/header }}

<h1>{{Title}}</h1>

{{> views/partials/footer }}

./views/partials/header.mustache

<h2>Header</h2>

./views/partials/footer.mustache

<h2>Footer</h2>

./views/layouts/main.mustache

<!DOCTYPE html>
<html>

<head>
<title>Main</title>
</head>

<body>
{{{embed}}}
</body>

</html>
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/mustache/v2"
)

func main() {
// Create a new engine
engine := mustache.New("./views", ".mustache")

// Or from an embedded system
// Note that with an embedded system the partials included from template files must be
// specified relative to the filesystem's root, not the current working directory
// engine := mustache.NewFileSystem(http.Dir("./views", ".mustache"), ".mustache")

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

+ + \ No newline at end of file diff --git a/template/pug/index.html b/template/pug/index.html index f1ce7a98cc0..4077bced501 100644 --- a/template/pug/index.html +++ b/template/pug/index.html @@ -6,8 +6,8 @@ Pug | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Pug is a template engine create by joker, to see the original syntax documentation please click here

Basic Example​

./views/index.pug

include partials/header.pug

h1 #{.Title}

include partials/footer.pug

./views/partials/header.pug

h2 Header

./views/partials/footer.pug

h2 Footer

./views/layouts/main.pug

doctype html
html
head
title Main
include ../partials/meta.pug
body
| {{embed}}
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/pug/v2"

// "net/http" // embedded system
)

func main() {
// Create a new engine
engine := pug.New("./views", ".pug")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := pug.NewFileSystem(http.Dir("./views", ".pug"))

// Pass the engine to the views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

- - +Linter

Pug is a template engine create by joker, to see the original syntax documentation please click here

Basic Example​

./views/index.pug

include partials/header.pug

h1 #{.Title}

include partials/footer.pug

./views/partials/header.pug

h2 Header

./views/partials/footer.pug

h2 Footer

./views/layouts/main.pug

doctype html
html
head
title Main
include ../partials/meta.pug
body
| {{embed}}
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/pug/v2"

// "net/http" // embedded system
)

func main() {
// Create a new engine
engine := pug.New("./views", ".pug")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := pug.NewFileSystem(http.Dir("./views", ".pug"))

// Pass the engine to the views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

+ + \ No newline at end of file diff --git a/template/slim/index.html b/template/slim/index.html index 0be1974cc68..81d84c77d01 100644 --- a/template/slim/index.html +++ b/template/slim/index.html @@ -6,8 +6,8 @@ Slim | Fiber - - + +
@@ -15,8 +15,8 @@ Discord Test Security -Linter

Slim is a template engine created by mattn, to see the original syntax documentation please click here

Basic Example​

./views/index.slim

== render("partials/header.slim")

h1 = Title

== render("partials/footer.slim")

./views/partials/header.slim

h2 = Header

./views/partials/footer.slim

h2 = Footer

./views/layouts/main.slim

doctype html
html
head
title Main
include ../partials/meta.slim
body
| {{embed}}
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/slim/v2"

// "net/http" // embedded system
)

func main() {
// Create a new engine
engine := slim.New("./views", ".slim")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := slim.NewFileSystem(http.Dir("./views", ".slim"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

- - +Linter

Slim is a template engine created by mattn, to see the original syntax documentation please click here

Basic Example​

./views/index.slim

== render("partials/header.slim")

h1 = Title

== render("partials/footer.slim")

./views/partials/header.slim

h2 = Header

./views/partials/footer.slim

h2 = Footer

./views/layouts/main.slim

doctype html
html
head
title Main
include ../partials/meta.slim
body
| {{embed}}
package main

import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/slim/v2"

// "net/http" // embedded system
)

func main() {
// Create a new engine
engine := slim.New("./views", ".slim")

// Or from an embedded system
// See github.com/gofiber/embed for examples
// engine := slim.NewFileSystem(http.Dir("./views", ".slim"))

// Pass the engine to the Views
app := fiber.New(fiber.Config{
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
})

log.Fatal(app.Listen(":3000"))
}

+ + \ No newline at end of file diff --git a/v1.x/api/app/index.html b/v1.x/api/app/index.html index f5cb4279622..03349e855cd 100644 --- a/v1.x/api/app/index.html +++ b/v1.x/api/app/index.html @@ -6,13 +6,13 @@ πŸš€ App | Fiber - - + +
-
Version: v1.x

πŸš€ App

New​

This method creates a new App named instance. You can pass optional settings when creating a new instance

Signature
fiber.New(settings ...*Settings) *App
Example
package main

import "github.com/gofiber/fiber"

func main() {
app := fiber.New()

// ...

app.Listen(3000)
}

Settings​

You can pass application settings when calling New.

Example
func main() {
// Pass Settings creating a new instance
app := fiber.New(&fiber.Settings{
Prefork: true,
CaseSensitive: true,
StrictRouting: true,
ServerHeader: "Fiber",
})

// ...

app.Listen(3000)
}

Or change the settings after initializing an app.

Example
func main() {
app := fiber.New()

// Or change Settings after creating an instance
app.Settings.Prefork = true
app.Settings.CaseSensitive = true
app.Settings.StrictRouting = true
app.Settings.ServerHeader = "Fiber"

// ...

app.Listen(3000)
}

Settings fields

PropertyTypeDescriptionDefault
PreforkboolEnables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding.false
ServerHeaderstringEnables the Server HTTP header with the given value.""
StrictRoutingboolWhen enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same.false
CaseSensitiveboolWhen enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same.false
ImmutableboolWhen enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see the issue #185.false
UnescapePathboolConverts all encoded characters in the route back before setting the path for the context, so that the routing can also work with urlencoded special charactersfalse
BodyLimitintSets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response.4 * 1024 * 1024
CompressedFileSuffixstringAdds suffix to the original file name and tries saving the resulting compressed file under the new file name.".fiber.gz"
ConcurrencyintMaximum number of concurrent connections.256 * 1024
DisableKeepaliveboolDisable keep-alive connections, the server will close incoming connections after sending the first response to clientfalse
DisableDefaultDateboolWhen set to true causes the default date header to be excluded from the response.false
DisableDefaultContentTypeboolWhen set to true, causes the default Content-Type header to be excluded from the Response.false
DisableStartupMessageboolWhen set to true, it will not print out the fiber ASCII and "listening" on messagefalse
DisableHeaderNormalizingboolBy default all header names are normalized: conteNT-tYPE -> Content-Typefalse
ETagboolEnable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled.false
ViewsViewsViews is the interface that wraps the Render function. See our Template Middleware for supported engines.nil
ReadTimeouttime.DurationThe amount of time allowed to read the full request, including body. The default timeout is unlimited.nil
WriteTimeouttime.DurationThe maximum duration before timing out writes of the response. The default timeout is unlimited.nil
IdleTimeouttime.DurationThe maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used.nil
ReadBufferSizeintper-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies).4096
WriteBufferSizeintPer-connection buffer size for responses' writing.4096

Static​

Use the Static method to serve static files such as images, CSS and JavaScript.

info

By default, Static will serve index.html files in response to a request on a directory.

Signature
app.Static(prefix, root string, config ...Static) // => with prefix

Use the following code to serve files in a directory named ./public

Example
app.Static("/", "./public")

// => http://localhost:3000/hello.html
// => http://localhost:3000/js/jquery.js
// => http://localhost:3000/css/style.css

To serve from multiple directories, you can use Static numerous times.

Example
// Serve files from "./public" directory:
app.Static("/", "./public")

// Serve files from "./files" directory:
app.Static("/", "./files")
info

Use a reverse proxy cache like NGINX to improve performance of serving static assets.

You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below:

Example
app.Static("/static", "./public")

// => http://localhost:3000/static/hello.html
// => http://localhost:3000/static/js/jquery.js
// => http://localhost:3000/static/css/style.css

If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings.

fiber.Static{}
// Static represents settings for serving static files
type Static struct {
// Transparently compresses responses if set to true
// This works differently than the github.com/gofiber/compression middleware
// The server tries minimizing CPU usage by caching compressed files.
// It adds ".fiber.gz" suffix to the original file name.
// Optional. Default value false
Compress bool
// Enables byte-range requests if set to true.
// Optional. Default value false
ByteRange bool
// Enable directory browsing.
// Optional. Default value false.
Browse bool
// File to serve when requesting a directory path.
// Optional. Default value "index.html".
Index string
}
Example
app.Static("/", "./public", fiber.Static{
Compress: true,
ByteRange: true,
Browse: true,
Index: "john.html"
})

HTTP Methods​

Routes an HTTP request, where METHOD is the HTTP method of the request.

Signatures
// Add allows you to specifiy a method as value
app.Add(method, path string, handlers ...func(*Ctx)) Router

// All will register the route on all methods
app.All(path string, handlers ...func(*Ctx)) Router

// HTTP methods
app.Get(path string, handlers ...func(*Ctx)) Router
app.Put(path string, handlers ...func(*Ctx)) Router
app.Post(path string, handlers ...func(*Ctx)) Router
app.Head(path string, handlers ...func(*Ctx)) Router
app.Patch(path string, handlers ...func(*Ctx)) Router
app.Trace(path string, handlers ...func(*Ctx)) Router
app.Delete(path string, handlers ...func(*Ctx)) Router
app.Connect(path string, handlers ...func(*Ctx)) Router
app.Options(path string, handlers ...func(*Ctx)) Router

// Use is mostly used for middleware modules
// These routes will only match the beggining of each path
// i.e. "/john" will match "/john/doe", "/johnnnn"
app.Use(handlers ...func(*Ctx)) Router
app.Use(prefix string, handlers ...func(*Ctx)) Router
Example
app.Use("/api", func(c *fiber.Ctx) {
c.Set("X-Custom-Header", random.String(32))
c.Next()
})
app.Get("/api/list", func(c *fiber.Ctx) {
c.Send("I'm a GET request!")
})
app.Post("/api/register", func(c *fiber.Ctx) {
c.Send("I'm a POST request!")
})

Group​

You can group routes by creating a *Group struct.

Signature

app.Group(prefix string, handlers ...func(*Ctx)) Router

Example

func main() {
app := fiber.New()

api := app.Group("/api", handler) // /api

v1 := api.Group("/v1", handler) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", handler) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

app.Listen(3000)
}

Stack​

This method returns the original router stack

Signature
app.Stack() [][]*Route
Example
app := fiber.New()

app.Use(handler)
app.Get("/john", handler)
app.Post("/register", handler)
app.Get("/v1/users", handler)
app.Put("/user/:id", handler)
app.Head("/xhr", handler)

data, _ := json.MarshalIndent(app.Stack(), "", " ")
fmt.Println(string(data))

Listen​

Binds and listens for connections on the specified address. This can be an int for port or string for address. This will listen either on tcp4 or tcp6 depending on the address input (i.e. :3000 / [::1]:3000 ).

Signature
app.Listen(address interface{}, tls ...*tls.Config) error
Examples
app.Listen(8080)
app.Listen("8080")
app.Listen(":8080")
app.Listen("127.0.0.1:8080")
app.Listen("[::1]:8080")

To enable TLS/HTTPS you can append a TLS config.

Example
cer, err := tls.LoadX509KeyPair("server.crt", "server.key")
if err != nil {
log.Fatal(err)
}
config := &tls.Config{Certificates: []tls.Certificate{cer}}

app.Listen(443, config)

Listener​

You can pass your own net.Listener using the Listener method.

Signature
app.Listener(ln net.Listener, tls ...*tls.Config) error
caution

Listener does not support the Prefork feature.

Example
if ln, err = net.Listen("tcp", ":8080"); err != nil {
log.Fatal(err)
}

app.Listener(ln)

Test​

Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 200ms if you want to disable a timeout altogether, pass -1 as a second argument.

Signature
app.Test(req *http.Request, msTimeout ...int) (*http.Response, error)
Example
// Create route with GET method for test:
app.Get("/", func(c *Ctx) {
fmt.Println(c.BaseURL()) // => http://google.com
fmt.Println(c.Get("X-Custom-Header")) // => hi

c.Send("hello, World!")
})

// http.Request
req := httptest.NewRequest("GET", "http://google.com", nil)
req.Header.Set("X-Custom-Header", "hi")

// http.Response
resp, _ := app.Test(req)

// Do something with results:
if resp.StatusCode == 200 {
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body)) // => Hello, World!
}
- - +
Version: v1.x

πŸš€ App

New​

This method creates a new App named instance. You can pass optional settings when creating a new instance

Signature
fiber.New(settings ...*Settings) *App
Example
package main

import "github.com/gofiber/fiber"

func main() {
app := fiber.New()

// ...

app.Listen(3000)
}

Settings​

You can pass application settings when calling New.

Example
func main() {
// Pass Settings creating a new instance
app := fiber.New(&fiber.Settings{
Prefork: true,
CaseSensitive: true,
StrictRouting: true,
ServerHeader: "Fiber",
})

// ...

app.Listen(3000)
}

Or change the settings after initializing an app.

Example
func main() {
app := fiber.New()

// Or change Settings after creating an instance
app.Settings.Prefork = true
app.Settings.CaseSensitive = true
app.Settings.StrictRouting = true
app.Settings.ServerHeader = "Fiber"

// ...

app.Listen(3000)
}

Settings fields

PropertyTypeDescriptionDefault
PreforkboolEnables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding.false
ServerHeaderstringEnables the Server HTTP header with the given value.""
StrictRoutingboolWhen enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same.false
CaseSensitiveboolWhen enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same.false
ImmutableboolWhen enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see the issue #185.false
UnescapePathboolConverts all encoded characters in the route back before setting the path for the context, so that the routing can also work with urlencoded special charactersfalse
BodyLimitintSets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response.4 * 1024 * 1024
CompressedFileSuffixstringAdds suffix to the original file name and tries saving the resulting compressed file under the new file name.".fiber.gz"
ConcurrencyintMaximum number of concurrent connections.256 * 1024
DisableKeepaliveboolDisable keep-alive connections, the server will close incoming connections after sending the first response to clientfalse
DisableDefaultDateboolWhen set to true causes the default date header to be excluded from the response.false
DisableDefaultContentTypeboolWhen set to true, causes the default Content-Type header to be excluded from the Response.false
DisableStartupMessageboolWhen set to true, it will not print out the fiber ASCII and "listening" on messagefalse
DisableHeaderNormalizingboolBy default all header names are normalized: conteNT-tYPE -> Content-Typefalse
ETagboolEnable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled.false
ViewsViewsViews is the interface that wraps the Render function. See our Template Middleware for supported engines.nil
ReadTimeouttime.DurationThe amount of time allowed to read the full request, including body. The default timeout is unlimited.nil
WriteTimeouttime.DurationThe maximum duration before timing out writes of the response. The default timeout is unlimited.nil
IdleTimeouttime.DurationThe maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used.nil
ReadBufferSizeintper-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies).4096
WriteBufferSizeintPer-connection buffer size for responses' writing.4096

Static​

Use the Static method to serve static files such as images, CSS and JavaScript.

info

By default, Static will serve index.html files in response to a request on a directory.

Signature
app.Static(prefix, root string, config ...Static) // => with prefix

Use the following code to serve files in a directory named ./public

Example
app.Static("/", "./public")

// => http://localhost:3000/hello.html
// => http://localhost:3000/js/jquery.js
// => http://localhost:3000/css/style.css

To serve from multiple directories, you can use Static numerous times.

Example
// Serve files from "./public" directory:
app.Static("/", "./public")

// Serve files from "./files" directory:
app.Static("/", "./files")
info

Use a reverse proxy cache like NGINX to improve performance of serving static assets.

You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below:

Example
app.Static("/static", "./public")

// => http://localhost:3000/static/hello.html
// => http://localhost:3000/static/js/jquery.js
// => http://localhost:3000/static/css/style.css

If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings.

fiber.Static{}
// Static represents settings for serving static files
type Static struct {
// Transparently compresses responses if set to true
// This works differently than the github.com/gofiber/compression middleware
// The server tries minimizing CPU usage by caching compressed files.
// It adds ".fiber.gz" suffix to the original file name.
// Optional. Default value false
Compress bool
// Enables byte-range requests if set to true.
// Optional. Default value false
ByteRange bool
// Enable directory browsing.
// Optional. Default value false.
Browse bool
// File to serve when requesting a directory path.
// Optional. Default value "index.html".
Index string
}
Example
app.Static("/", "./public", fiber.Static{
Compress: true,
ByteRange: true,
Browse: true,
Index: "john.html"
})

HTTP Methods​

Routes an HTTP request, where METHOD is the HTTP method of the request.

Signatures
// Add allows you to specifiy a method as value
app.Add(method, path string, handlers ...func(*Ctx)) Router

// All will register the route on all methods
app.All(path string, handlers ...func(*Ctx)) Router

// HTTP methods
app.Get(path string, handlers ...func(*Ctx)) Router
app.Put(path string, handlers ...func(*Ctx)) Router
app.Post(path string, handlers ...func(*Ctx)) Router
app.Head(path string, handlers ...func(*Ctx)) Router
app.Patch(path string, handlers ...func(*Ctx)) Router
app.Trace(path string, handlers ...func(*Ctx)) Router
app.Delete(path string, handlers ...func(*Ctx)) Router
app.Connect(path string, handlers ...func(*Ctx)) Router
app.Options(path string, handlers ...func(*Ctx)) Router

// Use is mostly used for middleware modules
// These routes will only match the beggining of each path
// i.e. "/john" will match "/john/doe", "/johnnnn"
app.Use(handlers ...func(*Ctx)) Router
app.Use(prefix string, handlers ...func(*Ctx)) Router
Example
app.Use("/api", func(c *fiber.Ctx) {
c.Set("X-Custom-Header", random.String(32))
c.Next()
})
app.Get("/api/list", func(c *fiber.Ctx) {
c.Send("I'm a GET request!")
})
app.Post("/api/register", func(c *fiber.Ctx) {
c.Send("I'm a POST request!")
})

Group​

You can group routes by creating a *Group struct.

Signature

app.Group(prefix string, handlers ...func(*Ctx)) Router

Example

func main() {
app := fiber.New()

api := app.Group("/api", handler) // /api

v1 := api.Group("/v1", handler) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", handler) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

app.Listen(3000)
}

Stack​

This method returns the original router stack

Signature
app.Stack() [][]*Route
Example
app := fiber.New()

app.Use(handler)
app.Get("/john", handler)
app.Post("/register", handler)
app.Get("/v1/users", handler)
app.Put("/user/:id", handler)
app.Head("/xhr", handler)

data, _ := json.MarshalIndent(app.Stack(), "", " ")
fmt.Println(string(data))

Listen​

Binds and listens for connections on the specified address. This can be an int for port or string for address. This will listen either on tcp4 or tcp6 depending on the address input (i.e. :3000 / [::1]:3000 ).

Signature
app.Listen(address interface{}, tls ...*tls.Config) error
Examples
app.Listen(8080)
app.Listen("8080")
app.Listen(":8080")
app.Listen("127.0.0.1:8080")
app.Listen("[::1]:8080")

To enable TLS/HTTPS you can append a TLS config.

Example
cer, err := tls.LoadX509KeyPair("server.crt", "server.key")
if err != nil {
log.Fatal(err)
}
config := &tls.Config{Certificates: []tls.Certificate{cer}}

app.Listen(443, config)

Listener​

You can pass your own net.Listener using the Listener method.

Signature
app.Listener(ln net.Listener, tls ...*tls.Config) error
caution

Listener does not support the Prefork feature.

Example
if ln, err = net.Listen("tcp", ":8080"); err != nil {
log.Fatal(err)
}

app.Listener(ln)

Test​

Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 200ms if you want to disable a timeout altogether, pass -1 as a second argument.

Signature
app.Test(req *http.Request, msTimeout ...int) (*http.Response, error)
Example
// Create route with GET method for test:
app.Get("/", func(c *Ctx) {
fmt.Println(c.BaseURL()) // => http://google.com
fmt.Println(c.Get("X-Custom-Header")) // => hi

c.Send("hello, World!")
})

// http.Request
req := httptest.NewRequest("GET", "http://google.com", nil)
req.Header.Set("X-Custom-Header", "hi")

// http.Response
resp, _ := app.Test(req)

// Do something with results:
if resp.StatusCode == 200 {
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body)) // => Hello, World!
}
+ + \ No newline at end of file diff --git a/v1.x/api/ctx/index.html b/v1.x/api/ctx/index.html index c3512489dbb..abcc0e664df 100644 --- a/v1.x/api/ctx/index.html +++ b/v1.x/api/ctx/index.html @@ -6,14 +6,14 @@ 🧠 Ctx | Fiber - - + +
Version: v1.x

🧠 Ctx

Accepts​

Checks, if the specified extensions or content types are acceptable.

info

Based on the request’s Accept HTTP header.

Signature
c.Accepts(types ...string)                 string
c.AcceptsCharsets(charsets ...string) string
c.AcceptsEncodings(encodings ...string) string
c.AcceptsLanguages(langs ...string) string
Example
// Accept: text/*, application/json

app.Get("/", func(c *fiber.Ctx) {
c.Accepts("html") // "html"
c.Accepts("text/html") // "text/html"
c.Accepts("json", "text") // "json"
c.Accepts("application/json") // "application/json"
c.Accepts("image/png") // ""
c.Accepts("png") // ""
})

Fiber provides similar functions for the other accept headers.

// Accept-Charset: utf-8, iso-8859-1;q=0.2
// Accept-Encoding: gzip, compress;q=0.2
// Accept-Language: en;q=0.8, nl, ru

app.Get("/", func(c *fiber.Ctx) {
c.AcceptsCharsets("utf-16", "iso-8859-1")
// "iso-8859-1"

c.AcceptsEncodings("compress", "br")
// "compress"

c.AcceptsLanguages("pt", "nl", "ru")
// "nl"
})

Append​

Appends the specified value to the HTTP response header field.

caution

If the header is not already set, it creates the header with the specified value.

Signature
c.Append(field, values ...string)
Example
app.Get("/", func(c *fiber.Ctx) {
c.Append("Link", "http://google.com", "http://localhost")
// => Link: http://localhost, http://google.com

c.Append("Link", "Test")
// => Link: http://localhost, http://google.com, Test
})

Attachment​

Sets the HTTP response Content-Disposition header field to attachment.

Signature
c.Attachment(file ...string)
Example
app.Get("/", func(c *fiber.Ctx) {
c.Attachment()
// => Content-Disposition: attachment

c.Attachment("./upload/images/logo.png")
// => Content-Disposition: attachment; filename="logo.png"
// => Content-Type: image/png
})

App​

Returns the *App reference so you could easily access all application settings.

Signature
c.App() *App
Example
app.Get("/bodylimit", func(c *fiber.Ctx) {
bodylimit := c.App().Settings.BodyLimit
c.Send(bodylimit)
})

BaseURL​

Returns the base URL (protocol + host) as a string.

Signature
c.BaseURL() string
Example
// GET https://example.com/page#chapter-1

app.Get("/", func(c *fiber.Ctx) {
c.BaseURL() // https://example.com
})

Body​

Returns the request body.

Signature
c.Body() string
Example
// curl -X POST http://localhost:8080 -d user=john

app.Post("/", func(c *fiber.Ctx) {
// Get raw body from POST request:
c.Body() // user=john
})

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more...

BodyParser​

Binds the request body to a struct. BodyParser supports decoding query parameters and the following content types based on the Content-Type header:

  • application/json
  • application/xml
  • application/x-www-form-urlencoded
  • multipart/form-data
Signature
c.BodyParser(out interface{}) error
Example
// Field names should start with an uppercase letter
type Person struct {
Name string `json:"name" xml:"name" form:"name"`
Pass string `json:"pass" xml:"pass" form:"pass"`
}

app.Post("/", func(c *fiber.Ctx) {
p := new(Person)

if err := c.BodyParser(p); err != nil {
log.Fatal(err)
}

log.Println(p.Name) // john
log.Println(p.Pass) // doe
})
// Run tests with the following curl commands

// curl -X POST -H "Content-Type: application/json" --data "{\"name\":\"john\",\"pass\":\"doe\"}" localhost:3000

// curl -X POST -H "Content-Type: application/xml" --data "<login><name>john</name><pass>doe</pass></login>" localhost:3000

// curl -X POST -H "Content-Type: application/x-www-form-urlencoded" --data "name=john&pass=doe" localhost:3000

// curl -X POST -F name=john -F pass=doe http://localhost:3000

// curl -X POST "http://localhost:3000/?name=john&pass=doe"

ClearCookie​

Expire a client cookie (or all cookies if left empty)

Signature
c.ClearCookie(key ...string)
Example
app.Get("/", func(c *fiber.Ctx) {
// Clears all cookies:
c.ClearCookie()

// Expire specific cookie by name:
c.ClearCookie("user")

// Expire multiple cookies by names:
c.ClearCookie("token", "session", "track_id", "version")
})
caution

Web browsers and other compliant clients will only clear the cookie if the given options are identical to those when creating the cookie, excluding expires and maxAge. ClearCookie will not set these values for you - a technique similar to the one shown below should be used to ensure your cookie is deleted.

Example
app.Get("/set", func(c *fiber.Ctx) {
c.Cookie(&fiber.Cookie{
Name: "token",
Value: "randomvalue",
Expires: time.Now().Add(24 * time.Hour),
HTTPOnly: true,
SameSite: "lax",
})
})

app.Get("/delete", func(c *fiber.Ctx) {
c.Cookie(&fiber.Cookie{
Name: "token",
// Set expiry date to the past
Expires: time.Now().Add(-(time.Hour * 2)),
HTTPOnly: true,
SameSite: "lax",
})
})

Context​

Returns context.Context that carries a deadline, a cancellation signal, and other values across API boundaries.

Signature

c.Context() context.Context

Set cookie

Signature

c.Cookie(*Cookie)
type Cookie struct {
Name string
Value string
Path string
Domain string
Expires time.Time
Secure bool
HTTPOnly bool
SameSite string // lax, strict, none
}
Example
app.Get("/", func(c *fiber.Ctx) {
// Create cookie
cookie := new(fiber.Cookie)
cookie.Name = "john"
cookie.Value = "doe"
cookie.Expires = time.Now().Add(24 * time.Hour)

// Set cookie
c.Cookie(cookie)
})

Cookies​

Get cookie value by key, you could pass an optional default value that will be returned if the cookie key does not exist.

Signatures

c.Cookies(key string, defaultValue ...string) string
Example
app.Get("/", func(c *fiber.Ctx) {
// Get cookie by key:
c.Cookies("name") // "john"
c.Cookies("empty", "doe") // "doe"
})

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more...

Download​

Transfers the file from path as an attachment.

Typically, browsers will prompt the user to download. By default, the Content-Disposition header filename= parameter is the file path (this typically appears in the browser dialog).

Override this default with the filename parameter.

Signature
c.Download(path, filename ...string) error
Example
app.Get("/", func(c *fiber.Ctx) {
if err := c.Download("./files/report-12345.pdf"); err != nil {
c.Next(err) // Pass err to fiber
}
// => Download report-12345.pdf

if err := c.Download("./files/report-12345.pdf", "report.pdf"); err != nil {
c.Next(err) // Pass err to fiber
}
// => Download report.pdf
})

Fasthttp​

You can still access and use all Fasthttp methods and properties.

Signature

info

Please read the Fasthttp Documentation for more information.

Example

app.Get("/", func(c *fiber.Ctx) {
c.Fasthttp.Request.Header.Method()
// => []byte("GET")

c.Fasthttp.Response.Write([]byte("Hello, World!"))
// => "Hello, World!"
})

Error​

This contains the error information that thrown by a panic or passed via the Next(err) method.

Signature
c.Error() error
Example
func main() {
app := fiber.New()
app.Post("/api/register", func (c *fiber.Ctx) {
if err := c.JSON(&User); err != nil {
c.Next(err)
}
})
app.Get("/api/user", func (c *fiber.Ctx) {
if err := c.JSON(&User); err != nil {
c.Next(err)
}
})
app.Put("/api/update", func (c *fiber.Ctx) {
if err := c.JSON(&User); err != nil {
c.Next(err)
}
})
app.Use("/api", func(c *fiber.Ctx) {
c.Set("Content-Type", "application/json")
c.Status(500).Send(c.Error())
})
app.Listen(1337)
}

Format​

Performs content-negotiation on the Accept HTTP header. It uses Accepts to select a proper format.

info

If the header is not specified or there is no proper format, text/plain is used.

Signature
c.Format(body interface{})
Example
app.Get("/", func(c *fiber.Ctx) {
// Accept: text/plain
c.Format("Hello, World!")
// => Hello, World!

// Accept: text/html
c.Format("Hello, World!")
// => <p>Hello, World!</p>

// Accept: application/json
c.Format("Hello, World!")
// => "Hello, World!"
})

FormFile​

MultipartForm files can be retrieved by name, the first file from the given key is returned.

Signature
c.FormFile(name string) (*multipart.FileHeader, error)
Example
app.Post("/", func(c *fiber.Ctx) {
// Get first file from form field "document":
file, err := c.FormFile("document")

// Check for errors:
if err == nil {
// Save file to root directory:
c.SaveFile(file, fmt.Sprintf("./%s", file.Filename))
}
})

FormValue​

Any form values can be retrieved by name, the first value from the given key is returned.

Signature
c.FormValue(name string) string
Example
app.Post("/", func(c *fiber.Ctx) {
// Get first value from form field "name":
c.FormValue("name")
// => "john" or "" if not exist
})

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more...

Fresh​

https://expressjs.com/en/4x/api.html#req.fresh

info

Not implemented yet, pull requests are welcome!

Get​

Returns the HTTP request header specified by the field.

tip

The match is case-insensitive.

Signature
c.Get(field string) string
Example
app.Get("/", func(c *fiber.Ctx) {
c.Get("Content-Type") // "text/plain"
c.Get("CoNtEnT-TypE") // "text/plain"
c.Get("something") // ""
})

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more...

Hostname​

Returns the hostname derived from the Host HTTP header.

Signature
c.Hostname() string
Example
// GET http://google.com/search

app.Get("/", func(c *fiber.Ctx) {
c.Hostname() // "google.com"
})

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more...

IP​

Returns the remote IP address of the request.

Signature
c.IP() string
Example
app.Get("/", func(c *fiber.Ctx) {
c.IP() // "127.0.0.1"
})

IPs​

Returns an array of IP addresses specified in the X-Forwarded-For request header.

Signature
c.IPs() []string
Example
// X-Forwarded-For: proxy1, 127.0.0.1, proxy3

app.Get("/", func(c *fiber.Ctx) {
c.IPs() // ["proxy1", "127.0.0.1", "proxy3"]
})

Is​

Returns the matching content type, if the incoming request’s Content-Type HTTP header field matches the MIME type specified by the type parameter.

info

If the request has no body, it returns false.

Signature
c.Is(t string) bool
Example
// Content-Type: text/html; charset=utf-8

app.Get("/", func(c *fiber.Ctx) {
c.Is("html") // true
c.Is(".html") // true
c.Is("json") // false
})

JSON​

Converts any interface or string to JSON using Jsoniter.

info

JSON also sets the content header to application/json.

Signature
c.JSON(v interface{}) error
Example
type SomeStruct struct {
Name string
Age uint8
}

app.Get("/json", func(c *fiber.Ctx) {
// Create data struct:
data := SomeStruct{
Name: "Grame",
Age: 20,
}

if err := c.JSON(data); err != nil {
c.Status(500).Send(err)
return
}
// => Content-Type: application/json
// => "{"Name": "Grame", "Age": 20}"

if err := c.JSON(fiber.Map{
"name": "Grame",
"age": 20,
}); err != nil {
c.Status(500).Send(err)
return
}
// => Content-Type: application/json
// => "{"name": "Grame", "age": 20}"
})

JSONP​

Sends a JSON response with JSONP support. This method is identical to JSON, except that it opts-in to JSONP callback support. By default, the callback name is simply callback.

Override this by passing a named string in the method.

Signature
c.JSONP(v interface{}, callback ...string) error
Example
type SomeStruct struct {
name string
age uint8
}

app.Get("/", func(c *fiber.Ctx) {
// Create data struct:
data := SomeStruct{
name: "Grame",
age: 20,
}

c.JSONP(data)
// => callback({"name": "Grame", "age": 20})

c.JSONP(data, "customFunc")
// => customFunc({"name": "Grame", "age": 20})
})

Joins the links followed by the property to populate the response’s Link HTTP header field.

Signature
c.Links(link ...string)
Example
app.Get("/", func(c *fiber.Ctx) {
c.Link(
"http://api.example.com/users?page=2", "next",
"http://api.example.com/users?page=5", "last",
)
// Link: <http://api.example.com/users?page=2>; rel="next",
// <http://api.example.com/users?page=5>; rel="last"
})

Locals​

A method that stores variables scoped to the request and, therefore, are available only to the routes that match the request.

tip

This is useful if you want to pass some specific data to the next middleware.

Signature
c.Locals(key string, value ...interface{}) interface{}
Example
app.Use(func(c *fiber.Ctx) {
c.Locals("user", "admin")
c.Next()
})

app.Get("/admin", func(c *fiber.Ctx) {
if c.Locals("user") == "admin" {
c.Status(200).Send("Welcome, admin!")
} else {
c.SendStatus(403) // => 403 Forbidden
}
})

Location​

Sets the response Location HTTP header to the specified path parameter.

Signature
c.Location(path string)
Example
app.Post("/", func(c *fiber.Ctx) {
c.Location("http://example.com")
c.Location("/foo/bar")
})

Method​

Returns a string corresponding to the HTTP method of the request: GET, POST, PUT, and so on.
-Optionally, you could override the method by passing a string.

Signature
c.Method(override ...string) string
Example
app.Post("/", func(c *fiber.Ctx) {
c.Method() // "POST"
})

MultipartForm​

To access multipart form entries, you can parse the binary with MultipartForm(). This returns a map[string][]string, so given a key, the value will be a string slice.

Signature
c.MultipartForm() (*multipart.Form, error)
Example
app.Post("/", func(c *fiber.Ctx) {
// Parse the multipart form:
if form, err := c.MultipartForm(); err == nil {
// => *multipart.Form

if token := form.Value["token"]; len(token) > 0 {
// Get key value:
fmt.Println(token[0])
}

// Get all files from "documents" key:
files := form.File["documents"]
// => []*multipart.FileHeader

// Loop through files:
for _, file := range files {
fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])
// => "tutorial.pdf" 360641 "application/pdf"

// Save the files to disk:
c.SaveFile(file, fmt.Sprintf("./%s", file.Filename))
}
}
})

Next​

When Next is called, it executes the next method in the stack that matches the current route. You can pass an error struct within the method that will end the chaining and call the error handler.

Signature
c.Next(err ...error)
Example
app.Get("/", func(c *fiber.Ctx) {
fmt.Println("1st route!")
c.Next()
})

app.Get("*", func(c *fiber.Ctx) {
fmt.Println("2nd route!")
c.Next()
})

app.Get("/", func(c *fiber.Ctx) {
fmt.Println("3rd route!")
c.Send("Hello, World!")
})

OriginalURL​

Returns the original request URL.

Signature
c.OriginalURL() string
Example
// GET http://example.com/search?q=something

app.Get("/", func(c *fiber.Ctx) {
c.OriginalURL() // "/search?q=something"
})

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more...

Params​

Method can be used to get the route parameters, you could pass an optional default value that will be returned if the param key does not exist.

info

Defaults to empty string (""), if the param doesn't exist.

Signature
c.Params(param string, defaultValue ...string) string
Example
// GET http://example.com/user/fenny

app.Get("/user/:name", func(c *fiber.Ctx) {
c.Params("name") // "fenny"
c.Params("age", "21") // "21"
})

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more...__

Path​

Contains the path part of the request URL. Optionally, you could override the path by passing a string.

Signature
c.Path(override ...string) string
Example
// GET http://example.com/users?sort=desc

app.Get("/users", func(c *fiber.Ctx) {
c.Path() // "/users"
})

Protocol​

Contains the request protocol string: http or https for TLS requests.

Signature
c.Protocol() string
Example
// GET http://example.com

app.Get("/", func(c *fiber.Ctx) {
c.Protocol() // "http"
})

Query​

This property is an object containing a property for each query string parameter in the route, you could pass an optional default value that will be returned if the query key does not exist.

info

If there is no query string, it returns an empty string.

Signature
c.Query(parameter string, defaultValue ...string) string
Example
// GET http://example.com/shoes?order=desc&brand=nike

app.Get("/", func(c *fiber.Ctx) {
c.Query("order") // "desc"
c.Query("brand") // "nike"
c.Query("empty", "nike") // "nike"
})

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more...

QueryParser​

This method is similar to BodyParser, but for query parameters.

Signature
c.QueryParser(out interface{}) error
Example
// Field names should start with an uppercase letter
type Person struct {
Name string `query:"name"`
Pass string `query:"pass"`
Products []string `query:"products"`
}

app.Post("/", func(c *fiber.Ctx) {
p := new(Person)

if err := c.QueryParser(p); err != nil {
log.Fatal(err)
}

log.Println(p.Name) // john
log.Println(p.Pass) // doe
log.Println(p.Products) // [shoe, hat]
})
// Run tests with the following curl command

// curl -X POST "http://localhost:3000/?name=john&pass=doe&products=shoe,hat"

Range​

A struct containing the type and a slice of ranges will be returned.

Signature
c.Range(int size)
Example
// Range: bytes=500-700, 700-900
app.Get("/", func(c *fiber.Ctx) {
b := c.Range(1000)
if b.Type == "bytes" {
for r := range r.Ranges {
fmt.Println(r)
// [500, 700]
}
}
})

Redirect​

Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code.

info

If not specified, status defaults to 302 Found.

Signature
c.Redirect(path string, status ...int)
Example
app.Get("/coffee", func(c *fiber.Ctx) {
c.Redirect("/teapot")
})

app.Get("/teapot", func(c *fiber.Ctx) {
c.Status(fiber.StatusTeapot).Send("🍡 short and stout 🍡")
})
More examples
app.Get("/", func(c *fiber.Ctx) {
c.Redirect("/foo/bar")
c.Redirect("../login")
c.Redirect("http://example.com")
c.Redirect("http://example.com", 301)
})

Render​

Renders a view with data and sends a text/html response. By default Render uses the default Go Template engine. If you want to use another View engine, please take a look at our Template middleware.

Signature
c.Render(file string, data interface{}, layout ...string) error

Route​

Returns the matched Route struct.

Signature
c.Route() *Route
Example
// http://localhost:8080/hello

handler := func(c *fiber.Ctx) {
r := c.Route()
fmt.Println(r.Method, r.Path, r.Params, r.Handlers)
// GET /hello/:name handler [name]
}

app.Get("/hello/:name", handler )

SaveFile​

Method is used to save any multipart file to disk.

Signature
c.SaveFile(fh *multipart.FileHeader, path string)
Example
app.Post("/", func(c *fiber.Ctx) {
// Parse the multipart form:
if form, err := c.MultipartForm(); err == nil {
// => *multipart.Form

// Get all files from "documents" key:
files := form.File["documents"]
// => []*multipart.FileHeader

// Loop through files:
for _, file := range files {
fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])
// => "tutorial.pdf" 360641 "application/pdf"

// Save the files to disk:
c.SaveFile(file, fmt.Sprintf("./%s", file.Filename))
}
}
})

Secure​

A boolean property that is true , if a TLS connection is established.

Signature
c.Secure() bool
Example
// Secure() method is equivalent to:
c.Protocol() == "https"

Send​

Sets the HTTP response body. The Send body can be of any type.

caution

Send doesn't append like the Write method.

Signature
c.Send(body ...interface{})
Example
app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!") // => "Hello, World!"
c.Send([]byte("Hello, World!")) // => "Hello, World!"
c.Send(123) // => 123
})

Fiber also provides SendBytes ,SendString and SendStream methods for raw inputs.

tip

Use this if you don't need type assertion, recommended for faster performance.

Signature
c.SendBytes(b []byte)
c.SendString(s string)
c.SendStream(r io.Reader, s ...int)
Example
app.Get("/", func(c *fiber.Ctx) {
c.SendByte([]byte("Hello, World!"))
// => "Hello, World!"

c.SendString("Hello, World!")
// => "Hello, World!"

c.SendStream(bytes.NewReader([]byte("Hello, World!")))
// => "Hello, World!"
})

SendFile​

Transfers the file from the given path. Sets the Content-Type response HTTP header field based on the filenames extension.

caution

Method use gzipping by default, set it to true to disable.

Signature
c.SendFile(path string, compress ...bool) error
Example
app.Get("/not-found", func(c *fiber.Ctx) {
if err := c.SendFile("./public/404.html"); err != nil {
c.Next(err) // pass err to ErrorHandler
}

// Enable compression
if err := c.SendFile("./static/index.html", true); err != nil {
c.Next(err) // pass err to ErrorHandler
}
})

SendStatus​

Sets the status code and the correct status message in the body, if the response body is empty.

tip

You can find all used status codes and messages here.

Signature
c.SendStatus(status int)
Example
app.Get("/not-found", func(c *fiber.Ctx) {
c.SendStatus(415)
// => 415 "Unsupported Media Type"

c.Send("Hello, World!")
c.SendStatus(415)
// => 415 "Hello, World!"
})

Set​

Sets the response’s HTTP header field to the specified key, value.

Signature
c.Set(field, value string)
Example
app.Get("/", func(c *fiber.Ctx) {
c.Set("Content-Type", "text/plain")
// => "Content-type: text/plain"
})

Stale​

https://expressjs.com/en/4x/api.html#req.fresh

info

Not implemented yet, pull requests are welcome!

Status​

Sets the HTTP status for the response.

info

Method is a chainable.

Signature
c.Status(status int)
Example
app.Get("/", func(c *fiber.Ctx) {
c.Status(200)
c.Status(400).Send("Bad Request")
c.Status(404).SendFile("./public/gopher.png")
})

Subdomains​

Returns a string slice of subdomains in the domain name of the request.

The application property subdomain offset, which defaults to 2, is used for determining the beginning of the subdomain segments.

Signature
c.Subdomains(offset ...int) []string
Example
// Host: "tobi.ferrets.example.com"

app.Get("/", func(c *fiber.Ctx) {
c.Subdomains() // ["ferrets", "tobi"]
c.Subdomains(1) // ["tobi"]
})

Type​

Sets the Content-Type HTTP header to the MIME type listed here specified by the file extension.

Signature
c.Type(t string) string
Example
app.Get("/", func(c *fiber.Ctx) {
c.Type(".html") // => "text/html"
c.Type("html") // => "text/html"
c.Type("json") // => "application/json"
c.Type("png") // => "image/png"
})

Vary​

Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location.

info

Multiple fields are allowed.

Signature
c.Vary(field ...string)
Example
app.Get("/", func(c *fiber.Ctx) {
c.Vary("Origin") // => Vary: Origin
c.Vary("User-Agent") // => Vary: Origin, User-Agent

// No duplicates
c.Vary("Origin") // => Vary: Origin, User-Agent

c.Vary("Accept-Encoding", "Accept")
// => Vary: Origin, User-Agent, Accept-Encoding, Accept
})

Write​

Appends any input to the HTTP body response.

Signature
c.Write(body ...interface{})
Example
app.Get("/", func(c *fiber.Ctx) {
c.Write("Hello, ") // => "Hello, "
c.Write([]byte("World! ")) // => "Hello, World! "
c.Write(123) // => "Hello, World! 123"
})

XHR​

A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery).

Signature
c.XHR() bool
Example
// X-Requested-With: XMLHttpRequest

app.Get("/", func(c *fiber.Ctx) {
c.XHR() // true
})
- - +Optionally, you could override the method by passing a string.

Signature
c.Method(override ...string) string
Example
app.Post("/", func(c *fiber.Ctx) {
c.Method() // "POST"
})

MultipartForm​

To access multipart form entries, you can parse the binary with MultipartForm(). This returns a map[string][]string, so given a key, the value will be a string slice.

Signature
c.MultipartForm() (*multipart.Form, error)
Example
app.Post("/", func(c *fiber.Ctx) {
// Parse the multipart form:
if form, err := c.MultipartForm(); err == nil {
// => *multipart.Form

if token := form.Value["token"]; len(token) > 0 {
// Get key value:
fmt.Println(token[0])
}

// Get all files from "documents" key:
files := form.File["documents"]
// => []*multipart.FileHeader

// Loop through files:
for _, file := range files {
fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])
// => "tutorial.pdf" 360641 "application/pdf"

// Save the files to disk:
c.SaveFile(file, fmt.Sprintf("./%s", file.Filename))
}
}
})

Next​

When Next is called, it executes the next method in the stack that matches the current route. You can pass an error struct within the method that will end the chaining and call the error handler.

Signature
c.Next(err ...error)
Example
app.Get("/", func(c *fiber.Ctx) {
fmt.Println("1st route!")
c.Next()
})

app.Get("*", func(c *fiber.Ctx) {
fmt.Println("2nd route!")
c.Next()
})

app.Get("/", func(c *fiber.Ctx) {
fmt.Println("3rd route!")
c.Send("Hello, World!")
})

OriginalURL​

Returns the original request URL.

Signature
c.OriginalURL() string
Example
// GET http://example.com/search?q=something

app.Get("/", func(c *fiber.Ctx) {
c.OriginalURL() // "/search?q=something"
})

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more...

Params​

Method can be used to get the route parameters, you could pass an optional default value that will be returned if the param key does not exist.

info

Defaults to empty string (""), if the param doesn't exist.

Signature
c.Params(param string, defaultValue ...string) string
Example
// GET http://example.com/user/fenny

app.Get("/user/:name", func(c *fiber.Ctx) {
c.Params("name") // "fenny"
c.Params("age", "21") // "21"
})

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more...__

Path​

Contains the path part of the request URL. Optionally, you could override the path by passing a string.

Signature
c.Path(override ...string) string
Example
// GET http://example.com/users?sort=desc

app.Get("/users", func(c *fiber.Ctx) {
c.Path() // "/users"
})

Protocol​

Contains the request protocol string: http or https for TLS requests.

Signature
c.Protocol() string
Example
// GET http://example.com

app.Get("/", func(c *fiber.Ctx) {
c.Protocol() // "http"
})

Query​

This property is an object containing a property for each query string parameter in the route, you could pass an optional default value that will be returned if the query key does not exist.

info

If there is no query string, it returns an empty string.

Signature
c.Query(parameter string, defaultValue ...string) string
Example
// GET http://example.com/shoes?order=desc&brand=nike

app.Get("/", func(c *fiber.Ctx) {
c.Query("order") // "desc"
c.Query("brand") // "nike"
c.Query("empty", "nike") // "nike"
})

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more...

QueryParser​

This method is similar to BodyParser, but for query parameters.

Signature
c.QueryParser(out interface{}) error
Example
// Field names should start with an uppercase letter
type Person struct {
Name string `query:"name"`
Pass string `query:"pass"`
Products []string `query:"products"`
}

app.Post("/", func(c *fiber.Ctx) {
p := new(Person)

if err := c.QueryParser(p); err != nil {
log.Fatal(err)
}

log.Println(p.Name) // john
log.Println(p.Pass) // doe
log.Println(p.Products) // [shoe, hat]
})
// Run tests with the following curl command

// curl -X POST "http://localhost:3000/?name=john&pass=doe&products=shoe,hat"

Range​

A struct containing the type and a slice of ranges will be returned.

Signature
c.Range(int size)
Example
// Range: bytes=500-700, 700-900
app.Get("/", func(c *fiber.Ctx) {
b := c.Range(1000)
if b.Type == "bytes" {
for r := range r.Ranges {
fmt.Println(r)
// [500, 700]
}
}
})

Redirect​

Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code.

info

If not specified, status defaults to 302 Found.

Signature
c.Redirect(path string, status ...int)
Example
app.Get("/coffee", func(c *fiber.Ctx) {
c.Redirect("/teapot")
})

app.Get("/teapot", func(c *fiber.Ctx) {
c.Status(fiber.StatusTeapot).Send("🍡 short and stout 🍡")
})
More examples
app.Get("/", func(c *fiber.Ctx) {
c.Redirect("/foo/bar")
c.Redirect("../login")
c.Redirect("http://example.com")
c.Redirect("http://example.com", 301)
})

Render​

Renders a view with data and sends a text/html response. By default Render uses the default Go Template engine. If you want to use another View engine, please take a look at our Template middleware.

Signature
c.Render(file string, data interface{}, layout ...string) error

Route​

Returns the matched Route struct.

Signature
c.Route() *Route
Example
// http://localhost:8080/hello

handler := func(c *fiber.Ctx) {
r := c.Route()
fmt.Println(r.Method, r.Path, r.Params, r.Handlers)
// GET /hello/:name handler [name]
}

app.Get("/hello/:name", handler )

SaveFile​

Method is used to save any multipart file to disk.

Signature
c.SaveFile(fh *multipart.FileHeader, path string)
Example
app.Post("/", func(c *fiber.Ctx) {
// Parse the multipart form:
if form, err := c.MultipartForm(); err == nil {
// => *multipart.Form

// Get all files from "documents" key:
files := form.File["documents"]
// => []*multipart.FileHeader

// Loop through files:
for _, file := range files {
fmt.Println(file.Filename, file.Size, file.Header["Content-Type"][0])
// => "tutorial.pdf" 360641 "application/pdf"

// Save the files to disk:
c.SaveFile(file, fmt.Sprintf("./%s", file.Filename))
}
}
})

Secure​

A boolean property that is true , if a TLS connection is established.

Signature
c.Secure() bool
Example
// Secure() method is equivalent to:
c.Protocol() == "https"

Send​

Sets the HTTP response body. The Send body can be of any type.

caution

Send doesn't append like the Write method.

Signature
c.Send(body ...interface{})
Example
app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!") // => "Hello, World!"
c.Send([]byte("Hello, World!")) // => "Hello, World!"
c.Send(123) // => 123
})

Fiber also provides SendBytes ,SendString and SendStream methods for raw inputs.

tip

Use this if you don't need type assertion, recommended for faster performance.

Signature
c.SendBytes(b []byte)
c.SendString(s string)
c.SendStream(r io.Reader, s ...int)
Example
app.Get("/", func(c *fiber.Ctx) {
c.SendByte([]byte("Hello, World!"))
// => "Hello, World!"

c.SendString("Hello, World!")
// => "Hello, World!"

c.SendStream(bytes.NewReader([]byte("Hello, World!")))
// => "Hello, World!"
})

SendFile​

Transfers the file from the given path. Sets the Content-Type response HTTP header field based on the filenames extension.

caution

Method use gzipping by default, set it to true to disable.

Signature
c.SendFile(path string, compress ...bool) error
Example
app.Get("/not-found", func(c *fiber.Ctx) {
if err := c.SendFile("./public/404.html"); err != nil {
c.Next(err) // pass err to ErrorHandler
}

// Enable compression
if err := c.SendFile("./static/index.html", true); err != nil {
c.Next(err) // pass err to ErrorHandler
}
})

SendStatus​

Sets the status code and the correct status message in the body, if the response body is empty.

tip

You can find all used status codes and messages here.

Signature
c.SendStatus(status int)
Example
app.Get("/not-found", func(c *fiber.Ctx) {
c.SendStatus(415)
// => 415 "Unsupported Media Type"

c.Send("Hello, World!")
c.SendStatus(415)
// => 415 "Hello, World!"
})

Set​

Sets the response’s HTTP header field to the specified key, value.

Signature
c.Set(field, value string)
Example
app.Get("/", func(c *fiber.Ctx) {
c.Set("Content-Type", "text/plain")
// => "Content-type: text/plain"
})

Stale​

https://expressjs.com/en/4x/api.html#req.fresh

info

Not implemented yet, pull requests are welcome!

Status​

Sets the HTTP status for the response.

info

Method is a chainable.

Signature
c.Status(status int)
Example
app.Get("/", func(c *fiber.Ctx) {
c.Status(200)
c.Status(400).Send("Bad Request")
c.Status(404).SendFile("./public/gopher.png")
})

Subdomains​

Returns a string slice of subdomains in the domain name of the request.

The application property subdomain offset, which defaults to 2, is used for determining the beginning of the subdomain segments.

Signature
c.Subdomains(offset ...int) []string
Example
// Host: "tobi.ferrets.example.com"

app.Get("/", func(c *fiber.Ctx) {
c.Subdomains() // ["ferrets", "tobi"]
c.Subdomains(1) // ["tobi"]
})

Type​

Sets the Content-Type HTTP header to the MIME type listed here specified by the file extension.

Signature
c.Type(t string) string
Example
app.Get("/", func(c *fiber.Ctx) {
c.Type(".html") // => "text/html"
c.Type("html") // => "text/html"
c.Type("json") // => "application/json"
c.Type("png") // => "image/png"
})

Vary​

Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location.

info

Multiple fields are allowed.

Signature
c.Vary(field ...string)
Example
app.Get("/", func(c *fiber.Ctx) {
c.Vary("Origin") // => Vary: Origin
c.Vary("User-Agent") // => Vary: Origin, User-Agent

// No duplicates
c.Vary("Origin") // => Vary: Origin, User-Agent

c.Vary("Accept-Encoding", "Accept")
// => Vary: Origin, User-Agent, Accept-Encoding, Accept
})

Write​

Appends any input to the HTTP body response.

Signature
c.Write(body ...interface{})
Example
app.Get("/", func(c *fiber.Ctx) {
c.Write("Hello, ") // => "Hello, "
c.Write([]byte("World! ")) // => "Hello, World! "
c.Write(123) // => "Hello, World! 123"
})

XHR​

A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery).

Signature
c.XHR() bool
Example
// X-Requested-With: XMLHttpRequest

app.Get("/", func(c *fiber.Ctx) {
c.XHR() // true
})
+ + \ No newline at end of file diff --git a/v1.x/api/middleware/index.html b/v1.x/api/middleware/index.html index d4912120acc..7de3f59c3e3 100644 --- a/v1.x/api/middleware/index.html +++ b/v1.x/api/middleware/index.html @@ -6,14 +6,14 @@ 🧬 Middleware | Fiber - - + +
Version: v1.x

🧬 Middleware

Fiber ships with multiple middleware modules by default:

import (
"github.com/gofiber/fiber"
"github.com/gofiber/fiber/middleware"
)
  • ****Compress Compress middleware that supports deflate, gzip and brotli compression.
  • ****FileSystem FileSystem middleware for Fiber, special thanks and credits to Alireza Salary
  • Favicon Ignore favicon from logs or serve from memory if a file path is provided.
  • Logger HTTP request/response logger.
  • Pprof HTTP server runtime profiling
  • Recover Recover middleware recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.
  • RequestID Request ID middleware generates a unique id for a request.
  • Timeout A wrapper function for handlers which will raise an error if the handler takes longer than a set amount of time to return

Fiber also maintains external middleware modules, these have to be installed separately:

import (
"github.com/gofiber/fiber"
"github.com/gofiber/<module>"
)
  • gofiber/adaptor Converter for net/http handlers to/from Fiber request handlers.
  • gofiber/basicauth Basic auth middleware provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized for missing or invalid credentials.
  • gofiber/cors Enable cross-origin resource sharing (CORS) with various options.
  • gofiber/csrf Protect from CSRF exploits.
  • gofiber/helmet Helps secure your apps by setting various HTTP headers.
  • gofiber/jwt JWT returns a JSON Web Token (JWT) auth middleware.
  • gofiber/keyauth Key auth middleware provides a key-based authentication.
  • gofiber/limiter Rate-limiting middleware for Fiber. Use to limit repeated requests to public APIs and/or endpoints such as password reset.
  • gofiber/rewrite Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links.
  • gofiber/session This session middleware is built on top of fasthttp/session by @savsgio MIT. Special thanks to
  • gofiber/template This package contains 8 template engines
  • gofiber/websocket Based on Gorilla WebSocket for Fiber

Compress​

Compress middleware for with support for deflate, gzip and brotlicompression.
-It will use the fastest compression method depending on the request header Accept-Encodingvalue.

Signature
func Compress(options ...interface{}) fiber.Handler {}
Config
type CompressConfig struct {
// Next defines a function to skip this middleware.
// Default: nil
Next func(*fiber.Ctx) bool

// Compression level for brotli, gzip and deflate
// CompressLevelDisabled = -1
// CompressLevelDefault = 0
// CompressLevelBestSpeed = 1
// CompressLevelBestCompression = 2
// Default: CompressLevelDefault
Level int
}
Example
// Compression handler with default settings
app.Use(middleware.Compress())

// Provide a custom compression level
app.Use(middleware.Compress(2))

// Pass a next function to skip specific requests
app.Use(middleware.Compress(func(c *fiber.Ctx) bool {
return c.Path() == "/dontcompress"
}))

// Provide a full Config
app.Use(middleware.Compress(middleware.CompressConfig{
Next: func(c *fiber.Ctx) bool {
return c.Path() == "/dontcompress"
},
Level: CompressLevelDefault,
})

Skipping middleware execution​

When adding middleware to your application, you can also specify when the middleware should be activated and when it should not through a function passed when initialising the middleware using a function passed in the configuration for the middleware.

Signature
func (*fiber.Ctx) bool

This function should return true if the middleware should be deactivated. For example, if you would like admin users to be exempt from rate-limiting, you could do something like this:

Example
app.Use(limiter.New(limiter.Config{
Timeout: 10,
Max: 3,
Filter: func (c *fiber.Ctx) bool {
var isUserAdmin bool
// Your logic here
return isUserAdmin
}
}))
caution

If you are using middleware that is included with Fiber by default (for example Compress or Logger), you should use the Next field instead of the Filter field. For example:

Example
app.Use(middleware.Logger(middleware.LoggerConfig{
Format: "${time} ${method} ${path}",
TimeFormat: "15:04:05",
TimeZone: "Asia/Chongqing",
Next: func (c *fiber.Ctx) bool {
var isUserAdmin bool
// Your logic here
return isUserAdmin
}
}))

FileSystem​

Favicon​

- - +It will use the fastest compression method depending on the request header Accept-Encodingvalue.

Signature
func Compress(options ...interface{}) fiber.Handler {}
Config
type CompressConfig struct {
// Next defines a function to skip this middleware.
// Default: nil
Next func(*fiber.Ctx) bool

// Compression level for brotli, gzip and deflate
// CompressLevelDisabled = -1
// CompressLevelDefault = 0
// CompressLevelBestSpeed = 1
// CompressLevelBestCompression = 2
// Default: CompressLevelDefault
Level int
}
Example
// Compression handler with default settings
app.Use(middleware.Compress())

// Provide a custom compression level
app.Use(middleware.Compress(2))

// Pass a next function to skip specific requests
app.Use(middleware.Compress(func(c *fiber.Ctx) bool {
return c.Path() == "/dontcompress"
}))

// Provide a full Config
app.Use(middleware.Compress(middleware.CompressConfig{
Next: func(c *fiber.Ctx) bool {
return c.Path() == "/dontcompress"
},
Level: CompressLevelDefault,
})

Skipping middleware execution​

When adding middleware to your application, you can also specify when the middleware should be activated and when it should not through a function passed when initialising the middleware using a function passed in the configuration for the middleware.

Signature
func (*fiber.Ctx) bool

This function should return true if the middleware should be deactivated. For example, if you would like admin users to be exempt from rate-limiting, you could do something like this:

Example
app.Use(limiter.New(limiter.Config{
Timeout: 10,
Max: 3,
Filter: func (c *fiber.Ctx) bool {
var isUserAdmin bool
// Your logic here
return isUserAdmin
}
}))
caution

If you are using middleware that is included with Fiber by default (for example Compress or Logger), you should use the Next field instead of the Filter field. For example:

Example
app.Use(middleware.Logger(middleware.LoggerConfig{
Format: "${time} ${method} ${path}",
TimeFormat: "15:04:05",
TimeZone: "Asia/Chongqing",
Next: func (c *fiber.Ctx) bool {
var isUserAdmin bool
// Your logic here
return isUserAdmin
}
}))

FileSystem​

Favicon​

+ + \ No newline at end of file diff --git a/v1.x/category/api/index.html b/v1.x/category/api/index.html index 61cf939fbf0..77d35dc80e3 100644 --- a/v1.x/category/api/index.html +++ b/v1.x/category/api/index.html @@ -6,13 +6,13 @@ API | Fiber - - + + - - + + \ No newline at end of file diff --git a/v1.x/category/guide/index.html b/v1.x/category/guide/index.html index b79dc20967a..33dc496e9f3 100644 --- a/v1.x/category/guide/index.html +++ b/v1.x/category/guide/index.html @@ -6,13 +6,13 @@ Guide | Fiber - - + + - - + + \ No newline at end of file diff --git a/v1.x/category/misc/index.html b/v1.x/category/misc/index.html index a52b45ae1e3..59dbcb7e550 100644 --- a/v1.x/category/misc/index.html +++ b/v1.x/category/misc/index.html @@ -6,13 +6,13 @@ Misc | Fiber - - + + - - + + \ No newline at end of file diff --git a/v1.x/guide/error-handling/index.html b/v1.x/guide/error-handling/index.html index 659d9f3d006..8ab75f5e035 100644 --- a/v1.x/guide/error-handling/index.html +++ b/v1.x/guide/error-handling/index.html @@ -6,13 +6,13 @@ πŸ› Error Handling | Fiber - - + +
-
Version: v1.x

πŸ› Error Handling

Catching Errors​

It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them.

app.Get("/", func(c *fiber.Ctx) {
err := c.SendFile("file-does-not-exist")

if err != nil {
c.Next(err) // Pass error to Fiber
}
})

Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below:

Example
package main

import (
"github.com/gofiber/fiber"
"github.com/gofiber/fiber/middleware"
)

func main() {
app := fiber.New()

app.Use(middleware.Recover())

app.Get("/", func(c *fiber.Ctx) {
panic("This panic is catched by the ErrorHandler")
})

log.Fatal(app.Listen(3000))
}

Because ctx.Next() accepts an error interface, you could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found).

Example
app.Get("/", func(c *fiber.Ctx) {
err := fiber.NewError(503)
c.Next(err) // 503 Service Unavailable

err := fiber.NewError(404, "Sorry, not found!")
c.Next(err) // 404 Sorry, not found!
})

Default Error Handler​

Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If error is of type fiber*Error, response is sent with the provided status code and message.

Example
// Default error handler
app.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) {
// Statuscode defaults to 500
code := fiber.StatusInternalServerError

// Check if it's an fiber.Error type
if e, ok := err.(*fiber.Error); ok {
code = e.Code
}

// Return HTTP response
ctx.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)
ctx.Status(code).SendString(err.Error())
}

Custom Error Handler​

A custom error handler can be set via app.Settings.ErrorHandler

In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response.

The following example shows how to display error pages for different types of errors.

Example
app := fiber.New()

// Custom error handler
app.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) {
// Statuscode defaults to 500
code := fiber.StatusInternalServerError

// Retrieve the custom statuscode if it's an fiber.*Error
if e, ok := err.(*fiber.Error); ok {
code = e.Code
}

// Send custom error page
err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))
if err != nil {
ctx.Status(500).SendString("Internal Server Error")
}
}

Special thanks to the Echo & Express framework for inspiration regarding error handling.

- - +
Version: v1.x

πŸ› Error Handling

Catching Errors​

It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them.

app.Get("/", func(c *fiber.Ctx) {
err := c.SendFile("file-does-not-exist")

if err != nil {
c.Next(err) // Pass error to Fiber
}
})

Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below:

Example
package main

import (
"github.com/gofiber/fiber"
"github.com/gofiber/fiber/middleware"
)

func main() {
app := fiber.New()

app.Use(middleware.Recover())

app.Get("/", func(c *fiber.Ctx) {
panic("This panic is catched by the ErrorHandler")
})

log.Fatal(app.Listen(3000))
}

Because ctx.Next() accepts an error interface, you could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found).

Example
app.Get("/", func(c *fiber.Ctx) {
err := fiber.NewError(503)
c.Next(err) // 503 Service Unavailable

err := fiber.NewError(404, "Sorry, not found!")
c.Next(err) // 404 Sorry, not found!
})

Default Error Handler​

Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If error is of type fiber*Error, response is sent with the provided status code and message.

Example
// Default error handler
app.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) {
// Statuscode defaults to 500
code := fiber.StatusInternalServerError

// Check if it's an fiber.Error type
if e, ok := err.(*fiber.Error); ok {
code = e.Code
}

// Return HTTP response
ctx.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)
ctx.Status(code).SendString(err.Error())
}

Custom Error Handler​

A custom error handler can be set via app.Settings.ErrorHandler

In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response.

The following example shows how to display error pages for different types of errors.

Example
app := fiber.New()

// Custom error handler
app.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) {
// Statuscode defaults to 500
code := fiber.StatusInternalServerError

// Retrieve the custom statuscode if it's an fiber.*Error
if e, ok := err.(*fiber.Error); ok {
code = e.Code
}

// Send custom error page
err = ctx.Status(code).SendFile(fmt.Sprintf("./%d.html", code))
if err != nil {
ctx.Status(500).SendString("Internal Server Error")
}
}

Special thanks to the Echo & Express framework for inspiration regarding error handling.

+ + \ No newline at end of file diff --git a/v1.x/guide/grouping/index.html b/v1.x/guide/grouping/index.html index 01c69008c3d..d5af0debc64 100644 --- a/v1.x/guide/grouping/index.html +++ b/v1.x/guide/grouping/index.html @@ -6,13 +6,13 @@ 🎭 Grouping | Fiber - - + +
-
Version: v1.x

🎭 Grouping

Paths​

Like Routing, groups can also have paths that belong to a cluster.

func main() {
app := fiber.New()

api := app.Group("/api", cors()) // /api

v1 := api.Group("/v1", mysql()) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", mongodb()) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

app.Listen(3000)
}

A Group of paths can have an optional handler.

func main() {
app := fiber.New()

api := app.Group("/api") // /api

v1 := api.Group("/v1") // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2") // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

app.Listen(3000)
}
caution

Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.

Group Handlers​

Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue.

func main() {
app := fiber.New()

api := app.Group("/api") // /api

v1 := api.Group("/v1", func(c *fiber.Ctx) {
c.JSON(fiber.Map{
"message": "v1",
})
c.Next()
}) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

app.Listen(3000)
}
- - +
Version: v1.x

🎭 Grouping

Paths​

Like Routing, groups can also have paths that belong to a cluster.

func main() {
app := fiber.New()

api := app.Group("/api", cors()) // /api

v1 := api.Group("/v1", mysql()) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", mongodb()) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

app.Listen(3000)
}

A Group of paths can have an optional handler.

func main() {
app := fiber.New()

api := app.Group("/api") // /api

v1 := api.Group("/v1") // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2") // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

app.Listen(3000)
}
caution

Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.

Group Handlers​

Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue.

func main() {
app := fiber.New()

api := app.Group("/api") // /api

v1 := api.Group("/v1", func(c *fiber.Ctx) {
c.JSON(fiber.Map{
"message": "v1",
})
c.Next()
}) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

app.Listen(3000)
}
+ + \ No newline at end of file diff --git a/v1.x/guide/routing/index.html b/v1.x/guide/routing/index.html index 4380d930ba4..4d8d18abbdc 100644 --- a/v1.x/guide/routing/index.html +++ b/v1.x/guide/routing/index.html @@ -6,13 +6,13 @@ πŸ”Œ Routing | Fiber - - + +
-
Version: v1.x

πŸ”Œ Routing

Paths​

Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns.

Examples of route paths based on strings

// This route path will match requests to the root route, "/":
app.Get("/", func(c *fiber.Ctx) {
c.Send("root")
})

// This route path will match requests to "/about":
app.Get("/about", func(c *fiber.Ctx) {
c.Send("about")
})

// This route path will match requests to "/random.txt":
app.Get("/random.txt", func(c *fiber.Ctx) {
c.Send("random.txt")
})

Parameters​

Route parameters are named URL segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys.

info

The name of the route parameter must be made up of characters ([A-Za-z0-9_]).

Example of define routes with route parameters

// Parameters
app.Get("/user/:name/books/:title", func(c *fiber.Ctx) {
c.Write(c.Params("name"))
c.Write(c.Params("title"))
})
// Wildcard
app.Get("/user/*", func(c *fiber.Ctx) {
c.Send(c.Params("*"))
})
// Optional parameter
app.Get("/user/:name?", func(c *fiber.Ctx) {
c.Send(c.Params("name"))
})
info

Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes.

// http://localhost:3000/plantae/prunus.persica
app.Get("/plantae/:genus.:species", func(c *fiber.Ctx) {
c.Params("genus") // prunus
c.Params("species") // persica
})
// http://localhost:3000/flights/LAX-SFO
app.Get("/flights/:from-:to", func(c *fiber.Ctx) {
c.Params("from") // LAX
c.Params("to") // SFO
})

Middleware​

Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route.

Example of a middleware function

app.Use(func(c *fiber.Ctx) {
// Set some security headers:
c.Set("X-XSS-Protection", "1; mode=block")
c.Set("X-Content-Type-Options", "nosniff")
c.Set("X-Download-Options", "noopen")
c.Set("Strict-Transport-Security", "max-age=5184000")
c.Set("X-Frame-Options", "SAMEORIGIN")
c.Set("X-DNS-Prefetch-Control", "off")

// Go to next middleware:
c.Next()

// End of the chain
fmt.Println("Bye πŸ‘‹!")
})

app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!")
})

Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.

Grouping​

If you have many endpoints, you can organize your routes using Group.

func main() {
app := fiber.New()

api := app.Group("/api", cors()) // /api

v1 := api.Group("/v1", mysql()) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", mongodb()) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

app.Listen(3000)
}
- - +
Version: v1.x

πŸ”Œ Routing

Paths​

Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns.

Examples of route paths based on strings

// This route path will match requests to the root route, "/":
app.Get("/", func(c *fiber.Ctx) {
c.Send("root")
})

// This route path will match requests to "/about":
app.Get("/about", func(c *fiber.Ctx) {
c.Send("about")
})

// This route path will match requests to "/random.txt":
app.Get("/random.txt", func(c *fiber.Ctx) {
c.Send("random.txt")
})

Parameters​

Route parameters are named URL segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys.

info

The name of the route parameter must be made up of characters ([A-Za-z0-9_]).

Example of define routes with route parameters

// Parameters
app.Get("/user/:name/books/:title", func(c *fiber.Ctx) {
c.Write(c.Params("name"))
c.Write(c.Params("title"))
})
// Wildcard
app.Get("/user/*", func(c *fiber.Ctx) {
c.Send(c.Params("*"))
})
// Optional parameter
app.Get("/user/:name?", func(c *fiber.Ctx) {
c.Send(c.Params("name"))
})
info

Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes.

// http://localhost:3000/plantae/prunus.persica
app.Get("/plantae/:genus.:species", func(c *fiber.Ctx) {
c.Params("genus") // prunus
c.Params("species") // persica
})
// http://localhost:3000/flights/LAX-SFO
app.Get("/flights/:from-:to", func(c *fiber.Ctx) {
c.Params("from") // LAX
c.Params("to") // SFO
})

Middleware​

Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route.

Example of a middleware function

app.Use(func(c *fiber.Ctx) {
// Set some security headers:
c.Set("X-XSS-Protection", "1; mode=block")
c.Set("X-Content-Type-Options", "nosniff")
c.Set("X-Download-Options", "noopen")
c.Set("Strict-Transport-Security", "max-age=5184000")
c.Set("X-Frame-Options", "SAMEORIGIN")
c.Set("X-DNS-Prefetch-Control", "off")

// Go to next middleware:
c.Next()

// End of the chain
fmt.Println("Bye πŸ‘‹!")
})

app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!")
})

Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.

Grouping​

If you have many endpoints, you can organize your routes using Group.

func main() {
app := fiber.New()

api := app.Group("/api", cors()) // /api

v1 := api.Group("/v1", mysql()) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user

v2 := api.Group("/v2", mongodb()) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user

app.Listen(3000)
}
+ + \ No newline at end of file diff --git a/v1.x/guide/templates/index.html b/v1.x/guide/templates/index.html index 30c6fd2f45f..b826e1cd801 100644 --- a/v1.x/guide/templates/index.html +++ b/v1.x/guide/templates/index.html @@ -6,13 +6,13 @@ πŸ“ Templates | Fiber - - + +
-
Version: v1.x

πŸ“ Templates

Template interfaces​

Fiber provides a Views interface to provide your own template engine:

type Views interface {
Load() error
Render(io.Writer, string, interface{}, ...string) error
}

Views interface contains a Load and Render method, Load is executed by Fiber on app initialization to load/parse the templates.

// Pass engine to Fiber's Views Engine
app := fiber.New(&fiber.Settings{
Views: engine,
})

The Render method is linked to the ctx.Render() function that accepts a template name and binding data.

app.Get("/", func(c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
"hello": "world",
});
})

Engines​

Fiber team maintains templates package that provides wrappers for multiple template engines:

package main

import (
"github.com/gofiber/fiber"
"github.com/gofiber/template/html"
)

func main() {
// Initialize standard Go html template engine
engine := html.New("./views", ".html")

app := fiber.New(&fiber.Settings{
Views: engine,
})
app.Get("/", func(c *fiber.Ctx) {
// Render index template
_ = c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Listen(3000)
}
- - +
Version: v1.x

πŸ“ Templates

Template interfaces​

Fiber provides a Views interface to provide your own template engine:

type Views interface {
Load() error
Render(io.Writer, string, interface{}, ...string) error
}

Views interface contains a Load and Render method, Load is executed by Fiber on app initialization to load/parse the templates.

// Pass engine to Fiber's Views Engine
app := fiber.New(&fiber.Settings{
Views: engine,
})

The Render method is linked to the ctx.Render() function that accepts a template name and binding data.

app.Get("/", func(c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
"hello": "world",
});
})

Engines​

Fiber team maintains templates package that provides wrappers for multiple template engines:

package main

import (
"github.com/gofiber/fiber"
"github.com/gofiber/template/html"
)

func main() {
// Initialize standard Go html template engine
engine := html.New("./views", ".html")

app := fiber.New(&fiber.Settings{
Views: engine,
})
app.Get("/", func(c *fiber.Ctx) {
// Render index template
_ = c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Listen(3000)
}
+ + \ No newline at end of file diff --git a/v1.x/guide/validating/index.html b/v1.x/guide/validating/index.html index 435c7d1eb3f..311d484153f 100644 --- a/v1.x/guide/validating/index.html +++ b/v1.x/guide/validating/index.html @@ -6,13 +6,13 @@ πŸ”Ž Validating | Fiber - - + +
-
Version: v1.x

πŸ”Ž Validating

Validator package​

Fiber can make great use of the validator package to ensure correct validation of data to store.

You can find the detailed descriptions of the validations used in the fields contained on the structs below:

Validation Example
type Job struct{
Type string `validate:"required,min=3,max=32"`
Salary int `validate:"required,number"`
}

type User struct{
Name string `validate:"required,min=3,max=32"`
IsActive bool `validate:"required,eq=True|eq=False"`
Email string `validate:"required,email,min=6,max=32"`
Job Job `validate:"dive"`
}

type ErrorResponse struct {
FailedField string
Tag string
Value string
}

func ValidateStruct(user User) []*ErrorResponse {
var errors []*ErrorResponse
validate = validator.New()
err := validate.Struct(user)
if err != nil {
for _, err := range err.(validator.ValidationErrors) {
var element ErrorResponse
element.FailedField = err.StructNamespace()
element.Tag = err.Tag()
element.Value = err.Param()
errors = append(errors, &element)
}
}
return errors
}

func AddUser(c *fiber.Ctx) {
//Connect to database
user := new(User)
if err := c.BodyParser(user); err != nil {
errors := ValidateStruct()
if errors != nil {
c.JSON(errors)
return
}
}
//Do something else here

//Return user
c.JSON(user)
}

// Running a test with the following curl commands

// curl -X POST -H "Content-Type: application/json" --data "{\"name\":\"john\",\"isactive\":\"True\"}" http://localhost:8080/register/user

// Results in

// [{"FailedField":"User.Email","Tag":"required","Value":""},{"FailedField":"User.Job.Salary","Tag":"required","Value":""},{"FailedField":"User.Job.Type","Tag":"required","Value":""}]⏎
- - +
Version: v1.x

πŸ”Ž Validating

Validator package​

Fiber can make great use of the validator package to ensure correct validation of data to store.

You can find the detailed descriptions of the validations used in the fields contained on the structs below:

Validation Example
type Job struct{
Type string `validate:"required,min=3,max=32"`
Salary int `validate:"required,number"`
}

type User struct{
Name string `validate:"required,min=3,max=32"`
IsActive bool `validate:"required,eq=True|eq=False"`
Email string `validate:"required,email,min=6,max=32"`
Job Job `validate:"dive"`
}

type ErrorResponse struct {
FailedField string
Tag string
Value string
}

func ValidateStruct(user User) []*ErrorResponse {
var errors []*ErrorResponse
validate = validator.New()
err := validate.Struct(user)
if err != nil {
for _, err := range err.(validator.ValidationErrors) {
var element ErrorResponse
element.FailedField = err.StructNamespace()
element.Tag = err.Tag()
element.Value = err.Param()
errors = append(errors, &element)
}
}
return errors
}

func AddUser(c *fiber.Ctx) {
//Connect to database
user := new(User)
if err := c.BodyParser(user); err != nil {
errors := ValidateStruct()
if errors != nil {
c.JSON(errors)
return
}
}
//Do something else here

//Return user
c.JSON(user)
}

// Running a test with the following curl commands

// curl -X POST -H "Content-Type: application/json" --data "{\"name\":\"john\",\"isactive\":\"True\"}" http://localhost:8080/register/user

// Results in

// [{"FailedField":"User.Email","Tag":"required","Value":""},{"FailedField":"User.Job.Salary","Tag":"required","Value":""},{"FailedField":"User.Job.Type","Tag":"required","Value":""}]⏎
+ + \ No newline at end of file diff --git a/v1.x/index.html b/v1.x/index.html index 2d8f9f32b73..7d83ec0a18a 100644 --- a/v1.x/index.html +++ b/v1.x/index.html @@ -6,14 +6,14 @@ πŸ“– Getting started | Fiber - - + +
Version: v1.x

πŸ“– Getting started

Fiber is an Express inspired web framework build on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development with zero memory allocation and performance in mind.

caution

These docs are for the old Fiber v1, you can view the v2 docs here.
-v2.0.0 was released on September 15th, 2020, and contains numerous changes regarding performance and API design.

Installation​

First of all, download and install Go. 1.11 or higher is required.

Installation is done using the go get command:

go get -u github.com/gofiber/fiber

Zero Allocation​

caution

Some values returned from fiber.Ctx are not immutable by default

Because fiber is optimized for high-performance, values returned from fiber.Ctx are not immutable by default and will be re-used across requests. As a rule of thumb, you must only use context values within the handler, and you must not keep any references. As soon as you return from the handler, any values you have obtained from the context will be re-used in future requests and will change below your feet. Here is an example:

func handler(c *fiber.Ctx) {
result := c.Param("foo") // result is only valid within this method
}

If you need to persist such values outside the handler, make copies of their underlying buffer using the copy builtin. Here is an example for persisting a string:

func handler(c *fiber.Ctx) {
result := c.Param("foo") // result is only valid within this method
newBuffer := make([]byte, len(result))
copy(newBuffer, result)
newResult := string(newBuffer) // newResult is immutable and valid forever
}

We created a custom ImmutableString function that does the above and is available in the gofiber/utils package.

app.Get("/:foo", func(c *fiber.Ctx) {
result := utils.ImmutableString(c.Param("foo"))
// result is now immutable
})

Alternatively, you can also use the Immutable setting. It will make all values returned from the context immutable, allowing you to persist them anywhere. Of course, this comes at the cost of performance.

For more information, please check #426 and #185.

Hello, World!​

Embedded below is essentially the most straightforward Fiber app, which you can create.

package main

import "github.com/gofiber/fiber"

func main() {
app := fiber.New()

app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!")
})

app.Listen(3000)
}
go run server.go

Browse to http://localhost:3000, and you should see Hello, World! on the page.

Basic routing​

Routing refers to determining how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (GET, PUT, POST and so on).

info

Each route can have multiple handler functions, that is executed when the route is matched.

Route definition takes the following structures:

// Function signature
app.Method(path string, ...func(*fiber.Ctx))
  • app is an instance of Fiber.
  • Method is an HTTP request method, in capitalization: Get, Put, Post, etc.
  • path is a virtual path on the server.
  • func(*fiber.Ctx) is a callback function containing the Context executed when the route is matched.

Simple route

// Respond with "Hello, World!" on root path, "/"
app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!")
})

Parameters

// GET http://localhost:8080/hello%20world

app.Get("/:value", func(c *fiber.Ctx) {
c.Send("Get request with value: " + c.Params("value"))
// => Get request with value: hello world
})

Optional parameter

// GET http://localhost:3000/john

app.Get("/:name?", func(c *fiber.Ctx) {
if c.Params("name") != "" {
c.Send("Hello " + c.Params("name"))
// => Hello john
} else {
c.Send("Where is john?")
}
})

Wildcards

// GET http://localhost:3000/api/user/john

app.Get("/api/*", func(c *fiber.Ctx) {
c.Send("API path: " + c.Params("*"))
// => API path: user/john
})

Static files​

To serve static files such as images, CSS, and JavaScript files, replace your function handler with a file or directory string.

Function signature:

app.Static(prefix, root string)

Use the following code to serve files in a directory named ./public:

app := fiber.New()

app.Static("/", "./public")

app.Listen(8080)

Now, you can load the files that are in the ./public directory:

http://localhost:8080/hello.html
http://localhost:8080/js/jquery.js
http://localhost:8080/css/style.css

Note​

For more information on how to build APIs in Go with Fiber, please check out this excellent article on building an express-style API in Go with Fiber

- - +v2.0.0 was released on September 15th, 2020, and contains numerous changes regarding performance and API design.

Installation​

First of all, download and install Go. 1.11 or higher is required.

Installation is done using the go get command:

go get -u github.com/gofiber/fiber

Zero Allocation​

caution

Some values returned from fiber.Ctx are not immutable by default

Because fiber is optimized for high-performance, values returned from fiber.Ctx are not immutable by default and will be re-used across requests. As a rule of thumb, you must only use context values within the handler, and you must not keep any references. As soon as you return from the handler, any values you have obtained from the context will be re-used in future requests and will change below your feet. Here is an example:

func handler(c *fiber.Ctx) {
result := c.Param("foo") // result is only valid within this method
}

If you need to persist such values outside the handler, make copies of their underlying buffer using the copy builtin. Here is an example for persisting a string:

func handler(c *fiber.Ctx) {
result := c.Param("foo") // result is only valid within this method
newBuffer := make([]byte, len(result))
copy(newBuffer, result)
newResult := string(newBuffer) // newResult is immutable and valid forever
}

We created a custom ImmutableString function that does the above and is available in the gofiber/utils package.

app.Get("/:foo", func(c *fiber.Ctx) {
result := utils.ImmutableString(c.Param("foo"))
// result is now immutable
})

Alternatively, you can also use the Immutable setting. It will make all values returned from the context immutable, allowing you to persist them anywhere. Of course, this comes at the cost of performance.

For more information, please check #426 and #185.

Hello, World!​

Embedded below is essentially the most straightforward Fiber app, which you can create.

package main

import "github.com/gofiber/fiber"

func main() {
app := fiber.New()

app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!")
})

app.Listen(3000)
}
go run server.go

Browse to http://localhost:3000, and you should see Hello, World! on the page.

Basic routing​

Routing refers to determining how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (GET, PUT, POST and so on).

info

Each route can have multiple handler functions, that is executed when the route is matched.

Route definition takes the following structures:

// Function signature
app.Method(path string, ...func(*fiber.Ctx))
  • app is an instance of Fiber.
  • Method is an HTTP request method, in capitalization: Get, Put, Post, etc.
  • path is a virtual path on the server.
  • func(*fiber.Ctx) is a callback function containing the Context executed when the route is matched.

Simple route

// Respond with "Hello, World!" on root path, "/"
app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!")
})

Parameters

// GET http://localhost:8080/hello%20world

app.Get("/:value", func(c *fiber.Ctx) {
c.Send("Get request with value: " + c.Params("value"))
// => Get request with value: hello world
})

Optional parameter

// GET http://localhost:3000/john

app.Get("/:name?", func(c *fiber.Ctx) {
if c.Params("name") != "" {
c.Send("Hello " + c.Params("name"))
// => Hello john
} else {
c.Send("Where is john?")
}
})

Wildcards

// GET http://localhost:3000/api/user/john

app.Get("/api/*", func(c *fiber.Ctx) {
c.Send("API path: " + c.Params("*"))
// => API path: user/john
})

Static files​

To serve static files such as images, CSS, and JavaScript files, replace your function handler with a file or directory string.

Function signature:

app.Static(prefix, root string)

Use the following code to serve files in a directory named ./public:

app := fiber.New()

app.Static("/", "./public")

app.Listen(8080)

Now, you can load the files that are in the ./public directory:

http://localhost:8080/hello.html
http://localhost:8080/js/jquery.js
http://localhost:8080/css/style.css

Note​

For more information on how to build APIs in Go with Fiber, please check out this excellent article on building an express-style API in Go with Fiber

+ + \ No newline at end of file diff --git a/v1.x/misc/benchmarks/index.html b/v1.x/misc/benchmarks/index.html index 071378e3e4c..90c6e6d9cc4 100644 --- a/v1.x/misc/benchmarks/index.html +++ b/v1.x/misc/benchmarks/index.html @@ -6,8 +6,8 @@ πŸ“Š Benchmarks | Fiber - - + +
@@ -16,8 +16,8 @@ Express handled 2,066 responses per second with an average latency of 390.44 ms.

Fiber vs Express

Multiple Queries​

Fiber handled 19,664 responses per second with an average latency of 25.7 ms.
Express handled 4,302 responses per second with an average latency of 117.2 ms.

Fiber vs Express

Single Query​

Fiber handled 368,647 responses per second with an average latency of 0.7 ms.
Express handled 57,880 responses per second with an average latency of 4.4 ms.

Fiber vs Express

JSON Serialization​

Fiber handled 1,146,667 responses per second with an average latency of 0.4 ms.
-Express handled 244,847 responses per second with an average latency of 1.1 ms.

Fiber vs Express

Go web framework benchmark​

πŸ”— https://github.com/smallnest/go-web-framework-benchmark

  • CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
  • MEM 4GB
  • GO go1.13.6 linux/amd64
  • OS Linux

The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers.

The concurrency clients are 5000.

Latency is the time of real processing time by web servers. The smaller is the better.

Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better.

If we enable http pipelining, test result as below:

Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is:

If we enable http pipelining, test result as below:

Dependency graph for v1.9.0

- - +Express handled 244,847 responses per second with an average latency of 1.1 ms.

Fiber vs Express

Go web framework benchmark​

πŸ”— https://github.com/smallnest/go-web-framework-benchmark

  • CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
  • MEM 4GB
  • GO go1.13.6 linux/amd64
  • OS Linux

The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers.

The concurrency clients are 5000.

Latency is the time of real processing time by web servers. The smaller is the better.

Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better.

If we enable http pipelining, test result as below:

Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is:

If we enable http pipelining, test result as below:

Dependency graph for v1.9.0

+ + \ No newline at end of file diff --git a/v1.x/misc/faq/index.html b/v1.x/misc/faq/index.html index 9c124891cc2..50e0e628263 100644 --- a/v1.x/misc/faq/index.html +++ b/v1.x/misc/faq/index.html @@ -6,14 +6,14 @@ πŸ€” FAQ | Fiber - - + +
Version: v1.x

πŸ€” FAQ

How should I structure my application?​

There is no definitive answer to this question. The answer depends on the scale of your application and the team that is involved. To be as flexible as possible, Fiber makes no assumptions in terms of structure.

Routes and other application-specific logic can live in as many files as you wish, in any directory structure you prefer. View the following examples for inspiration:

How do I handle custom 404 responses?​

In Fiber, 404 responses are not the result of an error, so the error handler will not capture them. This behavior is because a 404 response simply indicates the absence of additional work to do; in other words, Fiber has found no routes that match the request.

All you need to do is add a middleware function at the very bottom of the stack (below all other functions) to handle a 404 response:

Example
app.Use(func(c *fiber.Ctx) {
c.Status(fiber.StatusNotFound).SendString("Sorry can't find that!")
})

How do I set up an error handler?​

To override the default error handler, provide a custom handler to the app.Settings.ErrorHandler

Example
app.Settings.ErrorHandler = func(c *fiber.Ctx, err error) {
c.Status(500).SendString(err.Error())
}

We have a dedicated page explaining how error handling works in Fiber, see Error Handling.

Which template engines does Fiber support?​

Fiber currently supports 8 template engines in our gofiber/template middleware:

To learn more about using Templates in Fiber, see Templates.

Does Fiber have a community chat?​

Yes, we have our own Discord server, where we hang out. We have different rooms for every subject.
-If you have questions or just want to have a chat, feel free to join us via this > invite link <.

- - +If you have questions or just want to have a chat, feel free to join us via this > invite link <.

+ + \ No newline at end of file diff --git a/v1.x/search-index.json b/v1.x/search-index.json index 088658baed0..f61f75e5c77 100644 --- a/v1.x/search-index.json +++ b/v1.x/search-index.json @@ -1 +1 @@ -[{"documents":[{"i":1911,"t":"πŸ“– Getting started","u":"/v1.x/","b":["🏠 Home"]},{"i":1925,"t":"πŸš€ App","u":"/v1.x/api/app","b":["🏠 Home","API"]},{"i":1944,"t":"🧠 Ctx","u":"/v1.x/api/ctx","b":["🏠 Home","API"]},{"i":2053,"t":"🧬 Middleware","u":"/v1.x/api/middleware","b":["🏠 Home","API"]},{"i":2061,"t":"πŸ› Error Handling","u":"/v1.x/guide/error-handling","b":["🏠 Home","Guide"]},{"i":2068,"t":"🎭 Grouping","u":"/v1.x/guide/grouping","b":["🏠 Home","Guide"]},{"i":2073,"t":"πŸ”Œ Routing","u":"/v1.x/guide/routing","b":["🏠 Home","Guide"]},{"i":2082,"t":"πŸ”Ž Validating","u":"/v1.x/guide/validating","b":["🏠 Home","Guide"]},{"i":2085,"t":"πŸ“Š Benchmarks","u":"/v1.x/misc/benchmarks","b":["🏠 Home","Misc"]},{"i":2100,"t":"πŸ€” FAQ","u":"/v1.x/misc/faq","b":["🏠 Home","Misc"]},{"i":2111,"t":"πŸ“ Templates","u":"/v1.x/guide/templates","b":["🏠 Home","Guide"]}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/1911",[0,0.037,1,1.803,2,1.803]],["t/1925",[0,0.044,3,2.153]],["t/1944",[0,0.044,4,2.153]],["t/2053",[0,0.044,5,2.153]],["t/2061",[0,0.037,6,1.803,7,1.803]],["t/2068",[0,0.044,8,2.153]],["t/2073",[0,0.044,9,2.153]],["t/2082",[0,0.044,10,2.153]],["t/2085",[0,0.044,11,2.153]],["t/2100",[0,0.044,12,2.153]],["t/2111",[0,0.044,13,2.153]]],"invertedIndex":[["",{"_index":0,"t":{"1911":{"position":[[0,2]]},"1925":{"position":[[0,2]]},"1944":{"position":[[0,2]]},"2053":{"position":[[0,2]]},"2061":{"position":[[0,2]]},"2068":{"position":[[0,2]]},"2073":{"position":[[0,2]]},"2082":{"position":[[0,2]]},"2085":{"position":[[0,2]]},"2100":{"position":[[0,2]]},"2111":{"position":[[0,2]]}}}],["app",{"_index":3,"t":{"1925":{"position":[[3,3]]}}}],["benchmark",{"_index":11,"t":{"2085":{"position":[[3,10]]}}}],["ctx",{"_index":4,"t":{"1944":{"position":[[3,3]]}}}],["error",{"_index":6,"t":{"2061":{"position":[[3,5]]}}}],["faq",{"_index":12,"t":{"2100":{"position":[[3,3]]}}}],["get",{"_index":1,"t":{"1911":{"position":[[3,7]]}}}],["group",{"_index":8,"t":{"2068":{"position":[[3,8]]}}}],["handl",{"_index":7,"t":{"2061":{"position":[[9,8]]}}}],["middlewar",{"_index":5,"t":{"2053":{"position":[[3,10]]}}}],["rout",{"_index":9,"t":{"2073":{"position":[[3,7]]}}}],["start",{"_index":2,"t":{"1911":{"position":[[11,7]]}}}],["templat",{"_index":13,"t":{"2111":{"position":[[3,9]]}}}],["valid",{"_index":10,"t":{"2082":{"position":[[3,10]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":1913,"t":"Installation","u":"/v1.x/","h":"#installation","p":1911},{"i":1915,"t":"Zero Allocation","u":"/v1.x/","h":"#zero-allocation","p":1911},{"i":1917,"t":"Hello, World!","u":"/v1.x/","h":"#hello-world","p":1911},{"i":1919,"t":"Basic routing","u":"/v1.x/","h":"#basic-routing","p":1911},{"i":1921,"t":"Static files","u":"/v1.x/","h":"#static-files","p":1911},{"i":1923,"t":"Note","u":"/v1.x/","h":"#note","p":1911},{"i":1926,"t":"New","u":"/v1.x/api/app","h":"#new","p":1925},{"i":1928,"t":"Settings","u":"/v1.x/api/app","h":"#settings","p":1925},{"i":1930,"t":"Static","u":"/v1.x/api/app","h":"#static","p":1925},{"i":1932,"t":"HTTP Methods","u":"/v1.x/api/app","h":"#http-methods","p":1925},{"i":1934,"t":"Group","u":"/v1.x/api/app","h":"#group","p":1925},{"i":1936,"t":"Stack","u":"/v1.x/api/app","h":"#stack","p":1925},{"i":1938,"t":"Listen","u":"/v1.x/api/app","h":"#listen","p":1925},{"i":1940,"t":"Listener","u":"/v1.x/api/app","h":"#listener","p":1925},{"i":1942,"t":"Test","u":"/v1.x/api/app","h":"#test","p":1925},{"i":1945,"t":"Accepts","u":"/v1.x/api/ctx","h":"#accepts","p":1944},{"i":1947,"t":"Append","u":"/v1.x/api/ctx","h":"#append","p":1944},{"i":1949,"t":"Attachment","u":"/v1.x/api/ctx","h":"#attachment","p":1944},{"i":1951,"t":"App","u":"/v1.x/api/ctx","h":"#app","p":1944},{"i":1953,"t":"BaseURL","u":"/v1.x/api/ctx","h":"#baseurl","p":1944},{"i":1955,"t":"Body","u":"/v1.x/api/ctx","h":"#body","p":1944},{"i":1957,"t":"BodyParser","u":"/v1.x/api/ctx","h":"#bodyparser","p":1944},{"i":1959,"t":"ClearCookie","u":"/v1.x/api/ctx","h":"#clearcookie","p":1944},{"i":1961,"t":"Context","u":"/v1.x/api/ctx","h":"#context","p":1944},{"i":1963,"t":"Cookie","u":"/v1.x/api/ctx","h":"#cookie","p":1944},{"i":1965,"t":"Cookies","u":"/v1.x/api/ctx","h":"#cookies","p":1944},{"i":1967,"t":"Download","u":"/v1.x/api/ctx","h":"#download","p":1944},{"i":1969,"t":"Fasthttp","u":"/v1.x/api/ctx","h":"#fasthttp","p":1944},{"i":1971,"t":"Error","u":"/v1.x/api/ctx","h":"#error","p":1944},{"i":1973,"t":"Format","u":"/v1.x/api/ctx","h":"#format","p":1944},{"i":1975,"t":"FormFile","u":"/v1.x/api/ctx","h":"#formfile","p":1944},{"i":1977,"t":"FormValue","u":"/v1.x/api/ctx","h":"#formvalue","p":1944},{"i":1979,"t":"Fresh","u":"/v1.x/api/ctx","h":"#fresh","p":1944},{"i":1981,"t":"Get","u":"/v1.x/api/ctx","h":"#get","p":1944},{"i":1983,"t":"Hostname","u":"/v1.x/api/ctx","h":"#hostname","p":1944},{"i":1985,"t":"IP","u":"/v1.x/api/ctx","h":"#ip","p":1944},{"i":1987,"t":"IPs","u":"/v1.x/api/ctx","h":"#ips","p":1944},{"i":1989,"t":"Is","u":"/v1.x/api/ctx","h":"#is","p":1944},{"i":1991,"t":"JSON","u":"/v1.x/api/ctx","h":"#json","p":1944},{"i":1993,"t":"JSONP","u":"/v1.x/api/ctx","h":"#jsonp","p":1944},{"i":1995,"t":"Links","u":"/v1.x/api/ctx","h":"#links","p":1944},{"i":1997,"t":"Locals","u":"/v1.x/api/ctx","h":"#locals","p":1944},{"i":1999,"t":"Location","u":"/v1.x/api/ctx","h":"#location","p":1944},{"i":2001,"t":"Method","u":"/v1.x/api/ctx","h":"#method","p":1944},{"i":2003,"t":"MultipartForm","u":"/v1.x/api/ctx","h":"#multipartform","p":1944},{"i":2005,"t":"Next","u":"/v1.x/api/ctx","h":"#next","p":1944},{"i":2007,"t":"OriginalURL","u":"/v1.x/api/ctx","h":"#originalurl","p":1944},{"i":2009,"t":"Params","u":"/v1.x/api/ctx","h":"#params","p":1944},{"i":2011,"t":"Path","u":"/v1.x/api/ctx","h":"#path","p":1944},{"i":2013,"t":"Protocol","u":"/v1.x/api/ctx","h":"#protocol","p":1944},{"i":2015,"t":"Query","u":"/v1.x/api/ctx","h":"#query","p":1944},{"i":2017,"t":"QueryParser","u":"/v1.x/api/ctx","h":"#queryparser","p":1944},{"i":2019,"t":"Range","u":"/v1.x/api/ctx","h":"#range","p":1944},{"i":2021,"t":"Redirect","u":"/v1.x/api/ctx","h":"#redirect","p":1944},{"i":2023,"t":"Render","u":"/v1.x/api/ctx","h":"#render","p":1944},{"i":2025,"t":"Route","u":"/v1.x/api/ctx","h":"#route","p":1944},{"i":2027,"t":"SaveFile","u":"/v1.x/api/ctx","h":"#savefile","p":1944},{"i":2029,"t":"Secure","u":"/v1.x/api/ctx","h":"#secure","p":1944},{"i":2031,"t":"Send","u":"/v1.x/api/ctx","h":"#send","p":1944},{"i":2033,"t":"SendFile","u":"/v1.x/api/ctx","h":"#sendfile","p":1944},{"i":2035,"t":"SendStatus","u":"/v1.x/api/ctx","h":"#sendstatus","p":1944},{"i":2037,"t":"Set","u":"/v1.x/api/ctx","h":"#set","p":1944},{"i":2039,"t":"Stale","u":"/v1.x/api/ctx","h":"#stale","p":1944},{"i":2041,"t":"Status","u":"/v1.x/api/ctx","h":"#status","p":1944},{"i":2043,"t":"Subdomains","u":"/v1.x/api/ctx","h":"#subdomains","p":1944},{"i":2045,"t":"Type","u":"/v1.x/api/ctx","h":"#type","p":1944},{"i":2047,"t":"Vary","u":"/v1.x/api/ctx","h":"#vary","p":1944},{"i":2049,"t":"Write","u":"/v1.x/api/ctx","h":"#write","p":1944},{"i":2051,"t":"XHR","u":"/v1.x/api/ctx","h":"#xhr","p":1944},{"i":2055,"t":"Compress","u":"/v1.x/api/middleware","h":"#compress","p":2053},{"i":2057,"t":"Skipping middleware execution","u":"/v1.x/api/middleware","h":"#skipping-middleware-execution","p":2053},{"i":2059,"t":"FileSystem","u":"/v1.x/api/middleware","h":"#filesystem","p":2053},{"i":2060,"t":"Favicon","u":"/v1.x/api/middleware","h":"#favicon","p":2053},{"i":2062,"t":"Catching Errors","u":"/v1.x/guide/error-handling","h":"#catching-errors","p":2061},{"i":2064,"t":"Default Error Handler","u":"/v1.x/guide/error-handling","h":"#default-error-handler","p":2061},{"i":2066,"t":"Custom Error Handler","u":"/v1.x/guide/error-handling","h":"#custom-error-handler","p":2061},{"i":2069,"t":"Paths","u":"/v1.x/guide/grouping","h":"#paths","p":2068},{"i":2071,"t":"Group Handlers","u":"/v1.x/guide/grouping","h":"#group-handlers","p":2068},{"i":2074,"t":"Paths","u":"/v1.x/guide/routing","h":"#paths","p":2073},{"i":2076,"t":"Parameters","u":"/v1.x/guide/routing","h":"#parameters","p":2073},{"i":2078,"t":"Middleware","u":"/v1.x/guide/routing","h":"#middleware","p":2073},{"i":2080,"t":"Grouping","u":"/v1.x/guide/routing","h":"#grouping","p":2073},{"i":2083,"t":"Validator package","u":"/v1.x/guide/validating","h":"#validator-package","p":2082},{"i":2086,"t":"TechEmpower","u":"/v1.x/misc/benchmarks","h":"#techempower","p":2085},{"i":2088,"t":"Plaintext","u":"/v1.x/misc/benchmarks","h":"#plaintext","p":2085},{"i":2090,"t":"Data Updates","u":"/v1.x/misc/benchmarks","h":"#data-updates","p":2085},{"i":2092,"t":"Multiple Queries","u":"/v1.x/misc/benchmarks","h":"#multiple-queries","p":2085},{"i":2094,"t":"Single Query","u":"/v1.x/misc/benchmarks","h":"#single-query","p":2085},{"i":2096,"t":"JSON Serialization","u":"/v1.x/misc/benchmarks","h":"#json-serialization","p":2085},{"i":2098,"t":"Go web framework benchmark","u":"/v1.x/misc/benchmarks","h":"#go-web-framework-benchmark","p":2085},{"i":2101,"t":"How should I structure my application?","u":"/v1.x/misc/faq","h":"#how-should-i-structure-my-application","p":2100},{"i":2103,"t":"How do I handle custom 404 responses?","u":"/v1.x/misc/faq","h":"#how-do-i-handle-custom-404-responses","p":2100},{"i":2105,"t":"How do I set up an error handler?","u":"/v1.x/misc/faq","h":"#how-do-i-set-up-an-error-handler","p":2100},{"i":2107,"t":"Which template engines does Fiber support?","u":"/v1.x/misc/faq","h":"#which-template-engines-does-fiber-support","p":2100},{"i":2109,"t":"Does Fiber have a community chat?","u":"/v1.x/misc/faq","h":"#does-fiber-have-a-community-chat","p":2100},{"i":2112,"t":"Template interfaces","u":"/v1.x/guide/templates","h":"#template-interfaces","p":2111},{"i":2114,"t":"Engines","u":"/v1.x/guide/templates","h":"#engines","p":2111}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/1913",[0,4.652]],["t/1915",[1,3.465,2,3.465]],["t/1917",[3,3.465,4,3.465]],["t/1919",[5,3.465,6,3.042]],["t/1921",[7,3.042,8,3.465]],["t/1923",[9,4.652]],["t/1926",[10,4.652]],["t/1928",[11,3.709]],["t/1930",[7,4.083]],["t/1932",[12,3.465,13,3.042]],["t/1934",[14,3.709]],["t/1936",[15,4.652]],["t/1938",[16,4.083]],["t/1940",[16,4.083]],["t/1942",[17,4.652]],["t/1945",[18,4.652]],["t/1947",[19,4.652]],["t/1949",[20,4.652]],["t/1951",[21,4.652]],["t/1953",[22,4.652]],["t/1955",[23,4.652]],["t/1957",[24,4.652]],["t/1959",[25,4.652]],["t/1961",[26,4.652]],["t/1963",[27,4.083]],["t/1965",[27,4.083]],["t/1967",[28,4.652]],["t/1969",[29,4.652]],["t/1971",[30,3.206]],["t/1973",[31,4.652]],["t/1975",[32,4.652]],["t/1977",[33,4.652]],["t/1979",[34,4.652]],["t/1981",[]],["t/1983",[35,4.652]],["t/1985",[36,4.083]],["t/1987",[36,4.083]],["t/1989",[]],["t/1991",[37,4.083]],["t/1993",[38,4.652]],["t/1995",[39,4.652]],["t/1997",[40,4.652]],["t/1999",[41,4.652]],["t/2001",[13,4.083]],["t/2003",[42,4.652]],["t/2005",[43,4.652]],["t/2007",[44,4.652]],["t/2009",[45,4.652]],["t/2011",[46,3.709]],["t/2013",[47,4.652]],["t/2015",[48,3.709]],["t/2017",[49,4.652]],["t/2019",[50,4.652]],["t/2021",[51,4.652]],["t/2023",[52,4.652]],["t/2025",[6,4.083]],["t/2027",[53,4.652]],["t/2029",[54,4.652]],["t/2031",[55,4.652]],["t/2033",[56,4.652]],["t/2035",[57,4.652]],["t/2037",[11,3.709]],["t/2039",[58,4.652]],["t/2041",[59,4.652]],["t/2043",[60,4.652]],["t/2045",[61,4.652]],["t/2047",[62,4.652]],["t/2049",[63,4.652]],["t/2051",[64,4.652]],["t/2055",[65,4.652]],["t/2057",[66,2.761,67,2.424,68,2.761]],["t/2059",[69,4.652]],["t/2060",[70,4.652]],["t/2062",[30,2.388,71,3.465]],["t/2064",[30,1.903,72,2.761,73,2.035]],["t/2066",[30,1.903,73,2.035,74,2.424]],["t/2069",[46,3.709]],["t/2071",[14,2.763,73,2.554]],["t/2074",[46,3.709]],["t/2076",[75,4.652]],["t/2078",[67,4.083]],["t/2080",[14,3.709]],["t/2083",[76,3.465,77,3.465]],["t/2086",[78,4.652]],["t/2088",[79,4.652]],["t/2090",[80,3.465,81,3.465]],["t/2092",[48,2.763,82,3.465]],["t/2094",[48,2.763,83,3.465]],["t/2096",[37,3.042,84,3.465]],["t/2098",[85,2.295,86,2.295,87,2.295,88,2.295]],["t/2101",[89,3.465,90,3.465]],["t/2103",[74,2.014,91,2.295,92,2.295,93,2.295]],["t/2105",[11,1.83,30,1.581,73,1.692,94,2.295]],["t/2107",[95,2.014,96,2.014,97,2.014,98,2.295]],["t/2109",[97,2.424,99,2.761,100,2.761]],["t/2112",[95,3.042,101,3.465]],["t/2114",[96,4.083]]],"invertedIndex":[["404",{"_index":92,"t":{"2103":{"position":[[23,3]]}}}],["accept",{"_index":18,"t":{"1945":{"position":[[0,7]]}}}],["alloc",{"_index":2,"t":{"1915":{"position":[[5,10]]}}}],["app",{"_index":21,"t":{"1951":{"position":[[0,3]]}}}],["append",{"_index":19,"t":{"1947":{"position":[[0,6]]}}}],["applic",{"_index":90,"t":{"2101":{"position":[[26,12]]}}}],["attach",{"_index":20,"t":{"1949":{"position":[[0,10]]}}}],["baseurl",{"_index":22,"t":{"1953":{"position":[[0,7]]}}}],["basic",{"_index":5,"t":{"1919":{"position":[[0,5]]}}}],["benchmark",{"_index":88,"t":{"2098":{"position":[[17,9]]}}}],["bodi",{"_index":23,"t":{"1955":{"position":[[0,4]]}}}],["bodypars",{"_index":24,"t":{"1957":{"position":[[0,10]]}}}],["catch",{"_index":71,"t":{"2062":{"position":[[0,8]]}}}],["chat",{"_index":100,"t":{"2109":{"position":[[28,5]]}}}],["clearcooki",{"_index":25,"t":{"1959":{"position":[[0,11]]}}}],["commun",{"_index":99,"t":{"2109":{"position":[[18,9]]}}}],["compress",{"_index":65,"t":{"2055":{"position":[[0,8]]}}}],["context",{"_index":26,"t":{"1961":{"position":[[0,7]]}}}],["cooki",{"_index":27,"t":{"1963":{"position":[[0,6]]},"1965":{"position":[[0,7]]}}}],["custom",{"_index":74,"t":{"2066":{"position":[[0,6]]},"2103":{"position":[[16,6]]}}}],["data",{"_index":80,"t":{"2090":{"position":[[0,4]]}}}],["default",{"_index":72,"t":{"2064":{"position":[[0,7]]}}}],["download",{"_index":28,"t":{"1967":{"position":[[0,8]]}}}],["engin",{"_index":96,"t":{"2107":{"position":[[15,7]]},"2114":{"position":[[0,7]]}}}],["error",{"_index":30,"t":{"1971":{"position":[[0,5]]},"2062":{"position":[[9,6]]},"2064":{"position":[[8,5]]},"2066":{"position":[[7,5]]},"2105":{"position":[[19,5]]}}}],["execut",{"_index":68,"t":{"2057":{"position":[[20,9]]}}}],["fasthttp",{"_index":29,"t":{"1969":{"position":[[0,8]]}}}],["favicon",{"_index":70,"t":{"2060":{"position":[[0,7]]}}}],["fiber",{"_index":97,"t":{"2107":{"position":[[28,5]]},"2109":{"position":[[5,5]]}}}],["file",{"_index":8,"t":{"1921":{"position":[[7,5]]}}}],["filesystem",{"_index":69,"t":{"2059":{"position":[[0,10]]}}}],["format",{"_index":31,"t":{"1973":{"position":[[0,6]]}}}],["formfil",{"_index":32,"t":{"1975":{"position":[[0,8]]}}}],["formvalu",{"_index":33,"t":{"1977":{"position":[[0,9]]}}}],["framework",{"_index":87,"t":{"2098":{"position":[[7,9]]}}}],["fresh",{"_index":34,"t":{"1979":{"position":[[0,5]]}}}],["go",{"_index":85,"t":{"2098":{"position":[[0,2]]}}}],["group",{"_index":14,"t":{"1934":{"position":[[0,5]]},"2071":{"position":[[0,5]]},"2080":{"position":[[0,8]]}}}],["handl",{"_index":91,"t":{"2103":{"position":[[9,6]]}}}],["handler",{"_index":73,"t":{"2064":{"position":[[14,7]]},"2066":{"position":[[13,7]]},"2071":{"position":[[6,8]]},"2105":{"position":[[25,8]]}}}],["hello",{"_index":3,"t":{"1917":{"position":[[0,6]]}}}],["hostnam",{"_index":35,"t":{"1983":{"position":[[0,8]]}}}],["http",{"_index":12,"t":{"1932":{"position":[[0,4]]}}}],["instal",{"_index":0,"t":{"1913":{"position":[[0,12]]}}}],["interfac",{"_index":101,"t":{"2112":{"position":[[9,10]]}}}],["ip",{"_index":36,"t":{"1985":{"position":[[0,2]]},"1987":{"position":[[0,3]]}}}],["json",{"_index":37,"t":{"1991":{"position":[[0,4]]},"2096":{"position":[[0,4]]}}}],["jsonp",{"_index":38,"t":{"1993":{"position":[[0,5]]}}}],["link",{"_index":39,"t":{"1995":{"position":[[0,5]]}}}],["listen",{"_index":16,"t":{"1938":{"position":[[0,6]]},"1940":{"position":[[0,8]]}}}],["local",{"_index":40,"t":{"1997":{"position":[[0,6]]}}}],["locat",{"_index":41,"t":{"1999":{"position":[[0,8]]}}}],["method",{"_index":13,"t":{"1932":{"position":[[5,7]]},"2001":{"position":[[0,6]]}}}],["middlewar",{"_index":67,"t":{"2057":{"position":[[9,10]]},"2078":{"position":[[0,10]]}}}],["multipartform",{"_index":42,"t":{"2003":{"position":[[0,13]]}}}],["multipl",{"_index":82,"t":{"2092":{"position":[[0,8]]}}}],["new",{"_index":10,"t":{"1926":{"position":[[0,3]]}}}],["next",{"_index":43,"t":{"2005":{"position":[[0,4]]}}}],["note",{"_index":9,"t":{"1923":{"position":[[0,4]]}}}],["originalurl",{"_index":44,"t":{"2007":{"position":[[0,11]]}}}],["packag",{"_index":77,"t":{"2083":{"position":[[10,7]]}}}],["param",{"_index":45,"t":{"2009":{"position":[[0,6]]}}}],["paramet",{"_index":75,"t":{"2076":{"position":[[0,10]]}}}],["path",{"_index":46,"t":{"2011":{"position":[[0,4]]},"2069":{"position":[[0,5]]},"2074":{"position":[[0,5]]}}}],["plaintext",{"_index":79,"t":{"2088":{"position":[[0,9]]}}}],["protocol",{"_index":47,"t":{"2013":{"position":[[0,8]]}}}],["queri",{"_index":48,"t":{"2015":{"position":[[0,5]]},"2092":{"position":[[9,7]]},"2094":{"position":[[7,5]]}}}],["querypars",{"_index":49,"t":{"2017":{"position":[[0,11]]}}}],["rang",{"_index":50,"t":{"2019":{"position":[[0,5]]}}}],["redirect",{"_index":51,"t":{"2021":{"position":[[0,8]]}}}],["render",{"_index":52,"t":{"2023":{"position":[[0,6]]}}}],["respons",{"_index":93,"t":{"2103":{"position":[[27,10]]}}}],["rout",{"_index":6,"t":{"1919":{"position":[[6,7]]},"2025":{"position":[[0,5]]}}}],["savefil",{"_index":53,"t":{"2027":{"position":[[0,8]]}}}],["secur",{"_index":54,"t":{"2029":{"position":[[0,6]]}}}],["send",{"_index":55,"t":{"2031":{"position":[[0,4]]}}}],["sendfil",{"_index":56,"t":{"2033":{"position":[[0,8]]}}}],["sendstatu",{"_index":57,"t":{"2035":{"position":[[0,10]]}}}],["serial",{"_index":84,"t":{"2096":{"position":[[5,13]]}}}],["set",{"_index":11,"t":{"1928":{"position":[[0,8]]},"2037":{"position":[[0,3]]},"2105":{"position":[[9,3]]}}}],["singl",{"_index":83,"t":{"2094":{"position":[[0,6]]}}}],["skip",{"_index":66,"t":{"2057":{"position":[[0,8]]}}}],["stack",{"_index":15,"t":{"1936":{"position":[[0,5]]}}}],["stale",{"_index":58,"t":{"2039":{"position":[[0,5]]}}}],["static",{"_index":7,"t":{"1921":{"position":[[0,6]]},"1930":{"position":[[0,6]]}}}],["statu",{"_index":59,"t":{"2041":{"position":[[0,6]]}}}],["structur",{"_index":89,"t":{"2101":{"position":[[13,9]]}}}],["subdomain",{"_index":60,"t":{"2043":{"position":[[0,10]]}}}],["support",{"_index":98,"t":{"2107":{"position":[[34,8]]}}}],["techempow",{"_index":78,"t":{"2086":{"position":[[0,11]]}}}],["templat",{"_index":95,"t":{"2107":{"position":[[6,8]]},"2112":{"position":[[0,8]]}}}],["test",{"_index":17,"t":{"1942":{"position":[[0,4]]}}}],["type",{"_index":61,"t":{"2045":{"position":[[0,4]]}}}],["up",{"_index":94,"t":{"2105":{"position":[[13,2]]}}}],["updat",{"_index":81,"t":{"2090":{"position":[[5,7]]}}}],["valid",{"_index":76,"t":{"2083":{"position":[[0,9]]}}}],["vari",{"_index":62,"t":{"2047":{"position":[[0,4]]}}}],["web",{"_index":86,"t":{"2098":{"position":[[3,3]]}}}],["world",{"_index":4,"t":{"1917":{"position":[[7,6]]}}}],["write",{"_index":63,"t":{"2049":{"position":[[0,5]]}}}],["xhr",{"_index":64,"t":{"2051":{"position":[[0,3]]}}}],["zero",{"_index":1,"t":{"1915":{"position":[[0,4]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":1912,"t":"Fiber is an Express inspired web framework build on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development with zero memory allocation and performance in mind. caution These docs are for the old Fiber v1, you can view the v2 docs here. v2.0.0 was released on September 15th, 2020, and contains numerous changes regarding performance and API design.","s":"πŸ“– Getting started","u":"/v1.x/","h":"","p":1911},{"i":1914,"t":"First of all, download and install Go. 1.11 or higher is required. Installation is done using the go get command: go get -u github.com/gofiber/fiber","s":"Installation","u":"/v1.x/","h":"#installation","p":1911},{"i":1916,"t":"caution Some values returned from fiber.Ctx are not immutable by default Because fiber is optimized for high-performance, values returned from fiber.Ctx are not immutable by default and will be re-used across requests. As a rule of thumb, you must only use context values within the handler, and you must not keep any references. As soon as you return from the handler, any values you have obtained from the context will be re-used in future requests and will change below your feet. Here is an example: func handler(c *fiber.Ctx) { result := c.Param(\"foo\") // result is only valid within this method } If you need to persist such values outside the handler, make copies of their underlying buffer using the copy builtin. Here is an example for persisting a string: func handler(c *fiber.Ctx) { result := c.Param(\"foo\") // result is only valid within this method newBuffer := make([]byte, len(result)) copy(newBuffer, result) newResult := string(newBuffer) // newResult is immutable and valid forever } We created a custom ImmutableString function that does the above and is available in the gofiber/utils package. app.Get(\"/:foo\", func(c *fiber.Ctx) { result := utils.ImmutableString(c.Param(\"foo\")) // result is now immutable }) Alternatively, you can also use the Immutable setting. It will make all values returned from the context immutable, allowing you to persist them anywhere. Of course, this comes at the cost of performance. For more information, please check #426 and #185.","s":"Zero Allocation","u":"/v1.x/","h":"#zero-allocation","p":1911},{"i":1918,"t":"Embedded below is essentially the most straightforward Fiber app, which you can create. package main import \"github.com/gofiber/fiber\" func main() { app := fiber.New() app.Get(\"/\", func(c *fiber.Ctx) { c.Send(\"Hello, World!\") }) app.Listen(3000) } go run server.go Browse to http://localhost:3000, and you should see Hello, World! on the page.","s":"Hello, World!","u":"/v1.x/","h":"#hello-world","p":1911},{"i":1920,"t":"Routing refers to determining how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (GET, PUT, POST and so on). info Each route can have multiple handler functions, that is executed when the route is matched. Route definition takes the following structures: // Function signature app.Method(path string, ...func(*fiber.Ctx)) app is an instance of Fiber. Method is an HTTP request method, in capitalization: Get, Put, Post, etc. path is a virtual path on the server. func(*fiber.Ctx) is a callback function containing the Context executed when the route is matched. Simple route // Respond with \"Hello, World!\" on root path, \"/\" app.Get(\"/\", func(c *fiber.Ctx) { c.Send(\"Hello, World!\") }) Parameters // GET http://localhost:8080/hello%20world app.Get(\"/:value\", func(c *fiber.Ctx) { c.Send(\"Get request with value: \" + c.Params(\"value\")) // => Get request with value: hello world }) Optional parameter // GET http://localhost:3000/john app.Get(\"/:name?\", func(c *fiber.Ctx) { if c.Params(\"name\") != \"\" { c.Send(\"Hello \" + c.Params(\"name\")) // => Hello john } else { c.Send(\"Where is john?\") } }) Wildcards // GET http://localhost:3000/api/user/john app.Get(\"/api/*\", func(c *fiber.Ctx) { c.Send(\"API path: \" + c.Params(\"*\")) // => API path: user/john })","s":"Basic routing","u":"/v1.x/","h":"#basic-routing","p":1911},{"i":1922,"t":"To serve static files such as images, CSS, and JavaScript files, replace your function handler with a file or directory string. Function signature: app.Static(prefix, root string) Use the following code to serve files in a directory named ./public: app := fiber.New() app.Static(\"/\", \"./public\") app.Listen(8080) Now, you can load the files that are in the ./public directory: http://localhost:8080/hello.html http://localhost:8080/js/jquery.js http://localhost:8080/css/style.css","s":"Static files","u":"/v1.x/","h":"#static-files","p":1911},{"i":1924,"t":"For more information on how to build APIs in Go with Fiber, please check out this excellent article on building an express-style API in Go with Fiber","s":"Note","u":"/v1.x/","h":"#note","p":1911},{"i":1927,"t":"This method creates a new App named instance. You can pass optional settings when creating a new instance Signature fiber.New(settings ...*Settings) *App Example package main import \"github.com/gofiber/fiber\" func main() { app := fiber.New() // ... app.Listen(3000) }","s":"New","u":"/v1.x/api/app","h":"#new","p":1925},{"i":1929,"t":"You can pass application settings when calling New. Example func main() { // Pass Settings creating a new instance app := fiber.New(&fiber.Settings{ Prefork: true, CaseSensitive: true, StrictRouting: true, ServerHeader: \"Fiber\", }) // ... app.Listen(3000) } Or change the settings after initializing an app. Example func main() { app := fiber.New() // Or change Settings after creating an instance app.Settings.Prefork = true app.Settings.CaseSensitive = true app.Settings.StrictRouting = true app.Settings.ServerHeader = \"Fiber\" // ... app.Listen(3000) } Settings fields Property Type Description Default Prefork bool Enables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding. false ServerHeader string Enables the Server HTTP header with the given value. \"\" StrictRouting bool When enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same. false CaseSensitive bool When enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same. false Immutable bool When enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see the issue #185. false UnescapePath bool Converts all encoded characters in the route back before setting the path for the context, so that the routing can also work with urlencoded special characters false BodyLimit int Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response. 4 * 1024 * 1024 CompressedFileSuffix string Adds suffix to the original file name and tries saving the resulting compressed file under the new file name. \".fiber.gz\" Concurrency int Maximum number of concurrent connections. 256 * 1024 DisableKeepalive bool Disable keep-alive connections, the server will close incoming connections after sending the first response to client false DisableDefaultDate bool When set to true causes the default date header to be excluded from the response. false DisableDefaultContentType bool When set to true, causes the default Content-Type header to be excluded from the Response. false DisableStartupMessage bool When set to true, it will not print out the fiber ASCII and \"listening\" on message false DisableHeaderNormalizing bool By default all header names are normalized: conteNT-tYPE -> Content-Type false ETag bool Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled. false Views Views Views is the interface that wraps the Render function. See our Template Middleware for supported engines. nil ReadTimeout time.Duration The amount of time allowed to read the full request, including body. The default timeout is unlimited. nil WriteTimeout time.Duration The maximum duration before timing out writes of the response. The default timeout is unlimited. nil IdleTimeout time.Duration The maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used. nil ReadBufferSize int per-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies). 4096 WriteBufferSize int Per-connection buffer size for responses' writing. 4096","s":"Settings","u":"/v1.x/api/app","h":"#settings","p":1925},{"i":1931,"t":"Use the Static method to serve static files such as images, CSS and JavaScript. info By default, Static will serve index.html files in response to a request on a directory. Signature app.Static(prefix, root string, config ...Static) // => with prefix Use the following code to serve files in a directory named ./public Example app.Static(\"/\", \"./public\") // => http://localhost:3000/hello.html // => http://localhost:3000/js/jquery.js // => http://localhost:3000/css/style.css To serve from multiple directories, you can use Static numerous times. Example // Serve files from \"./public\" directory: app.Static(\"/\", \"./public\") // Serve files from \"./files\" directory: app.Static(\"/\", \"./files\") info Use a reverse proxy cache like NGINX to improve performance of serving static assets. You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below: Example app.Static(\"/static\", \"./public\") // => http://localhost:3000/static/hello.html // => http://localhost:3000/static/js/jquery.js // => http://localhost:3000/static/css/style.css If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings. fiber.Static{} // Static represents settings for serving static files type Static struct { // Transparently compresses responses if set to true // This works differently than the github.com/gofiber/compression middleware // The server tries minimizing CPU usage by caching compressed files. // It adds \".fiber.gz\" suffix to the original file name. // Optional. Default value false Compress bool // Enables byte-range requests if set to true. // Optional. Default value false ByteRange bool // Enable directory browsing. // Optional. Default value false. Browse bool // File to serve when requesting a directory path. // Optional. Default value \"index.html\". Index string } Example app.Static(\"/\", \"./public\", fiber.Static{ Compress: true, ByteRange: true, Browse: true, Index: \"john.html\" })","s":"Static","u":"/v1.x/api/app","h":"#static","p":1925},{"i":1933,"t":"Routes an HTTP request, where METHOD is the HTTP method of the request. Signatures // Add allows you to specifiy a method as value app.Add(method, path string, handlers ...func(*Ctx)) Router // All will register the route on all methods app.All(path string, handlers ...func(*Ctx)) Router // HTTP methods app.Get(path string, handlers ...func(*Ctx)) Router app.Put(path string, handlers ...func(*Ctx)) Router app.Post(path string, handlers ...func(*Ctx)) Router app.Head(path string, handlers ...func(*Ctx)) Router app.Patch(path string, handlers ...func(*Ctx)) Router app.Trace(path string, handlers ...func(*Ctx)) Router app.Delete(path string, handlers ...func(*Ctx)) Router app.Connect(path string, handlers ...func(*Ctx)) Router app.Options(path string, handlers ...func(*Ctx)) Router // Use is mostly used for middleware modules // These routes will only match the beggining of each path // i.e. \"/john\" will match \"/john/doe\", \"/johnnnn\" app.Use(handlers ...func(*Ctx)) Router app.Use(prefix string, handlers ...func(*Ctx)) Router Example app.Use(\"/api\", func(c *fiber.Ctx) { c.Set(\"X-Custom-Header\", random.String(32)) c.Next() }) app.Get(\"/api/list\", func(c *fiber.Ctx) { c.Send(\"I'm a GET request!\") }) app.Post(\"/api/register\", func(c *fiber.Ctx) { c.Send(\"I'm a POST request!\") })","s":"HTTP Methods","u":"/v1.x/api/app","h":"#http-methods","p":1925},{"i":1935,"t":"You can group routes by creating a *Group struct. Signature app.Group(prefix string, handlers ...func(*Ctx)) Router Example func main() { app := fiber.New() api := app.Group(\"/api\", handler) // /api v1 := api.Group(\"/v1\", handler) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", handler) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user app.Listen(3000) }","s":"Group","u":"/v1.x/api/app","h":"#group","p":1925},{"i":1937,"t":"This method returns the original router stack Signature app.Stack() [][]*Route Example app := fiber.New() app.Use(handler) app.Get(\"/john\", handler) app.Post(\"/register\", handler) app.Get(\"/v1/users\", handler) app.Put(\"/user/:id\", handler) app.Head(\"/xhr\", handler) data, _ := json.MarshalIndent(app.Stack(), \"\", \" \") fmt.Println(string(data))","s":"Stack","u":"/v1.x/api/app","h":"#stack","p":1925},{"i":1939,"t":"Binds and listens for connections on the specified address. This can be an int for port or string for address. This will listen either on tcp4 or tcp6 depending on the address input (i.e. :3000 / [::1]:3000 ). Signature app.Listen(address interface{}, tls ...*tls.Config) error Examples app.Listen(8080) app.Listen(\"8080\") app.Listen(\":8080\") app.Listen(\"127.0.0.1:8080\") app.Listen(\"[::1]:8080\") To enable TLS/HTTPS you can append a TLS config. Example cer, err := tls.LoadX509KeyPair(\"server.crt\", \"server.key\") if err != nil { log.Fatal(err) } config := &tls.Config{Certificates: []tls.Certificate{cer}} app.Listen(443, config)","s":"Listen","u":"/v1.x/api/app","h":"#listen","p":1925},{"i":1941,"t":"You can pass your own net.Listener using the Listener method. Signature app.Listener(ln net.Listener, tls ...*tls.Config) error caution Listener does not support the Prefork feature. Example if ln, err = net.Listen(\"tcp\", \":8080\"); err != nil { log.Fatal(err) } app.Listener(ln)","s":"Listener","u":"/v1.x/api/app","h":"#listener","p":1925},{"i":1943,"t":"Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 200ms if you want to disable a timeout altogether, pass -1 as a second argument. Signature app.Test(req *http.Request, msTimeout ...int) (*http.Response, error) Example // Create route with GET method for test: app.Get(\"/\", func(c *Ctx) { fmt.Println(c.BaseURL()) // => http://google.com fmt.Println(c.Get(\"X-Custom-Header\")) // => hi c.Send(\"hello, World!\") }) // http.Request req := httptest.NewRequest(\"GET\", \"http://google.com\", nil) req.Header.Set(\"X-Custom-Header\", \"hi\") // http.Response resp, _ := app.Test(req) // Do something with results: if resp.StatusCode == 200 { body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) // => Hello, World! }","s":"Test","u":"/v1.x/api/app","h":"#test","p":1925},{"i":1946,"t":"Checks, if the specified extensions or content types are acceptable. info Based on the request’s Accept HTTP header. Signature c.Accepts(types ...string) string c.AcceptsCharsets(charsets ...string) string c.AcceptsEncodings(encodings ...string) string c.AcceptsLanguages(langs ...string) string Example // Accept: text/*, application/json app.Get(\"/\", func(c *fiber.Ctx) { c.Accepts(\"html\") // \"html\" c.Accepts(\"text/html\") // \"text/html\" c.Accepts(\"json\", \"text\") // \"json\" c.Accepts(\"application/json\") // \"application/json\" c.Accepts(\"image/png\") // \"\" c.Accepts(\"png\") // \"\" }) Fiber provides similar functions for the other accept headers. // Accept-Charset: utf-8, iso-8859-1;q=0.2 // Accept-Encoding: gzip, compress;q=0.2 // Accept-Language: en;q=0.8, nl, ru app.Get(\"/\", func(c *fiber.Ctx) { c.AcceptsCharsets(\"utf-16\", \"iso-8859-1\") // \"iso-8859-1\" c.AcceptsEncodings(\"compress\", \"br\") // \"compress\" c.AcceptsLanguages(\"pt\", \"nl\", \"ru\") // \"nl\" })","s":"Accepts","u":"/v1.x/api/ctx","h":"#accepts","p":1944},{"i":1948,"t":"Appends the specified value to the HTTP response header field. caution If the header is not already set, it creates the header with the specified value. Signature c.Append(field, values ...string) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Append(\"Link\", \"http://google.com\", \"http://localhost\") // => Link: http://localhost, http://google.com c.Append(\"Link\", \"Test\") // => Link: http://localhost, http://google.com, Test })","s":"Append","u":"/v1.x/api/ctx","h":"#append","p":1944},{"i":1950,"t":"Sets the HTTP response Content-Disposition header field to attachment. Signature c.Attachment(file ...string) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Attachment() // => Content-Disposition: attachment c.Attachment(\"./upload/images/logo.png\") // => Content-Disposition: attachment; filename=\"logo.png\" // => Content-Type: image/png })","s":"Attachment","u":"/v1.x/api/ctx","h":"#attachment","p":1944},{"i":1952,"t":"Returns the *App reference so you could easily access all application settings. Signature c.App() *App Example app.Get(\"/bodylimit\", func(c *fiber.Ctx) { bodylimit := c.App().Settings.BodyLimit c.Send(bodylimit) })","s":"App","u":"/v1.x/api/ctx","h":"#app","p":1944},{"i":1954,"t":"Returns the base URL (protocol + host) as a string. Signature c.BaseURL() string Example // GET https://example.com/page#chapter-1 app.Get(\"/\", func(c *fiber.Ctx) { c.BaseURL() // https://example.com })","s":"BaseURL","u":"/v1.x/api/ctx","h":"#baseurl","p":1944},{"i":1956,"t":"Returns the request body. Signature c.Body() string Example // curl -X POST http://localhost:8080 -d user=john app.Post(\"/\", func(c *fiber.Ctx) { // Get raw body from POST request: c.Body() // user=john }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Body","u":"/v1.x/api/ctx","h":"#body","p":1944},{"i":1958,"t":"Binds the request body to a struct. BodyParser supports decoding query parameters and the following content types based on the Content-Type header: application/json application/xml application/x-www-form-urlencoded multipart/form-data Signature c.BodyParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `json:\"name\" xml:\"name\" form:\"name\"` Pass string `json:\"pass\" xml:\"pass\" form:\"pass\"` } app.Post(\"/\", func(c *fiber.Ctx) { p := new(Person) if err := c.BodyParser(p); err != nil { log.Fatal(err) } log.Println(p.Name) // john log.Println(p.Pass) // doe }) // Run tests with the following curl commands // curl -X POST -H \"Content-Type: application/json\" --data \"{\\\"name\\\":\\\"john\\\",\\\"pass\\\":\\\"doe\\\"}\" localhost:3000 // curl -X POST -H \"Content-Type: application/xml\" --data \"johndoe\" localhost:3000 // curl -X POST -H \"Content-Type: application/x-www-form-urlencoded\" --data \"name=john&pass=doe\" localhost:3000 // curl -X POST -F name=john -F pass=doe http://localhost:3000 // curl -X POST \"http://localhost:3000/?name=john&pass=doe\"","s":"BodyParser","u":"/v1.x/api/ctx","h":"#bodyparser","p":1944},{"i":1960,"t":"Expire a client cookie (or all cookies if left empty) Signature c.ClearCookie(key ...string) Example app.Get(\"/\", func(c *fiber.Ctx) { // Clears all cookies: c.ClearCookie() // Expire specific cookie by name: c.ClearCookie(\"user\") // Expire multiple cookies by names: c.ClearCookie(\"token\", \"session\", \"track_id\", \"version\") }) caution Web browsers and other compliant clients will only clear the cookie if the given options are identical to those when creating the cookie, excluding expires and maxAge. ClearCookie will not set these values for you - a technique similar to the one shown below should be used to ensure your cookie is deleted. Example app.Get(\"/set\", func(c *fiber.Ctx) { c.Cookie(&fiber.Cookie{ Name: \"token\", Value: \"randomvalue\", Expires: time.Now().Add(24 * time.Hour), HTTPOnly: true, SameSite: \"lax\", }) }) app.Get(\"/delete\", func(c *fiber.Ctx) { c.Cookie(&fiber.Cookie{ Name: \"token\", // Set expiry date to the past Expires: time.Now().Add(-(time.Hour * 2)), HTTPOnly: true, SameSite: \"lax\", }) })","s":"ClearCookie","u":"/v1.x/api/ctx","h":"#clearcookie","p":1944},{"i":1962,"t":"Returns context.Context that carries a deadline, a cancellation signal, and other values across API boundaries. Signature c.Context() context.Context","s":"Context","u":"/v1.x/api/ctx","h":"#context","p":1944},{"i":1964,"t":"Set cookie Signature c.Cookie(*Cookie) type Cookie struct { Name string Value string Path string Domain string Expires time.Time Secure bool HTTPOnly bool SameSite string // lax, strict, none } Example app.Get(\"/\", func(c *fiber.Ctx) { // Create cookie cookie := new(fiber.Cookie) cookie.Name = \"john\" cookie.Value = \"doe\" cookie.Expires = time.Now().Add(24 * time.Hour) // Set cookie c.Cookie(cookie) })","s":"Cookie","u":"/v1.x/api/ctx","h":"#cookie","p":1944},{"i":1966,"t":"Get cookie value by key, you could pass an optional default value that will be returned if the cookie key does not exist. Signatures c.Cookies(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) { // Get cookie by key: c.Cookies(\"name\") // \"john\" c.Cookies(\"empty\", \"doe\") // \"doe\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Cookies","u":"/v1.x/api/ctx","h":"#cookies","p":1944},{"i":1968,"t":"Transfers the file from path as an attachment. Typically, browsers will prompt the user to download. By default, the Content-Disposition header filename= parameter is the file path (this typically appears in the browser dialog). Override this default with the filename parameter. Signature c.Download(path, filename ...string) error Example app.Get(\"/\", func(c *fiber.Ctx) { if err := c.Download(\"./files/report-12345.pdf\"); err != nil { c.Next(err) // Pass err to fiber } // => Download report-12345.pdf if err := c.Download(\"./files/report-12345.pdf\", \"report.pdf\"); err != nil { c.Next(err) // Pass err to fiber } // => Download report.pdf })","s":"Download","u":"/v1.x/api/ctx","h":"#download","p":1944},{"i":1970,"t":"You can still access and use all Fasthttp methods and properties. Signature info Please read the Fasthttp Documentation for more information. Example app.Get(\"/\", func(c *fiber.Ctx) { c.Fasthttp.Request.Header.Method() // => []byte(\"GET\") c.Fasthttp.Response.Write([]byte(\"Hello, World!\")) // => \"Hello, World!\" })","s":"Fasthttp","u":"/v1.x/api/ctx","h":"#fasthttp","p":1944},{"i":1972,"t":"This contains the error information that thrown by a panic or passed via the Next(err) method. Signature c.Error() error Example func main() { app := fiber.New() app.Post(\"/api/register\", func (c *fiber.Ctx) { if err := c.JSON(&User); err != nil { c.Next(err) } }) app.Get(\"/api/user\", func (c *fiber.Ctx) { if err := c.JSON(&User); err != nil { c.Next(err) } }) app.Put(\"/api/update\", func (c *fiber.Ctx) { if err := c.JSON(&User); err != nil { c.Next(err) } }) app.Use(\"/api\", func(c *fiber.Ctx) { c.Set(\"Content-Type\", \"application/json\") c.Status(500).Send(c.Error()) }) app.Listen(1337) }","s":"Error","u":"/v1.x/api/ctx","h":"#error","p":1944},{"i":1974,"t":"Performs content-negotiation on the Accept HTTP header. It uses Accepts to select a proper format. info If the header is not specified or there is no proper format, text/plain is used. Signature c.Format(body interface{}) Example app.Get(\"/\", func(c *fiber.Ctx) { // Accept: text/plain c.Format(\"Hello, World!\") // => Hello, World! // Accept: text/html c.Format(\"Hello, World!\") // =>

Hello, World!

// Accept: application/json c.Format(\"Hello, World!\") // => \"Hello, World!\" })","s":"Format","u":"/v1.x/api/ctx","h":"#format","p":1944},{"i":1976,"t":"MultipartForm files can be retrieved by name, the first file from the given key is returned. Signature c.FormFile(name string) (*multipart.FileHeader, error) Example app.Post(\"/\", func(c *fiber.Ctx) { // Get first file from form field \"document\": file, err := c.FormFile(\"document\") // Check for errors: if err == nil { // Save file to root directory: c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)) } })","s":"FormFile","u":"/v1.x/api/ctx","h":"#formfile","p":1944},{"i":1978,"t":"Any form values can be retrieved by name, the first value from the given key is returned. Signature c.FormValue(name string) string Example app.Post(\"/\", func(c *fiber.Ctx) { // Get first value from form field \"name\": c.FormValue(\"name\") // => \"john\" or \"\" if not exist }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"FormValue","u":"/v1.x/api/ctx","h":"#formvalue","p":1944},{"i":1980,"t":"https://expressjs.com/en/4x/api.html#req.fresh info Not implemented yet, pull requests are welcome!","s":"Fresh","u":"/v1.x/api/ctx","h":"#fresh","p":1944},{"i":1982,"t":"Returns the HTTP request header specified by the field. tip The match is case-insensitive. Signature c.Get(field string) string Example app.Get(\"/\", func(c *fiber.Ctx) { c.Get(\"Content-Type\") // \"text/plain\" c.Get(\"CoNtEnT-TypE\") // \"text/plain\" c.Get(\"something\") // \"\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Get","u":"/v1.x/api/ctx","h":"#get","p":1944},{"i":1984,"t":"Returns the hostname derived from the Host HTTP header. Signature c.Hostname() string Example // GET http://google.com/search app.Get(\"/\", func(c *fiber.Ctx) { c.Hostname() // \"google.com\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Hostname","u":"/v1.x/api/ctx","h":"#hostname","p":1944},{"i":1986,"t":"Returns the remote IP address of the request. Signature c.IP() string Example app.Get(\"/\", func(c *fiber.Ctx) { c.IP() // \"127.0.0.1\" })","s":"IP","u":"/v1.x/api/ctx","h":"#ip","p":1944},{"i":1988,"t":"Returns an array of IP addresses specified in the X-Forwarded-For request header. Signature c.IPs() []string Example // X-Forwarded-For: proxy1, 127.0.0.1, proxy3 app.Get(\"/\", func(c *fiber.Ctx) { c.IPs() // [\"proxy1\", \"127.0.0.1\", \"proxy3\"] })","s":"IPs","u":"/v1.x/api/ctx","h":"#ips","p":1944},{"i":1990,"t":"Returns the matching content type, if the incoming request’s Content-Type HTTP header field matches the MIME type specified by the type parameter. info If the request has no body, it returns false. Signature c.Is(t string) bool Example // Content-Type: text/html; charset=utf-8 app.Get(\"/\", func(c *fiber.Ctx) { c.Is(\"html\") // true c.Is(\".html\") // true c.Is(\"json\") // false })","s":"Is","u":"/v1.x/api/ctx","h":"#is","p":1944},{"i":1992,"t":"Converts any interface or string to JSON using Jsoniter. info JSON also sets the content header to application/json. Signature c.JSON(v interface{}) error Example type SomeStruct struct { Name string Age uint8 } app.Get(\"/json\", func(c *fiber.Ctx) { // Create data struct: data := SomeStruct{ Name: \"Grame\", Age: 20, } if err := c.JSON(data); err != nil { c.Status(500).Send(err) return } // => Content-Type: application/json // => \"{\"Name\": \"Grame\", \"Age\": 20}\" if err := c.JSON(fiber.Map{ \"name\": \"Grame\", \"age\": 20, }); err != nil { c.Status(500).Send(err) return } // => Content-Type: application/json // => \"{\"name\": \"Grame\", \"age\": 20}\" })","s":"JSON","u":"/v1.x/api/ctx","h":"#json","p":1944},{"i":1994,"t":"Sends a JSON response with JSONP support. This method is identical to JSON, except that it opts-in to JSONP callback support. By default, the callback name is simply callback. Override this by passing a named string in the method. Signature c.JSONP(v interface{}, callback ...string) error Example type SomeStruct struct { name string age uint8 } app.Get(\"/\", func(c *fiber.Ctx) { // Create data struct: data := SomeStruct{ name: \"Grame\", age: 20, } c.JSONP(data) // => callback({\"name\": \"Grame\", \"age\": 20}) c.JSONP(data, \"customFunc\") // => customFunc({\"name\": \"Grame\", \"age\": 20}) })","s":"JSONP","u":"/v1.x/api/ctx","h":"#jsonp","p":1944},{"i":1996,"t":"Joins the links followed by the property to populate the response’s Link HTTP header field. Signature c.Links(link ...string) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Link( \"http://api.example.com/users?page=2\", \"next\", \"http://api.example.com/users?page=5\", \"last\", ) // Link: ; rel=\"next\", // ; rel=\"last\" })","s":"Links","u":"/v1.x/api/ctx","h":"#links","p":1944},{"i":1998,"t":"A method that stores variables scoped to the request and, therefore, are available only to the routes that match the request. tip This is useful if you want to pass some specific data to the next middleware. Signature c.Locals(key string, value ...interface{}) interface{} Example app.Use(func(c *fiber.Ctx) { c.Locals(\"user\", \"admin\") c.Next() }) app.Get(\"/admin\", func(c *fiber.Ctx) { if c.Locals(\"user\") == \"admin\" { c.Status(200).Send(\"Welcome, admin!\") } else { c.SendStatus(403) // => 403 Forbidden } })","s":"Locals","u":"/v1.x/api/ctx","h":"#locals","p":1944},{"i":2000,"t":"Sets the response Location HTTP header to the specified path parameter. Signature c.Location(path string) Example app.Post(\"/\", func(c *fiber.Ctx) { c.Location(\"http://example.com\") c.Location(\"/foo/bar\") })","s":"Location","u":"/v1.x/api/ctx","h":"#location","p":1944},{"i":2002,"t":"Returns a string corresponding to the HTTP method of the request: GET, POST, PUT, and so on. Optionally, you could override the method by passing a string. Signature c.Method(override ...string) string Example app.Post(\"/\", func(c *fiber.Ctx) { c.Method() // \"POST\" })","s":"Method","u":"/v1.x/api/ctx","h":"#method","p":1944},{"i":2004,"t":"To access multipart form entries, you can parse the binary with MultipartForm(). This returns a map[string][]string, so given a key, the value will be a string slice. Signature c.MultipartForm() (*multipart.Form, error) Example app.Post(\"/\", func(c *fiber.Ctx) { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form if token := form.Value[\"token\"]; len(token) > 0 { // Get key value: fmt.Println(token[0]) } // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)) } } })","s":"MultipartForm","u":"/v1.x/api/ctx","h":"#multipartform","p":1944},{"i":2006,"t":"When Next is called, it executes the next method in the stack that matches the current route. You can pass an error struct within the method that will end the chaining and call the error handler. Signature c.Next(err ...error) Example app.Get(\"/\", func(c *fiber.Ctx) { fmt.Println(\"1st route!\") c.Next() }) app.Get(\"*\", func(c *fiber.Ctx) { fmt.Println(\"2nd route!\") c.Next() }) app.Get(\"/\", func(c *fiber.Ctx) { fmt.Println(\"3rd route!\") c.Send(\"Hello, World!\") })","s":"Next","u":"/v1.x/api/ctx","h":"#next","p":1944},{"i":2008,"t":"Returns the original request URL. Signature c.OriginalURL() string Example // GET http://example.com/search?q=something app.Get(\"/\", func(c *fiber.Ctx) { c.OriginalURL() // \"/search?q=something\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"OriginalURL","u":"/v1.x/api/ctx","h":"#originalurl","p":1944},{"i":2010,"t":"Method can be used to get the route parameters, you could pass an optional default value that will be returned if the param key does not exist. info Defaults to empty string (\"\"), if the param doesn't exist. Signature c.Params(param string, defaultValue ...string) string Example // GET http://example.com/user/fenny app.Get(\"/user/:name\", func(c *fiber.Ctx) { c.Params(\"name\") // \"fenny\" c.Params(\"age\", \"21\") // \"21\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...__","s":"Params","u":"/v1.x/api/ctx","h":"#params","p":1944},{"i":2012,"t":"Contains the path part of the request URL. Optionally, you could override the path by passing a string. Signature c.Path(override ...string) string Example // GET http://example.com/users?sort=desc app.Get(\"/users\", func(c *fiber.Ctx) { c.Path() // \"/users\" })","s":"Path","u":"/v1.x/api/ctx","h":"#path","p":1944},{"i":2014,"t":"Contains the request protocol string: http or https for TLS requests. Signature c.Protocol() string Example // GET http://example.com app.Get(\"/\", func(c *fiber.Ctx) { c.Protocol() // \"http\" })","s":"Protocol","u":"/v1.x/api/ctx","h":"#protocol","p":1944},{"i":2016,"t":"This property is an object containing a property for each query string parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. info If there is no query string, it returns an empty string. Signature c.Query(parameter string, defaultValue ...string) string Example // GET http://example.com/shoes?order=desc&brand=nike app.Get(\"/\", func(c *fiber.Ctx) { c.Query(\"order\") // \"desc\" c.Query(\"brand\") // \"nike\" c.Query(\"empty\", \"nike\") // \"nike\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Query","u":"/v1.x/api/ctx","h":"#query","p":1944},{"i":2018,"t":"This method is similar to BodyParser, but for query parameters. Signature c.QueryParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `query:\"name\"` Pass string `query:\"pass\"` Products []string `query:\"products\"` } app.Post(\"/\", func(c *fiber.Ctx) { p := new(Person) if err := c.QueryParser(p); err != nil { log.Fatal(err) } log.Println(p.Name) // john log.Println(p.Pass) // doe log.Println(p.Products) // [shoe, hat] }) // Run tests with the following curl command // curl -X POST \"http://localhost:3000/?name=john&pass=doe&products=shoe,hat\"","s":"QueryParser","u":"/v1.x/api/ctx","h":"#queryparser","p":1944},{"i":2020,"t":"A struct containing the type and a slice of ranges will be returned. Signature c.Range(int size) Example // Range: bytes=500-700, 700-900 app.Get(\"/\", func(c *fiber.Ctx) { b := c.Range(1000) if b.Type == \"bytes\" { for r := range r.Ranges { fmt.Println(r) // [500, 700] } } })","s":"Range","u":"/v1.x/api/ctx","h":"#range","p":1944},{"i":2022,"t":"Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. Signature c.Redirect(path string, status ...int) Example app.Get(\"/coffee\", func(c *fiber.Ctx) { c.Redirect(\"/teapot\") }) app.Get(\"/teapot\", func(c *fiber.Ctx) { c.Status(fiber.StatusTeapot).Send(\"🍡 short and stout 🍡\") }) More examples app.Get(\"/\", func(c *fiber.Ctx) { c.Redirect(\"/foo/bar\") c.Redirect(\"../login\") c.Redirect(\"http://example.com\") c.Redirect(\"http://example.com\", 301) })","s":"Redirect","u":"/v1.x/api/ctx","h":"#redirect","p":1944},{"i":2024,"t":"Renders a view with data and sends a text/html response. By default Render uses the default Go Template engine. If you want to use another View engine, please take a look at our Template middleware. Signature c.Render(file string, data interface{}, layout ...string) error","s":"Render","u":"/v1.x/api/ctx","h":"#render","p":1944},{"i":2026,"t":"Returns the matched Route struct. Signature c.Route() *Route Example // http://localhost:8080/hello handler := func(c *fiber.Ctx) { r := c.Route() fmt.Println(r.Method, r.Path, r.Params, r.Handlers) // GET /hello/:name handler [name] } app.Get(\"/hello/:name\", handler )","s":"Route","u":"/v1.x/api/ctx","h":"#route","p":1944},{"i":2028,"t":"Method is used to save any multipart file to disk. Signature c.SaveFile(fh *multipart.FileHeader, path string) Example app.Post(\"/\", func(c *fiber.Ctx) { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)) } } })","s":"SaveFile","u":"/v1.x/api/ctx","h":"#savefile","p":1944},{"i":2030,"t":"A boolean property that is true , if a TLS connection is established. Signature c.Secure() bool Example // Secure() method is equivalent to: c.Protocol() == \"https\"","s":"Secure","u":"/v1.x/api/ctx","h":"#secure","p":1944},{"i":2032,"t":"Sets the HTTP response body. The Send body can be of any type. caution Send doesn't append like the Write method. Signature c.Send(body ...interface{}) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Send(\"Hello, World!\") // => \"Hello, World!\" c.Send([]byte(\"Hello, World!\")) // => \"Hello, World!\" c.Send(123) // => 123 }) Fiber also provides SendBytes ,SendString and SendStream methods for raw inputs. tip Use this if you don't need type assertion, recommended for faster performance. Signature c.SendBytes(b []byte) c.SendString(s string) c.SendStream(r io.Reader, s ...int) Example app.Get(\"/\", func(c *fiber.Ctx) { c.SendByte([]byte(\"Hello, World!\")) // => \"Hello, World!\" c.SendString(\"Hello, World!\") // => \"Hello, World!\" c.SendStream(bytes.NewReader([]byte(\"Hello, World!\"))) // => \"Hello, World!\" })","s":"Send","u":"/v1.x/api/ctx","h":"#send","p":1944},{"i":2034,"t":"Transfers the file from the given path. Sets the Content-Type response HTTP header field based on the filenames extension. caution Method use gzipping by default, set it to true to disable. Signature c.SendFile(path string, compress ...bool) error Example app.Get(\"/not-found\", func(c *fiber.Ctx) { if err := c.SendFile(\"./public/404.html\"); err != nil { c.Next(err) // pass err to ErrorHandler } // Enable compression if err := c.SendFile(\"./static/index.html\", true); err != nil { c.Next(err) // pass err to ErrorHandler } })","s":"SendFile","u":"/v1.x/api/ctx","h":"#sendfile","p":1944},{"i":2036,"t":"Sets the status code and the correct status message in the body, if the response body is empty. tip You can find all used status codes and messages here. Signature c.SendStatus(status int) Example app.Get(\"/not-found\", func(c *fiber.Ctx) { c.SendStatus(415) // => 415 \"Unsupported Media Type\" c.Send(\"Hello, World!\") c.SendStatus(415) // => 415 \"Hello, World!\" })","s":"SendStatus","u":"/v1.x/api/ctx","h":"#sendstatus","p":1944},{"i":2038,"t":"Sets the response’s HTTP header field to the specified key, value. Signature c.Set(field, value string) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Set(\"Content-Type\", \"text/plain\") // => \"Content-type: text/plain\" })","s":"Set","u":"/v1.x/api/ctx","h":"#set","p":1944},{"i":2040,"t":"https://expressjs.com/en/4x/api.html#req.fresh info Not implemented yet, pull requests are welcome!","s":"Stale","u":"/v1.x/api/ctx","h":"#stale","p":1944},{"i":2042,"t":"Sets the HTTP status for the response. info Method is a chainable. Signature c.Status(status int) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Status(200) c.Status(400).Send(\"Bad Request\") c.Status(404).SendFile(\"./public/gopher.png\") })","s":"Status","u":"/v1.x/api/ctx","h":"#status","p":1944},{"i":2044,"t":"Returns a string slice of subdomains in the domain name of the request. The application property subdomain offset, which defaults to 2, is used for determining the beginning of the subdomain segments. Signature c.Subdomains(offset ...int) []string Example // Host: \"tobi.ferrets.example.com\" app.Get(\"/\", func(c *fiber.Ctx) { c.Subdomains() // [\"ferrets\", \"tobi\"] c.Subdomains(1) // [\"tobi\"] })","s":"Subdomains","u":"/v1.x/api/ctx","h":"#subdomains","p":1944},{"i":2046,"t":"Sets the Content-Type HTTP header to the MIME type listed here specified by the file extension. Signature c.Type(t string) string Example app.Get(\"/\", func(c *fiber.Ctx) { c.Type(\".html\") // => \"text/html\" c.Type(\"html\") // => \"text/html\" c.Type(\"json\") // => \"application/json\" c.Type(\"png\") // => \"image/png\" })","s":"Type","u":"/v1.x/api/ctx","h":"#type","p":1944},{"i":2048,"t":"Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location. info Multiple fields are allowed. Signature c.Vary(field ...string) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Vary(\"Origin\") // => Vary: Origin c.Vary(\"User-Agent\") // => Vary: Origin, User-Agent // No duplicates c.Vary(\"Origin\") // => Vary: Origin, User-Agent c.Vary(\"Accept-Encoding\", \"Accept\") // => Vary: Origin, User-Agent, Accept-Encoding, Accept })","s":"Vary","u":"/v1.x/api/ctx","h":"#vary","p":1944},{"i":2050,"t":"Appends any input to the HTTP body response. Signature c.Write(body ...interface{}) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Write(\"Hello, \") // => \"Hello, \" c.Write([]byte(\"World! \")) // => \"Hello, World! \" c.Write(123) // => \"Hello, World! 123\" })","s":"Write","u":"/v1.x/api/ctx","h":"#write","p":1944},{"i":2052,"t":"A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery). Signature c.XHR() bool Example // X-Requested-With: XMLHttpRequest app.Get(\"/\", func(c *fiber.Ctx) { c.XHR() // true })","s":"XHR","u":"/v1.x/api/ctx","h":"#xhr","p":1944},{"i":2054,"t":"Fiber ships with multiple middleware modules by default: import ( \"github.com/gofiber/fiber\" \"github.com/gofiber/fiber/middleware\" ) ****Compress Compress middleware that supports deflate, gzip and brotli compression. ****FileSystem FileSystem middleware for Fiber, special thanks and credits to Alireza Salary Favicon Ignore favicon from logs or serve from memory if a file path is provided. Logger HTTP request/response logger. Pprof HTTP server runtime profiling Recover Recover middleware recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler. RequestID Request ID middleware generates a unique id for a request. Timeout A wrapper function for handlers which will raise an error if the handler takes longer than a set amount of time to return Fiber also maintains external middleware modules, these have to be installed separately: import ( \"github.com/gofiber/fiber\" \"github.com/gofiber/\" ) gofiber/adaptor Converter for net/http handlers to/from Fiber request handlers. gofiber/basicauth Basic auth middleware provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized for missing or invalid credentials. gofiber/cors Enable cross-origin resource sharing (CORS) with various options. gofiber/csrf Protect from CSRF exploits. gofiber/helmet Helps secure your apps by setting various HTTP headers. gofiber/jwt JWT returns a JSON Web Token (JWT) auth middleware. gofiber/keyauth Key auth middleware provides a key-based authentication. gofiber/limiter Rate-limiting middleware for Fiber. Use to limit repeated requests to public APIs and/or endpoints such as password reset. gofiber/rewrite Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links. gofiber/session This session middleware is built on top of fasthttp/session by @savsgio MIT. Special thanks to gofiber/template This package contains 8 template engines gofiber/websocket Based on Gorilla WebSocket for Fiber","s":"🧬 Middleware","u":"/v1.x/api/middleware","h":"","p":2053},{"i":2056,"t":"Compress middleware for with support for deflate, gzip and brotlicompression. It will use the fastest compression method depending on the request header Accept-Encodingvalue. Signature func Compress(options ...interface{}) fiber.Handler {} Config type CompressConfig struct { // Next defines a function to skip this middleware. // Default: nil Next func(*fiber.Ctx) bool // Compression level for brotli, gzip and deflate // CompressLevelDisabled = -1 // CompressLevelDefault = 0 // CompressLevelBestSpeed = 1 // CompressLevelBestCompression = 2 // Default: CompressLevelDefault Level int } Example // Compression handler with default settings app.Use(middleware.Compress()) // Provide a custom compression level app.Use(middleware.Compress(2)) // Pass a next function to skip specific requests app.Use(middleware.Compress(func(c *fiber.Ctx) bool { return c.Path() == \"/dontcompress\" })) // Provide a full Config app.Use(middleware.Compress(middleware.CompressConfig{ Next: func(c *fiber.Ctx) bool { return c.Path() == \"/dontcompress\" }, Level: CompressLevelDefault, })","s":"Compress","u":"/v1.x/api/middleware","h":"#compress","p":2053},{"i":2058,"t":"When adding middleware to your application, you can also specify when the middleware should be activated and when it should not through a function passed when initialising the middleware using a function passed in the configuration for the middleware. Signature func (*fiber.Ctx) bool This function should return true if the middleware should be deactivated. For example, if you would like admin users to be exempt from rate-limiting, you could do something like this: Example app.Use(limiter.New(limiter.Config{ Timeout: 10, Max: 3, Filter: func (c *fiber.Ctx) bool { var isUserAdmin bool // Your logic here return isUserAdmin } })) caution If you are using middleware that is included with Fiber by default (for example Compress or Logger), you should use the Next field instead of the Filter field. For example: Example app.Use(middleware.Logger(middleware.LoggerConfig{ Format: \"${time} ${method} ${path}\", TimeFormat: \"15:04:05\", TimeZone: \"Asia/Chongqing\", Next: func (c *fiber.Ctx) bool { var isUserAdmin bool // Your logic here return isUserAdmin } }))","s":"Skipping middleware execution","u":"/v1.x/api/middleware","h":"#skipping-middleware-execution","p":2053},{"i":2063,"t":"It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them. Example app.Get(\"/\", func(c *fiber.Ctx) { err := c.SendFile(\"file-does-not-exist\") if err != nil { c.Next(err) // Pass error to Fiber } }) Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below: Example package main import ( \"github.com/gofiber/fiber\" \"github.com/gofiber/fiber/middleware\" ) func main() { app := fiber.New() app.Use(middleware.Recover()) app.Get(\"/\", func(c *fiber.Ctx) { panic(\"This panic is catched by the ErrorHandler\") }) log.Fatal(app.Listen(3000)) } Because ctx.Next() accepts an error interface, you could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found). Example app.Get(\"/\", func(c *fiber.Ctx) { err := fiber.NewError(503) c.Next(err) // 503 Service Unavailable err := fiber.NewError(404, \"Sorry, not found!\") c.Next(err) // 404 Sorry, not found! })","s":"Catching Errors","u":"/v1.x/guide/error-handling","h":"#catching-errors","p":2061},{"i":2065,"t":"Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If error is of type fiber*Error, response is sent with the provided status code and message. Example // Default error handler app.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) { // Statuscode defaults to 500 code := fiber.StatusInternalServerError // Check if it's an fiber.Error type if e, ok := err.(*fiber.Error); ok { code = e.Code } // Return HTTP response ctx.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8) ctx.Status(code).SendString(err.Error()) }","s":"Default Error Handler","u":"/v1.x/guide/error-handling","h":"#default-error-handler","p":2061},{"i":2067,"t":"A custom error handler can be set via app.Settings.ErrorHandler In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response. The following example shows how to display error pages for different types of errors. Example app := fiber.New() // Custom error handler app.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) { // Statuscode defaults to 500 code := fiber.StatusInternalServerError // Retrieve the custom statuscode if it's an fiber.*Error if e, ok := err.(*fiber.Error); ok { code = e.Code } // Send custom error page err = ctx.Status(code).SendFile(fmt.Sprintf(\"./%d.html\", code)) if err != nil { ctx.Status(500).SendString(\"Internal Server Error\") } } Special thanks to the Echo & Express framework for inspiration regarding error handling.","s":"Custom Error Handler","u":"/v1.x/guide/error-handling","h":"#custom-error-handler","p":2061},{"i":2070,"t":"Like Routing, groups can also have paths that belong to a cluster. func main() { app := fiber.New() api := app.Group(\"/api\", cors()) // /api v1 := api.Group(\"/v1\", mysql()) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", mongodb()) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user app.Listen(3000) } A Group of paths can have an optional handler. func main() { app := fiber.New() api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\") // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\") // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user app.Listen(3000) } caution Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.","s":"Paths","u":"/v1.x/guide/grouping","h":"#paths","p":2068},{"i":2072,"t":"Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue. func main() { app := fiber.New() api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\", func(c *fiber.Ctx) { c.JSON(fiber.Map{ \"message\": \"v1\", }) c.Next() }) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user app.Listen(3000) }","s":"Group Handlers","u":"/v1.x/guide/grouping","h":"#group-handlers","p":2068},{"i":2075,"t":"Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns. Examples of route paths based on strings // This route path will match requests to the root route, \"/\": app.Get(\"/\", func(c *fiber.Ctx) { c.Send(\"root\") }) // This route path will match requests to \"/about\": app.Get(\"/about\", func(c *fiber.Ctx) { c.Send(\"about\") }) // This route path will match requests to \"/random.txt\": app.Get(\"/random.txt\", func(c *fiber.Ctx) { c.Send(\"random.txt\") })","s":"Paths","u":"/v1.x/guide/routing","h":"#paths","p":2073},{"i":2077,"t":"Route parameters are named URL segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys. info The name of the route parameter must be made up of characters ([A-Za-z0-9_]). Example of define routes with route parameters // Parameters app.Get(\"/user/:name/books/:title\", func(c *fiber.Ctx) { c.Write(c.Params(\"name\")) c.Write(c.Params(\"title\")) }) // Wildcard app.Get(\"/user/*\", func(c *fiber.Ctx) { c.Send(c.Params(\"*\")) }) // Optional parameter app.Get(\"/user/:name?\", func(c *fiber.Ctx) { c.Send(c.Params(\"name\")) }) info Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes. // http://localhost:3000/plantae/prunus.persica app.Get(\"/plantae/:genus.:species\", func(c *fiber.Ctx) { c.Params(\"genus\") // prunus c.Params(\"species\") // persica }) // http://localhost:3000/flights/LAX-SFO app.Get(\"/flights/:from-:to\", func(c *fiber.Ctx) { c.Params(\"from\") // LAX c.Params(\"to\") // SFO })","s":"Parameters","u":"/v1.x/guide/routing","h":"#parameters","p":2073},{"i":2079,"t":"Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route. Example of a middleware function app.Use(func(c *fiber.Ctx) { // Set some security headers: c.Set(\"X-XSS-Protection\", \"1; mode=block\") c.Set(\"X-Content-Type-Options\", \"nosniff\") c.Set(\"X-Download-Options\", \"noopen\") c.Set(\"Strict-Transport-Security\", \"max-age=5184000\") c.Set(\"X-Frame-Options\", \"SAMEORIGIN\") c.Set(\"X-DNS-Prefetch-Control\", \"off\") // Go to next middleware: c.Next() // End of the chain fmt.Println(\"Bye πŸ‘‹!\") }) app.Get(\"/\", func(c *fiber.Ctx) { c.Send(\"Hello, World!\") }) Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.","s":"Middleware","u":"/v1.x/guide/routing","h":"#middleware","p":2073},{"i":2081,"t":"If you have many endpoints, you can organize your routes using Group. func main() { app := fiber.New() api := app.Group(\"/api\", cors()) // /api v1 := api.Group(\"/v1\", mysql()) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", mongodb()) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user app.Listen(3000) }","s":"Grouping","u":"/v1.x/guide/routing","h":"#grouping","p":2073},{"i":2084,"t":"Fiber can make great use of the validator package to ensure correct validation of data to store. Official validator Github page (Installation, use, examples..). You can find the detailed descriptions of the validations used in the fields contained on the structs below: Detailed docs Validation Example type Job struct{ Type string `validate:\"required,min=3,max=32\"` Salary int `validate:\"required,number\"` } type User struct{ Name string `validate:\"required,min=3,max=32\"` IsActive bool `validate:\"required,eq=True|eq=False\"` Email string `validate:\"required,email,min=6,max=32\"` Job Job `validate:\"dive\"` } type ErrorResponse struct { FailedField string Tag string Value string } func ValidateStruct(user User) []*ErrorResponse { var errors []*ErrorResponse validate = validator.New() err := validate.Struct(user) if err != nil { for _, err := range err.(validator.ValidationErrors) { var element ErrorResponse element.FailedField = err.StructNamespace() element.Tag = err.Tag() element.Value = err.Param() errors = append(errors, &element) } } return errors } func AddUser(c *fiber.Ctx) { //Connect to database user := new(User) if err := c.BodyParser(user); err != nil { errors := ValidateStruct() if errors != nil { c.JSON(errors) return } } //Do something else here //Return user c.JSON(user) } // Running a test with the following curl commands // curl -X POST -H \"Content-Type: application/json\" --data \"{\\\"name\\\":\\\"john\\\",\\\"isactive\\\":\\\"True\\\"}\" http://localhost:8080/register/user // Results in // [{\"FailedField\":\"User.Email\",\"Tag\":\"required\",\"Value\":\"\"},{\"FailedField\":\"User.Job.Salary\",\"Tag\":\"required\",\"Value\":\"\"},{\"FailedField\":\"User.Job.Type\",\"Tag\":\"required\",\"Value\":\"\"}]⏎","s":"Validator package","u":"/v1.x/guide/validating","h":"#validator-package","p":2082},{"i":2087,"t":"TechEmpower provides a performance comparison of many web application frameworks executing fundamental tasks such as JSON serialization, database access, and server-side template composition. Each framework is operating in a realistic production configuration. Results are captured on cloud instances and on physical hardware. The test implementations are largely community-contributed and all source is available at the GitHub repository. Fiber v1.10.0 28 HT Cores Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz 32GB RAM Ubuntu 18.04.3 4.15.0-88-generic Dedicated Cisco 10-Gbit Ethernet switch.","s":"TechEmpower","u":"/v1.x/misc/benchmarks","h":"#techempower","p":2085},{"i":2089,"t":"The Plaintext test is an exercise of the request-routing fundamentals only, designed to demonstrate the capacity of high-performance platforms in particular. Requests will be sent using HTTP pipelining. The response payload is still small, meaning good performance is still necessary in order to saturate the gigabit Ethernet of the test environment. See Plaintext requirements Fiber - 6,162,556 responses per second with an average latency of 2.0 ms. Express - 367,069 responses per second with an average latency of 354.1 ms.","s":"Plaintext","u":"/v1.x/misc/benchmarks","h":"#plaintext","p":2085},{"i":2091,"t":"Fiber handled 11,846 responses per second with an average latency of 42.8 ms. Express handled 2,066 responses per second with an average latency of 390.44 ms.","s":"Data Updates","u":"/v1.x/misc/benchmarks","h":"#data-updates","p":2085},{"i":2093,"t":"Fiber handled 19,664 responses per second with an average latency of 25.7 ms. Express handled 4,302 responses per second with an average latency of 117.2 ms.","s":"Multiple Queries","u":"/v1.x/misc/benchmarks","h":"#multiple-queries","p":2085},{"i":2095,"t":"Fiber handled 368,647 responses per second with an average latency of 0.7 ms. Express handled 57,880 responses per second with an average latency of 4.4 ms.","s":"Single Query","u":"/v1.x/misc/benchmarks","h":"#single-query","p":2085},{"i":2097,"t":"Fiber handled 1,146,667 responses per second with an average latency of 0.4 ms. Express handled 244,847 responses per second with an average latency of 1.1 ms.","s":"JSON Serialization","u":"/v1.x/misc/benchmarks","h":"#json-serialization","p":2085},{"i":2099,"t":"πŸ”— https://github.com/smallnest/go-web-framework-benchmark CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz MEM 4GB GO go1.13.6 linux/amd64 OS Linux The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers. The concurrency clients are 5000. Latency is the time of real processing time by web servers. The smaller is the better. Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better. If we enable http pipelining, test result as below: Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is: If we enable http pipelining, test result as below: Dependency graph for v1.9.0","s":"Go web framework benchmark","u":"/v1.x/misc/benchmarks","h":"#go-web-framework-benchmark","p":2085},{"i":2102,"t":"There is no definitive answer to this question. The answer depends on the scale of your application and the team that is involved. To be as flexible as possible, Fiber makes no assumptions in terms of structure. Routes and other application-specific logic can live in as many files as you wish, in any directory structure you prefer. View the following examples for inspiration: gofiber/boilerplate thomasvvugt/fiber-boilerplate Youtube - Building a REST API using Gorm and Fiber","s":"How should I structure my application?","u":"/v1.x/misc/faq","h":"#how-should-i-structure-my-application","p":2100},{"i":2104,"t":"In Fiber, 404 responses are not the result of an error, so the error handler will not capture them. This behavior is because a 404 response simply indicates the absence of additional work to do; in other words, Fiber has found no routes that match the request. All you need to do is add a middleware function at the very bottom of the stack (below all other functions) to handle a 404 response: Example app.Use(func(c *fiber.Ctx) { c.Status(fiber.StatusNotFound).SendString(\"Sorry can't find that!\") })","s":"How do I handle custom 404 responses?","u":"/v1.x/misc/faq","h":"#how-do-i-handle-custom-404-responses","p":2100},{"i":2106,"t":"To override the default error handler, provide a custom handler to the app.Settings.ErrorHandler Example app.Settings.ErrorHandler = func(c *fiber.Ctx, err error) { c.Status(500).SendString(err.Error()) } We have a dedicated page explaining how error handling works in Fiber, see Error Handling.","s":"How do I set up an error handler?","u":"/v1.x/misc/faq","h":"#how-do-i-set-up-an-error-handler","p":2100},{"i":2108,"t":"Fiber currently supports 8 template engines in our gofiber/template middleware: Ace Amber Django Handlebars HTML Jet Mustache Pug To learn more about using Templates in Fiber, see Templates.","s":"Which template engines does Fiber support?","u":"/v1.x/misc/faq","h":"#which-template-engines-does-fiber-support","p":2100},{"i":2110,"t":"Yes, we have our own Discord server, where we hang out. We have different rooms for every subject. If you have questions or just want to have a chat, feel free to join us via this > invite link <.","s":"Does Fiber have a community chat?","u":"/v1.x/misc/faq","h":"#does-fiber-have-a-community-chat","p":2100},{"i":2113,"t":"Fiber provides a Views interface to provide your own template engine: Views type Views interface { Load() error Render(io.Writer, string, interface{}, ...string) error } Views interface contains a Load and Render method, Load is executed by Fiber on app initialization to load/parse the templates. // Pass engine to Fiber's Views Engine app := fiber.New(&fiber.Settings{ Views: engine, }) The Render method is linked to the ctx.Render() function that accepts a template name and binding data. app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"index\", fiber.Map{ \"hello\": \"world\", }); })","s":"Template interfaces","u":"/v1.x/guide/templates","h":"#template-interfaces","p":2111},{"i":2115,"t":"Fiber team maintains templates package that provides wrappers for multiple template engines: html ace amber django handlebars jet mustache pug Example views/index.html package main import ( \"github.com/gofiber/fiber\" \"github.com/gofiber/template/html\" ) func main() { // Initialize standard Go html template engine engine := html.New(\"./views\", \".html\") app := fiber.New(&fiber.Settings{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) { // Render index template _ = c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Listen(3000) }

{{.Title}}

","s":"Engines","u":"/v1.x/guide/templates","h":"#engines","p":2111}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/1912",[0,1.893,1,2.753,2,3.752,3,3.243,4,3.469,5,3.752,6,4.131,7,4.131,8,4.131,9,1.431,10,2.894,11,2.628,12,4.964,13,4.706,14,4.706,15,4.131,16,4.706,17,4.706,18,4.131,19,4.131,20,4.131,21,3.829,22,4.706,23,2.628,24,5.465,25,4.706,26,3.243,27,3.055,28,3.469,29,3.055,30,4.706,31,4.706,32,4.706,33,4.706,34,4.706,35,2.515,36,4.131,37,3.469,38,3.752,39,2.515]],["t/1914",[11,4.372,40,4.161,41,4.814,42,5.812,43,6.038,44,6.038,45,5.3,46,5.3,47,1.313,48,4.451,49,6.038,50,3.92]],["t/1916",[0,0.824,21,2.573,23,1.512,29,2.716,37,1.997,47,1.352,51,2.314,52,1.562,53,0.555,54,3.512,55,1.566,56,2.708,57,2.377,58,4.184,59,1.272,60,2.377,61,2.708,62,4.077,63,2.733,64,1.511,65,2.377,66,1.389,67,2.708,68,2.377,69,2.708,70,1.584,71,2.708,72,0.288,73,1.913,74,4.184,75,0.304,76,4.008,77,4.184,78,2.519,79,1.272,80,1.867,81,5.113,82,1.758,83,2.708,84,1.985,85,2.336,86,2.708,87,2.377,88,2.708,89,0.43,90,2.708,91,2.708,92,2.708,93,2.708,94,4.184,95,2.708,96,2.708,97,1.334,98,1.666,99,2.708,100,1.285,101,2.708,102,2.159,103,2.708,104,1.666,105,2.708,106,0.281,107,2.708,108,2.377,109,2.708,110,0.756,111,1.997,112,2.377,113,2.708,114,2.377,115,2.708,116,1.195,117,1.997,118,1.997,119,1.867,120,2.708,121,2.377]],["t/1918",[0,1.536,11,2.821,50,3.28,53,0.451,70,2.955,73,2.31,75,0.303,97,2.489,104,3.107,106,0.525,122,5.052,123,4.435,124,5.052,125,2.688,126,3.485,127,3.482,128,2.489,129,1.098,130,3.107,131,3.213,132,2.955,133,3.107,134,5.052,135,4.435,136,4.435,137,3.482,138,2.7,139,3.724]],["t/1920",[0,0.827,9,1.277,35,1.454,39,1.454,51,1.478,53,0.514,59,1.894,62,2.169,64,0.804,66,1.395,75,0.328,79,1.559,89,0.432,100,2.432,106,0.599,125,1.121,129,0.591,130,2.582,131,2.526,138,2.74,140,2.389,141,2.388,142,1.591,143,4.199,144,1.766,145,2.388,146,2.005,147,2.72,148,2.626,149,1.766,150,3.685,151,2.582,152,1.2,153,2.005,154,1.673,155,2.893,156,2.244,157,2.388,158,2.005,159,1.519,160,2.388,161,0.272,162,2.72,163,3.685,164,2.005,165,2.72,166,2.72,167,2.388,168,1.519,169,2.388,170,2.72,171,1.875,172,2.344,173,2.72,174,2.72,175,2.72,176,2.72,177,1.2,178,2.72,179,2.72,180,3.685,181,2.582,182,2.72,183,2.388,184,2.72,185,2.72,186,2.72,187,2.72,188,2.72]],["t/1922",[47,1.047,64,1.423,75,0.185,82,3.127,89,1.003,100,2.998,108,4.228,125,1.985,128,2.373,159,2.689,161,0.482,171,3.319,189,5.04,190,4.228,191,3.833,192,4.228,193,4.228,194,4.228,195,4.816,196,5.202,197,4.228,198,2.962,199,1.985,200,5.626,201,4.228,202,4.228,203,4.228,204,4.816,205,4.816,206,4.816]],["t/1924",[0,2.191,1,3.464,5,5.744,11,4.023,39,3.85,116,2.613,117,4.366,118,4.366,119,4.081,207,4.722,208,5.922,209,5.922,210,5.922]],["t/1927",[50,3.39,72,0.359,73,2.388,75,0.306,79,1.588,97,3.282,104,3.212,110,1.86,125,3.024,126,3.56,127,3.599,128,2.573,132,3.055,161,0.523,164,4.911,177,2.304,199,2.153,211,5.847,212,1.896,213,5.223]],["t/1929",[0,0.931,9,0.399,10,0.807,11,0.733,18,1.152,27,1.989,37,1.693,40,0.905,47,0.666,51,1.078,52,0.624,54,1.228,55,1.966,59,1.27,62,1.832,64,0.388,65,2.016,72,0.211,73,1.05,75,0.277,76,0.768,78,0.647,79,0.698,87,2.689,89,0.364,97,1.132,100,0.623,110,1.604,111,1.693,116,0.579,121,1.152,125,1.263,126,1.228,128,0.647,132,1.344,137,1.583,140,1.112,142,0.768,144,1.491,148,0.524,154,0.807,164,1.693,168,1.283,177,0.579,191,1.509,199,1.263,207,1.832,211,2.689,212,0.834,214,0.968,215,1.047,216,2.016,217,3.226,218,2.297,219,2.297,220,2.297,221,1.047,222,1.313,223,1.313,224,1.313,225,1.313,226,0.56,227,0.807,228,1.219,229,1.047,230,3.179,231,3.41,232,1.313,233,1.313,234,1.047,235,1.832,236,3.676,237,1.152,238,1.152,239,1.313,240,1.313,241,4.742,242,1.642,243,0.807,244,1.583,245,3.063,246,4.949,247,1.693,248,1.152,249,2.442,250,1.313,251,1.313,252,1.152,253,1.313,254,1.047,255,1.047,256,2.016,257,1.313,258,2.297,259,0.968,260,1.152,261,1.047,262,1.152,263,1.965,264,4.178,265,3.667,266,1.283,267,1.313,268,1.047,269,1.693,270,2.111,271,1.313,272,1.313,273,1.152,274,1.618,275,1.313,276,3.063,277,1.313,278,0.905,279,1.152,280,0.852,281,1.152,282,0.968,283,0.807,284,1.313,285,1.152,286,2.016,287,1.313,288,3.079,289,1.313,290,1.313,291,2.297,292,1.313,293,1.152,294,1.313,295,2.297,296,1.152,297,2.016,298,1.313,299,1.453,300,1.313,301,1.313,302,1.313,303,0.905,304,1.313,305,1.313,306,3.676,307,1.832,308,1.313,309,2.297,310,1.313,311,1.313,312,1.313,313,1.313,314,0.6,315,1.313,316,0.968,317,0.807,318,0.647,319,0.807,320,1.515,321,2.297,322,3.063,323,2.016,324,2.111,325,1.228,326,1.152,327,1.047,328,1.693,329,2.297,330,1.313,331,1.313,332,2.016,333,2.297,334,1.313,335,0.733,336,1.313,337,1.491,338,1.313,339,2.297,340,2.297,341,1.313,342,1.152,343,1.313,344,0.968,345,2.297,346,1.313]],["t/1931",[21,1.21,36,1.727,38,1.569,47,1.24,51,1.688,55,1.984,59,1.257,70,1.151,72,0.33,75,0.315,79,0.986,82,1.277,89,0.514,110,1.48,116,0.868,135,3.629,148,1.912,149,1.277,152,1.43,154,1.21,159,1.099,161,0.197,167,1.727,168,1.099,171,1.356,177,2.115,189,5.496,190,6.18,191,3.589,192,1.727,193,1.727,194,1.727,196,4.645,197,1.727,198,1.21,199,1.336,200,4.547,201,4.208,217,3.101,228,0.653,230,2.209,231,2.684,241,3.296,247,1.451,259,1.451,274,1.141,278,1.356,279,1.727,280,1.277,281,1.727,283,2.948,285,1.727,318,0.97,324,1.356,347,3.242,348,1.569,349,3.629,350,1.968,351,1.968,352,1.968,353,1.968,354,1.968,355,3.242,356,1.968,357,1.968,358,1.968,359,1.968,360,1.277,361,1.727,362,0.9,363,1.727,364,1.968,365,1.968,366,1.968,367,1.968,368,1.277,369,1.968,370,1.968,371,1.569,372,4.134,373,1.538,374,1.968,375,1.968,376,1.968,377,1.968,378,1.569,379,1.968,380,1.569,381,1.356,382,3.242,383,2.846,384,1.968]],["t/1933",[9,1.608,47,0.948,51,1.006,53,0.472,59,1.799,64,2.293,72,0.197,75,0.297,79,1.937,89,1.231,98,1.758,106,0.549,111,2.107,140,1.919,148,1.74,151,1.758,153,2.107,156,2.331,161,0.286,181,1.758,242,0.948,244,5.413,278,1.97,318,1.408,385,2.859,386,2.859,387,6.895,388,2.859,389,2.859,390,2.859,391,2.859,392,2.859,393,2.859,394,2.859,395,2.859,396,2.859,397,2.859,398,2.859,399,2.859,400,2.509,401,2.859,402,2.509,403,2.859,404,2.859,405,2.509,406,2.859,407,2.509,408,2.509,409,2.859,410,1.97,411,2.859,412,4.361,413,2.509]],["t/1935",[26,3.014,28,3.224,39,3.168,64,2.388,72,0.301,73,2,75,0.325,89,0.694,97,2.155,125,1.803,126,2.337,128,2.155,132,2.559,140,1.587,161,0.438,244,3.014,373,2.074,387,3.839,414,4.37,415,4.374,416,3.224,417,3.224,418,3.224,419,3.224,420,3.224,421,3.224,422,3.224,423,3.487,424,3.487,425,3.487,426,3.487,427,3.487,428,3.487]],["t/1937",[52,1.418,64,2.358,72,0.359,75,0.306,79,1.588,125,2.153,128,2.573,140,1.896,161,0.523,244,3.599,280,3.39,405,4.584,429,3.599,430,5.223,431,5.223,432,5.223,433,5.223,434,5.223,435,5.223,436,3.055,437,3.39,438,5.223,439,5.223]],["t/1939",[72,0.406,75,0.304,89,0.689,161,0.435,202,3.812,231,2.819,235,4.704,237,3.812,263,2.321,288,3.201,314,1.986,320,1.79,348,5.342,362,1.986,402,3.812,440,3.463,441,5.342,442,4.343,443,4.343,444,3.201,445,3.463,446,4.343,447,4.343,448,4.343,449,4.349,450,3.812,451,1.484,452,4.343,453,4.343,454,4.343,455,4.343,456,4.343,457,2.993,458,4.343,459,2.515,460,4.343,461,4.343,462,3.201,463,4.343,464,4.343,465,4.343]],["t/1941",[23,2.966,47,1.155,72,0.366,75,0.298,79,1.615,161,0.532,212,1.928,216,4.663,235,5.369,319,3.267,320,2.19,449,3.916,450,4.663,451,1.815,459,2.871,462,3.916,466,6.734,467,6.734,468,5.312,469,5.312,470,5.312,471,5.312]],["t/1943",[46,3.078,47,0.762,55,1.313,72,0.241,75,0.323,76,2.051,79,1.815,80,2.416,97,2.501,98,3.122,106,0.364,129,0.762,130,2.156,131,2.501,138,1.874,140,1.843,142,2.051,161,0.351,191,1.728,212,1.273,242,1.684,249,2.796,263,1.874,266,1.958,320,1.445,328,3.742,368,2.276,437,3.296,451,1.198,472,3.491,473,3.506,474,3.506,475,2.796,476,3.506,477,3.506,478,2.416,479,2.276,480,3.506,481,5.077,482,5.077,483,3.506,484,5.077,485,3.506,486,3.506,487,4.456,488,3.506,489,5.077,490,3.506,491,3.506,492,3.506,493,3.506,494,2.796,495,3.506,496,3.506,497,3.506,498,3.506]],["t/1946",[0,0.993,9,0.993,53,0.43,72,0.225,75,0.322,89,1.189,100,1.549,106,0.5,119,2.251,129,1.048,152,1.441,161,0.327,228,1.083,242,1.599,255,2.604,283,2.008,299,1.549,362,1.493,478,3.322,499,2.604,500,4.74,501,2.12,502,2.604,503,3.266,504,3.266,505,3.266,506,3.266,507,4.82,508,2.964,509,3.266,510,2.604,511,3.266,512,2.251,513,3.266,514,2.12,515,3.266,516,3.266,517,3.266,518,1.824,519,2.604,520,3.266,521,3.266,522,2.407,523,5.728,524,5.728,525,3.266,526,2.407,527,3.266,528,3.266,529,3.266,530,5.728,531,4.82,532,3.266,533,3.266,534,3.266,535,3.266,536,3.266]],["t/1948",[9,1.464,23,2.689,51,2.484,53,0.43,72,0.332,75,0.306,89,0.764,97,2.373,106,0.5,110,1.345,129,1.047,161,0.482,226,2.053,242,2.341,274,1.696,362,2.89,457,3.319,472,3.698,487,6.194,537,4.228,538,4.816,539,6.321,540,7.056,541,4.356]],["t/1950",[9,1.536,53,0.451,72,0.348,75,0.32,89,0.801,106,0.525,110,1.411,129,1.098,161,0.506,226,2.154,228,1.676,242,1.676,274,1.779,299,3.619,542,6.339,543,6.339,544,5.052,545,5.052,546,5.052,547,5.052,548,4.435]],["t/1952",[52,1.563,53,0.514,66,2.951,72,0.396,75,0.294,106,0.598,110,1.608,125,2.919,142,3.368,161,0.576,262,5.053,549,5.757,550,4.244,551,5.757,552,5.757,553,5.757,554,5.757]],["t/1954",[52,1.535,53,0.504,72,0.389,75,0.313,89,1.111,106,0.587,129,1.229,161,0.566,478,3.895,501,3.669,555,3.669,556,4.961,557,4.506,558,7.001,559,5.652,560,5.652]],["t/1956",[47,1.039,51,1.683,52,1.708,53,0.426,54,2.554,59,1.912,63,2.554,64,1.412,66,2.45,72,0.329,75,0.297,78,2.355,84,2.267,85,2.668,89,0.758,106,0.496,110,1.335,116,2.109,151,3.867,161,0.478,266,3.512,325,2.554,561,6.289,562,3.523,563,3.102,564,4.779,565,4.779,566,6.289,567,2.668,568,4.195,569,2.554,570,2.668]],["t/1958",[48,2.107,53,0.255,59,0.869,72,0.197,75,0.314,89,0.692,106,0.297,133,1.758,136,2.509,151,3.917,159,2.435,161,0.286,172,1.596,181,1.758,199,1.798,212,1.038,226,1.219,228,2.227,242,0.948,260,3.828,266,1.596,299,3.022,314,1.307,319,1.758,320,1.178,373,2.069,436,3.461,440,2.279,451,0.977,459,1.859,462,2.107,472,1.672,501,1.856,508,2.682,562,4.949,563,4.136,567,1.596,571,2.509,572,2.859,573,2.279,574,4.361,575,4.361,576,4.361,577,3.006,578,2.859,579,2.859,580,2.509,581,2.509,582,2.509,583,2.509,584,2.859,585,2.859,586,2.859,587,2.859,588,2.859,589,2.859,590,2.509,591,2.509,592,2.859,593,2.509,594,2.509,595,2.107,596,4.642,597,2.859,598,5.288,599,2.859,600,2.859,601,4.361,602,2.859,603,2.859,604,2.859]],["t/1960",[3,2.216,23,1.795,47,0.699,51,1.677,53,0.506,70,1.881,72,0.328,75,0.311,89,0.51,97,1.584,106,0.589,110,1.331,129,0.699,144,3.093,149,2.087,154,1.977,161,0.322,177,1.419,199,2.587,217,2.787,243,1.977,296,2.822,297,2.822,344,5.499,363,2.822,519,2.563,605,6.161,606,2.822,607,2.216,608,3.215,609,4.764,610,3.215,611,3.215,612,3.215,613,2.822,614,3.215,615,3.215,616,2.822,617,3.215,618,2.822,619,3.215,620,3.215,621,3.215,622,3.215,623,3.215,624,2.563,625,3.215,626,3.215,627,4.764,628,3.798,629,3.215,630,2.822,631,4.182,632,4.182,633,4.182,634,3.798,635,3.215,636,3.215,637,3.215,638,3.215,639,2.563]],["t/1962",[39,3.324,51,2.19,52,1.689,161,0.623,640,7.42,641,6.22,642,6.22,643,6.22,644,6.22,645,6.22,646,6.22]],["t/1964",[51,1.518,53,0.385,72,0.297,75,0.322,89,1.189,97,2.125,106,0.448,110,1.64,129,0.938,148,1.72,161,0.432,181,2.652,199,1.778,228,1.431,230,3.138,344,5.527,373,2.046,595,3.179,605,3.786,630,3.786,631,3.786,632,3.786,633,3.786,634,3.438,647,4.313,648,3.786,649,4.313,650,3.179,651,4.313,652,4.313,653,4.313,654,4.313,655,4.313,656,4.313,657,4.313]],["t/1966",[47,0.993,51,2.42,52,1.657,53,0.407,54,2.441,55,1.71,63,2.441,64,1.35,66,2.342,72,0.314,75,0.293,78,2.25,84,2.166,85,2.55,89,1.09,106,0.474,110,1.276,116,2.015,129,0.993,161,0.457,177,2.015,181,2.809,212,1.658,325,2.441,344,5.067,360,2.965,569,2.441,570,2.55,595,4.499,658,3.673,659,4.567,660,3.642,661,4.567,662,4.567]],["t/1968",[0,1.645,41,4.999,53,0.342,55,2.025,72,0.264,75,0.324,89,0.608,106,0.398,129,0.833,148,2.158,161,0.384,172,3.021,191,2.665,212,1.963,242,1.271,299,1.818,320,2.23,451,1.309,459,3.178,542,3.364,543,3.364,616,4.749,663,3.364,664,5.41,665,3.832,666,2.641,667,5.504,668,3.832,669,3.832,670,2.641,671,3.832,672,5.41,673,6.27,674,3.728,675,3.832,676,5.41]],["t/1970",[7,5.879,47,1.145,53,0.47,72,0.363,75,0.313,79,1.601,106,0.547,116,2.324,117,3.883,118,3.883,129,1.145,131,3.3,138,2.815,152,2.324,161,0.527,227,3.239,325,2.815,550,3.883,677,4.623,678,3.883,679,5.267,680,5.267,681,5.267]],["t/1972",[35,2.035,53,0.606,72,0.262,73,3.106,75,0.332,79,1.158,106,0.395,117,2.807,125,1.57,126,2.035,128,1.876,161,0.381,212,1.382,228,1.263,320,2.576,407,3.343,413,3.343,451,1.84,459,3.172,508,2.342,674,4.306,682,3.343,683,3.036,684,3.036,685,3.809,686,3.809,687,5.485,688,6.249,689,3.809,690,3.809,691,3.343,692,3.809,693,3.809]],["t/1974",[9,1.33,21,2.69,47,1.289,53,0.39,72,0.301,75,0.32,106,0.454,129,0.951,131,3.712,138,3.168,152,1.93,161,0.438,242,1.966,299,2.074,314,2,362,2,500,4.891,508,2.69,512,3.014,694,4.374,695,4.374,696,5.928,697,5.203,698,4.726,699,4.374,700,6.724,701,4.374,702,4.374]],["t/1976",[40,4.248,52,1.259,53,0.414,72,0.319,75,0.318,89,0.735,106,0.481,119,3.195,161,0.464,171,3.195,191,3.786,196,3.417,199,1.911,226,1.976,243,2.851,282,3.417,320,1.911,451,2.106,459,2.628,567,2.588,577,3.195,658,2.477,678,3.417,703,4.069,704,3.417,705,4.636,706,3.696,707,4.636,708,3.696,709,3.696,710,3.696]],["t/1978",[40,4.248,47,1.008,51,2.598,52,1.674,53,0.414,54,2.477,63,2.477,64,1.37,66,2.377,72,0.319,75,0.303,78,2.284,84,2.199,85,2.588,89,0.978,106,0.481,110,1.295,116,2.045,161,0.464,181,2.851,199,2.541,226,1.976,243,2.851,325,2.477,360,3.009,567,2.588,569,2.477,570,2.588,577,4.248,658,2.477,704,3.417,711,4.636,712,4.636]],["t/1980",[59,2.013,152,2.921,713,5.81,714,5.277,715,5.81,716,5.81]],["t/1982",[9,1.41,47,1.008,51,1.632,52,1.674,53,0.414,54,2.477,59,1.41,63,2.477,64,1.37,66,2.377,72,0.319,75,0.303,78,2.284,84,2.199,85,2.588,89,0.978,106,0.481,110,1.295,116,2.045,129,1.008,156,2.477,161,0.464,226,1.976,228,2.045,242,1.538,325,2.477,362,2.119,569,2.477,570,2.588,698,4.914,717,3.417,718,3.696,719,4.636,720,4.636,721,6.164,722,4.636]],["t/1984",[9,1.536,47,1.098,51,1.779,52,1.771,53,0.451,54,2.7,63,2.7,64,1.493,66,2.59,72,0.348,75,0.292,78,2.489,84,2.396,85,2.821,89,0.801,106,0.525,110,1.411,116,2.229,129,1.098,161,0.506,242,1.676,325,2.7,557,4.028,569,2.7,570,2.821,723,5.052,724,4.435,725,6.521,726,5.052,727,5.052]],["t/1986",[52,1.608,53,0.528,59,1.801,72,0.408,75,0.297,89,0.939,106,0.615,129,1.288,161,0.593,441,4.722,728,5.922,729,5.199,730,6.324,731,5.199]],["t/1988",[52,1.443,53,0.474,59,1.615,72,0.366,75,0.298,89,0.843,106,0.552,129,1.155,161,0.532,242,1.762,362,2.429,441,4.235,563,4.371,729,4.663,730,5.911,731,5.911,732,5.312,733,6.734,734,6.734,735,6.734]],["t/1990",[9,1.399,52,1.666,53,0.41,59,1.399,72,0.317,75,0.302,89,0.73,106,0.478,129,1,152,2.03,156,3.278,161,0.461,172,2.569,217,3.588,226,1.961,228,2.542,230,2.459,241,4.89,242,1.526,266,2.569,293,4.039,299,3.272,362,2.104,502,3.669,512,3.171,522,3.392,736,4.039,737,4.601,738,4.601,739,4.601,740,4.601,741,4.601]],["t/1992",[47,0.758,52,1.373,53,0.311,72,0.24,75,0.33,89,0.802,97,1.718,106,0.362,110,0.974,152,1.538,161,0.349,199,2.855,228,1.973,242,1.157,254,2.78,299,2.821,314,2.312,320,2.084,373,2.398,436,2.958,451,1.191,459,2.781,508,3.658,514,3.282,742,3.487,743,3.487,744,4.438,745,6.08,746,3.061,747,3.487,748,5.727,749,5.727,750,3.487,751,5.056,752,3.061]],["t/1994",[53,0.348,55,1.462,72,0.269,75,0.314,79,1.667,89,1.005,97,1.924,106,0.405,129,0.849,161,0.391,169,6.029,199,2.831,212,1.417,228,1.295,270,2.691,274,1.375,314,1.785,319,3.371,373,2.6,436,3.207,451,1.334,514,3.558,618,3.427,670,2.691,744,4.812,745,6.029,746,3.427,748,5.56,749,5.56,753,5.482,754,3.905,755,3.905,756,3.427,757,3.905,758,5.482,759,3.905,760,3.905,761,3.905]],["t/1996",[9,1.575,53,0.462,72,0.356,75,0.305,89,0.822,106,0.538,129,1.126,159,2.892,161,0.518,226,2.208,227,3.185,242,1.718,335,2.892,541,5.035,762,4.546,763,5.179,764,4.546,765,5.179,766,5.179,767,6.626,768,6.626,769,5.179,770,5.179,771,5.179]],["t/1998",[47,0.972,51,1.573,53,0.537,59,1.829,72,0.308,75,0.321,79,1.359,89,0.709,102,3.563,106,0.464,140,1.622,149,2.901,156,2.388,161,0.447,212,1.622,314,2.75,318,2.202,335,2.495,368,2.901,410,3.079,436,2.614,569,2.388,717,3.294,772,4.469,773,4.469,774,4.469,775,4.469,776,3.563,777,6.014,778,5.967,779,4.469,780,4.469,781,4.469,782,4.469,783,4.469]],["t/2000",[9,1.767,53,0.518,72,0.4,75,0.273,89,0.922,106,0.603,110,1.623,148,2.318,161,0.582,172,3.245,242,1.927,274,2.046,362,2.657,567,3.245,784,5.101,785,5.811,786,5.811,787,5.811]],["t/2002",[9,1.658,52,1.481,53,0.486,59,1.658,72,0.375,75,0.287,79,2.081,89,1.245,106,0.566,150,4.786,151,4.21,161,0.546,177,2.406,212,1.979,567,3.045,670,3.758,788,4.786,789,5.453,790,5.453]],["t/2004",[51,1.787,52,0.952,53,0.313,72,0.241,75,0.331,89,0.556,106,0.364,161,0.351,191,3.566,243,2.156,282,2.585,320,1.445,381,2.416,437,2.276,451,1.198,459,2.164,550,2.585,567,1.958,577,4.113,628,2.796,658,3.189,678,2.585,703,3.078,706,2.796,708,2.796,709,2.796,710,2.796,791,4.456,792,3.506,793,4.456,794,3.506,795,3.506,796,2.796,797,4.456,798,4.456,799,3.506,800,3.506,801,2.796,802,3.506,803,3.078,804,3.078,805,2.796,806,3.078,807,3.078,808,3.078,809,3.078,810,3.078,811,3.078,812,3.078,813,3.078]],["t/2006",[53,0.613,63,2.441,64,1.35,72,0.314,75,0.301,79,1.856,106,0.714,129,1.494,130,2.809,131,2.25,140,2.663,155,3.148,156,2.441,161,0.457,212,1.658,214,4.499,335,3.408,373,2.166,410,4.206,429,3.148,451,2.348,674,3.148,814,3.367,815,4.009,816,3.642,817,4.567,818,4.567,819,4.567]],["t/2008",[47,1.117,51,1.808,52,1.79,53,0.458,54,2.745,59,1.562,63,2.745,64,1.518,66,2.633,72,0.354,75,0.294,78,2.531,84,2.436,85,2.868,89,0.815,106,0.533,110,1.434,116,2.266,129,1.117,161,0.514,280,3.334,325,2.745,555,3.334,569,2.745,570,2.868,820,6.591,821,5.136,822,5.136]],["t/2010",[47,1.277,51,2.067,52,1.594,53,0.385,54,2.305,55,2.198,63,2.305,64,1.274,66,2.211,72,0.297,75,0.296,78,2.125,79,1.311,84,2.046,85,2.408,89,1.137,106,0.448,110,1.204,140,1.565,152,1.903,161,0.432,172,2.408,177,1.903,180,3.786,212,1.565,325,2.305,360,3.812,569,2.305,570,2.408,607,2.972,658,2.305,660,3.438,823,5.154,824,3.786,825,4.313,826,4.313,827,3.786,828,4.313,829,4.313,830,5.872,831,4.313]],["t/2012",[35,2.94,53,0.491,59,1.673,72,0.379,75,0.302,89,1.192,106,0.571,148,2.746,161,0.551,177,2.427,212,1.997,555,3.571,666,3.791,670,3.791,832,5.501,833,5.501,834,5.501,835,4.829,836,4.829]],["t/2014",[9,2.313,35,3.02,53,0.504,59,2.129,72,0.389,75,0.305,89,1.111,106,0.587,129,1.229,161,0.566,449,4.166,556,4.961,837,6.145,838,5.652]],["t/2016",[35,2.212,47,0.9,51,2.01,52,1.775,53,0.369,54,2.212,55,1.55,63,2.212,64,1.223,66,2.122,72,0.285,75,0.293,78,2.04,84,1.963,85,2.311,89,1.212,106,0.43,110,1.156,116,1.827,129,0.9,140,1.502,152,1.827,153,3.052,161,0.414,172,2.311,177,1.827,212,1.502,227,3.511,325,2.212,360,2.687,569,2.212,570,2.311,573,5.21,607,2.853,658,2.212,660,3.3,839,4.14,840,4.14,841,4.14,842,4.14,843,4.14,844,4.14,845,6.535,846,4.14]],["t/2018",[48,2.934,53,0.355,72,0.274,75,0.324,79,1.21,89,1.015,106,0.413,133,2.447,151,2.447,159,2.222,161,0.398,172,2.222,181,2.447,199,2.29,212,1.445,226,1.697,228,1.32,314,1.82,320,1.641,373,1.888,451,1.36,459,2.368,462,2.934,472,2.328,519,3.173,562,4.095,563,2.584,567,2.222,571,3.494,573,3.173,580,3.494,581,3.494,582,3.494,583,3.494,590,3.494,591,3.494,593,3.494,594,3.494,595,2.934,847,3.98,848,3.98,849,3.98,850,3.494,851,3.98,852,3.98,853,3.98,854,3.98,855,3.98,856,3.98]],["t/2020",[35,2.615,52,1.329,53,0.436,72,0.337,75,0.326,106,0.508,129,1.064,161,0.49,228,1.623,265,4.294,373,2.32,380,3.901,381,4.9,796,3.901,857,4.892,858,4.892,859,7.111,860,4.892,861,4.892,862,4.892,863,4.892,864,4.294,865,4.892,866,4.892,867,3.606]],["t/2022",[9,1.349,53,0.604,55,1.661,72,0.412,75,0.305,89,0.704,106,0.703,116,1.958,129,0.965,148,1.77,152,1.958,161,0.444,198,2.728,263,2.371,362,3.097,555,2.88,724,3.894,788,3.894,868,4.436,869,4.997,870,3.894,871,4.436,872,4.436,873,3.057,874,4.436,875,4.436,876,4.436,877,4.436,878,4.436,879,4.436,880,4.436,881,4.436,882,4.436,883,5.985,884,4.436]],["t/2024",[10,4.096,11,2.916,27,4.324,47,1.448,55,2.494,89,1.057,118,3.85,158,3.85,161,0.523,270,3.599,274,1.839,314,2.388,316,4.911,317,4.096,318,2.573,368,3.39,436,3.897,451,1.784,512,3.599,885,5.223,886,5.223,887,5.223,888,5.223]],["t/2026",[52,1.43,53,0.47,64,2.176,72,0.363,75,0.318,106,0.547,140,2.431,156,2.815,161,0.527,199,2.171,373,2.498,864,4.623,889,6.698,890,5.267,891,5.267,892,5.267,893,5.267,894,5.267,895,5.267,896,5.267]],["t/2028",[47,0.854,53,0.351,72,0.27,75,0.33,79,1.195,89,0.623,106,0.408,148,1.567,161,0.393,191,3.802,282,4.059,320,1.62,381,2.708,437,2.551,459,2.347,567,2.194,577,3.794,658,2.1,678,2.897,706,4.39,708,3.133,709,3.133,710,3.133,791,4.833,793,3.449,797,3.449,798,3.449,803,3.449,804,3.449,805,3.133,806,3.449,807,3.449,808,3.449,809,3.449,810,3.449,811,3.449,812,3.449,813,4.833,897,3.929]],["t/2030",[9,1.784,72,0.404,75,0.296,79,1.784,161,0.587,217,3.432,227,3.607,230,3.135,288,4.324,449,4.324,650,4.324,837,5.149,898,5.149,899,5.866,900,5.866,901,5.866]],["t/2032",[0,1.072,9,1.072,21,2.168,23,1.969,47,0.767,53,0.455,72,0.351,75,0.32,79,1.55,80,2.43,89,0.559,106,0.529,110,0.985,129,1.108,130,2.168,131,3.903,138,3.718,161,0.51,228,1.691,263,1.885,266,2.846,270,3.513,274,1.242,314,1.612,332,3.095,380,2.812,445,2.812,457,2.43,518,1.969,568,3.095,717,2.599,824,3.095,902,3.526,903,3.526,904,3.526,905,3.095,906,3.526,907,3.526,908,3.526,909,3.526,910,3.526,911,3.526,912,3.526,913,3.526,914,3.526,915,3.526,916,3.526,917,3.526,918,3.526,919,3.526,920,3.526]],["t/2034",[9,1.234,23,2.266,47,0.882,53,0.362,55,1.519,72,0.279,75,0.321,79,1.234,89,0.644,106,0.421,110,1.573,148,1.619,161,0.406,191,2,212,2.044,217,3.294,226,1.73,228,1.346,230,2.169,231,2.634,242,1.346,243,2.496,249,3.236,274,1.429,283,3.463,299,1.925,320,2.321,451,1.387,459,3.237,499,3.236,501,2.634,526,2.992,663,3.562,667,3.562,674,3.881,873,2.797,921,4.058,922,3.562,923,4.058,924,4.49,925,4.058]],["t/2036",[29,3.102,47,1.039,53,0.426,72,0.329,75,0.305,106,0.496,110,1.335,130,2.939,131,3.099,138,2.554,161,0.478,198,3.867,228,1.585,263,2.554,266,3.512,274,1.683,303,4.334,607,3.293,717,3.523,869,4.844,873,3.293,922,4.195,926,4.195,927,3.81,928,4.779,929,6.289,930,6.289,931,4.779,932,4.779]],["t/2038",[9,1.658,51,2.41,53,0.486,72,0.375,75,0.301,89,0.865,106,0.566,110,1.523,129,1.185,161,0.546,226,2.324,228,2.271,242,1.809,299,2.586,362,2.493,658,2.914,691,4.786,698,5.458,764,4.786,933,5.453]],["t/2040",[59,2.013,152,2.921,713,5.81,714,5.277,715,5.81,716,5.81]],["t/2042",[9,1.75,53,0.514,59,1.75,72,0.396,75,0.271,79,1.75,106,0.598,110,1.608,129,1.252,152,2.54,161,0.576,263,3.077,274,2.027,869,3.967,934,5.757,935,5.757,936,5.757,937,5.757,938,5.757]],["t/2044",[47,1.072,52,1.339,53,0.44,55,1.846,59,1.499,72,0.339,75,0.3,89,1.018,106,0.512,129,1.072,141,4.329,142,2.885,161,0.494,199,2.033,227,3.032,263,2.635,557,3.932,639,3.932,648,4.329,796,3.932,939,7.138,940,4.931,941,4.329,942,4.329,943,4.931,944,4.931,945,4.931,946,4.931,947,6.42,948,4.931]],["t/2046",[9,1.499,29,3.201,53,0.44,72,0.339,75,0.324,89,1.018,106,0.512,110,1.377,129,1.072,161,0.494,191,2.43,228,2.129,242,1.636,299,2.339,362,2.255,499,3.932,508,3.032,512,4.424,548,4.329,736,4.329,949,4.329,950,4.931,951,4.931,952,4.931,953,4.931,954,4.931]],["t/2048",[53,0.367,72,0.283,75,0.317,89,0.652,106,0.427,111,3.031,129,0.894,152,1.814,154,2.529,161,0.412,226,2.422,242,2.16,243,2.529,248,3.61,255,4.531,274,1.448,278,2.834,280,4.56,457,2.834,500,4.227,537,3.61,666,4.488,784,3.61,814,3.031,949,4.988,955,7.372,956,4.112,957,4.112,958,5.683,959,4.112,960,7.024,961,4.112,962,4.112]],["t/2050",[9,1.562,53,0.458,72,0.354,75,0.331,106,0.533,129,1.117,131,3.247,138,3.889,161,0.514,266,2.868,274,1.808,314,2.348,445,4.095,457,3.539,905,4.508,963,5.136,964,5.136,965,5.136,966,5.136]],["t/2052",[53,0.462,59,2.222,72,0.356,75,0.295,82,3.362,106,0.538,129,1.126,144,3.362,161,0.518,217,3.876,226,2.208,227,3.185,230,2.768,242,1.718,252,4.546,502,4.129,563,4.301,898,4.546,967,6.626,968,4.546,969,5.179,970,5.179,971,6.626]],["t/2054",[0,1.784,3,1.438,6,1.832,9,1.51,10,1.284,19,1.832,35,1.115,39,1.115,42,1.664,47,0.454,50,2.209,52,0.924,55,0.781,59,1.51,60,1.832,64,1.616,75,0.19,78,1.028,82,1.355,97,1.028,100,0.99,104,1.284,110,0.95,112,1.832,116,0.921,125,0.86,127,2.345,146,1.539,148,1.357,154,1.284,158,1.539,168,1.165,177,0.921,189,1.664,191,1.028,200,1.664,214,1.539,229,1.664,231,1.355,242,0.692,254,1.664,261,2.713,269,2.508,280,1.355,283,2.648,307,1.664,317,1.284,318,3.529,319,1.284,323,1.832,324,1.438,328,1.539,335,1.165,342,1.832,371,1.664,400,2.986,429,1.438,451,0.713,501,2.796,514,1.355,518,2.773,522,1.539,526,1.539,541,1.438,555,1.355,613,1.832,628,1.664,650,1.539,658,1.818,683,1.664,816,1.664,924,1.664,972,2.087,973,1.832,974,1.832,975,1.832,976,3.402,977,2.986,978,2.087,979,2.087,980,1.832,981,3.402,982,2.087,983,1.832,984,2.986,985,2.087,986,2.087,987,2.087,988,2.087,989,3.78,990,1.165,991,1.832,992,2.087,993,3.402,994,2.087,995,1.832,996,2.087,997,2.087,998,1.832,999,2.087,1000,2.087,1001,2.087,1002,2.087,1003,2.087,1004,2.087,1005,2.087,1006,3.402,1007,4.307,1008,3.402,1009,3.402,1010,2.087,1011,2.087,1012,2.087,1013,2.087,1014,2.087,1015,2.087,1016,2.087,1017,2.087,1018,1.664,1019,3.402,1020,2.087,1021,1.832,1022,2.087,1023,2.087,1024,2.087,1025,3.402,1026,2.087,1027,3.402,1028,2.087,1029,2.087,1030,1.832,1031,2.087,1032,2.087,1033,2.087,1034,2.087,1035,3.402,1036,2.087,1037,2.087,1038,2.087,1039,2.087,1040,2.087,1041,2.087,1042,2.087,1043,2.087,1044,1.832,1045,2.087,1046,2.087,1047,2.087]],["t/2056",[8,2.709,47,0.671,52,1.255,53,0.412,55,2.074,59,1.405,64,0.912,72,0.212,73,1.411,75,0.327,79,0.939,98,1.898,100,2.192,106,0.32,110,0.862,149,2.004,161,0.309,163,2.709,212,1.12,228,1.024,230,2.961,242,1.024,263,1.65,283,4.051,314,1.411,318,2.277,319,1.898,320,1.272,326,2.709,335,3.435,348,3.685,373,1.464,444,2.275,478,3.185,500,2.004,518,2.581,526,3.407,639,2.461,801,2.461,836,4.057,974,4.057,975,2.709,1048,3.087,1049,3.087,1050,3.087,1051,3.087,1052,3.087,1053,2.461,1054,4.622,1055,6.152,1056,3.087,1057,5.54,1058,3.087,1059,3.087,1060,3.087,1061,3.087,1062,3.087,1063,4.622,1064,3.087]],["t/2058",[0,1.025,23,1.883,29,3.204,47,1.269,52,1.585,53,0.521,55,1.263,72,0.47,73,2.668,75,0.29,79,1.025,100,2.768,142,1.973,148,1.345,161,0.338,212,1.791,217,1.973,226,2.104,230,3.653,268,2.689,269,2.486,283,2.074,318,3.518,324,2.324,327,2.689,328,2.486,335,2.756,362,1.542,475,3.935,494,2.689,570,1.883,666,2.324,687,4.332,697,2.96,778,2.96,805,2.689,984,2.96,1030,2.96,1065,2.96,1066,3.373,1067,3.373,1068,3.373,1069,3.373,1070,3.373,1071,2.689,1072,2.96,1073,3.373,1074,4.935,1075,4.332,1076,6.423,1077,3.373,1078,3.373,1079,3.373,1080,3.373,1081,3.373]],["t/2063",[0,1.799,47,0.948,50,1.856,52,0.776,53,0.472,55,1.633,64,1.563,70,1.672,72,0.364,73,1.307,75,0.317,80,1.97,98,1.758,100,1.356,104,1.758,106,0.549,123,2.509,125,1.178,126,2.331,127,1.97,128,1.408,129,1.15,133,1.758,140,1.038,177,1.261,198,2.682,212,1.919,234,2.279,303,3.006,314,1.307,318,2.149,320,1.178,327,2.279,360,1.856,373,1.356,429,1.97,451,2.021,459,2.522,500,1.856,606,2.509,607,1.97,624,2.279,674,3.644,682,2.509,683,4.216,869,3.006,873,3.644,924,2.279,973,2.509,989,3.828,990,1.596,1082,2.859,1083,5.288,1084,2.859,1085,2.859,1086,2.859,1087,2.859,1088,2.859,1089,2.859,1090,2.509,1091,2.509,1092,2.859,1093,2.279,1094,3.477,1095,2.859,1096,2.859,1097,2.859,1098,2.859,1099,2.859,1100,2.859,1101,4.361]],["t/2065",[0,1.242,9,1.242,52,1.109,53,0.364,55,2.429,64,1.672,72,0.281,75,0.319,119,2.815,168,2.281,198,3.99,228,1.876,274,2.285,303,2.815,451,2.6,459,1.741,518,3.159,867,4.17,869,2.815,1093,3.257,1102,3.586,1103,4.966,1104,4.085,1105,4.085,1106,3.257,1107,3.586,1108,3.586,1109,3.586,1110,4.085,1111,3.586,1112,4.966,1113,3.586,1114,3.586,1115,4.085,1116,4.085,1117,4.085]],["t/2067",[1,1.779,2,2.425,4,2.242,38,2.425,53,0.271,55,1.711,64,1.804,72,0.315,75,0.317,98,4.228,110,0.849,114,2.67,125,1.254,128,1.498,139,4.048,144,1.974,158,2.242,159,1.698,168,1.698,198,3.377,228,1.516,247,3.369,261,2.425,270,3.784,274,1.609,320,1.254,361,2.67,368,1.974,451,2.718,459,2.341,514,1.974,684,2.425,704,2.242,718,2.425,867,2.242,977,2.67,983,2.67,990,1.698,991,2.67,1093,2.425,1106,3.644,1107,2.67,1108,4.012,1109,2.67,1111,2.67,1112,4.012,1113,2.67,1114,2.67,1118,3.041,1119,3.041,1120,2.242,1121,3.041,1122,3.041,1123,4.571,1124,3.041,1125,2.67,1126,3.041,1127,3.041,1128,3.041,1129,3.041,1130,3.041,1131,3.041]],["t/2070",[23,1.824,26,3.948,28,4.223,39,3.605,64,2.261,73,2.204,75,0.329,76,1.91,84,1.549,110,0.912,125,1.987,126,2.576,128,2.375,132,2.819,133,2.008,140,1.185,148,1.923,177,1.441,414,3.553,416,3.553,417,3.553,418,3.553,419,3.553,420,3.553,421,3.553,422,3.553,423,3.843,424,3.843,425,3.843,426,3.843,427,3.843,428,3.843,451,1.647,1018,2.604,1094,2.604,1132,3.266,1133,3.266,1134,2.867,1135,2.867,1136,3.266]],["t/2072",[26,4.291,39,3.327,47,1.023,53,0.42,64,2.062,73,2.152,75,0.326,106,0.489,125,1.94,126,2.515,128,2.319,132,2.753,140,1.708,148,1.877,303,3.243,335,2.628,410,3.243,414,3.469,416,3.469,417,3.469,418,3.469,419,3.469,420,3.469,421,3.469,422,3.469,752,4.131,1065,4.131,1137,4.706,1138,4.706]],["t/2075",[53,0.596,59,2.28,72,0.297,75,0.316,79,1.311,89,1.059,106,0.693,129,0.938,140,2.873,146,3.179,148,3.086,156,3.568,171,2.972,501,2.8,1053,3.438,1139,4.313,1140,3.786,1141,4.313,1142,4.313,1143,4.313,1144,4.313,1145,4.313,1146,4.313,1147,4.313]],["t/2077",[15,2.807,47,1.361,51,1.671,53,0.597,68,2.807,72,0.22,75,0.325,100,1.517,106,0.694,140,2.543,148,1.276,152,2.094,172,4.049,177,1.411,183,2.807,199,2.332,256,2.807,362,2.17,555,3.081,634,2.55,658,1.709,704,2.358,823,2.807,827,2.807,835,2.807,870,2.807,942,2.807,1053,2.55,1120,2.358,1140,2.807,1148,3.198,1149,3.198,1150,3.198,1151,3.198,1152,3.198,1153,3.198,1154,3.198,1155,3.198,1156,3.198,1157,3.198,1158,3.198,1159,3.198,1160,3.198,1161,3.198,1162,3.198,1163,3.198,1164,3.198,1165,3.198,1166,3.198,1167,3.198,1168,3.198,1169,3.198,1170,4.746,1171,3.198,1172,3.198,1173,3.198]],["t/2079",[0,1.078,11,1.98,12,2.828,37,2.614,41,2.828,47,0.771,53,0.457,59,1.556,72,0.244,75,0.294,79,1.078,84,1.682,100,3.308,106,0.368,110,0.99,129,0.771,130,2.181,131,1.747,140,1.287,148,2.396,155,2.444,156,1.895,177,2.65,214,3.773,228,1.176,242,1.176,244,2.444,269,2.614,274,1.249,299,1.682,318,3.24,335,3.354,349,3.113,371,2.828,408,6.121,410,2.444,478,2.444,650,3.773,776,2.828,814,2.614,815,3.113,816,2.828,941,3.113,1021,3.113,1072,3.113,1174,3.547,1175,3.547,1176,3.547,1177,3.547,1178,3.547,1179,3.547,1180,3.547,1181,3.547,1182,3.547,1183,3.547,1184,3.547,1185,3.547,1186,3.547,1187,3.547]],["t/2081",[26,3.148,28,3.367,39,3.262,47,0.993,64,2.168,73,2.088,75,0.327,125,1.883,126,2.441,128,2.25,132,2.672,140,1.658,146,3.367,414,3.367,416,3.367,417,3.367,418,3.367,419,3.367,420,3.367,421,3.367,422,3.367,423,3.642,424,3.642,425,3.642,426,3.642,427,3.642,428,3.642,1018,3.642,1134,4.009,1135,4.009,1188,3.642,1189,4.567]],["t/2084",[0,0.739,24,2.135,29,1.579,35,1.3,42,1.939,47,1.037,48,1.793,51,0.856,52,1.296,53,0.217,70,1.423,72,0.265,73,1.758,75,0.325,76,1.423,78,3.095,84,1.153,89,0.997,104,1.495,133,1.495,139,1.793,151,1.495,159,1.358,199,1.002,226,1.037,228,1.96,229,1.939,230,1.3,263,1.3,288,1.793,299,1.153,320,1.967,373,2.572,381,1.676,436,2.25,437,1.579,451,2.019,459,2.519,472,1.423,494,1.939,508,1.495,562,2.835,563,1.579,569,1.3,596,2.135,624,1.939,666,3.738,926,2.135,927,1.939,980,2.135,1075,3.376,1125,2.135,1190,2.432,1191,2.432,1192,2.135,1193,3.846,1194,4.772,1195,3.846,1196,2.432,1197,2.432,1198,2.432,1199,2.432,1200,2.432,1201,5.424,1202,2.432,1203,2.432,1204,2.432,1205,2.432,1206,2.432,1207,2.432,1208,3.846,1209,2.432,1210,2.432,1211,2.432,1212,2.432,1213,2.432,1214,2.432,1215,2.432,1216,2.432,1217,2.135,1218,2.432,1219,2.432,1220,2.432,1221,2.432,1222,2.432,1223,2.432,1224,2.432,1225,2.432]],["t/2087",[0,1.226,3,2.778,4,4.132,21,2.479,75,0.154,76,2.359,82,2.617,102,3.214,142,2.359,153,2.972,155,2.778,164,2.972,168,2.251,268,3.214,273,3.539,307,3.214,317,2.479,378,3.214,472,2.359,514,2.617,518,2.251,550,2.972,714,3.214,850,3.539,1071,3.214,1120,2.972,1188,3.214,1192,3.539,1217,3.539,1226,4.032,1227,4.032,1228,3.539,1229,4.032,1230,4.032,1231,4.032,1232,4.032,1233,4.032,1234,4.032,1235,4.032,1236,4.032,1237,4.032,1238,4.032,1239,4.032,1240,4.032,1241,4.032,1242,4.032,1243,4.032,1244,4.032,1245,4.032,1246,3.539,1247,3.539,1248,3.539,1249,4.032,1250,4.032,1251,4.032,1252,4.032,1253,4.032,1254,4.032,1255,4.032,1256,4.032,1257,3.539,1258,4.032,1259,4.032,1260,3.539,1261,4.032]],["t/2089",[0,1.33,1,2.559,9,1.33,12,3.487,21,3.645,45,3.839,47,0.951,57,3.839,59,1.802,137,3.014,140,1.587,145,3.839,274,2.367,337,3.848,472,3.468,479,3.848,677,5.203,1103,3.839,1228,3.839,1260,3.839,1262,5.928,1263,4.374,1264,4.374,1265,4.374,1266,4.374,1267,3.839,1268,4.374,1269,4.374,1270,4.374,1271,4.374,1272,4.374,1273,4.374,1274,4.374,1275,4.374,1276,4.374,1277,4.374,1278,4.085,1279,3.848,1280,4.374,1281,3.848,1282,4.374,1283,4.374]],["t/2091",[0,1.75,1,3.368,274,2.493,337,4.597,479,4.597,990,3.954,1278,4.88,1279,4.597,1281,4.597,1284,5.757,1285,5.757,1286,5.757,1287,5.757]],["t/2093",[0,1.75,1,3.368,274,2.493,337,4.597,479,4.597,990,3.954,1278,4.88,1279,4.597,1281,4.597,1288,5.757,1289,5.757,1290,5.757,1291,5.757]],["t/2095",[0,1.75,1,3.368,274,2.493,337,4.597,479,4.597,990,3.954,1278,4.88,1279,4.597,1281,4.597,1292,5.757,1293,5.757,1294,5.757,1295,5.757]],["t/2097",[0,1.75,1,3.368,274,2.493,337,4.597,479,4.597,990,3.954,1278,4.88,1279,4.597,1281,4.597,1296,5.757,1297,5.757,1298,5.757,1299,5.757]],["t/2099",[3,4.166,4,2.645,9,1.569,11,2.003,20,4.531,40,2.472,64,1.06,70,3.019,75,0.198,76,3.536,133,2.206,144,3.351,168,2.882,231,3.351,234,4.82,286,4.531,324,4.556,378,4.115,444,2.645,472,4.267,718,2.86,801,2.86,867,2.645,1071,2.86,1246,3.149,1247,3.149,1248,3.149,1267,4.531,1279,2.329,1281,4.548,1300,3.588,1301,3.588,1302,3.588,1303,3.588,1304,3.588,1305,3.588,1306,3.588,1307,3.588,1308,3.588,1309,3.588,1310,3.588,1311,5.162,1312,5.162,1313,3.588,1314,5.162,1315,5.162,1316,3.588,1317,3.588,1318,3.588,1319,3.588,1320,3.588,1321,3.588,1322,3.588]],["t/2102",[0,1.922,2,3.84,5,3.84,27,3.127,39,2.574,47,1.047,72,0.332,84,2.284,140,1.748,142,3.698,149,3.127,157,4.228,159,2.689,160,5.549,191,2.373,196,3.55,444,3.55,475,3.84,1188,3.84,1323,6.321,1324,4.228,1325,4.816,1326,4.228,1327,4.816,1328,4.816,1329,4.816,1330,4.816,1331,4.816,1332,4.816,1333,4.816,1334,4.816,1335,4.816,1336,4.816,1337,4.816,1338,4.816,1339,4.816,1340,4.816]],["t/2104",[0,1.912,53,0.426,59,1.453,64,1.412,70,2.796,72,0.329,75,0.241,76,2.796,80,3.293,100,2.983,140,1.735,156,2.554,259,3.523,274,2.475,278,3.293,318,2.355,429,3.293,451,2.149,756,4.195,776,3.81,873,3.293,927,3.81,968,4.195,990,2.668,1091,4.195,1094,5.605,1120,3.523,1341,4.779,1342,4.779,1343,4.779,1344,4.779,1345,4.779,1346,4.779,1347,4.779]],["t/2106",[0,1.629,53,0.478,55,2.006,64,2.001,72,0.369,75,0.284,98,3.295,106,0.556,137,3.693,139,3.95,259,3.95,451,2.665,459,2.284,518,2.992,670,3.693,990,3.781,1106,5.398,1257,4.703,1348,5.358,1349,5.358]],["t/2108",[0,2.117,10,3.444,47,1.218,116,2.471,137,3.86,238,4.916,317,4.658,318,2.76,319,3.444,510,4.465,522,4.129,814,4.129,1044,4.916,1350,4.916,1351,4.916,1352,4.916,1353,4.916,1354,4.916,1355,4.916,1356,4.916]],["t/2110",[75,0.273,168,3.245,207,4.633,247,4.284,368,3.772,541,4.005,684,4.633,762,5.101,1324,5.101,1357,5.811,1358,5.811,1359,5.811,1360,5.811,1361,5.811,1362,5.811,1363,5.811,1364,5.811,1365,5.811]],["t/2113",[0,1.697,10,4.271,27,4.909,35,2.141,52,1.088,53,0.357,75,0.303,79,1.697,89,0.885,100,1.9,106,0.416,125,2.3,129,0.871,131,1.974,138,2.141,155,2.76,199,1.651,203,5.637,212,1.454,215,3.194,221,3.194,228,1.329,314,3.175,316,4.114,317,3.949,436,2.343,440,3.194,451,2.194,500,2.6,518,3.116,541,2.76,1090,3.516,1366,4.006,1367,4.006,1368,4.006,1369,3.516,1370,3.516]],["t/2115",[0,1.18,10,4.212,11,2.167,27,2.519,50,2.519,53,0.346,72,0.267,73,1.774,75,0.319,104,3.356,106,0.403,125,1.599,126,2.917,127,2.674,129,0.844,131,1.912,132,2.27,138,2.074,154,2.386,215,3.094,221,3.094,266,3.047,316,2.86,317,4.212,383,3.406,437,2.519,510,5.754,518,2.167,995,3.406,998,3.406,1102,3.406,1326,3.406,1350,3.406,1351,3.406,1352,3.406,1353,3.406,1354,3.406,1355,3.406,1356,3.406,1369,3.406,1370,3.406,1371,3.88,1372,3.88,1373,3.88,1374,3.88,1375,3.88,1376,3.88]]],"invertedIndex":[["",{"_index":75,"t":{"1916":{"position":[[531,1],[540,2],[558,2],[601,1],[793,1],[802,2],[820,2],[873,2],[936,2],[957,2],[1001,1],[1151,1],[1160,2],[1201,2],[1228,2]]},"1918":{"position":[[147,1],[153,2],[200,1],[226,2],[246,1]]},"1920":{"position":[[338,2],[658,2],[704,3],[740,1],[766,2],[780,2],[861,1],[895,1],[897,1],[918,2],[921,2],[960,2],[982,2],[1054,1],[1076,2],[1079,2],[1082,1],[1098,1],[1100,1],[1120,2],[1123,2],[1137,1],[1144,1],[1171,1],[1173,2],[1186,2],[1266,1],[1286,1],[1288,1],[1305,2],[1308,2],[1331,2]]},"1922":{"position":[[253,2]]},"1927":{"position":[[221,1],[227,2],[242,2],[245,3],[266,1]]},"1929":{"position":[[72,1],[74,2],[119,2],[229,2],[232,2],[235,3],[256,1],[328,1],[334,2],[349,2],[419,1],[453,1],[487,1],[520,1],[530,2],[533,3],[554,1],[843,2],[1627,1],[1634,1],[1853,1],[2450,1]]},"1931":{"position":[[233,2],[236,2],[355,2],[358,2],[394,2],[397,2],[435,2],[438,2],[556,2],[626,2],[1035,2],[1038,2],[1081,2],[1084,2],[1129,2],[1132,2],[1355,2],[1429,1],[1431,2],[1484,2],[1561,2],[1631,2],[1688,2],[1735,2],[1782,2],[1830,2],[1860,2],[1906,2],[1957,2],[2011,1],[2129,2]]},"1933":{"position":[[83,2],[191,2],[289,2],[790,2],[835,2],[894,2],[1081,1],[1136,2],[1179,1],[1210,2],[1258,1],[1290,2]]},"1935":{"position":[[136,1],[142,2],[161,2],[191,2],[202,2],[231,2],[267,2],[308,2],[327,2],[356,2],[392,2],[433,2],[466,1]]},"1937":{"position":[[91,2],[274,2],[309,3],[313,1],[315,2]]},"1939":{"position":[[194,1],[207,2],[463,2],[521,2],[528,1],[545,1],[554,2]]},"1941":{"position":[[202,1],[236,2],[243,1],[260,1]]},"1943":{"position":[[337,2],[405,1],[432,2],[435,2],[494,2],[497,2],[527,2],[530,2],[550,2],[646,2],[671,2],[688,2],[737,2],[744,1],[754,2],[809,2],[812,2],[829,1]]},"1946":{"position":[[304,2],[372,1],[392,2],[425,2],[466,2],[506,2],[551,2],[554,2],[574,2],[577,2],[580,2],[646,2],[689,2],[730,2],[799,1],[843,2],[896,2],[947,2],[955,2]]},"1948":{"position":[[237,1],[297,2],[300,2],[370,2],[373,2],[424,2]]},"1950":{"position":[[150,1],[167,2],[170,2],[246,2],[249,2],[305,2],[308,2],[335,2]]},"1952":{"position":[[152,1],[164,2],[212,2]]},"1954":{"position":[[31,1],[89,2],[163,1],[177,2],[200,2]]},"1956":{"position":[[60,2],[144,1],[146,2],[190,2],[203,2]]},"1958":{"position":[[289,2],[361,1],[461,1],[496,1],[500,2],[522,2],[546,2],[553,1],[570,1],[592,2],[620,2],[627,2],[630,2],[676,2],[789,2],[913,2],[1025,2],[1088,2]]},"1960":{"position":[[133,1],[135,2],[174,2],[231,2],[325,2],[687,1],[777,1],[824,2],[827,2],[868,1],[909,2],[976,1],[1016,2],[1019,2]]},"1964":{"position":[[58,1],[171,2],[192,1],[234,1],[236,2],[260,2],[293,1],[315,1],[338,1],[358,1],[371,2],[402,2]]},"1966":{"position":[[226,1],[228,2],[268,2],[304,2],[313,2]]},"1968":{"position":[[373,1],[382,2],[429,2],[436,1],[450,2],[471,1],[473,2],[476,2],[512,2],[573,2],[580,1],[594,2],[615,1],[617,2],[620,2],[643,2]]},"1970":{"position":[[182,1],[219,2],[222,2],[290,2],[293,2],[312,2]]},"1972":{"position":[[141,1],[147,2],[208,1],[217,2],[239,2],[246,1],[260,1],[262,2],[306,1],[315,2],[337,2],[344,1],[358,1],[360,2],[406,1],[415,2],[437,2],[444,1],[458,1],[460,2],[498,1],[572,2],[592,1]]},"1974":{"position":[[262,1],[264,2],[312,2],[315,2],[332,2],[379,2],[382,2],[406,2],[460,2],[463,2],[482,2]]},"1976":{"position":[[199,1],[201,2],[257,2],[283,2],[311,2],[318,1],[320,2],[405,1],[407,2]]},"1978":{"position":[[173,1],[175,2],[238,2],[241,2],[254,2],[270,2]]},"1982":{"position":[[168,1],[192,2],[230,2],[265,2],[268,2],[271,2]]},"1984":{"position":[[94,2],[158,1],[173,2],[189,2]]},"1986":{"position":[[110,1],[119,2],[134,2]]},"1988":{"position":[[117,2],[195,1],[205,2],[242,2]]},"1990":{"position":[[236,2],[310,1],[325,2],[347,2],[368,2],[377,2]]},"1992":{"position":[[186,1],[210,1],[248,1],[250,2],[278,2],[317,1],[326,2],[347,2],[354,1],[387,1],[389,2],[392,2],[426,2],[429,2],[470,2],[519,3],[527,2],[534,1],[567,1],[569,2],[572,2],[606,2],[609,2],[643,2]]},"1994":{"position":[[321,1],[345,1],[379,1],[381,2],[409,2],[448,1],[464,2],[467,2],[537,2],[540,2],[584,2]]},"1996":{"position":[[166,1],[270,1],[272,2],[332,2],[385,2]]},"1998":{"position":[[308,1],[345,2],[385,1],[407,2],[418,1],[458,1],[465,1],[485,2],[488,2],[505,1],[507,2]]},"2000":{"position":[[147,1],[205,2]]},"2002":{"position":[[243,1],[256,2],[266,2]]},"2004":{"position":[[261,1],[263,2],[305,2],[331,2],[338,1],[340,2],[343,2],[371,2],[406,1],[410,1],[412,2],[452,1],[454,2],[499,2],[525,2],[528,2],[555,2],[590,2],[605,1],[677,2],[680,2],[723,2],[803,1],[805,1],[807,2]]},"2006":{"position":[[267,1],[304,2],[339,1],[376,2],[411,1],[463,2]]},"2008":{"position":[[75,2],[152,1],[170,2],[195,2]]},"2010":{"position":[[174,5],[280,2],[359,1],[378,2],[411,2],[419,2]]},"2012":{"position":[[156,2],[235,1],[246,2],[258,2]]},"2014":{"position":[[108,2],[166,1],[181,2],[191,2]]},"2016":{"position":[[328,2],[414,1],[433,2],[460,2],[495,2],[505,2]]},"2018":{"position":[[119,2],[191,1],[284,1],[319,1],[323,2],[345,2],[370,2],[377,1],[394,1],[416,2],[444,2],[475,2],[490,2],[493,2],[538,2]]},"2020":{"position":[[105,2],[170,1],[174,2],[201,2],[212,1],[220,2],[238,1],[255,2],[269,1],[271,1],[273,2]]},"2022":{"position":[[285,1],[309,2],[350,1],[406,4],[411,2],[460,1],[579,2]]},"2026":{"position":[[69,2],[108,2],[130,1],[134,2],[199,2],[234,1],[268,1]]},"2028":{"position":[[152,1],[154,2],[196,2],[222,2],[229,1],[231,2],[234,2],[253,2],[298,2],[324,2],[327,2],[354,2],[389,2],[404,1],[476,2],[479,2],[522,2],[602,1],[604,1],[606,2]]},"2030":{"position":[[32,1],[104,2],[154,2]]},"2032":{"position":[[192,1],[218,2],[221,2],[272,2],[275,2],[306,2],[309,2],[316,2],[614,1],[652,2],[655,2],[704,2],[707,2],[781,2],[784,2],[803,2]]},"2034":{"position":[[297,1],[306,2],[346,2],[353,1],[367,2],[395,1],[397,2],[426,2],[474,2],[481,1],[495,2],[523,1],[525,2]]},"2036":{"position":[[238,1],[258,2],[261,2],[335,2],[338,2],[361,2]]},"2038":{"position":[[144,1],[182,2],[185,2],[215,2]]},"2042":{"position":[[138,1],[234,2]]},"2044":{"position":[[256,2],[324,1],[341,2],[380,2],[392,2]]},"2046":{"position":[[170,1],[188,2],[191,2],[221,2],[224,2],[254,2],[257,2],[293,2],[296,2],[311,2]]},"2048":{"position":[[269,1],[288,2],[291,2],[328,2],[331,2],[359,2],[393,2],[396,2],[460,2],[463,2],[516,2]]},"2050":{"position":[[124,1],[142,2],[145,2],[148,2],[159,1],[184,3],[188,2],[191,2],[209,1],[224,2],[227,2],[250,2]]},"2052":{"position":[[208,2],[276,1],[286,2],[294,2]]},"2054":{"position":[[64,1],[131,1],[894,1],[953,1]]},"2056":{"position":[[237,2],[274,1],[276,2],[328,2],[371,2],[421,2],[446,1],[451,2],[475,1],[479,2],[505,1],[509,2],[541,1],[545,2],[588,1],[598,2],[674,2],[744,2],[846,1],[864,2],[883,3],[887,2],[997,1],[1015,2],[1034,2],[1066,2]]},"2058":{"position":[[567,1],[590,2],[628,1],[630,3],[994,1],[1017,2],[1055,1],[1057,3]]},"2063":{"position":[[238,1],[244,2],[288,2],[295,1],[309,2],[332,1],[334,2],[516,1],[583,1],[597,1],[603,2],[680,1],[733,2],[764,1],[1076,1],[1082,2],[1117,2],[1148,2],[1204,2],[1229,2]]},"2065":{"position":[[218,2],[269,1],[303,1],[305,2],[340,2],[375,2],[421,2],[447,1],[454,1],[463,1],[465,2],[595,1]]},"2067":{"position":[[522,2],[537,2],[587,1],[621,1],[623,2],[658,2],[693,2],[760,2],[786,1],[793,1],[802,1],[804,2],[834,1],[901,2],[908,1],[962,1],[964,1],[993,1]]},"2070":{"position":[[79,1],[85,2],[104,2],[133,2],[144,2],[173,2],[209,2],[250,2],[269,2],[300,2],[336,2],[377,2],[410,1],[471,1],[477,2],[496,2],[517,2],[528,2],[548,2],[584,2],[625,2],[644,2],[664,2],[700,2],[741,2],[774,1]]},"2072":{"position":[[131,1],[137,2],[156,2],[177,2],[188,2],[227,1],[264,2],[276,2],[279,2],[315,2],[356,2],[389,1]]},"2075":{"position":[[185,2],[243,4],[280,1],[297,2],[300,2],[389,1],[407,2],[410,2],[509,1],[532,2]]},"2077":{"position":[[395,2],[464,1],[519,2],[522,2],[572,1],[596,2],[599,2],[664,1],[691,2],[716,1],[718,1],[732,3],[829,2],[932,1],[952,2],[982,2],[993,2],[996,2],[1086,1],[1105,2],[1127,2],[1134,2]]},"2079":{"position":[[273,1],[275,2],[561,2],[596,2],[633,5],[639,2],[674,1],[700,2]]},"2081":{"position":[[82,1],[88,2],[107,2],[136,2],[147,2],[176,2],[212,2],[253,2],[272,2],[303,2],[339,2],[380,2],[413,1]]},"2084":{"position":[[407,1],[607,1],[635,1],[680,1],[730,1],[769,1],[791,2],[823,2],[830,1],[843,2],[885,1],[933,1],[969,1],[995,1],[1016,1],[1043,1],[1045,1],[1061,1],[1090,1],[1119,2],[1139,2],[1166,2],[1173,1],[1182,2],[1212,2],[1219,1],[1243,1],[1245,1],[1299,1],[1301,2],[1352,2],[1491,2],[1505,2]]},"2087":{"position":[[497,1]]},"2099":{"position":[[0,2],[94,1]]},"2104":{"position":[[430,1],[500,2]]},"2106":{"position":[[131,1],[163,1],[203,1]]},"2110":{"position":[[180,1],[194,2]]},"2113":{"position":[[97,1],[168,1],[298,2],[341,2],[386,2],[531,1],[587,3],[591,2]]},"2115":{"position":[[188,1],[252,1],[266,1],[268,2],[322,2],[358,2],[403,2],[438,1],[440,2],[467,1],[524,2],[527,2],[547,1]]}}}],["0",{"_index":801,"t":{"2004":{"position":[[408,1]]},"2056":{"position":[[477,1]]},"2099":{"position":[[176,1]]}}}],["0.4",{"_index":1297,"t":{"2097":{"position":[[72,3]]}}}],["0.7",{"_index":1293,"t":{"2095":{"position":[[70,3]]}}}],["1",{"_index":478,"t":{"1943":{"position":[[225,1]]},"1946":{"position":[[839,3],[856,2]]},"1954":{"position":[[129,1]]},"2056":{"position":[[449,1],[507,1]]},"2079":{"position":[[331,3]]}}}],["1,146,667",{"_index":1296,"t":{"2097":{"position":[[14,9]]}}}],["1.1",{"_index":1299,"t":{"2097":{"position":[[152,3]]}}}],["1.11",{"_index":43,"t":{"1914":{"position":[[39,4]]}}}],["10",{"_index":1071,"t":{"2058":{"position":[[522,3]]},"2087":{"position":[[565,2]]},"2099":{"position":[[182,2]]}}}],["100",{"_index":1311,"t":{"2099":{"position":[[189,3],[580,4]]}}}],["1000",{"_index":1320,"t":{"2099":{"position":[[585,5]]}}}],["1024",{"_index":276,"t":{"1929":{"position":[[1629,4],[1636,4],[1855,4]]}}}],["11,846",{"_index":1284,"t":{"2091":{"position":[[14,6]]}}}],["117.2",{"_index":1291,"t":{"2093":{"position":[[148,5]]}}}],["123",{"_index":905,"t":{"2032":{"position":[[312,3]]},"2050":{"position":[[245,4]]}}}],["12345.pdf",{"_index":673,"t":{"1968":{"position":[[412,12],[495,9],[542,11]]}}}],["127.0.0.1",{"_index":731,"t":{"1986":{"position":[[122,11]]},"1988":{"position":[[145,10],[219,12]]}}}],["15:04:05",{"_index":1079,"t":{"2058":{"position":[[923,11]]}}}],["15th",{"_index":33,"t":{"1912":{"position":[[311,5]]}}}],["16",{"_index":533,"t":{"1946":{"position":[[824,4]]}}}],["18.04.3",{"_index":1254,"t":{"2087":{"position":[[523,7]]}}}],["185",{"_index":121,"t":{"1916":{"position":[[1480,5]]},"1929":{"position":[[1273,5]]}}}],["19,664",{"_index":1288,"t":{"2093":{"position":[[14,6]]}}}],["1;q=0.2",{"_index":525,"t":{"1946":{"position":[[681,7]]}}}],["1]:3000",{"_index":447,"t":{"1939":{"position":[[196,10]]}}}],["2",{"_index":639,"t":{"1960":{"position":[[978,4]]},"2044":{"position":[[133,2]]},"2056":{"position":[[543,1]]}}}],["2,066",{"_index":1286,"t":{"2091":{"position":[[94,5]]}}}],["2.0",{"_index":1280,"t":{"2089":{"position":[[444,3]]}}}],["2.20ghz",{"_index":1250,"t":{"2087":{"position":[[499,7]]}}}],["2.30ghz",{"_index":1303,"t":{"2099":{"position":[[96,7]]}}}],["20",{"_index":749,"t":{"1992":{"position":[[313,3],[458,4],[515,3],[638,4]]},"1994":{"position":[[444,3],[504,4],[579,4]]}}}],["200",{"_index":496,"t":{"1943":{"position":[[740,3]]}}}],["200m",{"_index":476,"t":{"1943":{"position":[[168,5]]}}}],["2020",{"_index":34,"t":{"1912":{"position":[[317,5]]}}}],["21",{"_index":830,"t":{"2010":{"position":[[405,5],[414,4]]}}}],["244,847",{"_index":1298,"t":{"2097":{"position":[[96,7]]}}}],["25.7",{"_index":1289,"t":{"2093":{"position":[[69,4]]}}}],["256",{"_index":289,"t":{"1929":{"position":[[1849,3]]}}}],["28",{"_index":1243,"t":{"2087":{"position":[[454,2]]}}}],["3",{"_index":1073,"t":{"2058":{"position":[[531,2]]}}}],["30",{"_index":1319,"t":{"2099":{"position":[[537,2]]}}}],["3000",{"_index":446,"t":{"1939":{"position":[[188,5]]}}}],["301",{"_index":884,"t":{"2022":{"position":[[574,4]]}}}],["302",{"_index":872,"t":{"2022":{"position":[[179,3]]}}}],["32",{"_index":313,"t":{"1929":{"position":[[2605,4]]}}}],["32gb",{"_index":1251,"t":{"2087":{"position":[[507,4]]}}}],["354.1",{"_index":1283,"t":{"2089":{"position":[[518,5]]}}}],["360641",{"_index":811,"t":{"2004":{"position":[[698,6]]},"2028":{"position":[[497,6]]}}}],["367,069",{"_index":1282,"t":{"2089":{"position":[[462,7]]}}}],["368,647",{"_index":1292,"t":{"2095":{"position":[[14,7]]}}}],["390.44",{"_index":1287,"t":{"2091":{"position":[[148,6]]}}}],["4",{"_index":275,"t":{"1929":{"position":[[1625,1]]}}}],["4,302",{"_index":1290,"t":{"2093":{"position":[[94,5]]}}}],["4.15.0",{"_index":1255,"t":{"2087":{"position":[[531,6]]}}}],["4.4",{"_index":1295,"t":{"2095":{"position":[[149,3]]}}}],["401",{"_index":1010,"t":{"2054":{"position":[[1166,3]]}}}],["403",{"_index":782,"t":{"1998":{"position":[[491,3]]}}}],["404",{"_index":1094,"t":{"2063":{"position":[[1012,4],[1207,3]]},"2070":{"position":[[824,3]]},"2104":{"position":[[10,3],[127,3],[381,3]]}}}],["4096",{"_index":345,"t":{"1929":{"position":[[3438,4],[3514,4]]}}}],["413",{"_index":271,"t":{"1929":{"position":[[1584,3]]}}}],["415",{"_index":930,"t":{"2036":{"position":[[264,3],[341,3]]}}}],["42.8",{"_index":1285,"t":{"2091":{"position":[[69,4]]}}}],["426",{"_index":120,"t":{"1916":{"position":[[1471,4]]}}}],["4gb",{"_index":1305,"t":{"2099":{"position":[[108,3]]}}}],["500",{"_index":867,"t":{"2020":{"position":[[258,5]]},"2065":{"position":[[90,3],[331,3]]},"2067":{"position":[[649,3]]},"2099":{"position":[[197,3]]}}}],["5000",{"_index":1312,"t":{"2099":{"position":[[261,5],[591,4]]}}}],["503",{"_index":1097,"t":{"2063":{"position":[[1120,3]]}}}],["5120",{"_index":1249,"t":{"2087":{"position":[[488,4]]}}}],["57,880",{"_index":1294,"t":{"2095":{"position":[[94,6]]}}}],["6,162,556",{"_index":1277,"t":{"2089":{"position":[[386,9]]}}}],["6140",{"_index":1302,"t":{"2099":{"position":[[85,4]]}}}],["700",{"_index":859,"t":{"2020":{"position":[[125,4],[130,3],[264,4]]}}}],["8",{"_index":522,"t":{"1946":{"position":[[669,2]]},"1990":{"position":[[276,1]]},"2054":{"position":[[2016,1]]},"2108":{"position":[[25,1]]}}}],["8080",{"_index":471,"t":{"1941":{"position":[[222,9]]}}}],["88",{"_index":1256,"t":{"2087":{"position":[[538,2]]}}}],["8859",{"_index":524,"t":{"1946":{"position":[[676,4],[834,4],[851,4]]}}}],["900",{"_index":860,"t":{"2020":{"position":[[134,3]]}}}],["9_",{"_index":1151,"t":{"2077":{"position":[[342,5]]}}}],["_",{"_index":437,"t":{"1937":{"position":[[272,1]]},"1943":{"position":[[669,1],[752,1]]},"2004":{"position":[[582,2]]},"2028":{"position":[[381,2]]},"2084":{"position":[[836,2]]},"2115":{"position":[[465,1]]}}}],["_test.go",{"_index":473,"t":{"1943":{"position":[[84,8]]}}}],["abov",{"_index":101,"t":{"1916":{"position":[[1062,5]]}}}],["absenc",{"_index":1342,"t":{"2104":{"position":[[161,7]]}}}],["ac",{"_index":1350,"t":{"2108":{"position":[[80,3]]},"2115":{"position":[[98,3]]}}}],["accept",{"_index":500,"t":{"1946":{"position":[[57,11],[97,6],[307,7],[630,6],[649,6],[692,6],[733,6]]},"1974":{"position":[[36,6],[64,7],[267,7],[335,7],[409,7]]},"2048":{"position":[[450,9],[492,6],[509,6]]},"2056":{"position":[[153,6]]},"2063":{"position":[[785,7]]},"2113":{"position":[[451,7]]}}}],["access",{"_index":550,"t":{"1952":{"position":[[47,6]]},"1970":{"position":[[14,6]]},"2004":{"position":[[3,6]]},"2087":{"position":[[146,7]]}}}],["accordingli",{"_index":1122,"t":{"2067":{"position":[[242,11]]}}}],["action",{"_index":1121,"t":{"2067":{"position":[[235,6]]}}}],["activ",{"_index":1066,"t":{"2058":{"position":[[95,9]]}}}],["actual",{"_index":359,"t":{"1931":{"position":[[846,8]]}}}],["ad",{"_index":1065,"t":{"2058":{"position":[[5,6]]},"2072":{"position":[[74,5]]}}}],["add",{"_index":278,"t":{"1929":{"position":[[1669,4]]},"1931":{"position":[[1637,4]]},"1933":{"position":[[86,3]]},"2048":{"position":[[0,4]]},"2104":{"position":[[283,3]]}}}],["addit",{"_index":1091,"t":{"2063":{"position":[[866,10]]},"2104":{"position":[[172,10]]}}}],["address",{"_index":441,"t":{"1939":{"position":[[51,8],[102,8],[168,7]]},"1986":{"position":[[22,7]]},"1988":{"position":[[23,9]]}}}],["adduser(c",{"_index":1216,"t":{"2084":{"position":[[1068,9]]}}}],["admin",{"_index":778,"t":{"1998":{"position":[[327,8],[410,7],[449,8]]},"2058":{"position":[[390,5]]}}}],["ag",{"_index":745,"t":{"1992":{"position":[[200,3],[308,4],[451,6],[508,6],[631,6]]},"1994":{"position":[[335,3],[439,4],[497,6],[572,6]]}}}],["age=5184000",{"_index":1180,"t":{"2079":{"position":[[469,13]]}}}],["agent",{"_index":960,"t":{"2048":{"position":[[320,7],[353,5],[418,5],[485,6]]}}}],["alireza",{"_index":979,"t":{"2054":{"position":[[296,7]]}}}],["aliv",{"_index":291,"t":{"1929":{"position":[[1895,5],[3132,5]]}}}],["alloc",{"_index":20,"t":{"1912":{"position":[[166,10]]},"2099":{"position":[[354,6],[373,11]]}}}],["allow",{"_index":111,"t":{"1916":{"position":[[1347,8]]},"1929":{"position":[[1500,7],[2824,7]]},"1933":{"position":[[90,6]]},"2048":{"position":[[186,8]]}}}],["along",{"_index":1161,"t":{"2077":{"position":[[780,5]]}}}],["alreadi",{"_index":537,"t":{"1948":{"position":[[92,7]]},"2048":{"position":[[93,7]]}}}],["altern",{"_index":109,"t":{"1916":{"position":[[1231,14]]}}}],["altogeth",{"_index":477,"t":{"1943":{"position":[[207,11]]}}}],["amber",{"_index":1351,"t":{"2108":{"position":[[84,5]]},"2115":{"position":[[102,5]]}}}],["amount",{"_index":323,"t":{"1929":{"position":[[2809,6],[3078,6]]},"2054":{"position":[[773,6]]}}}],["and/or",{"_index":342,"t":{"1929":{"position":[[3386,6]]},"2054":{"position":[[1645,6]]}}}],["anoth",{"_index":885,"t":{"2024":{"position":[[131,7]]}}}],["answer",{"_index":1323,"t":{"2102":{"position":[[23,6],[52,6]]}}}],["anywher",{"_index":112,"t":{"1916":{"position":[[1376,9]]},"2054":{"position":[[514,8]]}}}],["api",{"_index":39,"t":{"1912":{"position":[[379,3]]},"1920":{"position":[[1311,3]]},"1924":{"position":[[37,4],[129,3]]},"1935":{"position":[[157,3],[194,4]]},"1962":{"position":[[96,3]]},"2054":{"position":[[1640,4]]},"2070":{"position":[[100,3],[136,4],[492,3],[520,4],[792,5]]},"2072":{"position":[[152,3],[180,4]]},"2081":{"position":[[103,3],[139,4]]},"2102":{"position":[[455,3]]}}}],["api.group(\"/v1",{"_index":417,"t":{"1935":{"position":[[205,16]]},"2070":{"position":[[147,16],[531,16]]},"2072":{"position":[[191,16]]},"2081":{"position":[[150,16]]}}}],["api.group(\"/v2",{"_index":423,"t":{"1935":{"position":[[330,16]]},"2070":{"position":[[272,16],[647,16]]},"2081":{"position":[[275,16]]}}}],["api/v1",{"_index":418,"t":{"1935":{"position":[[234,7]]},"2070":{"position":[[176,7],[551,7]]},"2072":{"position":[[282,7]]},"2081":{"position":[[179,7]]}}}],["api/v1/list",{"_index":420,"t":{"1935":{"position":[[270,12]]},"2070":{"position":[[212,12],[587,12]]},"2072":{"position":[[318,12]]},"2081":{"position":[[215,12]]}}}],["api/v1/us",{"_index":422,"t":{"1935":{"position":[[311,12]]},"2070":{"position":[[253,12],[628,12]]},"2072":{"position":[[359,12]]},"2081":{"position":[[256,12]]}}}],["api/v2",{"_index":424,"t":{"1935":{"position":[[359,7]]},"2070":{"position":[[303,7],[667,7]]},"2081":{"position":[[306,7]]}}}],["api/v2/list",{"_index":426,"t":{"1935":{"position":[[395,12]]},"2070":{"position":[[339,12],[703,12]]},"2081":{"position":[[342,12]]}}}],["api/v2/us",{"_index":428,"t":{"1935":{"position":[[436,12]]},"2070":{"position":[[380,12],[744,12]]},"2081":{"position":[[383,12]]}}}],["app",{"_index":125,"t":{"1918":{"position":[[61,4],[149,3]]},"1920":{"position":[[405,3]]},"1922":{"position":[[249,3]]},"1927":{"position":[[26,3],[149,4],[223,3]]},"1929":{"position":[[115,3],[303,4],[330,3]]},"1935":{"position":[[138,3]]},"1937":{"position":[[87,3]]},"1952":{"position":[[12,4],[98,4]]},"1972":{"position":[[143,3]]},"2054":{"position":[[1372,4]]},"2063":{"position":[[599,3]]},"2067":{"position":[[518,3]]},"2070":{"position":[[81,3],[473,3]]},"2072":{"position":[[133,3]]},"2081":{"position":[[84,3]]},"2113":{"position":[[250,3],[337,3]]},"2115":{"position":[[354,3]]}}}],["app.add(method",{"_index":386,"t":{"1933":{"position":[[131,15]]}}}],["app.all(path",{"_index":389,"t":{"1933":{"position":[[237,12]]}}}],["app.connect(path",{"_index":397,"t":{"1933":{"position":[[678,16]]}}}],["app.delete(path",{"_index":396,"t":{"1933":{"position":[[623,15]]}}}],["app.get",{"_index":129,"t":{"1918":{"position":[[168,12]]},"1920":{"position":[[708,12]]},"1943":{"position":[[379,12]]},"1946":{"position":[[340,12],[767,12]]},"1948":{"position":[[205,12]]},"1950":{"position":[[118,12]]},"1954":{"position":[[131,12]]},"1960":{"position":[[101,12]]},"1964":{"position":[[202,12]]},"1966":{"position":[[194,12]]},"1968":{"position":[[341,12]]},"1970":{"position":[[150,12]]},"1974":{"position":[[230,12]]},"1982":{"position":[[136,12]]},"1984":{"position":[[126,12]]},"1986":{"position":[[78,12]]},"1988":{"position":[[163,12]]},"1990":{"position":[[278,12]]},"1994":{"position":[[347,12]]},"1996":{"position":[[134,12]]},"2006":{"position":[[235,12],[307,12],[379,12]]},"2008":{"position":[[120,12]]},"2014":{"position":[[134,12]]},"2016":{"position":[[382,12]]},"2020":{"position":[[138,12]]},"2022":{"position":[[428,12]]},"2032":{"position":[[160,12],[582,12]]},"2038":{"position":[[112,12]]},"2042":{"position":[[106,12]]},"2044":{"position":[[292,12]]},"2046":{"position":[[138,12]]},"2048":{"position":[[237,12]]},"2050":{"position":[[92,12]]},"2052":{"position":[[244,12]]},"2063":{"position":[[206,12],[648,12],[1044,12]]},"2075":{"position":[[248,12]]},"2079":{"position":[[642,12]]},"2113":{"position":[[493,12]]},"2115":{"position":[[406,12]]}}}],["app.get(\"/:foo",{"_index":105,"t":{"1916":{"position":[[1115,16]]}}}],["app.get(\"/:nam",{"_index":179,"t":{"1920":{"position":[[1016,18]]}}}],["app.get(\"/:valu",{"_index":174,"t":{"1920":{"position":[[823,18]]}}}],["app.get(\"/about",{"_index":1143,"t":{"2075":{"position":[[352,17]]}}}],["app.get(\"/admin",{"_index":779,"t":{"1998":{"position":[[348,17]]}}}],["app.get(\"/api",{"_index":185,"t":{"1920":{"position":[[1229,17]]}}}],["app.get(\"/api/list",{"_index":411,"t":{"1933":{"position":[[1139,20]]}}}],["app.get(\"/api/us",{"_index":689,"t":{"1972":{"position":[[265,20]]}}}],["app.get(\"/bodylimit",{"_index":552,"t":{"1952":{"position":[[111,21]]}}}],["app.get(\"/coffe",{"_index":875,"t":{"2022":{"position":[[247,18]]}}}],["app.get(\"/delet",{"_index":635,"t":{"1960":{"position":[[830,18]]}}}],["app.get(\"/flights/:from",{"_index":1171,"t":{"2077":{"position":[[1037,23]]}}}],["app.get(\"/hello/:nam",{"_index":896,"t":{"2026":{"position":[[236,23]]}}}],["app.get(\"/john",{"_index":431,"t":{"1937":{"position":[[123,16]]}}}],["app.get(\"/json",{"_index":747,"t":{"1992":{"position":[[212,16]]}}}],["app.get(\"/not",{"_index":922,"t":{"2034":{"position":[[256,13]]},"2036":{"position":[[197,13]]}}}],["app.get(\"/plantae/:genus.:speci",{"_index":1164,"t":{"2077":{"position":[[877,35]]}}}],["app.get(\"/random.txt",{"_index":1146,"t":{"2075":{"position":[[467,22]]}}}],["app.get(\"/set",{"_index":626,"t":{"1960":{"position":[[652,15]]}}}],["app.get(\"/teapot",{"_index":877,"t":{"2022":{"position":[[312,18]]}}}],["app.get(\"/us",{"_index":835,"t":{"2012":{"position":[[198,17]]},"2077":{"position":[[534,18]]}}}],["app.get(\"/user/:nam",{"_index":827,"t":{"2010":{"position":[[317,22]]},"2077":{"position":[[621,23]]}}}],["app.get(\"/user/:name/books/:titl",{"_index":1152,"t":{"2077":{"position":[[409,35]]}}}],["app.get(\"/v1/us",{"_index":433,"t":{"1937":{"position":[[180,20]]}}}],["app.get(path",{"_index":390,"t":{"1933":{"position":[[305,12]]}}}],["app.group(\"/api",{"_index":416,"t":{"1935":{"position":[[164,17]]},"2070":{"position":[[107,17],[499,17]]},"2072":{"position":[[159,17]]},"2081":{"position":[[110,17]]}}}],["app.group(prefix",{"_index":415,"t":{"1935":{"position":[[60,16]]}}}],["app.head(\"/xhr",{"_index":435,"t":{"1937":{"position":[[240,16]]}}}],["app.head(path",{"_index":393,"t":{"1933":{"position":[[462,13]]}}}],["app.listen(\"127.0.0.1:8080",{"_index":454,"t":{"1939":{"position":[[343,28]]}}}],["app.listen(\"8080",{"_index":452,"t":{"1939":{"position":[[304,18]]}}}],["app.listen(\":8080",{"_index":453,"t":{"1939":{"position":[[323,19]]}}}],["app.listen(\"[::1]:8080",{"_index":455,"t":{"1939":{"position":[[372,24]]}}}],["app.listen(1337",{"_index":693,"t":{"1972":{"position":[[575,16]]}}}],["app.listen(3000",{"_index":132,"t":{"1918":{"position":[[229,16]]},"1927":{"position":[[249,16]]},"1929":{"position":[[239,16],[537,16]]},"1935":{"position":[[449,16]]},"2070":{"position":[[393,16],[757,16]]},"2072":{"position":[[372,16]]},"2081":{"position":[[396,16]]},"2115":{"position":[[530,16]]}}}],["app.listen(443",{"_index":465,"t":{"1939":{"position":[[607,15]]}}}],["app.listen(8080",{"_index":202,"t":{"1922":{"position":[[296,16]]},"1939":{"position":[[287,16]]}}}],["app.listen(address",{"_index":448,"t":{"1939":{"position":[[220,18]]}}}],["app.listener(ln",{"_index":467,"t":{"1941":{"position":[[72,15],[262,16]]}}}],["app.method(path",{"_index":162,"t":{"1920":{"position":[[360,15]]}}}],["app.options(path",{"_index":398,"t":{"1933":{"position":[[734,16]]}}}],["app.patch(path",{"_index":394,"t":{"1933":{"position":[[515,14]]}}}],["app.post",{"_index":567,"t":{"1956":{"position":[[111,13]]},"1958":{"position":[[463,13]]},"1976":{"position":[[166,13]]},"1978":{"position":[[140,13]]},"2000":{"position":[[114,13]]},"2002":{"position":[[210,13]]},"2004":{"position":[[228,13]]},"2018":{"position":[[286,13]]},"2028":{"position":[[119,13]]}}}],["app.post(\"/api/regist",{"_index":413,"t":{"1933":{"position":[[1213,25]]},"1972":{"position":[[162,25]]}}}],["app.post(\"/regist",{"_index":432,"t":{"1937":{"position":[[149,21]]}}}],["app.post(path",{"_index":392,"t":{"1933":{"position":[[409,13]]}}}],["app.put(\"/api/upd",{"_index":690,"t":{"1972":{"position":[[363,22]]}}}],["app.put(\"/user/:id",{"_index":434,"t":{"1937":{"position":[[210,20]]}}}],["app.put(path",{"_index":391,"t":{"1933":{"position":[[357,12]]}}}],["app.settings.casesensit",{"_index":223,"t":{"1929":{"position":[[426,26]]}}}],["app.settings.errorhandl",{"_index":1106,"t":{"2065":{"position":[[243,25]]},"2067":{"position":[[38,25],[561,25]]},"2106":{"position":[[71,25],[105,25]]}}}],["app.settings.prefork",{"_index":222,"t":{"1929":{"position":[[398,20]]}}}],["app.settings.serverhead",{"_index":225,"t":{"1929":{"position":[[494,25]]}}}],["app.settings.strictrout",{"_index":224,"t":{"1929":{"position":[[460,26]]}}}],["app.stack",{"_index":430,"t":{"1937":{"position":[[56,11]]}}}],["app.stat",{"_index":201,"t":{"1922":{"position":[[268,15]]},"1931":{"position":[[327,15],[598,15],[667,15],[2021,15]]}}}],["app.static(\"/stat",{"_index":364,"t":{"1931":{"position":[[1001,21]]}}}],["app.static(prefix",{"_index":197,"t":{"1922":{"position":[[148,18]]},"1931":{"position":[[183,18]]}}}],["app.test(req",{"_index":481,"t":{"1943":{"position":[[259,12],[674,13]]}}}],["app.trace(path",{"_index":395,"t":{"1933":{"position":[[569,14]]}}}],["app.use(\"/api",{"_index":407,"t":{"1933":{"position":[[1046,15]]},"1972":{"position":[[463,15]]}}}],["app.use(func(c",{"_index":776,"t":{"1998":{"position":[[281,14]]},"2079":{"position":[[246,14]]},"2104":{"position":[[403,14]]}}}],["app.use(handl",{"_index":405,"t":{"1933":{"position":[[945,16]]},"1937":{"position":[[106,16]]}}}],["app.use(limiter.new(limiter.config",{"_index":1070,"t":{"2058":{"position":[[477,35]]}}}],["app.use(middleware.compress",{"_index":1060,"t":{"2056":{"position":[[643,30]]}}}],["app.use(middleware.compress(2",{"_index":1061,"t":{"2056":{"position":[[712,31]]}}}],["app.use(middleware.compress(func(c",{"_index":1062,"t":{"2056":{"position":[[794,34]]}}}],["app.use(middleware.compress(middleware.compressconfig",{"_index":1064,"t":{"2056":{"position":[[912,54]]}}}],["app.use(middleware.logger(middleware.loggerconfig",{"_index":1077,"t":{"2058":{"position":[[823,50]]}}}],["app.use(middleware.recov",{"_index":1086,"t":{"2063":{"position":[[618,29]]}}}],["app.use(prefix",{"_index":406,"t":{"1933":{"position":[[984,14]]}}}],["appear",{"_index":668,"t":{"1968":{"position":[[197,7]]}}}],["append",{"_index":457,"t":{"1939":{"position":[[425,6]]},"1948":{"position":[[0,7]]},"2032":{"position":[[84,6]]},"2048":{"position":[[67,6]]},"2050":{"position":[[0,7]]}}}],["append(error",{"_index":1215,"t":{"2084":{"position":[[1018,14]]}}}],["appli",{"_index":1187,"t":{"2079":{"position":[[777,5]]}}}],["applic",{"_index":142,"t":{"1920":{"position":[[37,11]]},"1929":{"position":[[13,11]]},"1943":{"position":[[13,11]]},"1952":{"position":[[58,11]]},"2044":{"position":[[76,11]]},"2058":{"position":[[31,12]]},"2087":{"position":[[58,11]]},"2102":{"position":[[88,11],[229,11]]}}}],["application/json",{"_index":508,"t":{"1946":{"position":[[323,16],[509,18]]},"1958":{"position":[[148,16],[710,17]]},"1972":{"position":[[522,19]]},"1974":{"position":[[417,16]]},"1992":{"position":[[99,17],[409,16],[589,16]]},"2046":{"position":[[260,18]]},"2084":{"position":[[1386,17]]}}}],["application/pdf",{"_index":812,"t":{"2004":{"position":[[705,17]]},"2028":{"position":[[504,17]]}}}],["application/x",{"_index":575,"t":{"1958":{"position":[[181,13],[947,13]]}}}],["application/xml",{"_index":574,"t":{"1958":{"position":[[165,15],[823,16]]}}}],["argument",{"_index":480,"t":{"1943":{"position":[[239,9]]}}}],["array",{"_index":732,"t":{"1988":{"position":[[11,5]]}}}],["articl",{"_index":209,"t":{"1924":{"position":[[92,7]]}}}],["ascii",{"_index":302,"t":{"1929":{"position":[[2323,5]]}}}],["asia/chongq",{"_index":1081,"t":{"2058":{"position":[[945,17]]}}}],["assert",{"_index":910,"t":{"2032":{"position":[[436,10]]}}}],["asset",{"_index":358,"t":{"1931":{"position":[[777,7]]}}}],["assumpt",{"_index":1330,"t":{"2102":{"position":[[177,11]]}}}],["attach",{"_index":543,"t":{"1950":{"position":[[59,11],[194,10],[273,11]]},"1968":{"position":[[35,11]]}}}],["auth",{"_index":1007,"t":{"2054":{"position":[[1059,4],[1457,4],[1494,4]]}}}],["authent",{"_index":1008,"t":{"2054":{"position":[[1098,15],[1531,15]]}}}],["avail",{"_index":102,"t":{"1916":{"position":[[1075,9]]},"1998":{"position":[[73,9]]},"2087":{"position":[[404,9]]}}}],["averag",{"_index":1278,"t":{"2089":{"position":[[425,7],[499,7]]},"2091":{"position":[[50,7],[129,7]]},"2093":{"position":[[50,7],[129,7]]},"2095":{"position":[[51,7],[130,7]]},"2097":{"position":[[53,7],[133,7]]}}}],["b",{"_index":861,"t":{"2020":{"position":[[172,1]]}}}],["b.type",{"_index":863,"t":{"2020":{"position":[[194,6]]}}}],["back",{"_index":257,"t":{"1929":{"position":[[1348,4]]}}}],["backward",{"_index":1036,"t":{"2054":{"position":[[1790,8]]}}}],["base",{"_index":501,"t":{"1946":{"position":[[74,5]]},"1954":{"position":[[12,4]]},"1958":{"position":[[114,5]]},"2034":{"position":[[89,5]]},"2054":{"position":[[1525,5],[1743,5],[2053,5]]},"2075":{"position":[[168,5]]}}}],["basic",{"_index":1006,"t":{"2054":{"position":[[1053,5],[1092,5]]}}}],["befor",{"_index":258,"t":{"1929":{"position":[[1353,6],[2960,6]]}}}],["beggin",{"_index":401,"t":{"1933":{"position":[[871,9]]}}}],["begin",{"_index":941,"t":{"2044":{"position":[[164,9]]},"2079":{"position":[[811,5]]}}}],["behavior",{"_index":1341,"t":{"2104":{"position":[[105,8]]}}}],["belong",{"_index":1132,"t":{"2070":{"position":[[46,6]]}}}],["below",{"_index":70,"t":{"1916":{"position":[[467,5]]},"1918":{"position":[[9,5]]},"1931":{"position":[[986,6]]},"1960":{"position":[[589,5]]},"2063":{"position":[[481,6]]},"2084":{"position":[[263,6]]},"2099":{"position":[[510,6],[653,6]]},"2104":{"position":[[341,6]]}}}],["benchmark",{"_index":1301,"t":{"2099":{"position":[[49,9]]}}}],["better",{"_index":1315,"t":{"2099":{"position":[[346,7],[457,7]]}}}],["big",{"_index":343,"t":{"1929":{"position":[[3424,3]]}}}],["binari",{"_index":794,"t":{"2004":{"position":[[52,6]]}}}],["bind",{"_index":440,"t":{"1939":{"position":[[0,5]]},"1958":{"position":[[0,5]]},"2113":{"position":[[479,7]]}}}],["bit",{"_index":370,"t":{"1931":{"position":[[1207,3]]}}}],["bodi",{"_index":266,"t":{"1929":{"position":[[1527,5],[2868,5]]},"1943":{"position":[[746,5]]},"1956":{"position":[[20,5],[157,4]]},"1958":{"position":[[18,4]]},"1990":{"position":[[174,5]]},"2032":{"position":[[23,5],[38,4]]},"2036":{"position":[[59,5],[81,4]]},"2050":{"position":[[30,4]]},"2115":{"position":[[565,6],[592,7]]}}}],["bodylimit",{"_index":262,"t":{"1929":{"position":[[1469,9]]},"1952":{"position":[[154,9]]}}}],["bodypars",{"_index":571,"t":{"1958":{"position":[[36,10]]},"2018":{"position":[[26,11]]}}}],["boilerpl",{"_index":1337,"t":{"2102":{"position":[[417,11]]}}}],["bool",{"_index":230,"t":{"1929":{"position":[[614,4],[860,4],[1003,4],[1124,4],[1298,4],[1877,4],[2025,4],[2144,4],[2268,4],[2387,4],[2476,4]]},"1931":{"position":[[1730,4],[1825,4],[1901,4]]},"1964":{"position":[[136,4],[150,4]]},"1990":{"position":[[223,4]]},"2030":{"position":[[91,4]]},"2034":{"position":[[233,8]]},"2052":{"position":[[195,4]]},"2056":{"position":[[366,4],[841,4],[992,4]]},"2058":{"position":[[280,4],[562,4],[585,4],[989,4],[1012,4]]},"2084":{"position":[[483,4]]}}}],["boolean",{"_index":898,"t":{"2030":{"position":[[2,7]]},"2052":{"position":[[2,7]]}}}],["both",{"_index":308,"t":{"1929":{"position":[[2529,4]]}}}],["bottom",{"_index":1345,"t":{"2104":{"position":[[321,6]]}}}],["boundari",{"_index":645,"t":{"1962":{"position":[[100,11]]}}}],["br",{"_index":535,"t":{"1946":{"position":[[890,5]]}}}],["brotli",{"_index":975,"t":{"2054":{"position":[[198,6]]},"2056":{"position":[[396,7]]}}}],["brotlicompress",{"_index":1048,"t":{"2056":{"position":[[59,18]]}}}],["brows",{"_index":135,"t":{"1918":{"position":[[265,6]]},"1931":{"position":[[1850,9],[1894,6],[2096,7]]}}}],["browser",{"_index":616,"t":{"1960":{"position":[[340,8]]},"1968":{"position":[[58,8],[212,7]]}}}],["buffer",{"_index":87,"t":{"1916":{"position":[[691,6]]},"1929":{"position":[[3246,6],[3337,6],[3478,6]]}}}],["build",{"_index":5,"t":{"1912":{"position":[[43,5]]},"1924":{"position":[[31,5],[103,8]]},"2102":{"position":[[439,8]]}}}],["built",{"_index":1040,"t":{"2054":{"position":[[1909,5]]}}}],["builtin",{"_index":88,"t":{"1916":{"position":[[713,8]]}}}],["byte",{"_index":380,"t":{"1931":{"position":[[1746,4]]},"2020":{"position":[[204,7]]},"2032":{"position":[[507,7]]}}}],["byte(\"get",{"_index":680,"t":{"1970":{"position":[[225,13]]}}}],["byterang",{"_index":382,"t":{"1931":{"position":[[1815,9],[2079,10]]}}}],["bytes=500",{"_index":858,"t":{"2020":{"position":[[115,9]]}}}],["c",{"_index":687,"t":{"1972":{"position":[[193,2],[291,2],[391,2]]},"2058":{"position":[[547,2],[974,2]]}}}],["c.accepts(\"application/json",{"_index":515,"t":{"1946":{"position":[[476,29]]}}}],["c.accepts(\"html",{"_index":509,"t":{"1946":{"position":[[374,17]]}}}],["c.accepts(\"image/png",{"_index":516,"t":{"1946":{"position":[[528,22]]}}}],["c.accepts(\"json",{"_index":513,"t":{"1946":{"position":[[440,17]]}}}],["c.accepts(\"png",{"_index":517,"t":{"1946":{"position":[[557,16]]}}}],["c.accepts(\"text/html",{"_index":511,"t":{"1946":{"position":[[402,22]]}}}],["c.accepts(typ",{"_index":503,"t":{"1946":{"position":[[127,15]]}}}],["c.acceptscharsets(\"utf",{"_index":532,"t":{"1946":{"position":[[801,22]]}}}],["c.acceptscharsets(charset",{"_index":504,"t":{"1946":{"position":[[161,26]]}}}],["c.acceptsencodings(\"compress",{"_index":534,"t":{"1946":{"position":[[859,30]]}}}],["c.acceptsencodings(encod",{"_index":505,"t":{"1946":{"position":[[206,28]]}}}],["c.acceptslanguages(\"pt",{"_index":536,"t":{"1946":{"position":[[910,24]]}}}],["c.acceptslanguages(lang",{"_index":506,"t":{"1946":{"position":[[253,24]]}}}],["c.app",{"_index":551,"t":{"1952":{"position":[[90,7]]}}}],["c.app().settings.bodylimit",{"_index":553,"t":{"1952":{"position":[[167,26]]}}}],["c.append(\"link",{"_index":539,"t":{"1948":{"position":[[239,16],[345,16]]}}}],["c.append(field",{"_index":538,"t":{"1948":{"position":[[163,15]]}}}],["c.attach",{"_index":545,"t":{"1950":{"position":[[152,14]]}}}],["c.attachment(\"./upload/images/logo.png",{"_index":546,"t":{"1950":{"position":[[205,40]]}}}],["c.attachment(fil",{"_index":544,"t":{"1950":{"position":[[81,17]]}}}],["c.baseurl",{"_index":558,"t":{"1954":{"position":[[62,11],[165,11]]}}}],["c.bodi",{"_index":561,"t":{"1956":{"position":[[36,8],[181,8]]}}}],["c.bodyparser(out",{"_index":579,"t":{"1958":{"position":[[245,16]]}}}],["c.bodyparser(p",{"_index":592,"t":{"1958":{"position":[[525,16]]}}}],["c.bodyparser(us",{"_index":1219,"t":{"2084":{"position":[[1142,19]]}}}],["c.clearcooki",{"_index":610,"t":{"1960":{"position":[[158,15]]}}}],["c.clearcookie(\"token",{"_index":612,"t":{"1960":{"position":[[268,22]]}}}],["c.clearcookie(\"us",{"_index":611,"t":{"1960":{"position":[[209,21]]}}}],["c.clearcookie(key",{"_index":608,"t":{"1960":{"position":[[64,17]]}}}],["c.context",{"_index":646,"t":{"1962":{"position":[[122,11]]}}}],["c.cookie(&fiber.cooki",{"_index":627,"t":{"1960":{"position":[[689,23],[870,23]]}}}],["c.cookie(*cooki",{"_index":647,"t":{"1964":{"position":[[21,17]]}}}],["c.cookie(cooki",{"_index":657,"t":{"1964":{"position":[[385,16]]}}}],["c.cookies(\"empti",{"_index":662,"t":{"1966":{"position":[[278,18]]}}}],["c.cookies(\"nam",{"_index":661,"t":{"1966":{"position":[[250,17]]}}}],["c.cookies(key",{"_index":659,"t":{"1966":{"position":[[133,13]]}}}],["c.download(\"./files/report",{"_index":672,"t":{"1968":{"position":[[385,26],[515,26]]}}}],["c.download(path",{"_index":671,"t":{"1968":{"position":[[290,16]]}}}],["c.error",{"_index":686,"t":{"1972":{"position":[[105,9]]}}}],["c.fasthttp.request.header.method",{"_index":679,"t":{"1970":{"position":[[184,34]]}}}],["c.fasthttp.response.write([]byte(\"hello",{"_index":681,"t":{"1970":{"position":[[239,40]]}}}],["c.format(\"hello",{"_index":700,"t":{"1974":{"position":[[286,16],[353,16],[434,16]]}}}],["c.format(bodi",{"_index":699,"t":{"1974":{"position":[[195,13]]}}}],["c.formfile(\"docu",{"_index":707,"t":{"1976":{"position":[[260,22]]}}}],["c.formfile(nam",{"_index":705,"t":{"1976":{"position":[[103,15]]}}}],["c.formvalue(\"nam",{"_index":712,"t":{"1978":{"position":[[218,19]]}}}],["c.formvalue(nam",{"_index":711,"t":{"1978":{"position":[[100,16]]}}}],["c.get(\"cont",{"_index":721,"t":{"1982":{"position":[[170,14],[208,14]]}}}],["c.get(\"someth",{"_index":722,"t":{"1982":{"position":[[246,18]]}}}],["c.get(field",{"_index":720,"t":{"1982":{"position":[[101,11]]}}}],["c.hostnam",{"_index":725,"t":{"1984":{"position":[[66,12],[160,12]]}}}],["c.ip",{"_index":730,"t":{"1986":{"position":[[56,6],[112,6]]},"1988":{"position":[[92,7],[197,7]]}}}],["c.is(\".html",{"_index":740,"t":{"1990":{"position":[[333,13]]}}}],["c.is(\"html",{"_index":739,"t":{"1990":{"position":[[312,12]]}}}],["c.is(\"json",{"_index":741,"t":{"1990":{"position":[[355,12]]}}}],["c.is(t",{"_index":737,"t":{"1990":{"position":[[208,6]]}}}],["c.json(&us",{"_index":688,"t":{"1972":{"position":[[220,14],[318,14],[418,14]]}}}],["c.json(data",{"_index":750,"t":{"1992":{"position":[[329,13]]}}}],["c.json(error",{"_index":1221,"t":{"2084":{"position":[[1221,14]]}}}],["c.json(fiber.map",{"_index":752,"t":{"1992":{"position":[[473,17]]},"2072":{"position":[[229,17]]}}}],["c.json(us",{"_index":1222,"t":{"2084":{"position":[[1286,12]]}}}],["c.json(v",{"_index":743,"t":{"1992":{"position":[[127,8]]}}}],["c.jsonp(data",{"_index":758,"t":{"1994":{"position":[[450,13],[509,13]]}}}],["c.jsonp(v",{"_index":757,"t":{"1994":{"position":[[241,9]]}}}],["c.link",{"_index":766,"t":{"1996":{"position":[[168,7]]}}}],["c.links(link",{"_index":765,"t":{"1996":{"position":[[102,12]]}}}],["c.locals(\"us",{"_index":777,"t":{"1998":{"position":[[310,16],[390,16]]}}}],["c.locals(key",{"_index":775,"t":{"1998":{"position":[[218,12]]}}}],["c.location(\"/foo/bar",{"_index":787,"t":{"2000":{"position":[[182,22]]}}}],["c.location(\"http://example.com",{"_index":786,"t":{"2000":{"position":[[149,32]]}}}],["c.location(path",{"_index":785,"t":{"2000":{"position":[[82,15]]}}}],["c.method",{"_index":790,"t":{"2002":{"position":[[245,10]]}}}],["c.method(overrid",{"_index":789,"t":{"2002":{"position":[[166,17]]}}}],["c.multipartform",{"_index":797,"t":{"2004":{"position":[[177,17],[308,18]]},"2028":{"position":[[199,18]]}}}],["c.next",{"_index":410,"t":{"1933":{"position":[[1127,8]]},"1998":{"position":[[336,8]]},"2006":{"position":[[295,8],[367,8]]},"2072":{"position":[[267,8]]},"2079":{"position":[[587,8]]}}}],["c.next(err",{"_index":674,"t":{"1968":{"position":[[438,11],[582,11]]},"1972":{"position":[[248,11],[346,11],[446,11]]},"2006":{"position":[[206,10]]},"2034":{"position":[[355,11],[483,11]]},"2063":{"position":[[297,11],[1105,11],[1192,11]]}}}],["c.originalurl",{"_index":820,"t":{"2008":{"position":[[44,15],[154,15]]}}}],["c.param",{"_index":187,"t":{"1920":{"position":[[1290,14]]}}}],["c.param(\"foo",{"_index":77,"t":{"1916":{"position":[[543,14],[805,14]]}}}],["c.params(\"ag",{"_index":829,"t":{"2010":{"position":[[389,15]]}}}],["c.params(\"from",{"_index":1172,"t":{"2077":{"position":[[1088,16]]}}}],["c.params(\"genu",{"_index":1165,"t":{"2077":{"position":[[934,17]]}}}],["c.params(\"nam",{"_index":180,"t":{"1920":{"position":[[1059,16],[1102,17]]},"2010":{"position":[[361,16]]}}}],["c.params(\"speci",{"_index":1167,"t":{"2077":{"position":[[962,19]]}}}],["c.params(\"to",{"_index":1173,"t":{"2077":{"position":[[1112,14]]}}}],["c.params(\"valu",{"_index":176,"t":{"1920":{"position":[[899,18]]}}}],["c.params(param",{"_index":825,"t":{"2010":{"position":[[218,14]]}}}],["c.path",{"_index":836,"t":{"2012":{"position":[[237,8]]},"2056":{"position":[[855,8],[1006,8]]}}}],["c.path(overrid",{"_index":833,"t":{"2012":{"position":[[114,15]]}}}],["c.protocol",{"_index":837,"t":{"2014":{"position":[[80,12],[168,12]]},"2030":{"position":[[141,12]]}}}],["c.query(\"brand",{"_index":844,"t":{"2016":{"position":[[443,16]]}}}],["c.query(\"empti",{"_index":846,"t":{"2016":{"position":[[470,16]]}}}],["c.query(\"ord",{"_index":842,"t":{"2016":{"position":[[416,16]]}}}],["c.query(paramet",{"_index":840,"t":{"2016":{"position":[[263,17]]}}}],["c.queryparser(out",{"_index":847,"t":{"2018":{"position":[[74,17]]}}}],["c.queryparser(p",{"_index":852,"t":{"2018":{"position":[[348,17]]}}}],["c.range(1000",{"_index":862,"t":{"2020":{"position":[[177,13]]}}}],["c.range(int",{"_index":857,"t":{"2020":{"position":[[79,11]]}}}],["c.redirect(\"../login",{"_index":882,"t":{"2022":{"position":[[485,22]]}}}],["c.redirect(\"/foo/bar",{"_index":881,"t":{"2022":{"position":[[462,22]]}}}],["c.redirect(\"/teapot",{"_index":876,"t":{"2022":{"position":[[287,21]]}}}],["c.redirect(\"http://example.com",{"_index":883,"t":{"2022":{"position":[[508,32],[541,32]]}}}],["c.redirect(path",{"_index":874,"t":{"2022":{"position":[[200,15]]}}}],["c.render(\"index",{"_index":1369,"t":{"2113":{"position":[[540,17]]},"2115":{"position":[[469,17]]}}}],["c.render(fil",{"_index":887,"t":{"2024":{"position":[[209,13]]}}}],["c.rout",{"_index":889,"t":{"2026":{"position":[[44,9],[137,9]]}}}],["c.savefile(fh",{"_index":897,"t":{"2028":{"position":[[61,13]]}}}],["c.savefile(fil",{"_index":708,"t":{"1976":{"position":[[352,16]]},"2004":{"position":[[750,16]]},"2028":{"position":[[549,16]]}}}],["c.secur",{"_index":900,"t":{"2030":{"position":[[80,10]]}}}],["c.send(\"about",{"_index":1144,"t":{"2075":{"position":[[391,15]]}}}],["c.send(\"api",{"_index":186,"t":{"1920":{"position":[[1268,11]]}}}],["c.send(\"get",{"_index":175,"t":{"1920":{"position":[[863,11]]}}}],["c.send(\"hello",{"_index":130,"t":{"1918":{"position":[[202,14]]},"1920":{"position":[[742,14],[1084,13]]},"1943":{"position":[[503,14]]},"2006":{"position":[[439,14]]},"2032":{"position":[[194,14]]},"2036":{"position":[[293,14]]},"2079":{"position":[[676,14]]}}}],["c.send(\"i'm",{"_index":412,"t":{"1933":{"position":[[1181,11],[1260,11]]}}}],["c.send(\"random.txt",{"_index":1147,"t":{"2075":{"position":[[511,20]]}}}],["c.send(\"root",{"_index":1142,"t":{"2075":{"position":[[282,14]]}}}],["c.send(\"wher",{"_index":182,"t":{"1920":{"position":[[1146,13]]}}}],["c.send(123",{"_index":904,"t":{"2032":{"position":[[294,11]]}}}],["c.send([]byte(\"hello",{"_index":903,"t":{"2032":{"position":[[240,21]]}}}],["c.send(bodi",{"_index":902,"t":{"2032":{"position":[[124,11]]}}}],["c.send(bodylimit",{"_index":554,"t":{"1952":{"position":[[194,17]]}}}],["c.send(c.param",{"_index":1155,"t":{"2077":{"position":[[574,21]]}}}],["c.send(c.params(\"nam",{"_index":1156,"t":{"2077":{"position":[[666,24]]}}}],["c.sendbyte([]byte(\"hello",{"_index":918,"t":{"2032":{"position":[[616,25]]}}}],["c.sendbytes(b",{"_index":913,"t":{"2032":{"position":[[493,13]]}}}],["c.sendfile(\"./public/404.html",{"_index":923,"t":{"2034":{"position":[[309,32]]}}}],["c.sendfile(\"./static/index.html",{"_index":925,"t":{"2034":{"position":[[429,33]]}}}],["c.sendfile(\"fil",{"_index":1085,"t":{"2063":{"position":[[247,16]]}}}],["c.sendfile(path",{"_index":921,"t":{"2034":{"position":[[200,15]]}}}],["c.sendstatus(403",{"_index":781,"t":{"1998":{"position":[[467,17]]}}}],["c.sendstatus(415",{"_index":929,"t":{"2036":{"position":[[240,17],[317,17]]}}}],["c.sendstatus(statu",{"_index":928,"t":{"2036":{"position":[[164,19]]}}}],["c.sendstream(bytes.newreader([]byte(\"hello",{"_index":920,"t":{"2032":{"position":[[726,43]]}}}],["c.sendstream(r",{"_index":915,"t":{"2032":{"position":[[538,14]]}}}],["c.sendstring(",{"_index":914,"t":{"2032":{"position":[[515,14]]}}}],["c.sendstring(\"hello",{"_index":919,"t":{"2032":{"position":[[674,20]]}}}],["c.set(\"cont",{"_index":691,"t":{"1972":{"position":[[500,14]]},"2038":{"position":[[146,14]]}}}],["c.set(\"strict",{"_index":1178,"t":{"2079":{"position":[[429,13]]}}}],["c.set(\"x",{"_index":408,"t":{"1933":{"position":[[1083,8]]},"2079":{"position":[[305,8],[348,8],[391,8],[483,8],[522,8]]}}}],["c.set(field",{"_index":933,"t":{"2038":{"position":[[77,12]]}}}],["c.status(200",{"_index":936,"t":{"2042":{"position":[[140,13]]}}}],["c.status(200).send(\"welcom",{"_index":780,"t":{"1998":{"position":[[420,28]]}}}],["c.status(400).send(\"bad",{"_index":937,"t":{"2042":{"position":[[154,23]]}}}],["c.status(404).sendfile(\"./public/gopher.png",{"_index":938,"t":{"2042":{"position":[[188,45]]}}}],["c.status(500).send(c.error",{"_index":692,"t":{"1972":{"position":[[542,29]]}}}],["c.status(500).send(err",{"_index":751,"t":{"1992":{"position":[[356,23],[536,23]]}}}],["c.status(500).sendstring(err.error",{"_index":1348,"t":{"2106":{"position":[[165,37]]}}}],["c.status(fiber.statusnotfound).sendstring(\"sorri",{"_index":1346,"t":{"2104":{"position":[[432,48]]}}}],["c.status(fiber.statusteapot).send",{"_index":878,"t":{"2022":{"position":[[352,37]]}}}],["c.status(statu",{"_index":935,"t":{"2042":{"position":[[77,15]]}}}],["c.subdomain",{"_index":945,"t":{"2044":{"position":[[326,14]]}}}],["c.subdomains(1",{"_index":948,"t":{"2044":{"position":[[364,15]]}}}],["c.subdomains(offset",{"_index":943,"t":{"2044":{"position":[[211,19]]}}}],["c.type(\".html",{"_index":951,"t":{"2046":{"position":[[172,15]]}}}],["c.type(\"html",{"_index":952,"t":{"2046":{"position":[[206,14]]}}}],["c.type(\"json",{"_index":953,"t":{"2046":{"position":[[239,14]]}}}],["c.type(\"png",{"_index":954,"t":{"2046":{"position":[[279,13]]}}}],["c.type(t",{"_index":950,"t":{"2046":{"position":[[106,8]]}}}],["c.vary(\"accept",{"_index":962,"t":{"2048":{"position":[[424,14]]}}}],["c.vary(\"origin",{"_index":958,"t":{"2048":{"position":[[271,16],[376,16]]}}}],["c.vary(\"us",{"_index":959,"t":{"2048":{"position":[[307,12]]}}}],["c.vary(field",{"_index":957,"t":{"2048":{"position":[[205,12]]}}}],["c.write(\"hello",{"_index":964,"t":{"2050":{"position":[[126,15]]}}}],["c.write(123",{"_index":966,"t":{"2050":{"position":[[211,12]]}}}],["c.write([]byte(\"world",{"_index":965,"t":{"2050":{"position":[[161,22]]}}}],["c.write(bodi",{"_index":963,"t":{"2050":{"position":[[55,12]]}}}],["c.write(c.params(\"nam",{"_index":1153,"t":{"2077":{"position":[[466,25]]}}}],["c.write(c.params(\"titl",{"_index":1154,"t":{"2077":{"position":[[492,26]]}}}],["c.xhr",{"_index":971,"t":{"2052":{"position":[[187,7],[278,7]]}}}],["cach",{"_index":355,"t":{"1931":{"position":[[719,5],[1605,7]]}}}],["call",{"_index":214,"t":{"1929":{"position":[[39,7]]},"2006":{"position":[[13,7],[172,4]]},"2054":{"position":[[1117,5]]},"2079":{"position":[[75,6],[146,7]]}}}],["callback",{"_index":169,"t":{"1920":{"position":[[568,8]]},"1994":{"position":[[108,8],[142,8],[166,9],[264,8]]}}}],["callback({\"nam",{"_index":759,"t":{"1994":{"position":[[470,17]]}}}],["can't",{"_index":1347,"t":{"2104":{"position":[[481,5]]}}}],["cancel",{"_index":643,"t":{"1962":{"position":[[51,12]]}}}],["capac",{"_index":1265,"t":{"2089":{"position":[[104,8]]}}}],["capit",{"_index":165,"t":{"1920":{"position":[[471,15]]}}}],["captur",{"_index":1120,"t":{"2067":{"position":[[192,7]]},"2077":{"position":[[57,7]]},"2087":{"position":[[273,8]]},"2104":{"position":[[86,7]]}}}],["carri",{"_index":641,"t":{"1962":{"position":[[29,7]]}}}],["case",{"_index":718,"t":{"1982":{"position":[[73,4]]},"2067":{"position":[[72,6]]},"2099":{"position":[[160,4]]}}}],["casesensit",{"_index":218,"t":{"1929":{"position":[[164,14],[989,13]]}}}],["catch",{"_index":1083,"t":{"2063":{"position":[[36,7],[174,5],[703,7]]}}}],["caus",{"_index":295,"t":{"1929":{"position":[[2047,6],[2167,6]]}}}],["caution",{"_index":23,"t":{"1912":{"position":[[202,7]]},"1916":{"position":[[0,7]]},"1941":{"position":[[128,7]]},"1948":{"position":[[63,7]]},"1960":{"position":[[328,7]]},"2032":{"position":[[63,7]]},"2034":{"position":[[123,7]]},"2058":{"position":[[634,7]]},"2070":{"position":[[776,7]]}}}],["central",{"_index":991,"t":{"2054":{"position":[[573,11]]},"2067":{"position":[[309,11]]}}}],["cer",{"_index":458,"t":{"1939":{"position":[[454,4]]}}}],["chain",{"_index":816,"t":{"2006":{"position":[[159,8]]},"2054":{"position":[[536,5]]},"2079":{"position":[[610,5]]}}}],["chainabl",{"_index":934,"t":{"2042":{"position":[[56,10]]}}}],["chang",{"_index":37,"t":{"1912":{"position":[[345,7]]},"1916":{"position":[[460,6]]},"1929":{"position":[[261,6],[355,6]]},"2079":{"position":[[36,7]]}}}],["charact",{"_index":256,"t":{"1929":{"position":[[1324,10],[1452,10]]},"2077":{"position":[[321,10]]}}}],["charset",{"_index":520,"t":{"1946":{"position":[[656,8]]}}}],["charset=utf",{"_index":738,"t":{"1990":{"position":[[264,11]]}}}],["chat",{"_index":1362,"t":{"2110":{"position":[[144,5]]}}}],["check",{"_index":119,"t":{"1916":{"position":[[1465,5]]},"1924":{"position":[[67,5]]},"1946":{"position":[[0,7]]},"1976":{"position":[[286,5]]},"2065":{"position":[[378,5]]}}}],["cisco",{"_index":1258,"t":{"2087":{"position":[[559,5]]}}}],["cleaner",{"_index":1038,"t":{"2054":{"position":[[1830,7]]}}}],["clear",{"_index":609,"t":{"1960":{"position":[[138,6],[387,5]]}}}],["clearcooki",{"_index":621,"t":{"1960":{"position":[[504,11]]}}}],["client",{"_index":144,"t":{"1920":{"position":[[63,6]]},"1929":{"position":[[1993,6],[3352,7]]},"1960":{"position":[[9,6],[369,7]]},"2052":{"position":[[144,6]]},"2067":{"position":[[375,6]]},"2099":{"position":[[249,7],[596,7]]}}}],["close",{"_index":292,"t":{"1929":{"position":[[1930,5]]}}}],["cloud",{"_index":1235,"t":{"2087":{"position":[[285,5]]}}}],["cluster",{"_index":1133,"t":{"2070":{"position":[[58,8]]}}}],["code",{"_index":198,"t":{"1922":{"position":[[198,4]]},"1931":{"position":[[269,4]]},"2022":{"position":[[131,5]]},"2036":{"position":[[16,4],[129,5]]},"2063":{"position":[[884,4],[999,4]]},"2065":{"position":[[192,4],[335,4],[449,4]]},"2067":{"position":[[653,4],[788,4],[887,6]]}}}],["combin",{"_index":1139,"t":{"2075":{"position":[[13,8]]}}}],["come",{"_index":114,"t":{"1916":{"position":[[1402,5]]},"2067":{"position":[[163,4]]}}}],["command",{"_index":48,"t":{"1914":{"position":[[105,8]]},"1958":{"position":[[667,8]]},"2018":{"position":[[530,7]]},"2084":{"position":[[1343,8]]}}}],["commun",{"_index":1238,"t":{"2087":{"position":[[364,9]]}}}],["comparison",{"_index":1227,"t":{"2087":{"position":[[35,10]]}}}],["compat",{"_index":1037,"t":{"2054":{"position":[[1799,13]]}}}],["compliant",{"_index":617,"t":{"1960":{"position":[[359,9]]}}}],["composit",{"_index":1232,"t":{"2087":{"position":[[179,12]]}}}],["compress",{"_index":283,"t":{"1929":{"position":[[1738,10]]},"1931":{"position":[[1448,10],[1613,10],[1721,8],[2063,9]]},"1946":{"position":[[899,10]]},"2034":{"position":[[224,8],[407,11]]},"2054":{"position":[[133,12],[146,8],[205,12]]},"2056":{"position":[[0,8],[102,11],[374,11],[601,11],[694,11]]},"2058":{"position":[[722,8]]}}}],["compress(opt",{"_index":1050,"t":{"2056":{"position":[[190,16]]}}}],["compress;q=0.2",{"_index":527,"t":{"1946":{"position":[[715,14]]}}}],["compressconfig",{"_index":1052,"t":{"2056":{"position":[[252,14]]}}}],["compressedfilesuffix",{"_index":277,"t":{"1929":{"position":[[1641,20]]}}}],["compresslevelbestcompress",{"_index":1059,"t":{"2056":{"position":[[512,28]]}}}],["compresslevelbestspe",{"_index":1058,"t":{"2056":{"position":[[482,22]]}}}],["compressleveldefault",{"_index":1057,"t":{"2056":{"position":[[454,20],[557,20],[1044,21]]}}}],["compressleveldis",{"_index":1056,"t":{"2056":{"position":[[424,21]]}}}],["concurr",{"_index":286,"t":{"1929":{"position":[[1791,11],[1825,10]]},"2099":{"position":[[237,11],[517,11]]}}}],["config",{"_index":348,"t":{"1931":{"position":[[215,6]]},"1939":{"position":[[438,7],[547,6],[623,7]]},"2056":{"position":[[240,6],[905,6]]}}}],["configur",{"_index":268,"t":{"1929":{"position":[[1557,10]]},"2058":{"position":[[218,13]]},"2087":{"position":[[246,14]]}}}],["connect",{"_index":288,"t":{"1929":{"position":[[1836,12],[1901,12],[1945,11],[3235,10],[3467,10]]},"1939":{"position":[[22,11]]},"2030":{"position":[[43,10]]},"2084":{"position":[[1092,9]]}}}],["contain",{"_index":35,"t":{"1912":{"position":[[327,8]]},"1920":{"position":[[586,10]]},"1972":{"position":[[5,8]]},"2012":{"position":[[0,8]]},"2014":{"position":[[0,8]]},"2016":{"position":[[27,10]]},"2020":{"position":[[9,10]]},"2054":{"position":[[2007,8]]},"2084":{"position":[[238,9]]},"2113":{"position":[[186,8]]}}}],["content",{"_index":299,"t":{"1929":{"position":[[2186,7],[2436,7],[2452,7]]},"1946":{"position":[[39,7]]},"1950":{"position":[[23,7],[173,7],[252,7],[311,7]]},"1958":{"position":[[100,7],[127,7],[695,8],[808,8],[932,8]]},"1968":{"position":[[117,7]]},"1974":{"position":[[9,7]]},"1990":{"position":[[21,7],[61,7],[239,7]]},"1992":{"position":[[81,7],[395,7],[575,7]]},"2034":{"position":[[49,7]]},"2038":{"position":[[188,8]]},"2046":{"position":[[9,7]]},"2079":{"position":[[357,7]]},"2084":{"position":[[1371,8]]}}}],["context",{"_index":62,"t":{"1916":{"position":[[257,7],[408,7],[1328,7]]},"1920":{"position":[[601,7]]},"1929":{"position":[[1166,7],[1385,8]]}}}],["context.context",{"_index":640,"t":{"1962":{"position":[[8,15],[134,15]]}}}],["continu",{"_index":1138,"t":{"2072":{"position":[[109,9]]}}}],["contribut",{"_index":1239,"t":{"2087":{"position":[[374,11]]}}}],["control",{"_index":371,"t":{"1931":{"position":[[1216,7]]},"2054":{"position":[[558,7]]},"2079":{"position":[[544,9]]}}}],["convert",{"_index":254,"t":{"1929":{"position":[[1303,8]]},"1992":{"position":[[0,8]]},"2054":{"position":[[971,9]]}}}],["cooki",{"_index":344,"t":{"1929":{"position":[[3428,9]]},"1960":{"position":[[16,6],[31,7],[149,8],[193,6],[250,7],[397,6],[466,7],[625,6]]},"1964":{"position":[[4,6],[44,6],[246,6],[253,6],[378,6]]},"1966":{"position":[[4,6],[95,6],[235,6]]}}}],["cookie.expir",{"_index":656,"t":{"1964":{"position":[[323,14]]}}}],["cookie.nam",{"_index":654,"t":{"1964":{"position":[[281,11]]}}}],["cookie.valu",{"_index":655,"t":{"1964":{"position":[[302,12]]}}}],["copi",{"_index":85,"t":{"1916":{"position":[[664,6],[708,4]]},"1956":{"position":[[289,6]]},"1966":{"position":[[399,6]]},"1978":{"position":[[356,6]]},"1982":{"position":[[357,6]]},"1984":{"position":[[275,6]]},"2008":{"position":[[281,6]]},"2010":{"position":[[505,6]]},"2016":{"position":[[591,6]]}}}],["copy(newbuff",{"_index":93,"t":{"1916":{"position":[[902,15]]}}}],["cor",{"_index":1018,"t":{"2054":{"position":[[1269,6]]},"2070":{"position":[[125,7]]},"2081":{"position":[[128,7]]}}}],["core",{"_index":1245,"t":{"2087":{"position":[[460,5]]}}}],["correct",{"_index":926,"t":{"2036":{"position":[[29,7]]},"2084":{"position":[[60,7]]}}}],["correspond",{"_index":788,"t":{"2002":{"position":[[17,13]]},"2022":{"position":[[101,11]]}}}],["cost",{"_index":115,"t":{"1916":{"position":[[1415,4]]}}}],["cours",{"_index":113,"t":{"1916":{"position":[[1389,7]]}}}],["cpu",{"_index":378,"t":{"1931":{"position":[[1592,3]]},"2087":{"position":[[493,3]]},"2099":{"position":[[59,3],[90,3]]}}}],["crc",{"_index":312,"t":{"1929":{"position":[[2600,4]]}}}],["creat",{"_index":97,"t":{"1916":{"position":[[1006,7]]},"1918":{"position":[[80,7]]},"1927":{"position":[[12,7],[82,8]]},"1929":{"position":[[91,8],[377,8]]},"1935":{"position":[[24,8]]},"1943":{"position":[[75,8],[340,6]]},"1948":{"position":[[108,7]]},"1960":{"position":[[453,8]]},"1964":{"position":[[239,6]]},"1992":{"position":[[253,6]]},"1994":{"position":[[384,6]]},"2054":{"position":[[1821,8]]}}}],["credenti",{"_index":1009,"t":{"2054":{"position":[[1150,11],[1206,12]]}}}],["credit",{"_index":978,"t":{"2054":{"position":[[285,7]]}}}],["cross",{"_index":1015,"t":{"2054":{"position":[[1239,5]]}}}],["csrf",{"_index":1022,"t":{"2054":{"position":[[1324,4]]}}}],["css",{"_index":193,"t":{"1922":{"position":[[38,4]]},"1931":{"position":[[60,3]]}}}],["ctx",{"_index":485,"t":{"1943":{"position":[[399,5]]}}}],["ctx.next",{"_index":1089,"t":{"2063":{"position":[[774,10]]}}}],["ctx.render",{"_index":1368,"t":{"2113":{"position":[[424,12]]}}}],["ctx.set(fiber.headercontenttyp",{"_index":1115,"t":{"2065":{"position":[[489,32]]}}}],["ctx.status(500).sendstring(\"intern",{"_index":1130,"t":{"2067":{"position":[[910,36]]}}}],["ctx.status(code).sendfile(fmt.sprintf(\"./%d.html",{"_index":1129,"t":{"2067":{"position":[[836,50]]}}}],["ctx.status(code).sendstring(err.error",{"_index":1117,"t":{"2065":{"position":[[554,40]]}}}],["curl",{"_index":562,"t":{"1956":{"position":[[63,4]]},"1958":{"position":[[662,4],[679,4],[792,4],[916,4],[1028,4],[1091,4]]},"2018":{"position":[[525,4],[541,4]]},"2084":{"position":[[1338,4],[1355,4]]}}}],["current",{"_index":814,"t":{"2006":{"position":[[79,7]]},"2048":{"position":[[143,7]]},"2079":{"position":[[198,7]]},"2108":{"position":[[6,9]]}}}],["custom",{"_index":98,"t":{"1916":{"position":[[1016,6]]},"1933":{"position":[[1092,6]]},"1943":{"position":[[477,6],[624,6]]},"2056":{"position":[[687,6]]},"2063":{"position":[[835,6]]},"2067":{"position":[[2,6],[138,6],[347,10],[540,6],[709,6],[812,6]]},"2106":{"position":[[49,6]]}}}],["customfunc",{"_index":760,"t":{"1994":{"position":[[523,13]]}}}],["customfunc({\"nam",{"_index":761,"t":{"1994":{"position":[[543,19]]}}}],["d",{"_index":565,"t":{"1956":{"position":[[99,1]]}}}],["data",{"_index":436,"t":{"1937":{"position":[[266,5]]},"1958":{"position":[[230,4],[730,4],[842,4],[984,4]]},"1992":{"position":[[260,4],[273,4]]},"1994":{"position":[[391,4],[404,4]]},"1998":{"position":[[179,4]]},"2024":{"position":[[20,4],[231,4]]},"2084":{"position":[[82,4],[1406,4]]},"2113":{"position":[[487,5]]}}}],["databas",{"_index":1217,"t":{"2084":{"position":[[1105,8]]},"2087":{"position":[[137,8]]}}}],["date",{"_index":296,"t":{"1929":{"position":[[2066,4]]},"1960":{"position":[[923,4]]}}}],["deactiv",{"_index":1068,"t":{"2058":{"position":[[346,12]]}}}],["deadlin",{"_index":642,"t":{"1962":{"position":[[39,9]]}}}],["debug",{"_index":474,"t":{"1943":{"position":[[119,5]]}}}],["decod",{"_index":572,"t":{"1958":{"position":[[56,8]]}}}],["dedic",{"_index":1257,"t":{"2087":{"position":[[549,9]]},"2106":{"position":[[215,9]]}}}],["default",{"_index":55,"t":{"1916":{"position":[[65,7],[174,7]]},"1929":{"position":[[598,7],[1200,8],[2058,7],[2178,7],[2395,7],[2629,7],[2878,7],[3006,7]]},"1931":{"position":[[88,8],[1701,7],[1795,7],[1873,7],[1970,7]]},"1943":{"position":[[149,7]]},"1966":{"position":[[52,7]]},"1968":{"position":[[104,8],[243,7]]},"1994":{"position":[[129,8]]},"2010":{"position":[[75,7],[149,8]]},"2016":{"position":[[122,7]]},"2022":{"position":[[167,8]]},"2024":{"position":[[60,7],[84,7]]},"2034":{"position":[[154,8]]},"2044":{"position":[[121,8]]},"2054":{"position":[[48,8]]},"2056":{"position":[[331,8],[548,8],[626,7]]},"2058":{"position":[[701,7]]},"2063":{"position":[[369,8],[977,7]]},"2065":{"position":[[35,8],[221,7],[319,8]]},"2067":{"position":[[83,7],[637,8]]},"2106":{"position":[[16,7]]}}}],["defaultvalu",{"_index":660,"t":{"1966":{"position":[[155,12]]},"2010":{"position":[[241,12]]},"2016":{"position":[[289,12]]}}}],["defin",{"_index":1053,"t":{"2056":{"position":[[284,7]]},"2075":{"position":[[45,6]]},"2077":{"position":[[359,6]]}}}],["definit",{"_index":157,"t":{"1920":{"position":[[295,10]]},"2102":{"position":[[12,10]]}}}],["deflat",{"_index":974,"t":{"2054":{"position":[[180,8]]},"2056":{"position":[[41,8],[413,7]]}}}],["delet",{"_index":625,"t":{"1960":{"position":[[635,8]]}}}],["demonstr",{"_index":1264,"t":{"2089":{"position":[[88,11]]}}}],["depend",{"_index":444,"t":{"1939":{"position":[[151,9]]},"2056":{"position":[[121,9]]},"2099":{"position":[[660,10]]},"2102":{"position":[[59,7]]}}}],["deriv",{"_index":724,"t":{"1984":{"position":[[21,7]]},"2022":{"position":[[21,7]]}}}],["desc",{"_index":843,"t":{"2016":{"position":[[436,6]]}}}],["descript",{"_index":229,"t":{"1929":{"position":[[586,11]]},"2054":{"position":[[1847,11]]},"2084":{"position":[[187,12]]}}}],["design",{"_index":12,"t":{"1912":{"position":[[101,8],[383,7]]},"2079":{"position":[[19,8]]},"2089":{"position":[[76,8]]}}}],["detail",{"_index":1193,"t":{"2084":{"position":[[178,8],[270,8]]}}}],["determin",{"_index":141,"t":{"1920":{"position":[[18,11]]},"2044":{"position":[[148,11]]}}}],["develop",{"_index":17,"t":{"1912":{"position":[[137,11]]}}}],["dialog",{"_index":669,"t":{"1968":{"position":[[220,8]]}}}],["differ",{"_index":247,"t":{"1929":{"position":[[915,10],[1040,9]]},"1931":{"position":[[1498,11]]},"2067":{"position":[[200,9],[483,9]]},"2110":{"position":[[64,9]]}}}],["directori",{"_index":196,"t":{"1922":{"position":[[110,9],[223,9],[366,10]]},"1931":{"position":[[162,10],[294,9],[500,12],[587,10],[656,10],[966,10],[1840,9],[1941,9]]},"1976":{"position":[[341,10]]},"2102":{"position":[[302,9]]}}}],["disabl",{"_index":249,"t":{"1929":{"position":[[1063,9],[1882,7],[2491,7]]},"1943":{"position":[[189,7]]},"2034":{"position":[[181,8]]}}}],["disabledefaultcontenttyp",{"_index":298,"t":{"1929":{"position":[[2118,25]]}}}],["disabledefaultd",{"_index":294,"t":{"1929":{"position":[[2006,18]]}}}],["disableheadernorm",{"_index":304,"t":{"1929":{"position":[[2362,24]]}}}],["disablekeepal",{"_index":290,"t":{"1929":{"position":[[1860,16]]}}}],["disablestartupmessag",{"_index":300,"t":{"1929":{"position":[[2246,21]]}}}],["discord",{"_index":1358,"t":{"2110":{"position":[[21,7]]}}}],["disk",{"_index":813,"t":{"2004":{"position":[[744,5]]},"2028":{"position":[[45,5],[543,5]]}}}],["display",{"_index":1127,"t":{"2067":{"position":[[459,7]]}}}],["disposit",{"_index":542,"t":{"1950":{"position":[[31,11],[181,12],[260,12]]},"1968":{"position":[[125,11]]}}}],["django",{"_index":1352,"t":{"2108":{"position":[[90,6]]},"2115":{"position":[[108,6]]}}}],["dn",{"_index":1183,"t":{"2079":{"position":[[531,3]]}}}],["doc",{"_index":24,"t":{"1912":{"position":[[216,4],[267,4]]},"2084":{"position":[[279,4]]}}}],["doctyp",{"_index":1375,"t":{"2115":{"position":[[549,9]]}}}],["document",{"_index":678,"t":{"1970":{"position":[[106,13]]},"1976":{"position":[[235,11]]},"2004":{"position":[[476,11]]},"2028":{"position":[[275,11]]}}}],["doe",{"_index":595,"t":{"1958":{"position":[[623,3]]},"1964":{"position":[[317,5]]},"1966":{"position":[[297,6],[307,5]]},"2018":{"position":[[447,3]]}}}],["doesn't",{"_index":824,"t":{"2010":{"position":[[193,7]]},"2032":{"position":[[76,7]]}}}],["domain",{"_index":648,"t":{"1964":{"position":[[97,6]]},"2044":{"position":[[44,6]]}}}],["don't",{"_index":909,"t":{"2032":{"position":[[420,5]]}}}],["done",{"_index":46,"t":{"1914":{"position":[[83,4]]},"1943":{"position":[[28,4]]}}}],["dontcompress",{"_index":1063,"t":{"2056":{"position":[[867,15],[1018,15]]}}}],["dot",{"_index":1158,"t":{"2077":{"position":[[728,3]]}}}],["download",{"_index":41,"t":{"1914":{"position":[[14,8]]},"1968":{"position":[[91,9],[479,8],[623,8]]},"2079":{"position":[[400,8]]}}}],["duplic",{"_index":961,"t":{"2048":{"position":[[365,10]]}}}],["durat",{"_index":331,"t":{"1929":{"position":[[2951,8]]}}}],["e",{"_index":1111,"t":{"2065":{"position":[[415,2]]},"2067":{"position":[[754,2]]}}}],["e.cod",{"_index":1114,"t":{"2065":{"position":[[456,6]]},"2067":{"position":[[795,6]]}}}],["e.g",{"_index":1123,"t":{"2067":{"position":[[254,5],[382,5]]}}}],["each",{"_index":153,"t":{"1920":{"position":[[197,4]]},"1933":{"position":[[884,4]]},"2016":{"position":[[53,4]]},"2087":{"position":[[192,4]]}}}],["eas",{"_index":13,"t":{"1912":{"position":[[113,4]]}}}],["easili",{"_index":549,"t":{"1952":{"position":[[40,6]]}}}],["echo",{"_index":1131,"t":{"2067":{"position":[[988,4]]}}}],["element",{"_index":1208,"t":{"2084":{"position":[[891,7],[1033,9]]}}}],["element.failedfield",{"_index":1209,"t":{"2084":{"position":[[913,19]]}}}],["element.tag",{"_index":1211,"t":{"2084":{"position":[[957,11]]}}}],["element.valu",{"_index":1213,"t":{"2084":{"position":[[981,13]]}}}],["email",{"_index":1125,"t":{"2067":{"position":[[280,5]]},"2084":{"position":[[527,5]]}}}],["embed",{"_index":122,"t":{"1918":{"position":[[0,8]]}}}],["empti",{"_index":607,"t":{"1960":{"position":[[47,6]]},"2010":{"position":[[161,5]]},"2016":{"position":[[239,5]]},"2036":{"position":[[89,6]]},"2063":{"position":[[962,6]]}}}],["en;q=0.8",{"_index":529,"t":{"1946":{"position":[[750,9]]}}}],["enabl",{"_index":231,"t":{"1929":{"position":[[619,7],[790,7],[870,8],[1013,8],[1134,8],[2481,6],[2642,8],[3141,8]]},"1931":{"position":[[1314,6],[1738,7],[1833,6]]},"1939":{"position":[[400,6]]},"2034":{"position":[[400,6]]},"2054":{"position":[[1232,6]]},"2099":{"position":[[471,6],[614,6]]}}}],["encod",{"_index":255,"t":{"1929":{"position":[[1316,7]]},"1946":{"position":[[699,9]]},"2048":{"position":[[439,10],[499,9]]}}}],["encodingvalu",{"_index":1049,"t":{"2056":{"position":[[160,14]]}}}],["end",{"_index":815,"t":{"2006":{"position":[[151,3]]},"2079":{"position":[[599,3]]}}}],["endpoint",{"_index":146,"t":{"1920":{"position":[[94,9]]},"2054":{"position":[[1652,9]]},"2075":{"position":[[56,9]]},"2081":{"position":[[17,10]]}}}],["engin",{"_index":10,"t":{"1912":{"position":[[86,6]]},"1929":{"position":[[2766,8]]},"2024":{"position":[[104,7],[144,7]]},"2054":{"position":[[2027,7]]},"2108":{"position":[[36,7]]},"2113":{"position":[[62,7],[306,6],[330,6],[378,7]]},"2115":{"position":[[84,8],[308,6],[315,6],[395,7]]}}}],["ensur",{"_index":624,"t":{"1960":{"position":[[613,6]]},"2063":{"position":[[18,6]]},"2084":{"position":[[53,6]]}}}],["entiti",{"_index":272,"t":{"1929":{"position":[[1598,6]]}}}],["entri",{"_index":792,"t":{"2004":{"position":[[25,8]]}}}],["environ",{"_index":1276,"t":{"2089":{"position":[[338,12]]}}}],["equal",{"_index":1095,"t":{"2063":{"position":[[1017,6]]}}}],["equival",{"_index":901,"t":{"2030":{"position":[[126,10]]}}}],["err",{"_index":459,"t":{"1939":{"position":[[459,3],[517,3]]},"1941":{"position":[[198,3],[232,3]]},"1958":{"position":[[518,3],[542,3]]},"1968":{"position":[[378,3],[425,3],[458,3],[508,3],[569,3],[602,3]]},"1972":{"position":[[213,3],[235,3],[311,3],[333,3],[411,3],[433,3]]},"1976":{"position":[[253,3],[307,3]]},"1992":{"position":[[322,3],[343,3],[466,3],[523,3]]},"2004":{"position":[[301,3],[327,3]]},"2018":{"position":[[341,3],[366,3]]},"2028":{"position":[[192,3],[218,3]]},"2034":{"position":[[302,3],[342,3],[375,3],[422,3],[470,3],[503,3]]},"2063":{"position":[[240,3],[284,3],[1078,3],[1144,3]]},"2065":{"position":[[292,3]]},"2067":{"position":[[610,3],[830,3],[897,3]]},"2084":{"position":[[787,3],[819,3],[839,3],[1135,3],[1162,3]]},"2106":{"position":[[152,3]]}}}],["err.(*fiber.error",{"_index":1113,"t":{"2065":{"position":[[424,19]]},"2067":{"position":[[763,19]]}}}],["err.(validator.validationerror",{"_index":1207,"t":{"2084":{"position":[[852,32]]}}}],["err.param",{"_index":1214,"t":{"2084":{"position":[[997,11]]}}}],["err.structnamespac",{"_index":1210,"t":{"2084":{"position":[[935,21]]}}}],["err.tag",{"_index":1212,"t":{"2084":{"position":[[971,9]]}}}],["error",{"_index":451,"t":{"1939":{"position":[[272,5]]},"1941":{"position":[[122,5]]},"1943":{"position":[[322,6]]},"1958":{"position":[[275,5]]},"1968":{"position":[[327,5]]},"1972":{"position":[[18,5],[115,5]]},"1976":{"position":[[151,6],[296,7]]},"1992":{"position":[[149,5]]},"1994":{"position":[[284,5]]},"2004":{"position":[[213,6]]},"2006":{"position":[[110,5],[181,5],[217,9]]},"2018":{"position":[[105,5]]},"2024":{"position":[[267,5]]},"2034":{"position":[[242,5]]},"2054":{"position":[[728,5]]},"2063":{"position":[[48,6],[317,5],[796,5],[842,5]]},"2065":{"position":[[18,5],[59,6],[110,6],[120,5],[229,5],[296,6]]},"2067":{"position":[[9,5],[91,5],[145,5],[219,6],[296,5],[388,5],[467,5],[502,7],[547,5],[614,6],[819,5],[954,7],[1039,5]]},"2070":{"position":[[828,6],[858,6]]},"2084":{"position":[[736,6],[1009,6],[1054,6],[1175,6],[1205,6]]},"2104":{"position":[[49,6],[63,5]]},"2106":{"position":[[24,5],[156,6],[245,5],[280,5]]},"2113":{"position":[[106,5],[162,5],[525,5]]}}}],["errorhandl",{"_index":924,"t":{"2034":{"position":[[382,12],[510,12]]},"2054":{"position":[[585,13]]},"2063":{"position":[[718,14]]}}}],["errorrespons",{"_index":1201,"t":{"2084":{"position":[[614,13],[713,16],[743,16],[899,13]]}}}],["essenti",{"_index":123,"t":{"1918":{"position":[[18,11]]},"2063":{"position":[[5,9]]}}}],["establish",{"_index":899,"t":{"2030":{"position":[[57,12]]}}}],["etag",{"_index":306,"t":{"1929":{"position":[[2471,4],[2499,4],[2550,5],[2615,5]]}}}],["etc",{"_index":166,"t":{"1920":{"position":[[503,4]]}}}],["ethernet",{"_index":1260,"t":{"2087":{"position":[[573,8]]},"2089":{"position":[[317,8]]}}}],["exampl",{"_index":72,"t":{"1916":{"position":[[495,8],[733,7]]},"1927":{"position":[[154,7]]},"1929":{"position":[[52,7],[308,7],[3415,8]]},"1931":{"position":[[319,7],[548,7],[993,7],[2013,7]]},"1933":{"position":[[1038,7]]},"1935":{"position":[[116,7]]},"1937":{"position":[[79,7]]},"1939":{"position":[[278,8],[446,7]]},"1941":{"position":[[183,7]]},"1943":{"position":[[329,7]]},"1946":{"position":[[296,7]]},"1948":{"position":[[197,7]]},"1950":{"position":[[110,7]]},"1952":{"position":[[103,7]]},"1954":{"position":[[81,7]]},"1956":{"position":[[52,7]]},"1958":{"position":[[281,7]]},"1960":{"position":[[93,7],[644,7]]},"1964":{"position":[[194,7]]},"1966":{"position":[[186,7]]},"1968":{"position":[[333,7]]},"1970":{"position":[[142,7]]},"1972":{"position":[[121,7]]},"1974":{"position":[[222,7]]},"1976":{"position":[[158,7]]},"1978":{"position":[[132,7]]},"1982":{"position":[[128,7]]},"1984":{"position":[[86,7]]},"1986":{"position":[[70,7]]},"1988":{"position":[[109,7]]},"1990":{"position":[[228,7]]},"1992":{"position":[[155,7]]},"1994":{"position":[[290,7]]},"1996":{"position":[[126,7]]},"1998":{"position":[[273,7]]},"2000":{"position":[[106,7]]},"2002":{"position":[[202,7]]},"2004":{"position":[[220,7]]},"2006":{"position":[[227,7]]},"2008":{"position":[[67,7]]},"2010":{"position":[[272,7]]},"2012":{"position":[[148,7]]},"2014":{"position":[[100,7]]},"2016":{"position":[[320,7]]},"2018":{"position":[[111,7]]},"2020":{"position":[[97,7]]},"2022":{"position":[[239,7],[419,8]]},"2026":{"position":[[61,7]]},"2028":{"position":[[111,7]]},"2030":{"position":[[96,7]]},"2032":{"position":[[152,7],[574,7]]},"2034":{"position":[[248,7]]},"2036":{"position":[[189,7]]},"2038":{"position":[[104,7]]},"2042":{"position":[[98,7]]},"2044":{"position":[[248,7]]},"2046":{"position":[[130,7]]},"2048":{"position":[[229,7]]},"2050":{"position":[[84,7]]},"2052":{"position":[[200,7]]},"2056":{"position":[[590,7]]},"2058":{"position":[[363,8],[469,7],[714,7],[806,8],[815,7]]},"2063":{"position":[[198,7],[488,7],[1036,7]]},"2065":{"position":[[210,7]]},"2067":{"position":[[438,7],[510,7]]},"2075":{"position":[[144,8]]},"2077":{"position":[[348,7]]},"2079":{"position":[[213,7]]},"2084":{"position":[[148,12],[295,7]]},"2102":{"position":[[353,8]]},"2104":{"position":[[395,7]]},"2106":{"position":[[97,7]]},"2115":{"position":[[143,7]]}}}],["exce",{"_index":267,"t":{"1929":{"position":[[1545,7]]}}}],["excel",{"_index":208,"t":{"1924":{"position":[[82,9]]}}}],["except",{"_index":754,"t":{"1994":{"position":[[76,6]]}}}],["exclud",{"_index":297,"t":{"1929":{"position":[[2084,8],[2212,8]]},"1960":{"position":[[474,9]]}}}],["execut",{"_index":155,"t":{"1920":{"position":[[253,8],[609,8]]},"2006":{"position":[[24,8]]},"2079":{"position":[[154,8]]},"2087":{"position":[[81,9]]},"2113":{"position":[[229,8]]}}}],["exempt",{"_index":1069,"t":{"2058":{"position":[[408,6]]}}}],["exercis",{"_index":1263,"t":{"2089":{"position":[[25,8]]}}}],["exist",{"_index":360,"t":{"1931":{"position":[[855,5]]},"1966":{"position":[[115,6]]},"1978":{"position":[[264,5]]},"2010":{"position":[[137,6],[201,6]]},"2016":{"position":[[184,6]]},"2063":{"position":[[273,7]]}}}],["expir",{"_index":605,"t":{"1960":{"position":[[0,6],[177,6],[234,6],[484,7],[750,8],[940,8]]},"1964":{"position":[[111,7]]}}}],["expiri",{"_index":636,"t":{"1960":{"position":[[916,6]]}}}],["explain",{"_index":1349,"t":{"2106":{"position":[[230,10]]}}}],["exploit",{"_index":1023,"t":{"2054":{"position":[[1329,9]]}}}],["express",{"_index":1,"t":{"1912":{"position":[[12,7]]},"1924":{"position":[[115,7]]},"2067":{"position":[[995,7]]},"2089":{"position":[[452,7]]},"2091":{"position":[[78,7]]},"2093":{"position":[[78,7]]},"2095":{"position":[[78,7]]},"2097":{"position":[[80,7]]}}}],["extens",{"_index":499,"t":{"1946":{"position":[[25,10]]},"2034":{"position":[[112,10]]},"2046":{"position":[[85,10]]}}}],["extern",{"_index":999,"t":{"2054":{"position":[[819,8]]}}}],["f",{"_index":601,"t":{"1958":{"position":[[1042,1],[1055,1]]}}}],["failedfield",{"_index":1202,"t":{"2084":{"position":[[637,11]]}}}],["failedfield\":\"user.email\",\"tag\":\"required\",\"value\":\"\"},{\"failedfield\":\"user.job.salary\",\"tag\":\"required\",\"value\":\"\"},{\"failedfield\":\"user.job.type\",\"tag\":\"required\",\"valu",{"_index":1225,"t":{"2084":{"position":[[1508,181]]}}}],["fals",{"_index":241,"t":{"1929":{"position":[[764,5],[983,5],[1108,5],[1279,5],[1463,5],[2000,5],[2112,5],[2240,5],[2356,5],[2465,5],[2651,5]]},"1931":{"position":[[1715,5],[1809,5],[1887,6]]},"1990":{"position":[[191,6],[371,5]]}}}],["fast",{"_index":16,"t":{"1912":{"position":[[132,4]]}}}],["faster",{"_index":912,"t":{"2032":{"position":[[463,6]]}}}],["fastest",{"_index":8,"t":{"1912":{"position":[[73,7]]},"2056":{"position":[[94,7]]}}}],["fasthttp",{"_index":7,"t":{"1912":{"position":[[59,9]]},"1970":{"position":[[33,8],[97,8]]}}}],["fasthttp/sess",{"_index":1041,"t":{"2054":{"position":[[1925,16]]}}}],["favicon",{"_index":981,"t":{"2054":{"position":[[311,7],[326,7]]}}}],["featur",{"_index":468,"t":{"1941":{"position":[[174,8]]}}}],["feel",{"_index":1363,"t":{"2110":{"position":[[150,4]]}}}],["feet",{"_index":71,"t":{"1916":{"position":[[478,5]]}}}],["fenni",{"_index":828,"t":{"2010":{"position":[[381,7]]}}}],["ferret",{"_index":946,"t":{"2044":{"position":[[344,11]]}}}],["fiber",{"_index":0,"t":{"1912":{"position":[[0,5],[237,5]]},"1916":{"position":[[81,5]]},"1918":{"position":[[55,5]]},"1920":{"position":[[427,6]]},"1924":{"position":[[53,6],[144,5]]},"1929":{"position":[[220,8],[522,7],[2317,5]]},"1946":{"position":[[583,5]]},"1968":{"position":[[465,5],[609,5]]},"2032":{"position":[[319,5]]},"2054":{"position":[[0,5],[259,6],[798,5],[1011,5],[1592,6],[2084,5]]},"2058":{"position":[[692,5]]},"2063":{"position":[[30,5],[163,5],[326,5],[337,5]]},"2065":{"position":[[0,5]]},"2079":{"position":[[118,5]]},"2084":{"position":[[0,5]]},"2087":{"position":[[440,5]]},"2089":{"position":[[378,5]]},"2091":{"position":[[0,5]]},"2093":{"position":[[0,5]]},"2095":{"position":[[0,5]]},"2097":{"position":[[0,5]]},"2102":{"position":[[162,5],[474,5]]},"2104":{"position":[[3,6],[211,5]]},"2106":{"position":[[269,6]]},"2108":{"position":[[0,5],[169,6]]},"2113":{"position":[[0,5],[241,5]]},"2115":{"position":[[0,5]]}}}],["fiber'",{"_index":1090,"t":{"2063":{"position":[[827,7]]},"2113":{"position":[[316,7]]}}}],["fiber*error",{"_index":1105,"t":{"2065":{"position":[[137,12]]}}}],["fiber.*error",{"_index":1128,"t":{"2067":{"position":[[738,12]]}}}],["fiber.ctx",{"_index":53,"t":{"1916":{"position":[[34,9],[143,9],[519,11],[781,11],[1139,11]]},"1918":{"position":[[188,11]]},"1920":{"position":[[728,11],[849,11],[1042,11],[1254,11]]},"1933":{"position":[[1069,11],[1167,11],[1246,11]]},"1946":{"position":[[360,11],[787,11]]},"1948":{"position":[[225,11]]},"1950":{"position":[[138,11]]},"1952":{"position":[[140,11]]},"1954":{"position":[[151,11]]},"1956":{"position":[[132,11]]},"1958":{"position":[[484,11]]},"1960":{"position":[[121,11],[675,11],[856,11]]},"1964":{"position":[[222,11]]},"1966":{"position":[[214,11]]},"1968":{"position":[[361,11]]},"1970":{"position":[[170,11]]},"1972":{"position":[[196,11],[294,11],[394,11],[486,11]]},"1974":{"position":[[250,11]]},"1976":{"position":[[187,11]]},"1978":{"position":[[161,11]]},"1982":{"position":[[156,11]]},"1984":{"position":[[146,11]]},"1986":{"position":[[98,11]]},"1988":{"position":[[183,11]]},"1990":{"position":[[298,11]]},"1992":{"position":[[236,11]]},"1994":{"position":[[367,11]]},"1996":{"position":[[154,11]]},"1998":{"position":[[296,11],[373,11]]},"2000":{"position":[[135,11]]},"2002":{"position":[[231,11]]},"2004":{"position":[[249,11]]},"2006":{"position":[[255,11],[327,11],[399,11]]},"2008":{"position":[[140,11]]},"2010":{"position":[[347,11]]},"2012":{"position":[[223,11]]},"2014":{"position":[[154,11]]},"2016":{"position":[[402,11]]},"2018":{"position":[[307,11]]},"2020":{"position":[[158,11]]},"2022":{"position":[[273,11],[338,11],[448,11]]},"2026":{"position":[[118,11]]},"2028":{"position":[[140,11]]},"2032":{"position":[[180,11],[602,11]]},"2034":{"position":[[285,11]]},"2036":{"position":[[226,11]]},"2038":{"position":[[132,11]]},"2042":{"position":[[126,11]]},"2044":{"position":[[312,11]]},"2046":{"position":[[158,11]]},"2048":{"position":[[257,11]]},"2050":{"position":[[112,11]]},"2052":{"position":[[264,11]]},"2056":{"position":[[829,11],[980,11]]},"2058":{"position":[[267,12],[550,11],[977,11]]},"2063":{"position":[[226,11],[668,11],[1064,11]]},"2065":{"position":[[280,11]]},"2067":{"position":[[598,11]]},"2072":{"position":[[215,11]]},"2075":{"position":[[268,11],[377,11],[497,11]]},"2077":{"position":[[452,11],[560,11],[652,11],[920,11],[1074,11]]},"2079":{"position":[[261,11],[662,11]]},"2084":{"position":[[1078,11]]},"2104":{"position":[[418,11]]},"2106":{"position":[[140,11]]},"2113":{"position":[[513,11]]},"2115":{"position":[[426,11]]}}}],["fiber.error",{"_index":1110,"t":{"2065":{"position":[[395,11]]}}}],["fiber.gz",{"_index":285,"t":{"1929":{"position":[[1779,11]]},"1931":{"position":[[1642,11]]}}}],["fiber.handl",{"_index":1051,"t":{"2056":{"position":[[223,13]]}}}],["fiber.map",{"_index":1370,"t":{"2113":{"position":[[558,10]]},"2115":{"position":[[487,10]]}}}],["fiber.mimetextplaincharsetutf8",{"_index":1116,"t":{"2065":{"position":[[522,31]]}}}],["fiber.new",{"_index":128,"t":{"1918":{"position":[[156,11]]},"1922":{"position":[[256,11]]},"1927":{"position":[[230,11]]},"1929":{"position":[[337,11]]},"1935":{"position":[[145,11]]},"1937":{"position":[[94,11]]},"1972":{"position":[[150,11]]},"2063":{"position":[[606,11]]},"2067":{"position":[[525,11]]},"2070":{"position":[[88,11],[480,11]]},"2072":{"position":[[140,11]]},"2081":{"position":[[91,11]]}}}],["fiber.new(&fiber.set",{"_index":215,"t":{"1929":{"position":[[122,26]]},"2113":{"position":[[344,26]]},"2115":{"position":[[361,26]]}}}],["fiber.new(set",{"_index":213,"t":{"1927":{"position":[[116,18]]}}}],["fiber.newerror",{"_index":1092,"t":{"2063":{"position":[[895,17]]}}}],["fiber.newerror(404",{"_index":1100,"t":{"2063":{"position":[[1151,19]]}}}],["fiber.newerror(503",{"_index":1096,"t":{"2063":{"position":[[1085,19]]}}}],["fiber.stat",{"_index":372,"t":{"1931":{"position":[[1291,12],[1340,14],[2049,13]]}}}],["fiber.statusinternalservererror",{"_index":1109,"t":{"2065":{"position":[[343,31]]},"2067":{"position":[[661,31]]}}}],["field",{"_index":226,"t":{"1929":{"position":[[565,6]]},"1948":{"position":[[56,6]]},"1950":{"position":[[50,5]]},"1958":{"position":[[292,5]]},"1976":{"position":[[229,5]]},"1978":{"position":[[204,5]]},"1982":{"position":[[49,6]]},"1990":{"position":[[86,5]]},"1996":{"position":[[85,6]]},"2018":{"position":[[122,5]]},"2034":{"position":[[83,5]]},"2038":{"position":[[32,5]]},"2048":{"position":[[22,5],[175,6]]},"2052":{"position":[[75,5]]},"2058":{"position":[[767,5],[795,6]]},"2084":{"position":[[231,6]]}}}],["file",{"_index":191,"t":{"1922":{"position":[[16,5],[58,6],[102,4],[212,5],[335,5]]},"1929":{"position":[[1697,4],[1749,4],[1768,4]]},"1931":{"position":[[38,5],[126,5],[283,5],[565,5],[635,5],[646,9],[683,10],[868,4],[885,5],[1266,6],[1404,5],[1624,6],[1677,4],[1909,4]]},"1943":{"position":[[93,5]]},"1968":{"position":[[14,4],[171,4]]},"1976":{"position":[[14,5],[56,4],[214,4],[247,5],[328,4]]},"2004":{"position":[[465,5],[493,5],[571,6],[585,4],[599,5],[735,5]]},"2028":{"position":[[37,4],[264,5],[292,5],[370,6],[384,4],[398,5],[534,5]]},"2034":{"position":[[14,4]]},"2046":{"position":[[80,4]]},"2054":{"position":[[370,4]]},"2102":{"position":[[276,5]]}}}],["file.filenam",{"_index":710,"t":{"1976":{"position":[[389,15]]},"2004":{"position":[[787,15]]},"2028":{"position":[[586,15]]}}}],["file.header[\"cont",{"_index":808,"t":{"2004":{"position":[[645,20]]},"2028":{"position":[[444,20]]}}}],["file.s",{"_index":807,"t":{"2004":{"position":[[634,10]]},"2028":{"position":[[433,10]]}}}],["filenam",{"_index":667,"t":{"1968":{"position":[[144,9],[260,8],[307,8]]},"2034":{"position":[[102,9]]}}}],["filename=\"logo.png",{"_index":547,"t":{"1950":{"position":[[285,19]]}}}],["filesystem",{"_index":976,"t":{"2054":{"position":[[218,14],[233,10]]}}}],["filter",{"_index":1074,"t":{"2058":{"position":[[534,7],[788,6]]}}}],["find",{"_index":927,"t":{"2036":{"position":[[108,4]]},"2084":{"position":[[169,4]]},"2104":{"position":[[487,4]]}}}],["first",{"_index":40,"t":{"1914":{"position":[[0,5]]},"1929":{"position":[[1975,5]]},"1976":{"position":[[50,5],[208,5]]},"1978":{"position":[[46,5],[182,5]]},"2099":{"position":[[149,5]]}}}],["flexibl",{"_index":1328,"t":{"2102":{"position":[[140,8]]}}}],["flow",{"_index":1137,"t":{"2072":{"position":[[100,4]]}}}],["fmt.println(\"1st",{"_index":817,"t":{"2006":{"position":[[269,16]]}}}],["fmt.println(\"2nd",{"_index":818,"t":{"2006":{"position":[[341,16]]}}}],["fmt.println(\"3rd",{"_index":819,"t":{"2006":{"position":[[413,16]]}}}],["fmt.println(\"by",{"_index":1185,"t":{"2079":{"position":[[616,16]]}}}],["fmt.println(c.baseurl",{"_index":486,"t":{"1943":{"position":[[407,24]]}}}],["fmt.println(c.get(\"x",{"_index":488,"t":{"1943":{"position":[[456,20]]}}}],["fmt.println(file.filenam",{"_index":806,"t":{"2004":{"position":[[607,26]]},"2028":{"position":[[406,26]]}}}],["fmt.println(r",{"_index":866,"t":{"2020":{"position":[[240,14]]}}}],["fmt.println(r.method",{"_index":891,"t":{"2026":{"position":[[147,21]]}}}],["fmt.println(string(bodi",{"_index":498,"t":{"1943":{"position":[[783,25]]}}}],["fmt.println(string(data",{"_index":439,"t":{"1937":{"position":[[318,25]]}}}],["fmt.println(token[0",{"_index":802,"t":{"2004":{"position":[[430,21]]}}}],["fmt.sprintf(\"./%",{"_index":709,"t":{"1976":{"position":[[369,19]]},"2004":{"position":[[767,19]]},"2028":{"position":[[566,19]]}}}],["follow",{"_index":159,"t":{"1920":{"position":[[316,9]]},"1922":{"position":[[188,9]]},"1931":{"position":[[259,9]]},"1958":{"position":[[90,9],[652,9]]},"1996":{"position":[[16,8]]},"2018":{"position":[[515,9]]},"2067":{"position":[[428,9]]},"2084":{"position":[[1328,9]]},"2102":{"position":[[343,9]]}}}],["foo",{"_index":246,"t":{"1929":{"position":[[897,4],[906,5],[955,4],[964,5],[1022,4],[1031,4],[1081,4]]}}}],["fooand",{"_index":250,"t":{"1929":{"position":[[1073,7]]}}}],["forbidden",{"_index":783,"t":{"1998":{"position":[[495,9]]}}}],["forev",{"_index":96,"t":{"1916":{"position":[[993,7]]}}}],["form",{"_index":577,"t":{"1958":{"position":[[199,4],[965,4]]},"1976":{"position":[[224,4]]},"1978":{"position":[[4,4],[199,4]]},"2004":{"position":[[20,4],[286,5],[295,5]]},"2028":{"position":[[177,5],[186,5]]}}}],["form.file[\"docu",{"_index":803,"t":{"2004":{"position":[[502,22]]},"2028":{"position":[[301,22]]}}}],["form.value[\"token",{"_index":799,"t":{"2004":{"position":[[374,20]]}}}],["form:\"nam",{"_index":586,"t":{"1958":{"position":[[399,12]]}}}],["form:\"pass",{"_index":589,"t":{"1958":{"position":[[448,12]]}}}],["format",{"_index":697,"t":{"1974":{"position":[[91,7],[157,7]]},"2058":{"position":[[874,7]]}}}],["forward",{"_index":733,"t":{"1988":{"position":[[52,9],[122,9]]}}}],["found",{"_index":873,"t":{"2022":{"position":[[183,6]]},"2034":{"position":[[270,7]]},"2036":{"position":[[211,7]]},"2063":{"position":[[1028,7],[1183,8],[1222,6]]},"2104":{"position":[[221,5]]}}}],["frame",{"_index":1181,"t":{"2079":{"position":[[492,5]]}}}],["framework",{"_index":4,"t":{"1912":{"position":[[33,9]]},"2067":{"position":[[1003,9]]},"2087":{"position":[[70,10],[197,9]]},"2099":{"position":[[39,9]]}}}],["free",{"_index":1364,"t":{"2110":{"position":[[155,4]]}}}],["full",{"_index":326,"t":{"1929":{"position":[[2844,4]]},"2056":{"position":[[900,4]]}}}],["func",{"_index":73,"t":{"1916":{"position":[[504,4],[766,4]]},"1918":{"position":[[135,4]]},"1927":{"position":[[209,4]]},"1929":{"position":[[60,4],[316,4]]},"1935":{"position":[[124,4]]},"1972":{"position":[[129,4],[188,4],[286,4],[386,4]]},"2056":{"position":[[185,4]]},"2058":{"position":[[262,4],[542,4],[969,4]]},"2063":{"position":[[585,4]]},"2070":{"position":[[67,4],[459,4]]},"2072":{"position":[[119,4]]},"2081":{"position":[[70,4]]},"2084":{"position":[[682,4],[1063,4]]},"2115":{"position":[[254,4]]}}}],["func(*ctx",{"_index":387,"t":{"1933":{"position":[[169,14],[267,14],[335,14],[387,14],[440,14],[493,14],[547,14],[601,14],[656,14],[712,14],[768,14],[962,14],[1016,14]]},"1935":{"position":[[94,14]]}}}],["func(*fiber.ctx",{"_index":163,"t":{"1920":{"position":[[384,20],[546,16]]},"2056":{"position":[[349,16]]}}}],["func(c",{"_index":106,"t":{"1916":{"position":[[1132,6]]},"1918":{"position":[[181,6]]},"1920":{"position":[[721,6],[842,6],[1035,6],[1247,6]]},"1933":{"position":[[1062,6],[1160,6],[1239,6]]},"1943":{"position":[[392,6]]},"1946":{"position":[[353,6],[780,6]]},"1948":{"position":[[218,6]]},"1950":{"position":[[131,6]]},"1952":{"position":[[133,6]]},"1954":{"position":[[144,6]]},"1956":{"position":[[125,6]]},"1958":{"position":[[477,6]]},"1960":{"position":[[114,6],[668,6],[849,6]]},"1964":{"position":[[215,6]]},"1966":{"position":[[207,6]]},"1968":{"position":[[354,6]]},"1970":{"position":[[163,6]]},"1972":{"position":[[479,6]]},"1974":{"position":[[243,6]]},"1976":{"position":[[180,6]]},"1978":{"position":[[154,6]]},"1982":{"position":[[149,6]]},"1984":{"position":[[139,6]]},"1986":{"position":[[91,6]]},"1988":{"position":[[176,6]]},"1990":{"position":[[291,6]]},"1992":{"position":[[229,6]]},"1994":{"position":[[360,6]]},"1996":{"position":[[147,6]]},"1998":{"position":[[366,6]]},"2000":{"position":[[128,6]]},"2002":{"position":[[224,6]]},"2004":{"position":[[242,6]]},"2006":{"position":[[248,6],[320,6],[392,6]]},"2008":{"position":[[133,6]]},"2010":{"position":[[340,6]]},"2012":{"position":[[216,6]]},"2014":{"position":[[147,6]]},"2016":{"position":[[395,6]]},"2018":{"position":[[300,6]]},"2020":{"position":[[151,6]]},"2022":{"position":[[266,6],[331,6],[441,6]]},"2026":{"position":[[111,6]]},"2028":{"position":[[133,6]]},"2032":{"position":[[173,6],[595,6]]},"2034":{"position":[[278,6]]},"2036":{"position":[[219,6]]},"2038":{"position":[[125,6]]},"2042":{"position":[[119,6]]},"2044":{"position":[[305,6]]},"2046":{"position":[[151,6]]},"2048":{"position":[[250,6]]},"2050":{"position":[[105,6]]},"2052":{"position":[[257,6]]},"2056":{"position":[[973,6]]},"2063":{"position":[[219,6],[661,6],[1057,6]]},"2072":{"position":[[208,6]]},"2075":{"position":[[261,6],[370,6],[490,6]]},"2077":{"position":[[445,6],[553,6],[645,6],[913,6],[1067,6]]},"2079":{"position":[[655,6]]},"2106":{"position":[[133,6]]},"2113":{"position":[[506,6]]},"2115":{"position":[[419,6]]}}}],["func(ctx",{"_index":1107,"t":{"2065":{"position":[[271,8]]},"2067":{"position":[[589,8]]}}}],["function",{"_index":100,"t":{"1916":{"position":[[1039,8]]},"1920":{"position":[[234,10],[341,8],[577,8]]},"1922":{"position":[[78,8],[128,8]]},"1929":{"position":[[2714,9]]},"1946":{"position":[[606,9]]},"2054":{"position":[[686,8]]},"2056":{"position":[[294,8],[759,8]]},"2058":{"position":[[138,8],[195,8],[290,8]]},"2063":{"position":[[147,9]]},"2077":{"position":[[170,9]]},"2079":{"position":[[0,9],[93,10],[131,9],[172,8],[237,8]]},"2104":{"position":[[300,8],[358,10]]},"2113":{"position":[[437,8]]}}}],["fundament",{"_index":1228,"t":{"2087":{"position":[[91,11]]},"2089":{"position":[[57,12]]}}}],["futur",{"_index":69,"t":{"1916":{"position":[[435,6]]}}}],["gbit",{"_index":1259,"t":{"2087":{"position":[[568,4]]}}}],["gener",{"_index":307,"t":{"1929":{"position":[[2511,11],[2560,9]]},"2054":{"position":[[631,9]]},"2087":{"position":[[541,7]]}}}],["gigabit",{"_index":1275,"t":{"2089":{"position":[[309,7]]}}}],["github",{"_index":1192,"t":{"2084":{"position":[[116,6]]},"2087":{"position":[[421,6]]}}}],["github.com/gofiber/{{.title}}johndoehello",{"_index":701,"t":{"1974":{"position":[[385,9]]}}}],["packag",{"_index":104,"t":{"1916":{"position":[[1106,8]]},"1918":{"position":[[88,7]]},"1927":{"position":[[162,7]]},"2054":{"position":[[1999,7]]},"2063":{"position":[[496,7]]},"2084":{"position":[[42,7]]},"2115":{"position":[[31,7],[168,7]]}}}],["page",{"_index":139,"t":{"1918":{"position":[[338,5]]},"2067":{"position":[[394,4],[473,5],[825,4]]},"2084":{"position":[[123,4]]},"2106":{"position":[[225,4]]}}}],["panic",{"_index":683,"t":{"1972":{"position":[[53,5]]},"2054":{"position":[[507,6]]},"2063":{"position":[[359,6],[396,5],[694,5]]}}}],["panic(\"thi",{"_index":1087,"t":{"2063":{"position":[[682,11]]}}}],["param",{"_index":823,"t":{"2010":{"position":[[118,5],[187,5]]},"2077":{"position":[[163,6]]}}}],["paramet",{"_index":172,"t":{"1920":{"position":[[769,10],[972,9]]},"1958":{"position":[[71,10]]},"1968":{"position":[[154,9],[269,10]]},"1990":{"position":[[136,10]]},"2000":{"position":[[61,10]]},"2010":{"position":[[36,11]]},"2016":{"position":[[71,9]]},"2018":{"position":[[52,11]]},"2077":{"position":[[6,10],[207,9],[292,9],[384,10],[398,10],[611,9],[797,10]]}}}],["pars",{"_index":793,"t":{"2004":{"position":[[42,5],[266,5]]},"2028":{"position":[[157,5]]}}}],["part",{"_index":832,"t":{"2012":{"position":[[18,4]]}}}],["particular",{"_index":145,"t":{"1920":{"position":[[83,10]]},"2089":{"position":[[146,11]]}}}],["pass",{"_index":212,"t":{"1927":{"position":[[54,4]]},"1929":{"position":[[8,4],[77,4]]},"1941":{"position":[[8,4]]},"1943":{"position":[[219,4]]},"1958":{"position":[[412,4]]},"1966":{"position":[[35,4]]},"1968":{"position":[[453,4],[597,4]]},"1972":{"position":[[62,6]]},"1994":{"position":[[193,7]]},"1998":{"position":[[160,4]]},"2002":{"position":[[138,7]]},"2006":{"position":[[102,4]]},"2010":{"position":[[58,4]]},"2012":{"position":[[86,7]]},"2016":{"position":[[105,4]]},"2018":{"position":[[220,4]]},"2034":{"position":[[370,4],[498,4]]},"2056":{"position":[[747,4]]},"2058":{"position":[[147,6],[204,6]]},"2063":{"position":[[312,4],[858,4],[930,4]]},"2113":{"position":[[301,4]]}}}],["pass=do",{"_index":603,"t":{"1958":{"position":[[1057,8]]}}}],["password",{"_index":1032,"t":{"2054":{"position":[[1670,8]]}}}],["past",{"_index":637,"t":{"1960":{"position":[[935,4]]}}}],["path",{"_index":148,"t":{"1920":{"position":[[123,5],[508,4],[526,4],[698,5],[1280,5],[1315,5]]},"1929":{"position":[[1372,4]]},"1931":{"position":[[809,4],[832,4],[946,4],[1951,5]]},"1933":{"position":[[147,4],[889,4]]},"1964":{"position":[[85,4]]},"1968":{"position":[[24,4],[176,4]]},"2000":{"position":[[56,4]]},"2012":{"position":[[13,4],[78,4]]},"2022":{"position":[[48,5]]},"2028":{"position":[[98,4]]},"2034":{"position":[[34,5]]},"2054":{"position":[[375,4],[1738,4]]},"2058":{"position":[[901,9]]},"2070":{"position":[[35,5],[423,5]]},"2072":{"position":[[45,4]]},"2075":{"position":[[6,6],[103,5],[162,5],[199,4],[314,4],[424,4]]},"2077":{"position":[[234,4]]},"2079":{"position":[[714,4],[741,5],[790,5]]}}}],["pattern",{"_index":1141,"t":{"2075":{"position":[[134,9]]}}}],["payload",{"_index":1268,"t":{"2089":{"position":[[216,7]]}}}],["per",{"_index":337,"t":{"1929":{"position":[[3231,3],[3463,3]]},"2089":{"position":[[406,3],[480,3]]},"2091":{"position":[[31,3],[110,3]]},"2093":{"position":[[31,3],[110,3]]},"2095":{"position":[[32,3],[111,3]]},"2097":{"position":[[34,3],[114,3]]}}}],["perform",{"_index":21,"t":{"1912":{"position":[[181,11],[363,11]]},"1916":{"position":[[109,12],[1423,12]]},"1931":{"position":[[747,11]]},"1974":{"position":[[0,8]]},"2032":{"position":[[470,12]]},"2087":{"position":[[23,11]]},"2089":{"position":[[121,11],[253,11]]}}}],["persica",{"_index":1168,"t":{"2077":{"position":[[985,7]]}}}],["persist",{"_index":81,"t":{"1916":{"position":[[618,7],[745,10],[1363,7]]}}}],["person",{"_index":583,"t":{"1958":{"position":[[347,6]]},"2018":{"position":[[177,6]]}}}],["physic",{"_index":1236,"t":{"2087":{"position":[[308,8]]}}}],["pipelin",{"_index":1267,"t":{"2089":{"position":[[191,11]]},"2099":{"position":[[483,11],[626,11]]}}}],["plaintext",{"_index":1262,"t":{"2089":{"position":[[4,9],[355,9]]}}}],["platform",{"_index":1266,"t":{"2089":{"position":[[133,9]]}}}],["pleas",{"_index":118,"t":{"1916":{"position":[[1458,6]]},"1924":{"position":[[60,6]]},"1970":{"position":[[81,6]]},"2024":{"position":[[152,6]]}}}],["popul",{"_index":763,"t":{"1996":{"position":[[44,8]]}}}],["port",{"_index":237,"t":{"1929":{"position":[[724,5]]},"1939":{"position":[[83,4]]}}}],["posit",{"_index":870,"t":{"2022":{"position":[[79,8]]},"2077":{"position":[[95,8]]}}}],["possibl",{"_index":1329,"t":{"2102":{"position":[[152,9]]}}}],["post",{"_index":151,"t":{"1920":{"position":[[175,4],[497,5]]},"1933":{"position":[[1274,4]]},"1956":{"position":[[71,4],[167,4]]},"1958":{"position":[[687,4],[800,4],[924,4],[1036,4],[1099,4]]},"2002":{"position":[[71,5],[259,6]]},"2018":{"position":[[549,4]]},"2084":{"position":[[1363,4]]}}}],["pprof",{"_index":986,"t":{"2054":{"position":[[430,5]]}}}],["prefer",{"_index":1334,"t":{"2102":{"position":[[326,7]]}}}],["prefetch",{"_index":1184,"t":{"2079":{"position":[[535,8]]}}}],["prefix",{"_index":349,"t":{"1931":{"position":[[244,6],[814,6],[939,6]]},"2079":{"position":[[734,6]]}}}],["prefork",{"_index":216,"t":{"1929":{"position":[[149,8],[606,7]]},"1941":{"position":[[166,7]]}}}],["print",{"_index":301,"t":{"1929":{"position":[[2303,5]]}}}],["process",{"_index":234,"t":{"1929":{"position":[[692,9]]},"2063":{"position":[[184,7]]},"2099":{"position":[[204,10],[295,10],[543,10]]}}}],["product",{"_index":850,"t":{"2018":{"position":[[247,8]]},"2087":{"position":[[235,10]]}}}],["profil",{"_index":988,"t":{"2054":{"position":[[456,9]]}}}],["prompt",{"_index":665,"t":{"1968":{"position":[[72,6]]}}}],["proper",{"_index":696,"t":{"1974":{"position":[[84,6],[150,6]]}}}],["properti",{"_index":227,"t":{"1929":{"position":[[572,8]]},"1970":{"position":[[54,11]]},"1996":{"position":[[32,8]]},"2016":{"position":[[5,8],[40,8]]},"2030":{"position":[[10,8]]},"2044":{"position":[[88,8]]},"2052":{"position":[[10,9]]}}}],["protect",{"_index":1021,"t":{"2054":{"position":[[1311,7]]},"2079":{"position":[[318,12]]}}}],["protocol",{"_index":556,"t":{"1954":{"position":[[21,9]]},"2014":{"position":[[21,8]]}}}],["provid",{"_index":518,"t":{"1946":{"position":[[589,8]]},"2032":{"position":[[330,8]]},"2054":{"position":[[383,9],[1075,8],[1510,8],[1752,8]]},"2056":{"position":[[677,7],[890,7]]},"2065":{"position":[[6,8],[176,8]]},"2087":{"position":[[12,8]]},"2106":{"position":[[39,7]]},"2113":{"position":[[6,8],[36,7]]},"2115":{"position":[[44,8]]}}}],["proxi",{"_index":354,"t":{"1931":{"position":[[713,5]]}}}],["proxy1",{"_index":734,"t":{"1988":{"position":[[137,7],[208,10]]}}}],["proxy3",{"_index":735,"t":{"1988":{"position":[[156,6],[232,9]]}}}],["prunu",{"_index":1166,"t":{"2077":{"position":[[955,6]]}}}],["public",{"_index":200,"t":{"1922":{"position":[[239,9],[284,11],[357,8]]},"1931":{"position":[[310,8],[343,11],[576,10],[614,11],[1023,11],[2037,11]]},"2054":{"position":[[1633,6]]}}}],["pug",{"_index":1356,"t":{"2108":{"position":[[126,3]]},"2115":{"position":[[139,3]]}}}],["pull",{"_index":715,"t":{"1980":{"position":[[73,4]]},"2040":{"position":[[73,4]]}}}],["purpos",{"_index":1162,"t":{"2077":{"position":[[819,9]]}}}],["put",{"_index":150,"t":{"1920":{"position":[[170,4],[492,4]]},"2002":{"position":[[77,4]]}}}],["queri",{"_index":573,"t":{"1958":{"position":[[65,5]]},"2016":{"position":[[58,5],[165,5],[211,5]]},"2018":{"position":[[46,5]]}}}],["query:\"nam",{"_index":848,"t":{"2018":{"position":[[205,14]]}}}],["query:\"pass",{"_index":849,"t":{"2018":{"position":[[232,14]]}}}],["query:\"product",{"_index":851,"t":{"2018":{"position":[[265,18]]}}}],["question",{"_index":1324,"t":{"2102":{"position":[[38,9]]},"2110":{"position":[[111,9]]}}}],["r",{"_index":864,"t":{"2020":{"position":[[218,1]]},"2026":{"position":[[132,1]]}}}],["r.handler",{"_index":894,"t":{"2026":{"position":[[187,11]]}}}],["r.param",{"_index":893,"t":{"2026":{"position":[[177,9]]}}}],["r.path",{"_index":892,"t":{"2026":{"position":[[169,7]]}}}],["r.rang",{"_index":865,"t":{"2020":{"position":[[229,8]]}}}],["rais",{"_index":996,"t":{"2054":{"position":[[719,5]]}}}],["ram",{"_index":1252,"t":{"2087":{"position":[[512,3]]}}}],["random.string(32",{"_index":409,"t":{"1933":{"position":[[1108,18]]}}}],["random.txt",{"_index":1145,"t":{"2075":{"position":[[452,14]]}}}],["randomvalu",{"_index":629,"t":{"1960":{"position":[[735,14]]}}}],["rang",{"_index":381,"t":{"1931":{"position":[[1751,5]]},"2004":{"position":[[593,5]]},"2020":{"position":[[44,6],[108,6],[223,5]]},"2028":{"position":[[392,5]]},"2084":{"position":[[846,5]]}}}],["rate",{"_index":1030,"t":{"2054":{"position":[[1563,4]]},"2058":{"position":[[420,4]]}}}],["raw",{"_index":568,"t":{"1956":{"position":[[153,3]]},"2032":{"position":[[388,3]]}}}],["re",{"_index":58,"t":{"1916":{"position":[[194,2],[424,2]]}}}],["read",{"_index":325,"t":{"1929":{"position":[[2835,4],[3272,8]]},"1956":{"position":[[334,4]]},"1966":{"position":[[444,4]]},"1970":{"position":[[88,4]]},"1978":{"position":[[401,4]]},"1982":{"position":[[402,4]]},"1984":{"position":[[320,4]]},"2008":{"position":[[326,4]]},"2010":{"position":[[550,4]]},"2016":{"position":[[636,4]]}}}],["readbuffers",{"_index":336,"t":{"1929":{"position":[[3212,14]]}}}],["readtimeout",{"_index":321,"t":{"1929":{"position":[[2779,11],[3187,11]]}}}],["real",{"_index":1313,"t":{"2099":{"position":[[290,4]]}}}],["realist",{"_index":1234,"t":{"2087":{"position":[[225,9]]}}}],["recommend",{"_index":911,"t":{"2032":{"position":[[447,11]]}}}],["recov",{"_index":989,"t":{"2054":{"position":[[466,7],[474,7],[493,8]]},"2063":{"position":[[381,7],[462,7]]}}}],["redirect",{"_index":868,"t":{"2022":{"position":[[0,9]]}}}],["refer",{"_index":66,"t":{"1916":{"position":[[318,11]]},"1920":{"position":[[8,6]]},"1952":{"position":[[17,9]]},"1956":{"position":[[272,11]]},"1966":{"position":[[382,11]]},"1978":{"position":[[339,11]]},"1982":{"position":[[340,11]]},"1984":{"position":[[258,11]]},"2008":{"position":[[264,11]]},"2010":{"position":[[488,11]]},"2016":{"position":[[574,11]]}}}],["regard",{"_index":38,"t":{"1912":{"position":[[353,9]]},"1931":{"position":[[1224,9]]},"2067":{"position":[[1029,9]]}}}],["regist",{"_index":388,"t":{"1933":{"position":[[203,8]]}}}],["rel=\"last",{"_index":771,"t":{"1996":{"position":[[374,10]]}}}],["rel=\"next",{"_index":770,"t":{"1996":{"position":[[320,11]]}}}],["releas",{"_index":31,"t":{"1912":{"position":[[289,8]]}}}],["remot",{"_index":728,"t":{"1986":{"position":[[12,6]]}}}],["render",{"_index":316,"t":{"1929":{"position":[[2707,6]]},"2024":{"position":[[0,7],[68,6]]},"2113":{"position":[[206,6],[393,6]]},"2115":{"position":[[443,6]]}}}],["render(io.writ",{"_index":1366,"t":{"2113":{"position":[[112,17]]}}}],["repeat",{"_index":1031,"t":{"2054":{"position":[[1612,8]]}}}],["replac",{"_index":195,"t":{"1922":{"position":[[65,7]]}}}],["report",{"_index":675,"t":{"1968":{"position":[[488,6]]}}}],["report.pdf",{"_index":676,"t":{"1968":{"position":[[554,14],[632,10]]}}}],["repositori",{"_index":1241,"t":{"2087":{"position":[[428,11]]}}}],["repres",{"_index":374,"t":{"1931":{"position":[[1365,10]]}}}],["req",{"_index":490,"t":{"1943":{"position":[[546,3]]}}}],["req.header.set(\"x",{"_index":492,"t":{"1943":{"position":[[606,17]]}}}],["request",{"_index":59,"t":{"1916":{"position":[[209,9],[442,8]]},"1920":{"position":[[70,7],[149,7],[452,7],[875,7],[928,7]]},"1929":{"position":[[1519,7],[1590,7],[2849,8],[3114,7],[3262,9]]},"1931":{"position":[[149,7],[1757,8],[1928,10]]},"1933":{"position":[[15,8],[63,8],[1199,10],[1279,10]]},"1956":{"position":[[12,7],[172,8]]},"1958":{"position":[[10,7]]},"1980":{"position":[[78,8]]},"1982":{"position":[[17,7]]},"1986":{"position":[[37,8]]},"1988":{"position":[[66,7]]},"1990":{"position":[[159,7]]},"1998":{"position":[[45,7],[117,8]]},"2002":{"position":[[57,8]]},"2008":{"position":[[21,7]]},"2012":{"position":[[30,7]]},"2014":{"position":[[13,7],[60,9]]},"2040":{"position":[[78,8]]},"2042":{"position":[[178,9]]},"2044":{"position":[[63,8]]},"2052":{"position":[[53,9],[120,7],[213,9]]},"2054":{"position":[[609,7],[659,8],[1017,7],[1621,8]]},"2056":{"position":[[138,7],[785,8]]},"2075":{"position":[[29,7],[75,8],[215,8],[330,8],[440,8]]},"2079":{"position":[[51,7],[796,9]]},"2089":{"position":[[41,7],[158,8]]},"2104":{"position":[[252,8]]}}}],["request/respons",{"_index":985,"t":{"2054":{"position":[[405,16]]}}}],["requestid",{"_index":992,"t":{"2054":{"position":[[599,9]]}}}],["requesturi",{"_index":341,"t":{"1929":{"position":[[3374,11]]}}}],["request’",{"_index":502,"t":{"1946":{"position":[[87,9]]},"1990":{"position":[[51,9]]},"2052":{"position":[[41,9]]}}}],["requir",{"_index":45,"t":{"1914":{"position":[[57,9]]},"2089":{"position":[[365,12]]}}}],["reset",{"_index":1033,"t":{"2054":{"position":[[1679,6]]}}}],["resourc",{"_index":1016,"t":{"2054":{"position":[[1252,8]]}}}],["resp",{"_index":493,"t":{"1943":{"position":[[663,5]]}}}],["resp.statuscod",{"_index":495,"t":{"1943":{"position":[[721,15]]}}}],["respect",{"_index":1148,"t":{"2077":{"position":[[248,10]]}}}],["respond",{"_index":143,"t":{"1920":{"position":[[49,8],[661,7]]}}}],["respons",{"_index":274,"t":{"1929":{"position":[[1615,9],[1981,8],[2102,9],[2230,9],[2992,9],[3494,10]]},"1931":{"position":[[135,8],[1459,9]]},"1948":{"position":[[40,8]]},"1950":{"position":[[14,8]]},"1994":{"position":[[13,8]]},"2000":{"position":[[9,8]]},"2024":{"position":[[47,9]]},"2032":{"position":[[14,8]]},"2034":{"position":[[62,8]]},"2036":{"position":[[72,8]]},"2042":{"position":[[29,9]]},"2048":{"position":[[40,8]]},"2050":{"position":[[35,9]]},"2065":{"position":[[70,8],[150,8],[480,8]]},"2067":{"position":[[358,9],[414,9]]},"2079":{"position":[[62,8]]},"2089":{"position":[[207,8],[396,9],[470,9]]},"2091":{"position":[[21,9],[100,9]]},"2093":{"position":[[21,9],[100,9]]},"2095":{"position":[[22,9],[101,9]]},"2097":{"position":[[24,9],[104,9]]},"2104":{"position":[[14,9],[131,8],[385,9]]}}}],["response’",{"_index":764,"t":{"1996":{"position":[[57,10]]},"2038":{"position":[[9,10]]}}}],["rest",{"_index":1339,"t":{"2102":{"position":[[450,4]]}}}],["result",{"_index":76,"t":{"1916":{"position":[[533,6],[561,6],[795,6],[823,6],[918,7],[1153,6],[1204,6]]},"1929":{"position":[[1728,9]]},"1943":{"position":[[709,8]]},"2070":{"position":[[814,6]]},"2084":{"position":[[1494,7]]},"2087":{"position":[[261,7]]},"2099":{"position":[[500,6],[569,6],[643,6]]},"2104":{"position":[[36,6]]}}}],["retriev",{"_index":704,"t":{"1976":{"position":[[27,9]]},"1978":{"position":[[23,9]]},"2067":{"position":[[696,8]]},"2077":{"position":[[143,9]]}}}],["return",{"_index":52,"t":{"1916":{"position":[[20,8],[129,8],[345,6],[1310,8]]},"1929":{"position":[[1154,8],[1234,6]]},"1937":{"position":[[12,7]]},"1952":{"position":[[0,7]]},"1954":{"position":[[0,7]]},"1956":{"position":[[0,7],[206,8]]},"1962":{"position":[[0,7]]},"1966":{"position":[[79,8],[316,8]]},"1976":{"position":[[83,9]]},"1978":{"position":[[80,9],[273,8]]},"1982":{"position":[[0,7],[274,8]]},"1984":{"position":[[0,7],[192,8]]},"1986":{"position":[[0,7]]},"1988":{"position":[[0,7]]},"1990":{"position":[[0,7],[183,7]]},"1992":{"position":[[380,6],[560,6]]},"2002":{"position":[[0,7]]},"2004":{"position":[[86,7]]},"2008":{"position":[[0,7],[198,8]]},"2010":{"position":[[102,8],[422,8]]},"2016":{"position":[[149,8],[228,7],[508,8]]},"2020":{"position":[[59,9]]},"2026":{"position":[[0,7]]},"2044":{"position":[[0,7]]},"2054":{"position":[[791,6],[1426,7]]},"2056":{"position":[[848,6],[999,6]]},"2058":{"position":[[306,6],[609,6],[1036,6]]},"2063":{"position":[[120,6]]},"2065":{"position":[[468,6]]},"2084":{"position":[[1047,6],[1236,6],[1272,8]]},"2113":{"position":[[533,6]]}}}],["revers",{"_index":353,"t":{"1931":{"position":[[705,7]]}}}],["rewrit",{"_index":1035,"t":{"2054":{"position":[[1702,7],[1721,8]]}}}],["room",{"_index":1360,"t":{"2110":{"position":[[74,5]]}}}],["root",{"_index":171,"t":{"1920":{"position":[[693,4]]},"1922":{"position":[[167,4]]},"1931":{"position":[[202,4]]},"1976":{"position":[[336,4]]},"2075":{"position":[[231,4]]}}}],["rout",{"_index":140,"t":{"1920":{"position":[[0,7],[202,5],[271,5],[289,5],[627,5],[652,5]]},"1929":{"position":[[1050,7],[1342,5],[1406,7]]},"1933":{"position":[[0,6],[216,5],[844,6]]},"1935":{"position":[[14,6]]},"1937":{"position":[[68,10]]},"1943":{"position":[[130,7],[347,5]]},"1998":{"position":[[95,6]]},"2006":{"position":[[87,6],[286,8],[358,8],[430,8]]},"2010":{"position":[[30,5]]},"2016":{"position":[[88,6]]},"2026":{"position":[[20,5],[54,6]]},"2063":{"position":[[80,5]]},"2070":{"position":[[5,8]]},"2072":{"position":[[37,7]]},"2075":{"position":[[0,5],[97,5],[156,5],[193,5],[236,6],[308,5],[418,5]]},"2077":{"position":[[0,5],[201,5],[286,5],[366,6],[378,5],[791,5]]},"2079":{"position":[[206,6]]},"2081":{"position":[[50,6]]},"2089":{"position":[[49,7]]},"2102":{"position":[[212,6]]},"2104":{"position":[[230,6]]}}}],["router",{"_index":244,"t":{"1929":{"position":[[883,6],[941,6]]},"1933":{"position":[[184,6],[282,6],[350,6],[402,6],[455,6],[508,6],[562,6],[616,6],[671,6],[727,6],[783,6],[977,6],[1031,6]]},"1935":{"position":[[109,6]]},"1937":{"position":[[33,6]]},"2079":{"position":[[124,6]]}}}],["ru",{"_index":531,"t":{"1946":{"position":[[764,2],[941,5]]}}}],["rule",{"_index":60,"t":{"1916":{"position":[[224,4]]},"2054":{"position":[[1761,6]]}}}],["run",{"_index":133,"t":{"1918":{"position":[[251,3]]},"1958":{"position":[[633,3]]},"2018":{"position":[[496,3]]},"2063":{"position":[[72,7]]},"2070":{"position":[[784,7]]},"2084":{"position":[[1304,7]]},"2099":{"position":[[413,8]]}}}],["runtim",{"_index":987,"t":{"2054":{"position":[[448,7]]}}}],["s",{"_index":917,"t":{"2032":{"position":[[564,1]]}}}],["salari",{"_index":980,"t":{"2054":{"position":[[304,6]]},"2084":{"position":[[367,6]]}}}],["same",{"_index":236,"t":{"1929":{"position":[[719,4],[977,5],[1102,5],[2580,4]]}}}],["sameorigin",{"_index":1182,"t":{"2079":{"position":[[508,13]]}}}],["samesit",{"_index":633,"t":{"1960":{"position":[[807,9],[999,9]]},"1964":{"position":[[155,8]]}}}],["satur",{"_index":1274,"t":{"2089":{"position":[[296,8]]}}}],["save",{"_index":282,"t":{"1929":{"position":[[1717,6]]},"1976":{"position":[[323,4]]},"2004":{"position":[[726,4]]},"2028":{"position":[[18,4],[525,4]]}}}],["savsgio",{"_index":1042,"t":{"2054":{"position":[[1945,8]]}}}],["scale",{"_index":1325,"t":{"2102":{"position":[[74,5]]}}}],["scope",{"_index":773,"t":{"1998":{"position":[[31,6]]}}}],["search?q=someth",{"_index":822,"t":{"2008":{"position":[[173,21]]}}}],["second",{"_index":479,"t":{"1943":{"position":[[232,6]]},"2089":{"position":[[410,6],[484,6]]},"2091":{"position":[[35,6],[114,6]]},"2093":{"position":[[35,6],[114,6]]},"2095":{"position":[[36,6],[115,6]]},"2097":{"position":[[38,6],[118,6]]}}}],["secur",{"_index":650,"t":{"1964":{"position":[[129,6]]},"2030":{"position":[[107,8]]},"2054":{"position":[[1360,6]]},"2079":{"position":[[287,8],[453,10]]}}}],["see",{"_index":137,"t":{"1918":{"position":[[313,3]]},"1929":{"position":[[1259,3],[2724,3]]},"2089":{"position":[[351,3]]},"2106":{"position":[[276,3]]},"2108":{"position":[[176,3]]}}}],["segment",{"_index":942,"t":{"2044":{"position":[[191,9]]},"2077":{"position":[[31,8]]}}}],["select",{"_index":695,"t":{"1974":{"position":[[75,6]]}}}],["send",{"_index":270,"t":{"1929":{"position":[[1578,5],[1963,7],[3360,4]]},"1994":{"position":[[0,5]]},"2024":{"position":[[29,5]]},"2032":{"position":[[33,4],[71,4]]},"2067":{"position":[[260,4],[342,4],[807,4]]}}}],["sendbyt",{"_index":906,"t":{"2032":{"position":[[339,9]]}}}],["sendstr",{"_index":907,"t":{"2032":{"position":[[349,11]]}}}],["sendstream",{"_index":908,"t":{"2032":{"position":[[365,10]]}}}],["sent",{"_index":1103,"t":{"2065":{"position":[[82,4],[162,4]]},"2089":{"position":[[175,4]]}}}],["separ",{"_index":1000,"t":{"2054":{"position":[[875,11]]}}}],["septemb",{"_index":32,"t":{"1912":{"position":[[301,9]]}}}],["serial",{"_index":1230,"t":{"2087":{"position":[[122,14]]}}}],["serv",{"_index":189,"t":{"1922":{"position":[[3,5],[206,5]]},"1931":{"position":[[25,5],[109,5],[277,5],[480,5],[559,5],[629,5],[762,7],[900,6],[1251,7],[1389,7],[1917,5]]},"2054":{"position":[[347,5]]}}}],["server",{"_index":168,"t":{"1920":{"position":[[538,7]]},"1929":{"position":[[802,6],[1918,6]]},"1931":{"position":[[1568,6]]},"2054":{"position":[[441,6]]},"2065":{"position":[[103,6]]},"2067":{"position":[[947,6]]},"2087":{"position":[[158,6]]},"2099":{"position":[[318,8],[392,7]]},"2110":{"position":[[29,7]]}}}],["server.go",{"_index":134,"t":{"1918":{"position":[[255,9]]}}}],["server.key",{"_index":461,"t":{"1939":{"position":[[500,13]]}}}],["serverhead",{"_index":220,"t":{"1929":{"position":[[206,13],[770,12]]}}}],["servic",{"_index":1098,"t":{"2063":{"position":[[1124,7]]}}}],["session",{"_index":613,"t":{"1960":{"position":[[291,10]]},"2054":{"position":[[1887,7]]}}}],["set",{"_index":110,"t":{"1916":{"position":[[1277,8]]},"1927":{"position":[[68,8],[135,13]]},"1929":{"position":[[25,8],[82,8],[272,8],[362,8],[556,8],[1360,7],[1483,4],[2035,3],[2154,3],[2278,3]]},"1931":{"position":[[1238,8],[1330,9],[1376,8],[1472,3],[1769,3]]},"1948":{"position":[[100,4]]},"1950":{"position":[[0,4]]},"1952":{"position":[[70,9]]},"1956":{"position":[[317,7]]},"1960":{"position":[[525,3],[912,3]]},"1964":{"position":[[0,3],[374,3]]},"1966":{"position":[[427,7]]},"1978":{"position":[[384,7]]},"1982":{"position":[[385,7]]},"1984":{"position":[[303,7]]},"1992":{"position":[[72,4]]},"2000":{"position":[[0,4]]},"2008":{"position":[[309,7]]},"2010":{"position":[[533,7]]},"2016":{"position":[[619,7]]},"2032":{"position":[[0,4]]},"2034":{"position":[[40,4],[163,3]]},"2036":{"position":[[0,4]]},"2038":{"position":[[0,4]]},"2042":{"position":[[0,4]]},"2046":{"position":[[0,4]]},"2054":{"position":[[769,3],[1380,7]]},"2056":{"position":[[634,8]]},"2067":{"position":[[30,3]]},"2070":{"position":[[865,4]]},"2079":{"position":[[278,3]]}}}],["sfo",{"_index":1170,"t":{"2077":{"position":[[1033,3],[1130,3]]}}}],["shard",{"_index":240,"t":{"1929":{"position":[[754,9]]}}}],["share",{"_index":1017,"t":{"2054":{"position":[[1261,7]]}}}],["ship",{"_index":972,"t":{"2054":{"position":[[6,5]]}}}],["shoe",{"_index":854,"t":{"2018":{"position":[[478,6]]}}}],["short",{"_index":879,"t":{"2022":{"position":[[390,5]]}}}],["show",{"_index":1126,"t":{"2067":{"position":[[446,5]]}}}],["shown",{"_index":363,"t":{"1931":{"position":[[980,5]]},"1960":{"position":[[583,5]]}}}],["side",{"_index":1231,"t":{"2087":{"position":[[165,4]]}}}],["signal",{"_index":644,"t":{"1962":{"position":[[64,7]]}}}],["signatur",{"_index":161,"t":{"1920":{"position":[[350,9]]},"1922":{"position":[[137,10]]},"1927":{"position":[[106,9]]},"1931":{"position":[[173,9]]},"1933":{"position":[[72,10]]},"1935":{"position":[[50,9]]},"1937":{"position":[[46,9]]},"1939":{"position":[[210,9]]},"1941":{"position":[[62,9]]},"1943":{"position":[[249,9]]},"1946":{"position":[[117,9]]},"1948":{"position":[[153,9]]},"1950":{"position":[[71,9]]},"1952":{"position":[[80,9]]},"1954":{"position":[[52,9]]},"1956":{"position":[[26,9]]},"1958":{"position":[[235,9]]},"1960":{"position":[[54,9]]},"1962":{"position":[[112,9]]},"1964":{"position":[[11,9]]},"1966":{"position":[[122,10]]},"1968":{"position":[[280,9]]},"1970":{"position":[[66,9]]},"1972":{"position":[[95,9]]},"1974":{"position":[[185,9]]},"1976":{"position":[[93,9]]},"1978":{"position":[[90,9]]},"1982":{"position":[[91,9]]},"1984":{"position":[[56,9]]},"1986":{"position":[[46,9]]},"1988":{"position":[[82,9]]},"1990":{"position":[[198,9]]},"1992":{"position":[[117,9]]},"1994":{"position":[[231,9]]},"1996":{"position":[[92,9]]},"1998":{"position":[[208,9]]},"2000":{"position":[[72,9]]},"2002":{"position":[[156,9]]},"2004":{"position":[[167,9]]},"2006":{"position":[[196,9]]},"2008":{"position":[[34,9]]},"2010":{"position":[[208,9]]},"2012":{"position":[[104,9]]},"2014":{"position":[[70,9]]},"2016":{"position":[[253,9]]},"2018":{"position":[[64,9]]},"2020":{"position":[[69,9]]},"2022":{"position":[[190,9]]},"2024":{"position":[[199,9]]},"2026":{"position":[[34,9]]},"2028":{"position":[[51,9]]},"2030":{"position":[[70,9]]},"2032":{"position":[[114,9],[483,9]]},"2034":{"position":[[190,9]]},"2036":{"position":[[154,9]]},"2038":{"position":[[67,9]]},"2042":{"position":[[67,9]]},"2044":{"position":[[201,9]]},"2046":{"position":[[96,9]]},"2048":{"position":[[195,9]]},"2050":{"position":[[45,9]]},"2052":{"position":[[177,9]]},"2056":{"position":[[175,9]]},"2058":{"position":[[252,9]]}}}],["similar",{"_index":519,"t":{"1946":{"position":[[598,7]]},"1960":{"position":[[564,7]]},"2018":{"position":[[15,7]]}}}],["simpl",{"_index":170,"t":{"1920":{"position":[[645,6]]}}}],["simpli",{"_index":756,"t":{"1994":{"position":[[159,6]]},"2104":{"position":[[140,6]]}}}],["size",{"_index":265,"t":{"1929":{"position":[[1508,4],[1540,4],[3253,4],[3317,5],[3485,4]]},"2020":{"position":[[91,5]]}}}],["skip",{"_index":1054,"t":{"2056":{"position":[[306,4],[771,4]]}}}],["slice",{"_index":796,"t":{"2004":{"position":[[160,6]]},"2020":{"position":[[35,5]]},"2044":{"position":[[17,5]]}}}],["small",{"_index":1269,"t":{"2089":{"position":[[233,6]]}}}],["smaller",{"_index":1314,"t":{"2099":{"position":[[331,7],[442,7]]}}}],["socket",{"_index":239,"t":{"1929":{"position":[[747,6]]}}}],["somestruct",{"_index":744,"t":{"1992":{"position":[[168,10],[281,11]]},"1994":{"position":[[303,10],[412,11]]}}}],["someth",{"_index":494,"t":{"1943":{"position":[[694,9]]},"2058":{"position":[[448,9]]},"2084":{"position":[[1252,9]]}}}],["soon",{"_index":67,"t":{"1916":{"position":[[333,4]]}}}],["sorri",{"_index":1101,"t":{"2063":{"position":[[1171,7],[1211,6]]}}}],["sourc",{"_index":1240,"t":{"2087":{"position":[[394,6]]}}}],["spawn",{"_index":233,"t":{"1929":{"position":[[674,5]]}}}],["special",{"_index":261,"t":{"1929":{"position":[[1444,7]]},"2054":{"position":[[266,7],[1959,7]]},"2067":{"position":[[966,7]]}}}],["specif",{"_index":149,"t":{"1920":{"position":[[135,8]]},"1931":{"position":[[1321,8]]},"1960":{"position":[[184,8]]},"1998":{"position":[[170,8]]},"2056":{"position":[[776,8]]},"2102":{"position":[[241,8]]}}}],["specifi",{"_index":362,"t":{"1931":{"position":[[929,7]]},"1939":{"position":[[41,9]]},"1946":{"position":[[15,9]]},"1948":{"position":[[12,9],[136,9]]},"1974":{"position":[[125,9]]},"1982":{"position":[[32,9]]},"1988":{"position":[[33,9]]},"1990":{"position":[[114,9]]},"2000":{"position":[[46,9]]},"2022":{"position":[[38,9],[59,9],[149,10]]},"2038":{"position":[[45,9]]},"2046":{"position":[[63,9]]},"2058":{"position":[[57,7]]},"2077":{"position":[[76,9],[217,9]]}}}],["specifiy",{"_index":385,"t":{"1933":{"position":[[104,8]]}}}],["stack",{"_index":429,"t":{"1937":{"position":[[40,5]]},"2006":{"position":[[56,5]]},"2054":{"position":[[530,5]]},"2063":{"position":[[431,6]]},"2104":{"position":[[335,5]]}}}],["standard",{"_index":1102,"t":{"2065":{"position":[[50,8]]},"2115":{"position":[[282,8]]}}}],["start",{"_index":580,"t":{"1958":{"position":[[311,5]]},"2018":{"position":[[141,5]]}}}],["static",{"_index":190,"t":{"1922":{"position":[[9,6]]},"1931":{"position":[[8,6],[31,6],[97,6],[222,10],[525,6],[770,6],[914,6],[959,6],[1259,6],[1358,6],[1397,6],[1415,6]]}}}],["statu",{"_index":869,"t":{"2022":{"position":[[69,7],[124,6],[160,6],[224,6]]},"2036":{"position":[[9,6],[37,6],[122,6]]},"2042":{"position":[[14,6]]},"2063":{"position":[[877,6],[992,6]]},"2065":{"position":[[185,6]]}}}],["statuscod",{"_index":1108,"t":{"2065":{"position":[[308,10]]},"2067":{"position":[[626,10],[716,10]]}}}],["still",{"_index":677,"t":{"1970":{"position":[[8,5]]},"2089":{"position":[[227,5],[268,5]]}}}],["store",{"_index":569,"t":{"1956":{"position":[[262,5]]},"1966":{"position":[[372,5]]},"1978":{"position":[[329,5]]},"1982":{"position":[[330,5]]},"1984":{"position":[[248,5]]},"1998":{"position":[[14,6]]},"2008":{"position":[[254,5]]},"2010":{"position":[[478,5]]},"2016":{"position":[[564,5]]},"2084":{"position":[[90,6]]}}}],["stout",{"_index":880,"t":{"2022":{"position":[[400,5]]}}}],["straightforward",{"_index":124,"t":{"1918":{"position":[[39,15]]}}}],["strict",{"_index":651,"t":{"1964":{"position":[[179,7]]}}}],["strictrout",{"_index":219,"t":{"1929":{"position":[[185,14],[846,13]]}}}],["string",{"_index":89,"t":{"1916":{"position":[[758,7]]},"1920":{"position":[[376,7]]},"1922":{"position":[[120,7],[172,7]]},"1929":{"position":[[783,6],[1662,6]]},"1931":{"position":[[207,7],[2004,6]]},"1933":{"position":[[152,7],[250,7],[318,7],[370,7],[423,7],[476,7],[530,7],[584,7],[639,7],[695,7],[751,7],[999,7]]},"1935":{"position":[[77,7]]},"1939":{"position":[[91,6]]},"1946":{"position":[[143,10],[154,6],[188,10],[199,6],[235,10],[246,6],[278,10],[289,6]]},"1948":{"position":[[186,10]]},"1950":{"position":[[99,10]]},"1954":{"position":[[44,7],[74,6]]},"1956":{"position":[[45,6]]},"1958":{"position":[[368,6],[417,6]]},"1960":{"position":[[82,10]]},"1964":{"position":[[65,6],[78,6],[90,6],[104,6],[164,6]]},"1966":{"position":[[147,7],[168,10],[179,6]]},"1968":{"position":[[316,10]]},"1976":{"position":[[119,7]]},"1978":{"position":[[117,7],[125,6]]},"1982":{"position":[[113,7],[121,6]]},"1984":{"position":[[79,6]]},"1986":{"position":[[63,6]]},"1988":{"position":[[100,8]]},"1990":{"position":[[215,7]]},"1992":{"position":[[26,6],[193,6]]},"1994":{"position":[[209,6],[273,10],[328,6]]},"1996":{"position":[[115,10]]},"1998":{"position":[[231,7]]},"2000":{"position":[[98,7]]},"2002":{"position":[[10,6],[148,7],[184,10],[195,6]]},"2004":{"position":[[153,6]]},"2008":{"position":[[60,6]]},"2010":{"position":[[167,6],[233,7],[254,10],[265,6]]},"2012":{"position":[[96,7],[130,10],[141,6]]},"2014":{"position":[[30,7],[93,6]]},"2016":{"position":[[64,6],[217,7],[245,7],[281,7],[302,10],[313,6]]},"2018":{"position":[[198,6],[225,6],[256,8]]},"2022":{"position":[[216,7]]},"2024":{"position":[[223,7],[256,10]]},"2028":{"position":[[103,7]]},"2032":{"position":[[530,7]]},"2034":{"position":[[216,7]]},"2038":{"position":[[96,7]]},"2044":{"position":[[10,6],[239,8]]},"2046":{"position":[[115,7],[123,6]]},"2048":{"position":[[218,10]]},"2075":{"position":[[116,7],[127,6],[177,7]]},"2084":{"position":[[325,6],[432,6],[533,6],[649,6],[660,6],[673,6]]},"2113":{"position":[[130,7],[151,10]]}}}],["string(newbuff",{"_index":95,"t":{"1916":{"position":[[939,17]]}}}],["strong",{"_index":310,"t":{"1929":{"position":[[2543,6]]}}}],["struct",{"_index":373,"t":{"1931":{"position":[[1304,6],[1422,6]]},"1935":{"position":[[42,7]]},"1958":{"position":[[28,7],[354,6]]},"1964":{"position":[[51,6]]},"1992":{"position":[[179,6],[265,7]]},"1994":{"position":[[314,6],[396,7]]},"2006":{"position":[[116,6]]},"2018":{"position":[[184,6]]},"2020":{"position":[[2,6]]},"2026":{"position":[[26,7]]},"2056":{"position":[[267,6]]},"2063":{"position":[[848,6]]},"2084":{"position":[[255,7],[312,7],[419,7],[628,6]]}}}],["structur",{"_index":160,"t":{"1920":{"position":[[326,11]]},"2102":{"position":[[201,10],[312,9]]}}}],["style",{"_index":210,"t":{"1924":{"position":[[123,5]]}}}],["subdomain",{"_index":939,"t":{"2044":{"position":[[26,10],[97,9],[181,9]]}}}],["subject",{"_index":1361,"t":{"2110":{"position":[[90,8]]}}}],["such",{"_index":82,"t":{"1916":{"position":[[626,4]]},"1922":{"position":[[22,4]]},"1931":{"position":[[44,4]]},"2052":{"position":[[159,5]]},"2054":{"position":[[1662,4]]},"2087":{"position":[[109,4]]}}}],["suffici",{"_index":1118,"t":{"2067":{"position":[[115,11]]}}}],["suffix",{"_index":279,"t":{"1929":{"position":[[1674,6]]},"1931":{"position":[[1654,6]]}}}],["support",{"_index":319,"t":{"1929":{"position":[[2756,9]]},"1941":{"position":[[154,7]]},"1958":{"position":[[47,8]]},"1994":{"position":[[33,8],[117,8]]},"2054":{"position":[[171,8]]},"2056":{"position":[[29,7]]},"2108":{"position":[[16,8]]}}}],["sure",{"_index":1136,"t":{"2070":{"position":[[840,4]]}}}],["switch",{"_index":1261,"t":{"2087":{"position":[[582,7]]}}}],["system",{"_index":361,"t":{"1931":{"position":[[873,7]]},"2067":{"position":[[321,7]]}}}],["tag",{"_index":1203,"t":{"2084":{"position":[[656,3]]}}}],["take",{"_index":158,"t":{"1920":{"position":[[306,5]]},"2024":{"position":[[159,4]]},"2054":{"position":[[749,5]]},"2067":{"position":[[230,4]]}}}],["task",{"_index":1229,"t":{"2087":{"position":[[103,5]]}}}],["tcp4",{"_index":442,"t":{"1939":{"position":[[138,4]]}}}],["tcp6",{"_index":443,"t":{"1939":{"position":[[146,4]]}}}],["team",{"_index":1326,"t":{"2102":{"position":[[108,4]]},"2115":{"position":[[6,4]]}}}],["techempow",{"_index":1226,"t":{"2087":{"position":[[0,11]]}}}],["techniqu",{"_index":622,"t":{"1960":{"position":[[554,9]]}}}],["templat",{"_index":317,"t":{"1929":{"position":[[2732,8]]},"2024":{"position":[[95,8],[178,8]]},"2054":{"position":[[2018,8]]},"2087":{"position":[[170,8]]},"2108":{"position":[[27,8],[156,9],[180,10]]},"2113":{"position":[[53,8],[287,10],[461,8]]},"2115":{"position":[[21,9],[75,8],[299,8],[456,8]]}}}],["term",{"_index":1331,"t":{"2102":{"position":[[192,5]]}}}],["test",{"_index":472,"t":{"1943":{"position":[[0,7],[42,4],[373,5]]},"1948":{"position":[[362,7],[419,4]]},"1958":{"position":[[637,5]]},"2018":{"position":[[500,5]]},"2084":{"position":[[1314,4]]},"2087":{"position":[[331,4]]},"2089":{"position":[[14,4],[333,4]]},"2099":{"position":[[155,4],[405,4],[495,4],[529,4],[564,4],[638,4]]}}}],["text",{"_index":507,"t":{"1946":{"position":[[315,7],[458,7]]}}}],["text/html",{"_index":512,"t":{"1946":{"position":[[428,11]]},"1974":{"position":[[343,9]]},"1990":{"position":[[253,10]]},"2024":{"position":[[37,9]]},"2046":{"position":[[194,11],[227,11]]}}}],["text/plain",{"_index":698,"t":{"1974":{"position":[[165,10],[275,10]]},"1982":{"position":[[195,12],[233,12]]},"2038":{"position":[[168,13],[203,11]]}}}],["thank",{"_index":977,"t":{"2054":{"position":[[274,6],[1967,6]]},"2067":{"position":[[974,6]]}}}],["therefor",{"_index":774,"t":{"1998":{"position":[[58,10]]}}}],["theso_reuseportsocket",{"_index":232,"t":{"1929":{"position":[[634,21]]}}}],["thing",{"_index":14,"t":{"1912":{"position":[[118,6]]}}}],["thomasvvugt/fib",{"_index":1336,"t":{"2102":{"position":[[399,17]]}}}],["those",{"_index":619,"t":{"1960":{"position":[[442,5]]}}}],["through",{"_index":805,"t":{"2004":{"position":[[563,7]]},"2028":{"position":[[362,7]]},"2058":{"position":[[128,7]]}}}],["thrown",{"_index":682,"t":{"1972":{"position":[[41,6]]},"2063":{"position":[[402,6]]}}}],["thumb",{"_index":61,"t":{"1916":{"position":[[232,6]]}}}],["time",{"_index":324,"t":{"1929":{"position":[[2819,4],[2967,6],[3088,4]]},"1931":{"position":[[541,6]]},"2054":{"position":[[783,4]]},"2058":{"position":[[882,8]]},"2099":{"position":[[215,4],[282,4],[306,4],[554,5]]}}}],["time.dur",{"_index":322,"t":{"1929":{"position":[[2791,13],[2925,13],[3052,13]]}}}],["time.hour",{"_index":631,"t":{"1960":{"position":[[779,11],[965,10]]},"1964":{"position":[[360,10]]}}}],["time.now().add",{"_index":638,"t":{"1960":{"position":[[949,15]]}}}],["time.now().add(24",{"_index":630,"t":{"1960":{"position":[[759,17]]},"1964":{"position":[[340,17]]}}}],["time.tim",{"_index":649,"t":{"1964":{"position":[[119,9]]}}}],["timeformat",{"_index":1078,"t":{"2058":{"position":[[911,11]]}}}],["timeout",{"_index":328,"t":{"1929":{"position":[[2886,7],[3014,7]]},"1943":{"position":[[157,7],[199,7]]},"2054":{"position":[[668,7]]},"2058":{"position":[[513,8]]}}}],["timezon",{"_index":1080,"t":{"2058":{"position":[[935,9]]}}}],["tip",{"_index":717,"t":{"1982":{"position":[[56,3]]},"1998":{"position":[[126,3]]},"2032":{"position":[[400,3]]},"2036":{"position":[[96,3]]}}}],["titl",{"_index":1374,"t":{"2115":{"position":[[498,8]]}}}],["tl",{"_index":449,"t":{"1939":{"position":[[252,3],[434,3]]},"1941":{"position":[[102,3]]},"2014":{"position":[[56,3]]},"2030":{"position":[[39,3]]}}}],["tls.certificate{c",{"_index":464,"t":{"1939":{"position":[[583,23]]}}}],["tls.config",{"_index":450,"t":{"1939":{"position":[[256,15]]},"1941":{"position":[[106,15]]}}}],["tls.config{certif",{"_index":463,"t":{"1939":{"position":[[557,25]]}}}],["tls.loadx509keypair(\"server.crt",{"_index":460,"t":{"1939":{"position":[[466,33]]}}}],["tls/http",{"_index":456,"t":{"1939":{"position":[[407,9]]}}}],["to/from",{"_index":1004,"t":{"2054":{"position":[[1003,7]]}}}],["tobi",{"_index":947,"t":{"2044":{"position":[[356,7],[383,8]]}}}],["tobi.ferrets.example.com",{"_index":944,"t":{"2044":{"position":[[265,26]]}}}],["token",{"_index":628,"t":{"1960":{"position":[[719,8],[900,8]]},"2004":{"position":[[365,5]]},"2054":{"position":[[1445,5]]}}}],["top",{"_index":6,"t":{"1912":{"position":[[52,3]]},"2054":{"position":[[1918,3]]}}}],["track_id",{"_index":614,"t":{"1960":{"position":[[302,11]]}}}],["transfer",{"_index":663,"t":{"1968":{"position":[[0,9]]},"2034":{"position":[[0,9]]}}}],["transpar",{"_index":375,"t":{"1931":{"position":[[1434,13]]}}}],["transport",{"_index":1179,"t":{"2079":{"position":[[443,9]]}}}],["treat",{"_index":245,"t":{"1929":{"position":[[890,6],[948,6],[1090,7]]}}}],["tri",{"_index":281,"t":{"1929":{"position":[[1711,5]]},"1931":{"position":[[1575,5]]}}}],["true",{"_index":217,"t":{"1929":{"position":[[158,5],[179,5],[200,5],[421,4],[455,4],[489,4],[2042,4],[2161,5],[2285,5]]},"1931":{"position":[[1479,4],[1776,5],[2073,5],[2090,5],[2104,5]]},"1960":{"position":[[801,5],[993,5]]},"1990":{"position":[[328,4],[350,4]]},"2030":{"position":[[27,4]]},"2034":{"position":[[173,4],[463,6]]},"2052":{"position":[[28,5],[289,4]]},"2058":{"position":[[313,4]]}}}],["tutorial.pdf",{"_index":810,"t":{"2004":{"position":[[683,14]]},"2028":{"position":[[482,14]]}}}],["type",{"_index":228,"t":{"1929":{"position":[[581,4],[2194,4],[2444,4],[2460,4]]},"1931":{"position":[[1410,4]]},"1946":{"position":[[47,5]]},"1950":{"position":[[319,5]]},"1958":{"position":[[108,5],[135,4],[342,4],[704,5],[817,5],[941,5]]},"1964":{"position":[[39,4]]},"1972":{"position":[[515,6]]},"1982":{"position":[[185,6],[223,6]]},"1990":{"position":[[29,5],[69,4],[109,4],[131,4],[247,5]]},"1992":{"position":[[163,4],[403,5],[583,5]]},"1994":{"position":[[298,4]]},"2018":{"position":[[172,4]]},"2020":{"position":[[24,4]]},"2032":{"position":[[57,5],[431,4]]},"2034":{"position":[[57,4]]},"2036":{"position":[[287,5]]},"2038":{"position":[[161,6],[197,5]]},"2046":{"position":[[17,4],[46,4]]},"2056":{"position":[[247,4]]},"2065":{"position":[[132,4],[407,4]]},"2067":{"position":[[210,5],[493,5]]},"2079":{"position":[[365,4]]},"2084":{"position":[[303,4],[320,4],[409,4],[609,4],[1380,5]]},"2113":{"position":[[76,4]]}}}],["type\"][0",{"_index":809,"t":{"2004":{"position":[[666,10]]},"2028":{"position":[[465,10]]}}}],["typic",{"_index":664,"t":{"1968":{"position":[[47,10],[187,9]]}}}],["u",{"_index":49,"t":{"1914":{"position":[[122,1]]}}}],["ubuntu",{"_index":1253,"t":{"2087":{"position":[[516,6]]}}}],["uint8",{"_index":746,"t":{"1992":{"position":[[204,5]]},"1994":{"position":[[339,5]]}}}],["unauthor",{"_index":1011,"t":{"2054":{"position":[[1170,12]]}}}],["unavail",{"_index":1099,"t":{"2063":{"position":[[1132,11]]}}}],["under",{"_index":284,"t":{"1929":{"position":[[1754,5]]}}}],["underli",{"_index":86,"t":{"1916":{"position":[[680,10]]}}}],["unescapepath",{"_index":253,"t":{"1929":{"position":[[1285,12]]}}}],["uniqu",{"_index":994,"t":{"2054":{"position":[[643,6]]}}}],["unit",{"_index":1317,"t":{"2099":{"position":[[426,4]]}}}],["unlimit",{"_index":329,"t":{"1929":{"position":[[2897,10],[3025,10]]}}}],["unsupport",{"_index":931,"t":{"2036":{"position":[[268,12]]}}}],["until",{"_index":251,"t":{"1929":{"position":[[1224,5]]}}}],["up",{"_index":15,"t":{"1912":{"position":[[125,2]]},"2077":{"position":[[315,2]]}}}],["uppercas",{"_index":581,"t":{"1958":{"position":[[325,9]]},"2018":{"position":[[155,9]]}}}],["uri",{"_index":147,"t":{"1920":{"position":[[115,3]]}}}],["url",{"_index":555,"t":{"1954":{"position":[[17,3]]},"2008":{"position":[[29,4]]},"2012":{"position":[[38,4]]},"2022":{"position":[[17,3]]},"2054":{"position":[[1734,3]]},"2077":{"position":[[27,3],[111,4]]}}}],["urlencod",{"_index":260,"t":{"1929":{"position":[[1433,10]]},"1958":{"position":[[204,10],[970,11]]}}}],["us",{"_index":47,"t":{"1914":{"position":[[88,5]]},"1916":{"position":[[197,4],[253,3],[427,4],[698,5],[1259,3]]},"1922":{"position":[[180,3]]},"1929":{"position":[[627,3],[2570,5],[3202,5]]},"1931":{"position":[[0,3],[251,3],[521,3],[699,3],[793,3],[1283,3]]},"1933":{"position":[[793,3],[807,4]]},"1941":{"position":[[35,5]]},"1943":{"position":[[55,3]]},"1956":{"position":[[299,3]]},"1960":{"position":[[605,4]]},"1966":{"position":[[409,3]]},"1970":{"position":[[25,3]]},"1974":{"position":[[59,4],[179,5]]},"1978":{"position":[[366,3]]},"1982":{"position":[[367,3]]},"1984":{"position":[[285,3]]},"1992":{"position":[[41,5]]},"1998":{"position":[[138,6]]},"2008":{"position":[[291,3]]},"2010":{"position":[[14,4],[515,3]]},"2016":{"position":[[601,3]]},"2024":{"position":[[75,4],[127,3]]},"2028":{"position":[[10,4]]},"2032":{"position":[[404,3]]},"2034":{"position":[[138,3]]},"2036":{"position":[[117,4]]},"2044":{"position":[[139,4]]},"2054":{"position":[[1599,3]]},"2056":{"position":[[86,3]]},"2058":{"position":[[187,5],[653,5],[754,3]]},"2063":{"position":[[823,3],[889,5]]},"2072":{"position":[[27,4]]},"2077":{"position":[[49,4],[153,5],[775,4],[812,6]]},"2079":{"position":[[703,3]]},"2081":{"position":[[57,5]]},"2084":{"position":[[21,3],[143,4],[219,4]]},"2089":{"position":[[180,5]]},"2102":{"position":[[459,5]]},"2108":{"position":[[150,5]]}}}],["usag",{"_index":379,"t":{"1931":{"position":[[1596,5]]}}}],["user",{"_index":666,"t":{"1968":{"position":[[83,4]]},"2012":{"position":[[249,8]]},"2048":{"position":[[348,4],[413,4],[480,4]]},"2058":{"position":[[396,5]]},"2084":{"position":[[414,4],[707,5],[1114,4],[1281,4]]}}}],["user/john",{"_index":188,"t":{"1920":{"position":[[1321,9]]}}}],["user=john",{"_index":566,"t":{"1956":{"position":[[101,9],[193,9]]}}}],["utf",{"_index":521,"t":{"1946":{"position":[[665,3]]}}}],["utils.immutablestring(c.param(\"foo",{"_index":107,"t":{"1916":{"position":[[1163,37]]}}}],["v1",{"_index":26,"t":{"1912":{"position":[[243,3]]},"1935":{"position":[[199,2]]},"2070":{"position":[[141,2],[525,2],[798,3]]},"2072":{"position":[[185,2],[258,5]]},"2081":{"position":[[144,2]]}}}],["v1.10.0",{"_index":1242,"t":{"2087":{"position":[[446,7]]}}}],["v1.9.0",{"_index":1322,"t":{"2099":{"position":[[681,6]]}}}],["v1.get(\"/list",{"_index":419,"t":{"1935":{"position":[[242,15]]},"2070":{"position":[[184,15],[559,15]]},"2072":{"position":[[290,15]]},"2081":{"position":[[187,15]]}}}],["v1.get(\"/us",{"_index":421,"t":{"1935":{"position":[[283,15]]},"2070":{"position":[[225,15],[600,15]]},"2072":{"position":[[331,15]]},"2081":{"position":[[228,15]]}}}],["v2",{"_index":28,"t":{"1912":{"position":[[264,2]]},"1935":{"position":[[324,2]]},"2070":{"position":[[266,2],[641,2],[805,3]]},"2081":{"position":[[269,2]]}}}],["v2.0.0",{"_index":30,"t":{"1912":{"position":[[278,6]]}}}],["v2.get(\"/list",{"_index":425,"t":{"1935":{"position":[[367,15]]},"2070":{"position":[[311,15],[675,15]]},"2081":{"position":[[314,15]]}}}],["v2.get(\"/us",{"_index":427,"t":{"1935":{"position":[[408,15]]},"2070":{"position":[[352,15],[716,15]]},"2081":{"position":[[355,15]]}}}],["valid",{"_index":78,"t":{"1916":{"position":[[576,5],[838,5],[987,5]]},"1929":{"position":[[1218,5]]},"1956":{"position":[[229,5]]},"1966":{"position":[[339,5]]},"1978":{"position":[[296,5]]},"1982":{"position":[[297,5]]},"1984":{"position":[[215,5]]},"2008":{"position":[[221,5]]},"2010":{"position":[[445,5]]},"2016":{"position":[[531,5]]},"2054":{"position":[[1144,5]]},"2084":{"position":[[32,9],[68,10],[106,9],[207,11],[284,10],[760,8]]}}}],["validate.struct(us",{"_index":1206,"t":{"2084":{"position":[[794,21]]}}}],["validate:\"d",{"_index":1200,"t":{"2084":{"position":[[589,17]]}}}],["validate:\"required,email,min=6,max=32",{"_index":1199,"t":{"2084":{"position":[[540,40]]}}}],["validate:\"required,eq=true|eq=fals",{"_index":1198,"t":{"2084":{"position":[[488,38]]}}}],["validate:\"required,min=3,max=32",{"_index":1195,"t":{"2084":{"position":[[332,34],[439,34]]}}}],["validate:\"required,numb",{"_index":1196,"t":{"2084":{"position":[[378,28]]}}}],["validatestruct",{"_index":1220,"t":{"2084":{"position":[[1185,16]]}}}],["validatestruct(us",{"_index":1204,"t":{"2084":{"position":[[687,19]]}}}],["validator.new",{"_index":1205,"t":{"2084":{"position":[[771,15]]}}}],["valu",{"_index":51,"t":{"1916":{"position":[[13,6],[122,6],[265,6],[374,6],[631,6],[1303,6]]},"1920":{"position":[[888,6],[941,6]]},"1929":{"position":[[836,6],[1147,6],[3178,5]]},"1931":{"position":[[1709,5],[1803,5],[1881,5],[1978,5]]},"1933":{"position":[[125,5]]},"1948":{"position":[[22,5],[146,6],[179,6]]},"1956":{"position":[[215,5]]},"1960":{"position":[[535,6],[728,6]]},"1962":{"position":[[82,6]]},"1964":{"position":[[72,5]]},"1966":{"position":[[11,5],[60,5],[325,5]]},"1978":{"position":[[9,6],[52,5],[188,5],[282,5]]},"1982":{"position":[[283,5]]},"1984":{"position":[[201,5]]},"1998":{"position":[[239,5]]},"2004":{"position":[[137,5],[423,6]]},"2008":{"position":[[207,5]]},"2010":{"position":[[83,5],[431,5]]},"2016":{"position":[[130,5],[517,5]]},"2038":{"position":[[60,6],[90,5]]},"2077":{"position":[[69,6],[129,6]]},"2084":{"position":[[667,5]]}}}],["var",{"_index":1075,"t":{"2058":{"position":[[569,3],[996,3]]},"2084":{"position":[[732,3],[887,3]]}}}],["vari",{"_index":955,"t":{"2048":{"position":[[35,4],[294,5],[334,5],[399,5],[466,5]]}}}],["variabl",{"_index":772,"t":{"1998":{"position":[[21,9]]}}}],["variou",{"_index":1019,"t":{"2054":{"position":[[1281,7],[1388,7]]}}}],["veri",{"_index":1344,"t":{"2104":{"position":[[316,4]]}}}],["version",{"_index":615,"t":{"1960":{"position":[[314,10]]}}}],["via",{"_index":684,"t":{"1972":{"position":[[69,3]]},"2067":{"position":[[34,3]]},"2110":{"position":[[171,3]]}}}],["view",{"_index":27,"t":{"1912":{"position":[[255,4]]},"1929":{"position":[[2657,5],[2663,5],[2669,5]]},"2024":{"position":[[10,4],[139,4]]},"2102":{"position":[[334,4]]},"2113":{"position":[[17,5],[70,5],[81,5],[170,5],[324,5],[371,6]]},"2115":{"position":[[388,6]]}}}],["views/index.html",{"_index":1371,"t":{"2115":{"position":[[151,16]]}}}],["virtual",{"_index":167,"t":{"1920":{"position":[[518,7]]},"1931":{"position":[[801,7]]}}}],["wait",{"_index":334,"t":{"1929":{"position":[[3096,4]]}}}],["want",{"_index":368,"t":{"1931":{"position":[[1185,4]]},"1943":{"position":[[181,4]]},"1998":{"position":[[152,4]]},"2024":{"position":[[119,4]]},"2067":{"position":[[184,4]]},"2110":{"position":[[129,4]]}}}],["weak",{"_index":309,"t":{"1929":{"position":[[2534,4],[2610,4]]}}}],["web",{"_index":3,"t":{"1912":{"position":[[29,3]]},"1960":{"position":[[336,3]]},"2054":{"position":[[1441,3]]},"2087":{"position":[[54,3]]},"2099":{"position":[[35,3],[314,3],[388,3]]}}}],["websocket",{"_index":1047,"t":{"2054":{"position":[[2070,9]]}}}],["welcom",{"_index":716,"t":{"1980":{"position":[[91,8]]},"2040":{"position":[[91,8]]}}}],["wildcard",{"_index":183,"t":{"1920":{"position":[[1176,9]]},"2077":{"position":[[525,8]]}}}],["wish",{"_index":1333,"t":{"2102":{"position":[[289,5]]}}}],["within",{"_index":63,"t":{"1916":{"position":[[272,6],[582,6],[844,6]]},"1956":{"position":[[235,6]]},"1966":{"position":[[345,6]]},"1978":{"position":[[302,6]]},"1982":{"position":[[303,6]]},"1984":{"position":[[221,6]]},"2006":{"position":[[123,6]]},"2008":{"position":[[227,6]]},"2010":{"position":[[451,6]]},"2016":{"position":[[537,6]]}}}],["word",{"_index":1343,"t":{"2104":{"position":[[204,6]]}}}],["work",{"_index":259,"t":{"1929":{"position":[[1423,4]]},"1931":{"position":[[1492,5]]},"2104":{"position":[[183,4]]},"2106":{"position":[[260,5]]}}}],["world",{"_index":131,"t":{"1918":{"position":[[217,8],[324,6]]},"1920":{"position":[[682,7],[757,8],[954,5]]},"1943":{"position":[[518,8],[822,6]]},"1970":{"position":[[280,9],[304,7]]},"1974":{"position":[[303,8],[325,6],[370,8],[451,8],[474,7]]},"2006":{"position":[[454,8]]},"2032":{"position":[[209,8],[232,7],[262,9],[286,7],[642,9],[666,7],[695,8],[718,7],[770,10],[795,7]]},"2036":{"position":[[308,8],[353,7]]},"2050":{"position":[[202,6],[238,6]]},"2079":{"position":[[691,8]]},"2113":{"position":[[578,8]]},"2115":{"position":[[515,8]]}}}],["world! Get request with value: hello world }) Optional parameter // GET http://localhost:3000/john app.Get(\"/:name?\", func(c *fiber.Ctx) { if c.Params(\"name\") != \"\" { c.Send(\"Hello \" + c.Params(\"name\")) // => Hello john } else { c.Send(\"Where is john?\") } }) Wildcards // GET http://localhost:3000/api/user/john app.Get(\"/api/*\", func(c *fiber.Ctx) { c.Send(\"API path: \" + c.Params(\"*\")) // => API path: user/john })","s":"Basic routing","u":"/v1.x/","h":"#basic-routing","p":1911},{"i":1922,"t":"To serve static files such as images, CSS, and JavaScript files, replace your function handler with a file or directory string. Function signature: app.Static(prefix, root string) Use the following code to serve files in a directory named ./public: app := fiber.New() app.Static(\"/\", \"./public\") app.Listen(8080) Now, you can load the files that are in the ./public directory: http://localhost:8080/hello.html http://localhost:8080/js/jquery.js http://localhost:8080/css/style.css","s":"Static files","u":"/v1.x/","h":"#static-files","p":1911},{"i":1924,"t":"For more information on how to build APIs in Go with Fiber, please check out this excellent article on building an express-style API in Go with Fiber","s":"Note","u":"/v1.x/","h":"#note","p":1911},{"i":1927,"t":"This method creates a new App named instance. You can pass optional settings when creating a new instance Signature fiber.New(settings ...*Settings) *App Example package main import \"github.com/gofiber/fiber\" func main() { app := fiber.New() // ... app.Listen(3000) }","s":"New","u":"/v1.x/api/app","h":"#new","p":1925},{"i":1929,"t":"You can pass application settings when calling New. Example func main() { // Pass Settings creating a new instance app := fiber.New(&fiber.Settings{ Prefork: true, CaseSensitive: true, StrictRouting: true, ServerHeader: \"Fiber\", }) // ... app.Listen(3000) } Or change the settings after initializing an app. Example func main() { app := fiber.New() // Or change Settings after creating an instance app.Settings.Prefork = true app.Settings.CaseSensitive = true app.Settings.StrictRouting = true app.Settings.ServerHeader = \"Fiber\" // ... app.Listen(3000) } Settings fields Property Type Description Default Prefork bool Enables use of theSO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding. false ServerHeader string Enables the Server HTTP header with the given value. \"\" StrictRouting bool When enabled, the router treats /foo and /foo/ as different. Otherwise, the router treats /foo and /foo/ as the same. false CaseSensitive bool When enabled, /Foo and /foo are different routes. When disabled, /Fooand /foo are treated the same. false Immutable bool When enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see the issue #185. false UnescapePath bool Converts all encoded characters in the route back before setting the path for the context, so that the routing can also work with urlencoded special characters false BodyLimit int Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends 413 - Request Entity Too Large response. 4 * 1024 * 1024 CompressedFileSuffix string Adds suffix to the original file name and tries saving the resulting compressed file under the new file name. \".fiber.gz\" Concurrency int Maximum number of concurrent connections. 256 * 1024 DisableKeepalive bool Disable keep-alive connections, the server will close incoming connections after sending the first response to client false DisableDefaultDate bool When set to true causes the default date header to be excluded from the response. false DisableDefaultContentType bool When set to true, causes the default Content-Type header to be excluded from the Response. false DisableStartupMessage bool When set to true, it will not print out the fiber ASCII and \"listening\" on message false DisableHeaderNormalizing bool By default all header names are normalized: conteNT-tYPE -> Content-Type false ETag bool Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled. false Views Views Views is the interface that wraps the Render function. See our Template Middleware for supported engines. nil ReadTimeout time.Duration The amount of time allowed to read the full request, including body. The default timeout is unlimited. nil WriteTimeout time.Duration The maximum duration before timing out writes of the response. The default timeout is unlimited. nil IdleTimeout time.Duration The maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used. nil ReadBufferSize int per-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies). 4096 WriteBufferSize int Per-connection buffer size for responses' writing. 4096","s":"Settings","u":"/v1.x/api/app","h":"#settings","p":1925},{"i":1931,"t":"Use the Static method to serve static files such as images, CSS and JavaScript. info By default, Static will serve index.html files in response to a request on a directory. Signature app.Static(prefix, root string, config ...Static) // => with prefix Use the following code to serve files in a directory named ./public Example app.Static(\"/\", \"./public\") // => http://localhost:3000/hello.html // => http://localhost:3000/js/jquery.js // => http://localhost:3000/css/style.css To serve from multiple directories, you can use Static numerous times. Example // Serve files from \"./public\" directory: app.Static(\"/\", \"./public\") // Serve files from \"./files\" directory: app.Static(\"/\", \"./files\") info Use a reverse proxy cache like NGINX to improve performance of serving static assets. You can use any virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Static method, specify a prefix path for the static directory, as shown below: Example app.Static(\"/static\", \"./public\") // => http://localhost:3000/static/hello.html // => http://localhost:3000/static/js/jquery.js // => http://localhost:3000/static/css/style.css If you want to have a little bit more control regarding the settings for serving static files. You could use the fiber.Static struct to enable specific settings. fiber.Static{} // Static represents settings for serving static files type Static struct { // Transparently compresses responses if set to true // This works differently than the github.com/gofiber/compression middleware // The server tries minimizing CPU usage by caching compressed files. // It adds \".fiber.gz\" suffix to the original file name. // Optional. Default value false Compress bool // Enables byte-range requests if set to true. // Optional. Default value false ByteRange bool // Enable directory browsing. // Optional. Default value false. Browse bool // File to serve when requesting a directory path. // Optional. Default value \"index.html\". Index string } Example app.Static(\"/\", \"./public\", fiber.Static{ Compress: true, ByteRange: true, Browse: true, Index: \"john.html\" })","s":"Static","u":"/v1.x/api/app","h":"#static","p":1925},{"i":1933,"t":"Routes an HTTP request, where METHOD is the HTTP method of the request. Signatures // Add allows you to specifiy a method as value app.Add(method, path string, handlers ...func(*Ctx)) Router // All will register the route on all methods app.All(path string, handlers ...func(*Ctx)) Router // HTTP methods app.Get(path string, handlers ...func(*Ctx)) Router app.Put(path string, handlers ...func(*Ctx)) Router app.Post(path string, handlers ...func(*Ctx)) Router app.Head(path string, handlers ...func(*Ctx)) Router app.Patch(path string, handlers ...func(*Ctx)) Router app.Trace(path string, handlers ...func(*Ctx)) Router app.Delete(path string, handlers ...func(*Ctx)) Router app.Connect(path string, handlers ...func(*Ctx)) Router app.Options(path string, handlers ...func(*Ctx)) Router // Use is mostly used for middleware modules // These routes will only match the beggining of each path // i.e. \"/john\" will match \"/john/doe\", \"/johnnnn\" app.Use(handlers ...func(*Ctx)) Router app.Use(prefix string, handlers ...func(*Ctx)) Router Example app.Use(\"/api\", func(c *fiber.Ctx) { c.Set(\"X-Custom-Header\", random.String(32)) c.Next() }) app.Get(\"/api/list\", func(c *fiber.Ctx) { c.Send(\"I'm a GET request!\") }) app.Post(\"/api/register\", func(c *fiber.Ctx) { c.Send(\"I'm a POST request!\") })","s":"HTTP Methods","u":"/v1.x/api/app","h":"#http-methods","p":1925},{"i":1935,"t":"You can group routes by creating a *Group struct. Signature app.Group(prefix string, handlers ...func(*Ctx)) Router Example func main() { app := fiber.New() api := app.Group(\"/api\", handler) // /api v1 := api.Group(\"/v1\", handler) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", handler) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user app.Listen(3000) }","s":"Group","u":"/v1.x/api/app","h":"#group","p":1925},{"i":1937,"t":"This method returns the original router stack Signature app.Stack() [][]*Route Example app := fiber.New() app.Use(handler) app.Get(\"/john\", handler) app.Post(\"/register\", handler) app.Get(\"/v1/users\", handler) app.Put(\"/user/:id\", handler) app.Head(\"/xhr\", handler) data, _ := json.MarshalIndent(app.Stack(), \"\", \" \") fmt.Println(string(data))","s":"Stack","u":"/v1.x/api/app","h":"#stack","p":1925},{"i":1939,"t":"Binds and listens for connections on the specified address. This can be an int for port or string for address. This will listen either on tcp4 or tcp6 depending on the address input (i.e. :3000 / [::1]:3000 ). Signature app.Listen(address interface{}, tls ...*tls.Config) error Examples app.Listen(8080) app.Listen(\"8080\") app.Listen(\":8080\") app.Listen(\"127.0.0.1:8080\") app.Listen(\"[::1]:8080\") To enable TLS/HTTPS you can append a TLS config. Example cer, err := tls.LoadX509KeyPair(\"server.crt\", \"server.key\") if err != nil { log.Fatal(err) } config := &tls.Config{Certificates: []tls.Certificate{cer}} app.Listen(443, config)","s":"Listen","u":"/v1.x/api/app","h":"#listen","p":1925},{"i":1941,"t":"You can pass your own net.Listener using the Listener method. Signature app.Listener(ln net.Listener, tls ...*tls.Config) error caution Listener does not support the Prefork feature. Example if ln, err = net.Listen(\"tcp\", \":8080\"); err != nil { log.Fatal(err) } app.Listener(ln)","s":"Listener","u":"/v1.x/api/app","h":"#listener","p":1925},{"i":1943,"t":"Testing your application is done with the Test method. Use this method for creating _test.go files or when you need to debug your routing logic. The default timeout is 200ms if you want to disable a timeout altogether, pass -1 as a second argument. Signature app.Test(req *http.Request, msTimeout ...int) (*http.Response, error) Example // Create route with GET method for test: app.Get(\"/\", func(c *Ctx) { fmt.Println(c.BaseURL()) // => http://google.com fmt.Println(c.Get(\"X-Custom-Header\")) // => hi c.Send(\"hello, World!\") }) // http.Request req := httptest.NewRequest(\"GET\", \"http://google.com\", nil) req.Header.Set(\"X-Custom-Header\", \"hi\") // http.Response resp, _ := app.Test(req) // Do something with results: if resp.StatusCode == 200 { body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) // => Hello, World! }","s":"Test","u":"/v1.x/api/app","h":"#test","p":1925},{"i":1946,"t":"Checks, if the specified extensions or content types are acceptable. info Based on the request’s Accept HTTP header. Signature c.Accepts(types ...string) string c.AcceptsCharsets(charsets ...string) string c.AcceptsEncodings(encodings ...string) string c.AcceptsLanguages(langs ...string) string Example // Accept: text/*, application/json app.Get(\"/\", func(c *fiber.Ctx) { c.Accepts(\"html\") // \"html\" c.Accepts(\"text/html\") // \"text/html\" c.Accepts(\"json\", \"text\") // \"json\" c.Accepts(\"application/json\") // \"application/json\" c.Accepts(\"image/png\") // \"\" c.Accepts(\"png\") // \"\" }) Fiber provides similar functions for the other accept headers. // Accept-Charset: utf-8, iso-8859-1;q=0.2 // Accept-Encoding: gzip, compress;q=0.2 // Accept-Language: en;q=0.8, nl, ru app.Get(\"/\", func(c *fiber.Ctx) { c.AcceptsCharsets(\"utf-16\", \"iso-8859-1\") // \"iso-8859-1\" c.AcceptsEncodings(\"compress\", \"br\") // \"compress\" c.AcceptsLanguages(\"pt\", \"nl\", \"ru\") // \"nl\" })","s":"Accepts","u":"/v1.x/api/ctx","h":"#accepts","p":1944},{"i":1948,"t":"Appends the specified value to the HTTP response header field. caution If the header is not already set, it creates the header with the specified value. Signature c.Append(field, values ...string) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Append(\"Link\", \"http://google.com\", \"http://localhost\") // => Link: http://localhost, http://google.com c.Append(\"Link\", \"Test\") // => Link: http://localhost, http://google.com, Test })","s":"Append","u":"/v1.x/api/ctx","h":"#append","p":1944},{"i":1950,"t":"Sets the HTTP response Content-Disposition header field to attachment. Signature c.Attachment(file ...string) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Attachment() // => Content-Disposition: attachment c.Attachment(\"./upload/images/logo.png\") // => Content-Disposition: attachment; filename=\"logo.png\" // => Content-Type: image/png })","s":"Attachment","u":"/v1.x/api/ctx","h":"#attachment","p":1944},{"i":1952,"t":"Returns the *App reference so you could easily access all application settings. Signature c.App() *App Example app.Get(\"/bodylimit\", func(c *fiber.Ctx) { bodylimit := c.App().Settings.BodyLimit c.Send(bodylimit) })","s":"App","u":"/v1.x/api/ctx","h":"#app","p":1944},{"i":1954,"t":"Returns the base URL (protocol + host) as a string. Signature c.BaseURL() string Example // GET https://example.com/page#chapter-1 app.Get(\"/\", func(c *fiber.Ctx) { c.BaseURL() // https://example.com })","s":"BaseURL","u":"/v1.x/api/ctx","h":"#baseurl","p":1944},{"i":1956,"t":"Returns the request body. Signature c.Body() string Example // curl -X POST http://localhost:8080 -d user=john app.Post(\"/\", func(c *fiber.Ctx) { // Get raw body from POST request: c.Body() // user=john }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Body","u":"/v1.x/api/ctx","h":"#body","p":1944},{"i":1958,"t":"Binds the request body to a struct. BodyParser supports decoding query parameters and the following content types based on the Content-Type header: application/json application/xml application/x-www-form-urlencoded multipart/form-data Signature c.BodyParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `json:\"name\" xml:\"name\" form:\"name\"` Pass string `json:\"pass\" xml:\"pass\" form:\"pass\"` } app.Post(\"/\", func(c *fiber.Ctx) { p := new(Person) if err := c.BodyParser(p); err != nil { log.Fatal(err) } log.Println(p.Name) // john log.Println(p.Pass) // doe }) // Run tests with the following curl commands // curl -X POST -H \"Content-Type: application/json\" --data \"{\\\"name\\\":\\\"john\\\",\\\"pass\\\":\\\"doe\\\"}\" localhost:3000 // curl -X POST -H \"Content-Type: application/xml\" --data \"johndoe\" localhost:3000 // curl -X POST -H \"Content-Type: application/x-www-form-urlencoded\" --data \"name=john&pass=doe\" localhost:3000 // curl -X POST -F name=john -F pass=doe http://localhost:3000 // curl -X POST \"http://localhost:3000/?name=john&pass=doe\"","s":"BodyParser","u":"/v1.x/api/ctx","h":"#bodyparser","p":1944},{"i":1960,"t":"Expire a client cookie (or all cookies if left empty) Signature c.ClearCookie(key ...string) Example app.Get(\"/\", func(c *fiber.Ctx) { // Clears all cookies: c.ClearCookie() // Expire specific cookie by name: c.ClearCookie(\"user\") // Expire multiple cookies by names: c.ClearCookie(\"token\", \"session\", \"track_id\", \"version\") }) caution Web browsers and other compliant clients will only clear the cookie if the given options are identical to those when creating the cookie, excluding expires and maxAge. ClearCookie will not set these values for you - a technique similar to the one shown below should be used to ensure your cookie is deleted. Example app.Get(\"/set\", func(c *fiber.Ctx) { c.Cookie(&fiber.Cookie{ Name: \"token\", Value: \"randomvalue\", Expires: time.Now().Add(24 * time.Hour), HTTPOnly: true, SameSite: \"lax\", }) }) app.Get(\"/delete\", func(c *fiber.Ctx) { c.Cookie(&fiber.Cookie{ Name: \"token\", // Set expiry date to the past Expires: time.Now().Add(-(time.Hour * 2)), HTTPOnly: true, SameSite: \"lax\", }) })","s":"ClearCookie","u":"/v1.x/api/ctx","h":"#clearcookie","p":1944},{"i":1962,"t":"Returns context.Context that carries a deadline, a cancellation signal, and other values across API boundaries. Signature c.Context() context.Context","s":"Context","u":"/v1.x/api/ctx","h":"#context","p":1944},{"i":1964,"t":"Set cookie Signature c.Cookie(*Cookie) type Cookie struct { Name string Value string Path string Domain string Expires time.Time Secure bool HTTPOnly bool SameSite string // lax, strict, none } Example app.Get(\"/\", func(c *fiber.Ctx) { // Create cookie cookie := new(fiber.Cookie) cookie.Name = \"john\" cookie.Value = \"doe\" cookie.Expires = time.Now().Add(24 * time.Hour) // Set cookie c.Cookie(cookie) })","s":"Cookie","u":"/v1.x/api/ctx","h":"#cookie","p":1944},{"i":1966,"t":"Get cookie value by key, you could pass an optional default value that will be returned if the cookie key does not exist. Signatures c.Cookies(key string, defaultValue ...string) string Example app.Get(\"/\", func(c *fiber.Ctx) { // Get cookie by key: c.Cookies(\"name\") // \"john\" c.Cookies(\"empty\", \"doe\") // \"doe\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Cookies","u":"/v1.x/api/ctx","h":"#cookies","p":1944},{"i":1968,"t":"Transfers the file from path as an attachment. Typically, browsers will prompt the user to download. By default, the Content-Disposition header filename= parameter is the file path (this typically appears in the browser dialog). Override this default with the filename parameter. Signature c.Download(path, filename ...string) error Example app.Get(\"/\", func(c *fiber.Ctx) { if err := c.Download(\"./files/report-12345.pdf\"); err != nil { c.Next(err) // Pass err to fiber } // => Download report-12345.pdf if err := c.Download(\"./files/report-12345.pdf\", \"report.pdf\"); err != nil { c.Next(err) // Pass err to fiber } // => Download report.pdf })","s":"Download","u":"/v1.x/api/ctx","h":"#download","p":1944},{"i":1970,"t":"You can still access and use all Fasthttp methods and properties. Signature info Please read the Fasthttp Documentation for more information. Example app.Get(\"/\", func(c *fiber.Ctx) { c.Fasthttp.Request.Header.Method() // => []byte(\"GET\") c.Fasthttp.Response.Write([]byte(\"Hello, World!\")) // => \"Hello, World!\" })","s":"Fasthttp","u":"/v1.x/api/ctx","h":"#fasthttp","p":1944},{"i":1972,"t":"This contains the error information that thrown by a panic or passed via the Next(err) method. Signature c.Error() error Example func main() { app := fiber.New() app.Post(\"/api/register\", func (c *fiber.Ctx) { if err := c.JSON(&User); err != nil { c.Next(err) } }) app.Get(\"/api/user\", func (c *fiber.Ctx) { if err := c.JSON(&User); err != nil { c.Next(err) } }) app.Put(\"/api/update\", func (c *fiber.Ctx) { if err := c.JSON(&User); err != nil { c.Next(err) } }) app.Use(\"/api\", func(c *fiber.Ctx) { c.Set(\"Content-Type\", \"application/json\") c.Status(500).Send(c.Error()) }) app.Listen(1337) }","s":"Error","u":"/v1.x/api/ctx","h":"#error","p":1944},{"i":1974,"t":"Performs content-negotiation on the Accept HTTP header. It uses Accepts to select a proper format. info If the header is not specified or there is no proper format, text/plain is used. Signature c.Format(body interface{}) Example app.Get(\"/\", func(c *fiber.Ctx) { // Accept: text/plain c.Format(\"Hello, World!\") // => Hello, World! // Accept: text/html c.Format(\"Hello, World!\") // =>

Hello, World!

// Accept: application/json c.Format(\"Hello, World!\") // => \"Hello, World!\" })","s":"Format","u":"/v1.x/api/ctx","h":"#format","p":1944},{"i":1976,"t":"MultipartForm files can be retrieved by name, the first file from the given key is returned. Signature c.FormFile(name string) (*multipart.FileHeader, error) Example app.Post(\"/\", func(c *fiber.Ctx) { // Get first file from form field \"document\": file, err := c.FormFile(\"document\") // Check for errors: if err == nil { // Save file to root directory: c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)) } })","s":"FormFile","u":"/v1.x/api/ctx","h":"#formfile","p":1944},{"i":1978,"t":"Any form values can be retrieved by name, the first value from the given key is returned. Signature c.FormValue(name string) string Example app.Post(\"/\", func(c *fiber.Ctx) { // Get first value from form field \"name\": c.FormValue(\"name\") // => \"john\" or \"\" if not exist }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"FormValue","u":"/v1.x/api/ctx","h":"#formvalue","p":1944},{"i":1980,"t":"https://expressjs.com/en/4x/api.html#req.fresh info Not implemented yet, pull requests are welcome!","s":"Fresh","u":"/v1.x/api/ctx","h":"#fresh","p":1944},{"i":1982,"t":"Returns the HTTP request header specified by the field. tip The match is case-insensitive. Signature c.Get(field string) string Example app.Get(\"/\", func(c *fiber.Ctx) { c.Get(\"Content-Type\") // \"text/plain\" c.Get(\"CoNtEnT-TypE\") // \"text/plain\" c.Get(\"something\") // \"\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Get","u":"/v1.x/api/ctx","h":"#get","p":1944},{"i":1984,"t":"Returns the hostname derived from the Host HTTP header. Signature c.Hostname() string Example // GET http://google.com/search app.Get(\"/\", func(c *fiber.Ctx) { c.Hostname() // \"google.com\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Hostname","u":"/v1.x/api/ctx","h":"#hostname","p":1944},{"i":1986,"t":"Returns the remote IP address of the request. Signature c.IP() string Example app.Get(\"/\", func(c *fiber.Ctx) { c.IP() // \"127.0.0.1\" })","s":"IP","u":"/v1.x/api/ctx","h":"#ip","p":1944},{"i":1988,"t":"Returns an array of IP addresses specified in the X-Forwarded-For request header. Signature c.IPs() []string Example // X-Forwarded-For: proxy1, 127.0.0.1, proxy3 app.Get(\"/\", func(c *fiber.Ctx) { c.IPs() // [\"proxy1\", \"127.0.0.1\", \"proxy3\"] })","s":"IPs","u":"/v1.x/api/ctx","h":"#ips","p":1944},{"i":1990,"t":"Returns the matching content type, if the incoming request’s Content-Type HTTP header field matches the MIME type specified by the type parameter. info If the request has no body, it returns false. Signature c.Is(t string) bool Example // Content-Type: text/html; charset=utf-8 app.Get(\"/\", func(c *fiber.Ctx) { c.Is(\"html\") // true c.Is(\".html\") // true c.Is(\"json\") // false })","s":"Is","u":"/v1.x/api/ctx","h":"#is","p":1944},{"i":1992,"t":"Converts any interface or string to JSON using Jsoniter. info JSON also sets the content header to application/json. Signature c.JSON(v interface{}) error Example type SomeStruct struct { Name string Age uint8 } app.Get(\"/json\", func(c *fiber.Ctx) { // Create data struct: data := SomeStruct{ Name: \"Grame\", Age: 20, } if err := c.JSON(data); err != nil { c.Status(500).Send(err) return } // => Content-Type: application/json // => \"{\"Name\": \"Grame\", \"Age\": 20}\" if err := c.JSON(fiber.Map{ \"name\": \"Grame\", \"age\": 20, }); err != nil { c.Status(500).Send(err) return } // => Content-Type: application/json // => \"{\"name\": \"Grame\", \"age\": 20}\" })","s":"JSON","u":"/v1.x/api/ctx","h":"#json","p":1944},{"i":1994,"t":"Sends a JSON response with JSONP support. This method is identical to JSON, except that it opts-in to JSONP callback support. By default, the callback name is simply callback. Override this by passing a named string in the method. Signature c.JSONP(v interface{}, callback ...string) error Example type SomeStruct struct { name string age uint8 } app.Get(\"/\", func(c *fiber.Ctx) { // Create data struct: data := SomeStruct{ name: \"Grame\", age: 20, } c.JSONP(data) // => callback({\"name\": \"Grame\", \"age\": 20}) c.JSONP(data, \"customFunc\") // => customFunc({\"name\": \"Grame\", \"age\": 20}) })","s":"JSONP","u":"/v1.x/api/ctx","h":"#jsonp","p":1944},{"i":1996,"t":"Joins the links followed by the property to populate the response’s Link HTTP header field. Signature c.Links(link ...string) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Link( \"http://api.example.com/users?page=2\", \"next\", \"http://api.example.com/users?page=5\", \"last\", ) // Link: ; rel=\"next\", // ; rel=\"last\" })","s":"Links","u":"/v1.x/api/ctx","h":"#links","p":1944},{"i":1998,"t":"A method that stores variables scoped to the request and, therefore, are available only to the routes that match the request. tip This is useful if you want to pass some specific data to the next middleware. Signature c.Locals(key string, value ...interface{}) interface{} Example app.Use(func(c *fiber.Ctx) { c.Locals(\"user\", \"admin\") c.Next() }) app.Get(\"/admin\", func(c *fiber.Ctx) { if c.Locals(\"user\") == \"admin\" { c.Status(200).Send(\"Welcome, admin!\") } else { c.SendStatus(403) // => 403 Forbidden } })","s":"Locals","u":"/v1.x/api/ctx","h":"#locals","p":1944},{"i":2000,"t":"Sets the response Location HTTP header to the specified path parameter. Signature c.Location(path string) Example app.Post(\"/\", func(c *fiber.Ctx) { c.Location(\"http://example.com\") c.Location(\"/foo/bar\") })","s":"Location","u":"/v1.x/api/ctx","h":"#location","p":1944},{"i":2002,"t":"Returns a string corresponding to the HTTP method of the request: GET, POST, PUT, and so on. Optionally, you could override the method by passing a string. Signature c.Method(override ...string) string Example app.Post(\"/\", func(c *fiber.Ctx) { c.Method() // \"POST\" })","s":"Method","u":"/v1.x/api/ctx","h":"#method","p":1944},{"i":2004,"t":"To access multipart form entries, you can parse the binary with MultipartForm(). This returns a map[string][]string, so given a key, the value will be a string slice. Signature c.MultipartForm() (*multipart.Form, error) Example app.Post(\"/\", func(c *fiber.Ctx) { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form if token := form.Value[\"token\"]; len(token) > 0 { // Get key value: fmt.Println(token[0]) } // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)) } } })","s":"MultipartForm","u":"/v1.x/api/ctx","h":"#multipartform","p":1944},{"i":2006,"t":"When Next is called, it executes the next method in the stack that matches the current route. You can pass an error struct within the method that will end the chaining and call the error handler. Signature c.Next(err ...error) Example app.Get(\"/\", func(c *fiber.Ctx) { fmt.Println(\"1st route!\") c.Next() }) app.Get(\"*\", func(c *fiber.Ctx) { fmt.Println(\"2nd route!\") c.Next() }) app.Get(\"/\", func(c *fiber.Ctx) { fmt.Println(\"3rd route!\") c.Send(\"Hello, World!\") })","s":"Next","u":"/v1.x/api/ctx","h":"#next","p":1944},{"i":2008,"t":"Returns the original request URL. Signature c.OriginalURL() string Example // GET http://example.com/search?q=something app.Get(\"/\", func(c *fiber.Ctx) { c.OriginalURL() // \"/search?q=something\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"OriginalURL","u":"/v1.x/api/ctx","h":"#originalurl","p":1944},{"i":2010,"t":"Method can be used to get the route parameters, you could pass an optional default value that will be returned if the param key does not exist. info Defaults to empty string (\"\"), if the param doesn't exist. Signature c.Params(param string, defaultValue ...string) string Example // GET http://example.com/user/fenny app.Get(\"/user/:name\", func(c *fiber.Ctx) { c.Params(\"name\") // \"fenny\" c.Params(\"age\", \"21\") // \"21\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...__","s":"Params","u":"/v1.x/api/ctx","h":"#params","p":1944},{"i":2012,"t":"Contains the path part of the request URL. Optionally, you could override the path by passing a string. Signature c.Path(override ...string) string Example // GET http://example.com/users?sort=desc app.Get(\"/users\", func(c *fiber.Ctx) { c.Path() // \"/users\" })","s":"Path","u":"/v1.x/api/ctx","h":"#path","p":1944},{"i":2014,"t":"Contains the request protocol string: http or https for TLS requests. Signature c.Protocol() string Example // GET http://example.com app.Get(\"/\", func(c *fiber.Ctx) { c.Protocol() // \"http\" })","s":"Protocol","u":"/v1.x/api/ctx","h":"#protocol","p":1944},{"i":2016,"t":"This property is an object containing a property for each query string parameter in the route, you could pass an optional default value that will be returned if the query key does not exist. info If there is no query string, it returns an empty string. Signature c.Query(parameter string, defaultValue ...string) string Example // GET http://example.com/shoes?order=desc&brand=nike app.Get(\"/\", func(c *fiber.Ctx) { c.Query(\"order\") // \"desc\" c.Query(\"brand\") // \"nike\" c.Query(\"empty\", \"nike\") // \"nike\" }) Returned value is only valid within the handler. Do not store any references. Make copies or use the Immutable setting instead. Read more...","s":"Query","u":"/v1.x/api/ctx","h":"#query","p":1944},{"i":2018,"t":"This method is similar to BodyParser, but for query parameters. Signature c.QueryParser(out interface{}) error Example // Field names should start with an uppercase letter type Person struct { Name string `query:\"name\"` Pass string `query:\"pass\"` Products []string `query:\"products\"` } app.Post(\"/\", func(c *fiber.Ctx) { p := new(Person) if err := c.QueryParser(p); err != nil { log.Fatal(err) } log.Println(p.Name) // john log.Println(p.Pass) // doe log.Println(p.Products) // [shoe, hat] }) // Run tests with the following curl command // curl -X POST \"http://localhost:3000/?name=john&pass=doe&products=shoe,hat\"","s":"QueryParser","u":"/v1.x/api/ctx","h":"#queryparser","p":1944},{"i":2020,"t":"A struct containing the type and a slice of ranges will be returned. Signature c.Range(int size) Example // Range: bytes=500-700, 700-900 app.Get(\"/\", func(c *fiber.Ctx) { b := c.Range(1000) if b.Type == \"bytes\" { for r := range r.Ranges { fmt.Println(r) // [500, 700] } } })","s":"Range","u":"/v1.x/api/ctx","h":"#range","p":1944},{"i":2022,"t":"Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code. info If not specified, status defaults to 302 Found. Signature c.Redirect(path string, status ...int) Example app.Get(\"/coffee\", func(c *fiber.Ctx) { c.Redirect(\"/teapot\") }) app.Get(\"/teapot\", func(c *fiber.Ctx) { c.Status(fiber.StatusTeapot).Send(\"🍡 short and stout 🍡\") }) More examples app.Get(\"/\", func(c *fiber.Ctx) { c.Redirect(\"/foo/bar\") c.Redirect(\"../login\") c.Redirect(\"http://example.com\") c.Redirect(\"http://example.com\", 301) })","s":"Redirect","u":"/v1.x/api/ctx","h":"#redirect","p":1944},{"i":2024,"t":"Renders a view with data and sends a text/html response. By default Render uses the default Go Template engine. If you want to use another View engine, please take a look at our Template middleware. Signature c.Render(file string, data interface{}, layout ...string) error","s":"Render","u":"/v1.x/api/ctx","h":"#render","p":1944},{"i":2026,"t":"Returns the matched Route struct. Signature c.Route() *Route Example // http://localhost:8080/hello handler := func(c *fiber.Ctx) { r := c.Route() fmt.Println(r.Method, r.Path, r.Params, r.Handlers) // GET /hello/:name handler [name] } app.Get(\"/hello/:name\", handler )","s":"Route","u":"/v1.x/api/ctx","h":"#route","p":1944},{"i":2028,"t":"Method is used to save any multipart file to disk. Signature c.SaveFile(fh *multipart.FileHeader, path string) Example app.Post(\"/\", func(c *fiber.Ctx) { // Parse the multipart form: if form, err := c.MultipartForm(); err == nil { // => *multipart.Form // Get all files from \"documents\" key: files := form.File[\"documents\"] // => []*multipart.FileHeader // Loop through files: for _, file := range files { fmt.Println(file.Filename, file.Size, file.Header[\"Content-Type\"][0]) // => \"tutorial.pdf\" 360641 \"application/pdf\" // Save the files to disk: c.SaveFile(file, fmt.Sprintf(\"./%s\", file.Filename)) } } })","s":"SaveFile","u":"/v1.x/api/ctx","h":"#savefile","p":1944},{"i":2030,"t":"A boolean property that is true , if a TLS connection is established. Signature c.Secure() bool Example // Secure() method is equivalent to: c.Protocol() == \"https\"","s":"Secure","u":"/v1.x/api/ctx","h":"#secure","p":1944},{"i":2032,"t":"Sets the HTTP response body. The Send body can be of any type. caution Send doesn't append like the Write method. Signature c.Send(body ...interface{}) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Send(\"Hello, World!\") // => \"Hello, World!\" c.Send([]byte(\"Hello, World!\")) // => \"Hello, World!\" c.Send(123) // => 123 }) Fiber also provides SendBytes ,SendString and SendStream methods for raw inputs. tip Use this if you don't need type assertion, recommended for faster performance. Signature c.SendBytes(b []byte) c.SendString(s string) c.SendStream(r io.Reader, s ...int) Example app.Get(\"/\", func(c *fiber.Ctx) { c.SendByte([]byte(\"Hello, World!\")) // => \"Hello, World!\" c.SendString(\"Hello, World!\") // => \"Hello, World!\" c.SendStream(bytes.NewReader([]byte(\"Hello, World!\"))) // => \"Hello, World!\" })","s":"Send","u":"/v1.x/api/ctx","h":"#send","p":1944},{"i":2034,"t":"Transfers the file from the given path. Sets the Content-Type response HTTP header field based on the filenames extension. caution Method use gzipping by default, set it to true to disable. Signature c.SendFile(path string, compress ...bool) error Example app.Get(\"/not-found\", func(c *fiber.Ctx) { if err := c.SendFile(\"./public/404.html\"); err != nil { c.Next(err) // pass err to ErrorHandler } // Enable compression if err := c.SendFile(\"./static/index.html\", true); err != nil { c.Next(err) // pass err to ErrorHandler } })","s":"SendFile","u":"/v1.x/api/ctx","h":"#sendfile","p":1944},{"i":2036,"t":"Sets the status code and the correct status message in the body, if the response body is empty. tip You can find all used status codes and messages here. Signature c.SendStatus(status int) Example app.Get(\"/not-found\", func(c *fiber.Ctx) { c.SendStatus(415) // => 415 \"Unsupported Media Type\" c.Send(\"Hello, World!\") c.SendStatus(415) // => 415 \"Hello, World!\" })","s":"SendStatus","u":"/v1.x/api/ctx","h":"#sendstatus","p":1944},{"i":2038,"t":"Sets the response’s HTTP header field to the specified key, value. Signature c.Set(field, value string) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Set(\"Content-Type\", \"text/plain\") // => \"Content-type: text/plain\" })","s":"Set","u":"/v1.x/api/ctx","h":"#set","p":1944},{"i":2040,"t":"https://expressjs.com/en/4x/api.html#req.fresh info Not implemented yet, pull requests are welcome!","s":"Stale","u":"/v1.x/api/ctx","h":"#stale","p":1944},{"i":2042,"t":"Sets the HTTP status for the response. info Method is a chainable. Signature c.Status(status int) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Status(200) c.Status(400).Send(\"Bad Request\") c.Status(404).SendFile(\"./public/gopher.png\") })","s":"Status","u":"/v1.x/api/ctx","h":"#status","p":1944},{"i":2044,"t":"Returns a string slice of subdomains in the domain name of the request. The application property subdomain offset, which defaults to 2, is used for determining the beginning of the subdomain segments. Signature c.Subdomains(offset ...int) []string Example // Host: \"tobi.ferrets.example.com\" app.Get(\"/\", func(c *fiber.Ctx) { c.Subdomains() // [\"ferrets\", \"tobi\"] c.Subdomains(1) // [\"tobi\"] })","s":"Subdomains","u":"/v1.x/api/ctx","h":"#subdomains","p":1944},{"i":2046,"t":"Sets the Content-Type HTTP header to the MIME type listed here specified by the file extension. Signature c.Type(t string) string Example app.Get(\"/\", func(c *fiber.Ctx) { c.Type(\".html\") // => \"text/html\" c.Type(\"html\") // => \"text/html\" c.Type(\"json\") // => \"application/json\" c.Type(\"png\") // => \"image/png\" })","s":"Type","u":"/v1.x/api/ctx","h":"#type","p":1944},{"i":2048,"t":"Adds the given header field to the Vary response header. This will append the header, if not already listed, otherwise leaves it listed in the current location. info Multiple fields are allowed. Signature c.Vary(field ...string) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Vary(\"Origin\") // => Vary: Origin c.Vary(\"User-Agent\") // => Vary: Origin, User-Agent // No duplicates c.Vary(\"Origin\") // => Vary: Origin, User-Agent c.Vary(\"Accept-Encoding\", \"Accept\") // => Vary: Origin, User-Agent, Accept-Encoding, Accept })","s":"Vary","u":"/v1.x/api/ctx","h":"#vary","p":1944},{"i":2050,"t":"Appends any input to the HTTP body response. Signature c.Write(body ...interface{}) Example app.Get(\"/\", func(c *fiber.Ctx) { c.Write(\"Hello, \") // => \"Hello, \" c.Write([]byte(\"World! \")) // => \"Hello, World! \" c.Write(123) // => \"Hello, World! 123\" })","s":"Write","u":"/v1.x/api/ctx","h":"#write","p":1944},{"i":2052,"t":"A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery). Signature c.XHR() bool Example // X-Requested-With: XMLHttpRequest app.Get(\"/\", func(c *fiber.Ctx) { c.XHR() // true })","s":"XHR","u":"/v1.x/api/ctx","h":"#xhr","p":1944},{"i":2054,"t":"Fiber ships with multiple middleware modules by default: import ( \"github.com/gofiber/fiber\" \"github.com/gofiber/fiber/middleware\" ) ****Compress Compress middleware that supports deflate, gzip and brotli compression. ****FileSystem FileSystem middleware for Fiber, special thanks and credits to Alireza Salary Favicon Ignore favicon from logs or serve from memory if a file path is provided. Logger HTTP request/response logger. Pprof HTTP server runtime profiling Recover Recover middleware recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler. RequestID Request ID middleware generates a unique id for a request. Timeout A wrapper function for handlers which will raise an error if the handler takes longer than a set amount of time to return Fiber also maintains external middleware modules, these have to be installed separately: import ( \"github.com/gofiber/fiber\" \"github.com/gofiber/\" ) gofiber/adaptor Converter for net/http handlers to/from Fiber request handlers. gofiber/basicauth Basic auth middleware provides an HTTP basic authentication. It calls the next handler for valid credentials and 401 Unauthorized for missing or invalid credentials. gofiber/cors Enable cross-origin resource sharing (CORS) with various options. gofiber/csrf Protect from CSRF exploits. gofiber/helmet Helps secure your apps by setting various HTTP headers. gofiber/jwt JWT returns a JSON Web Token (JWT) auth middleware. gofiber/keyauth Key auth middleware provides a key-based authentication. gofiber/limiter Rate-limiting middleware for Fiber. Use to limit repeated requests to public APIs and/or endpoints such as password reset. gofiber/rewrite Rewrite middleware rewrites the URL path based on provided rules. It can be helpful for backward compatibility or just creating cleaner and more descriptive links. gofiber/session This session middleware is built on top of fasthttp/session by @savsgio MIT. Special thanks to gofiber/template This package contains 8 template engines gofiber/websocket Based on Gorilla WebSocket for Fiber","s":"🧬 Middleware","u":"/v1.x/api/middleware","h":"","p":2053},{"i":2056,"t":"Compress middleware for with support for deflate, gzip and brotlicompression. It will use the fastest compression method depending on the request header Accept-Encodingvalue. Signature func Compress(options ...interface{}) fiber.Handler {} Config type CompressConfig struct { // Next defines a function to skip this middleware. // Default: nil Next func(*fiber.Ctx) bool // Compression level for brotli, gzip and deflate // CompressLevelDisabled = -1 // CompressLevelDefault = 0 // CompressLevelBestSpeed = 1 // CompressLevelBestCompression = 2 // Default: CompressLevelDefault Level int } Example // Compression handler with default settings app.Use(middleware.Compress()) // Provide a custom compression level app.Use(middleware.Compress(2)) // Pass a next function to skip specific requests app.Use(middleware.Compress(func(c *fiber.Ctx) bool { return c.Path() == \"/dontcompress\" })) // Provide a full Config app.Use(middleware.Compress(middleware.CompressConfig{ Next: func(c *fiber.Ctx) bool { return c.Path() == \"/dontcompress\" }, Level: CompressLevelDefault, })","s":"Compress","u":"/v1.x/api/middleware","h":"#compress","p":2053},{"i":2058,"t":"When adding middleware to your application, you can also specify when the middleware should be activated and when it should not through a function passed when initialising the middleware using a function passed in the configuration for the middleware. Signature func (*fiber.Ctx) bool This function should return true if the middleware should be deactivated. For example, if you would like admin users to be exempt from rate-limiting, you could do something like this: Example app.Use(limiter.New(limiter.Config{ Timeout: 10, Max: 3, Filter: func (c *fiber.Ctx) bool { var isUserAdmin bool // Your logic here return isUserAdmin } })) caution If you are using middleware that is included with Fiber by default (for example Compress or Logger), you should use the Next field instead of the Filter field. For example: Example app.Use(middleware.Logger(middleware.LoggerConfig{ Format: \"${time} ${method} ${path}\", TimeFormat: \"15:04:05\", TimeZone: \"Asia/Chongqing\", Next: func (c *fiber.Ctx) bool { var isUserAdmin bool // Your logic here return isUserAdmin } }))","s":"Skipping middleware execution","u":"/v1.x/api/middleware","h":"#skipping-middleware-execution","p":2053},{"i":2063,"t":"It’s essential to ensure that Fiber catches all errors that occur while running route handlers and middleware. You must return them to the handler function, where Fiber will catch and process them. Example app.Get(\"/\", func(c *fiber.Ctx) { err := c.SendFile(\"file-does-not-exist\") if err != nil { c.Next(err) // Pass error to Fiber } }) Fiber does not handle panics by default. To recover from a panic thrown by any handler in the stack, you need to include the Recover middleware below: Example package main import ( \"github.com/gofiber/fiber\" \"github.com/gofiber/fiber/middleware\" ) func main() { app := fiber.New() app.Use(middleware.Recover()) app.Get(\"/\", func(c *fiber.Ctx) { panic(\"This panic is catched by the ErrorHandler\") }) log.Fatal(app.Listen(3000)) } Because ctx.Next() accepts an error interface, you could use Fiber's custom error struct to pass an additional status code using fiber.NewError(). It's optional to pass a message; if this is left empty, it will default to the status code message (404 equals Not Found). Example app.Get(\"/\", func(c *fiber.Ctx) { err := fiber.NewError(503) c.Next(err) // 503 Service Unavailable err := fiber.NewError(404, \"Sorry, not found!\") c.Next(err) // 404 Sorry, not found! })","s":"Catching Errors","u":"/v1.x/guide/error-handling","h":"#catching-errors","p":2061},{"i":2065,"t":"Fiber provides an error handler by default. For a standard error, the response is sent as 500 Internal Server Error. If error is of type fiber*Error, response is sent with the provided status code and message. Example // Default error handler app.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) { // Statuscode defaults to 500 code := fiber.StatusInternalServerError // Check if it's an fiber.Error type if e, ok := err.(*fiber.Error); ok { code = e.Code } // Return HTTP response ctx.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8) ctx.Status(code).SendString(err.Error()) }","s":"Default Error Handler","u":"/v1.x/guide/error-handling","h":"#default-error-handler","p":2061},{"i":2067,"t":"A custom error handler can be set via app.Settings.ErrorHandler In most cases, the default error handler should be sufficient. However, a custom error handler can come in handy if you want to capture different types of errors and take action accordingly e.g., send a notification email or log an error to the centralized system. You can also send customized responses to the client e.g., error page or just a JSON response. The following example shows how to display error pages for different types of errors. Example app := fiber.New() // Custom error handler app.Settings.ErrorHandler = func(ctx *fiber.Ctx, err error) { // Statuscode defaults to 500 code := fiber.StatusInternalServerError // Retrieve the custom statuscode if it's an fiber.*Error if e, ok := err.(*fiber.Error); ok { code = e.Code } // Send custom error page err = ctx.Status(code).SendFile(fmt.Sprintf(\"./%d.html\", code)) if err != nil { ctx.Status(500).SendString(\"Internal Server Error\") } } Special thanks to the Echo & Express framework for inspiration regarding error handling.","s":"Custom Error Handler","u":"/v1.x/guide/error-handling","h":"#custom-error-handler","p":2061},{"i":2070,"t":"Like Routing, groups can also have paths that belong to a cluster. func main() { app := fiber.New() api := app.Group(\"/api\", cors()) // /api v1 := api.Group(\"/v1\", mysql()) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", mongodb()) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user app.Listen(3000) } A Group of paths can have an optional handler. func main() { app := fiber.New() api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\") // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\") // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user app.Listen(3000) } caution Running /api, /v1 or /v2 will result in 404 error, make sure you have the errors set.","s":"Paths","u":"/v1.x/guide/grouping","h":"#paths","p":2068},{"i":2072,"t":"Group handlers can also be used as a routing path but they must have Next added to them so that the flow can continue. func main() { app := fiber.New() api := app.Group(\"/api\") // /api v1 := api.Group(\"/v1\", func(c *fiber.Ctx) { c.JSON(fiber.Map{ \"message\": \"v1\", }) c.Next() }) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user app.Listen(3000) }","s":"Group Handlers","u":"/v1.x/guide/grouping","h":"#group-handlers","p":2068},{"i":2075,"t":"Route paths, combined with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns. Examples of route paths based on strings // This route path will match requests to the root route, \"/\": app.Get(\"/\", func(c *fiber.Ctx) { c.Send(\"root\") }) // This route path will match requests to \"/about\": app.Get(\"/about\", func(c *fiber.Ctx) { c.Send(\"about\") }) // This route path will match requests to \"/random.txt\": app.Get(\"/random.txt\", func(c *fiber.Ctx) { c.Send(\"random.txt\") })","s":"Paths","u":"/v1.x/guide/routing","h":"#paths","p":2073},{"i":2077,"t":"Route parameters are named URL segments that are used to capture the values specified at their position in the URL. The obtained values can be retrieved using the Params function, with the name of the route parameter specified in the path as their respective keys. info The name of the route parameter must be made up of characters ([A-Za-z0-9_]). Example of define routes with route parameters // Parameters app.Get(\"/user/:name/books/:title\", func(c *fiber.Ctx) { c.Write(c.Params(\"name\")) c.Write(c.Params(\"title\")) }) // Wildcard app.Get(\"/user/*\", func(c *fiber.Ctx) { c.Send(c.Params(\"*\")) }) // Optional parameter app.Get(\"/user/:name?\", func(c *fiber.Ctx) { c.Send(c.Params(\"name\")) }) info Since the hyphen (-) and the dot (.) are interpreted literally, they can be used along with route parameters for useful purposes. // http://localhost:3000/plantae/prunus.persica app.Get(\"/plantae/:genus.:species\", func(c *fiber.Ctx) { c.Params(\"genus\") // prunus c.Params(\"species\") // persica }) // http://localhost:3000/flights/LAX-SFO app.Get(\"/flights/:from-:to\", func(c *fiber.Ctx) { c.Params(\"from\") // LAX c.Params(\"to\") // SFO })","s":"Parameters","u":"/v1.x/guide/routing","h":"#parameters","p":2073},{"i":2079,"t":"Functions that are designed to make changes to the request or response are called middleware functions. The Next is a Fiber router function, when called, executes the next function that matches the current route. Example of a middleware function app.Use(func(c *fiber.Ctx) { // Set some security headers: c.Set(\"X-XSS-Protection\", \"1; mode=block\") c.Set(\"X-Content-Type-Options\", \"nosniff\") c.Set(\"X-Download-Options\", \"noopen\") c.Set(\"Strict-Transport-Security\", \"max-age=5184000\") c.Set(\"X-Frame-Options\", \"SAMEORIGIN\") c.Set(\"X-DNS-Prefetch-Control\", \"off\") // Go to next middleware: c.Next() // End of the chain fmt.Println(\"Bye πŸ‘‹!\") }) app.Get(\"/\", func(c *fiber.Ctx) { c.Send(\"Hello, World!\") }) Use method path is a mount, or prefix path, and limits middleware to only apply to any paths requested that begin with it.","s":"Middleware","u":"/v1.x/guide/routing","h":"#middleware","p":2073},{"i":2081,"t":"If you have many endpoints, you can organize your routes using Group. func main() { app := fiber.New() api := app.Group(\"/api\", cors()) // /api v1 := api.Group(\"/v1\", mysql()) // /api/v1 v1.Get(\"/list\", handler) // /api/v1/list v1.Get(\"/user\", handler) // /api/v1/user v2 := api.Group(\"/v2\", mongodb()) // /api/v2 v2.Get(\"/list\", handler) // /api/v2/list v2.Get(\"/user\", handler) // /api/v2/user app.Listen(3000) }","s":"Grouping","u":"/v1.x/guide/routing","h":"#grouping","p":2073},{"i":2084,"t":"Fiber provides a Views interface to provide your own template engine: Views type Views interface { Load() error Render(io.Writer, string, interface{}, ...string) error } Views interface contains a Load and Render method, Load is executed by Fiber on app initialization to load/parse the templates. // Pass engine to Fiber's Views Engine app := fiber.New(&fiber.Settings{ Views: engine, }) The Render method is linked to the ctx.Render() function that accepts a template name and binding data. app.Get(\"/\", func(c *fiber.Ctx) error { return c.Render(\"index\", fiber.Map{ \"hello\": \"world\", }); })","s":"Template interfaces","u":"/v1.x/guide/templates","h":"#template-interfaces","p":2082},{"i":2086,"t":"Fiber team maintains templates package that provides wrappers for multiple template engines: html ace amber django handlebars jet mustache pug Example views/index.html package main import ( \"github.com/gofiber/fiber\" \"github.com/gofiber/template/html\" ) func main() { // Initialize standard Go html template engine engine := html.New(\"./views\", \".html\") app := fiber.New(&fiber.Settings{ Views: engine, }) app.Get(\"/\", func(c *fiber.Ctx) { // Render index template _ = c.Render(\"index\", fiber.Map{ \"Title\": \"Hello, World!\", }) }) app.Listen(3000) }

{{.Title}}

","s":"Engines","u":"/v1.x/guide/templates","h":"#engines","p":2082},{"i":2089,"t":"Fiber can make great use of the validator package to ensure correct validation of data to store. Official validator Github page (Installation, use, examples..). You can find the detailed descriptions of the validations used in the fields contained on the structs below: Detailed docs Validation Example type Job struct{ Type string `validate:\"required,min=3,max=32\"` Salary int `validate:\"required,number\"` } type User struct{ Name string `validate:\"required,min=3,max=32\"` IsActive bool `validate:\"required,eq=True|eq=False\"` Email string `validate:\"required,email,min=6,max=32\"` Job Job `validate:\"dive\"` } type ErrorResponse struct { FailedField string Tag string Value string } func ValidateStruct(user User) []*ErrorResponse { var errors []*ErrorResponse validate = validator.New() err := validate.Struct(user) if err != nil { for _, err := range err.(validator.ValidationErrors) { var element ErrorResponse element.FailedField = err.StructNamespace() element.Tag = err.Tag() element.Value = err.Param() errors = append(errors, &element) } } return errors } func AddUser(c *fiber.Ctx) { //Connect to database user := new(User) if err := c.BodyParser(user); err != nil { errors := ValidateStruct() if errors != nil { c.JSON(errors) return } } //Do something else here //Return user c.JSON(user) } // Running a test with the following curl commands // curl -X POST -H \"Content-Type: application/json\" --data \"{\\\"name\\\":\\\"john\\\",\\\"isactive\\\":\\\"True\\\"}\" http://localhost:8080/register/user // Results in // [{\"FailedField\":\"User.Email\",\"Tag\":\"required\",\"Value\":\"\"},{\"FailedField\":\"User.Job.Salary\",\"Tag\":\"required\",\"Value\":\"\"},{\"FailedField\":\"User.Job.Type\",\"Tag\":\"required\",\"Value\":\"\"}]⏎","s":"Validator package","u":"/v1.x/guide/validating","h":"#validator-package","p":2087},{"i":2092,"t":"TechEmpower provides a performance comparison of many web application frameworks executing fundamental tasks such as JSON serialization, database access, and server-side template composition. Each framework is operating in a realistic production configuration. Results are captured on cloud instances and on physical hardware. The test implementations are largely community-contributed and all source is available at the GitHub repository. Fiber v1.10.0 28 HT Cores Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz 32GB RAM Ubuntu 18.04.3 4.15.0-88-generic Dedicated Cisco 10-Gbit Ethernet switch.","s":"TechEmpower","u":"/v1.x/misc/benchmarks","h":"#techempower","p":2090},{"i":2094,"t":"The Plaintext test is an exercise of the request-routing fundamentals only, designed to demonstrate the capacity of high-performance platforms in particular. Requests will be sent using HTTP pipelining. The response payload is still small, meaning good performance is still necessary in order to saturate the gigabit Ethernet of the test environment. See Plaintext requirements Fiber - 6,162,556 responses per second with an average latency of 2.0 ms. Express - 367,069 responses per second with an average latency of 354.1 ms.","s":"Plaintext","u":"/v1.x/misc/benchmarks","h":"#plaintext","p":2090},{"i":2096,"t":"Fiber handled 11,846 responses per second with an average latency of 42.8 ms. Express handled 2,066 responses per second with an average latency of 390.44 ms.","s":"Data Updates","u":"/v1.x/misc/benchmarks","h":"#data-updates","p":2090},{"i":2098,"t":"Fiber handled 19,664 responses per second with an average latency of 25.7 ms. Express handled 4,302 responses per second with an average latency of 117.2 ms.","s":"Multiple Queries","u":"/v1.x/misc/benchmarks","h":"#multiple-queries","p":2090},{"i":2100,"t":"Fiber handled 368,647 responses per second with an average latency of 0.7 ms. Express handled 57,880 responses per second with an average latency of 4.4 ms.","s":"Single Query","u":"/v1.x/misc/benchmarks","h":"#single-query","p":2090},{"i":2102,"t":"Fiber handled 1,146,667 responses per second with an average latency of 0.4 ms. Express handled 244,847 responses per second with an average latency of 1.1 ms.","s":"JSON Serialization","u":"/v1.x/misc/benchmarks","h":"#json-serialization","p":2090},{"i":2104,"t":"πŸ”— https://github.com/smallnest/go-web-framework-benchmark CPU Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz MEM 4GB GO go1.13.6 linux/amd64 OS Linux The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers. The concurrency clients are 5000. Latency is the time of real processing time by web servers. The smaller is the better. Allocs is the heap allocations by web servers when test is running. The unit is MB. The smaller is the better. If we enable http pipelining, test result as below: Concurrency test in 30 ms processing time, the test result for 100, 1000, 5000 clients is: If we enable http pipelining, test result as below: Dependency graph for v1.9.0","s":"Go web framework benchmark","u":"/v1.x/misc/benchmarks","h":"#go-web-framework-benchmark","p":2090},{"i":2107,"t":"There is no definitive answer to this question. The answer depends on the scale of your application and the team that is involved. To be as flexible as possible, Fiber makes no assumptions in terms of structure. Routes and other application-specific logic can live in as many files as you wish, in any directory structure you prefer. View the following examples for inspiration: gofiber/boilerplate thomasvvugt/fiber-boilerplate Youtube - Building a REST API using Gorm and Fiber","s":"How should I structure my application?","u":"/v1.x/misc/faq","h":"#how-should-i-structure-my-application","p":2105},{"i":2109,"t":"In Fiber, 404 responses are not the result of an error, so the error handler will not capture them. This behavior is because a 404 response simply indicates the absence of additional work to do; in other words, Fiber has found no routes that match the request. All you need to do is add a middleware function at the very bottom of the stack (below all other functions) to handle a 404 response: Example app.Use(func(c *fiber.Ctx) { c.Status(fiber.StatusNotFound).SendString(\"Sorry can't find that!\") })","s":"How do I handle custom 404 responses?","u":"/v1.x/misc/faq","h":"#how-do-i-handle-custom-404-responses","p":2105},{"i":2111,"t":"To override the default error handler, provide a custom handler to the app.Settings.ErrorHandler Example app.Settings.ErrorHandler = func(c *fiber.Ctx, err error) { c.Status(500).SendString(err.Error()) } We have a dedicated page explaining how error handling works in Fiber, see Error Handling.","s":"How do I set up an error handler?","u":"/v1.x/misc/faq","h":"#how-do-i-set-up-an-error-handler","p":2105},{"i":2113,"t":"Fiber currently supports 8 template engines in our gofiber/template middleware: Ace Amber Django Handlebars HTML Jet Mustache Pug To learn more about using Templates in Fiber, see Templates.","s":"Which template engines does Fiber support?","u":"/v1.x/misc/faq","h":"#which-template-engines-does-fiber-support","p":2105},{"i":2115,"t":"Yes, we have our own Discord server, where we hang out. We have different rooms for every subject. If you have questions or just want to have a chat, feel free to join us via this > invite link <.","s":"Does Fiber have a community chat?","u":"/v1.x/misc/faq","h":"#does-fiber-have-a-community-chat","p":2105}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/1912",[0,1.893,1,2.753,2,3.752,3,3.243,4,3.469,5,3.752,6,4.131,7,4.131,8,4.131,9,1.431,10,2.894,11,2.628,12,4.964,13,4.706,14,4.706,15,4.131,16,4.706,17,4.706,18,4.131,19,4.131,20,4.131,21,3.829,22,4.706,23,2.628,24,5.465,25,4.706,26,3.243,27,3.055,28,3.469,29,3.055,30,4.706,31,4.706,32,4.706,33,4.706,34,4.706,35,2.515,36,4.131,37,3.469,38,3.752,39,2.515]],["t/1914",[11,4.372,40,4.161,41,4.814,42,5.812,43,6.038,44,6.038,45,5.3,46,5.3,47,1.313,48,4.451,49,6.038,50,3.92]],["t/1916",[0,0.824,21,2.573,23,1.512,29,2.716,37,1.997,47,1.352,51,2.314,52,1.562,53,0.555,54,3.512,55,1.566,56,2.708,57,2.377,58,4.184,59,1.272,60,2.377,61,2.708,62,4.077,63,2.733,64,1.511,65,2.377,66,1.389,67,2.708,68,2.377,69,2.708,70,1.584,71,2.708,72,0.288,73,1.913,74,4.184,75,0.304,76,4.008,77,4.184,78,2.519,79,1.272,80,1.867,81,5.113,82,1.758,83,2.708,84,1.985,85,2.336,86,2.708,87,2.377,88,2.708,89,0.43,90,2.708,91,2.708,92,2.708,93,2.708,94,4.184,95,2.708,96,2.708,97,1.334,98,1.666,99,2.708,100,1.285,101,2.708,102,2.159,103,2.708,104,1.666,105,2.708,106,0.281,107,2.708,108,2.377,109,2.708,110,0.756,111,1.997,112,2.377,113,2.708,114,2.377,115,2.708,116,1.195,117,1.997,118,1.997,119,1.867,120,2.708,121,2.377]],["t/1918",[0,1.536,11,2.821,50,3.28,53,0.451,70,2.955,73,2.31,75,0.303,97,2.489,104,3.107,106,0.525,122,5.052,123,4.435,124,5.052,125,2.688,126,3.485,127,3.482,128,2.489,129,1.098,130,3.107,131,3.213,132,2.955,133,3.107,134,5.052,135,4.435,136,4.435,137,3.482,138,2.7,139,3.724]],["t/1920",[0,0.827,9,1.277,35,1.454,39,1.454,51,1.478,53,0.514,59,1.894,62,2.169,64,0.804,66,1.395,75,0.328,79,1.559,89,0.432,100,2.432,106,0.599,125,1.121,129,0.591,130,2.582,131,2.526,138,2.74,140,2.389,141,2.388,142,1.591,143,4.199,144,1.766,145,2.388,146,2.005,147,2.72,148,2.626,149,1.766,150,3.685,151,2.582,152,1.2,153,2.005,154,1.673,155,2.893,156,2.244,157,2.388,158,2.005,159,1.519,160,2.388,161,0.272,162,2.72,163,3.685,164,2.005,165,2.72,166,2.72,167,2.388,168,1.519,169,2.388,170,2.72,171,1.875,172,2.344,173,2.72,174,2.72,175,2.72,176,2.72,177,1.2,178,2.72,179,2.72,180,3.685,181,2.582,182,2.72,183,2.388,184,2.72,185,2.72,186,2.72,187,2.72,188,2.72]],["t/1922",[47,1.047,64,1.423,75,0.185,82,3.127,89,1.003,100,2.998,108,4.228,125,1.985,128,2.373,159,2.689,161,0.482,171,3.319,189,5.04,190,4.228,191,3.833,192,4.228,193,4.228,194,4.228,195,4.816,196,5.202,197,4.228,198,2.962,199,1.985,200,5.626,201,4.228,202,4.228,203,4.228,204,4.816,205,4.816,206,4.816]],["t/1924",[0,2.191,1,3.464,5,5.744,11,4.023,39,3.85,116,2.613,117,4.366,118,4.366,119,4.081,207,4.722,208,5.922,209,5.922,210,5.922]],["t/1927",[50,3.39,72,0.359,73,2.388,75,0.306,79,1.588,97,3.282,104,3.212,110,1.86,125,3.024,126,3.56,127,3.599,128,2.573,132,3.055,161,0.523,164,4.911,177,2.304,199,2.153,211,5.847,212,1.896,213,5.223]],["t/1929",[0,0.931,9,0.399,10,0.807,11,0.733,18,1.152,27,1.989,37,1.693,40,0.905,47,0.666,51,1.078,52,0.624,54,1.228,55,1.966,59,1.27,62,1.832,64,0.388,65,2.016,72,0.211,73,1.05,75,0.277,76,0.768,78,0.647,79,0.698,87,2.689,89,0.364,97,1.132,100,0.623,110,1.604,111,1.693,116,0.579,121,1.152,125,1.263,126,1.228,128,0.647,132,1.344,137,1.583,140,1.112,142,0.768,144,1.491,148,0.524,154,0.807,164,1.693,168,1.283,177,0.579,191,1.509,199,1.263,207,1.832,211,2.689,212,0.834,214,0.968,215,1.047,216,2.016,217,3.226,218,2.297,219,2.297,220,2.297,221,1.047,222,1.313,223,1.313,224,1.313,225,1.313,226,0.56,227,0.807,228,1.219,229,1.047,230,3.179,231,3.41,232,1.313,233,1.313,234,1.047,235,1.832,236,3.676,237,1.152,238,1.152,239,1.313,240,1.313,241,4.742,242,1.642,243,0.807,244,1.583,245,3.063,246,4.949,247,1.693,248,1.152,249,2.442,250,1.313,251,1.313,252,1.152,253,1.313,254,1.047,255,1.047,256,2.016,257,1.313,258,2.297,259,0.968,260,1.152,261,1.047,262,1.152,263,1.965,264,4.178,265,3.667,266,1.283,267,1.313,268,1.047,269,1.693,270,2.111,271,1.313,272,1.313,273,1.152,274,1.618,275,1.313,276,3.063,277,1.313,278,0.905,279,1.152,280,0.852,281,1.152,282,0.968,283,0.807,284,1.313,285,1.152,286,2.016,287,1.313,288,3.079,289,1.313,290,1.313,291,2.297,292,1.313,293,1.152,294,1.313,295,2.297,296,1.152,297,2.016,298,1.313,299,1.453,300,1.313,301,1.313,302,1.313,303,0.905,304,1.313,305,1.313,306,3.676,307,1.832,308,1.313,309,2.297,310,1.313,311,1.313,312,1.313,313,1.313,314,0.6,315,1.313,316,0.968,317,0.807,318,0.647,319,0.807,320,1.515,321,2.297,322,3.063,323,2.016,324,2.111,325,1.228,326,1.152,327,1.047,328,1.693,329,2.297,330,1.313,331,1.313,332,2.016,333,2.297,334,1.313,335,0.733,336,1.313,337,1.491,338,1.313,339,2.297,340,2.297,341,1.313,342,1.152,343,1.313,344,0.968,345,2.297,346,1.313]],["t/1931",[21,1.21,36,1.727,38,1.569,47,1.24,51,1.688,55,1.984,59,1.257,70,1.151,72,0.33,75,0.315,79,0.986,82,1.277,89,0.514,110,1.48,116,0.868,135,3.629,148,1.912,149,1.277,152,1.43,154,1.21,159,1.099,161,0.197,167,1.727,168,1.099,171,1.356,177,2.115,189,5.496,190,6.18,191,3.589,192,1.727,193,1.727,194,1.727,196,4.645,197,1.727,198,1.21,199,1.336,200,4.547,201,4.208,217,3.101,228,0.653,230,2.209,231,2.684,241,3.296,247,1.451,259,1.451,274,1.141,278,1.356,279,1.727,280,1.277,281,1.727,283,2.948,285,1.727,318,0.97,324,1.356,347,3.242,348,1.569,349,3.629,350,1.968,351,1.968,352,1.968,353,1.968,354,1.968,355,3.242,356,1.968,357,1.968,358,1.968,359,1.968,360,1.277,361,1.727,362,0.9,363,1.727,364,1.968,365,1.968,366,1.968,367,1.968,368,1.277,369,1.968,370,1.968,371,1.569,372,4.134,373,1.538,374,1.968,375,1.968,376,1.968,377,1.968,378,1.569,379,1.968,380,1.569,381,1.356,382,3.242,383,2.846,384,1.968]],["t/1933",[9,1.608,47,0.948,51,1.006,53,0.472,59,1.799,64,2.293,72,0.197,75,0.297,79,1.937,89,1.231,98,1.758,106,0.549,111,2.107,140,1.919,148,1.74,151,1.758,153,2.107,156,2.331,161,0.286,181,1.758,242,0.948,244,5.413,278,1.97,318,1.408,385,2.859,386,2.859,387,6.895,388,2.859,389,2.859,390,2.859,391,2.859,392,2.859,393,2.859,394,2.859,395,2.859,396,2.859,397,2.859,398,2.859,399,2.859,400,2.509,401,2.859,402,2.509,403,2.859,404,2.859,405,2.509,406,2.859,407,2.509,408,2.509,409,2.859,410,1.97,411,2.859,412,4.361,413,2.509]],["t/1935",[26,3.014,28,3.224,39,3.168,64,2.388,72,0.301,73,2,75,0.325,89,0.694,97,2.155,125,1.803,126,2.337,128,2.155,132,2.559,140,1.587,161,0.438,244,3.014,373,2.074,387,3.839,414,4.37,415,4.374,416,3.224,417,3.224,418,3.224,419,3.224,420,3.224,421,3.224,422,3.224,423,3.487,424,3.487,425,3.487,426,3.487,427,3.487,428,3.487]],["t/1937",[52,1.418,64,2.358,72,0.359,75,0.306,79,1.588,125,2.153,128,2.573,140,1.896,161,0.523,244,3.599,280,3.39,405,4.584,429,3.599,430,5.223,431,5.223,432,5.223,433,5.223,434,5.223,435,5.223,436,3.055,437,3.39,438,5.223,439,5.223]],["t/1939",[72,0.406,75,0.304,89,0.689,161,0.435,202,3.812,231,2.819,235,4.704,237,3.812,263,2.321,288,3.201,314,1.986,320,1.79,348,5.342,362,1.986,402,3.812,440,3.463,441,5.342,442,4.343,443,4.343,444,3.201,445,3.463,446,4.343,447,4.343,448,4.343,449,4.349,450,3.812,451,1.484,452,4.343,453,4.343,454,4.343,455,4.343,456,4.343,457,2.993,458,4.343,459,2.515,460,4.343,461,4.343,462,3.201,463,4.343,464,4.343,465,4.343]],["t/1941",[23,2.966,47,1.155,72,0.366,75,0.298,79,1.615,161,0.532,212,1.928,216,4.663,235,5.369,319,3.267,320,2.19,449,3.916,450,4.663,451,1.815,459,2.871,462,3.916,466,6.734,467,6.734,468,5.312,469,5.312,470,5.312,471,5.312]],["t/1943",[46,3.078,47,0.762,55,1.313,72,0.241,75,0.323,76,2.051,79,1.815,80,2.416,97,2.501,98,3.122,106,0.364,129,0.762,130,2.156,131,2.501,138,1.874,140,1.843,142,2.051,161,0.351,191,1.728,212,1.273,242,1.684,249,2.796,263,1.874,266,1.958,320,1.445,328,3.742,368,2.276,437,3.296,451,1.198,472,3.491,473,3.506,474,3.506,475,2.796,476,3.506,477,3.506,478,2.416,479,2.276,480,3.506,481,5.077,482,5.077,483,3.506,484,5.077,485,3.506,486,3.506,487,4.456,488,3.506,489,5.077,490,3.506,491,3.506,492,3.506,493,3.506,494,2.796,495,3.506,496,3.506,497,3.506,498,3.506]],["t/1946",[0,0.993,9,0.993,53,0.43,72,0.225,75,0.322,89,1.189,100,1.549,106,0.5,119,2.251,129,1.048,152,1.441,161,0.327,228,1.083,242,1.599,255,2.604,283,2.008,299,1.549,362,1.493,478,3.322,499,2.604,500,4.74,501,2.12,502,2.604,503,3.266,504,3.266,505,3.266,506,3.266,507,4.82,508,2.964,509,3.266,510,2.604,511,3.266,512,2.251,513,3.266,514,2.12,515,3.266,516,3.266,517,3.266,518,1.824,519,2.604,520,3.266,521,3.266,522,2.407,523,5.728,524,5.728,525,3.266,526,2.407,527,3.266,528,3.266,529,3.266,530,5.728,531,4.82,532,3.266,533,3.266,534,3.266,535,3.266,536,3.266]],["t/1948",[9,1.464,23,2.689,51,2.484,53,0.43,72,0.332,75,0.306,89,0.764,97,2.373,106,0.5,110,1.345,129,1.047,161,0.482,226,2.053,242,2.341,274,1.696,362,2.89,457,3.319,472,3.698,487,6.194,537,4.228,538,4.816,539,6.321,540,7.056,541,4.356]],["t/1950",[9,1.536,53,0.451,72,0.348,75,0.32,89,0.801,106,0.525,110,1.411,129,1.098,161,0.506,226,2.154,228,1.676,242,1.676,274,1.779,299,3.619,542,6.339,543,6.339,544,5.052,545,5.052,546,5.052,547,5.052,548,4.435]],["t/1952",[52,1.563,53,0.514,66,2.951,72,0.396,75,0.294,106,0.598,110,1.608,125,2.919,142,3.368,161,0.576,262,5.053,549,5.757,550,4.244,551,5.757,552,5.757,553,5.757,554,5.757]],["t/1954",[52,1.535,53,0.504,72,0.389,75,0.313,89,1.111,106,0.587,129,1.229,161,0.566,478,3.895,501,3.669,555,3.669,556,4.961,557,4.506,558,7.001,559,5.652,560,5.652]],["t/1956",[47,1.039,51,1.683,52,1.708,53,0.426,54,2.554,59,1.912,63,2.554,64,1.412,66,2.45,72,0.329,75,0.297,78,2.355,84,2.267,85,2.668,89,0.758,106,0.496,110,1.335,116,2.109,151,3.867,161,0.478,266,3.512,325,2.554,561,6.289,562,3.523,563,3.102,564,4.779,565,4.779,566,6.289,567,2.668,568,4.195,569,2.554,570,2.668]],["t/1958",[48,2.107,53,0.255,59,0.869,72,0.197,75,0.314,89,0.692,106,0.297,133,1.758,136,2.509,151,3.917,159,2.435,161,0.286,172,1.596,181,1.758,199,1.798,212,1.038,226,1.219,228,2.227,242,0.948,260,3.828,266,1.596,299,3.022,314,1.307,319,1.758,320,1.178,373,2.069,436,3.461,440,2.279,451,0.977,459,1.859,462,2.107,472,1.672,501,1.856,508,2.682,562,4.949,563,4.136,567,1.596,571,2.509,572,2.859,573,2.279,574,4.361,575,4.361,576,4.361,577,3.006,578,2.859,579,2.859,580,2.509,581,2.509,582,2.509,583,2.509,584,2.859,585,2.859,586,2.859,587,2.859,588,2.859,589,2.859,590,2.509,591,2.509,592,2.859,593,2.509,594,2.509,595,2.107,596,4.642,597,2.859,598,5.288,599,2.859,600,2.859,601,4.361,602,2.859,603,2.859,604,2.859]],["t/1960",[3,2.216,23,1.795,47,0.699,51,1.677,53,0.506,70,1.881,72,0.328,75,0.311,89,0.51,97,1.584,106,0.589,110,1.331,129,0.699,144,3.093,149,2.087,154,1.977,161,0.322,177,1.419,199,2.587,217,2.787,243,1.977,296,2.822,297,2.822,344,5.499,363,2.822,519,2.563,605,6.161,606,2.822,607,2.216,608,3.215,609,4.764,610,3.215,611,3.215,612,3.215,613,2.822,614,3.215,615,3.215,616,2.822,617,3.215,618,2.822,619,3.215,620,3.215,621,3.215,622,3.215,623,3.215,624,2.563,625,3.215,626,3.215,627,4.764,628,3.798,629,3.215,630,2.822,631,4.182,632,4.182,633,4.182,634,3.798,635,3.215,636,3.215,637,3.215,638,3.215,639,2.563]],["t/1962",[39,3.324,51,2.19,52,1.689,161,0.623,640,7.42,641,6.22,642,6.22,643,6.22,644,6.22,645,6.22,646,6.22]],["t/1964",[51,1.518,53,0.385,72,0.297,75,0.322,89,1.189,97,2.125,106,0.448,110,1.64,129,0.938,148,1.72,161,0.432,181,2.652,199,1.778,228,1.431,230,3.138,344,5.527,373,2.046,595,3.179,605,3.786,630,3.786,631,3.786,632,3.786,633,3.786,634,3.438,647,4.313,648,3.786,649,4.313,650,3.179,651,4.313,652,4.313,653,4.313,654,4.313,655,4.313,656,4.313,657,4.313]],["t/1966",[47,0.993,51,2.42,52,1.657,53,0.407,54,2.441,55,1.71,63,2.441,64,1.35,66,2.342,72,0.314,75,0.293,78,2.25,84,2.166,85,2.55,89,1.09,106,0.474,110,1.276,116,2.015,129,0.993,161,0.457,177,2.015,181,2.809,212,1.658,325,2.441,344,5.067,360,2.965,569,2.441,570,2.55,595,4.499,658,3.673,659,4.567,660,3.642,661,4.567,662,4.567]],["t/1968",[0,1.645,41,4.999,53,0.342,55,2.025,72,0.264,75,0.324,89,0.608,106,0.398,129,0.833,148,2.158,161,0.384,172,3.021,191,2.665,212,1.963,242,1.271,299,1.818,320,2.23,451,1.309,459,3.178,542,3.364,543,3.364,616,4.749,663,3.364,664,5.41,665,3.832,666,2.641,667,5.504,668,3.832,669,3.832,670,2.641,671,3.832,672,5.41,673,6.27,674,3.728,675,3.832,676,5.41]],["t/1970",[7,5.879,47,1.145,53,0.47,72,0.363,75,0.313,79,1.601,106,0.547,116,2.324,117,3.883,118,3.883,129,1.145,131,3.3,138,2.815,152,2.324,161,0.527,227,3.239,325,2.815,550,3.883,677,4.623,678,3.883,679,5.267,680,5.267,681,5.267]],["t/1972",[35,2.035,53,0.606,72,0.262,73,3.106,75,0.332,79,1.158,106,0.395,117,2.807,125,1.57,126,2.035,128,1.876,161,0.381,212,1.382,228,1.263,320,2.576,407,3.343,413,3.343,451,1.84,459,3.172,508,2.342,674,4.306,682,3.343,683,3.036,684,3.036,685,3.809,686,3.809,687,5.485,688,6.249,689,3.809,690,3.809,691,3.343,692,3.809,693,3.809]],["t/1974",[9,1.33,21,2.69,47,1.289,53,0.39,72,0.301,75,0.32,106,0.454,129,0.951,131,3.712,138,3.168,152,1.93,161,0.438,242,1.966,299,2.074,314,2,362,2,500,4.891,508,2.69,512,3.014,694,4.374,695,4.374,696,5.928,697,5.203,698,4.726,699,4.374,700,6.724,701,4.374,702,4.374]],["t/1976",[40,4.248,52,1.259,53,0.414,72,0.319,75,0.318,89,0.735,106,0.481,119,3.195,161,0.464,171,3.195,191,3.786,196,3.417,199,1.911,226,1.976,243,2.851,282,3.417,320,1.911,451,2.106,459,2.628,567,2.588,577,3.195,658,2.477,678,3.417,703,4.069,704,3.417,705,4.636,706,3.696,707,4.636,708,3.696,709,3.696,710,3.696]],["t/1978",[40,4.248,47,1.008,51,2.598,52,1.674,53,0.414,54,2.477,63,2.477,64,1.37,66,2.377,72,0.319,75,0.303,78,2.284,84,2.199,85,2.588,89,0.978,106,0.481,110,1.295,116,2.045,161,0.464,181,2.851,199,2.541,226,1.976,243,2.851,325,2.477,360,3.009,567,2.588,569,2.477,570,2.588,577,4.248,658,2.477,704,3.417,711,4.636,712,4.636]],["t/1980",[59,2.013,152,2.921,713,5.81,714,5.277,715,5.81,716,5.81]],["t/1982",[9,1.41,47,1.008,51,1.632,52,1.674,53,0.414,54,2.477,59,1.41,63,2.477,64,1.37,66,2.377,72,0.319,75,0.303,78,2.284,84,2.199,85,2.588,89,0.978,106,0.481,110,1.295,116,2.045,129,1.008,156,2.477,161,0.464,226,1.976,228,2.045,242,1.538,325,2.477,362,2.119,569,2.477,570,2.588,698,4.914,717,3.417,718,3.696,719,4.636,720,4.636,721,6.164,722,4.636]],["t/1984",[9,1.536,47,1.098,51,1.779,52,1.771,53,0.451,54,2.7,63,2.7,64,1.493,66,2.59,72,0.348,75,0.292,78,2.489,84,2.396,85,2.821,89,0.801,106,0.525,110,1.411,116,2.229,129,1.098,161,0.506,242,1.676,325,2.7,557,4.028,569,2.7,570,2.821,723,5.052,724,4.435,725,6.521,726,5.052,727,5.052]],["t/1986",[52,1.608,53,0.528,59,1.801,72,0.408,75,0.297,89,0.939,106,0.615,129,1.288,161,0.593,441,4.722,728,5.922,729,5.199,730,6.324,731,5.199]],["t/1988",[52,1.443,53,0.474,59,1.615,72,0.366,75,0.298,89,0.843,106,0.552,129,1.155,161,0.532,242,1.762,362,2.429,441,4.235,563,4.371,729,4.663,730,5.911,731,5.911,732,5.312,733,6.734,734,6.734,735,6.734]],["t/1990",[9,1.399,52,1.666,53,0.41,59,1.399,72,0.317,75,0.302,89,0.73,106,0.478,129,1,152,2.03,156,3.278,161,0.461,172,2.569,217,3.588,226,1.961,228,2.542,230,2.459,241,4.89,242,1.526,266,2.569,293,4.039,299,3.272,362,2.104,502,3.669,512,3.171,522,3.392,736,4.039,737,4.601,738,4.601,739,4.601,740,4.601,741,4.601]],["t/1992",[47,0.758,52,1.373,53,0.311,72,0.24,75,0.33,89,0.802,97,1.718,106,0.362,110,0.974,152,1.538,161,0.349,199,2.855,228,1.973,242,1.157,254,2.78,299,2.821,314,2.312,320,2.084,373,2.398,436,2.958,451,1.191,459,2.781,508,3.658,514,3.282,742,3.487,743,3.487,744,4.438,745,6.08,746,3.061,747,3.487,748,5.727,749,5.727,750,3.487,751,5.056,752,3.061]],["t/1994",[53,0.348,55,1.462,72,0.269,75,0.314,79,1.667,89,1.005,97,1.924,106,0.405,129,0.849,161,0.391,169,6.029,199,2.831,212,1.417,228,1.295,270,2.691,274,1.375,314,1.785,319,3.371,373,2.6,436,3.207,451,1.334,514,3.558,618,3.427,670,2.691,744,4.812,745,6.029,746,3.427,748,5.56,749,5.56,753,5.482,754,3.905,755,3.905,756,3.427,757,3.905,758,5.482,759,3.905,760,3.905,761,3.905]],["t/1996",[9,1.575,53,0.462,72,0.356,75,0.305,89,0.822,106,0.538,129,1.126,159,2.892,161,0.518,226,2.208,227,3.185,242,1.718,335,2.892,541,5.035,762,4.546,763,5.179,764,4.546,765,5.179,766,5.179,767,6.626,768,6.626,769,5.179,770,5.179,771,5.179]],["t/1998",[47,0.972,51,1.573,53,0.537,59,1.829,72,0.308,75,0.321,79,1.359,89,0.709,102,3.563,106,0.464,140,1.622,149,2.901,156,2.388,161,0.447,212,1.622,314,2.75,318,2.202,335,2.495,368,2.901,410,3.079,436,2.614,569,2.388,717,3.294,772,4.469,773,4.469,774,4.469,775,4.469,776,3.563,777,6.014,778,5.967,779,4.469,780,4.469,781,4.469,782,4.469,783,4.469]],["t/2000",[9,1.767,53,0.518,72,0.4,75,0.273,89,0.922,106,0.603,110,1.623,148,2.318,161,0.582,172,3.245,242,1.927,274,2.046,362,2.657,567,3.245,784,5.101,785,5.811,786,5.811,787,5.811]],["t/2002",[9,1.658,52,1.481,53,0.486,59,1.658,72,0.375,75,0.287,79,2.081,89,1.245,106,0.566,150,4.786,151,4.21,161,0.546,177,2.406,212,1.979,567,3.045,670,3.758,788,4.786,789,5.453,790,5.453]],["t/2004",[51,1.787,52,0.952,53,0.313,72,0.241,75,0.331,89,0.556,106,0.364,161,0.351,191,3.566,243,2.156,282,2.585,320,1.445,381,2.416,437,2.276,451,1.198,459,2.164,550,2.585,567,1.958,577,4.113,628,2.796,658,3.189,678,2.585,703,3.078,706,2.796,708,2.796,709,2.796,710,2.796,791,4.456,792,3.506,793,4.456,794,3.506,795,3.506,796,2.796,797,4.456,798,4.456,799,3.506,800,3.506,801,2.796,802,3.506,803,3.078,804,3.078,805,2.796,806,3.078,807,3.078,808,3.078,809,3.078,810,3.078,811,3.078,812,3.078,813,3.078]],["t/2006",[53,0.613,63,2.441,64,1.35,72,0.314,75,0.301,79,1.856,106,0.714,129,1.494,130,2.809,131,2.25,140,2.663,155,3.148,156,2.441,161,0.457,212,1.658,214,4.499,335,3.408,373,2.166,410,4.206,429,3.148,451,2.348,674,3.148,814,3.367,815,4.009,816,3.642,817,4.567,818,4.567,819,4.567]],["t/2008",[47,1.117,51,1.808,52,1.79,53,0.458,54,2.745,59,1.562,63,2.745,64,1.518,66,2.633,72,0.354,75,0.294,78,2.531,84,2.436,85,2.868,89,0.815,106,0.533,110,1.434,116,2.266,129,1.117,161,0.514,280,3.334,325,2.745,555,3.334,569,2.745,570,2.868,820,6.591,821,5.136,822,5.136]],["t/2010",[47,1.277,51,2.067,52,1.594,53,0.385,54,2.305,55,2.198,63,2.305,64,1.274,66,2.211,72,0.297,75,0.296,78,2.125,79,1.311,84,2.046,85,2.408,89,1.137,106,0.448,110,1.204,140,1.565,152,1.903,161,0.432,172,2.408,177,1.903,180,3.786,212,1.565,325,2.305,360,3.812,569,2.305,570,2.408,607,2.972,658,2.305,660,3.438,823,5.154,824,3.786,825,4.313,826,4.313,827,3.786,828,4.313,829,4.313,830,5.872,831,4.313]],["t/2012",[35,2.94,53,0.491,59,1.673,72,0.379,75,0.302,89,1.192,106,0.571,148,2.746,161,0.551,177,2.427,212,1.997,555,3.571,666,3.791,670,3.791,832,5.501,833,5.501,834,5.501,835,4.829,836,4.829]],["t/2014",[9,2.313,35,3.02,53,0.504,59,2.129,72,0.389,75,0.305,89,1.111,106,0.587,129,1.229,161,0.566,449,4.166,556,4.961,837,6.145,838,5.652]],["t/2016",[35,2.212,47,0.9,51,2.01,52,1.775,53,0.369,54,2.212,55,1.55,63,2.212,64,1.223,66,2.122,72,0.285,75,0.293,78,2.04,84,1.963,85,2.311,89,1.212,106,0.43,110,1.156,116,1.827,129,0.9,140,1.502,152,1.827,153,3.052,161,0.414,172,2.311,177,1.827,212,1.502,227,3.511,325,2.212,360,2.687,569,2.212,570,2.311,573,5.21,607,2.853,658,2.212,660,3.3,839,4.14,840,4.14,841,4.14,842,4.14,843,4.14,844,4.14,845,6.535,846,4.14]],["t/2018",[48,2.934,53,0.355,72,0.274,75,0.324,79,1.21,89,1.015,106,0.413,133,2.447,151,2.447,159,2.222,161,0.398,172,2.222,181,2.447,199,2.29,212,1.445,226,1.697,228,1.32,314,1.82,320,1.641,373,1.888,451,1.36,459,2.368,462,2.934,472,2.328,519,3.173,562,4.095,563,2.584,567,2.222,571,3.494,573,3.173,580,3.494,581,3.494,582,3.494,583,3.494,590,3.494,591,3.494,593,3.494,594,3.494,595,2.934,847,3.98,848,3.98,849,3.98,850,3.494,851,3.98,852,3.98,853,3.98,854,3.98,855,3.98,856,3.98]],["t/2020",[35,2.615,52,1.329,53,0.436,72,0.337,75,0.326,106,0.508,129,1.064,161,0.49,228,1.623,265,4.294,373,2.32,380,3.901,381,4.9,796,3.901,857,4.892,858,4.892,859,7.111,860,4.892,861,4.892,862,4.892,863,4.892,864,4.294,865,4.892,866,4.892,867,3.606]],["t/2022",[9,1.349,53,0.604,55,1.661,72,0.412,75,0.305,89,0.704,106,0.703,116,1.958,129,0.965,148,1.77,152,1.958,161,0.444,198,2.728,263,2.371,362,3.097,555,2.88,724,3.894,788,3.894,868,4.436,869,4.997,870,3.894,871,4.436,872,4.436,873,3.057,874,4.436,875,4.436,876,4.436,877,4.436,878,4.436,879,4.436,880,4.436,881,4.436,882,4.436,883,5.985,884,4.436]],["t/2024",[10,4.096,11,2.916,27,4.324,47,1.448,55,2.494,89,1.057,118,3.85,158,3.85,161,0.523,270,3.599,274,1.839,314,2.388,316,4.911,317,4.096,318,2.573,368,3.39,436,3.897,451,1.784,512,3.599,885,5.223,886,5.223,887,5.223,888,5.223]],["t/2026",[52,1.43,53,0.47,64,2.176,72,0.363,75,0.318,106,0.547,140,2.431,156,2.815,161,0.527,199,2.171,373,2.498,864,4.623,889,6.698,890,5.267,891,5.267,892,5.267,893,5.267,894,5.267,895,5.267,896,5.267]],["t/2028",[47,0.854,53,0.351,72,0.27,75,0.33,79,1.195,89,0.623,106,0.408,148,1.567,161,0.393,191,3.802,282,4.059,320,1.62,381,2.708,437,2.551,459,2.347,567,2.194,577,3.794,658,2.1,678,2.897,706,4.39,708,3.133,709,3.133,710,3.133,791,4.833,793,3.449,797,3.449,798,3.449,803,3.449,804,3.449,805,3.133,806,3.449,807,3.449,808,3.449,809,3.449,810,3.449,811,3.449,812,3.449,813,4.833,897,3.929]],["t/2030",[9,1.784,72,0.404,75,0.296,79,1.784,161,0.587,217,3.432,227,3.607,230,3.135,288,4.324,449,4.324,650,4.324,837,5.149,898,5.149,899,5.866,900,5.866,901,5.866]],["t/2032",[0,1.072,9,1.072,21,2.168,23,1.969,47,0.767,53,0.455,72,0.351,75,0.32,79,1.55,80,2.43,89,0.559,106,0.529,110,0.985,129,1.108,130,2.168,131,3.903,138,3.718,161,0.51,228,1.691,263,1.885,266,2.846,270,3.513,274,1.242,314,1.612,332,3.095,380,2.812,445,2.812,457,2.43,518,1.969,568,3.095,717,2.599,824,3.095,902,3.526,903,3.526,904,3.526,905,3.095,906,3.526,907,3.526,908,3.526,909,3.526,910,3.526,911,3.526,912,3.526,913,3.526,914,3.526,915,3.526,916,3.526,917,3.526,918,3.526,919,3.526,920,3.526]],["t/2034",[9,1.234,23,2.266,47,0.882,53,0.362,55,1.519,72,0.279,75,0.321,79,1.234,89,0.644,106,0.421,110,1.573,148,1.619,161,0.406,191,2,212,2.044,217,3.294,226,1.73,228,1.346,230,2.169,231,2.634,242,1.346,243,2.496,249,3.236,274,1.429,283,3.463,299,1.925,320,2.321,451,1.387,459,3.237,499,3.236,501,2.634,526,2.992,663,3.562,667,3.562,674,3.881,873,2.797,921,4.058,922,3.562,923,4.058,924,4.49,925,4.058]],["t/2036",[29,3.102,47,1.039,53,0.426,72,0.329,75,0.305,106,0.496,110,1.335,130,2.939,131,3.099,138,2.554,161,0.478,198,3.867,228,1.585,263,2.554,266,3.512,274,1.683,303,4.334,607,3.293,717,3.523,869,4.844,873,3.293,922,4.195,926,4.195,927,3.81,928,4.779,929,6.289,930,6.289,931,4.779,932,4.779]],["t/2038",[9,1.658,51,2.41,53,0.486,72,0.375,75,0.301,89,0.865,106,0.566,110,1.523,129,1.185,161,0.546,226,2.324,228,2.271,242,1.809,299,2.586,362,2.493,658,2.914,691,4.786,698,5.458,764,4.786,933,5.453]],["t/2040",[59,2.013,152,2.921,713,5.81,714,5.277,715,5.81,716,5.81]],["t/2042",[9,1.75,53,0.514,59,1.75,72,0.396,75,0.271,79,1.75,106,0.598,110,1.608,129,1.252,152,2.54,161,0.576,263,3.077,274,2.027,869,3.967,934,5.757,935,5.757,936,5.757,937,5.757,938,5.757]],["t/2044",[47,1.072,52,1.339,53,0.44,55,1.846,59,1.499,72,0.339,75,0.3,89,1.018,106,0.512,129,1.072,141,4.329,142,2.885,161,0.494,199,2.033,227,3.032,263,2.635,557,3.932,639,3.932,648,4.329,796,3.932,939,7.138,940,4.931,941,4.329,942,4.329,943,4.931,944,4.931,945,4.931,946,4.931,947,6.42,948,4.931]],["t/2046",[9,1.499,29,3.201,53,0.44,72,0.339,75,0.324,89,1.018,106,0.512,110,1.377,129,1.072,161,0.494,191,2.43,228,2.129,242,1.636,299,2.339,362,2.255,499,3.932,508,3.032,512,4.424,548,4.329,736,4.329,949,4.329,950,4.931,951,4.931,952,4.931,953,4.931,954,4.931]],["t/2048",[53,0.367,72,0.283,75,0.317,89,0.652,106,0.427,111,3.031,129,0.894,152,1.814,154,2.529,161,0.412,226,2.422,242,2.16,243,2.529,248,3.61,255,4.531,274,1.448,278,2.834,280,4.56,457,2.834,500,4.227,537,3.61,666,4.488,784,3.61,814,3.031,949,4.988,955,7.372,956,4.112,957,4.112,958,5.683,959,4.112,960,7.024,961,4.112,962,4.112]],["t/2050",[9,1.562,53,0.458,72,0.354,75,0.331,106,0.533,129,1.117,131,3.247,138,3.889,161,0.514,266,2.868,274,1.808,314,2.348,445,4.095,457,3.539,905,4.508,963,5.136,964,5.136,965,5.136,966,5.136]],["t/2052",[53,0.462,59,2.222,72,0.356,75,0.295,82,3.362,106,0.538,129,1.126,144,3.362,161,0.518,217,3.876,226,2.208,227,3.185,230,2.768,242,1.718,252,4.546,502,4.129,563,4.301,898,4.546,967,6.626,968,4.546,969,5.179,970,5.179,971,6.626]],["t/2054",[0,1.784,3,1.438,6,1.832,9,1.51,10,1.284,19,1.832,35,1.115,39,1.115,42,1.664,47,0.454,50,2.209,52,0.924,55,0.781,59,1.51,60,1.832,64,1.616,75,0.19,78,1.028,82,1.355,97,1.028,100,0.99,104,1.284,110,0.95,112,1.832,116,0.921,125,0.86,127,2.345,146,1.539,148,1.357,154,1.284,158,1.539,168,1.165,177,0.921,189,1.664,191,1.028,200,1.664,214,1.539,229,1.664,231,1.355,242,0.692,254,1.664,261,2.713,269,2.508,280,1.355,283,2.648,307,1.664,317,1.284,318,3.529,319,1.284,323,1.832,324,1.438,328,1.539,335,1.165,342,1.832,371,1.664,400,2.986,429,1.438,451,0.713,501,2.796,514,1.355,518,2.773,522,1.539,526,1.539,541,1.438,555,1.355,613,1.832,628,1.664,650,1.539,658,1.818,683,1.664,816,1.664,924,1.664,972,2.087,973,1.832,974,1.832,975,1.832,976,3.402,977,2.986,978,2.087,979,2.087,980,1.832,981,3.402,982,2.087,983,1.832,984,2.986,985,2.087,986,2.087,987,2.087,988,2.087,989,3.78,990,1.165,991,1.832,992,2.087,993,3.402,994,2.087,995,1.832,996,2.087,997,2.087,998,1.832,999,2.087,1000,2.087,1001,2.087,1002,2.087,1003,2.087,1004,2.087,1005,2.087,1006,3.402,1007,4.307,1008,3.402,1009,3.402,1010,2.087,1011,2.087,1012,2.087,1013,2.087,1014,2.087,1015,2.087,1016,2.087,1017,2.087,1018,1.664,1019,3.402,1020,2.087,1021,1.832,1022,2.087,1023,2.087,1024,2.087,1025,3.402,1026,2.087,1027,3.402,1028,2.087,1029,2.087,1030,1.832,1031,2.087,1032,2.087,1033,2.087,1034,2.087,1035,3.402,1036,2.087,1037,2.087,1038,2.087,1039,2.087,1040,2.087,1041,2.087,1042,2.087,1043,2.087,1044,1.832,1045,2.087,1046,2.087,1047,2.087]],["t/2056",[8,2.709,47,0.671,52,1.255,53,0.412,55,2.074,59,1.405,64,0.912,72,0.212,73,1.411,75,0.327,79,0.939,98,1.898,100,2.192,106,0.32,110,0.862,149,2.004,161,0.309,163,2.709,212,1.12,228,1.024,230,2.961,242,1.024,263,1.65,283,4.051,314,1.411,318,2.277,319,1.898,320,1.272,326,2.709,335,3.435,348,3.685,373,1.464,444,2.275,478,3.185,500,2.004,518,2.581,526,3.407,639,2.461,801,2.461,836,4.057,974,4.057,975,2.709,1048,3.087,1049,3.087,1050,3.087,1051,3.087,1052,3.087,1053,2.461,1054,4.622,1055,6.152,1056,3.087,1057,5.54,1058,3.087,1059,3.087,1060,3.087,1061,3.087,1062,3.087,1063,4.622,1064,3.087]],["t/2058",[0,1.025,23,1.883,29,3.204,47,1.269,52,1.585,53,0.521,55,1.263,72,0.47,73,2.668,75,0.29,79,1.025,100,2.768,142,1.973,148,1.345,161,0.338,212,1.791,217,1.973,226,2.104,230,3.653,268,2.689,269,2.486,283,2.074,318,3.518,324,2.324,327,2.689,328,2.486,335,2.756,362,1.542,475,3.935,494,2.689,570,1.883,666,2.324,687,4.332,697,2.96,778,2.96,805,2.689,984,2.96,1030,2.96,1065,2.96,1066,3.373,1067,3.373,1068,3.373,1069,3.373,1070,3.373,1071,2.689,1072,2.96,1073,3.373,1074,4.935,1075,4.332,1076,6.423,1077,3.373,1078,3.373,1079,3.373,1080,3.373,1081,3.373]],["t/2063",[0,1.799,47,0.948,50,1.856,52,0.776,53,0.472,55,1.633,64,1.563,70,1.672,72,0.364,73,1.307,75,0.317,80,1.97,98,1.758,100,1.356,104,1.758,106,0.549,123,2.509,125,1.178,126,2.331,127,1.97,128,1.408,129,1.15,133,1.758,140,1.038,177,1.261,198,2.682,212,1.919,234,2.279,303,3.006,314,1.307,318,2.149,320,1.178,327,2.279,360,1.856,373,1.356,429,1.97,451,2.021,459,2.522,500,1.856,606,2.509,607,1.97,624,2.279,674,3.644,682,2.509,683,4.216,869,3.006,873,3.644,924,2.279,973,2.509,989,3.828,990,1.596,1082,2.859,1083,5.288,1084,2.859,1085,2.859,1086,2.859,1087,2.859,1088,2.859,1089,2.859,1090,2.509,1091,2.509,1092,2.859,1093,2.279,1094,3.477,1095,2.859,1096,2.859,1097,2.859,1098,2.859,1099,2.859,1100,2.859,1101,4.361]],["t/2065",[0,1.242,9,1.242,52,1.109,53,0.364,55,2.429,64,1.672,72,0.281,75,0.319,119,2.815,168,2.281,198,3.99,228,1.876,274,2.285,303,2.815,451,2.6,459,1.741,518,3.159,867,4.17,869,2.815,1093,3.257,1102,3.586,1103,4.966,1104,4.085,1105,4.085,1106,3.257,1107,3.586,1108,3.586,1109,3.586,1110,4.085,1111,3.586,1112,4.966,1113,3.586,1114,3.586,1115,4.085,1116,4.085,1117,4.085]],["t/2067",[1,1.779,2,2.425,4,2.242,38,2.425,53,0.271,55,1.711,64,1.804,72,0.315,75,0.317,98,4.228,110,0.849,114,2.67,125,1.254,128,1.498,139,4.048,144,1.974,158,2.242,159,1.698,168,1.698,198,3.377,228,1.516,247,3.369,261,2.425,270,3.784,274,1.609,320,1.254,361,2.67,368,1.974,451,2.718,459,2.341,514,1.974,684,2.425,704,2.242,718,2.425,867,2.242,977,2.67,983,2.67,990,1.698,991,2.67,1093,2.425,1106,3.644,1107,2.67,1108,4.012,1109,2.67,1111,2.67,1112,4.012,1113,2.67,1114,2.67,1118,3.041,1119,3.041,1120,2.242,1121,3.041,1122,3.041,1123,4.571,1124,3.041,1125,2.67,1126,3.041,1127,3.041,1128,3.041,1129,3.041,1130,3.041,1131,3.041]],["t/2070",[23,1.824,26,3.948,28,4.223,39,3.605,64,2.261,73,2.204,75,0.329,76,1.91,84,1.549,110,0.912,125,1.987,126,2.576,128,2.375,132,2.819,133,2.008,140,1.185,148,1.923,177,1.441,414,3.553,416,3.553,417,3.553,418,3.553,419,3.553,420,3.553,421,3.553,422,3.553,423,3.843,424,3.843,425,3.843,426,3.843,427,3.843,428,3.843,451,1.647,1018,2.604,1094,2.604,1132,3.266,1133,3.266,1134,2.867,1135,2.867,1136,3.266]],["t/2072",[26,4.291,39,3.327,47,1.023,53,0.42,64,2.062,73,2.152,75,0.326,106,0.489,125,1.94,126,2.515,128,2.319,132,2.753,140,1.708,148,1.877,303,3.243,335,2.628,410,3.243,414,3.469,416,3.469,417,3.469,418,3.469,419,3.469,420,3.469,421,3.469,422,3.469,752,4.131,1065,4.131,1137,4.706,1138,4.706]],["t/2075",[53,0.596,59,2.28,72,0.297,75,0.316,79,1.311,89,1.059,106,0.693,129,0.938,140,2.873,146,3.179,148,3.086,156,3.568,171,2.972,501,2.8,1053,3.438,1139,4.313,1140,3.786,1141,4.313,1142,4.313,1143,4.313,1144,4.313,1145,4.313,1146,4.313,1147,4.313]],["t/2077",[15,2.807,47,1.361,51,1.671,53,0.597,68,2.807,72,0.22,75,0.325,100,1.517,106,0.694,140,2.543,148,1.276,152,2.094,172,4.049,177,1.411,183,2.807,199,2.332,256,2.807,362,2.17,555,3.081,634,2.55,658,1.709,704,2.358,823,2.807,827,2.807,835,2.807,870,2.807,942,2.807,1053,2.55,1120,2.358,1140,2.807,1148,3.198,1149,3.198,1150,3.198,1151,3.198,1152,3.198,1153,3.198,1154,3.198,1155,3.198,1156,3.198,1157,3.198,1158,3.198,1159,3.198,1160,3.198,1161,3.198,1162,3.198,1163,3.198,1164,3.198,1165,3.198,1166,3.198,1167,3.198,1168,3.198,1169,3.198,1170,4.746,1171,3.198,1172,3.198,1173,3.198]],["t/2079",[0,1.078,11,1.98,12,2.828,37,2.614,41,2.828,47,0.771,53,0.457,59,1.556,72,0.244,75,0.294,79,1.078,84,1.682,100,3.308,106,0.368,110,0.99,129,0.771,130,2.181,131,1.747,140,1.287,148,2.396,155,2.444,156,1.895,177,2.65,214,3.773,228,1.176,242,1.176,244,2.444,269,2.614,274,1.249,299,1.682,318,3.24,335,3.354,349,3.113,371,2.828,408,6.121,410,2.444,478,2.444,650,3.773,776,2.828,814,2.614,815,3.113,816,2.828,941,3.113,1021,3.113,1072,3.113,1174,3.547,1175,3.547,1176,3.547,1177,3.547,1178,3.547,1179,3.547,1180,3.547,1181,3.547,1182,3.547,1183,3.547,1184,3.547,1185,3.547,1186,3.547,1187,3.547]],["t/2081",[26,3.148,28,3.367,39,3.262,47,0.993,64,2.168,73,2.088,75,0.327,125,1.883,126,2.441,128,2.25,132,2.672,140,1.658,146,3.367,414,3.367,416,3.367,417,3.367,418,3.367,419,3.367,420,3.367,421,3.367,422,3.367,423,3.642,424,3.642,425,3.642,426,3.642,427,3.642,428,3.642,1018,3.642,1134,4.009,1135,4.009,1188,3.642,1189,4.567]],["t/2084",[0,1.697,10,4.271,27,4.909,35,2.141,52,1.088,53,0.357,75,0.303,79,1.697,89,0.885,100,1.9,106,0.416,125,2.3,129,0.871,131,1.974,138,2.141,155,2.76,199,1.651,203,5.637,212,1.454,215,3.194,221,3.194,228,1.329,314,3.175,316,4.114,317,3.949,436,2.343,440,3.194,451,2.194,500,2.6,518,3.116,541,2.76,1090,3.516,1190,4.006,1191,4.006,1192,4.006,1193,3.516,1194,3.516]],["t/2086",[0,1.18,10,4.212,11,2.167,27,2.519,50,2.519,53,0.346,72,0.267,73,1.774,75,0.319,104,3.356,106,0.403,125,1.599,126,2.917,127,2.674,129,0.844,131,1.912,132,2.27,138,2.074,154,2.386,215,3.094,221,3.094,266,3.047,316,2.86,317,4.212,383,3.406,437,2.519,510,5.754,518,2.167,995,3.406,998,3.406,1102,3.406,1193,3.406,1194,3.406,1195,3.406,1196,3.406,1197,3.406,1198,3.406,1199,3.406,1200,3.406,1201,3.406,1202,3.406,1203,3.88,1204,3.88,1205,3.88,1206,3.88,1207,3.88,1208,3.88]],["t/2089",[0,0.739,24,2.135,29,1.579,35,1.3,42,1.939,47,1.037,48,1.793,51,0.856,52,1.296,53,0.217,70,1.423,72,0.265,73,1.758,75,0.325,76,1.423,78,3.095,84,1.153,89,0.997,104,1.495,133,1.495,139,1.793,151,1.495,159,1.358,199,1.002,226,1.037,228,1.96,229,1.939,230,1.3,263,1.3,288,1.793,299,1.153,320,1.967,373,2.572,381,1.676,436,2.25,437,1.579,451,2.019,459,2.519,472,1.423,494,1.939,508,1.495,562,2.835,563,1.579,569,1.3,596,2.135,624,1.939,666,3.738,926,2.135,927,1.939,980,2.135,1075,3.376,1125,2.135,1209,2.432,1210,2.432,1211,2.135,1212,3.846,1213,4.772,1214,3.846,1215,2.432,1216,2.432,1217,2.432,1218,2.432,1219,2.432,1220,5.424,1221,2.432,1222,2.432,1223,2.432,1224,2.432,1225,2.432,1226,2.432,1227,3.846,1228,2.432,1229,2.432,1230,2.432,1231,2.432,1232,2.432,1233,2.432,1234,2.432,1235,2.432,1236,2.135,1237,2.432,1238,2.432,1239,2.432,1240,2.432,1241,2.432,1242,2.432,1243,2.432,1244,2.432]],["t/2092",[0,1.226,3,2.778,4,4.132,21,2.479,75,0.154,76,2.359,82,2.617,102,3.214,142,2.359,153,2.972,155,2.778,164,2.972,168,2.251,268,3.214,273,3.539,307,3.214,317,2.479,378,3.214,472,2.359,514,2.617,518,2.251,550,2.972,714,3.214,850,3.539,1071,3.214,1120,2.972,1188,3.214,1211,3.539,1236,3.539,1245,4.032,1246,4.032,1247,3.539,1248,4.032,1249,4.032,1250,4.032,1251,4.032,1252,4.032,1253,4.032,1254,4.032,1255,4.032,1256,4.032,1257,4.032,1258,4.032,1259,4.032,1260,4.032,1261,4.032,1262,4.032,1263,4.032,1264,4.032,1265,3.539,1266,3.539,1267,3.539,1268,4.032,1269,4.032,1270,4.032,1271,4.032,1272,4.032,1273,4.032,1274,4.032,1275,4.032,1276,3.539,1277,4.032,1278,4.032,1279,3.539,1280,4.032]],["t/2094",[0,1.33,1,2.559,9,1.33,12,3.487,21,3.645,45,3.839,47,0.951,57,3.839,59,1.802,137,3.014,140,1.587,145,3.839,274,2.367,337,3.848,472,3.468,479,3.848,677,5.203,1103,3.839,1247,3.839,1279,3.839,1281,5.928,1282,4.374,1283,4.374,1284,4.374,1285,4.374,1286,3.839,1287,4.374,1288,4.374,1289,4.374,1290,4.374,1291,4.374,1292,4.374,1293,4.374,1294,4.374,1295,4.374,1296,4.374,1297,4.085,1298,3.848,1299,4.374,1300,3.848,1301,4.374,1302,4.374]],["t/2096",[0,1.75,1,3.368,274,2.493,337,4.597,479,4.597,990,3.954,1297,4.88,1298,4.597,1300,4.597,1303,5.757,1304,5.757,1305,5.757,1306,5.757]],["t/2098",[0,1.75,1,3.368,274,2.493,337,4.597,479,4.597,990,3.954,1297,4.88,1298,4.597,1300,4.597,1307,5.757,1308,5.757,1309,5.757,1310,5.757]],["t/2100",[0,1.75,1,3.368,274,2.493,337,4.597,479,4.597,990,3.954,1297,4.88,1298,4.597,1300,4.597,1311,5.757,1312,5.757,1313,5.757,1314,5.757]],["t/2102",[0,1.75,1,3.368,274,2.493,337,4.597,479,4.597,990,3.954,1297,4.88,1298,4.597,1300,4.597,1315,5.757,1316,5.757,1317,5.757,1318,5.757]],["t/2104",[3,4.166,4,2.645,9,1.569,11,2.003,20,4.531,40,2.472,64,1.06,70,3.019,75,0.198,76,3.536,133,2.206,144,3.351,168,2.882,231,3.351,234,4.82,286,4.531,324,4.556,378,4.115,444,2.645,472,4.267,718,2.86,801,2.86,867,2.645,1071,2.86,1265,3.149,1266,3.149,1267,3.149,1286,4.531,1298,2.329,1300,4.548,1319,3.588,1320,3.588,1321,3.588,1322,3.588,1323,3.588,1324,3.588,1325,3.588,1326,3.588,1327,3.588,1328,3.588,1329,3.588,1330,5.162,1331,5.162,1332,3.588,1333,5.162,1334,5.162,1335,3.588,1336,3.588,1337,3.588,1338,3.588,1339,3.588,1340,3.588,1341,3.588]],["t/2107",[0,1.922,2,3.84,5,3.84,27,3.127,39,2.574,47,1.047,72,0.332,84,2.284,140,1.748,142,3.698,149,3.127,157,4.228,159,2.689,160,5.549,191,2.373,196,3.55,444,3.55,475,3.84,1188,3.84,1195,4.228,1342,6.321,1343,4.228,1344,4.816,1345,4.816,1346,4.816,1347,4.816,1348,4.816,1349,4.816,1350,4.816,1351,4.816,1352,4.816,1353,4.816,1354,4.816,1355,4.816,1356,4.816,1357,4.816,1358,4.816]],["t/2109",[0,1.912,53,0.426,59,1.453,64,1.412,70,2.796,72,0.329,75,0.241,76,2.796,80,3.293,100,2.983,140,1.735,156,2.554,259,3.523,274,2.475,278,3.293,318,2.355,429,3.293,451,2.149,756,4.195,776,3.81,873,3.293,927,3.81,968,4.195,990,2.668,1091,4.195,1094,5.605,1120,3.523,1359,4.779,1360,4.779,1361,4.779,1362,4.779,1363,4.779,1364,4.779,1365,4.779]],["t/2111",[0,1.629,53,0.478,55,2.006,64,2.001,72,0.369,75,0.284,98,3.295,106,0.556,137,3.693,139,3.95,259,3.95,451,2.665,459,2.284,518,2.992,670,3.693,990,3.781,1106,5.398,1276,4.703,1366,5.358,1367,5.358]],["t/2113",[0,2.117,10,3.444,47,1.218,116,2.471,137,3.86,238,4.916,317,4.658,318,2.76,319,3.444,510,4.465,522,4.129,814,4.129,1044,4.916,1196,4.916,1197,4.916,1198,4.916,1199,4.916,1200,4.916,1201,4.916,1202,4.916]],["t/2115",[75,0.273,168,3.245,207,4.633,247,4.284,368,3.772,541,4.005,684,4.633,762,5.101,1343,5.101,1368,5.811,1369,5.811,1370,5.811,1371,5.811,1372,5.811,1373,5.811,1374,5.811,1375,5.811,1376,5.811]]],"invertedIndex":[["",{"_index":75,"t":{"1916":{"position":[[531,1],[540,2],[558,2],[601,1],[793,1],[802,2],[820,2],[873,2],[936,2],[957,2],[1001,1],[1151,1],[1160,2],[1201,2],[1228,2]]},"1918":{"position":[[147,1],[153,2],[200,1],[226,2],[246,1]]},"1920":{"position":[[338,2],[658,2],[704,3],[740,1],[766,2],[780,2],[861,1],[895,1],[897,1],[918,2],[921,2],[960,2],[982,2],[1054,1],[1076,2],[1079,2],[1082,1],[1098,1],[1100,1],[1120,2],[1123,2],[1137,1],[1144,1],[1171,1],[1173,2],[1186,2],[1266,1],[1286,1],[1288,1],[1305,2],[1308,2],[1331,2]]},"1922":{"position":[[253,2]]},"1927":{"position":[[221,1],[227,2],[242,2],[245,3],[266,1]]},"1929":{"position":[[72,1],[74,2],[119,2],[229,2],[232,2],[235,3],[256,1],[328,1],[334,2],[349,2],[419,1],[453,1],[487,1],[520,1],[530,2],[533,3],[554,1],[843,2],[1627,1],[1634,1],[1853,1],[2450,1]]},"1931":{"position":[[233,2],[236,2],[355,2],[358,2],[394,2],[397,2],[435,2],[438,2],[556,2],[626,2],[1035,2],[1038,2],[1081,2],[1084,2],[1129,2],[1132,2],[1355,2],[1429,1],[1431,2],[1484,2],[1561,2],[1631,2],[1688,2],[1735,2],[1782,2],[1830,2],[1860,2],[1906,2],[1957,2],[2011,1],[2129,2]]},"1933":{"position":[[83,2],[191,2],[289,2],[790,2],[835,2],[894,2],[1081,1],[1136,2],[1179,1],[1210,2],[1258,1],[1290,2]]},"1935":{"position":[[136,1],[142,2],[161,2],[191,2],[202,2],[231,2],[267,2],[308,2],[327,2],[356,2],[392,2],[433,2],[466,1]]},"1937":{"position":[[91,2],[274,2],[309,3],[313,1],[315,2]]},"1939":{"position":[[194,1],[207,2],[463,2],[521,2],[528,1],[545,1],[554,2]]},"1941":{"position":[[202,1],[236,2],[243,1],[260,1]]},"1943":{"position":[[337,2],[405,1],[432,2],[435,2],[494,2],[497,2],[527,2],[530,2],[550,2],[646,2],[671,2],[688,2],[737,2],[744,1],[754,2],[809,2],[812,2],[829,1]]},"1946":{"position":[[304,2],[372,1],[392,2],[425,2],[466,2],[506,2],[551,2],[554,2],[574,2],[577,2],[580,2],[646,2],[689,2],[730,2],[799,1],[843,2],[896,2],[947,2],[955,2]]},"1948":{"position":[[237,1],[297,2],[300,2],[370,2],[373,2],[424,2]]},"1950":{"position":[[150,1],[167,2],[170,2],[246,2],[249,2],[305,2],[308,2],[335,2]]},"1952":{"position":[[152,1],[164,2],[212,2]]},"1954":{"position":[[31,1],[89,2],[163,1],[177,2],[200,2]]},"1956":{"position":[[60,2],[144,1],[146,2],[190,2],[203,2]]},"1958":{"position":[[289,2],[361,1],[461,1],[496,1],[500,2],[522,2],[546,2],[553,1],[570,1],[592,2],[620,2],[627,2],[630,2],[676,2],[789,2],[913,2],[1025,2],[1088,2]]},"1960":{"position":[[133,1],[135,2],[174,2],[231,2],[325,2],[687,1],[777,1],[824,2],[827,2],[868,1],[909,2],[976,1],[1016,2],[1019,2]]},"1964":{"position":[[58,1],[171,2],[192,1],[234,1],[236,2],[260,2],[293,1],[315,1],[338,1],[358,1],[371,2],[402,2]]},"1966":{"position":[[226,1],[228,2],[268,2],[304,2],[313,2]]},"1968":{"position":[[373,1],[382,2],[429,2],[436,1],[450,2],[471,1],[473,2],[476,2],[512,2],[573,2],[580,1],[594,2],[615,1],[617,2],[620,2],[643,2]]},"1970":{"position":[[182,1],[219,2],[222,2],[290,2],[293,2],[312,2]]},"1972":{"position":[[141,1],[147,2],[208,1],[217,2],[239,2],[246,1],[260,1],[262,2],[306,1],[315,2],[337,2],[344,1],[358,1],[360,2],[406,1],[415,2],[437,2],[444,1],[458,1],[460,2],[498,1],[572,2],[592,1]]},"1974":{"position":[[262,1],[264,2],[312,2],[315,2],[332,2],[379,2],[382,2],[406,2],[460,2],[463,2],[482,2]]},"1976":{"position":[[199,1],[201,2],[257,2],[283,2],[311,2],[318,1],[320,2],[405,1],[407,2]]},"1978":{"position":[[173,1],[175,2],[238,2],[241,2],[254,2],[270,2]]},"1982":{"position":[[168,1],[192,2],[230,2],[265,2],[268,2],[271,2]]},"1984":{"position":[[94,2],[158,1],[173,2],[189,2]]},"1986":{"position":[[110,1],[119,2],[134,2]]},"1988":{"position":[[117,2],[195,1],[205,2],[242,2]]},"1990":{"position":[[236,2],[310,1],[325,2],[347,2],[368,2],[377,2]]},"1992":{"position":[[186,1],[210,1],[248,1],[250,2],[278,2],[317,1],[326,2],[347,2],[354,1],[387,1],[389,2],[392,2],[426,2],[429,2],[470,2],[519,3],[527,2],[534,1],[567,1],[569,2],[572,2],[606,2],[609,2],[643,2]]},"1994":{"position":[[321,1],[345,1],[379,1],[381,2],[409,2],[448,1],[464,2],[467,2],[537,2],[540,2],[584,2]]},"1996":{"position":[[166,1],[270,1],[272,2],[332,2],[385,2]]},"1998":{"position":[[308,1],[345,2],[385,1],[407,2],[418,1],[458,1],[465,1],[485,2],[488,2],[505,1],[507,2]]},"2000":{"position":[[147,1],[205,2]]},"2002":{"position":[[243,1],[256,2],[266,2]]},"2004":{"position":[[261,1],[263,2],[305,2],[331,2],[338,1],[340,2],[343,2],[371,2],[406,1],[410,1],[412,2],[452,1],[454,2],[499,2],[525,2],[528,2],[555,2],[590,2],[605,1],[677,2],[680,2],[723,2],[803,1],[805,1],[807,2]]},"2006":{"position":[[267,1],[304,2],[339,1],[376,2],[411,1],[463,2]]},"2008":{"position":[[75,2],[152,1],[170,2],[195,2]]},"2010":{"position":[[174,5],[280,2],[359,1],[378,2],[411,2],[419,2]]},"2012":{"position":[[156,2],[235,1],[246,2],[258,2]]},"2014":{"position":[[108,2],[166,1],[181,2],[191,2]]},"2016":{"position":[[328,2],[414,1],[433,2],[460,2],[495,2],[505,2]]},"2018":{"position":[[119,2],[191,1],[284,1],[319,1],[323,2],[345,2],[370,2],[377,1],[394,1],[416,2],[444,2],[475,2],[490,2],[493,2],[538,2]]},"2020":{"position":[[105,2],[170,1],[174,2],[201,2],[212,1],[220,2],[238,1],[255,2],[269,1],[271,1],[273,2]]},"2022":{"position":[[285,1],[309,2],[350,1],[406,4],[411,2],[460,1],[579,2]]},"2026":{"position":[[69,2],[108,2],[130,1],[134,2],[199,2],[234,1],[268,1]]},"2028":{"position":[[152,1],[154,2],[196,2],[222,2],[229,1],[231,2],[234,2],[253,2],[298,2],[324,2],[327,2],[354,2],[389,2],[404,1],[476,2],[479,2],[522,2],[602,1],[604,1],[606,2]]},"2030":{"position":[[32,1],[104,2],[154,2]]},"2032":{"position":[[192,1],[218,2],[221,2],[272,2],[275,2],[306,2],[309,2],[316,2],[614,1],[652,2],[655,2],[704,2],[707,2],[781,2],[784,2],[803,2]]},"2034":{"position":[[297,1],[306,2],[346,2],[353,1],[367,2],[395,1],[397,2],[426,2],[474,2],[481,1],[495,2],[523,1],[525,2]]},"2036":{"position":[[238,1],[258,2],[261,2],[335,2],[338,2],[361,2]]},"2038":{"position":[[144,1],[182,2],[185,2],[215,2]]},"2042":{"position":[[138,1],[234,2]]},"2044":{"position":[[256,2],[324,1],[341,2],[380,2],[392,2]]},"2046":{"position":[[170,1],[188,2],[191,2],[221,2],[224,2],[254,2],[257,2],[293,2],[296,2],[311,2]]},"2048":{"position":[[269,1],[288,2],[291,2],[328,2],[331,2],[359,2],[393,2],[396,2],[460,2],[463,2],[516,2]]},"2050":{"position":[[124,1],[142,2],[145,2],[148,2],[159,1],[184,3],[188,2],[191,2],[209,1],[224,2],[227,2],[250,2]]},"2052":{"position":[[208,2],[276,1],[286,2],[294,2]]},"2054":{"position":[[64,1],[131,1],[894,1],[953,1]]},"2056":{"position":[[237,2],[274,1],[276,2],[328,2],[371,2],[421,2],[446,1],[451,2],[475,1],[479,2],[505,1],[509,2],[541,1],[545,2],[588,1],[598,2],[674,2],[744,2],[846,1],[864,2],[883,3],[887,2],[997,1],[1015,2],[1034,2],[1066,2]]},"2058":{"position":[[567,1],[590,2],[628,1],[630,3],[994,1],[1017,2],[1055,1],[1057,3]]},"2063":{"position":[[238,1],[244,2],[288,2],[295,1],[309,2],[332,1],[334,2],[516,1],[583,1],[597,1],[603,2],[680,1],[733,2],[764,1],[1076,1],[1082,2],[1117,2],[1148,2],[1204,2],[1229,2]]},"2065":{"position":[[218,2],[269,1],[303,1],[305,2],[340,2],[375,2],[421,2],[447,1],[454,1],[463,1],[465,2],[595,1]]},"2067":{"position":[[522,2],[537,2],[587,1],[621,1],[623,2],[658,2],[693,2],[760,2],[786,1],[793,1],[802,1],[804,2],[834,1],[901,2],[908,1],[962,1],[964,1],[993,1]]},"2070":{"position":[[79,1],[85,2],[104,2],[133,2],[144,2],[173,2],[209,2],[250,2],[269,2],[300,2],[336,2],[377,2],[410,1],[471,1],[477,2],[496,2],[517,2],[528,2],[548,2],[584,2],[625,2],[644,2],[664,2],[700,2],[741,2],[774,1]]},"2072":{"position":[[131,1],[137,2],[156,2],[177,2],[188,2],[227,1],[264,2],[276,2],[279,2],[315,2],[356,2],[389,1]]},"2075":{"position":[[185,2],[243,4],[280,1],[297,2],[300,2],[389,1],[407,2],[410,2],[509,1],[532,2]]},"2077":{"position":[[395,2],[464,1],[519,2],[522,2],[572,1],[596,2],[599,2],[664,1],[691,2],[716,1],[718,1],[732,3],[829,2],[932,1],[952,2],[982,2],[993,2],[996,2],[1086,1],[1105,2],[1127,2],[1134,2]]},"2079":{"position":[[273,1],[275,2],[561,2],[596,2],[633,5],[639,2],[674,1],[700,2]]},"2081":{"position":[[82,1],[88,2],[107,2],[136,2],[147,2],[176,2],[212,2],[253,2],[272,2],[303,2],[339,2],[380,2],[413,1]]},"2084":{"position":[[97,1],[168,1],[298,2],[341,2],[386,2],[531,1],[587,3],[591,2]]},"2086":{"position":[[188,1],[252,1],[266,1],[268,2],[322,2],[358,2],[403,2],[438,1],[440,2],[467,1],[524,2],[527,2],[547,1]]},"2089":{"position":[[407,1],[607,1],[635,1],[680,1],[730,1],[769,1],[791,2],[823,2],[830,1],[843,2],[885,1],[933,1],[969,1],[995,1],[1016,1],[1043,1],[1045,1],[1061,1],[1090,1],[1119,2],[1139,2],[1166,2],[1173,1],[1182,2],[1212,2],[1219,1],[1243,1],[1245,1],[1299,1],[1301,2],[1352,2],[1491,2],[1505,2]]},"2092":{"position":[[497,1]]},"2104":{"position":[[0,2],[94,1]]},"2109":{"position":[[430,1],[500,2]]},"2111":{"position":[[131,1],[163,1],[203,1]]},"2115":{"position":[[180,1],[194,2]]}}}],["0",{"_index":801,"t":{"2004":{"position":[[408,1]]},"2056":{"position":[[477,1]]},"2104":{"position":[[176,1]]}}}],["0.4",{"_index":1316,"t":{"2102":{"position":[[72,3]]}}}],["0.7",{"_index":1312,"t":{"2100":{"position":[[70,3]]}}}],["1",{"_index":478,"t":{"1943":{"position":[[225,1]]},"1946":{"position":[[839,3],[856,2]]},"1954":{"position":[[129,1]]},"2056":{"position":[[449,1],[507,1]]},"2079":{"position":[[331,3]]}}}],["1,146,667",{"_index":1315,"t":{"2102":{"position":[[14,9]]}}}],["1.1",{"_index":1318,"t":{"2102":{"position":[[152,3]]}}}],["1.11",{"_index":43,"t":{"1914":{"position":[[39,4]]}}}],["10",{"_index":1071,"t":{"2058":{"position":[[522,3]]},"2092":{"position":[[565,2]]},"2104":{"position":[[182,2]]}}}],["100",{"_index":1330,"t":{"2104":{"position":[[189,3],[580,4]]}}}],["1000",{"_index":1339,"t":{"2104":{"position":[[585,5]]}}}],["1024",{"_index":276,"t":{"1929":{"position":[[1629,4],[1636,4],[1855,4]]}}}],["11,846",{"_index":1303,"t":{"2096":{"position":[[14,6]]}}}],["117.2",{"_index":1310,"t":{"2098":{"position":[[148,5]]}}}],["123",{"_index":905,"t":{"2032":{"position":[[312,3]]},"2050":{"position":[[245,4]]}}}],["12345.pdf",{"_index":673,"t":{"1968":{"position":[[412,12],[495,9],[542,11]]}}}],["127.0.0.1",{"_index":731,"t":{"1986":{"position":[[122,11]]},"1988":{"position":[[145,10],[219,12]]}}}],["15:04:05",{"_index":1079,"t":{"2058":{"position":[[923,11]]}}}],["15th",{"_index":33,"t":{"1912":{"position":[[311,5]]}}}],["16",{"_index":533,"t":{"1946":{"position":[[824,4]]}}}],["18.04.3",{"_index":1273,"t":{"2092":{"position":[[523,7]]}}}],["185",{"_index":121,"t":{"1916":{"position":[[1480,5]]},"1929":{"position":[[1273,5]]}}}],["19,664",{"_index":1307,"t":{"2098":{"position":[[14,6]]}}}],["1;q=0.2",{"_index":525,"t":{"1946":{"position":[[681,7]]}}}],["1]:3000",{"_index":447,"t":{"1939":{"position":[[196,10]]}}}],["2",{"_index":639,"t":{"1960":{"position":[[978,4]]},"2044":{"position":[[133,2]]},"2056":{"position":[[543,1]]}}}],["2,066",{"_index":1305,"t":{"2096":{"position":[[94,5]]}}}],["2.0",{"_index":1299,"t":{"2094":{"position":[[444,3]]}}}],["2.20ghz",{"_index":1269,"t":{"2092":{"position":[[499,7]]}}}],["2.30ghz",{"_index":1322,"t":{"2104":{"position":[[96,7]]}}}],["20",{"_index":749,"t":{"1992":{"position":[[313,3],[458,4],[515,3],[638,4]]},"1994":{"position":[[444,3],[504,4],[579,4]]}}}],["200",{"_index":496,"t":{"1943":{"position":[[740,3]]}}}],["200m",{"_index":476,"t":{"1943":{"position":[[168,5]]}}}],["2020",{"_index":34,"t":{"1912":{"position":[[317,5]]}}}],["21",{"_index":830,"t":{"2010":{"position":[[405,5],[414,4]]}}}],["244,847",{"_index":1317,"t":{"2102":{"position":[[96,7]]}}}],["25.7",{"_index":1308,"t":{"2098":{"position":[[69,4]]}}}],["256",{"_index":289,"t":{"1929":{"position":[[1849,3]]}}}],["28",{"_index":1262,"t":{"2092":{"position":[[454,2]]}}}],["3",{"_index":1073,"t":{"2058":{"position":[[531,2]]}}}],["30",{"_index":1338,"t":{"2104":{"position":[[537,2]]}}}],["3000",{"_index":446,"t":{"1939":{"position":[[188,5]]}}}],["301",{"_index":884,"t":{"2022":{"position":[[574,4]]}}}],["302",{"_index":872,"t":{"2022":{"position":[[179,3]]}}}],["32",{"_index":313,"t":{"1929":{"position":[[2605,4]]}}}],["32gb",{"_index":1270,"t":{"2092":{"position":[[507,4]]}}}],["354.1",{"_index":1302,"t":{"2094":{"position":[[518,5]]}}}],["360641",{"_index":811,"t":{"2004":{"position":[[698,6]]},"2028":{"position":[[497,6]]}}}],["367,069",{"_index":1301,"t":{"2094":{"position":[[462,7]]}}}],["368,647",{"_index":1311,"t":{"2100":{"position":[[14,7]]}}}],["390.44",{"_index":1306,"t":{"2096":{"position":[[148,6]]}}}],["4",{"_index":275,"t":{"1929":{"position":[[1625,1]]}}}],["4,302",{"_index":1309,"t":{"2098":{"position":[[94,5]]}}}],["4.15.0",{"_index":1274,"t":{"2092":{"position":[[531,6]]}}}],["4.4",{"_index":1314,"t":{"2100":{"position":[[149,3]]}}}],["401",{"_index":1010,"t":{"2054":{"position":[[1166,3]]}}}],["403",{"_index":782,"t":{"1998":{"position":[[491,3]]}}}],["404",{"_index":1094,"t":{"2063":{"position":[[1012,4],[1207,3]]},"2070":{"position":[[824,3]]},"2109":{"position":[[10,3],[127,3],[381,3]]}}}],["4096",{"_index":345,"t":{"1929":{"position":[[3438,4],[3514,4]]}}}],["413",{"_index":271,"t":{"1929":{"position":[[1584,3]]}}}],["415",{"_index":930,"t":{"2036":{"position":[[264,3],[341,3]]}}}],["42.8",{"_index":1304,"t":{"2096":{"position":[[69,4]]}}}],["426",{"_index":120,"t":{"1916":{"position":[[1471,4]]}}}],["4gb",{"_index":1324,"t":{"2104":{"position":[[108,3]]}}}],["500",{"_index":867,"t":{"2020":{"position":[[258,5]]},"2065":{"position":[[90,3],[331,3]]},"2067":{"position":[[649,3]]},"2104":{"position":[[197,3]]}}}],["5000",{"_index":1331,"t":{"2104":{"position":[[261,5],[591,4]]}}}],["503",{"_index":1097,"t":{"2063":{"position":[[1120,3]]}}}],["5120",{"_index":1268,"t":{"2092":{"position":[[488,4]]}}}],["57,880",{"_index":1313,"t":{"2100":{"position":[[94,6]]}}}],["6,162,556",{"_index":1296,"t":{"2094":{"position":[[386,9]]}}}],["6140",{"_index":1321,"t":{"2104":{"position":[[85,4]]}}}],["700",{"_index":859,"t":{"2020":{"position":[[125,4],[130,3],[264,4]]}}}],["8",{"_index":522,"t":{"1946":{"position":[[669,2]]},"1990":{"position":[[276,1]]},"2054":{"position":[[2016,1]]},"2113":{"position":[[25,1]]}}}],["8080",{"_index":471,"t":{"1941":{"position":[[222,9]]}}}],["88",{"_index":1275,"t":{"2092":{"position":[[538,2]]}}}],["8859",{"_index":524,"t":{"1946":{"position":[[676,4],[834,4],[851,4]]}}}],["900",{"_index":860,"t":{"2020":{"position":[[134,3]]}}}],["9_",{"_index":1151,"t":{"2077":{"position":[[342,5]]}}}],["_",{"_index":437,"t":{"1937":{"position":[[272,1]]},"1943":{"position":[[669,1],[752,1]]},"2004":{"position":[[582,2]]},"2028":{"position":[[381,2]]},"2086":{"position":[[465,1]]},"2089":{"position":[[836,2]]}}}],["_test.go",{"_index":473,"t":{"1943":{"position":[[84,8]]}}}],["abov",{"_index":101,"t":{"1916":{"position":[[1062,5]]}}}],["absenc",{"_index":1360,"t":{"2109":{"position":[[161,7]]}}}],["ac",{"_index":1196,"t":{"2086":{"position":[[98,3]]},"2113":{"position":[[80,3]]}}}],["accept",{"_index":500,"t":{"1946":{"position":[[57,11],[97,6],[307,7],[630,6],[649,6],[692,6],[733,6]]},"1974":{"position":[[36,6],[64,7],[267,7],[335,7],[409,7]]},"2048":{"position":[[450,9],[492,6],[509,6]]},"2056":{"position":[[153,6]]},"2063":{"position":[[785,7]]},"2084":{"position":[[451,7]]}}}],["access",{"_index":550,"t":{"1952":{"position":[[47,6]]},"1970":{"position":[[14,6]]},"2004":{"position":[[3,6]]},"2092":{"position":[[146,7]]}}}],["accordingli",{"_index":1122,"t":{"2067":{"position":[[242,11]]}}}],["action",{"_index":1121,"t":{"2067":{"position":[[235,6]]}}}],["activ",{"_index":1066,"t":{"2058":{"position":[[95,9]]}}}],["actual",{"_index":359,"t":{"1931":{"position":[[846,8]]}}}],["ad",{"_index":1065,"t":{"2058":{"position":[[5,6]]},"2072":{"position":[[74,5]]}}}],["add",{"_index":278,"t":{"1929":{"position":[[1669,4]]},"1931":{"position":[[1637,4]]},"1933":{"position":[[86,3]]},"2048":{"position":[[0,4]]},"2109":{"position":[[283,3]]}}}],["addit",{"_index":1091,"t":{"2063":{"position":[[866,10]]},"2109":{"position":[[172,10]]}}}],["address",{"_index":441,"t":{"1939":{"position":[[51,8],[102,8],[168,7]]},"1986":{"position":[[22,7]]},"1988":{"position":[[23,9]]}}}],["adduser(c",{"_index":1235,"t":{"2089":{"position":[[1068,9]]}}}],["admin",{"_index":778,"t":{"1998":{"position":[[327,8],[410,7],[449,8]]},"2058":{"position":[[390,5]]}}}],["ag",{"_index":745,"t":{"1992":{"position":[[200,3],[308,4],[451,6],[508,6],[631,6]]},"1994":{"position":[[335,3],[439,4],[497,6],[572,6]]}}}],["age=5184000",{"_index":1180,"t":{"2079":{"position":[[469,13]]}}}],["agent",{"_index":960,"t":{"2048":{"position":[[320,7],[353,5],[418,5],[485,6]]}}}],["alireza",{"_index":979,"t":{"2054":{"position":[[296,7]]}}}],["aliv",{"_index":291,"t":{"1929":{"position":[[1895,5],[3132,5]]}}}],["alloc",{"_index":20,"t":{"1912":{"position":[[166,10]]},"2104":{"position":[[354,6],[373,11]]}}}],["allow",{"_index":111,"t":{"1916":{"position":[[1347,8]]},"1929":{"position":[[1500,7],[2824,7]]},"1933":{"position":[[90,6]]},"2048":{"position":[[186,8]]}}}],["along",{"_index":1161,"t":{"2077":{"position":[[780,5]]}}}],["alreadi",{"_index":537,"t":{"1948":{"position":[[92,7]]},"2048":{"position":[[93,7]]}}}],["altern",{"_index":109,"t":{"1916":{"position":[[1231,14]]}}}],["altogeth",{"_index":477,"t":{"1943":{"position":[[207,11]]}}}],["amber",{"_index":1197,"t":{"2086":{"position":[[102,5]]},"2113":{"position":[[84,5]]}}}],["amount",{"_index":323,"t":{"1929":{"position":[[2809,6],[3078,6]]},"2054":{"position":[[773,6]]}}}],["and/or",{"_index":342,"t":{"1929":{"position":[[3386,6]]},"2054":{"position":[[1645,6]]}}}],["anoth",{"_index":885,"t":{"2024":{"position":[[131,7]]}}}],["answer",{"_index":1342,"t":{"2107":{"position":[[23,6],[52,6]]}}}],["anywher",{"_index":112,"t":{"1916":{"position":[[1376,9]]},"2054":{"position":[[514,8]]}}}],["api",{"_index":39,"t":{"1912":{"position":[[379,3]]},"1920":{"position":[[1311,3]]},"1924":{"position":[[37,4],[129,3]]},"1935":{"position":[[157,3],[194,4]]},"1962":{"position":[[96,3]]},"2054":{"position":[[1640,4]]},"2070":{"position":[[100,3],[136,4],[492,3],[520,4],[792,5]]},"2072":{"position":[[152,3],[180,4]]},"2081":{"position":[[103,3],[139,4]]},"2107":{"position":[[455,3]]}}}],["api.group(\"/v1",{"_index":417,"t":{"1935":{"position":[[205,16]]},"2070":{"position":[[147,16],[531,16]]},"2072":{"position":[[191,16]]},"2081":{"position":[[150,16]]}}}],["api.group(\"/v2",{"_index":423,"t":{"1935":{"position":[[330,16]]},"2070":{"position":[[272,16],[647,16]]},"2081":{"position":[[275,16]]}}}],["api/v1",{"_index":418,"t":{"1935":{"position":[[234,7]]},"2070":{"position":[[176,7],[551,7]]},"2072":{"position":[[282,7]]},"2081":{"position":[[179,7]]}}}],["api/v1/list",{"_index":420,"t":{"1935":{"position":[[270,12]]},"2070":{"position":[[212,12],[587,12]]},"2072":{"position":[[318,12]]},"2081":{"position":[[215,12]]}}}],["api/v1/us",{"_index":422,"t":{"1935":{"position":[[311,12]]},"2070":{"position":[[253,12],[628,12]]},"2072":{"position":[[359,12]]},"2081":{"position":[[256,12]]}}}],["api/v2",{"_index":424,"t":{"1935":{"position":[[359,7]]},"2070":{"position":[[303,7],[667,7]]},"2081":{"position":[[306,7]]}}}],["api/v2/list",{"_index":426,"t":{"1935":{"position":[[395,12]]},"2070":{"position":[[339,12],[703,12]]},"2081":{"position":[[342,12]]}}}],["api/v2/us",{"_index":428,"t":{"1935":{"position":[[436,12]]},"2070":{"position":[[380,12],[744,12]]},"2081":{"position":[[383,12]]}}}],["app",{"_index":125,"t":{"1918":{"position":[[61,4],[149,3]]},"1920":{"position":[[405,3]]},"1922":{"position":[[249,3]]},"1927":{"position":[[26,3],[149,4],[223,3]]},"1929":{"position":[[115,3],[303,4],[330,3]]},"1935":{"position":[[138,3]]},"1937":{"position":[[87,3]]},"1952":{"position":[[12,4],[98,4]]},"1972":{"position":[[143,3]]},"2054":{"position":[[1372,4]]},"2063":{"position":[[599,3]]},"2067":{"position":[[518,3]]},"2070":{"position":[[81,3],[473,3]]},"2072":{"position":[[133,3]]},"2081":{"position":[[84,3]]},"2084":{"position":[[250,3],[337,3]]},"2086":{"position":[[354,3]]}}}],["app.add(method",{"_index":386,"t":{"1933":{"position":[[131,15]]}}}],["app.all(path",{"_index":389,"t":{"1933":{"position":[[237,12]]}}}],["app.connect(path",{"_index":397,"t":{"1933":{"position":[[678,16]]}}}],["app.delete(path",{"_index":396,"t":{"1933":{"position":[[623,15]]}}}],["app.get",{"_index":129,"t":{"1918":{"position":[[168,12]]},"1920":{"position":[[708,12]]},"1943":{"position":[[379,12]]},"1946":{"position":[[340,12],[767,12]]},"1948":{"position":[[205,12]]},"1950":{"position":[[118,12]]},"1954":{"position":[[131,12]]},"1960":{"position":[[101,12]]},"1964":{"position":[[202,12]]},"1966":{"position":[[194,12]]},"1968":{"position":[[341,12]]},"1970":{"position":[[150,12]]},"1974":{"position":[[230,12]]},"1982":{"position":[[136,12]]},"1984":{"position":[[126,12]]},"1986":{"position":[[78,12]]},"1988":{"position":[[163,12]]},"1990":{"position":[[278,12]]},"1994":{"position":[[347,12]]},"1996":{"position":[[134,12]]},"2006":{"position":[[235,12],[307,12],[379,12]]},"2008":{"position":[[120,12]]},"2014":{"position":[[134,12]]},"2016":{"position":[[382,12]]},"2020":{"position":[[138,12]]},"2022":{"position":[[428,12]]},"2032":{"position":[[160,12],[582,12]]},"2038":{"position":[[112,12]]},"2042":{"position":[[106,12]]},"2044":{"position":[[292,12]]},"2046":{"position":[[138,12]]},"2048":{"position":[[237,12]]},"2050":{"position":[[92,12]]},"2052":{"position":[[244,12]]},"2063":{"position":[[206,12],[648,12],[1044,12]]},"2075":{"position":[[248,12]]},"2079":{"position":[[642,12]]},"2084":{"position":[[493,12]]},"2086":{"position":[[406,12]]}}}],["app.get(\"/:foo",{"_index":105,"t":{"1916":{"position":[[1115,16]]}}}],["app.get(\"/:nam",{"_index":179,"t":{"1920":{"position":[[1016,18]]}}}],["app.get(\"/:valu",{"_index":174,"t":{"1920":{"position":[[823,18]]}}}],["app.get(\"/about",{"_index":1143,"t":{"2075":{"position":[[352,17]]}}}],["app.get(\"/admin",{"_index":779,"t":{"1998":{"position":[[348,17]]}}}],["app.get(\"/api",{"_index":185,"t":{"1920":{"position":[[1229,17]]}}}],["app.get(\"/api/list",{"_index":411,"t":{"1933":{"position":[[1139,20]]}}}],["app.get(\"/api/us",{"_index":689,"t":{"1972":{"position":[[265,20]]}}}],["app.get(\"/bodylimit",{"_index":552,"t":{"1952":{"position":[[111,21]]}}}],["app.get(\"/coffe",{"_index":875,"t":{"2022":{"position":[[247,18]]}}}],["app.get(\"/delet",{"_index":635,"t":{"1960":{"position":[[830,18]]}}}],["app.get(\"/flights/:from",{"_index":1171,"t":{"2077":{"position":[[1037,23]]}}}],["app.get(\"/hello/:nam",{"_index":896,"t":{"2026":{"position":[[236,23]]}}}],["app.get(\"/john",{"_index":431,"t":{"1937":{"position":[[123,16]]}}}],["app.get(\"/json",{"_index":747,"t":{"1992":{"position":[[212,16]]}}}],["app.get(\"/not",{"_index":922,"t":{"2034":{"position":[[256,13]]},"2036":{"position":[[197,13]]}}}],["app.get(\"/plantae/:genus.:speci",{"_index":1164,"t":{"2077":{"position":[[877,35]]}}}],["app.get(\"/random.txt",{"_index":1146,"t":{"2075":{"position":[[467,22]]}}}],["app.get(\"/set",{"_index":626,"t":{"1960":{"position":[[652,15]]}}}],["app.get(\"/teapot",{"_index":877,"t":{"2022":{"position":[[312,18]]}}}],["app.get(\"/us",{"_index":835,"t":{"2012":{"position":[[198,17]]},"2077":{"position":[[534,18]]}}}],["app.get(\"/user/:nam",{"_index":827,"t":{"2010":{"position":[[317,22]]},"2077":{"position":[[621,23]]}}}],["app.get(\"/user/:name/books/:titl",{"_index":1152,"t":{"2077":{"position":[[409,35]]}}}],["app.get(\"/v1/us",{"_index":433,"t":{"1937":{"position":[[180,20]]}}}],["app.get(path",{"_index":390,"t":{"1933":{"position":[[305,12]]}}}],["app.group(\"/api",{"_index":416,"t":{"1935":{"position":[[164,17]]},"2070":{"position":[[107,17],[499,17]]},"2072":{"position":[[159,17]]},"2081":{"position":[[110,17]]}}}],["app.group(prefix",{"_index":415,"t":{"1935":{"position":[[60,16]]}}}],["app.head(\"/xhr",{"_index":435,"t":{"1937":{"position":[[240,16]]}}}],["app.head(path",{"_index":393,"t":{"1933":{"position":[[462,13]]}}}],["app.listen(\"127.0.0.1:8080",{"_index":454,"t":{"1939":{"position":[[343,28]]}}}],["app.listen(\"8080",{"_index":452,"t":{"1939":{"position":[[304,18]]}}}],["app.listen(\":8080",{"_index":453,"t":{"1939":{"position":[[323,19]]}}}],["app.listen(\"[::1]:8080",{"_index":455,"t":{"1939":{"position":[[372,24]]}}}],["app.listen(1337",{"_index":693,"t":{"1972":{"position":[[575,16]]}}}],["app.listen(3000",{"_index":132,"t":{"1918":{"position":[[229,16]]},"1927":{"position":[[249,16]]},"1929":{"position":[[239,16],[537,16]]},"1935":{"position":[[449,16]]},"2070":{"position":[[393,16],[757,16]]},"2072":{"position":[[372,16]]},"2081":{"position":[[396,16]]},"2086":{"position":[[530,16]]}}}],["app.listen(443",{"_index":465,"t":{"1939":{"position":[[607,15]]}}}],["app.listen(8080",{"_index":202,"t":{"1922":{"position":[[296,16]]},"1939":{"position":[[287,16]]}}}],["app.listen(address",{"_index":448,"t":{"1939":{"position":[[220,18]]}}}],["app.listener(ln",{"_index":467,"t":{"1941":{"position":[[72,15],[262,16]]}}}],["app.method(path",{"_index":162,"t":{"1920":{"position":[[360,15]]}}}],["app.options(path",{"_index":398,"t":{"1933":{"position":[[734,16]]}}}],["app.patch(path",{"_index":394,"t":{"1933":{"position":[[515,14]]}}}],["app.post",{"_index":567,"t":{"1956":{"position":[[111,13]]},"1958":{"position":[[463,13]]},"1976":{"position":[[166,13]]},"1978":{"position":[[140,13]]},"2000":{"position":[[114,13]]},"2002":{"position":[[210,13]]},"2004":{"position":[[228,13]]},"2018":{"position":[[286,13]]},"2028":{"position":[[119,13]]}}}],["app.post(\"/api/regist",{"_index":413,"t":{"1933":{"position":[[1213,25]]},"1972":{"position":[[162,25]]}}}],["app.post(\"/regist",{"_index":432,"t":{"1937":{"position":[[149,21]]}}}],["app.post(path",{"_index":392,"t":{"1933":{"position":[[409,13]]}}}],["app.put(\"/api/upd",{"_index":690,"t":{"1972":{"position":[[363,22]]}}}],["app.put(\"/user/:id",{"_index":434,"t":{"1937":{"position":[[210,20]]}}}],["app.put(path",{"_index":391,"t":{"1933":{"position":[[357,12]]}}}],["app.settings.casesensit",{"_index":223,"t":{"1929":{"position":[[426,26]]}}}],["app.settings.errorhandl",{"_index":1106,"t":{"2065":{"position":[[243,25]]},"2067":{"position":[[38,25],[561,25]]},"2111":{"position":[[71,25],[105,25]]}}}],["app.settings.prefork",{"_index":222,"t":{"1929":{"position":[[398,20]]}}}],["app.settings.serverhead",{"_index":225,"t":{"1929":{"position":[[494,25]]}}}],["app.settings.strictrout",{"_index":224,"t":{"1929":{"position":[[460,26]]}}}],["app.stack",{"_index":430,"t":{"1937":{"position":[[56,11]]}}}],["app.stat",{"_index":201,"t":{"1922":{"position":[[268,15]]},"1931":{"position":[[327,15],[598,15],[667,15],[2021,15]]}}}],["app.static(\"/stat",{"_index":364,"t":{"1931":{"position":[[1001,21]]}}}],["app.static(prefix",{"_index":197,"t":{"1922":{"position":[[148,18]]},"1931":{"position":[[183,18]]}}}],["app.test(req",{"_index":481,"t":{"1943":{"position":[[259,12],[674,13]]}}}],["app.trace(path",{"_index":395,"t":{"1933":{"position":[[569,14]]}}}],["app.use(\"/api",{"_index":407,"t":{"1933":{"position":[[1046,15]]},"1972":{"position":[[463,15]]}}}],["app.use(func(c",{"_index":776,"t":{"1998":{"position":[[281,14]]},"2079":{"position":[[246,14]]},"2109":{"position":[[403,14]]}}}],["app.use(handl",{"_index":405,"t":{"1933":{"position":[[945,16]]},"1937":{"position":[[106,16]]}}}],["app.use(limiter.new(limiter.config",{"_index":1070,"t":{"2058":{"position":[[477,35]]}}}],["app.use(middleware.compress",{"_index":1060,"t":{"2056":{"position":[[643,30]]}}}],["app.use(middleware.compress(2",{"_index":1061,"t":{"2056":{"position":[[712,31]]}}}],["app.use(middleware.compress(func(c",{"_index":1062,"t":{"2056":{"position":[[794,34]]}}}],["app.use(middleware.compress(middleware.compressconfig",{"_index":1064,"t":{"2056":{"position":[[912,54]]}}}],["app.use(middleware.logger(middleware.loggerconfig",{"_index":1077,"t":{"2058":{"position":[[823,50]]}}}],["app.use(middleware.recov",{"_index":1086,"t":{"2063":{"position":[[618,29]]}}}],["app.use(prefix",{"_index":406,"t":{"1933":{"position":[[984,14]]}}}],["appear",{"_index":668,"t":{"1968":{"position":[[197,7]]}}}],["append",{"_index":457,"t":{"1939":{"position":[[425,6]]},"1948":{"position":[[0,7]]},"2032":{"position":[[84,6]]},"2048":{"position":[[67,6]]},"2050":{"position":[[0,7]]}}}],["append(error",{"_index":1234,"t":{"2089":{"position":[[1018,14]]}}}],["appli",{"_index":1187,"t":{"2079":{"position":[[777,5]]}}}],["applic",{"_index":142,"t":{"1920":{"position":[[37,11]]},"1929":{"position":[[13,11]]},"1943":{"position":[[13,11]]},"1952":{"position":[[58,11]]},"2044":{"position":[[76,11]]},"2058":{"position":[[31,12]]},"2092":{"position":[[58,11]]},"2107":{"position":[[88,11],[229,11]]}}}],["application/json",{"_index":508,"t":{"1946":{"position":[[323,16],[509,18]]},"1958":{"position":[[148,16],[710,17]]},"1972":{"position":[[522,19]]},"1974":{"position":[[417,16]]},"1992":{"position":[[99,17],[409,16],[589,16]]},"2046":{"position":[[260,18]]},"2089":{"position":[[1386,17]]}}}],["application/pdf",{"_index":812,"t":{"2004":{"position":[[705,17]]},"2028":{"position":[[504,17]]}}}],["application/x",{"_index":575,"t":{"1958":{"position":[[181,13],[947,13]]}}}],["application/xml",{"_index":574,"t":{"1958":{"position":[[165,15],[823,16]]}}}],["argument",{"_index":480,"t":{"1943":{"position":[[239,9]]}}}],["array",{"_index":732,"t":{"1988":{"position":[[11,5]]}}}],["articl",{"_index":209,"t":{"1924":{"position":[[92,7]]}}}],["ascii",{"_index":302,"t":{"1929":{"position":[[2323,5]]}}}],["asia/chongq",{"_index":1081,"t":{"2058":{"position":[[945,17]]}}}],["assert",{"_index":910,"t":{"2032":{"position":[[436,10]]}}}],["asset",{"_index":358,"t":{"1931":{"position":[[777,7]]}}}],["assumpt",{"_index":1348,"t":{"2107":{"position":[[177,11]]}}}],["attach",{"_index":543,"t":{"1950":{"position":[[59,11],[194,10],[273,11]]},"1968":{"position":[[35,11]]}}}],["auth",{"_index":1007,"t":{"2054":{"position":[[1059,4],[1457,4],[1494,4]]}}}],["authent",{"_index":1008,"t":{"2054":{"position":[[1098,15],[1531,15]]}}}],["avail",{"_index":102,"t":{"1916":{"position":[[1075,9]]},"1998":{"position":[[73,9]]},"2092":{"position":[[404,9]]}}}],["averag",{"_index":1297,"t":{"2094":{"position":[[425,7],[499,7]]},"2096":{"position":[[50,7],[129,7]]},"2098":{"position":[[50,7],[129,7]]},"2100":{"position":[[51,7],[130,7]]},"2102":{"position":[[53,7],[133,7]]}}}],["b",{"_index":861,"t":{"2020":{"position":[[172,1]]}}}],["b.type",{"_index":863,"t":{"2020":{"position":[[194,6]]}}}],["back",{"_index":257,"t":{"1929":{"position":[[1348,4]]}}}],["backward",{"_index":1036,"t":{"2054":{"position":[[1790,8]]}}}],["base",{"_index":501,"t":{"1946":{"position":[[74,5]]},"1954":{"position":[[12,4]]},"1958":{"position":[[114,5]]},"2034":{"position":[[89,5]]},"2054":{"position":[[1525,5],[1743,5],[2053,5]]},"2075":{"position":[[168,5]]}}}],["basic",{"_index":1006,"t":{"2054":{"position":[[1053,5],[1092,5]]}}}],["befor",{"_index":258,"t":{"1929":{"position":[[1353,6],[2960,6]]}}}],["beggin",{"_index":401,"t":{"1933":{"position":[[871,9]]}}}],["begin",{"_index":941,"t":{"2044":{"position":[[164,9]]},"2079":{"position":[[811,5]]}}}],["behavior",{"_index":1359,"t":{"2109":{"position":[[105,8]]}}}],["belong",{"_index":1132,"t":{"2070":{"position":[[46,6]]}}}],["below",{"_index":70,"t":{"1916":{"position":[[467,5]]},"1918":{"position":[[9,5]]},"1931":{"position":[[986,6]]},"1960":{"position":[[589,5]]},"2063":{"position":[[481,6]]},"2089":{"position":[[263,6]]},"2104":{"position":[[510,6],[653,6]]},"2109":{"position":[[341,6]]}}}],["benchmark",{"_index":1320,"t":{"2104":{"position":[[49,9]]}}}],["better",{"_index":1334,"t":{"2104":{"position":[[346,7],[457,7]]}}}],["big",{"_index":343,"t":{"1929":{"position":[[3424,3]]}}}],["binari",{"_index":794,"t":{"2004":{"position":[[52,6]]}}}],["bind",{"_index":440,"t":{"1939":{"position":[[0,5]]},"1958":{"position":[[0,5]]},"2084":{"position":[[479,7]]}}}],["bit",{"_index":370,"t":{"1931":{"position":[[1207,3]]}}}],["bodi",{"_index":266,"t":{"1929":{"position":[[1527,5],[2868,5]]},"1943":{"position":[[746,5]]},"1956":{"position":[[20,5],[157,4]]},"1958":{"position":[[18,4]]},"1990":{"position":[[174,5]]},"2032":{"position":[[23,5],[38,4]]},"2036":{"position":[[59,5],[81,4]]},"2050":{"position":[[30,4]]},"2086":{"position":[[565,6],[592,7]]}}}],["bodylimit",{"_index":262,"t":{"1929":{"position":[[1469,9]]},"1952":{"position":[[154,9]]}}}],["bodypars",{"_index":571,"t":{"1958":{"position":[[36,10]]},"2018":{"position":[[26,11]]}}}],["boilerpl",{"_index":1355,"t":{"2107":{"position":[[417,11]]}}}],["bool",{"_index":230,"t":{"1929":{"position":[[614,4],[860,4],[1003,4],[1124,4],[1298,4],[1877,4],[2025,4],[2144,4],[2268,4],[2387,4],[2476,4]]},"1931":{"position":[[1730,4],[1825,4],[1901,4]]},"1964":{"position":[[136,4],[150,4]]},"1990":{"position":[[223,4]]},"2030":{"position":[[91,4]]},"2034":{"position":[[233,8]]},"2052":{"position":[[195,4]]},"2056":{"position":[[366,4],[841,4],[992,4]]},"2058":{"position":[[280,4],[562,4],[585,4],[989,4],[1012,4]]},"2089":{"position":[[483,4]]}}}],["boolean",{"_index":898,"t":{"2030":{"position":[[2,7]]},"2052":{"position":[[2,7]]}}}],["both",{"_index":308,"t":{"1929":{"position":[[2529,4]]}}}],["bottom",{"_index":1363,"t":{"2109":{"position":[[321,6]]}}}],["boundari",{"_index":645,"t":{"1962":{"position":[[100,11]]}}}],["br",{"_index":535,"t":{"1946":{"position":[[890,5]]}}}],["brotli",{"_index":975,"t":{"2054":{"position":[[198,6]]},"2056":{"position":[[396,7]]}}}],["brotlicompress",{"_index":1048,"t":{"2056":{"position":[[59,18]]}}}],["brows",{"_index":135,"t":{"1918":{"position":[[265,6]]},"1931":{"position":[[1850,9],[1894,6],[2096,7]]}}}],["browser",{"_index":616,"t":{"1960":{"position":[[340,8]]},"1968":{"position":[[58,8],[212,7]]}}}],["buffer",{"_index":87,"t":{"1916":{"position":[[691,6]]},"1929":{"position":[[3246,6],[3337,6],[3478,6]]}}}],["build",{"_index":5,"t":{"1912":{"position":[[43,5]]},"1924":{"position":[[31,5],[103,8]]},"2107":{"position":[[439,8]]}}}],["built",{"_index":1040,"t":{"2054":{"position":[[1909,5]]}}}],["builtin",{"_index":88,"t":{"1916":{"position":[[713,8]]}}}],["byte",{"_index":380,"t":{"1931":{"position":[[1746,4]]},"2020":{"position":[[204,7]]},"2032":{"position":[[507,7]]}}}],["byte(\"get",{"_index":680,"t":{"1970":{"position":[[225,13]]}}}],["byterang",{"_index":382,"t":{"1931":{"position":[[1815,9],[2079,10]]}}}],["bytes=500",{"_index":858,"t":{"2020":{"position":[[115,9]]}}}],["c",{"_index":687,"t":{"1972":{"position":[[193,2],[291,2],[391,2]]},"2058":{"position":[[547,2],[974,2]]}}}],["c.accepts(\"application/json",{"_index":515,"t":{"1946":{"position":[[476,29]]}}}],["c.accepts(\"html",{"_index":509,"t":{"1946":{"position":[[374,17]]}}}],["c.accepts(\"image/png",{"_index":516,"t":{"1946":{"position":[[528,22]]}}}],["c.accepts(\"json",{"_index":513,"t":{"1946":{"position":[[440,17]]}}}],["c.accepts(\"png",{"_index":517,"t":{"1946":{"position":[[557,16]]}}}],["c.accepts(\"text/html",{"_index":511,"t":{"1946":{"position":[[402,22]]}}}],["c.accepts(typ",{"_index":503,"t":{"1946":{"position":[[127,15]]}}}],["c.acceptscharsets(\"utf",{"_index":532,"t":{"1946":{"position":[[801,22]]}}}],["c.acceptscharsets(charset",{"_index":504,"t":{"1946":{"position":[[161,26]]}}}],["c.acceptsencodings(\"compress",{"_index":534,"t":{"1946":{"position":[[859,30]]}}}],["c.acceptsencodings(encod",{"_index":505,"t":{"1946":{"position":[[206,28]]}}}],["c.acceptslanguages(\"pt",{"_index":536,"t":{"1946":{"position":[[910,24]]}}}],["c.acceptslanguages(lang",{"_index":506,"t":{"1946":{"position":[[253,24]]}}}],["c.app",{"_index":551,"t":{"1952":{"position":[[90,7]]}}}],["c.app().settings.bodylimit",{"_index":553,"t":{"1952":{"position":[[167,26]]}}}],["c.append(\"link",{"_index":539,"t":{"1948":{"position":[[239,16],[345,16]]}}}],["c.append(field",{"_index":538,"t":{"1948":{"position":[[163,15]]}}}],["c.attach",{"_index":545,"t":{"1950":{"position":[[152,14]]}}}],["c.attachment(\"./upload/images/logo.png",{"_index":546,"t":{"1950":{"position":[[205,40]]}}}],["c.attachment(fil",{"_index":544,"t":{"1950":{"position":[[81,17]]}}}],["c.baseurl",{"_index":558,"t":{"1954":{"position":[[62,11],[165,11]]}}}],["c.bodi",{"_index":561,"t":{"1956":{"position":[[36,8],[181,8]]}}}],["c.bodyparser(out",{"_index":579,"t":{"1958":{"position":[[245,16]]}}}],["c.bodyparser(p",{"_index":592,"t":{"1958":{"position":[[525,16]]}}}],["c.bodyparser(us",{"_index":1238,"t":{"2089":{"position":[[1142,19]]}}}],["c.clearcooki",{"_index":610,"t":{"1960":{"position":[[158,15]]}}}],["c.clearcookie(\"token",{"_index":612,"t":{"1960":{"position":[[268,22]]}}}],["c.clearcookie(\"us",{"_index":611,"t":{"1960":{"position":[[209,21]]}}}],["c.clearcookie(key",{"_index":608,"t":{"1960":{"position":[[64,17]]}}}],["c.context",{"_index":646,"t":{"1962":{"position":[[122,11]]}}}],["c.cookie(&fiber.cooki",{"_index":627,"t":{"1960":{"position":[[689,23],[870,23]]}}}],["c.cookie(*cooki",{"_index":647,"t":{"1964":{"position":[[21,17]]}}}],["c.cookie(cooki",{"_index":657,"t":{"1964":{"position":[[385,16]]}}}],["c.cookies(\"empti",{"_index":662,"t":{"1966":{"position":[[278,18]]}}}],["c.cookies(\"nam",{"_index":661,"t":{"1966":{"position":[[250,17]]}}}],["c.cookies(key",{"_index":659,"t":{"1966":{"position":[[133,13]]}}}],["c.download(\"./files/report",{"_index":672,"t":{"1968":{"position":[[385,26],[515,26]]}}}],["c.download(path",{"_index":671,"t":{"1968":{"position":[[290,16]]}}}],["c.error",{"_index":686,"t":{"1972":{"position":[[105,9]]}}}],["c.fasthttp.request.header.method",{"_index":679,"t":{"1970":{"position":[[184,34]]}}}],["c.fasthttp.response.write([]byte(\"hello",{"_index":681,"t":{"1970":{"position":[[239,40]]}}}],["c.format(\"hello",{"_index":700,"t":{"1974":{"position":[[286,16],[353,16],[434,16]]}}}],["c.format(bodi",{"_index":699,"t":{"1974":{"position":[[195,13]]}}}],["c.formfile(\"docu",{"_index":707,"t":{"1976":{"position":[[260,22]]}}}],["c.formfile(nam",{"_index":705,"t":{"1976":{"position":[[103,15]]}}}],["c.formvalue(\"nam",{"_index":712,"t":{"1978":{"position":[[218,19]]}}}],["c.formvalue(nam",{"_index":711,"t":{"1978":{"position":[[100,16]]}}}],["c.get(\"cont",{"_index":721,"t":{"1982":{"position":[[170,14],[208,14]]}}}],["c.get(\"someth",{"_index":722,"t":{"1982":{"position":[[246,18]]}}}],["c.get(field",{"_index":720,"t":{"1982":{"position":[[101,11]]}}}],["c.hostnam",{"_index":725,"t":{"1984":{"position":[[66,12],[160,12]]}}}],["c.ip",{"_index":730,"t":{"1986":{"position":[[56,6],[112,6]]},"1988":{"position":[[92,7],[197,7]]}}}],["c.is(\".html",{"_index":740,"t":{"1990":{"position":[[333,13]]}}}],["c.is(\"html",{"_index":739,"t":{"1990":{"position":[[312,12]]}}}],["c.is(\"json",{"_index":741,"t":{"1990":{"position":[[355,12]]}}}],["c.is(t",{"_index":737,"t":{"1990":{"position":[[208,6]]}}}],["c.json(&us",{"_index":688,"t":{"1972":{"position":[[220,14],[318,14],[418,14]]}}}],["c.json(data",{"_index":750,"t":{"1992":{"position":[[329,13]]}}}],["c.json(error",{"_index":1240,"t":{"2089":{"position":[[1221,14]]}}}],["c.json(fiber.map",{"_index":752,"t":{"1992":{"position":[[473,17]]},"2072":{"position":[[229,17]]}}}],["c.json(us",{"_index":1241,"t":{"2089":{"position":[[1286,12]]}}}],["c.json(v",{"_index":743,"t":{"1992":{"position":[[127,8]]}}}],["c.jsonp(data",{"_index":758,"t":{"1994":{"position":[[450,13],[509,13]]}}}],["c.jsonp(v",{"_index":757,"t":{"1994":{"position":[[241,9]]}}}],["c.link",{"_index":766,"t":{"1996":{"position":[[168,7]]}}}],["c.links(link",{"_index":765,"t":{"1996":{"position":[[102,12]]}}}],["c.locals(\"us",{"_index":777,"t":{"1998":{"position":[[310,16],[390,16]]}}}],["c.locals(key",{"_index":775,"t":{"1998":{"position":[[218,12]]}}}],["c.location(\"/foo/bar",{"_index":787,"t":{"2000":{"position":[[182,22]]}}}],["c.location(\"http://example.com",{"_index":786,"t":{"2000":{"position":[[149,32]]}}}],["c.location(path",{"_index":785,"t":{"2000":{"position":[[82,15]]}}}],["c.method",{"_index":790,"t":{"2002":{"position":[[245,10]]}}}],["c.method(overrid",{"_index":789,"t":{"2002":{"position":[[166,17]]}}}],["c.multipartform",{"_index":797,"t":{"2004":{"position":[[177,17],[308,18]]},"2028":{"position":[[199,18]]}}}],["c.next",{"_index":410,"t":{"1933":{"position":[[1127,8]]},"1998":{"position":[[336,8]]},"2006":{"position":[[295,8],[367,8]]},"2072":{"position":[[267,8]]},"2079":{"position":[[587,8]]}}}],["c.next(err",{"_index":674,"t":{"1968":{"position":[[438,11],[582,11]]},"1972":{"position":[[248,11],[346,11],[446,11]]},"2006":{"position":[[206,10]]},"2034":{"position":[[355,11],[483,11]]},"2063":{"position":[[297,11],[1105,11],[1192,11]]}}}],["c.originalurl",{"_index":820,"t":{"2008":{"position":[[44,15],[154,15]]}}}],["c.param",{"_index":187,"t":{"1920":{"position":[[1290,14]]}}}],["c.param(\"foo",{"_index":77,"t":{"1916":{"position":[[543,14],[805,14]]}}}],["c.params(\"ag",{"_index":829,"t":{"2010":{"position":[[389,15]]}}}],["c.params(\"from",{"_index":1172,"t":{"2077":{"position":[[1088,16]]}}}],["c.params(\"genu",{"_index":1165,"t":{"2077":{"position":[[934,17]]}}}],["c.params(\"nam",{"_index":180,"t":{"1920":{"position":[[1059,16],[1102,17]]},"2010":{"position":[[361,16]]}}}],["c.params(\"speci",{"_index":1167,"t":{"2077":{"position":[[962,19]]}}}],["c.params(\"to",{"_index":1173,"t":{"2077":{"position":[[1112,14]]}}}],["c.params(\"valu",{"_index":176,"t":{"1920":{"position":[[899,18]]}}}],["c.params(param",{"_index":825,"t":{"2010":{"position":[[218,14]]}}}],["c.path",{"_index":836,"t":{"2012":{"position":[[237,8]]},"2056":{"position":[[855,8],[1006,8]]}}}],["c.path(overrid",{"_index":833,"t":{"2012":{"position":[[114,15]]}}}],["c.protocol",{"_index":837,"t":{"2014":{"position":[[80,12],[168,12]]},"2030":{"position":[[141,12]]}}}],["c.query(\"brand",{"_index":844,"t":{"2016":{"position":[[443,16]]}}}],["c.query(\"empti",{"_index":846,"t":{"2016":{"position":[[470,16]]}}}],["c.query(\"ord",{"_index":842,"t":{"2016":{"position":[[416,16]]}}}],["c.query(paramet",{"_index":840,"t":{"2016":{"position":[[263,17]]}}}],["c.queryparser(out",{"_index":847,"t":{"2018":{"position":[[74,17]]}}}],["c.queryparser(p",{"_index":852,"t":{"2018":{"position":[[348,17]]}}}],["c.range(1000",{"_index":862,"t":{"2020":{"position":[[177,13]]}}}],["c.range(int",{"_index":857,"t":{"2020":{"position":[[79,11]]}}}],["c.redirect(\"../login",{"_index":882,"t":{"2022":{"position":[[485,22]]}}}],["c.redirect(\"/foo/bar",{"_index":881,"t":{"2022":{"position":[[462,22]]}}}],["c.redirect(\"/teapot",{"_index":876,"t":{"2022":{"position":[[287,21]]}}}],["c.redirect(\"http://example.com",{"_index":883,"t":{"2022":{"position":[[508,32],[541,32]]}}}],["c.redirect(path",{"_index":874,"t":{"2022":{"position":[[200,15]]}}}],["c.render(\"index",{"_index":1193,"t":{"2084":{"position":[[540,17]]},"2086":{"position":[[469,17]]}}}],["c.render(fil",{"_index":887,"t":{"2024":{"position":[[209,13]]}}}],["c.rout",{"_index":889,"t":{"2026":{"position":[[44,9],[137,9]]}}}],["c.savefile(fh",{"_index":897,"t":{"2028":{"position":[[61,13]]}}}],["c.savefile(fil",{"_index":708,"t":{"1976":{"position":[[352,16]]},"2004":{"position":[[750,16]]},"2028":{"position":[[549,16]]}}}],["c.secur",{"_index":900,"t":{"2030":{"position":[[80,10]]}}}],["c.send(\"about",{"_index":1144,"t":{"2075":{"position":[[391,15]]}}}],["c.send(\"api",{"_index":186,"t":{"1920":{"position":[[1268,11]]}}}],["c.send(\"get",{"_index":175,"t":{"1920":{"position":[[863,11]]}}}],["c.send(\"hello",{"_index":130,"t":{"1918":{"position":[[202,14]]},"1920":{"position":[[742,14],[1084,13]]},"1943":{"position":[[503,14]]},"2006":{"position":[[439,14]]},"2032":{"position":[[194,14]]},"2036":{"position":[[293,14]]},"2079":{"position":[[676,14]]}}}],["c.send(\"i'm",{"_index":412,"t":{"1933":{"position":[[1181,11],[1260,11]]}}}],["c.send(\"random.txt",{"_index":1147,"t":{"2075":{"position":[[511,20]]}}}],["c.send(\"root",{"_index":1142,"t":{"2075":{"position":[[282,14]]}}}],["c.send(\"wher",{"_index":182,"t":{"1920":{"position":[[1146,13]]}}}],["c.send(123",{"_index":904,"t":{"2032":{"position":[[294,11]]}}}],["c.send([]byte(\"hello",{"_index":903,"t":{"2032":{"position":[[240,21]]}}}],["c.send(bodi",{"_index":902,"t":{"2032":{"position":[[124,11]]}}}],["c.send(bodylimit",{"_index":554,"t":{"1952":{"position":[[194,17]]}}}],["c.send(c.param",{"_index":1155,"t":{"2077":{"position":[[574,21]]}}}],["c.send(c.params(\"nam",{"_index":1156,"t":{"2077":{"position":[[666,24]]}}}],["c.sendbyte([]byte(\"hello",{"_index":918,"t":{"2032":{"position":[[616,25]]}}}],["c.sendbytes(b",{"_index":913,"t":{"2032":{"position":[[493,13]]}}}],["c.sendfile(\"./public/404.html",{"_index":923,"t":{"2034":{"position":[[309,32]]}}}],["c.sendfile(\"./static/index.html",{"_index":925,"t":{"2034":{"position":[[429,33]]}}}],["c.sendfile(\"fil",{"_index":1085,"t":{"2063":{"position":[[247,16]]}}}],["c.sendfile(path",{"_index":921,"t":{"2034":{"position":[[200,15]]}}}],["c.sendstatus(403",{"_index":781,"t":{"1998":{"position":[[467,17]]}}}],["c.sendstatus(415",{"_index":929,"t":{"2036":{"position":[[240,17],[317,17]]}}}],["c.sendstatus(statu",{"_index":928,"t":{"2036":{"position":[[164,19]]}}}],["c.sendstream(bytes.newreader([]byte(\"hello",{"_index":920,"t":{"2032":{"position":[[726,43]]}}}],["c.sendstream(r",{"_index":915,"t":{"2032":{"position":[[538,14]]}}}],["c.sendstring(",{"_index":914,"t":{"2032":{"position":[[515,14]]}}}],["c.sendstring(\"hello",{"_index":919,"t":{"2032":{"position":[[674,20]]}}}],["c.set(\"cont",{"_index":691,"t":{"1972":{"position":[[500,14]]},"2038":{"position":[[146,14]]}}}],["c.set(\"strict",{"_index":1178,"t":{"2079":{"position":[[429,13]]}}}],["c.set(\"x",{"_index":408,"t":{"1933":{"position":[[1083,8]]},"2079":{"position":[[305,8],[348,8],[391,8],[483,8],[522,8]]}}}],["c.set(field",{"_index":933,"t":{"2038":{"position":[[77,12]]}}}],["c.status(200",{"_index":936,"t":{"2042":{"position":[[140,13]]}}}],["c.status(200).send(\"welcom",{"_index":780,"t":{"1998":{"position":[[420,28]]}}}],["c.status(400).send(\"bad",{"_index":937,"t":{"2042":{"position":[[154,23]]}}}],["c.status(404).sendfile(\"./public/gopher.png",{"_index":938,"t":{"2042":{"position":[[188,45]]}}}],["c.status(500).send(c.error",{"_index":692,"t":{"1972":{"position":[[542,29]]}}}],["c.status(500).send(err",{"_index":751,"t":{"1992":{"position":[[356,23],[536,23]]}}}],["c.status(500).sendstring(err.error",{"_index":1366,"t":{"2111":{"position":[[165,37]]}}}],["c.status(fiber.statusnotfound).sendstring(\"sorri",{"_index":1364,"t":{"2109":{"position":[[432,48]]}}}],["c.status(fiber.statusteapot).send",{"_index":878,"t":{"2022":{"position":[[352,37]]}}}],["c.status(statu",{"_index":935,"t":{"2042":{"position":[[77,15]]}}}],["c.subdomain",{"_index":945,"t":{"2044":{"position":[[326,14]]}}}],["c.subdomains(1",{"_index":948,"t":{"2044":{"position":[[364,15]]}}}],["c.subdomains(offset",{"_index":943,"t":{"2044":{"position":[[211,19]]}}}],["c.type(\".html",{"_index":951,"t":{"2046":{"position":[[172,15]]}}}],["c.type(\"html",{"_index":952,"t":{"2046":{"position":[[206,14]]}}}],["c.type(\"json",{"_index":953,"t":{"2046":{"position":[[239,14]]}}}],["c.type(\"png",{"_index":954,"t":{"2046":{"position":[[279,13]]}}}],["c.type(t",{"_index":950,"t":{"2046":{"position":[[106,8]]}}}],["c.vary(\"accept",{"_index":962,"t":{"2048":{"position":[[424,14]]}}}],["c.vary(\"origin",{"_index":958,"t":{"2048":{"position":[[271,16],[376,16]]}}}],["c.vary(\"us",{"_index":959,"t":{"2048":{"position":[[307,12]]}}}],["c.vary(field",{"_index":957,"t":{"2048":{"position":[[205,12]]}}}],["c.write(\"hello",{"_index":964,"t":{"2050":{"position":[[126,15]]}}}],["c.write(123",{"_index":966,"t":{"2050":{"position":[[211,12]]}}}],["c.write([]byte(\"world",{"_index":965,"t":{"2050":{"position":[[161,22]]}}}],["c.write(bodi",{"_index":963,"t":{"2050":{"position":[[55,12]]}}}],["c.write(c.params(\"nam",{"_index":1153,"t":{"2077":{"position":[[466,25]]}}}],["c.write(c.params(\"titl",{"_index":1154,"t":{"2077":{"position":[[492,26]]}}}],["c.xhr",{"_index":971,"t":{"2052":{"position":[[187,7],[278,7]]}}}],["cach",{"_index":355,"t":{"1931":{"position":[[719,5],[1605,7]]}}}],["call",{"_index":214,"t":{"1929":{"position":[[39,7]]},"2006":{"position":[[13,7],[172,4]]},"2054":{"position":[[1117,5]]},"2079":{"position":[[75,6],[146,7]]}}}],["callback",{"_index":169,"t":{"1920":{"position":[[568,8]]},"1994":{"position":[[108,8],[142,8],[166,9],[264,8]]}}}],["callback({\"nam",{"_index":759,"t":{"1994":{"position":[[470,17]]}}}],["can't",{"_index":1365,"t":{"2109":{"position":[[481,5]]}}}],["cancel",{"_index":643,"t":{"1962":{"position":[[51,12]]}}}],["capac",{"_index":1284,"t":{"2094":{"position":[[104,8]]}}}],["capit",{"_index":165,"t":{"1920":{"position":[[471,15]]}}}],["captur",{"_index":1120,"t":{"2067":{"position":[[192,7]]},"2077":{"position":[[57,7]]},"2092":{"position":[[273,8]]},"2109":{"position":[[86,7]]}}}],["carri",{"_index":641,"t":{"1962":{"position":[[29,7]]}}}],["case",{"_index":718,"t":{"1982":{"position":[[73,4]]},"2067":{"position":[[72,6]]},"2104":{"position":[[160,4]]}}}],["casesensit",{"_index":218,"t":{"1929":{"position":[[164,14],[989,13]]}}}],["catch",{"_index":1083,"t":{"2063":{"position":[[36,7],[174,5],[703,7]]}}}],["caus",{"_index":295,"t":{"1929":{"position":[[2047,6],[2167,6]]}}}],["caution",{"_index":23,"t":{"1912":{"position":[[202,7]]},"1916":{"position":[[0,7]]},"1941":{"position":[[128,7]]},"1948":{"position":[[63,7]]},"1960":{"position":[[328,7]]},"2032":{"position":[[63,7]]},"2034":{"position":[[123,7]]},"2058":{"position":[[634,7]]},"2070":{"position":[[776,7]]}}}],["central",{"_index":991,"t":{"2054":{"position":[[573,11]]},"2067":{"position":[[309,11]]}}}],["cer",{"_index":458,"t":{"1939":{"position":[[454,4]]}}}],["chain",{"_index":816,"t":{"2006":{"position":[[159,8]]},"2054":{"position":[[536,5]]},"2079":{"position":[[610,5]]}}}],["chainabl",{"_index":934,"t":{"2042":{"position":[[56,10]]}}}],["chang",{"_index":37,"t":{"1912":{"position":[[345,7]]},"1916":{"position":[[460,6]]},"1929":{"position":[[261,6],[355,6]]},"2079":{"position":[[36,7]]}}}],["charact",{"_index":256,"t":{"1929":{"position":[[1324,10],[1452,10]]},"2077":{"position":[[321,10]]}}}],["charset",{"_index":520,"t":{"1946":{"position":[[656,8]]}}}],["charset=utf",{"_index":738,"t":{"1990":{"position":[[264,11]]}}}],["chat",{"_index":1373,"t":{"2115":{"position":[[144,5]]}}}],["check",{"_index":119,"t":{"1916":{"position":[[1465,5]]},"1924":{"position":[[67,5]]},"1946":{"position":[[0,7]]},"1976":{"position":[[286,5]]},"2065":{"position":[[378,5]]}}}],["cisco",{"_index":1277,"t":{"2092":{"position":[[559,5]]}}}],["cleaner",{"_index":1038,"t":{"2054":{"position":[[1830,7]]}}}],["clear",{"_index":609,"t":{"1960":{"position":[[138,6],[387,5]]}}}],["clearcooki",{"_index":621,"t":{"1960":{"position":[[504,11]]}}}],["client",{"_index":144,"t":{"1920":{"position":[[63,6]]},"1929":{"position":[[1993,6],[3352,7]]},"1960":{"position":[[9,6],[369,7]]},"2052":{"position":[[144,6]]},"2067":{"position":[[375,6]]},"2104":{"position":[[249,7],[596,7]]}}}],["close",{"_index":292,"t":{"1929":{"position":[[1930,5]]}}}],["cloud",{"_index":1254,"t":{"2092":{"position":[[285,5]]}}}],["cluster",{"_index":1133,"t":{"2070":{"position":[[58,8]]}}}],["code",{"_index":198,"t":{"1922":{"position":[[198,4]]},"1931":{"position":[[269,4]]},"2022":{"position":[[131,5]]},"2036":{"position":[[16,4],[129,5]]},"2063":{"position":[[884,4],[999,4]]},"2065":{"position":[[192,4],[335,4],[449,4]]},"2067":{"position":[[653,4],[788,4],[887,6]]}}}],["combin",{"_index":1139,"t":{"2075":{"position":[[13,8]]}}}],["come",{"_index":114,"t":{"1916":{"position":[[1402,5]]},"2067":{"position":[[163,4]]}}}],["command",{"_index":48,"t":{"1914":{"position":[[105,8]]},"1958":{"position":[[667,8]]},"2018":{"position":[[530,7]]},"2089":{"position":[[1343,8]]}}}],["commun",{"_index":1257,"t":{"2092":{"position":[[364,9]]}}}],["comparison",{"_index":1246,"t":{"2092":{"position":[[35,10]]}}}],["compat",{"_index":1037,"t":{"2054":{"position":[[1799,13]]}}}],["compliant",{"_index":617,"t":{"1960":{"position":[[359,9]]}}}],["composit",{"_index":1251,"t":{"2092":{"position":[[179,12]]}}}],["compress",{"_index":283,"t":{"1929":{"position":[[1738,10]]},"1931":{"position":[[1448,10],[1613,10],[1721,8],[2063,9]]},"1946":{"position":[[899,10]]},"2034":{"position":[[224,8],[407,11]]},"2054":{"position":[[133,12],[146,8],[205,12]]},"2056":{"position":[[0,8],[102,11],[374,11],[601,11],[694,11]]},"2058":{"position":[[722,8]]}}}],["compress(opt",{"_index":1050,"t":{"2056":{"position":[[190,16]]}}}],["compress;q=0.2",{"_index":527,"t":{"1946":{"position":[[715,14]]}}}],["compressconfig",{"_index":1052,"t":{"2056":{"position":[[252,14]]}}}],["compressedfilesuffix",{"_index":277,"t":{"1929":{"position":[[1641,20]]}}}],["compresslevelbestcompress",{"_index":1059,"t":{"2056":{"position":[[512,28]]}}}],["compresslevelbestspe",{"_index":1058,"t":{"2056":{"position":[[482,22]]}}}],["compressleveldefault",{"_index":1057,"t":{"2056":{"position":[[454,20],[557,20],[1044,21]]}}}],["compressleveldis",{"_index":1056,"t":{"2056":{"position":[[424,21]]}}}],["concurr",{"_index":286,"t":{"1929":{"position":[[1791,11],[1825,10]]},"2104":{"position":[[237,11],[517,11]]}}}],["config",{"_index":348,"t":{"1931":{"position":[[215,6]]},"1939":{"position":[[438,7],[547,6],[623,7]]},"2056":{"position":[[240,6],[905,6]]}}}],["configur",{"_index":268,"t":{"1929":{"position":[[1557,10]]},"2058":{"position":[[218,13]]},"2092":{"position":[[246,14]]}}}],["connect",{"_index":288,"t":{"1929":{"position":[[1836,12],[1901,12],[1945,11],[3235,10],[3467,10]]},"1939":{"position":[[22,11]]},"2030":{"position":[[43,10]]},"2089":{"position":[[1092,9]]}}}],["contain",{"_index":35,"t":{"1912":{"position":[[327,8]]},"1920":{"position":[[586,10]]},"1972":{"position":[[5,8]]},"2012":{"position":[[0,8]]},"2014":{"position":[[0,8]]},"2016":{"position":[[27,10]]},"2020":{"position":[[9,10]]},"2054":{"position":[[2007,8]]},"2084":{"position":[[186,8]]},"2089":{"position":[[238,9]]}}}],["content",{"_index":299,"t":{"1929":{"position":[[2186,7],[2436,7],[2452,7]]},"1946":{"position":[[39,7]]},"1950":{"position":[[23,7],[173,7],[252,7],[311,7]]},"1958":{"position":[[100,7],[127,7],[695,8],[808,8],[932,8]]},"1968":{"position":[[117,7]]},"1974":{"position":[[9,7]]},"1990":{"position":[[21,7],[61,7],[239,7]]},"1992":{"position":[[81,7],[395,7],[575,7]]},"2034":{"position":[[49,7]]},"2038":{"position":[[188,8]]},"2046":{"position":[[9,7]]},"2079":{"position":[[357,7]]},"2089":{"position":[[1371,8]]}}}],["context",{"_index":62,"t":{"1916":{"position":[[257,7],[408,7],[1328,7]]},"1920":{"position":[[601,7]]},"1929":{"position":[[1166,7],[1385,8]]}}}],["context.context",{"_index":640,"t":{"1962":{"position":[[8,15],[134,15]]}}}],["continu",{"_index":1138,"t":{"2072":{"position":[[109,9]]}}}],["contribut",{"_index":1258,"t":{"2092":{"position":[[374,11]]}}}],["control",{"_index":371,"t":{"1931":{"position":[[1216,7]]},"2054":{"position":[[558,7]]},"2079":{"position":[[544,9]]}}}],["convert",{"_index":254,"t":{"1929":{"position":[[1303,8]]},"1992":{"position":[[0,8]]},"2054":{"position":[[971,9]]}}}],["cooki",{"_index":344,"t":{"1929":{"position":[[3428,9]]},"1960":{"position":[[16,6],[31,7],[149,8],[193,6],[250,7],[397,6],[466,7],[625,6]]},"1964":{"position":[[4,6],[44,6],[246,6],[253,6],[378,6]]},"1966":{"position":[[4,6],[95,6],[235,6]]}}}],["cookie.expir",{"_index":656,"t":{"1964":{"position":[[323,14]]}}}],["cookie.nam",{"_index":654,"t":{"1964":{"position":[[281,11]]}}}],["cookie.valu",{"_index":655,"t":{"1964":{"position":[[302,12]]}}}],["copi",{"_index":85,"t":{"1916":{"position":[[664,6],[708,4]]},"1956":{"position":[[289,6]]},"1966":{"position":[[399,6]]},"1978":{"position":[[356,6]]},"1982":{"position":[[357,6]]},"1984":{"position":[[275,6]]},"2008":{"position":[[281,6]]},"2010":{"position":[[505,6]]},"2016":{"position":[[591,6]]}}}],["copy(newbuff",{"_index":93,"t":{"1916":{"position":[[902,15]]}}}],["cor",{"_index":1018,"t":{"2054":{"position":[[1269,6]]},"2070":{"position":[[125,7]]},"2081":{"position":[[128,7]]}}}],["core",{"_index":1264,"t":{"2092":{"position":[[460,5]]}}}],["correct",{"_index":926,"t":{"2036":{"position":[[29,7]]},"2089":{"position":[[60,7]]}}}],["correspond",{"_index":788,"t":{"2002":{"position":[[17,13]]},"2022":{"position":[[101,11]]}}}],["cost",{"_index":115,"t":{"1916":{"position":[[1415,4]]}}}],["cours",{"_index":113,"t":{"1916":{"position":[[1389,7]]}}}],["cpu",{"_index":378,"t":{"1931":{"position":[[1592,3]]},"2092":{"position":[[493,3]]},"2104":{"position":[[59,3],[90,3]]}}}],["crc",{"_index":312,"t":{"1929":{"position":[[2600,4]]}}}],["creat",{"_index":97,"t":{"1916":{"position":[[1006,7]]},"1918":{"position":[[80,7]]},"1927":{"position":[[12,7],[82,8]]},"1929":{"position":[[91,8],[377,8]]},"1935":{"position":[[24,8]]},"1943":{"position":[[75,8],[340,6]]},"1948":{"position":[[108,7]]},"1960":{"position":[[453,8]]},"1964":{"position":[[239,6]]},"1992":{"position":[[253,6]]},"1994":{"position":[[384,6]]},"2054":{"position":[[1821,8]]}}}],["credenti",{"_index":1009,"t":{"2054":{"position":[[1150,11],[1206,12]]}}}],["credit",{"_index":978,"t":{"2054":{"position":[[285,7]]}}}],["cross",{"_index":1015,"t":{"2054":{"position":[[1239,5]]}}}],["csrf",{"_index":1022,"t":{"2054":{"position":[[1324,4]]}}}],["css",{"_index":193,"t":{"1922":{"position":[[38,4]]},"1931":{"position":[[60,3]]}}}],["ctx",{"_index":485,"t":{"1943":{"position":[[399,5]]}}}],["ctx.next",{"_index":1089,"t":{"2063":{"position":[[774,10]]}}}],["ctx.render",{"_index":1192,"t":{"2084":{"position":[[424,12]]}}}],["ctx.set(fiber.headercontenttyp",{"_index":1115,"t":{"2065":{"position":[[489,32]]}}}],["ctx.status(500).sendstring(\"intern",{"_index":1130,"t":{"2067":{"position":[[910,36]]}}}],["ctx.status(code).sendfile(fmt.sprintf(\"./%d.html",{"_index":1129,"t":{"2067":{"position":[[836,50]]}}}],["ctx.status(code).sendstring(err.error",{"_index":1117,"t":{"2065":{"position":[[554,40]]}}}],["curl",{"_index":562,"t":{"1956":{"position":[[63,4]]},"1958":{"position":[[662,4],[679,4],[792,4],[916,4],[1028,4],[1091,4]]},"2018":{"position":[[525,4],[541,4]]},"2089":{"position":[[1338,4],[1355,4]]}}}],["current",{"_index":814,"t":{"2006":{"position":[[79,7]]},"2048":{"position":[[143,7]]},"2079":{"position":[[198,7]]},"2113":{"position":[[6,9]]}}}],["custom",{"_index":98,"t":{"1916":{"position":[[1016,6]]},"1933":{"position":[[1092,6]]},"1943":{"position":[[477,6],[624,6]]},"2056":{"position":[[687,6]]},"2063":{"position":[[835,6]]},"2067":{"position":[[2,6],[138,6],[347,10],[540,6],[709,6],[812,6]]},"2111":{"position":[[49,6]]}}}],["customfunc",{"_index":760,"t":{"1994":{"position":[[523,13]]}}}],["customfunc({\"nam",{"_index":761,"t":{"1994":{"position":[[543,19]]}}}],["d",{"_index":565,"t":{"1956":{"position":[[99,1]]}}}],["data",{"_index":436,"t":{"1937":{"position":[[266,5]]},"1958":{"position":[[230,4],[730,4],[842,4],[984,4]]},"1992":{"position":[[260,4],[273,4]]},"1994":{"position":[[391,4],[404,4]]},"1998":{"position":[[179,4]]},"2024":{"position":[[20,4],[231,4]]},"2084":{"position":[[487,5]]},"2089":{"position":[[82,4],[1406,4]]}}}],["databas",{"_index":1236,"t":{"2089":{"position":[[1105,8]]},"2092":{"position":[[137,8]]}}}],["date",{"_index":296,"t":{"1929":{"position":[[2066,4]]},"1960":{"position":[[923,4]]}}}],["deactiv",{"_index":1068,"t":{"2058":{"position":[[346,12]]}}}],["deadlin",{"_index":642,"t":{"1962":{"position":[[39,9]]}}}],["debug",{"_index":474,"t":{"1943":{"position":[[119,5]]}}}],["decod",{"_index":572,"t":{"1958":{"position":[[56,8]]}}}],["dedic",{"_index":1276,"t":{"2092":{"position":[[549,9]]},"2111":{"position":[[215,9]]}}}],["default",{"_index":55,"t":{"1916":{"position":[[65,7],[174,7]]},"1929":{"position":[[598,7],[1200,8],[2058,7],[2178,7],[2395,7],[2629,7],[2878,7],[3006,7]]},"1931":{"position":[[88,8],[1701,7],[1795,7],[1873,7],[1970,7]]},"1943":{"position":[[149,7]]},"1966":{"position":[[52,7]]},"1968":{"position":[[104,8],[243,7]]},"1994":{"position":[[129,8]]},"2010":{"position":[[75,7],[149,8]]},"2016":{"position":[[122,7]]},"2022":{"position":[[167,8]]},"2024":{"position":[[60,7],[84,7]]},"2034":{"position":[[154,8]]},"2044":{"position":[[121,8]]},"2054":{"position":[[48,8]]},"2056":{"position":[[331,8],[548,8],[626,7]]},"2058":{"position":[[701,7]]},"2063":{"position":[[369,8],[977,7]]},"2065":{"position":[[35,8],[221,7],[319,8]]},"2067":{"position":[[83,7],[637,8]]},"2111":{"position":[[16,7]]}}}],["defaultvalu",{"_index":660,"t":{"1966":{"position":[[155,12]]},"2010":{"position":[[241,12]]},"2016":{"position":[[289,12]]}}}],["defin",{"_index":1053,"t":{"2056":{"position":[[284,7]]},"2075":{"position":[[45,6]]},"2077":{"position":[[359,6]]}}}],["definit",{"_index":157,"t":{"1920":{"position":[[295,10]]},"2107":{"position":[[12,10]]}}}],["deflat",{"_index":974,"t":{"2054":{"position":[[180,8]]},"2056":{"position":[[41,8],[413,7]]}}}],["delet",{"_index":625,"t":{"1960":{"position":[[635,8]]}}}],["demonstr",{"_index":1283,"t":{"2094":{"position":[[88,11]]}}}],["depend",{"_index":444,"t":{"1939":{"position":[[151,9]]},"2056":{"position":[[121,9]]},"2104":{"position":[[660,10]]},"2107":{"position":[[59,7]]}}}],["deriv",{"_index":724,"t":{"1984":{"position":[[21,7]]},"2022":{"position":[[21,7]]}}}],["desc",{"_index":843,"t":{"2016":{"position":[[436,6]]}}}],["descript",{"_index":229,"t":{"1929":{"position":[[586,11]]},"2054":{"position":[[1847,11]]},"2089":{"position":[[187,12]]}}}],["design",{"_index":12,"t":{"1912":{"position":[[101,8],[383,7]]},"2079":{"position":[[19,8]]},"2094":{"position":[[76,8]]}}}],["detail",{"_index":1212,"t":{"2089":{"position":[[178,8],[270,8]]}}}],["determin",{"_index":141,"t":{"1920":{"position":[[18,11]]},"2044":{"position":[[148,11]]}}}],["develop",{"_index":17,"t":{"1912":{"position":[[137,11]]}}}],["dialog",{"_index":669,"t":{"1968":{"position":[[220,8]]}}}],["differ",{"_index":247,"t":{"1929":{"position":[[915,10],[1040,9]]},"1931":{"position":[[1498,11]]},"2067":{"position":[[200,9],[483,9]]},"2115":{"position":[[64,9]]}}}],["directori",{"_index":196,"t":{"1922":{"position":[[110,9],[223,9],[366,10]]},"1931":{"position":[[162,10],[294,9],[500,12],[587,10],[656,10],[966,10],[1840,9],[1941,9]]},"1976":{"position":[[341,10]]},"2107":{"position":[[302,9]]}}}],["disabl",{"_index":249,"t":{"1929":{"position":[[1063,9],[1882,7],[2491,7]]},"1943":{"position":[[189,7]]},"2034":{"position":[[181,8]]}}}],["disabledefaultcontenttyp",{"_index":298,"t":{"1929":{"position":[[2118,25]]}}}],["disabledefaultd",{"_index":294,"t":{"1929":{"position":[[2006,18]]}}}],["disableheadernorm",{"_index":304,"t":{"1929":{"position":[[2362,24]]}}}],["disablekeepal",{"_index":290,"t":{"1929":{"position":[[1860,16]]}}}],["disablestartupmessag",{"_index":300,"t":{"1929":{"position":[[2246,21]]}}}],["discord",{"_index":1369,"t":{"2115":{"position":[[21,7]]}}}],["disk",{"_index":813,"t":{"2004":{"position":[[744,5]]},"2028":{"position":[[45,5],[543,5]]}}}],["display",{"_index":1127,"t":{"2067":{"position":[[459,7]]}}}],["disposit",{"_index":542,"t":{"1950":{"position":[[31,11],[181,12],[260,12]]},"1968":{"position":[[125,11]]}}}],["django",{"_index":1198,"t":{"2086":{"position":[[108,6]]},"2113":{"position":[[90,6]]}}}],["dn",{"_index":1183,"t":{"2079":{"position":[[531,3]]}}}],["doc",{"_index":24,"t":{"1912":{"position":[[216,4],[267,4]]},"2089":{"position":[[279,4]]}}}],["doctyp",{"_index":1207,"t":{"2086":{"position":[[549,9]]}}}],["document",{"_index":678,"t":{"1970":{"position":[[106,13]]},"1976":{"position":[[235,11]]},"2004":{"position":[[476,11]]},"2028":{"position":[[275,11]]}}}],["doe",{"_index":595,"t":{"1958":{"position":[[623,3]]},"1964":{"position":[[317,5]]},"1966":{"position":[[297,6],[307,5]]},"2018":{"position":[[447,3]]}}}],["doesn't",{"_index":824,"t":{"2010":{"position":[[193,7]]},"2032":{"position":[[76,7]]}}}],["domain",{"_index":648,"t":{"1964":{"position":[[97,6]]},"2044":{"position":[[44,6]]}}}],["don't",{"_index":909,"t":{"2032":{"position":[[420,5]]}}}],["done",{"_index":46,"t":{"1914":{"position":[[83,4]]},"1943":{"position":[[28,4]]}}}],["dontcompress",{"_index":1063,"t":{"2056":{"position":[[867,15],[1018,15]]}}}],["dot",{"_index":1158,"t":{"2077":{"position":[[728,3]]}}}],["download",{"_index":41,"t":{"1914":{"position":[[14,8]]},"1968":{"position":[[91,9],[479,8],[623,8]]},"2079":{"position":[[400,8]]}}}],["duplic",{"_index":961,"t":{"2048":{"position":[[365,10]]}}}],["durat",{"_index":331,"t":{"1929":{"position":[[2951,8]]}}}],["e",{"_index":1111,"t":{"2065":{"position":[[415,2]]},"2067":{"position":[[754,2]]}}}],["e.cod",{"_index":1114,"t":{"2065":{"position":[[456,6]]},"2067":{"position":[[795,6]]}}}],["e.g",{"_index":1123,"t":{"2067":{"position":[[254,5],[382,5]]}}}],["each",{"_index":153,"t":{"1920":{"position":[[197,4]]},"1933":{"position":[[884,4]]},"2016":{"position":[[53,4]]},"2092":{"position":[[192,4]]}}}],["eas",{"_index":13,"t":{"1912":{"position":[[113,4]]}}}],["easili",{"_index":549,"t":{"1952":{"position":[[40,6]]}}}],["echo",{"_index":1131,"t":{"2067":{"position":[[988,4]]}}}],["element",{"_index":1227,"t":{"2089":{"position":[[891,7],[1033,9]]}}}],["element.failedfield",{"_index":1228,"t":{"2089":{"position":[[913,19]]}}}],["element.tag",{"_index":1230,"t":{"2089":{"position":[[957,11]]}}}],["element.valu",{"_index":1232,"t":{"2089":{"position":[[981,13]]}}}],["email",{"_index":1125,"t":{"2067":{"position":[[280,5]]},"2089":{"position":[[527,5]]}}}],["embed",{"_index":122,"t":{"1918":{"position":[[0,8]]}}}],["empti",{"_index":607,"t":{"1960":{"position":[[47,6]]},"2010":{"position":[[161,5]]},"2016":{"position":[[239,5]]},"2036":{"position":[[89,6]]},"2063":{"position":[[962,6]]}}}],["en;q=0.8",{"_index":529,"t":{"1946":{"position":[[750,9]]}}}],["enabl",{"_index":231,"t":{"1929":{"position":[[619,7],[790,7],[870,8],[1013,8],[1134,8],[2481,6],[2642,8],[3141,8]]},"1931":{"position":[[1314,6],[1738,7],[1833,6]]},"1939":{"position":[[400,6]]},"2034":{"position":[[400,6]]},"2054":{"position":[[1232,6]]},"2104":{"position":[[471,6],[614,6]]}}}],["encod",{"_index":255,"t":{"1929":{"position":[[1316,7]]},"1946":{"position":[[699,9]]},"2048":{"position":[[439,10],[499,9]]}}}],["encodingvalu",{"_index":1049,"t":{"2056":{"position":[[160,14]]}}}],["end",{"_index":815,"t":{"2006":{"position":[[151,3]]},"2079":{"position":[[599,3]]}}}],["endpoint",{"_index":146,"t":{"1920":{"position":[[94,9]]},"2054":{"position":[[1652,9]]},"2075":{"position":[[56,9]]},"2081":{"position":[[17,10]]}}}],["engin",{"_index":10,"t":{"1912":{"position":[[86,6]]},"1929":{"position":[[2766,8]]},"2024":{"position":[[104,7],[144,7]]},"2054":{"position":[[2027,7]]},"2084":{"position":[[62,7],[306,6],[330,6],[378,7]]},"2086":{"position":[[84,8],[308,6],[315,6],[395,7]]},"2113":{"position":[[36,7]]}}}],["ensur",{"_index":624,"t":{"1960":{"position":[[613,6]]},"2063":{"position":[[18,6]]},"2089":{"position":[[53,6]]}}}],["entiti",{"_index":272,"t":{"1929":{"position":[[1598,6]]}}}],["entri",{"_index":792,"t":{"2004":{"position":[[25,8]]}}}],["environ",{"_index":1295,"t":{"2094":{"position":[[338,12]]}}}],["equal",{"_index":1095,"t":{"2063":{"position":[[1017,6]]}}}],["equival",{"_index":901,"t":{"2030":{"position":[[126,10]]}}}],["err",{"_index":459,"t":{"1939":{"position":[[459,3],[517,3]]},"1941":{"position":[[198,3],[232,3]]},"1958":{"position":[[518,3],[542,3]]},"1968":{"position":[[378,3],[425,3],[458,3],[508,3],[569,3],[602,3]]},"1972":{"position":[[213,3],[235,3],[311,3],[333,3],[411,3],[433,3]]},"1976":{"position":[[253,3],[307,3]]},"1992":{"position":[[322,3],[343,3],[466,3],[523,3]]},"2004":{"position":[[301,3],[327,3]]},"2018":{"position":[[341,3],[366,3]]},"2028":{"position":[[192,3],[218,3]]},"2034":{"position":[[302,3],[342,3],[375,3],[422,3],[470,3],[503,3]]},"2063":{"position":[[240,3],[284,3],[1078,3],[1144,3]]},"2065":{"position":[[292,3]]},"2067":{"position":[[610,3],[830,3],[897,3]]},"2089":{"position":[[787,3],[819,3],[839,3],[1135,3],[1162,3]]},"2111":{"position":[[152,3]]}}}],["err.(*fiber.error",{"_index":1113,"t":{"2065":{"position":[[424,19]]},"2067":{"position":[[763,19]]}}}],["err.(validator.validationerror",{"_index":1226,"t":{"2089":{"position":[[852,32]]}}}],["err.param",{"_index":1233,"t":{"2089":{"position":[[997,11]]}}}],["err.structnamespac",{"_index":1229,"t":{"2089":{"position":[[935,21]]}}}],["err.tag",{"_index":1231,"t":{"2089":{"position":[[971,9]]}}}],["error",{"_index":451,"t":{"1939":{"position":[[272,5]]},"1941":{"position":[[122,5]]},"1943":{"position":[[322,6]]},"1958":{"position":[[275,5]]},"1968":{"position":[[327,5]]},"1972":{"position":[[18,5],[115,5]]},"1976":{"position":[[151,6],[296,7]]},"1992":{"position":[[149,5]]},"1994":{"position":[[284,5]]},"2004":{"position":[[213,6]]},"2006":{"position":[[110,5],[181,5],[217,9]]},"2018":{"position":[[105,5]]},"2024":{"position":[[267,5]]},"2034":{"position":[[242,5]]},"2054":{"position":[[728,5]]},"2063":{"position":[[48,6],[317,5],[796,5],[842,5]]},"2065":{"position":[[18,5],[59,6],[110,6],[120,5],[229,5],[296,6]]},"2067":{"position":[[9,5],[91,5],[145,5],[219,6],[296,5],[388,5],[467,5],[502,7],[547,5],[614,6],[819,5],[954,7],[1039,5]]},"2070":{"position":[[828,6],[858,6]]},"2084":{"position":[[106,5],[162,5],[525,5]]},"2089":{"position":[[736,6],[1009,6],[1054,6],[1175,6],[1205,6]]},"2109":{"position":[[49,6],[63,5]]},"2111":{"position":[[24,5],[156,6],[245,5],[280,5]]}}}],["errorhandl",{"_index":924,"t":{"2034":{"position":[[382,12],[510,12]]},"2054":{"position":[[585,13]]},"2063":{"position":[[718,14]]}}}],["errorrespons",{"_index":1220,"t":{"2089":{"position":[[614,13],[713,16],[743,16],[899,13]]}}}],["essenti",{"_index":123,"t":{"1918":{"position":[[18,11]]},"2063":{"position":[[5,9]]}}}],["establish",{"_index":899,"t":{"2030":{"position":[[57,12]]}}}],["etag",{"_index":306,"t":{"1929":{"position":[[2471,4],[2499,4],[2550,5],[2615,5]]}}}],["etc",{"_index":166,"t":{"1920":{"position":[[503,4]]}}}],["ethernet",{"_index":1279,"t":{"2092":{"position":[[573,8]]},"2094":{"position":[[317,8]]}}}],["exampl",{"_index":72,"t":{"1916":{"position":[[495,8],[733,7]]},"1927":{"position":[[154,7]]},"1929":{"position":[[52,7],[308,7],[3415,8]]},"1931":{"position":[[319,7],[548,7],[993,7],[2013,7]]},"1933":{"position":[[1038,7]]},"1935":{"position":[[116,7]]},"1937":{"position":[[79,7]]},"1939":{"position":[[278,8],[446,7]]},"1941":{"position":[[183,7]]},"1943":{"position":[[329,7]]},"1946":{"position":[[296,7]]},"1948":{"position":[[197,7]]},"1950":{"position":[[110,7]]},"1952":{"position":[[103,7]]},"1954":{"position":[[81,7]]},"1956":{"position":[[52,7]]},"1958":{"position":[[281,7]]},"1960":{"position":[[93,7],[644,7]]},"1964":{"position":[[194,7]]},"1966":{"position":[[186,7]]},"1968":{"position":[[333,7]]},"1970":{"position":[[142,7]]},"1972":{"position":[[121,7]]},"1974":{"position":[[222,7]]},"1976":{"position":[[158,7]]},"1978":{"position":[[132,7]]},"1982":{"position":[[128,7]]},"1984":{"position":[[86,7]]},"1986":{"position":[[70,7]]},"1988":{"position":[[109,7]]},"1990":{"position":[[228,7]]},"1992":{"position":[[155,7]]},"1994":{"position":[[290,7]]},"1996":{"position":[[126,7]]},"1998":{"position":[[273,7]]},"2000":{"position":[[106,7]]},"2002":{"position":[[202,7]]},"2004":{"position":[[220,7]]},"2006":{"position":[[227,7]]},"2008":{"position":[[67,7]]},"2010":{"position":[[272,7]]},"2012":{"position":[[148,7]]},"2014":{"position":[[100,7]]},"2016":{"position":[[320,7]]},"2018":{"position":[[111,7]]},"2020":{"position":[[97,7]]},"2022":{"position":[[239,7],[419,8]]},"2026":{"position":[[61,7]]},"2028":{"position":[[111,7]]},"2030":{"position":[[96,7]]},"2032":{"position":[[152,7],[574,7]]},"2034":{"position":[[248,7]]},"2036":{"position":[[189,7]]},"2038":{"position":[[104,7]]},"2042":{"position":[[98,7]]},"2044":{"position":[[248,7]]},"2046":{"position":[[130,7]]},"2048":{"position":[[229,7]]},"2050":{"position":[[84,7]]},"2052":{"position":[[200,7]]},"2056":{"position":[[590,7]]},"2058":{"position":[[363,8],[469,7],[714,7],[806,8],[815,7]]},"2063":{"position":[[198,7],[488,7],[1036,7]]},"2065":{"position":[[210,7]]},"2067":{"position":[[438,7],[510,7]]},"2075":{"position":[[144,8]]},"2077":{"position":[[348,7]]},"2079":{"position":[[213,7]]},"2086":{"position":[[143,7]]},"2089":{"position":[[148,12],[295,7]]},"2107":{"position":[[353,8]]},"2109":{"position":[[395,7]]},"2111":{"position":[[97,7]]}}}],["exce",{"_index":267,"t":{"1929":{"position":[[1545,7]]}}}],["excel",{"_index":208,"t":{"1924":{"position":[[82,9]]}}}],["except",{"_index":754,"t":{"1994":{"position":[[76,6]]}}}],["exclud",{"_index":297,"t":{"1929":{"position":[[2084,8],[2212,8]]},"1960":{"position":[[474,9]]}}}],["execut",{"_index":155,"t":{"1920":{"position":[[253,8],[609,8]]},"2006":{"position":[[24,8]]},"2079":{"position":[[154,8]]},"2084":{"position":[[229,8]]},"2092":{"position":[[81,9]]}}}],["exempt",{"_index":1069,"t":{"2058":{"position":[[408,6]]}}}],["exercis",{"_index":1282,"t":{"2094":{"position":[[25,8]]}}}],["exist",{"_index":360,"t":{"1931":{"position":[[855,5]]},"1966":{"position":[[115,6]]},"1978":{"position":[[264,5]]},"2010":{"position":[[137,6],[201,6]]},"2016":{"position":[[184,6]]},"2063":{"position":[[273,7]]}}}],["expir",{"_index":605,"t":{"1960":{"position":[[0,6],[177,6],[234,6],[484,7],[750,8],[940,8]]},"1964":{"position":[[111,7]]}}}],["expiri",{"_index":636,"t":{"1960":{"position":[[916,6]]}}}],["explain",{"_index":1367,"t":{"2111":{"position":[[230,10]]}}}],["exploit",{"_index":1023,"t":{"2054":{"position":[[1329,9]]}}}],["express",{"_index":1,"t":{"1912":{"position":[[12,7]]},"1924":{"position":[[115,7]]},"2067":{"position":[[995,7]]},"2094":{"position":[[452,7]]},"2096":{"position":[[78,7]]},"2098":{"position":[[78,7]]},"2100":{"position":[[78,7]]},"2102":{"position":[[80,7]]}}}],["extens",{"_index":499,"t":{"1946":{"position":[[25,10]]},"2034":{"position":[[112,10]]},"2046":{"position":[[85,10]]}}}],["extern",{"_index":999,"t":{"2054":{"position":[[819,8]]}}}],["f",{"_index":601,"t":{"1958":{"position":[[1042,1],[1055,1]]}}}],["failedfield",{"_index":1221,"t":{"2089":{"position":[[637,11]]}}}],["failedfield\":\"user.email\",\"tag\":\"required\",\"value\":\"\"},{\"failedfield\":\"user.job.salary\",\"tag\":\"required\",\"value\":\"\"},{\"failedfield\":\"user.job.type\",\"tag\":\"required\",\"valu",{"_index":1244,"t":{"2089":{"position":[[1508,181]]}}}],["fals",{"_index":241,"t":{"1929":{"position":[[764,5],[983,5],[1108,5],[1279,5],[1463,5],[2000,5],[2112,5],[2240,5],[2356,5],[2465,5],[2651,5]]},"1931":{"position":[[1715,5],[1809,5],[1887,6]]},"1990":{"position":[[191,6],[371,5]]}}}],["fast",{"_index":16,"t":{"1912":{"position":[[132,4]]}}}],["faster",{"_index":912,"t":{"2032":{"position":[[463,6]]}}}],["fastest",{"_index":8,"t":{"1912":{"position":[[73,7]]},"2056":{"position":[[94,7]]}}}],["fasthttp",{"_index":7,"t":{"1912":{"position":[[59,9]]},"1970":{"position":[[33,8],[97,8]]}}}],["fasthttp/sess",{"_index":1041,"t":{"2054":{"position":[[1925,16]]}}}],["favicon",{"_index":981,"t":{"2054":{"position":[[311,7],[326,7]]}}}],["featur",{"_index":468,"t":{"1941":{"position":[[174,8]]}}}],["feel",{"_index":1374,"t":{"2115":{"position":[[150,4]]}}}],["feet",{"_index":71,"t":{"1916":{"position":[[478,5]]}}}],["fenni",{"_index":828,"t":{"2010":{"position":[[381,7]]}}}],["ferret",{"_index":946,"t":{"2044":{"position":[[344,11]]}}}],["fiber",{"_index":0,"t":{"1912":{"position":[[0,5],[237,5]]},"1916":{"position":[[81,5]]},"1918":{"position":[[55,5]]},"1920":{"position":[[427,6]]},"1924":{"position":[[53,6],[144,5]]},"1929":{"position":[[220,8],[522,7],[2317,5]]},"1946":{"position":[[583,5]]},"1968":{"position":[[465,5],[609,5]]},"2032":{"position":[[319,5]]},"2054":{"position":[[0,5],[259,6],[798,5],[1011,5],[1592,6],[2084,5]]},"2058":{"position":[[692,5]]},"2063":{"position":[[30,5],[163,5],[326,5],[337,5]]},"2065":{"position":[[0,5]]},"2079":{"position":[[118,5]]},"2084":{"position":[[0,5],[241,5]]},"2086":{"position":[[0,5]]},"2089":{"position":[[0,5]]},"2092":{"position":[[440,5]]},"2094":{"position":[[378,5]]},"2096":{"position":[[0,5]]},"2098":{"position":[[0,5]]},"2100":{"position":[[0,5]]},"2102":{"position":[[0,5]]},"2107":{"position":[[162,5],[474,5]]},"2109":{"position":[[3,6],[211,5]]},"2111":{"position":[[269,6]]},"2113":{"position":[[0,5],[169,6]]}}}],["fiber'",{"_index":1090,"t":{"2063":{"position":[[827,7]]},"2084":{"position":[[316,7]]}}}],["fiber*error",{"_index":1105,"t":{"2065":{"position":[[137,12]]}}}],["fiber.*error",{"_index":1128,"t":{"2067":{"position":[[738,12]]}}}],["fiber.ctx",{"_index":53,"t":{"1916":{"position":[[34,9],[143,9],[519,11],[781,11],[1139,11]]},"1918":{"position":[[188,11]]},"1920":{"position":[[728,11],[849,11],[1042,11],[1254,11]]},"1933":{"position":[[1069,11],[1167,11],[1246,11]]},"1946":{"position":[[360,11],[787,11]]},"1948":{"position":[[225,11]]},"1950":{"position":[[138,11]]},"1952":{"position":[[140,11]]},"1954":{"position":[[151,11]]},"1956":{"position":[[132,11]]},"1958":{"position":[[484,11]]},"1960":{"position":[[121,11],[675,11],[856,11]]},"1964":{"position":[[222,11]]},"1966":{"position":[[214,11]]},"1968":{"position":[[361,11]]},"1970":{"position":[[170,11]]},"1972":{"position":[[196,11],[294,11],[394,11],[486,11]]},"1974":{"position":[[250,11]]},"1976":{"position":[[187,11]]},"1978":{"position":[[161,11]]},"1982":{"position":[[156,11]]},"1984":{"position":[[146,11]]},"1986":{"position":[[98,11]]},"1988":{"position":[[183,11]]},"1990":{"position":[[298,11]]},"1992":{"position":[[236,11]]},"1994":{"position":[[367,11]]},"1996":{"position":[[154,11]]},"1998":{"position":[[296,11],[373,11]]},"2000":{"position":[[135,11]]},"2002":{"position":[[231,11]]},"2004":{"position":[[249,11]]},"2006":{"position":[[255,11],[327,11],[399,11]]},"2008":{"position":[[140,11]]},"2010":{"position":[[347,11]]},"2012":{"position":[[223,11]]},"2014":{"position":[[154,11]]},"2016":{"position":[[402,11]]},"2018":{"position":[[307,11]]},"2020":{"position":[[158,11]]},"2022":{"position":[[273,11],[338,11],[448,11]]},"2026":{"position":[[118,11]]},"2028":{"position":[[140,11]]},"2032":{"position":[[180,11],[602,11]]},"2034":{"position":[[285,11]]},"2036":{"position":[[226,11]]},"2038":{"position":[[132,11]]},"2042":{"position":[[126,11]]},"2044":{"position":[[312,11]]},"2046":{"position":[[158,11]]},"2048":{"position":[[257,11]]},"2050":{"position":[[112,11]]},"2052":{"position":[[264,11]]},"2056":{"position":[[829,11],[980,11]]},"2058":{"position":[[267,12],[550,11],[977,11]]},"2063":{"position":[[226,11],[668,11],[1064,11]]},"2065":{"position":[[280,11]]},"2067":{"position":[[598,11]]},"2072":{"position":[[215,11]]},"2075":{"position":[[268,11],[377,11],[497,11]]},"2077":{"position":[[452,11],[560,11],[652,11],[920,11],[1074,11]]},"2079":{"position":[[261,11],[662,11]]},"2084":{"position":[[513,11]]},"2086":{"position":[[426,11]]},"2089":{"position":[[1078,11]]},"2109":{"position":[[418,11]]},"2111":{"position":[[140,11]]}}}],["fiber.error",{"_index":1110,"t":{"2065":{"position":[[395,11]]}}}],["fiber.gz",{"_index":285,"t":{"1929":{"position":[[1779,11]]},"1931":{"position":[[1642,11]]}}}],["fiber.handl",{"_index":1051,"t":{"2056":{"position":[[223,13]]}}}],["fiber.map",{"_index":1194,"t":{"2084":{"position":[[558,10]]},"2086":{"position":[[487,10]]}}}],["fiber.mimetextplaincharsetutf8",{"_index":1116,"t":{"2065":{"position":[[522,31]]}}}],["fiber.new",{"_index":128,"t":{"1918":{"position":[[156,11]]},"1922":{"position":[[256,11]]},"1927":{"position":[[230,11]]},"1929":{"position":[[337,11]]},"1935":{"position":[[145,11]]},"1937":{"position":[[94,11]]},"1972":{"position":[[150,11]]},"2063":{"position":[[606,11]]},"2067":{"position":[[525,11]]},"2070":{"position":[[88,11],[480,11]]},"2072":{"position":[[140,11]]},"2081":{"position":[[91,11]]}}}],["fiber.new(&fiber.set",{"_index":215,"t":{"1929":{"position":[[122,26]]},"2084":{"position":[[344,26]]},"2086":{"position":[[361,26]]}}}],["fiber.new(set",{"_index":213,"t":{"1927":{"position":[[116,18]]}}}],["fiber.newerror",{"_index":1092,"t":{"2063":{"position":[[895,17]]}}}],["fiber.newerror(404",{"_index":1100,"t":{"2063":{"position":[[1151,19]]}}}],["fiber.newerror(503",{"_index":1096,"t":{"2063":{"position":[[1085,19]]}}}],["fiber.stat",{"_index":372,"t":{"1931":{"position":[[1291,12],[1340,14],[2049,13]]}}}],["fiber.statusinternalservererror",{"_index":1109,"t":{"2065":{"position":[[343,31]]},"2067":{"position":[[661,31]]}}}],["field",{"_index":226,"t":{"1929":{"position":[[565,6]]},"1948":{"position":[[56,6]]},"1950":{"position":[[50,5]]},"1958":{"position":[[292,5]]},"1976":{"position":[[229,5]]},"1978":{"position":[[204,5]]},"1982":{"position":[[49,6]]},"1990":{"position":[[86,5]]},"1996":{"position":[[85,6]]},"2018":{"position":[[122,5]]},"2034":{"position":[[83,5]]},"2038":{"position":[[32,5]]},"2048":{"position":[[22,5],[175,6]]},"2052":{"position":[[75,5]]},"2058":{"position":[[767,5],[795,6]]},"2089":{"position":[[231,6]]}}}],["file",{"_index":191,"t":{"1922":{"position":[[16,5],[58,6],[102,4],[212,5],[335,5]]},"1929":{"position":[[1697,4],[1749,4],[1768,4]]},"1931":{"position":[[38,5],[126,5],[283,5],[565,5],[635,5],[646,9],[683,10],[868,4],[885,5],[1266,6],[1404,5],[1624,6],[1677,4],[1909,4]]},"1943":{"position":[[93,5]]},"1968":{"position":[[14,4],[171,4]]},"1976":{"position":[[14,5],[56,4],[214,4],[247,5],[328,4]]},"2004":{"position":[[465,5],[493,5],[571,6],[585,4],[599,5],[735,5]]},"2028":{"position":[[37,4],[264,5],[292,5],[370,6],[384,4],[398,5],[534,5]]},"2034":{"position":[[14,4]]},"2046":{"position":[[80,4]]},"2054":{"position":[[370,4]]},"2107":{"position":[[276,5]]}}}],["file.filenam",{"_index":710,"t":{"1976":{"position":[[389,15]]},"2004":{"position":[[787,15]]},"2028":{"position":[[586,15]]}}}],["file.header[\"cont",{"_index":808,"t":{"2004":{"position":[[645,20]]},"2028":{"position":[[444,20]]}}}],["file.s",{"_index":807,"t":{"2004":{"position":[[634,10]]},"2028":{"position":[[433,10]]}}}],["filenam",{"_index":667,"t":{"1968":{"position":[[144,9],[260,8],[307,8]]},"2034":{"position":[[102,9]]}}}],["filename=\"logo.png",{"_index":547,"t":{"1950":{"position":[[285,19]]}}}],["filesystem",{"_index":976,"t":{"2054":{"position":[[218,14],[233,10]]}}}],["filter",{"_index":1074,"t":{"2058":{"position":[[534,7],[788,6]]}}}],["find",{"_index":927,"t":{"2036":{"position":[[108,4]]},"2089":{"position":[[169,4]]},"2109":{"position":[[487,4]]}}}],["first",{"_index":40,"t":{"1914":{"position":[[0,5]]},"1929":{"position":[[1975,5]]},"1976":{"position":[[50,5],[208,5]]},"1978":{"position":[[46,5],[182,5]]},"2104":{"position":[[149,5]]}}}],["flexibl",{"_index":1346,"t":{"2107":{"position":[[140,8]]}}}],["flow",{"_index":1137,"t":{"2072":{"position":[[100,4]]}}}],["fmt.println(\"1st",{"_index":817,"t":{"2006":{"position":[[269,16]]}}}],["fmt.println(\"2nd",{"_index":818,"t":{"2006":{"position":[[341,16]]}}}],["fmt.println(\"3rd",{"_index":819,"t":{"2006":{"position":[[413,16]]}}}],["fmt.println(\"by",{"_index":1185,"t":{"2079":{"position":[[616,16]]}}}],["fmt.println(c.baseurl",{"_index":486,"t":{"1943":{"position":[[407,24]]}}}],["fmt.println(c.get(\"x",{"_index":488,"t":{"1943":{"position":[[456,20]]}}}],["fmt.println(file.filenam",{"_index":806,"t":{"2004":{"position":[[607,26]]},"2028":{"position":[[406,26]]}}}],["fmt.println(r",{"_index":866,"t":{"2020":{"position":[[240,14]]}}}],["fmt.println(r.method",{"_index":891,"t":{"2026":{"position":[[147,21]]}}}],["fmt.println(string(bodi",{"_index":498,"t":{"1943":{"position":[[783,25]]}}}],["fmt.println(string(data",{"_index":439,"t":{"1937":{"position":[[318,25]]}}}],["fmt.println(token[0",{"_index":802,"t":{"2004":{"position":[[430,21]]}}}],["fmt.sprintf(\"./%",{"_index":709,"t":{"1976":{"position":[[369,19]]},"2004":{"position":[[767,19]]},"2028":{"position":[[566,19]]}}}],["follow",{"_index":159,"t":{"1920":{"position":[[316,9]]},"1922":{"position":[[188,9]]},"1931":{"position":[[259,9]]},"1958":{"position":[[90,9],[652,9]]},"1996":{"position":[[16,8]]},"2018":{"position":[[515,9]]},"2067":{"position":[[428,9]]},"2089":{"position":[[1328,9]]},"2107":{"position":[[343,9]]}}}],["foo",{"_index":246,"t":{"1929":{"position":[[897,4],[906,5],[955,4],[964,5],[1022,4],[1031,4],[1081,4]]}}}],["fooand",{"_index":250,"t":{"1929":{"position":[[1073,7]]}}}],["forbidden",{"_index":783,"t":{"1998":{"position":[[495,9]]}}}],["forev",{"_index":96,"t":{"1916":{"position":[[993,7]]}}}],["form",{"_index":577,"t":{"1958":{"position":[[199,4],[965,4]]},"1976":{"position":[[224,4]]},"1978":{"position":[[4,4],[199,4]]},"2004":{"position":[[20,4],[286,5],[295,5]]},"2028":{"position":[[177,5],[186,5]]}}}],["form.file[\"docu",{"_index":803,"t":{"2004":{"position":[[502,22]]},"2028":{"position":[[301,22]]}}}],["form.value[\"token",{"_index":799,"t":{"2004":{"position":[[374,20]]}}}],["form:\"nam",{"_index":586,"t":{"1958":{"position":[[399,12]]}}}],["form:\"pass",{"_index":589,"t":{"1958":{"position":[[448,12]]}}}],["format",{"_index":697,"t":{"1974":{"position":[[91,7],[157,7]]},"2058":{"position":[[874,7]]}}}],["forward",{"_index":733,"t":{"1988":{"position":[[52,9],[122,9]]}}}],["found",{"_index":873,"t":{"2022":{"position":[[183,6]]},"2034":{"position":[[270,7]]},"2036":{"position":[[211,7]]},"2063":{"position":[[1028,7],[1183,8],[1222,6]]},"2109":{"position":[[221,5]]}}}],["frame",{"_index":1181,"t":{"2079":{"position":[[492,5]]}}}],["framework",{"_index":4,"t":{"1912":{"position":[[33,9]]},"2067":{"position":[[1003,9]]},"2092":{"position":[[70,10],[197,9]]},"2104":{"position":[[39,9]]}}}],["free",{"_index":1375,"t":{"2115":{"position":[[155,4]]}}}],["full",{"_index":326,"t":{"1929":{"position":[[2844,4]]},"2056":{"position":[[900,4]]}}}],["func",{"_index":73,"t":{"1916":{"position":[[504,4],[766,4]]},"1918":{"position":[[135,4]]},"1927":{"position":[[209,4]]},"1929":{"position":[[60,4],[316,4]]},"1935":{"position":[[124,4]]},"1972":{"position":[[129,4],[188,4],[286,4],[386,4]]},"2056":{"position":[[185,4]]},"2058":{"position":[[262,4],[542,4],[969,4]]},"2063":{"position":[[585,4]]},"2070":{"position":[[67,4],[459,4]]},"2072":{"position":[[119,4]]},"2081":{"position":[[70,4]]},"2086":{"position":[[254,4]]},"2089":{"position":[[682,4],[1063,4]]}}}],["func(*ctx",{"_index":387,"t":{"1933":{"position":[[169,14],[267,14],[335,14],[387,14],[440,14],[493,14],[547,14],[601,14],[656,14],[712,14],[768,14],[962,14],[1016,14]]},"1935":{"position":[[94,14]]}}}],["func(*fiber.ctx",{"_index":163,"t":{"1920":{"position":[[384,20],[546,16]]},"2056":{"position":[[349,16]]}}}],["func(c",{"_index":106,"t":{"1916":{"position":[[1132,6]]},"1918":{"position":[[181,6]]},"1920":{"position":[[721,6],[842,6],[1035,6],[1247,6]]},"1933":{"position":[[1062,6],[1160,6],[1239,6]]},"1943":{"position":[[392,6]]},"1946":{"position":[[353,6],[780,6]]},"1948":{"position":[[218,6]]},"1950":{"position":[[131,6]]},"1952":{"position":[[133,6]]},"1954":{"position":[[144,6]]},"1956":{"position":[[125,6]]},"1958":{"position":[[477,6]]},"1960":{"position":[[114,6],[668,6],[849,6]]},"1964":{"position":[[215,6]]},"1966":{"position":[[207,6]]},"1968":{"position":[[354,6]]},"1970":{"position":[[163,6]]},"1972":{"position":[[479,6]]},"1974":{"position":[[243,6]]},"1976":{"position":[[180,6]]},"1978":{"position":[[154,6]]},"1982":{"position":[[149,6]]},"1984":{"position":[[139,6]]},"1986":{"position":[[91,6]]},"1988":{"position":[[176,6]]},"1990":{"position":[[291,6]]},"1992":{"position":[[229,6]]},"1994":{"position":[[360,6]]},"1996":{"position":[[147,6]]},"1998":{"position":[[366,6]]},"2000":{"position":[[128,6]]},"2002":{"position":[[224,6]]},"2004":{"position":[[242,6]]},"2006":{"position":[[248,6],[320,6],[392,6]]},"2008":{"position":[[133,6]]},"2010":{"position":[[340,6]]},"2012":{"position":[[216,6]]},"2014":{"position":[[147,6]]},"2016":{"position":[[395,6]]},"2018":{"position":[[300,6]]},"2020":{"position":[[151,6]]},"2022":{"position":[[266,6],[331,6],[441,6]]},"2026":{"position":[[111,6]]},"2028":{"position":[[133,6]]},"2032":{"position":[[173,6],[595,6]]},"2034":{"position":[[278,6]]},"2036":{"position":[[219,6]]},"2038":{"position":[[125,6]]},"2042":{"position":[[119,6]]},"2044":{"position":[[305,6]]},"2046":{"position":[[151,6]]},"2048":{"position":[[250,6]]},"2050":{"position":[[105,6]]},"2052":{"position":[[257,6]]},"2056":{"position":[[973,6]]},"2063":{"position":[[219,6],[661,6],[1057,6]]},"2072":{"position":[[208,6]]},"2075":{"position":[[261,6],[370,6],[490,6]]},"2077":{"position":[[445,6],[553,6],[645,6],[913,6],[1067,6]]},"2079":{"position":[[655,6]]},"2084":{"position":[[506,6]]},"2086":{"position":[[419,6]]},"2111":{"position":[[133,6]]}}}],["func(ctx",{"_index":1107,"t":{"2065":{"position":[[271,8]]},"2067":{"position":[[589,8]]}}}],["function",{"_index":100,"t":{"1916":{"position":[[1039,8]]},"1920":{"position":[[234,10],[341,8],[577,8]]},"1922":{"position":[[78,8],[128,8]]},"1929":{"position":[[2714,9]]},"1946":{"position":[[606,9]]},"2054":{"position":[[686,8]]},"2056":{"position":[[294,8],[759,8]]},"2058":{"position":[[138,8],[195,8],[290,8]]},"2063":{"position":[[147,9]]},"2077":{"position":[[170,9]]},"2079":{"position":[[0,9],[93,10],[131,9],[172,8],[237,8]]},"2084":{"position":[[437,8]]},"2109":{"position":[[300,8],[358,10]]}}}],["fundament",{"_index":1247,"t":{"2092":{"position":[[91,11]]},"2094":{"position":[[57,12]]}}}],["futur",{"_index":69,"t":{"1916":{"position":[[435,6]]}}}],["gbit",{"_index":1278,"t":{"2092":{"position":[[568,4]]}}}],["gener",{"_index":307,"t":{"1929":{"position":[[2511,11],[2560,9]]},"2054":{"position":[[631,9]]},"2092":{"position":[[541,7]]}}}],["gigabit",{"_index":1294,"t":{"2094":{"position":[[309,7]]}}}],["github",{"_index":1211,"t":{"2089":{"position":[[116,6]]},"2092":{"position":[[421,6]]}}}],["github.com/gofiber/{{.title}}johndoehello",{"_index":701,"t":{"1974":{"position":[[385,9]]}}}],["packag",{"_index":104,"t":{"1916":{"position":[[1106,8]]},"1918":{"position":[[88,7]]},"1927":{"position":[[162,7]]},"2054":{"position":[[1999,7]]},"2063":{"position":[[496,7]]},"2086":{"position":[[31,7],[168,7]]},"2089":{"position":[[42,7]]}}}],["page",{"_index":139,"t":{"1918":{"position":[[338,5]]},"2067":{"position":[[394,4],[473,5],[825,4]]},"2089":{"position":[[123,4]]},"2111":{"position":[[225,4]]}}}],["panic",{"_index":683,"t":{"1972":{"position":[[53,5]]},"2054":{"position":[[507,6]]},"2063":{"position":[[359,6],[396,5],[694,5]]}}}],["panic(\"thi",{"_index":1087,"t":{"2063":{"position":[[682,11]]}}}],["param",{"_index":823,"t":{"2010":{"position":[[118,5],[187,5]]},"2077":{"position":[[163,6]]}}}],["paramet",{"_index":172,"t":{"1920":{"position":[[769,10],[972,9]]},"1958":{"position":[[71,10]]},"1968":{"position":[[154,9],[269,10]]},"1990":{"position":[[136,10]]},"2000":{"position":[[61,10]]},"2010":{"position":[[36,11]]},"2016":{"position":[[71,9]]},"2018":{"position":[[52,11]]},"2077":{"position":[[6,10],[207,9],[292,9],[384,10],[398,10],[611,9],[797,10]]}}}],["pars",{"_index":793,"t":{"2004":{"position":[[42,5],[266,5]]},"2028":{"position":[[157,5]]}}}],["part",{"_index":832,"t":{"2012":{"position":[[18,4]]}}}],["particular",{"_index":145,"t":{"1920":{"position":[[83,10]]},"2094":{"position":[[146,11]]}}}],["pass",{"_index":212,"t":{"1927":{"position":[[54,4]]},"1929":{"position":[[8,4],[77,4]]},"1941":{"position":[[8,4]]},"1943":{"position":[[219,4]]},"1958":{"position":[[412,4]]},"1966":{"position":[[35,4]]},"1968":{"position":[[453,4],[597,4]]},"1972":{"position":[[62,6]]},"1994":{"position":[[193,7]]},"1998":{"position":[[160,4]]},"2002":{"position":[[138,7]]},"2006":{"position":[[102,4]]},"2010":{"position":[[58,4]]},"2012":{"position":[[86,7]]},"2016":{"position":[[105,4]]},"2018":{"position":[[220,4]]},"2034":{"position":[[370,4],[498,4]]},"2056":{"position":[[747,4]]},"2058":{"position":[[147,6],[204,6]]},"2063":{"position":[[312,4],[858,4],[930,4]]},"2084":{"position":[[301,4]]}}}],["pass=do",{"_index":603,"t":{"1958":{"position":[[1057,8]]}}}],["password",{"_index":1032,"t":{"2054":{"position":[[1670,8]]}}}],["past",{"_index":637,"t":{"1960":{"position":[[935,4]]}}}],["path",{"_index":148,"t":{"1920":{"position":[[123,5],[508,4],[526,4],[698,5],[1280,5],[1315,5]]},"1929":{"position":[[1372,4]]},"1931":{"position":[[809,4],[832,4],[946,4],[1951,5]]},"1933":{"position":[[147,4],[889,4]]},"1964":{"position":[[85,4]]},"1968":{"position":[[24,4],[176,4]]},"2000":{"position":[[56,4]]},"2012":{"position":[[13,4],[78,4]]},"2022":{"position":[[48,5]]},"2028":{"position":[[98,4]]},"2034":{"position":[[34,5]]},"2054":{"position":[[375,4],[1738,4]]},"2058":{"position":[[901,9]]},"2070":{"position":[[35,5],[423,5]]},"2072":{"position":[[45,4]]},"2075":{"position":[[6,6],[103,5],[162,5],[199,4],[314,4],[424,4]]},"2077":{"position":[[234,4]]},"2079":{"position":[[714,4],[741,5],[790,5]]}}}],["pattern",{"_index":1141,"t":{"2075":{"position":[[134,9]]}}}],["payload",{"_index":1287,"t":{"2094":{"position":[[216,7]]}}}],["per",{"_index":337,"t":{"1929":{"position":[[3231,3],[3463,3]]},"2094":{"position":[[406,3],[480,3]]},"2096":{"position":[[31,3],[110,3]]},"2098":{"position":[[31,3],[110,3]]},"2100":{"position":[[32,3],[111,3]]},"2102":{"position":[[34,3],[114,3]]}}}],["perform",{"_index":21,"t":{"1912":{"position":[[181,11],[363,11]]},"1916":{"position":[[109,12],[1423,12]]},"1931":{"position":[[747,11]]},"1974":{"position":[[0,8]]},"2032":{"position":[[470,12]]},"2092":{"position":[[23,11]]},"2094":{"position":[[121,11],[253,11]]}}}],["persica",{"_index":1168,"t":{"2077":{"position":[[985,7]]}}}],["persist",{"_index":81,"t":{"1916":{"position":[[618,7],[745,10],[1363,7]]}}}],["person",{"_index":583,"t":{"1958":{"position":[[347,6]]},"2018":{"position":[[177,6]]}}}],["physic",{"_index":1255,"t":{"2092":{"position":[[308,8]]}}}],["pipelin",{"_index":1286,"t":{"2094":{"position":[[191,11]]},"2104":{"position":[[483,11],[626,11]]}}}],["plaintext",{"_index":1281,"t":{"2094":{"position":[[4,9],[355,9]]}}}],["platform",{"_index":1285,"t":{"2094":{"position":[[133,9]]}}}],["pleas",{"_index":118,"t":{"1916":{"position":[[1458,6]]},"1924":{"position":[[60,6]]},"1970":{"position":[[81,6]]},"2024":{"position":[[152,6]]}}}],["popul",{"_index":763,"t":{"1996":{"position":[[44,8]]}}}],["port",{"_index":237,"t":{"1929":{"position":[[724,5]]},"1939":{"position":[[83,4]]}}}],["posit",{"_index":870,"t":{"2022":{"position":[[79,8]]},"2077":{"position":[[95,8]]}}}],["possibl",{"_index":1347,"t":{"2107":{"position":[[152,9]]}}}],["post",{"_index":151,"t":{"1920":{"position":[[175,4],[497,5]]},"1933":{"position":[[1274,4]]},"1956":{"position":[[71,4],[167,4]]},"1958":{"position":[[687,4],[800,4],[924,4],[1036,4],[1099,4]]},"2002":{"position":[[71,5],[259,6]]},"2018":{"position":[[549,4]]},"2089":{"position":[[1363,4]]}}}],["pprof",{"_index":986,"t":{"2054":{"position":[[430,5]]}}}],["prefer",{"_index":1352,"t":{"2107":{"position":[[326,7]]}}}],["prefetch",{"_index":1184,"t":{"2079":{"position":[[535,8]]}}}],["prefix",{"_index":349,"t":{"1931":{"position":[[244,6],[814,6],[939,6]]},"2079":{"position":[[734,6]]}}}],["prefork",{"_index":216,"t":{"1929":{"position":[[149,8],[606,7]]},"1941":{"position":[[166,7]]}}}],["print",{"_index":301,"t":{"1929":{"position":[[2303,5]]}}}],["process",{"_index":234,"t":{"1929":{"position":[[692,9]]},"2063":{"position":[[184,7]]},"2104":{"position":[[204,10],[295,10],[543,10]]}}}],["product",{"_index":850,"t":{"2018":{"position":[[247,8]]},"2092":{"position":[[235,10]]}}}],["profil",{"_index":988,"t":{"2054":{"position":[[456,9]]}}}],["prompt",{"_index":665,"t":{"1968":{"position":[[72,6]]}}}],["proper",{"_index":696,"t":{"1974":{"position":[[84,6],[150,6]]}}}],["properti",{"_index":227,"t":{"1929":{"position":[[572,8]]},"1970":{"position":[[54,11]]},"1996":{"position":[[32,8]]},"2016":{"position":[[5,8],[40,8]]},"2030":{"position":[[10,8]]},"2044":{"position":[[88,8]]},"2052":{"position":[[10,9]]}}}],["protect",{"_index":1021,"t":{"2054":{"position":[[1311,7]]},"2079":{"position":[[318,12]]}}}],["protocol",{"_index":556,"t":{"1954":{"position":[[21,9]]},"2014":{"position":[[21,8]]}}}],["provid",{"_index":518,"t":{"1946":{"position":[[589,8]]},"2032":{"position":[[330,8]]},"2054":{"position":[[383,9],[1075,8],[1510,8],[1752,8]]},"2056":{"position":[[677,7],[890,7]]},"2065":{"position":[[6,8],[176,8]]},"2084":{"position":[[6,8],[36,7]]},"2086":{"position":[[44,8]]},"2092":{"position":[[12,8]]},"2111":{"position":[[39,7]]}}}],["proxi",{"_index":354,"t":{"1931":{"position":[[713,5]]}}}],["proxy1",{"_index":734,"t":{"1988":{"position":[[137,7],[208,10]]}}}],["proxy3",{"_index":735,"t":{"1988":{"position":[[156,6],[232,9]]}}}],["prunu",{"_index":1166,"t":{"2077":{"position":[[955,6]]}}}],["public",{"_index":200,"t":{"1922":{"position":[[239,9],[284,11],[357,8]]},"1931":{"position":[[310,8],[343,11],[576,10],[614,11],[1023,11],[2037,11]]},"2054":{"position":[[1633,6]]}}}],["pug",{"_index":1202,"t":{"2086":{"position":[[139,3]]},"2113":{"position":[[126,3]]}}}],["pull",{"_index":715,"t":{"1980":{"position":[[73,4]]},"2040":{"position":[[73,4]]}}}],["purpos",{"_index":1162,"t":{"2077":{"position":[[819,9]]}}}],["put",{"_index":150,"t":{"1920":{"position":[[170,4],[492,4]]},"2002":{"position":[[77,4]]}}}],["queri",{"_index":573,"t":{"1958":{"position":[[65,5]]},"2016":{"position":[[58,5],[165,5],[211,5]]},"2018":{"position":[[46,5]]}}}],["query:\"nam",{"_index":848,"t":{"2018":{"position":[[205,14]]}}}],["query:\"pass",{"_index":849,"t":{"2018":{"position":[[232,14]]}}}],["query:\"product",{"_index":851,"t":{"2018":{"position":[[265,18]]}}}],["question",{"_index":1343,"t":{"2107":{"position":[[38,9]]},"2115":{"position":[[111,9]]}}}],["r",{"_index":864,"t":{"2020":{"position":[[218,1]]},"2026":{"position":[[132,1]]}}}],["r.handler",{"_index":894,"t":{"2026":{"position":[[187,11]]}}}],["r.param",{"_index":893,"t":{"2026":{"position":[[177,9]]}}}],["r.path",{"_index":892,"t":{"2026":{"position":[[169,7]]}}}],["r.rang",{"_index":865,"t":{"2020":{"position":[[229,8]]}}}],["rais",{"_index":996,"t":{"2054":{"position":[[719,5]]}}}],["ram",{"_index":1271,"t":{"2092":{"position":[[512,3]]}}}],["random.string(32",{"_index":409,"t":{"1933":{"position":[[1108,18]]}}}],["random.txt",{"_index":1145,"t":{"2075":{"position":[[452,14]]}}}],["randomvalu",{"_index":629,"t":{"1960":{"position":[[735,14]]}}}],["rang",{"_index":381,"t":{"1931":{"position":[[1751,5]]},"2004":{"position":[[593,5]]},"2020":{"position":[[44,6],[108,6],[223,5]]},"2028":{"position":[[392,5]]},"2089":{"position":[[846,5]]}}}],["rate",{"_index":1030,"t":{"2054":{"position":[[1563,4]]},"2058":{"position":[[420,4]]}}}],["raw",{"_index":568,"t":{"1956":{"position":[[153,3]]},"2032":{"position":[[388,3]]}}}],["re",{"_index":58,"t":{"1916":{"position":[[194,2],[424,2]]}}}],["read",{"_index":325,"t":{"1929":{"position":[[2835,4],[3272,8]]},"1956":{"position":[[334,4]]},"1966":{"position":[[444,4]]},"1970":{"position":[[88,4]]},"1978":{"position":[[401,4]]},"1982":{"position":[[402,4]]},"1984":{"position":[[320,4]]},"2008":{"position":[[326,4]]},"2010":{"position":[[550,4]]},"2016":{"position":[[636,4]]}}}],["readbuffers",{"_index":336,"t":{"1929":{"position":[[3212,14]]}}}],["readtimeout",{"_index":321,"t":{"1929":{"position":[[2779,11],[3187,11]]}}}],["real",{"_index":1332,"t":{"2104":{"position":[[290,4]]}}}],["realist",{"_index":1253,"t":{"2092":{"position":[[225,9]]}}}],["recommend",{"_index":911,"t":{"2032":{"position":[[447,11]]}}}],["recov",{"_index":989,"t":{"2054":{"position":[[466,7],[474,7],[493,8]]},"2063":{"position":[[381,7],[462,7]]}}}],["redirect",{"_index":868,"t":{"2022":{"position":[[0,9]]}}}],["refer",{"_index":66,"t":{"1916":{"position":[[318,11]]},"1920":{"position":[[8,6]]},"1952":{"position":[[17,9]]},"1956":{"position":[[272,11]]},"1966":{"position":[[382,11]]},"1978":{"position":[[339,11]]},"1982":{"position":[[340,11]]},"1984":{"position":[[258,11]]},"2008":{"position":[[264,11]]},"2010":{"position":[[488,11]]},"2016":{"position":[[574,11]]}}}],["regard",{"_index":38,"t":{"1912":{"position":[[353,9]]},"1931":{"position":[[1224,9]]},"2067":{"position":[[1029,9]]}}}],["regist",{"_index":388,"t":{"1933":{"position":[[203,8]]}}}],["rel=\"last",{"_index":771,"t":{"1996":{"position":[[374,10]]}}}],["rel=\"next",{"_index":770,"t":{"1996":{"position":[[320,11]]}}}],["releas",{"_index":31,"t":{"1912":{"position":[[289,8]]}}}],["remot",{"_index":728,"t":{"1986":{"position":[[12,6]]}}}],["render",{"_index":316,"t":{"1929":{"position":[[2707,6]]},"2024":{"position":[[0,7],[68,6]]},"2084":{"position":[[206,6],[393,6]]},"2086":{"position":[[443,6]]}}}],["render(io.writ",{"_index":1190,"t":{"2084":{"position":[[112,17]]}}}],["repeat",{"_index":1031,"t":{"2054":{"position":[[1612,8]]}}}],["replac",{"_index":195,"t":{"1922":{"position":[[65,7]]}}}],["report",{"_index":675,"t":{"1968":{"position":[[488,6]]}}}],["report.pdf",{"_index":676,"t":{"1968":{"position":[[554,14],[632,10]]}}}],["repositori",{"_index":1260,"t":{"2092":{"position":[[428,11]]}}}],["repres",{"_index":374,"t":{"1931":{"position":[[1365,10]]}}}],["req",{"_index":490,"t":{"1943":{"position":[[546,3]]}}}],["req.header.set(\"x",{"_index":492,"t":{"1943":{"position":[[606,17]]}}}],["request",{"_index":59,"t":{"1916":{"position":[[209,9],[442,8]]},"1920":{"position":[[70,7],[149,7],[452,7],[875,7],[928,7]]},"1929":{"position":[[1519,7],[1590,7],[2849,8],[3114,7],[3262,9]]},"1931":{"position":[[149,7],[1757,8],[1928,10]]},"1933":{"position":[[15,8],[63,8],[1199,10],[1279,10]]},"1956":{"position":[[12,7],[172,8]]},"1958":{"position":[[10,7]]},"1980":{"position":[[78,8]]},"1982":{"position":[[17,7]]},"1986":{"position":[[37,8]]},"1988":{"position":[[66,7]]},"1990":{"position":[[159,7]]},"1998":{"position":[[45,7],[117,8]]},"2002":{"position":[[57,8]]},"2008":{"position":[[21,7]]},"2012":{"position":[[30,7]]},"2014":{"position":[[13,7],[60,9]]},"2040":{"position":[[78,8]]},"2042":{"position":[[178,9]]},"2044":{"position":[[63,8]]},"2052":{"position":[[53,9],[120,7],[213,9]]},"2054":{"position":[[609,7],[659,8],[1017,7],[1621,8]]},"2056":{"position":[[138,7],[785,8]]},"2075":{"position":[[29,7],[75,8],[215,8],[330,8],[440,8]]},"2079":{"position":[[51,7],[796,9]]},"2094":{"position":[[41,7],[158,8]]},"2109":{"position":[[252,8]]}}}],["request/respons",{"_index":985,"t":{"2054":{"position":[[405,16]]}}}],["requestid",{"_index":992,"t":{"2054":{"position":[[599,9]]}}}],["requesturi",{"_index":341,"t":{"1929":{"position":[[3374,11]]}}}],["request’",{"_index":502,"t":{"1946":{"position":[[87,9]]},"1990":{"position":[[51,9]]},"2052":{"position":[[41,9]]}}}],["requir",{"_index":45,"t":{"1914":{"position":[[57,9]]},"2094":{"position":[[365,12]]}}}],["reset",{"_index":1033,"t":{"2054":{"position":[[1679,6]]}}}],["resourc",{"_index":1016,"t":{"2054":{"position":[[1252,8]]}}}],["resp",{"_index":493,"t":{"1943":{"position":[[663,5]]}}}],["resp.statuscod",{"_index":495,"t":{"1943":{"position":[[721,15]]}}}],["respect",{"_index":1148,"t":{"2077":{"position":[[248,10]]}}}],["respond",{"_index":143,"t":{"1920":{"position":[[49,8],[661,7]]}}}],["respons",{"_index":274,"t":{"1929":{"position":[[1615,9],[1981,8],[2102,9],[2230,9],[2992,9],[3494,10]]},"1931":{"position":[[135,8],[1459,9]]},"1948":{"position":[[40,8]]},"1950":{"position":[[14,8]]},"1994":{"position":[[13,8]]},"2000":{"position":[[9,8]]},"2024":{"position":[[47,9]]},"2032":{"position":[[14,8]]},"2034":{"position":[[62,8]]},"2036":{"position":[[72,8]]},"2042":{"position":[[29,9]]},"2048":{"position":[[40,8]]},"2050":{"position":[[35,9]]},"2065":{"position":[[70,8],[150,8],[480,8]]},"2067":{"position":[[358,9],[414,9]]},"2079":{"position":[[62,8]]},"2094":{"position":[[207,8],[396,9],[470,9]]},"2096":{"position":[[21,9],[100,9]]},"2098":{"position":[[21,9],[100,9]]},"2100":{"position":[[22,9],[101,9]]},"2102":{"position":[[24,9],[104,9]]},"2109":{"position":[[14,9],[131,8],[385,9]]}}}],["response’",{"_index":764,"t":{"1996":{"position":[[57,10]]},"2038":{"position":[[9,10]]}}}],["rest",{"_index":1357,"t":{"2107":{"position":[[450,4]]}}}],["result",{"_index":76,"t":{"1916":{"position":[[533,6],[561,6],[795,6],[823,6],[918,7],[1153,6],[1204,6]]},"1929":{"position":[[1728,9]]},"1943":{"position":[[709,8]]},"2070":{"position":[[814,6]]},"2089":{"position":[[1494,7]]},"2092":{"position":[[261,7]]},"2104":{"position":[[500,6],[569,6],[643,6]]},"2109":{"position":[[36,6]]}}}],["retriev",{"_index":704,"t":{"1976":{"position":[[27,9]]},"1978":{"position":[[23,9]]},"2067":{"position":[[696,8]]},"2077":{"position":[[143,9]]}}}],["return",{"_index":52,"t":{"1916":{"position":[[20,8],[129,8],[345,6],[1310,8]]},"1929":{"position":[[1154,8],[1234,6]]},"1937":{"position":[[12,7]]},"1952":{"position":[[0,7]]},"1954":{"position":[[0,7]]},"1956":{"position":[[0,7],[206,8]]},"1962":{"position":[[0,7]]},"1966":{"position":[[79,8],[316,8]]},"1976":{"position":[[83,9]]},"1978":{"position":[[80,9],[273,8]]},"1982":{"position":[[0,7],[274,8]]},"1984":{"position":[[0,7],[192,8]]},"1986":{"position":[[0,7]]},"1988":{"position":[[0,7]]},"1990":{"position":[[0,7],[183,7]]},"1992":{"position":[[380,6],[560,6]]},"2002":{"position":[[0,7]]},"2004":{"position":[[86,7]]},"2008":{"position":[[0,7],[198,8]]},"2010":{"position":[[102,8],[422,8]]},"2016":{"position":[[149,8],[228,7],[508,8]]},"2020":{"position":[[59,9]]},"2026":{"position":[[0,7]]},"2044":{"position":[[0,7]]},"2054":{"position":[[791,6],[1426,7]]},"2056":{"position":[[848,6],[999,6]]},"2058":{"position":[[306,6],[609,6],[1036,6]]},"2063":{"position":[[120,6]]},"2065":{"position":[[468,6]]},"2084":{"position":[[533,6]]},"2089":{"position":[[1047,6],[1236,6],[1272,8]]}}}],["revers",{"_index":353,"t":{"1931":{"position":[[705,7]]}}}],["rewrit",{"_index":1035,"t":{"2054":{"position":[[1702,7],[1721,8]]}}}],["room",{"_index":1371,"t":{"2115":{"position":[[74,5]]}}}],["root",{"_index":171,"t":{"1920":{"position":[[693,4]]},"1922":{"position":[[167,4]]},"1931":{"position":[[202,4]]},"1976":{"position":[[336,4]]},"2075":{"position":[[231,4]]}}}],["rout",{"_index":140,"t":{"1920":{"position":[[0,7],[202,5],[271,5],[289,5],[627,5],[652,5]]},"1929":{"position":[[1050,7],[1342,5],[1406,7]]},"1933":{"position":[[0,6],[216,5],[844,6]]},"1935":{"position":[[14,6]]},"1937":{"position":[[68,10]]},"1943":{"position":[[130,7],[347,5]]},"1998":{"position":[[95,6]]},"2006":{"position":[[87,6],[286,8],[358,8],[430,8]]},"2010":{"position":[[30,5]]},"2016":{"position":[[88,6]]},"2026":{"position":[[20,5],[54,6]]},"2063":{"position":[[80,5]]},"2070":{"position":[[5,8]]},"2072":{"position":[[37,7]]},"2075":{"position":[[0,5],[97,5],[156,5],[193,5],[236,6],[308,5],[418,5]]},"2077":{"position":[[0,5],[201,5],[286,5],[366,6],[378,5],[791,5]]},"2079":{"position":[[206,6]]},"2081":{"position":[[50,6]]},"2094":{"position":[[49,7]]},"2107":{"position":[[212,6]]},"2109":{"position":[[230,6]]}}}],["router",{"_index":244,"t":{"1929":{"position":[[883,6],[941,6]]},"1933":{"position":[[184,6],[282,6],[350,6],[402,6],[455,6],[508,6],[562,6],[616,6],[671,6],[727,6],[783,6],[977,6],[1031,6]]},"1935":{"position":[[109,6]]},"1937":{"position":[[33,6]]},"2079":{"position":[[124,6]]}}}],["ru",{"_index":531,"t":{"1946":{"position":[[764,2],[941,5]]}}}],["rule",{"_index":60,"t":{"1916":{"position":[[224,4]]},"2054":{"position":[[1761,6]]}}}],["run",{"_index":133,"t":{"1918":{"position":[[251,3]]},"1958":{"position":[[633,3]]},"2018":{"position":[[496,3]]},"2063":{"position":[[72,7]]},"2070":{"position":[[784,7]]},"2089":{"position":[[1304,7]]},"2104":{"position":[[413,8]]}}}],["runtim",{"_index":987,"t":{"2054":{"position":[[448,7]]}}}],["s",{"_index":917,"t":{"2032":{"position":[[564,1]]}}}],["salari",{"_index":980,"t":{"2054":{"position":[[304,6]]},"2089":{"position":[[367,6]]}}}],["same",{"_index":236,"t":{"1929":{"position":[[719,4],[977,5],[1102,5],[2580,4]]}}}],["sameorigin",{"_index":1182,"t":{"2079":{"position":[[508,13]]}}}],["samesit",{"_index":633,"t":{"1960":{"position":[[807,9],[999,9]]},"1964":{"position":[[155,8]]}}}],["satur",{"_index":1293,"t":{"2094":{"position":[[296,8]]}}}],["save",{"_index":282,"t":{"1929":{"position":[[1717,6]]},"1976":{"position":[[323,4]]},"2004":{"position":[[726,4]]},"2028":{"position":[[18,4],[525,4]]}}}],["savsgio",{"_index":1042,"t":{"2054":{"position":[[1945,8]]}}}],["scale",{"_index":1344,"t":{"2107":{"position":[[74,5]]}}}],["scope",{"_index":773,"t":{"1998":{"position":[[31,6]]}}}],["search?q=someth",{"_index":822,"t":{"2008":{"position":[[173,21]]}}}],["second",{"_index":479,"t":{"1943":{"position":[[232,6]]},"2094":{"position":[[410,6],[484,6]]},"2096":{"position":[[35,6],[114,6]]},"2098":{"position":[[35,6],[114,6]]},"2100":{"position":[[36,6],[115,6]]},"2102":{"position":[[38,6],[118,6]]}}}],["secur",{"_index":650,"t":{"1964":{"position":[[129,6]]},"2030":{"position":[[107,8]]},"2054":{"position":[[1360,6]]},"2079":{"position":[[287,8],[453,10]]}}}],["see",{"_index":137,"t":{"1918":{"position":[[313,3]]},"1929":{"position":[[1259,3],[2724,3]]},"2094":{"position":[[351,3]]},"2111":{"position":[[276,3]]},"2113":{"position":[[176,3]]}}}],["segment",{"_index":942,"t":{"2044":{"position":[[191,9]]},"2077":{"position":[[31,8]]}}}],["select",{"_index":695,"t":{"1974":{"position":[[75,6]]}}}],["send",{"_index":270,"t":{"1929":{"position":[[1578,5],[1963,7],[3360,4]]},"1994":{"position":[[0,5]]},"2024":{"position":[[29,5]]},"2032":{"position":[[33,4],[71,4]]},"2067":{"position":[[260,4],[342,4],[807,4]]}}}],["sendbyt",{"_index":906,"t":{"2032":{"position":[[339,9]]}}}],["sendstr",{"_index":907,"t":{"2032":{"position":[[349,11]]}}}],["sendstream",{"_index":908,"t":{"2032":{"position":[[365,10]]}}}],["sent",{"_index":1103,"t":{"2065":{"position":[[82,4],[162,4]]},"2094":{"position":[[175,4]]}}}],["separ",{"_index":1000,"t":{"2054":{"position":[[875,11]]}}}],["septemb",{"_index":32,"t":{"1912":{"position":[[301,9]]}}}],["serial",{"_index":1249,"t":{"2092":{"position":[[122,14]]}}}],["serv",{"_index":189,"t":{"1922":{"position":[[3,5],[206,5]]},"1931":{"position":[[25,5],[109,5],[277,5],[480,5],[559,5],[629,5],[762,7],[900,6],[1251,7],[1389,7],[1917,5]]},"2054":{"position":[[347,5]]}}}],["server",{"_index":168,"t":{"1920":{"position":[[538,7]]},"1929":{"position":[[802,6],[1918,6]]},"1931":{"position":[[1568,6]]},"2054":{"position":[[441,6]]},"2065":{"position":[[103,6]]},"2067":{"position":[[947,6]]},"2092":{"position":[[158,6]]},"2104":{"position":[[318,8],[392,7]]},"2115":{"position":[[29,7]]}}}],["server.go",{"_index":134,"t":{"1918":{"position":[[255,9]]}}}],["server.key",{"_index":461,"t":{"1939":{"position":[[500,13]]}}}],["serverhead",{"_index":220,"t":{"1929":{"position":[[206,13],[770,12]]}}}],["servic",{"_index":1098,"t":{"2063":{"position":[[1124,7]]}}}],["session",{"_index":613,"t":{"1960":{"position":[[291,10]]},"2054":{"position":[[1887,7]]}}}],["set",{"_index":110,"t":{"1916":{"position":[[1277,8]]},"1927":{"position":[[68,8],[135,13]]},"1929":{"position":[[25,8],[82,8],[272,8],[362,8],[556,8],[1360,7],[1483,4],[2035,3],[2154,3],[2278,3]]},"1931":{"position":[[1238,8],[1330,9],[1376,8],[1472,3],[1769,3]]},"1948":{"position":[[100,4]]},"1950":{"position":[[0,4]]},"1952":{"position":[[70,9]]},"1956":{"position":[[317,7]]},"1960":{"position":[[525,3],[912,3]]},"1964":{"position":[[0,3],[374,3]]},"1966":{"position":[[427,7]]},"1978":{"position":[[384,7]]},"1982":{"position":[[385,7]]},"1984":{"position":[[303,7]]},"1992":{"position":[[72,4]]},"2000":{"position":[[0,4]]},"2008":{"position":[[309,7]]},"2010":{"position":[[533,7]]},"2016":{"position":[[619,7]]},"2032":{"position":[[0,4]]},"2034":{"position":[[40,4],[163,3]]},"2036":{"position":[[0,4]]},"2038":{"position":[[0,4]]},"2042":{"position":[[0,4]]},"2046":{"position":[[0,4]]},"2054":{"position":[[769,3],[1380,7]]},"2056":{"position":[[634,8]]},"2067":{"position":[[30,3]]},"2070":{"position":[[865,4]]},"2079":{"position":[[278,3]]}}}],["sfo",{"_index":1170,"t":{"2077":{"position":[[1033,3],[1130,3]]}}}],["shard",{"_index":240,"t":{"1929":{"position":[[754,9]]}}}],["share",{"_index":1017,"t":{"2054":{"position":[[1261,7]]}}}],["ship",{"_index":972,"t":{"2054":{"position":[[6,5]]}}}],["shoe",{"_index":854,"t":{"2018":{"position":[[478,6]]}}}],["short",{"_index":879,"t":{"2022":{"position":[[390,5]]}}}],["show",{"_index":1126,"t":{"2067":{"position":[[446,5]]}}}],["shown",{"_index":363,"t":{"1931":{"position":[[980,5]]},"1960":{"position":[[583,5]]}}}],["side",{"_index":1250,"t":{"2092":{"position":[[165,4]]}}}],["signal",{"_index":644,"t":{"1962":{"position":[[64,7]]}}}],["signatur",{"_index":161,"t":{"1920":{"position":[[350,9]]},"1922":{"position":[[137,10]]},"1927":{"position":[[106,9]]},"1931":{"position":[[173,9]]},"1933":{"position":[[72,10]]},"1935":{"position":[[50,9]]},"1937":{"position":[[46,9]]},"1939":{"position":[[210,9]]},"1941":{"position":[[62,9]]},"1943":{"position":[[249,9]]},"1946":{"position":[[117,9]]},"1948":{"position":[[153,9]]},"1950":{"position":[[71,9]]},"1952":{"position":[[80,9]]},"1954":{"position":[[52,9]]},"1956":{"position":[[26,9]]},"1958":{"position":[[235,9]]},"1960":{"position":[[54,9]]},"1962":{"position":[[112,9]]},"1964":{"position":[[11,9]]},"1966":{"position":[[122,10]]},"1968":{"position":[[280,9]]},"1970":{"position":[[66,9]]},"1972":{"position":[[95,9]]},"1974":{"position":[[185,9]]},"1976":{"position":[[93,9]]},"1978":{"position":[[90,9]]},"1982":{"position":[[91,9]]},"1984":{"position":[[56,9]]},"1986":{"position":[[46,9]]},"1988":{"position":[[82,9]]},"1990":{"position":[[198,9]]},"1992":{"position":[[117,9]]},"1994":{"position":[[231,9]]},"1996":{"position":[[92,9]]},"1998":{"position":[[208,9]]},"2000":{"position":[[72,9]]},"2002":{"position":[[156,9]]},"2004":{"position":[[167,9]]},"2006":{"position":[[196,9]]},"2008":{"position":[[34,9]]},"2010":{"position":[[208,9]]},"2012":{"position":[[104,9]]},"2014":{"position":[[70,9]]},"2016":{"position":[[253,9]]},"2018":{"position":[[64,9]]},"2020":{"position":[[69,9]]},"2022":{"position":[[190,9]]},"2024":{"position":[[199,9]]},"2026":{"position":[[34,9]]},"2028":{"position":[[51,9]]},"2030":{"position":[[70,9]]},"2032":{"position":[[114,9],[483,9]]},"2034":{"position":[[190,9]]},"2036":{"position":[[154,9]]},"2038":{"position":[[67,9]]},"2042":{"position":[[67,9]]},"2044":{"position":[[201,9]]},"2046":{"position":[[96,9]]},"2048":{"position":[[195,9]]},"2050":{"position":[[45,9]]},"2052":{"position":[[177,9]]},"2056":{"position":[[175,9]]},"2058":{"position":[[252,9]]}}}],["similar",{"_index":519,"t":{"1946":{"position":[[598,7]]},"1960":{"position":[[564,7]]},"2018":{"position":[[15,7]]}}}],["simpl",{"_index":170,"t":{"1920":{"position":[[645,6]]}}}],["simpli",{"_index":756,"t":{"1994":{"position":[[159,6]]},"2109":{"position":[[140,6]]}}}],["size",{"_index":265,"t":{"1929":{"position":[[1508,4],[1540,4],[3253,4],[3317,5],[3485,4]]},"2020":{"position":[[91,5]]}}}],["skip",{"_index":1054,"t":{"2056":{"position":[[306,4],[771,4]]}}}],["slice",{"_index":796,"t":{"2004":{"position":[[160,6]]},"2020":{"position":[[35,5]]},"2044":{"position":[[17,5]]}}}],["small",{"_index":1288,"t":{"2094":{"position":[[233,6]]}}}],["smaller",{"_index":1333,"t":{"2104":{"position":[[331,7],[442,7]]}}}],["socket",{"_index":239,"t":{"1929":{"position":[[747,6]]}}}],["somestruct",{"_index":744,"t":{"1992":{"position":[[168,10],[281,11]]},"1994":{"position":[[303,10],[412,11]]}}}],["someth",{"_index":494,"t":{"1943":{"position":[[694,9]]},"2058":{"position":[[448,9]]},"2089":{"position":[[1252,9]]}}}],["soon",{"_index":67,"t":{"1916":{"position":[[333,4]]}}}],["sorri",{"_index":1101,"t":{"2063":{"position":[[1171,7],[1211,6]]}}}],["sourc",{"_index":1259,"t":{"2092":{"position":[[394,6]]}}}],["spawn",{"_index":233,"t":{"1929":{"position":[[674,5]]}}}],["special",{"_index":261,"t":{"1929":{"position":[[1444,7]]},"2054":{"position":[[266,7],[1959,7]]},"2067":{"position":[[966,7]]}}}],["specif",{"_index":149,"t":{"1920":{"position":[[135,8]]},"1931":{"position":[[1321,8]]},"1960":{"position":[[184,8]]},"1998":{"position":[[170,8]]},"2056":{"position":[[776,8]]},"2107":{"position":[[241,8]]}}}],["specifi",{"_index":362,"t":{"1931":{"position":[[929,7]]},"1939":{"position":[[41,9]]},"1946":{"position":[[15,9]]},"1948":{"position":[[12,9],[136,9]]},"1974":{"position":[[125,9]]},"1982":{"position":[[32,9]]},"1988":{"position":[[33,9]]},"1990":{"position":[[114,9]]},"2000":{"position":[[46,9]]},"2022":{"position":[[38,9],[59,9],[149,10]]},"2038":{"position":[[45,9]]},"2046":{"position":[[63,9]]},"2058":{"position":[[57,7]]},"2077":{"position":[[76,9],[217,9]]}}}],["specifiy",{"_index":385,"t":{"1933":{"position":[[104,8]]}}}],["stack",{"_index":429,"t":{"1937":{"position":[[40,5]]},"2006":{"position":[[56,5]]},"2054":{"position":[[530,5]]},"2063":{"position":[[431,6]]},"2109":{"position":[[335,5]]}}}],["standard",{"_index":1102,"t":{"2065":{"position":[[50,8]]},"2086":{"position":[[282,8]]}}}],["start",{"_index":580,"t":{"1958":{"position":[[311,5]]},"2018":{"position":[[141,5]]}}}],["static",{"_index":190,"t":{"1922":{"position":[[9,6]]},"1931":{"position":[[8,6],[31,6],[97,6],[222,10],[525,6],[770,6],[914,6],[959,6],[1259,6],[1358,6],[1397,6],[1415,6]]}}}],["statu",{"_index":869,"t":{"2022":{"position":[[69,7],[124,6],[160,6],[224,6]]},"2036":{"position":[[9,6],[37,6],[122,6]]},"2042":{"position":[[14,6]]},"2063":{"position":[[877,6],[992,6]]},"2065":{"position":[[185,6]]}}}],["statuscod",{"_index":1108,"t":{"2065":{"position":[[308,10]]},"2067":{"position":[[626,10],[716,10]]}}}],["still",{"_index":677,"t":{"1970":{"position":[[8,5]]},"2094":{"position":[[227,5],[268,5]]}}}],["store",{"_index":569,"t":{"1956":{"position":[[262,5]]},"1966":{"position":[[372,5]]},"1978":{"position":[[329,5]]},"1982":{"position":[[330,5]]},"1984":{"position":[[248,5]]},"1998":{"position":[[14,6]]},"2008":{"position":[[254,5]]},"2010":{"position":[[478,5]]},"2016":{"position":[[564,5]]},"2089":{"position":[[90,6]]}}}],["stout",{"_index":880,"t":{"2022":{"position":[[400,5]]}}}],["straightforward",{"_index":124,"t":{"1918":{"position":[[39,15]]}}}],["strict",{"_index":651,"t":{"1964":{"position":[[179,7]]}}}],["strictrout",{"_index":219,"t":{"1929":{"position":[[185,14],[846,13]]}}}],["string",{"_index":89,"t":{"1916":{"position":[[758,7]]},"1920":{"position":[[376,7]]},"1922":{"position":[[120,7],[172,7]]},"1929":{"position":[[783,6],[1662,6]]},"1931":{"position":[[207,7],[2004,6]]},"1933":{"position":[[152,7],[250,7],[318,7],[370,7],[423,7],[476,7],[530,7],[584,7],[639,7],[695,7],[751,7],[999,7]]},"1935":{"position":[[77,7]]},"1939":{"position":[[91,6]]},"1946":{"position":[[143,10],[154,6],[188,10],[199,6],[235,10],[246,6],[278,10],[289,6]]},"1948":{"position":[[186,10]]},"1950":{"position":[[99,10]]},"1954":{"position":[[44,7],[74,6]]},"1956":{"position":[[45,6]]},"1958":{"position":[[368,6],[417,6]]},"1960":{"position":[[82,10]]},"1964":{"position":[[65,6],[78,6],[90,6],[104,6],[164,6]]},"1966":{"position":[[147,7],[168,10],[179,6]]},"1968":{"position":[[316,10]]},"1976":{"position":[[119,7]]},"1978":{"position":[[117,7],[125,6]]},"1982":{"position":[[113,7],[121,6]]},"1984":{"position":[[79,6]]},"1986":{"position":[[63,6]]},"1988":{"position":[[100,8]]},"1990":{"position":[[215,7]]},"1992":{"position":[[26,6],[193,6]]},"1994":{"position":[[209,6],[273,10],[328,6]]},"1996":{"position":[[115,10]]},"1998":{"position":[[231,7]]},"2000":{"position":[[98,7]]},"2002":{"position":[[10,6],[148,7],[184,10],[195,6]]},"2004":{"position":[[153,6]]},"2008":{"position":[[60,6]]},"2010":{"position":[[167,6],[233,7],[254,10],[265,6]]},"2012":{"position":[[96,7],[130,10],[141,6]]},"2014":{"position":[[30,7],[93,6]]},"2016":{"position":[[64,6],[217,7],[245,7],[281,7],[302,10],[313,6]]},"2018":{"position":[[198,6],[225,6],[256,8]]},"2022":{"position":[[216,7]]},"2024":{"position":[[223,7],[256,10]]},"2028":{"position":[[103,7]]},"2032":{"position":[[530,7]]},"2034":{"position":[[216,7]]},"2038":{"position":[[96,7]]},"2044":{"position":[[10,6],[239,8]]},"2046":{"position":[[115,7],[123,6]]},"2048":{"position":[[218,10]]},"2075":{"position":[[116,7],[127,6],[177,7]]},"2084":{"position":[[130,7],[151,10]]},"2089":{"position":[[325,6],[432,6],[533,6],[649,6],[660,6],[673,6]]}}}],["string(newbuff",{"_index":95,"t":{"1916":{"position":[[939,17]]}}}],["strong",{"_index":310,"t":{"1929":{"position":[[2543,6]]}}}],["struct",{"_index":373,"t":{"1931":{"position":[[1304,6],[1422,6]]},"1935":{"position":[[42,7]]},"1958":{"position":[[28,7],[354,6]]},"1964":{"position":[[51,6]]},"1992":{"position":[[179,6],[265,7]]},"1994":{"position":[[314,6],[396,7]]},"2006":{"position":[[116,6]]},"2018":{"position":[[184,6]]},"2020":{"position":[[2,6]]},"2026":{"position":[[26,7]]},"2056":{"position":[[267,6]]},"2063":{"position":[[848,6]]},"2089":{"position":[[255,7],[312,7],[419,7],[628,6]]}}}],["structur",{"_index":160,"t":{"1920":{"position":[[326,11]]},"2107":{"position":[[201,10],[312,9]]}}}],["style",{"_index":210,"t":{"1924":{"position":[[123,5]]}}}],["subdomain",{"_index":939,"t":{"2044":{"position":[[26,10],[97,9],[181,9]]}}}],["subject",{"_index":1372,"t":{"2115":{"position":[[90,8]]}}}],["such",{"_index":82,"t":{"1916":{"position":[[626,4]]},"1922":{"position":[[22,4]]},"1931":{"position":[[44,4]]},"2052":{"position":[[159,5]]},"2054":{"position":[[1662,4]]},"2092":{"position":[[109,4]]}}}],["suffici",{"_index":1118,"t":{"2067":{"position":[[115,11]]}}}],["suffix",{"_index":279,"t":{"1929":{"position":[[1674,6]]},"1931":{"position":[[1654,6]]}}}],["support",{"_index":319,"t":{"1929":{"position":[[2756,9]]},"1941":{"position":[[154,7]]},"1958":{"position":[[47,8]]},"1994":{"position":[[33,8],[117,8]]},"2054":{"position":[[171,8]]},"2056":{"position":[[29,7]]},"2113":{"position":[[16,8]]}}}],["sure",{"_index":1136,"t":{"2070":{"position":[[840,4]]}}}],["switch",{"_index":1280,"t":{"2092":{"position":[[582,7]]}}}],["system",{"_index":361,"t":{"1931":{"position":[[873,7]]},"2067":{"position":[[321,7]]}}}],["tag",{"_index":1222,"t":{"2089":{"position":[[656,3]]}}}],["take",{"_index":158,"t":{"1920":{"position":[[306,5]]},"2024":{"position":[[159,4]]},"2054":{"position":[[749,5]]},"2067":{"position":[[230,4]]}}}],["task",{"_index":1248,"t":{"2092":{"position":[[103,5]]}}}],["tcp4",{"_index":442,"t":{"1939":{"position":[[138,4]]}}}],["tcp6",{"_index":443,"t":{"1939":{"position":[[146,4]]}}}],["team",{"_index":1195,"t":{"2086":{"position":[[6,4]]},"2107":{"position":[[108,4]]}}}],["techempow",{"_index":1245,"t":{"2092":{"position":[[0,11]]}}}],["techniqu",{"_index":622,"t":{"1960":{"position":[[554,9]]}}}],["templat",{"_index":317,"t":{"1929":{"position":[[2732,8]]},"2024":{"position":[[95,8],[178,8]]},"2054":{"position":[[2018,8]]},"2084":{"position":[[53,8],[287,10],[461,8]]},"2086":{"position":[[21,9],[75,8],[299,8],[456,8]]},"2092":{"position":[[170,8]]},"2113":{"position":[[27,8],[156,9],[180,10]]}}}],["term",{"_index":1349,"t":{"2107":{"position":[[192,5]]}}}],["test",{"_index":472,"t":{"1943":{"position":[[0,7],[42,4],[373,5]]},"1948":{"position":[[362,7],[419,4]]},"1958":{"position":[[637,5]]},"2018":{"position":[[500,5]]},"2089":{"position":[[1314,4]]},"2092":{"position":[[331,4]]},"2094":{"position":[[14,4],[333,4]]},"2104":{"position":[[155,4],[405,4],[495,4],[529,4],[564,4],[638,4]]}}}],["text",{"_index":507,"t":{"1946":{"position":[[315,7],[458,7]]}}}],["text/html",{"_index":512,"t":{"1946":{"position":[[428,11]]},"1974":{"position":[[343,9]]},"1990":{"position":[[253,10]]},"2024":{"position":[[37,9]]},"2046":{"position":[[194,11],[227,11]]}}}],["text/plain",{"_index":698,"t":{"1974":{"position":[[165,10],[275,10]]},"1982":{"position":[[195,12],[233,12]]},"2038":{"position":[[168,13],[203,11]]}}}],["thank",{"_index":977,"t":{"2054":{"position":[[274,6],[1967,6]]},"2067":{"position":[[974,6]]}}}],["therefor",{"_index":774,"t":{"1998":{"position":[[58,10]]}}}],["theso_reuseportsocket",{"_index":232,"t":{"1929":{"position":[[634,21]]}}}],["thing",{"_index":14,"t":{"1912":{"position":[[118,6]]}}}],["thomasvvugt/fib",{"_index":1354,"t":{"2107":{"position":[[399,17]]}}}],["those",{"_index":619,"t":{"1960":{"position":[[442,5]]}}}],["through",{"_index":805,"t":{"2004":{"position":[[563,7]]},"2028":{"position":[[362,7]]},"2058":{"position":[[128,7]]}}}],["thrown",{"_index":682,"t":{"1972":{"position":[[41,6]]},"2063":{"position":[[402,6]]}}}],["thumb",{"_index":61,"t":{"1916":{"position":[[232,6]]}}}],["time",{"_index":324,"t":{"1929":{"position":[[2819,4],[2967,6],[3088,4]]},"1931":{"position":[[541,6]]},"2054":{"position":[[783,4]]},"2058":{"position":[[882,8]]},"2104":{"position":[[215,4],[282,4],[306,4],[554,5]]}}}],["time.dur",{"_index":322,"t":{"1929":{"position":[[2791,13],[2925,13],[3052,13]]}}}],["time.hour",{"_index":631,"t":{"1960":{"position":[[779,11],[965,10]]},"1964":{"position":[[360,10]]}}}],["time.now().add",{"_index":638,"t":{"1960":{"position":[[949,15]]}}}],["time.now().add(24",{"_index":630,"t":{"1960":{"position":[[759,17]]},"1964":{"position":[[340,17]]}}}],["time.tim",{"_index":649,"t":{"1964":{"position":[[119,9]]}}}],["timeformat",{"_index":1078,"t":{"2058":{"position":[[911,11]]}}}],["timeout",{"_index":328,"t":{"1929":{"position":[[2886,7],[3014,7]]},"1943":{"position":[[157,7],[199,7]]},"2054":{"position":[[668,7]]},"2058":{"position":[[513,8]]}}}],["timezon",{"_index":1080,"t":{"2058":{"position":[[935,9]]}}}],["tip",{"_index":717,"t":{"1982":{"position":[[56,3]]},"1998":{"position":[[126,3]]},"2032":{"position":[[400,3]]},"2036":{"position":[[96,3]]}}}],["titl",{"_index":1206,"t":{"2086":{"position":[[498,8]]}}}],["tl",{"_index":449,"t":{"1939":{"position":[[252,3],[434,3]]},"1941":{"position":[[102,3]]},"2014":{"position":[[56,3]]},"2030":{"position":[[39,3]]}}}],["tls.certificate{c",{"_index":464,"t":{"1939":{"position":[[583,23]]}}}],["tls.config",{"_index":450,"t":{"1939":{"position":[[256,15]]},"1941":{"position":[[106,15]]}}}],["tls.config{certif",{"_index":463,"t":{"1939":{"position":[[557,25]]}}}],["tls.loadx509keypair(\"server.crt",{"_index":460,"t":{"1939":{"position":[[466,33]]}}}],["tls/http",{"_index":456,"t":{"1939":{"position":[[407,9]]}}}],["to/from",{"_index":1004,"t":{"2054":{"position":[[1003,7]]}}}],["tobi",{"_index":947,"t":{"2044":{"position":[[356,7],[383,8]]}}}],["tobi.ferrets.example.com",{"_index":944,"t":{"2044":{"position":[[265,26]]}}}],["token",{"_index":628,"t":{"1960":{"position":[[719,8],[900,8]]},"2004":{"position":[[365,5]]},"2054":{"position":[[1445,5]]}}}],["top",{"_index":6,"t":{"1912":{"position":[[52,3]]},"2054":{"position":[[1918,3]]}}}],["track_id",{"_index":614,"t":{"1960":{"position":[[302,11]]}}}],["transfer",{"_index":663,"t":{"1968":{"position":[[0,9]]},"2034":{"position":[[0,9]]}}}],["transpar",{"_index":375,"t":{"1931":{"position":[[1434,13]]}}}],["transport",{"_index":1179,"t":{"2079":{"position":[[443,9]]}}}],["treat",{"_index":245,"t":{"1929":{"position":[[890,6],[948,6],[1090,7]]}}}],["tri",{"_index":281,"t":{"1929":{"position":[[1711,5]]},"1931":{"position":[[1575,5]]}}}],["true",{"_index":217,"t":{"1929":{"position":[[158,5],[179,5],[200,5],[421,4],[455,4],[489,4],[2042,4],[2161,5],[2285,5]]},"1931":{"position":[[1479,4],[1776,5],[2073,5],[2090,5],[2104,5]]},"1960":{"position":[[801,5],[993,5]]},"1990":{"position":[[328,4],[350,4]]},"2030":{"position":[[27,4]]},"2034":{"position":[[173,4],[463,6]]},"2052":{"position":[[28,5],[289,4]]},"2058":{"position":[[313,4]]}}}],["tutorial.pdf",{"_index":810,"t":{"2004":{"position":[[683,14]]},"2028":{"position":[[482,14]]}}}],["type",{"_index":228,"t":{"1929":{"position":[[581,4],[2194,4],[2444,4],[2460,4]]},"1931":{"position":[[1410,4]]},"1946":{"position":[[47,5]]},"1950":{"position":[[319,5]]},"1958":{"position":[[108,5],[135,4],[342,4],[704,5],[817,5],[941,5]]},"1964":{"position":[[39,4]]},"1972":{"position":[[515,6]]},"1982":{"position":[[185,6],[223,6]]},"1990":{"position":[[29,5],[69,4],[109,4],[131,4],[247,5]]},"1992":{"position":[[163,4],[403,5],[583,5]]},"1994":{"position":[[298,4]]},"2018":{"position":[[172,4]]},"2020":{"position":[[24,4]]},"2032":{"position":[[57,5],[431,4]]},"2034":{"position":[[57,4]]},"2036":{"position":[[287,5]]},"2038":{"position":[[161,6],[197,5]]},"2046":{"position":[[17,4],[46,4]]},"2056":{"position":[[247,4]]},"2065":{"position":[[132,4],[407,4]]},"2067":{"position":[[210,5],[493,5]]},"2079":{"position":[[365,4]]},"2084":{"position":[[76,4]]},"2089":{"position":[[303,4],[320,4],[409,4],[609,4],[1380,5]]}}}],["type\"][0",{"_index":809,"t":{"2004":{"position":[[666,10]]},"2028":{"position":[[465,10]]}}}],["typic",{"_index":664,"t":{"1968":{"position":[[47,10],[187,9]]}}}],["u",{"_index":49,"t":{"1914":{"position":[[122,1]]}}}],["ubuntu",{"_index":1272,"t":{"2092":{"position":[[516,6]]}}}],["uint8",{"_index":746,"t":{"1992":{"position":[[204,5]]},"1994":{"position":[[339,5]]}}}],["unauthor",{"_index":1011,"t":{"2054":{"position":[[1170,12]]}}}],["unavail",{"_index":1099,"t":{"2063":{"position":[[1132,11]]}}}],["under",{"_index":284,"t":{"1929":{"position":[[1754,5]]}}}],["underli",{"_index":86,"t":{"1916":{"position":[[680,10]]}}}],["unescapepath",{"_index":253,"t":{"1929":{"position":[[1285,12]]}}}],["uniqu",{"_index":994,"t":{"2054":{"position":[[643,6]]}}}],["unit",{"_index":1336,"t":{"2104":{"position":[[426,4]]}}}],["unlimit",{"_index":329,"t":{"1929":{"position":[[2897,10],[3025,10]]}}}],["unsupport",{"_index":931,"t":{"2036":{"position":[[268,12]]}}}],["until",{"_index":251,"t":{"1929":{"position":[[1224,5]]}}}],["up",{"_index":15,"t":{"1912":{"position":[[125,2]]},"2077":{"position":[[315,2]]}}}],["uppercas",{"_index":581,"t":{"1958":{"position":[[325,9]]},"2018":{"position":[[155,9]]}}}],["uri",{"_index":147,"t":{"1920":{"position":[[115,3]]}}}],["url",{"_index":555,"t":{"1954":{"position":[[17,3]]},"2008":{"position":[[29,4]]},"2012":{"position":[[38,4]]},"2022":{"position":[[17,3]]},"2054":{"position":[[1734,3]]},"2077":{"position":[[27,3],[111,4]]}}}],["urlencod",{"_index":260,"t":{"1929":{"position":[[1433,10]]},"1958":{"position":[[204,10],[970,11]]}}}],["us",{"_index":47,"t":{"1914":{"position":[[88,5]]},"1916":{"position":[[197,4],[253,3],[427,4],[698,5],[1259,3]]},"1922":{"position":[[180,3]]},"1929":{"position":[[627,3],[2570,5],[3202,5]]},"1931":{"position":[[0,3],[251,3],[521,3],[699,3],[793,3],[1283,3]]},"1933":{"position":[[793,3],[807,4]]},"1941":{"position":[[35,5]]},"1943":{"position":[[55,3]]},"1956":{"position":[[299,3]]},"1960":{"position":[[605,4]]},"1966":{"position":[[409,3]]},"1970":{"position":[[25,3]]},"1974":{"position":[[59,4],[179,5]]},"1978":{"position":[[366,3]]},"1982":{"position":[[367,3]]},"1984":{"position":[[285,3]]},"1992":{"position":[[41,5]]},"1998":{"position":[[138,6]]},"2008":{"position":[[291,3]]},"2010":{"position":[[14,4],[515,3]]},"2016":{"position":[[601,3]]},"2024":{"position":[[75,4],[127,3]]},"2028":{"position":[[10,4]]},"2032":{"position":[[404,3]]},"2034":{"position":[[138,3]]},"2036":{"position":[[117,4]]},"2044":{"position":[[139,4]]},"2054":{"position":[[1599,3]]},"2056":{"position":[[86,3]]},"2058":{"position":[[187,5],[653,5],[754,3]]},"2063":{"position":[[823,3],[889,5]]},"2072":{"position":[[27,4]]},"2077":{"position":[[49,4],[153,5],[775,4],[812,6]]},"2079":{"position":[[703,3]]},"2081":{"position":[[57,5]]},"2089":{"position":[[21,3],[143,4],[219,4]]},"2094":{"position":[[180,5]]},"2107":{"position":[[459,5]]},"2113":{"position":[[150,5]]}}}],["usag",{"_index":379,"t":{"1931":{"position":[[1596,5]]}}}],["user",{"_index":666,"t":{"1968":{"position":[[83,4]]},"2012":{"position":[[249,8]]},"2048":{"position":[[348,4],[413,4],[480,4]]},"2058":{"position":[[396,5]]},"2089":{"position":[[414,4],[707,5],[1114,4],[1281,4]]}}}],["user/john",{"_index":188,"t":{"1920":{"position":[[1321,9]]}}}],["user=john",{"_index":566,"t":{"1956":{"position":[[101,9],[193,9]]}}}],["utf",{"_index":521,"t":{"1946":{"position":[[665,3]]}}}],["utils.immutablestring(c.param(\"foo",{"_index":107,"t":{"1916":{"position":[[1163,37]]}}}],["v1",{"_index":26,"t":{"1912":{"position":[[243,3]]},"1935":{"position":[[199,2]]},"2070":{"position":[[141,2],[525,2],[798,3]]},"2072":{"position":[[185,2],[258,5]]},"2081":{"position":[[144,2]]}}}],["v1.10.0",{"_index":1261,"t":{"2092":{"position":[[446,7]]}}}],["v1.9.0",{"_index":1341,"t":{"2104":{"position":[[681,6]]}}}],["v1.get(\"/list",{"_index":419,"t":{"1935":{"position":[[242,15]]},"2070":{"position":[[184,15],[559,15]]},"2072":{"position":[[290,15]]},"2081":{"position":[[187,15]]}}}],["v1.get(\"/us",{"_index":421,"t":{"1935":{"position":[[283,15]]},"2070":{"position":[[225,15],[600,15]]},"2072":{"position":[[331,15]]},"2081":{"position":[[228,15]]}}}],["v2",{"_index":28,"t":{"1912":{"position":[[264,2]]},"1935":{"position":[[324,2]]},"2070":{"position":[[266,2],[641,2],[805,3]]},"2081":{"position":[[269,2]]}}}],["v2.0.0",{"_index":30,"t":{"1912":{"position":[[278,6]]}}}],["v2.get(\"/list",{"_index":425,"t":{"1935":{"position":[[367,15]]},"2070":{"position":[[311,15],[675,15]]},"2081":{"position":[[314,15]]}}}],["v2.get(\"/us",{"_index":427,"t":{"1935":{"position":[[408,15]]},"2070":{"position":[[352,15],[716,15]]},"2081":{"position":[[355,15]]}}}],["valid",{"_index":78,"t":{"1916":{"position":[[576,5],[838,5],[987,5]]},"1929":{"position":[[1218,5]]},"1956":{"position":[[229,5]]},"1966":{"position":[[339,5]]},"1978":{"position":[[296,5]]},"1982":{"position":[[297,5]]},"1984":{"position":[[215,5]]},"2008":{"position":[[221,5]]},"2010":{"position":[[445,5]]},"2016":{"position":[[531,5]]},"2054":{"position":[[1144,5]]},"2089":{"position":[[32,9],[68,10],[106,9],[207,11],[284,10],[760,8]]}}}],["validate.struct(us",{"_index":1225,"t":{"2089":{"position":[[794,21]]}}}],["validate:\"d",{"_index":1219,"t":{"2089":{"position":[[589,17]]}}}],["validate:\"required,email,min=6,max=32",{"_index":1218,"t":{"2089":{"position":[[540,40]]}}}],["validate:\"required,eq=true|eq=fals",{"_index":1217,"t":{"2089":{"position":[[488,38]]}}}],["validate:\"required,min=3,max=32",{"_index":1214,"t":{"2089":{"position":[[332,34],[439,34]]}}}],["validate:\"required,numb",{"_index":1215,"t":{"2089":{"position":[[378,28]]}}}],["validatestruct",{"_index":1239,"t":{"2089":{"position":[[1185,16]]}}}],["validatestruct(us",{"_index":1223,"t":{"2089":{"position":[[687,19]]}}}],["validator.new",{"_index":1224,"t":{"2089":{"position":[[771,15]]}}}],["valu",{"_index":51,"t":{"1916":{"position":[[13,6],[122,6],[265,6],[374,6],[631,6],[1303,6]]},"1920":{"position":[[888,6],[941,6]]},"1929":{"position":[[836,6],[1147,6],[3178,5]]},"1931":{"position":[[1709,5],[1803,5],[1881,5],[1978,5]]},"1933":{"position":[[125,5]]},"1948":{"position":[[22,5],[146,6],[179,6]]},"1956":{"position":[[215,5]]},"1960":{"position":[[535,6],[728,6]]},"1962":{"position":[[82,6]]},"1964":{"position":[[72,5]]},"1966":{"position":[[11,5],[60,5],[325,5]]},"1978":{"position":[[9,6],[52,5],[188,5],[282,5]]},"1982":{"position":[[283,5]]},"1984":{"position":[[201,5]]},"1998":{"position":[[239,5]]},"2004":{"position":[[137,5],[423,6]]},"2008":{"position":[[207,5]]},"2010":{"position":[[83,5],[431,5]]},"2016":{"position":[[130,5],[517,5]]},"2038":{"position":[[60,6],[90,5]]},"2077":{"position":[[69,6],[129,6]]},"2089":{"position":[[667,5]]}}}],["var",{"_index":1075,"t":{"2058":{"position":[[569,3],[996,3]]},"2089":{"position":[[732,3],[887,3]]}}}],["vari",{"_index":955,"t":{"2048":{"position":[[35,4],[294,5],[334,5],[399,5],[466,5]]}}}],["variabl",{"_index":772,"t":{"1998":{"position":[[21,9]]}}}],["variou",{"_index":1019,"t":{"2054":{"position":[[1281,7],[1388,7]]}}}],["veri",{"_index":1362,"t":{"2109":{"position":[[316,4]]}}}],["version",{"_index":615,"t":{"1960":{"position":[[314,10]]}}}],["via",{"_index":684,"t":{"1972":{"position":[[69,3]]},"2067":{"position":[[34,3]]},"2115":{"position":[[171,3]]}}}],["view",{"_index":27,"t":{"1912":{"position":[[255,4]]},"1929":{"position":[[2657,5],[2663,5],[2669,5]]},"2024":{"position":[[10,4],[139,4]]},"2084":{"position":[[17,5],[70,5],[81,5],[170,5],[324,5],[371,6]]},"2086":{"position":[[388,6]]},"2107":{"position":[[334,4]]}}}],["views/index.html",{"_index":1203,"t":{"2086":{"position":[[151,16]]}}}],["virtual",{"_index":167,"t":{"1920":{"position":[[518,7]]},"1931":{"position":[[801,7]]}}}],["wait",{"_index":334,"t":{"1929":{"position":[[3096,4]]}}}],["want",{"_index":368,"t":{"1931":{"position":[[1185,4]]},"1943":{"position":[[181,4]]},"1998":{"position":[[152,4]]},"2024":{"position":[[119,4]]},"2067":{"position":[[184,4]]},"2115":{"position":[[129,4]]}}}],["weak",{"_index":309,"t":{"1929":{"position":[[2534,4],[2610,4]]}}}],["web",{"_index":3,"t":{"1912":{"position":[[29,3]]},"1960":{"position":[[336,3]]},"2054":{"position":[[1441,3]]},"2092":{"position":[[54,3]]},"2104":{"position":[[35,3],[314,3],[388,3]]}}}],["websocket",{"_index":1047,"t":{"2054":{"position":[[2070,9]]}}}],["welcom",{"_index":716,"t":{"1980":{"position":[[91,8]]},"2040":{"position":[[91,8]]}}}],["wildcard",{"_index":183,"t":{"1920":{"position":[[1176,9]]},"2077":{"position":[[525,8]]}}}],["wish",{"_index":1351,"t":{"2107":{"position":[[289,5]]}}}],["within",{"_index":63,"t":{"1916":{"position":[[272,6],[582,6],[844,6]]},"1956":{"position":[[235,6]]},"1966":{"position":[[345,6]]},"1978":{"position":[[302,6]]},"1982":{"position":[[303,6]]},"1984":{"position":[[221,6]]},"2006":{"position":[[123,6]]},"2008":{"position":[[227,6]]},"2010":{"position":[[451,6]]},"2016":{"position":[[537,6]]}}}],["word",{"_index":1361,"t":{"2109":{"position":[[204,6]]}}}],["work",{"_index":259,"t":{"1929":{"position":[[1423,4]]},"1931":{"position":[[1492,5]]},"2109":{"position":[[183,4]]},"2111":{"position":[[260,5]]}}}],["world",{"_index":131,"t":{"1918":{"position":[[217,8],[324,6]]},"1920":{"position":[[682,7],[757,8],[954,5]]},"1943":{"position":[[518,8],[822,6]]},"1970":{"position":[[280,9],[304,7]]},"1974":{"position":[[303,8],[325,6],[370,8],[451,8],[474,7]]},"2006":{"position":[[454,8]]},"2032":{"position":[[209,8],[232,7],[262,9],[286,7],[642,9],[666,7],[695,8],[718,7],[770,10],[795,7]]},"2036":{"position":[[308,8],[353,7]]},"2050":{"position":[[202,6],[238,6]]},"2079":{"position":[[691,8]]},"2084":{"position":[[578,8]]},"2086":{"position":[[515,8]]}}}],["world!