utils

package
v0.0.0-...-585d944 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EvePlatformFile contains the platform string that indicates evaluation mode
	EvePlatformFile = "/hostfs/etc/eve-platform"
	// EvaluationPlatformString is the string that must be present to indicate evaluation mode
	EvaluationPlatformString = "evaluation"
)

Variables

This section is empty.

Functions

func DeserializeToStruct

func DeserializeToStruct(filename string, pointerToStructInstance any) error

DeserializeToStruct deserializes the given file into the given struct. It returns an error if the file is not accessible or if the file does not contain all the necessary fields (those that are marked as mandatory="true" in the struct definition).

func GetVolumeFormat

func GetVolumeFormat(log *base.LogObject, fileLocation string) (config.Format, error)

GetVolumeFormat returns format of the volume

func GetZipArchive

func GetZipArchive(root string, pe types.PatchEnvelopeInfo) (string, error)

GetZipArchive archives list of patch envelopes in a given path and returns full path to zip archive

func IsEvaluationPlatform

func IsEvaluationPlatform() bool

IsEvaluationPlatform reads /etc/eve-platform and returns true if it contains "evaluation" Uses OS filesystem by default

func IsEvaluationPlatformFS

func IsEvaluationPlatformFS(fs afero.Fs) bool

IsEvaluationPlatformFS reads /etc/eve-platform and returns true if it contains "evaluation" Accepts filesystem abstraction for testing

func JoinStrings

func JoinStrings[T Stringer](items []T, sep string) string

JoinStrings joins a slice of Stringer values using the given separator.

func LookupDatastoreConfig

func LookupDatastoreConfig(sub pubsub.Subscription, dsID uuid.UUID) (*types.DatastoreConfig, error)

LookupDatastoreConfig get a datastore config based on uuid

func MaybeInsertSha

func MaybeInsertSha(name string, sha string) string

MaybeInsertSha Check if the OCI name does not include an explicit sha and if not return the name with the sha inserted. Note that the sha must be lower case in the OCI reference.

func RemoteAccessDisabled

func RemoteAccessDisabled() bool

RemoteAccessDisabled checks if remote access is enabled/disabled by checking if the file /config/remote_access_disabled exists or not.

func ToStrings

func ToStrings[T Stringer](items []T) []string

ToStrings converts a slice of Stringer values to a slice of strings.

func UpdateLedManagerConfig

func UpdateLedManagerConfig(log *base.LogObject, count types.LedBlinkCount)

UpdateLedManagerConfig is used by callers to change the behavior or the LED

Types

type Stringer

type Stringer interface {
	String() string
}

Stringer is a type constraint for anything that implements String() string.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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