Help us shape the future of Go! Take the 2026 Go Developer Survey

versionh

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package versionh 提供版本信息的 HTTP Handler。

从 version 包拆分,避免 version 包直接依赖 Hertz。 version 包只提供构建元数据(Metadata/Version 等),本包提供 HTTP 端点。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(ctx context.Context, c *app.RequestContext)

Handler 返回编译版本与运行时信息的 HTTP handler。 已包含 code/message/trace_id 外层,不会被 ResponseMiddleware 重复包装。 直接在路由中注册:h.GET("/buildVersion", versionh.Handler)

Types

type BuildVersionResp

type BuildVersionResp struct {
	Version     string `json:"version"`
	BuildCommit string `json:"buildCommit"`
	BuildTime   string `json:"buildTime"`
	BuildBranch string `json:"buildBranch"`
	StartTime   string `json:"startTime"`
	Uptime      string `json:"uptime"`
}

BuildVersionResp 版本信息响应结构,用于 /buildVersion 端点。

Jump to

Keyboard shortcuts

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