INNER CODE UNIT · Go
ExportResource
VladRassokhin/intellij-hcl · schemas-extractor/template/generate-schema.go:91
func ExportResource(r *schema.Resource) SchemaInfo {
return schemaMap(r.Schema).Export()
}
// schemaMap is a wrapper that adds nice functions on top of schemas.
type schemaMap map[string]*schema.Schema
// Export exports the format of this schema.
func (m schemaMap) Export() SchemaInfo {
result := make(SchemaInfo)
for k, v := range m {
item := export(v)
result[k] = item
}
return result
}
func export(v *schema.Schema) SchemaDefinition {