Documentation
¶
Index ¶
- Variables
- type BoltCache
- func (c *BoltCache) DeleteChannel(channelId uint64)
- func (c *BoltCache) DeleteEmoji(emojiId uint64)
- func (c *BoltCache) DeleteGuild(guildId uint64)
- func (c *BoltCache) DeleteGuildChannels(guildId uint64)
- func (c *BoltCache) DeleteGuildRoles(guildId uint64)
- func (c *BoltCache) DeleteMember(userId, guildId uint64)
- func (c *BoltCache) DeleteRole(roleId uint64)
- func (c *BoltCache) DeleteVoiceState(userId, guildId uint64)
- func (c *BoltCache) GetChannel(channelId uint64) (channel.Channel, bool)
- func (c *BoltCache) GetEmoji(emojiId uint64) (emoji.Emoji, bool)
- func (c *BoltCache) GetGuild(guildId uint64) (guild.Guild, bool)
- func (c *BoltCache) GetGuildChannels(guildId uint64) []channel.Channel
- func (c *BoltCache) GetGuildCount() int
- func (c *BoltCache) GetGuildEmojis(guildId uint64) []emoji.Emoji
- func (c *BoltCache) GetGuildMembers(guildId uint64, withUserData bool) []member.Member
- func (c *BoltCache) GetGuildOwner(guildId uint64) (uint64, bool)
- func (c *BoltCache) GetGuildRoles(guildId uint64) []guild.Role
- func (c *BoltCache) GetGuildVoiceStates(guildId uint64) []guild.VoiceState
- func (c *BoltCache) GetGuilds() []guild.Guild
- func (c *BoltCache) GetMember(guildId, userId uint64) (member.Member, bool)
- func (c *BoltCache) GetOptions() CacheOptions
- func (c *BoltCache) GetRole(roleId uint64) (guild.Role, bool)
- func (c *BoltCache) GetRoles(guildId uint64, ids []uint64) (map[uint64]guild.Role, error)
- func (c *BoltCache) GetSelf() (user.User, bool)
- func (c *BoltCache) GetUser(userId uint64) (user.User, bool)
- func (c *BoltCache) GetUsers(ids []uint64) (map[uint64]user.User, error)
- func (c *BoltCache) GetVoiceState(userId, guildId uint64) (guild.VoiceState, bool)
- func (c *BoltCache) StoreChannel(ch channel.Channel)
- func (c *BoltCache) StoreChannels(channels []channel.Channel)
- func (c *BoltCache) StoreEmoji(e emoji.Emoji, guildId uint64)
- func (c *BoltCache) StoreEmojis(emojis []emoji.Emoji, guildId uint64)
- func (c *BoltCache) StoreGuild(g guild.Guild)
- func (c *BoltCache) StoreGuilds(guilds []guild.Guild)
- func (c *BoltCache) StoreMember(m member.Member, guildId uint64)
- func (c *BoltCache) StoreMembers(members []member.Member, guildId uint64)
- func (c *BoltCache) StoreRole(role guild.Role, guildId uint64)
- func (c *BoltCache) StoreRoles(roles []guild.Role, guildId uint64)
- func (c *BoltCache) StoreSelf(self user.User)
- func (c *BoltCache) StoreUser(u user.User)
- func (c *BoltCache) StoreUsers(users []user.User)
- func (c *BoltCache) StoreVoiceState(state guild.VoiceState)
- func (c *BoltCache) StoreVoiceStates(states []guild.VoiceState)
- type BoltOptions
- type Cache
- type CacheFactory
- type CacheOptions
- type MemoryCache
- func (c *MemoryCache) DeleteChannel(ctx context.Context, channelId uint64) error
- func (c *MemoryCache) DeleteEmoji(ctx context.Context, emojiId uint64) error
- func (c *MemoryCache) DeleteGuild(ctx context.Context, guildId uint64) error
- func (c *MemoryCache) DeleteGuildChannels(ctx context.Context, guildId uint64) error
- func (c *MemoryCache) DeleteGuildRoles(ctx context.Context, guildId uint64) error
- func (c *MemoryCache) DeleteMember(ctx context.Context, userId, guildId uint64) error
- func (c *MemoryCache) DeleteRole(ctx context.Context, roleId uint64) error
- func (c *MemoryCache) DeleteVoiceState(ctx context.Context, userId, guildId uint64) error
- func (c *MemoryCache) GetChannel(ctx context.Context, channelId uint64) (channel.Channel, error)
- func (c *MemoryCache) GetEmoji(ctx context.Context, emojiId uint64) (emoji.Emoji, error)
- func (c *MemoryCache) GetGuild(ctx context.Context, guildId uint64) (guild.Guild, error)
- func (c *MemoryCache) GetGuildChannels(ctx context.Context, guildId uint64) ([]channel.Channel, error)
- func (c *MemoryCache) GetGuildCount(ctx context.Context) (int, error)
- func (c *MemoryCache) GetGuildEmojis(ctx context.Context, guildId uint64) ([]emoji.Emoji, error)
- func (c *MemoryCache) GetGuildMembers(ctx context.Context, guildId uint64, withUserData bool) ([]member.Member, error)
- func (c *MemoryCache) GetGuildOwner(ctx context.Context, guildId uint64) (uint64, error)
- func (c *MemoryCache) GetGuildRoles(ctx context.Context, guildId uint64) ([]guild.Role, error)
- func (c *MemoryCache) GetGuildVoiceStates(ctx context.Context, guildId uint64) ([]guild.VoiceState, error)
- func (c *MemoryCache) GetMember(ctx context.Context, guildId, userId uint64) (member.Member, error)
- func (c *MemoryCache) GetRole(ctx context.Context, roleId uint64) (guild.Role, error)
- func (c *MemoryCache) GetRoles(ctx context.Context, guildId uint64, ids []uint64) (map[uint64]guild.Role, error)
- func (c *MemoryCache) GetSelf(ctx context.Context) (user.User, error)
- func (c *MemoryCache) GetUser(ctx context.Context, userId uint64) (user.User, error)
- func (c *MemoryCache) GetUsers(ctx context.Context, ids []uint64) (map[uint64]user.User, error)
- func (c *MemoryCache) GetVoiceState(ctx context.Context, userId, guildId uint64) (guild.VoiceState, error)
- func (c *MemoryCache) Options() CacheOptions
- func (c *MemoryCache) Size() string
- func (c *MemoryCache) StoreChannel(ctx context.Context, ch channel.Channel) error
- func (c *MemoryCache) StoreChannels(ctx context.Context, channels []channel.Channel) error
- func (c *MemoryCache) StoreEmoji(ctx context.Context, e emoji.Emoji, guildId uint64) error
- func (c *MemoryCache) StoreEmojis(ctx context.Context, emojis []emoji.Emoji, guildId uint64) error
- func (c *MemoryCache) StoreGuild(ctx context.Context, g guild.Guild) error
- func (c *MemoryCache) StoreGuilds(ctx context.Context, guilds []guild.Guild) error
- func (c *MemoryCache) StoreMember(ctx context.Context, m member.Member, guildId uint64) error
- func (c *MemoryCache) StoreMembers(ctx context.Context, members []member.Member, guildId uint64) error
- func (c *MemoryCache) StoreRole(ctx context.Context, role guild.Role, guildId uint64) error
- func (c *MemoryCache) StoreRoles(ctx context.Context, roles []guild.Role, guildId uint64) error
- func (c *MemoryCache) StoreSelf(ctx context.Context, self user.User) error
- func (c *MemoryCache) StoreUser(ctx context.Context, u user.User) error
- func (c *MemoryCache) StoreUsers(ctx context.Context, users []user.User) error
- func (c *MemoryCache) StoreVoiceState(ctx context.Context, state guild.VoiceState) error
- func (c *MemoryCache) StoreVoiceStates(ctx context.Context, states []guild.VoiceState) error
- type PgCache
- func (c *PgCache) CreateSchema(ctx context.Context) error
- func (c *PgCache) DeleteChannel(ctx context.Context, channelId uint64) error
- func (c *PgCache) DeleteEmoji(ctx context.Context, emojiId uint64) error
- func (c *PgCache) DeleteGuild(ctx context.Context, id uint64) error
- func (c *PgCache) DeleteGuildChannels(ctx context.Context, guildId uint64) error
- func (c *PgCache) DeleteGuildRoles(ctx context.Context, guildId uint64) error
- func (c *PgCache) DeleteMember(ctx context.Context, userId, guildId uint64) error
- func (c *PgCache) DeleteRole(ctx context.Context, roleId uint64) error
- func (c *PgCache) DeleteVoiceState(ctx context.Context, userId, guildId uint64) error
- func (c *PgCache) GetChannel(ctx context.Context, channelId uint64) (channel.Channel, error)
- func (c *PgCache) GetEmoji(ctx context.Context, id uint64) (emoji.Emoji, error)
- func (c *PgCache) GetGuild(ctx context.Context, id uint64) (guild.Guild, error)
- func (c *PgCache) GetGuildChannels(ctx context.Context, guildId uint64) ([]channel.Channel, error)
- func (c *PgCache) GetGuildCount(ctx context.Context) (int, error)
- func (c *PgCache) GetGuildEmojis(ctx context.Context, guildId uint64) ([]emoji.Emoji, error)
- func (c *PgCache) GetGuildMembers(ctx context.Context, guildId uint64, withUserData bool) ([]member.Member, error)
- func (c *PgCache) GetGuildOwner(ctx context.Context, guildId uint64) (uint64, error)
- func (c *PgCache) GetGuildRole(ctx context.Context, id, guildId uint64) (guild.Role, error)
- func (c *PgCache) GetGuildRoles(ctx context.Context, guildId uint64) ([]guild.Role, error)
- func (c *PgCache) GetGuildVoiceStates(ctx context.Context, guildId uint64) ([]guild.VoiceState, error)
- func (c *PgCache) GetMember(ctx context.Context, guildId, userId uint64) (member.Member, error)
- func (c *PgCache) GetRole(ctx context.Context, id uint64) (guild.Role, error)
- func (c *PgCache) GetRoles(ctx context.Context, guildId uint64, ids []uint64) (map[uint64]guild.Role, error)
- func (c *PgCache) GetSelf(ctx context.Context) (user.User, error)
- func (c *PgCache) GetUser(ctx context.Context, id uint64) (user.User, error)
- func (c *PgCache) GetUsers(ctx context.Context, ids []uint64) (map[uint64]user.User, error)
- func (c *PgCache) GetVoiceState(ctx context.Context, userId, guildId uint64) (guild.VoiceState, error)
- func (c *PgCache) Options() CacheOptions
- func (c *PgCache) ReplaceChannels(ctx context.Context, guildId uint64, channels []channel.Channel) error
- func (c *PgCache) StoreChannel(ctx context.Context, ch channel.Channel) error
- func (c *PgCache) StoreChannels(ctx context.Context, channels []channel.Channel) error
- func (c *PgCache) StoreEmoji(ctx context.Context, emoji emoji.Emoji, guildId uint64) error
- func (c *PgCache) StoreEmojis(ctx context.Context, emojis []emoji.Emoji, guildId uint64) error
- func (c *PgCache) StoreGuild(ctx context.Context, g guild.Guild) error
- func (c *PgCache) StoreGuilds(ctx context.Context, guilds []guild.Guild) error
- func (c *PgCache) StoreMember(ctx context.Context, m member.Member, guildId uint64) error
- func (c *PgCache) StoreMembers(ctx context.Context, members []member.Member, guildId uint64) error
- func (c *PgCache) StoreRole(ctx context.Context, role guild.Role, guildId uint64) error
- func (c *PgCache) StoreRoles(ctx context.Context, roles []guild.Role, guildId uint64) error
- func (c *PgCache) StoreSelf(ctx context.Context, self user.User) error
- func (c *PgCache) StoreUser(ctx context.Context, user user.User) error
- func (c *PgCache) StoreUsers(ctx context.Context, users []user.User) error
- func (c *PgCache) StoreVoiceState(ctx context.Context, state guild.VoiceState) error
- func (c *PgCache) StoreVoiceStates(ctx context.Context, states []guild.VoiceState) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("object not found in cache")
Functions ¶
This section is empty.
Types ¶
type BoltCache ¶
BoltCache Deprecated
func NewBoltCache ¶
func NewBoltCache(cacheOptions CacheOptions, boltOptions BoltOptions) BoltCache
func (*BoltCache) DeleteChannel ¶
func (*BoltCache) DeleteEmoji ¶
func (*BoltCache) DeleteGuild ¶
func (*BoltCache) DeleteGuildChannels ¶
func (*BoltCache) DeleteGuildRoles ¶
func (*BoltCache) DeleteMember ¶
func (*BoltCache) DeleteRole ¶
func (*BoltCache) DeleteVoiceState ¶
func (*BoltCache) GetChannel ¶
func (*BoltCache) GetGuildChannels ¶
func (*BoltCache) GetGuildCount ¶
func (*BoltCache) GetGuildMembers ¶
func (*BoltCache) GetGuildVoiceStates ¶
func (c *BoltCache) GetGuildVoiceStates(guildId uint64) []guild.VoiceState
func (*BoltCache) GetOptions ¶
func (c *BoltCache) GetOptions() CacheOptions
func (*BoltCache) GetVoiceState ¶
func (c *BoltCache) GetVoiceState(userId, guildId uint64) (guild.VoiceState, bool)
func (*BoltCache) StoreChannel ¶
func (*BoltCache) StoreChannels ¶
func (*BoltCache) StoreEmojis ¶
func (*BoltCache) StoreGuild ¶
func (*BoltCache) StoreGuilds ¶
func (*BoltCache) StoreMembers ¶
func (*BoltCache) StoreUsers ¶
func (*BoltCache) StoreVoiceState ¶
func (c *BoltCache) StoreVoiceState(state guild.VoiceState)
func (*BoltCache) StoreVoiceStates ¶
func (c *BoltCache) StoreVoiceStates(states []guild.VoiceState)
type BoltOptions ¶
type Cache ¶
type Cache interface {
Options() CacheOptions
StoreUser(ctx context.Context, user user.User) error
StoreUsers(ctx context.Context, user []user.User) error
GetUser(ctx context.Context, id uint64) (user.User, error)
GetUsers(ctx context.Context, ids []uint64) (map[uint64]user.User, error)
StoreGuild(ctx context.Context, guild guild.Guild) error
StoreGuilds(ctx context.Context, guilds []guild.Guild) error
GetGuild(ctx context.Context, id uint64) (guild.Guild, error)
DeleteGuild(ctx context.Context, id uint64) error
GetGuildCount(ctx context.Context) (int, error)
GetGuildOwner(ctx context.Context, guildId uint64) (uint64, error)
StoreMember(ctx context.Context, member member.Member, guildId uint64) error
StoreMembers(ctx context.Context, members []member.Member, guildId uint64) error
GetMember(ctx context.Context, guildId, userId uint64) (member.Member, error)
GetGuildMembers(ctx context.Context, guildId uint64, withUserData bool) ([]member.Member, error)
DeleteMember(ctx context.Context, userId, guildId uint64) error
StoreChannel(ctx context.Context, channel channel.Channel) error
StoreChannels(ctx context.Context, channel []channel.Channel) error
GetChannel(ctx context.Context, id uint64) (channel.Channel, error)
GetGuildChannels(ctx context.Context, guildId uint64) ([]channel.Channel, error)
DeleteChannel(ctx context.Context, channelId uint64) error
DeleteGuildChannels(ctx context.Context, guildId uint64) error
StoreRole(ctx context.Context, role guild.Role, guildId uint64) error
StoreRoles(ctx context.Context, roles []guild.Role, guildId uint64) error
GetRole(ctx context.Context, id uint64) (guild.Role, error)
GetRoles(ctx context.Context, guildId uint64, ids []uint64) (map[uint64]guild.Role, error)
GetGuildRoles(ctx context.Context, guildId uint64) ([]guild.Role, error)
DeleteRole(ctx context.Context, roleId uint64) error
DeleteGuildRoles(ctx context.Context, guildId uint64) error
StoreEmoji(ctx context.Context, emoji emoji.Emoji, guildId uint64) error
StoreEmojis(ctx context.Context, emojis []emoji.Emoji, guildId uint64) error
GetEmoji(ctx context.Context, id uint64) (emoji.Emoji, error)
GetGuildEmojis(ctx context.Context, id uint64) ([]emoji.Emoji, error)
DeleteEmoji(ctx context.Context, emojiId uint64) error
StoreVoiceState(ctx context.Context, voiceState guild.VoiceState) error
StoreVoiceStates(ctx context.Context, voiceStates []guild.VoiceState) error
GetVoiceState(ctx context.Context, userId, guildId uint64) (guild.VoiceState, error)
GetGuildVoiceStates(ctx context.Context, guildId uint64) ([]guild.VoiceState, error)
DeleteVoiceState(ctx context.Context, userId, guildId uint64) error
StoreSelf(ctx context.Context, self user.User) error
GetSelf(ctx context.Context) (user.User, error)
}
type CacheFactory ¶
type CacheFactory func() Cache
func MemoryCacheFactory ¶
func MemoryCacheFactory(cacheOptions CacheOptions) CacheFactory
func PgCacheFactory ¶
func PgCacheFactory(db *pgxpool.Pool, options CacheOptions) CacheFactory
type CacheOptions ¶
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
func NewMemoryCache ¶
func NewMemoryCache(cacheOptions CacheOptions) MemoryCache
func (*MemoryCache) DeleteChannel ¶
func (c *MemoryCache) DeleteChannel(ctx context.Context, channelId uint64) error
func (*MemoryCache) DeleteEmoji ¶
func (c *MemoryCache) DeleteEmoji(ctx context.Context, emojiId uint64) error
func (*MemoryCache) DeleteGuild ¶
func (c *MemoryCache) DeleteGuild(ctx context.Context, guildId uint64) error
func (*MemoryCache) DeleteGuildChannels ¶
func (c *MemoryCache) DeleteGuildChannels(ctx context.Context, guildId uint64) error
func (*MemoryCache) DeleteGuildRoles ¶
func (c *MemoryCache) DeleteGuildRoles(ctx context.Context, guildId uint64) error
func (*MemoryCache) DeleteMember ¶
func (c *MemoryCache) DeleteMember(ctx context.Context, userId, guildId uint64) error
func (*MemoryCache) DeleteRole ¶
func (c *MemoryCache) DeleteRole(ctx context.Context, roleId uint64) error
func (*MemoryCache) DeleteVoiceState ¶
func (c *MemoryCache) DeleteVoiceState(ctx context.Context, userId, guildId uint64) error
func (*MemoryCache) GetChannel ¶
func (*MemoryCache) GetGuildChannels ¶
func (*MemoryCache) GetGuildCount ¶
func (c *MemoryCache) GetGuildCount(ctx context.Context) (int, error)
func (*MemoryCache) GetGuildEmojis ¶
func (*MemoryCache) GetGuildMembers ¶
func (*MemoryCache) GetGuildOwner ¶
func (*MemoryCache) GetGuildRoles ¶
func (*MemoryCache) GetGuildVoiceStates ¶
func (c *MemoryCache) GetGuildVoiceStates(ctx context.Context, guildId uint64) ([]guild.VoiceState, error)
func (*MemoryCache) GetVoiceState ¶
func (c *MemoryCache) GetVoiceState(ctx context.Context, userId, guildId uint64) (guild.VoiceState, error)
func (*MemoryCache) Options ¶
func (c *MemoryCache) Options() CacheOptions
func (*MemoryCache) Size ¶
func (c *MemoryCache) Size() string
func (*MemoryCache) StoreChannel ¶
func (*MemoryCache) StoreChannels ¶
func (*MemoryCache) StoreEmoji ¶
func (*MemoryCache) StoreEmojis ¶
func (*MemoryCache) StoreGuild ¶
func (*MemoryCache) StoreGuilds ¶
func (*MemoryCache) StoreMember ¶
func (*MemoryCache) StoreMembers ¶
func (*MemoryCache) StoreRoles ¶
func (*MemoryCache) StoreUsers ¶
func (*MemoryCache) StoreVoiceState ¶
func (c *MemoryCache) StoreVoiceState(ctx context.Context, state guild.VoiceState) error
func (*MemoryCache) StoreVoiceStates ¶
func (c *MemoryCache) StoreVoiceStates(ctx context.Context, states []guild.VoiceState) error
type PgCache ¶
func NewPgCache ¶
func NewPgCache(db *pgxpool.Pool, options CacheOptions) PgCache
func (*PgCache) DeleteChannel ¶
func (*PgCache) DeleteEmoji ¶
func (*PgCache) DeleteGuildChannels ¶
func (*PgCache) DeleteGuildRoles ¶
func (*PgCache) DeleteMember ¶
func (*PgCache) DeleteVoiceState ¶
func (*PgCache) GetChannel ¶
func (*PgCache) GetGuildChannels ¶
func (*PgCache) GetGuildEmojis ¶
func (*PgCache) GetGuildMembers ¶
func (*PgCache) GetGuildOwner ¶
func (*PgCache) GetGuildRole ¶
func (*PgCache) GetGuildRoles ¶
func (*PgCache) GetGuildVoiceStates ¶
func (*PgCache) GetVoiceState ¶
func (*PgCache) Options ¶
func (c *PgCache) Options() CacheOptions
func (*PgCache) ReplaceChannels ¶
func (*PgCache) StoreChannel ¶
func (*PgCache) StoreChannels ¶
func (*PgCache) StoreEmoji ¶
func (*PgCache) StoreEmojis ¶
func (*PgCache) StoreGuilds ¶
func (*PgCache) StoreMember ¶
func (*PgCache) StoreMembers ¶
func (*PgCache) StoreRoles ¶
func (*PgCache) StoreUsers ¶
func (*PgCache) StoreVoiceState ¶
func (*PgCache) StoreVoiceStates ¶
Click to show internal directories.
Click to hide internal directories.