db

package
v0.0.0-...-c36e226 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2025 License: AGPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserParams

type CreateUserParams struct {
	Username     string
	DisplayName  string
	Email        string
	PasswordHash string
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type IndexUsersParams

type IndexUsersParams struct {
	Limit  int32
	Offset int32
}

type Meow

type Meow struct {
	ID        pgtype.UUID
	UserID    pgtype.UUID
	Content   string
	CreatedAt pgtype.Timestamp
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CreateMeow

func (q *Queries) CreateMeow(ctx context.Context, content string) (Meow, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id pgtype.UUID) error

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) GetUserById

func (q *Queries) GetUserById(ctx context.Context, id pgtype.UUID) (User, error)

func (*Queries) GetUserByResetToken

func (q *Queries) GetUserByResetToken(ctx context.Context, resetPasswordToken pgtype.Text) (User, error)

func (*Queries) GetUserByUsername

func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)

func (*Queries) IndexMeows

func (q *Queries) IndexMeows(ctx context.Context) ([]Meow, error)

func (*Queries) IndexUsers

func (q *Queries) IndexUsers(ctx context.Context, arg IndexUsersParams) ([]User, error)

func (*Queries) ShowMeow

func (q *Queries) ShowMeow(ctx context.Context, id pgtype.UUID) (Meow, error)

func (*Queries) UpdateLastLoginAt

func (q *Queries) UpdateLastLoginAt(ctx context.Context, arg UpdateLastLoginAtParams) (User, error)

func (*Queries) UpdateLoginAttempts

func (q *Queries) UpdateLoginAttempts(ctx context.Context, arg UpdateLoginAttemptsParams) (User, error)

func (*Queries) UpdatePasswordResetToken

func (q *Queries) UpdatePasswordResetToken(ctx context.Context, arg UpdatePasswordResetTokenParams) (User, error)

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)

func (*Queries) VerifyEmail

func (q *Queries) VerifyEmail(ctx context.Context, id pgtype.UUID) (User, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type UpdateLastLoginAtParams

type UpdateLastLoginAtParams struct {
	ID          pgtype.UUID
	LastLoginAt pgtype.Timestamp
}

type UpdateLoginAttemptsParams

type UpdateLoginAttemptsParams struct {
	ID                  pgtype.UUID
	FailedLoginAttempts pgtype.Int4
	AccountLocked       pgtype.Bool
}

type UpdatePasswordResetTokenParams

type UpdatePasswordResetTokenParams struct {
	ID                   pgtype.UUID
	ResetPasswordToken   pgtype.Text
	ResetPasswordExpires pgtype.Timestamp
}

type UpdateUserParams

type UpdateUserParams struct {
	ID            pgtype.UUID
	DisplayName   string
	Email         string
	EmailVerified pgtype.Bool
	PasswordHash  string
	LastLoginAt   pgtype.Timestamp
}

type User

type User struct {
	ID                   pgtype.UUID
	Username             string
	DisplayName          string
	Email                string
	EmailVerified        pgtype.Bool
	PasswordHash         string
	ResetPasswordToken   pgtype.Text
	ResetPasswordExpires pgtype.Timestamp
	CreatedAt            pgtype.Timestamp
	LastLoginAt          pgtype.Timestamp
	AccountLocked        pgtype.Bool
	FailedLoginAttempts  pgtype.Int4
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL