stream

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package stream parses stdin for XML context-update tags and dispatches them for processing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractAttribute

func ExtractAttribute(tag, attrName string) string

ExtractAttribute extracts a named attribute from an XML tag string.

Parameters:

  • tag: XML tag string to search (e.g., `<context-update type="task">`)
  • attrName: Attribute name to extract (e.g., "type")

Returns:

  • string: Attribute value, or empty string if not found

func ProcessStream

func ProcessStream(cmd *cobra.Command, reader io.Reader, dryRun bool) error

ProcessStream reads from a stream and applies context updates.

Scans input line-by-line looking for <context-update> XML tags. When found, parses the type and content, then either displays what would happen (dry-run) or applies the update.

Parameters:

  • cmd: Cobra command for output
  • reader: Input stream to scan (stdin or log file)
  • dryRun: If true, show what would happen without applying

Returns:

  • error: Non-nil if a read error occurs

Types

This section is empty.

Jump to

Keyboard shortcuts

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