Documentation ¶
Overview ¶
Package testprovider is a declarative provider for implementing unit testing within this Go module.
Index ¶
- type DataSource
- type Protov5Provider
- func (p Protov5Provider) Configure(ctx context.Context, req provider.Protov5ConfigureRequest, ...)
- func (p Protov5Provider) DataSourcesMap() map[string]datasource.DataSource
- func (p Protov5Provider) ResourcesMap() map[string]resource.Resource
- func (p Protov5Provider) Schema(ctx context.Context, req provider.Protov5SchemaRequest, ...)
- func (p Protov5Provider) Stop(ctx context.Context, req provider.Protov5StopRequest, ...)
- func (p Protov5Provider) ValidateConfig(ctx context.Context, req provider.Protov5ValidateConfigRequest, ...)
- type Provider
- func (p Provider) Configure(ctx context.Context, req provider.ConfigureRequest, ...)
- func (p Provider) DataSourcesMap() map[string]datasource.DataSource
- func (p Provider) ResourcesMap() map[string]resource.Resource
- func (p Provider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse)
- func (p Provider) Stop(ctx context.Context, req provider.StopRequest, resp *provider.StopResponse)
- func (p Provider) ValidateConfig(ctx context.Context, req provider.ValidateConfigRequest, ...)
- type Resource
- func (r Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r Resource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r Resource) PlanChange(ctx context.Context, req resource.PlanChangeRequest, ...)
- func (r Resource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- func (r Resource) UpgradeState(ctx context.Context, req resource.UpgradeStateRequest, ...)
- func (r Resource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSource ¶
type DataSource struct { ReadResponse *datasource.ReadResponse SchemaResponse *datasource.SchemaResponse ValidateConfigResponse *datasource.ValidateConfigResponse }
func (DataSource) Read ¶
func (d DataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
func (DataSource) Schema ¶
func (d DataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
func (DataSource) ValidateConfig ¶
func (d DataSource) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, resp *datasource.ValidateConfigResponse)
type Protov5Provider ¶ added in v1.6.0
type Protov5Provider struct { ConfigureResponse *provider.Protov5ConfigureResponse DataSources map[string]DataSource Resources map[string]Resource SchemaResponse *provider.Protov5SchemaResponse StopResponse *provider.Protov5StopResponse ValidateConfigResponse *provider.Protov5ValidateConfigResponse }
Protov5Provider is a declarative provider implementation for unit testing in this Go module. The provider is unimplemented except for the Schema method.
func (Protov5Provider) Configure ¶ added in v1.6.0
func (p Protov5Provider) Configure(ctx context.Context, req provider.Protov5ConfigureRequest, resp *provider.Protov5ConfigureResponse)
func (Protov5Provider) DataSourcesMap ¶ added in v1.6.0
func (p Protov5Provider) DataSourcesMap() map[string]datasource.DataSource
func (Protov5Provider) ResourcesMap ¶ added in v1.6.0
func (p Protov5Provider) ResourcesMap() map[string]resource.Resource
func (Protov5Provider) Schema ¶ added in v1.6.0
func (p Protov5Provider) Schema(ctx context.Context, req provider.Protov5SchemaRequest, resp *provider.Protov5SchemaResponse)
func (Protov5Provider) Stop ¶ added in v1.6.0
func (p Protov5Provider) Stop(ctx context.Context, req provider.Protov5StopRequest, resp *provider.Protov5StopResponse)
func (Protov5Provider) ValidateConfig ¶ added in v1.6.0
func (p Protov5Provider) ValidateConfig(ctx context.Context, req provider.Protov5ValidateConfigRequest, resp *provider.Protov5ValidateConfigResponse)
type Provider ¶
type Provider struct { ConfigureResponse *provider.ConfigureResponse DataSources map[string]DataSource Resources map[string]Resource SchemaResponse *provider.SchemaResponse StopResponse *provider.StopResponse ValidateConfigResponse *provider.ValidateConfigResponse }
Provider is a declarative provider implementation for unit testing in this Go module.
func (Provider) Configure ¶
func (p Provider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse)
func (Provider) DataSourcesMap ¶
func (p Provider) DataSourcesMap() map[string]datasource.DataSource
func (Provider) Schema ¶
func (p Provider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse)
func (Provider) Stop ¶
func (p Provider) Stop(ctx context.Context, req provider.StopRequest, resp *provider.StopResponse)
func (Provider) ValidateConfig ¶
func (p Provider) ValidateConfig(ctx context.Context, req provider.ValidateConfigRequest, resp *provider.ValidateConfigResponse)
type Resource ¶
type Resource struct { CreateResponse *resource.CreateResponse DeleteResponse *resource.DeleteResponse ImportStateResponse *resource.ImportStateResponse // Planning happens multiple ways during a single TestStep, so statically // defining only the response is very problematic. PlanChangeFunc func(context.Context, resource.PlanChangeRequest, *resource.PlanChangeResponse) ReadResponse *resource.ReadResponse SchemaResponse *resource.SchemaResponse UpdateResponse *resource.UpdateResponse UpgradeStateResponse *resource.UpgradeStateResponse ValidateConfigResponse *resource.ValidateConfigResponse }
func (Resource) Create ¶
func (r Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (Resource) Delete ¶
func (r Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (Resource) ImportState ¶
func (r Resource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
func (Resource) PlanChange ¶
func (r Resource) PlanChange(ctx context.Context, req resource.PlanChangeRequest, resp *resource.PlanChangeResponse)
func (Resource) Read ¶
func (r Resource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (Resource) Schema ¶
func (r Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (Resource) Update ¶
func (r Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
func (Resource) UpgradeState ¶
func (r Resource) UpgradeState(ctx context.Context, req resource.UpgradeStateRequest, resp *resource.UpgradeStateResponse)
func (Resource) ValidateConfig ¶
func (r Resource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse)
Click to show internal directories.
Click to hide internal directories.