package httpfs

import "github.com/golang-migrate/migrate/v4/source/httpfs"

Index

Functions

func New

func New(fs http.FileSystem, path string) (source.Driver, error)

New creates a new migrate source driver from a http.FileSystem instance and a relative path to migration files within the virtual FS.

Types

type PartialDriver

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

PartialDriver is a helper service for creating new source drivers working with http.FileSystem 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 (p *PartialDriver) Close() error

Close is part of source.Driver interface implementation. This is a no-op.

func (*PartialDriver) First

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

First is part of source.Driver interface implementation.

func (*PartialDriver) Init

func (p *PartialDriver) Init(fs http.FileSystem, path string) error

Init prepares not initialized PartialDriver instance to read migrations from a http.FileSystem instance and a relative path.

func (*PartialDriver) Next

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

Next is part of source.Driver interface implementation.

func (*PartialDriver) Prev

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

Prev is part of source.Driver interface implementation.

func (*PartialDriver) ReadDown

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

ReadDown is part of source.Driver interface implementation.

func (*PartialDriver) ReadUp

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

ReadUp is part of source.Driver interface implementation.

Source Files

driver.go partial_driver.go

Version
v4.18.2 (latest)
Published
Jan 27, 2025
Platform
js/wasm
Imports
7 packages
Last checked
1 week ago

Tools for package owners.