version

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 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

func Json() string

func ReleaseVersion

func ReleaseVersion() string

func ShortString

func ShortString() string

func String

func String() string

func Yaml

func Yaml() string

Types

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

type VersionInfo

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

VersionInfo 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 NewVersionInfo

func NewVersionInfo() (*VersionInfo, error)

func (*VersionInfo) Json

func (v *VersionInfo) Json() string

func (*VersionInfo) ShortString

func (v *VersionInfo) ShortString() string

func (*VersionInfo) String

func (v *VersionInfo) String() string

func (*VersionInfo) Yaml

func (v *VersionInfo) Yaml() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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