Home / Type/ Config Type — fiber Architecture

Config Type — fiber Architecture

Architecture documentation for the Config type/interface in app.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  c71b09f2_05ae_9fcd_fefe_918389f3ea2b["Config"]
  258982c0_9752_bf98_01ce_836d4de563e1["app.go"]
  c71b09f2_05ae_9fcd_fefe_918389f3ea2b -->|defined in| 258982c0_9752_bf98_01ce_836d4de563e1
  style c71b09f2_05ae_9fcd_fefe_918389f3ea2b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

app.go lines 115–432

type Config struct { //nolint:govet // Aligning the struct fields is not necessary. betteralign:ignore
	// Enables the "Server: value" HTTP header.
	//
	// Default: ""
	ServerHeader string `json:"server_header"`

	// 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.
	//
	// Default: false
	StrictRouting bool `json:"strict_routing"`

	// 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.
	//
	// Default: false
	CaseSensitive bool `json:"case_sensitive"`

	// When set to true, disables automatic registration of HEAD routes for
	// every GET route.
	//
	// Default: false
	DisableHeadAutoRegister bool `json:"disable_head_auto_register"`

	// 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"`

	// When set to true, converts all encoded characters in the route back
	// before setting the path for the context, so that the routing,
	// the returning of the current url from the context `ctx.Path()`
	// and the parameters `ctx.Params(%key%)` with decoded characters will work
	//
	// Default: false
	UnescapePath bool `json:"unescape_path"`

	// Max body size that the server accepts.
	// Zero or negative values fall back to the default limit.
	//
	// Default: 4 * 1024 * 1024
	BodyLimit int `json:"body_limit"`

	// MaxRanges sets the maximum number of ranges parsed from a Range header.
	// Zero or negative values fall back to the default limit.
	//
	// Default: 16
	MaxRanges int `json:"max_ranges"`

	// Maximum number of concurrent connections.
	//
	// Default: 256 * 1024
	Concurrency int `json:"concurrency"`

	// Views is the interface that wraps the Render function.
	//
	// Default: nil
	Views Views `json:"-"`

	// Views Layout is the global layout for all template render until override on Render function.
	//
	// Default: ""
	ViewsLayout string `json:"views_layout"`

	// PassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine
	//
	// Default: false
	PassLocalsToViews bool `json:"pass_locals_to_views"`

	// The amount of time allowed to read the full request including body.
	// It is reset after the request handler has returned.
	// The connection's read deadline is reset when the connection opens.
	//
	// Default: unlimited
	ReadTimeout time.Duration `json:"read_timeout"`

	// The maximum duration before timing out writes of the response.

Defined In

Frequently Asked Questions

What is the Config type?
Config is a type/interface in the fiber codebase, defined in app.go.
Where is Config defined?
Config is defined in app.go at line 115.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free