Documentation ¶
Index ¶
- Variables
- func DateTimeUTCNow() primitive.DateTime
- func GetNotificationsForStreamOfflineEvent(userID string) ([]notification.Notification, error)
- func GetNotificationsForStreamOnlineEvent(userID string, streamID string) ([]notification.Notification, error)
- func RegisterClient(addr string) *mongo.Client
- func SetNotificationLastEvent(ID primitive.Binary, lastEvent notification.LastEvent)
- func SetStreamOfflineLastEvent(ID primitive.Binary)
Constants ¶
This section is empty.
Variables ¶
var GlobalClient *mongo.Client
GlobalClient ...
var GlobalCollection *mongo.Collection
GlobalCollection - default collection specified in config
var GlobalDatabase *mongo.Database
GlobalDatabase - default database specified in config
Functions ¶
func DateTimeUTCNow ¶
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 ¶
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 ¶
SetStreamOfflineLastEvent sets the `last_event.notified_stream_offline` field to `true`. Ignores any errors raised by MongoDB.
Types ¶
This section is empty.