Documentation
¶
Index ¶
- type AlertNotificationdeprecated
- type ConvectiveOutlookNotificationdeprecated
- type IAlertV2Table
- type IConvectiveOutlookTableV2
- type IDeviceTable
- type ILocationQueries
- type ILocationTable
- type IMesoscaleDiscussionV2Table
- type INotificationQueriesdeprecated
- type IUserNotificationTabledeprecated
- type LocationOptionType
- type MesoscaleDiscussionNotificationdeprecated
- type PostgresAlertV2Table
- func (p *PostgresAlertV2Table) Delete(id string) error
- func (p *PostgresAlertV2Table) Exists(id string) (bool, error)
- func (p *PostgresAlertV2Table) Insert(alert data_structures.AlertV2) error
- func (p *PostgresAlertV2Table) Select(id string) (*data_structures.AlertV2, error)
- func (p *PostgresAlertV2Table) SelectByLocation(codes []string, point geojson_v2.Point) ([]data_structures.AlertV2, error)
- type PostgresConvectiveOutlookTableV2
- func (p *PostgresConvectiveOutlookTableV2) Insert(outlooks []data_structures.ConvectiveOutlookV2) error
- func (p *PostgresConvectiveOutlookTableV2) Select(issuedTime time.Time, outlookType golang.ConvectiveOutlookType) ([]data_structures.ConvectiveOutlookV2, error)
- func (p *PostgresConvectiveOutlookTableV2) SelectAllLatest() (map[golang.ConvectiveOutlookType][]data_structures.ConvectiveOutlookV2, error)
- func (p *PostgresConvectiveOutlookTableV2) SelectAllLatestByLocation(point geojson_v2.Point) ([]data_structures.ConvectiveOutlookV2, error)
- func (p *PostgresConvectiveOutlookTableV2) SelectById(id string) ([]data_structures.ConvectiveOutlookV2, error)
- func (p *PostgresConvectiveOutlookTableV2) SelectLatest(outlookType golang.ConvectiveOutlookType) ([]data_structures.ConvectiveOutlookV2, error)
- type PostgresDeviceTable
- func (p PostgresDeviceTable) Delete(id string) error
- func (p PostgresDeviceTable) Insert(device data_structures.Device) error
- func (p PostgresDeviceTable) Select(id string) (*data_structures.Device, error)
- func (p PostgresDeviceTable) SelectByUser(userId string) ([]data_structures.Device, error)
- func (p PostgresDeviceTable) UpdateApnsToken(id, apnsToken string) error
- type PostgresLocationQueries
- func (n *PostgresLocationQueries) GetDevicesForAlertID(alertId string) (map[data_structures.Device][]string, error)
- func (n *PostgresLocationQueries) GetDevicesForConvectiveOutlookID(convectiveOutlookId string) (map[string]map[data_structures.Device][]string, error)
- func (n *PostgresLocationQueries) GetDevicesForMesoscaleDiscussionID(mesoscaleDiscussionID string) (map[data_structures.Device][]string, error)
- type PostgresLocationTable
- func (p *PostgresLocationTable) Delete(locationID string) error
- func (p *PostgresLocationTable) Insert(location data_structures.Location) error
- func (p *PostgresLocationTable) Select(locationID string) (*data_structures.Location, error)
- func (p *PostgresLocationTable) SelectByCodes(codes []string) ([]data_structures.Location, error)
- func (p *PostgresLocationTable) SelectByDeviceID(deviceID string) ([]data_structures.Location, error)
- func (p *PostgresLocationTable) SelectByUserID(userID string) ([]data_structures.Location, error)
- func (p *PostgresLocationTable) SelectNotificationsWithConvectiveOutlook() ([]data_structures.Location, error)
- func (p *PostgresLocationTable) SelectNotificationsWithMDNotifications() ([]data_structures.Location, error)
- func (p *PostgresLocationTable) Update(location data_structures.Location) error
- type PostgresMesoscaleDiscussionV2Table
- func (p *PostgresMesoscaleDiscussionV2Table) Delete(year, mdNumber int) error
- func (p *PostgresMesoscaleDiscussionV2Table) Insert(md data_structures.MesoscaleDiscussionV2) error
- func (p *PostgresMesoscaleDiscussionV2Table) Select(year, mdNumber int) (*data_structures.MesoscaleDiscussionV2, error)
- func (p *PostgresMesoscaleDiscussionV2Table) SelectById(id string) (*data_structures.MesoscaleDiscussionV2, error)
- func (p *PostgresMesoscaleDiscussionV2Table) SelectLatest() ([]data_structures.MesoscaleDiscussionV2, error)
- func (p *PostgresMesoscaleDiscussionV2Table) SelectLatestByLocation(point geojson_v2.Point) ([]data_structures.MesoscaleDiscussionV2, error)
- func (p *PostgresMesoscaleDiscussionV2Table) SelectMDNotInTable(year int, mdsToCheck map[int]bool) ([]int, error)
- type PostgresNotificationQueriesdeprecated
- func (n *PostgresNotificationQueries) GetDevicesForAlertId(alertId string) ([]AlertNotification, error)
- func (n *PostgresNotificationQueries) GetDevicesForConvectiveOutlookId(convectiveOutlookId string) ([]ConvectiveOutlookNotification, error)
- func (n *PostgresNotificationQueries) GetDevicesForMesoscaleDiscussion(mesoscaleDiscussionId string) ([]MesoscaleDiscussionNotification, error)
- type PostgresUserNotificationTabledeprecated
- func (p *PostgresUserNotificationTable) Delete(notificationId string) error
- func (p *PostgresUserNotificationTable) Insert(userNotification data_structures.UserNotification) error
- func (p *PostgresUserNotificationTable) Select(id string) (*data_structures.UserNotification, error)
- func (p *PostgresUserNotificationTable) SelectAll() ([]data_structures.UserNotification, error)
- func (p *PostgresUserNotificationTable) SelectByCodes(codes []string) ([]data_structures.UserNotification, error)
- func (p *PostgresUserNotificationTable) SelectByUserId(userId string) ([]data_structures.UserNotification, error)
- func (p *PostgresUserNotificationTable) SelectNotificationsWithConvectiveOutlook() ([]data_structures.UserNotification, error)
- func (p *PostgresUserNotificationTable) SelectNotificationsWithMDNotifications() ([]data_structures.UserNotification, error)
- func (p *PostgresUserNotificationTable) Update(id string, userNotification data_structures.UserNotification) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertNotification
deprecated
type AlertNotification struct { Device data_structures.Device LocationName string }
Deprecated: use the new location queries
type ConvectiveOutlookNotification
deprecated
type ConvectiveOutlookNotification struct { Device data_structures.Device LocationName string ConvectiveOutlookLabel string }
Deprecated: use the new location queries
type IAlertV2Table ¶
type IAlertV2Table interface { common_tables.IIdTable[data_structures.AlertV2] SelectByLocation(codes []string, point geojson_v2.Point) ([]data_structures.AlertV2, error) Exists(id string) (bool, error) }
type IConvectiveOutlookTableV2 ¶
type IConvectiveOutlookTableV2 interface { Insert(outlooks []data_structures.ConvectiveOutlookV2) error Select(publishedTime time.Time, outlookType golang.ConvectiveOutlookType) ([]data_structures.ConvectiveOutlookV2, error) SelectById(id string) ([]data_structures.ConvectiveOutlookV2, error) SelectLatest(outlookType golang.ConvectiveOutlookType) ([]data_structures.ConvectiveOutlookV2, error) SelectAllLatest() (map[golang.ConvectiveOutlookType][]data_structures.ConvectiveOutlookV2, error) SelectAllLatestByLocation(point geojson_v2.Point) ([]data_structures.ConvectiveOutlookV2, error) }
type IDeviceTable ¶
type IDeviceTable interface { common_tables.IIdTable[data_structures.Device] SelectByUser(userId string) ([]data_structures.Device, error) UpdateApnsToken(id, apnsToken string) error }
type ILocationQueries ¶ added in v5.1.0
type ILocationQueries interface { GetDevicesForAlertID(alertID string) (map[data_structures.Device][]string, error) GetDevicesForConvectiveOutlookID(convectiveOutlookID string) (map[string]map[data_structures.Device][]string, error) GetDevicesForMesoscaleDiscussionID(mesoscaleDiscussionID string) (map[data_structures.Device][]string, error) }
type ILocationTable ¶ added in v5.1.0
type ILocationTable interface { common_tables.IIdTable[data_structures.Location] SelectByUserID(userID string) ([]data_structures.Location, error) SelectByDeviceID(deviceID string) ([]data_structures.Location, error) SelectByCodes(codes []string) ([]data_structures.Location, error) SelectNotificationsWithMDNotifications() ([]data_structures.Location, error) SelectNotificationsWithConvectiveOutlook() ([]data_structures.Location, error) Update(location data_structures.Location) error }
type IMesoscaleDiscussionV2Table ¶
type IMesoscaleDiscussionV2Table interface { Insert(md data_structures.MesoscaleDiscussionV2) error Select(mdNumber int, year int) (*data_structures.MesoscaleDiscussionV2, error) SelectById(id string) (*data_structures.MesoscaleDiscussionV2, error) SelectMDNotInTable(year int, mdsToCheck map[int]bool) ([]int, error) SelectLatestByLocation(point geojson_v2.Point) ([]data_structures.MesoscaleDiscussionV2, error) SelectLatest() ([]data_structures.MesoscaleDiscussionV2, error) Delete(year, mdNumber int) error }
type INotificationQueries
deprecated
type INotificationQueries interface { GetDevicesForAlertId(alertId string) ([]AlertNotification, error) GetDevicesForConvectiveOutlookId(convectiveOutlookId string) ([]ConvectiveOutlookNotification, error) GetDevicesForMesoscaleDiscussion(mesoscaleDiscussionId string) ([]MesoscaleDiscussionNotification, error) }
Deprecated: use the new location queries
type IUserNotificationTable
deprecated
type IUserNotificationTable interface { common_tables.IIdTable[data_structures.UserNotification] SelectAll() ([]data_structures.UserNotification, error) SelectByUserId(userId string) ([]data_structures.UserNotification, error) SelectByCodes(codes []string) ([]data_structures.UserNotification, error) SelectNotificationsWithMDNotifications() ([]data_structures.UserNotification, error) SelectNotificationsWithConvectiveOutlook() ([]data_structures.UserNotification, error) Update(id string, userNotification data_structures.UserNotification) error }
Deprecated: use the new location table
type LocationOptionType ¶ added in v5.1.0
type LocationOptionType int8
const ( LocationOptionType_AlertOption LocationOptionType = 0 LocationOptionType_ConvectiveOutlookOption LocationOptionType = 1 LocationOptionType_MesoscaleDiscussionNotifications LocationOptionType = 2 )
type MesoscaleDiscussionNotification
deprecated
type MesoscaleDiscussionNotification struct { Device data_structures.Device LocationName string }
Deprecated: use the new location queries
type PostgresAlertV2Table ¶
type PostgresAlertV2Table struct {
// contains filtered or unexported fields
}
func NewPostgresAlertV2Table ¶
func NewPostgresAlertV2Table(db *sql.DB) PostgresAlertV2Table
func (*PostgresAlertV2Table) Delete ¶
func (p *PostgresAlertV2Table) Delete(id string) error
func (*PostgresAlertV2Table) Exists ¶
func (p *PostgresAlertV2Table) Exists(id string) (bool, error)
func (*PostgresAlertV2Table) Insert ¶
func (p *PostgresAlertV2Table) Insert(alert data_structures.AlertV2) error
func (*PostgresAlertV2Table) Select ¶
func (p *PostgresAlertV2Table) Select(id string) (*data_structures.AlertV2, error)
func (*PostgresAlertV2Table) SelectByLocation ¶
func (p *PostgresAlertV2Table) SelectByLocation(codes []string, point geojson_v2.Point) ([]data_structures.AlertV2, error)
type PostgresConvectiveOutlookTableV2 ¶
type PostgresConvectiveOutlookTableV2 struct {
// contains filtered or unexported fields
}
func NewPostgresConvectiveOutlookTableV2 ¶
func NewPostgresConvectiveOutlookTableV2(db *sql.DB) PostgresConvectiveOutlookTableV2
func (*PostgresConvectiveOutlookTableV2) Insert ¶
func (p *PostgresConvectiveOutlookTableV2) Insert(outlooks []data_structures.ConvectiveOutlookV2) error
func (*PostgresConvectiveOutlookTableV2) Select ¶
func (p *PostgresConvectiveOutlookTableV2) Select(issuedTime time.Time, outlookType golang.ConvectiveOutlookType) ([]data_structures.ConvectiveOutlookV2, error)
func (*PostgresConvectiveOutlookTableV2) SelectAllLatest ¶
func (p *PostgresConvectiveOutlookTableV2) SelectAllLatest() (map[golang.ConvectiveOutlookType][]data_structures.ConvectiveOutlookV2, error)
func (*PostgresConvectiveOutlookTableV2) SelectAllLatestByLocation ¶
func (p *PostgresConvectiveOutlookTableV2) SelectAllLatestByLocation(point geojson_v2.Point) ([]data_structures.ConvectiveOutlookV2, error)
func (*PostgresConvectiveOutlookTableV2) SelectById ¶
func (p *PostgresConvectiveOutlookTableV2) SelectById(id string) ([]data_structures.ConvectiveOutlookV2, error)
func (*PostgresConvectiveOutlookTableV2) SelectLatest ¶
func (p *PostgresConvectiveOutlookTableV2) SelectLatest(outlookType golang.ConvectiveOutlookType) ([]data_structures.ConvectiveOutlookV2, error)
type PostgresDeviceTable ¶
type PostgresDeviceTable struct {
// contains filtered or unexported fields
}
func NewPostgresDeviceTable ¶
func NewPostgresDeviceTable(db *sql.DB) PostgresDeviceTable
func (PostgresDeviceTable) Delete ¶
func (p PostgresDeviceTable) Delete(id string) error
func (PostgresDeviceTable) Insert ¶
func (p PostgresDeviceTable) Insert(device data_structures.Device) error
func (PostgresDeviceTable) Select ¶
func (p PostgresDeviceTable) Select(id string) (*data_structures.Device, error)
func (PostgresDeviceTable) SelectByUser ¶
func (p PostgresDeviceTable) SelectByUser(userId string) ([]data_structures.Device, error)
func (PostgresDeviceTable) UpdateApnsToken ¶
func (p PostgresDeviceTable) UpdateApnsToken(id, apnsToken string) error
type PostgresLocationQueries ¶ added in v5.1.0
type PostgresLocationQueries struct {
// contains filtered or unexported fields
}
func NewLocationQueries ¶ added in v5.1.0
func NewLocationQueries(db *sql.DB) PostgresLocationQueries
func (*PostgresLocationQueries) GetDevicesForAlertID ¶ added in v5.1.0
func (n *PostgresLocationQueries) GetDevicesForAlertID(alertId string) (map[data_structures.Device][]string, error)
GetDevicesForAlertID returns a mapping from device to list of LocationNames
func (*PostgresLocationQueries) GetDevicesForConvectiveOutlookID ¶ added in v5.1.0
func (n *PostgresLocationQueries) GetDevicesForConvectiveOutlookID(convectiveOutlookId string) (map[string]map[data_structures.Device][]string, error)
GetDevicesForConvectiveOutlookID returns a mapping from level to device to list of LocationNames
func (*PostgresLocationQueries) GetDevicesForMesoscaleDiscussionID ¶ added in v5.1.0
func (n *PostgresLocationQueries) GetDevicesForMesoscaleDiscussionID(mesoscaleDiscussionID string) (map[data_structures.Device][]string, error)
GetDevicesForMesoscaleDiscussionID returns a mapping from device to list of LocationNames
type PostgresLocationTable ¶ added in v5.1.0
type PostgresLocationTable struct {
// contains filtered or unexported fields
}
func NewPostgresLocationTable ¶ added in v5.1.0
func NewPostgresLocationTable(db *sql.DB) PostgresLocationTable
func (*PostgresLocationTable) Delete ¶ added in v5.1.0
func (p *PostgresLocationTable) Delete(locationID string) error
func (*PostgresLocationTable) Insert ¶ added in v5.1.0
func (p *PostgresLocationTable) Insert(location data_structures.Location) error
func (*PostgresLocationTable) Select ¶ added in v5.1.0
func (p *PostgresLocationTable) Select(locationID string) (*data_structures.Location, error)
func (*PostgresLocationTable) SelectByCodes ¶ added in v5.1.0
func (p *PostgresLocationTable) SelectByCodes(codes []string) ([]data_structures.Location, error)
func (*PostgresLocationTable) SelectByDeviceID ¶ added in v5.1.0
func (p *PostgresLocationTable) SelectByDeviceID(deviceID string) ([]data_structures.Location, error)
func (*PostgresLocationTable) SelectByUserID ¶ added in v5.1.0
func (p *PostgresLocationTable) SelectByUserID(userID string) ([]data_structures.Location, error)
func (*PostgresLocationTable) SelectNotificationsWithConvectiveOutlook ¶ added in v5.1.0
func (p *PostgresLocationTable) SelectNotificationsWithConvectiveOutlook() ([]data_structures.Location, error)
func (*PostgresLocationTable) SelectNotificationsWithMDNotifications ¶ added in v5.1.0
func (p *PostgresLocationTable) SelectNotificationsWithMDNotifications() ([]data_structures.Location, error)
SelectNotificationsWithMDNotifications Selects all of the notifications that want mesoscale discussion notifications. Note this does not fill out AlertOptions or SPCOptions in the returned UserNotifications struct
func (*PostgresLocationTable) Update ¶ added in v5.1.0
func (p *PostgresLocationTable) Update(location data_structures.Location) error
type PostgresMesoscaleDiscussionV2Table ¶
type PostgresMesoscaleDiscussionV2Table struct {
// contains filtered or unexported fields
}
func NewPostgresMesoscaleDiscussionV2Table ¶
func NewPostgresMesoscaleDiscussionV2Table(db *sql.DB) PostgresMesoscaleDiscussionV2Table
func (*PostgresMesoscaleDiscussionV2Table) Delete ¶
func (p *PostgresMesoscaleDiscussionV2Table) Delete(year, mdNumber int) error
func (*PostgresMesoscaleDiscussionV2Table) Insert ¶
func (p *PostgresMesoscaleDiscussionV2Table) Insert(md data_structures.MesoscaleDiscussionV2) error
func (*PostgresMesoscaleDiscussionV2Table) Select ¶
func (p *PostgresMesoscaleDiscussionV2Table) Select(year, mdNumber int) (*data_structures.MesoscaleDiscussionV2, error)
func (*PostgresMesoscaleDiscussionV2Table) SelectById ¶
func (p *PostgresMesoscaleDiscussionV2Table) SelectById(id string) (*data_structures.MesoscaleDiscussionV2, error)
func (*PostgresMesoscaleDiscussionV2Table) SelectLatest ¶
func (p *PostgresMesoscaleDiscussionV2Table) SelectLatest() ([]data_structures.MesoscaleDiscussionV2, error)
func (*PostgresMesoscaleDiscussionV2Table) SelectLatestByLocation ¶
func (p *PostgresMesoscaleDiscussionV2Table) SelectLatestByLocation(point geojson_v2.Point) ([]data_structures.MesoscaleDiscussionV2, error)
func (*PostgresMesoscaleDiscussionV2Table) SelectMDNotInTable ¶
type PostgresNotificationQueries
deprecated
type PostgresNotificationQueries struct {
// contains filtered or unexported fields
}
Deprecated: use the new location queries
func NewNotificationQueries
deprecated
func NewNotificationQueries(db *sql.DB) PostgresNotificationQueries
Deprecated: use the new location queries
func (*PostgresNotificationQueries) GetDevicesForAlertId ¶
func (n *PostgresNotificationQueries) GetDevicesForAlertId(alertId string) ([]AlertNotification, error)
func (*PostgresNotificationQueries) GetDevicesForConvectiveOutlookId ¶
func (n *PostgresNotificationQueries) GetDevicesForConvectiveOutlookId(convectiveOutlookId string) ([]ConvectiveOutlookNotification, error)
func (*PostgresNotificationQueries) GetDevicesForMesoscaleDiscussion ¶
func (n *PostgresNotificationQueries) GetDevicesForMesoscaleDiscussion(mesoscaleDiscussionId string) ([]MesoscaleDiscussionNotification, error)
type PostgresUserNotificationTable
deprecated
type PostgresUserNotificationTable struct {
// contains filtered or unexported fields
}
Deprecated: use the new location table
func NewPostgresUserNotificationTable
deprecated
func NewPostgresUserNotificationTable(db *sql.DB) PostgresUserNotificationTable
Deprecated: use the new location table
func (*PostgresUserNotificationTable) Delete ¶
func (p *PostgresUserNotificationTable) Delete(notificationId string) error
func (*PostgresUserNotificationTable) Insert ¶
func (p *PostgresUserNotificationTable) Insert(userNotification data_structures.UserNotification) error
func (*PostgresUserNotificationTable) Select ¶
func (p *PostgresUserNotificationTable) Select(id string) (*data_structures.UserNotification, error)
func (*PostgresUserNotificationTable) SelectAll ¶
func (p *PostgresUserNotificationTable) SelectAll() ([]data_structures.UserNotification, error)
func (*PostgresUserNotificationTable) SelectByCodes ¶
func (p *PostgresUserNotificationTable) SelectByCodes(codes []string) ([]data_structures.UserNotification, error)
func (*PostgresUserNotificationTable) SelectByUserId ¶
func (p *PostgresUserNotificationTable) SelectByUserId(userId string) ([]data_structures.UserNotification, error)
func (*PostgresUserNotificationTable) SelectNotificationsWithConvectiveOutlook ¶
func (p *PostgresUserNotificationTable) SelectNotificationsWithConvectiveOutlook() ([]data_structures.UserNotification, error)
func (*PostgresUserNotificationTable) SelectNotificationsWithMDNotifications ¶
func (p *PostgresUserNotificationTable) SelectNotificationsWithMDNotifications() ([]data_structures.UserNotification, error)
SelectNotificationsWithMDNotifications Selects all of the notifications that want mesoscale discussion notifications. Note this does not fill out AlertOptions or SPCOptions in the returned UserNotifications struct
func (*PostgresUserNotificationTable) Update ¶
func (p *PostgresUserNotificationTable) Update(id string, userNotification data_structures.UserNotification) error