version

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package version is a convenience utility that provides provider consumers with a ready-to-use version command that produces apps versioning information based on flags passed at compile time.

Configure the version command

The version command can be just added to your cobra root command. At build time, the variables Name, Version, Commit, and BuildTags can be passed as build flags as shown in the following example:

go build -X github.com/akash-network/provider/version.Name=provider-services \
 -X github.com/akash-network/provider/version.AppName=provider-services \
 -X github.com/akash-network/provider/version.Version=1.0 \
 -X github.com/akash-network/provider/version.Commit=f0f7b7dab7e36c20b757cebce0e8f4fc5b95de60 \
 -X "github.com/akash-network/provider/version.BuildTags=linux darwin amd64"

Index

Constants

This section is empty.

Variables

View Source
var (
	// Name application's name
	Name = ""
	// AppName application binary name
	AppName = "<appd>"
	// Version application's version string
	Version = ""
	// Commit commit
	Commit = ""
	// BuildTags build tags
	BuildTags = ""
)

Functions

func NewVersionCommand

func NewVersionCommand() *cobra.Command

NewVersionCommand returns a CLI command to interactively print the application binary version information.

Types

type Info

type Info struct {
	Name             string     `json:"name" yaml:"name"`
	AppName          string     `json:"server_name" yaml:"server_name"`
	Version          string     `json:"version" yaml:"version"`
	GitCommit        string     `json:"commit" yaml:"commit"`
	BuildTags        string     `json:"build_tags" yaml:"build_tags"`
	GoVersion        string     `json:"go" yaml:"go"`
	BuildDeps        []buildDep `json:"build_deps" yaml:"build_deps"`
	CosmosSdkVersion string     `json:"cosmos_sdk_version" yaml:"cosmos_sdk_version"`
}

Info defines the application version information.

func NewInfo

func NewInfo() Info

func (Info) String

func (vi Info) String() string

Jump to

Keyboard shortcuts

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