Documentation
¶
Overview ¶
Package defaultstore implements the SQL-backed default store for the Aegis authentication module.
Index ¶
- type DefaultStore
- func (s *DefaultStore) AccountStore() types.AccountStore
- func (s *DefaultStore) BeginTx(ctx context.Context) (types.Tx, error)
- func (s *DefaultStore) SessionStore() types.SessionStore
- func (s *DefaultStore) UserStore() types.UserStore
- func (s *DefaultStore) VerificationStore() types.VerificationStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultStore ¶
type DefaultStore struct {
// contains filtered or unexported fields
}
DefaultStore holds all default SQL-based store implementations. It provides a complete implementation of all storage interfaces using sqlc-generated database queries supporting PostgreSQL, MySQL, and SQLite.
In addition to the four store interfaces, DefaultStore implements types.Transactor so callers can compose multiple writes into a single database transaction (used, for example, by AccountService.UpdatePassword to atomically rotate the password and revoke all active sessions).
func NewDefaultStore ¶
NewDefaultStore creates a new default store for the given dialect. The dialect switch happens exactly once here; all store methods call through the querier interface and are dialect-agnostic.
func (*DefaultStore) AccountStore ¶
func (s *DefaultStore) AccountStore() types.AccountStore
AccountStore returns the default account store implementation.
func (*DefaultStore) BeginTx ¶ added in v1.6.0
BeginTx opens a database transaction and returns a types.Tx whose store accessors are bound to the transaction. The caller must Commit or Rollback the returned Tx; using `defer tx.Rollback()` immediately after a successful BeginTx call is safe because Rollback after Commit is a no-op.
func (*DefaultStore) SessionStore ¶
func (s *DefaultStore) SessionStore() types.SessionStore
SessionStore returns the default session store implementation.
func (*DefaultStore) UserStore ¶
func (s *DefaultStore) UserStore() types.UserStore
UserStore returns the default user store implementation.
func (*DefaultStore) VerificationStore ¶
func (s *DefaultStore) VerificationStore() types.VerificationStore
VerificationStore returns the default verification store implementation.