Home / File/ healthcheck.go — fiber Source File

healthcheck.go — fiber Source File

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

File go FiberCore Adapters 1 imports 1 functions

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

package healthcheck

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

// New returns a health-check handler that responds based on the provided
// configuration.
func New(config ...Config) fiber.Handler {
	cfg := configDefault(config...)

	return func(c fiber.Ctx) error {
		// Don't execute middleware if Next returns true
		if cfg.Next != nil && cfg.Next(c) {
			return c.Next()
		}

		if c.Method() != fiber.MethodGet {
			return c.Next()
		}

		if cfg.Probe(c) {
			return c.SendStatus(fiber.StatusOK)
		}

		return c.SendStatus(fiber.StatusServiceUnavailable)
	}
}

Domain

Subdomains

Functions

Dependencies

  • v3

Frequently Asked Questions

What does healthcheck.go do?
healthcheck.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 healthcheck.go?
healthcheck.go defines 1 function(s): New.
What does healthcheck.go depend on?
healthcheck.go imports 1 module(s): v3.
Where is healthcheck.go in the architecture?
healthcheck.go is located at middleware/healthcheck/healthcheck.go (domain: FiberCore, subdomain: Adapters, directory: middleware/healthcheck).

Analyze Your Own Codebase

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

Try Supermodel Free