build

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version      string
	GitCommit    string
	GitBranch    string
	BuildTime    string
	GoVersion    string
	Platform     string
	Architecture string
)

Functions

func IsRelease

func IsRelease() bool

func JSON

func JSON() (string, error)

func Short

func Short() string

func String

func String() string

Types

type BuildInfo

type BuildInfo interface {
	GetVersion() string
	GetCommit() string
	GetBranch() string
	GetBuildTime() time.Time
	GetGoVersion() string
	GetPlatform() string
	GetArchitecture() string
	IsRelease() bool
	String() string
	Short() string
	JSON() (string, error)
	Info() Info
}

BuildInfo defines the interface for build information

func New

func New(version, commit, branch, buildTime, goVersion, platform, architecture string) BuildInfo

type Info

type Info struct {
	Version      string    `json:"version"`
	GitCommit    string    `json:"gitCommit"`
	GitBranch    string    `json:"gitBranch"`
	BuildTime    time.Time `json:"buildTime"`
	GoVersion    string    `json:"goVersion"`
	Platform     string    `json:"platform"`
	Architecture string    `json:"architecture"`
}

Info contains all build-time information

func GetInfo

func GetInfo() Info

Convenience package-level functions

func (*Info) GetArchitecture

func (i *Info) GetArchitecture() string

func (*Info) GetBranch

func (i *Info) GetBranch() string

func (*Info) GetBuildTime

func (i *Info) GetBuildTime() time.Time

func (*Info) GetCommit

func (i *Info) GetCommit() string

func (*Info) GetGoVersion

func (i *Info) GetGoVersion() string

func (*Info) GetPlatform

func (i *Info) GetPlatform() string

func (*Info) GetVersion

func (i *Info) GetVersion() string

func (*Info) Info

func (i *Info) Info() Info

func (*Info) IsRelease

func (i *Info) IsRelease() bool

func (*Info) JSON

func (i *Info) JSON() (string, error)

func (*Info) Short

func (i *Info) Short() string

func (*Info) String

func (i *Info) String() string

Jump to

Keyboard shortcuts

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