Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidObjectId error = errors.New("Invalid object ID")
View Source
var ErrNotFound error = errors.New("Item not found")
View Source
var ErrNotUnique error = errors.New("Resource already exists")
View Source
var ErrSlugEmpty error = errors.New("Slug is nil or empty")
View Source
var ErrUnsupportedDatabase error = errors.New("Unsuppored database type")
Functions ¶
This section is empty.
Types ¶
type DBClient ¶
type DBClient interface { CloseSession() // Notifications GetNotifications() ([]contract.Notification, error) GetNotificationById(id string) (contract.Notification, error) GetNotificationBySlug(slug string) (contract.Notification, error) GetNotificationBySender(sender string, limit int) ([]contract.Notification, error) GetNotificationsByLabels(labels []string, limit int) ([]contract.Notification, error) GetNotificationsByStartEnd(start int64, end int64, limit int) ([]contract.Notification, error) GetNotificationsByStart(start int64, limit int) ([]contract.Notification, error) GetNotificationsByEnd(end int64, limit int) ([]contract.Notification, error) GetNewNotifications(limit int) ([]contract.Notification, error) GetNewNormalNotifications(limit int) ([]contract.Notification, error) AddNotification(n contract.Notification) (string, error) UpdateNotification(n contract.Notification) error MarkNotificationProcessed(n contract.Notification) error DeleteNotificationById(id string) error DeleteNotificationBySlug(id string) error DeleteNotificationsOld(age int) error // Subscriptions GetSubscriptions() ([]contract.Subscription, error) GetSubscriptionById(id string) (contract.Subscription, error) GetSubscriptionBySlug(slug string) (contract.Subscription, error) GetSubscriptionByReceiver(receiver string) ([]contract.Subscription, error) GetSubscriptionByCategories(categories []string) ([]contract.Subscription, error) GetSubscriptionByLabels(labels []string) ([]contract.Subscription, error) GetSubscriptionByCategoriesLabels(categories []string, labels []string) ([]contract.Subscription, error) AddSubscription(s contract.Subscription) (string, error) UpdateSubscription(s contract.Subscription) error DeleteSubscriptionById(id string) error DeleteSubscriptionBySlug(id string) error // Transmissions GetTransmissionById(id string) (contract.Transmission, error) GetTransmissionsByNotificationSlug(slug string, limit int) ([]contract.Transmission, error) GetTransmissionsByNotificationSlugAndStartEnd(slug string, start int64, end int64, limit int) ([]contract.Transmission, error) GetTransmissionsByStartEnd(start int64, end int64, limit int) ([]contract.Transmission, error) GetTransmissionsByStart(start int64, limit int) ([]contract.Transmission, error) GetTransmissionsByEnd(end int64, limit int) ([]contract.Transmission, error) GetTransmissionsByStatus(limit int, status contract.TransmissionStatus) ([]contract.Transmission, error) AddTransmission(t contract.Transmission) (string, error) UpdateTransmission(t contract.Transmission) error DeleteTransmission(age int64, status contract.TransmissionStatus) error // General Cleanup Cleanup() error CleanupOld(age int) error }
type DBConfiguration ¶
type DatabaseType ¶
type DatabaseType int8 // Database type enum
const (
MONGO DatabaseType = iota
)
Click to show internal directories.
Click to hide internal directories.