Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
ID uint `gorm:"primaryKey" json:"id"`
Hash string `gorm:"index:idx_event_hash,unique" json:"unique_hash"`
City string `gorm:"size:255;not null" json:"city"`
Address string `gorm:"type:text;not null;index:idx_event_address" json:"address"`
Start time.Time `gorm:"column:start_at" json:"start_at"`
End time.Time `gorm:"column:end_at" json:"end_at"`
CreatedAt time.Time `json:"created_at"`
}
func (*Event) StartClock ¶ added in v0.0.4
type Listener ¶
type Listener struct {
ID uint `gorm:"primaryKey" json:"id"`
// ChatID
TelegramCID int64 `gorm:"not null" json:"-"`
// ThreadID
TelegramTID int64 `gorm:"null" json:"-"`
// Mattermost channel id
MattermostCID string `gorm:"type:text" json:"-"`
// Mattermost root post id for threaded replies
MattermostRID string `gorm:"type:text" json:"-"`
// Search Text (sql `like`)
SearchTerm string `gorm:"type:text;not null;uniqueIndex:idx_listener_term_city" json:"search_term"`
City string `gorm:"size:255;not null;uniqueIndex:idx_listener_term_city" json:"city"`
}
type Notification ¶ added in v0.0.4
type Notification struct {
ID uint `gorm:"primaryKey" json:"id"`
// Foreign keys to Listener and Event
ListenerID uint `gorm:"not null;index" json:"listener_id"`
EventID uint `gorm:"not null;index" json:"event_id"`
// Notification payload
Message string `gorm:"type:text;not null" json:"message"`
// When the notification was sent
SentAt time.Time `gorm:"not null" json:"sent_at"`
// GORM auto-managed timestamp
CreatedAt time.Time `json:"created_at"`
// Relationships (preloaded on retrieval)
Listener *Listener `gorm:"foreignKey:ListenerID;constraint:OnDelete:CASCADE" json:"listener,omitempty"`
Event *Event `gorm:"foreignKey:EventID;constraint:OnDelete:CASCADE" json:"event,omitempty"`
}
type ScheduledNotification ¶ added in v0.4.0
type ScheduledNotification struct {
ID uint `gorm:"primaryKey"`
ScheduledAt time.Time `gorm:"not null;index"`
ListenerID uint `gorm:"not null"`
EventID uint `gorm:"not null"`
Message string `gorm:"type:text;not null"`
CreatedAt time.Time
}
ScheduledNotification persists pending scheduled notifications in the database so they survive service restarts. The scheduler's Storage implementation reads/writes this table.
Click to show internal directories.
Click to hide internal directories.