Documentation
¶
Index ¶
- type AccountsService
- func (service *AccountsService) CleanPendingEmail(id int) error
- func (service *AccountsService) CreateAccount(account *types.Account) error
- func (service *AccountsService) DeleteAccount(id int) error
- func (service *AccountsService) DisableTOTP(id int) error
- func (service *AccountsService) EnableTOTP(id int) error
- func (service *AccountsService) GetAccountByEmail(email string) (*types.Account, error)
- func (service *AccountsService) GetAccountByID(id int) (*types.Account, error)
- func (service *AccountsService) MarkAccountAsVerified(id int) error
- func (service *AccountsService) SavePending(email string, account int) error
- func (service *AccountsService) UpdateAccountEmail(email string, id int) error
- func (service *AccountsService) UpdateAccountPassword(password string, id int) error
- type BlacklistService
- type EmailService
- func (service *EmailService) AddRecoveryCode(code string, account int) error
- func (service *EmailService) AddVerificationCode(code string, account int) error
- func (service *EmailService) CompareCodes(code string, account int) error
- func (service *EmailService) CompareRecoveryCodes(code string, account int) error
- func (service *EmailService) DeleteCodes(account int) error
- func (service *EmailService) GetAccountIDByCodeOwnership(code string) (int, error)
- func (service *EmailService) SendEmail(email, subject, path string, data interface{}) error
- func (service *EmailService) SendNotificationEmail(email, subject, message string) error
- func (service *EmailService) SendRecoveryEmail(email, code string) error
- func (service *EmailService) SendVerificationEmail(email, code string) error
- type TotpService
- func (service *TotpService) AddBackupCodes(codes []string, account int) error
- func (service *TotpService) DeleteBackupCodes(account int) error
- func (service *TotpService) GenerateBackupCodes(count int, length int) ([]string, error)
- func (service *TotpService) GenerateQRCode(key *otp.Key) ([]byte, error)
- func (service *TotpService) GenerateTOTPSecret(email string, id int) (*otp.Key, error)
- func (service *TotpService) ValidateBackupCode(account int, code string) error
- func (service *TotpService) ValidateTOTP(id int, code string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountsService ¶
func (*AccountsService) CleanPendingEmail ¶
func (service *AccountsService) CleanPendingEmail(id int) error
func (*AccountsService) CreateAccount ¶
func (service *AccountsService) CreateAccount(account *types.Account) error
Creates an account in the database
func (*AccountsService) DeleteAccount ¶
func (service *AccountsService) DeleteAccount(id int) error
Deletes an account in the database
func (*AccountsService) DisableTOTP ¶
func (service *AccountsService) DisableTOTP(id int) error
Disables 2fa totp for an account
func (*AccountsService) EnableTOTP ¶
func (service *AccountsService) EnableTOTP(id int) error
Enables 2fa totp for an account
func (*AccountsService) GetAccountByEmail ¶
func (service *AccountsService) GetAccountByEmail(email string) (*types.Account, error)
Gets an account by email
func (*AccountsService) GetAccountByID ¶
func (service *AccountsService) GetAccountByID(id int) (*types.Account, error)
Gets an account by id
func (*AccountsService) MarkAccountAsVerified ¶
func (service *AccountsService) MarkAccountAsVerified(id int) error
Marks the account as verified
func (*AccountsService) SavePending ¶
func (service *AccountsService) SavePending(email string, account int) error
Saves pending email before confirmation
func (*AccountsService) UpdateAccountEmail ¶
func (service *AccountsService) UpdateAccountEmail(email string, id int) error
Updates account email in the database
func (*AccountsService) UpdateAccountPassword ¶
func (service *AccountsService) UpdateAccountPassword(password string, id int) error
Updates account password in the database
type BlacklistService ¶
func (*BlacklistService) FindToken ¶
func (service *BlacklistService) FindToken(tokenID string) (bool, error)
Tries to find a blacklisted token
func (*BlacklistService) RevokeToken ¶
Revokes jwt tokens
type EmailService ¶
func (*EmailService) AddRecoveryCode ¶
func (service *EmailService) AddRecoveryCode(code string, account int) error
Adds the recovery code to the database
func (*EmailService) AddVerificationCode ¶
func (service *EmailService) AddVerificationCode(code string, account int) error
Adds the verification code to the database
func (*EmailService) CompareCodes ¶
func (service *EmailService) CompareCodes(code string, account int) error
Compares the stored and the inputted verification codes
func (*EmailService) CompareRecoveryCodes ¶
func (service *EmailService) CompareRecoveryCodes(code string, account int) error
Compares the stored and the inputted recovery codes
func (*EmailService) DeleteCodes ¶
func (service *EmailService) DeleteCodes(account int) error
Deletes the account codes
func (*EmailService) GetAccountIDByCodeOwnership ¶
func (service *EmailService) GetAccountIDByCodeOwnership(code string) (int, error)
Gets an account by code ownership
func (*EmailService) SendEmail ¶
func (service *EmailService) SendEmail(email, subject, path string, data interface{}) error
Sends emails based on template and data
func (*EmailService) SendNotificationEmail ¶
func (service *EmailService) SendNotificationEmail(email, subject, message string) error
Sends a notification email
func (*EmailService) SendRecoveryEmail ¶
func (service *EmailService) SendRecoveryEmail(email, code string) error
Sends an account recovery email
func (*EmailService) SendVerificationEmail ¶
func (service *EmailService) SendVerificationEmail(email, code string) error
Sends a verification email
type TotpService ¶
func (*TotpService) AddBackupCodes ¶
func (service *TotpService) AddBackupCodes(codes []string, account int) error
Stores backup codes in the database
func (*TotpService) DeleteBackupCodes ¶
func (service *TotpService) DeleteBackupCodes(account int) error
Deletes backup codes
func (*TotpService) GenerateBackupCodes ¶
func (service *TotpService) GenerateBackupCodes(count int, length int) ([]string, error)
Generates backup codes
func (*TotpService) GenerateQRCode ¶
func (service *TotpService) GenerateQRCode(key *otp.Key) ([]byte, error)
Generates a qrcode
func (*TotpService) GenerateTOTPSecret ¶
Generates and a saves a totp secret
func (*TotpService) ValidateBackupCode ¶
func (service *TotpService) ValidateBackupCode(account int, code string) error
Validates backup codes
func (*TotpService) ValidateTOTP ¶
func (service *TotpService) ValidateTOTP(id int, code string) (bool, error)
Validates a totp code