source

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoModule error = fmt.Errorf("no this module")
	ErrTop      error = fmt.Errorf("beyond the up limit")
	ErrBottom   error = fmt.Errorf("beyond the bottom limit")
)

Functions

func Register

func Register(name string, r Reader)

Types

type Migration

type Migration struct {
	MaxVer  int
	Version int
	Sql     map[int]string
}

func (*Migration) Goto

func (mig *Migration) Goto(v int) error

func (*Migration) Next

func (mig *Migration) Next() (string, int, error)

func (*Migration) SetMax

func (mig *Migration) SetMax(v int)

func (*Migration) Ver

func (mig *Migration) Ver() int

type Migrations

type Migrations map[Module]*Migration

func (Migrations) Goto

func (migs Migrations) Goto(m Module, v int) error

func (Migrations) List

func (migs Migrations) List() []Module

func (Migrations) Next

func (migs Migrations) Next(m Module) (string, int, error)

func (Migrations) Ver

func (migs Migrations) Ver(m Module) (int, error)

type Module

type Module string

type Reader

type Reader interface {
	Open(string) (Reader, error)
	Goto(Module, int) error
	Next(Module) (string, int, error)
	List() []Module
}

func Open

func Open(scheme string, uri string) (Reader, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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