peda

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 10 Imported by: 0

README

fancy

fancy

go get -u all
go mod tidy
git tag                                 #check current version
git tag v0.0.28                          #set tag version
git push origin --tags                  #push tag version to repo
go list -m https://github.com/Fancypedia/fancybackend@v0.0.1   #publish to pkg dev, replace ORG/URL with your repo URL
[https://asia-southeast2-testlogin-366704.cloudfunctions.net/updated](https://asia-southeast2-testlogin-366704.cloudfunctions.net/getaaalll -get all
https://asia-southeast2-testlogin-366704.cloudfunctions.net/function-16 -admin khusus
https://asia-southeast2-testlogin-366704.cloudfunctions.net/gislocation -gis tempat penjualan
https://asia-southeast2-testlogin-366704.cloudfunctions.net/post -post ( ini payloadnya {
   " Username": "pakrolly",
		"Password": "ganteng",
		"Role":     "admin"
})
https://us-central1-testlogin-366704.cloudfunctions.net/delete
https://asia-southeast2-testlogin-366704.cloudfunctions.net/updated)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Box

func Box(mongoconn *mongo.Database, long1 float64, lat1 float64, long2 float64, lat2 float64) (namalokasi string)

func Center

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

func CenterSphere

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

func DeleteDoc

func DeleteDoc(db *mongo.Database, collection string, filter bson.M) (result *mongo.DeleteResult)

func DeleteOneDoc

func DeleteOneDoc(db *mongo.Database, collection string, filter bson.M) (result *mongo.DeleteResult)

func GeoIntersects

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

func GeoWithin

func GeoWithin(mongoconn *mongo.Database, coordinates [][][]float64) (namalokasi string)

func GeometryFix

func GeometryFix(mongoconn *mongo.Database, coordinates [][][]float64) (namalokasi string)

func GetAllDistinctDoc

func GetAllDistinctDoc(db *mongo.Database, filter bson.M, fieldname, collection string) (doc []any)

func GetAllDoc

func GetAllDoc[T any](db *mongo.Database, collection string) (doc T)

func GetOneDoc

func GetOneDoc[T any](db *mongo.Database, collection string, filter bson.M) (doc T)

func GetOneLatestDoc

func GetOneLatestDoc[T any](db *mongo.Database, collection string, filter bson.M) (doc T, err error)

func GetRandomDoc

func GetRandomDoc[T any](db *mongo.Database, collection string, size uint) (result []T, err error)

func InsertOneDoc

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

func Json

func Json(DataStuct any) string

func MaxDistance

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

func MinDistance

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

func Near

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

func NearSpehere

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

func Polygon

func Polygon(mongoconn *mongo.Database, coordinates [][][]float64) (namalokasi string)

func PostGeoIntersects

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

func PostGeoWithin

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

func PostNear

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

func ReplaceOneDoc

func ReplaceOneDoc(db *mongo.Database, collection string, filter bson.M, doc interface{}) (updatereseult *mongo.UpdateResult)

func ReturnStruct

func ReturnStruct(DataStuct any) string

func SetConnection

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

func SetConnection2dsphereTest

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

func SetConnection2dsphereTestGeo

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

func SetConnection2dsphereTestPoint

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

Types

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 GeoBorder

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

type GeoJson

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

type GeoJsonLineString

type GeoJsonLineString struct {
	Type       string             `json:"type" bson:"type"`
	Properties Properties         `json:"properties" bson:"properties"`
	Geometry   GeometryLineString `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,omitempty" bson:"type,omitempty"`
}

type Geometryy

type Geometryy struct {
	Type        string      `bson:"type,omitempty"`
	Coordinates [][]float64 `bson:"coordinates,omitempty"`
}

type LocationData

type LocationData struct {
	ID          string    `bson:"_id"`
	Province    string    `bson:"province"`
	District    string    `bson:"district"`
	SubDistrict string    `bson:"sub_district"`
	Village     string    `bson:"village"`
	Border      GeoBorder `bson:"border"`
}

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 Lokasii

type Lokasii struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"`
	Properties Namee              `bson:"properties,omitempty"`
	Geometry   Geometryy          `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 Namee

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

type Pesan

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

type Properties

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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