mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add members database adapters interface.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user