parser

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandInfo added in v1.0.1

type CommandInfo interface {
	String() string
}

CommandInfo defines the minimal interface that identifies a Command.

type Parser

type Parser interface {
	Parse(rawResult *RawResult, dst any) error
}

Parser converts a RawResult into a user-defined value

type RawResult

type RawResult struct {
	CmdPtr   CommandInfo   // command.Command pointer
	Stdout   string        // collected standard output
	Stderr   string        // collected standard error
	ExitCode int           // process exit code
	Duration time.Duration // time taken to run the command
	Err      error         // any error from execution or parsing
}

RawResult holds the outcome of running a command

func NewRawResult

func NewRawResult(cmdPtr CommandInfo) *RawResult

NewRawResult initializes a RawResult for the given shell command

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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