mpipe

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: MIT Imports: 7 Imported by: 0

README

Small wrapper around os/exec package to offer some qol improvements for piping commands with custom behaviour


Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mpipe

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

func Command

func Command(name string, args ...string) *Mpipe

func CommandContext

func CommandContext(ctx context.Context, name string, args ...string) *Mpipe

func CommandContextWithOptions

func CommandContextWithOptions(ctx context.Context, opts []MpipeOptions, name string, args ...string) *Mpipe

func CommandWithOptions

func CommandWithOptions(opts []MpipeOptions, name string, args ...string) *Mpipe

func (*Mpipe) Run

func (m *Mpipe) Run() error

func (*Mpipe) Start

func (m *Mpipe) Start() error

func (*Mpipe) String

func (m *Mpipe) String() string

func (*Mpipe) Wait

func (m *Mpipe) Wait() error

type MpipeOptions

type MpipeOptions func(*Mpipe)

func WithStderrTransformer

func WithStderrTransformer(t Transformer) MpipeOptions

func WithStdinTransformer

func WithStdinTransformer(t Transformer) MpipeOptions

func WithStdoutTransformer

func WithStdoutTransformer(t Transformer) MpipeOptions

type Transformer

type Transformer func(string) string
var NoTransform Transformer = func(s string) string {
	return s
}

Jump to

Keyboard shortcuts

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