drop: 考虑加入 uauth 作为认证中心做一个整体

This commit is contained in:
loveuer
2024-11-01 15:18:21 +08:00
parent 9ba2aace6a
commit df1a41eb21
28 changed files with 910 additions and 63 deletions

View File

@ -1,6 +1,8 @@
package store
import (
"context"
"github.com/glebarez/sqlite"
"gorm.io/gorm"
)
@ -17,3 +19,7 @@ func NewSqliteStore(path string) (Store, error) {
return &sqliteStore{db: db}, nil
}
func (s *sqliteStore) Session(ctx context.Context) *gorm.DB {
return s.db.Session(&gorm.Session{}).WithContext(ctx)
}

View File

@ -1,4 +1,11 @@
package store
import (
"context"
"gorm.io/gorm"
)
type Store interface {
Session(ctx context.Context) *gorm.DB
}