Documentation ¶
Index ¶
- Variables
- func CheckConnection() int
- func CheckUserAlreadyExists(email string) (models.User, bool, string)
- func ConnectorBD() *mongo.Client
- func ConsultRelation(t models.Relationship) (bool, error)
- func DeletePost(ID string, UserID string) error
- func DeleteRelationship(t models.Relationship) (bool, error)
- func EncryptPassword(pass string) (string, error)
- func InsertPost(t models.RecordPost) (string, bool, error)
- func InsertRegistration(u models.User) (string, bool, error)
- func InsertRelationship(t models.Relationship) (bool, error)
- func ModifyRecord(u models.User, ID string) (bool, error)
- func ProfileLookup(ID string) (models.User, error)
- func ReadAllUsers(ID string, page int64, search string, tipo string) ([]*models.User, bool)
- func ReadFollowersPosts(ID string, page int) ([]models.ReturnFollowersPosts, bool)
- func ReadPosts(ID string, page int64) ([]*models.ReturnPost, bool)
- func SearchProfile(ID string) (models.User, error)
- func TryLogin(email string, password string) (models.User, bool)
Constants ¶
This section is empty.
Variables ¶
var MongoCN = ConnectorBD()
MongoCN is an object to conect to DB
Functions ¶
func CheckUserAlreadyExists ¶
CheckUserAlreadyExists checks if the database already contains a user registered with the input email address
func ConsultRelation ¶
func ConsultRelation(t models.Relationship) (bool, error)
ConsultRelation checks the relationship between 2 users
func DeletePost ¶
This function is for deleting posts
func DeleteRelationship ¶
func DeleteRelationship(t models.Relationship) (bool, error)
DeleteRelationship deletes the relation in the database
func EncryptPassword ¶
EncryptPassword encrypts the user password for storage in Database
func InsertPost ¶
func InsertPost(t models.RecordPost) (string, bool, error)
func InsertRegistration ¶
This is the final stop with the db to insert the user data
func InsertRelationship ¶
func InsertRelationship(t models.Relationship) (bool, error)
This func inserts the relationship
func ModifyRecord ¶
modifies the record of the user
func ProfileLookup ¶
ProfileLookup looks up for a profile in DB
func ReadAllUsers ¶
ReadAllUsers reads the users registered in the system, if "R" is received in those who bring only those who are related to me
func ReadFollowersPosts ¶
func ReadFollowersPosts(ID string, page int) ([]models.ReturnFollowersPosts, bool)
ReadFollowersPosts reads the posts of the followers
func ReadPosts ¶
func ReadPosts(ID string, page int64) ([]*models.ReturnPost, bool)
ReadPosts reads the posts of a profile
func SearchProfile ¶
SearchProfile finds the user based on the given ID as parameter
Types ¶
This section is empty.