configurator

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorZeroAffectedRowsMsg = "Zero affected rows. not found records. Expected more."

Variables

View Source
var NewCfgAlertBaseHealthIsDecreasing = NewConfiguratorAlertBool[models.AlertBaseIfHealthDecreasing]
View Source
var NewConfiguratorAuthorIgnore = NewConfiguratorTags[models.TagForumAuthorIgnore]
View Source
var NewConfiguratorAuthorWatch = NewConfiguratorTags[models.TagForumAuthorWatch]
View Source
var NewConfiguratorBase = NewConfiguratorTags[models.TagBase]
View Source
var NewConfiguratorContentIgnore = NewConfiguratorTags[models.TagForumContentIgnore]
View Source
var NewConfiguratorContentWatch = NewConfiguratorTags[models.TagForumContentWatch]
View Source
var NewConfiguratorForumIgnore = NewConfiguratorTags[models.TagForumPostIgnore]
View Source
var NewConfiguratorForumWatch = NewConfiguratorTags[models.TagForumPostTrack]
View Source
var NewConfiguratorPoBGood = NewConfiguratorTags[models.TagPoBGood]
View Source
var NewConfiguratorRegion = NewConfiguratorTags[models.TagRegion]
View Source
var NewConfiguratorSubForumIgnore = NewConfiguratorTags[models.TagForumSubforumIgnore]
View Source
var NewConfiguratorSubForumWatch = NewConfiguratorTags[models.TagForumSubforumTrack]
View Source
var NewConfiguratorSystem = NewConfiguratorTags[models.TagSystem]

Functions

func GetPingingMessage

func GetPingingMessage(ChannelID types.DiscordChannelID, configurator *Configurators, Discorder *discorder.Discorder) types.PingMessage

func NewErrorAggregator

func NewErrorAggregator() errorAggregator

Types

type AlertPoBGoodType added in v1.17.0

type AlertPoBGoodType interface {
	models.AlertPobGoodBelowThan | models.AlertPobGoodAboveThan
	GetGoodNickname() string
	GetThreshold() int
}

type AlertStringType

type AlertStringType interface {
	models.AlertPingMessage |
		models.ConfigBaseOrderingKey
	GetValue() string
}

type AlertThresholdType

type AlertThresholdType interface {
	// models.SomeAlert |
	models.AlertBaseHealthLowerThan |
		models.AlertBaseMoneyBelow |
		models.AlertBaseCargoBelow

	GetThreshold() int
}

type Alerts

type Alerts struct {
	BaseHealthLowerThan    CfgAlertBaseHealthLowerThan
	BaseHealthIsDecreasing CfgAlertBaseHealthIsDecreasing
	BaseIsUnderAttack      CfgAlertBaseIsUnderAttack
	BaseMoneyBelowThan     CfgAlertBaseMoneyBelowThan
	BaseCargoBelowThan     CfgAlertBaseCargoBelowThan
	PoBGoodsBelowThan      CfgAlertPoBGoodBelowThan
	PoBGoodsAboveThan      CfgAlertPoBGoodAboveThan
	PingMessage            CfgAlertPingMessage
}

type Base

type Base struct {
	Tags    ConfiguratorBase
	OrderBy CfgBaseOrderingKey
}

type CfgAlertBaseCargoBelowThan added in v1.17.0

type CfgAlertBaseCargoBelowThan = IConfiguratorAlertThreshold[models.AlertBaseCargoBelow]

type CfgAlertBaseMoneyBelowThan added in v1.17.0

type CfgAlertBaseMoneyBelowThan = IConfiguratorAlertThreshold[models.AlertBaseMoneyBelow]

type CfgAlertPoBGoodAboveThan added in v1.17.0

type CfgAlertPoBGoodAboveThan = IConfiguratorAlertPoBGood[models.AlertPobGoodAboveThan]

type CfgAlertPoBGoodBelowThan added in v1.17.0

type CfgAlertPoBGoodBelowThan = IConfiguratorAlertPoBGood[models.AlertPobGoodBelowThan]

type Configurator

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

func FixtureConfigurator

func FixtureConfigurator(dbpath types.Dbpath) *Configurator

func FixtureMigrator

func FixtureMigrator(callback func(dbpath types.Dbpath)) *Configurator

func NewConfigurator

func NewConfigurator(dbpath types.Dbpath) *Configurator

func (*Configurator) AutoMigrateSchema

func (cg *Configurator) AutoMigrateSchema() *Configurator

func (Configurator) GetClient

func (cg Configurator) GetClient() *gorm.DB

func (Configurator) GetDbpath

func (cg Configurator) GetDbpath() types.Dbpath

type ConfiguratorAuthorIgnore added in v1.15.0

type ConfiguratorAuthorIgnore = ConfiguratorTags[models.TagForumAuthorIgnore]

type ConfiguratorAuthorWatch added in v1.15.0

type ConfiguratorAuthorWatch = ConfiguratorTags[models.TagForumAuthorWatch]

type ConfiguratorBase

type ConfiguratorBase = ConfiguratorTags[models.TagBase]

type ConfiguratorChannel

type ConfiguratorChannel struct {
	*Configurator
}

func NewConfiguratorChannel

func NewConfiguratorChannel(con *Configurator) ConfiguratorChannel

func (ConfiguratorChannel) Add

func (ConfiguratorChannel) IsEnabled

func (c ConfiguratorChannel) IsEnabled(channelID types.DiscordChannelID) (bool, error)

func (ConfiguratorChannel) List

func (ConfiguratorChannel) Remove

func (c ConfiguratorChannel) Remove(channelID types.DiscordChannelID) error

type ConfiguratorContentIgnore added in v1.14.0

type ConfiguratorContentIgnore = ConfiguratorTags[models.TagForumContentIgnore]

type ConfiguratorContentWatch added in v1.14.0

type ConfiguratorContentWatch = ConfiguratorTags[models.TagForumContentWatch]

type ConfiguratorForumWatch

type ConfiguratorForumWatch = ConfiguratorTags[models.TagForumPostTrack]

type ConfiguratorPoBGood added in v1.17.0

type ConfiguratorPoBGood = ConfiguratorTags[models.TagPoBGood]

type ConfiguratorRegion

type ConfiguratorRegion = ConfiguratorTags[models.TagRegion]

type ConfiguratorSystem

type ConfiguratorSystem = ConfiguratorTags[models.TagSystem]

type ConfiguratorTags

type ConfiguratorTags[T taggable] struct {
	*Configurator
}

func NewConfiguratorTags

func NewConfiguratorTags[T taggable](configurator *Configurator) ConfiguratorTags[T]

func (ConfiguratorTags[T]) TagsAdd

func (c ConfiguratorTags[T]) TagsAdd(channelID types.DiscordChannelID, tags ...types.Tag) error

func (ConfiguratorTags[T]) TagsClear

func (c ConfiguratorTags[T]) TagsClear(channelID types.DiscordChannelID) error

func (ConfiguratorTags[T]) TagsList

func (c ConfiguratorTags[T]) TagsList(channelID types.DiscordChannelID) ([]types.Tag, error)

func (ConfiguratorTags[T]) TagsList2

func (c ConfiguratorTags[T]) TagsList2(channelID types.DiscordChannelID) []types.Tag

func (ConfiguratorTags[T]) TagsRemove

func (c ConfiguratorTags[T]) TagsRemove(channelID types.DiscordChannelID, tags ...types.Tag) error

type Configurators

type Configurators struct {
	Bases    Base
	Alerts   Alerts
	Forum    Forum
	PoBGood  PoBGood
	Configur *Configurator
	Channels ConfiguratorChannel
}

func NewConfigugurators

func NewConfigugurators(dbpath types.Dbpath) *Configurators

func NewConfiguratorsFromConfigur

func NewConfiguratorsFromConfigur(configur *Configurator) *Configurators

type ErrorZeroAffectedRows

type ErrorZeroAffectedRows struct {
	ExtraMsg string
}

func (ErrorZeroAffectedRows) Error

func (z ErrorZeroAffectedRows) Error() string

type Forum

type Forum struct {
	Thread   ForumThread
	Subforum ForumSubforum
	Content  ForumContent
	Author   ForumAuthor
}

type ForumAuthor added in v1.15.0

type ForumAuthor struct {
	Watch  ConfiguratorAuthorWatch
	Ignore ConfiguratorAuthorIgnore
}

type ForumContent added in v1.14.0

type ForumContent struct {
	Watch  ConfiguratorContentWatch
	Ignore ConfiguratorContentIgnore
}

type ForumSubforum

type ForumSubforum struct {
	Watch  ConfiguratorSubForumWatch
	Ignore ConfiguratorSubForumIgnore
}

type ForumThread

type ForumThread struct {
	Watch  ConfiguratorForumWatch
	Ignore ConfiguratorForumIgnore
}

type IConfiguratorAlertBool

type IConfiguratorAlertBool[T AlertBoolType] struct {
	*Configurator
}

func NewConfiguratorAlertBool

func NewConfiguratorAlertBool[T AlertBoolType](configurator *Configurator) IConfiguratorAlertBool[T]

func (IConfiguratorAlertBool[T]) Disable

func (c IConfiguratorAlertBool[T]) Disable(channelID types.DiscordChannelID) error

func (IConfiguratorAlertBool[T]) Enable

func (c IConfiguratorAlertBool[T]) Enable(channelID types.DiscordChannelID) error

func (IConfiguratorAlertBool[T]) Status

func (c IConfiguratorAlertBool[T]) Status(channelID types.DiscordChannelID) (bool, error)

type IConfiguratorAlertPoBGood added in v1.17.0

type IConfiguratorAlertPoBGood[T AlertPoBGoodType] struct {
	*Configurator
}

func NewConfiguratorAlertPoBGood added in v1.17.0

func NewConfiguratorAlertPoBGood[T AlertPoBGoodType](configurator *Configurator) IConfiguratorAlertPoBGood[T]

func (IConfiguratorAlertPoBGood[T]) Add added in v1.17.0

func (c IConfiguratorAlertPoBGood[T]) Add(channelID types.DiscordChannelID, good_nickname string, value int) error

func (IConfiguratorAlertPoBGood[T]) Clear added in v1.17.0

func (c IConfiguratorAlertPoBGood[T]) Clear(channelID types.DiscordChannelID) error

func (IConfiguratorAlertPoBGood[T]) Get added in v1.17.0

func (c IConfiguratorAlertPoBGood[T]) Get(channelID types.DiscordChannelID) (map[string]int, error)

func (IConfiguratorAlertPoBGood[T]) Remove added in v1.17.0

func (c IConfiguratorAlertPoBGood[T]) Remove(channelID types.DiscordChannelID, good_nickname string) error

type IConfiguratorAlertString

type IConfiguratorAlertString[T AlertStringType] struct {
	*Configurator
}

func NewConfiguratorAlertString

func NewConfiguratorAlertString[T AlertStringType](configurator *Configurator) IConfiguratorAlertString[T]

func (IConfiguratorAlertString[T]) Set

func (c IConfiguratorAlertString[T]) Set(channelID types.DiscordChannelID, value string) error

func (IConfiguratorAlertString[T]) Status

func (c IConfiguratorAlertString[T]) Status(channelID types.DiscordChannelID) (string, error)

func (IConfiguratorAlertString[T]) Unset

func (c IConfiguratorAlertString[T]) Unset(channelID types.DiscordChannelID) error

type IConfiguratorAlertThreshold

type IConfiguratorAlertThreshold[T AlertThresholdType] struct {
	*Configurator
}

func NewConfiguratorAlertThreshold

func NewConfiguratorAlertThreshold[T AlertThresholdType](configurator *Configurator) IConfiguratorAlertThreshold[T]

func (IConfiguratorAlertThreshold[T]) Set

func (IConfiguratorAlertThreshold[T]) Status

func (c IConfiguratorAlertThreshold[T]) Status(channelID types.DiscordChannelID) (int, error)

func (IConfiguratorAlertThreshold[T]) Unset

type IConfiguratorTags

type IConfiguratorTags interface {
	TagsAdd(channelID types.DiscordChannelID, tags ...types.Tag) error
	TagsRemove(channelID types.DiscordChannelID, tags ...types.Tag) error
	TagsList(channelID types.DiscordChannelID) ([]types.Tag, error)
	TagsClear(channelID types.DiscordChannelID) error
}

type PoBGood added in v1.17.0

type PoBGood struct {
	Tags ConfiguratorPoBGood
}

type PoBGoodStatus added in v1.17.0

type PoBGoodStatus struct {
	Threshold    int
	GoodNickname string
}

type StorageErrorExists

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

func (StorageErrorExists) Error

func (s StorageErrorExists) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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