Improve Store

Still need to fill out SQLite bootstrap

Also setup plug-in system mechanism
This commit is contained in:
Dan Jones 2024-09-14 20:37:51 -05:00
commit e7b88bcc09
10 changed files with 154 additions and 6 deletions

29
store/sqlite/repo.go Normal file
View file

@ -0,0 +1,29 @@
package sqlite
import (
"codeberg.org/danjones000/lenore/config"
"codeberg.org/danjones000/lenore/store"
"github.com/go-ap/storage-sqlite"
)
func init() {
store.AddFactory("sqlite", MakeStore)
}
func MakeStore(conf config.Config) (store.Store, error) {
sqlConf := sqlite.Config{Path: conf.Conn.DSN}
db, err := sqlite.New(sqlConf)
if err != nil {
return nil, err
}
return Repo{db}, nil
}
type Repo struct {
store.PartStore
}
func (r Repo) Bootstrap(config.Config) error {
// @todo
return nil
}