Created
January 13, 2023 14:14
-
-
Save kkdai/7ff6487458ee8691b9ddf6993872186d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type MemStorage map[string]GroupData | |
| type MemDB struct { | |
| db MemStorage | |
| } | |
| func (mdb *MemDB) ReadGroupInfo(roomID string) GroupData { | |
| return mdb.db[roomID] | |
| } | |
| func (mdb *MemDB) AppendGroupInfo(roomID string, m MsgDetail) { | |
| mdb.db[roomID] = append(mdb.db[roomID], m) | |
| } | |
| func NewMemDB() *MemDB { | |
| return &MemDB{ | |
| db: make(MemStorage), | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment