INNER CODE UNIT · Go

exportValue

VladRassokhin/intellij-hcl · schemas-extractor/template/generate-schema.go:143

func exportValue(value interface{}, t string) *SchemaElement {
	s2, ok := value.(*schema.Schema)
	if ok {
		return &SchemaElement{Type: "SchemaElements", ElementsType: shortenType(fmt.Sprintf("%s", s2.Type))}
	}
	r2, ok := value.(*schema.Resource)
	if ok {
		return &SchemaElement{Type: "SchemaInfo", Info: ExportResource(r2)}
	}
	vt, ok := value.(schema.ValueType)
	if ok {
	  return &SchemaElement{Value: shortenType(fmt.Sprintf("%v", vt))}
	}
	// Unknown case
	return &SchemaElement{Type: t, Value: fmt.Sprintf("%v", value)}
}

func Generate(provider *schema.Provider, name string, outputPath string) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…