version

package
v2.39.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package version implements server, cli and console version handling.

Index

Constants

View Source
const DevVersion = "dev"

DevVersion is the version string for development versions.

Variables

View Source
var BuildVersion = DevVersion

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

Functions

func FetchServerVersion

func FetchServerVersion(endpoint string, client *httpc.Client) (version string, err error)

FetchServerVersion reads the version from server.

Types

type ServerFeatureFlags

type ServerFeatureFlags struct {
	HasAccessKey bool

	HasAction       bool
	HasCronTriggers bool
}

ServerFeatureFlags indicates what features are supported by this version of server.

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

	// ServerFeatureFlags indicates what features are supported by this
	// version of server.
	ServerFeatureFlags *ServerFeatureFlags
}

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) GetServerFeatureFlags

func (v *Version) GetServerFeatureFlags() error

GetServerFeatureFlags returns the feature flags for server.

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