Documentation ¶
Index ¶
- Variables
- type ResourceStore
- type TestProvider
- func (provider *TestProvider) ApplyResourceChange(request providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse
- func (provider *TestProvider) ConfigureProvider(request providers.ConfigureProviderRequest) providers.ConfigureProviderResponse
- func (provider *TestProvider) DataPrefix() string
- func (provider *TestProvider) DataSourceCount() int
- func (provider *TestProvider) DataSourceString() string
- func (provider *TestProvider) GetDataKey(id string) string
- func (provider *TestProvider) GetResourceKey(id string) string
- func (provider *TestProvider) PlanResourceChange(request providers.PlanResourceChangeRequest) providers.PlanResourceChangeResponse
- func (provider *TestProvider) ReadDataSource(request providers.ReadDataSourceRequest) providers.ReadDataSourceResponse
- func (provider *TestProvider) ReadResource(request providers.ReadResourceRequest) providers.ReadResourceResponse
- func (provider *TestProvider) ResourceCount() int
- func (provider *TestProvider) ResourcePrefix() string
- func (provider *TestProvider) ResourceString() string
- func (provider *TestProvider) SetDataPrefix(prefix string)
- func (provider *TestProvider) SetResourcePrefix(prefix string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProviderSchema = &providers.GetProviderSchemaResponse{ Provider: providers.Schema{ Block: &configschema.Block{ Attributes: map[string]*configschema.Attribute{ "data_prefix": {Type: cty.String, Optional: true}, "resource_prefix": {Type: cty.String, Optional: true}, }, }, }, ResourceTypes: map[string]providers.Schema{ "test_resource": { Block: &configschema.Block{ Attributes: map[string]*configschema.Attribute{ "id": {Type: cty.String, Optional: true, Computed: true}, "value": {Type: cty.String, Optional: true}, "interrupt_count": {Type: cty.Number, Optional: true}, }, }, }, }, DataSources: map[string]providers.Schema{ "test_data_source": { Block: &configschema.Block{ Attributes: map[string]*configschema.Attribute{ "id": {Type: cty.String, Required: true}, "value": {Type: cty.String, Computed: true}, "interrupt_count": {Type: cty.Number, Computed: true}, }, }, }, }, } )
Functions ¶
This section is empty.
Types ¶
type ResourceStore ¶
ResourceStore manages a set of cty.Value resources that can be shared between TestProvider providers.
type TestProvider ¶
type TestProvider struct { Provider *tofu.MockProvider Interrupt chan<- struct{} Store *ResourceStore // contains filtered or unexported fields }
TestProvider is a wrapper around tofu.MockProvider that defines dynamic schemas, and keeps track of the resources and data sources that it contains.
func NewProvider ¶
func NewProvider(store *ResourceStore) *TestProvider
func (*TestProvider) ApplyResourceChange ¶
func (provider *TestProvider) ApplyResourceChange(request providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse
func (*TestProvider) ConfigureProvider ¶
func (provider *TestProvider) ConfigureProvider(request providers.ConfigureProviderRequest) providers.ConfigureProviderResponse
func (*TestProvider) DataPrefix ¶
func (provider *TestProvider) DataPrefix() string
func (*TestProvider) DataSourceCount ¶
func (provider *TestProvider) DataSourceCount() int
func (*TestProvider) DataSourceString ¶
func (provider *TestProvider) DataSourceString() string
func (*TestProvider) GetDataKey ¶
func (provider *TestProvider) GetDataKey(id string) string
func (*TestProvider) GetResourceKey ¶
func (provider *TestProvider) GetResourceKey(id string) string
func (*TestProvider) PlanResourceChange ¶
func (provider *TestProvider) PlanResourceChange(request providers.PlanResourceChangeRequest) providers.PlanResourceChangeResponse
func (*TestProvider) ReadDataSource ¶
func (provider *TestProvider) ReadDataSource(request providers.ReadDataSourceRequest) providers.ReadDataSourceResponse
func (*TestProvider) ReadResource ¶
func (provider *TestProvider) ReadResource(request providers.ReadResourceRequest) providers.ReadResourceResponse
func (*TestProvider) ResourceCount ¶
func (provider *TestProvider) ResourceCount() int
func (*TestProvider) ResourcePrefix ¶
func (provider *TestProvider) ResourcePrefix() string
func (*TestProvider) ResourceString ¶
func (provider *TestProvider) ResourceString() string
func (*TestProvider) SetDataPrefix ¶
func (provider *TestProvider) SetDataPrefix(prefix string)
func (*TestProvider) SetResourcePrefix ¶
func (provider *TestProvider) SetResourcePrefix(prefix string)
Click to show internal directories.
Click to hide internal directories.