connections

package
v0.3.39 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// General
	ConnectionsFile = "./provider/gen/connections/connections.yaml"
)

Variables

View Source
var (
	TypeMap = map[string]Typer{
		"string": {
			AttrType:      "schema.StringAttribute",
			TfType:        "types.String",
			NewAttrType:   "types.StringType",
			Default:       "stringdefault.StaticString(\"\")",
			DefaultImport: "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault",
		},
		"number": {
			AttrType:      "schema.NumberAttribute",
			TfType:        "types.Number",
			NewAttrType:   "types.NumberType",
			Default:       "int64default.StaticInt64(0)",
			DefaultImport: "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default",
		},
		"bool": {
			AttrType:    "schema.BoolAttribute",
			TfType:      "types.Bool",
			NewAttrType: "types.BoolType",
		},
		"int": {
			AttrType:      "schema.Int64Attribute",
			TfType:        "types.Int64",
			NewAttrType:   "types.NumberType",
			Default:       "int64default.StaticInt64(0)",
			DefaultImport: "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default",
		},
		"int64": {
			AttrType:      "schema.Int64Attribute",
			TfType:        "types.Int64",
			NewAttrType:   "types.NumberType",
			Default:       "int64default.StaticInt64(0)",
			DefaultImport: "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default",
		},
	}
)

Functions

func GenerateConnections

func GenerateConnections() error

func TerraformResourceName

func TerraformResourceName(connection string) string

Types

type Attribute

type Attribute struct {
	Name                string `yaml:"name"`
	CapName             string `yaml:"-"`
	NameOverride        string `yaml:"name_override"`
	Alias               string `yaml:"alias"`
	Sensitive           bool   `yaml:"sensitive"`
	Required            bool   `yaml:"required"`
	Optional            bool   `yaml:"optional"`
	Computed            bool   `yaml:"computed"`
	Type                string `yaml:"type"`
	Description         string `yaml:"description"`
	Example             string `yaml:"example"`
	ExampleTypeOverride string `yaml:"example_type_override"`

	TfType      string `yaml:"-"`
	AttrType    string `yaml:"-"`
	NewAttrType string `yaml:"-"`
	AttrName    string `yaml:"-"`
	Default     string `yaml:"-"`
}

type Connection

type Connection struct {
	Name         string `yaml:"name"`
	Conn         string `yaml:"-"`
	Connection   string `yaml:"connection"`
	ResourceName string
	Type         string          `yaml:"type"`
	Attributes   []Attribute     `yaml:"attributes"`
	Config       string          `yaml:"config"`
	Datasource   bool            `yaml:"datasource"`
	Resource     bool            `yaml:"resource"`
	ExtraImports map[string]bool `yaml:"-"`
	Imports      string          `yaml:"-"`
}

type Connections

type Connections struct {
	Connections []Connection `yaml:"connections"`
}

type Importable

type Importable struct {
	Name         string
	ResourceName string
}

type Typer

type Typer struct {
	AttrType      string
	TfType        string
	NewAttrType   string
	Default       string
	DefaultImport string
}

Jump to

Keyboard shortcuts

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