Documentation ¶
Index ¶
- func AdminIsPasswordValid(mongoconn *mongo.Database, collection string, admindata Admin) bool
- func CompareHashPass(password, hash string) bool
- func CreateAdmin(mongoconn *mongo.Database, collection string, admindata Admin) interface{}
- func CreateAdminAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, ...) error
- func CreateNewAdminRole(mongoconn *mongo.Database, collection string, admindata Admin) interface{}
- func CreateNewTicket(mongoconn *mongo.Database, collection string, ticketdata Ticket) interface{}
- func CreateNewUserRole(mongoconn *mongo.Database, collection string, userdata User) interface{}
- func CreateUser(mongoconn *mongo.Database, collection string, userdata User) interface{}
- func CreateUserAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, ...) error
- func DeleteAdmin(mongoconn *mongo.Database, collection string, admindata Admin) interface{}
- func DeleteOneDoc(_id primitive.ObjectID, db *mongo.Database, col string) error
- func DeleteTicket(mongoconn *mongo.Database, collection string, ticketdata Ticket) interface{}
- func DeleteUser(mongoconn *mongo.Database, collection string, userdata User) interface{}
- func GCFDeleteTicket(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collticket string, ...) string
- func GCFGetAllTicket(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string
- func GCFGetAllTicketID(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string
- func GCFInsertTicket(publickey, MONGOCONNSTRINGENV, dbname, colluser, collticket string, ...) string
- func GCFReturnStruct(DataStruct any) string
- func GCFUpdateTicket(publickey, MONGOCONNSTRINGENV, dbname, colluser, collticket string, ...) string
- func GetAllDocs(db *mongo.Database, col string, docs interface{}) interface{}
- func HashPass(password string) (string, error)
- func InsertAdmindata(MongoConn *mongo.Database, username, email, role, password string) (InsertedID interface{})
- func InsertOneDoc(db *mongo.Database, collection string, doc interface{}) (insertedID interface{})
- func InsertUserdata(MongoConn *mongo.Database, username, email, role, password string) (InsertedID interface{})
- func LoginAdmin(Privatekey, MongoEnv, dbname, Colname string, r *http.Request) string
- func LoginUser(Privatekey, MongoEnv, dbname, Colname string, r *http.Request) string
- func MongoCreateConnection(MongoString, dbname string) *mongo.Database
- func Register(Mongoenv, dbname string, r *http.Request) string
- func ReturnStringStruct(Data any) string
- func SetConnection(MONGOCONNSTRINGENV, dbname string) *mongo.Database
- func UpdateOneDoc(id primitive.ObjectID, db *mongo.Database, col string, doc interface{}) (err error)
- func UpdatedTicket(mongoconn *mongo.Database, collection string, filter bson.M, ticketdata Ticket) interface{}
- func UserIsPasswordValid(mongoconn *mongo.Database, collection string, userdata User) bool
- type About
- type Admin
- type Contact
- type Credential
- type Payload
- type RegisterStruct
- type Response
- type Ticket
- type Tour
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminIsPasswordValid ¶
func CompareHashPass ¶
func CreateAdmin ¶
admin
func CreateAdminAndAddToken ¶
func CreateAdminAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, admindata Admin) error
admin
func CreateNewAdminRole ¶
admin
func CreateNewTicket ¶
ticket
func CreateNewUserRole ¶
user
func CreateUser ¶
user
func CreateUserAndAddToken ¶
func CreateUserAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, userdata User) error
user
func DeleteAdmin ¶
func DeleteTicket ¶
func DeleteUser ¶
func GCFDeleteTicket ¶
func GCFDeleteTicket(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collticket string, r *http.Request) string
delete ticket
func GCFGetAllTicket ¶
get all ticket
func GCFGetAllTicketID ¶
get all ticket by id
func GCFInsertTicket ¶
func GCFInsertTicket(publickey, MONGOCONNSTRINGENV, dbname, colluser, collticket string, r *http.Request) string
ticket post
func GCFUpdateTicket ¶
func GCFUpdateTicket(publickey, MONGOCONNSTRINGENV, dbname, colluser, collticket string, r *http.Request) string
update ticket
func GetAllDocs ¶
crud
func InsertAdmindata ¶
func InsertOneDoc ¶
func InsertUserdata ¶
func LoginAdmin ¶
func MongoCreateConnection ¶
func ReturnStringStruct ¶
func SetConnection ¶
func UpdateOneDoc ¶
func UpdatedTicket ¶
Types ¶
type Admin ¶
type Admin struct { Email string `bson:"email,omitempty" json:"email,omitempty"` Username string `json:"username" bson:"username"` Password string `json:"password" bson:"password"` PasswordHash string `json:"passwordhash" bson:"passwordhash"` Role string `json:"role,omitempty" bson:"role,omitempty"` Token string `json:"token,omitempty" bson:"token,omitempty"` Private string `json:"private,omitempty" bson:"private,omitempty"` Public string `json:"public,omitempty" bson:"public,omitempty"` }
type Contact ¶
type Contact struct { ID int `json:"id" bson:"id"` Name string `json:"title" bson:"title"` Subject string `json:"description" bson:"description"` Alamat string `json:"alamat" bson:"alamat"` Website string `json:"website" bson:"website"` Message string `json:"image" bson:"image"` Email string `json:"email" bson:"email"` Phone string `json:"phone" bson:"phone"` Status bool `json:"status" bson:"status"` }
type Credential ¶
type Payload ¶
type Payload struct { Id primitive.ObjectID `json:"id"` Role string `json:"role"` Exp time.Time `json:"exp"` Iat time.Time `json:"iat"` Nbf time.Time `json:"nbf"` }
func IsTokenValid ¶
<--- paseto encoder ---> memeriksa token
type RegisterStruct ¶
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 ¶
type Ticket ¶
type Tour ¶
type Tour struct { ID int `json:"id" bson:"id"` Title string `json:"title" bson:"title"` Description string `json:"description" bson:"description"` Cari string `json:"cari" bson:"cari"` Tanggal string `json:"tanggal" bson:"tanggal"` Image string `json:"image" bson:"image"` Harga int `json:"harga" bson:"harga"` Ticket []Ticket `json:"ticket" bson:"ticket"` Rating string `json:"rating" bson:"rating"` Status bool `json:"status" bson:"status"` }
type User ¶
type User struct { Email string `bson:"email,omitempty" json:"email,omitempty"` Username string `json:"username" bson:"username"` Password string `json:"password" bson:"password"` PasswordHash string `json:"passwordhash" bson:"passwordhash"` Role string `json:"role,omitempty" bson:"role,omitempty"` Token string `json:"token,omitempty" bson:"token,omitempty"` Private string `json:"private,omitempty" bson:"private,omitempty"` Public string `json:"public,omitempty" bson:"public,omitempty"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.