iofs

package
v0.0.0-...-07a4155 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(fsys fs.FS, path string) (source.Driver, error)

New returns a new Driver from io/fs#FS and a relative path.

Types

type PartialDriver

type PartialDriver struct {
	// contains filtered or unexported fields
}

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.

func (*PartialDriver) Close

func (d *PartialDriver) Close() error

Close is part of source.Driver interface implementation. Closes the file system if possible.

func (*PartialDriver) First

func (d *PartialDriver) First() (version uint, err error)

First is part of source.Driver interface implementation.

func (*PartialDriver) Init

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 (*PartialDriver) Next

func (d *PartialDriver) Next(version uint) (nextVersion uint, err error)

Next is part of source.Driver interface implementation.

func (*PartialDriver) Prev

func (d *PartialDriver) Prev(version uint) (prevVersion uint, err error)

Prev is part of source.Driver interface implementation.

func (*PartialDriver) ReadDown

func (d *PartialDriver) ReadDown(version uint) (r io.ReadCloser, identifier string, err error)

ReadDown is part of source.Driver interface implementation.

func (*PartialDriver) ReadUp

func (d *PartialDriver) ReadUp(version uint) (r io.ReadCloser, identifier string, err error)

ReadUp is part of source.Driver interface implementation.

Jump to

Keyboard shortcuts

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