template

package
v0.0.0-...-a4d1c73 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: Apache-2.0 Imports: 0 Imported by: 12

Documentation

Overview

Package template provides struct which describes AWS Template.

Index

Constants

View Source
const (
	NotExist = TemplateElementValueType(iota)
	String
	Number
	Object
	Array
	Boolean
	Null
	Unknown
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameters

type Parameters map[string]interface{}

Parameters describes structure of Parameters in Template.

type Resource

type Resource struct {
	Type           string                 `yaml:"Type"`
	Properties     map[string]interface{} `yaml:"Properties"`
	DeletionPolicy string                 `yaml:"DeletionPolicy"`
}

Resource describes structure of Resources in Template.

type Template

type Template struct {
	AWSTemplateFormatVersion string                 `yaml:"AWSTemplateFormatVersion"`
	Description              string                 `yaml:"Description"`
	Metadata                 map[string]interface{} `yaml:"Metadata"`
	Parameters               map[string]interface{} `yaml:"Parameters"`
	Mappings                 map[string]interface{} `yaml:"Mappings"`
	Conditions               map[string]interface{} `yaml:"Conditions"`
	Transform                map[string]interface{} `yaml:"Transform"`
	Resources                map[string]Resource    `yaml:"Resources"`
	Outputs                  map[string]interface{} `yaml:"Outputs"`
}

Template describes AWS Template.

type TemplateElement

type TemplateElement struct {
	Name     string
	Value    interface{}
	Type     TemplateElementValueType
	Children interface{}
	Line     int
	Column   int
}

TemplateElement describe each Element.

func (*TemplateElement) GetChildrenMap

func (te *TemplateElement) GetChildrenMap() map[string]*TemplateElement

GetChildrenMap - get map in Element.

func (*TemplateElement) GetChildrenSlice

func (te *TemplateElement) GetChildrenSlice() []*TemplateElement

GetChildrenSlice - get slice in Element.

func (*TemplateElement) Traverse

func (te *TemplateElement) Traverse(iterator func(element *TemplateElement, parent *TemplateElement, depth int))

Traverse - get all maps and slices.

type TemplateElementValueType

type TemplateElementValueType int

TemplateElementValueType describe type of the element value.

type TemplateWithDetails

type TemplateWithDetails struct {
	AWSTemplateFormatVersion *TemplateElement
	Description              *TemplateElement
	Metadata                 *TemplateElement
	Parameters               *TemplateElement
	Mappings                 *TemplateElement
	Conditions               *TemplateElement
	Transform                *TemplateElement
	Resources                *TemplateElement
	Outputs                  *TemplateElement
}

TemplateWithDetails - more detailed template.

func (TemplateWithDetails) Traverse

func (twd TemplateWithDetails) Traverse(iterator func(element *TemplateElement, parent *TemplateElement, depth int))

Traverse - get all maps and slices for each element.

Jump to

Keyboard shortcuts

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