Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { // Guid is a random uuid generated the first time this resource is added to the project. Guid string // Uid is the combined id like type.class#id Uid string // Type is always defined as the resource type Type string // Class is the resource class, it defaults to 'default' Class string // Id is the resource id, like 'global-id' or 'workload.res-name' Id string Params map[string]interface{} Metadata map[string]interface{} Init map[string]interface{} State map[string]interface{} SourceWorkload string WorkloadServices map[string]provisioners.NetworkService }
Data is the structure sent to each template during rendering.
type Provisioner ¶
type Provisioner struct { ProvisionerUri string `yaml:"uri"` ResType string `yaml:"type"` ResClass *string `yaml:"class,omitempty"` ResId *string `yaml:"id,omitempty"` // The InitTemplate is always evaluated first, it is used as temporary or working set data that may be needed in the // later templates. It has access to the resource inputs and previous state. InitTemplate string `yaml:"init,omitempty"` // StateTemplate generates the new state of the resource based on the init and previous state. StateTemplate string `yaml:"state,omitempty"` SharedStateTemplate string `yaml:"shared,omitempty"` // OutputsTemplate generates the outputs of the resource, based on the init and current state. OutputsTemplate string `yaml:"outputs,omitempty"` ManifestsTemplate string `yaml:"manifests,omitempty"` }
Provisioner is the decoded template provisioner. A template provisioner provisions a resource by evaluating a series of Go text/templates that have access to some input parameters, previous state, and utility functions. Each parameter is expected to return a JSON object.
func Parse ¶
func Parse(raw map[string]interface{}) (*Provisioner, error)
func (*Provisioner) Match ¶
func (p *Provisioner) Match(resUid framework.ResourceUid) bool
func (*Provisioner) Provision ¶
func (p *Provisioner) Provision(ctx context.Context, input *provisioners.Input) (*provisioners.ProvisionOutput, error)
func (*Provisioner) Uri ¶
func (p *Provisioner) Uri() string
Click to show internal directories.
Click to hide internal directories.