Documentation ¶
Index ¶
Constants ¶
View Source
const ( SEL_NOTIFICATION_SINGLE = `SELECT * from notifications WHERE id = $1` SEL_NOTIFICATIONS_SINCE = `SELECT * from notifications WHERE created_on >= $1 AND heard = $2` SEL_NOTIFICATIONS_UNHEARD = `SELECT * from notifications WHERE heard = %d` )
View Source
const ( // Priorities PRIO_LOW = 10 PRIO_MED = 20 PRIO_HIGH = 30 // Actions ACT_POLL = 10 ACT_PUSH = 20 // Heard status HRD_UNHEARD = 10 HRD_HEARD = 20 )
View Source
const (
INSERT_NOTIFICATION = `` /* 216-byte string literal not displayed */
)
View Source
const (
MARK_HEARD_NOTIFICATION = `UPDATE notifications
SET
heard=%d
WHERE
id in %s`
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Notification ¶
type Notification struct { Id int `json:"id" db:"id"` Title string `json:"title" db:"title"` Url string `json:"url, omitempty" db:"url"` Key string `json:"key" db:"key"` Heard int `json:"heard" db:"heard"` Provider int `json:"provider" db:"provider"` CreatedOn time.Time `json:"created_on, omitempty" db:"created_on"` Priority int `json:"priority" db:"priority"` Action int `json:"action" db:"action"` // this exists to enable providers to push without knowing their id ProviderName string `json:"provider_name, omitempty" db:"provider_name"` }
func GetUnheard ¶
func GetUnheard(conn *sqlx.DB) (n []*Notification, err error)
func (*Notification) ValidInsert ¶
func (self *Notification) ValidInsert() error
Click to show internal directories.
Click to hide internal directories.