debug

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: 4 Imported by: 0

Documentation

Overview

Package debug 提供全局 debug HTTP 路由聚合器(基于 Fiber)。

各子模块通过 debug/bootstrap.RegisterAll() 向全局 App 注册路由; 主 HTTP/gRPC 服务器通过 app.Use("/debug", debug.App()) 挂载。

鉴权由 debug/debug 子包的全局中间件负责:

  • 来自 loopback 地址(127.0.0.1 / ::1)的请求免 token(基于客户端 IP)
  • 非本地访问需携带 token(query/header/cookie),可在配置 debug.password 中设置

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(path string, handler any, handlers ...any)

func App

func App() *fiber.App

App 返回全局 debug Fiber 实例,供主服务器挂载。

func Delete

func Delete(path string, handler any, handlers ...any)

func Get

func Get(path string, handler any, handlers ...any)

Get 在全局 debug App 上注册 GET 路由。

func Group

func Group(prefix string, handlers ...any)
func Head(path string, handler any, handlers ...any)

func Patch

func Patch(path string, handler any, handlers ...any)

func Post

func Post(path string, handler any, handlers ...any)

func Put

func Put(path string, handler any, handlers ...any)

func Route

func Route(prefix string, fn func(router fiber.Router), name ...string)

func Static

func Static(prefix, root string, config ...static.Config)

func Wrap

func Wrap(h http.Handler) fiber.Handler

Wrap 将标准库 http.Handler 适配为 Fiber Handler。

func WrapFunc

func WrapFunc(h http.HandlerFunc) fiber.Handler

WrapFunc 将标准库 http.HandlerFunc 适配为 Fiber Handler。

Types

type Config

type Config struct {
	Debug struct {
		// Password 是非本地访问 debug 端点所需的 token。
		Password string `yaml:"password"`
	} `yaml:"debug"`
}

Config 是 debug 模块的 YAML 配置结构。

Directories

Path Synopsis
Package bootstrap registers built-in debug routes on the global debug App.
Package bootstrap registers built-in debug routes on the global debug App.
Package debug 注册 debug 控制台主页与全局鉴权中间件。
Package debug 注册 debug 控制台主页与全局鉴权中间件。
Package featurehttp 提供 feature flags 的 HTTP 调试接口
Package featurehttp 提供 feature flags 的 HTTP 调试接口

Jump to

Keyboard shortcuts

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