module

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MongoInfo = atdb.DBInfo{
	DBString: MongoString,
	DBName:   "rumahsakit",
}
View Source
var MongoString string = os.Getenv("MONGOSTRING")

Functions

func DeletePasienByID

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

func DeleteTokenFromMongoDB added in v0.0.7

func DeleteTokenFromMongoDB(db *mongo.Database, col string, token string) error

func DeleteUserByID added in v0.0.7

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

DeleteUserByID deletes a menu item from the database by its ID

func GetAllPasien added in v0.0.2

func GetAllPasien(db *mongo.Database, col string) (data []model.Biodata)

func GetAllUser added in v0.0.7

func GetAllUser(db *mongo.Database, col string) ([]model.User, error)

GetAllUser retrieves all users from the database

func GetByUsername added in v0.0.7

func GetByUsername(db *mongo.Database, col string, username string) (*model.User, error)

func GetPasienByID

func GetPasienByID(_id primitive.ObjectID, db *mongo.Database, col string) (model.Biodata, error)

func GetUserByID added in v0.0.7

func GetUserByID(_id primitive.ObjectID, db *mongo.Database, col string) (model.User, error)

FUNCTION USER GetUserByID retrieves a user from the database by its ID

func InsertOneDoc

func InsertOneDoc(db string, collection string, doc interface{}) (insertedID interface{})

func InsertPasien

func InsertPasien(db *mongo.Database, col string, pasienName string, gender string, usia string, phonenumber string, alamat string, doctor model.Doctor, medicalRecord model.MedicalRecord) (insertedID primitive.ObjectID, err error)

func InsertUsers added in v0.0.7

func InsertUsers(db *mongo.Database, col string, fullname string, phonenumber string, username string, password string) (insertedID primitive.ObjectID, err error)

func MongoConnect

func MongoConnect(dbname string) (db *mongo.Database)

func SaveTokenToDatabase added in v0.0.7

func SaveTokenToDatabase(db *mongo.Database, col string, adminID string, token string) error

func UpdatePasien

func UpdatePasien(ctx context.Context, db *mongo.Database, col string, _id primitive.ObjectID, pasienName string, gender string, usia string, phonenumber string, alamat string, doctor model.Doctor, medicalRecord model.MedicalRecord) (err error)

func UpdateUser added in v0.0.7

func UpdateUser(ctx context.Context, db *mongo.Database, col string, _id primitive.ObjectID, name string, phone string, username string, password string) (err error)

UpdateUser updates an existing user in the database

Types

This section is empty.

Jump to

Keyboard shortcuts

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