Documentation ¶
Index ¶
- func IsCreatable(status ConstructStatus) bool
- func IsDeletable(status ConstructStatus) bool
- func IsDeployable(status ConstructStatus) bool
- func IsUpdatable(status ConstructStatus) bool
- func UrnPath(urn URN) (string, error)
- type ApplicationEnvironment
- type Binding
- type Construct
- type ConstructAction
- type ConstructState
- type ConstructStatus
- type DryRun
- type Input
- type InputStatus
- type State
- type StateManager
- func (sm *StateManager) CheckStateFileExists() bool
- func (sm *StateManager) GetAllConstructs() map[string]ConstructState
- func (sm *StateManager) GetConstructState(name string) (ConstructState, bool)
- func (sm *StateManager) GetState() *State
- func (sm *StateManager) InitState(ir *ApplicationEnvironment)
- func (sm *StateManager) IsOperating(construct *ConstructState) bool
- func (sm *StateManager) LoadState() error
- func (sm *StateManager) RegisterOutputValues(ctx context.Context, urn URN, outputs map[string]any) error
- func (sm *StateManager) SaveState() error
- func (sm *StateManager) SetConstructState(construct ConstructState)
- func (sm *StateManager) TransitionConstructComplete(construct *ConstructState) error
- func (sm *StateManager) TransitionConstructFailed(construct *ConstructState) error
- func (sm *StateManager) TransitionConstructState(construct *ConstructState, nextStatus ConstructStatus) error
- func (sm *StateManager) UpdateResourceState(name string, status ConstructStatus, lastUpdated string) error
- type URN
- func (u *URN) Compare(other URN) int
- func (u *URN) Equals(other any) bool
- func (u *URN) IsAccount() bool
- func (u *URN) IsApplicationEnvironment() bool
- func (u *URN) IsEnvironment() bool
- func (u *URN) IsOutput() bool
- func (u *URN) IsProject() bool
- func (u *URN) IsResource() bool
- func (u *URN) IsType() bool
- func (u URN) MarshalText() ([]byte, error)
- func (u URN) String() string
- func (u *URN) UnmarshalText(text []byte) error
- func (u *URN) UrnType() UrnType
- type UUID
- type UrnType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCreatable ¶
func IsCreatable(status ConstructStatus) bool
func IsDeletable ¶
func IsDeletable(status ConstructStatus) bool
func IsDeployable ¶
func IsDeployable(status ConstructStatus) bool
func IsUpdatable ¶
func IsUpdatable(status ConstructStatus) bool
Types ¶
type ApplicationEnvironment ¶
type ApplicationEnvironment struct { SchemaVersion int `yaml:"schemaVersion,omitempty"` Version int `yaml:"version,omitempty"` ProjectURN URN `yaml:"project_urn,omitempty"` AppURN URN `yaml:"app_urn,omitempty"` Environment string `yaml:"environment,omitempty"` Constructs map[string]Construct `yaml:"constructs,omitempty"` DefaultRegion string `yaml:"default_region,omitempty"` }
func ParseIRFile ¶
func ParseIRFile(content []byte) (*ApplicationEnvironment, error)
func ReadIRFile ¶
func ReadIRFile(filename string) (*ApplicationEnvironment, error)
type Construct ¶
type Construct struct { URN *URN `yaml:"urn,omitempty"` Version int `yaml:"version,omitempty"` Inputs map[string]Input `yaml:"inputs,omitempty"` Outputs map[string]any `yaml:"outputs,omitempty"` Bindings []Binding `yaml:"bindings,omitempty"` Options map[string]interface{} `yaml:"options,omitempty"` DependsOn []*URN `yaml:"dependsOn,omitempty"` }
type ConstructAction ¶
type ConstructAction string
const ( ConstructActionCreate ConstructAction = "create" ConstructActionUpdate ConstructAction = "update" ConstructActionDelete ConstructAction = "delete" )
type ConstructState ¶
type ConstructState struct { Status ConstructStatus `yaml:"status,omitempty"` LastUpdated string `yaml:"last_updated,omitempty"` Inputs map[string]Input `yaml:"inputs,omitempty"` Outputs map[string]any `yaml:"outputs,omitempty"` Bindings []Binding `yaml:"bindings,omitempty"` Options map[string]any `yaml:"options,omitempty"` DependsOn []*URN `yaml:"dependsOn,omitempty"` PulumiStack UUID `yaml:"pulumi_stack,omitempty"` URN *URN `yaml:"urn,omitempty"` }
type ConstructStatus ¶
type ConstructStatus string
const ( // Create-related statuses ConstructCreating ConstructStatus = "creating" ConstructCreateComplete ConstructStatus = "create_complete" ConstructCreateFailed ConstructStatus = "create_failed" // Update-related statuses ConstructUpdating ConstructStatus = "updating" ConstructUpdateComplete ConstructStatus = "update_complete" ConstructUpdateFailed ConstructStatus = "update_failed" // Delete-related statuses ConstructDeleting ConstructStatus = "deleting" ConstructDeleteComplete ConstructStatus = "delete_complete" ConstructDeleteFailed ConstructStatus = "delete_failed" // Unknown status ConstructUnknown ConstructStatus = "unknown" )
type DryRun ¶
type DryRun int
const ( // DryRunNone is the default value, no dry run DryRunNone DryRun = iota // DryRunPreview is a dry run that uses Pulumi preview DryRunPreview // DryRunCompile is a dry run that only runs `tsc` on the resulting IaC DryRunCompile // DryRunFileOnly is a dry run that only writes the files to disk DryRunFileOnly )
type Input ¶
type Input struct { Value interface{} `yaml:"value,omitempty"` Encrypted bool `yaml:"encrypted,omitempty"` Status InputStatus `yaml:"status,omitempty"` DependsOn string `yaml:"dependsOn,omitempty"` }
type InputStatus ¶
type InputStatus string
const ( InputStatusPending InputStatus = "pending" InputStatusResolved InputStatus = "resolved" InputStatusError InputStatus = "error" )
type State ¶
type State struct { SchemaVersion int `yaml:"schemaVersion,omitempty"` Version int `yaml:"version,omitempty"` ProjectURN URN `yaml:"project_urn,omitempty"` AppURN URN `yaml:"app_urn,omitempty"` Environment string `yaml:"environment,omitempty"` DefaultRegion string `yaml:"default_region,omitempty"` Constructs map[string]ConstructState `yaml:"constructs,omitempty"` }
type StateManager ¶
type StateManager struct {
// contains filtered or unexported fields
}
func NewStateManager ¶
func NewStateManager(fsys afero.Fs, stateFile string) *StateManager
func (*StateManager) CheckStateFileExists ¶
func (sm *StateManager) CheckStateFileExists() bool
func (*StateManager) GetAllConstructs ¶
func (sm *StateManager) GetAllConstructs() map[string]ConstructState
func (*StateManager) GetConstructState ¶
func (sm *StateManager) GetConstructState(name string) (ConstructState, bool)
func (*StateManager) GetState ¶
func (sm *StateManager) GetState() *State
func (*StateManager) InitState ¶
func (sm *StateManager) InitState(ir *ApplicationEnvironment)
func (*StateManager) IsOperating ¶
func (sm *StateManager) IsOperating(construct *ConstructState) bool
func (*StateManager) LoadState ¶
func (sm *StateManager) LoadState() error
func (*StateManager) RegisterOutputValues ¶
func (sm *StateManager) RegisterOutputValues(ctx context.Context, urn URN, outputs map[string]any) error
RegisterOutputValues registers the resolved output values of a construct in the state manager and resolves any inputs that depend on the provided outputs
func (*StateManager) SaveState ¶
func (sm *StateManager) SaveState() error
func (*StateManager) SetConstructState ¶
func (sm *StateManager) SetConstructState(construct ConstructState)
func (*StateManager) TransitionConstructComplete ¶
func (sm *StateManager) TransitionConstructComplete(construct *ConstructState) error
func (*StateManager) TransitionConstructFailed ¶
func (sm *StateManager) TransitionConstructFailed(construct *ConstructState) error
func (*StateManager) TransitionConstructState ¶
func (sm *StateManager) TransitionConstructState(construct *ConstructState, nextStatus ConstructStatus) error
func (*StateManager) UpdateResourceState ¶
func (sm *StateManager) UpdateResourceState(name string, status ConstructStatus, lastUpdated string) error
type URN ¶
type URN struct { AccountID string `yaml:"accountId"` Project string `yaml:"project"` Environment string `yaml:"environment,omitempty"` Application string `yaml:"application,omitempty"` Type string `yaml:"type,omitempty"` Subtype string `yaml:"subtype,omitempty"` ParentResourceID string `yaml:"parentResourceId,omitempty"` ResourceID string `yaml:"resourceId,omitempty"` Output string `yaml:"output,omitempty"` }
URN represents a Unique Resource Name in the Klotho ecosystem
func (*URN) IsApplicationEnvironment ¶
func (*URN) IsEnvironment ¶
func (*URN) IsResource ¶
func (URN) MarshalText ¶
func (*URN) UnmarshalText ¶
type UUID ¶
func (*UUID) UnmarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.