peda

package module
v0.0.0-...-250f05c Latest Latest
Warning

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

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

README

fancy

fancy

go get -u all
go mod tidy
git tag                                 #check current version
git tag v1.28                          #set tag version
git push origin --tags                  #push tag version to repo
go list -m github.com/Fancyyy21/BackendGIS@v1.28   #publish to pkg dev, replace ORG/URL with your repo URL

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmbilDataGeojson

func AmbilDataGeojson(mongoenv, dbname, collname string) string

func AmbilDataGeojsonToken

func AmbilDataGeojsonToken(mongoenv, dbname, collname string, r *http.Request) string

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

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 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 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 GCFCreatePostLineString

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

func GCFCreatePostLineStringg

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

func GCFCreateProduct

func GCFCreateProduct(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 GCFGetAllProduct

func GCFGetAllProduct(MONGOCONNSTRINGENV, dbname, collectionname string) string

product

func GCFHandler

func GCFHandler(MONGOCONNSTRINGENV, dbname, collectionname string) 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 GeoIntersects

func GeoIntersects(mongoconn *mongo.Database, long float64, lat float64) (namalokasi string)

func HashPassword

func HashPassword(password string) (string, error)

func InsertDataUserGCF

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

func InsertOneDoc

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

func InsertUserdata

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

func IsPasswordValid

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

func MemasukkanKoordinat

func MemasukkanKoordinat(MongoConn *mongo.Database, colname string, coordinate []float64, name, volume, tipe string) (InsertedID interface{})

func MembuatGeojsonPoint

func MembuatGeojsonPoint(mongoenv, dbname, collname string, r *http.Request) string

func MembuatGeojsonPointToken

func MembuatGeojsonPointToken(mongoenv, dbname, collname string, r *http.Request) string

func MembuatGeojsonPolygon

func MembuatGeojsonPolygon(mongoenv, dbname, collname string, r *http.Request) string

func MembuatGeojsonPolygonToken

func MembuatGeojsonPolygonToken(mongoenv, dbname, collname string, r *http.Request) string

func MembuatGeojsonPolyline

func MembuatGeojsonPolyline(mongoenv, dbname, collname string, r *http.Request) string

func MembuatGeojsonPolylineToken

func MembuatGeojsonPolylineToken(mongoenv, dbname, collname string, r *http.Request) string

func PostGeoIntersects

func PostGeoIntersects(mongoenv, dbname string, r *http.Request) string

func PostLinestring

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

func PostPoint

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

func PostPolygon

func PostPolygon(mongoconn *mongo.Database, collection string, polygondata GeoJsonPolygon) interface{}

func PostStructWithToken

func PostStructWithToken[T any](tokenkey string, tokenvalue string, structname interface{}, urltarget string) (result T, errormessage string)

func ReplaceOneDoc

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

func ReturnStruct

func ReturnStruct(DataStuct any) string

func SetConnection

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

func SetConnectionTest

func SetConnectionTest(mongoenv, dbname string) *mongo.Database

Types

type Coordinate

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

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

type GeoJsonPoint

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

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 Lokasi

type Lokasi struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"`
	Properties Name               `bson:"properties,omitempty"`
	Geometry   Geometry           `bson:"geometry,omitempty"`
	Kategori   string             `bson:"kategori,omitempty"`
}

type LongLat

type LongLat struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type Name

type Name struct {
	Name string `bson:"name,omitempty"`
}

type Pesan

type Pesan struct {
	Status  bool   `json:"status" bson:"status"`
	Message string `json:"message" bson:"message"`
}

type PostToken

type PostToken struct {
	Response string `json:"response"`
}

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

type Token

type Token struct {
	Key    string
	Values string
}

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 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

Jump to

Keyboard shortcuts

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