(plugin cqapi.ListPlugin)
| 173 | } |
| 174 | |
| 175 | func defaultConfigForPlugin(plugin cqapi.ListPlugin) *strings.Builder { |
| 176 | tmpl := `kind: {{.Kind}} |
| 177 | spec: |
| 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 | |
| 191 | func configForSourcePlugin(source cqapi.ListPlugin, version *cqapi.PluginVersionDetails) string { |
| 192 | exampleConfig := extractYamlFromMarkdownCodeBlock(version.ExampleConfig) |
no test coverage detected