befous

package module
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 12 Imported by: 0

README

Befous

Nama = Ibrohim Mubarok
NPM = 1214081
Kelas = 3C

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmbilDataDosen added in v1.3.5

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

func AmbilDataGeojson

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

func AmbilDataJadwal

func AmbilDataJadwal(mongoenv, dbname, collname string) string

func AmbilDataKegiatan

func AmbilDataKegiatan(mongoenv, dbname, collname string) string

func AmbilDataMahasiswa added in v1.3.5

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

func AmbilDataMatakuliah added in v1.3.5

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

func AmbilDataRuangan added in v1.3.5

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

func AmbilSemuaUser added in v1.3.2

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

func Authorization added in v1.0.5

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

func Box added in v1.3.6

func Box(mconn *mongo.Database, collname string, coordinates Polyline) string

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func Create2dsphere added in v1.3.6

func Create2dsphere(mconn DBInfo) (db *mongo.Database)

func DecodeGetName added in v1.3.2

func DecodeGetName(publickey string, tokenstring string) string

func DecodeGetRole added in v1.3.2

func DecodeGetRole(publickey string, tokenstring string) string

func DecodeGetUsername added in v1.3.2

func DecodeGetUsername(publickey string, tokenstring string) string

func DeleteDoc added in v1.3.6

func DeleteDoc(db *mongo.Database, collection string, filter bson.M) (result *mongo.DeleteResult)

func DeleteGeojson added in v1.3.2

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

func DeleteOneDoc added in v1.3.6

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

func DeleteUser

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

func DocExists added in v1.3.6

func DocExists[T any](db *mongo.Database, collname string, filter bson.M, doc T) (result bool)

func EditUser added in v1.1.6

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

func Encode added in v1.3.2

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

func GenerateKey added in v1.3.2

func GenerateKey() (privatekey, publickey string)

func GeoIntersects added in v1.1.6

func GeoIntersects(mconn *mongo.Database, collname string, coordinates Point) string

func GeoWithin added in v1.1.8

func GeoWithin(mconn *mongo.Database, collname string, coordinates Polygon) string

func GetAllDistinctDoc added in v1.3.6

func GetAllDistinctDoc(db *mongo.Database, filter bson.M, fieldname, collection string) (doc []any)

func GetAllDoc added in v1.3.6

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

func GetAllDocByFilter added in v1.3.6

func GetAllDocByFilter[T any](db *mongo.Database, collection string, filter bson.M) (doc T)

func GetBoxDoc added in v1.3.6

func GetBoxDoc(db *mongo.Database, collname string, coordinates Polyline) (result string)

func GetGeoIntersectsDoc added in v1.3.6

func GetGeoIntersectsDoc(db *mongo.Database, collname string, coordinates Point) (result string)

func GetGeoWithinDoc added in v1.3.6

func GetGeoWithinDoc(db *mongo.Database, collname string, coordinates Polygon) (result string)

func GetNearDoc added in v1.3.6

func GetNearDoc(db *mongo.Database, collname string, coordinates Point) (result string)

func GetNearSphereDoc added in v1.3.6

func GetNearSphereDoc(db *mongo.Database, collname string, coordinates Point) (result string)

func GetOneDoc added in v1.3.6

func GetOneDoc[T any](db *mongo.Database, collection string, filter bson.M) (doc T)

func GetOneLatestDoc added in v1.3.6

func GetOneLatestDoc[T any](db *mongo.Database, collection string, filter bson.M) (doc T, err error)

func GetRandomDoc added in v1.3.6

func GetRandomDoc[T any](db *mongo.Database, collection string, size uint) (result []T, err error)

func HapusUser

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

func HashPassword

func HashPassword(password string) (string, error)

func InsertDosen added in v1.3.5

func InsertDosen(mongoenv *mongo.Database, collname string, datadosen Dosen) interface{}

func InsertMahasiswa added in v1.3.5

func InsertMahasiswa(mongoenv *mongo.Database, collname string, datamahasiswa Mahasiswa) interface{}

func InsertMatakuliah added in v1.3.5

func InsertMatakuliah(mongoenv *mongo.Database, collname string, datamatakuliah Matakuliah) interface{}

func InsertOneDoc added in v1.3.6

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

func InsertRuangan added in v1.3.5

func InsertRuangan(mongoenv *mongo.Database, collname string, dataruangan Ruangan) interface{}

func InsertUser added in v1.3.2

func InsertUser(mongoenv *mongo.Database, collname string, datauser User) interface{}

func IsPasswordValid

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

func Login added in v1.1.6

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

func MembuatGeojsonPoint

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

func MembuatGeojsonPolygon

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

func MembuatGeojsonPolyline

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

func MongoConnect added in v1.3.6

func MongoConnect(mconn DBInfo) (db *mongo.Database)

func Near added in v1.1.9

func Near(mconn *mongo.Database, collname string, coordinates Point) string

func NearSphere added in v1.3.6

func NearSphere(mconn *mongo.Database, collname string, coordinates Point) string

func PostGeoIntersects added in v1.1.6

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

func PostGeoWithin added in v1.1.8

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

func PostLinestring

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

func PostNear added in v1.1.9

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

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

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

func ReplaceOneDoc

func ReplaceOneDoc(db *mongo.Database, collection string, filter bson.M, doc interface{}) (updatereseult *mongo.UpdateResult)

func ReturnStruct

func ReturnStruct(DataStuct any) string

func SetConnection

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

func SetConnection2dsphere added in v1.1.9

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

func TambahDosen added in v1.3.5

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

func TambahMahasiswa added in v1.3.5

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

func TambahMatakuliah added in v1.3.5

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

func TambahRuangan added in v1.3.5

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

func UpdateUser added in v1.1.3

func UpdateUser(mconn *mongo.Database, collname string, datauser User) interface{}

func UsernameExists added in v1.3.6

func UsernameExists(mconn *mongo.Database, collname string, userdata User) bool

Types

type CredentialUser added in v1.1.6

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

type DBInfo struct {
	DBString       string
	DBName         string
	CollectionName string
}

type Dosen added in v1.3.5

type Dosen struct {
	NIDN       string `json:"nidn" bson:"nidn"`
	Nama_Dosen string `json:"nama_dosen" bson:"nama_dosen"`
	Alamat     string `json:"alamat" bson:"alamat"`
}

func GetAllDosen added in v1.3.5

func GetAllDosen(mconn *mongo.Database, collname string) []Dosen

type FullGeoJson added in v1.3.2

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

func GetAllBangunan added in v1.3.2

func GetAllBangunan(mconn *mongo.Database, collname 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"`
}

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 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(mconn *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(mconn *mongo.Database, collname string) []Kegiatan

type LongLat added in v1.1.6

type LongLat struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type Mahasiswa added in v1.3.5

type Mahasiswa struct {
	NPM          string `json:"npm" bson:"npm"`
	Nama_Lengkap string `json:"nama_lengkap" bson:"nama_lengkap"`
	Alamat       string `json:"alamat" bson:"alamat"`
}

func GetAllMahasiswa added in v1.3.5

func GetAllMahasiswa(mconn *mongo.Database, collname string) []Mahasiswa

type Matakuliah added in v1.3.5

type Matakuliah struct {
	Kode_Matakuliah string `json:"kode_matakuliah" bson:"kode_matakuliah"`
	Nama_Matakiliah string `json:"nama_matakuliah" bson:"nama_matakuliah"`
	SKS             string `json:"sks" bson:"sks"`
}

func GetAllMatakuliah added in v1.3.5

func GetAllMatakuliah(mconn *mongo.Database, collname string) []Matakuliah

type Payload added in v1.3.2

type Payload struct {
	Name     string    `json:"name"`
	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.3.2

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

type Pesan

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

type Point added in v1.3.4

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

type Polygon added in v1.3.4

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

type Polyline added in v1.3.4

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

type Properties

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

type Ruangan added in v1.3.5

type Ruangan struct {
	Kode_Ruangan string `json:"kode_ruangan" bson:"kode_ruangan"`
	Nama_Ruangan string `json:"nama_ruangan" bson:"nama_ruangan"`
	Kapasitas    string `json:"kapasitas" bson:"kapasitas"`
}

func GetAllRuangan added in v1.3.5

func GetAllRuangan(mconn *mongo.Database, collname string) []Ruangan

type User

type User struct {
	Name     string `json:"name" bson:"name"`
	Username string `json:"username" bson:"username"`
	Password string `json:"password" bson:"password"`
	Role     string `json:"role" bson:"role"`
}

func FindUser

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

func GetAllUser

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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