teststep

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pointer

func Pointer[T any](in T) *T

Pointer returns a pointer to any type.

Types

type Config

type Config interface {
	HasConfigurationFiles() bool
	HasProviderBlock(context.Context) (bool, error)
	HasTerraformBlock(context.Context) (bool, error)
	Write(context.Context, string) error
}

Config defines an interface implemented by all types that represent Terraform configuration:

  • [config.configurationDirectory]
  • [config.configurationFile]
  • [config.configurationString]

func Configuration

func Configuration(req ConfigurationRequest) Config

Configuration uses the supplied ConfigurationRequest to determine which of the types that implement Config to instantiate. If none of the fields in ConfigurationRequest are populated nil is returned.

type ConfigurationRequest

type ConfigurationRequest struct {
	Directory *string
	File      *string
	Raw       *string
}

ConfigurationRequest is used by the Configuration func to determine the underlying type to instantiate.

func (ConfigurationRequest) Validate

func (c ConfigurationRequest) Validate() error

Validate ensures that only one of Directory, File or Raw are non-empty.

type PrepareConfigurationRequest

type PrepareConfigurationRequest struct {
	Directory             config.TestStepConfigFunc
	File                  config.TestStepConfigFunc
	Raw                   string
	TestStepConfigRequest config.TestStepConfigRequest
}

PrepareConfigurationRequest is used to simplify the generation of a ConfigurationRequest which is required when calling the Configuration func.

func (PrepareConfigurationRequest) Exec

Exec returns a Configuration request which is required when calling the Configuration func.

Jump to

Keyboard shortcuts

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