generate

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Scenario *flightplan.Scenario
	BaseDir  string
	OutDir   string
	UI       cli.Ui
}

Generator is a request to generate a Terraform module.

func NewGenerator

func NewGenerator(opts ...Opt) (*Generator, error)

NewGenerator takes options and returns a new validated generator.

func (*Generator) Generate

func (g *Generator) Generate() error

Generate converts the Scenario into a terraform module.

func (*Generator) TerraformModuleDir

func (g *Generator) TerraformModuleDir() string

TerraformModuleDir is the directory where the generated Terraform.

func (*Generator) TerraformModulePath

func (g *Generator) TerraformModulePath() string

TerraformModulePath is where the generated Terraform module file will be written.

func (*Generator) TerraformRCPath

func (g *Generator) TerraformRCPath() string

TerraformRCPath is where the generated terraform.rc configuration file will be written.

type Opt

type Opt func(*Generator) error

Opt is a generate module option.

func WithOutBaseDirectory

func WithOutBaseDirectory(dir string) Opt

WithOutBaseDirectory is the destination base directory where modules will be written.

func WithScenario

func WithScenario(s *flightplan.Scenario) Opt

WithScenario is the scenario to generate into a module.

func WithScenarioBaseDirectory

func WithScenarioBaseDirectory(dir string) Opt

WithScenarioBaseDirectory is base directory where the scenario defintions reside.

func WithUI

func WithUI(ui cli.Ui) Opt

WithUI is the UI to use for outputing information.

Jump to

Keyboard shortcuts

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