Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store interface {
StartPrediction(ctx context.Context, userID uuid.UUID, scanURL string) (*models.Prediction, error)
CompletePrediction(ctx context.Context, id uuid.UUID, result models.PredictionResult, err error) error
GetPrediction(ctx context.Context, id uuid.UUID) (*models.Prediction, error)
GetPredictionsByUserID(ctx context.Context, userID uuid.UUID, offset, limit int) ([]*models.Prediction, error)
CreateUser(ctx context.Context, user *models.User) error
GetUser(ctx context.Context, id uuid.UUID, withStats bool) (*models.User, error)
GetUserByLogin(ctx context.Context, login string) (*models.User, error)
UpdateUserPass(ctx context.Context, id uuid.UUID, newHashedPass string) error
UpdateAvatar(ctx context.Context, user *models.User) error
DeleteUser(ctx context.Context, id uuid.UUID) error
InsertRefreshToken(ctx context.Context, refreshToken *models.RefreshToken) error
GetRefreshTokenByHash(ctx context.Context, tokenHash string) (*models.RefreshToken, error)
RevokeRefreshToken(ctx context.Context, tokenHash string) error
RevokeAllUserTokens(ctx context.Context, userID uuid.UUID) error
UpdateStats(ctx context.Context, stat *models.Stat) error
InsertLoginHistory(ctx context.Context, loginHistory *models.LoginHistory) error
GetLoginHistory(ctx context.Context, userID uuid.UUID) ([]models.LoginHistory, error)
Close()
Conn() *pgxpool.Pool
WithTx(tx pgx.Tx) Store
BeginTx(ctx context.Context) (pgx.Tx, error)
ExecTx(ctx context.Context, fn func(Store) error) error
}
func NewPgStore ¶
func NewPgStore(q db.Querier, qf QuerierFactory, pool Connection) Store
Click to show internal directories.
Click to hide internal directories.