cobain

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 12 Imported by: 0

README

cobain

cobain buat package

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateUserAndGenerateToken

func AuthenticateUserAndGenerateToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, userdata User) (string, error)

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func CreateLogin

func CreateLogin(mongoconn *mongo.Database, collection string, userdata User) interface{}

create login using Private

func CreateNewParkir

func CreateNewParkir(mongoconn *mongo.Database, collection string, parkirdatadata Parkir) interface{}

func CreateNewScanQR

func CreateNewScanQR(mconn *mongo.Client, collectionName string, qrdata CodeQr) error

ScanQR

func CreateNewUserRole

func CreateNewUserRole(mongoconn *mongo.Database, collection string, userdata User) interface{}
func GetAllUser(mongoconn *mongo.Database, collection string) []User {
	user := atdb.GetAllDoc[[]User](mongoconn, collection)
	return user
}

func CreateUser

func CreateUser(mongoconn *mongo.Database, collection string, userdata User) interface{}

func CreateUserAndAddToken

func CreateUserAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, userdata User) error

func CreateUserAndAddedToeken

func CreateUserAndAddedToeken(PASETOPRIVATEKEYENV string, mongoconn *mongo.Database, collection string, userdata User) interface{}

func DeleteUser

func DeleteUser(mongoconn *mongo.Database, collection string, userdata User) interface{}

func GCFCreateAccountAndToken

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

func GCFCreateHandler

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

func GCFCreateHandlerTokenPaseto

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

func GCFCreateTokenAndSaveToDB

func GCFCreateTokenAndSaveToDB(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) (string, error)

func GCFCreteRegister

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

func GCFDeleteHandler

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

func GCFFindUserByID

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

func GCFFindUserByName

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

func GCFGetAllParkir

func GCFGetAllParkir(MONGOCONNSTRINGENV, dbname, collectionname string) string

product

func GCFLoginAfterCreate

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

func GCFLoginAfterCreatee

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

func GCFLoginAfterCreateee

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

func GCFLoginAfterCreateeee

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

func GCFLoginAfterCreater

func GCFLoginAfterCreater(MONGOCONNSTRINGENV, dbname, collectionname, privateKeyEnv string, r *http.Request) (string, error)

func GCFLoginFixx

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

func GCFLoginFixxx

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

func GCFLoginTest

func GCFLoginTest(username, password, MONGOCONNSTRINGENV, dbname, collectionname string) bool

func GCFPostHandler

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

func GCFReturnStruct

func GCFReturnStruct(DataStuct any) string

func GCFUpdateHandler

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

func GFCPostHandlerUser

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

func HashPassword

func HashPassword(password string) (string, error)

func IsPasswordValid

func IsPasswordValid(mongoconn *mongo.Database, collection string, userdata User) bool

func ReplaceOneDoc

func ReplaceOneDoc(mongoconn *mongo.Database, collection string, filter bson.M, userdata User) interface{}

func SetConnection

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

Types

type CodeQr

type CodeQr struct {
	ID           string `bson:"id,omitempty" `
	Message      string `json:"message" bson:"message"`
	Email        string `json:"email" bson:"email"`
	Notification string `json:"notification" bson:"notification"`
}

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"`
}

func GCFCreateParkir

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

type Iklan

type Iklan struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Image       string `json:"image" bson:"image"`
}

type Parkir

type Parkir struct {
	ID             int    `bson:"_id,omitempty" `
	Nopol          string `json:"nopol" bson:"nopol"`
	NamaMhs        string `json:"namamhs" bson:"namamhs"`
	Prodi          string `json:"prodi" bson:"prodi"`
	JenisKendaraan string `json:"jeniskendaraan" bson:"jeniskendaraan"`
	WaktuMasuk     string `json:"waktumasuk" bson:"waktumasuk"`
	WaktuKeluar    string `json:"waktukeluar" bson:"waktukeluar"`
	Image          string `json:"image" bson:"image"`
}

func GetAllParkir

func GetAllParkir(mongoconn *mongo.Database, collection string) []Parkir

type Response

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

func CreateResponse

func CreateResponse(status bool, message string, data interface{}) Response

type User

type User struct {
	Username string `json:"username" bson:"username"`
	Password string `json:"password" bson:"password"`
	Role     string `json:"role,omitempty" bson:"role,omitempty"`
	Token    string `json:"token,omitempty" bson:"token,omitempty"`
	Private  string `json:"private,omitempty" bson:"private,omitempty"`
	Publick  string `json:"publick,omitempty" bson:"publick,omitempty"`
}

func FindUser

func FindUser(mongoconn *mongo.Database, collection string, userdata User) User

func FindUserByUsername

func FindUserByUsername(mongoconn *mongo.Database, collection string, username string) (User, error)

func FindUserUser

func FindUserUser(mongoconn *mongo.Database, collection string, userdata User) User

func FindUserUserr

func FindUserUserr(mongoconn *mongo.Database, collection string, userdata User) (User, error)

func IsPasswordValidd

func IsPasswordValidd(mconn *mongo.Database, collection string, userdata User) (User, bool)

Jump to

Keyboard shortcuts

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