sql

package
v6.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 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 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

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

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 LocationOptionType

type LocationOptionType int8
const (
	LocationOptionType_AlertOption                      LocationOptionType = 0
	LocationOptionType_ConvectiveOutlookOption          LocationOptionType = 1
	LocationOptionType_MesoscaleDiscussionNotifications LocationOptionType = 2
)

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

type PostgresLocationQueries struct {
	// contains filtered or unexported fields
}

func NewLocationQueries

func NewLocationQueries(db *sql.DB) PostgresLocationQueries

func (*PostgresLocationQueries) GetDevicesForAlertID

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

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

func (n *PostgresLocationQueries) GetDevicesForMesoscaleDiscussionID(mesoscaleDiscussionID string) (map[data_structures.Device][]string, error)

GetDevicesForMesoscaleDiscussionID returns a mapping from device to list of LocationNames

type PostgresLocationTable

type PostgresLocationTable struct {
	// contains filtered or unexported fields
}

func NewPostgresLocationTable

func NewPostgresLocationTable(db *sql.DB) PostgresLocationTable

func (*PostgresLocationTable) Delete

func (p *PostgresLocationTable) Delete(locationID string) error

func (*PostgresLocationTable) Insert

func (*PostgresLocationTable) Select

func (p *PostgresLocationTable) Select(locationID string) (*data_structures.Location, error)

func (*PostgresLocationTable) SelectByCodes

func (p *PostgresLocationTable) SelectByCodes(codes []string) ([]data_structures.Location, error)

func (*PostgresLocationTable) SelectByDeviceID

func (p *PostgresLocationTable) SelectByDeviceID(deviceID string) ([]data_structures.Location, error)

func (*PostgresLocationTable) SelectByUserID

func (p *PostgresLocationTable) SelectByUserID(userID string) ([]data_structures.Location, error)

func (*PostgresLocationTable) SelectNotificationsWithConvectiveOutlook

func (p *PostgresLocationTable) SelectNotificationsWithConvectiveOutlook() ([]data_structures.Location, error)

func (*PostgresLocationTable) SelectNotificationsWithMDNotifications

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

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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