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

Function defaultConfigForPlugin

cli/cmd/init.go:175–189  ·  view source on GitHub ↗
(plugin cqapi.ListPlugin)

Source from the content-addressed store, hash-verified

173}
174
175func defaultConfigForPlugin(plugin cqapi.ListPlugin) *strings.Builder {
176 tmpl := `kind: {{.Kind}}
177spec:
178 name: {{.Name}}
179 path: {{.TeamName}}/{{.Name}}
180 version: {{.LatestVersion}}
181`
182 var buf bytes.Buffer
183 t := template.Must(template.New("config").Parse(tmpl))
184 _ = t.Execute(&buf, plugin)
185
186 sb := strings.Builder{}
187 sb.WriteString(buf.String())
188 return &sb
189}
190
191func configForSourcePlugin(source cqapi.ListPlugin, version *cqapi.PluginVersionDetails) string {
192 exampleConfig := extractYamlFromMarkdownCodeBlock(version.ExampleConfig)

Callers 2

configForSourcePluginFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected