Documentation ¶
Index ¶
Constants ¶
const SemVerRegex string = `v?([0-9]+)\.([0-9]+)\.([0-9]+)`
SemVerRegex is the regular expression used to parse a semantic version. https://github.com/Masterminds/semver/blob/master/LICENSE.txt
Variables ¶
This section is empty.
Functions ¶
func CheckProcessVersion ¶ added in v0.8.1
CheckProcessVersion is not meant to be used for peers but is meant to be used for other utilities
func DebugHandler ¶ added in v0.8.8
func DebugHandler(w http.ResponseWriter, r *http.Request)
DebugHandler returns a json representation of the current version information for the binary
Types ¶
type AllowedVersions ¶
type AllowedVersions struct { Bootstrap []SemVer Satellite []SemVer Storagenode []SemVer Uplink []SemVer Gateway []SemVer Identity []SemVer }
AllowedVersions provides a list of SemVer per Service
type Config ¶
type Config struct { ServerAddress string `help:"server address to check its version against" default:"https://version.alpha.storj.io"` RequestTimeout time.Duration `help:"Request timeout for version checks" default:"0h1m0s"` CheckInterval time.Duration `help:"Interval to check the version" default:"0h15m0s"` }
Config contains the necessary Information to check the Software Version
type Info ¶
type Info struct { Timestamp time.Time `json:"timestamp,omitempty"` CommitHash string `json:"commitHash,omitempty"` Version SemVer `json:"version"` Release bool `json:"release,omitempty"` // contains filtered or unexported fields }
Info is the versioning information for a binary
var ( // Build is a struct containing all relevant build information associated with the binary Build Info )
type SemVer ¶
type SemVer struct { Major int64 `json:"major"` Minor int64 `json:"minor"` Patch int64 `json:"patch"` }
SemVer represents a semantic version
func NewSemVer ¶
NewSemVer parses a given version and returns an instance of SemVer or an error if unable to parse the version.
func StrToSemVerList ¶
StrToSemVerList converts a list of versions to a list of SemVer
type Service ¶
Service contains the information and variables to ensure the Software is up to date
func NewService ¶
NewService creates a Version Check Client with default configuration
func (*Service) CheckVersion ¶ added in v0.8.1
CheckVersion checks to make sure the version is still okay, returning an error if not