migrations

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, opt Options) 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, 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, opt Options) error

Run executes the migrations.

type Options

type Options struct {
	Db     basedb.IDb
	Logger *zap.Logger
	DbPath string
}

Options are configurations for migrations

Jump to

Keyboard shortcuts

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