terrago

package module
v0.0.0-...-f7b6a4b Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 12 Imported by: 0

README

Terrago

This git repository contains one Go module with:

  • One public Go package at the root directory.
  • Two internal Go packages generated by the make dag-code target.

The module path is github.com/h0tbird/terrago which is also the import path used for the root directory. It is intended to be consumed as a library by adding the import "github.com/h0tbird/terrago" statement to your code.

Architecture

A Manifest is a collection of Resources (stored in a hash table) and its corresponding dependency DAG. When a Manifest is applied, the DAG is generated and walked and that's when Resources are reconciled.

Development

Upgrade all dependencies at once:

go mod edit -go=1.16
go get -u ./...
go mod tidy

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	Resources map[string]*Resource
	Dag       dag.AcyclicGraph
}

Manifest ...

func NewManifest

func NewManifest() *Manifest

NewManifest ...

func (*Manifest) Apply

func (h *Manifest) Apply(ctx context.Context, p *schema.Provider, s State) error

Apply ...

type Resource

type Resource struct {
	ResourceLogicalID string
	ResourceType      string
	ResourceConfig    map[string]interface{}
	ResourceState     *terraform.InstanceState
}

Resource ...

func (*Resource) Reconcile

func (h *Resource) Reconcile(ctx context.Context, p *schema.Provider, s State, r map[string]*Resource) error

Reconcile ...

type State

type State interface {
	Read(string, interface{}) error
	Write(string, interface{}) error
}

State ...

Directories

Path Synopsis
cmd
internal
dag
tfd
Package tfd is a utility package for representing errors and warnings in a manner that allows us to produce good messages for the user.
Package tfd is a utility package for representing errors and warnings in a manner that allows us to produce good messages for the user.

Jump to

Keyboard shortcuts

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