chore: update yaml tag for tools (#2356)

Update yaml tag in tools from `kind` to `type`.

Upcoming PRs: 
* Update config in `/tests` and `/docs`

Will resolve other unit tests failure in the final PR to keep things
simpler.
This commit is contained in:
Yuan Teoh
2026-01-26 17:53:37 -08:00
committed by Yuan Teoh
parent 83ebaf20b7
commit 474e480b2c
369 changed files with 4707 additions and 5752 deletions

View File

@@ -26,7 +26,7 @@ import (
"github.com/jackc/pgx/v5/pgxpool"
)
const kind string = "postgres-database-overview"
const resourceType string = "postgres-database-overview"
const databaseOverviewStatement = `
SELECT
@@ -43,8 +43,8 @@ const databaseOverviewStatement = `
`
func init() {
if !tools.Register(kind, newConfig) {
panic(fmt.Sprintf("tool type %q already registered", kind))
if !tools.Register(resourceType, newConfig) {
panic(fmt.Sprintf("tool type %q already registered", resourceType))
}
}
@@ -63,7 +63,7 @@ type compatibleSource interface {
type Config struct {
Name string `yaml:"name" validate:"required"`
Type string `yaml:"kind" validate:"required"`
Type string `yaml:"type" validate:"required"`
Source string `yaml:"source" validate:"required"`
Description string `yaml:"description"`
AuthRequired []string `yaml:"authRequired"`
@@ -73,7 +73,7 @@ type Config struct {
var _ tools.ToolConfig = Config{}
func (cfg Config) ToolConfigType() string {
return kind
return resourceType
}
func (cfg Config) Initialize(srcs map[string]sources.Source) (tools.Tool, error) {