template

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Code generated by "mapstructure-to-hcl2 -type Provisioner"; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Name   string                 `json:"name,omitempty"`
	Type   string                 `json:"type"`
	Config map[string]interface{} `json:"config,omitempty"`
}

Builder represents a builder configured in the template

func (*Builder) GoString

func (b *Builder) GoString() string

func (*Builder) MarshalJSON added in v1.4.0

func (b *Builder) MarshalJSON() ([]byte, error)

MarshalJSON conducts the necessary flattening of the Builder struct to provide valid Packer template JSON

type FlatProvisioner added in v1.4.5

type FlatProvisioner struct {
	Only        []string               `json:"only,omitempty" cty:"only" hcl:"only"`
	Except      []string               `json:"except,omitempty" cty:"except" hcl:"except"`
	Type        *string                `json:"type" cty:"type" hcl:"type"`
	Config      map[string]interface{} `json:"config,omitempty" cty:"config" hcl:"config"`
	Override    map[string]interface{} `json:"override,omitempty" cty:"override" hcl:"override"`
	PauseBefore *string                `mapstructure:"pause_before" json:"pause_before,omitempty" cty:"pause_before" hcl:"pause_before"`
	MaxRetries  *string                `mapstructure:"max_retries" json:"max_retries,omitempty" cty:"max_retries" hcl:"max_retries"`
	Timeout     *string                `mapstructure:"timeout" json:"timeout,omitempty" cty:"timeout" hcl:"timeout"`
}

FlatProvisioner is an auto-generated flat version of Provisioner. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatProvisioner) HCL2Spec added in v1.4.5

func (*FlatProvisioner) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Provisioner. This spec is used by HCL to read the fields of Provisioner. The decoded values from this spec will then be applied to a FlatProvisioner.

type OnlyExcept

type OnlyExcept struct {
	Only   []string `json:"only,omitempty"`
	Except []string `json:"except,omitempty"`
}

OnlyExcept is a struct that is meant to be embedded that contains the logic required for "only" and "except" meta-parameters.

func (*OnlyExcept) Skip

func (o *OnlyExcept) Skip(n string) bool

Skip says whether or not to skip the build with the given name.

func (*OnlyExcept) Validate

func (o *OnlyExcept) Validate(t *Template) error

Validate validates that the OnlyExcept settings are correct for a thing.

type PostProcessor

type PostProcessor struct {
	OnlyExcept `mapstructure:",squash" json:",omitempty"`

	Name              string                 `json:"name,omitempty"`
	Type              string                 `json:"type"`
	KeepInputArtifact *bool                  `mapstructure:"keep_input_artifact" json:"keep_input_artifact,omitempty"`
	Config            map[string]interface{} `json:"config,omitempty"`
}

PostProcessor represents a post-processor within the template.

func (*PostProcessor) GoString

func (p *PostProcessor) GoString() string

func (*PostProcessor) MarshalJSON added in v1.4.0

func (p *PostProcessor) MarshalJSON() ([]byte, error)

MarshalJSON conducts the necessary flattening of the PostProcessor struct to provide valid Packer template JSON

type Provisioner

type Provisioner struct {
	OnlyExcept `mapstructure:",squash" json:",omitempty"`

	Type        string                 `json:"type"`
	Config      map[string]interface{} `json:"config,omitempty"`
	Override    map[string]interface{} `json:"override,omitempty"`
	PauseBefore time.Duration          `mapstructure:"pause_before" json:"pause_before,omitempty"`
	MaxRetries  string                 `mapstructure:"max_retries" json:"max_retries,omitempty"`
	Timeout     time.Duration          `mapstructure:"timeout" json:"timeout,omitempty"`
}

Provisioner represents a provisioner within the template.

func (*Provisioner) FlatMapstructure added in v1.4.5

func (*Provisioner) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatProvisioner. FlatProvisioner is an auto-generated flat version of Provisioner. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*Provisioner) GoString

func (p *Provisioner) GoString() string

func (*Provisioner) MarshalJSON added in v1.4.0

func (p *Provisioner) MarshalJSON() ([]byte, error)

MarshalJSON conducts the necessary flattening of the Provisioner struct to provide valid Packer template JSON

type Push

type Push struct {
	Name    string
	Address string
	BaseDir string `mapstructure:"base_dir"`
	Include []string
	Exclude []string
	Token   string
	VCS     bool
}

Push represents the configuration for pushing the template to Atlas.

type Template

type Template struct {
	// Path is the path to the template. This will be blank if Parse is
	// used, but will be automatically populated by ParseFile.
	Path string

	Description string
	MinVersion  string

	Comments           map[string]string
	Variables          map[string]*Variable
	SensitiveVariables []*Variable
	Builders           map[string]*Builder
	Provisioners       []*Provisioner
	CleanupProvisioner *Provisioner
	PostProcessors     [][]*PostProcessor

	// RawContents is just the raw data for this template
	RawContents []byte
}

Template represents the parsed template that is used to configure Packer builds.

func Parse

func Parse(r io.Reader) (*Template, error)

Parse takes the given io.Reader and parses a Template object out of it.

func ParseFile

func ParseFile(path string) (*Template, error)

ParseFile is the same as Parse but is a helper to automatically open a file for parsing.

func (*Template) Raw added in v1.4.0

func (t *Template) Raw() (*rawTemplate, error)

Raw converts a Template struct back into the raw Packer template structure

func (*Template) Validate

func (t *Template) Validate() error

Validate does some basic validation of the template on top of the validation that occurs while parsing. If possible, we try to defer validation to here. The validation errors that occur during parsing are the minimal necessary to make sure parsing builds a reasonable Template structure.

type Variable

type Variable struct {
	Key      string
	Default  string
	Required bool
}

Variable represents a variable within the template

func (*Variable) GoString

func (v *Variable) GoString() string

func (*Variable) MarshalJSON added in v1.4.0

func (v *Variable) MarshalJSON() ([]byte, error)

Directories

Path Synopsis
aws/secretsmanager
Package secretsmanager provide methods to get data from AWS Secret Manager
Package secretsmanager provide methods to get data from AWS Secret Manager

Jump to

Keyboard shortcuts

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