Versions in this module Expand all Collapse all v1 v1.24.19 Mar 7, 2021 v1.20.6 Sep 3, 2019 Changes in this version + const MaxRetries + var Cached = NewCached() + var ErrInvalidConfig = errors.New("Invalid config") + var ErrNotFound = errors.New("Config not found") + var SQL = &Postgres + func HandleInvalidateCacheEvt(event *pubsub.Event) + func InitDatabases() + func InvalidateGuildCache(guildID interface{}, conf GuildConfig) + func KeyGuildConfig(guildID int64, configName string) string + func RegisterConfig(stor Storage, conf GuildConfig) + func StrID(id int64) string + type CachedStorage struct + func NewCached() *CachedStorage + func (c *CachedStorage) GetGuildConfig(ctx context.Context, guildID int64, dest GuildConfig) error + func (c *CachedStorage) InvalidateCache(guildID int64, config string) + type GuildConfig interface + GetGuildID func() int64 + GetName func() string + GetUpdatedAt func() time.Time + type GuildConfigModel struct + CreatedAt time.Time + GuildID int64 + UpdatedAt time.Time + func (gm *GuildConfigModel) GetGuildID() int64 + func (gm *GuildConfigModel) GetUpdatedAt() time.Time + type PostFetchHandler interface + PostFetch func() + type Postgres struct + func (p *Postgres) GetGuildConfig(ctx context.Context, guildID int64, conf GuildConfig) error + func (p *Postgres) SetGuildConfig(ctx context.Context, conf GuildConfig) error + func (p *Postgres) SetIfLatest(ctx context.Context, conf GuildConfig) (updated bool, err error) + type Storage interface + GetGuildConfig func(ctx context.Context, guildID int64, dest GuildConfig) (err error) + SetGuildConfig func(ctx context.Context, conf GuildConfig) error