mirror of
https://github.com/tgdrive/teldrive.git
synced 2025-10-05 04:44:57 +08:00
23 lines
358 B
Go
23 lines
358 B
Go
package tgstorage
|
|
|
|
import (
|
|
"github.com/gotd/td/session"
|
|
"gorm.io/gorm"
|
|
|
|
"github.com/gotd/contrib/auth/kv"
|
|
)
|
|
|
|
var _ session.Storage = SessionStorage{}
|
|
|
|
type SessionStorage struct {
|
|
kv.Session
|
|
}
|
|
|
|
func NewSessionStorage(db *gorm.DB, key string) SessionStorage {
|
|
s := &kvStorage{
|
|
db: db,
|
|
}
|
|
return SessionStorage{
|
|
Session: kv.NewSession(s, key),
|
|
}
|
|
}
|