config

package
v0.94.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultResourceName = "test"

DefaultResourceName is exported to allow assertions against the resources using the default name.

Variables

This section is empty.

Functions

func FromModel

func FromModel(t *testing.T, model ResourceModel) string

FromModel should be used in terraform acceptance tests for Config attribute to get string config from ResourceModel. Current implementation is really straightforward but it could be improved and tested. It may not handle all cases (like objects, lists, sets) correctly. TODO [SNOW-1501905]: use reflection to build config directly from model struct (or some other different way) TODO [SNOW-1501905]: add support for config.TestStepConfigFunc (to use as ConfigFile); the naive implementation would be to just create a tmp directory and save file there

Types

type ResourceModel

type ResourceModel interface {
	Resource() resources.Resource
	ResourceName() string
	SetResourceName(name string)
}

ResourceModel is the base interface all of our config models will implement. To allow easy implementation, ResourceModelMeta can be embedded inside the struct (and the struct will automatically implement it).

type ResourceModelMeta

type ResourceModelMeta struct {
	// contains filtered or unexported fields
}

func DefaultMeta

func DefaultMeta(resource resources.Resource) *ResourceModelMeta

func Meta

func Meta(resourceName string, resource resources.Resource) *ResourceModelMeta

func (*ResourceModelMeta) Resource

func (m *ResourceModelMeta) Resource() resources.Resource

func (*ResourceModelMeta) ResourceName

func (m *ResourceModelMeta) ResourceName() string

func (*ResourceModelMeta) SetResourceName

func (m *ResourceModelMeta) SetResourceName(name string)

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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