mongo

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: BSL-1.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalClient *mongo.Client

GlobalClient ...

View Source
var GlobalCollection *mongo.Collection

GlobalCollection - default collection specified in config

View Source
var GlobalDatabase *mongo.Database

GlobalDatabase - default database specified in config

Functions

func DateTimeUTCNow

func DateTimeUTCNow() primitive.DateTime

DateTimeUTCNow gets the current time as a primitive.DateTime

func GetNotificationsForStreamOfflineEvent

func GetNotificationsForStreamOfflineEvent(userID string) ([]notification.Notification, error)

GetNotificationsForStreamOfflineEvent - Get a list of notifications for a certain streamer. If streamID is not nil, notifications that have already notified for this stream will be excluded from results.

func GetNotificationsForStreamOnlineEvent

func GetNotificationsForStreamOnlineEvent(userID string, streamID string) ([]notification.Notification, error)

GetNotificationsForStreamOnlineEvent - Get a list of notifications for a certain streamer. If streamID is not nil, notifications that have already notified for this stream will be excluded from results.

func RegisterClient

func RegisterClient(addr string) *mongo.Client

RegisterClient creates a MongoDB driver instance, connects to, and pings the specified database.

func SetNotificationLastEvent

func SetNotificationLastEvent(ID primitive.Binary, lastEvent notification.LastEvent)

SetNotificationLastEvent sets the `last_event` field to the specified object. Ignores any errors raised by MongoDB.

func SetStreamOfflineLastEvent

func SetStreamOfflineLastEvent(ID primitive.Binary)

SetStreamOfflineLastEvent sets the `last_event.notified_stream_offline` field to `true`. Ignores any errors raised by MongoDB.

Types

This section is empty.

Jump to

Keyboard shortcuts

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