Documentation ¶
Index ¶
- func AmbilDataGeojson(mongoenv, dbname, collname string, r *http.Request) string
- func Box(mconn *mongo.Database, collname string, coordinates Polyline) string
- func Center(mconn *mongo.Database, collname string, coordinates Point) string
- func CenterSphere(mconn *mongo.Database, collname string, coordinates Point) string
- func Create2dsphere(mconn DBInfo) (db *mongo.Database)
- func DeleteDoc(db *mongo.Database, collection string, filter bson.M) (result *mongo.DeleteResult)
- func DeleteGeojson(mconn *mongo.Database, collname string, userdata User) interface{}
- func DeleteOneDoc(db *mongo.Database, collection string, filter bson.M) (result *mongo.DeleteResult)
- func DocExists[T any](db *mongo.Database, collname string, filter bson.M, doc T) (result bool)
- func GeoIntersects(mconn *mongo.Database, collname string, coordinates Point) string
- func GeoWithin(mconn *mongo.Database, collname string, coordinates Polygon) string
- func GetAllDistinctDoc(db *mongo.Database, filter bson.M, fieldname, collection string) (doc []any)
- func GetAllDoc[T any](db *mongo.Database, collection string) (doc T)
- func GetAllDocByFilter[T any](db *mongo.Database, collection string, filter bson.M) (doc T)
- func GetBoxDoc(db *mongo.Database, collname string, coordinates Polyline) (result string)
- func GetCenterDoc(db *mongo.Database, collname string, coordinates Point) (result string)
- func GetCenterSphereDoc(db *mongo.Database, collname string, coordinates Point) (result string)
- func GetGeoIntersectsDoc(db *mongo.Database, collname string, coordinates Point) (result string)
- func GetGeoWithinDoc(db *mongo.Database, collname string, coordinates Polygon) (result string)
- func GetNearDoc(db *mongo.Database, collname string, coordinates Point) (result string)
- func GetNearSphereDoc(db *mongo.Database, collname string, coordinates Point) (result string)
- func GetOneDoc[T any](db *mongo.Database, collection string, filter bson.M) (doc T)
- func GetOneLatestDoc[T any](db *mongo.Database, collection string, filter bson.M) (doc T, err error)
- func GetRandomDoc[T any](db *mongo.Database, collection string, size uint) (result []T, err error)
- func InsertOneDoc(db *mongo.Database, collection string, doc interface{}) (insertedID interface{})
- func MembuatGeojsonPoint(mongoenv, dbname, collname string, r *http.Request) string
- func MembuatGeojsonPolygon(mongoenv, dbname, collname string, r *http.Request) string
- func MembuatGeojsonPolyline(mongoenv, dbname, collname string, r *http.Request) string
- func MongoConnect(mconn DBInfo) (db *mongo.Database)
- func Near(mconn *mongo.Database, collname string, coordinates Point) string
- func NearSphere(mconn *mongo.Database, collname string, coordinates Point) string
- func PostBox(mongoenv, dbname, collname string, r *http.Request) string
- func PostCenter(mongoenv, dbname, collname string, r *http.Request) string
- func PostGeoIntersects(mongoenv, dbname, collname string, r *http.Request) string
- func PostGeoWithin(mongoenv, dbname, collname string, r *http.Request) string
- func PostLinestring(mconn *mongo.Database, collection string, linestringdata GeoJsonLineString) interface{}
- func PostNear(mongoenv, dbname, collname string, r *http.Request) string
- func PostNearSphere(mongoenv, dbname, collname string, r *http.Request) string
- func PostPoint(mconn *mongo.Database, collection string, pointdata GeoJsonPoint) interface{}
- func PostPolygon(mconn *mongo.Database, collection string, polygondata GeoJsonPolygon) interface{}
- func ReplaceOneDoc(db *mongo.Database, collection string, filter bson.M, doc interface{}) (updatereseult *mongo.UpdateResult)
- func ReturnStruct(DataStuct any) string
- func SetConnection(mongoenv, dbname string) *mongo.Database
- func SetConnection2dsphere(mongoenv, dbname, collname string) *mongo.Database
- type CredentialUser
- type DBInfo
- type FullGeoJson
- type GeoJson
- type GeoJsonLineString
- type GeoJsonPoint
- type GeoJsonPolygon
- type Geometry
- type LongLat
- type Payload
- type Pesan
- type Point
- type Polygon
- type Polyline
- type Properties
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AmbilDataGeojson ¶
func CenterSphere ¶
func Create2dsphere ¶
func DeleteGeojson ¶
func DeleteOneDoc ¶
func GeoIntersects ¶
func GetAllDistinctDoc ¶
func GetAllDocByFilter ¶
func GetCenterDoc ¶
func GetCenterSphereDoc ¶
func GetGeoIntersectsDoc ¶
func GetGeoWithinDoc ¶
func GetNearDoc ¶
func GetNearSphereDoc ¶
func GetOneLatestDoc ¶
func GetRandomDoc ¶
func InsertOneDoc ¶
func MembuatGeojsonPoint ¶
func MembuatGeojsonPolygon ¶
func MembuatGeojsonPolyline ¶
func MongoConnect ¶
func PostGeoIntersects ¶
func PostLinestring ¶
func PostLinestring(mconn *mongo.Database, collection string, linestringdata GeoJsonLineString) interface{}
func PostNearSphere ¶
func PostPoint ¶
func PostPoint(mconn *mongo.Database, collection string, pointdata GeoJsonPoint) interface{}
func PostPolygon ¶
func PostPolygon(mconn *mongo.Database, collection string, polygondata GeoJsonPolygon) interface{}
func ReplaceOneDoc ¶
func ReturnStruct ¶
func SetConnection ¶
func SetConnection2dsphere ¶
Types ¶
type CredentialUser ¶
type CredentialUser struct { Status bool `json:"status" bson:"status"` Data struct { Name string `json:"name" bson:"name"` Username string `json:"username" bson:"username"` Role string `json:"role" bson:"role"` } `json:"data" bson:"data"` Message string `json:"message,omitempty" bson:"message,omitempty"` }
type FullGeoJson ¶
type FullGeoJson struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` Type string `json:"type" bson:"type"` Properties Properties `json:"properties" bson:"properties"` Geometry Geometry `json:"geometry" bson:"geometry"` }
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 struct { Coordinates [][]float64 `json:"coordinates" bson:"coordinates"` Type string `json:"type" bson:"type"` } `json:"geometry" bson:"geometry"` }
type GeoJsonPoint ¶
type GeoJsonPoint struct { Type string `json:"type" bson:"type"` Properties Properties `json:"properties" bson:"properties"` Geometry struct { Coordinates []float64 `json:"coordinates" bson:"coordinates"` Type string `json:"type" bson:"type"` } `json:"geometry" bson:"geometry"` }
type GeoJsonPolygon ¶
type GeoJsonPolygon struct { Type string `json:"type" bson:"type"` Properties Properties `json:"properties" bson:"properties"` Geometry struct { Coordinates [][][]float64 `json:"coordinates" bson:"coordinates"` Type string `json:"type,omitempty" bson:"type,omitempty"` } `json:"geometry" bson:"geometry"` }
type Geometry ¶
type Geometry struct { Coordinates interface{} `json:"coordinates" bson:"coordinates"` Type string `json:"type" bson:"type"` }
type Polygon ¶
type Polygon struct {
Coordinates [][][]float64 `json:"coordinates" bson:"coordinates"`
}
type Polyline ¶
type Polyline struct {
Coordinates [][]float64 `json:"coordinates" bson:"coordinates"`
}
type Properties ¶
type Properties struct {
Name string `json:"name" bson:"name"`
}
Click to show internal directories.
Click to hide internal directories.