db

package
v0.0.0-...-f4c426e Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 FindUserByIdParams

type FindUserByIdParams struct {
	ID       uuid.UUID
	ClientID pgtype.UUID
}

type InsertTokenParams

type InsertTokenParams struct {
	UserID    uuid.UUID
	Token     string
	ExpiresAt pgtype.Timestamp
}

type InsertUserParams

type InsertUserParams struct {
	Name     string
	Email    string
	Password string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DeletedTokenById

func (q *Queries) DeletedTokenById(ctx context.Context, id uuid.UUID) error

func (*Queries) DeletedTokenByUserId

func (q *Queries) DeletedTokenByUserId(ctx context.Context, userID uuid.UUID) error

func (*Queries) FindTokenByToken

func (q *Queries) FindTokenByToken(ctx context.Context, token string) (UserToken, error)

func (*Queries) FindTokenByUserId

func (q *Queries) FindTokenByUserId(ctx context.Context, userID uuid.UUID) (UserToken, error)

func (*Queries) FindUserByEmail

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

func (*Queries) FindUserById

func (q *Queries) FindUserById(ctx context.Context, arg FindUserByIdParams) (User, error)

func (*Queries) GetTokenIsExpiredByUserId

func (q *Queries) GetTokenIsExpiredByUserId(ctx context.Context, userID uuid.UUID) (UserToken, error)

func (*Queries) InsertToken

func (q *Queries) InsertToken(ctx context.Context, arg InsertTokenParams) (uuid.UUID, error)

func (*Queries) InsertUser

func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) (uuid.UUID, error)

func (*Queries) WithTx

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

type User

type User struct {
	ID        uuid.UUID
	Name      string
	Email     string
	Password  string
	ClientID  pgtype.UUID
	CreatedAt pgtype.Timestamp
	UpdatedAt pgtype.Timestamp
}

type UserToken

type UserToken struct {
	ID        uuid.UUID
	UserID    uuid.UUID
	Token     string
	CreatedAt pgtype.Timestamp
	ExpiresAt pgtype.Timestamp
}

Jump to

Keyboard shortcuts

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