config

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2015 License: MPL-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(target interface{}, raws ...interface{}) (*mapstructure.Metadata, error)

Types

type Validator

type Validator struct {
	Required []string
	Optional []string
}

Validator is a helper that helps you validate the configuration of your resource, resource provider, etc.

At the most basic level, set the Required and Optional lists to be specifiers of keys that are required or optional. If a key shows up that isn't in one of these two lists, then an error is generated.

The "specifiers" allowed in this is a fairly rich syntax to help describe the format of your configuration:

  • Basic keys are just strings. For example: "foo" will match the "foo" key.

  • Nested structure keys can be matched by doing "listener.*.foo". This will verify that there is at least one listener element that has the "foo" key set.

  • The existence of a nested structure can be checked by simply doing "listener.*" which will verify that there is at least one element in the "listener" structure. This is NOT validating that "listener" is an array. It is validating that it is a nested structure in the configuration.

func (*Validator) Validate

func (v *Validator) Validate(
	c *terraform.ResourceConfig) (ws []string, es []error)

Jump to

Keyboard shortcuts

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