Any plans for go.rice support?
tabula-rasa opened this issue · 5 comments
What would I use it for, @tabula-rasa?
Some applications pack their assets with it (or go-bindata, which is more popular). This way one can compile whole app with related files (templates, migration, config files...) into one binary for easy deploy. To tell the truth, I would be happy if there was a possibility to create migrator not only by a given directory, but by a map of preloaded files, like that:
type fileName string
type fileData []byte
func NewMigratorMemory(db *sql.DB, adapter Migratable, migrationsMemory map[fileName][fileData]) (*Migrator, error)
This way I could implement my own go.rice or go-bindata wrapper, so you don't need to import them in your package.
I like the idea of creating a migrator that uses io.ReadCloser objects. If someone wants to use go-bindata, go.rice, or whatever comes along next can just use that interface. Would you like to spike on that?
Sure, that would be great.
👍 was looking for this myself today (using go-bindata)