Help us shape the future of Go! Take the 2026 Go Developer Survey

testprovider

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MPL-2.0 Imports: 5 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 DataSource

type DataSource struct {
	// DataSource interface methods
	MetadataMethod func(context.Context, datasource.MetadataRequest, *datasource.MetadataResponse)
	ReadMethod     func(context.Context, datasource.ReadRequest, *datasource.ReadResponse)
	SchemaMethod   func(context.Context, datasource.SchemaRequest, *datasource.SchemaResponse)
}

Declarative datasource.DataSource for unit testing.

func (*DataSource) Metadata added in v0.13.0

Metadata satisfies the datasource.DataSource interface.

func (*DataSource) Read

Read satisfies the datasource.DataSource interface.

func (*DataSource) Schema added in v0.17.0

Schema satisfies the datasource.DataSource interface.

type DataSourceConfigValidator

type DataSourceConfigValidator struct {
	// DataSourceConfigValidator interface methods
	DescriptionMethod         func(context.Context) string
	MarkdownDescriptionMethod func(context.Context) string
	ValidateDataSourceMethod  func(context.Context, datasource.ValidateConfigRequest, *datasource.ValidateConfigResponse)
}

Declarative datasource.ConfigValidator for unit testing.

func (*DataSourceConfigValidator) Description

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

Description satisfies the datasource.ConfigValidator interface.

func (*DataSourceConfigValidator) MarkdownDescription

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

MarkdownDescription satisfies the datasource.ConfigValidator interface.

func (*DataSourceConfigValidator) ValidateDataSource added in v0.10.0

Validate satisfies the datasource.ConfigValidator interface.

type DataSourceWithConfigValidators

type DataSourceWithConfigValidators struct {
	*DataSource

	// DataSourceWithConfigValidators interface methods
	ConfigValidatorsMethod func(context.Context) []datasource.ConfigValidator
}

Declarative datasource.DataSourceWithConfigValidators for unit testing.

func (*DataSourceWithConfigValidators) ConfigValidators

ConfigValidators satisfies the datasource.DataSourceWithConfigValidators interface.

type DataSourceWithConfigure added in v0.12.0

type DataSourceWithConfigure struct {
	*DataSource

	// DataSourceWithConfigure interface methods
	ConfigureMethod func(context.Context, datasource.ConfigureRequest, *datasource.ConfigureResponse)
}

Declarative datasource.DataSourceWithConfigure for unit testing.

func (*DataSourceWithConfigure) Configure added in v0.12.0

Configure satisfies the datasource.DataSourceWithConfigure interface.

type DataSourceWithValidateConfig

type DataSourceWithValidateConfig struct {
	*DataSource

	// DataSourceWithValidateConfig interface methods
	ValidateConfigMethod func(context.Context, datasource.ValidateConfigRequest, *datasource.ValidateConfigResponse)
}

Declarative datasource.DataSourceWithValidateConfig for unit testing.

func (*DataSourceWithValidateConfig) ValidateConfig

ValidateConfig satisfies the datasource.DataSourceWithValidateConfig interface.

type Function added in v1.5.0

type Function struct {
	// Function interface methods
	DefinitionMethod func(context.Context, function.DefinitionRequest, *function.DefinitionResponse)
	MetadataMethod   func(context.Context, function.MetadataRequest, *function.MetadataResponse)
	RunMethod        func(context.Context, function.RunRequest, *function.RunResponse)
}

Declarative function.Function for unit testing.

func (*Function) Definition added in v1.5.0

Definition satisfies the function.Function interface.

func (*Function) Metadata added in v1.5.0

Metadata satisfies the function.Function interface.

func (*Function) Run added in v1.5.0

Run satisfies the function.Function interface.

type Provider

type Provider struct {
	// Provider interface methods
	MetadataMethod    func(context.Context, provider.MetadataRequest, *provider.MetadataResponse)
	ConfigureMethod   func(context.Context, provider.ConfigureRequest, *provider.ConfigureResponse)
	SchemaMethod      func(context.Context, provider.SchemaRequest, *provider.SchemaResponse)
	DataSourcesMethod func(context.Context) []func() datasource.DataSource
	ResourcesMethod   func(context.Context) []func() resource.Resource
}

Declarative provider.Provider for unit testing.

func (*Provider) Configure

Configure satisfies the provider.Provider interface.

func (*Provider) DataSources added in v0.12.0

func (p *Provider) DataSources(ctx context.Context) []func() datasource.DataSource

DataSources satisfies the provider.Provider interface.

func (*Provider) Metadata added in v1.0.0

Metadata satisfies the provider.Provider interface.

func (*Provider) Resources added in v0.12.0

func (p *Provider) Resources(ctx context.Context) []func() resource.Resource

Resources satisfies the provider.Provider interface.

func (*Provider) Schema added in v0.17.0

Schema satisfies the provider.Provider interface.

type ProviderConfigValidator

type ProviderConfigValidator struct {
	// ConfigValidator interface methods
	DescriptionMethod         func(context.Context) string
	MarkdownDescriptionMethod func(context.Context) string
	ValidateProviderMethod    func(context.Context, provider.ValidateConfigRequest, *provider.ValidateConfigResponse)
}

Declarative provider.ConfigValidator for unit testing.

func (*ProviderConfigValidator) Description

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

Description satisfies the provider.ConfigValidator interface.

func (*ProviderConfigValidator) MarkdownDescription

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

MarkdownDescription satisfies the provider.ConfigValidator interface.

func (*ProviderConfigValidator) ValidateProvider added in v0.10.0

Validate satisfies the provider.ConfigValidator interface.

type ProviderWithConfigValidators

type ProviderWithConfigValidators struct {
	*Provider

	// ProviderWithConfigValidators interface methods
	ConfigValidatorsMethod func(context.Context) []provider.ConfigValidator
}

Declarative provider.ProviderWithConfigValidators for unit testing.

func (*ProviderWithConfigValidators) ConfigValidators

GetMetaSchema satisfies the provider.ProviderWithConfigValidators interface.

type ProviderWithFunctions added in v1.5.0

type ProviderWithFunctions struct {
	*Provider

	// ProviderWithFunctions interface methods
	FunctionsMethod func(context.Context) []func() function.Function
}

Declarative provider.ProviderWithFunctions for unit testing.

func (*ProviderWithFunctions) Functions added in v1.5.0

func (p *ProviderWithFunctions) Functions(ctx context.Context) []func() function.Function

Functions satisfies the provider.ProviderWithFunctions interface.

type ProviderWithMetaSchema added in v0.11.0

type ProviderWithMetaSchema struct {
	*Provider

	// ProviderWithMetaSchema interface methods
	MetaSchemaMethod func(context.Context, provider.MetaSchemaRequest, *provider.MetaSchemaResponse)
}

Declarative provider.ProviderWithMetaSchema for unit testing.

func (*ProviderWithMetaSchema) MetaSchema added in v0.17.0

MetaSchema satisfies the provider.ProviderWithMetaSchema interface.

type ProviderWithValidateConfig

type ProviderWithValidateConfig struct {
	*Provider

	// ProviderWithValidateConfig interface methods
	ValidateConfigMethod func(context.Context, provider.ValidateConfigRequest, *provider.ValidateConfigResponse)
}

Declarative provider.ProviderWithValidateConfig for unit testing.

func (*ProviderWithValidateConfig) ValidateConfig

GetMetaSchema satisfies the provider.ProviderWithValidateConfig interface.

type Resource

Declarative resource.Resource for unit testing.

func (*Resource) Create

Create satisfies the resource.Resource interface.

func (*Resource) Delete

Delete satisfies the resource.Resource interface.

func (*Resource) Metadata added in v0.13.0

Metadata satisfies the resource.Resource interface.

func (*Resource) Read

Read satisfies the resource.Resource interface.

func (*Resource) Schema added in v0.17.0

Schema satisfies the resource.Resource interface.

func (*Resource) Update

Update satisfies the resource.Resource interface.

type ResourceConfigValidator

type ResourceConfigValidator struct {
	// ResourceConfigValidator interface methods
	DescriptionMethod         func(context.Context) string
	MarkdownDescriptionMethod func(context.Context) string
	ValidateResourceMethod    func(context.Context, resource.ValidateConfigRequest, *resource.ValidateConfigResponse)
}

Declarative resource.ConfigValidator for unit testing.

func (*ResourceConfigValidator) Description

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

Description satisfies the resource.ConfigValidator interface.

func (*ResourceConfigValidator) MarkdownDescription

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

MarkdownDescription satisfies the resource.ConfigValidator interface.

func (*ResourceConfigValidator) ValidateResource added in v0.10.0

Validate satisfies the resource.ConfigValidator interface.

type ResourceWithConfigValidators

type ResourceWithConfigValidators struct {
	*Resource

	// ResourceWithConfigValidators interface methods
	ConfigValidatorsMethod func(context.Context) []resource.ConfigValidator
}

Declarative resource.ResourceWithConfigValidators for unit testing.

func (*ResourceWithConfigValidators) ConfigValidators

ConfigValidators satisfies the resource.ResourceWithConfigValidators interface.

type ResourceWithConfigure added in v0.12.0

type ResourceWithConfigure struct {
	*Resource

	// ResourceWithConfigure interface methods
	ConfigureMethod func(context.Context, resource.ConfigureRequest, *resource.ConfigureResponse)
}

Declarative resource.ResourceWithConfigure for unit testing.

func (*ResourceWithConfigure) Configure added in v0.12.0

Configure satisfies the resource.ResourceWithConfigure interface.

type ResourceWithConfigureAndImportState added in v0.12.0

type ResourceWithConfigureAndImportState struct {
	*Resource

	// ResourceWithConfigureAndImportState interface methods
	ConfigureMethod func(context.Context, resource.ConfigureRequest, *resource.ConfigureResponse)

	// ResourceWithImportState interface methods
	ImportStateMethod func(context.Context, resource.ImportStateRequest, *resource.ImportStateResponse)
}

Declarative resource.ResourceWithConfigureAndImportState for unit testing.

func (*ResourceWithConfigureAndImportState) Configure added in v0.12.0

Configure satisfies the resource.ResourceWithConfigureAndImportState interface.

func (*ResourceWithConfigureAndImportState) ImportState added in v0.12.0

ImportState satisfies the resource.ResourceWithImportState interface.

type ResourceWithConfigureAndModifyPlan added in v0.12.0

type ResourceWithConfigureAndModifyPlan struct {
	*Resource

	// ResourceWithConfigureAndModifyPlan interface methods
	ConfigureMethod func(context.Context, resource.ConfigureRequest, *resource.ConfigureResponse)

	// ResourceWithModifyPlan interface methods
	ModifyPlanMethod func(context.Context, resource.ModifyPlanRequest, *resource.ModifyPlanResponse)
}

Declarative resource.ResourceWithConfigureAndModifyPlan for unit testing.

func (*ResourceWithConfigureAndModifyPlan) Configure added in v0.12.0

Configure satisfies the resource.ResourceWithConfigureAndModifyPlan interface.

func (*ResourceWithConfigureAndModifyPlan) ModifyPlan added in v0.12.0

ModifyPlan satisfies the resource.ResourceWithModifyPlan interface.

type ResourceWithConfigureAndUpgradeState added in v0.12.0

type ResourceWithConfigureAndUpgradeState struct {
	*Resource

	// ResourceWithConfigureAndUpgradeState interface methods
	ConfigureMethod func(context.Context, resource.ConfigureRequest, *resource.ConfigureResponse)

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

Declarative resource.ResourceWithConfigureAndUpgradeState for unit testing.

func (*ResourceWithConfigureAndUpgradeState) Configure added in v0.12.0

Configure satisfies the resource.ResourceWithConfigureAndUpgradeState interface.

func (*ResourceWithConfigureAndUpgradeState) UpgradeState added in v0.12.0

UpgradeState satisfies the resource.ResourceWithUpgradeState interface.

type ResourceWithImportState

type ResourceWithImportState struct {
	*Resource

	// ResourceWithImportState interface methods
	ImportStateMethod func(context.Context, resource.ImportStateRequest, *resource.ImportStateResponse)
}

Declarative resource.ResourceWithImportState for unit testing.

func (*ResourceWithImportState) ImportState

ImportState satisfies the resource.ResourceWithImportState interface.

type ResourceWithModifyPlan

type ResourceWithModifyPlan struct {
	*Resource

	// ResourceWithModifyPlan interface methods
	ModifyPlanMethod func(context.Context, resource.ModifyPlanRequest, *resource.ModifyPlanResponse)
}

Declarative resource.ResourceWithModifyPlan for unit testing.

func (*ResourceWithModifyPlan) ModifyPlan

ModifyPlan satisfies the resource.ResourceWithModifyPlan interface.

type ResourceWithMoveState added in v1.6.0

type ResourceWithMoveState struct {
	*Resource

	// ResourceWithMoveState interface methods
	MoveStateMethod func(context.Context) []resource.StateMover
}

Declarative resource.ResourceWithMoveState for unit testing.

func (*ResourceWithMoveState) MoveState added in v1.6.0

MoveState satisfies the resource.ResourceWithMoveState interface.

type ResourceWithUpgradeState

type ResourceWithUpgradeState struct {
	*Resource

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

Declarative resource.ResourceWithUpgradeState for unit testing.

func (*ResourceWithUpgradeState) UpgradeState

UpgradeState satisfies the resource.ResourceWithUpgradeState interface.

type ResourceWithValidateConfig

type ResourceWithValidateConfig struct {
	*Resource

	// ResourceWithValidateConfig interface methods
	ValidateConfigMethod func(context.Context, resource.ValidateConfigRequest, *resource.ValidateConfigResponse)
}

Declarative resource.ResourceWithValidateConfig for unit testing.

func (*ResourceWithValidateConfig) ValidateConfig

ValidateConfig satisfies the resource.ResourceWithValidateConfig interface.

Jump to

Keyboard shortcuts

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