desktop

package
v0.0.6-beta Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	Component string `json:"component"`
	Action    string `json:"action"`
	Target    string `json:"target"`
	Current   string `json:"current"`
	Proposed  string `json:"proposed"`
	Risk      string `json:"risk"`
}

type HealthReport

type HealthReport struct {
	Database    string            `json:"database"`
	Role        string            `json:"role"`
	OplogWindow string            `json:"oplog_window"`
	OplogSize   string            `json:"oplog_size"`
	Connections string            `json:"connections"`
	Lag         map[string]string `json:"lag,omitempty"`
	Warnings    []string          `json:"warnings,omitempty"`
}

type IndexSpec

type IndexSpec struct {
	Collection         string `json:"collection"`
	Name               string `json:"name"`
	Keys               string `json:"keys"`
	Unique             bool   `json:"unique"`
	Sparse             bool   `json:"sparse"`
	PartialFilter      string `json:"partial_filter,omitempty"`
	ExpireAfterSeconds *int32 `json:"expire_after_seconds,omitempty"`
}

type MigrationRecord

type MigrationRecord struct {
	Version     string    `json:"version"`
	Description string    `json:"description"`
	AppliedAt   time.Time `json:"applied_at"`
	Checksum    string    `json:"checksum"`
}

type MigrationStatus

type MigrationStatus struct {
	Version     string     `json:"version"`
	Description string     `json:"description"`
	Applied     bool       `json:"applied"`
	AppliedAt   *time.Time `json:"applied_at,omitempty"`
}

type OplogEntry

type OplogEntry map[string]interface{}

type Service

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

func NewService

func NewService() *Service

func (*Service) Connect

func (s *Service) Connect(ctx context.Context, connectionString, database, username, password string) error

func (*Service) CreateMigration

func (s *Service) CreateMigration(ctx context.Context, name string) (string, error)

func (*Service) Disconnect

func (s *Service) Disconnect() error

func (*Service) Down

func (s *Service) Down(ctx context.Context, targetVersion string, dryRun bool) (string, error)

func (*Service) GetDBHealth

func (s *Service) GetDBHealth(ctx context.Context) (HealthReport, error)

func (*Service) GetMCPActivity

func (s *Service) GetMCPActivity(ctx context.Context, limit int) ([]map[string]interface{}, error)

func (*Service) GetMCPServerStatus

func (s *Service) GetMCPServerStatus(ctx context.Context) (map[string]interface{}, error)

func (*Service) GetMigrationsPath

func (s *Service) GetMigrationsPath() string

GetMigrationsPath returns the configured migrations output directory.

func (*Service) GetOplog

func (s *Service) GetOplog(ctx context.Context, limit int) ([]interface{}, error)

func (*Service) GetOpslog

func (s *Service) GetOpslog(ctx context.Context, search, version,
	regexStr, from, to string, limit int) ([]MigrationRecord, error)

func (*Service) GetSchemaDiff

func (s *Service) GetSchemaDiff(ctx context.Context) ([]Diff, error)

func (*Service) GetSchemaIndexes

func (s *Service) GetSchemaIndexes(ctx context.Context) ([]IndexSpec, error)

func (*Service) GetStatus

func (s *Service) GetStatus(ctx context.Context) ([]MigrationStatus, error)

func (*Service) SetMigrationsPath

func (s *Service) SetMigrationsPath(path string) error

SetMigrationsPath sets the output directory for generated migrations.

func (*Service) StartMCPServer

func (s *Service) StartMCPServer(ctx context.Context, transport, listenAddr string) (string, error)

func (*Service) StopMCPServer

func (s *Service) StopMCPServer(ctx context.Context) (string, error)

func (*Service) Up

func (s *Service) Up(ctx context.Context, target string, dryRun bool) (string, error)

Jump to

Keyboard shortcuts

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