package pkger

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

Index

Functions

func WithInstance

func WithInstance(instance pkging.Pkger, path string) (source.Driver, error)

WithInstance returns a source.Driver that is backed by an instance of pkging.Pkger. The relative location of migrations is indicated by path. The path must exist on the pkging.Pkger instance for the driver to initialize successfully.

Types

type Pkger

type Pkger struct {
	httpfs.PartialDriver
}

Pkger is a source.Driver that reads migrations from instances of pkging.Pkger.

func (*Pkger) Open

func (p *Pkger) Open(url string) (source.Driver, error)

Open implements source.Driver. The path component of url will be used as the relative location of migrations. The returned driver will use the package scoped pkger.Open to access migrations. The relative root and any migrations must be added to the global pkger.Pkger instance by calling pkger.Apply. Refer to Pkger documentation for more information.

Source Files

pkger.go

Version
v4.15.1
Published
Oct 15, 2021
Platform
darwin/amd64
Imports
7 packages
Last checked
1 hour ago

Tools for package owners.