BEGis

package module
v1.0.6 Latest Latest
Warning

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

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

README

Update Library GISWisataBandung

go get -u all
go mod tidy
git tag                                 #cek riwayat versi tag
git tag v1.1.0                          #set versi tag
git push origin --tags                  #push tag version ke repo
go list -m projectanda/example.com@v1.1.0   #publish ke PKG go Dev

go get projectanda/example.com@v1.1.0 #Jika ingin Menggunakan Package atau library

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Privatekey = "" /* 128-byte string literal not displayed */

Functions

func AuthenticateUserAndGenerateToken added in v1.0.6

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

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func CreateComment added in v1.0.6

func CreateComment(mongoconn *mongo.Database, collection string, commentdata Comment) interface{}

func CreateLogin added in v1.0.6

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

create login using Private

func CreateNewBlog added in v1.0.6

func CreateNewBlog(mongoconn *mongo.Database, collection string, blogdata Blog) interface{}

func CreateNewContent added in v1.0.6

func CreateNewContent(mongoconn *mongo.Database, collection string, contentdata Content) interface{}

content

func CreateNewProduct

func CreateNewProduct(mongoconn *mongo.Database, collection string, productdata Product) interface{}

func CreateNewUserRole

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

func CreateUserAndAddToken added in v1.0.6

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 CreateWisata added in v1.0.4

func CreateWisata(MONGOCONNSTRING, dbname, collectionname string, tempat TempatWisata) error

func DeleteComment added in v1.0.6

func DeleteComment(mongoconn *mongo.Database, collection string, commentdata Comment) interface{}

func DeleteContent added in v1.0.6

func DeleteContent(mongoconn *mongo.Database, collection string, contentdata Content) interface{}

func DeleteLinestring added in v1.0.6

func DeleteLinestring(mongoconn *mongo.Database, collection string, linestringdata GeoJsonLineString) interface{}

func DeleteUser

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

func DeleteWisata added in v1.0.4

func DeleteWisata(MONGOCONNSTRING, dbname, collectionname string, filter bson.D) error

func GCFCreateContent added in v1.0.6

func GCFCreateContent(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 GCFCreateLineStringgg added in v1.0.6

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

func GCFCreateNewBlog added in v1.0.6

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

func GCFCreatePolygone added in v1.0.6

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

func GCFCreatePolygonee added in v1.0.6

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

func GCFCreatePostLineString added in v1.0.6

func GCFCreatePostLineString(MONGOCONNSTRINGENV, dbname, collection string, r *http.Request) string

func GCFCreatePostLineStringg added in v1.0.6

func GCFCreatePostLineStringg(MONGOCONNSTRINGENV, dbname, collection string, r *http.Request) string

func GCFCreateProduct

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

func GCFCreateTokenAndSaveToDB added in v1.0.6

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

func GCFCreteCommnet added in v1.0.6

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

func GCFCreteRegister added in v1.0.6

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

func GCFDeleteHandler

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

func GCFDeleteHandlerContent added in v1.0.6

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

func GCFDeleteLineString added in v1.0.6

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

func GCFDeletedCommnet added in v1.0.6

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

func GCFFindBlogAllID added in v1.0.6

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

func GCFFindContentAllID added in v1.0.6

func GCFFindContentAllID(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 GCFGetAllBlog added in v1.0.6

func GCFGetAllBlog(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GCFGetAllComment added in v1.0.6

func GCFGetAllComment(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GCFGetAllProduct

func GCFGetAllProduct(MONGOCONNSTRINGENV, dbname, collectionname string) string

product

func GCFHandler

func GCFHandler(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GCFLoginAfterCreate added in v1.0.6

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

func GCFLoginAfterCreatee added in v1.0.6

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

func GCFLoginAfterCreateee added in v1.0.6

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

func GCFLoginAfterCreateeee added in v1.0.6

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

func GCFLoginAfterCreater added in v1.0.6

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

func GCFLoginTest

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

func GCFNearestRoadHandler

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

Handler untuk endpoint jalan terdekat

func GCFPoint added in v1.0.6

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

func GCFPostHandler

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

func GCFPostHandlerSIGN added in v1.0.3

func GCFPostHandlerSIGN(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request, w http.ResponseWriter)

func GCFReturnStruct

func GCFReturnStruct(DataStuct any) string

func GCFRouteHandler

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

Handler untuk endpoint jalur Handler untuk endpoint jalur

func GCFUpdateHandler

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

func GCFUpdateLinestring added in v1.0.6

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

func GCFUpdatedContent added in v1.0.6

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

func GCFlineStingCreate added in v1.0.6

func GCFlineStingCreate(MONGOCONNSTRINGENV, dbname, collection string, r *http.Request) string

func GCFlineStingCreatea added in v1.0.6

func GCFlineStingCreatea(MONGOCONNSTRINGENV, dbname, collection string, r *http.Request) string

func GFCPostHandlerUser

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

func GFCUpadatedCommnet added in v1.0.6

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

func HashPassword

func HashPassword(password string) (string, error)

func InsertDataUserGCF added in v1.0.6

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

func InsertOneDoc added in v1.0.6

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

func InsertUserdata added in v1.0.6

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

func IsPasswordValid

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

func LoginHandler added in v1.0.2

func LoginHandler(w http.ResponseWriter, r *http.Request)

func PostLineString added in v1.0.6

func PostLineString(mongoconn *mongo.Database, collection string, commentdata GeoJsonLineString) interface{}

func PostLinestring added in v1.0.6

func PostLinestring(mongoconn *mongo.Database, collection string, linestringdata GeoJsonLineString) interface{}

func PostPoint added in v1.0.6

func PostPoint(mongoconn *mongo.Database, collection string, pointdata GeometryPoint) interface{}

func PostPolygone added in v1.0.6

func PostPolygone(mongoconn *mongo.Database, collection string, polygonedata GeoJsonPolygon) interface{}

func RegisterLoginRoutes added in v1.0.2

func RegisterLoginRoutes()

func ReplaceContent added in v1.0.6

func ReplaceContent(mongoconn *mongo.Database, collection string, filter bson.M, contentdata Content) interface{}

func ReplaceOneDoc

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

func SetConnection

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

func TestAllProduct

func TestAllProduct(t *testing.T)

func TestCreateNewUserRole

func TestCreateNewUserRole(t *testing.T)

func TestCreateNewUserToken

func TestCreateNewUserToken(t *testing.T)

func TestDeleteUser

func TestDeleteUser(t *testing.T)

func TestFindUser

func TestFindUser(t *testing.T)

func TestFunciionUser

func TestFunciionUser(t *testing.T)

func TestGFCPostHandlerUser

func TestGFCPostHandlerUser(t *testing.T)

func TestGeneratePasswordHash

func TestGeneratePasswordHash(t *testing.T)

func TestGeneratePasswordHashh

func TestGeneratePasswordHashh(t *testing.T)

func TestGeneratePrivateKeyPaseto

func TestGeneratePrivateKeyPaseto(t *testing.T)

func TestHashFunction

func TestHashFunction(t *testing.T)

func TestHashFunctionn

func TestHashFunctionn(t *testing.T)

func TestIsPasswordValid

func TestIsPasswordValid(t *testing.T)

func TestProduct

func TestProduct(t *testing.T)

func TestUpdateGetData

func TestUpdateGetData(t *testing.T)

func UpdateWisata added in v1.0.4

func UpdateWisata(MONGOCONNSTRING, dbname, collectionname string, filter bson.D, update bson.D) error

func UpdatedComment added in v1.0.6

func UpdatedComment(mongoconn *mongo.Database, collection string, filter bson.M, commentdata Comment) interface{}

func UpdatedLinestring added in v1.0.6

func UpdatedLinestring(mongoconn *mongo.Database, collection string, filter bson.M, linestringdata GeoJsonLineString) interface{}

Types

type About added in v1.0.6

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

type Blog added in v1.0.6

type Blog struct {
	ID          int       `json:"id" bson:"id"`
	Title       string    `json:"title" bson:"title"`
	Tanggal     string    `json:"tanggal" bson:"tanggal"`
	Description string    `json:"judul" bson:"judul"`
	Content     []Content `json:"content" bson:"content"`
}

func GetAllBlogAll added in v1.0.6

func GetAllBlogAll(mongoconn *mongo.Database, collection string) []Blog

func GetIDBlog added in v1.0.6

func GetIDBlog(mongoconn *mongo.Database, collection string, blogdata Blog) Blog

type Category added in v1.0.6

type Category struct {
	Category []string `json:"category" bson:"category"`
}

type Comment added in v1.0.6

type Comment struct {
	ID        int    `json:"id" bson:"id"`
	Username  string `json:"username" bson:"username"`
	Answer    string `json:"comment" bson:"comment"`
	Questions string `json:"questions" bson:"questions"`
	Tanggal   string `json:"tanggal" bson:"tanggal"`
}

func GetAllComment added in v1.0.6

func GetAllComment(mongoconn *mongo.Database, collection string) []Comment

type Contack added in v1.0.6

type Contack struct {
	ID      int    `json:"id" bson:"id"`
	Name    string `json:"title" bson:"title"`
	Subject string `json:"description" bson:"description"`
	Message string `json:"image" bson:"image"`
	Email   string `json:"email" bson:"email"`
	Phone   string `json:"phone" bson:"phone"`
}

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 Event added in v1.0.6

type Event struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Tanggal     string `json:"tanggal" bson:"tanggal"`
	Image       string `json:"image" bson:"image"`
	Harga       int    `json:"harga" bson:"harga"`
	LinkYoutube string `json:"linkyoutube" bson:"linkyoutube"`
}

type EventGlobal added in v1.0.6

type EventGlobal struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Tanggal     string `json:"tanggal" bson:"tanggal"`
	Image       string `json:"image" bson:"image"`
	Harga       int    `json:"harga" bson:"harga"`
}
type Gallery 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 GeoJson

type GeoJson struct {
	Type       string     `json:"type" bson:"type"`
	Properties Properties `json:"properties" bson:"properties"`
	Geometry   Geometry   `json:"geometry" bson:"geometry"`
}

func GetAllBangunanLineString

func GetAllBangunanLineString(mongoconn *mongo.Database, collection string) []GeoJson

type GeoJsonLineString

type GeoJsonLineString struct {
	Type       string             `json:"type" bson:"type"`
	Properties Properties         `json:"properties" bson:"properties"`
	Geometry   GeometryLineString `json:"geometry" bson:"geometry"`
}

func FindNearestRoad

func FindNearestRoad(mconn *mongo.Database, collectionname string, coordinates []float64) GeoJsonLineString

Fungsi untuk mencari jalan terdekat

func FindRoute

func FindRoute(mconn *mongo.Database, collectionname string, startGeometry, endGeometry GeometryLineString) []GeoJsonLineString

Fungsi untuk mencari jalur dari jalan awal ke jalan akhir Fungsi untuk mencari jalur dari jalan awal ke jalan akhir

func GetByCoordinate added in v1.0.6

func GetByCoordinate(mongoconn *mongo.Database, collection string, linestringdata GeoJsonLineString) GeoJsonLineString

type GeoJsonPolygon

type GeoJsonPolygon struct {
	Type       string          `json:"type" bson:"type"`
	Properties Properties      `json:"properties" bson:"properties"`
	Geometry   GeometryPolygon `json:"geometry" bson:"geometry"`
}

type Geometry

type Geometry struct {
	Coordinates interface{} `json:"coordinates" bson:"coordinates"`
	Type        string      `json:"type" bson:"type"`
}

type GeometryLineString

type GeometryLineString struct {
	Coordinates [][]float64 `json:"coordinates" bson:"coordinates"`
	Type        string      `json:"type" bson:"type"`
}

type GeometryPoint

type GeometryPoint struct {
	Coordinates []float64 `json:"coordinates" bson:"coordinates"`
	Type        string    `json:"type" bson:"type"`
}

type GeometryPolygon

type GeometryPolygon struct {
	Coordinates [][][]float64 `json:"coordinates" bson:"coordinates"`
	Type        string        `json:"type" bson:"type"`
}

type Iklan added in v1.0.6

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 Lokasi added in v1.0.4

type Lokasi struct {
	Type        string    `json:"type"`
	Coordinates []float64 `json:"coordinates"`
}

type Product

type Product struct {
	Nomorid     int    `json:"nomorid" bson:"nomorid"`
	Name        string `json:"name" bson:"name"`
	Description string `json:"description" bson:"description"`
	Price       int    `json:"price" bson:"price"`
	Stock       int    `json:"stock" bson:"stock"`
	Size        string `json:"size" bson:"size"`
	Image       string `json:"image" bson:"image"`
}

func GetAllProduct

func GetAllProduct(mongoconn *mongo.Database, collection string) []Product

type Properties

type Properties struct {
	Name string `json:"name" bson:"name"`
}

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 v1.0.6

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

type Share added in v1.0.6

type Share struct {
	Share []string `json:"share" bson:"share"`
}

type Tags added in v1.0.6

type Tags struct {
	Tags []string `json:"tags" bson:"tags"`
}

type TempatWisata added in v1.0.4

type TempatWisata struct {
	Nama      string  `json:"nama"`
	Jenis     string  `json:"jenis"`
	Deskripsi string  `json:"deskripsi"`
	Lokasi    Lokasi  `json:"lokasi"`
	Alamat    string  `json:"alamat"`
	Gambar    string  `json:"gambar"`
	Rating    float64 `json:"rating"`
}

func ReadWisata added in v1.0.4

func ReadWisata(MONGOCONNSTRING, dbname, collectionname string) ([]TempatWisata, error)

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 added in v1.0.6

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

func FindUserUser

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

func GetAllUser

func GetAllUser(mongoconn *mongo.Database, collection string) []User

func GetNameAndPassowrd

func GetNameAndPassowrd(mongoconn *mongo.Database, collection string) []User

type Userss added in v1.0.2

type Userss struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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