repositories

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAuth

func DeleteAuth(id string) error

DeleteAuth deletes a UserAuth in MongoDB

func DeletePhoto

func DeletePhoto(id string) error

DeletePhoto deletes a photo from MongoDB

func DeleteUser

func DeleteUser(id string) error

DeleteUser deletes a user in mongodb

func GetAllPhotosByOwnerID

func GetAllPhotosByOwnerID(ownerID string) ([]models.Photo, error)

GetAllPhotosByOwnerID returns all the photos from a user by its ID from MongoDB

func GetAllUsers

func GetAllUsers() ([]models.User, error)

GetAllUsers returns all the user registered from MongoDB

func GetAllUsersSubscribedTo

func GetAllUsersSubscribedTo(id string) ([]models.User, error)

GetAllUsersSubscribedTo Gets all the users subscribed to another user from MongoDB

func GetAuthByEmail

func GetAuthByEmail(email string) (*models.UserAuth, error)

GetAuthByEmail returns a UserAuth by its email from MongoDB

func GetPhotoByID

func GetPhotoByID(id string) (*models.Photo, error)

GetPhotoByID returns a Photo by its id from MongoDB

func GetPhotoByName

func GetPhotoByName(name string) (*models.Photo, error)

GetPhotoByID returns a Photo by its name from MongoDB

func GetUserById

func GetUserById(id string) (*models.User, error)

GetUserById returns a user by its ID from MongoDB

func IsEmailUsed

func IsEmailUsed(email string) (bool, error)

IsEmailUsed checks if a given email is used by another user in MongoDB

func SaveAuth

func SaveAuth(auth *models.UserAuth) (string, error)

GetAuthByEmail saves a UserAuth to MongoDB

func SaveMultiplePhotos

func SaveMultiplePhotos(photos []models.Photo) ([]string, error)

SaveMultiplePhotos saves multiple photos to MongoDB

func SavePhoto

func SavePhoto(photo *models.Photo) (string, error)

SavePhoto saves a photo to MongoDB

func SaveUser

func SaveUser(user models.User) (string, error)

SaveUser saves a user to MongoDB

func SearchPhotosByNameContaining

func SearchPhotosByNameContaining(name string, ownerID string) ([]models.Photo, error)

SearchPhotosByNameContaining returns all the photos from a user where the name partially matches the provided name

func UpdateAuth

func UpdateAuth(id string, auth *models.UserAuth) (bool, error)

UpdateAuth updates a UserAuth in MongoDB

func UpdateUser

func UpdateUser(id string, newUser *models.User) (bool, error)

UpdateUser updates a user in MongoDB

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL