terraform

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	Data []byte
	Lock []byte
}

type StateSchema

type StateSchema struct {
	TableName       string
	IDColumnName    string
	DataColumnName  string
	LockColumnName  string
	CreateStatement string
}

func DefaultStateSchema

func DefaultStateSchema() *StateSchema

func (*StateSchema) GetState

func (c *StateSchema) GetState(ctx context.Context, db *sql.DB, stateID string) (*State, error)

GetState gets a TerraformState struct from the database if no rows are found then a new row is created

func (*StateSchema) SaveState

func (c *StateSchema) SaveState(ctx context.Context, db *sql.DB, state *State, stateID string) error

SaveState saves a TerraformState struct to a database

func (*StateSchema) SelectState

func (c *StateSchema) SelectState(stateID string) squirrel.SelectBuilder

SelectState generates a squirrel.SelectBuilder suitable for selecting a row

func (*StateSchema) UpsertState

func (c *StateSchema) UpsertState(state *State, stateID string) squirrel.InsertBuilder

UpsertState generates a squirrel.InsertBuilder suitable for inserting a new row or updating if the stateID already exists

Jump to

Keyboard shortcuts

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