helpers

package
v1.3.0 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: 11 Imported by: 0

Documentation

Overview

Package helpers implements helper function for builder plugin

Index

Constants

View Source
const (
	PluginInventoryDBImageName = "plugin-inventory"
)

Variables

View Source
var Identifiers = []string{
	string('\U0001F435'),
	string('\U0001F43C'),
	string('\U0001F436'),
	string('\U0001F430'),
	string('\U0001F98A'),
	string('\U0001F431'),
	string('\U0001F981'),
	string('\U0001F42F'),
	string('\U0001F42E'),
	string('\U0001F437'),
	string('\U0001F42D'),
	string('\U0001F428'),
}

Identifiers are the emoji symbols to specify progress happening on different threads

Functions

func GetDigest

func GetDigest(filePath string) (string, error)

GetDigest computes the sha256 digest of the specified file

func GetID added in v1.0.0

func GetID(i int) string

GetID return a unique ID based on the identifiers

func GetMaxParallelism added in v1.0.0

func GetMaxParallelism() int

GetMaxParallelism return the maximum concurrent threads to use. Limit the number of concurrent operations we perform so we don't overwhelm the system.

func GetNumberOfIndividualPluginBinariesFromManifest added in v1.0.0

func GetNumberOfIndividualPluginBinariesFromManifest(pluginManifest *cli.Manifest) int

GetNumberOfIndividualPluginBinariesFromManifest returns the number of plugin binaries into consideration based on the plugin manifest file This includes plugin binaries for all supported os architectures as well as all versions mentioned for the specific plugin.

func GetPluginArchiveRelativePath

func GetPluginArchiveRelativePath(plugin cli.Plugin, osArch cli.Arch, version string) string

GetPluginArchiveRelativePath creates plugin archive relative path from metadata

func IsRequiredOSArch added in v1.0.0

func IsRequiredOSArch(osArch cli.Arch) bool

IsRequiredOSArch returns true if 'osArch' is one of the require OSArch combinations that a plugin must support.

func ReadPluginGroupManifest added in v0.0.11

func ReadPluginGroupManifest(pluginGroupManifestFile string) (*cli.PluginGroupManifest, error)

ReadPluginGroupManifest reads the PluginGroupManifest file and returns PluginGroupManifest object

func ReadPluginManifest

func ReadPluginManifest(pluginManifestFile string) (*cli.Manifest, error)

ReadPluginManifest reads the PluginManifest file and returns Manifest object

func ValidatePluginBinary added in v0.90.0

func ValidatePluginBinary(pluginBinaryFilePath, threadID string) (bool, error)

ValidatePluginBinary validates the plugin binary file Checks the binary file size if its empty returns true if file is not empty and false if file is empty

Types

type ErrInfo added in v1.0.0

type ErrInfo struct {
	Err  error
	Path string
	ID   string
}

ErrInfo is used to return error information for

Jump to

Keyboard shortcuts

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