version

package
v0.0.0-...-8b058bf Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(name string, version string, buildDate string, commit string, sourceUrl string) string

Format is used to display version information about a Tympan application. For an application named "myapp" with a version of "1.2.3", a build date of "2022/01/31", a commit hash of "f1976f1", and a source url of https://github.com/myuser/myapp, it will return:

`
myapp 1.2.3 f1976f1 2022/01/31
https://github.com/myuser/myapp/releases/tag/1.2.3
`

Types

type VersionCommand

type VersionCommand struct {
	Version   string
	BuildDate string
	Commit    string
	tympan.Metadata
}

VersionCommand contains all the necessary information to determine and display a Tympan application's version.

func (*VersionCommand) CreateCommand

func (v *VersionCommand) CreateCommand() *cobra.Command

CreateCommand instantiates a cobra command to display the version of the Tympan application.

type VersionCommander

type VersionCommander interface {
	CreateCommand() *cobra.Command
}

The Version command is reimplementable and must return a valid cobra Command.

Jump to

Keyboard shortcuts

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