Documentation ¶
Overview ¶
Package lrustate implements a state storage with LRU capabilities.
Index ¶
- type ChannelStore
- func (s *ChannelStore) Channel(id discord.Snowflake) (*discord.Channel, error)
- func (s *ChannelStore) ChannelRemove(ch *discord.Channel) error
- func (s *ChannelStore) ChannelSet(ch *discord.Channel) error
- func (s *ChannelStore) Channels(guildID discord.Snowflake) ([]discord.Channel, error)
- func (s *ChannelStore) CreatePrivateChannel(user discord.Snowflake) (*discord.Channel, error)
- func (s *ChannelStore) PrivateChannels() ([]discord.Channel, error)
- func (s *ChannelStore) Reset()
- type GuildStore
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelStore ¶
type ChannelStore struct {
// contains filtered or unexported fields
}
func (*ChannelStore) ChannelRemove ¶
func (s *ChannelStore) ChannelRemove(ch *discord.Channel) error
func (*ChannelStore) ChannelSet ¶
func (s *ChannelStore) ChannelSet(ch *discord.Channel) error
func (*ChannelStore) CreatePrivateChannel ¶
func (*ChannelStore) PrivateChannels ¶
func (s *ChannelStore) PrivateChannels() ([]discord.Channel, error)
func (*ChannelStore) Reset ¶
func (s *ChannelStore) Reset()
type GuildStore ¶
type GuildStore struct {
// contains filtered or unexported fields
}
func (*GuildStore) GuildRemove ¶
func (s *GuildStore) GuildRemove(id discord.Snowflake) error
func (*GuildStore) Reset ¶
func (s *GuildStore) Reset()
type Store ¶
type Store struct { GuildStore ChannelStore }
Store implements the state storage using a special LRU cache. This store pertains all IDs, but purges structs as usual.
In some cases, functions that return a single struct would be a cache-hit, but functions that return a slice would be a cache-miss. This is to prevent incomplete slices.
Click to show internal directories.
Click to hide internal directories.