storage

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

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

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

Jump to

Keyboard shortcuts

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