version

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 7 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.2.9

func JSON() string

func ReleaseVersion

func ReleaseVersion() string

func ShortString

func ShortString() string

func String

func String() string

func YAML added in v0.2.9

func YAML() string

Types

type Info added in v0.2.9

type Info struct {
	ReleaseVersion string      `json:"releaseVersion" yaml:"releaseVersion"`                 // Such as "v1.2.3-3836f877"
	GitVersion     string      `json:"gitVersion" yaml:"gitVersion"`                         // Such as "v1.2.3"
	GitCommit      string      `json:"gitCommit" yaml:"gitCommit"`                           // Such as "3836f8770ab8f488356b2129f42f2ae5c1134bb0"
	GitTreeState   string      `json:"gitTreeState,omitempty" yaml:"gitTreeState,omitempty"` // Such as "clean", "dirty"
	BuildTime      string      `json:"buildTime" yaml:"buildTime"`                           // Such as "2021-10-20 18:24:03"
	Runtime        RuntimeInfo `json:"runtime,omitempty" yaml:"runtime,omitempty"`
}

Info contains versioning information. following attributes:

   ReleaseVersion - "vX.Y.Z-00000000" used to indicate the last release version,
		  containing GitVersion and GitCommitShort.
   GitVersion - "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

func NewInfo added in v0.2.9

func NewInfo() (*Info, error)

func (*Info) JSON added in v0.2.9

func (v *Info) JSON() string

func (*Info) ShortString added in v0.2.9

func (v *Info) ShortString() string

func (*Info) String added in v0.2.9

func (v *Info) String() string

func (*Info) YAML added in v0.2.9

func (v *Info) YAML() string

type RuntimeInfo

type RuntimeInfo 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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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