Documentation ¶
Index ¶
- func CreateTestFile(t *testing.T, contents string) string
- func CreateTestFiles(t *testing.T, contents ...string) string
- func LoadState() (*hclconfig.Config, error)
- func NewParser(callback hclconfig.WalkCallback, variables map[string]string, ...) *hclconfig.Parser
- func ParseVars(value map[string]cty.Value) map[string]interface{}
- func RegisterResource(name string, r types.Resource, p Provider)
- func SaveState(c *hclconfig.Config) error
- type ConfigWrapper
- type Provider
- type Providers
- type ProvidersImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTestFile ¶
createTestFile creates a hcl file from the given contents
func CreateTestFiles ¶
createsTestFiles creates a temporary directory and stores temp files into it returns directory containing files cleanup function usage: d, cleanup := createTestFiles(t, `cluster "abc" {}`, `docs "bcdf" {}`) defer cleanup()
func NewParser ¶ added in v0.5.38
func NewParser(callback hclconfig.WalkCallback, variables map[string]string, variablesFiles []string) *hclconfig.Parser
setupHCLConfig configures the HCLConfig package and registers the custom types
func ParseVars ¶
ParseVars converts a map[string]cty.Value into map[string]interface where the interface are generic go types like string, number, bool, slice, map
func RegisterResource ¶ added in v0.5.38
RegisterResource allows a resource to register itself with the parser
Types ¶
type ConfigWrapper ¶ added in v0.5.38
type ConfigWrapper struct { Type string Value interface{} }
ConfigWrapper allows the provider config to be deserialized to a type
type Provider ¶ added in v0.5.38
type Provider interface { // Init is called when the provider is created, it is passed a logger that // can be used for any logging purposes. Any other clients must be created // by the provider Init(types.Resource, logger.Logger) error // Create is called when a resource does not exist or creation has previously // failed and 'up' is run Create() error // Destroy is called when a resource is failed or created and 'down' is run Destroy() error // Refresh is called when a resource is created and 'up' is run Refresh() error // Changed returns if a resource has changed since the last run Changed() (bool, error) // Lookup is a utility to determine the existence of a resource Lookup() ([]string, error) }
Provider defines an interface to be implemented by providers
type Providers ¶ added in v0.5.38
func NewProviders ¶ added in v0.5.38
type ProvidersImpl ¶ added in v0.5.38
type ProvidersImpl struct {
// contains filtered or unexported fields
}
func (*ProvidersImpl) GetProvider ¶ added in v0.5.38
func (p *ProvidersImpl) GetProvider(r types.Resource) Provider