databricks-cli/bundle/schema/docs.go

26 lines
406 B
Go
Raw Normal View History

2023-01-18 15:02:38 +00:00
package schema
import (
"os"
"gopkg.in/yaml.v2"
)
type Docs struct {
Documentation string `json:"documentation"`
Children map[string]Docs `json:"children"`
}
func LoadDocs(path string) (*Docs, error) {
2023-01-19 14:25:17 +00:00
bytes, err := os.ReadFile(path)
2023-01-18 15:02:38 +00:00
if err != nil {
return nil, err
}
docs := Docs{}
err = yaml.Unmarshal(bytes, &docs)
if err != nil {
return nil, err
}
return &docs, nil
}