evchargingpoint

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 16 Imported by: 0

README

backend-evchargingpoint

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteOneDoc

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

func Encode

func Encode(id primitive.ObjectID, namalengkap, 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 GetID

func GetID(r *http.Request) string

Get Id

func InsertOneDoc

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

func MongoConnect

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

Mongo Environment

func SaveFileToGithub

func SaveFileToGithub(usernameGhp, emailGhp, repoGhp, path string, r *http.Request) (string, error)

save file to github

func UpdateOneDoc

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

Types

type ChargingSatation

type ChargingSatation struct {
	ID             primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	ChargingKode   string             `bson:"chargingkode,omitempty" json:"chargingkode,omitempty"`
	Nama           string             `bson:"nama,omitempty" json:"nama,omitempty"`
	Alamat         string             `bson:"alamat,omitempty" json:"alamat,omitempty"`
	AmmountPlugs   int                `bson:"ammountplugs,omitempty" json:"ammountplugs,omitempty"`
	Daya           string             `bson:"daya,omitempty" json:"daya,omitempty"`
	Connector      string             `bson:"connector,omitempty" json:"connector,omitempty"`
	Harga          string             `bson:"harga,omitempty" json:"harga,omitempty"`
	Image          string             `bson:"image,omitempty" json:"image,omitempty"`
	NomorTelepon   string             `bson:"nomortelepon,omitempty" json:"nomortelepon,omitempty"`
	JamOperasional string             `bson:"jamoperasional,omitempty" json:"jamoperasional,omitempty"`
	Longitude      string             `bson:"longitude,omitempty" json:"longitude,omitempty"`
	Latitude       string             `bson:"latitude,omitempty" json:"latitude,omitempty"`
}

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 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 Transaksi

type Transaksi struct {
	ID               primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	ChargingSatation ChargingSatation   `bson:"chargingsatation,omitempty" json:"chargingsatation,omitempty"`
	User             User               `bson:"user,omitempty" json:"user,omitempty"`
	Tanggal          string             `bson:"tanggal,omitempty" json:"tanggal,omitempty"`
	StartTime        time.Time          `bson:"starttime,omitempty" json:"starttime,omitempty"`
	EndTime          time.Time          `bson:"endtime,omitempty" json:"endtime,omitempty"`
	TotalPrice       string             `bson:"totalprice,omitempty" json:"totalprice,omitempty"`
	Status           int                `bson:"status,omitempty" json:"status,omitempty"`
}

type User

type User struct {
	ID              primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	NamaLengkap     string             `bson:"namalengkap,omitempty" json:"namalengkap,omitempty"`
	NomorHp         string             `bson:"nomorhp,omitempty" json:"nomorhp,omitempty"`
	NamaKendaraan   string             `bson:"namakendaraan,omitempty" json:"namakendaraan,omitempty"`
	NomorPolisi     string             `bson:"nomorpolisi,omitempty" json:"nomorpolisi,omitempty"`
	Email           string             `bson:"email,omitempty" json:"email,omitempty"`
	Password        string             `bson:"password,omitempty" json:"password,omitempty"`
	Image           string             `bson:"image,omitempty" json:"image,omitempty"`
	Confirmpassword string             `bson:"confirmpass,omitempty" json:"confirmpass,omitempty"`
	Salt            string             `bson:"salt,omitempty" json:"salt,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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