catp

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(command []string, streamIn io.Reader, streamOut io.Writer, captureStderr io.Writer) error

Start create a catp chain and start it.

Types

type Chain

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

func New

func New() Chain

New build a new catp chain.

func (*Chain) Add

func (c *Chain) Add(pipe Pipe)

func (*Chain) Run

func (c *Chain) Run(input io.Reader, output io.Writer) (result error)

type Pipe

type Pipe interface {
	Configure(input io.Reader, output io.Writer, doneHandler func(), errorHandler func(error)) io.Reader
	Start()
}

Pipe stream data from input to output.

type ProcessConfiguration

type ProcessConfiguration struct {
	Command []string
	Stderr  io.Writer
}

ProcessConfiguration is the process execute by catp.

type ProcessPipe

type ProcessPipe struct {
	SimplePipe
	ProcessConfiguration
}

func NewProcessPipe

func NewProcessPipe(configuration ProcessConfiguration) *ProcessPipe

func (*ProcessPipe) Start

func (p *ProcessPipe) Start()

type SimplePipe

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

func (*SimplePipe) Configure

func (p *SimplePipe) Configure(
	input io.Reader, output io.Writer,
	doneHandler func(),
	errorHandler func(error)) io.Reader

func (*SimplePipe) Start

func (p *SimplePipe) Start()

Start a goroutine to copy data from input to output.

Jump to

Keyboard shortcuts

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