sql

package
v5.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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 (*PostgresAlertV2Table) Select

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 (*PostgresConvectiveOutlookTableV2) Select

func (*PostgresConvectiveOutlookTableV2) SelectAllLatest

func (*PostgresConvectiveOutlookTableV2) SelectAllLatestByLocation

func (*PostgresConvectiveOutlookTableV2) SelectById

func (*PostgresConvectiveOutlookTableV2) SelectLatest

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 (PostgresDeviceTable) Select

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 (*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

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 (*PostgresMesoscaleDiscussionV2Table) Select

func (*PostgresMesoscaleDiscussionV2Table) SelectById

func (*PostgresMesoscaleDiscussionV2Table) SelectLatest

func (*PostgresMesoscaleDiscussionV2Table) SelectLatestByLocation

func (*PostgresMesoscaleDiscussionV2Table) SelectMDNotInTable

func (p *PostgresMesoscaleDiscussionV2Table) SelectMDNotInTable(year int, mdsToCheck map[int]bool) ([]int, error)

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 (*PostgresUserNotificationTable) Select

func (*PostgresUserNotificationTable) SelectAll

func (*PostgresUserNotificationTable) SelectByCodes

func (*PostgresUserNotificationTable) SelectByUserId

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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