构建信息类

package
v0.0.0-...-2910145 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gbuild 管理来自 "gf build" 的内置变量。

Index

Constants

View Source
const (
	BuiltGit     = `builtGit`
	BuiltTime    = `builtTime`
	BuiltVersion = `builtVersion`
)

Variables

This section is empty.

Functions

func Data

func Data() map[string]interface{}

Data 返回自定义内置变量作为映射(map)。

func Get

func Get(name string, def ...interface{}) *泛型类.Var

Get 函数用于获取并返回指定名称的内置二进制变量。

Types

type BuildInfo

type BuildInfo struct {
	GoFrame string                 // 使用的GoFrame版本。
	Golang  string                 // 使用的Golang构建版本。
	Git     string                 // 此处注释翻译为:// 根据所用git仓库,构建提交ID及日期时间。
	Time    string                 // Built datetime.
	Version string                 // Built version.
	Data    map[string]interface{} // 所有自定义构建的数据键值对。
}

BuildInfo 用于维护当前二进制文件的构建信息。

func Info

func Info() BuildInfo

Info 返回二进制文件的基本构建信息,以 map 的形式。 注意,此函数需配合 gf-cli 工具的 "gf build" 命令使用, 该命令会自动向二进制文件中注入必要的信息。

Jump to

Keyboard shortcuts

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