Documentation ¶
Index ¶
- type DefaultStore
- func (d *DefaultStore) ChannelGuild(channel snowflake.ID) snowflake.ID
- func (d *DefaultStore) Channels() SafeStore[SafeStore[discord.Channel]]
- func (d *DefaultStore) Guilds() SafeStore[discord.Guild]
- func (d *DefaultStore) Members() SafeStore[SafeStore[discord.Member]]
- func (d *DefaultStore) Messages() SafeStore[sets.Set[snowflake.ID, discord.BaseMessage]]
- func (d *DefaultStore) Presences() SafeStore[SafeStore[discord.BasePresence]]
- func (d *DefaultStore) Private() SafeStore[discord.Channel]
- func (d *DefaultStore) Reactions() SafeStore[SafeStoreCustom[string, discord.MessageReaction]]
- func (d *DefaultStore) SetChannelGuild(channel, guild snowflake.ID)
- func (d *DefaultStore) Users() SafeStore[discord.User]
- func (d *DefaultStore) VoiceStates() SafeStore[SafeStore[discord.VoiceState]]
- type SafeMap
- func (v *SafeMap[K, V]) Delete(key K) bool
- func (v *SafeMap[K, V]) Each(fn func(item V))
- func (v *SafeMap[K, V]) Filter(fn func(item V) bool) (data []V)
- func (v *SafeMap[K, V]) Find(fn func(item V) bool) (_ V, found bool)
- func (v *SafeMap[K, V]) Get(key K) (value V, ok bool)
- func (v *SafeMap[K, V]) GetOrSet(key K, set func() V) V
- func (v *SafeMap[K, V]) Has(key K) bool
- func (v *SafeMap[K, V]) Set(key K, value V)
- func (v *SafeMap[K, V]) Size() int
- func (v *SafeMap[K, V]) Sort(fn func(a, b V) bool) (sorted []V)
- func (v *SafeMap[K, V]) ToSlice() (data []V)
- func (v *SafeMap[K, V]) UnsafeGet(key K) V
- type SafeStore
- type SafeStoreCustom
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultStore ¶
type DefaultStore struct {
// contains filtered or unexported fields
}
func NewDefaultStore ¶
func NewDefaultStore() *DefaultStore
func (*DefaultStore) ChannelGuild ¶
func (d *DefaultStore) ChannelGuild(channel snowflake.ID) snowflake.ID
func (*DefaultStore) Channels ¶
func (d *DefaultStore) Channels() SafeStore[SafeStore[discord.Channel]]
func (*DefaultStore) Members ¶
func (d *DefaultStore) Members() SafeStore[SafeStore[discord.Member]]
func (*DefaultStore) Messages ¶
func (d *DefaultStore) Messages() SafeStore[sets.Set[snowflake.ID, discord.BaseMessage]]
func (*DefaultStore) Presences ¶
func (d *DefaultStore) Presences() SafeStore[SafeStore[discord.BasePresence]]
func (*DefaultStore) Reactions ¶
func (d *DefaultStore) Reactions() SafeStore[SafeStoreCustom[string, discord.MessageReaction]]
func (*DefaultStore) SetChannelGuild ¶
func (d *DefaultStore) SetChannelGuild(channel, guild snowflake.ID)
func (*DefaultStore) VoiceStates ¶
func (d *DefaultStore) VoiceStates() SafeStore[SafeStore[discord.VoiceState]]
type SafeMap ¶
type SafeMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewSafeMap ¶
func NewSafeMap[K comparable, V any](prealloc int) *SafeMap[K, V]
func NewSafeMapWithInitializer ¶
func NewSafeMapWithInitializer[K comparable, V any](prealloc int, init func() V) *SafeMap[K, V]
type SafeStore ¶
type SafeStore[V any] SafeStoreCustom[snowflake.ID, V]
type SafeStoreCustom ¶
type SafeStoreCustom[K comparable, V any] interface { Get(key K) (val V, found bool) UnsafeGet(key K) V GetOrSet(key K, set func() V) V ToSlice() []V Filter(fn func(item V) bool) []V Each(fn func(item V)) Find(fn func(item V) bool) (V, bool) Sort(fn func(a, b V) bool) []V Has(key K) bool Set(key K, value V) Delete(key K) bool Size() int }
type Store ¶
type Store interface { Guilds() SafeStore[discord.Guild] Members() SafeStore[SafeStore[discord.Member]] Channels() SafeStore[SafeStore[discord.Channel]] Reactions() SafeStore[SafeStoreCustom[string, discord.MessageReaction]] Presences() SafeStore[SafeStore[discord.BasePresence]] Messages() SafeStore[sets.Set[snowflake.ID, discord.BaseMessage]] Private() SafeStore[discord.Channel] Users() SafeStore[discord.User] VoiceStates() SafeStore[SafeStore[discord.VoiceState]] SetChannelGuild(channel, guild snowflake.ID) ChannelGuild(channel snowflake.ID) snowflake.ID }
Click to show internal directories.
Click to hide internal directories.