Documentation ¶
Index ¶
- Constants
- func CreateMultiplePhotos(photos []models.Photo) ([]string, []string, error)
- func CreateNewUser(user models.User) (string, error)
- func CreateNewUserAuth(userAuth *models.UserAuth) (string, error)
- func CreatePhoto(photo models.Photo) (string, error)
- func CreateToken(userAuth *models.UserAuth) (string, error)
- func DeletePhoto(currentUserID string, photoID string) error
- func DeleteUser(id string) error
- func DeleteUserAuth(id string) error
- func GetAllPhotosFromOwner(currentUserID string, ownerID string) ([]models.Photo, error)
- func GetAllUsers() ([]models.User, error)
- func GetPasswordHash(email string, password string) string
- func GetPhotoByID(currentUserID string, photoID string) (*models.Photo, error)
- func GetUserAuthByEmail(email string) (*models.UserAuth, error)
- func GetUserById(id string) (*models.User, error)
- func ModifyUserAuth(id string, userAuth *models.UserAuth) (bool, error)
- func PaySubscription(user *models.User)
- func PaySubscriptionTo(user *models.User, subscribedToID string) error
- func SearchPhotosOfOwnerByName(currentUserID string, ownerID string, name string) ([]models.Photo, error)
- func SubscribeTo(currentUserID string, newSubscriptionID string) (bool, error)
- func UnsubscribeFrom(currentUserID string, subscriptionIDToRemove string) (bool, error)
- func UpdateUser(currentUserID string, user models.User) (bool, error)
- func ValidateLoginRequest(loginRequest *models.LoginRequest, userAuth *models.UserAuth) (token string, err error)
- func ValidateSignUpRequest(req models.SignUpRequest) error
Constants ¶
const EMAIL_REGEX = "" /* 490-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func CreateMultiplePhotos ¶
CreateMultiplePhotos creates multiple photos
func CreateNewUser ¶
CreateNewUser creates a new user
func CreateNewUserAuth ¶
CreateNewUserAuth creates a new UserAuth
func CreatePhoto ¶
CreatePhoto creates a new photo
func CreateToken ¶
CreateToken creates a JWT token for a given user
func DeletePhoto ¶
DeletePhoto deletes a photo
func DeleteUser ¶
DeleteUser deletes a user and unsubscribes every user who is subscribed to them
func DeleteUserAuth ¶
DeleteUserAuth removes a UserAuth associated with the ID
func GetAllPhotosFromOwner ¶
GetAllPhotosFromOwner returns all the pictures from a user, given that the currently authenticated user is subscribed
to the owner of the pictures
func GetAllUsers ¶
GetAllUsers returns all users registered to this platform
func GetPasswordHash ¶
GetPasswordHash returns the hash for a given password. Uses email las prepend salt
func GetPhotoByID ¶
GetPhotoByID returns a saved photo by its ID
func GetUserAuthByEmail ¶
GetAuthByEmail returns the UserAuth associated with the email address
func GetUserById ¶
GetUserById returns a given user by its id
func ModifyUserAuth ¶
ModifyUserAuth modifies a UserAuth
func PaySubscription ¶
PaySubscription Pays all users to whom a users is subscribed to
func PaySubscriptionTo ¶
PaySubscriptionTo transfers balance of the amount in SubscriptionPrice to a user is subscribed to
func SearchPhotosOfOwnerByName ¶
func SearchPhotosOfOwnerByName(currentUserID string, ownerID string, name string) ([]models.Photo, error)
SearchPhotosOfOwnerByName will search all photos from a given owner for photos where the name partially match the
name provided
func SubscribeTo ¶
SubscribeTo subscribes the current user to another user
func UnsubscribeFrom ¶
UnsubscribeFrom unsubscribes the current user from another user
func UpdateUser ¶
UpdateUser updates a user with new information. The user performing the action must be owner of this account
func ValidateLoginRequest ¶
func ValidateLoginRequest(loginRequest *models.LoginRequest, userAuth *models.UserAuth) (token string, err error)
ValidateLoginRequest checks that the login request is valid and that the credentials match
func ValidateSignUpRequest ¶
func ValidateSignUpRequest(req models.SignUpRequest) error
ValidateSignUpRequest checks that the sign up request is valid
Types ¶
This section is empty.