mpipe

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 5 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 CommandWithOptions

func CommandWithOptions(cmd *exec.Cmd, opts ...MpipeOptions) *Mpipe

func (*Mpipe) Cancel added in v0.1.4

func (m *Mpipe) Cancel() bool

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([]byte) []byte
var NoTransform Transformer = func(b []byte) []byte {
	return b
}

Jump to

Keyboard shortcuts

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