BEGIS

package module
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 23 Imported by: 0

README

Geographic Information System By Akbar Hasbullah

1. Geowithin

Menentukan apakah suatu data lokasi berada di dalam suatu bentuk geometri (polygon) tertentu.

Format

{
  "type":"",
  "coordinates":[],
  "min":,
  "max":
}

2. GeoIntersect

Menentukan apakah suatu bentuk geometri (polygon) memotong (intersect) dengan data lokasi yang disimpan dalam MongoDB.

Format

{
    "type": "LineString/Point/Polygon",
    "coordinates": 
                [[],
                []] 

}

3.Box

Menentukan sebuah kotak (box) di sekitar suatu wilayah tertentu dalam sistem koordinat geografis. Data yang memiliki lokasi di dalam kotak tersebut akan dipilih.

Format

{
   "coordinates":[ [ Koordinan Kiri Bawah],
    [ Koordinat Kanan Atas] ]
}

4. Near

Mencari data lokasi yang berada paling dekat dengan suatu titik atau koordinat tertentu.

Format

{
 "coordinates":[],
 "min":
 "max":
}

5. NearSphere

Operator ini mirip dengan $Near, namun dengan tambahan parameter jari-jari (radius) dalam radians.

Format

{
 "type":"Point",
 "coordinates":[
 ],
 "min":
 "max":
}

6. Center

Menentukan sebuah titik tengah (center) dari suatu wilayah tertentu dalam sistem koordinat geografis. Data yang memiliki lokasi di sekitar titik tengah tersebut akan dipilih.

Format

{
   "coordinates": [] ,
   "radius": 
}

Rilis Package

go get -u all
go mod tidy
git tag                                 #check current version
git tag v1.0.0                          #set tag version
git push origin v1.0.0                  #push tag version to repo
GOPROXY=proxy.golang.org go list -m example.com/mymodule@v0.1.0
go get example.com/mymodule@v0.1.0
go list -m example.com/mymodule@v0.1.0   #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 AuthenticateUserAndGenerateToken

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

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func Create2dsphere added in v1.0.7

func Create2dsphere(mconn models.DBInfo2) (MONGOCONNSTRINGENV *mongo.Database)

func CreateComment

func CreateComment(MONGOCONNSTRINGENV *mongo.Database, collection string, commentdata Comment) interface{}

func CreateContent

func CreateContent(t *testing.T)

func CreateNewBlog

func CreateNewBlog(MONGOCONNSTRINGENV *mongo.Database, collection string, blogdata Blog) interface{}

func CreateNewContent

func CreateNewContent(MONGOCONNSTRINGENV *mongo.Database, collection string, contentdata Content) interface{}

content

func CreateNewProduct

func CreateNewProduct(MONGOCONNSTRINGENV *mongo.Database, collection string, productdata Product) interface{}

func CreateNewUserRole

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

func CreatetGeojsonPoint added in v1.0.7

func CreatetGeojsonPoint(publickey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func DecodeGetRole added in v1.0.7

func DecodeGetRole(publickey string, tokenstring string) string

func DecodeGetUsername added in v1.0.7

func DecodeGetUsername(publickey string, tokenstring string) string

func DeleteComment

func DeleteComment(MONGOCONNSTRINGENV *mongo.Database, collection string, commentdata Comment) interface{}

func DeleteContent

func DeleteContent(MONGOCONNSTRINGENV *mongo.Database, collection string, contentdata Content) interface{}

func DeleteGeojson added in v1.0.7

func DeleteGeojson(mMONGOCONNSTRINGENV *mongo.Database, collname string, userdata User) interface{}

func DeleteLinestring

func DeleteLinestring(MONGOCONNSTRINGENV *mongo.Database, collection string, linestringdata GeoJsonLineString) interface{}

func DeleteOneDoc added in v1.0.7

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

func DeleteUser

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

func Encode added in v1.0.7

func Encode(username, role, privatekey string) (string, error)

func GCFCreateLineStringgg

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

func GCFCreatePolygone

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

func GCFCreatePolygonee

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

func GCFCreatePostLineString

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

func GCFCreatePostLineStringg

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

func GCFCreteCommnet

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

func GCFDeleteLineString

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

func GCFDeletedCommnet

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

func GCFGetAllComment

func GCFGetAllComment(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GCFHandler

func GCFHandler(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GCFLoginAfterCreatee

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

func GCFLoginAfterCreateee

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

func GCFLoginAfterCreateeee

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

func GCFReturnStruct

func GCFReturnStruct(DataStuct any) string

func GCFUpdateLinestring

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

func GCFlineStingCreate

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

func GCFlineStingCreatea

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

func GFCUpadatedCommnet

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

func GenerateKey added in v1.0.7

func GenerateKey() (privatekey, publickey string)

func GeojsonNameString added in v1.1.4

func GeojsonNameString(geojson []FullGeoJson) (result string)

func GetAllDoc added in v1.0.7

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

func GetBoxDoc added in v1.0.7

func GetBoxDoc[T any](MONGOCONNSTRINGENV *mongo.Database, collname, locfield string, geospatial Geospatial) (result []T, err error)

func GetCenterDoc added in v1.0.7

func GetCenterDoc[T any](MONGOCONNSTRINGENV *mongo.Database, collname, locfield string, geospatial Geospatial) (result []T, err error)

func GetCenterSphereDoc added in v1.0.7

func GetCenterSphereDoc[T any](MONGOCONNSTRINGENV *mongo.Database, collname, locfield string, geospatial Geospatial) (result []T, err error)

func GetGeoIntersectsDoc added in v1.0.7

func GetGeoIntersectsDoc[T any](MONGOCONNSTRINGENV *mongo.Database, collname string, locfield string, geospatial Geospatial) (result []T, err error)

func GetGeoWithinDoc added in v1.0.7

func GetGeoWithinDoc[T any](MONGOCONNSTRINGENV *mongo.Database, collname, locfield string, geospatial Geospatial) (result []T, err error)

func GetNearDoc added in v1.0.7

func GetNearDoc[T any](MONGOCONNSTRINGENV *mongo.Database, collname, locfield string, geospatial Geospatial) (result []T, err error)

func GetNearSphereDoc added in v1.0.7

func GetNearSphereDoc[T any](MONGOCONNSTRINGENV *mongo.Database, collname, locfield string, geospatial Geospatial) (result []T, err error)

func HashPassword

func HashPassword(password string) (string, error)

func InsertOneDoc

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

func InsertUserdata

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

func IsAuthorized

func IsAuthorized(username string, mconn *mongo.Client, collectionname string) bool

func IsPasswordValid

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

func LoginHandler added in v1.0.7

func LoginHandler(token, privatekey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func MembuatGeojsonPolygon added in v1.0.7

func MembuatGeojsonPolygon(publickey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func MembuatGeojsonPolyline added in v1.0.7

func MembuatGeojsonPolyline(publickey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func Otorisasi added in v1.0.7

func Otorisasi(publickey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func PostBox added in v1.0.7

func PostBox(publickey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func PostCenter added in v1.0.7

func PostCenter(publickey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func PostCenterSphere added in v1.0.7

func PostCenterSphere(publickey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func PostGeoIntersects added in v1.0.7

func PostGeoIntersects(publickey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func PostGeoWithin added in v1.0.7

func PostGeoWithin(publickey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func PostLineString

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

func PostLinestring

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

func PostLinestring1 added in v1.0.7

func PostLinestring1(MONGOCONNSTRINGENV *mongo.Database, collection string, linestringdata GeoJsonLineString) interface{}

func PostNear added in v1.0.7

func PostNear(publickey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func PostNearSphere added in v1.0.7

func PostNearSphere(publickey, MONGOCONNSTRINGENV, dbname, collname string, r *http.Request) string

func PostPoint

func PostPoint(MONGOCONNSTRINGENV *mongo.Database, collection string, pointdata GeoJsonPoint) interface{}

func PostPolygon added in v1.0.7

func PostPolygon(MONGOCONNSTRINGENV *mongo.Database, collection string, polygondata GeoJsonPolygon) interface{}

func PostPolygone

func PostPolygone(MONGOCONNSTRINGENV *mongo.Database, collection string, polygonedata GeoJsonPolygon) interface{}

func ReplaceContent

func ReplaceContent(MONGOCONNSTRINGENV *mongo.Database, collection string, filter bson.M, contentdata Content) interface{}

func ReplaceOneDoc

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

func SetConnection

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

func SetConnection2dsphere added in v1.0.7

func SetConnection2dsphere(MONGOCONNSTRINGENV, dbname, collname string) *mongo.Database

func TestAllProduct

func TestAllProduct(t *testing.T)

func TestCreateNewUserRole

func TestCreateNewUserRole(t *testing.T)

func TestDeleteUser

func TestDeleteUser(t *testing.T)

func TestGFCPostHandlerUser

func TestGFCPostHandlerUser(t *testing.T)

func TestGeneratePasswordHash

func TestGeneratePasswordHash(t *testing.T)

func TestGeneratePrivateKeyPaseto

func TestGeneratePrivateKeyPaseto(t *testing.T)

func TestHashFunction

func TestHashFunction(t *testing.T)

func TestIsPasswordValid

func TestIsPasswordValid(t *testing.T)

func TestProduct

func TestProduct(t *testing.T)

func UpdatedComment

func UpdatedComment(MONGOCONNSTRINGENV *mongo.Database, collection string, filter bson.M, commentdata Comment) interface{}

func UpdatedLinestring

func UpdatedLinestring(MONGOCONNSTRINGENV *mongo.Database, collection string, filter bson.M, linestringdata GeoJsonLineString) interface{}

Types

type About

type About struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Image       string `json:"image" bson:"image"`
}

type BeriPesan added in v1.0.7

type BeriPesan struct {
	Status  bool   `json:"status" bson:"status"`
	Message string `json:"message" bson:"message"`
	Token   string `json:"token,omitempty" bson:"token,omitempty"`
}

type Blog

type Blog struct {
	ID          int       `json:"id" bson:"id"`
	Title       string    `json:"title" bson:"title"`
	Tanggal     string    `json:"tanggal" bson:"tanggal"`
	Description string    `json:"judul" bson:"judul"`
	Content     []Content `json:"content" bson:"content"`
}

func GetAllBlogAll

func GetAllBlogAll(MONGOCONNSTRINGENV *mongo.Database, collection string) []Blog

func GetIDBlog

func GetIDBlog(MONGOCONNSTRINGENV *mongo.Database, collection string, blogdata Blog) Blog

type Category

type Category struct {
	Category []string `json:"category" bson:"category"`
}

type Comment

type Comment struct {
	ID        int    `json:"id" bson:"id"`
	Username  string `json:"username" bson:"username"`
	Answer    string `json:"comment" bson:"comment"`
	Questions string `json:"questions" bson:"questions"`
	Tanggal   string `json:"tanggal" bson:"tanggal"`
}

func GetAllComment

func GetAllComment(MONGOCONNSTRINGENV *mongo.Database, collection string) []Comment

type Contack

type Contack struct {
	ID      int    `json:"id" bson:"id"`
	Name    string `json:"title" bson:"title"`
	Subject string `json:"description" bson:"description"`
	Message string `json:"image" bson:"image"`
	Email   string `json:"email" bson:"email"`
	Phone   string `json:"phone" bson:"phone"`
}

type Content

type Content struct {
	ID          int    `json:"id" bson:"id" `
	Content     string `json:"content" bson:"content"`
	Image       string `json:"image" bson:"image"`
	Description string `json:"description" bson:"description"`
}

func FindContentAllId

func FindContentAllId(MONGOCONNSTRINGENV *mongo.Database, collection string, contentdata Content) Content

func GetAllContent

func GetAllContent(MONGOCONNSTRINGENV *mongo.Database, collection string) []Content

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

type DBInfo2 struct {
	DBString       string
	DBName         string
	CollectionName string
}

type Event

type Event struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Tanggal     string `json:"tanggal" bson:"tanggal"`
	Image       string `json:"image" bson:"image"`
	Harga       int    `json:"harga" bson:"harga"`
	LinkYoutube string `json:"linkyoutube" bson:"linkyoutube"`
}

type EventGlobal

type EventGlobal struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Tanggal     string `json:"tanggal" bson:"tanggal"`
	Image       string `json:"image" bson:"image"`
	Harga       int    `json:"harga" bson:"harga"`
}

type FullGeoJson added in v1.0.7

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

func Box

func Box(MONGOCONNSTRINGENV *mongo.Database, collname string, geospatial Geospatial) ([]FullGeoJson, error)

func Center

func Center(MONGOCONNSTRINGENV *mongo.Database, collname string, geospatial Geospatial) ([]FullGeoJson, error)

func CenterSphere added in v1.0.7

func CenterSphere(MONGOCONNSTRINGENV *mongo.Database, collname string, geospatial Geospatial) ([]FullGeoJson, error)

func GeoIntersects

func GeoIntersects(MONGOCONNSTRINGENV *mongo.Database, collname string, geospatial Geospatial) ([]FullGeoJson, error)

func GeoWithin

func GeoWithin(MONGOCONNSTRINGENV *mongo.Database, collname string, geospatial Geospatial) ([]FullGeoJson, error)

func Near

func Near(MONGOCONNSTRINGENV *mongo.Database, collname string, geospatial Geospatial) ([]FullGeoJson, error)

func NearSphere

func NearSphere(MONGOCONNSTRINGENV *mongo.Database, collname string, geospatial Geospatial) ([]FullGeoJson, error)
type Gallery struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Image       string `json:"image" bson:"image"`
}

type GeoJson

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

func AmbilDataGeojson added in v1.0.7

func AmbilDataGeojson(MONGOCONNSTRINGENV, dbname, collname string) []GeoJson

func GetAllBangunan added in v1.0.7

func GetAllBangunan(MONGOCONNSTRINGENV *mongo.Database, collname string) []GeoJson

func GetAllBangunanLineString

func GetAllBangunanLineString(MONGOCONNSTRINGENV *mongo.Database, collection string) []GeoJson

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

func FindNearestRoad

func FindNearestRoad(mconn *mongo.Database, collectionname string, coordinates []float64) GeoJsonLineString

func FindRoute

func FindRoute(mconn *mongo.Database, collectionname string, startGeometry, endGeometry GeometryLineString) []GeoJsonLineString

Fungsi untuk mencari jalur dari jalan awal ke jalan akhir Fungsi untuk mencari jalur dari jalan awal ke jalan akhir

func GetByCoordinate

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

type GeoJsonPoint added in v1.0.7

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

type Geospatial struct {
	Type        string      `json:"type" bson:"type"`
	Coordinates interface{} `json:"coordinates" bson:"coordinates"`
	Max         float64     `json:"max,omitempty" bson:"max,omitempty"`
	Min         float64     `json:"min,omitempty" bson:"min,omitempty"`
	Radius      float64     `json:"radius,omitempty" bson:"radius,omitempty"`
}

type Iklan

type Iklan struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Image       string `json:"image" bson:"image"`
}

type Payload added in v1.0.7

type Payload struct {
	Username string    `json:"username"`
	Role     string    `json:"role"`
	Exp      time.Time `json:"exp"`
	Iat      time.Time `json:"iat"`
	Nbf      time.Time `json:"nbf"`
}

func Decode added in v1.0.7

func Decode(publickey, tokenstr string) (payload Payload, err error)

type Point added in v1.0.7

type Point struct {
	Coordinates []float64 `json:"coordinates" bson:"coordinates"`
	Max         int64     `json:"max,omitempty" bson:"max,omitempty"`
	Min         int64     `json:"min,omitempty" bson:"min,omitempty"`
}

type Polygon

type Polygon struct {
	Coordinates [][][]float64 `json:"coordinates" bson:"coordinates"`
}

type Polyline added in v1.0.7

type Polyline struct {
	Coordinates [][]float64 `json:"coordinates" bson:"coordinates"`
}

type Product

type Product struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" `
	Nomorid     int                `json:"nomorid" bson:"nomorid"`
	Name        string             `json:"name" bson:"name"`
	Description string             `json:"description" bson:"description"`
	Price       int                `json:"price" bson:"price"`
	Stock       int                `json:"stock" bson:"stock"`
	Size        string             `json:"size" bson:"size"`
	Image       string             `json:"image" bson:"image"`
}

func GetAllProduct

func GetAllProduct(MONGOCONNSTRINGENV *mongo.Database, collection string) []Product

type Properties

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

type Response

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

func CreateResponse

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

type Share

type Share struct {
	Share []string `json:"share" bson:"share"`
}

type Tags

type Tags struct {
	Tags []string `json:"tags" bson:"tags"`
}

type User

type User struct {
	No_whatsapp string `json:"no_whatsapp,omitempty" bson:"no_whatsapp"`
	Username    string `json:"username" bson:"username"`
	Password    string `json:"password,omitempty" bson:"password"`
	Role        string `json:"role,omitempty" bson:"role,omitempty"`
}

func FindUser

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

func FindUserByUsername

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

func FindUserUser

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

func GetAllUser

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

func GetNameAndPassowrd

func GetNameAndPassowrd(MONGOCONNSTRINGENV *mongo.Database, collection string) []User

type Userkredensial added in v1.0.7

type Userkredensial struct {
	Status  bool   `json:"status" bson:"status"`
	Data    User   `json:"data,omitempty" bson:"data,omitempty"`
	Message string `json:"message,omitempty" bson:"message,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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