mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-03 16:59:12 +02:00
add members database adapters interface.
This commit is contained in:
parent
edb9fef097
commit
100544198b
5 changed files with 116 additions and 58 deletions
|
@ -20,7 +20,7 @@ func New(config *config.Session) *SessionManagerCtx {
|
|||
host: nil,
|
||||
hostMu: sync.Mutex{},
|
||||
config: config,
|
||||
database: database.New(),
|
||||
database: database.New(config),
|
||||
members: make(map[string]*SessionCtx),
|
||||
membersMu: sync.Mutex{},
|
||||
emmiter: events.New(),
|
||||
|
@ -31,6 +31,8 @@ func New(config *config.Session) *SessionManagerCtx {
|
|||
_ = manager.add(id, profile)
|
||||
}
|
||||
|
||||
// TODO: Move to Database, or make `admin` as reserved user.
|
||||
|
||||
// create default admin account at startup
|
||||
_ = manager.add("admin", types.MemberProfile{
|
||||
Secret: config.AdminPassword,
|
||||
|
@ -53,7 +55,7 @@ type SessionManagerCtx struct {
|
|||
host types.Session
|
||||
hostMu sync.Mutex
|
||||
config *config.Session
|
||||
database *database.MembersDatabaseCtx
|
||||
database types.MembersDatabase
|
||||
members map[string]*SessionCtx
|
||||
membersMu sync.Mutex
|
||||
emmiter events.EventEmmiter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue