Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorCode(err error) string
- type BatchCreateUserRolesBatchResults
- type BatchCreateUserRolesParams
- type BatchDeleteUserRolesBatchResults
- type BatchDeleteUserRolesParams
- type CountObservationsParams
- type CountStationObservationsParams
- type CountStationsWithinBBoxParams
- type CountStationsWithinRadiusParams
- type CreateCurrentObservationParams
- type CreateGLabsLoadParams
- type CreateRoleParams
- type CreateSessionParams
- type CreateSimAccessTokenParams
- type CreateSimCardParams
- type CreateStationHealthParams
- type CreateStationObservationParams
- type CreateStationParams
- type CreateUserParams
- type DBTX
- type DeleteStationHealthParams
- type DeleteStationObservationParams
- type FirstOrCreateSimAccessTokenTxParams
- type FirstOrCreateSimAccessTokenTxResult
- type GetLatestStationObservationRow
- type GetNearestLatestStationObservationParams
- type GetNearestLatestStationObservationRow
- type GetStationHealthParams
- type GetStationObservationParams
- type GlabsLoad
- type ListLatestObservationsRow
- type ListLufftStationMsgParams
- type ListLufftStationMsgRow
- type ListObservationsParams
- type ListRolesParams
- type ListStationHealthsParams
- type ListStationObservationsParams
- type ListStationsParams
- type ListStationsWithinBBoxParams
- type ListStationsWithinRadiusParams
- type ListUsersParams
- type ObservationsCurrent
- type ObservationsMoObservation
- type ObservationsObservation
- type ObservationsStation
- type ObservationsStationhealth
- type Querier
- type Queries
- func (q *Queries) BatchCreateUserRoles(ctx context.Context, arg []BatchCreateUserRolesParams) *BatchCreateUserRolesBatchResults
- func (q *Queries) BatchDeleteUserRoles(ctx context.Context, arg []BatchDeleteUserRolesParams) *BatchDeleteUserRolesBatchResults
- func (q *Queries) CountLufftStationMsg(ctx context.Context, stationID int64) (int64, error)
- func (q *Queries) CountObservations(ctx context.Context, arg CountObservationsParams) (int64, error)
- func (q *Queries) CountRoles(ctx context.Context) (int64, error)
- func (q *Queries) CountStationObservations(ctx context.Context, arg CountStationObservationsParams) (int64, error)
- func (q *Queries) CountStations(ctx context.Context, status pgtype.Text) (int64, error)
- func (q *Queries) CountStationsWithinBBox(ctx context.Context, arg CountStationsWithinBBoxParams) (int64, error)
- func (q *Queries) CountStationsWithinRadius(ctx context.Context, arg CountStationsWithinRadiusParams) (int64, error)
- func (q *Queries) CountUsers(ctx context.Context) (int64, error)
- func (q *Queries) CreateCurrentObservation(ctx context.Context, arg CreateCurrentObservationParams) (ObservationsCurrent, error)
- func (q *Queries) CreateGLabsLoad(ctx context.Context, arg CreateGLabsLoadParams) (GlabsLoad, error)
- func (q *Queries) CreateRole(ctx context.Context, arg CreateRoleParams) (Role, error)
- func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)
- func (q *Queries) CreateSimAccessToken(ctx context.Context, arg CreateSimAccessTokenParams) (SimAccessToken, error)
- func (q *Queries) CreateSimCard(ctx context.Context, arg CreateSimCardParams) (SimCard, error)
- func (q *Queries) CreateStation(ctx context.Context, arg CreateStationParams) (ObservationsStation, error)
- func (q *Queries) CreateStationHealth(ctx context.Context, arg CreateStationHealthParams) (ObservationsStationhealth, error)
- func (q *Queries) CreateStationObservation(ctx context.Context, arg CreateStationObservationParams) (ObservationsObservation, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) DeleteRole(ctx context.Context, id int64) error
- func (q *Queries) DeleteSession(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteSimAccessToken(ctx context.Context, accessToken string) error
- func (q *Queries) DeleteStation(ctx context.Context, id int64) error
- func (q *Queries) DeleteStationHealth(ctx context.Context, arg DeleteStationHealthParams) error
- func (q *Queries) DeleteStationObservation(ctx context.Context, arg DeleteStationObservationParams) error
- func (q *Queries) DeleteUser(ctx context.Context, id int64) error
- func (q *Queries) GetLatestStationObservation(ctx context.Context, id int64) (GetLatestStationObservationRow, error)
- func (q *Queries) GetNearestLatestStationObservation(ctx context.Context, arg GetNearestLatestStationObservationParams) (GetNearestLatestStationObservationRow, error)
- func (q *Queries) GetRole(ctx context.Context, id int64) (Role, error)
- func (q *Queries) GetRoleByName(ctx context.Context, name string) (Role, error)
- func (q *Queries) GetSession(ctx context.Context, id uuid.UUID) (Session, error)
- func (q *Queries) GetSimAccessToken(ctx context.Context, accessToken string) (SimAccessToken, error)
- func (q *Queries) GetSimCard(ctx context.Context, mobileNumber string) (SimCard, error)
- func (q *Queries) GetStation(ctx context.Context, id int64) (ObservationsStation, error)
- func (q *Queries) GetStationByMobileNumber(ctx context.Context, mobileNumber pgtype.Text) (ObservationsStation, error)
- func (q *Queries) GetStationHealth(ctx context.Context, arg GetStationHealthParams) (ObservationsStationhealth, error)
- func (q *Queries) GetStationObservation(ctx context.Context, arg GetStationObservationParams) (ObservationsObservation, error)
- func (q *Queries) GetUser(ctx context.Context, id int64) (User, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)
- func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)
- func (q *Queries) InsertCurrentObservations(ctx context.Context) ([]ObservationsCurrent, error)
- func (q *Queries) ListLatestObservations(ctx context.Context) ([]ListLatestObservationsRow, error)
- func (q *Queries) ListLufftStationMsg(ctx context.Context, arg ListLufftStationMsgParams) ([]ListLufftStationMsgRow, error)
- func (q *Queries) ListObservations(ctx context.Context, arg ListObservationsParams) ([]ObservationsObservation, error)
- func (q *Queries) ListRoles(ctx context.Context, arg ListRolesParams) ([]Role, error)
- func (q *Queries) ListStationHealths(ctx context.Context, arg ListStationHealthsParams) ([]ObservationsStationhealth, error)
- func (q *Queries) ListStationObservations(ctx context.Context, arg ListStationObservationsParams) ([]ObservationsObservation, error)
- func (q *Queries) ListStations(ctx context.Context, arg ListStationsParams) ([]ObservationsStation, error)
- func (q *Queries) ListStationsWithinBBox(ctx context.Context, arg ListStationsWithinBBoxParams) ([]ObservationsStation, error)
- func (q *Queries) ListStationsWithinRadius(ctx context.Context, arg ListStationsWithinRadiusParams) ([]ObservationsStation, error)
- func (q *Queries) ListUserRoles(ctx context.Context, userID int64) ([]string, error)
- func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
- func (q *Queries) UpdateRole(ctx context.Context, arg UpdateRoleParams) (Role, error)
- func (q *Queries) UpdateStation(ctx context.Context, arg UpdateStationParams) (ObservationsStation, error)
- func (q *Queries) UpdateStationHealth(ctx context.Context, arg UpdateStationHealthParams) (ObservationsStationhealth, error)
- func (q *Queries) UpdateStationObservation(ctx context.Context, arg UpdateStationObservationParams) (ObservationsObservation, error)
- func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Role
- type RoleUser
- type SQLStore
- func (s *SQLStore) BulkCreateUserRoles(ctx context.Context, arg []UserRolesParams) (ret []UserRolesParams, errs []error)
- func (s *SQLStore) BulkDeleteUserRoles(ctx context.Context, arg []UserRolesParams) []error
- func (store *SQLStore) FirstOrCreateSimAccessTokenTx(ctx context.Context, arg FirstOrCreateSimAccessTokenTxParams) (FirstOrCreateSimAccessTokenTxResult, error)
- type Session
- type SimAccessToken
- type SimCard
- type Store
- type UpdateRoleParams
- type UpdateStationHealthParams
- type UpdateStationObservationParams
- type UpdateStationParams
- type UpdateUserParams
- type User
- type UserRolesParams
Constants ¶
View Source
const ( ForeignKeyViolation = "23503" UniqueViolation = "23505" )
Variables ¶
View Source
var (
ErrBatchAlreadyClosed = errors.New("batch already closed")
)
View Source
var ErrRecordNotFound = pgx.ErrNoRows
View Source
var ErrUniqueViolation = &pgconn.PgError{ Code: UniqueViolation, }
Functions ¶
Types ¶
type BatchCreateUserRolesBatchResults ¶
type BatchCreateUserRolesBatchResults struct {
// contains filtered or unexported fields
}
func (*BatchCreateUserRolesBatchResults) Close ¶
func (b *BatchCreateUserRolesBatchResults) Close() error
type BatchDeleteUserRolesBatchResults ¶
type BatchDeleteUserRolesBatchResults struct {
// contains filtered or unexported fields
}
func (*BatchDeleteUserRolesBatchResults) Close ¶
func (b *BatchDeleteUserRolesBatchResults) Close() error
func (*BatchDeleteUserRolesBatchResults) Exec ¶
func (b *BatchDeleteUserRolesBatchResults) Exec(f func(int, error))
type CountObservationsParams ¶
type CountObservationsParams struct { StationIds []int64 `json:"station_ids"` IsStartDate bool `json:"is_start_date"` StartDate pgtype.Timestamptz `json:"start_date"` IsEndDate bool `json:"is_end_date"` EndDate pgtype.Timestamptz `json:"end_date"` }
type CountStationObservationsParams ¶
type CountStationObservationsParams struct { StationID int64 `json:"station_id"` IsStartDate bool `json:"is_start_date"` StartDate pgtype.Timestamptz `json:"start_date"` IsEndDate bool `json:"is_end_date"` EndDate pgtype.Timestamptz `json:"end_date"` }
type CreateCurrentObservationParams ¶
type CreateCurrentObservationParams struct { StationID int64 `json:"station_id"` Rain pgtype.Float4 `json:"rain"` Temp pgtype.Float4 `json:"temp"` Rh pgtype.Float4 `json:"rh"` Wdir pgtype.Float4 `json:"wdir"` Wspd pgtype.Float4 `json:"wspd"` Srad pgtype.Float4 `json:"srad"` Mslp pgtype.Float4 `json:"mslp"` Tn pgtype.Float4 `json:"tn"` Tx pgtype.Float4 `json:"tx"` Gust pgtype.Float4 `json:"gust"` RainAccum pgtype.Float4 `json:"rain_accum"` TnTimestamp pgtype.Timestamptz `json:"tn_timestamp"` TxTimestamp pgtype.Timestamptz `json:"tx_timestamp"` GustTimestamp pgtype.Timestamptz `json:"gust_timestamp"` Timestamp pgtype.Timestamptz `json:"timestamp"` }
type CreateGLabsLoadParams ¶
type CreateRoleParams ¶
type CreateSessionParams ¶
type CreateSimCardParams ¶
type CreateStationHealthParams ¶
type CreateStationHealthParams struct { Vb1 pgtype.Float4 `json:"vb1"` Vb2 pgtype.Float4 `json:"vb2"` Curr pgtype.Float4 `json:"curr"` Bp1 pgtype.Float4 `json:"bp1"` Bp2 pgtype.Float4 `json:"bp2"` Cm pgtype.Text `json:"cm"` Ss pgtype.Int4 `json:"ss"` TempArq pgtype.Float4 `json:"temp_arq"` RhArq pgtype.Float4 `json:"rh_arq"` Fpm pgtype.Text `json:"fpm"` ErrorMsg pgtype.Text `json:"error_msg"` Message pgtype.Text `json:"message"` DataCount pgtype.Int4 `json:"data_count"` DataStatus pgtype.Text `json:"data_status"` Timestamp pgtype.Timestamptz `json:"timestamp"` MinutesDifference pgtype.Int4 `json:"minutes_difference"` StationID int64 `json:"station_id"` }
type CreateStationObservationParams ¶
type CreateStationObservationParams struct { Pres pgtype.Float4 `json:"pres"` Rr pgtype.Float4 `json:"rr"` Rh pgtype.Float4 `json:"rh"` Temp pgtype.Float4 `json:"temp"` Td pgtype.Float4 `json:"td"` Wdir pgtype.Float4 `json:"wdir"` Wspd pgtype.Float4 `json:"wspd"` Wspdx pgtype.Float4 `json:"wspdx"` Srad pgtype.Float4 `json:"srad"` Mslp pgtype.Float4 `json:"mslp"` Hi pgtype.Float4 `json:"hi"` Wchill pgtype.Float4 `json:"wchill"` Timestamp pgtype.Timestamptz `json:"timestamp"` QcLevel int32 `json:"qc_level"` StationID int64 `json:"station_id"` }
type CreateStationParams ¶
type CreateStationParams struct { Name string `json:"name"` Elevation pgtype.Float4 `json:"elevation"` DateInstalled pgtype.Date `json:"date_installed"` MoStationID pgtype.Text `json:"mo_station_id"` SmsSystemType pgtype.Text `json:"sms_system_type"` MobileNumber pgtype.Text `json:"mobile_number"` StationType pgtype.Text `json:"station_type"` StationType2 pgtype.Text `json:"station_type2"` StationUrl pgtype.Text `json:"station_url"` Status pgtype.Text `json:"status"` LoggerVersion pgtype.Text `json:"logger_version"` PriorityLevel pgtype.Text `json:"priority_level"` ProviderID pgtype.Text `json:"provider_id"` Province pgtype.Text `json:"province"` Region pgtype.Text `json:"region"` Address pgtype.Text `json:"address"` Lat pgtype.Float4 `json:"lat"` Lon pgtype.Float4 `json:"lon"` }
type CreateUserParams ¶
type FirstOrCreateSimAccessTokenTxResult ¶
type FirstOrCreateSimAccessTokenTxResult struct { AccessToken SimAccessToken IsCreated bool }
type GetLatestStationObservationRow ¶
type GetLatestStationObservationRow struct { ID int64 `json:"id"` Name string `json:"name"` Lat pgtype.Float4 `json:"lat"` Lon pgtype.Float4 `json:"lon"` Elevation pgtype.Float4 `json:"elevation"` Address pgtype.Text `json:"address"` ObservationsCurrent ObservationsCurrent `json:"observations_current"` }
type GetNearestLatestStationObservationRow ¶
type GetNearestLatestStationObservationRow struct { ID int64 `json:"id"` Name string `json:"name"` Lat pgtype.Float4 `json:"lat"` Lon pgtype.Float4 `json:"lon"` Elevation pgtype.Float4 `json:"elevation"` Address pgtype.Text `json:"address"` ObservationsCurrent ObservationsCurrent `json:"observations_current"` }
type GetStationHealthParams ¶
type GlabsLoad ¶
type GlabsLoad struct { ID int64 `json:"id"` Status pgtype.Text `json:"status"` Promo pgtype.Text `json:"promo"` TransactionID pgtype.Int4 `json:"transaction_id"` MobileNumber string `json:"mobile_number"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
type ListLatestObservationsRow ¶
type ListLatestObservationsRow struct { ID int64 `json:"id"` Name string `json:"name"` Lat pgtype.Float4 `json:"lat"` Lon pgtype.Float4 `json:"lon"` Elevation pgtype.Float4 `json:"elevation"` Address pgtype.Text `json:"address"` Rain pgtype.Float4 `json:"rain"` Temp pgtype.Float4 `json:"temp"` Rh pgtype.Float4 `json:"rh"` Wdir pgtype.Float4 `json:"wdir"` Wspd pgtype.Float4 `json:"wspd"` Srad pgtype.Float4 `json:"srad"` Mslp pgtype.Float4 `json:"mslp"` Tn pgtype.Float4 `json:"tn"` Tx pgtype.Float4 `json:"tx"` Gust pgtype.Float4 `json:"gust"` RainAccum pgtype.Float4 `json:"rain_accum"` TnTimestamp pgtype.Timestamptz `json:"tn_timestamp"` TxTimestamp pgtype.Timestamptz `json:"tx_timestamp"` GustTimestamp pgtype.Timestamptz `json:"gust_timestamp"` Timestamp pgtype.Timestamptz `json:"timestamp"` Rn int64 `json:"rn"` }
type ListLufftStationMsgRow ¶
type ListLufftStationMsgRow struct { Timestamp pgtype.Timestamptz `json:"timestamp"` Message pgtype.Text `json:"message"` }
type ListObservationsParams ¶
type ListObservationsParams struct { StationIds []int64 `json:"station_ids"` IsStartDate bool `json:"is_start_date"` StartDate pgtype.Timestamptz `json:"start_date"` IsEndDate bool `json:"is_end_date"` EndDate pgtype.Timestamptz `json:"end_date"` Offset int32 `json:"offset"` Limit pgtype.Int4 `json:"limit"` }
type ListRolesParams ¶
type ListStationObservationsParams ¶
type ListStationObservationsParams struct { StationID int64 `json:"station_id"` IsStartDate bool `json:"is_start_date"` StartDate pgtype.Timestamptz `json:"start_date"` IsEndDate bool `json:"is_end_date"` EndDate pgtype.Timestamptz `json:"end_date"` Offset int32 `json:"offset"` Limit pgtype.Int4 `json:"limit"` }
type ListStationsParams ¶
type ListUsersParams ¶
type ObservationsCurrent ¶
type ObservationsCurrent struct { ID int64 `json:"id"` StationID int64 `json:"station_id"` Rain pgtype.Float4 `json:"rain"` Temp pgtype.Float4 `json:"temp"` Rh pgtype.Float4 `json:"rh"` Wdir pgtype.Float4 `json:"wdir"` Wspd pgtype.Float4 `json:"wspd"` Srad pgtype.Float4 `json:"srad"` Mslp pgtype.Float4 `json:"mslp"` Tn pgtype.Float4 `json:"tn"` Tx pgtype.Float4 `json:"tx"` Gust pgtype.Float4 `json:"gust"` RainAccum pgtype.Float4 `json:"rain_accum"` Timestamp pgtype.Timestamptz `json:"timestamp"` TnTimestamp pgtype.Timestamptz `json:"tn_timestamp"` TxTimestamp pgtype.Timestamptz `json:"tx_timestamp"` GustTimestamp pgtype.Timestamptz `json:"gust_timestamp"` }
type ObservationsMoObservation ¶
type ObservationsMoObservation struct { ID int64 `json:"id"` Pres pgtype.Float4 `json:"pres"` Rr pgtype.Float4 `json:"rr"` Rh pgtype.Float4 `json:"rh"` Temp pgtype.Float4 `json:"temp"` Td pgtype.Float4 `json:"td"` Wdir pgtype.Float4 `json:"wdir"` Wspd pgtype.Float4 `json:"wspd"` Wspdx pgtype.Float4 `json:"wspdx"` Srad pgtype.Float4 `json:"srad"` Hi pgtype.Float4 `json:"hi"` StationID int64 `json:"station_id"` Timestamp pgtype.Timestamptz `json:"timestamp"` Wchill pgtype.Float4 `json:"wchill"` Rain pgtype.Float4 `json:"rain"` Tx pgtype.Float4 `json:"tx"` Tn pgtype.Float4 `json:"tn"` Wrun pgtype.Float4 `json:"wrun"` Thwi pgtype.Float4 `json:"thwi"` Thswi pgtype.Float4 `json:"thswi"` Senergy pgtype.Float4 `json:"senergy"` Sradx pgtype.Float4 `json:"sradx"` Uvi pgtype.Float4 `json:"uvi"` Uvdose pgtype.Float4 `json:"uvdose"` Uvx pgtype.Float4 `json:"uvx"` Hdd pgtype.Float4 `json:"hdd"` Cdd pgtype.Float4 `json:"cdd"` Et pgtype.Float4 `json:"et"` QcLevel int32 `json:"qc_level"` Wdirx pgtype.Float4 `json:"wdirx"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
type ObservationsObservation ¶
type ObservationsObservation struct { ID int64 `json:"id"` Pres pgtype.Float4 `json:"pres"` Rr pgtype.Float4 `json:"rr"` Rh pgtype.Float4 `json:"rh"` Temp pgtype.Float4 `json:"temp"` Td pgtype.Float4 `json:"td"` Wdir pgtype.Float4 `json:"wdir"` Wspd pgtype.Float4 `json:"wspd"` Wspdx pgtype.Float4 `json:"wspdx"` Srad pgtype.Float4 `json:"srad"` Mslp pgtype.Float4 `json:"mslp"` Hi pgtype.Float4 `json:"hi"` StationID int64 `json:"station_id"` Timestamp pgtype.Timestamptz `json:"timestamp"` Wchill pgtype.Float4 `json:"wchill"` QcLevel int32 `json:"qc_level"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
type ObservationsStation ¶
type ObservationsStation struct { ID int64 `json:"id"` Name string `json:"name"` Lat pgtype.Float4 `json:"lat"` Lon pgtype.Float4 `json:"lon"` Elevation pgtype.Float4 `json:"elevation"` DateInstalled pgtype.Date `json:"date_installed"` MoStationID pgtype.Text `json:"mo_station_id"` SmsSystemType pgtype.Text `json:"sms_system_type"` MobileNumber pgtype.Text `json:"mobile_number"` StationType pgtype.Text `json:"station_type"` StationType2 pgtype.Text `json:"station_type2"` StationUrl pgtype.Text `json:"station_url"` Status pgtype.Text `json:"status"` LoggerVersion pgtype.Text `json:"logger_version"` PriorityLevel pgtype.Text `json:"priority_level"` ProviderID pgtype.Text `json:"provider_id"` Province pgtype.Text `json:"province"` Region pgtype.Text `json:"region"` Address pgtype.Text `json:"address"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` DeletedAt pgtype.Timestamptz `json:"deleted_at"` Geom util.Point `json:"geom"` }
type ObservationsStationhealth ¶
type ObservationsStationhealth struct { ID int64 `json:"id"` Vb1 pgtype.Float4 `json:"vb1"` Vb2 pgtype.Float4 `json:"vb2"` Curr pgtype.Float4 `json:"curr"` Bp1 pgtype.Float4 `json:"bp1"` Bp2 pgtype.Float4 `json:"bp2"` Cm pgtype.Text `json:"cm"` Ss pgtype.Int4 `json:"ss"` TempArq pgtype.Float4 `json:"temp_arq"` RhArq pgtype.Float4 `json:"rh_arq"` Fpm pgtype.Text `json:"fpm"` ErrorMsg pgtype.Text `json:"error_msg"` Message pgtype.Text `json:"message"` DataCount pgtype.Int4 `json:"data_count"` DataStatus pgtype.Text `json:"data_status"` Timestamp pgtype.Timestamptz `json:"timestamp"` StationID int64 `json:"station_id"` MinutesDifference pgtype.Int4 `json:"minutes_difference"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
type Querier ¶
type Querier interface { BatchCreateUserRoles(ctx context.Context, arg []BatchCreateUserRolesParams) *BatchCreateUserRolesBatchResults BatchDeleteUserRoles(ctx context.Context, arg []BatchDeleteUserRolesParams) *BatchDeleteUserRolesBatchResults CountLufftStationMsg(ctx context.Context, stationID int64) (int64, error) CountObservations(ctx context.Context, arg CountObservationsParams) (int64, error) CountRoles(ctx context.Context) (int64, error) CountStationObservations(ctx context.Context, arg CountStationObservationsParams) (int64, error) CountStations(ctx context.Context, status pgtype.Text) (int64, error) CountStationsWithinBBox(ctx context.Context, arg CountStationsWithinBBoxParams) (int64, error) CountStationsWithinRadius(ctx context.Context, arg CountStationsWithinRadiusParams) (int64, error) CountUsers(ctx context.Context) (int64, error) CreateCurrentObservation(ctx context.Context, arg CreateCurrentObservationParams) (ObservationsCurrent, error) CreateGLabsLoad(ctx context.Context, arg CreateGLabsLoadParams) (GlabsLoad, error) CreateRole(ctx context.Context, arg CreateRoleParams) (Role, error) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) CreateSimAccessToken(ctx context.Context, arg CreateSimAccessTokenParams) (SimAccessToken, error) CreateSimCard(ctx context.Context, arg CreateSimCardParams) (SimCard, error) CreateStation(ctx context.Context, arg CreateStationParams) (ObservationsStation, error) CreateStationHealth(ctx context.Context, arg CreateStationHealthParams) (ObservationsStationhealth, error) CreateStationObservation(ctx context.Context, arg CreateStationObservationParams) (ObservationsObservation, error) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) DeleteRole(ctx context.Context, id int64) error DeleteSession(ctx context.Context, id uuid.UUID) error DeleteSimAccessToken(ctx context.Context, accessToken string) error DeleteStation(ctx context.Context, id int64) error DeleteStationHealth(ctx context.Context, arg DeleteStationHealthParams) error DeleteStationObservation(ctx context.Context, arg DeleteStationObservationParams) error DeleteUser(ctx context.Context, id int64) error GetLatestStationObservation(ctx context.Context, id int64) (GetLatestStationObservationRow, error) GetNearestLatestStationObservation(ctx context.Context, arg GetNearestLatestStationObservationParams) (GetNearestLatestStationObservationRow, error) GetRole(ctx context.Context, id int64) (Role, error) GetRoleByName(ctx context.Context, name string) (Role, error) GetSession(ctx context.Context, id uuid.UUID) (Session, error) GetSimAccessToken(ctx context.Context, accessToken string) (SimAccessToken, error) GetSimCard(ctx context.Context, mobileNumber string) (SimCard, error) GetStation(ctx context.Context, id int64) (ObservationsStation, error) GetStationByMobileNumber(ctx context.Context, mobileNumber pgtype.Text) (ObservationsStation, error) GetStationHealth(ctx context.Context, arg GetStationHealthParams) (ObservationsStationhealth, error) GetStationObservation(ctx context.Context, arg GetStationObservationParams) (ObservationsObservation, error) GetUser(ctx context.Context, id int64) (User, error) GetUserByEmail(ctx context.Context, email string) (User, error) GetUserByUsername(ctx context.Context, username string) (User, error) InsertCurrentObservations(ctx context.Context) ([]ObservationsCurrent, error) ListLatestObservations(ctx context.Context) ([]ListLatestObservationsRow, error) ListLufftStationMsg(ctx context.Context, arg ListLufftStationMsgParams) ([]ListLufftStationMsgRow, error) ListObservations(ctx context.Context, arg ListObservationsParams) ([]ObservationsObservation, error) ListRoles(ctx context.Context, arg ListRolesParams) ([]Role, error) ListStationHealths(ctx context.Context, arg ListStationHealthsParams) ([]ObservationsStationhealth, error) ListStationObservations(ctx context.Context, arg ListStationObservationsParams) ([]ObservationsObservation, error) ListStations(ctx context.Context, arg ListStationsParams) ([]ObservationsStation, error) ListStationsWithinBBox(ctx context.Context, arg ListStationsWithinBBoxParams) ([]ObservationsStation, error) ListStationsWithinRadius(ctx context.Context, arg ListStationsWithinRadiusParams) ([]ObservationsStation, error) ListUserRoles(ctx context.Context, userID int64) ([]string, error) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error) UpdateRole(ctx context.Context, arg UpdateRoleParams) (Role, error) UpdateStation(ctx context.Context, arg UpdateStationParams) (ObservationsStation, error) UpdateStationHealth(ctx context.Context, arg UpdateStationHealthParams) (ObservationsStationhealth, error) UpdateStationObservation(ctx context.Context, arg UpdateStationObservationParams) (ObservationsObservation, error) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) BatchCreateUserRoles ¶
func (q *Queries) BatchCreateUserRoles(ctx context.Context, arg []BatchCreateUserRolesParams) *BatchCreateUserRolesBatchResults
func (*Queries) BatchDeleteUserRoles ¶
func (q *Queries) BatchDeleteUserRoles(ctx context.Context, arg []BatchDeleteUserRolesParams) *BatchDeleteUserRolesBatchResults
func (*Queries) CountLufftStationMsg ¶
func (*Queries) CountObservations ¶
func (*Queries) CountStationObservations ¶
func (*Queries) CountStations ¶
func (*Queries) CountStationsWithinBBox ¶
func (*Queries) CountStationsWithinRadius ¶
func (*Queries) CreateCurrentObservation ¶
func (q *Queries) CreateCurrentObservation(ctx context.Context, arg CreateCurrentObservationParams) (ObservationsCurrent, error)
func (*Queries) CreateGLabsLoad ¶
func (*Queries) CreateRole ¶
func (*Queries) CreateSession ¶
func (*Queries) CreateSimAccessToken ¶
func (q *Queries) CreateSimAccessToken(ctx context.Context, arg CreateSimAccessTokenParams) (SimAccessToken, error)
func (*Queries) CreateSimCard ¶
func (*Queries) CreateStation ¶
func (q *Queries) CreateStation(ctx context.Context, arg CreateStationParams) (ObservationsStation, error)
func (*Queries) CreateStationHealth ¶
func (q *Queries) CreateStationHealth(ctx context.Context, arg CreateStationHealthParams) (ObservationsStationhealth, error)
func (*Queries) CreateStationObservation ¶
func (q *Queries) CreateStationObservation(ctx context.Context, arg CreateStationObservationParams) (ObservationsObservation, error)
func (*Queries) CreateUser ¶
func (*Queries) DeleteSession ¶
func (*Queries) DeleteSimAccessToken ¶
func (*Queries) DeleteStation ¶
func (*Queries) DeleteStationHealth ¶
func (q *Queries) DeleteStationHealth(ctx context.Context, arg DeleteStationHealthParams) error
func (*Queries) DeleteStationObservation ¶
func (q *Queries) DeleteStationObservation(ctx context.Context, arg DeleteStationObservationParams) error
func (*Queries) GetLatestStationObservation ¶
func (*Queries) GetNearestLatestStationObservation ¶
func (q *Queries) GetNearestLatestStationObservation(ctx context.Context, arg GetNearestLatestStationObservationParams) (GetNearestLatestStationObservationRow, error)
func (*Queries) GetRoleByName ¶
func (*Queries) GetSession ¶
func (*Queries) GetSimAccessToken ¶
func (*Queries) GetSimCard ¶
func (*Queries) GetStation ¶
func (*Queries) GetStationByMobileNumber ¶
func (*Queries) GetStationHealth ¶
func (q *Queries) GetStationHealth(ctx context.Context, arg GetStationHealthParams) (ObservationsStationhealth, error)
func (*Queries) GetStationObservation ¶
func (q *Queries) GetStationObservation(ctx context.Context, arg GetStationObservationParams) (ObservationsObservation, error)
func (*Queries) GetUserByEmail ¶
func (*Queries) GetUserByUsername ¶
func (*Queries) InsertCurrentObservations ¶
func (q *Queries) InsertCurrentObservations(ctx context.Context) ([]ObservationsCurrent, error)
func (*Queries) ListLatestObservations ¶
func (q *Queries) ListLatestObservations(ctx context.Context) ([]ListLatestObservationsRow, error)
func (*Queries) ListLufftStationMsg ¶
func (q *Queries) ListLufftStationMsg(ctx context.Context, arg ListLufftStationMsgParams) ([]ListLufftStationMsgRow, error)
func (*Queries) ListObservations ¶
func (q *Queries) ListObservations(ctx context.Context, arg ListObservationsParams) ([]ObservationsObservation, error)
func (*Queries) ListStationHealths ¶
func (q *Queries) ListStationHealths(ctx context.Context, arg ListStationHealthsParams) ([]ObservationsStationhealth, error)
func (*Queries) ListStationObservations ¶
func (q *Queries) ListStationObservations(ctx context.Context, arg ListStationObservationsParams) ([]ObservationsObservation, error)
func (*Queries) ListStations ¶
func (q *Queries) ListStations(ctx context.Context, arg ListStationsParams) ([]ObservationsStation, error)
func (*Queries) ListStationsWithinBBox ¶
func (q *Queries) ListStationsWithinBBox(ctx context.Context, arg ListStationsWithinBBoxParams) ([]ObservationsStation, error)
func (*Queries) ListStationsWithinRadius ¶
func (q *Queries) ListStationsWithinRadius(ctx context.Context, arg ListStationsWithinRadiusParams) ([]ObservationsStation, error)
func (*Queries) ListUserRoles ¶
func (*Queries) UpdateRole ¶
func (*Queries) UpdateStation ¶
func (q *Queries) UpdateStation(ctx context.Context, arg UpdateStationParams) (ObservationsStation, error)
func (*Queries) UpdateStationHealth ¶
func (q *Queries) UpdateStationHealth(ctx context.Context, arg UpdateStationHealthParams) (ObservationsStationhealth, error)
func (*Queries) UpdateStationObservation ¶
func (q *Queries) UpdateStationObservation(ctx context.Context, arg UpdateStationObservationParams) (ObservationsObservation, error)
func (*Queries) UpdateUser ¶
type Role ¶
type Role struct { ID int64 `json:"id"` Name string `json:"name"` Description pgtype.Text `json:"description"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
type RoleUser ¶
type RoleUser struct { RoleID int64 `json:"role_id"` UserID int64 `json:"user_id"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
type SQLStore ¶
type SQLStore struct { *Queries // contains filtered or unexported fields }
SQLStore provides all functions to execute SQL queries and transactions
func (*SQLStore) BulkCreateUserRoles ¶
func (s *SQLStore) BulkCreateUserRoles(ctx context.Context, arg []UserRolesParams) (ret []UserRolesParams, errs []error)
func (*SQLStore) BulkDeleteUserRoles ¶
func (s *SQLStore) BulkDeleteUserRoles(ctx context.Context, arg []UserRolesParams) []error
func (*SQLStore) FirstOrCreateSimAccessTokenTx ¶
func (store *SQLStore) FirstOrCreateSimAccessTokenTx(ctx context.Context, arg FirstOrCreateSimAccessTokenTxParams) (FirstOrCreateSimAccessTokenTxResult, error)
type Session ¶
type Session struct { ID uuid.UUID `json:"id"` UserID int64 `json:"user_id"` RefreshToken string `json:"refresh_token"` UserAgent string `json:"user_agent"` ClientIp string `json:"client_ip"` IsBlocked bool `json:"is_blocked"` ExpiresAt pgtype.Timestamptz `json:"expires_at"` CreatedAt pgtype.Timestamptz `json:"created_at"` }
type SimAccessToken ¶
type SimAccessToken struct { AccessToken string `json:"access_token"` Type string `json:"type"` MobileNumber string `json:"mobile_number"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
type SimCard ¶
type SimCard struct { MobileNumber string `json:"mobile_number"` Type pgtype.Text `json:"type"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
type Store ¶
type Store interface { Querier FirstOrCreateSimAccessTokenTx(ctx context.Context, arg FirstOrCreateSimAccessTokenTxParams) (FirstOrCreateSimAccessTokenTxResult, error) BulkCreateUserRoles(ctx context.Context, arg []UserRolesParams) (ret []UserRolesParams, errs []error) BulkDeleteUserRoles(ctx context.Context, arg []UserRolesParams) []error }
Store provides all functions to execute db queries and transaction
type UpdateRoleParams ¶
type UpdateStationHealthParams ¶
type UpdateStationHealthParams struct { Vb1 pgtype.Float4 `json:"vb1"` Vb2 pgtype.Float4 `json:"vb2"` Curr pgtype.Float4 `json:"curr"` Bp1 pgtype.Float4 `json:"bp1"` Bp2 pgtype.Float4 `json:"bp2"` Cm pgtype.Text `json:"cm"` Ss pgtype.Int4 `json:"ss"` TempArq pgtype.Float4 `json:"temp_arq"` RhArq pgtype.Float4 `json:"rh_arq"` Fpm pgtype.Text `json:"fpm"` ErrorMsg pgtype.Text `json:"error_msg"` Message pgtype.Text `json:"message"` DataCount pgtype.Int4 `json:"data_count"` DataStatus pgtype.Text `json:"data_status"` Timestamp pgtype.Timestamptz `json:"timestamp"` MinutesDifference pgtype.Int4 `json:"minutes_difference"` StationID int64 `json:"station_id"` ID int64 `json:"id"` }
type UpdateStationObservationParams ¶
type UpdateStationObservationParams struct { Pres pgtype.Float4 `json:"pres"` Rr pgtype.Float4 `json:"rr"` Rh pgtype.Float4 `json:"rh"` Temp pgtype.Float4 `json:"temp"` Td pgtype.Float4 `json:"td"` Wdir pgtype.Float4 `json:"wdir"` Wspd pgtype.Float4 `json:"wspd"` Wspdx pgtype.Float4 `json:"wspdx"` Srad pgtype.Float4 `json:"srad"` Mslp pgtype.Float4 `json:"mslp"` Hi pgtype.Float4 `json:"hi"` Wchill pgtype.Float4 `json:"wchill"` Timestamp pgtype.Timestamptz `json:"timestamp"` QcLevel pgtype.Int4 `json:"qc_level"` StationID int64 `json:"station_id"` ID int64 `json:"id"` }
type UpdateStationParams ¶
type UpdateStationParams struct { Name pgtype.Text `json:"name"` Lat pgtype.Float4 `json:"lat"` Lon pgtype.Float4 `json:"lon"` Elevation pgtype.Float4 `json:"elevation"` DateInstalled pgtype.Date `json:"date_installed"` MoStationID pgtype.Text `json:"mo_station_id"` SmsSystemType pgtype.Text `json:"sms_system_type"` MobileNumber pgtype.Text `json:"mobile_number"` StationType pgtype.Text `json:"station_type"` StationType2 pgtype.Text `json:"station_type2"` StationUrl pgtype.Text `json:"station_url"` Status pgtype.Text `json:"status"` LoggerVersion pgtype.Text `json:"logger_version"` PriorityLevel pgtype.Text `json:"priority_level"` ProviderID pgtype.Text `json:"provider_id"` Province pgtype.Text `json:"province"` Region pgtype.Text `json:"region"` Address pgtype.Text `json:"address"` ID int64 `json:"id"` }
type UpdateUserParams ¶
type User ¶
type User struct { ID int64 `json:"id"` Username string `json:"username"` FullName string `json:"full_name"` Email string `json:"email"` Password string `json:"password"` EmailVerifiedAt pgtype.Timestamptz `json:"email_verified_at"` PasswordChangedAt pgtype.Timestamptz `json:"password_changed_at"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
type UserRolesParams ¶
Source Files ¶
- batch.go
- batch_user_role.go
- db.go
- error.go
- exec_tx.go
- glabs.sql.go
- lufft.sql.go
- models.go
- observation.sql.go
- observations_current.sql.go
- querier.go
- role.sql.go
- role_user.sql.go
- session.sql.go
- sim_access_token.sql.go
- sim_cards.sql.go
- station.sql.go
- station_health.sql.go
- store.go
- tx_sim_access_token.go
- user.sql.go
Click to show internal directories.
Click to hide internal directories.