Documentation
¶
Index ¶
- func CreateUser(db *mongo.Database, col string, username, password string) (insertedID primitive.ObjectID, err error)
- func DeleteContactsByID(_id primitive.ObjectID, db *mongo.Database, col string) error
- func GenerateJWT(userID, username string) (string, error)
- func GenerateRandomString(length int) (string, error)
- func GetAllContacts(db *mongo.Database, col string) (data []model.Contact)
- func GetContactsFromID(_id primitive.ObjectID, db *mongo.Database, col string) (kontak model.Contact, errs error)
- func GetUserByUsername(username string, db *mongo.Database, col string) (user model.User, err error)
- func InsertContacts(db *mongo.Database, col, nmkontak, nmrkontak string) (insertedID primitive.ObjectID, err error)
- func Login(username, password string, db *mongo.Database, col string) (loggedIn bool, token string, err error)
- func UpdateContacts(db *mongo.Database, col string, id primitive.ObjectID, ...) (err error)
- func VerifyPassword(user model.User, providedPassword string) (bool, error)
- type JWTClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateUser ¶
func DeleteContactsByID ¶
func GenerateJWT ¶
func GenerateRandomString ¶
func GetContactsFromID ¶
func GetUserByUsername ¶
func InsertContacts ¶
func UpdateContacts ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.