repo

package
v1.4.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 16 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 IsUnknownVersion added in v1.3.0

func IsUnknownVersion(err error) bool

func IsValidVersion added in v1.2.1

func IsValidVersion(version int) bool

IsValidVersion returns true if the version is valid.

Types

type ErrUnknownRepoVersion added in v1.3.0

type ErrUnknownRepoVersion int

func NewUnknownRepoVersionError added in v1.3.0

func NewUnknownRepoVersionError(version int) ErrUnknownRepoVersion

func (ErrUnknownRepoVersion) Error added in v1.3.0

func (e ErrUnknownRepoVersion) Error() string

type FsRepo

type FsRepo struct {
	Migrations *MigrationManager
	// contains filtered or unexported fields
}

func NewFS

func NewFS(params FsRepoParams) (*FsRepo, error)

func (*FsRepo) EnsureRepoPathsConfigured added in v1.3.2

func (fsr *FsRepo) EnsureRepoPathsConfigured(c config.ReadWriter)

modifies the config to include keys for accessing repo paths

func (*FsRepo) Exists

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

func (*FsRepo) Init

func (fsr *FsRepo) Init(c config.ReadWriter) error

func (*FsRepo) Open

func (fsr *FsRepo) Open(c config.ReadWriter) 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