tfstructs

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Mostly adapted from tfschema - https://github.com/minamijoyo/tfschema

Index

Constants

This section is empty.

Variables

View Source
var Clients = make(map[string]*Client)
View Source
var OfficialProviders = make(map[string]TerraformProvider)
View Source
var TerraformBackends = map[string]*configschema.Block{}

Functions

func GetAllConfigs added in v0.0.2

func GetAllConfigs(filePath string, tempFilePath string) *configs.Module

func GetAttributeCompletion

func GetAttributeCompletion(result []lsp.CompletionItem, configType string, origConfig interface{}, fileDir string) (lsp.CompletionList, bool, error)

func GetConfig

func GetConfig(file *configs.File, posHCL hcl.Pos) (*hclsyntax.Body, interface{}, string)

func GetDiagnostics

func GetDiagnostics(fileName string, originalFile string) []lsp.Diagnostic

func GetLocalsForDiags added in v0.0.12

func GetLocalsForDiags(local configs.Local, targetDir string, variables map[string]cty.Value) hcl.Diagnostics

func GetModuleVariables

func GetModuleVariables(moduleAddr string, config hcl.Body, targetDir string) (map[string]*configs.Variable, bool)

func GetNestingAttributeCompletion

func GetNestingAttributeCompletion(attr *hcl.Attribute, result []lsp.CompletionItem, configType string, origConfig interface{}, fileDir string, posHCL hcl.Pos, origType reflect.Type) (lsp.CompletionList, bool, error)

func GetNestingCompletion

func GetNestingCompletion(blocks []*hcl.Block, result []lsp.CompletionItem, configType string, origConfig interface{}, fileDir string) (lsp.CompletionList, bool, error)

func GetTopLevelCompletion

func GetTopLevelCompletion() []lsp.CompletionItem

func GetTopLevelCompletionWithPos added in v0.0.12

func GetTopLevelCompletionWithPos(pos hcl.Pos) []lsp.CompletionItem

func GetTypeCompletion

func GetTypeCompletion(result []lsp.CompletionItem, fileDir string, hclFile *hclsyntax.Body, posHCL hcl.Pos, extraProvider string) (lsp.CompletionList, bool, error)

func GetVarAttributeCompletion added in v0.0.2

func GetVarAttributeCompletion(request GetVarAttributeRequest) []lsp.CompletionItem

Types

type Client

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

Client represents a tfschema Client.

func GetProvider

func GetProvider(providerType string, targetDir string) (*Client, error)

func GetProvisioner added in v0.0.4

func GetProvisioner(provisionerType string, targetDir string) (*Client, error)

func NewClient

func NewClient(providerName string, targetDir string) (*Client, error)

NewClient creates a new Client instance.

func NewProvisionerClient added in v0.0.4

func NewProvisionerClient(name string, targetDir string) (*Client, error)

NewProvisionerClient creates a new Client instance for Provisioner.

func (*Client) GetDataSourceTypes

func (c *Client) GetDataSourceTypes() ([]string, error)

GetDataSourceTypes returns a type definiton of resource type.

func (*Client) GetRawDataSourceTypeSchema

func (c *Client) GetRawDataSourceTypeSchema(dataSourceType string) (*providers.Schema, error)

GetRawDataSourceTypeSchema returns a type definiton of resource type.

func (*Client) GetRawProviderSchema

func (c *Client) GetRawProviderSchema() (*providers.Schema, error)

GetRawProviderSchema returns a raw type definiton of provider schema.

func (*Client) GetRawProvisionerSchema added in v0.0.4

func (c *Client) GetRawProvisionerSchema() (*provisioners.GetSchemaResponse, error)

GetRawProvisionerSchema returns a raw type definiton of provisioner schema.

func (*Client) GetRawResourceTypeSchema

func (c *Client) GetRawResourceTypeSchema(resourceType string) (*providers.Schema, error)

GetRawResourceTypeSchema returns a type definiton of resource type.

func (*Client) GetResourceTypes

func (c *Client) GetResourceTypes() ([]string, error)

GetResourceTypes returns a type definiton of resource type.

func (*Client) Kill

func (c *Client) Kill()

Kill kills a process of the plugin.

type GetVarAttributeRequest added in v0.0.2

type GetVarAttributeRequest struct {
	Variables hcl.Traversal
	Result    []lsp.CompletionItem
	Files     *configs.Module
	Config    hcl.Body
	FileDir   string
}

type TerraformProvider

type TerraformProvider struct {
	Name string
	Type string
}

type TerraformProvisionerSchema added in v0.0.4

type TerraformProvisionerSchema struct {
	Schema        *provisioners.GetSchemaResponse
	DecodedSchema cty.Value
	Diags         hcl.Diagnostics
}

func GetProvisionerSchema added in v0.0.4

func GetProvisionerSchema(provisionerType string, config hcl.Body, targetDir string) *TerraformProvisionerSchema

type TerraformSchema

type TerraformSchema struct {
	Schema        *providers.Schema
	DecodedSchema cty.Value
	Diags         hcl.Diagnostics
}

func GetDataSourceSchema

func GetDataSourceSchema(dataSourceType string, config hcl.Body, targetDir string, overrideProvider string) *TerraformSchema

func GetDataSourceSchemaForDiags added in v0.0.6

func GetDataSourceSchemaForDiags(dataSourceType string, config hcl.Body, targetDir string, overrideProvider string, variables map[string]cty.Value) *TerraformSchema

func GetProviderSchema added in v0.0.2

func GetProviderSchema(providerType string, config hcl.Body, targetDir string) *TerraformSchema

func GetProviderSchemaForDiags added in v0.0.6

func GetProviderSchemaForDiags(providerType string, config hcl.Body, targetDir string, variables map[string]cty.Value) *TerraformSchema

Need to combine with GetProviderSchema after testing

func GetResourceSchema

func GetResourceSchema(resourceType string, config hcl.Body, targetDir string, overrideProvider string) *TerraformSchema

func GetResourceSchemaForDiags added in v0.0.6

func GetResourceSchemaForDiags(resourceType string, config hcl.Body, targetDir string, overrideProvider string, variables map[string]cty.Value) *TerraformSchema

Jump to

Keyboard shortcuts

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