Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorCode(err error) string
- type APIToken
- type AccessRequest
- type BatchCreateUserRolesBatchResults
- type BatchCreateUserRolesParams
- type BatchDeleteUserRolesBatchResults
- type BatchDeleteUserRolesParams
- type CompleteRegistrationTxParams
- type CompleteUserRegistrationParams
- type ConsumeUserTokenParams
- type CountMOObservationsParams
- type CountObservationsParams
- type CountStationMOObservationsParams
- type CountStationObservationsParams
- type CountStationsWithinBBoxParams
- type CountStationsWithinRadiusParams
- type CreateAPITokenParams
- type CreateAccessRequestParams
- type CreateCurrentObservationParams
- type CreateGLabsLoadParams
- type CreateMisolStationParams
- type CreateMisolStationTxParams
- type CreateMisolStationTxResult
- type CreatePasswordResetTokenTxParams
- type CreateRegistrationTokenTxParams
- type CreateRoleParams
- type CreateSessionParams
- type CreateSimAccessTokenParams
- type CreateSimCardParams
- type CreateStationHealthParams
- type CreateStationMOObservationParams
- type CreateStationObservationParams
- type CreateStationParams
- type CreateUserParams
- type CreateUserTokenParams
- type CreateWeatherlinkStationParams
- type DBTX
- type DeleteStationHealthParams
- type DeleteStationMOObservationParams
- type DeleteStationObservationParams
- type FirstOrCreateSimAccessTokenTxParams
- type FirstOrCreateSimAccessTokenTxResult
- type GetLatestStationObservationRow
- type GetNearestLatestStationObservationParams
- type GetNearestLatestStationObservationRow
- type GetStationHealthParams
- type GetStationMOObservationParams
- type GetStationObservationParams
- type GetStationStatsByIdsParams
- type GetStationStatsByIdsRow
- type GetStationStatsRow
- type GetUserTokenByHashParams
- type GlabsLoad
- type InvalidateUserTokensParams
- type ListAccessRequestsByStatusParams
- type ListAccessRequestsParams
- type ListLatestObservationsRow
- type ListLufftStationMsgParams
- type ListLufftStationMsgRow
- type ListMOObservationsParams
- type ListObservationsParams
- type ListRolesParams
- type ListStationHealthsParams
- type ListStationMOObservationsParams
- type ListStationObservationsParams
- type ListStationsByIdsParams
- type ListStationsParams
- type ListStationsWithinBBoxParams
- type ListStationsWithinRadiusParams
- type ListUserRolesByUserIDsRow
- type ListUsersParams
- type ListWeatherlinkStationsParams
- type MisolStation
- type ObservationsCurrent
- type ObservationsMoObservation
- type ObservationsObservation
- type ObservationsStation
- type ObservationsStationhealth
- type PostgresContainer
- 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) CompleteUserRegistration(ctx context.Context, arg CompleteUserRegistrationParams) (User, error)
- func (q *Queries) ConsumeUserToken(ctx context.Context, arg ConsumeUserTokenParams) (UserToken, error)
- func (q *Queries) CountAPITokensByUser(ctx context.Context, userID int64) (int64, error)
- func (q *Queries) CountAccessRequests(ctx context.Context) (int64, error)
- func (q *Queries) CountAccessRequestsByStatus(ctx context.Context, status string) (int64, error)
- func (q *Queries) CountLufftStationMsg(ctx context.Context, stationID int64) (int64, error)
- func (q *Queries) CountMOObservations(ctx context.Context, arg CountMOObservationsParams) (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) CountStationMOObservations(ctx context.Context, arg CountStationMOObservationsParams) (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) CountStationsByIds(ctx context.Context, stationIds []int64) (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, status pgtype.Text) (int64, error)
- func (q *Queries) CreateAPIToken(ctx context.Context, arg CreateAPITokenParams) (APIToken, error)
- func (q *Queries) CreateAccessRequest(ctx context.Context, arg CreateAccessRequestParams) (AccessRequest, 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) CreateMisolStation(ctx context.Context, arg CreateMisolStationParams) (MisolStation, 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) CreateStationMOObservation(ctx context.Context, arg CreateStationMOObservationParams) (ObservationsMoObservation, 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) CreateUserToken(ctx context.Context, arg CreateUserTokenParams) (UserToken, error)
- func (q *Queries) CreateWeatherlinkStation(ctx context.Context, arg CreateWeatherlinkStationParams) (Weatherlink, error)
- func (q *Queries) DeleteAPIToken(ctx context.Context, id int64) error
- func (q *Queries) DeleteAccessRequest(ctx context.Context, id int64) error
- func (q *Queries) DeleteMisolStation(ctx context.Context, id int64) 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) DeleteSessionsByUserID(ctx context.Context, userID int64) 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) DeleteStationMOObservation(ctx context.Context, arg DeleteStationMOObservationParams) error
- func (q *Queries) DeleteStationObservation(ctx context.Context, arg DeleteStationObservationParams) error
- func (q *Queries) DeleteUser(ctx context.Context, id int64) error
- func (q *Queries) DeleteUserAccess(ctx context.Context, userID int64) error
- func (q *Queries) GetAPIToken(ctx context.Context, id int64) (APIToken, error)
- func (q *Queries) GetAPITokenByHash(ctx context.Context, tokenHash string) (APIToken, error)
- func (q *Queries) GetAccessRequest(ctx context.Context, id int64) (AccessRequest, error)
- func (q *Queries) GetLatestStationObservation(ctx context.Context, id int64) (GetLatestStationObservationRow, error)
- func (q *Queries) GetMisolStation(ctx context.Context, id int64) (MisolStation, 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) GetStationMOObservation(ctx context.Context, arg GetStationMOObservationParams) (ObservationsMoObservation, error)
- func (q *Queries) GetStationObservation(ctx context.Context, arg GetStationObservationParams) (ObservationsObservation, error)
- func (q *Queries) GetStationStats(ctx context.Context, windowSeconds float64) (GetStationStatsRow, error)
- func (q *Queries) GetStationStatsByIds(ctx context.Context, arg GetStationStatsByIdsParams) (GetStationStatsByIdsRow, error)
- func (q *Queries) GetUser(ctx context.Context, id int64) (User, error)
- func (q *Queries) GetUserAccess(ctx context.Context, userID int64) (UserAccess, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, lower string) (User, error)
- func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)
- func (q *Queries) GetUserTokenByHash(ctx context.Context, arg GetUserTokenByHashParams) (UserToken, error)
- func (q *Queries) InsertCurrentMOObservations(ctx context.Context) ([]ObservationsCurrent, error)
- func (q *Queries) InsertCurrentObservations(ctx context.Context) ([]ObservationsCurrent, error)
- func (q *Queries) InvalidateUserTokens(ctx context.Context, arg InvalidateUserTokensParams) error
- func (q *Queries) ListAPITokensByUser(ctx context.Context, userID int64) ([]APIToken, error)
- func (q *Queries) ListAccessRequests(ctx context.Context, arg ListAccessRequestsParams) ([]AccessRequest, error)
- func (q *Queries) ListAccessRequestsByStatus(ctx context.Context, arg ListAccessRequestsByStatusParams) ([]AccessRequest, error)
- func (q *Queries) ListAccessRequestsByUser(ctx context.Context, userID int64) ([]AccessRequest, error)
- func (q *Queries) ListLatestObservations(ctx context.Context, windowSeconds float64) ([]ListLatestObservationsRow, error)
- func (q *Queries) ListLufftStationMsg(ctx context.Context, arg ListLufftStationMsgParams) ([]ListLufftStationMsgRow, error)
- func (q *Queries) ListMOObservations(ctx context.Context, arg ListMOObservationsParams) ([]ObservationsMoObservation, 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) ListStationMOObservations(ctx context.Context, arg ListStationMOObservationsParams) ([]ObservationsMoObservation, 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) ListStationsByIds(ctx context.Context, arg ListStationsByIdsParams) ([]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) ListUserRolesByUserIDs(ctx context.Context, userIds []int64) ([]ListUserRolesByUserIDsRow, error)
- func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
- func (q *Queries) ListWeatherlinkStations(ctx context.Context, arg ListWeatherlinkStationsParams) ([]Weatherlink, error)
- func (q *Queries) MarkStaleStationsOffline(ctx context.Context, staleAfterSeconds float64) (int64, error)
- func (q *Queries) ReviewUser(ctx context.Context, arg ReviewUserParams) (User, error)
- func (q *Queries) SetStationStatus(ctx context.Context, arg SetStationStatusParams) (int64, error)
- func (q *Queries) UpdateAPITokenLastUsedAt(ctx context.Context, id int64) error
- func (q *Queries) UpdateAccessRequestStatus(ctx context.Context, arg UpdateAccessRequestStatusParams) (AccessRequest, 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) UpdateStationMOObservation(ctx context.Context, arg UpdateStationMOObservationParams) (ObservationsMoObservation, 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) UpsertUserAccess(ctx context.Context, arg UpsertUserAccessParams) (UserAccess, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type ResetPasswordTxParams
- type ReviewUserParams
- 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) CompleteRegistrationTx(ctx context.Context, arg CompleteRegistrationTxParams) (User, error)
- func (store *SQLStore) CreateMisolStationTx(ctx context.Context, arg CreateMisolStationTxParams) (CreateMisolStationTxResult, error)
- func (store *SQLStore) CreatePasswordResetTokenTx(ctx context.Context, arg CreatePasswordResetTokenTxParams) (UserToken, error)
- func (store *SQLStore) CreateRegistrationTokenTx(ctx context.Context, arg CreateRegistrationTokenTxParams) (UserToken, error)
- func (store *SQLStore) FirstOrCreateSimAccessTokenTx(ctx context.Context, arg FirstOrCreateSimAccessTokenTxParams) (FirstOrCreateSimAccessTokenTxResult, error)
- func (store *SQLStore) Ping(ctx context.Context) error
- func (store *SQLStore) ResetPasswordTx(ctx context.Context, arg ResetPasswordTxParams) (User, error)
- type Session
- type SetStationStatusParams
- type SimAccessToken
- type SimCard
- type Store
- type UpdateAccessRequestStatusParams
- type UpdateRoleParams
- type UpdateStationHealthParams
- type UpdateStationMOObservationParams
- type UpdateStationObservationParams
- type UpdateStationParams
- type UpdateUserParams
- type UpsertUserAccessParams
- type User
- type UserAccess
- type UserRolesParams
- type UserToken
- type Weatherlink
Constants ¶
const ( ForeignKeyViolation = "23503" UniqueViolation = "23505" )
const ( UserTokenPurposeRegistration = "registration" UserTokenPurposePasswordReset = "password_reset" )
Variables ¶
var (
ErrBatchAlreadyClosed = errors.New("batch already closed")
)
var ErrRecordNotFound = pgx.ErrNoRows
var ErrUniqueViolation = &pgconn.PgError{ Code: UniqueViolation, }
Functions ¶
Types ¶
type APIToken ¶
type APIToken struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
Name string `json:"name"`
TokenHash string `json:"token_hash"`
TokenPrefix string `json:"token_prefix"`
Permissions []byte `json:"permissions"`
LastUsedAt pgtype.Timestamptz `json:"last_used_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type AccessRequest ¶
type AccessRequest struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
StationIds []byte `json:"station_ids"`
AllStations bool `json:"all_stations"`
Variables []byte `json:"variables"`
AllVariables bool `json:"all_variables"`
MaxDaysHistory pgtype.Int4 `json:"max_days_history"`
Reason pgtype.Text `json:"reason"`
Status string `json:"status"`
ReviewedBy pgtype.Int8 `json:"reviewed_by"`
ReviewNote pgtype.Text `json:"review_note"`
ReviewedAt pgtype.Timestamptz `json:"reviewed_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
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 ConsumeUserTokenParams ¶
type CountMOObservationsParams ¶
type CountMOObservationsParams 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 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 CountStationMOObservationsParams ¶
type CountStationMOObservationsParams 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 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 CreateAPITokenParams ¶
type CreateAccessRequestParams ¶
type CreateAccessRequestParams struct {
UserID int64 `json:"user_id"`
StationIds []byte `json:"station_ids"`
AllStations bool `json:"all_stations"`
Variables []byte `json:"variables"`
AllVariables bool `json:"all_variables"`
MaxDaysHistory pgtype.Int4 `json:"max_days_history"`
Reason pgtype.Text `json:"reason"`
}
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 CreateMisolStationTxParams ¶
type CreateMisolStationTxParams struct {
ID int64 `json:"id"`
Name string `json:"name"`
Lat pgtype.Float4 `json:"lat"`
Lon pgtype.Float4 `json:"lon"`
Elevation pgtype.Float4 `json:"elevation"`
Province pgtype.Text `json:"province"`
Region pgtype.Text `json:"region"`
Address pgtype.Text `json:"address"`
}
type CreateMisolStationTxResult ¶
type CreateMisolStationTxResult struct {
ID int64
Info ObservationsStation
}
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 CreateStationMOObservationParams ¶
type CreateStationMOObservationParams 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"`
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 CreateStationObservationParams ¶
type CreateStationObservationParams struct {
Pres pgtype.Float4 `json:"pres"`
Rr pgtype.Float4 `json:"rr"`
RainTips pgtype.Int4 `json:"rain_tips"`
RainCumulativeTips pgtype.Int4 `json:"rain_cumulative_tips"`
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 CreateUserTokenParams ¶
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"`
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 GetStationHealthParams ¶
type GetStationStatsByIdsRow ¶
type GetStationStatsRow ¶
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 ListMOObservationsParams ¶
type ListMOObservationsParams 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 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"`
CursorTs pgtype.Timestamptz `json:"cursor_ts"`
CursorID pgtype.Int8 `json:"cursor_id"`
Offset int32 `json:"offset"`
Limit pgtype.Int4 `json:"limit"`
}
type ListRolesParams ¶
type ListStationMOObservationsParams ¶
type ListStationMOObservationsParams 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"`
CursorTs pgtype.Timestamptz `json:"cursor_ts"`
CursorID pgtype.Int8 `json:"cursor_id"`
Offset int32 `json:"offset"`
Limit pgtype.Int4 `json:"limit"`
}
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"`
CursorTs pgtype.Timestamptz `json:"cursor_ts"`
CursorID pgtype.Int8 `json:"cursor_id"`
Offset int32 `json:"offset"`
Limit pgtype.Int4 `json:"limit"`
}
type ListStationsByIdsParams ¶
type ListStationsParams ¶
type ListUsersParams ¶
type MisolStation ¶
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"`
RainTips pgtype.Int4 `json:"rain_tips"`
RainCumulativeTips pgtype.Int4 `json:"rain_cumulative_tips"`
}
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 types.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 PostgresContainer ¶
type PostgresContainer struct {
Source string
Conn *pgxpool.Pool
// contains filtered or unexported fields
}
func NewDockerPostgres ¶
func NewDockerPostgres(config util.Config) *PostgresContainer
func (*PostgresContainer) Close ¶
func (pg *PostgresContainer) Close()
type Querier ¶
type Querier interface {
BatchCreateUserRoles(ctx context.Context, arg []BatchCreateUserRolesParams) *BatchCreateUserRolesBatchResults
BatchDeleteUserRoles(ctx context.Context, arg []BatchDeleteUserRolesParams) *BatchDeleteUserRolesBatchResults
CompleteUserRegistration(ctx context.Context, arg CompleteUserRegistrationParams) (User, error)
ConsumeUserToken(ctx context.Context, arg ConsumeUserTokenParams) (UserToken, error)
CountAPITokensByUser(ctx context.Context, userID int64) (int64, error)
CountAccessRequests(ctx context.Context) (int64, error)
CountAccessRequestsByStatus(ctx context.Context, status string) (int64, error)
CountLufftStationMsg(ctx context.Context, stationID int64) (int64, error)
CountMOObservations(ctx context.Context, arg CountMOObservationsParams) (int64, error)
CountObservations(ctx context.Context, arg CountObservationsParams) (int64, error)
CountRoles(ctx context.Context) (int64, error)
CountStationMOObservations(ctx context.Context, arg CountStationMOObservationsParams) (int64, error)
CountStationObservations(ctx context.Context, arg CountStationObservationsParams) (int64, error)
CountStations(ctx context.Context, status pgtype.Text) (int64, error)
CountStationsByIds(ctx context.Context, stationIds []int64) (int64, error)
CountStationsWithinBBox(ctx context.Context, arg CountStationsWithinBBoxParams) (int64, error)
CountStationsWithinRadius(ctx context.Context, arg CountStationsWithinRadiusParams) (int64, error)
CountUsers(ctx context.Context, status pgtype.Text) (int64, error)
CreateAPIToken(ctx context.Context, arg CreateAPITokenParams) (APIToken, error)
CreateAccessRequest(ctx context.Context, arg CreateAccessRequestParams) (AccessRequest, error)
CreateCurrentObservation(ctx context.Context, arg CreateCurrentObservationParams) (ObservationsCurrent, error)
CreateGLabsLoad(ctx context.Context, arg CreateGLabsLoadParams) (GlabsLoad, error)
CreateMisolStation(ctx context.Context, arg CreateMisolStationParams) (MisolStation, 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)
CreateStationMOObservation(ctx context.Context, arg CreateStationMOObservationParams) (ObservationsMoObservation, error)
CreateStationObservation(ctx context.Context, arg CreateStationObservationParams) (ObservationsObservation, error)
CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
CreateUserToken(ctx context.Context, arg CreateUserTokenParams) (UserToken, error)
CreateWeatherlinkStation(ctx context.Context, arg CreateWeatherlinkStationParams) (Weatherlink, error)
DeleteAPIToken(ctx context.Context, id int64) error
DeleteAccessRequest(ctx context.Context, id int64) error
DeleteMisolStation(ctx context.Context, id int64) error
DeleteRole(ctx context.Context, id int64) error
DeleteSession(ctx context.Context, id uuid.UUID) error
DeleteSessionsByUserID(ctx context.Context, userID int64) error
DeleteSimAccessToken(ctx context.Context, accessToken string) error
DeleteStation(ctx context.Context, id int64) error
DeleteStationHealth(ctx context.Context, arg DeleteStationHealthParams) error
DeleteStationMOObservation(ctx context.Context, arg DeleteStationMOObservationParams) error
DeleteStationObservation(ctx context.Context, arg DeleteStationObservationParams) error
DeleteUser(ctx context.Context, id int64) error
DeleteUserAccess(ctx context.Context, userID int64) error
GetAPIToken(ctx context.Context, id int64) (APIToken, error)
GetAPITokenByHash(ctx context.Context, tokenHash string) (APIToken, error)
GetAccessRequest(ctx context.Context, id int64) (AccessRequest, error)
GetLatestStationObservation(ctx context.Context, id int64) (GetLatestStationObservationRow, error)
GetMisolStation(ctx context.Context, id int64) (MisolStation, 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)
GetStationMOObservation(ctx context.Context, arg GetStationMOObservationParams) (ObservationsMoObservation, error)
GetStationObservation(ctx context.Context, arg GetStationObservationParams) (ObservationsObservation, error)
GetStationStats(ctx context.Context, windowSeconds float64) (GetStationStatsRow, error)
GetStationStatsByIds(ctx context.Context, arg GetStationStatsByIdsParams) (GetStationStatsByIdsRow, error)
GetUser(ctx context.Context, id int64) (User, error)
GetUserAccess(ctx context.Context, userID int64) (UserAccess, error)
GetUserByEmail(ctx context.Context, lower string) (User, error)
GetUserByUsername(ctx context.Context, username string) (User, error)
GetUserTokenByHash(ctx context.Context, arg GetUserTokenByHashParams) (UserToken, error)
InsertCurrentMOObservations(ctx context.Context) ([]ObservationsCurrent, error)
InsertCurrentObservations(ctx context.Context) ([]ObservationsCurrent, error)
InvalidateUserTokens(ctx context.Context, arg InvalidateUserTokensParams) error
ListAPITokensByUser(ctx context.Context, userID int64) ([]APIToken, error)
ListAccessRequests(ctx context.Context, arg ListAccessRequestsParams) ([]AccessRequest, error)
ListAccessRequestsByStatus(ctx context.Context, arg ListAccessRequestsByStatusParams) ([]AccessRequest, error)
ListAccessRequestsByUser(ctx context.Context, userID int64) ([]AccessRequest, error)
ListLatestObservations(ctx context.Context, windowSeconds float64) ([]ListLatestObservationsRow, error)
ListLufftStationMsg(ctx context.Context, arg ListLufftStationMsgParams) ([]ListLufftStationMsgRow, error)
ListMOObservations(ctx context.Context, arg ListMOObservationsParams) ([]ObservationsMoObservation, 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)
ListStationMOObservations(ctx context.Context, arg ListStationMOObservationsParams) ([]ObservationsMoObservation, error)
ListStationObservations(ctx context.Context, arg ListStationObservationsParams) ([]ObservationsObservation, error)
ListStations(ctx context.Context, arg ListStationsParams) ([]ObservationsStation, error)
ListStationsByIds(ctx context.Context, arg ListStationsByIdsParams) ([]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)
ListUserRolesByUserIDs(ctx context.Context, userIds []int64) ([]ListUserRolesByUserIDsRow, error)
ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
ListWeatherlinkStations(ctx context.Context, arg ListWeatherlinkStationsParams) ([]Weatherlink, error)
MarkStaleStationsOffline(ctx context.Context, staleAfterSeconds float64) (int64, error)
ReviewUser(ctx context.Context, arg ReviewUserParams) (User, error)
SetStationStatus(ctx context.Context, arg SetStationStatusParams) (int64, error)
UpdateAPITokenLastUsedAt(ctx context.Context, id int64) error
UpdateAccessRequestStatus(ctx context.Context, arg UpdateAccessRequestStatusParams) (AccessRequest, 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)
UpdateStationMOObservation(ctx context.Context, arg UpdateStationMOObservationParams) (ObservationsMoObservation, error)
UpdateStationObservation(ctx context.Context, arg UpdateStationObservationParams) (ObservationsObservation, error)
UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)
UpsertUserAccess(ctx context.Context, arg UpsertUserAccessParams) (UserAccess, 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) CompleteUserRegistration ¶
func (*Queries) ConsumeUserToken ¶
func (*Queries) CountAPITokensByUser ¶
func (*Queries) CountAccessRequests ¶
func (*Queries) CountAccessRequestsByStatus ¶
func (*Queries) CountLufftStationMsg ¶
func (*Queries) CountMOObservations ¶
func (*Queries) CountObservations ¶
func (*Queries) CountStationMOObservations ¶
func (*Queries) CountStationObservations ¶
func (*Queries) CountStations ¶
func (*Queries) CountStationsByIds ¶
func (*Queries) CountStationsWithinBBox ¶
func (*Queries) CountStationsWithinRadius ¶
func (*Queries) CountUsers ¶
func (*Queries) CreateAPIToken ¶
func (*Queries) CreateAccessRequest ¶
func (q *Queries) CreateAccessRequest(ctx context.Context, arg CreateAccessRequestParams) (AccessRequest, error)
func (*Queries) CreateCurrentObservation ¶
func (q *Queries) CreateCurrentObservation(ctx context.Context, arg CreateCurrentObservationParams) (ObservationsCurrent, error)
func (*Queries) CreateGLabsLoad ¶
func (*Queries) CreateMisolStation ¶
func (q *Queries) CreateMisolStation(ctx context.Context, arg CreateMisolStationParams) (MisolStation, error)
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) CreateStationMOObservation ¶
func (q *Queries) CreateStationMOObservation(ctx context.Context, arg CreateStationMOObservationParams) (ObservationsMoObservation, error)
func (*Queries) CreateStationObservation ¶
func (q *Queries) CreateStationObservation(ctx context.Context, arg CreateStationObservationParams) (ObservationsObservation, error)
func (*Queries) CreateUser ¶
func (*Queries) CreateUserToken ¶
func (*Queries) CreateWeatherlinkStation ¶
func (q *Queries) CreateWeatherlinkStation(ctx context.Context, arg CreateWeatherlinkStationParams) (Weatherlink, error)
func (*Queries) DeleteAPIToken ¶
func (*Queries) DeleteAccessRequest ¶
func (*Queries) DeleteMisolStation ¶
func (*Queries) DeleteSession ¶
func (*Queries) DeleteSessionsByUserID ¶
func (*Queries) DeleteSimAccessToken ¶
func (*Queries) DeleteStation ¶
func (*Queries) DeleteStationHealth ¶
func (q *Queries) DeleteStationHealth(ctx context.Context, arg DeleteStationHealthParams) error
func (*Queries) DeleteStationMOObservation ¶
func (q *Queries) DeleteStationMOObservation(ctx context.Context, arg DeleteStationMOObservationParams) error
func (*Queries) DeleteStationObservation ¶
func (q *Queries) DeleteStationObservation(ctx context.Context, arg DeleteStationObservationParams) error
func (*Queries) DeleteUserAccess ¶
func (*Queries) GetAPIToken ¶
func (*Queries) GetAPITokenByHash ¶
func (*Queries) GetAccessRequest ¶
func (*Queries) GetLatestStationObservation ¶
func (*Queries) GetMisolStation ¶
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) GetStationMOObservation ¶
func (q *Queries) GetStationMOObservation(ctx context.Context, arg GetStationMOObservationParams) (ObservationsMoObservation, error)
func (*Queries) GetStationObservation ¶
func (q *Queries) GetStationObservation(ctx context.Context, arg GetStationObservationParams) (ObservationsObservation, error)
func (*Queries) GetStationStats ¶
func (*Queries) GetStationStatsByIds ¶
func (q *Queries) GetStationStatsByIds(ctx context.Context, arg GetStationStatsByIdsParams) (GetStationStatsByIdsRow, error)
func (*Queries) GetUserAccess ¶
func (*Queries) GetUserByEmail ¶
func (*Queries) GetUserByUsername ¶
func (*Queries) GetUserTokenByHash ¶
func (*Queries) InsertCurrentMOObservations ¶
func (q *Queries) InsertCurrentMOObservations(ctx context.Context) ([]ObservationsCurrent, error)
func (*Queries) InsertCurrentObservations ¶
func (q *Queries) InsertCurrentObservations(ctx context.Context) ([]ObservationsCurrent, error)
func (*Queries) InvalidateUserTokens ¶
func (q *Queries) InvalidateUserTokens(ctx context.Context, arg InvalidateUserTokensParams) error
func (*Queries) ListAPITokensByUser ¶
func (*Queries) ListAccessRequests ¶
func (q *Queries) ListAccessRequests(ctx context.Context, arg ListAccessRequestsParams) ([]AccessRequest, error)
func (*Queries) ListAccessRequestsByStatus ¶
func (q *Queries) ListAccessRequestsByStatus(ctx context.Context, arg ListAccessRequestsByStatusParams) ([]AccessRequest, error)
func (*Queries) ListAccessRequestsByUser ¶
func (*Queries) ListLatestObservations ¶
func (*Queries) ListLufftStationMsg ¶
func (q *Queries) ListLufftStationMsg(ctx context.Context, arg ListLufftStationMsgParams) ([]ListLufftStationMsgRow, error)
func (*Queries) ListMOObservations ¶
func (q *Queries) ListMOObservations(ctx context.Context, arg ListMOObservationsParams) ([]ObservationsMoObservation, 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) ListStationMOObservations ¶
func (q *Queries) ListStationMOObservations(ctx context.Context, arg ListStationMOObservationsParams) ([]ObservationsMoObservation, 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) ListStationsByIds ¶
func (q *Queries) ListStationsByIds(ctx context.Context, arg ListStationsByIdsParams) ([]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) ListUserRolesByUserIDs ¶
func (*Queries) ListWeatherlinkStations ¶
func (q *Queries) ListWeatherlinkStations(ctx context.Context, arg ListWeatherlinkStationsParams) ([]Weatherlink, error)
func (*Queries) MarkStaleStationsOffline ¶
func (*Queries) ReviewUser ¶
func (*Queries) SetStationStatus ¶
func (*Queries) UpdateAPITokenLastUsedAt ¶
func (*Queries) UpdateAccessRequestStatus ¶
func (q *Queries) UpdateAccessRequestStatus(ctx context.Context, arg UpdateAccessRequestStatusParams) (AccessRequest, error)
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) UpdateStationMOObservation ¶
func (q *Queries) UpdateStationMOObservation(ctx context.Context, arg UpdateStationMOObservationParams) (ObservationsMoObservation, error)
func (*Queries) UpdateStationObservation ¶
func (q *Queries) UpdateStationObservation(ctx context.Context, arg UpdateStationObservationParams) (ObservationsObservation, error)
func (*Queries) UpdateUser ¶
func (*Queries) UpsertUserAccess ¶
func (q *Queries) UpsertUserAccess(ctx context.Context, arg UpsertUserAccessParams) (UserAccess, error)
type ResetPasswordTxParams ¶
type ReviewUserParams ¶
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) CompleteRegistrationTx ¶
func (store *SQLStore) CompleteRegistrationTx(ctx context.Context, arg CompleteRegistrationTxParams) (User, error)
CompleteRegistrationTx consumes a registration token and activates the invited user in one transaction. If the user was already activated (or the email conflicts), the whole transaction rolls back and the token stays usable.
func (*SQLStore) CreateMisolStationTx ¶
func (store *SQLStore) CreateMisolStationTx(ctx context.Context, arg CreateMisolStationTxParams) (CreateMisolStationTxResult, error)
func (*SQLStore) CreatePasswordResetTokenTx ¶
func (store *SQLStore) CreatePasswordResetTokenTx(ctx context.Context, arg CreatePasswordResetTokenTxParams) (UserToken, error)
CreatePasswordResetTokenTx invalidates any unused reset tokens for the user and creates a new one atomically.
func (*SQLStore) CreateRegistrationTokenTx ¶
func (store *SQLStore) CreateRegistrationTokenTx(ctx context.Context, arg CreateRegistrationTokenTxParams) (UserToken, error)
CreateRegistrationTokenTx invalidates any unused registration tokens for the user and creates a new one atomically.
func (*SQLStore) FirstOrCreateSimAccessTokenTx ¶
func (store *SQLStore) FirstOrCreateSimAccessTokenTx(ctx context.Context, arg FirstOrCreateSimAccessTokenTxParams) (FirstOrCreateSimAccessTokenTxResult, error)
func (*SQLStore) ResetPasswordTx ¶
func (store *SQLStore) ResetPasswordTx(ctx context.Context, arg ResetPasswordTxParams) (User, error)
ResetPasswordTx consumes a reset token, changes the password and revokes all existing sessions atomically.
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 SetStationStatusParams ¶
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
Ping(ctx context.Context) error
BulkCreateUserRoles(ctx context.Context, arg []UserRolesParams) (ret []UserRolesParams, errs []error)
BulkDeleteUserRoles(ctx context.Context, arg []UserRolesParams) []error
CreateMisolStationTx(ctx context.Context, arg CreateMisolStationTxParams) (CreateMisolStationTxResult, error)
FirstOrCreateSimAccessTokenTx(ctx context.Context, arg FirstOrCreateSimAccessTokenTxParams) (FirstOrCreateSimAccessTokenTxResult, error)
CreateRegistrationTokenTx(ctx context.Context, arg CreateRegistrationTokenTxParams) (UserToken, error)
CompleteRegistrationTx(ctx context.Context, arg CompleteRegistrationTxParams) (User, error)
CreatePasswordResetTokenTx(ctx context.Context, arg CreatePasswordResetTokenTxParams) (UserToken, error)
ResetPasswordTx(ctx context.Context, arg ResetPasswordTxParams) (User, 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 UpdateStationMOObservationParams ¶
type UpdateStationMOObservationParams 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"`
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 UpdateStationObservationParams ¶
type UpdateStationObservationParams struct {
Pres pgtype.Float4 `json:"pres"`
Rr pgtype.Float4 `json:"rr"`
RainTips pgtype.Int4 `json:"rain_tips"`
RainCumulativeTips pgtype.Int4 `json:"rain_cumulative_tips"`
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 UpdateUserParams struct {
Username pgtype.Text `json:"username"`
Password pgtype.Text `json:"password"`
PasswordChangedAt pgtype.Timestamptz `json:"password_changed_at"`
FullName pgtype.Text `json:"full_name"`
SetEmail bool `json:"set_email"`
Email pgtype.Text `json:"email"`
ID int64 `json:"id"`
}
type UpsertUserAccessParams ¶
type User ¶
type User struct {
ID int64 `json:"id"`
Username string `json:"username"`
FullName string `json:"full_name"`
Email pgtype.Text `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"`
Status string `json:"status"`
ReviewedBy pgtype.Int8 `json:"reviewed_by"`
ReviewedAt pgtype.Timestamptz `json:"reviewed_at"`
ReviewNote pgtype.Text `json:"review_note"`
}
type UserAccess ¶
type UserAccess struct {
UserID int64 `json:"user_id"`
StationIds []byte `json:"station_ids"`
Variables []byte `json:"variables"`
MaxDaysHistory int32 `json:"max_days_history"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type UserRolesParams ¶
type UserToken ¶
type UserToken struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
Purpose string `json:"purpose"`
TokenHash string `json:"token_hash"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
UsedAt pgtype.Timestamptz `json:"used_at"`
CreatedBy pgtype.Int8 `json:"created_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type Weatherlink ¶
type Weatherlink struct {
ID int64 `json:"id"`
StationID int64 `json:"station_id"`
Uuid pgtype.Text `json:"uuid"`
APIKey pgtype.Text `json:"api_key"`
APISecret pgtype.Text `json:"api_secret"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
}
Source Files
¶
- access_request.sql.go
- api_token.sql.go
- batch.go
- batch_user_role.go
- db.go
- error.go
- exec_tx.go
- glabs.sql.go
- lufft.sql.go
- misol.sql.go
- mo_observation.sql.go
- models.go
- observation.sql.go
- observations_current.sql.go
- pg_testcontainer.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_misol.go
- tx_sim_access_token.go
- tx_user.go
- user.sql.go
- user_access.sql.go
- user_token.sql.go
- weatherlink.sql.go