Documentation ¶
Index ¶
- 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 models.User, err error)
- func GetUserFromID(_id primitive.ObjectID, db *mongo.Database) (doc models.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
- type Payload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorResponse ¶ added in v0.1.2
func GenerateKey ¶
func GenerateKey() (privateKey, publicKey string)
func GetAllDocs ¶
func GetUserFromEmail ¶
func GetUserFromID ¶
func InsertOneDoc ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.