Documentation
¶
Index ¶
- func InitWriter(ioCtx io.Context)
- func Markdown(content string) error
- func MarkdownNoWrap(content string) error
- func MarkdownNoWrapf(format string, a ...interface{}) error
- func Markdownf(format string, a ...interface{}) error
- func Reset()
- func SetMarkdownRenderer(renderer MarkdownRenderer)
- func Write(content string) error
- func WriteJSON(v interface{}) error
- func WriteUnmasked(content string) error
- func WriteUnmaskedf(format string, a ...interface{}) error
- func WriteYAML(v interface{}) error
- func Writef(format string, a ...interface{}) error
- func Writeln(content string) error
- type MarkdownRenderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitWriter ¶
InitWriter initializes the global data writer with an I/O context. This should be called once at application startup (in root.go).
func Markdown ¶
Markdown renders markdown content and writes to the data channel (stdout). Use this for help text, documentation, and other pipeable formatted content. Flow: data.Markdown() → MarkdownRenderer.Markdown() → io.Write(DataStream) → masking → stdout.
func MarkdownNoWrap ¶ added in v1.223.0
MarkdownNoWrap renders markdown content without word-wrapping and writes to the data channel (stdout). Use this instead of Markdown for content with long inline tokens (URLs) that word-wrap can otherwise hard-break mid-token when they don't fit the wrap width. Falls back to Markdown if the registered renderer doesn't support no-wrap rendering.
func MarkdownNoWrapf ¶ added in v1.223.0
MarkdownNoWrapf renders formatted markdown content without word-wrapping and writes to the data channel (stdout). See MarkdownNoWrap.
func Markdownf ¶
Markdownf renders formatted markdown content and writes to the data channel (stdout). Flow: data.Markdownf() → data.Markdown() → io.Write(DataStream) → masking → stdout.
func Reset ¶ added in v1.203.0
func Reset()
Reset clears the global I/O context and markdown renderer. This is primarily used in tests to ensure clean state between test executions.
func SetMarkdownRenderer ¶
func SetMarkdownRenderer(renderer MarkdownRenderer)
SetMarkdownRenderer sets the markdown renderer for data.Markdown(). This should be called after ui.InitFormatter() in root.go.
func Write ¶
Write writes content to the data channel (stdout). Flow: data.Write() → io.Write(DataStream) → masking → stdout.
func WriteJSON ¶
func WriteJSON(v interface{}) error
WriteJSON marshals v to JSON and writes to the data channel (stdout). Flow: data.WriteJSON() → io.Write(DataStream) → masking → stdout.
func WriteUnmasked ¶ added in v1.223.0
WriteUnmasked writes content to the data channel (stdout) WITHOUT secret masking.
Escape hatch for the narrow case where a user explicitly requested unmasked output containing their own resolved credentials for consumption by another program (e.g. `atmos auth env` emitting `export AWS_SECRET_ACCESS_KEY='...'` for `eval $(...)`). Routing that through Write() would mask the exact values the user asked for, silently breaking the feature.
Still resolves through the same dynamic stdout accessor as Write() (test output-capture via os.Stdout redirection keeps working) and still feeds --cast/session recording via io.RecordMaskedOutput — it only skips the masker.
Only use this when BOTH are true: (1) content is exactly what the user explicitly asked to receive unmasked, and (2) masking it would make the output unusable for its stated purpose (shell eval, etc). For everything else, use Write.
func WriteUnmaskedf ¶ added in v1.223.0
WriteUnmaskedf writes formatted content to the data channel (stdout) WITHOUT secret masking. See WriteUnmasked for when this is (and is not) appropriate to use.
func WriteYAML ¶
func WriteYAML(v interface{}) error
WriteYAML marshals v to YAML and writes to the data channel (stdout). Flow: data.WriteYAML() → io.Write(DataStream) → masking → stdout.
Types ¶
type MarkdownRenderer ¶
MarkdownRenderer is the interface for rendering markdown. This avoids circular dependency with pkg/ui.