mongo

package
v0.0.0-...-788a77d Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

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)

Jump to

Keyboard shortcuts

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