Documentation
¶
Index ¶
- type Postgres
- func (pg *Postgres[T]) DeleteSession(sessionID string) error
- func (pg *Postgres[T]) DeleteUser(user *models.User) error
- func (pg *Postgres[T]) FindByPK(val any) (T, error)
- func (pg *Postgres[T]) GetAllUsers() ([]T, error)
- func (pg *Postgres[T]) GetSession(sessionID string) (behemoth.Session, error)
- func (pg *Postgres[T]) SaveSession(session behemoth.Session, expiresAt time.Time) error
- func (pg *Postgres[T]) SaveUser(user *models.User) (*models.User, error)
- func (pg *Postgres[T]) UpdateUser(user *models.User) (*models.User, error)
- func (pg *Postgres[T]) UserExists(user *models.User) (bool, error)
- func (pg *Postgres[T]) WithTransaction(fn func(tx *sql.Tx) error) error
- type SQLite
- func (sqlt *SQLite[T]) DeleteSession(sessionID string) error
- func (sqlt *SQLite[T]) DeleteUser(user *models.User) error
- func (sqlt *SQLite[T]) FindByPK(val any) (T, error)
- func (sqlt *SQLite[T]) GetAllUsers() ([]T, error)
- func (sqlt *SQLite[T]) GetSession(sessionID string) (behemoth.Session, error)
- func (sqlt *SQLite[T]) SaveSession(session behemoth.Session, expiresAt time.Time) error
- func (sqlt *SQLite[T]) SaveUser(user *models.User) (*models.User, error)
- func (sqlt *SQLite[T]) UpdateUser(user *models.User) (*models.User, error)
- func (sqlt *SQLite[T]) UserExists(user *models.User) (bool, error)
- func (sqlt *SQLite[T]) WithTransaction(fn func(tx *sql.Tx) error) error
- type ScannableRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Postgres ¶
func NewPostgres ¶
func (*Postgres[T]) DeleteSession ¶
DeleteSession removes a session by ID.
func (*Postgres[T]) GetAllUsers ¶
func (*Postgres[T]) GetSession ¶
GetSession retrieves a session by ID, returning an error if not found or expired.
func (*Postgres[T]) SaveSession ¶
SaveSession stores a session in the database with its expiration time.
func (*Postgres[T]) UpdateUser ¶
type SQLite ¶
func (*SQLite[T]) DeleteSession ¶
DeleteSession removes a session by ID.
func (*SQLite[T]) GetAllUsers ¶
func (*SQLite[T]) GetSession ¶
GetSession retrieves a session by ID, returning an error if not found or expired.
func (*SQLite[T]) SaveSession ¶
SaveSession stores a session in the database with its expiration time.
func (*SQLite[T]) UpdateUser ¶
type ScannableRow ¶
Click to show internal directories.
Click to hide internal directories.