mirror of https://github.com/gofiber/fiber.git
📚Settings documentation cleanup
- End all comments with a full stop. - Be consistent with wording for bool settings (when set to true). - Exception: ETag property, as I am not familiar with it. - Be consistent with mentioning default values (Default: $foo)pull/593/head
parent
5d5e988802
commit
070cbb0963
40
app.go
40
app.go
|
@ -63,9 +63,9 @@ type App struct {
|
|||
Settings *Settings `json:"settings"`
|
||||
}
|
||||
|
||||
// Settings holds is a struct holding the server settings
|
||||
// Settings is a struct holding the server settings.
|
||||
type Settings struct {
|
||||
// ErrorHandler is executed when you pass an error in the Next(err) method
|
||||
// ErrorHandler is executed when you pass an error in the Next(err) method.
|
||||
// This function is also executed when middleware.Recover() catches a panic
|
||||
// Default: func(ctx *Ctx, err error) {
|
||||
// code := StatusInternalServerError
|
||||
|
@ -81,36 +81,38 @@ type Settings struct {
|
|||
// Default: ""
|
||||
ServerHeader string `json:"server_header"`
|
||||
|
||||
// Enable strict routing. When enabled, the router treats "/foo" and "/foo/" as different.
|
||||
// When set to true, the router treats "/foo" and "/foo/" as different.
|
||||
// By default this is disabled and both "/foo" and "/foo/" will execute the same handler.
|
||||
StrictRouting bool `json:"strict_routing"`
|
||||
|
||||
// Enable case sensitive routing. When enabled, "/FoO" and "/foo" are different routes.
|
||||
// When set to true, enables case sensitive routing.
|
||||
// E.g. "/FoO" and "/foo" are treated as different routes.
|
||||
// By default this is disabled and both "/FoO" and "/foo" will execute the same handler.
|
||||
CaseSensitive bool `json:"case_sensitive"`
|
||||
|
||||
// When enabled, this relinquishes the 0-allocation promise in certain
|
||||
// When set to true, this relinquishes the 0-allocation promise in certain
|
||||
// cases in order to access the handler values (e.g. request bodies) in an
|
||||
// immutable fashion so that these values are available even if you return
|
||||
// from handler.
|
||||
// Default: false
|
||||
Immutable bool `json:"immutable"`
|
||||
|
||||
// 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
|
||||
// When set to true, 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.
|
||||
// Default: false
|
||||
UnescapePath bool `json:"unescape_path"`
|
||||
|
||||
// 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.
|
||||
// Default value false
|
||||
// Default: false
|
||||
ETag bool `json:"etag"`
|
||||
|
||||
// This will spawn multiple Go processes listening on the same port
|
||||
// When set to true, this will spawn multiple Go processes listening on the same port.
|
||||
// Default: false
|
||||
Prefork bool `json:"prefork"`
|
||||
|
||||
// Max body size that the server accepts
|
||||
// Max body size that the server accepts.
|
||||
// Default: 4 * 1024 * 1024
|
||||
BodyLimit int `json:"body_limit"`
|
||||
|
||||
|
@ -118,27 +120,29 @@ type Settings struct {
|
|||
// Default: 256 * 1024
|
||||
Concurrency int `json:"concurrency"`
|
||||
|
||||
// Disable keep-alive connections, the server will close incoming connections after sending the first response to client
|
||||
// When set to true, disables keep-alive connections.
|
||||
// The server will close incoming connections after sending the first response to client.
|
||||
// Default: false
|
||||
DisableKeepalive bool `json:"disable_keep_alive"`
|
||||
|
||||
// When set to true causes the default date header to be excluded from the response.
|
||||
// When set to true, causes the default date header to be excluded from the response.
|
||||
// Default: false
|
||||
DisableDefaultDate bool `json:"disable_default_date"`
|
||||
|
||||
// When set to true, causes the default Content-Type header to be excluded from the Response.
|
||||
// When set to true, causes the default Content-Type header to be excluded from the response.
|
||||
// Default: false
|
||||
DisableDefaultContentType bool `json:"disable_default_content_type"`
|
||||
|
||||
// By default all header names are normalized: conteNT-tYPE -> Content-Type
|
||||
// When set to true, disables header normalization.
|
||||
// By default all header names are normalized: conteNT-tYPE -> Content-Type.
|
||||
// Default: false
|
||||
DisableHeaderNormalizing bool `json:"disable_header_normalizing"`
|
||||
|
||||
// When set to true, it will not print out the «Fiber» ASCII art and listening address
|
||||
// When set to true, it will not print out the «Fiber» ASCII art and listening address.
|
||||
// Default: false
|
||||
DisableStartupMessage bool `json:"disable_startup_message"`
|
||||
|
||||
// Templates is deprecated please use Views
|
||||
// Deprecated: Templates is deprecated please use Views.
|
||||
// Default: nil
|
||||
Templates Templates `json:"-"`
|
||||
|
||||
|
@ -166,11 +170,11 @@ type Settings struct {
|
|||
// 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).
|
||||
// Default 4096
|
||||
// Default: 4096
|
||||
ReadBufferSize int `json:"read_buffer_size"`
|
||||
|
||||
// Per-connection buffer size for responses' writing.
|
||||
// Default 4096
|
||||
// Default: 4096
|
||||
WriteBufferSize int `json:"write_buffer_size"`
|
||||
|
||||
// CompressedFileSuffix adds suffix to the original file name and
|
||||
|
|
Loading…
Reference in New Issue