workingset

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentWorkingSetVersion = 1
View Source
const MCPCatalogArtifactType = "application/vnd.docker.mcp.catalog.v1+json"

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, dao db.DAO, registryClient registryapi.Client, ociService oci.Service, id string, name string, servers []string) error

func Export

func Export(ctx context.Context, dao db.DAO, id string, filename string) error

func Import

func Import(ctx context.Context, dao db.DAO, ociService oci.Service, filename string) error

func List

func List(ctx context.Context, dao db.DAO, format OutputFormat) error

func Pull

func Pull(ctx context.Context, dao db.DAO, ociService oci.Service, ref string) error

func Push

func Push(ctx context.Context, dao db.DAO, id string, refStr string) error

func Remove

func Remove(ctx context.Context, dao db.DAO, id string) error

func Servers added in v0.26.0

func Servers(ctx context.Context, dao db.DAO, query string, workingSetID string, format OutputFormat) error

func Show

func Show(ctx context.Context, dao db.DAO, id string, format OutputFormat) error

func SupportedFormats

func SupportedFormats() []string

Types

type Catalog

type Catalog struct {
	Name    string          `json:"name"`
	Servers []CatalogServer `json:"servers"`
}

func NewCatalogFromWorkingSet

func NewCatalogFromWorkingSet(workingSet WorkingSet) Catalog

func (Catalog) ToWorkingSet

func (catalog Catalog) ToWorkingSet() WorkingSet

type CatalogServer

type CatalogServer struct {
	Type   string         `yaml:"type" json:"type"`
	Config map[string]any `yaml:"config,omitempty" json:"config,omitempty"`
	Tools  []string       `yaml:"tools,omitempty" json:"tools,omitempty"`

	// If type is "registry"
	Source string `yaml:"source,omitempty" json:"source,omitempty"`

	// If type is "image"
	Image string `yaml:"image,omitempty" json:"image,omitempty"`
}

type OutputFormat

type OutputFormat string
const (
	OutputFormatJSON          OutputFormat = "json"
	OutputFormatYAML          OutputFormat = "yaml"
	OutputFormatHumanReadable OutputFormat = "human"
)

type SearchResult added in v0.26.0

type SearchResult struct {
	ID      string   `json:"id" yaml:"id"`
	Name    string   `json:"name" yaml:"name"`
	Servers []Server `json:"servers" yaml:"servers"`
}

type Secret

type Secret struct {
	Provider SecretProvider `yaml:"provider" json:"provider" validate:"required,oneof=docker-desktop-store"`
}

Secret represents a secret configuration in a working set

type SecretProvider

type SecretProvider string
const (
	SecretProviderDockerDesktop SecretProvider = "docker-desktop-store"
)

type Server

type Server struct {
	Type    ServerType     `yaml:"type" json:"type" validate:"required,oneof=registry image"`
	Config  map[string]any `yaml:"config,omitempty" json:"config,omitempty"`
	Secrets string         `yaml:"secrets,omitempty" json:"secrets,omitempty"`
	Tools   []string       `yaml:"tools,omitempty" json:"tools,omitempty"`

	// ServerTypeRegistry only
	Source string `yaml:"source,omitempty" json:"source,omitempty" validate:"required_if=Type registry"`

	// ServerTypeImage only
	Image string `yaml:"image,omitempty" json:"image,omitempty" validate:"required_if=Type image"`

	// Optional snapshot of the server schema
	Snapshot *ServerSnapshot `yaml:"snapshot,omitempty" json:"snapshot,omitempty"`
}

Server represents a server configuration in a working set

type ServerSnapshot added in v0.26.0

type ServerSnapshot struct {
	Server catalog.Server `yaml:"server" json:"server"`
}

func ResolveSnapshot added in v0.26.0

func ResolveSnapshot(ctx context.Context, ociService oci.Service, server Server) (*ServerSnapshot, error)

type ServerType

type ServerType string
const (
	ServerTypeRegistry ServerType = "registry"
	ServerTypeImage    ServerType = "image"
)

type WorkingSet

type WorkingSet struct {
	Version int               `yaml:"version" json:"version" validate:"required,min=1,max=1"`
	ID      string            `yaml:"id" json:"id" validate:"required"`
	Name    string            `yaml:"name" json:"name" validate:"required,min=1"`
	Servers []Server          `yaml:"servers" json:"servers" validate:"dive"`
	Secrets map[string]Secret `yaml:"secrets,omitempty" json:"secrets,omitempty" validate:"dive"`
}

WorkingSet represents a collection of MCP servers and their configurations

func NewFromDb

func NewFromDb(dbSet *db.WorkingSet) WorkingSet

func (WorkingSet) ToDb

func (workingSet WorkingSet) ToDb() db.WorkingSet

func (*WorkingSet) Validate

func (workingSet *WorkingSet) Validate() error

Jump to

Keyboard shortcuts

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