postgres

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package postgres implements the session storage driver for PostgreSQL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queryer

type Queryer interface {
	Begin(ctx context.Context) (pgx.Tx, error)
	Query(ctx context.Context, query string, args ...interface{}) (pgx.Rows, error)
	QueryRow(ctx context.Context, query string, args ...interface{}) pgx.Row
	Exec(ctx context.Context, query string, args ...interface{}) (pgconn.CommandTag, error)
}

Queryer is an interface that wraps the basic Query, QueryRow, and Exec methods.

type SessionStorageDriver

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

SessionStorageDriver represents the session storage implementation for PostgreSQL.

func NewSessionStorageDriver

func NewSessionStorageDriver(conn Queryer) *SessionStorageDriver

NewSessionStorageDriver creates a new SessionStorageDriver

func (*SessionStorageDriver) DestroySession

func (d *SessionStorageDriver) DestroySession(ctx context.Context, sessionID ccc.UUID) error

DestroySession marks the session as expired

func (*SessionStorageDriver) DestroySessionOIDC

func (d *SessionStorageDriver) DestroySessionOIDC(ctx context.Context, oidcSID string) error

DestroySessionOIDC marks the session as expired

func (*SessionStorageDriver) InsertSession

func (d *SessionStorageDriver) InsertSession(ctx context.Context, session *dbtype.InsertSession) (ccc.UUID, error)

InsertSession inserts Session into database

func (*SessionStorageDriver) InsertSessionOIDC

func (d *SessionStorageDriver) InsertSessionOIDC(ctx context.Context, session *dbtype.InsertSessionOIDC) (ccc.UUID, error)

InsertSessionOIDC inserts Session into database

func (*SessionStorageDriver) Session

func (d *SessionStorageDriver) Session(ctx context.Context, sessionID ccc.UUID) (*dbtype.Session, error)

Session returns the session information from the database for given sessionID

func (*SessionStorageDriver) SessionOIDC

func (d *SessionStorageDriver) SessionOIDC(ctx context.Context, sessionID ccc.UUID) (*dbtype.SessionOIDC, error)

SessionOIDC returns the session information from the database for given sessionID

func (*SessionStorageDriver) UpdateSessionActivity

func (d *SessionStorageDriver) UpdateSessionActivity(ctx context.Context, sessionID ccc.UUID) error

UpdateSessionActivity updates the session activity column with the current time

Jump to

Keyboard shortcuts

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