datasource

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClient

func CreateClient(d *Datasource) (client *cvm.Client, err error)

Types

type Config

type Config struct {
	SecretId       string            `mapstructure:"secret_id" required:"true"`
	SecretKey      string            `mapstructure:"secret_key" required:"true"`
	Region         string            `mapstructure:"region" required:"true"`
	ImageIds       []string          `mapstructure:"image_ids"`
	ImageNameRegex string            `mapstructure:"image_name_regex"`
	Filters        map[string]string `mapstructure:"filters"`
	InstanceType   string            `mapstructure:"instance_type"`
}

func (*Config) FlatMapstructure

func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type Datasource

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

func (*Datasource) ConfigSpec

func (d *Datasource) ConfigSpec() hcldec.ObjectSpec

func (*Datasource) Configure

func (d *Datasource) Configure(raws ...interface{}) error

func (*Datasource) Execute

func (d *Datasource) Execute() (cty.Value, error)

func (*Datasource) OutputSpec

func (d *Datasource) OutputSpec() hcldec.ObjectSpec

type DatasourceOutput

type DatasourceOutput struct {
	Images []Image `mapstructure:"images"`
}

func (*DatasourceOutput) FlatMapstructure

func (*DatasourceOutput) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatDatasourceOutput. FlatDatasourceOutput is an auto-generated flat version of DatasourceOutput. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type FlatConfig

type FlatConfig struct {
	SecretId       *string           `mapstructure:"secret_id" required:"true" cty:"secret_id" hcl:"secret_id"`
	SecretKey      *string           `mapstructure:"secret_key" required:"true" cty:"secret_key" hcl:"secret_key"`
	Region         *string           `mapstructure:"region" required:"true" cty:"region" hcl:"region"`
	ImageIds       []string          `mapstructure:"image_ids" cty:"image_ids" hcl:"image_ids"`
	ImageNameRegex *string           `mapstructure:"image_name_regex" cty:"image_name_regex" hcl:"image_name_regex"`
	Filters        map[string]string `mapstructure:"filters" cty:"filters" hcl:"filters"`
	InstanceType   *string           `mapstructure:"instance_type" cty:"instance_type" hcl:"instance_type"`
}

FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConfig) HCL2Spec

func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Config. This spec is used by HCL to read the fields of Config. The decoded values from this spec will then be applied to a FlatConfig.

type FlatDatasourceOutput

type FlatDatasourceOutput struct {
	Images []FlatImage `mapstructure:"images" cty:"images" hcl:"images"`
}

FlatDatasourceOutput is an auto-generated flat version of DatasourceOutput. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatDatasourceOutput) HCL2Spec

func (*FlatDatasourceOutput) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a DatasourceOutput. This spec is used by HCL to read the fields of DatasourceOutput. The decoded values from this spec will then be applied to a FlatDatasourceOutput.

type FlatImage

type FlatImage struct {
	ImageId      *string   `mapstructure:"image_id" cty:"image_id" hcl:"image_id"`
	ImageName    *string   `mapstructure:"image_name" cty:"image_name" hcl:"image_name"`
	InstanceType *string   `mapstructure:"instance_type" cty:"instance_type" hcl:"instance_type"`
	Tags         []FlatTag `mapstructure:"tags" cty:"tags" hcl:"tags"`
}

FlatImage is an auto-generated flat version of Image. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatImage) HCL2Spec

func (*FlatImage) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Image. This spec is used by HCL to read the fields of Image. The decoded values from this spec will then be applied to a FlatImage.

type FlatTag

type FlatTag struct {
	TagKey   *string `mapstructure:"key" cty:"key" hcl:"key"`
	TagValue *string `mapstructure:"value" cty:"value" hcl:"value"`
}

FlatTag is an auto-generated flat version of Tag. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatTag) HCL2Spec

func (*FlatTag) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Tag. This spec is used by HCL to read the fields of Tag. The decoded values from this spec will then be applied to a FlatTag.

type Image

type Image struct {
	ImageId      string `mapstructure:"image_id"`
	ImageName    string `mapstructure:"image_name"`
	InstanceType string `mapstructure:"instance_type"`
	Tags         []Tag  `mapstructure:"tags"`
}

func (*Image) FlatMapstructure

func (*Image) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatImage. FlatImage is an auto-generated flat version of Image. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type Tag

type Tag struct {
	TagKey   string `mapstructure:"key"`
	TagValue string `mapstructure:"value"`
}

func (*Tag) FlatMapstructure

func (*Tag) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatTag. FlatTag is an auto-generated flat version of Tag. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

Jump to

Keyboard shortcuts

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