Home / File/ config.go — fiber Source File

config.go — fiber Source File

Architecture documentation for config.go, a go file in the fiber codebase. 1 imports, 0 dependents.

File go FiberCore Adapters 1 imports 3 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  9af013f8_9ad3_f8aa_bf7e_5458e861693c["config.go"]
  6604ba6b_bab7_17c7_e687_7d0f07080e5a["v3"]
  9af013f8_9ad3_f8aa_bf7e_5458e861693c --> 6604ba6b_bab7_17c7_e687_7d0f07080e5a
  style 9af013f8_9ad3_f8aa_bf7e_5458e861693c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

package recover //nolint:predeclared // TODO: Rename to some non-builtin

import (
	"github.com/gofiber/fiber/v3"
)

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

	// StackTraceHandler defines a function to handle stack trace
	//
	// Optional. Default: defaultStackTraceHandler
	StackTraceHandler func(c fiber.Ctx, e any)

	// EnableStackTrace enables handling stack trace
	//
	// Optional. Default: false
	EnableStackTrace bool
}

// ConfigDefault is the default config
var ConfigDefault = Config{
	Next:              nil,
	EnableStackTrace:  false,
	StackTraceHandler: defaultStackTraceHandler,
}

// Helper function to set default values
func configDefault(config ...Config) Config {
	// Return default config if nothing provided
	if len(config) < 1 {
		return ConfigDefault
	}

	// Override default config
	cfg := config[0]

	if cfg.EnableStackTrace && cfg.StackTraceHandler == nil {
		cfg.StackTraceHandler = defaultStackTraceHandler
	}

	return cfg
}

Domain

Subdomains

Classes

Types

Dependencies

  • v3

Frequently Asked Questions

What does config.go do?
config.go is a source file in the fiber codebase, written in go. It belongs to the FiberCore domain, Adapters subdomain.
What functions are defined in config.go?
config.go defines 3 function(s): bool, c, configDefault.
What does config.go depend on?
config.go imports 1 module(s): v3.
Where is config.go in the architecture?
config.go is located at middleware/recover/config.go (domain: FiberCore, subdomain: Adapters, directory: middleware/recover).

Analyze Your Own Codebase

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

Try Supermodel Free