Documentation ¶
Index ¶
- Constants
- type DatabaseObject
- func (dbo *DatabaseObject) CountAllNotificationsByUserId(userId uint) (n int, err error)
- func (dbo *DatabaseObject) CountUnreadNotificationsByUserId(userId uint) (n int, err error)
- func (dbo *DatabaseObject) DeleteNotificationById(notificationId uint) (err error)
- func (dbo *DatabaseObject) GetAllNotificationsByUserId(userId uint) (notifications []nm.Notification, err error)
- func (dbo *DatabaseObject) GetNotificationById(notificationId uint) (notification *nm.Notification, err error)
- func (dbo *DatabaseObject) GetNotificationsByUserIdOnPage(userId uint, pageNumber uint, pageSize uint) (notifications []nm.Notification, err error)
- func (dbo *DatabaseObject) GetPreparedStatementByIndex(i int) (ps *sql.Stmt)
- func (dbo *DatabaseObject) GetUnreadNotifications(userId uint) (notifications []nm.Notification, err error)
- func (dbo *DatabaseObject) Init() (err error)
- func (dbo *DatabaseObject) InsertNewNotification(userId uint, text string) (lastInsertedId int64, err error)
- func (dbo *DatabaseObject) MarkNotificationAsRead(notificationId uint, userId uint) (err error)
- func (dbo *DatabaseObject) SaveIncident(module cm.Module, incidentType cm.IncidentType, email string, userIPAB net.IP) (err error)
- func (dbo *DatabaseObject) SaveIncidentWithoutUserIPA(module cm.Module, incidentType cm.IncidentType, email string) (err error)
- type TableNames
Constants ¶
View Source
const ( TableNotifications = "Notifications" TableIncidents = "Incidents" )
View Source
const ( DbPsid_InsertNewNotification = 0 DbPsid_GetNotificationById = 1 DbPsid_MarkNotificationAsRead = 2 DbPsid_DeleteNotificationById = 3 DbPsid_SaveIncident = 4 DbPsid_SaveIncidentWithoutUserIPA = 5 DbPsid_GetAllNotificationsByUserId = 6 DbPsid_GetUnreadNotificationsByUserId = 7 DbPsid_CountUnreadNotificationsByUserId = 8 DbPsid_ClearNotifications = 9 DbPsid_GetNotificationsByUserIdOnPage = 10 DbPsid_CountAllNotificationsByUserId = 11 )
Indices of prepared statements.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseObject ¶
type DatabaseObject struct { cdbo.DatabaseObject // contains filtered or unexported fields }
func NewDatabaseObject ¶
func NewDatabaseObject(settings ns.DbSettings) (dbo *DatabaseObject)
func (*DatabaseObject) CountAllNotificationsByUserId ¶ added in v0.0.50
func (dbo *DatabaseObject) CountAllNotificationsByUserId(userId uint) (n int, err error)
func (*DatabaseObject) CountUnreadNotificationsByUserId ¶
func (dbo *DatabaseObject) CountUnreadNotificationsByUserId(userId uint) (n int, err error)
func (*DatabaseObject) DeleteNotificationById ¶
func (dbo *DatabaseObject) DeleteNotificationById(notificationId uint) (err error)
func (*DatabaseObject) GetAllNotificationsByUserId ¶
func (dbo *DatabaseObject) GetAllNotificationsByUserId(userId uint) (notifications []nm.Notification, err error)
func (*DatabaseObject) GetNotificationById ¶
func (dbo *DatabaseObject) GetNotificationById(notificationId uint) (notification *nm.Notification, err error)
func (*DatabaseObject) GetNotificationsByUserIdOnPage ¶ added in v0.0.50
func (dbo *DatabaseObject) GetNotificationsByUserIdOnPage(userId uint, pageNumber uint, pageSize uint) (notifications []nm.Notification, err error)
func (*DatabaseObject) GetPreparedStatementByIndex ¶
func (dbo *DatabaseObject) GetPreparedStatementByIndex(i int) (ps *sql.Stmt)
func (*DatabaseObject) GetUnreadNotifications ¶
func (dbo *DatabaseObject) GetUnreadNotifications(userId uint) (notifications []nm.Notification, err error)
func (*DatabaseObject) Init ¶
func (dbo *DatabaseObject) Init() (err error)
Init connects to the database, initialises the tables and prepares SQL statements.
func (*DatabaseObject) InsertNewNotification ¶
func (dbo *DatabaseObject) InsertNewNotification(userId uint, text string) (lastInsertedId int64, err error)
func (*DatabaseObject) MarkNotificationAsRead ¶
func (dbo *DatabaseObject) MarkNotificationAsRead(notificationId uint, userId uint) (err error)
func (*DatabaseObject) SaveIncident ¶
func (dbo *DatabaseObject) SaveIncident(module cm.Module, incidentType cm.IncidentType, email string, userIPAB net.IP) (err error)
func (*DatabaseObject) SaveIncidentWithoutUserIPA ¶
func (dbo *DatabaseObject) SaveIncidentWithoutUserIPA(module cm.Module, incidentType cm.IncidentType, email string) (err error)
type TableNames ¶
Click to show internal directories.
Click to hide internal directories.