Versions in this module Expand all Collapse all v0 v0.0.2 Jul 4, 2024 v0.0.1 Jun 27, 2024 Changes in this version + func Encode(id primitive.ObjectID, email, privateKey string) (string, error) + func ErrorResponse(respw http.ResponseWriter, req *http.Request, statusCode int, err, msg string) + func GenerateKey() (privateKey, publicKey string) + func GetAllDocs[T any](db *mongo.Database, col string, filter bson.M) (docs T, err error) + func GetUserFromEmail(email string, db *mongo.Database) (doc model.User, err error) + func GetUserFromID(_id primitive.ObjectID, db *mongo.Database) (doc model.User, err error) + func InsertOneDoc(db *mongo.Database, col string, doc any) (insertedID primitive.ObjectID, err error) + func Jsonstr(strc any) string + func MongoConnect(mconn DBInfo) (db *mongo.Database, err error) + func WriteJSON(respw http.ResponseWriter, statusCode int, content any) + type DBInfo struct + DBName string + DBString string + type Payload struct + Email string + Exp time.Time + Iat time.Time + Id primitive.ObjectID + Nbf time.Time + func Decode(publicKey string, tokenstring string) (payload Payload, err error)