ns

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ApiKeyEnvVar   = "NULLSTONE_API_KEY"
	AddressEnvVar  = "NULLSTONE_ADDR"
	DefaultAddress = "https://api.nullstone.io"
)
View Source
var (
	DefaultTfeAddress = "https://api.nullstone.io"
)

Functions

func NewTfeConfig

func NewTfeConfig() *tfe.Config

func TftypeFromCtyType

func TftypeFromCtyType(in cty.Type) (tftypes.Type, error)

TFtypeFromCtyType is lifted from github.com/hashicorp/terraform-plugin-sdk/internal/plugin/convert It's very odd that this isn't exported because it was very valuable to parsing outputs

Types

type Client added in v0.3.0

type Client struct {
	Config Config
	Org    string
}

func (*Client) GetLatestConfig added in v0.3.0

func (c *Client) GetLatestConfig(stackName string, workspaceUid uuid.UUID) (*RunConfig, error)

func (*Client) GetWorkspace added in v0.3.0

func (c *Client) GetWorkspace(workspaceLocation WorkspaceLocation) (*Workspace, error)

type Config added in v0.3.0

type Config struct {
	BaseAddress string
	ApiKey      string
}

func NewConfig added in v0.3.0

func NewConfig() Config

func (*Config) ConstructUrl added in v0.3.0

func (c *Config) ConstructUrl(reqPath string) (*url.URL, error)

func (*Config) CreateTransport added in v0.3.0

func (c *Config) CreateTransport(baseTransport http.RoundTripper) http.RoundTripper

type Connection added in v0.3.0

type Connection struct {
	config.Connection
	Target string `json:"target"`
	Unused bool   `json:"unused"`
}

type Connections added in v0.3.0

type Connections map[string]Connection

type Output

type Output struct {
	Type  *cty.Type       `json:"type"`
	Value json.RawMessage `json:"value"`
}

type Outputs

type Outputs map[string]Output

func (Outputs) ToProtov5

func (o Outputs) ToProtov5() (tftypes.Value, error)

type RunConfig added in v0.3.0

type RunConfig struct {
	WorkspaceUid  uuid.UUID `json:"workspaceUid"`
	Source        string    `json:"source"`
	SourceVersion string    `json:"sourceVersion"`
	//Variables     Variables   `json:"variables"`
	Connections Connections `json:"connections"`
}

func GetWorkspaceConfig added in v0.3.0

func GetWorkspaceConfig(client *Client, workspaceLocation WorkspaceLocation) (*RunConfig, error)

type StateFile

type StateFile struct {
	Version          int     `json:"version"`
	TerraformVersion string  `json:"terraform_version"`
	Serial           int64   `json:"serial"`
	Lineage          string  `json:"lineage"`
	Outputs          Outputs `json:"outputs"`
}

func GetStateFile added in v0.3.0

func GetStateFile(tfeClient *tfe.Client, orgName string, workspaceLoc *WorkspaceLocation) (*StateFile, error)

type Workspace added in v0.3.0

type Workspace struct {
	Uid       uuid.UUID `json:"uid"`
	CreatedAt time.Time `json:"createdAt"`
	CreatedBy string    `json:"createdBy"`
	OrgName   string    `json:"orgName"`
	StackName string    `json:"stackName"`
	BlockName string    `json:"blockName"`
	EnvName   string    `json:"envName"`
	Status    string    `json:"status"`
	StatusAt  time.Time `json:"statusAt"`
}

type WorkspaceLocation added in v0.3.0

type WorkspaceLocation struct {
	Stack string `json:"stack"`
	Env   string `json:"env"`
	Block string `json:"block"`
}

func FullyQualifiedWorkspace added in v0.3.0

func FullyQualifiedWorkspace(baseStack, baseEnv, target string) *WorkspaceLocation

func WorkspaceLocationFromEnv added in v0.3.0

func WorkspaceLocationFromEnv() WorkspaceLocation

func (WorkspaceLocation) Id added in v0.3.0

func (w WorkspaceLocation) Id() string

Jump to

Keyboard shortcuts

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