Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func Create2dsphere(mconn models.DBInfo) (db *mongo.Database)
- func Decode(publickey, tokenstr string) (payload models.Payload, err error)
- func DecodeGetName(publickey string, tokenstring string) string
- func DecodeGetRole(publickey string, tokenstring string) string
- func DecodeGetUsername(publickey string, tokenstring string) string
- func DeleteDoc(db *mongo.Database, collection string, filter bson.M) (result *mongo.DeleteResult)
- func DeleteOneDoc(db *mongo.Database, collection string, filter bson.M) (result *mongo.DeleteResult)
- func DocExists[T any](db *mongo.Database, collname string, filter bson.M, doc T) (result bool)
- func Encode(name, username, role, privatekey string) (string, error)
- func GenerateKey() (privatekey, publickey string)
- func GetAllDistinctDoc(db *mongo.Database, filter bson.M, fieldname, collection string) (doc []any)
- func GetAllDoc[T any](db *mongo.Database, collection string) (doc T)
- func GetAllDocByFilter[T any](db *mongo.Database, collection string, filter bson.M) (doc T)
- func GetBoxDoc(db *mongo.Database, collname string, coordinates models.Polyline) (result string)
- func GetGeoIntersectsDoc(db *mongo.Database, collname string, coordinates models.Point) (result string)
- func GetGeoWithinDoc(db *mongo.Database, collname string, coordinates models.Polygon) (result string)
- func GetNearDoc(db *mongo.Database, collname string, coordinates models.Point) (result string)
- func GetNearSphereDoc(db *mongo.Database, collname string, coordinates models.Point) (result string)
- func GetOneDoc[T any](db *mongo.Database, collection string, filter bson.M) (doc T)
- func GetOneLatestDoc[T any](db *mongo.Database, collection string, filter bson.M) (doc T, err error)
- func GetRandomDoc[T any](db *mongo.Database, collection string, size uint) (result []T, err error)
- func HashPassword(password string) (string, error)
- func InsertOneDoc(db *mongo.Database, collection string, doc interface{}) (insertedID interface{})
- func MongoConnect(mconn models.DBInfo) (db *mongo.Database)
- func ReplaceOneDoc(db *mongo.Database, collection string, filter bson.M, doc interface{}) (updatereseult *mongo.UpdateResult)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
func DecodeGetName ¶
func DecodeGetRole ¶
func DecodeGetUsername ¶
func DeleteOneDoc ¶
func GenerateKey ¶
func GenerateKey() (privatekey, publickey string)
func GetAllDistinctDoc ¶
func GetAllDocByFilter ¶
func GetGeoIntersectsDoc ¶
func GetGeoWithinDoc ¶
func GetNearDoc ¶
func GetNearSphereDoc ¶
func GetOneLatestDoc ¶
func GetRandomDoc ¶
func HashPassword ¶
func InsertOneDoc ¶
func ReplaceOneDoc ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.