Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RepoVersion3 is the current repo versioning. RepoVersion3 = 3 // RepoVersion2 is the repo versioning up to v1.2.1 RepoVersion2 = 2 // RepoVersion1 is the repo versioning for v1-v1.1.4 RepoVersion1 = 1 // RepoVersionFile is the name of the repo file containing the repo version. RepoVersionFile = "repo.version" )
View Source
const (
// UpdateCheckStatePath is the update check paths.
UpdateCheckStatePath = "update.json"
)
Variables ¶
This section is empty.
Functions ¶
func IsValidVersion ¶ added in v1.2.1
IsValidVersion returns true if the version is valid.
Types ¶
type FsRepo ¶
type FsRepo struct { Migrations *MigrationManager // contains filtered or unexported fields }
func NewFS ¶
func NewFS(params FsRepoParams) (*FsRepo, error)
type FsRepoParams ¶ added in v1.2.2
type FsRepoParams struct { Path string Migrations *MigrationManager }
type Migration ¶ added in v1.2.2
type Migration struct { FromVersion int ToVersion int Migrations []MigrationFn }
func NewMigration ¶ added in v1.2.2
func NewMigration(fromVersion, toVersion int, migrations ...MigrationFn) Migration
NewMigration creates a new migration.
type MigrationFn ¶ added in v1.2.2
type MigrationManager ¶ added in v1.2.2
type MigrationManager struct {
// contains filtered or unexported fields
}
func NewMigrationManager ¶ added in v1.2.2
func NewMigrationManager(migrations ...Migration) (*MigrationManager, error)
NewMigrationManager creates a new migration manager.
func (*MigrationManager) Add ¶ added in v1.2.2
func (m *MigrationManager) Add(migration Migration) error
Add adds a migration to the manager.
func (*MigrationManager) Migrate ¶ added in v1.2.2
func (m *MigrationManager) Migrate(repo FsRepo) error
Migrate runs the migrations on the given repo.
type RepoVersion ¶
type RepoVersion struct {
Version int
}
Click to show internal directories.
Click to hide internal directories.