func New(fsys fs.FS, path string) (source.Driver, error)
New returns a new Driver from io/fs#FS and a relative path.
PartialDriver is a helper service for creating new source drivers working with io/fs.FS instances. It implements all source.Driver interface methods except for Open(). New driver could embed this struct and add missing Open() method.
To prepare PartialDriver for use Init() function.
type PartialDriver struct {
// contains filtered or unexported fields
}
func (d *PartialDriver) Close() error
Close is part of source.Driver interface implementation. Closes the file system if possible.
func (d *PartialDriver) First() (version uint, err error)
First is part of source.Driver interface implementation.
func (d *PartialDriver) Init(fsys fs.FS, path string) error
Init prepares not initialized IoFS instance to read migrations from a io/fs#FS instance and a relative path.
func (d *PartialDriver) Next(version uint) (nextVersion uint, err error)
Next is part of source.Driver interface implementation.
func (d *PartialDriver) Prev(version uint) (prevVersion uint, err error)
Prev is part of source.Driver interface implementation.
func (d *PartialDriver) ReadDown(version uint) (r io.ReadCloser, identifier string, err error)
ReadDown is part of source.Driver interface implementation.
func (d *PartialDriver) ReadUp(version uint) (r io.ReadCloser, identifier string, err error)
ReadUp is part of source.Driver interface implementation.