store

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuiltInData

type BuiltInData struct {
	// contains filtered or unexported fields
}

func NewBuiltInData

func NewBuiltInData(
	ctx context.Context,
	overlayBaseDir string,
	builtInSnapshotMaxAge time.Duration,
	opts ...BuiltInDataOption,
) (data *BuiltInData, err error)

func (*BuiltInData) ApplyServerSetupOverlay added in v0.1.13

func (d *BuiltInData) ApplyServerSetupOverlay(
	ctx context.Context,
	bundleID bundleitemutils.BundleID,
	serverID spec.MCPServerID,
	patch spec.MCPBuiltInServerOverlay,
	reset bool,
) (spec.MCPServerConfig, error)

ApplyServerSetupOverlay merges a setup overlay fragment into the stored overlay (or starts fresh when reset is true), validates the resulting config, persists, and returns the rebuilt config.

func (*BuiltInData) Close

func (d *BuiltInData) Close() error

func (*BuiltInData) FindBuiltInServerByID

func (d *BuiltInData) FindBuiltInServerByID(
	ctx context.Context,
	serverID spec.MCPServerID,
) (spec.MCPServerConfig, error)

func (*BuiltInData) GetBuiltInBundle

func (d *BuiltInData) GetBuiltInBundle(
	ctx context.Context,
	id bundleitemutils.BundleID,
) (spec.MCPBundle, error)

func (*BuiltInData) GetBuiltInServer

func (d *BuiltInData) GetBuiltInServer(
	ctx context.Context,
	bundleID bundleitemutils.BundleID,
	serverID spec.MCPServerID,
) (spec.MCPServerConfig, error)

func (*BuiltInData) ListBuiltInData

func (d *BuiltInData) ListBuiltInData(ctx context.Context) (
	bundleMap map[bundleitemutils.BundleID]spec.MCPBundle,
	serverMap map[bundleitemutils.BundleID]map[spec.MCPServerID]spec.MCPServerConfig,
	err error,
)

func (*BuiltInData) SetBundleEnabled

func (d *BuiltInData) SetBundleEnabled(
	ctx context.Context,
	id bundleitemutils.BundleID,
	enabled bool,
) (spec.MCPBundle, error)

func (*BuiltInData) SetServerEnabled

func (d *BuiltInData) SetServerEnabled(
	ctx context.Context,
	bundleID bundleitemutils.BundleID,
	serverID spec.MCPServerID,
	enabled bool,
) (spec.MCPServerConfig, error)

type BuiltInDataOption

type BuiltInDataOption func(*BuiltInData)

func WithMCPBundlesFS

func WithMCPBundlesFS(fsys fs.FS, rootDir string) BuiltInDataOption

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewMCPStore

func NewMCPStore(ctx context.Context, baseDir string) (*Store, error)

func (*Store) ApplyBuiltInServerSetupOverlay added in v0.1.13

func (s *Store) ApplyBuiltInServerSetupOverlay(
	ctx context.Context,
	bundleID bundleitemutils.BundleID,
	serverID spec.MCPServerID,
	patch spec.MCPBuiltInServerOverlay,
	reset bool,
) (*spec.MCPServerConfig, error)

ApplyBuiltInServerSetupOverlay routes a built-in setup patch to the overlay.

func (*Store) ApplyUserServerSetupOverlay added in v0.1.13

func (s *Store) ApplyUserServerSetupOverlay(
	ctx context.Context,
	bundleID bundleitemutils.BundleID,
	serverID spec.MCPServerID,
	patch spec.MCPBuiltInServerOverlay,
) (*spec.MCPServerConfig, error)

ApplyUserServerSetupOverlay patches only runtime setup fields on a user-owned server. It intentionally avoids PutMCPServer because setup patching should not have create/replace semantics and must preserve raw server.Enabled even when the containing bundle is disabled.

func (*Store) Close

func (s *Store) Close() error

func (*Store) DeleteMCPBundle

func (s *Store) DeleteMCPBundle(
	ctx context.Context,
	req *spec.DeleteMCPBundleRequest,
) (*spec.DeleteMCPBundleResponse, error)

func (*Store) DeleteMCPServer

func (s *Store) DeleteMCPServer(
	ctx context.Context,
	req *spec.DeleteMCPServerRequest,
) (*spec.DeleteMCPServerResponse, error)

func (*Store) GetMCPServer

func (s *Store) GetMCPServer(
	ctx context.Context,
	req *spec.GetMCPServerRequest,
) (*spec.GetMCPServerResponse, error)

func (*Store) GetMCPSettings added in v0.1.13

func (s *Store) GetMCPSettings(ctx context.Context) (*spec.MCPSettings, error)

GetMCPSettings is an internal read used at init and by settings patch.

func (*Store) ListMCPBundles

func (s *Store) ListMCPBundles(
	ctx context.Context,
	req *spec.ListMCPBundlesRequest,
) (*spec.ListMCPBundlesResponse, error)

func (*Store) ListMCPServers

func (s *Store) ListMCPServers(
	ctx context.Context,
	req *spec.ListMCPServersRequest,
) (*spec.ListMCPServersResponse, error)

func (*Store) PatchMCPBundle

func (s *Store) PatchMCPBundle(
	ctx context.Context,
	req *spec.PatchMCPBundleRequest,
) (*spec.PatchMCPBundleResponse, error)

func (*Store) PatchMCPServerEnabled

func (*Store) PatchMCPServerPolicy

func (s *Store) PatchMCPServerPolicy(
	ctx context.Context,
	req *spec.PatchMCPServerPolicyRequest,
) (*spec.PatchMCPServerPolicyResponse, error)

func (*Store) PatchMCPSettings added in v0.1.13

func (s *Store) PatchMCPSettings(
	ctx context.Context,
	req *spec.PatchMCPSettingsRequest,
) (*spec.MCPSettings, error)

func (*Store) PutMCPBundle

func (s *Store) PutMCPBundle(
	ctx context.Context,
	req *spec.PutMCPBundleRequest,
) (*spec.PutMCPBundleResponse, error)

func (*Store) PutMCPServer

func (s *Store) PutMCPServer(
	ctx context.Context,
	req *spec.PutMCPServerRequest,
) (*spec.PutMCPServerResponse, error)

Jump to

Keyboard shortcuts

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