Documentation ¶
Index ¶
- type CreateSessionParams
- type CreateUserParams
- type DBTX
- type GetUserByEmailRow
- type GetUserByIdRow
- type ListSessionsParams
- type Querier
- type Queries
- func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) DeleteSession(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteUser(ctx context.Context, id uuid.UUID) error
- func (q *Queries) GetSession(ctx context.Context, id uuid.UUID) (Session, error)
- func (q *Queries) GetSessionByUserID(ctx context.Context, userID uuid.UUID) (Session, error)
- func (q *Queries) GetSessionCount(ctx context.Context, userID uuid.UUID) (int64, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error)
- func (q *Queries) GetUserById(ctx context.Context, id uuid.UUID) (GetUserByIdRow, error)
- func (q *Queries) ListSessions(ctx context.Context, arg ListSessionsParams) ([]Session, error)
- func (q *Queries) RevokeSession(ctx context.Context, id uuid.UUID) error
- func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)
- func (q *Queries) UserExists(ctx context.Context, id uuid.UUID) (bool, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Session
- type UpdateUserParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateSessionParams ¶
type CreateUserParams ¶
type GetUserByEmailRow ¶
type GetUserByEmailRow struct { ID uuid.UUID `json:"id"` Email string `json:"email"` Username string `json:"username"` PasswordHash string `json:"password_hash"` PasswordChangedAt time.Time `json:"password_changed_at"` Role string `json:"role"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type GetUserByIdRow ¶
type GetUserByIdRow struct { ID uuid.UUID `json:"id"` Email string `json:"email"` Username string `json:"username"` PasswordHash string `json:"password_hash"` PasswordChangedAt time.Time `json:"password_changed_at"` Role string `json:"role"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type ListSessionsParams ¶
type Querier ¶
type Querier interface { CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) DeleteSession(ctx context.Context, id uuid.UUID) error DeleteUser(ctx context.Context, id uuid.UUID) error GetSession(ctx context.Context, id uuid.UUID) (Session, error) GetSessionByUserID(ctx context.Context, userID uuid.UUID) (Session, error) GetSessionCount(ctx context.Context, userID uuid.UUID) (int64, error) GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error) GetUserById(ctx context.Context, id uuid.UUID) (GetUserByIdRow, error) ListSessions(ctx context.Context, arg ListSessionsParams) ([]Session, error) RevokeSession(ctx context.Context, id uuid.UUID) error UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error) UserExists(ctx context.Context, id uuid.UUID) (bool, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateSession ¶
func (*Queries) CreateUser ¶
func (*Queries) DeleteSession ¶
func (*Queries) GetSession ¶
func (*Queries) GetSessionByUserID ¶
func (*Queries) GetSessionCount ¶
func (*Queries) GetUserByEmail ¶
func (*Queries) GetUserById ¶
func (*Queries) ListSessions ¶
func (*Queries) RevokeSession ¶
func (*Queries) UpdateUser ¶
func (*Queries) UserExists ¶
type Session ¶
type Session struct { ID uuid.UUID `json:"id"` UserID uuid.UUID `json:"user_id"` RefreshToken string `json:"refresh_token"` UserAgent string `json:"user_agent"` ClientIp string `json:"client_ip"` IsBlocked bool `json:"is_blocked"` ExpiresAt time.Time `json:"expires_at"` CreatedAt time.Time `json:"created_at"` }
type UpdateUserParams ¶
type User ¶
type User struct { ID uuid.UUID `json:"id"` Username string `json:"username"` Email string `json:"email"` PasswordHash string `json:"password_hash"` Role string `json:"role"` CreatedAt time.Time `json:"created_at"` PasswordChangedAt time.Time `json:"password_changed_at"` UpdatedAt time.Time `json:"updated_at"` }
Click to show internal directories.
Click to hide internal directories.