Documentation
¶
Overview ¶
Package discovery defines the workload discovery contract vMCP uses to find backend workloads in both CLI and Kubernetes environments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRuntimeDiscovererFactory ¶ added in v0.77.0
func RegisterRuntimeDiscovererFactory(factory RuntimeDiscovererFactory)
RegisterRuntimeDiscovererFactory sets the factory NewRuntimeDiscoverer uses. pkg/vmcp/discovery/environment registers it from init.
Types ¶
type Discoverer ¶ added in v0.77.0
type Discoverer interface {
// ListWorkloadsInGroup returns all workloads that belong to the specified group
ListWorkloadsInGroup(ctx context.Context, groupName string) ([]TypedWorkload, error)
// GetWorkloadAsVMCPBackend retrieves workload details and converts it to a vmcp.Backend.
// The returned Backend should have all fields populated except AuthConfig,
// which will be set by the discoverer based on the auth configuration.
// Returns nil if the workload exists but is not accessible (e.g., no URL).
GetWorkloadAsVMCPBackend(ctx context.Context, workload TypedWorkload) (*vmcp.Backend, error)
}
Discoverer is the interface for workload managers used by vmcp. This interface contains only the methods needed for backend discovery, allowing both CLI and Kubernetes managers to implement it.
func NewRuntimeDiscoverer ¶ added in v0.77.0
func NewRuntimeDiscoverer(ctx context.Context) (Discoverer, error)
NewRuntimeDiscoverer creates the Discoverer for the current runtime environment through the registered factory.
type RuntimeDiscovererFactory ¶ added in v0.77.0
type RuntimeDiscovererFactory func(ctx context.Context) (Discoverer, error)
RuntimeDiscovererFactory creates the Discoverer for the current runtime environment.
type TypedWorkload ¶ added in v0.77.0
type TypedWorkload struct {
// Name is the name of the workload
Name string
// Type is the type of the workload (MCPServer or MCPRemoteProxy)
Type WorkloadType
}
TypedWorkload contains information about a discovered workload
type WorkloadType ¶ added in v0.77.0
type WorkloadType string
WorkloadType represents the type of workload
const ( // WorkloadTypeMCPServer represents an MCPServer workload WorkloadTypeMCPServer WorkloadType = "MCPServer" // WorkloadTypeMCPRemoteProxy represents an MCPRemoteProxy workload WorkloadTypeMCPRemoteProxy WorkloadType = "MCPRemoteProxy" // WorkloadTypeMCPServerEntry represents an MCPServerEntry workload (zero-infrastructure catalog entry) WorkloadTypeMCPServerEntry WorkloadType = "MCPServerEntry" )
Directories
¶
| Path | Synopsis |
|---|---|
|
Package environment registers the discovery.Discoverer that matches the runtime environment: Kubernetes workloads or the local workload manager.
|
Package environment registers the discovery.Discoverer that matches the runtime environment: Kubernetes workloads or the local workload manager. |
|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |