datastore

package
v0.80.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package datastore provides CLI commands for datastore management operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(cfg Config) (*cobra.Command, error)

NewCommand creates a new datastore command with all subcommands.

Types

type CatalogLoaderFunc

type CatalogLoaderFunc func(ctx context.Context, envKey string, cfg *config.Config, dom domain.Domain) (fdatastore.CatalogStore, error)

CatalogLoaderFunc loads the catalog store for a given environment.

type CatalogMergerFunc

type CatalogMergerFunc func(ctx context.Context, envDir domain.EnvDir, name, timestamp string, catalog fdatastore.CatalogStore) error

CatalogMergerFunc merges migration datastore to catalog.

type CatalogSyncerFunc

type CatalogSyncerFunc func(ctx context.Context, envDir domain.EnvDir, catalog fdatastore.CatalogStore) error

CatalogSyncerFunc syncs the entire local datastore to catalog.

type Config

type Config struct {
	// Logger is the logger to use for command output. Required.
	Logger logger.Logger

	// Domain is the domain context for the commands. Required.
	Domain domain.Domain

	// Deps holds optional dependencies that can be overridden.
	// If fields are nil, production defaults are used.
	Deps Deps
}

Config holds the configuration for datastore commands.

func (Config) Validate

func (c Config) Validate() error

Validate checks that all required configuration fields are set.

type ConfigLoaderFunc

type ConfigLoaderFunc func(dom domain.Domain, envKey string, lggr logger.Logger) (*config.Config, error)

ConfigLoaderFunc loads the configuration for a given domain and environment.

type Deps

type Deps struct {
	// ConfigLoader loads the configuration for a domain and environment.
	// Default: config.Load
	ConfigLoader ConfigLoaderFunc

	// CatalogLoader loads the catalog store.
	// Default: cldcatalog.LoadCatalog
	CatalogLoader CatalogLoaderFunc

	// FileMerger merges changeset datastore to local files.
	// Default: envDir.MergeChangesetDataStore
	FileMerger FileMergerFunc

	// CatalogMerger merges changeset datastore to catalog.
	// Default: envDir.MergeChangesetDataStoreCatalog
	CatalogMerger CatalogMergerFunc

	// CatalogSyncer syncs the entire local datastore to catalog.
	// Default: envDir.SyncDataStoreToCatalog
	CatalogSyncer CatalogSyncerFunc
}

Deps holds the injectable dependencies for datastore commands. All fields are optional; nil values will use production defaults.

type FileMergerFunc

type FileMergerFunc func(envDir domain.EnvDir, name, timestamp string) error

FileMergerFunc merges migration datastore to local files.

Jump to

Keyboard shortcuts

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