output

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlignResult

type AlignResult struct {
	Success        bool
	DriftDetected  bool
	ActionsApplied int
	Resources      []ResourceStatus
	Duration       time.Duration
	Error          error
}

AlignResult represents the result of an align operation

type BootstrapResult

type BootstrapResult struct {
	Success            bool
	ProvidersInstalled []string
	ResourceCount      int
	ModulesLoaded      int
	PolicyViolations   []policy.PolicyViolation
	Duration           time.Duration
	Error              error
}

BootstrapResult represents the result of a bootstrap operation

type Change

type Change struct {
	Type         string // create, update, delete
	ResourceKind string
	ResourceName string
	Description  string
}

Change represents a planned infrastructure change

type CommitResult

type CommitResult struct {
	Success          bool
	ResourcesApplied int
	ExecutionLevels  []ExecutionLevel
	TotalDuration    time.Duration
	Error            error
}

CommitResult represents the result of a commit operation

type DriftResult

type DriftResult struct {
	ResourceName string
	HasDrift     bool
	Changes      []string
}

DriftResult represents drift detection results for a resource

type ExecutionLevel

type ExecutionLevel struct {
	Level     int
	Resources []string
	Duration  time.Duration
}

ExecutionLevel represents a level in the DAG execution

type Formatter

type Formatter interface {
	FormatBootstrapResult(result BootstrapResult) (string, error)
	FormatPreviewResult(result PreviewResult) (string, error)
	FormatCommitResult(result CommitResult) (string, error)
	FormatAlignResult(result AlignResult) (string, error)
}

Formatter defines the interface for output formatters

func NewFormatter

func NewFormatter(format OutputFormat) Formatter

NewFormatter creates a new formatter based on the specified format

type HumanFormatter

type HumanFormatter struct{}

HumanFormatter implements the Formatter interface for human-readable output

func NewHumanFormatter

func NewHumanFormatter() *HumanFormatter

NewHumanFormatter creates a new human-readable formatter

func (*HumanFormatter) FormatAlignResult

func (f *HumanFormatter) FormatAlignResult(result AlignResult) (string, error)

FormatAlignResult formats an align result for human reading

func (*HumanFormatter) FormatBootstrapResult

func (f *HumanFormatter) FormatBootstrapResult(result BootstrapResult) (string, error)

FormatBootstrapResult formats a bootstrap result for human reading

func (*HumanFormatter) FormatCommitResult

func (f *HumanFormatter) FormatCommitResult(result CommitResult) (string, error)

FormatCommitResult formats a commit result for human reading

func (*HumanFormatter) FormatPreviewResult

func (f *HumanFormatter) FormatPreviewResult(result PreviewResult) (string, error)

FormatPreviewResult formats a preview result for human reading

type JSONFormatter

type JSONFormatter struct{}

JSONFormatter implements the Formatter interface for JSON output

func NewJSONFormatter

func NewJSONFormatter() *JSONFormatter

NewJSONFormatter creates a new JSON formatter

func (*JSONFormatter) FormatAlignResult

func (f *JSONFormatter) FormatAlignResult(result AlignResult) (string, error)

FormatAlignResult formats an align result as JSON

func (*JSONFormatter) FormatBootstrapResult

func (f *JSONFormatter) FormatBootstrapResult(result BootstrapResult) (string, error)

FormatBootstrapResult formats a bootstrap result as JSON

func (*JSONFormatter) FormatCommitResult

func (f *JSONFormatter) FormatCommitResult(result CommitResult) (string, error)

FormatCommitResult formats a commit result as JSON

func (*JSONFormatter) FormatPreviewResult

func (f *JSONFormatter) FormatPreviewResult(result PreviewResult) (string, error)

FormatPreviewResult formats a preview result as JSON

type MarkdownFormatter

type MarkdownFormatter struct{}

MarkdownFormatter implements the Formatter interface for Markdown output

func NewMarkdownFormatter

func NewMarkdownFormatter() *MarkdownFormatter

NewMarkdownFormatter creates a new Markdown formatter

func (*MarkdownFormatter) FormatAlignResult

func (f *MarkdownFormatter) FormatAlignResult(result AlignResult) (string, error)

FormatAlignResult formats an align result as Markdown

func (*MarkdownFormatter) FormatBootstrapResult

func (f *MarkdownFormatter) FormatBootstrapResult(result BootstrapResult) (string, error)

FormatBootstrapResult formats a bootstrap result as Markdown

func (*MarkdownFormatter) FormatCommitResult

func (f *MarkdownFormatter) FormatCommitResult(result CommitResult) (string, error)

FormatCommitResult formats a commit result as Markdown

func (*MarkdownFormatter) FormatPreviewResult

func (f *MarkdownFormatter) FormatPreviewResult(result PreviewResult) (string, error)

FormatPreviewResult formats a preview result as Markdown

type OutputFormat

type OutputFormat string

OutputFormat represents the supported output formats

const (
	FormatHuman    OutputFormat = "human"
	FormatJSON     OutputFormat = "json"
	FormatMarkdown OutputFormat = "markdown"
)

type PreviewResult

type PreviewResult struct {
	Success      bool
	ChangesCount int
	Changes      []Change
	DriftResults []DriftResult
	Duration     time.Duration
	Error        error
}

PreviewResult represents the result of a preview operation

type ResourceStatus

type ResourceStatus struct {
	Name     string
	Status   string // aligned, drifted, healed, error
	Changes  []string
	Duration time.Duration
}

ResourceStatus represents the status of a resource during alignment

Jump to

Keyboard shortcuts

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