ToURI (types/mcp.go)

devops-ai-guidelines · 02-mcp-for-devops/code/06/pkg/types/mcp.go · go · MIT
infra

Defines generic Kubernetes resource structs with URI helper.

// Source: https://github.com/VersusControl/devops-ai-guidelines | License: MIT | Copyright 2025 VersusControl
// Provided via justclaw.it.com; keep this notice with the code.
package types

import (
	"encoding/json"
)

// Resource represents a Kubernetes resource exposed through MCP
type Resource struct {
	URI         string            `json:"uri"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	MimeType    string            `json:"mimeType"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

// ResourceContent holds the actual resource data
type ResourceContent struct {
	URI      string          `json:"uri"`
	MimeType string          `json:"mimeType"`
	Text     string          `json:"text,omitempty"`
	Blob     []byte          `

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key