output

package
v1.0.0-rc.11 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: EPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatConfigMutationOutput

func FormatConfigMutationOutput(setMap, before, patchResult map[string]any) string

FormatConfigMutationOutput renders accepted/rejected config key changes.

func FormatConfigPatchResult

func FormatConfigPatchResult(result map[string]any) string

FormatConfigPatchResult renders PATCH /v1/system/config output.

func FormatEdgeletAPIErrorMessage

func FormatEdgeletAPIErrorMessage(code, serverMessage string) string

FormatEdgeletAPIErrorMessage maps stable EdgeletAPI error codes to operator-facing CLI text.

func FormatEdgeletAPIHuman

func FormatEdgeletAPIHuman(routePath string, result map[string]any) string

FormatEdgeletAPIHuman renders human-readable output for a EdgeletAPI v1 route payload.

func FormatLogEntries

func FormatLogEntries(result map[string]any, timestamps bool) string

FormatLogEntries renders buffered log entries for human output.

func FormatProvisionSuccess

func FormatProvisionSuccess(agentUUID string) string

FormatProvisionSuccess renders provision completion output.

func FormatRegistryInspect

func FormatRegistryInspect(result map[string]any, passwordPlain bool) string

FormatRegistryInspect renders registry inspect human output.

func FormatSwitchResult

func FormatSwitchResult(result map[string]any) string

FormatSwitchResult renders profile switch output.

func FormatVersionHuman

func FormatVersionHuman(cliVersion, cliBuildTime, cliGitCommit string, daemon map[string]any, daemonErr error) string

FormatVersionHuman renders combined CLI + daemon version text.

func MapValueAsRawString

func MapValueAsRawString(input map[string]any, key string) string

MapValueAsRawString extracts a raw string without unknown placeholders.

func MapValueAsString

func MapValueAsString(input map[string]any, key string) string

MapValueAsString extracts a display string from an API map value.

func ValueOrDefault

func ValueOrDefault(value, fallback string) string

ValueOrDefault returns value unless empty or unknown.

func WriteStreamLogLine

func WriteStreamLogLine(w io.Writer, ts, line string, timestamps bool)

WriteStreamLogLine writes one log line preserving Docker-style spacing.

Types

type Format

type Format string

Format selects CLI data encoding.

const (
	FormatHuman Format = "human"
	FormatJSON  Format = "json"
	FormatYAML  Format = "yaml"
)

func ParseFormat

func ParseFormat(raw string) (Format, error)

ParseFormat normalizes a format flag value.

func (Format) IsStructured

func (f Format) IsStructured() bool

IsStructured reports whether output goes to stdout as machine-readable data only.

type Formatter

type Formatter interface {
	Format(v any) ([]byte, error)
}

Formatter encodes command data for stdout.

func NewFormatter

func NewFormatter(format Format) (Formatter, error)

NewFormatter returns a formatter for the requested output mode.

type HumanFormatter

type HumanFormatter struct{}

HumanFormatter renders simple human-readable key-value or scalar output.

func (HumanFormatter) Format

func (HumanFormatter) Format(v any) ([]byte, error)

type JSONFormatter

type JSONFormatter struct {
	Indent string
}

JSONFormatter renders JSON to stdout.

func (JSONFormatter) Format

func (f JSONFormatter) Format(v any) ([]byte, error)

type VersionCLI

type VersionCLI struct {
	Version   string `json:"version"`
	BuildTime string `json:"buildTime"`
	GitCommit string `json:"gitCommit"`
}

VersionCLI holds CLI build metadata.

type VersionPayload

type VersionPayload struct {
	CLI    VersionCLI     `json:"cli"`
	Daemon map[string]any `json:"daemon,omitempty"`
}

VersionPayload is the combined CLI + daemon version object for structured output.

func BuildVersionPayload

func BuildVersionPayload(cliVersion, cliBuildTime, cliGitCommit string, daemon map[string]any, daemonErr error) VersionPayload

BuildVersionPayload assembles version data from CLI build info and daemon API response.

type YAMLFormatter

type YAMLFormatter struct{}

YAMLFormatter renders YAML to stdout.

func (YAMLFormatter) Format

func (YAMLFormatter) Format(v any) ([]byte, error)

Jump to

Keyboard shortcuts

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