Documentation ¶
Overview ¶
package postgresql implements the database layer for postgresql
Index ¶
- type Connection
- func (d *Connection) DestroySession(ctx context.Context, sessionID ccc.UUID) error
- func (d *Connection) DestroySessionOIDC(ctx context.Context, oidcSID string) error
- func (d *Connection) InsertSession(ctx context.Context, session *InsertSession) (ccc.UUID, error)
- func (d *Connection) Session(ctx context.Context, sessionID ccc.UUID) (*Session, error)
- func (d *Connection) UpdateSessionActivity(ctx context.Context, sessionID ccc.UUID) error
- type DB
- type InsertSession
- type Queryer
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewDBConnection ¶
func NewDBConnection(conn Queryer) *Connection
func (*Connection) DestroySession ¶
func (*Connection) DestroySessionOIDC ¶
func (d *Connection) DestroySessionOIDC(ctx context.Context, oidcSID string) error
DestroySessionOIDC marks the session as expired
func (*Connection) InsertSession ¶
func (d *Connection) InsertSession(ctx context.Context, session *InsertSession) (ccc.UUID, error)
InsertSession inserts Session into database
func (*Connection) Session ¶
Session returns the session information from the database for given sessionID
func (*Connection) UpdateSessionActivity ¶
UpdateSessionActivity updates the session activity column with the current time
type DB ¶
type DB interface { // Session returns the session information from the database for given sessionID. Session(ctx context.Context, sessionID ccc.UUID) (*Session, error) // InsertSession inserts Session into database. InsertSession(ctx context.Context, sessionInfo *InsertSession) (ccc.UUID, error) // UpdateSessionActivity updates the session activity column with the current time. UpdateSessionActivity(ctx context.Context, sessionID ccc.UUID) error // DestroySession marks the session as expired. DestroySession(ctx context.Context, sessionID ccc.UUID) error // DestroySessionOIDC marks the session as expired DestroySessionOIDC(ctx context.Context, oidcSID string) error }
type InsertSession ¶
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) }
Click to show internal directories.
Click to hide internal directories.