petabackend

package module
v1.0.9 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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateUserAndGenerateToken added in v1.0.9

func AuthenticateUserAndGenerateToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, userdata User) (string, error)

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func CreateLogin added in v1.0.9

func CreateLogin(mongoconn *mongo.Database, collection string, userdata User) interface{}

create login using Private

func CreateNewUserRole added in v1.0.8

func CreateNewUserRole(mongoconn *mongo.Database, collection string, userdata User) interface{}
func GetAllUser(mongoconn *mongo.Database, collection string) []User {
	user := atdb.GetAllDoc[[]User](mongoconn, collection)
	return user
}

func CreateUser added in v1.0.9

func CreateUser(mongoconn *mongo.Database, collection string, userdata User) interface{}

func CreateUserAndAddToken added in v1.0.9

func CreateUserAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, userdata User) error

func CreateUserAndAddedToeken added in v1.0.8

func CreateUserAndAddedToeken(PASETOPRIVATEKEYENV string, mongoconn *mongo.Database, collection string, userdata User) interface{}

func DeleteUser added in v1.0.8

func DeleteUser(mongoconn *mongo.Database, collection string, userdata User) interface{}

func GCFCreateAccountAndToken added in v1.0.9

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

func GCFCreateHandler added in v1.0.8

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

func GCFCreateHandlerTokenPaseto added in v1.0.8

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

func GCFCreatePostLineString added in v1.0.8

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

func GCFCreatePostLineStringg added in v1.0.8

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

func GCFCreateTokenAndSaveToDB added in v1.0.9

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

func GCFCreteRegister added in v1.0.9

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

func GCFDeleteHandler added in v1.0.8

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

func GCFFindUserByID added in v1.0.8

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

func GCFFindUserByName added in v1.0.8

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

func GCFHandler

func GCFHandler(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GCFLoginAfterCreate added in v1.0.9

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

func GCFLoginAfterCreatee added in v1.0.9

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

func GCFLoginAfterCreateee added in v1.0.9

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

func GCFLoginAfterCreateeee added in v1.0.9

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

func GCFLoginAfterCreater added in v1.0.9

func GCFLoginAfterCreater(MONGOCONNSTRINGENV, dbname, collectionname, privateKeyEnv string, r *http.Request) (string, error)

func GCFLoginTest added in v1.0.8

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 added in v1.0.8

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

func GFCPostHandlerUser added in v1.0.8

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

func HashPassword

func HashPassword(password string) (string, error)

func InsertDataUserGCF added in v1.0.8

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

func InsertOneDoc added in v1.0.8

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

func InsertUserdata added in v1.0.8

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

func IsPasswordValid

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

func PostLineString added in v1.0.9

func PostLineString(mongoconn *mongo.Database, collection string, commentdata GeoJsonLineString) interface{}

func PostLinestring added in v1.0.8

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

func ReplaceOneDoc added in v1.0.8

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

func SetConnection

func SetConnection(MONGOCONNSTRINGENV, 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 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"`
}

func GetByCoordinate added in v1.0.8

func GetByCoordinate(mongoconn *mongo.Database, collection string, linestringdata GeoJsonLineString) GeoJsonLineString

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 Properties

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

type Response added in v1.0.8

type Response struct {
	Status  bool        `json:"status" bson:"status"`
	Message string      `json:"message" bson:"message"`
	Data    interface{} `json:"data" bson:"data"`
}

func CreateResponse added in v1.0.9

func CreateResponse(status bool, message string, data interface{}) Response

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 added in v1.0.8

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

func FindUserByUsername added in v1.0.9

func FindUserByUsername(mongoconn *mongo.Database, collection string, username string) (User, error)

func FindUserUser added in v1.0.8

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

func GetAllUser added in v1.0.8

func GetAllUser(mongoconn *mongo.Database, collection string) []User

func GetNameAndPassowrd added in v1.0.8

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