migrations

package
v0.5.5-jatov2-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: GPL-3.0 Imports: 12 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 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) 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.IDb
	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