refactor structure

This commit is contained in:
Sas Andy
2024-05-08 15:26:14 +07:00
parent ac97487b9b
commit 9ae7e495c6
100 changed files with 2337 additions and 447 deletions

View File

@@ -8,21 +8,17 @@ import (
_ "github.com/glebarez/go-sqlite"
)
type UserStore struct {
type AppStore struct {
Db *sql.DB
}
func NewUserStore(dbName string) (UserStore, error) {
func NewAppStore(dbName string) (AppStore, error) {
Db, err := getConnection(dbName)
if err != nil {
return UserStore{}, err
return AppStore{}, err
}
if err := createMigrations(dbName, Db); err != nil {
return UserStore{}, err
}
return UserStore{
return AppStore{
Db,
}, nil
}