Documentation ¶
Index ¶
- Variables
- func CheckConnection() bool
- func CheckFollow(t models.Follow) (bool, error)
- func CheckIfUserAlreadyExists(email string) (models.User, bool, string)
- func ConnectDB() *mongo.Client
- func DeleteFollow(t models.Follow) (bool, error)
- func DeleteMsg(ID string, UserID string) error
- func EncryptPassword(pass string) (string, error)
- func GetAllUsers(ID string, page int64, search string, userType string) ([]*models.User, bool)
- func GetFollowersMsg(ID string, page int) ([]models.ReturnFollowersMsg, bool)
- func GetMessages(ID string, page int64) ([]*models.ReturnMsg, bool)
- func GetProfile(ID string) (models.User, error)
- func InsertFollow(t models.Follow) (bool, error)
- func InsertMsg(t models.RecordMsg) (string, bool, error)
- func InsertUser(u models.User) (string, bool, error)
- func LoginAttemp(email string, password string) (models.User, bool)
- func ModifyProfile(u models.User, ID string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var MongoCN = ConnectDB()
MongoCN is the connection object to the database.
Functions ¶
func CheckConnection ¶
func CheckConnection() bool
CheckConnection Function to check database connection.
func CheckFollow ¶
CheckFollow Check for relation beetween two users in database.
func CheckIfUserAlreadyExists ¶
CheckIfUserAlreadyExists Receive an email as a parameter and check if there is already a registered user with that email.
func DeleteFollow ¶
DeleteFollow Delete a specific relation.
func EncryptPassword ¶
EncryptPassword Function to encrypt the user's password.
func GetAllUsers ¶
GetAllUsers Get all users who have a relation with me.
func GetFollowersMsg ¶
func GetFollowersMsg(ID string, page int) ([]models.ReturnFollowersMsg, bool)
GetFollowersMsg Gets messages from my followers.
func GetMessages ¶
GetMessages Get all messages from a profile.
func GetProfile ¶
GetProfile Look for profile in database.
func InsertFollow ¶
InsertFollow record relation in database.
func InsertUser ¶
InsertUser Function to record the registration of a new user in the database.
func LoginAttemp ¶
LoginAttemp Perform the login check in the database.
Types ¶
This section is empty.