Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSourceBase ¶
type DataSourceBase interface { Metadata(context.Context, datasource.MetadataRequest, *datasource.MetadataResponse) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) Client() *clients.Client }
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 }
Click to show internal directories.
Click to hide internal directories.