Documentation
¶
Overview ¶
Package version provides use cases for version management.
Index ¶
- Constants
- type Service
- func (s *Service) CheckAndMigrate(ctx context.Context, homeDir string, target string) (*domainVersion.Version, error)
- func (s *Service) GetCurrentVersion(homeDir string) (*domainVersion.Version, error)
- func (s *Service) ListMigrations() []domainVersion.Migration
- func (s *Service) RegisterMigration(migration domainVersion.Migration)
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.
Click to show internal directories.
Click to hide internal directories.