Documentation ¶
Overview ¶
Package stack contains the serialized and configurable state associated with an stack; or, in other words, a deployment target. It pertains to resources and deployment plans, but is a package unto itself.
Index ¶
- Constants
- Variables
- func DeserializeCheckpoint(chkpoint *apitype.CheckpointV1) (*deploy.Snapshot, error)
- func DeserializeDeployment(deployment *apitype.UntypedDeployment) (*deploy.Snapshot, error)
- func DeserializeProperties(props map[string]interface{}) (resource.PropertyMap, error)
- func DeserializePropertyValue(v interface{}) (resource.PropertyValue, error)
- func DeserializeResource(res apitype.Resource) (*resource.State, error)
- func GetRootStackResource(snap *deploy.Snapshot) (*resource.State, map[string]interface{})
- func SerializeCheckpoint(stack tokens.QName, config config.Map, snap *deploy.Snapshot) *apitype.VersionedCheckpoint
- func SerializeDeployment(snap *deploy.Snapshot) *apitype.Deployment
- func SerializeProperties(props resource.PropertyMap) map[string]interface{}
- func SerializePropertyValue(prop resource.PropertyValue) interface{}
- func SerializeResource(res *resource.State) apitype.Resource
- func UnmarshalVersionedCheckpointToLatestCheckpoint(bytes []byte) (*apitype.CheckpointV1, error)
Constants ¶
const ( // DeploymentSchemaVersionOldestSupported is the oldest deployment schema that we // still support, i.e. we can produce a `deploy.Snapshot` from. This will generally // need to be at least one less than the current schema version so that old deployments can // be migrated to the current schema. // // We only have one version today (version 1) so the oldest supported version is the // current version. DeploymentSchemaVersionOldestSupported = 1 )
Variables ¶
var ( // ErrDeploymentSchemaVersionTooOld is returned from `DeserializeDeployment` if the // untyped deployment being deserialized is too old to understand. ErrDeploymentSchemaVersionTooOld = fmt.Errorf("this stack's deployment is too old") // ErrDeploymentSchemaVersionTooNew is returned from `DeserializeDeployment` if the // untyped deployment being deserialized is too new to understand. ErrDeploymentSchemaVersionTooNew = fmt.Errorf("this stack's deployment version is too new") )
Functions ¶
func DeserializeCheckpoint ¶
func DeserializeCheckpoint(chkpoint *apitype.CheckpointV1) (*deploy.Snapshot, error)
DeserializeCheckpoint takes a serialized deployment record and returns its associated snapshot.
func DeserializeDeployment ¶
func DeserializeDeployment(deployment *apitype.UntypedDeployment) (*deploy.Snapshot, error)
DeserializeDeployment deserializes an untyped deployment and produces a `deploy.Snapshot` from it. DeserializeDeployment will return an error if the untyped deployment's version is not within the range `DeploymentSchemaVersionCurrent` and `DeploymentSchemaVersionOldestSupported`.
func DeserializeProperties ¶
func DeserializeProperties(props map[string]interface{}) (resource.PropertyMap, error)
DeserializeProperties deserializes an entire map of deploy properties into a resource property map.
func DeserializePropertyValue ¶
func DeserializePropertyValue(v interface{}) (resource.PropertyValue, error)
DeserializePropertyValue deserializes a single deploy property into a resource property value.
func DeserializeResource ¶
DeserializeResource turns a serialized resource back into its usual form.
func GetRootStackResource ¶
GetRootStackResource returns the root stack resource from a given snapshot, or nil if not found. If the stack exists, its output properties, if any, are also returned in the resulting map.
func SerializeCheckpoint ¶
func SerializeCheckpoint(stack tokens.QName, config config.Map, snap *deploy.Snapshot) *apitype.VersionedCheckpoint
SerializeCheckpoint turns a snapshot into a data structure suitable for serialization.
func SerializeDeployment ¶
func SerializeDeployment(snap *deploy.Snapshot) *apitype.Deployment
SerializeDeployment serializes an entire snapshot as a deploy record.
func SerializeProperties ¶
func SerializeProperties(props resource.PropertyMap) map[string]interface{}
SerializeProperties serializes a resource property bag so that it's suitable for serialization.
func SerializePropertyValue ¶
func SerializePropertyValue(prop resource.PropertyValue) interface{}
SerializePropertyValue serializes a resource property value so that it's suitable for serialization.
func SerializeResource ¶
SerializeResource turns a resource into a structure suitable for serialization.
func UnmarshalVersionedCheckpointToLatestCheckpoint ¶
func UnmarshalVersionedCheckpointToLatestCheckpoint(bytes []byte) (*apitype.CheckpointV1, error)
Types ¶
This section is empty.