testprovider

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package testprovider is a declarative provider for implementing unit testing within this Go module.

Index

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 (DataSource) Schema

func (DataSource) ValidateConfig

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 (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 (Protov5Provider) Stop added in v1.6.0

func (Protov5Provider) ValidateConfig added in v1.6.0

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 (Provider) DataSourcesMap

func (p Provider) DataSourcesMap() map[string]datasource.DataSource

func (Provider) ResourcesMap

func (p Provider) ResourcesMap() map[string]resource.Resource

func (Provider) Schema

func (Provider) Stop

func (Provider) ValidateConfig

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 (Resource) Delete

func (Resource) ImportState

func (Resource) PlanChange

func (Resource) Read

func (Resource) Schema

func (Resource) Update

func (Resource) UpgradeState

func (Resource) ValidateConfig

Jump to

Keyboard shortcuts

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