Documentation ¶
Index ¶
- func NewAccountRepository(accountsCollection *mongo.Collection) *accountRepository
- func NewAccountSessionTxn(client *mongo.Client, accountRepository *accountRepository, ...) *accountSessionTxn
- func NewGeneralInMemoryStorage(client *redis.Client) *generalInMemoryStorage
- func NewSessionRepository(client *mongo.Client, sessionsCollection *mongo.Collection) *sessionRepository
- type DBModel
- type Entity
- func (e *Entity) GetBirthDate() time.Time
- func (e *Entity) GetCurrentCountry() string
- func (e *Entity) GetEmail() string
- func (e *Entity) GetFirstName() string
- func (e *Entity) GetID() string
- func (e *Entity) GetLastName() string
- func (e *Entity) GetNickname() string
- func (e *Entity) RegisterUpdate()
- func (e *Entity) SetBirthDate(val time.Time)
- func (e *Entity) SetCurrentCountry(val string)
- func (e *Entity) SetFirstName(val string)
- func (e *Entity) SetLastName(val string)
- type HandleSessionsOverflowDTO
- type PasswordResetRequestDTO
- type PerformPasswordResetDTO
- type PrepareSessOverflowPipeDTO
- type SendVerifCodeToCleanSessionsDTO
- type Service
- func (s *Service) CreatePasswordResetRequest(ctx context.Context, dto *PasswordResetRequestDTO) error
- func (s *Service) GenerateCaptcha(ctx context.Context, captchaType int) (string, string, error)
- func (s *Service) GetAccessToken(ctx context.Context, refreshToken string, keyReader auth.KeyReader) (string, error)
- func (s *Service) GetAccount(ctx context.Context, nickname string) (*Entity, error)
- func (s *Service) HandleSessionsOverflow(ctx context.Context, dto *HandleSessionsOverflowDTO, keyReader auth.KeyReader) (string, string, error)
- func (s *Service) IsAvailableEmail(ctx context.Context, email string) (bool, error)
- func (s *Service) IsAvailableNickname(ctx context.Context, nickname string) (bool, error)
- func (s *Service) IsSignInCaptcha(ctx context.Context, email string) (bool, error)
- func (s *Service) Logout(ctx context.Context, refreshToken string, keyReader auth.KeyReader) error
- func (s *Service) PerformPasswordReset(ctx context.Context, dto *PerformPasswordResetDTO) error
- func (s *Service) ResendVerifCodeForSignUp(ctx context.Context, pipeID string) error
- func (s *Service) SendVerifCodeForPasswordUpdate(ctx context.Context, accountID string) error
- func (s *Service) SendVerifCodeToCleanSessions(ctx context.Context, dto *SendVerifCodeToCleanSessionsDTO) error
- func (s *Service) SignIn(ctx context.Context, dto *SignInDTO, keyReader auth.KeyReader) (*SignInResultDTO, error)
- func (s *Service) SignUp(ctx context.Context, dto *SignUpDTO) error
- func (s *Service) StartSignUpPipe(ctx context.Context, dto *StartSignUpPipeDTO) (string, error)
- func (s *Service) UpdateAccount(ctx context.Context, dto *UpdateAccountDTO) error
- func (s *Service) UpdatePassword(ctx context.Context, dto *UpdatePasswordDTO, keyReader auth.KeyReader) (string, error)
- type Session
- type SessionDBModel
- type SignInDTO
- type SignInResultDTO
- type SignUpDTO
- type StartSignUpPipeDTO
- type UpdateAccountDTO
- type UpdatePasswordDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccountRepository ¶
func NewAccountRepository(accountsCollection *mongo.Collection) *accountRepository
func NewAccountSessionTxn ¶
func NewGeneralInMemoryStorage ¶
func NewGeneralInMemoryStorage(client *redis.Client) *generalInMemoryStorage
func NewSessionRepository ¶
func NewSessionRepository(client *mongo.Client, sessionsCollection *mongo.Collection) *sessionRepository
Types ¶
type DBModel ¶
type DBModel struct { ID primitive.Binary `bson:"_id"` FirstName string `bson:"first_name"` LastName string `bson:"last_name"` Nickname string `bson:"nickname"` Email string `bson:"email"` BirthDate time.Time `bson:"birth_date"` CurrentCountry string `bson:"current_country"` CreatedAt primitive.Timestamp `bson:"created_at"` UpdatedAt primitive.Timestamp `bson:"updated_at"` EncryptedPassword primitive.Binary `bson:"encrypted_password"` }
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
func (*Entity) GetBirthDate ¶
func (*Entity) GetCurrentCountry ¶
func (*Entity) GetFirstName ¶
func (*Entity) GetLastName ¶
func (*Entity) GetNickname ¶
func (*Entity) RegisterUpdate ¶
func (e *Entity) RegisterUpdate()
func (*Entity) SetBirthDate ¶
func (*Entity) SetCurrentCountry ¶
func (*Entity) SetFirstName ¶
func (*Entity) SetLastName ¶
type PasswordResetRequestDTO ¶
type PerformPasswordResetDTO ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( emailManager emailManager, accountRepository *accountRepository, sessionRepository *sessionRepository, accountSessionTxn *accountSessionTxn, inMemoryStorage *generalInMemoryStorage, ) *Service
func (*Service) CreatePasswordResetRequest ¶
func (s *Service) CreatePasswordResetRequest(ctx context.Context, dto *PasswordResetRequestDTO) error
CreatePasswordResetRequest TODO: implement security mechanism -> - Sending verif code ->->->[Ban for 30 min BY IP]
func (*Service) GenerateCaptcha ¶
func (*Service) GetAccessToken ¶
func (*Service) GetAccount ¶
func (*Service) HandleSessionsOverflow ¶
func (*Service) IsAvailableEmail ¶
IsAvailableEmail TODO: check pipeID(from sign up)
func (*Service) IsAvailableNickname ¶
IsAvailableNickname TODO: check pipeID(from sign up)
func (*Service) IsSignInCaptcha ¶
func (*Service) PerformPasswordReset ¶
func (s *Service) PerformPasswordReset(ctx context.Context, dto *PerformPasswordResetDTO) error
func (*Service) ResendVerifCodeForSignUp ¶
func (*Service) SendVerifCodeForPasswordUpdate ¶
func (*Service) SendVerifCodeToCleanSessions ¶
func (s *Service) SendVerifCodeToCleanSessions(ctx context.Context, dto *SendVerifCodeToCleanSessionsDTO) error
func (*Service) StartSignUpPipe ¶
func (*Service) UpdateAccount ¶
func (s *Service) UpdateAccount(ctx context.Context, dto *UpdateAccountDTO) error
func (*Service) UpdatePassword ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func (*Session) GetSessionID ¶
type SessionDBModel ¶
type SignInResultDTO ¶
type StartSignUpPipeDTO ¶
type UpdateAccountDTO ¶
Click to show internal directories.
Click to hide internal directories.