commands

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUpgradeVersion

func CheckUpgradeVersion(ctx context.Context, force bool) string

CheckUpgradeVersion ...

func CommandLocator

func CommandLocator(ctx context.Context) []*cli.Command

CommandLocator builds a sorted slice of built-in and installed commands

func UpgradeCli

func UpgradeCli(ctx context.Context, latestVersion string) bool

UpgradeCli pulls from GitHub the latest released CLI binary and performs the upgrade of the current executable

Types

type CLI added in v1.6.0

type CLI struct {
	CommandList []CommandObject `json:"commands"`
}

CLI struct represents an individual command object in package-list.json

type Cmd added in v1.4.1

type Cmd interface {
	Run() error
}

Cmd is a wrapper for exec.Cmd methods

type Command added in v1.4.1

type Command struct {
	// contains filtered or unexported fields
}

Command represents an external command being prepared or run

func (*Command) Run added in v1.4.1

func (c *Command) Run() error

Run starts the command and waits for it to complete

type CommandObject added in v1.6.0

type CommandObject struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Description string `json:"description"`
}

CommandObject contains details for particular command

type MockCmd added in v1.4.1

type MockCmd struct {
	mock.Mock
}

MockCmd is used to track activity on command.Command

func (*MockCmd) Run added in v1.4.1

func (c *MockCmd) Run() error

Run mimics the behavior of (*Command) Run()

func (*MockCmd) String added in v1.4.1

func (c *MockCmd) String() string

String mimics the behavior or (*Command) String()

Jump to

Keyboard shortcuts

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