models

package
v0.0.0-...-456f4c6 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateOTP

type GenerateOTP struct {
	Otp_secret   string `json:"otp_secret"`
	Otp_auth_url string `json:"otp_auth_url"`
}

type GetSecret

type GetSecret struct {
	Username   string `json:"username"`
	Otp_secret string `json:"otp_secret"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

for Login Request

type OTP

type OTP struct {
	Token      string `json:"token"`
	Otp_secret string `json:"otp_secret"`
}

type Password

type Password struct {
	Password string `json:"password"`
}

type RegisterUser

type RegisterUser struct {
	ID        uuid.UUID `json:"id"`
	Name      string    `json:"name"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	Password  string    `json:"password"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	LastLogin time.Time `json:"last_login"`
}

For Registering new user

func NewRegisterUser

func NewRegisterUser(name, username, email, password string) *RegisterUser

type ScanSecret

type ScanSecret struct {
	Secret string `json:"secret"`
}

type Token

type Token struct {
	Username string `json:"username"`
	Token    string `json:"token"`
}

type Update

type Update struct {
	Username     string `json:"username"`
	Otp_secret   string `json:"otp_secret"`
	Otp_auth_url string `json:"otp_auth_url"`
}

type User

type User struct {
	ID           uuid.UUID `json:"id"`
	Name         string    `json:"name"`
	Username     string    `json:"username"`
	Email        string    `json:"email"`
	Password     string    `json:"password"`
	Otp_enabled  bool      `json:"otp_enabled"`
	Otp_verified bool      `json:"otp_verified"`
	Otp_secret   string    `json:"otp_secret"`
	Otp_auth_url string    `json:"otp_auth_url"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
	LastLogin    time.Time `json:"last_login"`
}

For creating new table in the database

type UserProfile

type UserProfile struct {
	ID           uuid.UUID      `json:"id"`
	Name         string         `json:"name"`
	Username     string         `json:"username"`
	Email        string         `json:"email"`
	Password     string         `json:"-"`
	Otp_enabled  bool           `json:"otp_enabled"`
	Otp_verified bool           `json:"otp_verified"`
	Otp_secret   sql.NullString `json:"otp_secret"`
	Otp_auth_url sql.NullString `json:"otp_auth_url"`
	CreatedAt    time.Time      `json:"created_at"`
	UpdatedAt    time.Time      `json:"updated_at"`
	LastLogin    time.Time      `json:"last_login"`
}

for get endpoint

type Username

type Username struct {
	UserName string `json:"username"`
}

Jump to

Keyboard shortcuts

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