runner

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckOk

func CheckOk() (finally func(), cleanup func(func()))

Types

type Cmd

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

func New

func New(ctx context.Context, cmd CommandArgsEnv) (_ *Cmd, finalErr error)

func (*Cmd) Close

func (cmd *Cmd) Close() error

func (*Cmd) Dial

func (cmd *Cmd) Dial(ctx context.Context, addr *net.TCPAddr) (net.Conn, error)

func (*Cmd) Input

func (cmd *Cmd) Input(in message.Input)

func (*Cmd) Listen

func (cmd *Cmd) Listen(port uint16) (net.Listener, error)

func (*Cmd) Output

func (cmd *Cmd) Output(ctx context.Context) <-chan message.Message

func (*Cmd) Start

func (cmd *Cmd) Start()

func (*Cmd) Wait

func (cmd *Cmd) Wait() <-chan struct{}

type CommandArgs

type CommandArgs interface {
	Command() string
	Args() []string
}

type CommandArgsEnv

type CommandArgsEnv interface {
	CommandArgs
	Environment() []string
}

func NewCommandArgs

func NewCommandArgs(command string, argsEnv ...[]string) CommandArgsEnv

type Output

type Output struct {
	Stdout, Stderr []byte
	Code           int
	Err            error
}

func Run

func Run(ctx context.Context, cmd CommandArgsEnv) (out Output)

func (*Output) Error

func (out *Output) Error() error

Jump to

Keyboard shortcuts

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