Documentation ¶
Index ¶
- func AddProduct(prod []Product, id string)
- func AddUser(user User) string
- func Customer(id string)
- func DeleteProduct(cartproducts []CartAdd, id string) []string
- func DeleteWishlist(wishProd []Wishlist, id string) []string
- func GenerateUniqueID() string
- func LoginVendor(vendorlog VendorLogin) (int, string)
- func RegisterAdmin(vendor Vendor) (int, string)
- func SetupDBConeection(cfg conf.Config)
- func UpadateCart(cartproducts []CartAdd, id string) []string
- func VendorGet(token string)
- func Wishlist_add(wish []Wishlist, id string) []string
- type Address
- type CartAdd
- type Collection
- type CustomerDatabase
- type Product
- type User
- type UserLogin
- type Vendor
- type VendorDashboard
- type VendorLogin
- type ViewProduct
- type Wishlist
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddProduct ¶
func DeleteProduct ¶
func DeleteWishlist ¶
func GenerateUniqueID ¶
func GenerateUniqueID() string
func LoginVendor ¶
func LoginVendor(vendorlog VendorLogin) (int, string)
func RegisterAdmin ¶
func SetupDBConeection ¶
func UpadateCart ¶
func Wishlist_add ¶
Types ¶
type Address ¶
type CartAdd ¶
type CartAdd struct { ProductName string `json:"product_name"` Price int `json:"price,omitempty"` Quantity int `json:"quantity"` }
func ViewWishlist ¶
type Collection ¶
type Collection struct { NewUser *mongo.Collection Cutomer *mongo.Collection Product *mongo.Collection VendorRegister *mongo.Collection Vendor *mongo.Collection }
func GetdbConnection ¶
func GetdbConnection() Collection
type CustomerDatabase ¶
type Product ¶
type Product struct { VendorID string `json:"vendor_id,omitempty" bson:"vendor_id"` Category string `jsno:"category" bson:"category"` ProductID string `jsno:"product_id,omitempty" bson:"product_id"` ProductName string `json:"product_name" bson:"product_name"` Price int `json:"price" bson:"price"` Quantity int `json:"quantity" bson:"quantity"` }
type User ¶
type User struct { ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"` First_Name string `json:"first_name" bson:"first_name" validate:"required"` Last_Name string `json:"last_name" bson:"last_name" validate:"required"` Password string `json:"password" bson:"password" validate:"required,min=4"` EmailID string `json:"email_id" bson:"email_id" validate:"required"` Phone_No string `json:"phone_no" bson:"phone_no" validate:"required"` UserID string `json:"user_id,omitempty" bson:"user_id"` Address []Address `json:"address,omitempty" bson:"address" validate:"required"` }
type UserLogin ¶
type UserLogin struct { UserID string `json:"user_id,omitempty"` EmailID string `json:"email_id" validate:"required"` Password string `json:"password" validate:"required,min=4"` Add []Address `json:"address,omitempty"` }
func (*UserLogin) EmailValid ¶
type Vendor ¶
type Vendor struct { ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"` First_Name string `json:"first_name" bson:"first_name"` Last_Name string `json:"last_name" bson:"last_name"` EmailID string `json:"email_id" bson:"email_id"` Company string `json:"company" bson:"company"` Password string `json:"password" bson:"password" validate:"required,min=4"` Phone_No string `json:"phone_no" bson:"phone_no"` Key string `json:"key" bson:"key" validate:"required"` Admin_id string `json:"admin_id,omitempty" bson:"admin_id"` }
type VendorDashboard ¶
type VendorLogin ¶
type VendorLogin struct { Admin_id string `json:"admin_id,omitempty"` EmailID string `json:"email_id" validate:"required"` Key string `json:"key" validate:"required"` Password string `json:"password" validate:"required,min=4"` }
func (*VendorLogin) EmailValidVendor ¶
func (v *VendorLogin) EmailValidVendor() bool
type ViewProduct ¶
type ViewProduct struct { ProductName string `json:"product_name"` Price int `json:"price"` Quantity int `json:"quantity"` }
func AllProducts ¶
func AllProducts() []ViewProduct
func SearchCategory ¶
func SearchCategory(catName string) []ViewProduct
func SearchSpecificProduct ¶
func SearchSpecificProduct(productname string) []ViewProduct
Click to show internal directories.
Click to hide internal directories.