migrate

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecutableExists

func ExecutableExists(cmd string) bool

func FormatValidationSummary

func FormatValidationSummary(imported int, result *ValidationResult) string

Types

type CacheSettings

type CacheSettings struct {
	Enabled  bool   `yaml:"enabled"`
	MaxSize  int    `yaml:"max_size"`
	TTL      string `yaml:"ttl"`
	TTLValue time.Duration
}

type ClaudeScanner

type ClaudeScanner struct{}

func (*ClaudeScanner) Name

func (s *ClaudeScanner) Name() string

func (*ClaudeScanner) Scan

type Config

type Config struct {
	Version string          `yaml:"version"`
	Servers []*ServerConfig `yaml:"servers"`
}

func LoadConfig

func LoadConfig(ctx context.Context, path string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type CursorScanner

type CursorScanner struct{}

func (*CursorScanner) Name

func (s *CursorScanner) Name() string

func (*CursorScanner) Scan

type DiscoveredServer

type DiscoveredServer struct {
	Name      string
	Source    string
	Transport registry.TransportType
	Stdio     *StdioConfig
	HTTP      *HTTPConfig
}

type GenericScanner

type GenericScanner struct{}

func (*GenericScanner) Name

func (s *GenericScanner) Name() string

func (*GenericScanner) Scan

type HTTPConfig

type HTTPConfig struct {
	URL     string            `yaml:"url"`
	Headers map[string]string `yaml:"headers"`
}

type ImportResult

type ImportResult struct {
	Imported   int
	Duplicates int
	Errors     []error
	Validation *ValidationResult
}

type MigrationSummary

type MigrationSummary struct {
	OpenCodeCount int
	ClaudeCount   int
	VSCodeCount   int
	CursorCount   int
	GenericCount  int
	TotalServers  int
}

func (*MigrationSummary) Total

func (s *MigrationSummary) Total() int

type Migrator

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

func NewMigrator

func NewMigrator() *Migrator

func (*Migrator) Import

func (m *Migrator) Import(ctx context.Context, servers []DiscoveredServer, targetPath string, yes bool) (*ImportResult, error)

func (*Migrator) ImportAll

func (m *Migrator) ImportAll(ctx context.Context, servers []DiscoveredServer, yes bool) (*ImportResult, error)

func (*Migrator) Scan

func (m *Migrator) Scan(ctx context.Context) (*ScanResult, error)

func (*Migrator) Summarize

func (m *Migrator) Summarize(servers []DiscoveredServer) *MigrationSummary

func (*Migrator) Validate

func (m *Migrator) Validate(servers []DiscoveredServer) *ValidationResult

type OpenCodeScanner

type OpenCodeScanner struct{}

func (*OpenCodeScanner) Name

func (s *OpenCodeScanner) Name() string

func (*OpenCodeScanner) Scan

type ScanResult

type ScanResult struct {
	Scanners []string
	Servers  []DiscoveredServer
}

type Scanner

type Scanner interface {
	Name() string
	Scan(ctx context.Context) ([]DiscoveredServer, error)
}

type ServerConfig

type ServerConfig struct {
	Name                string                 `yaml:"name"`
	Enabled             *bool                  `yaml:"enabled"`
	Transport           registry.TransportType `yaml:"transport"`
	Stdio               *StdioConfig           `yaml:"stdio,omitempty"`
	HTTP                *HTTPConfig            `yaml:"http,omitempty"`
	Timeout             string                 `yaml:"timeout"`
	TimeoutValue        time.Duration          `yaml:"-"`
	ConnectTimeout      string                 `yaml:"connect_timeout"`
	ConnectTimeoutValue time.Duration          `yaml:"-"`
	CacheSettings       *CacheSettings         `yaml:"cache_settings,omitempty"`
	SummarizeSettings   *SummarizeSettings     `yaml:"summarize_settings,omitempty"`
}

func (*ServerConfig) Validate

func (c *ServerConfig) Validate() error

type StdioConfig

type StdioConfig struct {
	Command string   `yaml:"command"`
	Args    []string `yaml:"args"`
	Env     []string `yaml:"env"`
	CWD     string   `yaml:"cwd"`
}

type SummarizeSettings

type SummarizeSettings struct {
	Enabled   bool   `yaml:"enabled"`
	MaxTokens int    `yaml:"max_tokens"`
	Strategy  string `yaml:"strategy"`
}

type VSCodeScanner

type VSCodeScanner struct{}

func (*VSCodeScanner) Name

func (s *VSCodeScanner) Name() string

func (*VSCodeScanner) Scan

type ValidationError

type ValidationError struct {
	ServerName string
	Message    string
	Field      string
}

func (*ValidationError) Error

func (e *ValidationError) Error() string

type ValidationResult

type ValidationResult struct {
	Errors   []ValidationError
	Warnings []ValidationError
}

func (*ValidationResult) ErrorCount

func (r *ValidationResult) ErrorCount() int

func (*ValidationResult) HasErrors

func (r *ValidationResult) HasErrors() bool

func (*ValidationResult) HasWarnings

func (r *ValidationResult) HasWarnings() bool

func (*ValidationResult) WarningCount

func (r *ValidationResult) WarningCount() int

type Validator

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

func NewValidator

func NewValidator() *Validator

func NewValidatorWithoutExecutableCheck

func NewValidatorWithoutExecutableCheck() *Validator

func (*Validator) ValidateServers

func (v *Validator) ValidateServers(servers []DiscoveredServer) *ValidationResult

Jump to

Keyboard shortcuts

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