migration

package
v0.0.0-...-5cbc45b Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client[C DBClient] struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient[C DBClient](c C, config ConfigRepo, migrations Migrations[C], retry int) *Client[C]

func (Client[C]) Migrate

func (c Client[C]) Migrate(ctx context.Context) (err error)

type ConfigRepo

type ConfigRepo interface {
	Current(ctx context.Context) (Key, error)
	Save(ctx context.Context, m Key) error
	Begin(ctx context.Context) error
	End(ctx context.Context) error
}

type DBClient

type DBClient interface {
	Transaction() usecasex.Transaction
}

type Key

type Key = int64

type MigrationFunc

type MigrationFunc[C DBClient] func(context.Context, C) error

type Migrations

type Migrations[C DBClient] map[Key]MigrationFunc[C]

Jump to

Keyboard shortcuts

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