pasetobackendpasabar

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 14 Imported by: 0

README

pasetobackendpasabar

hasil mongo Alt text

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash added in v0.0.2

func CheckPasswordHash(password, hash string) bool

func CreateAbout added in v0.0.7

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

func CreateCatalog added in v0.0.6

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

catalog function

func CreateContact added in v0.0.7

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

func CreateHotelResto added in v0.0.7

func CreateHotelResto(mongoconn *mongo.Database, collection string, hotelrestodata HotelResto) interface{}

func CreateNewCatalog added in v0.0.6

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

catalog

func CreateNewUserRole added in v0.0.2

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

func CreateTour added in v0.0.7

func CreateTour(mongoconn *mongo.Database, collection string, tourdata Tour) interface{}

func CreateUser added in v0.0.2

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

crud paseto

func CreateUserAndAddToken added in v0.0.2

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

func DeleteAbout added in v0.0.7

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

func DeleteCatalog added in v0.0.6

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

func DeleteContact added in v0.0.7

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

func DeleteHotelResto added in v0.0.7

func DeleteHotelResto(mongoconn *mongo.Database, collection string, hotelrestodata HotelResto) interface{}

func DeleteTour added in v0.0.7

func DeleteTour(mongoconn *mongo.Database, collection string, tourdata Tour) interface{}

func DeleteUser added in v0.0.2

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

func Encode added in v0.0.8

func Encode(id primitive.ObjectID, role, privateKey string) (string, error)

encode

func GCFCreateAbout added in v0.0.7

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

about post

func GCFCreateCatalog added in v0.0.6

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

catalog post

func GCFCreateContact added in v0.0.7

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

contact post

func GCFCreateHandler added in v0.0.2

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

func GCFCreateHotelResto added in v0.0.7

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

hotelresto post

func GCFCreateTour added in v0.0.7

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

tour post

func GCFDeleteAbout added in v0.0.7

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

delete about

func GCFDeleteCatalog added in v0.0.6

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

delete catalog

func GCFDeleteContact added in v0.0.7

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

delete contact

func GCFDeleteHandler added in v0.0.2

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

func GCFDeleteHotelResto added in v0.0.7

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

delete hotelresto

func GCFDeleteTour added in v0.0.7

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

delete tour

func GCFFindUserByID added in v0.0.2

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

func GCFFindUserByName added in v0.0.2

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

func GCFGetAllAbout added in v0.0.7

func GCFGetAllAbout(MONGOCONNSTRINGENV, dbname, collectionname string) string

get all about

func GCFGetAllCatalog added in v0.0.6

func GCFGetAllCatalog(MONGOCONNSTRINGENV, dbname, collectionname string) string

get all catalog

func GCFGetAllCatalogID added in v0.0.7

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

get all catalog by id

func GCFGetAllContact added in v0.0.7

func GCFGetAllContact(MONGOCONNSTRINGENV, dbname, collectionname string) string

get all contact

func GCFGetAllContactID added in v0.0.7

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

get all contact by id

func GCFGetAllHotelResto added in v0.0.7

func GCFGetAllHotelResto(MONGOCONNSTRINGENV, dbname, collectionname string) string

get all hotelresto

func GCFGetAllHotelRestoID added in v0.0.7

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

get all hotelresto by id

func GCFGetAllTour added in v0.0.7

func GCFGetAllTour(MONGOCONNSTRINGENV, dbname, collectionname string) string

get all tour

func GCFGetAllTourID added in v0.0.7

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

get all tour by id

func GCFLoginTest added in v0.0.2

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

func GCFPostHandler added in v0.0.2

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

func GCFReturnStruct added in v0.0.2

func GCFReturnStruct(DataStuct any) string

return struct

func GCFUpdateAbout added in v0.0.7

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

update about

func GCFUpdateCatalog added in v0.0.6

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

update catalog

func GCFUpdateContact added in v0.0.7

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

update contact

func GCFUpdateHandler added in v0.0.2

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

func GCFUpdateHotelResto added in v0.0.7

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

update hotelresto

func GCFUpdateTour added in v0.0.7

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

update tour

func GFCPostHandlerUser added in v0.0.2

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

func GenerateKey added in v0.0.8

func GenerateKey() (privateKey, publicKey string)

func GetConnectionMongo added in v0.0.3

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

func GetID added in v0.0.8

func GetID(r *http.Request) string

get id

func HashPassword added in v0.0.2

func HashPassword(password string) (string, error)

func InsertOneDoc

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

func InsertUser added in v0.0.4

func InsertUser(db *mongo.Database, collection string, userdata User) string

func InsertUserdata

func InsertUserdata(MongoConn *mongo.Database, username, role, password string) (InsertedID interface{})

func IsPasswordValid added in v0.0.2

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

func Login added in v0.0.3

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

func MongoConnect added in v0.0.8

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

mongo

func Register added in v0.0.3

func Register(Mongoenv, dbname string, r *http.Request) string

func ReplaceOneDoc added in v0.0.2

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

func ReturnStringStruct

func ReturnStringStruct(Data any) string

func SetConnection added in v0.0.2

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

func UpdatedAbout added in v0.0.7

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

func UpdatedCatalog added in v0.0.6

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

func UpdatedContact added in v0.0.7

func UpdatedContact(mongoconn *mongo.Database, collection string, filter bson.M, contactdata Contact) interface{}

func UpdatedHotelResto added in v0.0.7

func UpdatedHotelResto(mongoconn *mongo.Database, collection string, filter bson.M, hotelrestodata HotelResto) interface{}

func UpdatedTour added in v0.0.7

func UpdatedTour(mongoconn *mongo.Database, collection string, filter bson.M, tourdata Tour) interface{}

Types

type About added in v0.0.7

type About 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"`
	Status      bool   `json:"status" bson:"status"`
}

func GetAllAbout added in v0.0.7

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

func GetIDAbout added in v0.0.7

func GetIDAbout(mongoconn *mongo.Database, collection string, aboutdata About) About

type Catalog added in v0.0.6

type Catalog struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" `
	Nomorid     int                `json:"nomorid" bson:"nomorid"`
	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 GetAllCatalog added in v0.0.6

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

func GetAllCatalogID added in v0.0.6

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

type Contact added in v0.0.7

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

func GetAllContact added in v0.0.7

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

func GetIdContact added in v0.0.7

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

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

type HotelResto 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"`
	Catalog     []Catalog `json:"catalog" bson:"catalog"`
	Rating      string    `json:"rating" bson:"rating"`
	Status      bool      `json:"status" bson:"status"`
}

func GetAllHotelResto added in v0.0.7

func GetAllHotelResto(mongoconn *mongo.Database, collection string) []HotelResto

func GetAllHotelRestoId added in v0.0.7

func GetAllHotelRestoId(mongoconn *mongo.Database, collection string, hotelrestodata HotelResto) []HotelResto

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

func Decode(publicKey string, tokenstring string) (payload Payload, err error)

func GetUserLogin added in v0.0.8

func GetUserLogin(PASETOPUBLICKEYENV string, r *http.Request) (Payload, error)

get user login

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

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"`
	Catalog     []Catalog `json:"catalog" bson:"catalog"`
	Rating      string    `json:"rating" bson:"rating"`
	Status      bool      `json:"status" bson:"status"`
}

func GetAllTour added in v0.0.7

func GetAllTour(mongoconn *mongo.Database, collection string) []Tour

func GetAllTourId added in v0.0.7

func GetAllTourId(mongoconn *mongo.Database, collection string, tourdata Tour) []Tour

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"`
	Email    string `bson:"email,omitempty" json:"email,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"`
}

func FindUser added in v0.0.2

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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