models

package
v0.0.0-...-6b4d62a Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 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 Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) UserDelete

func (q *Queries) UserDelete(ctx context.Context, id uuid.UUID) (pgconn.CommandTag, error)

func (*Queries) UserInsert

func (q *Queries) UserInsert(ctx context.Context, arg UserInsertParams) (UserInsertRow, error)

func (*Queries) UserRetrieve

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

func (*Queries) UserRetrieveByEmail

func (q *Queries) UserRetrieveByEmail(ctx context.Context, email string) (UserRetrieveByEmailRow, error)

func (*Queries) UserUpdateAdmin

func (q *Queries) UserUpdateAdmin(ctx context.Context, arg UserUpdateAdminParams) (pgconn.CommandTag, error)

func (*Queries) UserUpdatePassword

func (q *Queries) UserUpdatePassword(ctx context.Context, arg UserUpdatePasswordParams) (pgconn.CommandTag, error)

func (*Queries) UsersList

func (q *Queries) UsersList(ctx context.Context, arg UsersListParams) ([]UsersListRow, error)

func (*Queries) WithTx

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

type User

type User struct {
	ID             uuid.UUID
	Created        pgtype.Timestamptz
	Email          string
	Admin          bool
	HashedPassword string
}

type UserInsertParams

type UserInsertParams struct {
	Email          string
	HashedPassword string
	ID             uuid.UUID
	Admin          bool
}

type UserInsertRow

type UserInsertRow struct {
	Email   string
	Created pgtype.Timestamptz
	ID      uuid.UUID
	Admin   bool
}

type UserRetrieveByEmailRow

type UserRetrieveByEmailRow struct {
	Email   string
	Created pgtype.Timestamptz
	ID      uuid.UUID
	Admin   bool
}

type UserRetrieveRow

type UserRetrieveRow struct {
	Email   string
	Created pgtype.Timestamptz
	ID      uuid.UUID
	Admin   bool
}

type UserUpdateAdminParams

type UserUpdateAdminParams struct {
	ID    uuid.UUID
	Admin bool
}

type UserUpdatePasswordParams

type UserUpdatePasswordParams struct {
	ID             uuid.UUID
	HashedPassword string
}

type UsersListParams

type UsersListParams struct {
	Limit  int32
	Offset int32
}

type UsersListRow

type UsersListRow struct {
	Email   string
	Created pgtype.Timestamptz
	ID      uuid.UUID
	Admin   bool
	RowData int64
}

Jump to

Keyboard shortcuts

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