archive

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archivist

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

Archivist is responsible for managing the archival of migration keys in a Go source file. It provides functionality to locate the migration file, parse its abstract syntax tree (AST), and remove specified migration keys and their associated registry.Add calls. The Archivist ensures that the migration keys are properly archived and removed from the migration file, maintaining the integrity of the migration process.

func NewArchivist

func NewArchivist(envdir domain.EnvDir) Archivist

NewArchivist creates a new Archivist instance with the provided EnvDir.

func (Archivist) Archive

func (a Archivist) Archive(migKeys ...string) (archivalReport, error)

Archive parses the migrations.go and migrations_archive.go abstract syntax tree (AST), to remove specified migration keys and their associated registry.Add calls and adds Archive calls for the provided keys.

type GitSHAGetter

type GitSHAGetter interface {
	Get() (string, error)
}

GitSHAGetter is an interface for getting a Git SHA.

type MainBranchSHAGetter

type MainBranchSHAGetter struct{}

MainBranchSHAGetter is a GitSHAGetter implementation that gets the SHA of the main branch.

func (MainBranchSHAGetter) Get

func (m MainBranchSHAGetter) Get() (string, error)

Get returns the SHA of the main branch

Jump to

Keyboard shortcuts

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