diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go b/vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go index b80b223..2a66a06 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/field_reader.go | |||
@@ -3,6 +3,7 @@ package schema | |||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | "strconv" | 5 | "strconv" |
6 | "strings" | ||
6 | ) | 7 | ) |
7 | 8 | ||
8 | // FieldReaders are responsible for decoding fields out of data into | 9 | // FieldReaders are responsible for decoding fields out of data into |
@@ -41,6 +42,13 @@ func (r *FieldReadResult) ValueOrZero(s *Schema) interface{} { | |||
41 | return s.ZeroValue() | 42 | return s.ZeroValue() |
42 | } | 43 | } |
43 | 44 | ||
45 | // SchemasForFlatmapPath tries its best to find a sequence of schemas that | ||
46 | // the given dot-delimited attribute path traverses through. | ||
47 | func SchemasForFlatmapPath(path string, schemaMap map[string]*Schema) []*Schema { | ||
48 | parts := strings.Split(path, ".") | ||
49 | return addrToSchema(parts, schemaMap) | ||
50 | } | ||
51 | |||
44 | // addrToSchema finds the final element schema for the given address | 52 | // addrToSchema finds the final element schema for the given address |
45 | // and the given schema. It returns all the schemas that led to the final | 53 | // and the given schema. It returns all the schemas that led to the final |
46 | // schema. These are in order of the address (out to in). | 54 | // schema. These are in order of the address (out to in). |