controllers

package
v0.0.0-...-84851c2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserCollection    *mongo.Collection = database.UserData(database.Client, "Users")
	ProductCollection *mongo.Collection = database.ProductData(database.Client, "Products")
	Validate                            = validator.New()
)

Functions

func AddAddress

func AddAddress() gin.HandlerFunc

AddAddress add new address from user id

func DeleteAddress

func DeleteAddress() gin.HandlerFunc

DeleteAddress delete address from user id

func EditHomeAddress

func EditHomeAddress() gin.HandlerFunc

EditHomeAddress update home address from user id

func EditWorkAddress

func EditWorkAddress() gin.HandlerFunc

EditWorkAddress update work address from user id

func HashPassword

func HashPassword(password string) string

HashPassword take password string and return hash

func Login

func Login() gin.HandlerFunc

func ProductViewerAdmin

func ProductViewerAdmin() gin.HandlerFunc

func SearchProduct

func SearchProduct() gin.HandlerFunc

func SearchProductByQuery

func SearchProductByQuery() gin.HandlerFunc

func SingUp

func SingUp() gin.HandlerFunc

func VerefiPassword

func VerefiPassword(userPassword string, givenPassword string) (bool, string)

Types

type Application

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

func NewApplication

func NewApplication(productCollection, userCollection *mongo.Collection) *Application

func (*Application) AddToCart

func (app *Application) AddToCart() gin.HandlerFunc

AddToCart add product to user cart

func (*Application) BuyFromCart

func (app *Application) BuyFromCart() gin.HandlerFunc

func (*Application) GetItemFromCart

func (app *Application) GetItemFromCart() gin.HandlerFunc

func (*Application) InstantBuy

func (app *Application) InstantBuy() gin.HandlerFunc

func (*Application) RemoveItem

func (app *Application) RemoveItem() gin.HandlerFunc

Jump to

Keyboard shortcuts

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