apiobat

package module
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 12 Imported by: 1

README

api_obat

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func DeleteObat

func DeleteObat(db *mongo.Database, col string, _id primitive.ObjectID) (status bool, err error)

func DeletePenyakit

func DeletePenyakit(db *mongo.Database, col string, _id primitive.ObjectID) (status bool, err error)

func DeleteRS added in v0.1.2

func DeleteRS(db *mongo.Database, col string, _id primitive.ObjectID) (status bool, err error)

func GCFReturnStruct

func GCFReturnStruct(DataStuct any) string

func HandlerDeleteObat

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

func HandlerDeletePenyakit

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

func HandlerDeleteRS added in v0.1.2

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

func HandlerGetAllObat

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

obat

func HandlerGetAllPenyakit

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

penyakit

func HandlerGetAllRS added in v0.1.2

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

rumah sakit

func HandlerGetAllUser added in v0.1.5

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

func HandlerGetObatByID

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

func HandlerGetPenyakitByID

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

func HandlerGetRSByID added in v0.1.2

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

func HandlerGetUserByID added in v0.1.5

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

func HandlerInsertObat

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

func HandlerInsertPenyakit

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

func HandlerInsertRS added in v0.1.2

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

func HandlerLogin

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

func HandlerRegister added in v0.1.5

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

user

func HandlerUpdateObat

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

func HandlerUpdatePenyakit

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

func HandlerUpdateRS added in v0.1.2

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

func HashPassword

func HashPassword(password string) (string, error)

func InsertOneDoc added in v0.0.4

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

func MongoConnect

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

func Register

func Register(db *mongo.Database, col string, userdata User) error

Types

type Credential added in v0.1.1

type Credential struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type Obat

type Obat struct {
	ID         primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Jenis_Obat string             `bson:"jenis_obat,omitempty" json:"jenis_obat,omitempty"`
	Nama_Obat  string             `bson:"nama_obat,omitempty" json:"nama_obat,omitempty"`
	Deskripsi  string             `bson:"deskripsi,omitempty" json:"deskripsi,omitempty"`
	Gambar     string             `bson:"gambar,omitempty" json:"gambar,omitempty"`
}

tambah gambar

func GetAllObat

func GetAllObat(db *mongo.Database, col string) (obat []Obat, err error)

obat

func GetObatByID

func GetObatByID(db *mongo.Database, col string, _id primitive.ObjectID) (obat Obat, err error)

func InsertObat

func InsertObat(db *mongo.Database, col string, r *http.Request) (docs Obat, err error)

func UpdateObat

func UpdateObat(db *mongo.Database, col string, _id primitive.ObjectID, r *http.Request) (docs Obat, err error)

type Penyakit

type Penyakit struct {
	ID             primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Jenis_Penyakit string             `bson:"jenis_penyakit,omitempty" json:"jenis_penyakit,omitempty"`
	Nama_Penyakit  string             `bson:"nama_penyakit,omitempty" json:"nama_penyakit,omitempty"`
	Deskripsi      string             `bson:"deskripsi,omitempty" json:"deskripsi,omitempty"`
	Obat           Obat               `bson:"obat,omitempty" json:"obat,omitempty"`
}

func GetAllPenyakit

func GetAllPenyakit(db *mongo.Database, col string) (penyakit []Penyakit, err error)

penyakit

func GetPenyakitByID

func GetPenyakitByID(db *mongo.Database, col string, _id primitive.ObjectID) (penyakit Penyakit, err error)

func InsertPenyakit

func InsertPenyakit(db *mongo.Database, col string, r *http.Request) (docs Penyakit, err error)

func UpdatePenyakit

func UpdatePenyakit(db *mongo.Database, col string, _id primitive.ObjectID, r *http.Request) (docs Penyakit, err error)

type Response added in v0.1.1

type Response struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type RumahSakit added in v0.0.8

type RumahSakit struct {
	ID        primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Nama_RS   string             `bson:"nama_rs,omitempty" json:"nama_rs,omitempty"`
	No_Telp   string             `bson:"no_telp,omitempty" json:"no_telp,omitempty"`
	Alamat    string             `bson:"alamat,omitempty" json:"alamat,omitempty"`
	Latitude  string             `bson:"latitude,omitempty" json:"latitude,omitempty"`
	Longitude string             `bson:"longitude,omitempty" json:"longitude,omitempty"`
	Gambar    string             `bson:"gambar,omitempty" json:"gambar,omitempty"`
	Obat      Obat               `bson:"obat,omitempty" json:"obat,omitempty"`
}

func GetAllRS added in v0.1.2

func GetAllRS(db *mongo.Database, col string) (rs []RumahSakit, err error)

rumah sakit

func GetRSByID added in v0.1.2

func GetRSByID(db *mongo.Database, col string, _id primitive.ObjectID) (rs RumahSakit, err error)

func InsertRS added in v0.1.2

func InsertRS(db *mongo.Database, col string, r *http.Request) (docs RumahSakit, err error)

func UpdateRS added in v0.1.2

func UpdateRS(db *mongo.Database, col string, _id primitive.ObjectID, r *http.Request) (docs RumahSakit, err error)

type User

type User struct {
	ID               primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Username         string             `bson:"username," json:"username,"`
	Phone_Number     string             `bson:"phone_number," json:"phone_number,"`
	Password         string             `bson:"password," json:"password,"`
	Confirm_Password string             `bson:"confirm_password," json:"confirm_password,"`
}

func GetAllUser added in v0.1.5

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

func GetUserByID added in v0.1.5

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

func Login

func Login(db *mongo.Database, col string, userdata User) (user User, status bool, err error)

Jump to

Keyboard shortcuts

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