Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parameter ¶
type Parameter struct { Type ParameterType `json:"type"` Default interface{} `json:"default,omitempty"` }
type ParameterType ¶
type ParameterType string
const ( ParameterTypeBool ParameterType = "bool" ParameterTypeNumber ParameterType = "number" ParameterTypeString ParameterType = "string" ParameterTypeArray ParameterType = "array" ParameterTypeObject ParameterType = "object" ParameterTypeSecret ParameterType = "secret" SecretParameterLVal = "$secret" SecretRefParameterLVal = "$secret_ref" )
type ParameterTypeError ¶
func (*ParameterTypeError) Error ¶
func (e *ParameterTypeError) Error() string
type Parameters ¶
func (Parameters) Bind ¶
func (p Parameters) Bind(path tree.Path, bindings map[string]interface{}) (map[string]interface{}, error)
Bind will take in a set of bindings for parameters, type check them, and properly set defaults if necessary. It will then return the checked and defaulted set of parameter bindings.
type Template ¶
type Template struct { Parameters Parameters Fields map[string]interface{} }
func (*Template) Evaluate ¶
func (t *Template) Evaluate(path tree.Path, bindings map[string]interface{}) (map[string]interface{}, error)
Evaluate will crawl the Fields map and inject parameters into the values.
func (*Template) MarshalJSON ¶
func (*Template) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface. The JSON should be an object. UnmarshalJSON will see if the object has a parameters field, and if it does try to Unmarshal it into a Parameters struct. If it succeeds it will use this struct as the Template's Parameters field. It will then use the rest of the fields of the object as the Template's Fields field.
Click to show internal directories.
Click to hide internal directories.