processor

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StartContentOperation tells the processor to begin streaming content.
	StartContentOperation = iota
	// StartGroupsOperation tells the processor to begin streaming groups.
	StartGroupsOperation
	// StopOperation tells the processor to shut down all spawned children,
	// contexts, and pipes.
	StopOperation
)

Variables

This section is empty.

Functions

func Run

func Run(program *tea.Program)

Run runs the processor for the given tea.Program. It first creates a command channel and then sends that channel to the program via a CommandChannel message. It then listens on that channel for commands.

Types

type Command

type Command struct {
	Operation Operation
	Selector  string
	Format    string
	Group     string
	Path      string
}

Command contains the description of a command the processor will execute.

type CommandChannel

type CommandChannel struct {
	CmdChan chan<- Command
}

CommandChannel is a tea.Msg that conveys the channel the processor will be listening on for commands.

type ContentError

type ContentError struct {
	Message string
	Err     error
	Jq      string
}

ContentError is a tea.Msg that conveys an error that occurred when looking for content.

type ContentLine

type ContentLine struct {
	Line string
}

ContentLine is a tea.Msg that conveys a line of content read by the processor.

type ContentStart

type ContentStart struct {
	InitialContent []string
}

ContentStart is a tea.Msg that indicates the processor is (re)starting a read for content.

type ContentStopped added in v1.0.5

type ContentStopped struct {
}

ContentStopped is a tea.Msg that indicates the processor has stopped. All child processes are killed, contexts are cancled, and pipes are closed.

type GroupsError added in v1.0.5

type GroupsError struct {
	Message string
	Err     error
	Jq      string
}

GroupsError is a tea.Msg that conveys an error that occurred when looking for groups.

type GroupsLine added in v1.0.5

type GroupsLine struct {
	Line string
}

GroupsLine is a tea.Msg that conveys a group read by the processor.

type GroupsStart

type GroupsStart struct {
	InitialGroups []string
}

GroupsStart is a tea.Msg that indicates the processor is (re)starting a read for groups.

type GroupsStopped added in v1.0.5

type GroupsStopped struct {
}

GroupsStopped is a tea.Msg that indicates the processor has stopped. All child processes are killed, contexts are cancled, and pipes are closed.

type JQCommand

type JQCommand struct {
	Jq string
}

JQCommand is a tea.Msg that conveys the equivalent jq command that would produce the content reported by the processor.

type Operation

type Operation int

Operation defines the operations the processor can handle.

Jump to

Keyboard shortcuts

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