Home / Function/ methodColor() — fiber Function Reference

methodColor() — fiber Function Reference

Architecture documentation for the methodColor() function in utils.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  f04279d3_8a54_72c0_d07b_814bc087ee08["methodColor()"]
  bf06993d_3182_2860_9771_529cc14bc251["utils.go"]
  f04279d3_8a54_72c0_d07b_814bc087ee08 -->|defined in| bf06993d_3182_2860_9771_529cc14bc251
  style f04279d3_8a54_72c0_d07b_814bc087ee08 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/logger/utils.go lines 11–33

func methodColor(method string, colors *fiber.Colors) string {
	if colors == nil {
		return ""
	}
	switch method {
	case fiber.MethodGet:
		return colors.Cyan
	case fiber.MethodPost:
		return colors.Green
	case fiber.MethodPut:
		return colors.Yellow
	case fiber.MethodDelete:
		return colors.Red
	case fiber.MethodPatch:
		return colors.White
	case fiber.MethodHead:
		return colors.Magenta
	case fiber.MethodOptions:
		return colors.Blue
	default:
		return colors.Reset
	}
}

Domain

Subdomains

Frequently Asked Questions

What does methodColor() do?
methodColor() is a function in the fiber codebase, defined in middleware/logger/utils.go.
Where is methodColor() defined?
methodColor() is defined in middleware/logger/utils.go at line 11.

Analyze Your Own Codebase

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

Try Supermodel Free