cms-template/storage/storage.go
Vasiliy Tolstov 973f9ac822
Some checks failed
build / test (push) Failing after 5s
build / lint (push) Failing after 6s
initial import
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2024-09-26 19:45:39 +03:00

30 lines
577 B
Go

package storage
import (
"context"
"database/sql"
"embed"
store "go.unistack.org/cms-service/storage"
"go.unistack.org/cms-template/storage/sqlite"
)
//go:embed all:migrations
var fs embed.FS
var storages = store.NewStorageInterface()
func init() {
storages.RegisterStorage("sqlite", sqlite.NewStorageSqlite(fs))
}
type Storage interface {
Auth(ctx context.Context, login, passw string) error
Delete(ctx context.Context, uuid string) error
store.Migrator
}
func NewStorage(name string, db *sql.DB) (interface{}, error) {
return storages.NewStorage(name, db)
}