database

package module
v0.0.0-...-5e3dc0d Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package database persists session families and generations through the production database owner.

Index

Constants

View Source
const (
	// SchemaVersion is the session schema version Ready must observe.
	SchemaVersion uint = 3
	// VersionTable records session migrations apart from the application's schema_migrations, so both sets keep independent version sequences in one database.
	VersionTable = "auth_session_schema_migrations"
)

Variables

This section is empty.

Functions

func Migrations

func Migrations(db *dbkit.DB, driver migration.DriverFunc) migration.Config

Migrations returns production versioned SQL migrations at SchemaVersion, tracked in VersionTable. Composition injects the driver and sets Config.Table.Schema for PostgreSQL.

func NewStore

func NewStore(db *dbkit.DB, clocks ...util.Clock) (session.Store, error)

NewStore borrows the injected production database; the caller owns migrations and pool shutdown.

func RevokeSubjectTx

func RevokeSubjectTx(tx *gorm.DB, kind auth.Kind, subject string) (int64, error)

RevokeSubjectTx revokes every active session family of one subject inside the caller's transaction, so the revocation commits or rolls back with the caller's own writes, such as a password change. It does not end live streams: after the commit the caller calls session.Manager.RevokeSubject or session.Manager.Nudge.

Types

This section is empty.

Jump to

Keyboard shortcuts

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