repo

package
v1.2.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

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

func IsValidVersion(version int) bool

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)

func (*FsRepo) Exists

func (fsr *FsRepo) Exists() (bool, error)

func (*FsRepo) Init

func (fsr *FsRepo) Init() error

func (*FsRepo) Open

func (fsr *FsRepo) Open() error

func (*FsRepo) Path

func (fsr *FsRepo) Path() (string, error)

func (*FsRepo) Version added in v1.2.2

func (fsr *FsRepo) Version() (int, error)

Version returns the version of the repo.

func (*FsRepo) WriteRunInfo

func (fsr *FsRepo) WriteRunInfo(ctx context.Context, summaryShellVariablesString string) (string, 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.

func (Migration) Migrate added in v1.2.2

func (m Migration) Migrate(repo FsRepo) error

Migrate runs the migrations on the given repo.

type MigrationFn added in v1.2.2

type MigrationFn = func(FsRepo) error

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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