version

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package version are used to generate version information

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON added in v0.1.3

func JSON() string

func ReleaseVersion

func ReleaseVersion() string

func ShortString

func ShortString() string

func String

func String() string

func YAML added in v0.1.3

func YAML() string

Types

type BuildInfo added in v0.1.5

type BuildInfo struct {
	GoVersion string `json:"goVersion,omitempty" yaml:"goVersion,omitempty"`
	GOOS      string `json:"GOOS,omitempty" yaml:"GOOS,omitempty"`
	GOARCH    string `json:"GOARCH,omitempty" yaml:"GOARCH,omitempty"`
	NumCPU    int    `json:"numCPU,omitempty" yaml:"numCPU,omitempty"`
	Compiler  string `json:"compiler,omitempty" yaml:"compiler,omitempty"`
	BuildTime string `json:"buildTime,omitempty" yaml:"buildTime,omitempty"` // Such as "2021-10-20 18:24:03"
}

type GitInfo added in v0.1.5

type GitInfo struct {
	LatestTag string `json:"latestTag,omitempty" yaml:"latestTag,omitempty"` // Such as "v1.2.3"
	Commit    string `json:"commit,omitempty" yaml:"commit,omitempty"`       // Such as "3836f8770ab8f488356b2129f42f2ae5c1134bb0"
	TreeState string `json:"treeState,omitempty" yaml:"treeState,omitempty"` // Such as "clean", "dirty"
}

GitInfo contains git information. following attributes:

GitLatestTag - "vX.Y.Z" used to indicate the last git tag.
GitCommit - The git commit id corresponding to this source code.
GitTreeState - "clean" indicates no changes since the git commit id
    "dirty" indicates source code changes after the git commit id

type Info added in v0.1.3

type Info struct {
	ReleaseVersion string     `json:"releaseVersion" yaml:"releaseVersion"` // Such as "v1.2.3-3836f877"
	GitInfo        *GitInfo   `json:"gitInfo,omitempty" yaml:"gitInfo,omitempty"`
	BuildInfo      *BuildInfo `json:"buildInfo,omitempty" yaml:"buildInfo,omitempty"`
}

Info contains versioning information. following attributes:

   ReleaseVersion - "vX.Y.Z-00000000" used to indicate the last release version,
		  containing GitVersion and GitCommitShort.

func NewDefaultVersionInfo added in v0.1.8

func NewDefaultVersionInfo() *Info

func NewInfo added in v0.1.5

func NewInfo() (*Info, error)

func NewMainOrDefaultVersionInfo added in v0.1.8

func NewMainOrDefaultVersionInfo() *Info

func (*Info) JSON added in v0.1.3

func (v *Info) JSON() string

func (*Info) ShortString added in v0.1.3

func (v *Info) ShortString() string

func (*Info) String added in v0.1.3

func (v *Info) String() string

func (*Info) YAML added in v0.1.3

func (v *Info) YAML() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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