interfaces

package
v1.3.1-dev.10 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

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 DBConfiguration struct {
	DbType            DatabaseType
	Host              string
	Port              int
	Timeout           int
	DatabaseName      string
	Username          string
	Password          string
	ReadMax           int
	ResendLimit       int
	CleanupDefaultAge int
}

type DatabaseType

type DatabaseType int8 // Database type enum
const (
	MONGO DatabaseType = iota
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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