migrations

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalThingsFromCursor

func UnmarshalThingsFromCursor(ctx context.Context, cur *mongo.Cursor) ([]interface{}, error)

Types

type Migration

type Migration interface {
	Execute(context.Context, *mongo.Database) error
	Version() int
}

type Migration0001SplitThings

type Migration0001SplitThings struct {
}

func (*Migration0001SplitThings) Execute

func (*Migration0001SplitThings) Version

func (m *Migration0001SplitThings) Version() int

type Migration0002AddThingIds

type Migration0002AddThingIds struct {
}

func (*Migration0002AddThingIds) Execute

func (*Migration0002AddThingIds) Version

func (m *Migration0002AddThingIds) Version() int

type MigrationProvider

type MigrationProvider interface {
	Migrations() []Migration
}

func NewMongoMigrationProvider

func NewMongoMigrationProvider() MigrationProvider

type Migrator

type Migrator struct {
}

func (*Migrator) Execute

func (m *Migrator) Execute(ctx context.Context, provider MigrationProvider, db *mongo.Database, logger *logrus.Logger) error

Jump to

Keyboard shortcuts

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