models

package
v0.0.0-...-82468b1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlanContent     = "plan_content"
	PlanContentJSON = "plan_content_json"
)
View Source
const (
	DestroyAction = "destroy"
)
View Source
const (
	// e.g. "2006-01-02T15:04:05Z"
	TimeFormat = time.RFC3339
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InParams

type InParams struct {
	Action             string `json:"action,omitempty"`           // optional
	OutputStatefile    bool   `json:"output_statefile,omitempty"` // optional
	OutputJSONPlanfile bool   `json:"output_planfile,omitempty"`  // optional
	Terraform
}

type InRequest

type InRequest struct {
	Source  Source   `json:"source"`
	Version Version  `json:"version,omitempty"` // absent on initial request
	Params  InParams `json:"params,omitempty"`  // used to specify 'destroy' action
}

type InResponse

type InResponse struct {
	Version  Version  `json:"version"`
	Metadata Metadata `json:"metadata"`
}

type Metadata

type Metadata []MetadataField

type MetadataField

type MetadataField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type OutParams

type OutParams struct {
	EnvName            string `json:"env_name"`
	EnvNameFile        string `json:"env_name_file"`
	GenerateRandomName bool   `json:"generate_random_name"`
	Action             string `json:"action,omitempty"` // optional
	Terraform
}

type OutRequest

type OutRequest struct {
	Source Source    `json:"source"`
	Params OutParams `json:"params"`
}

type OutResponse

type OutResponse struct {
	Version  Version  `json:"version"`
	Metadata Metadata `json:"metadata"`
}

type Source

type Source struct {
	Terraform
	Storage             storage.Model `json:"storage,omitempty"`               // optional
	MigratedFromStorage storage.Model `json:"migrated_from_storage,omitempty"` // optional
	EnvName             string        `json:"env_name,omitempty"`              // optional
}

func (Source) Validate

func (s Source) Validate() error

type Terraform

type Terraform struct {
	Source                string                 `json:"terraform_source"`
	Vars                  map[string]interface{} `json:"vars,omitempty"`                  // optional
	VarFiles              []string               `json:"var_files,omitempty"`             // optional
	Env                   map[string]string      `json:"env,omitempty"`                   // optional
	DeleteOnFailure       bool                   `json:"delete_on_failure,omitempty"`     // optional
	PlanOnly              bool                   `json:"plan_only,omitempty"`             // optional
	PlanRun               bool                   `json:"plan_run,omitempty"`              // optional
	OutputModule          string                 `json:"output_module,omitempty"`         // optional
	ImportFiles           []string               `json:"import_files,omitempty"`          // optional
	OverrideFiles         []string               `json:"override_files,omitempty"`        // optional
	ModuleOverrideFiles   []map[string]string    `json:"module_override_files,omitempty"` // optional
	PluginDir             string                 `json:"plugin_dir,omitempty"`            // optional
	BackendType           string                 `json:"backend_type,omitempty"`          // optional
	BackendConfig         map[string]interface{} `json:"backend_config,omitempty"`        // optional
	PrivateKey            string                 `json:"private_key,omitempty"`
	PlanFileLocalPath     string                 `json:"-"` // not specified pipeline
	JSONPlanFileLocalPath string                 `json:"-"` // not specified pipeline
	PlanFileRemotePath    string                 `json:"-"` // not specified pipeline
	StateFileLocalPath    string                 `json:"-"` // not specified pipeline
	StateFileRemotePath   string                 `json:"-"` // not specified pipeline
	Imports               map[string]string      `json:"-"` // not specified pipeline
	ConvertedVarFiles     []string               `json:"-"` // not specified pipeline
	DownloadPlugins       bool                   `json:"-"` // not specified pipeline
}

func (*Terraform) ConvertVarFiles

func (m *Terraform) ConvertVarFiles(tmpDir string) error

The resource supports input files in JSON, YAML, and HCL formats. Terraform supports JSON and HCL but not YAML. This method converts all YAML files to JSON and writes Vars to the first file to ensure precedence rules are respected.

func (Terraform) Merge

func (m Terraform) Merge(other Terraform) Terraform

func (*Terraform) ParseImportsFromFile

func (m *Terraform) ParseImportsFromFile() error

func (Terraform) Validate

func (m Terraform) Validate() error

type Version

type Version struct {
	Serial       string `json:"serial"`
	EnvName      string `json:"env_name"`
	Lineage      string `json:"lineage,omitempty"`       // omitted on older version
	LastModified string `json:"last_modified,omitempty"` // optional
	PlanOnly     string `json:"plan_only,omitempty"`     //optional
	PlanChecksum string `json:"plan_checksum,omitempty"` //optional
}

func NewVersionFromLegacyStorage

func NewVersionFromLegacyStorage(storageVersion storage.Version) Version

func (Version) IsPlan

func (r Version) IsPlan() bool

func (Version) IsZero

func (r Version) IsZero() bool

func (Version) LastModifiedTime

func (r Version) LastModifiedTime() time.Time

func (Version) Validate

func (r Version) Validate() error

Jump to

Keyboard shortcuts

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