Help us shape the future of Go! Take the 2026 Go Developer Survey

state

package
v0.19.1256 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsMap

func AsMap(i any) (map[string]any, error)

func NewSecretsState

func NewSecretsState() outputs.SyncSecretsOutput

Types

type AWSCloudAccount

type AWSCloudAccount struct {
	Region string `json:"region"`
}

type ActionWorkflowState

type ActionWorkflowState struct {
	Populated bool `json:"populated"`

	Status  string         `json:"status"`
	ID      string         `json:"id"`
	Outputs map[string]any `json:"outputs"`
}

func NewActionWorkflowState

func NewActionWorkflowState() *ActionWorkflowState

type ActionsState

type ActionsState struct {
	Populated bool `json:"populated"`

	Workflows map[string]*ActionWorkflowState `json:"workflows"`
}

func NewActionsState

func NewActionsState() *ActionsState

type AppState

type AppState struct {
	Populated bool `json:"populated"`

	Status    string            `json:"status"`
	ID        string            `json:"id"`
	Name      string            `json:"name"`
	Variables map[string]string `json:"variables"`
}

func NewAppState

func NewAppState() *AppState

type AzureCloudAccount

type AzureCloudAccount struct {
	Location string `json:"location"`
}

type CloudAccount

type CloudAccount struct {
	AWS   *AWSCloudAccount   `json:"aws"`
	Azure *AzureCloudAccount `json:"azure"`
	GCP   *GCPCloudAccount   `json:"gcp"`
}

func NewCloudAccount

func NewCloudAccount() *CloudAccount

type ComponentState

type ComponentState struct {
	Populated          bool                   `json:"populated"`
	Status             string                 `json:"status"`
	BuildID            string                 `json:"build_id"`
	ComponentID        string                 `json:"component_id"`
	InstallComponentID string                 `json:"install_component_id"`
	Name               string                 `json:"name"`
	Outputs            map[string]interface{} `json:"outputs" faker:"componentOutputs"`
}

func NewComponentState

func NewComponentState() *ComponentState

type ComponentsState

type ComponentsState struct {
	Populated bool `json:"populated"`

	Components map[string]*ComponentState `json:"components"`
}

func NewComponentsState

func NewComponentsState() *ComponentsState

type ComponentsStateLegacy

type ComponentsStateLegacy map[string]any

type DomainState

type DomainState struct {
	Populated bool `json:"populated"`

	PublicDomain   string `json:"public_domain"`
	InternalDomain string `json:"internal_domain"`
}

func NewDomainState

func NewDomainState() *DomainState

type GCPCloudAccount added in v0.19.850

type GCPCloudAccount struct {
	ProjectID string `json:"project_id"`
	Region    string `json:"region"`
}

type InputsState

type InputsState struct {
	Populated bool              `json:"populated"`
	Inputs    map[string]string `json:"inputs"`
}

func NewInputsState

func NewInputsState() *InputsState

type InstallStackState

type InstallStackState struct {
	Populated bool `json:"populated"`

	QuickLinkURL string `json:"quick_link_url"`
	TemplateURL  string `json:"template_url"`
	TemplateJSON string `json:"template_json"`
	Checksum     string `json:"checksum"`
	Status       string `json:"status"`

	Outputs map[string]interface{} `json:"outputs"`
}

func NewInstallStackState

func NewInstallStackState() *InstallStackState

type InstallState

type InstallState struct {
	Populated bool   `json:"populated"`
	ID        string `json:"id"`
	Name      string `json:"name"`

	PublicDomain   string            `json:"public_domain"`
	InternalDomain string            `json:"internal_domain"`
	Sandbox        SandboxState      `json:"sandbox"`
	Inputs         map[string]string `json:"inputs"`
}

TODO(jm): this is going to be deprecated

func NewInstallState

func NewInstallState() *InstallState

type OCIArtifactOutputs

type OCIArtifactOutputs struct {
	// Repository is the bare repository of the synced artifact (no tag, no
	// digest). Long-standing public output contract: user templates compose
	// it as `image: "{{.repository}}:{{.tag}}"`, so it must never carry a
	// digest suffix — use Ref for a digest-pinned pull reference.
	Repository string `mapstructure:"repository"`
	// Tag is the resolved image tag, composed with Repository by user
	// templates. Never cleared: charts default an empty tag to their
	// appVersion, which silently produces invalid refs when combined with
	// any non-bare repository.
	Tag string `mapstructure:"tag"`
	// Ref is the canonical digest-pinned pull reference for templates that
	// opt in to digest-pinned pulls:
	//
	//   <login_server>/<repository>@sha256:<digest>
	//
	// Empty when the sync runner did not record a manifest digest.
	Ref string `mapstructure:"ref"`
	// DisplayTag is the human-friendly tag the runner resolved (e.g.
	// "1.25.5") for use in plan output, dashboards, and any user template
	// that wants the tag for display purposes only. Always available even
	// when Tag is intentionally cleared for digest-pinning.
	DisplayTag   string            `mapstructure:"display_tag"`
	MediaType    string            `mapstructure:"media_type"`
	Digest       string            `mapstructure:"digest"`
	Size         int64             `mapstructure:"size"`
	URLs         []string          `mapstructure:"urls"`
	Annotations  map[string]string `mapstructure:"annotations"`
	ArtifactType string            `mapstructure:"artifact_type"`
	Platform     Platform          `mapstructure:"platform"`
}

type OrgState

type OrgState struct {
	Status    string `json:"status"`
	Populated bool   `json:"populated"`
	ID        string `json:"id"`
	Name      string `json:"name"`
}

func NewOrgState

func NewOrgState() *OrgState

type Platform

type Platform struct {
	Architecture string   `mapstructure:"architecture"`
	OS           string   `mapstructure:"os"`
	OSVersion    string   `mapstructure:"os_version"`
	Variant      string   `mapstructure:"variant"`
	OSFeatures   []string `mapstructure:"os_features"`
}

type RunnerState

type RunnerState struct {
	Populated bool `json:"populated"`

	ID            string `json:"id"`
	RunnerGroupID string `json:"runner_group_id"`
	Status        string `json:"status"`
	APIURL        string `json:"api_url"`
}

func NewRunnerState

func NewRunnerState() *RunnerState

type SandboxState

type SandboxState struct {
	Populated bool `json:"populated"`

	Status  string                 `json:"status"`
	Type    string                 `json:"type"`
	Version string                 `json:"version"`
	Outputs map[string]interface{} `json:"outputs" faker:"-"`

	RecentRuns []*SandboxState `json:"recent_runs"`
}

func NewSandboxState

func NewSandboxState() *SandboxState

type SecretsState

type SecretsState = outputs.SyncSecretsOutput

type State

type State struct {
	ID   string `json:"id"`
	Name string `json:"name"`

	Org          *OrgState          `json:"org"`
	App          *AppState          `json:"app"`
	Sandbox      *SandboxState      `json:"sandbox"`
	Inputs       *InputsState       `json:"inputs"`
	Actions      *ActionsState      `json:"actions"`
	Runner       *RunnerState       `json:"runner"`
	Components   map[string]any     `json:"components"`
	Domain       *DomainState       `json:"domain"`
	Cloud        *CloudAccount      `json:"cloud_account"`
	InstallStack *InstallStackState `json:"install_stack"`
	Secrets      *SecretsState      `json:"secrets"`
	Labels       map[string]string  `json:"labels"`

	// NOTE: for backwards compatibility, these are remaining in place.
	Install *InstallState `json:"install"`

	// loaded from the database but not part of the state itself
	StaleAt *time.Time `json:"stale_at"`
}

func New

func New() *State

func (State) AsMap

func (i State) AsMap() (map[string]interface{}, error)

func (State) GormDataType

func (State) GormDataType() string

func (*State) Scan

func (c *State) Scan(v interface{}) (err error)

Scan implements the database/sql.Scanner interface.

func (*State) Value

func (c *State) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

func (State) WorkflowSafeAsMap

func (i State) WorkflowSafeAsMap(ctx workflow.Context) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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