migrations

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, logger *zap.Logger, opt Options) (applied int, err error)

Run executes the default migrations.

Types

type CompletedFunc added in v1.1.0

type CompletedFunc func(rw basedb.ReadWriter) error

CompletedFunc is a function that marks a migration as completed.

type Migration

type Migration struct {
	Name string
	Run  MigrationFunc
}

Migration is a named MigrationFunc.

type MigrationFunc

type MigrationFunc func(ctx context.Context, logger *zap.Logger, opt Options, key []byte, completed CompletedFunc) error

MigrationFunc is a function that performs a migration.

type Migrations

type Migrations []Migration

Migrations is a slice of named migrations, meant to be executed from first to last (order is significant).

func (Migrations) Run

func (m Migrations) Run(ctx context.Context, logger *zap.Logger, opt Options) (applied int, err error)

Run executes the migrations.

type Options

type Options struct {
	Db          basedb.Database
	NodeStorage operatorstorage.Storage
	DbPath      string
	Network     beacon.Network
}

Options is the options for running migrations.

Jump to

Keyboard shortcuts

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