Documentation
¶
Index ¶
- Variables
- type Default
- func (d *Default) Channels() Map[ID, Channel]
- func (d *Default) Guilds() Map[ID, Guild]
- func (d *Default) Members() SubMap[ID, Map[ID, Member]]
- func (d *Default) Messages() SubMap[ID, Map[ID, Message]]
- func (d *Default) Presences() SubMap[ID, Map[ID, Presence]]
- func (d *Default) ScheduledEvents() SubMap[ID, Map[ID, ScheduledEvent]]
- func (d *Default) Users() Map[ID, User]
- func (d *Default) VoiceStates() SubMap[ID, Map[ID, VoiceState]]
- type DefaultConfig
- type Map
- type MapLambda
- type Store
- type SubMap
- type SubMapGen
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("resource not found in cache")
)
Functions ¶
This section is empty.
Types ¶
type Default ¶
type Default struct {
// contains filtered or unexported fields
}
func (*Default) ScheduledEvents ¶
func (*Default) VoiceStates ¶
type DefaultConfig ¶
type DefaultConfig struct {
Users uint
Guilds uint
Channels uint
Messages uint
PrivateChannels uint
Presences uint
Members uint
MessageLimit int
}
DefaultConfig is used to set up Default implementation of Store.
type Map ¶
type Map[K comparable, V any] interface { Get(key K) (V, error) Set(key K, obj V) error Delete(key K) error // Has checks if specific key exists. Default implementation will return ErrNotFound error if key does not exist. Has(key K) error // Size // // It will not return an error in Default implementation. Size() (int, error) Each(fn MapLambda[V]) error Search(fn MapLambda[V]) ([]V, error) Clear() error }
func NewLimitedMap ¶
func NewLimitedMap[K comparable, V any](limit int, preAllocated uint) Map[K, V]
type Store ¶
type Store interface {
Users() Map[ID, User]
Guilds() Map[ID, Guild]
Messages() SubMap[ID, Map[ID, Message]]
Channels() Map[ID, Channel]
Presences() SubMap[ID, Map[ID, Presence]]
Members() SubMap[ID, Map[ID, Member]]
ScheduledEvents() SubMap[ID, Map[ID, ScheduledEvent]]
VoiceStates() SubMap[ID, Map[ID, VoiceState]]
}
func NewDefault ¶
func NewDefault(cfg *DefaultConfig) Store
Click to show internal directories.
Click to hide internal directories.