mirror of
https://github.com/hanzoai/ca.git
synced 2026-11-03 18:08:27 +00:00
2.6 KiB
2.6 KiB
version
import "github.com/effective-security/trustyca/api/version"
Index
type Info
Info describes a version of an executable
type Info struct {
Major uint `json:"major"`
Minor uint `json:"minor"`
Commit uint `json:"commit"`
Build string `json:"build"`
Runtime string `json:"runtime"`
// contains filtered or unexported fields
}
func Current
func Current() Info
Current returns the current version [set by the build]
func (Info) Float
func (v Info) Float() float32
Float returns the version Major/Minor as a float Major.Minor e.g. given Major:3 Minor:52001, it'll return 3.52001 this is only valid if PopulateFromBuild has been called.
func (Info) GreaterOrEqual
func (v Info) GreaterOrEqual(than Info) bool
GreaterOrEqual returns true if the version 'v' is the same or new that the supplied parameter 'other' This only examines the Major & Minor field (as the SHA in Build provides no ordering indication)
func (*Info) PopulateFromBuild
func (v *Info) PopulateFromBuild()
PopulateFromBuild will parse the major/minor values from the build string the build string is expected to be in the format major.minor-commit and can be populated from git using
GIT_VERSION := $(shell git describe --dirty --always --tags --long)
and then using gofmt to substitute it into a template
func (Info) String
func (v Info) String() string
Generated by gomarkdoc