mongostorage

package
v0.0.0-...-bb896f4 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoStorage

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

MongoStorage is a MongoDB implementation of a storage.

func New

func New(storageConfig botconfig.StorageConfig) (*MongoStorage, error)

New creates a new MongoStorage

func (*MongoStorage) Connect

func (b *MongoStorage) Connect() error

Connect initializes the MongoStorage by using the appropriate Mongo functions. In addition it checks its collections and creates indices if necessary. This method must be called before the Mongo Backend can be used.

func (*MongoStorage) DeleteQuotesPluginQuote

func (b *MongoStorage) DeleteQuotesPluginQuote(botID, pluginID, identifier string) error

DeleteQuotesPluginQuote deletes a QuotesPluginQuote.

func (*MongoStorage) GetCustomCommandsPluginCommands

func (b *MongoStorage) GetCustomCommandsPluginCommands(botID, pluginID, identifier string) (storagemodels.CustomCommandsPluginCommands, error)

GetCustomCommandsPluginCommands returns CustomCommandsPluginCommands.

func (*MongoStorage) GetQuotesPluginQuote

func (b *MongoStorage) GetQuotesPluginQuote(botID, pluginID, identifier string) (storagemodels.QuotesPluginQuote, error)

GetQuotesPluginQuote returns a QuotesPluginQuote.

func (*MongoStorage) GetQuotesPluginQuotesList

func (b *MongoStorage) GetQuotesPluginQuotesList(botID, pluginID, identifier string) (storagemodels.QuotesPluginQuotesList, error)

GetQuotesPluginQuotesList returns a QuotesPluginQuotesList.

func (*MongoStorage) GetTimedMessagesPluginMessages

func (b *MongoStorage) GetTimedMessagesPluginMessages(botID, pluginID, identifier string) (storagemodels.TimedMessagesPluginMessages, error)

GetTimedMessagesPluginMessages returns a TimedMessagesPluginMessages.

func (*MongoStorage) IsConnected

func (b *MongoStorage) IsConnected() bool

IsConnected indicates if there is a connection to a Mongo server

func (*MongoStorage) StoreArchivePluginMessage

func (b *MongoStorage) StoreArchivePluginMessage(botID, pluginID, identifier string, data storagemodels.ArchivePluginMessage) error

StoreArchivePluginMessage stores data for ArchivePlugin.

func (*MongoStorage) StoreCustomCommandsPluginCommands

func (b *MongoStorage) StoreCustomCommandsPluginCommands(botID, pluginID, identifier string, data storagemodels.CustomCommandsPluginCommands) error

StoreCustomCommandsPluginCommands stores data for CustomCommandsPlugin.

func (*MongoStorage) StoreQuotesPluginQuote

func (b *MongoStorage) StoreQuotesPluginQuote(botID, pluginID, identifier string, data storagemodels.QuotesPluginQuote) error

StoreQuotesPluginQuote takes a QuotesPluginQuote and stores it.

func (*MongoStorage) StoreQuotesPluginQuotesList

func (b *MongoStorage) StoreQuotesPluginQuotesList(botID, pluginID, identifier string, data storagemodels.QuotesPluginQuotesList) error

StoreQuotesPluginQuotesList takes a QuotesPluginQuotesList and stores it.

func (*MongoStorage) StoreTimedMessagesPluginMessages

func (b *MongoStorage) StoreTimedMessagesPluginMessages(botID, pluginID, identifier string, data storagemodels.TimedMessagesPluginMessages) error

StoreTimedMessagesPluginMessages stores data for TimedMessagesPlugin.

Jump to

Keyboard shortcuts

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