drop: 考虑加入 uauth 作为认证中心做一个整体
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
@ -1,4 +1,11 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Store interface {
|
||||
Session(ctx context.Context) *gorm.DB
|
||||
}
|
||||
|
Reference in New Issue
Block a user