Documentation ¶
Index ¶
- Variables
- func AddAlbum(album models.Album) error
- func AddCollaborator(id bson.ObjectId, collaborator models.Collaborator) error
- func AddModule(site models.Site, module string) error
- func AddTrack(track models.Track) error
- func AddUser(user models.User) (models.User, error)
- func AddVideo(video models.Video) error
- func AddVideoGroup(videoGroup models.VideoGroup) error
- func Connect(server string, database string)
- func CreateGallery(gallery models.Gallery) error
- func CreatePhoto(photo models.Photo) (models.Photo, error)
- func CreateSite(site models.Site) (models.Site, error)
- func CreateVerification(user models.User) (models.EmailVerification, error)
- func DeleteFile(fileID bson.ObjectId, siteID bson.ObjectId) error
- func DeleteGallery(id bson.ObjectId) error
- func DeletePhotos(userID bson.ObjectId, ids []bson.ObjectId) error
- func DeleteSite(site models.Site) error
- func DeleteVerification(verification models.EmailVerification) error
- func GetAbout(id bson.ObjectId) (models.AboutContent, error)
- func GetAlbum(ID bson.ObjectId) (models.Album, error)
- func GetAlbumByShortID(id string) (models.Album, error)
- func GetAlbumTracks(id bson.ObjectId) ([]models.Track, error)
- func GetAlbums(siteID bson.ObjectId) ([]models.Album, error)
- func GetArticle(id bson.ObjectId) (models.Article, error)
- func GetArticleByShortID(shortID string) (models.Article, error)
- func GetArticles(id bson.ObjectId) ([]models.Article, error)
- func GetContact(id bson.ObjectId) (models.ContactContent, error)
- func GetDefaultGallery(id bson.ObjectId) (models.Gallery, error)
- func GetGalleries(id bson.ObjectId) ([]models.Gallery, error)
- func GetGallery(id bson.ObjectId) (models.Gallery, error)
- func GetGalleryByShortID(shortID string) (models.Gallery, error)
- func GetGalleryPhotos(id bson.ObjectId) ([]models.Photo, error)
- func GetGroupVideos(id bson.ObjectId) ([]models.Video, error)
- func GetOwnedSites(id bson.ObjectId) ([]models.Site, error)
- func GetPhotoByID(id bson.ObjectId) (models.Photo, error)
- func GetPhotos(userID bson.ObjectId, ids []bson.ObjectId) ([]models.Photo, error)
- func GetProject(id bson.ObjectId) (models.Project, error)
- func GetProjectByShortID(shortID string) (models.Project, error)
- func GetProjects(id bson.ObjectId) ([]models.Project, error)
- func GetSiteByID(id bson.ObjectId) (models.Site, error)
- func GetSiteByName(name string) (models.Site, error)
- func GetSiteFiles(id bson.ObjectId) ([]models.File, error)
- func GetSitePhotos(id bson.ObjectId) ([]models.Photo, error)
- func GetSiteTotalSize(siteID bson.ObjectId) float64
- func GetSitesOfUser(user models.User) ([]models.Site, error)
- func GetTrack(trackID bson.ObjectId) (models.Track, error)
- func GetTrackByShortID(shortID string) (models.Track, error)
- func GetUser(email string) (models.User, error)
- func GetUserByEmail(email string) (models.User, error)
- func GetUserByID(id bson.ObjectId) (models.User, error)
- func GetVerificationByID(id bson.ObjectId) (models.EmailVerification, error)
- func GetVideo(videoID bson.ObjectId) (models.Video, error)
- func GetVideoGroup(ID bson.ObjectId) (models.VideoGroup, error)
- func GetVideoGroupByShortID(id string) (models.VideoGroup, error)
- func GetVideoGroups(siteID bson.ObjectId) ([]models.VideoGroup, error)
- func InsertEmailVerification(verification models.EmailVerification) error
- func InsertFile(file models.File) error
- func InsertPhoto(photo models.Photo) (models.Photo, error)
- func IsEmailRegistered(email string) bool
- func RemoveAlbum(id bson.ObjectId) error
- func RemoveArticle(id bson.ObjectId) error
- func RemoveCollaborator(id bson.ObjectId, email string) error
- func RemoveModule(site models.Site, module string) error
- func RemoveProject(id bson.ObjectId) error
- func RemoveTrack(id bson.ObjectId) error
- func RemoveUser(id bson.ObjectId) error
- func RemoveUserSubscription(user models.User) error
- func RemoveVideo(id bson.ObjectId) error
- func RemoveVideoGroup(id bson.ObjectId) error
- func SetDefaultGallery(site models.Site, gallery models.Gallery) error
- func SetGalleryPreview(gallery models.Gallery, photo models.Photo) error
- func SetSiteFavorite(user models.User, siteID bson.ObjectId) error
- func SetUserPro(id bson.ObjectId, customer *stripe.Customer, subscription *stripe.Subscription) error
- func SiteExists(name string) bool
- func TransferSite(site models.Site, lastOwner models.User, newOwner models.User) error
- func UpdateAbout(id bson.ObjectId, about models.AboutContent) error
- func UpdateAlbum(id bson.ObjectId, album models.Album) error
- func UpdateAlbumsIndexes(siteID bson.ObjectId, albums []models.Album) error
- func UpdateContact(id bson.ObjectId, content models.ContactContent) error
- func UpdateFilename(fileID bson.ObjectId, filename string, siteID bson.ObjectId) error
- func UpdateGalleriesIndexes(siteID bson.ObjectId, galleries []models.Gallery) error
- func UpdateGallery(id bson.ObjectId, gallery models.Gallery) error
- func UpdatePhoto(id bson.ObjectId, photo models.Photo) error
- func UpdatePhotoURL(id bson.ObjectId, url string) error
- func UpdatePhotosIndexes(gallery models.Gallery, photos []models.Photo) error
- func UpdateSite(id bson.ObjectId, data models.Site) error
- func UpdateTrack(id bson.ObjectId, track models.Track) error
- func UpdateTracksIndexes(siteID bson.ObjectId, tracks []models.Track) error
- func UpdateUser(user models.User, updateUser models.User) (models.User, error)
- func UpdateUserPassword(id bson.ObjectId, password string) error
- func UpdateVideo(id bson.ObjectId, video models.Video) error
- func UpdateVideoGroup(id bson.ObjectId, group models.VideoGroup) error
- func UpdateVideoGroupsIndexes(siteID bson.ObjectId, groups []models.VideoGroup) error
- func UpdateVideosIndexes(siteID bson.ObjectId, videos []models.Video) error
- func UpsertArticle(article models.Article) (models.Article, error)
- func UpsertProject(project models.Project) error
- func VerifyEmail(email string, r *http.Request) (bool, string)
- func VerifyUser(user models.User, verification models.EmailVerification) error
Constants ¶
This section is empty.
Variables ¶
var DB *mgo.Database
DB : Database holder
Functions ¶
func AddCollaborator ¶
func AddCollaborator(id bson.ObjectId, collaborator models.Collaborator) error
AddCollaborator : add collaborator to site
func AddVideoGroup ¶
func AddVideoGroup(videoGroup models.VideoGroup) error
AddVideoGroup : add video group to db
func CreateGallery ¶
CreateGallery : insert new gallery in db
func CreateSite ¶
CreateSite : insert site in db
func CreateVerification ¶
func CreateVerification(user models.User) (models.EmailVerification, error)
CreateVerification : insert a verification status in db
func DeleteFile ¶
DeleteFile : remove file from db
func DeleteGallery ¶
DeleteGallery remove gallery from db
func DeletePhotos ¶
DeletePhotos : delete multiple photos from db
func DeleteVerification ¶
func DeleteVerification(verification models.EmailVerification) error
DeleteVerification : remove verification from db
func GetAbout ¶
func GetAbout(id bson.ObjectId) (models.AboutContent, error)
GetAbout : return about content of site
func GetAlbumByShortID ¶
GetAlbumByShortID : return specific album by short_id
func GetAlbumTracks ¶
GetAlbumTracks : return array of track for specific album
func GetArticle ¶
GetArticle : return single article based by short_id
func GetArticleByShortID ¶
GetArticle : return single article based by short_id
func GetArticles ¶
GetArticles : return array of articles of site
func GetContact ¶
func GetContact(id bson.ObjectId) (models.ContactContent, error)
GetContact : return contact content
func GetDefaultGallery ¶
GetDefaultGallery return default gallery
func GetGalleries ¶
GetGalleries return site's galleries
func GetGallery ¶
GetGallery return specific gallery
func GetGalleryByShortID ¶
GetGallery return specific gallery
func GetGalleryPhotos ¶
GetGalleryPhotos return photos of gallery
func GetGroupVideos ¶
GetGroupVideos : return array of video from a videogroup
func GetOwnedSites ¶
GetOwnedSites : return only owned sites (and not the ones you might collaborate with)
func GetProject ¶
GetProject : return project using shortid
func GetProjectByShortID ¶
GetProject : return project using shortid
func GetProjects ¶
GetProjects : return projects of site
func GetSiteByID ¶
GetSiteByID : return specific site by ObjectID
func GetSiteByName ¶
GetSiteByName : return specific site
func GetSiteFiles ¶
GetSiteFiles : return array of file for site
func GetSitePhotos ¶
GetSitePhotos : return photos from site
func GetSiteTotalSize ¶
GetSiteTotalSize : return site size in MB
func GetSitesOfUser ¶
GetSitesOfUser : return array of Site of specific user
func GetTrackByShortID ¶
GetTrack : return specific track by shortID
func GetUserByEmail ¶
GetUserByEmail : return user by email
func GetUserByID ¶
GetUserByID : returns user object with id
func GetVerificationByID ¶
func GetVerificationByID(id bson.ObjectId) (models.EmailVerification, error)
GetVerificationByID : get email verification by id
func GetVideoGroup ¶
func GetVideoGroup(ID bson.ObjectId) (models.VideoGroup, error)
GetVideoGroup : return specific video group by ObjectID
func GetVideoGroupByShortID ¶
func GetVideoGroupByShortID(id string) (models.VideoGroup, error)
GetVideoGroupByShortID : return specific video group by short_id
func GetVideoGroups ¶
func GetVideoGroups(siteID bson.ObjectId) ([]models.VideoGroup, error)
GetVideoGroups : Return array of videogroup from site
func InsertEmailVerification ¶
func InsertEmailVerification(verification models.EmailVerification) error
InsertEmailVerification insert email verification object in db
func InsertPhoto ¶
InsertPhoto : insert photo in db
func IsEmailRegistered ¶
IsEmailRegistered checks if email already exists in db
func RemoveAlbum ¶
RemoveAlbum : delete album object from db
func RemoveArticle ¶
RemoveArticle : remove article from db
func RemoveCollaborator ¶
RemoveCollaborator : remove collaborator from site
func RemoveModule ¶
RemoveModule : remove module from site
func RemoveProject ¶
RemoveProject : remove project from db
func RemoveUserSubscription ¶
RemoveUserSubscription : remove pro subscription from user
func RemoveVideoGroup ¶
RemoveVideoGroup : remove video group from db
func SetDefaultGallery ¶
SetDefaultGallery : set a default gallery (useful for a homepage gallery for example)
func SetGalleryPreview ¶
SetGalleryPreview : set a gallery preview image
func SetSiteFavorite ¶
SetSiteFavorite : set site favorite
func SetUserPro ¶
func SetUserPro(id bson.ObjectId, customer *stripe.Customer, subscription *stripe.Subscription) error
SetUserPro : add pro subscription to user
func TransferSite ¶
TransferSite : Transfer the site to another user
func UpdateAbout ¶
func UpdateAbout(id bson.ObjectId, about models.AboutContent) error
UpdateAbout : update about content of site
func UpdateAlbum ¶
UpdateAlbum : update album (title, cover, description)
func UpdateAlbumsIndexes ¶
UpdateAlbumsIndexes : change order of albums
func UpdateContact ¶
func UpdateContact(id bson.ObjectId, content models.ContactContent) error
UpdateContact : update contact content
func UpdateFilename ¶
UpdateFilename : change the name of a file
func UpdateGalleriesIndexes ¶
UpdateGalleriesIndexes : Update galleries order
func UpdateGallery ¶
UpdateGallery update gallery
func UpdatePhoto ¶
UpdatePhoto updates title & content
func UpdatePhotosIndexes ¶
UpdatePhotosIndexes : update order of photos
func UpdateSite ¶
UpdateSite : update site data
func UpdateTrack ¶
UpdateTrack : update track informations (title, url, image)
func UpdateTracksIndexes ¶
UpdateTracksIndexes : update order of tracks
func UpdateUser ¶
UpdateUser : update user data
func UpdateUserPassword ¶
UpdateUserPassword : update user password, password is of course hashed
func UpdateVideo ¶
Updatevideo : update video informations (title, content, youtube_url)
func UpdateVideoGroup ¶
func UpdateVideoGroup(id bson.ObjectId, group models.VideoGroup) error
UpdateVideoGroup : update video group informations (title, image)
func UpdateVideoGroupsIndexes ¶
func UpdateVideoGroupsIndexes(siteID bson.ObjectId, groups []models.VideoGroup) error
UpdateVideoGroupsIndexes : Update order of video groups
func UpdateVideosIndexes ¶
UpdateVideosIndexes : update order of videos
func UpsertArticle ¶
UpsertArticle : create/update article
func UpsertProject ¶
UpsertProject Update or insert project
func VerifyEmail ¶
VerifyEmail : check email format and whether it's been assigned already or not
func VerifyUser ¶
func VerifyUser(user models.User, verification models.EmailVerification) error
VerifyUser : verify user
Types ¶
This section is empty.