input

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InputSource

type InputSource interface {
	Lines() <-chan RawLine
	Stop()
	ExitCode() int
}

InputSource produces lines and signals EOF by closing the channel.

type PipeSource

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

PipeSource reads lines from stdin (or any reader).

func NewPipeSource

func NewPipeSource() *PipeSource

NewPipeSource creates a PipeSource reading from os.Stdin.

func NewPipeSourceFromReader

func NewPipeSourceFromReader(r io.Reader) *PipeSource

NewPipeSourceFromReader creates a PipeSource reading from the given reader.

func (*PipeSource) ExitCode

func (p *PipeSource) ExitCode() int

func (*PipeSource) Lines

func (p *PipeSource) Lines() <-chan RawLine

func (*PipeSource) Stop

func (p *PipeSource) Stop()

type RawLine

type RawLine struct {
	Text   string
	Source Source
}

RawLine carries a line of text plus metadata about where it came from.

type Source

type Source int

Source indicates the origin of a line.

const (
	SourceStdin  Source = iota // pipe mode
	SourceStdout               // wrapper mode — child's stdout
	SourceStderr               // wrapper mode — child's stderr
)

type WrapperSource

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

WrapperSource spawns a subprocess and reads its stdout/stderr.

func NewWrapperSource

func NewWrapperSource(args []string) (*WrapperSource, error)

NewWrapperSource spawns the given command and captures its output.

func (*WrapperSource) ExitCode

func (w *WrapperSource) ExitCode() int

func (*WrapperSource) Lines

func (w *WrapperSource) Lines() <-chan RawLine

func (*WrapperSource) Stop

func (w *WrapperSource) Stop()

Jump to

Keyboard shortcuts

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