memory

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package memory provides an in-memory repository implementation suitable for development and testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is a thread-safe in-memory implementation of authentication storage interfaces.

func New

func New() *Store

New instantiates a new thread-safe in-memory Store.

func (*Store) Create

func (s *Store) Create(ctx context.Context, tf *twofactor.TwoFactor) error

func (*Store) CreateAccount

func (s *Store) CreateAccount(ctx context.Context, account *entity.Account) error

Account Methods

func (*Store) CreateSession

func (s *Store) CreateSession(ctx context.Context, session *dto.CreateSessionParams) (*entity.Session, error)

Session Methods

func (*Store) CreateUser

func (s *Store) CreateUser(ctx context.Context, params *dto.CreateUserParams) (*entity.User, error)

User Methods

func (*Store) CreateVerificationToken

func (s *Store) CreateVerificationToken(ctx context.Context, token *entity.VerificationToken) error

Verification Token Methods

func (*Store) DeleteByUserID

func (s *Store) DeleteByUserID(ctx context.Context, userID string) error

func (*Store) DeleteOTPChallenge

func (s *Store) DeleteOTPChallenge(ctx context.Context, key string) error

func (*Store) DeleteSession

func (s *Store) DeleteSession(ctx context.Context, token string) error

func (*Store) DeleteVerificationToken

func (s *Store) DeleteVerificationToken(ctx context.Context, token string) error

func (*Store) FindByUserID

func (s *Store) FindByUserID(ctx context.Context, userID string) (*twofactor.TwoFactor, error)

func (*Store) GetAccountByUserIDAndProvider

func (s *Store) GetAccountByUserIDAndProvider(ctx context.Context, userID, provider string) (*entity.Account, error)

func (*Store) GetOTPChallenge

func (s *Store) GetOTPChallenge(ctx context.Context, key string) (*twofactor.OTPChallenge, error)

func (*Store) GetSessionByToken

func (s *Store) GetSessionByToken(ctx context.Context, token string) (*entity.Session, error)

func (*Store) GetTOTPSecret

func (s *Store) GetTOTPSecret(ctx context.Context, userID string) (string, error)

func (*Store) GetUserByEmail

func (s *Store) GetUserByEmail(ctx context.Context, email string) (*entity.User, error)

func (*Store) GetUserByID

func (s *Store) GetUserByID(ctx context.Context, id string) (*entity.User, error)

func (*Store) GetVerificationToken

func (s *Store) GetVerificationToken(ctx context.Context, token string) (*entity.VerificationToken, error)

func (*Store) SaveOTPChallenge

func (s *Store) SaveOTPChallenge(ctx context.Context, challenge *twofactor.OTPChallenge) error

func (*Store) SaveTOTPSecret

func (s *Store) SaveTOTPSecret(ctx context.Context, userID string, secret string) error

2FA TOTP Methods

func (*Store) Update

func (s *Store) Update(ctx context.Context, tf *twofactor.TwoFactor) error

func (*Store) UpdateAccountPassword

func (s *Store) UpdateAccountPassword(ctx context.Context, accountID, hashedPassword string) error

func (*Store) UpdateUser

func (s *Store) UpdateUser(ctx context.Context, user *entity.User) error

Jump to

Keyboard shortcuts

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