Documentation ¶
Index ¶
Constants ¶
View Source
const ( CollectionNameChannels = CollectionName("channels") CollectionNameMOTDs = CollectionName("motds") // Migration collections // CollectionNameChannels = CollectionName("new-channels") // Temporary coll with new channels CollectionNameOldSubscriptions = CollectionName("old-subscriptions") // Coll where old subscriptions should be imported )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectionName ¶
type CollectionName string
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewMongoConnection ¶
func NewMongoConnection(bgctx context.Context, cfg *config.TCBConfig) *Connection
NewMongoConnection creates a new instance of mongo.Connection. Keep in mind that Connect() has to be called before using it
func (*Connection) Collection ¶
func (conn *Connection) Collection(name CollectionName) *mongo.Collection
Collection returns a collection with given name from the bot's main database specified in the config
func (*Connection) CollectionSubs ¶
func (conn *Connection) CollectionSubs(channelID string) *mongo.Collection
CollectionSubs returns a collection that stores user's subscriptions to SubEvent events
func (Connection) Connect ¶
func (conn Connection) Connect(bgctx context.Context)
func (Connection) Disconnect ¶
func (conn Connection) Disconnect(bgctx context.Context)
Click to show internal directories.
Click to hide internal directories.