Documentation ¶
Overview ¶
Package storage provides an abstraction to interact with the storage of the data used by the bot.
Currently the only storage provider is MongoDB
Index ¶
- type StorageHelper
- func (storage *StorageHelper) AddUser(newUser int64)
- func (storage *StorageHelper) Connect(dbName string, connectionString string)
- func (storage *StorageHelper) Disconnect()
- func (storage *StorageHelper) GetCurrentOfferString() string
- func (storage *StorageHelper) GetSettings() settings.Settings
- func (storage *StorageHelper) GetTaskSettings() types.TaskSettings
- func (storage *StorageHelper) RemoveUser(userToRemove int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StorageHelper ¶
type StorageHelper struct {
// contains filtered or unexported fields
}
StorageHelper is handling the interactions with the storage
func (*StorageHelper) AddUser ¶
func (storage *StorageHelper) AddUser(newUser int64)
AddUser adds a user to the subscribers of the bot
func (*StorageHelper) Connect ¶
func (storage *StorageHelper) Connect(dbName string, connectionString string)
Connect to the database with the given dbName and connectionString
The created connection will be stored in the StorageHelper
func (*StorageHelper) Disconnect ¶
func (storage *StorageHelper) Disconnect()
Disconnect disconnects from the database
func (*StorageHelper) GetCurrentOfferString ¶
func (storage *StorageHelper) GetCurrentOfferString() string
GetCurrentOfferString returns the stringtemplate for the current offer
func (*StorageHelper) GetSettings ¶
func (storage *StorageHelper) GetSettings() settings.Settings
GetSettings returns the settings for the bot
func (*StorageHelper) GetTaskSettings ¶
func (storage *StorageHelper) GetTaskSettings() types.TaskSettings
GetTaskSettings returns the types.TaskSettings for the task
func (*StorageHelper) RemoveUser ¶
func (storage *StorageHelper) RemoveUser(userToRemove int64)
RemoveUser removes a user from the subscribers