module

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode added in v0.0.2

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

func DeleteCatatan added in v0.0.2

func DeleteCatatan(_id primitive.ObjectID, col string, db *mongo.Database) error
	return nil
}

func DeleteCatatanHandler added in v0.0.2

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

func DeleteOneDoc added in v0.0.2

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

func EditUpdateHandler added in v0.0.2

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

func Encode added in v0.0.2

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

func GCFReturnStruct added in v0.0.2

func GCFReturnStruct(DataStuct any) string

return struct

func GenerateKey added in v0.0.2

func GenerateKey() (privateKey, publicKey string)

func GetAllCatatan

func GetAllCatatan(db *mongo.Database, col string) (docs []model.Catatan, err error)

func GetAllDocs added in v0.0.2

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

func GetCatatanById added in v0.0.2

func GetCatatanById(db *mongo.Database, col string, idparam primitive.ObjectID) (doc model.Catatan, err error)

func GetCatatanHandler added in v0.0.2

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

func GetID added in v0.0.2

func GetID(r *http.Request) string

get id

func GetProfileHandler added in v0.0.3

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

func GetUserFromEmail added in v0.0.2

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

func GetUserFromID added in v0.0.2

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

user

func GetUserFromPhonenumber added in v0.0.2

func GetUserFromPhonenumber(phonenumber string, db *mongo.Database) (doc model.User, err error)

func GetUserLogin added in v0.0.2

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

get user login

func InsertCatatan

func InsertCatatan(db *mongo.Database, col string, r *http.Request) (bson.M, error)

func InsertOneDoc

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

func LogIn added in v0.0.2

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

func LogInHandler added in v0.0.2

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

func MongoConnect added in v0.0.2

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

mongodb

func SignUp added in v0.0.2

func SignUp(db *mongo.Database, col string, insertedDoc model.User) (string, error)

func SignUpHandler added in v0.0.2

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

func TambahCatatanHandler added in v0.0.2

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

func UpdateCatatan

func UpdateCatatan(_id primitive.ObjectID, db *mongo.Database, col string, r *http.Request) (bson.M, error)

func UpdateOneDoc added in v0.0.2

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

func ValidatePhoneNumber added in v0.0.2

func ValidatePhoneNumber(phoneNumber string) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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