mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-28 13:48:49 +08:00
24 lines
425 B
Go
24 lines
425 B
Go
//go:build go1.16
|
|
// +build go1.16
|
|
|
|
package migrate
|
|
|
|
import (
|
|
"embed"
|
|
"net/http"
|
|
)
|
|
|
|
// A set of migrations loaded from an go1.16 embed.FS
|
|
|
|
type EmbedFileSystemMigrationSource struct {
|
|
FileSystem embed.FS
|
|
|
|
Root string
|
|
}
|
|
|
|
var _ MigrationSource = (*EmbedFileSystemMigrationSource)(nil)
|
|
|
|
func (f EmbedFileSystemMigrationSource) FindMigrations() ([]*Migration, error) {
|
|
return findMigrations(http.FS(f.FileSystem), f.Root)
|
|
}
|