models

package
v0.0.0-...-b9d1559 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Details

type Details struct {
	// contains filtered or unexported fields
}

type Model

type Model struct {
	DB        *sql.DB
	RediStore *redistore.RediStore
}

func (*Model) AddImage

func (dExec *Model) AddImage(name, url string, productID int64) error

func (Model) CheckSession

func (dbExec Model) CheckSession(w http.ResponseWriter, r *http.Request) (*bool, error)

func (*Model) CreateProduct

func (dExec *Model) CreateProduct(name, category string, price float64, description string, other interface{}, contact string, owner_id int, owner_name string) (*int, error)

func (*Model) CreateSession

func (dbExec *Model) CreateSession(w http.ResponseWriter, r *http.Request, user string) error

func (*Model) CreateUser

func (dbExec *Model) CreateUser(username, email, firstName, lastName, password, phoneNumber, salt, token string, verified bool) error

func (*Model) DeleteProduct

func (dExec *Model) DeleteProduct(id int64) error

func (*Model) DeleteProfile

func (dExec *Model) DeleteProfile(userName string) (*string, error)

func (*Model) DeleteSession

func (dbExec *Model) DeleteSession(w http.ResponseWriter, r *http.Request) error

func (*Model) EmailExists

func (dbExec *Model) EmailExists(email string) error

func (*Model) ExpiredToken

func (dExec *Model) ExpiredToken(username string) error

func (*Model) GetByEmail

func (dbExec *Model) GetByEmail(email string) (*userDetails, error)

func (*Model) GetByUsername

func (dbExec *Model) GetByUsername(username string) (*userDetails, error)

func (*Model) GetEmail

func (dbExec *Model) GetEmail(email string) (*string, error)

func (*Model) GetSalt

func (dbExec *Model) GetSalt(username string) (*string, error)

func (*Model) GetToken

func (dExec *Model) GetToken(username string) (string, error)

func (*Model) GetUserFromSession

func (dbExec *Model) GetUserFromSession(w http.ResponseWriter, r *http.Request) (*string, error)

func (*Model) Getprt

func (dExec *Model) Getprt(username string) (*prToken, error)

func (*Model) IsVerify

func (dExec *Model) IsVerify(email string) (*bool, error)

func (*Model) ListProducts

func (dExec *Model) ListProducts() (interface{}, error)

func (*Model) ListProductsByCategory

func (dExec *Model) ListProductsByCategory(category string) (interface{}, error)

func (*Model) ReadProduct

func (dExec *Model) ReadProduct(id int64) (*Products, error)

func (*Model) ReadProfile

func (dExec *Model) ReadProfile(userName string) (*Profile, error)

func (*Model) ResetPassword

func (dExec *Model) ResetPassword(token string, prtExpired bool, email string) error

func (*Model) Setprt

func (dExec *Model) Setprt(prtExpired bool, username, password string) error

func (*Model) TokenExpired

func (dExec *Model) TokenExpired(username string) (*bool, error)

func (*Model) UpdatePassword

func (dExec *Model) UpdatePassword(hashPassword, username string) error

func (*Model) UpdateProduct

func (dExec *Model) UpdateProduct(name, category string, price float64, description string, other interface{}, pID int64) error

func (*Model) UpdateProfile

func (dExec *Model) UpdateProfile(firstName, lastName, phone, address string, usr string) (*string, error)

func (*Model) UserExists

func (dbExec *Model) UserExists(username string) error

func (*Model) VerifyEmail

func (dExec *Model) VerifyEmail(username string) error

type Products

type Products struct {
	Product_id  int
	OwnerID     int
	OwnerName   string
	Contact     string
	Name        string
	Category    string
	Price       float64
	Description string
	Other       interface{}
}

type Profile

type Profile struct {
	Username  string
	Email     string
	Phone     string
	FirstName string
	LastName  string
	Address   string
}

Jump to

Keyboard shortcuts

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