driver

package
v0.1.0-techpreview1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	// Init initializes the driver and environment
	Init(ctx context.Context) error

	// InitTask initializes the task that the driver executes
	InitTask(task Task, force bool) error

	// ApplyTask applies change for the task managed by the driver
	ApplyTask(ctx context.Context) error

	// Version returns the version of the driver.
	Version() string
}

Driver describes the interface for using an Sync driver to carry out changes downstream to update network infrastructure.

type Service

type Service struct {
	Datacenter  string
	Description string
	Name        string
	Namespace   string
	Tag         string
}

Service contains service configuration information

type Task

type Task struct {
	Description  string
	Name         string
	Providers    []map[string]interface{}
	ProviderInfo map[string]interface{}
	Services     []Service
	Source       string
	VarFiles     []string
	Version      string
}

Task contains task configuration information

type Terraform

type Terraform struct {
	// contains filtered or unexported fields
}

Terraform is an Sync driver that uses the Terraform CLI to interface with low-level network infrastructure.

func NewTerraform

func NewTerraform(config *TerraformConfig) *Terraform

NewTerraform configures and initializes a new Terraform driver

func (*Terraform) ApplyTask

func (tf *Terraform) ApplyTask(ctx context.Context) error

ApplyTask applies the task changes.

func (*Terraform) Init

func (tf *Terraform) Init(ctx context.Context) error

Init initializes the Terraform local environment. The Terraform binary is installed to the configured path.

func (*Terraform) InitTask

func (tf *Terraform) InitTask(task Task, force bool) error

InitTask initializes the task by creating the Terraform root module and client to execute task.

func (*Terraform) Version

func (tf *Terraform) Version() string

Version returns the Terraform CLI version for the Terraform driver.

type TerraformConfig

type TerraformConfig struct {
	Log               bool
	PersistLog        bool
	Path              string
	WorkingDir        string
	Backend           map[string]interface{}
	RequiredProviders map[string]interface{}

	// empty/unknown string will default to TerraformCLI client
	ClientType string
}

TerraformConfig configures the Terraform driver

Jump to

Keyboard shortcuts

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