FQversion

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

GoDoc Go Report Card

FQversion

Quick 'Version' helper library that I use in various projects that was written for a larger private enterprise library, but has been made standalone and public. This removes the need to make this vendored and helps those that use go modules.

This library supports a versioning catalog where multiple imported libraries can register their Name, Version, Build information and have it emitted in various ways.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Catalog

func Catalog() []registeredVersion

Catalog returns the list of registered versions

func GetBUILD

func GetBUILD() string

GetBUILD returns a standard formatted BUILD date string.

e.g. date '+%Y%m%d@%T'

func GetBUILDHOST

func GetBUILDHOST() string

GetBUILDHOST returns the server this was compiled on.

func GetVersions

func GetVersions(name, version, build string) []string

GetVersions return a list of Caller and Catalog versions.

func GetVersionsAligned

func GetVersionsAligned(name, version, build string) []string

GetVersionsAligned return a list of Caller and Catalog versions that is aligned via TabWriter.

func ProgVersion

func ProgVersion(name, version, build string) string

ProgVersion returns a formatted version string given: name, version, build

func Register

func Register(name, version, build string)

Register adds a new version structure to the catalog.

func ShowCatalog

func ShowCatalog() string

ShowCatalog returns a stringified catalog list

func ShowCatalogAligned

func ShowCatalogAligned() string

ShowCatalogAligned returns a stringified catalog list that is aligned via TabWriter

func ShowVersions

func ShowVersions(name, version, build string) string

ShowVersions returns a formatted version list of all registered versions in catalog

func ShowVersionsAligned

func ShowVersionsAligned(name, version, build string) string

ShowVersionsAligned returns a formatted version list of all registered versions in catalog aligned via TabWriter

Types

type Version

type Version registeredVersion

Version is the version structure stored in the catalog.

func NewVersion

func NewVersion(name, version, build string) *Version

NewVersion returns a new Version object.

func (*Version) GetVersions

func (v *Version) GetVersions() []string

GetVersions return a list of Caller and Catalog versions.

func (*Version) GetVersionsAligned

func (v *Version) GetVersionsAligned() []string

GetVersionsAligned return a list of Caller and Catalog versions that is aligned via TabWriter.

func (*Version) ProgVersion

func (v *Version) ProgVersion() string

ProgVersion returns a formatted version string given: name, version, build

func (*Version) ShowVersions

func (v *Version) ShowVersions() string

ShowVersions returns a formatted version list of all registered versions in catalog

func (*Version) ShowVersionsAligned

func (v *Version) ShowVersionsAligned() string

ShowVersionsAligned returns a formatted version list of all registered versions in catalog aligned via TabWriter

Jump to

Keyboard shortcuts

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