Documentation
¶
Overview ¶
Package output provides output formatting for the OmniVault CLI.
Index ¶
- func FormatListItem(item *daemon.SecretListItem, showFullTags bool) string
- func ShellExport(key, value string) string
- func ShellQuote(s string) string
- func ShellSafeKey(s string) string
- type Format
- type Writer
- func (w *Writer) Format() Format
- func (w *Writer) WriteList(resp *daemon.ListResponse, showMetadata bool) error
- func (w *Writer) WriteSearch(resp *daemon.SearchResponse) error
- func (w *Writer) WriteSecret(secret *daemon.SecretResponse, fieldName string) error
- func (w *Writer) WriteStatus(status *daemon.StatusResponse, daemonRunning bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatListItem ¶
func FormatListItem(item *daemon.SecretListItem, showFullTags bool) string
FormatListItem formats a secret list item as a string.
func ShellExport ¶
ShellExport formats a key-value pair as a shell export statement.
func ShellQuote ¶
ShellQuote quotes a string for safe shell use. Uses single quotes with proper escaping of embedded single quotes.
func ShellSafeKey ¶
ShellSafeKey converts a string to a safe shell variable name. - Replaces non-alphanumeric characters with underscores - Prepends underscore if string starts with a digit - Converts to uppercase
Types ¶
type Format ¶
type Format int
Format represents the output format type.
func ParseFormat ¶
ParseFormat parses a format string into a Format. Returns FormatText for unrecognized formats.
func (Format) IsStructured ¶
IsStructured returns true if the format outputs structured data (JSON/YAML).
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer writes formatted output.
func NewWriterWithOutput ¶
NewWriterWithOutput creates a new Writer with a custom output destination.
func (*Writer) WriteList ¶
func (w *Writer) WriteList(resp *daemon.ListResponse, showMetadata bool) error
WriteList writes a list response in the configured format.
func (*Writer) WriteSearch ¶
func (w *Writer) WriteSearch(resp *daemon.SearchResponse) error
WriteSearch writes a search response in the configured format.
func (*Writer) WriteSecret ¶
func (w *Writer) WriteSecret(secret *daemon.SecretResponse, fieldName string) error
WriteSecret writes a secret in the configured format. If fieldName is non-empty, only that field is output.
func (*Writer) WriteStatus ¶
func (w *Writer) WriteStatus(status *daemon.StatusResponse, daemonRunning bool) error
WriteStatus writes a status response in the configured format.