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 ¶
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.