Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccountsService ¶
func NewAccountsService(repo repository.AccountRepository, logger *logrus.Logger, registrationRepository repository.RegistrationRepository, sessionsRepository repository.SessionsRepository, accountEvents events.AccountsEventsMQ, tokenDeliveryMQ events.TokensDeliveryMQ, cfg *AccountsServiceConfig) *accountsService
Types ¶
type AccountsService ¶
type AccountsService interface { CreateAccount(ctx context.Context, dto models.CreateAccountDTO) error DeleteAccount(ctx context.Context, sessionID, machineID string) error RequestAccountVerificationToken(ctx context.Context, email, callbackURL string) error VerifyAccount(ctx context.Context, token string) error SignIn(ctx context.Context, dto models.SignInDTO) (sessionID string, err error) GetAccountID(ctx context.Context, sessionID, machineID string) (accountID string, err error) Logout(ctx context.Context, sessionID, machineID string) error RequestChangePasswordToken(ctx context.Context, email, callbackURL string) error ChangePassword(ctx context.Context, token, newPassword string) error GetAllSessions(ctx context.Context, sessionID, machineID string) (map[string]*models.SessionInfo, error) TerminateSessions(ctx context.Context, sessionID, machineID string, sessionsToTerminateIds []string) error }
type AccountsServiceConfig ¶
type AccountsServiceConfig struct { ChangePasswordTokenTTL time.Duration ChangePasswordTokenSecret string VerifyAccountTokenTTL time.Duration VerifyAccountTokenSecret string NumRetriesForTerminateSessions uint32 RetrySleepTimeForTerminateSessions time.Duration NonActivatedAccountTTL time.Duration BcryptCost int SessionTTL time.Duration }
Click to show internal directories.
Click to hide internal directories.