Documentation
¶
Index ¶
- type CompletePredictionParams
- type CreateLoginHistoryParams
- type CreateNewPredictionParams
- type CreateRefreshTokenParams
- type CreateUserParams
- type DBTX
- type GetLoginHistoryByUserParams
- type GetPredictionsByUserIDParams
- type LoginHistory
- type Prediction
- type Querier
- type Queries
- func (q *Queries) CompletePrediction(ctx context.Context, arg CompletePredictionParams) error
- func (q *Queries) CreateLoginHistory(ctx context.Context, arg CreateLoginHistoryParams) (uuid.UUID, error)
- func (q *Queries) CreateNewPrediction(ctx context.Context, arg CreateNewPredictionParams) (Prediction, error)
- func (q *Queries) CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) (uuid.UUID, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (uuid.UUID, error)
- func (q *Queries) DeleteUser(ctx context.Context, id uuid.UUID) error
- func (q *Queries) GetActiveTokensByUser(ctx context.Context, userID uuid.UUID) ([]RefreshToken, error)
- func (q *Queries) GetLoginHistoryByUser(ctx context.Context, arg GetLoginHistoryByUserParams) ([]LoginHistory, error)
- func (q *Queries) GetPrediction(ctx context.Context, id uuid.UUID) (Prediction, error)
- func (q *Queries) GetPredictionsByUserID(ctx context.Context, arg GetPredictionsByUserIDParams) ([]Prediction, error)
- func (q *Queries) GetRefreshTokenByHash(ctx context.Context, tokenHash string) (RefreshToken, error)
- func (q *Queries) GetStatsByUserID(ctx context.Context, userID uuid.UUID) (Stat, error)
- func (q *Queries) GetUserByID(ctx context.Context, id uuid.UUID) (User, error)
- func (q *Queries) GetUserByLogin(ctx context.Context, login string) (User, error)
- func (q *Queries) RevokeAllUserTokens(ctx context.Context, userID uuid.UUID) error
- func (q *Queries) RevokeRefreshToken(ctx context.Context, tokenHash string) error
- func (q *Queries) UpdateStats(ctx context.Context, arg UpdateStatsParams) error
- func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error
- func (q *Queries) UpdateUserAvatar(ctx context.Context, arg UpdateUserAvatarParams) error
- func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type RefreshToken
- type Stat
- type UpdateStatsParams
- type UpdateUserAvatarParams
- type UpdateUserParams
- type UpdateUserPasswordParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateUserParams ¶
type LoginHistory ¶
type LoginHistory struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
Success bool `json:"success"`
FailureReason *string `json:"failure_reason"`
IpAddress *netip.Addr `json:"ip_address"`
UserAgent *string `json:"user_agent"`
Location *string `json:"location"`
CreatedAt time.Time `json:"created_at"`
}
type Prediction ¶
type Querier ¶
type Querier interface {
CompletePrediction(ctx context.Context, arg CompletePredictionParams) error
CreateLoginHistory(ctx context.Context, arg CreateLoginHistoryParams) (uuid.UUID, error)
CreateNewPrediction(ctx context.Context, arg CreateNewPredictionParams) (Prediction, error)
CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) (uuid.UUID, error)
CreateUser(ctx context.Context, arg CreateUserParams) (uuid.UUID, error)
DeleteUser(ctx context.Context, id uuid.UUID) error
GetActiveTokensByUser(ctx context.Context, userID uuid.UUID) ([]RefreshToken, error)
GetLoginHistoryByUser(ctx context.Context, arg GetLoginHistoryByUserParams) ([]LoginHistory, error)
GetPrediction(ctx context.Context, id uuid.UUID) (Prediction, error)
GetPredictionsByUserID(ctx context.Context, arg GetPredictionsByUserIDParams) ([]Prediction, error)
GetRefreshTokenByHash(ctx context.Context, tokenHash string) (RefreshToken, error)
GetStatsByUserID(ctx context.Context, userID uuid.UUID) (Stat, error)
GetUserByID(ctx context.Context, id uuid.UUID) (User, error)
GetUserByLogin(ctx context.Context, login string) (User, error)
RevokeAllUserTokens(ctx context.Context, userID uuid.UUID) error
RevokeRefreshToken(ctx context.Context, tokenHash string) error
UpdateStats(ctx context.Context, arg UpdateStatsParams) error
UpdateUser(ctx context.Context, arg UpdateUserParams) error
UpdateUserAvatar(ctx context.Context, arg UpdateUserAvatarParams) error
UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CompletePrediction ¶
func (q *Queries) CompletePrediction(ctx context.Context, arg CompletePredictionParams) error
func (*Queries) CreateLoginHistory ¶
func (*Queries) CreateNewPrediction ¶
func (q *Queries) CreateNewPrediction(ctx context.Context, arg CreateNewPredictionParams) (Prediction, error)
func (*Queries) CreateRefreshToken ¶
func (*Queries) CreateUser ¶
func (*Queries) GetActiveTokensByUser ¶
func (*Queries) GetLoginHistoryByUser ¶
func (q *Queries) GetLoginHistoryByUser(ctx context.Context, arg GetLoginHistoryByUserParams) ([]LoginHistory, error)
func (*Queries) GetPrediction ¶
func (*Queries) GetPredictionsByUserID ¶
func (q *Queries) GetPredictionsByUserID(ctx context.Context, arg GetPredictionsByUserIDParams) ([]Prediction, error)
func (*Queries) GetRefreshTokenByHash ¶
func (*Queries) GetStatsByUserID ¶
func (*Queries) GetUserByID ¶
func (*Queries) GetUserByLogin ¶
func (*Queries) RevokeAllUserTokens ¶
func (*Queries) RevokeRefreshToken ¶
func (*Queries) UpdateStats ¶
func (q *Queries) UpdateStats(ctx context.Context, arg UpdateStatsParams) error
func (*Queries) UpdateUser ¶
func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error
func (*Queries) UpdateUserAvatar ¶
func (q *Queries) UpdateUserAvatar(ctx context.Context, arg UpdateUserAvatarParams) error
func (*Queries) UpdateUserPassword ¶
func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
type RefreshToken ¶
type RefreshToken struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
TokenHash string `json:"token_hash"`
ExpiresAt time.Time `json:"expires_at"`
Revoked bool `json:"revoked"`
RevokedAt pgtype.Timestamptz `json:"revoked_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Stat ¶
type Stat struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
Status string `json:"status"`
Rating int32 `json:"rating"`
FilesScanned int32 `json:"files_scanned"`
TotalWeight float64 `json:"total_weight"`
Achievements []byte `json:"achievements"`
TrashByTypes []byte `json:"trash_by_types"`
LastScannedAt pgtype.Timestamptz `json:"last_scanned_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type UpdateStatsParams ¶
type UpdateStatsParams struct {
Status string `json:"status"`
Rating int32 `json:"rating"`
FilesScanned int32 `json:"files_scanned"`
TotalWeight float64 `json:"total_weight"`
Achievements []byte `json:"achievements"`
TrashByTypes []byte `json:"trash_by_types"`
LastScannedAt pgtype.Timestamptz `json:"last_scanned_at"`
ID uuid.UUID `json:"id"`
}
type UpdateUserAvatarParams ¶
type UpdateUserParams ¶
Click to show internal directories.
Click to hide internal directories.