testprovider

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MPL-2.0 Imports: 5 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 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