Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectionName ¶
type CollectionName string
const ( CommandRegistrationsCollection CollectionName = "command_registrations" GuildConfigCollection CollectionName = "guild_config" )
func (CollectionName) String ¶
func (c CollectionName) String() string
type CommandRegistration ¶
type GuildConfig ¶
type GuildConfig struct { GuildId string `bson:"guild_id"` ScrapeConfigs []ScrapeConfig `bson:"scrape_configs"` }
func NewGuildConfig ¶
func NewGuildConfig(guildId string) *GuildConfig
type Repo ¶
type Repo interface { RegisterCommand(ctx context.Context, guildId string, commandId string, commandName string) error GetRegisteredCommands(ctx context.Context, guildId string) ([]CommandRegistration, error) GetGuildConfigs(ctx context.Context) ([]GuildConfig, error) GetGuildConfig(ctx context.Context, guildId string) (*GuildConfig, error) SetGuildConfig(ctx context.Context, config *GuildConfig) error ClearGuildInfo(ctx context.Context, guildId string) error }
func SetupInMemoryDatabase ¶
func SetupInMemoryDatabase(logger logrus.FieldLogger) Repo
func SetupMongoDatabase ¶
type ScrapeConfig ¶
type ScrapeConfig struct { Name string `bson:"scrape_name"` Endpoint string `bson:"endpoint"` Username string `bson:"username"` Password string `bson:"password"` ScrapeIntervalMinutes int64 `bson:"scrape_interval_minutes"` AlertChannelId string `bson:"alert_channel_id"` InhibitedAlerts []string `bson:"inhibited_alerts"` }
Click to show internal directories.
Click to hide internal directories.