consul

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidVersion

func IsValidVersion(version string, versions []Version) bool

IsValidVersion determines that a given version string is contained within the slice of available Consul versions.

func NormalizeVersion

func NormalizeVersion(version string) string

NormalizeVersion ensures the version starts with a 'v'

func RecommendedVersion

func RecommendedVersion(versions []Version) string

RecommendedVersion returns the recommended version of Consul

Types

type Version

type Version struct {
	// Version is the Consul product version.
	Version string `json:"version"`

	// Status denotes the availability (and whether the version is recommended) of the associated Consul version.
	Status string `json:"status"`
}

Version represents a Consul version and the status of that version in regards to availability on HCP.

func FromAMAVersions

func FromAMAVersions(amaVersions []*models.HashicorpCloudConsulamaAmaVersion) []Version

FromAMAVersions converts a slice of *HashicorpCloudConsulamaAmaVersion to a slice of Version.

func GetAvailableHCPConsulVersions

func GetAvailableHCPConsulVersions(ctx context.Context, hcpApiDomain string) ([]Version, error)

GetAvailableHCPConsulVersions retrieves a slice of supported/available Consul versions from the HCP Consul API.

Jump to

Keyboard shortcuts

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