data

package
v0.0.0-...-51342a6 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const CreateVerifyEmail = `` /* 183-byte string literal not displayed */
View Source
const UpdateUser = `` /* 192-byte string literal not displayed */
View Source
const UpdateVerifyEmail = `` /* 237-byte string literal not displayed */

Variables

ProviderSet is data providers.

Functions

func ExecTX

func ExecTX(ctx context.Context, conn *pgx.Conn, fn func(q *Queries) error) error

func NewEmailVerifyRepo

func NewEmailVerifyRepo(data *Data, logger log.Logger) biz.AuthRepo

func NewPgxPool

func NewPgxPool(config *conf.Data_Database) (*pgx.Conn, error)

Types

type CreateVerifyEmailParams

type CreateVerifyEmailParams struct {
	UserID     pgtype.UUID
	Email      string
	SecretCode 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 Data

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

func NewData

func NewData(c *pgx.Conn, logger log.Logger) (*Data, func(), error)

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateVerifyEmail

func (q *Queries) CreateVerifyEmail(ctx context.Context, arg CreateVerifyEmailParams) (VerifyEmail, error)

func (*Queries) UpdateUser

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

func (*Queries) UpdateVerifyEmail

func (q *Queries) UpdateVerifyEmail(ctx context.Context, arg UpdateVerifyEmailParams) (VerifyEmail, error)

func (*Queries) WithTx

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

type UpdateUserParams

type UpdateUserParams struct {
	IsEmailVerified bool
	ID              pgtype.UUID
}

type UpdateVerifyEmailParams

type UpdateVerifyEmailParams struct {
	ID         int64
	SecretCode string
}

type User

type User struct {
	ID                pgtype.UUID
	Username          string
	Email             string
	Password          string
	Description       pgtype.Text
	Avatar            pgtype.Text
	CreatedAt         pgtype.Timestamp
	IsEmailVerified   bool
	PasswordChangedAt pgtype.Timestamptz
}

type VerifyEmail

type VerifyEmail struct {
	ID         int64
	Email      string
	UserID     pgtype.UUID
	SecretCode string
	IsUsed     bool
	CreatedAt  pgtype.Timestamptz
	ExpiredAt  pgtype.Timestamptz
}

Jump to

Keyboard shortcuts

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