writer

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package writer contains the SyncWriter interface and implementations

Package writer contains the SyncWriter interface and implementations

Package writer contains the SyncWriter interface and implementations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncWriter

type SyncWriter interface {
	// Store saves a UpstreamRegistry instance to persistent storage for a specific registry
	Store(ctx context.Context, registryName string, reg *toolhivetypes.UpstreamRegistry) error
}

SyncWriter defines the interface needed to persist the list of MCP servers.

func NewDBSyncWriter added in v0.3.2

func NewDBSyncWriter(pool *pgxpool.Pool) (SyncWriter, error)

NewDBSyncWriter creates a new dbSyncWriter with the given connection pool. The caller is responsible for closing the pool when done.

func NewSyncWriter added in v0.3.2

func NewSyncWriter(cfg *config.Config, storageManager sources.StorageManager, pool *pgxpool.Pool) (SyncWriter, error)

NewSyncWriter creates a SyncWriter based on the configured storage type.

For file-based storage, it returns the provided StorageManager which implements the SyncWriter interface.

For database storage, it creates and returns a database-backed SyncWriter that stores registry data directly in PostgreSQL.

Jump to

Keyboard shortcuts

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