jsonout

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedactChanges added in v0.9.0

func RedactChanges(source *changes.BlueprintChanges) *changes.BlueprintChanges

RedactChanges returns a copy of a change set with every value the provider declared sensitive replaced by a placeholder.

func WriteJSON

func WriteJSON(w io.Writer, v any) error

WriteJSON writes a value as pretty-printed JSON to the writer.

Types

type ActionLink struct {
	Title string `json:"title,omitempty"`
	URL   string `json:"url"`
}

ActionLink represents a link to documentation or resources.

type ChangeSummary

type ChangeSummary struct {
	Resources ResourceSummary `json:"resources"`
	Children  ChildSummary    `json:"children"`
	Links     LinkSummary     `json:"links"`
	Exports   ExportSummary   `json:"exports"`
}

ChangeSummary contains summary counts organized by element type.

type ChildSummary

type ChildSummary struct {
	Total  int `json:"total"`
	Create int `json:"create"`
	Update int `json:"update"`
	Delete int `json:"delete"`
}

ChildSummary contains action counts for child blueprints.

type DeployDriftOutput

type DeployDriftOutput struct {
	Success        bool                                 `json:"success"`
	DriftDetected  bool                                 `json:"driftDetected"`
	InstanceID     string                               `json:"instanceId"`
	InstanceName   string                               `json:"instanceName,omitempty"`
	ChangesetID    string                               `json:"changesetId,omitempty"`
	Message        string                               `json:"message"`
	Reconciliation *container.ReconciliationCheckResult `json:"reconciliation"`
}

DeployDriftOutput represents drift detected during deployment.

type DeployOutput

type DeployOutput struct {
	Success          bool                               `json:"success"`
	InstanceID       string                             `json:"instanceId"`
	InstanceName     string                             `json:"instanceName,omitempty"`
	ChangesetID      string                             `json:"changesetId"`
	Status           string                             `json:"status"`
	InstanceState    *state.InstanceState               `json:"instanceState,omitempty"`
	PreRollbackState *container.PreRollbackStateMessage `json:"preRollbackState,omitempty"`
	Summary          DeploySummary                      `json:"summary"`
}

DeployOutput represents a successful deployment result.

type DeploySummary

type DeploySummary struct {
	Successful           int                             `json:"successful"`
	Failed               int                             `json:"failed"`
	Interrupted          int                             `json:"interrupted"`
	SkippedRollbackItems []container.SkippedRollbackItem `json:"skippedRollbackItems,omitempty"`
	Elements             []DeployedElement               `json:"elements"`
}

DeploySummary contains deployment result summary.

type DeployedElement

type DeployedElement struct {
	Name           string   `json:"name"`
	Path           string   `json:"path"`
	Type           string   `json:"type"` // "resource", "child", "link"
	Status         string   `json:"status"`
	Action         string   `json:"action,omitempty"` // "created", "updated", "destroyed", etc.
	FailureReasons []string `json:"failureReasons,omitempty"`
}

DeployedElement represents an element in the deployment.

type DestroyDriftOutput

type DestroyDriftOutput struct {
	Success        bool                                 `json:"success"`
	DriftDetected  bool                                 `json:"driftDetected"`
	InstanceID     string                               `json:"instanceId"`
	InstanceName   string                               `json:"instanceName,omitempty"`
	Message        string                               `json:"message"`
	Reconciliation *container.ReconciliationCheckResult `json:"reconciliation"`
}

DestroyDriftOutput represents drift detected during destroy.

type DestroyOutput

type DestroyOutput struct {
	Success         bool                 `json:"success"`
	InstanceID      string               `json:"instanceId"`
	InstanceName    string               `json:"instanceName,omitempty"`
	ChangesetID     string               `json:"changesetId"`
	Status          string               `json:"status"`
	InstanceState   *state.InstanceState `json:"instanceState,omitempty"`
	PreDestroyState *state.InstanceState `json:"preDestroyState,omitempty"`
	Summary         DestroySummary       `json:"summary"`
}

DestroyOutput represents a successful destroy result.

type DestroySummary

type DestroySummary struct {
	Destroyed     int                `json:"destroyed"`
	Failed        int                `json:"failed"`
	Interrupted   int                `json:"interrupted"`
	RetainedCount int                `json:"retainedCount"`
	Elements      []DestroyedElement `json:"elements"`
}

DestroySummary contains destroy operation summary.

type DestroyedElement

type DestroyedElement struct {
	Name           string   `json:"name"`
	Path           string   `json:"path"`
	Type           string   `json:"type"`   // "resource", "child", "link"
	Status         string   `json:"status"` // "destroyed", "failed", "interrupted", or "retained"
	FailureReasons []string `json:"failureReasons,omitempty"`
}

DestroyedElement represents an element in the destroy result.

type Diagnostic

type Diagnostic struct {
	Level            string            `json:"level"`
	Message          string            `json:"message"`
	Line             int               `json:"line,omitempty"`
	Column           int               `json:"column,omitempty"`
	Code             string            `json:"code,omitempty"`
	Category         string            `json:"category,omitempty"`
	SuggestedActions []SuggestedAction `json:"suggestedActions,omitempty"`
}

Diagnostic represents a single diagnostic message.

type ErrorDetail

type ErrorDetail struct {
	Type        string            `json:"type"` // "validation", "stream", "client", "internal"
	Message     string            `json:"message"`
	Hint        string            `json:"hint,omitempty"`
	Cause       string            `json:"cause,omitempty"`
	StatusCode  int               `json:"statusCode,omitempty"`
	Diagnostics []Diagnostic      `json:"diagnostics,omitempty"`
	Validation  []ValidationError `json:"validation,omitempty"`
}

ErrorDetail provides detailed error information.

type ErrorOutput

type ErrorOutput struct {
	Success bool        `json:"success"`
	Error   ErrorDetail `json:"error"`
}

ErrorOutput represents a structured error output.

func NewErrorOutput

func NewErrorOutput(err error) ErrorOutput

NewErrorOutput converts an error to an ErrorOutput struct.

type ExportSummary

type ExportSummary struct {
	Total     int `json:"total"`
	New       int `json:"new"`
	Modified  int `json:"modified"`
	Removed   int `json:"removed"`
	Unchanged int `json:"unchanged"`
}

ExportSummary contains action counts for exports.

type LinkSummary

type LinkSummary struct {
	Total  int `json:"total"`
	Create int `json:"create"`
	Update int `json:"update"`
	Delete int `json:"delete"`
}

LinkSummary contains action counts for links.

type ListInstanceItem

type ListInstanceItem struct {
	InstanceID            string `json:"instanceId"`
	InstanceName          string `json:"instanceName"`
	Status                string `json:"status"`
	LastDeployedTimestamp int64  `json:"lastDeployedTimestamp"`
}

ListInstanceItem represents a single instance in the list output.

type ListInstancesOutput

type ListInstancesOutput struct {
	Success    bool               `json:"success"`
	Instances  []ListInstanceItem `json:"instances"`
	TotalCount int                `json:"totalCount"`
	Search     string             `json:"search,omitempty"`
}

ListInstancesOutput represents the result of listing instances.

type ResourceSummary

type ResourceSummary struct {
	Total    int `json:"total"`
	Create   int `json:"create"`
	Update   int `json:"update"`
	Delete   int `json:"delete"`
	Recreate int `json:"recreate"`
}

ResourceSummary contains action counts for resources.

type StageDriftOutput

type StageDriftOutput struct {
	Success        bool                                 `json:"success"`
	DriftDetected  bool                                 `json:"driftDetected"`
	InstanceID     string                               `json:"instanceId"`
	InstanceName   string                               `json:"instanceName,omitempty"`
	Message        string                               `json:"message"`
	Reconciliation *container.ReconciliationCheckResult `json:"reconciliation"`
}

StageDriftOutput represents drift detected during staging.

type StageOutput

type StageOutput struct {
	Success      bool                      `json:"success"`
	ChangesetID  string                    `json:"changesetId"`
	InstanceID   string                    `json:"instanceId,omitempty"`
	InstanceName string                    `json:"instanceName,omitempty"`
	Changes      *changes.BlueprintChanges `json:"changes"`
	Summary      ChangeSummary             `json:"summary"`
}

StageOutput represents a successful staging result.

type StateImportOutput

type StateImportOutput struct {
	Success        bool   `json:"success"`
	Mode           string `json:"mode"`
	InstancesCount int    `json:"instancesCount,omitempty"`
	FilesExtracted int    `json:"filesExtracted,omitempty"`
	Message        string `json:"message"`
	Encrypted      bool   `json:"encrypted,omitempty"`
	// FileExportedAt is when an encrypted input file was exported, in RFC 3339 form.
	FileExportedAt string   `json:"fileExportedAt,omitempty"`
	Warnings       []string `json:"warnings,omitempty"`
}

StateImportOutput represents a state import result.

type SuggestedAction

type SuggestedAction struct {
	Type        string       `json:"type"`
	Title       string       `json:"title"`
	Description string       `json:"description,omitempty"`
	Commands    []string     `json:"commands,omitempty"`
	Links       []ActionLink `json:"links,omitempty"`
}

SuggestedAction represents an actionable suggestion for resolving an error.

type ValidationError

type ValidationError struct {
	Location string `json:"location"`
	Message  string `json:"message"`
	Type     string `json:"type,omitempty"`
}

ValidationError represents a single validation error.

Jump to

Keyboard shortcuts

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