featureflags

package
v1.25.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchInitCache added in v1.24.17

func BatchInitCache(guilds []int64) error

func EvictCacheForGuild

func EvictCacheForGuild(guildID int64)

EvictCacheForGuild evicts the specified guild's featureflag cache

func GetGuildFlags

func GetGuildFlags(guildID int64) ([]string, error)

GetGuildFlags returns the feature flags a guild has

func GuildHasFlag

func GuildHasFlag(guildID int64, flag string) (bool, error)

GuildHasFlag returns true if the target guild has the provided flag

func GuildHasFlagOrLogError

func GuildHasFlagOrLogError(guildID int64, flag string) bool

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 RetryGetGuildFlags

func RetryGetGuildFlags(guildID int64) (flags []string, err error)

RetryGetGuildFlags is the same as GetGuildFlags but will retry fetching the flags up to around 2 minutes before giving up on errors

func UpdateGuildFlags

func UpdateGuildFlags(guildID int64) error

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 Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin represents the mqueue plugin

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

func (p *Plugin) StopBackgroundWorker(wg *sync.WaitGroup)

StopBackgroundWorker implements backgroundworkers.BackgroundWorkerPlugin

type PluginWithFeatureFlags

type PluginWithFeatureFlags interface {
	common.Plugin

	UpdateFeatureFlags(guildID int64) ([]string, error)
	AllFeatureFlags() []string
}

PluginWithFeatureFlags is a interface for plugins that provide their own feature-flags

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL