pasetobackend

package module
v0.0.0-...-869092b Latest Latest
Warning

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

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

README

pasetobackend

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func DeleteDataGeojson

func DeleteDataGeojson(MongoConn *mongo.Database, colname string, name string) (*mongo.DeleteResult, error)

func GCFDeleteDataGeojson

func GCFDeleteDataGeojson(Mongostring, dbname, colname string, r *http.Request) string

func GCFPostCoordinate

func GCFPostCoordinate(Mongostring, dbname, colname string, r *http.Request) string

func GCFPostHandler

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

func GCFReturnStruct

func GCFReturnStruct(DataStuct any) string

func GCFUpdateNameGeojson

func GCFUpdateNameGeojson(Mongostring, dbname, colname string, r *http.Request) string

func GCHandlerFunc

func GCHandlerFunc(Mongostring, dbname, colname string) string

func HashPassword

func HashPassword(password string) (string, error)

func InsertDataGeojson

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

func InsertUser

func InsertUser(db *mongo.Database, collection string, userdata User) string

func IsPasswordValid

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

func SetConnection

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

func UpdateDataGeojson

func UpdateDataGeojson(MongoConn *mongo.Database, colname, name, newVolume, newTipe string) error

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 Credents

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

type GeoJson

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

func GetAllData

func GetAllData(MongoConnect *mongo.Database, colname 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 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 LonLatProperties

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

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

Jump to

Keyboard shortcuts

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