types

package
v0.77.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2026 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package types holds the group contracts, free of the Kubernetes-backed manager in pkg/groups.

Index

Constants

View Source
const DefaultGroup = "default"

DefaultGroup is the name of the default group for workloads

Variables

View Source
var (
	// ErrGroupAlreadyExists is returned when a group already exists
	ErrGroupAlreadyExists = httperr.WithCode(
		errors.New("group already exists"),
		http.StatusConflict,
	)

	// ErrGroupNotFound is returned when a group is not found
	ErrGroupNotFound = httperr.WithCode(
		errors.New("group not found"),
		http.StatusNotFound,
	)

	// ErrInvalidGroupName is returned when an invalid argument is provided
	ErrInvalidGroupName = httperr.WithCode(
		errors.New("invalid group name"),
		http.StatusBadRequest,
	)
)

Functions

This section is empty.

Types

type Group

type Group struct {
	Name              string   `json:"name"`
	RegisteredClients []string `json:"registered_clients"`
	Skills            []string `json:"skills,omitempty"`
	Plugins           []string `json:"plugins,omitempty"`
}

Group represents a logical grouping of MCP servers.

func (*Group) WriteJSON

func (g *Group) WriteJSON(w *os.File) error

WriteJSON serializes the Group to JSON and writes it to the provided writer

type Manager

type Manager interface {
	// Create creates a new group with the specified name.
	// Returns an error if a group with the same name already exists.
	Create(ctx context.Context, name string) error

	// Get retrieves a group by name.
	// Returns an error if the group does not exist.
	Get(ctx context.Context, name string) (*Group, error)

	// List returns all groups.
	List(ctx context.Context) ([]*Group, error)

	// Delete removes a group by name.
	// Returns an error if the group does not exist.
	Delete(ctx context.Context, name string) error

	// Exists checks if a group with the specified name exists.
	Exists(ctx context.Context, name string) (bool, error)

	// RegisterClients registers multiple clients with multiple groups.
	RegisterClients(ctx context.Context, groupNames []string, clientNames []string) error

	// UnregisterClients removes multiple clients from multiple groups.
	UnregisterClients(ctx context.Context, groupNames []string, clientNames []string) error

	// Update persists changes to an existing group.
	// The group must already exist; returns an error if it does not.
	Update(ctx context.Context, group *Group) error
}

Manager defines the interface for managing groups of MCP servers. It provides methods for creating, retrieving, listing, and deleting groups.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL