peda

package module
v1.0.5 Latest Latest
Warning

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

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

README

GeoQuery

Peta Pedia Library Package

ENV Setting

image

Release

go get -u all
go mod tidy
git tag                                 #check current version
git tag v0.0.3                          #set tag version
git push origin --tags                  #push tag version to repo
go list -m github.com/KOCOKERZ/GEOQUERY@v1.0.1   #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 AmbilDataBerita

func AmbilDataBerita(publickey, mongoenv, dbname, colluser, collberita string, r *http.Request) string

func AmbilDataGeojson

func AmbilDataGeojson(publickey, mongoenv, dbname, colluser, collgeojson string, r *http.Request) string

func AmbilDataJadwal

func AmbilDataJadwal(mongoenv, dbname, collname string) string

func AmbilDataKegiatan

func AmbilDataKegiatan(mongoenv, dbname, collname string) string

func AmbilSatuBerita

func AmbilSatuBerita(publickey, mongoenv, dbname, colluser, collberita string, r *http.Request) string

func Authorization

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

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func DeleteBerita

func DeleteBerita(mongoenv *mongo.Database, collname string, databerita Berita) interface{}

func DeleteUser

func DeleteUser(mongoenv *mongo.Database, collname string, userdata User) interface{}

func EditBerita

func EditBerita(mongoenv *mongo.Database, collname string, databerita Berita) interface{}

func EditUser

func EditUser(mongoenv *mongo.Database, collname, name, email, username, password string, admin, author, user bool) interface{}

func GeoIntersects

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

func GeoWithin added in v1.0.2

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

func HapusBerita

func HapusBerita(publickey, mongoenv, dbname, colluser, collberita string, r *http.Request) string

func HapusUser

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

func HashPassword

func HashPassword(password string) (string, error)

func InsertBerita

func InsertBerita(mongoenv *mongo.Database, collname string, databerita Berita) interface{}

func InsertUserdata

func InsertUserdata(mongoenv *mongo.Database, collname, name, email, username, password string, admin, author bool) (InsertedID interface{})

func IsPasswordValid

func IsPasswordValid(mongoenv *mongo.Database, collname string, userdata User) bool

func Login

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

func MemasukkanKoordinat

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

func MembuatGeojsonPoint

func MembuatGeojsonPoint(publickey, mongoenv, dbname, colluser, collgeojson string, r *http.Request) string

func MembuatGeojsonPolygon

func MembuatGeojsonPolygon(publickey, mongoenv, dbname, colluser, collgeojson string, r *http.Request) string

func MembuatGeojsonPolyline

func MembuatGeojsonPolyline(publickey, mongoenv, dbname, colluser, collgeojson string, r *http.Request) string

func Near added in v1.0.5

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

func PostGeoIntersects

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

func PostGeoWithin added in v1.0.2

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

func PostLinestring

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

func PostNear added in v1.0.5

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

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 Registrasi

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

func ReturnStruct

func ReturnStruct(DataStuct any) string

func SetConnection

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

func SetConnection2dsphere added in v1.0.5

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

func SetConnectionTest

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

func SetConnectionTest2dsphere added in v1.0.5

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

func TambahBerita

func TambahBerita(publickey, mongoenv, dbname, colluser, collberita string, r *http.Request) string

func UpdateBerita

func UpdateBerita(publickey, mongoenv, dbname, colluser, collberita string, r *http.Request) string

func UpdateUser

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

Types

type Berita

type Berita struct {
	ID       string   `json:"id" bson:"id"`
	Kategori string   `json:"kategori" bson:"kategori"`
	Judul    string   `json:"judul" bson:"judul"`
	Preview  string   `json:"preview" bson:"preview"`
	Konten   Paragraf `json:"konten" bson:"konten"`
}

func FindBerita

func FindBerita(mongoenv *mongo.Database, collname string, databerita Berita) Berita

func GetAllBerita

func GetAllBerita(mongoenv *mongo.Database, collname string) []Berita

type Coordinate

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

type CredentialBerita

type CredentialBerita struct {
	Status  bool   `json:"status" bson:"status"`
	Data    Berita `json:"data,omitempty" bson:"data,omitempty"`
	Message string `json:"message,omitempty" bson:"message,omitempty"`
	Token   string `json:"token,omitempty" bson:"token,omitempty"`
}

type CredentialGeojson

type CredentialGeojson struct {
	Status  bool    `json:"status" bson:"status"`
	Data    GeoJson `json:"data,omitempty" bson:"data,omitempty"`
	Message string  `json:"message,omitempty" bson:"message,omitempty"`
	Token   string  `json:"token,omitempty" bson:"token,omitempty"`
}

type CredentialUser

type CredentialUser struct {
	Status  bool   `json:"status" bson:"status"`
	Data    User   `json:"data,omitempty" bson:"data,omitempty"`
	Message string `json:"message,omitempty" bson:"message,omitempty"`
	Token   string `json:"token,omitempty" bson:"token,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(mongoenv *mongo.Database, collname 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,omitempty" bson:"type,omitempty"`
}

type Jadwal

type Jadwal struct {
	ID   int    `json:"id" bson:"id"`
	Nama string `json:"nama" bson:"nama"`
	Hari string `json:"hari" bson:"hari"`
	Jam  string `json:"jam" bson:"jam"`
}

func GetAllJadwal

func GetAllJadwal(mongoenv *mongo.Database, collname string) []Jadwal

type Kegiatan

type Kegiatan struct {
	ID      int    `json:"id" bson:"id"`
	Nama    string `json:"nama" bson:"nama"`
	Note    string `json:"note" bson:"note"`
	Tanggal string `json:"tanggal" bson:"tanggal"`
}

func GetAllKegiatan

func GetAllKegiatan(mongoenv *mongo.Database, collname string) []Kegiatan

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 Paragraf

type Paragraf struct {
	Paragraf1  string `json:"paragraf1,omitempty" bson:"paragraf1,omitempty"`
	Paragraf2  string `json:"paragraf2,omitempty" bson:"paragraf2,omitempty"`
	Paragraf3  string `json:"paragraf3,omitempty" bson:"paragraf3,omitempty"`
	Paragraf4  string `json:"paragraf4,omitempty" bson:"paragraf4,omitempty"`
	Paragraf5  string `json:"paragraf5,omitempty" bson:"paragraf5,omitempty"`
	Paragraf6  string `json:"paragraf6,omitempty" bson:"paragraf6,omitempty"`
	Paragraf7  string `json:"paragraf7,omitempty" bson:"paragraf7,omitempty"`
	Paragraf8  string `json:"paragraf8,omitempty" bson:"paragraf8,omitempty"`
	Paragraf9  string `json:"paragraf9,omitempty" bson:"paragraf9,omitempty"`
	Paragraf10 string `json:"paragraf10,omitempty" bson:"paragraf10,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 SemuaRole

type SemuaRole struct {
	Admin  bool `json:"admin" bson:"admin"`
	Author bool `json:"author" bson:"author"`
	User   bool `json:"user" bson:"user"`
}

type User

type User struct {
	Name     string    `json:"name,omitempty" bson:"name,omitempty"`
	Email    string    `json:"email,omitempty" bson:"email,omitempty"`
	Username string    `json:"username" bson:"username"`
	Password string    `json:"password" bson:"password"`
	Role     SemuaRole `json:"role,omitempty" bson:"role,omitempty"`
}

func FindUser

func FindUser(mongoenv *mongo.Database, collname string, userdata User) User

func GetAllUser

func GetAllUser(mongoenv *mongo.Database, collname string) []User

Jump to

Keyboard shortcuts

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