subprocessmanager

package
v0.82.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCommand added in v0.41.0

func ExecCommand(commandLine string) (*exec.Cmd, error)

Non-Windows version of exec.Command(...) Compiles on all but Windows

Types

type EnvConfig

type EnvConfig struct {
	// Name is the name of the environment variable
	Name string `mapstructure:"name"`
	// Value is the value of the variable
	Value string `mapstructure:"value"`
}

EnvConfig is the config definition of each key-value pair for environment variables

type SubprocessConfig

type SubprocessConfig struct {
	// Command is the command to be run (binary + flags, separated by commas)
	Command string `mapstructure:"exec"`
	// Env is a list of env variables to pass to a specific command
	Env []EnvConfig `mapstructure:"env"`
}

SubprocessConfig is the config definition for the subprocess manager

func (*SubprocessConfig) Run

func (proc *SubprocessConfig) Run(ctx context.Context, logger *zap.Logger) (time.Duration, error)

Run will start the process and keep track of running time

Jump to

Keyboard shortcuts

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