component

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddReminder

func AddReminder(username, phonenumber, title string, remindAt time.Time) error

func CheckDocExist

func CheckDocExist(db *mongo.Database, col string, filter any) (bool, error)

check document exist in collection

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

compare password hash

func DeleteManyDoc added in v0.0.6

func DeleteManyDoc(db *mongo.Database, col string, filter any) (*mongo.DeleteResult, error)

delete many document in collection

func DeleteOneDoc

func DeleteOneDoc(db *mongo.Database, col string, filter any) error

delete one document in collection

func FindOneAndUpdateDoc

func FindOneAndUpdateDoc(db *mongo.Database, col string, filter, update, result any) error

find one and update document in collection

func GenerateUID

func GenerateUID(len int) (string, error)

generate unique id for document

func GetManyDoc

func GetManyDoc(db *mongo.Database, col string, filter, result any) error

get many document from collection

func GetOneDoc

func GetOneDoc(db *mongo.Database, col string, filter, result any) error

get one document from collection

func HashPassword

func HashPassword(password string) (string, error)

hash password

func InsertOneDoc

func InsertOneDoc(db *mongo.Database, col string, docs any) (insertedID primitive.ObjectID, err error)

insert one document to collection

func Log

func Log(db *mongo.Database, col string, uid primitive.ObjectID, original, updated any) error

Insert Log ketika user melakukan perubahan data

func SaveFileToGithub

func SaveFileToGithub(usernameGhp, emailGhp, repoGhp, path string, r *http.Request) (string, error)

saves file to github

func SendWhatsAppConfirmation

func SendWhatsAppConfirmation(message, phonenumber string) error

func UpdateOneDoc

func UpdateOneDoc(db *mongo.Database, col string, filter, update any) (*mongo.UpdateResult, error)

update one document in collection

func ValidatePhoneNumber

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