Documentation ¶
Index ¶
- type AuthRepository
- func (repo *AuthRepository) AddResetPasswordRequest(ctx context.Context, emailaddress string, expiresAt time.Time) (*entities.ResetPwdReq, error)
- func (repo *AuthRepository) ChangePassword(ctx context.Context, userID string, newPwd []byte) error
- func (repo *AuthRepository) DeleteJWT(ctx context.Context, ut *entities.UserToken) (int64, error)
- func (repo *AuthRepository) DeleteRefreshToken(ctx context.Context, userID string) (n int64, err error)
- func (repo *AuthRepository) DeleteRefreshTokenAndAllTokens(ctx context.Context, userID string) (n int64, err error)
- func (repo *AuthRepository) GetRefreshToken(ctx context.Context, userID string) (*entities.RefreshToken, error)
- func (repo *AuthRepository) GetUserByEmailAddress(ctx context.Context, emailAddress string) (*entities.AuthUser, error)
- func (repo *AuthRepository) GetUserByID(ctx context.Context, id string) (*entities.AuthUser, error)
- func (repo *AuthRepository) GetUserJWTs(ctx context.Context, userID string, expired entities.ExpireType) ([]entities.UserToken, error)
- func (repo *AuthRepository) SaveJWT(ctx context.Context, userID string, device string, token string, ...) (*entities.UserToken, error)
- func (repo *AuthRepository) SaveRefreshToken(ctx context.Context, userID string, token string, expiresAt time.Time) (*entities.RefreshToken, error)
- func (repo *AuthRepository) UpdatePasswordForResetRequest(ctx context.Context, reqID string, pwdHash []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthRepository ¶
type AuthRepository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository( logger *zerolog.Logger, usersCol, tokensCol, refTokensCol, resetPwdCol *mongo.Collection) *AuthRepository
func (*AuthRepository) AddResetPasswordRequest ¶
func (repo *AuthRepository) AddResetPasswordRequest(ctx context.Context, emailaddress string, expiresAt time.Time) (*entities.ResetPwdReq, error)
func (*AuthRepository) ChangePassword ¶
func (*AuthRepository) DeleteRefreshToken ¶
func (*AuthRepository) DeleteRefreshTokenAndAllTokens ¶
func (*AuthRepository) GetRefreshToken ¶
func (repo *AuthRepository) GetRefreshToken( ctx context.Context, userID string) (*entities.RefreshToken, error)
func (*AuthRepository) GetUserByEmailAddress ¶
func (*AuthRepository) GetUserByID ¶
func (*AuthRepository) GetUserJWTs ¶
func (repo *AuthRepository) GetUserJWTs( ctx context.Context, userID string, expired entities.ExpireType, ) ([]entities.UserToken, error)
func (*AuthRepository) SaveRefreshToken ¶
func (repo *AuthRepository) SaveRefreshToken( ctx context.Context, userID string, token string, expiresAt time.Time) (*entities.RefreshToken, error)
func (*AuthRepository) UpdatePasswordForResetRequest ¶
Click to show internal directories.
Click to hide internal directories.