module

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Response model.Response

	Orderproduct model.Orderproduct
)

Functions

func Decode

func Decode(publicKey string, tokenstring string) (payload model.Payload, err error)

func DeleteOneDoc

func DeleteOneDoc(_id primitive.ObjectID, db *mongo.Database, col string) error

func DeleteOrder

func DeleteOrder(idparam, iduser primitive.ObjectID, db *mongo.Database) error

func DeleteProduct

func DeleteProduct(idparam, iduser primitive.ObjectID, db *mongo.Database) error

func Encode

func Encode(id primitive.ObjectID, role, privateKey string) (string, error)

func GCFHandlerDeleteOrder

func GCFHandlerDeleteOrder(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerDeleteProduct

func GCFHandlerDeleteProduct(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerGetAll

func GCFHandlerGetAll(MONGOCONNSTRINGENV, dbname, col string, docs interface{}) string

get all

func GCFHandlerGetAllOrder

func GCFHandlerGetAllOrder(MONGOCONNSTRINGENV, dbname string) string

func GCFHandlerGetAllPengguna

func GCFHandlerGetAllPengguna(MONGOCONNSTRINGENV, dbname string) string

func GCFHandlerGetAllProduct

func GCFHandlerGetAllProduct(MONGOCONNSTRINGENV, dbname string) string

func GCFHandlerGetAllSeller

func GCFHandlerGetAllSeller(MONGOCONNSTRINGENV, dbname string) string

func GCFHandlerGetAllUserByAdmin

func GCFHandlerGetAllUserByAdmin(conn *mongo.Database) string

func GCFHandlerGetOrder

func GCFHandlerGetOrder(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerGetOrderFromID

func GCFHandlerGetOrderFromID(MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerGetPenggunaByAdmin

func GCFHandlerGetPenggunaByAdmin(conn *mongo.Database, r *http.Request) string

func GCFHandlerGetPenggunaByPengguna

func GCFHandlerGetPenggunaByPengguna(iduser primitive.ObjectID, conn *mongo.Database) string

func GCFHandlerGetPenggunaFromID

func GCFHandlerGetPenggunaFromID(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerGetProduct

func GCFHandlerGetProduct(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerGetProductFromID

func GCFHandlerGetProductFromID(MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerGetSellerFromID

func GCFHandlerGetSellerFromID(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerGetUser

func GCFHandlerGetUser(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerGetUserFromID

func GCFHandlerGetUserFromID(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerInsertOrderProduct

func GCFHandlerInsertOrderProduct(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

order

func GCFHandlerInsertProduct

func GCFHandlerInsertProduct(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerLogin

func GCFHandlerLogin(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

login

func GCFHandlerSignUpPengguna

func GCFHandlerSignUpPengguna(MONGOCONNSTRINGENV, dbname string, r *http.Request) string

signup

func GCFHandlerSignUpSeller

func GCFHandlerSignUpSeller(MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerUpdateByPengguna

func GCFHandlerUpdateByPengguna(idparam, iduser primitive.ObjectID, pengguna model.Pengguna, conn *mongo.Database, r *http.Request) string

func GCFHandlerUpdateEmailUser

func GCFHandlerUpdateEmailUser(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

user

func GCFHandlerUpdatePasswordUser

func GCFHandlerUpdatePasswordUser(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerUpdatePengguna

func GCFHandlerUpdatePengguna(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

pengguna

func GCFHandlerUpdateProduct

func GCFHandlerUpdateProduct(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFHandlerUpdateSeller

func GCFHandlerUpdateSeller(idparam, iduser primitive.ObjectID, db *mongo.Database, insertedDoc model.Seller) error

func GCFHandlerUpdateUser

func GCFHandlerUpdateUser(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

func GCFReturnStruct

func GCFReturnStruct(DataStuct any) string

return struct

func GenerateKey

func GenerateKey() (privateKey, publicKey string)

func Get

func Get(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

get

func GetAllDocs

func GetAllDocs(db *mongo.Database, col string, docs interface{}) interface{}

crud

func GetAllOrder

func GetAllOrder(db *mongo.Database) (order []model.Orderproduct, err error)

func GetAllPengguna

func GetAllPengguna(db *mongo.Database) (pengguna []model.Pengguna, err error)

func GetAllPenggunaByAdmin

func GetAllPenggunaByAdmin(db *mongo.Database) (pengguna []model.Pengguna, err error)

func GetAllProduct

func GetAllProduct(db *mongo.Database) (product []model.Product, err error)

func GetAllSeller

func GetAllSeller(db *mongo.Database) (seller []model.Seller, err error)

func GetAllUser

func GetAllUser(db *mongo.Database) (user []model.User, err error)

func GetID

func GetID(r *http.Request) string

get id

func GetOrderFromID

func GetOrderFromID(_id primitive.ObjectID, db *mongo.Database) (doc model.Orderproduct, err error)

func GetPenggunaFromAkun

func GetPenggunaFromAkun(akun primitive.ObjectID, db *mongo.Database) (doc model.Pengguna, err error)

func GetPenggunaFromID

func GetPenggunaFromID(_id primitive.ObjectID, db *mongo.Database) (doc model.Pengguna, err error)

func GetPenggunaFromIDByAdmin

func GetPenggunaFromIDByAdmin(idparam primitive.ObjectID, db *mongo.Database) (pengguna model.Pengguna, err error)

by admin

func GetProductFromID

func GetProductFromID(_id primitive.ObjectID, db *mongo.Database) (doc model.Product, err error)

func GetSellerFromAkun

func GetSellerFromAkun(akun primitive.ObjectID, db *mongo.Database) (doc model.Seller, err error)

func GetSellerFromID

func GetSellerFromID(_id primitive.ObjectID, db *mongo.Database) (doc model.Seller, err error)

func GetSellerFromIDByAdmin

func GetSellerFromIDByAdmin(idparam primitive.ObjectID, db *mongo.Database) (seller model.Seller, err error)

func GetUserFromEmail

func GetUserFromEmail(email string, db *mongo.Database) (doc model.User, err error)

func GetUserFromID

func GetUserFromID(_id primitive.ObjectID, db *mongo.Database) (doc model.User, err error)

func GetUserLogin

func GetUserLogin(PASETOPUBLICKEYENV string, r *http.Request) (model.Payload, error)

get user login

func InsertOneDoc

func InsertOneDoc(db *mongo.Database, col string, doc interface{}) (insertedID primitive.ObjectID, err error)

func InsertOrderProduct

func InsertOrderProduct(idparam, iduser primitive.ObjectID, db *mongo.Database, insertedDoc model.Orderproduct) error

func InsertProduct

func InsertProduct(iduser primitive.ObjectID, db *mongo.Database, insertedDoc model.Product) error

func LogIn

func LogIn(db *mongo.Database, insertedDoc model.User) (user model.User, err error)

login

func MongoConnect

func MongoConnect(MongoString, dbname string) *mongo.Database

func Put

func Put(PASETOPUBLICKEYENV, MONGOCONNSTRINGENV, dbname string, r *http.Request) string

email

func SignUpPengguna

func SignUpPengguna(db *mongo.Database, insertedDoc model.Pengguna) error

signup

func SignUpSeller

func SignUpSeller(db *mongo.Database, insertedDoc model.Seller) error

func UpdateEmailUser

func UpdateEmailUser(iduser primitive.ObjectID, db *mongo.Database, insertedDoc model.User) error

user

func UpdateOneDoc

func UpdateOneDoc(id primitive.ObjectID, db *mongo.Database, col string, doc interface{}) (err error)

func UpdatePasswordUser

func UpdatePasswordUser(iduser primitive.ObjectID, db *mongo.Database, insertedDoc model.Password) error

func UpdatePengguna

func UpdatePengguna(idparam, iduser primitive.ObjectID, db *mongo.Database, insertedDoc model.Pengguna) error

pengguna

func UpdateSeller

func UpdateSeller(idparam, iduser primitive.ObjectID, db *mongo.Database, insertedDoc model.Seller) error

func UpdateStatusOrderProduct

func UpdateStatusOrderProduct(idorder primitive.ObjectID, db *mongo.Database, insertedDoc model.Orderproduct) error

update status pengiriman

func UpdateUser

func UpdateUser(iduser primitive.ObjectID, db *mongo.Database, insertedDoc model.User) error

func Updateproduct

func Updateproduct(idparam, iduser primitive.ObjectID, db *mongo.Database, insertedDoc model.Product) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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