gbuild

package
v2.8.8 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gbuild manages the build-in variables from "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 returns the custom build-in variables as map.

func Get

func Get(name string, def ...interface{}) *gvar.Var

Get retrieves and returns the build-in binary variable with given name.

Types

type BuildInfo

type BuildInfo struct {
	GoFrame string                 // Built used GoFrame version.
	Golang  string                 // Built used Golang version.
	Git     string                 // Built used git repo. commit id and datetime.
	Time    string                 // Built datetime.
	Version string                 // Built version.
	Data    map[string]interface{} // All custom built data key-value pairs.
}

BuildInfo maintains the built info of current binary.

func Info

func Info() BuildInfo

Info returns the basic built information of the binary as map. Note that it should be used with gf-cli tool "gf build", which automatically injects necessary information into the binary.

Jump to

Keyboard shortcuts

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