connections

package
v0.3.41 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MPL-2.0 Imports: 11 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(\"\")",
		},
		"number": {
			AttrType:    "schema.NumberAttribute",
			TfType:      "types.Number",
			NewAttrType: "types.NumberType",
			Default:     "int64default.StaticInt64(0)",
		},
		"bool": {
			AttrType:    "schema.BoolAttribute",
			TfType:      "types.Bool",
			NewAttrType: "types.BoolType",
		},
		"int": {
			AttrType:    "schema.Int64Attribute",
			TfType:      "types.Int64",
			NewAttrType: "types.NumberType",
			Default:     "int64default.StaticInt64(0)",
		},
		"int64": {
			AttrType:    "schema.Int64Attribute",
			TfType:      "types.Int64",
			NewAttrType: "types.NumberType",
			Default:     "int64default.StaticInt64(0)",
		},
	}
)

Functions

func GenerateConnections

func GenerateConnections() error

func TerraformResourceName

func TerraformResourceName(connection string) string

Types

type Attribute

type Attribute struct {
	Name                string `yaml:"name"`
	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"`
	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"`
}

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
}

Jump to

Keyboard shortcuts

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