version

package
v1.0.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package version provides use cases for version management.

Index

Constants

View Source
const (
	// DefaultVersion is the version assigned to fresh installations.
	DefaultVersion = "0.0.1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service implements ports.MigrationService. It manages version tracking and migration execution.

func NewService

func NewService(repository ports.VersionRepository, logger *output.Logger) *Service

NewService creates a new migration service.

func (*Service) CheckAndMigrate

func (s *Service) CheckAndMigrate(ctx context.Context, homeDir string, target string) (*domainVersion.Version, error)

CheckAndMigrate checks if migration is needed and applies migrations.

func (*Service) GetCurrentVersion

func (s *Service) GetCurrentVersion(homeDir string) (*domainVersion.Version, error)

GetCurrentVersion returns the current version stored in homeDir.

func (*Service) ListMigrations

func (s *Service) ListMigrations() []domainVersion.Migration

ListMigrations returns all registered migrations.

func (*Service) RegisterMigration

func (s *Service) RegisterMigration(migration domainVersion.Migration)

RegisterMigration registers a migration to the service.

Jump to

Keyboard shortcuts

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