sessionsql

package
v0.0.0-...-10dfb09 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 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 CreateParams

type CreateParams struct {
	UserID  uuid.UUID
	Expires 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 Querier

type Querier interface {
	Create(ctx context.Context, arg CreateParams) (*Session, error)
	Delete(ctx context.Context, id uuid.UUID) error
	Get(ctx context.Context, id uuid.UUID) (*Session, error)
	SetExpires(ctx context.Context, arg SetExpiresParams) (*Session, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) Create

func (q *Queries) Create(ctx context.Context, arg CreateParams) (*Session, error)

func (*Queries) Delete

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

func (*Queries) Get

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

func (*Queries) SetExpires

func (q *Queries) SetExpires(ctx context.Context, arg SetExpiresParams) (*Session, error)

func (*Queries) WithTx

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

type Session

type Session struct {
	ID      uuid.UUID
	UserID  uuid.UUID
	Expires pgtype.Timestamptz
}

type SetExpiresParams

type SetExpiresParams struct {
	Expires pgtype.Timestamptz
	ID      uuid.UUID
}

Jump to

Keyboard shortcuts

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