backprofile

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 17 Imported by: 0

README

backprofile

Membuat backend profile dan parkiran

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CodeQr added in v0.1.3

func CodeQr(dataJSON string, dbName, collectionName string, client *mongo.Client) error

GenerateCodeQr menghasilkan kode QR dari data JSON dan menyimpannya di MongoDB CodeQr menghasilkan kode QR dari data JSON dan menyimpannya di MongoDB

func ConnectDB

func ConnectDB() (*mongo.Database, error)

func CreateProfile

func CreateProfile(db *mongo.Database, profile Profile) error

func DeleteDataProfile added in v0.1.0

func DeleteDataProfile(MongoConn *mongo.Database, colname string, ID string) (*mongo.DeleteResult, error)

func DeleteProfile

func DeleteProfile(db *mongo.Database, id string) error

func GCFDeleteDataProfile added in v0.1.0

func GCFDeleteDataProfile(Mongostring, dbname, colname string, r *http.Request) string

func GCFPostDataProf added in v0.1.0

func GCFPostDataProf(Mongostring, dbname, colname string, r *http.Request) string

func GCFUpdateProfile added in v0.1.0

func GCFUpdateProfile(Mongostring, dbname, colname string, r *http.Request) string

func GCHandlerFunc added in v0.1.0

func GCHandlerFunc(Mongostring, dbname, colname string) (string, error)
func GenerateCodeQRLogo(dataJSON string, dbName, collectionName string, client *mongo.Client) error

GenerateCodeQRLogo generates a QR code with a logo and saves it to MongoDB

func GenerateCodeQr added in v0.0.9

func GenerateCodeQr(dataJSON string, dbName, collectionName string, client *mongo.Client) error

func GenerateQRCodeString added in v0.0.9

func GenerateQRCodeString(text string) (string, error)

GenerateQRCodeString generates a QR code from a string and encodes it as a URL-safe string

func GetConnectionMongo added in v0.1.0

func GetConnectionMongo(MongoString, dbname string) (*mongo.Database, error)

func InsertDataProfile added in v0.1.0

func InsertDataProfile(MongoConn *mongo.Database, colname string, coordinate []float64, id, namaLengkap, npm, prodi, namakendaraan, nomorkendaraan, timeString string) (interface{}, error)

func JSONToQRCodeImage added in v0.1.0

func JSONToQRCodeImage(jsonData []byte) (image.Image, error)

Fungsi untuk mengonversi data JSON menjadi gambar QR code

func ReturnStringStruct added in v0.1.0

func ReturnStringStruct(req *Credents) string

func UpdateDataProfile added in v0.1.0

func UpdateDataProfile(MongoConn *mongo.Database, colname, id, namaLengkap, npm, prodi, namakendaraan, nomorkendaraan, timeString string) error

func UpdateProfile

func UpdateProfile(db *mongo.Database, id string, profile Profile) error

Types

type CodeQR added in v0.0.9

type CodeQR struct {
	Data Profile `json:"data,omitempty" bson:"data,omitempty"`
}

type Credential

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

type Credents added in v0.1.0

type Credents struct {
	Status  string `json:"status" bson:"status"`
	Message string `json:"message" bson:"message"`
}

type Prodi added in v0.1.0

type Prodi struct {
	ProdiId   int    `json:"jurusanid" bson:"jurusanid,omitempty"`
	ProdiName string `json:"jurusanname" bson:"jurusanname,omitempty"`
}

type Profile

type Profile struct {
	ID             string `json:"id" bson:"_id,omitempty"`
	NamaLengkap    string `json:"nama,omitempty" bson:"nama,omitempty"`
	NPM            string `json:"npm,omitempty" bson:"npm,omitempty"`
	Prodi          string `json:"prodi,omitempty" bson:"prodi,omitempty"`
	NamaKendaraan  string `json:"namakendaraan,omitempty" bson:"namakendaraan,omitempty"`
	NomorKendaraan string `json:"nomorkendaraan,omitempty" bson:"nomorkendaraan,omitempty"`
	Time           Time   `json:"time,omitempty" bson:"time,omitempty"`
}

func GetAllDataProfile added in v0.1.1

func GetAllDataProfile(MongoConnect *mongo.Database, colname string) ([]Profile, error)

func GetAllProfiles added in v0.0.9

func GetAllProfiles(db *mongo.Database) ([]Profile, error)

func GetProfile added in v0.0.9

func GetProfile(db *mongo.Database, id string) (Profile, error)

type ProfileRepository

type ProfileRepository struct {
	// contains filtered or unexported fields
}

type RequestProfile

type RequestProfile struct {
	Username string `json:"username"`
	Npm      string `json:"npm"`
	Email    string `json:"email"`
}

type Response

type Response struct {
	Status  bool        `json:"status" bson:"status"`
	Message string      `json:"message" bson:"message"`
	Data    interface{} `json:"data" bson:"data"`
}

type ResponseBack

type ResponseBack struct {
	Status  int      `json:"status"`
	Message string   `json:"message"`
	Data    []string `json:"data"`
}

type ResponseProfile

type ResponseProfile struct {
	Status  int     `json:"status"`
	Message string  `json:"message"`
	Data    Profile `json:"data"`
}

type Time

type Time struct {
	Message     string `json:"message,omitempty" bson:"message,omitempty"`
	WaktuMasuk  string `json:"waktumasuk,omitempty" bson:"waktumasuk,omitempty"`
	WaktuKeluar string `json:"waktukeluar,omitempty" bson:"waktukeluar,omitempty"`
}

type Updated

type Updated struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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