Documentation
¶
Overview ¶
Package readable renders API values as plain, labeled text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Text ¶
Text escapes terminal controls and directional marks while preserving ordinary newlines and tabs. It adds no newline and does not redact sensitive content.
Types ¶
type StreamEvent ¶ added in v1.22.0
type StreamEvent struct {
Parts []StreamPart
Details gjson.Result
}
StreamEvent carries projected text and any accompanying structured details. An empty event represents progress without visible content.
type StreamPart ¶ added in v1.22.0
StreamPart describes one identified text component. A snapshot contains its complete text so far; other parts append a delta. Labels distinguish alternatives.
type StreamWriter ¶ added in v1.22.0
type StreamWriter struct {
// contains filtered or unexported fields
}
StreamWriter emits text immediately and retains only a digest per component. It never consumes an iterator or chooses which API fields to display.
func NewStreamWriter ¶ added in v1.22.0
func NewStreamWriter(out io.Writer) *StreamWriter
func (*StreamWriter) Finish ¶ added in v1.22.0
func (w *StreamWriter) Finish() error
Finish closes partial text before the caller reports completion or an error.
func (*StreamWriter) HasOutput ¶ added in v1.22.0
func (w *StreamWriter) HasOutput() bool
func (*StreamWriter) Write ¶ added in v1.22.0
func (w *StreamWriter) Write(event StreamEvent) error
func (*StreamWriter) WriteValue ¶ added in v1.22.0
func (w *StreamWriter) WriteValue(value gjson.Result) error
WriteValue preserves unfamiliar or non-text content as ordinary labeled data.