userrepository

package
v0.0.0-...-fd201ba Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUnitOfWork

func NewUnitOfWork(log logger.Logger, db *sql.DB) port.UserUnitOfWork

Types

type MockUnitOfWork

type MockUnitOfWork struct {
	mock.Mock
}

func (*MockUnitOfWork) BeginTx

func (r *MockUnitOfWork) BeginTx(ctx context.Context) error

func (*MockUnitOfWork) Commit

func (r *MockUnitOfWork) Commit() error

func (*MockUnitOfWork) Rollback

func (r *MockUnitOfWork) Rollback() error

func (*MockUnitOfWork) UserRepository

func (r *MockUnitOfWork) UserRepository() port.UserRepository

type MockUserRepository

type MockUserRepository struct {
	mock.Mock
}

func (*MockUserRepository) GetByEmail

func (r *MockUserRepository) GetByEmail(email string) (*domain.User, error)

func (*MockUserRepository) GetByID

func (r *MockUserRepository) GetByID(id uint64) (*domain.User, error)

func (*MockUserRepository) GetByUUID

func (r *MockUserRepository) GetByUUID(uuid uuid.UUID) (*domain.User, error)

func (*MockUserRepository) GetTOTPSecret

func (r *MockUserRepository) GetTOTPSecret(id uint64) (*string, error)

func (*MockUserRepository) IsEmailUnique

func (r *MockUserRepository) IsEmailUnique(email string) (bool, error)

func (*MockUserRepository) List

func (r *MockUserRepository) List() ([]*domain.User, error)

func (*MockUserRepository) MarkWelcomeMessageSent

func (r *MockUserRepository) MarkWelcomeMessageSent(id uint64) error

func (*MockUserRepository) Save

func (r *MockUserRepository) Save(user *domain.User) (*domain.User, error)

func (*MockUserRepository) UpdateGoogleID

func (r *MockUserRepository) UpdateGoogleID(id uint64, googleID string) error

func (*MockUserRepository) UpdateLastLoginTime

func (r *MockUserRepository) UpdateLastLoginTime(id uint64) error

func (*MockUserRepository) UpdatePassword

func (r *MockUserRepository) UpdatePassword(id uint64, password string) error

func (*MockUserRepository) UpdateTOTPSecret

func (r *MockUserRepository) UpdateTOTPSecret(id uint64, secret *string) error

func (*MockUserRepository) VerifiedEmail

func (r *MockUserRepository) VerifiedEmail(email string) error

type UserRepository

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

UserRepository implements port.UserRepository interface and provides access to the postgres database

func NewUserRepository

func NewUserRepository(log logger.Logger, tx *sql.Tx) *UserRepository

NewUserRepository creates a new user repository instance

func (*UserRepository) GetByEmail

func (r *UserRepository) GetByEmail(email string) (*domain.User, error)

func (*UserRepository) GetByID

func (r *UserRepository) GetByID(id uint64) (*domain.User, error)

func (*UserRepository) GetByUUID

func (r *UserRepository) GetByUUID(uuid uuid.UUID) (*domain.User, error)

func (*UserRepository) GetTOTPSecret

func (r *UserRepository) GetTOTPSecret(id uint64) (*string, error)

func (*UserRepository) IsEmailUnique

func (r *UserRepository) IsEmailUnique(email string) (bool, error)

func (*UserRepository) List

func (r *UserRepository) List() ([]*domain.User, error)

func (*UserRepository) MarkWelcomeMessageSent

func (r *UserRepository) MarkWelcomeMessageSent(id uint64) error

func (*UserRepository) Save

func (r *UserRepository) Save(user *domain.User) (*domain.User, error)

func (*UserRepository) UpdateGoogleID

func (r *UserRepository) UpdateGoogleID(id uint64, googleID string) error

func (*UserRepository) UpdateLastLoginTime

func (r *UserRepository) UpdateLastLoginTime(id uint64) error

func (*UserRepository) UpdatePassword

func (r *UserRepository) UpdatePassword(id uint64, password string) error

func (*UserRepository) UpdateTOTPSecret

func (r *UserRepository) UpdateTOTPSecret(id uint64, secret *string) error

func (*UserRepository) VerifiedEmail

func (r *UserRepository) VerifiedEmail(email string) error

Jump to

Keyboard shortcuts

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