stack

package
v0.14.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

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

View Source
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

View Source
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

func DeserializeResource(res apitype.Resource) (*resource.State, error)

DeserializeResource turns a serialized resource back into its usual form.

func GetRootStackResource

func GetRootStackResource(snap *deploy.Snapshot) (*resource.State, map[string]interface{})

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

func SerializeResource(res *resource.State) apitype.Resource

SerializeResource turns a resource into a structure suitable for serialization.

func UnmarshalVersionedCheckpointToLatestCheckpoint

func UnmarshalVersionedCheckpointToLatestCheckpoint(bytes []byte) (*apitype.CheckpointV1, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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