mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-09-07 10:49:38 +00:00
This commit refactors the Store interface in State into smaller interfaces in package store. These interfaces are combined into one structure called a "Cabinet". The default implementation of those interfaces have been rewritten in package defaultstore, while the old no-op implementation stays with the store package. This commit also omitted several state handlers for user events, as it is unclear what they are actually structured like.
22 lines
659 B
Go
22 lines
659 B
Go
// Package defaultstore provides thread-safe store implementations that store
|
|
// state values in memory.
|
|
package defaultstore
|
|
|
|
import "github.com/diamondburned/arikawa/v2/state/store"
|
|
|
|
// New creates a new cabinet instance of defaultstore. For Message, it creates a
|
|
// Message store with a limit of 100 messages.
|
|
func New() store.Cabinet {
|
|
return store.Cabinet{
|
|
MeStore: NewMe(),
|
|
ChannelStore: NewChannel(),
|
|
EmojiStore: NewEmoji(),
|
|
GuildStore: NewGuild(),
|
|
MemberStore: NewMember(),
|
|
MessageStore: NewMessage(100),
|
|
PresenceStore: NewPresence(),
|
|
RoleStore: NewRole(),
|
|
VoiceStateStore: NewVoiceState(),
|
|
}
|
|
}
|