be_ksi

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

be_ksi

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApproveSewa added in v0.1.1

func ApproveSewa(_id primitive.ObjectID, db *mongo.Database) (bson.M, error)

func BayarSewa added in v0.1.1

func BayarSewa(_id, iduser primitive.ObjectID, db *mongo.Database, insertedDoc Billboard) (bson.M, error)

func CheckKode added in v0.0.2

func CheckKode(db *mongo.Database, kode string) bool

func CheckLatitudeLongitude

func CheckLatitudeLongitude(db *mongo.Database, latitude, longitude string) bool

func CheckSewa added in v0.0.2

func CheckSewa(db *mongo.Database, idbilllboard primitive.ObjectID) bool

func DeleteOneDoc

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

func EditBillboardHandler

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

func EditBillboardOlehAdmin

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

func EditEmail added in v0.0.6

func EditEmail(iduser primitive.ObjectID, db *mongo.Database, insertedDoc User) (bson.M, error)

func EditEmailHandler added in v0.0.6

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

func EditPassword added in v0.0.6

func EditPassword(iduser primitive.ObjectID, db *mongo.Database, insertedDoc Password) (bson.M, error)

func EditPasswordHandler added in v0.0.6

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

func EditProfile added in v0.0.6

func EditProfile(idparam primitive.ObjectID, db *mongo.Database, r *http.Request) (bson.M, error)

func EditProfileHandler added in v0.0.6

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

func EditSewa added in v0.0.2

func EditSewa(idparam, iduser primitive.ObjectID, db *mongo.Database, r *http.Request) (bson.M, error)

func EditSewaHandler added in v0.0.2

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

func Encode

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

func GCFReturnStruct

func GCFReturnStruct(DataStuct any) string

return struct

func GenerateKey

func GenerateKey() (privateKey, publicKey string)

func GetAllDocs

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

crud

func GetBillboarHandler

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

func GetBillboard added in v0.0.2

func GetBillboard(db *mongo.Database) (docs []bson.M, err error)

billboard

func GetID

func GetID(r *http.Request) string

get id

func GetProfileHandler

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

func GetSewaHandler added in v0.0.2

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

func HapusBillboardHandler

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

func HapusBillboardOlehAdmin

func HapusBillboardOlehAdmin(_id primitive.ObjectID, db *mongo.Database) error

func HapusSewa added in v0.0.2

func HapusSewa(_id, iduser primitive.ObjectID, db *mongo.Database) error

func HapusSewaHandler added in v0.0.2

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

func InsertOneDoc

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

func LogInHandler

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

func MongoConnect

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

mongo

func SewaBillboard added in v0.0.2

func SewaBillboard(idbilllboard, iduser primitive.ObjectID, db *mongo.Database, r *http.Request) (bson.M, error)

sewa

func SewaHandler added in v0.0.2

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

sewa

func SignUp

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

register

func SignUpHandler

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

func TambahBillboardHandler

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

func TambahBillboardOlehAdmin

func TambahBillboardOlehAdmin(db *mongo.Database, r *http.Request) (bson.M, error)

func UpdateOneDoc

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

Types

type Billboard

type Billboard struct {
	ID        primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Kode      string             `bson:"kode,omitempty" json:"kode,omitempty"`
	Nama      string             `bson:"nama,omitempty" json:"nama,omitempty"`
	Gambar    string             `bson:"gambar,omitempty" json:"gambar,omitempty"`
	Panjang   string             `bson:"panjang,omitempty" json:"panjang,omitempty"`
	Lebar     string             `bson:"lebar,omitempty" json:"lebar,omitempty"`
	Harga     string             `bson:"harga,omitempty" json:"harga,omitempty"`
	Latitude  string             `bson:"latitude,omitempty" json:"latitude,omitempty"`
	Longitude string             `bson:"longitude,omitempty" json:"longitude,omitempty"`
	Address   string             `bson:"address,omitempty" json:"address,omitempty"`
	Regency   string             `bson:"regency,omitempty" json:"regency,omitempty"`
	District  string             `bson:"district,omitempty" json:"district,omitempty"`
	Village   string             `bson:"village,omitempty" json:"village,omitempty"`
}

func GetAllBillboard

func GetAllBillboard(db *mongo.Database) (docs []Billboard, err error)

func GetBillboardFromID

func GetBillboardFromID(_id primitive.ObjectID, db *mongo.Database) (doc Billboard, err error)

type Credential

type Credential struct {
	Status  int    `json:"status" bson:"status"`
	Token   string `json:"token,omitempty" bson:"token,omitempty"`
	Message string `json:"message,omitempty" bson:"message,omitempty"`
}

type Password added in v0.0.6

type Password struct {
	Password        string `bson:"password,omitempty" json:"password,omitempty"`
	Newpassword     string `bson:"newpass,omitempty" json:"newpass,omitempty"`
	Confirmpassword string `bson:"confirmpass,omitempty" json:"confirmpass,omitempty"`
}

type Payload

type Payload struct {
	Id    primitive.ObjectID `json:"id"`
	Email string             `json:"email"`
	Exp   time.Time          `json:"exp"`
	Iat   time.Time          `json:"iat"`
	Nbf   time.Time          `json:"nbf"`
}

func Decode

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

func GetUserLogin

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

get user login

type Response

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

type Sewa

type Sewa struct {
	ID             primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Billboard      Billboard          `bson:"billboard,omitempty" json:"billboard,omitempty"`
	User           User               `bson:"user,omitempty" json:"user,omitempty"`
	Content        string             `bson:"content,omitempty" json:"content,omitempty"`
	TanggalMulai   string             `bson:"tanggal_mulai,omitempty" json:"tanggal_mulai,omitempty"`
	TanggalSelesai string             `bson:"tanggal_selesai,omitempty" json:"tanggal_selesai,omitempty"`
	Bayar          bool               `bson:"bayar,omitempty" json:"bayar,omitempty"`
	Status         bool               `bson:"status,omitempty" json:"status,omitempty"`
}

func GetAllSewa added in v0.0.2

func GetAllSewa(db *mongo.Database) (sewa []Sewa, err error)

func GetAllSewaByUser added in v0.0.2

func GetAllSewaByUser(iduser primitive.ObjectID, db *mongo.Database) (sewa []Sewa, err error)

func GetSewaFromID added in v0.0.2

func GetSewaFromID(_id primitive.ObjectID, db *mongo.Database) (sewa Sewa, err error)

type User

type User struct {
	ID              primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	NamaLengkap     string             `bson:"namalengkap,omitempty" json:"namalengkap,omitempty"`
	Email           string             `bson:"email,omitempty" json:"email,omitempty"`
	Password        string             `bson:"password,omitempty" json:"password,omitempty"`
	Confirmpassword string             `bson:"confirmpass,omitempty" json:"confirmpass,omitempty"`
	NoHp            string             `bson:"nohp,omitempty" json:"nohp,omitempty"`
	KTP             string             `bson:"ktp,omitempty" json:"ktp,omitempty"`
	Gambar          string             `bson:"gambar,omitempty" json:"gambar,omitempty"`
	Salt            string             `bson:"salt,omitempty" json:"salt,omitempty"`
}

func GetUserFromEmail

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

func GetUserFromID

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

get user

func GetUserFromKTP added in v0.0.3

func GetUserFromKTP(ktp string, db *mongo.Database) (doc User, err error)

func LogIn

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

login

Jump to

Keyboard shortcuts

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