pasabarbackend

package module
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 18 Imported by: 0

README

pasabarbackend

admin backend

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareHashPass added in v0.0.5

func CompareHashPass(password, hash string) bool

func CreateAdmin

func CreateAdmin(mongoconn *mongo.Database, collection string, admindata Admin) interface{}

func CreateAdminAndAddToken added in v0.0.5

func CreateAdminAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, admindata Admin) error

func CreateNewAdminRole added in v0.0.5

func CreateNewAdminRole(mongoconn *mongo.Database, collection string, admindata Admin) interface{}

admin

func CreateNewCatalog

func CreateNewCatalog(mongoconn *mongo.Database, collection string, catalogdata Catalog) interface{}

catalog

func DecodeGetAbout added in v0.1.3

func DecodeGetAbout(PublicKey, tokenStr string) (pay string, err error)

func DecodeGetCatalog added in v0.0.9

func DecodeGetCatalog(PublicKey, tokenStr string) (pay string, err error)

func DecodeGetHotel added in v0.1.2

func DecodeGetHotel(PublicKey, tokenStr string) (pay string, err error)

func DecodeGetKesimpulan added in v0.1.6

func DecodeGetKesimpulan(PublicKey, tokenStr string) (pay string, err error)

func DecodeGetRestoran added in v0.1.2

func DecodeGetRestoran(PublicKey, tokenStr string) (pay string, err error)

func DecodeGetWisata added in v0.1.2

func DecodeGetWisata(PublicKey, tokenStr string) (pay string, err error)

func DeleteAbout added in v0.0.6

func DeleteAbout(mongoconn *mongo.Database, collection string, aboutdata About) interface{}

func DeleteAdmin added in v0.0.5

func DeleteAdmin(mongoconn *mongo.Database, collection string, admindata Admin) interface{}

func DeleteCatalog

func DeleteCatalog(mongoconn *mongo.Database, collection string, catalogdata Catalog) interface{}

func DeleteHotel added in v0.1.2

func DeleteHotel(mongoconn *mongo.Database, collection string, hoteldata Hotel) interface{}

func DeleteKesimpulan added in v0.1.6

func DeleteKesimpulan(mongoconn *mongo.Database, collection string, kesimpulandata Kesimpulan) interface{}

func DeleteOneDoc

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

func DeleteRestoran added in v0.1.2

func DeleteRestoran(mongoconn *mongo.Database, collection string, restorandata Restoran) interface{}

func DeleteWisata added in v0.1.2

func DeleteWisata(mongoconn *mongo.Database, collection string, wisatadata Wisata) interface{}

func GCFDeleteAbout added in v0.0.6

func GCFDeleteAbout(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collabout string, r *http.Request) string

delete about

func GCFDeleteCatalog added in v0.0.2

func GCFDeleteCatalog(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collcatalog string, r *http.Request) string

delete catalog

func GCFDeleteHotel added in v0.1.2

func GCFDeleteHotel(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collhotel string, r *http.Request) string

delete hotel

func GCFDeleteKesimpulan added in v0.1.6

func GCFDeleteKesimpulan(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collkesimpulan string, r *http.Request) string

delete kesimpulan

func GCFDeleteRestoran added in v0.1.2

func GCFDeleteRestoran(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collrestoran string, r *http.Request) string

delete restoran

func GCFDeleteWisata added in v0.1.2

func GCFDeleteWisata(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collwisata string, r *http.Request) string

delete wisata

func GCFGetAllAbout added in v0.0.6

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

get all about

func GCFGetAllCatalog added in v0.0.2

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

get all catalog

func GCFGetAllCatalogID added in v0.0.2

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

get all catalog by id

func GCFGetAllContacts added in v0.1.5

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

get all contact

func GCFGetAllContactt added in v0.1.1

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

func GCFGetAllCrawling added in v0.1.0

func GCFGetAllCrawling(MONGOCONNSTRINGENV, dbname, collectionname string) string

get all crawling

func GCFGetAllHotel added in v0.1.2

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

get all hotel

func GCFGetAllHotelID added in v0.1.2

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

get all hotel by id

func GCFGetAllKesimpulan added in v0.1.6

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

get all kesimpulan

func GCFGetAllKesimpulanID added in v0.1.6

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

get all kesimpulan by id

func GCFGetAllRestoran added in v0.1.2

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

get all restoran

func GCFGetAllRestoranID added in v0.1.2

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

get all restoran by id

func GCFGetAllWisata added in v0.1.2

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

get all wisata

func GCFGetAllWisataID added in v0.1.2

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

get all wisata by id

func GCFInsertAbout added in v0.0.6

func GCFInsertAbout(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collabout string, r *http.Request) string

about post

func GCFInsertCatalog added in v0.0.5

func GCFInsertCatalog(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collcatalog string, r *http.Request) string

catalog post

func GCFInsertContact added in v0.0.9

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

contact post

func GCFInsertHotel added in v0.1.2

func GCFInsertHotel(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collhotel string, r *http.Request) string

hotel post

func GCFInsertKesimpulan added in v0.1.6

func GCFInsertKesimpulan(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collkesimpulan string, r *http.Request) string

kesimpulan post

func GCFInsertRestoran added in v0.1.2

func GCFInsertRestoran(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collrestoran string, r *http.Request) string

restoran post

func GCFInsertWisata added in v0.1.2

func GCFInsertWisata(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collwisata string, r *http.Request) string

wisata post

func GCFReturnStruct added in v0.0.2

func GCFReturnStruct(DataStuct any) string

return struct

func GCFUpdateAbout added in v0.0.6

func GCFUpdateAbout(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collabout string, r *http.Request) string

update about

func GCFUpdateCatalog added in v0.0.2

func GCFUpdateCatalog(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collcatalog string, r *http.Request) string

update catalog

func GCFUpdateHotel added in v0.1.2

func GCFUpdateHotel(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collhotel string, r *http.Request) string

update hotel

func GCFUpdateKesimpulan added in v0.1.6

func GCFUpdateKesimpulan(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collkesimpulan string, r *http.Request) string

update kesimpulan

func GCFUpdateRestoran added in v0.1.2

func GCFUpdateRestoran(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collrestoran string, r *http.Request) string

update restoran

func GCFUpdateWisata added in v0.1.2

func GCFUpdateWisata(publickey, MONGOCONNSTRINGENV, dbname, colladmin, collwisata string, r *http.Request) string

update wisata

func GetAllDataAbouts added in v0.1.3

func GetAllDataAbouts(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string

func GetAllDataCatalogs added in v0.1.1

func GetAllDataCatalogs(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string

func GetAllDataHotels added in v0.1.2

func GetAllDataHotels(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string

func GetAllDataKesimpulans added in v0.1.6

func GetAllDataKesimpulans(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string

func GetAllDataRestorans added in v0.1.2

func GetAllDataRestorans(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string

func GetAllDataWisataa added in v0.1.2

func GetAllDataWisataa(PublicKey, MongoEnv, dbname, colname string, r *http.Request) string

func GetAllDocs

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

crud

func GetOneDataCatalog added in v0.1.7

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

func GetOneDataCatalogs added in v0.2.0

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

func GetOneDataHotel added in v0.2.3

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

func GetOneDataHotels added in v0.2.2

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

func GetOneDataKesimpulan added in v0.2.3

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

func GetOneDataKesimpulans added in v0.2.2

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

func GetOneDataRestoran added in v0.2.3

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

func GetOneDataRestorans added in v0.2.2

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

func GetOneDataWisata added in v0.2.3

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

func GetOneDataWisatas added in v0.2.2

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

func HashPass added in v0.0.5

func HashPass(password string) (string, error)

func InsertAbout added in v0.0.6

func InsertAbout(mongoconn *mongo.Database, collection string, aboutdata About) interface{}

func InsertAdmindata added in v0.0.4

func InsertAdmindata(MongoConn *mongo.Database, email, password, no_whatsapp string) (InsertedID interface{})

func InsertContact added in v0.0.9

func InsertContact(mongoconn *mongo.Database, collection string, contactdata Contact) interface{}

func InsertOneDoc

func InsertOneDoc(db *mongo.Database, collection string, doc interface{}) (insertedID interface{})

func IsExist added in v0.0.8

func IsExist(Tokenstr, PublicKey string) bool

func IsPasswordValid

func IsPasswordValid(mongoconn *mongo.Database, collection string, admindata Admin) bool

func Login added in v0.0.4

func Login(Privatekey, MongoEnv, dbname, Colname string, r *http.Request) string

<--- ini Login & Register Admin --->

func LoginWA added in v0.1.4

func LoginWA(token, Privatekey, MongoEnv, dbname, Colname string, r *http.Request) string

func MongoCreateConnection added in v0.0.5

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

func ReturnStringStruct added in v0.0.4

func ReturnStringStruct(Data any) string

func SetConnection

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

func UpdateOneDoc

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

func UpdatedAbout added in v0.0.6

func UpdatedAbout(mongoconn *mongo.Database, collection string, filter bson.M, aboutdata About) interface{}

func UpdatedCatalog

func UpdatedCatalog(mongoconn *mongo.Database, collection string, filter bson.M, catalogdata Catalog) interface{}

func UpdatedHotel added in v0.1.2

func UpdatedHotel(mongoconn *mongo.Database, collection string, filter bson.M, hoteldata Hotel) interface{}

func UpdatedKesimpulan added in v0.1.6

func UpdatedKesimpulan(mongoconn *mongo.Database, collection string, filter bson.M, kesimpulandata Kesimpulan) interface{}

func UpdatedRestoran added in v0.1.2

func UpdatedRestoran(mongoconn *mongo.Database, collection string, filter bson.M, restorandata Restoran) interface{}

func UpdatedWisata added in v0.1.2

func UpdatedWisata(mongoconn *mongo.Database, collection string, filter bson.M, wisatadata Wisata) interface{}

Types

type About

type About struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"  json:"_id,omitempty" `
	Title       string             `json:"title" bson:"title"`
	Description string             `json:"description" bson:"description"`
	Image       string             `json:"image" bson:"image"`
	Status      bool               `json:"status" bson:"status"`
}

func GetAllAbout added in v0.0.6

func GetAllAbout(mongoconn *mongo.Database, collection string) []About

type Admin

type Admin struct {
	Email       string `json:"email" bson:"email"`
	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"`
	Public      string `json:"public,omitempty" bson:"public,omitempty"`
	No_whatsapp string `json:"no_whatsapp,omitempty" bson:"no_whatsapp,omitempty"`
}

func FindAdmin added in v0.0.5

func FindAdmin(mongoconn *mongo.Database, collection string, admindata Admin) Admin

func GetAllCatalogs added in v0.0.9

func GetAllCatalogs(MongoConn *mongo.Database, colname string, email string) []Admin

func GetOneAdmin added in v0.0.5

func GetOneAdmin(MongoConn *mongo.Database, colname string, admindata Admin) Admin

type Catalog

type Catalog struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"  json:"_id,omitempty" `
	Nomorid     int                `json:"nomorid" bson:"nomorid"`
	Title       string             `json:"title" bson:"title"`
	Description string             `json:"description" bson:"description"`
	Lokasi      string             `json:"lokasi" bson:"lokasi"`
	Image       string             `json:"image" bson:"image"`
	Status      bool               `json:"status" bson:"status"`
}

func GetAllCatalog

func GetAllCatalog(mongoconn *mongo.Database, collection string) []Catalog

func GetAllCatalogID

func GetAllCatalogID(mongoconn *mongo.Database, collection string, catalogdata Catalog) Catalog

func GetCatalogFromID added in v0.1.7

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

func GetCatalogFromIDs added in v0.2.0

func GetCatalogFromIDs(db *mongo.Database, col string, _id int) (*Catalog, error)

type Contact

type Contact struct {
	ID       primitive.ObjectID `bson:"_id,omitempty"  json:"_id,omitempty" `
	FullName string             `json:"fullname" bson:"fullname"`
	Email    string             `json:"email" bson:"email"`
	Phone    string             `json:"phone" bson:"phone"`
	Message  string             `json:"image" bson:"image"`
	Status   bool               `json:"status" bson:"status"`
}

func GetAllContact added in v0.0.6

func GetAllContact(mongoconn *mongo.Database, collection string) []Contact

func GetIdContact added in v0.0.6

func GetIdContact(mongoconn *mongo.Database, collection string, contactdata Contact) Contact

type Crawling added in v0.1.0

type Crawling struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"  json:"_id,omitempty" `
	Created_at string             `json:"created_at" bson:"created_at"`
	Full_text  string             `json:"full_text" bson:"full_text"`
	Username   string             `json:"username" bson:"username"`
	Location   string             `json:"location" bson:"location"`
}

func GetAllCrawling added in v0.1.0

func GetAllCrawling(mongoconn *mongo.Database, collection string) []Crawling

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"`
	Data    []Catalog    `bson:"data,omitempty" json:"data,omitempty"`
	Datak   []Kesimpulan `bson:"datak,omitempty" json:"datak,omitempty"`
	Dataw   []Wisata     `bson:"dataw,omitempty" json:"dataw,omitempty"`
	Datar   []Restoran   `bson:"datar,omitempty" json:"datar,omitempty"`
	Datah   []Hotel      `bson:"datah,omitempty" json:"datah,omitempty"`
}

type Hotel added in v0.0.2

type Hotel struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"  json:"_id,omitempty" `
	Nomorid     int                `json:"nomorid" bson:"nomorid"`
	Title       string             `json:"title" bson:"title"`
	Description string             `json:"description" bson:"description"`
	Lokasi      string             `json:"lokasi" bson:"lokasi"`
	Image       string             `json:"image" bson:"image"`
	Status      bool               `json:"status" bson:"status"`
}

func GetAllHotel added in v0.1.2

func GetAllHotel(mongoconn *mongo.Database, collection string) []Hotel

func GetAllHotelID added in v0.1.2

func GetAllHotelID(mongoconn *mongo.Database, collection string, hoteldata Hotel) Hotel

func GetHotelFromID added in v0.2.3

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

func GetHotelFromIDs added in v0.2.2

func GetHotelFromIDs(db *mongo.Database, col string, _id int) (*Hotel, error)

type Kesimpulan added in v0.1.6

type Kesimpulan struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"  json:"_id,omitempty" `
	Nomorid     int                `json:"nomorid" bson:"nomorid"`
	Ticket      string             `json:"ticket" bson:"ticket"`
	Parkir      string             `json:"parkir" bson:"parkir"`
	Jarak       string             `json:"jarak" bson:"jarak"`
	Pemandangan string             `json:"pemandangan" bson:"pemandangan"`
	Kelebihan   string             `json:"kelebihan" bson:"kelebihan"`
	Kekurangan  string             `json:"kekurangan" bson:"kekurangan"`
	Status      bool               `json:"status" bson:"status"`
}

func GetAllKesimpulan added in v0.1.6

func GetAllKesimpulan(mongoconn *mongo.Database, collection string) []Kesimpulan

func GetAllKesimpulanID added in v0.1.6

func GetAllKesimpulanID(mongoconn *mongo.Database, collection string, kesimpulandata Kesimpulan) Kesimpulan

func GetKesimpulanFromID added in v0.2.3

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

func GetKesimpulanFromIDs added in v0.2.2

func GetKesimpulanFromIDs(db *mongo.Database, col string, _id int) (*Kesimpulan, error)

type Payload

type Payload struct {
	Admin      string    `json:"admin"`
	Catalog    string    `json:"catalog"`
	Wisata     string    `json:"wisata"`
	Hotel      string    `json:"hotel"`
	Restoran   string    `json:"restoran"`
	About      string    `json:"about"`
	Kesimpulan string    `json:"kesimpulan"`
	Role       string    `json:"role"`
	Exp        time.Time `json:"exp"`
	Iat        time.Time `json:"iat"`
	Nbf        time.Time `json:"nbf"`
}

func Decoder added in v0.0.9

func Decoder(publickey, tokenstr string) (payload Payload, err error)

<--- paseto encoder ---> pengecekantoken

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 added in v0.0.2

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

type Restoran added in v0.0.2

type Restoran struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"  json:"_id,omitempty" `
	Nomorid     int                `json:"nomorid" bson:"nomorid"`
	Title       string             `json:"title" bson:"title"`
	Description string             `json:"description" bson:"description"`
	Lokasi      string             `json:"lokasi" bson:"lokasi"`
	Image       string             `json:"image" bson:"image"`
	Status      bool               `json:"status" bson:"status"`
}

func GetAllRestoran added in v0.1.2

func GetAllRestoran(mongoconn *mongo.Database, collection string) []Restoran

func GetAllRestoranID added in v0.1.2

func GetAllRestoranID(mongoconn *mongo.Database, collection string, restorandata Restoran) Restoran

func GetRestoranFromID added in v0.2.3

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

func GetRestoranFromIDs added in v0.2.2

func GetRestoranFromIDs(db *mongo.Database, col string, _id int) (*Restoran, error)

type Wisata added in v0.1.2

type Wisata struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"  json:"_id,omitempty" `
	Nomorid     int                `json:"nomorid" bson:"nomorid"`
	Title       string             `json:"title" bson:"title"`
	Description string             `json:"description" bson:"description"`
	Lokasi      string             `json:"lokasi" bson:"lokasi"`
	Image       string             `json:"image" bson:"image"`
	Status      bool               `json:"status" bson:"status"`
}

func GetAllWisata added in v0.1.2

func GetAllWisata(mongoconn *mongo.Database, collection string) []Wisata

func GetAllWisataID added in v0.1.2

func GetAllWisataID(mongoconn *mongo.Database, collection string, wisatadata Wisata) Wisata

func GetWisataFromID added in v0.2.3

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

func GetWisataFromIDs added in v0.2.2

func GetWisataFromIDs(db *mongo.Database, col string, _id int) (*Wisata, error)

Jump to

Keyboard shortcuts

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