generated

package
v0.0.0-...-0d82576 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddUserParams

type AddUserParams struct {
	Username string
	Password string
}

type CreateSessionParams

type CreateSessionParams struct {
	ID        string
	UserID    pgtype.Int4
	ExpiresAt pgtype.Timestamptz
}

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 GetSessionRow

type GetSessionRow struct {
	ID           string
	UserID       pgtype.Int4
	CreatedAt    pgtype.Timestamptz
	RevokedAt    pgtype.Timestamptz
	ExpiresAt    pgtype.Timestamptz
	LastActiveAt pgtype.Timestamptz
	Username     string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddUser

func (q *Queries) AddUser(ctx context.Context, arg AddUserParams) error

func (*Queries) CreateSession

func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) error

func (*Queries) GetSession

func (q *Queries) GetSession(ctx context.Context, id string) (GetSessionRow, error)

func (*Queries) GetUserByUsername

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

func (*Queries) WithTx

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

type Session

type Session struct {
	ID           string
	UserID       pgtype.Int4
	CreatedAt    pgtype.Timestamptz
	RevokedAt    pgtype.Timestamptz
	ExpiresAt    pgtype.Timestamptz
	LastActiveAt pgtype.Timestamptz
}

type User

type User struct {
	ID       int32
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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