hvutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package hvutils provies utility methods to access the Hivelocity API.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrMoreThanOneTagFound gets returned if more than one caphv-device-type tag was found via the HV API.
	ErrMoreThanOneTagFound = fmt.Errorf("more than one caphv-device-type tag found")

	// ErrInvalidLabelValue gets returned if the HV tag contains a value which is an invalid K8s label.
	ErrInvalidLabelValue = fmt.Errorf("invalid label value")

	// ErrNoInstanceTypeFound gets returned if no caphv-device-type tag was found via the HV API.
	ErrNoInstanceTypeFound = fmt.Errorf("no caphv-device-type tag found")

	// ErrMoreThanOneNameFound gets returned if more than one caphv-machine-name tag was found via the HV API.
	ErrMoreThanOneNameFound = fmt.Errorf("more than one caphv-machine-name tag found")

	// ErrNoMachineNameFound gets returned if no caphv-machine-name tag was found via the HV API.
	ErrNoMachineNameFound = fmt.Errorf("no caphv-machine-name tag found")
)

Functions

func GetInstanceTypeFromTags

func GetInstanceTypeFromTags(tags []string) (string, error)

GetInstanceTypeFromTags is a utility method to read the caphv-device-type from a slice of strings. The slice is usually from the Hivelocity API of a device. Example: {"caphv-device-type=foo", "other-label"} would return "foo".

func GetMachineNameFromTags

func GetMachineNameFromTags(tags []string) (string, error)

GetMachineNameFromTags is a utility method to read the caphv-machine-name from a slice of strings. The slice is usually from the Hivelocity API of a device. Example: {"caphv-machine-name=foo", "other-label"} would return "foo".

Types

This section is empty.

Jump to

Keyboard shortcuts

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