types

package
v0.0.0-...-b623679 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID          int       `json:"id"`           // Unique identifier for the account
	Email       string    `json:"email"`        // Email address of the account
	Pending     string    `json:"pending"`      // Pending email address(used during email updates)
	Password    string    `json:"-"`            // Hashed password
	Verified    bool      `json:"verified"`     // Whether the account is verified
	TotpEnabled bool      `json:"totp_enabled"` // Whether TOTP(2FA) is enabled
	TotpSecret  string    `json:"-"`            // TOTP secret
	Updated     time.Time `json:"updated"`      // Timestamp of the last update
	Created     time.Time `json:"created"`      // Timestamp of account creation
}

Represents an account in the system

type PayloadAccountDelete

type PayloadAccountDelete struct {
	Password string `json:"password" validate:"required,min=12,max=128,containsany=!@#$%^&*"` // Account password
}

The payload for deleting an account.

type PayloadAccountRecovery

type PayloadAccountRecovery struct {
	Email string `json:"email" validate:"required,email"`
}

The payload for initiating account recovery

type PayloadAccountReset

type PayloadAccountReset struct {
	Code     string `json:"code" validate:"required,len=6,ascii"`
	Password string `json:"password" validate:"required,min=12,max=128,containsany=!@#$%^&*"`
}

The payload for resetting an account's password

type PayloadAccountSendConfirmationEmail

type PayloadAccountSendConfirmationEmail struct {
	Email string `json:"new" validate:"required,email"`
}

The payload for sending a confirmation email

type PayloadAccountUpdateEmail

type PayloadAccountUpdateEmail struct {
	Code string `json:"code" validate:"required,len=6,ascii"`
}

The payload for updating an account's email

type PayloadAccountUpdatePassword

type PayloadAccountUpdatePassword struct {
	Old string `json:"old" validate:"required,min=12,max=128,containsany=!@#$%^&*"`
	New string `json:"new" validate:"required,min=12,max=128,containsany=!@#$%^&*"`
}

The payload for updating an account's password

type PayloadLogin

type PayloadLogin struct {
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required,min=12,max=128,containsany=!@#$%^&*"`
	TOTP     string `json:"totp" validate:"omitempty"` // TOTP code(optional)
}

The payload for logging into an account

type PayloadLoginWithBackupCode

type PayloadLoginWithBackupCode struct {
	Email      string `json:"email" validate:"required,email"`
	BackupCode string `json:"code" validate:"required,len=8,ascii"`
}

The payload for logging in with a backup code

type PayloadRegister

type PayloadRegister struct {
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required,min=12,max=128,containsany=!@#$%^&*"`
}

The payload for registering a new account

type PayloadVerification

type PayloadVerification struct {
	Code string `json:"code" validate:"required,len=6,ascii"`
}

The payload for verifying an account

Jump to

Keyboard shortcuts

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