MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / NewGenerator

Function NewGenerator

cli/internal/docs/generator.go:58–69  ·  view source on GitHub ↗

NewGenerator creates a new generator for the given tables. The tables are sorted by name. pluginName is optional and is used in markdown only

(pluginName string, tables schema.Tables)

Source from the content-addressed store, hash-verified

56// NewGenerator creates a new generator for the given tables.
57// The tables are sorted by name. pluginName is optional and is used in markdown only
58func NewGenerator(pluginName string, tables schema.Tables) *Generator {
59 sortedTables := make(schema.Tables, 0, len(tables))
60 for _, t := range tables {
61 sortedTables = append(sortedTables, t.Copy(nil))
62 }
63 sortTables(sortedTables)
64
65 return &Generator{
66 tables: sortedTables,
67 pluginName: pluginName,
68 }
69}
70
71func (g *Generator) Generate(dir string, format Format) error {
72 if err := os.MkdirAll(dir, os.ModePerm); err != nil {

Callers 1

TestGeneratePluginDocsFunction · 0.85

Calls 1

sortTablesFunction · 0.85

Tested by 1

TestGeneratePluginDocsFunction · 0.68