testprovider

package
Version: v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package testprovider contains a fully declarative provider for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributePlanModifier

type AttributePlanModifier struct {
	// AttributePlanModifier interface methods
	DescriptionMethod         func(context.Context) string
	MarkdownDescriptionMethod func(context.Context) string
	ModifyMethod              func(context.Context, tfsdk.ModifyAttributePlanRequest, *tfsdk.ModifyAttributePlanResponse)
}

Declarative tfsdk.AttributePlanModifier for unit testing.

func (*AttributePlanModifier) Description

func (m *AttributePlanModifier) Description(ctx context.Context) string

Description satisfies the tfsdk.AttributePlanModifier interface.

func (*AttributePlanModifier) MarkdownDescription

func (m *AttributePlanModifier) MarkdownDescription(ctx context.Context) string

MarkdownDescription satisfies the tfsdk.AttributePlanModifier interface.

func (*AttributePlanModifier) Modify

Modify satisfies the tfsdk.AttributePlanModifier interface.

type AttributeValidator

type AttributeValidator struct {
	// AttributeValidator interface methods
	DescriptionMethod         func(context.Context) string
	MarkdownDescriptionMethod func(context.Context) string
	ValidateMethod            func(context.Context, tfsdk.ValidateAttributeRequest, *tfsdk.ValidateAttributeResponse)
}

Declarative tfsdk.AttributeValidator for unit testing.

func (*AttributeValidator) Description

func (v *AttributeValidator) Description(ctx context.Context) string

Description satisfies the tfsdk.AttributeValidator interface.

func (*AttributeValidator) MarkdownDescription

func (v *AttributeValidator) MarkdownDescription(ctx context.Context) string

MarkdownDescription satisfies the tfsdk.AttributeValidator interface.

func (*AttributeValidator) Validate

Validate satisfies the tfsdk.AttributeValidator interface.

type DataSource

type DataSource struct {
	// DataSource interface methods
	ReadMethod func(context.Context, tfsdk.ReadDataSourceRequest, *tfsdk.ReadDataSourceResponse)
}

Declarative tfsdk.DataSource for unit testing.

func (*DataSource) Read

Read satisfies the tfsdk.DataSource interface.

type DataSourceConfigValidator

type DataSourceConfigValidator struct {
	// DataSourceConfigValidator interface methods
	DescriptionMethod         func(context.Context) string
	MarkdownDescriptionMethod func(context.Context) string
	ValidateDataSourceMethod  func(context.Context, tfsdk.ValidateDataSourceConfigRequest, *tfsdk.ValidateDataSourceConfigResponse)
}

Declarative tfsdk.DataSourceConfigValidator for unit testing.

func (*DataSourceConfigValidator) Description

func (v *DataSourceConfigValidator) Description(ctx context.Context) string

Description satisfies the tfsdk.DataSourceConfigValidator interface.

func (*DataSourceConfigValidator) MarkdownDescription

func (v *DataSourceConfigValidator) MarkdownDescription(ctx context.Context) string

MarkdownDescription satisfies the tfsdk.DataSourceConfigValidator interface.

func (*DataSourceConfigValidator) ValidateDataSource added in v0.10.0

Validate satisfies the tfsdk.DataSourceConfigValidator interface.

type DataSourceType

type DataSourceType struct {
	// DataSourceType interface methods
	GetSchemaMethod     func(context.Context) (tfsdk.Schema, diag.Diagnostics)
	NewDataSourceMethod func(context.Context, tfsdk.Provider) (tfsdk.DataSource, diag.Diagnostics)
}

Declarative tfsdk.DataSourceType for unit testing.

func (*DataSourceType) GetSchema

func (t *DataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)

GetSchema satisfies the tfsdk.DataSourceType interface.

func (*DataSourceType) NewDataSource

NewDataSource satisfies the tfsdk.DataSourceType interface.

type DataSourceWithConfigValidators

type DataSourceWithConfigValidators struct {
	*DataSource

	// DataSourceWithConfigValidators interface methods
	ConfigValidatorsMethod func(context.Context) []tfsdk.DataSourceConfigValidator
}

Declarative tfsdk.DataSourceWithConfigValidators for unit testing.

func (*DataSourceWithConfigValidators) ConfigValidators

ConfigValidators satisfies the tfsdk.DataSourceWithConfigValidators interface.

type DataSourceWithValidateConfig

type DataSourceWithValidateConfig struct {
	*DataSource

	// DataSourceWithValidateConfig interface methods
	ValidateConfigMethod func(context.Context, tfsdk.ValidateDataSourceConfigRequest, *tfsdk.ValidateDataSourceConfigResponse)
}

Declarative tfsdk.DataSourceWithValidateConfig for unit testing.

func (*DataSourceWithValidateConfig) ValidateConfig

ValidateConfig satisfies the tfsdk.DataSourceWithValidateConfig interface.

type Provider

type Provider struct {
	// Provider interface methods
	ConfigureMethod      func(context.Context, tfsdk.ConfigureProviderRequest, *tfsdk.ConfigureProviderResponse)
	GetDataSourcesMethod func(context.Context) (map[string]tfsdk.DataSourceType, diag.Diagnostics)
	GetResourcesMethod   func(context.Context) (map[string]tfsdk.ResourceType, diag.Diagnostics)
	GetSchemaMethod      func(context.Context) (tfsdk.Schema, diag.Diagnostics)
}

Declarative tfsdk.Provider for unit testing.

func (*Provider) Configure

GetSchema satisfies the tfsdk.Provider interface.

func (*Provider) GetDataSources

func (p *Provider) GetDataSources(ctx context.Context) (map[string]tfsdk.DataSourceType, diag.Diagnostics)

GetDataSources satisfies the tfsdk.Provider interface.

func (*Provider) GetResources

func (p *Provider) GetResources(ctx context.Context) (map[string]tfsdk.ResourceType, diag.Diagnostics)

GetResources satisfies the tfsdk.Provider interface.

func (*Provider) GetSchema

func (p *Provider) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)

GetSchema satisfies the tfsdk.Provider interface.

type ProviderConfigValidator

type ProviderConfigValidator struct {
	// ProviderConfigValidator interface methods
	DescriptionMethod         func(context.Context) string
	MarkdownDescriptionMethod func(context.Context) string
	ValidateProviderMethod    func(context.Context, tfsdk.ValidateProviderConfigRequest, *tfsdk.ValidateProviderConfigResponse)
}

Declarative tfsdk.ProviderConfigValidator for unit testing.

func (*ProviderConfigValidator) Description

func (v *ProviderConfigValidator) Description(ctx context.Context) string

Description satisfies the tfsdk.ProviderConfigValidator interface.

func (*ProviderConfigValidator) MarkdownDescription

func (v *ProviderConfigValidator) MarkdownDescription(ctx context.Context) string

MarkdownDescription satisfies the tfsdk.ProviderConfigValidator interface.

func (*ProviderConfigValidator) ValidateProvider added in v0.10.0

Validate satisfies the tfsdk.ProviderConfigValidator interface.

type ProviderWithConfigValidators

type ProviderWithConfigValidators struct {
	*Provider

	// ProviderWithConfigValidators interface methods
	ConfigValidatorsMethod func(context.Context) []tfsdk.ProviderConfigValidator
}

Declarative tfsdk.ProviderWithConfigValidators for unit testing.

func (*ProviderWithConfigValidators) ConfigValidators

GetMetaSchema satisfies the tfsdk.ProviderWithConfigValidators interface.

type ProviderWithProviderMeta

type ProviderWithProviderMeta struct {
	*Provider

	// ProviderWithProviderMeta interface methods
	GetMetaSchemaMethod func(context.Context) (tfsdk.Schema, diag.Diagnostics)
}

Declarative tfsdk.ProviderWithProviderMeta for unit testing.

func (*ProviderWithProviderMeta) GetMetaSchema

GetMetaSchema satisfies the tfsdk.ProviderWithProviderMeta interface.

type ProviderWithValidateConfig

type ProviderWithValidateConfig struct {
	*Provider

	// ProviderWithValidateConfig interface methods
	ValidateConfigMethod func(context.Context, tfsdk.ValidateProviderConfigRequest, *tfsdk.ValidateProviderConfigResponse)
}

Declarative tfsdk.ProviderWithValidateConfig for unit testing.

func (*ProviderWithValidateConfig) ValidateConfig

GetMetaSchema satisfies the tfsdk.ProviderWithValidateConfig interface.

type Resource

Declarative tfsdk.Resource for unit testing.

func (*Resource) Create

Create satisfies the tfsdk.Resource interface.

func (*Resource) Delete

Delete satisfies the tfsdk.Resource interface.

func (*Resource) Read

Read satisfies the tfsdk.Resource interface.

func (*Resource) Update

Update satisfies the tfsdk.Resource interface.

type ResourceConfigValidator

type ResourceConfigValidator struct {
	// ResourceConfigValidator interface methods
	DescriptionMethod         func(context.Context) string
	MarkdownDescriptionMethod func(context.Context) string
	ValidateResourceMethod    func(context.Context, tfsdk.ValidateResourceConfigRequest, *tfsdk.ValidateResourceConfigResponse)
}

Declarative tfsdk.ResourceConfigValidator for unit testing.

func (*ResourceConfigValidator) Description

func (v *ResourceConfigValidator) Description(ctx context.Context) string

Description satisfies the tfsdk.ResourceConfigValidator interface.

func (*ResourceConfigValidator) MarkdownDescription

func (v *ResourceConfigValidator) MarkdownDescription(ctx context.Context) string

MarkdownDescription satisfies the tfsdk.ResourceConfigValidator interface.

func (*ResourceConfigValidator) ValidateResource added in v0.10.0

Validate satisfies the tfsdk.ResourceConfigValidator interface.

type ResourceType

type ResourceType struct {
	// ResourceType interface methods
	GetSchemaMethod   func(context.Context) (tfsdk.Schema, diag.Diagnostics)
	NewResourceMethod func(context.Context, tfsdk.Provider) (tfsdk.Resource, diag.Diagnostics)
}

Declarative tfsdk.ResourceType for unit testing.

func (*ResourceType) GetSchema

func (t *ResourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics)

GetSchema satisfies the tfsdk.ResourceType interface.

func (*ResourceType) NewResource

NewResource satisfies the tfsdk.ResourceType interface.

type ResourceWithConfigValidators

type ResourceWithConfigValidators struct {
	*Resource

	// ResourceWithConfigValidators interface methods
	ConfigValidatorsMethod func(context.Context) []tfsdk.ResourceConfigValidator
}

Declarative tfsdk.ResourceWithConfigValidators for unit testing.

func (*ResourceWithConfigValidators) ConfigValidators

ConfigValidators satisfies the tfsdk.ResourceWithConfigValidators interface.

type ResourceWithImportState

type ResourceWithImportState struct {
	*Resource

	// ResourceWithImportState interface methods
	ImportStateMethod func(context.Context, tfsdk.ImportResourceStateRequest, *tfsdk.ImportResourceStateResponse)
}

Declarative tfsdk.ResourceWithImportState for unit testing.

func (*ResourceWithImportState) ImportState

ImportState satisfies the tfsdk.ResourceWithImportState interface.

type ResourceWithModifyPlan

type ResourceWithModifyPlan struct {
	*Resource

	// ResourceWithModifyPlan interface methods
	ModifyPlanMethod func(context.Context, tfsdk.ModifyResourcePlanRequest, *tfsdk.ModifyResourcePlanResponse)
}

Declarative tfsdk.ResourceWithModifyPlan for unit testing.

func (*ResourceWithModifyPlan) ModifyPlan

ModifyPlan satisfies the tfsdk.ResourceWithModifyPlan interface.

type ResourceWithUpgradeState

type ResourceWithUpgradeState struct {
	*Resource

	// ResourceWithUpgradeState interface methods
	UpgradeStateMethod func(context.Context) map[int64]tfsdk.ResourceStateUpgrader
}

Declarative tfsdk.ResourceWithUpgradeState for unit testing.

func (*ResourceWithUpgradeState) UpgradeState

UpgradeState satisfies the tfsdk.ResourceWithUpgradeState interface.

type ResourceWithValidateConfig

type ResourceWithValidateConfig struct {
	*Resource

	// ResourceWithValidateConfig interface methods
	ValidateConfigMethod func(context.Context, tfsdk.ValidateResourceConfigRequest, *tfsdk.ValidateResourceConfigResponse)
}

Declarative tfsdk.ResourceWithValidateConfig for unit testing.

func (*ResourceWithValidateConfig) ValidateConfig

ValidateConfig satisfies the tfsdk.ResourceWithValidateConfig interface.

Jump to

Keyboard shortcuts

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