Documentation ¶
Index ¶
- Constants
- Variables
- func NewDB() (state.DB, error)
- type DB
- func (db *DB) DeleteChannel(_ context.Context, guild, id int64) error
- func (db *DB) DeleteChannelMessage(_ context.Context, channel, id int64) error
- func (db *DB) DeleteChannelMessageReaction(_ context.Context, channel, id, user int64, name interface{}) error
- func (db *DB) DeleteChannelMessageReactions(_ context.Context, channel, id, user int64) error
- func (db *DB) DeleteChannels(_ context.Context, guild int64) error
- func (db *DB) DeleteChannelsById(ctx context.Context, guildID int64, channelIDs []int64) error
- func (db *DB) DeleteGuild(_ context.Context, id int64) error
- func (db *DB) DeleteGuildBan(_ context.Context, guild, user int64) error
- func (db *DB) DeleteGuildEmoji(_ context.Context, guild, emoji int64) error
- func (db *DB) DeleteGuildEmojis(_ context.Context, guild int64) error
- func (db *DB) DeleteGuildMember(_ context.Context, guild, user int64) error
- func (db *DB) DeleteGuildMembers(_ context.Context, guild int64) error
- func (db *DB) DeleteGuildRole(_ context.Context, guild, role int64) error
- func (db *DB) DeleteGuildRoles(_ context.Context, guild int64) error
- func (db *DB) DeleteGuildRolesById(ctx context.Context, guildID int64, roleIDs []int64) error
- func (db *DB) DeleteThread(_ context.Context, id int64) error
- func (db *DB) DeleteThreads(_ context.Context, guild int64) error
- func (db *DB) Encoding() discord.Encoding
- func (db *DB) ExistUserInGuilds(ctx context.Context, guildIDs []int64, userID int64) (bool, error)
- func (db *DB) ExistUserInGuildsHasRoles(ctx context.Context, guildIDs []int64, roleIDs []string, userID int64) (bool, error)
- func (db *DB) GetChannel(_ context.Context, id int64) ([]byte, error)
- func (db *DB) GetChannelCount(_ context.Context) (int, error)
- func (db *DB) GetChannelMessage(_ context.Context, channel, id int64) ([]byte, error)
- func (db *DB) GetChannelThreads(_ context.Context, channel int64) ([][]byte, error)
- func (db *DB) GetChannels(_ context.Context) ([][]byte, error)
- func (db *DB) GetGuild(_ context.Context, id int64) ([]byte, error)
- func (db *DB) GetGuildBan(_ context.Context, guild, user int64) ([]byte, error)
- func (db *DB) GetGuildChannels(_ context.Context, guild int64) ([][]byte, error)
- func (db *DB) GetGuildCount(_ context.Context) (int, error)
- func (db *DB) GetGuildEmoji(_ context.Context, guild, emoji int64) ([]byte, error)
- func (db *DB) GetGuildEmojis(_ context.Context, guild int64) ([][]byte, error)
- func (db *DB) GetGuildMember(_ context.Context, guild, user int64) ([]byte, error)
- func (db *DB) GetGuildMemberCount(ctx context.Context, guildID int64) (int, error)
- func (db *DB) GetGuildMembers(_ context.Context, guild int64) ([][]byte, error)
- func (db *DB) GetGuildMembersWithRole(ctx context.Context, guild, role int64) ([][]byte, error)
- func (db *DB) GetGuildRole(_ context.Context, guild, role int64) ([]byte, error)
- func (db *DB) GetGuildRoles(_ context.Context, guild int64) ([][]byte, error)
- func (db *DB) GetGuildThreads(_ context.Context, guild int64) ([][]byte, error)
- func (db *DB) GetResumeGatewayURL(ctx context.Context, shard int, name string) (string, error)
- func (db *DB) GetSequence(ctx context.Context, shard int, name string) (int64, error)
- func (db *DB) GetSessionID(ctx context.Context, shard int, name string) (string, error)
- func (db *DB) GetShardInfo(ctx context.Context, shard int, name string) (sess string, seq int64, err error)
- func (db *DB) GetThread(_ context.Context, id int64) ([]byte, error)
- func (db *DB) GetThreads(_ context.Context) ([][]byte, error)
- func (db *DB) GetThreadsCount(_ context.Context) (int, error)
- func (db *DB) GetUser(ctx context.Context, userID int64) ([]byte, error)
- func (db *DB) GetUserPresence(ctx context.Context, guildID, userID int64) ([]byte, error)
- func (db *DB) GetUsersDiscordIdAndUsername(ctx context.Context, userIDs []int64) ([]state.UserAndData, error)
- func (db *DB) ReadTransact(fn func(t fdb.ReadTransaction) error) error
- func (db *DB) SearchGuildMembers(ctx context.Context, guildID int64, query string) ([][]byte, error)
- func (db *DB) SetChannel(_ context.Context, guild, id int64, raw []byte) error
- func (db *DB) SetChannelMessage(_ context.Context, channel, id int64, raw []byte) error
- func (db *DB) SetChannelMessageReaction(_ context.Context, channel, id, user int64, name interface{}, raw []byte) error
- func (db *DB) SetChannels(_ context.Context, guild int64, channels map[int64][]byte) error
- func (db *DB) SetGuild(_ context.Context, id int64, raw []byte) (bool, error)
- func (db *DB) SetGuildBan(_ context.Context, guild, user int64, raw []byte) error
- func (db *DB) SetGuildEmoji(_ context.Context, guild, emoji int64, raw []byte) error
- func (db *DB) SetGuildEmojis(_ context.Context, guild int64, raws map[int64][]byte) error
- func (db *DB) SetGuildMember(_ context.Context, guild, user int64, raw []byte) error
- func (db *DB) SetGuildMembers(_ context.Context, guild int64, raws map[int64][]byte) error
- func (db *DB) SetGuildRole(_ context.Context, guild, role int64, raw []byte) error
- func (db *DB) SetGuildRoles(_ context.Context, guild int64, roles map[int64][]byte) error
- func (db *DB) SetPresence(ctx context.Context, guildID, userID int64, data []byte) error
- func (db *DB) SetPresences(ctx context.Context, guildID int64, presences map[int64][]byte) error
- func (db *DB) SetResumeGatewayURL(ctx context.Context, shard int, name string, resumeURL string) error
- func (db *DB) SetSequence(ctx context.Context, shard int, name string, seq int64) error
- func (db *DB) SetSessionID(ctx context.Context, shard int, name, sess string) error
- func (db *DB) SetStatus(ctx context.Context, shard int, name, sess string) error
- func (db *DB) SetThread(_ context.Context, guild, channel, owner, id int64, raw []byte) error
- func (db *DB) SetThreads(_ context.Context, guild int64, threads map[int64][]byte) error
- func (db *DB) SetVoiceState(_ context.Context, guild, user int64, raw []byte) error
- func (db *DB) Transact(fn func(t fdb.Transaction) error) error
- type Subspaces
Constants ¶
View Source
const ( // ChannelSubspaceName is the enum for the channel subspace. ChannelSubspaceName = iota // GuildSubspaceName is the enum for the guild subspace. GuildSubspaceName // MemberSubspaceName is the enum for the member subspace. MemberSubspaceName // MessageSubspaceName is the enum for the message subspace. MessageSubspaceName // PresenceSubspaceName is the enum for the presence subspace. PresenceSubspaceName // UserSubspaceName is the enum for the user subspace. UserSubspaceName // RoleSubspaceName is the enum for the role subspace. RoleSubspaceName // VoiceStateSubspaceName is the enum for the voice state subspace. VoiceStateSubspaceName // EmojiSubspaceName is the enum for the emoji subspace. EmojiSubspaceName // ThreadsSubspaceName is the enum for the threads subspace. ThreadsSubspaceName )
If new enums need to be added, always append. If you are deprecating an enum never delete it.
Variables ¶
View Source
var (
FDBRangeWantAll = fdb.RangeOptions{Mode: fdb.StreamingModeWantAll}
)
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) DeleteChannelMessage ¶
func (*DB) DeleteChannelMessageReaction ¶
func (*DB) DeleteChannelMessageReactions ¶
func (*DB) DeleteChannels ¶
this will leak channels in the main pool. TODO: fix
func (*DB) DeleteChannelsById ¶
func (*DB) DeleteGuildBan ¶
func (*DB) DeleteGuildEmoji ¶
func (*DB) DeleteGuildEmojis ¶
func (*DB) DeleteGuildMember ¶
func (*DB) DeleteGuildMembers ¶
func (*DB) DeleteGuildRole ¶
func (*DB) DeleteGuildRolesById ¶
func (*DB) DeleteThreads ¶
this will leak threads in the main pool. TODO: fix
func (*DB) ExistUserInGuilds ¶
func (*DB) ExistUserInGuildsHasRoles ¶
func (*DB) GetChannelMessage ¶
func (*DB) GetChannelThreads ¶
func (*DB) GetGuildBan ¶
func (*DB) GetGuildChannels ¶
func (*DB) GetGuildEmoji ¶
func (*DB) GetGuildEmojis ¶
func (*DB) GetGuildMember ¶
func (*DB) GetGuildMemberCount ¶
func (*DB) GetGuildMembers ¶
func (*DB) GetGuildMembersWithRole ¶
func (*DB) GetGuildRole ¶
func (*DB) GetGuildRoles ¶
func (*DB) GetGuildThreads ¶
func (*DB) GetResumeGatewayURL ¶
func (*DB) GetSequence ¶
func (*DB) GetSessionID ¶
func (*DB) GetShardInfo ¶
func (*DB) GetUserPresence ¶
func (*DB) GetUsersDiscordIdAndUsername ¶
func (*DB) ReadTransact ¶
func (db *DB) ReadTransact(fn func(t fdb.ReadTransaction) error) error
ReadTransact is a helper around (fdb.Database).ReadTransact which accepts a function that doesn't require a return value.
func (*DB) SearchGuildMembers ¶
func (*DB) SetChannel ¶
func (*DB) SetChannelMessage ¶
func (*DB) SetChannelMessageReaction ¶
func (*DB) SetChannels ¶
func (*DB) SetGuildBan ¶
func (*DB) SetGuildEmoji ¶
func (*DB) SetGuildEmojis ¶
func (*DB) SetGuildMember ¶
func (*DB) SetGuildMembers ¶
func (*DB) SetGuildRole ¶
func (*DB) SetGuildRoles ¶
func (*DB) SetPresence ¶
func (*DB) SetPresences ¶
func (*DB) SetResumeGatewayURL ¶
func (*DB) SetSequence ¶
func (*DB) SetSessionID ¶
func (*DB) SetThreads ¶
func (*DB) SetVoiceState ¶
type Subspaces ¶
type Subspaces struct { Channels subspace.Subspace Guilds subspace.Subspace Members subspace.Subspace Messages subspace.Subspace Presences subspace.Subspace Users subspace.Subspace Roles subspace.Subspace VoiceStates subspace.Subspace Emojis subspace.Subspace Threads subspace.Subspace }
Subspaces is a struct containing all of the different subspaces used.
func NewSubspaces ¶
func NewSubspaces(dir directory.DirectorySubspace) *Subspaces
NewSubspaces returns an instantiated Subspaces with the correct subspaces.
Click to show internal directories.
Click to hide internal directories.