queries

package
v0.0.0-...-5591888 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: BSD-3-Clause Imports: 4 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 GetUserByTokenParams

type GetUserByTokenParams struct {
	Token        []byte
	Context      string
	ValidityDays int32
}

type InsertUserParams

type InsertUserParams struct {
	Email        string
	DisplayName  string
	PasswordHash string
}

type InsertUserTokenParams

type InsertUserTokenParams struct {
	UserID  int64
	Token   []byte
	Context string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetUserByEmail

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

func (*Queries) GetUserByToken

func (q *Queries) GetUserByToken(ctx context.Context, arg GetUserByTokenParams) (*User, error)

func (*Queries) InsertUser

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

func (*Queries) InsertUserToken

func (q *Queries) InsertUserToken(ctx context.Context, arg InsertUserTokenParams) (*UserToken, error)

func (*Queries) WithTx

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

type User

type User struct {
	ID           int64
	Email        string
	DisplayName  string
	PasswordHash string
	InsertedAt   pgtype.Timestamp
	UpdatedAt    pgtype.Timestamp
}

type UserToken

type UserToken struct {
	ID         int64
	UserID     int64
	Token      []byte
	Context    string
	InsertedAt pgtype.Timestamp
}

type WebauthnCredential

type WebauthnCredential struct {
	ID                        int64
	WebauthnID                []byte
	UserID                    int64
	PublicKey                 []byte
	AttestationType           *string
	Transport                 []string
	UserPresent               bool
	UserVerified              bool
	BackupEligible            bool
	BackupState               bool
	AuthenticatorAAGUID       []byte
	AuthenticatorSignCount    int32
	AuthenticatorCloneWarning bool
	AuthenticatorAttachment   *string
	InsertedAt                pgtype.Timestamp
	UpdatedAt                 pgtype.Timestamp
}

Jump to

Keyboard shortcuts

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