version

package
v1.0.0-alpha08 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package version implements server, cli and console version handling.

Index

Constants

This section is empty.

Variables

View Source
var BuildVersion = "dev"

BuildVersion is the versin string with which CLI is built. Set during the build time.

Functions

func FetchServerVersion

func FetchServerVersion(endpoint string) (version string, err error)

FetchServerVersion reads the version from server.

Types

type Version

type Version struct {
	// CLI is the version of CLI
	CLI string
	// CLISemver is the parsed semantic version for CLI
	CLISemver *semver.Version

	// Server is the version of server CLI is interacting with
	Server string
	// ServerSemver is the parsed semantic version for server
	ServerSemver *semver.Version
}

Version defines the version object.

func New

func New() *Version

New returns a new version object with BuildVersion filled in as CLI

func NewCLIVersion

func NewCLIVersion(cli string) *Version

NewCLIVersion returns a new version object with CLI info filled in

func (*Version) CheckCLIServerCompatibility

func (v *Version) CheckCLIServerCompatibility() (compatible bool, reason string)

CheckCLIServerCompatibility compares server and cli for compatibility, subject to certain conditions. compatible boolean is returned along with a message which states the reason for the result.

func (*Version) GetCLIVersion

func (v *Version) GetCLIVersion() string

GetCLIVersion return the CLI version string.

func (*Version) GetConsoleAssetsVersion

func (v *Version) GetConsoleAssetsVersion() (av string)

GetConsoleAssetsVersion returns the assets version av to be used in the console template.

func (*Version) GetConsoleTemplateVersion

func (v *Version) GetConsoleTemplateVersion() (tv string)

GetConsoleTemplateVersion returns the template version tv required to render the console html.

func (*Version) GetServerVersion

func (v *Version) GetServerVersion() string

GetServerVersion return the server version string.

func (*Version) SetCLIVersion

func (v *Version) SetCLIVersion(s string)

SetCLIVersion parses the version string vs and sets it as CLI version

func (*Version) SetServerVersion

func (v *Version) SetServerVersion(s string)

SetServerVersion parses the version string vs and sets it as server version

Jump to

Keyboard shortcuts

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