healthy

package
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package healthy 提供健康检查处理器(Handler)的全局注册表。

各组件可在初始化时通过 Register 注册自己的健康检查逻辑, 健康检查端点再通过 List/Get 汇总并执行这些 Handler。

Index

Constants

View Source
const Name = "healthy"

Variables

This section is empty.

Functions

func List

func List() (names []string)

List 返回所有已注册的健康检查名称。

func Register

func Register(name string, r Handler)

Register 注册一个健康检查 Handler。name 与 r 均不可为空, 且 name 不可重复注册,否则触发 panic。

Types

type Handler

type Handler func(req fiber.Ctx) error

Handler 是单个健康检查的处理函数,返回 error 表示不健康。

func Get

func Get(name string) Handler

Get 返回指定名称的健康检查 Handler,不存在时返回 nil。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL