Versions in this module Expand all Collapse all v0 v0.0.2 Feb 2, 2025 v0.0.1 Jan 22, 2025 Changes in this version + type BaseMessage struct + Kind JSONString[K] + Time time.Time + func NewBaseMessage[K fmt.Stringer]() BaseMessage[K] + type Cmd struct + func New(ctx context.Context, cmd CommandArgs) (_ *Cmd, finalErr error) + func (cmd *Cmd) Close() error + func (cmd *Cmd) CloseTimeout(timeout time.Duration) error + func (cmd *Cmd) Done() <-chan struct{} + func (cmd *Cmd) Listen(ctx context.Context) <-chan Message + func (cmd *Cmd) Push(in ...Input) + func (cmd *Cmd) Start() + type Command interface + Command func() string + func NewCommand(command string) Command + type CommandArgs interface + Args func() []string + func NewCommandArgs(command string, args []string) CommandArgs + type CommandArgsEnv interface + Environment func() []string + func NewCommandArgsEnv(command string, args, env []string) CommandArgsEnv + type CommandEnv interface + Environment func() []string + func NewCommandEnv(command string, env []string) CommandEnv + func WithEnv(cmd Command, env []string) CommandEnv + type Data []byte + func (d *Data) UnmarshalJSON(b []byte) error + func (d Data) MarshalJSON() ([]byte, error) + type DataLike interface + type ErrExitCode int + func (err ErrExitCode) Error() string + type ExitMessage struct + Code int + type Input interface + Input func() []byte + func NewInput[D DataLike](data D) Input + func NewInputf(format string, a ...any) Input + func NewInputln[D DataLike](data D) Input + type JSONString struct + func (JSONString[S]) String() string + func (js *JSONString[S]) UnmarshalJSON(b []byte) error + func (js JSONString[S]) MarshalJSON() ([]byte, error) + type Message interface + func NewExitMessage(code int) Message + func NewStartMessage() Message + func NewStdioMessage[T StdioLike, D DataLike](data D) Message + type Output struct + func Run(ctx context.Context, cmd Command, stdin []byte) (out Output) + func (out *Output) Code() int + func (out *Output) Err() error + func (out *Output) Stderr() []byte + func (out *Output) Stdout() []byte + type StartMessage struct + type StderrMessage = stdioMessage[kind[stderr]] + type StdinMessage = stdioMessage[kind[stdin]] + type StdioLike interface + type StdoutMessage = stdioMessage[kind[stdout]] + type TextInput struct + Data Data + func (ti TextInput) Input() []byte