bookingbackend

package module
v0.0.1 Latest Latest
Warning

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

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

README

bookingbackend

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func DeleteDataLapangan

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

func DeleteLapangan

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

func GCFReturnStruct

func GCFReturnStruct(DataStuct any) string

func GetAllDataLapangan

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

lapangan

func GetDataLapanganByID

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

func HashPassword

func HashPassword(password string) (string, error)

func InsertLapangan

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

func InsertOneDoc

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

func UpdateDataLapangan

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

func UserLogin

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

Types

type Credential

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

type Lapangan

type Lapangan struct {
	ID            primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Nama_Lapangan string             `bson:"nama_lapangan,omitempty" json:"nama_lapangan,omitempty"`
	Harga         string             `bson:"harga,omitempty" json:"harga,omitempty"`
	Deskripsi     string             `bson:"deskripsi,omitempty" json:"deskripsi,omitempty"`
	Gambar        string             `bson:"gambar,omitempty" json:"gambar,omitempty"`
}

func GetAllLapangan

func GetAllLapangan(db *mongo.Database, col string) (lapangan []Lapangan, err error)

obat

func GetLapanganByID

func GetLapanganByID(db *mongo.Database, col string, _id primitive.ObjectID) (lapangan Lapangan, err error)

func InsertLapang

func InsertLapang(db *mongo.Database, col string, lapangan Lapangan) (docs Lapangan, err error)

func UpdateLapangan

func UpdateLapangan(db *mongo.Database, col string, _id primitive.ObjectID, lapangan Lapangan) (docs Lapangan, err error)

type Response

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

type User

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

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