command

package
v0.0.0-...-a954c3e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI interface {
	RunCommand(context.Context, map[string]string, int, string, string, ...string) (int, error)
	RunCommandWithStdOut(context.Context, map[string]string, int, string, string, ...string) (int, []string, error)
	RunCommandWithStdErr(context.Context, map[string]string, int, string, string, ...string) (int, []string, error)
	RunCommandWithStdOutStdErr(context.Context, map[string]string, int, string, string, ...string) (int, []string, []string, error)
}

CLI interface contains the ways in which one can trigger commands from command line

func New

func New() CLI

New returns an instance of Pf9Cmd

type Pf9Cmd

type Pf9Cmd struct{}

Pf9Cmd represents an encapsulated command object with bells and whistles

func (*Pf9Cmd) RunCommand

func (c *Pf9Cmd) RunCommand(ctx context.Context, env map[string]string, timeout int, cwd, path string, args ...string) (int, error)

RunCommand runs a command

func (*Pf9Cmd) RunCommandWithStdErr

func (c *Pf9Cmd) RunCommandWithStdErr(ctx context.Context, env map[string]string, timeout int,
	cwd, path string, args ...string) (int, []string, error)

RunCommandWithStdErr runs a command and prints all the contents from STDERR

func (*Pf9Cmd) RunCommandWithStdOut

func (c *Pf9Cmd) RunCommandWithStdOut(ctx context.Context, env map[string]string, timeout int,
	cwd, path string, args ...string) (int, []string, error)

RunCommandWithStdOut runs a command and prints all the contents from STDOUT

func (*Pf9Cmd) RunCommandWithStdOutStdErr

func (c *Pf9Cmd) RunCommandWithStdOutStdErr(ctx context.Context, env map[string]string, timeout int,
	cwd, path string, args ...string) (int, []string, []string, error)

RunCommandWithStdOutStdErr runs a command and prints all the contents from STDOUT and STDERR together

type ServiceUtil

type ServiceUtil interface {
	RunAction(ctx context.Context, action string) ([]string, error)
}

func NewServiceUtil

func NewServiceUtil(name string) ServiceUtil

type ServiceUtility

type ServiceUtility struct {
	ServiceName string
	// contains filtered or unexported fields
}

func (*ServiceUtility) RunAction

func (su *ServiceUtility) RunAction(ctx context.Context, action string) ([]string, error)

Jump to

Keyboard shortcuts

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