Documentation ¶
Index ¶
- func AddManualGuildFlags(guildID int64, flags ...string) error
- func BatchInitCache(guilds []int64) error
- func EvictCacheForGuild(guildID int64)
- func GetGuildFlags(guildID int64) ([]string, error)
- func GuildHasFlag(guildID int64, flag string) (bool, error)
- func GuildHasFlagOrLogError(guildID int64, flag string) bool
- func MarkGuildDirty(guildID int64)
- func RegisterPlugin()
- func RemoveManualGuildFlags(guildID int64, flags ...string) error
- func RetryGetGuildFlags(guildID int64) (flags []string, err error)
- func UpdateGuildFlags(guildID int64) error
- func UpdatePluginFeatureFlags(guildID int64, p PluginWithFeatureFlags) error
- type EvictCacheData
- type Plugin
- type PluginWithBatchFeatureFlags
- type PluginWithFeatureFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddManualGuildFlags ¶
in some scenarios manual flag management is usefull and since updating flags dosen't trample over unknown flags its completely reliable aswelll
func BatchInitCache ¶
func EvictCacheForGuild ¶
func EvictCacheForGuild(guildID int64)
EvictCacheForGuild evicts the specified guild's featureflag cache
func GetGuildFlags ¶
GetGuildFlags returns the feature flags a guild has
func GuildHasFlag ¶
GuildHasFlag returns true if the target guild has the provided flag
func GuildHasFlagOrLogError ¶
GuildHasFlagOrLogError is the same as GuildHasFlag but will handle the error and log it
func MarkGuildDirty ¶
func MarkGuildDirty(guildID int64)
MarkGuildDirty marks a guild's feature flags dirty
func RegisterPlugin ¶
func RegisterPlugin()
RegisterPlugin registers the mqueue plugin into the plugin system and also initializes it
func RemoveManualGuildFlags ¶
in some scenarios manual flag management is usefull and since updating flags dosen't trample over unknown flags its completely reliable aswelll
func RetryGetGuildFlags ¶
RetryGetGuildFlags is the same as GetGuildFlags but will retry fetching the flags up to around 2 minutes before giving up on errors
func UpdateGuildFlags ¶
UpdateGuildFlags updates the provided guilds feature flags
func UpdatePluginFeatureFlags ¶
func UpdatePluginFeatureFlags(guildID int64, p PluginWithFeatureFlags) error
UpdatePluginFeatureFlags updates the feature flags of the provided plugin for the provided guild
Types ¶
type EvictCacheData ¶
type EvictCacheData struct {
GuildID int64 `json:"guild_id"`
}
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin represents the mqueue plugin
func (*Plugin) BatchInitialPluginUpdater ¶
func (p *Plugin) BatchInitialPluginUpdater(pbf PluginWithBatchFeatureFlags) error
Does a sparse initial update for new feature flags This is only used in cases where the feature flags can be calculated in a batch to save time This does NOT remove any flags so its purely to intiially populate the flags It should also run fairly fast since its blocking normal operation
func (*Plugin) PluginInfo ¶
func (p *Plugin) PluginInfo() *common.PluginInfo
PluginInfo implements common.Plugin
func (*Plugin) RunBackgroundWorker ¶
func (p *Plugin) RunBackgroundWorker()
RunBackgroundWorker implements backgroundworkers.BackgroundWorkerPlugin
func (*Plugin) StopBackgroundWorker ¶
StopBackgroundWorker implements backgroundworkers.BackgroundWorkerPlugin
type PluginWithBatchFeatureFlags ¶
type PluginWithBatchFeatureFlags interface { PluginWithFeatureFlags UpdateFeatureFlagsBatch() (map[int64][]string, error) }
this provides a way to batch update flags initially during init for example with premium, we can get all the premium guilds in 1 db query as opposed to querying each individual guild individually