base

package
v0.86.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSourceBase

func NewPackerDataSource

func NewPackerDataSource(params DataSourceParams) DataSourceBase

NewPackerDataSource creates a new data source with common attributes injected

If TypeNamePrefix is provided, it will be suffixed with `packer_` If TypeNamePrefix is not provided, it will be set to `packer`

type DataSourceConfigValidatorMixin

type DataSourceConfigValidatorMixin interface {
	ConfigValidators(context.Context) []datasource.ConfigValidator
}

func NewDataSourceConfigValidatorMixin

func NewDataSourceConfigValidatorMixin(validators ...datasource.ConfigValidator) DataSourceConfigValidatorMixin

type DataSourceParams

type DataSourceParams struct {
	// An prefix for the data source type (Optional)
	// Typically used for the HCP product name
	// Formatted with lowercase and underscores
	// Example: `"packer"` for `data.hcp_packer_version`
	TypeNamePrefix string
	// The data source type's identifier (Required)
	// Formatted with lowercase and underscores
	// Example: `"version"` for `data.hcp_packer_version` if TypeNamePrefix is `"packer"`
	TypeName string
	// The data source type's "pretty" name (Optional)
	// Formatted with title case and spaces
	// Used for templated error messages and descriptions of common schema elements
	// If not provided, the TypeName will be used instead
	// Example: `"Version"` for `data.hcp_packer_version` or `"Channel Assignment"` for `hcp_packer_channel_assignment`
	PrettyName string
	// The data source schema (Required)
	// Additional common schema elements will be injected by `NewDataSourceBase`
	Schema schema.Schema
}

Jump to

Keyboard shortcuts

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