command

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 23 Imported by: 4

Documentation

Index

Constants

View Source
const (
	TestPass = iota
	TestFail
	Aborted
	InternalError
	BadUsage
	NoTests
)

Exit codes

Variables

View Source
var ActiveEvaluationOrchestrator *pluginkit.EvaluationOrchestrator

Functions

func Contains added in v1.12.0

func Contains(slice []*PluginPkg, search string) bool

Contains checks if a plugin with the given name exists in the slice

func GeneratePlugin added in v1.12.0

func GeneratePlugin(logger hclog.Logger, templatesDir, sourcePath, outputDir, serviceName string) error

GeneratePlugin generates a plugin from a catalog file

func GetListCmd added in v1.12.0

func GetListCmd(writer Writer) *cobra.Command

GetListCmd returns the list command that can be added to a root command

func NewPluginCommands

func NewPluginCommands(pluginName, buildVersion, buildGitCommitHash, buildTime string, orchestrator *pluginkit.EvaluationOrchestrator) *cobra.Command

func ReadConfig

func ReadConfig()

func Run added in v1.12.0

func Run(logger hclog.Logger, getPlugins func() []*PluginPkg) (exitCode int)

Run executes all plugins with handling for the command line

func SetBase

func SetBase(cmd *cobra.Command)

SetBase sets the base flags for all commands

func SetupTemplatingEnvironment added in v1.12.0

func SetupTemplatingEnvironment(logger hclog.Logger) (templatesDir, sourcePath, outputDir, serviceName string, err error)

SetupTemplatingEnvironment validates and sets up the environment for plugin generation

Types

type CatalogData added in v1.12.0

type CatalogData struct {
	layer2.Catalog
	ServiceName             string
	Requirements            []Req
	ApplicabilityCategories []string
	StrippedName            string
}

type Plugin

type Plugin struct{}

func (*Plugin) Start

func (p *Plugin) Start() error

Start will be called by Privateer via gRPC

type PluginError added in v1.11.0

type PluginError struct {
	Plugin string
	Err    error
}

PluginError retains an error object and the name of the pack that generated it

type PluginErrors added in v1.11.0

type PluginErrors struct {
	Errors []PluginError
}

PluginErrors holds a list of errors and an Error() method so it adheres to the standard Error interface

func (*PluginErrors) Error added in v1.11.0

func (e *PluginErrors) Error() string

type PluginPkg added in v1.11.0

type PluginPkg struct {
	Name          string
	Path          string
	ServiceTarget string
	Command       *exec.Cmd
	Result        string

	Available  bool
	Requested  bool
	Successful bool
	Error      error
}

func GetPlugins added in v1.12.0

func GetPlugins() []*PluginPkg

GetPlugins returns a combined list of all plugins (requested and available)

func NewPluginPkg added in v1.11.0

func NewPluginPkg(pluginName string, serviceName string) *PluginPkg

type Req added in v1.12.0

type Req struct {
	Id   string
	Text string
}

type Writer added in v1.12.0

type Writer interface {
	io.Writer
	Flush() error
}

Writer interface for output operations

Jump to

Keyboard shortcuts

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