Documentation ¶
Index ¶
- Constants
- Variables
- func AddDefaultUserAbilities(abilities []string)
- func AddUserAbilities(abilities []string)
- func DeleteAuthTokenByID(tokenID string, db *mgo.Database) error
- func DeleteAuthTokensByUser(userID string, db *mgo.Database) (int, error)
- func DeleteDeleteAccountProcessByUserID(userID string, db *mgo.Database) error
- func DeleteDeletedUserByUserID(userID string, db *mgo.Database) error
- func DeleteDisableAccountProcessByUserID(userID string, db *mgo.Database) error
- func DeleteDisabledUserByUserID(userID string, db *mgo.Database) error
- func DeleteExpiredAuthTokens(db *mgo.Database) (int, error)
- func DeleteForgotPasswordProcessByUserID(userID string, db *mgo.Database) error
- func DeleteUpdateEmailAddressProcessByUserID(userID string, db *mgo.Database) error
- func DeleteUpdatePasswordProcessByUserID(userID string, db *mgo.Database) error
- func DeleteUpdatePropertyProcessByUserIDAndType(userID, t string, db *mgo.Database) error
- func DeleteUpdateValidEmailAddressProcessByUserID(userID string, db *mgo.Database) error
- func DeleteUserByUserID(userID string, db *mgo.Database) error
- func DeleteUserNotifications(notificationsIDs []bson.ObjectId, db *mgo.Database) (int, error)
- func GetAnonymousUserID(db *mgo.Database) (string, error)
- func GetCountOfUserNotifications(userID string, db *mgo.Database) (int, error)
- func GetCountOfUserUnreadNotifications(userID string, db *mgo.Database) (int, error)
- func GetInactiveUserIDs(interval time.Duration, db *mgo.Database) ([]string, error)
- func GetNeverUsedUserIDs(interval time.Duration, db *mgo.Database) ([]string, error)
- func GetOldestUserNotifications(userID string, offset int, db *mgo.Database) ([]bson.ObjectId, error)
- func IsDisabledUserWithEmailAddressExisting(emailAddress string, db *mgo.Database) bool
- func IsDisabledUserWithFacebookUserIDExisting(userID string, db *mgo.Database) bool
- func IsDisabledUserWithGoogleUserIDExisting(userID string, db *mgo.Database) bool
- func IsDisabledUserWithUsernameExisting(username string, db *mgo.Database) bool
- func IsDisabledUserWithValidEmailAddressExisting(emailAddress string, db *mgo.Database) bool
- func IsUserWithEmailAddressExisting(emailAddress string, db *mgo.Database) bool
- func IsUserWithFacebookUserIDExisting(userID string, db *mgo.Database) bool
- func IsUserWithGoogleUserIDExisting(userID string, db *mgo.Database) bool
- func IsUserWithUsernameExisting(username string, db *mgo.Database) bool
- func IsUserWithValidEmailAddressExisting(emailAddress string, db *mgo.Database) bool
- func IsValidAuthToken(tokenID string, db *mgo.Database) bool
- type AdminAuthToken
- type AdminContact
- type AdminDevice
- type AdminDisabledUser
- type AdminIPLocation
- type AdminSummarizedContact
- type AdminUser
- type AdminUserPrivateInfos
- type AuthToken
- func (token *AuthToken) Delete(db *mgo.Database) error
- func (token *AuthToken) FromToken(t authentication.Token)
- func (token *AuthToken) GetByID(id string, db *mgo.Database) error
- func (token *AuthToken) GetID() string
- func (token *AuthToken) IsSaved() bool
- func (token *AuthToken) Save(db *mgo.Database) (string, error)
- func (token *AuthToken) SetID(id string)
- func (token *AuthToken) ToToken() authentication.Token
- func (token *AuthToken) Update(update interface{}, db *mgo.Database) error
- func (token *AuthToken) UpdateExpirationDate(expirationDate time.Time, db *mgo.Database) error
- func (token *AuthToken) UpdateLocation(location IPLocation, db *mgo.Database) error
- func (token *AuthToken) UpdateProperties(deviceName string, notificationsEnabled bool, notifications []string, ...) error
- type Contact
- func (contact *Contact) Delete(db *mgo.Database) error
- func (contact *Contact) GetByID(id string, db *mgo.Database) error
- func (contact *Contact) GetID() string
- func (contact *Contact) IsSaved() bool
- func (contact *Contact) Save(db *mgo.Database) (string, error)
- func (contact *Contact) SetID(id string)
- func (contact *Contact) Update(update interface{}, db *mgo.Database) error
- func (contact *Contact) UpdateDone(done bool, db *mgo.Database) error
- type DeletedUser
- func (deletedUser *DeletedUser) Delete(db *mgo.Database) error
- func (deletedUser *DeletedUser) GetByID(id string, db *mgo.Database) error
- func (deletedUser *DeletedUser) GetID() string
- func (deletedUser *DeletedUser) IsSaved() bool
- func (deletedUser *DeletedUser) Save(db *mgo.Database) (string, error)
- func (deletedUser *DeletedUser) SetID(id string)
- func (deletedUser *DeletedUser) Update(update interface{}, db *mgo.Database) error
- type Device
- type DeviceNotification
- type DisabledUser
- func (user *DisabledUser) Delete(db *mgo.Database) error
- func (user *DisabledUser) GetByID(id string, db *mgo.Database) error
- func (user *DisabledUser) GetID() string
- func (user *DisabledUser) IsSaved() bool
- func (user *DisabledUser) Save(db *mgo.Database) (string, error)
- func (user *DisabledUser) SetID(id string)
- func (user *DisabledUser) Update(update interface{}, db *mgo.Database) error
- type ForgotPasswordProcess
- func (fpp *ForgotPasswordProcess) Delete(db *mgo.Database) error
- func (fpp *ForgotPasswordProcess) GetByID(id string, db *mgo.Database) error
- func (fpp *ForgotPasswordProcess) GetByUserID(userID string, db *mgo.Database) error
- func (fpp *ForgotPasswordProcess) GetID() string
- func (fpp *ForgotPasswordProcess) Increment(db *mgo.Database) error
- func (fpp *ForgotPasswordProcess) IsSaved() bool
- func (fpp *ForgotPasswordProcess) Save(db *mgo.Database) (string, error)
- func (fpp *ForgotPasswordProcess) SetID(id string)
- func (fpp *ForgotPasswordProcess) Update(update interface{}, db *mgo.Database) error
- type IPLocation
- func (IPLocation *IPLocation) Delete(db *mgo.Database) error
- func (IPLocation *IPLocation) GetByID(id string, db *mgo.Database) error
- func (location *IPLocation) GetByIPAddress(IPAddress string, db *mgo.Database) error
- func (IPLocation *IPLocation) GetID() string
- func (location *IPLocation) IsEmpty() bool
- func (IPLocation *IPLocation) IsSaved() bool
- func (IPLocation *IPLocation) Save(db *mgo.Database) (string, error)
- func (IPLocation *IPLocation) SetID(id string)
- func (IPLocation *IPLocation) Update(update interface{}, db *mgo.Database) error
- type IPLocationCountry
- type Image
- type ImageSize
- type ImageStorage
- type Notification
- func (notification *Notification) Delete(db *mgo.Database) error
- func (notification *Notification) GetByID(id string, db *mgo.Database) error
- func (notification *Notification) GetID() string
- func (notification *Notification) IsSaved() bool
- func (notification *Notification) Save(db *mgo.Database) (string, error)
- func (notification *Notification) SetID(id string)
- func (notification *Notification) Update(update interface{}, db *mgo.Database) error
- func (notification *Notification) UpdateNotified(db *mgo.Database) error
- func (notification *Notification) UpdateRead(db *mgo.Database) error
- type NotificationLocale
- type OwnAuthToken
- type OwnDevice
- type OwnDeviceNotification
- type OwnIPLocation
- type OwnImage
- type OwnImageSize
- type OwnNotification
- type OwnSummarizedNotification
- type OwnUser
- type OwnUserPrivateInfos
- type OwnUserPublicInfos
- type OwnUserSettings
- type PublicImage
- type PublicImageSize
- type PublicSummarizedImage
- type SitemapUser
- type UpdatePropertyProcess
- func NewDeleteAccountProcess(userID string) *UpdatePropertyProcess
- func NewDisableAccountProcess(userID string) *UpdatePropertyProcess
- func NewUpdateEmailAddressProcess(userID, value string) *UpdatePropertyProcess
- func NewUpdatePasswordProcess(userID, value string) *UpdatePropertyProcess
- func NewUpdatePropertyProcess(userID, t, value string) *UpdatePropertyProcess
- func NewUpdateValidEmailAddressProcess(userID string) *UpdatePropertyProcess
- func (process *UpdatePropertyProcess) Delete(db *mgo.Database) error
- func (process *UpdatePropertyProcess) GetByID(id string, db *mgo.Database) error
- func (process *UpdatePropertyProcess) GetByUserIDAndType(userID, t string, db *mgo.Database) error
- func (process *UpdatePropertyProcess) GetDeleteAccountProcessByUserID(userID string, db *mgo.Database) error
- func (process *UpdatePropertyProcess) GetDisableAccountProcessByUserID(userID string, db *mgo.Database) error
- func (process *UpdatePropertyProcess) GetID() string
- func (process *UpdatePropertyProcess) GetUpdateEmailAddressProcessByUserID(userID string, db *mgo.Database) error
- func (process *UpdatePropertyProcess) GetUpdatePasswordProcessByUserID(userID string, db *mgo.Database) error
- func (process *UpdatePropertyProcess) GetUpdateValidEmailAddressProcessByUserID(userID string, db *mgo.Database) error
- func (process *UpdatePropertyProcess) Increment(db *mgo.Database) error
- func (process *UpdatePropertyProcess) IsSaved() bool
- func (process *UpdatePropertyProcess) Save(db *mgo.Database) (string, error)
- func (process *UpdatePropertyProcess) SetID(id string)
- func (process *UpdatePropertyProcess) Update(update interface{}, db *mgo.Database) error
- type User
- func (user *User) AcceptVersionOfTerms(version string, db *mgo.Database) error
- func (user *User) AddAbilities(abilities []string, db *mgo.Database) error
- func (user *User) CancelRegistrationByEmailAddress(code string, db *mgo.Database) error
- func (user *User) DecrementCountOfUnreadNotifications(db *mgo.Database) error
- func (user *User) Delete(db *mgo.Database) error
- func (user *User) GenerateUnsubscribeKey(notificationType string) string
- func (user *User) GetByEmailAddress(emailAddress string, db *mgo.Database) error
- func (user *User) GetByFacebookUserID(userID string, db *mgo.Database) error
- func (user *User) GetByGoogleUserID(userID string, db *mgo.Database) error
- func (user *User) GetByID(id string, db *mgo.Database) error
- func (user *User) GetByIDAndNotification(userID, notificationType string, db *mgo.Database) error
- func (user *User) GetByIdentifier(identifier string, db *mgo.Database) error
- func (user *User) GetByUsername(username string, db *mgo.Database) error
- func (user *User) GetID() string
- func (user *User) HasAbility(ability string) bool
- func (user *User) IsSaved() bool
- func (user *User) RegisterByEmailAddress(username, encryptedPassword, emailAddress, locale, termsVersion, ... string, ...) error
- func (user *User) RegisterByThirdPartyToken(username string, tokenInfos validator.TokenInfos, ...) error
- func (user *User) RemoveAbilities(abilities []string, db *mgo.Database) error
- func (user *User) Save(db *mgo.Database) (string, error)
- func (user *User) SaveFacebookInfos(token, userID, firstName, lastName, email string, ...) error
- func (user *User) SaveGoogleInfos(token, userID, firstName, lastName, email string, ...) error
- func (user *User) SetAbilities(abilities []string, db *mgo.Database) error
- func (user *User) SetAdmin(admin bool, db *mgo.Database) error
- func (user *User) SetEmailAddressValid(db *mgo.Database) error
- func (user *User) SetID(id string)
- func (user *User) ToUser() authentication.User
- func (user *User) UnsubscribeNotification(notificationType string, db *mgo.Database) error
- func (user *User) Update(update interface{}, db *mgo.Database) error
- func (user *User) UpdateAllInformations(firstName, lastName, emailAddress string, validEmailAddress bool, ...) error
- func (user *User) UpdateCountOfNotifications(total, unread int, db *mgo.Database) error
- func (user *User) UpdateEmailAddress(emailAddress string, db *mgo.Database) error
- func (user *User) UpdateImage(db *mgo.Database) error
- func (user *User) UpdateInfos(firstName, lastName string, db *mgo.Database) error
- func (user *User) UpdateLastLogin(db *mgo.Database) error
- func (user *User) UpdateNotifications(notifications []string, db *mgo.Database) error
- func (user *User) UpdatePassword(newPassword string, alreadyEncrypted bool, db *mgo.Database) error
- func (user *User) UpdatePublicProfile(locale, description string, db *mgo.Database) error
- func (user *User) UpdateSettings(locale, timezone string, db *mgo.Database) error
- func (user *User) UpdateSocialNetworks(facebook, twitter, instagram string, db *mgo.Database) error
- func (user *User) ValidateRegistrationByEmailAddress(code string, db *mgo.Database) error
- type UserIdentificationMethods
- type UserNotificationTarget
- type UserNotificationsStats
- type UserOAuthInfos
- type UserPrivateInfos
- type UserPublicInfos
- type UserRegistrationInfos
- type UserSettings
Constants ¶
const AuthTokenCollection = "authTokens"
AuthTokenCollection : collection name of the 'authToken' documents.
const ContactCollection = "contact"
ContactCollection : collection name of the 'contact' documents.
const DeletedUserCollection = "deletedUsers"
DeletedUserCollection : collection name of the 'deletedUsers' documents.
const DisabledUserCollection = "disabledUsers"
DisabledUserCollection : collection name of the 'disabledUsers' documents.
const ForgotPasswordProcessCollection = "forgotPassword"
ForgotPasswordProcessCollection : collection name of the 'forgotPassword' documents.
const IPLocationCollection = "IPLocation"
IPLocationCollection : collection name of the 'ipLocation' documents.
const NotificationCollection = "notifications"
NotificationCollection : collection name of the 'notifications' documents.
const UpdatePropertyProcessCollection = "updateProperty"
UpdatePropertyProcessCollection : collection name of the 'updateProperty' documents.
const UserCollection = "users"
UserCollection : collection name of the 'user' documents.
Variables ¶
var ( // UserMaxValidateRegistrationAttemps : maximum attempts to validate a registration. UserMaxValidateRegistrationAttemps uint = 5 // UserMaxDescriptionLength : maximum length of the description of an account. UserMaxDescriptionLength uint = 300 // UserMaxImageSize : maximum size of the image of the account (in bytes). UserMaxImageSize int64 = 2000000 // UserImagePath : path of the directory containing the user images. UserImagePath = "/images" // UserImageWidth : width of the user images (in px). UserImageWidth int64 = 800 // UserImageHeight : height of the user images (in px). UserImageHeight int64 = 800 // UserImageSmallVersion : true if the small version of the user's image must be generated. UserImageSmallVersion = true // UserImageThumbVersion : true if the small version of the user's image must be generated. UserImageThumbVersion = true )
var ( // AllUserAbilities : all the user abilities are listed here. AllUserAbilities = []string{ rights.AbilityToManageUsers, rights.AbilityToManageContacts, } // DefaultUserAbilities : these are the default abilities of the users. DefaultUserAbilities = []string{} )
Functions ¶
func AddDefaultUserAbilities ¶
func AddDefaultUserAbilities(abilities []string)
AddDefaultUserAbilities : add some abilities to the default user abilities list.
func AddUserAbilities ¶
func AddUserAbilities(abilities []string)
AddUserAbilities : add some abilities to the user abilities list.
func DeleteAuthTokenByID ¶
DeleteAuthTokenByID : deletes the document with the ID.
func DeleteAuthTokensByUser ¶
DeleteAuthTokensByUser : deletes the documents from the user.
func DeleteDeleteAccountProcessByUserID ¶
DeleteDeleteAccountProcessByUserID : deletes a process linked to a user.
func DeleteDeletedUserByUserID ¶
DeleteDeletedUserByUserID : deletes the document with the ID.
func DeleteDisableAccountProcessByUserID ¶
DeleteDisableAccountProcessByUserID : deletes a process linked to a user.
func DeleteDisabledUserByUserID ¶
DeleteDisabledUserByUserID : deletes the document with the ID.
func DeleteExpiredAuthTokens ¶
DeleteExpiredAuthTokens : deletes the expired auth tokens.
func DeleteForgotPasswordProcessByUserID ¶
DeleteForgotPasswordProcessByUserID : deletes all the documents linked to a user.
func DeleteUpdateEmailAddressProcessByUserID ¶
DeleteUpdateEmailAddressProcessByUserID : deletes a process linked to a user.
func DeleteUpdatePasswordProcessByUserID ¶
DeleteUpdatePasswordProcessByUserID : deletes a process linked to a user.
func DeleteUpdatePropertyProcessByUserIDAndType ¶
DeleteUpdatePropertyProcessByUserIDAndType : deletes a process linked to a user.
func DeleteUpdateValidEmailAddressProcessByUserID ¶
DeleteUpdateValidEmailAddressProcessByUserID : deletes a process linked to a user.
func DeleteUserByUserID ¶
DeleteUserByUserID : deletes the document with the ID.
func DeleteUserNotifications ¶
DeleteUserNotifications : deletes some notifications received by a user.
func GetAnonymousUserID ¶
GetAnonymousUserID : returns the ID of the anonymous user.
func GetCountOfUserNotifications ¶
GetCountOfUserNotifications : returns the count of notifications received by a user.
func GetCountOfUserUnreadNotifications ¶
GetCountOfUserUnreadNotifications : returns the count of unread notifications received by a user.
func GetInactiveUserIDs ¶
GetInactiveUserIDs : returns the ID of the inactive users.
func GetNeverUsedUserIDs ¶
GetNeverUsedUserIDs : deletes the never used accounts from interval.
func GetOldestUserNotifications ¶
func GetOldestUserNotifications(userID string, offset int, db *mgo.Database) ([]bson.ObjectId, error)
GetOldestUserNotifications : returns the IDs of the oldest notifications received by a user.
func IsDisabledUserWithEmailAddressExisting ¶
IsDisabledUserWithEmailAddressExisting : returns true if a disabled user with this email address is already existing.
func IsDisabledUserWithFacebookUserIDExisting ¶
IsDisabledUserWithFacebookUserIDExisting : returns true if a disabled user with this facebook user id is already existing.
func IsDisabledUserWithGoogleUserIDExisting ¶
IsDisabledUserWithGoogleUserIDExisting : returns true if a disabled user with this google user id is already existing.
func IsDisabledUserWithUsernameExisting ¶
IsDisabledUserWithUsernameExisting : returns true if a disabled user with this username is already existing.
func IsDisabledUserWithValidEmailAddressExisting ¶
IsDisabledUserWithValidEmailAddressExisting : returns true if a disabled user with this email address is already existing.
func IsUserWithEmailAddressExisting ¶
IsUserWithEmailAddressExisting : returns true if a user with this email address is already existing.
func IsUserWithFacebookUserIDExisting ¶
IsUserWithFacebookUserIDExisting : returns true if a user with this facebook user id is already existing.
func IsUserWithGoogleUserIDExisting ¶
IsUserWithGoogleUserIDExisting : returns true if a user with this google user id is already existing.
func IsUserWithUsernameExisting ¶
IsUserWithUsernameExisting : returns true if a user with this username is already existing.
func IsUserWithValidEmailAddressExisting ¶
IsUserWithValidEmailAddressExisting : returns true if a user with this email address is already existing.
Types ¶
type AdminAuthToken ¶
type AdminAuthToken struct { ID bson.ObjectId `json:"id"` Source string `json:"source"` Method string `json:"method"` Device AdminDevice `json:"device"` Location *AdminIPLocation `json:"location,omitempty"` CreatedAt time.Time `json:"created_at"` ExpiresAt time.Time `json:"expires_at"` }
AdminAuthToken : admin version of the AuthToken struct
func NewAdminAuthToken ¶
func NewAdminAuthToken(token *AuthToken) *AdminAuthToken
NewAdminAuthToken : returns a new 'AdminAuthToken' struct.
func (*AdminAuthToken) HasLocation ¶
func (token *AdminAuthToken) HasLocation() bool
HasLocation : returns true if the token has a defined location.
func (*AdminAuthToken) URLParams ¶
func (token *AdminAuthToken) URLParams() map[string]string
URLParams : returns a struct containing the parameters to use into a url.
type AdminContact ¶
type AdminContact Contact
AdminContact : admin version of the Contact struct
func NewAdminContact ¶
func NewAdminContact(contact *Contact) *AdminContact
NewAdminContact : returns a new 'AdminContact' struct.
func (AdminContact) URLParams ¶
func (contact AdminContact) URLParams() map[string]string
URLParams : returns a struct containing the parameters to use into a url.
type AdminDevice ¶
type AdminDevice struct { Name string `json:"name" bson:"name"` Details string `json:"details" bson:"details"` Type string `json:"type" bson:"type"` }
AdminDevice : struct
func NewAdminDevice ¶
func NewAdminDevice(device Device) AdminDevice
NewAdminDevice : returns a new 'AdminDevice' struct.
type AdminDisabledUser ¶
type AdminDisabledUser struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` Username string `json:"username" bson:"username"` Slug string `json:"slug" bson:"slug"` PrivateInfos UserPrivateInfos `json:"private_infos" bson:"privateInfos,omitempty"` Verified bool `json:"verified" bson:"verified"` }
AdminDisabledUser : properties of a disabled user for the admin.
func GetDisabledUsersForAdmin ¶
func GetDisabledUsersForAdmin(db *mgo.Database) ([]AdminDisabledUser, error)
GetDisabledUsersForAdmin : returns the disabled users for the admin.
func NewAdminDisabledUser ¶
func NewAdminDisabledUser(user *User) *AdminDisabledUser
NewAdminDisabledUser : returns a new 'AdminDisabledUser' struct.
func (AdminDisabledUser) URLParams ¶
func (user AdminDisabledUser) URLParams() map[string]string
URLParams : returns a struct containing the parameters to use into a url.
type AdminIPLocation ¶
type AdminIPLocation struct { IP string `json:"IP"` Region string `json:"region"` City string `json:"city"` Country IPLocationCountry `json:"country"` }
AdminIPLocation : admin version of the IPLocation struct
func NewAdminIPLocation ¶
func NewAdminIPLocation(location IPLocation) *AdminIPLocation
NewAdminIPLocation : returns a new 'AdminIPLocation' struct.
func (*AdminIPLocation) IsEmpty ¶
func (location *AdminIPLocation) IsEmpty() bool
IsEmpty : returns true if this location is empty.
type AdminSummarizedContact ¶
type AdminSummarizedContact struct { ID bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` EmailAddress string `json:"email_address" bson:"emailAddress"` Subject string `json:"subject" bson:"subject"` Done bool `json:"done" bson:"done"` CreatedAt time.Time `json:"created_at" bson:"createdAt"` }
AdminSummarizedContact : short version of a contact document.
func GetContactsForAdmin ¶
func GetContactsForAdmin(offset, limit int, db *mgo.Database) ([]AdminSummarizedContact, error)
GetContactsForAdmin : returns all the contacts.
func NewAdminSummarizedContact ¶
func NewAdminSummarizedContact(contact *Contact) AdminSummarizedContact
NewAdminSummarizedContact : returns a new 'AdminSummarizedContact' struct.
func (AdminSummarizedContact) URLParams ¶
func (contact AdminSummarizedContact) URLParams() map[string]string
URLParams : returns a struct containing the parameters to use into a url.
type AdminUser ¶
type AdminUser struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` Username string `json:"username" bson:"username"` PrivateInfos AdminUserPrivateInfos `json:"private_infos" bson:"privateInfos,omitempty"` Verified bool `json:"verified" bson:"verified"` }
AdminUser : admin version of the User struct
func GetEnabledUsersForAdmin ¶
GetEnabledUsersForAdmin : returns the enabled users for the admin.
func NewAdminUser ¶
NewAdminUser : returns a new 'AdminUser' struct.
type AdminUserPrivateInfos ¶
type AdminUserPrivateInfos struct { Email string `json:"email" bson:"email"` IsEmailValid bool `json:"is_email_valid" bson:"isEmailValid"` }
AdminUserPrivateInfos : admin version of the UserPrivateInfos struct
type AuthToken ¶
type AuthToken struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` UserID bson.ObjectId `json:"-" bson:"userId,omitempty"` Source string `json:"source" bson:"source"` Method string `json:"method" bson:"method"` Device Device `json:"device" bson:"device"` Location *IPLocation `json:"location,omitempty" bson:"location,omitempty"` Key string `json:"key" bson:"key"` CreatedAt time.Time `json:"created_at" bson:"createdAt"` ExpiresAt time.Time `json:"expires_at" bson:"expiresAt"` }
AuthToken : authentication token properties.
func GetAuthTokens ¶
GetAuthTokens : returns all the auth tokens of a user.
func (*AuthToken) Delete ¶
Delete : deletes the 'AuthToken' document from the collection, returns an error if needed.
func (*AuthToken) FromToken ¶
func (token *AuthToken) FromToken(t authentication.Token)
FromToken : fills this struct from an 'authentication.Token'.
func (*AuthToken) GetByID ¶
GetByID : initializes the 'AuthToken' struct from the 'AuthToken' document with the ID.
func (*AuthToken) IsSaved ¶
IsSaved : returns true if the 'AuthToken' document if saved in the collection.
func (*AuthToken) Save ¶
Save : inserts the 'AuthToken' document in the collection, returns an error if needed.
func (*AuthToken) ToToken ¶
func (token *AuthToken) ToToken() authentication.Token
ToToken : returns an 'authentication.Token' struct from this struct.
func (*AuthToken) UpdateExpirationDate ¶
UpdateExpirationDate : updates the expiration date of the token.
func (*AuthToken) UpdateLocation ¶
func (token *AuthToken) UpdateLocation(location IPLocation, db *mgo.Database) error
UpdateLocation : updates some properties of the token.
type Contact ¶
type Contact struct { ID bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` EmailAddress string `json:"email_address" bson:"emailAddress"` Subject string `json:"subject" bson:"subject"` Text string `json:"text" bson:"text"` Done bool `json:"done" bson:"done"` CreatedAt time.Time `json:"created_at" bson:"createdAt"` }
Contact : contact properties.
func (*Contact) Delete ¶
Delete : deletes the 'Contact' document from the collection, returns an error if needed.
func (*Contact) GetByID ¶
GetByID : initializes the 'Contact' struct from the 'Contact' document with the ID.
func (*Contact) IsSaved ¶
IsSaved : returns true if the 'Contact' document if saved in the collection.
func (*Contact) Save ¶
Save : inserts the 'Contact' document in the collection, returns an error if needed.
type DeletedUser ¶
type DeletedUser struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` UserID bson.ObjectId `json:"-" bson:"userId,omitempty"` CreatedAt time.Time `json:"created_at" bson:"createdAt"` }
DeletedUser : deleted user properties.
func NewDeletedUser ¶
func NewDeletedUser(userID string) *DeletedUser
NewDeletedUser : returns a new 'DeletedUser' struct.
func (*DeletedUser) Delete ¶
func (deletedUser *DeletedUser) Delete(db *mgo.Database) error
Delete : deletes the 'DeletedUser' document from the collection, returns an error if needed.
func (*DeletedUser) GetByID ¶
func (deletedUser *DeletedUser) GetByID(id string, db *mgo.Database) error
GetByID : initializes the 'DeletedUser' struct from the 'DeletedUser' document with the ID.
func (*DeletedUser) GetID ¶
func (deletedUser *DeletedUser) GetID() string
GetID : returns the 'DeletedUser' ID.
func (*DeletedUser) IsSaved ¶
func (deletedUser *DeletedUser) IsSaved() bool
IsSaved : returns true if the 'DeletedUser' document if saved in the collection.
func (*DeletedUser) Save ¶
func (deletedUser *DeletedUser) Save(db *mgo.Database) (string, error)
Save : inserts the 'DeletedUser' document in the collection, returns an error if needed.
func (*DeletedUser) SetID ¶
func (deletedUser *DeletedUser) SetID(id string)
SetID : initializes the 'DeletedUser' ID.
type Device ¶
type Device struct { Name string `json:"name" bson:"name"` Details string `json:"details" bson:"details"` Type string `json:"type" bson:"type"` UDID string `json:"udid,omitempty" bson:"udid,omitempty"` RawName string `json:"raw_name" bson:"rawName"` NotificationSettings DeviceNotification `json:"notification_settings" bson:"notificationSettings"` }
Device : struct of a device.
func (*Device) FromDevice ¶
func (device *Device) FromDevice(d authentication.Device)
FromDevice : fills this struct from a struct authentication.Device.
func (*Device) ToDevice ¶
func (device *Device) ToDevice() *authentication.Device
ToDevice : returns a struct authentication.Device from this device struct.
type DeviceNotification ¶
type DeviceNotification struct { Token string `json:"token,omitempty" bson:"token,omitempty"` Enabled bool `json:"enabled" bson:"enabled"` Notifications []string `json:"notifications" bson:"notifications"` }
DeviceNotification : settings of the notifications on a device.
type DisabledUser ¶
type DisabledUser struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` UserID bson.ObjectId `json:"user_id" bson:"userId"` Username string `json:"username" bson:"username"` Slug string `json:"slug" bson:"slug"` Abilities []string `json:"abilities,omitempty" bson:"abilities,omitempty"` Notifications []string `json:"notifications" bson:"notifications"` NotificationsStats UserNotificationsStats `json:"notifications_stats" bson:"notificationsStats"` IdentificationMethods UserIdentificationMethods `json:"identification_methods,omitempty" bson:"identificationMethods,omitempty"` PublicInfos UserPublicInfos `json:"public_infos" bson:"publicInfos,omitempty"` PrivateInfos UserPrivateInfos `json:"private_infos" bson:"privateInfos,omitempty"` RegistrationInfos UserRegistrationInfos `json:"registration_infos,omitempty" bson:"registrationInfos,omitempty"` Settings UserSettings `json:"settings" bson:"settings"` IsAdmin bool `json:"is_admin" bson:"isAdmin"` IsAnonymous bool `json:"is_anonymous" bson:"isAnonymous"` Verified bool `json:"verified" bson:"verified"` VersionOfTermsAccepted string `json:"version_of_terms_accepted" bson:"versionOfTermsAccepted"` PrivateKey string `json:"-" bson:"privateKey"` DisabledAt time.Time `json:"disabled_at" bson:"disabledAt"` }
DisabledUser : properties of a disabled user.
func NewDisabledUser ¶
func NewDisabledUser(user *User) *DisabledUser
NewDisabledUser : returns a new 'DisabledUser' struct.
func (*DisabledUser) Delete ¶
func (user *DisabledUser) Delete(db *mgo.Database) error
Delete : deletes the 'DisabledUser' document from the collection, returns an error if needed.
func (*DisabledUser) GetByID ¶
func (user *DisabledUser) GetByID(id string, db *mgo.Database) error
GetByID : initializes the 'DisabledUser' struct from the 'DisabledUser' document with the ID.
func (*DisabledUser) GetID ¶
func (user *DisabledUser) GetID() string
GetID : returns the 'DisabledUser' ID.
func (*DisabledUser) IsSaved ¶
func (user *DisabledUser) IsSaved() bool
IsSaved : returns true if the 'DisabledUser' document if saved in the collection.
func (*DisabledUser) Save ¶
func (user *DisabledUser) Save(db *mgo.Database) (string, error)
Save : inserts the 'DisabledUser' document in the collection, returns an error if needed.
func (*DisabledUser) SetID ¶
func (user *DisabledUser) SetID(id string)
SetID : initializes the 'DisabledUser' ID.
type ForgotPasswordProcess ¶
type ForgotPasswordProcess struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` UserID bson.ObjectId `json:"user_id" bson:"userId"` Code string `json:"code" bson:"code"` Tries uint `json:"-" bson:"tries"` }
ForgotPasswordProcess : details about the password to update.
func NewForgotPasswordProcess ¶
func NewForgotPasswordProcess(userID string) *ForgotPasswordProcess
NewForgotPasswordProcess : returns a new 'ForgotPasswordProcess' struct.
func (*ForgotPasswordProcess) Delete ¶
func (fpp *ForgotPasswordProcess) Delete(db *mgo.Database) error
Delete : deletes the 'ForgotPasswordProcess' document from the collection, returns an error if needed.
func (*ForgotPasswordProcess) GetByID ¶
func (fpp *ForgotPasswordProcess) GetByID(id string, db *mgo.Database) error
GetByID : initializes the 'ForgotPasswordProcess' struct from the 'user' document with the ID.
func (*ForgotPasswordProcess) GetByUserID ¶
func (fpp *ForgotPasswordProcess) GetByUserID(userID string, db *mgo.Database) error
GetByUserID : returns a ForgotPasswordProcess struct with a user.
func (*ForgotPasswordProcess) GetID ¶
func (fpp *ForgotPasswordProcess) GetID() string
GetID : returns the 'ForgotPasswordProcess' ID.
func (*ForgotPasswordProcess) Increment ¶
func (fpp *ForgotPasswordProcess) Increment(db *mgo.Database) error
Increment : increments the tries of a forgot password proccess document.
func (*ForgotPasswordProcess) IsSaved ¶
func (fpp *ForgotPasswordProcess) IsSaved() bool
IsSaved : returns true if the 'ForgotPasswordProcess' document if saved in the collection.
func (*ForgotPasswordProcess) Save ¶
func (fpp *ForgotPasswordProcess) Save(db *mgo.Database) (string, error)
Save : inserts the 'ForgotPasswordProcess' document in the collection, returns an error if needed.
func (*ForgotPasswordProcess) SetID ¶
func (fpp *ForgotPasswordProcess) SetID(id string)
SetID : initializes the 'ForgotPasswordProcess' ID.
type IPLocation ¶
type IPLocation struct { ID bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` IP string `json:"IP" bson:"IP"` Region string `json:"region" bson:"region"` City string `json:"city" bson:"city"` Country IPLocationCountry `json:"country" bson:"country"` }
IPLocation : IP location properties.
func NewIPLocation ¶
func NewIPLocation() *IPLocation
NewIPLocation : returns a new 'IPLocation' struct.
func (*IPLocation) Delete ¶
func (IPLocation *IPLocation) Delete(db *mgo.Database) error
Delete : deletes the 'IPLocation' document from the collection, returns an error if needed.
func (*IPLocation) GetByID ¶
func (IPLocation *IPLocation) GetByID(id string, db *mgo.Database) error
GetByID : initializes the 'IPLocation' struct from the 'IPLocation' document with the ID.
func (*IPLocation) GetByIPAddress ¶
func (location *IPLocation) GetByIPAddress(IPAddress string, db *mgo.Database) error
GetByIPAddress : initializes the 'IPLocation' struct from the 'IPLocation' document with the IP Address.
func (*IPLocation) GetID ¶
func (IPLocation *IPLocation) GetID() string
GetID : returns the 'IPLocation' ID.
func (*IPLocation) IsEmpty ¶
func (location *IPLocation) IsEmpty() bool
IsEmpty : returns true if this location is empty.
func (*IPLocation) IsSaved ¶
func (IPLocation *IPLocation) IsSaved() bool
IsSaved : returns true if the 'IPLocation' document if saved in the collection.
func (*IPLocation) Save ¶
func (IPLocation *IPLocation) Save(db *mgo.Database) (string, error)
Save : inserts the 'IPLocation' document in the collection, returns an error if needed.
func (*IPLocation) SetID ¶
func (IPLocation *IPLocation) SetID(id string)
SetID : initializes the 'IPLocation' ID.
type IPLocationCountry ¶
type IPLocationCountry struct { Code string `json:"code" bson:"code"` Name string `json:"name" bson:"name"` }
IPLocationCountry : IP location country properties.
type Image ¶
type Image struct { Full ImageSize `json:"full" bson:"full"` Small ImageSize `json:"small" bson:"small"` Thumb ImageSize `json:"thumbnail" bson:"thumb"` }
Image : struct of a image.
type ImageSize ¶
type ImageSize struct { Size1x ImageStorage `json:"size1x" bson:"size1x"` Size2x ImageStorage `json:"size2x" bson:"size2x"` }
ImageSize : struct of the size of an image.
type ImageStorage ¶
type ImageStorage struct { Path string `json:"path" bson:"path"` URL string `json:"url" bson:"url"` }
ImageStorage : struct of the size of an image storage.
type Notification ¶
type Notification struct { ID bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` UserID bson.ObjectId `json:"user_id" bson:"userId"` Type string `json:"type" bson:"type"` Data string `json:"data" bson:"data"` Image PublicImage `json:"image,omitempty" bson:"image,omitempty"` Locales map[string]NotificationLocale `json:"locales" bson:"locales"` Read bool `json:"read" bson:"read"` Notified bool `json:"notified" bson:"notified"` CreatedAt time.Time `json:"created_at" bson:"createdAt"` }
Notification : notification properties.
func GetUserNotifications ¶
func GetUserNotifications(userID string, db *mgo.Database) ([]Notification, error)
GetUserNotifications : returns the latest notifications received by a user.
func NewNotification ¶
func NewNotification() *Notification
NewNotification : returns a new 'Notification' struct.
func (*Notification) Delete ¶
func (notification *Notification) Delete(db *mgo.Database) error
Delete : deletes the 'Notification' document from the collection, returns an error if needed.
func (*Notification) GetByID ¶
func (notification *Notification) GetByID(id string, db *mgo.Database) error
GetByID : initializes the 'Notification' struct from the 'Notification' document with the ID.
func (*Notification) GetID ¶
func (notification *Notification) GetID() string
GetID : returns the 'Notification' ID.
func (*Notification) IsSaved ¶
func (notification *Notification) IsSaved() bool
IsSaved : returns true if the 'Notification' document if saved in the collection.
func (*Notification) Save ¶
func (notification *Notification) Save(db *mgo.Database) (string, error)
Save : inserts the 'Notification' document in the collection, returns an error if needed.
func (*Notification) SetID ¶
func (notification *Notification) SetID(id string)
SetID : initializes the 'Notification' ID.
func (*Notification) Update ¶
func (notification *Notification) Update(update interface{}, db *mgo.Database) error
Update : updates the 'Notification' document, returns an error if needed.
func (*Notification) UpdateNotified ¶
func (notification *Notification) UpdateNotified(db *mgo.Database) error
UpdateNotified : updated the notified property of a notification received by a user.
func (*Notification) UpdateRead ¶
func (notification *Notification) UpdateRead(db *mgo.Database) error
UpdateRead : updated the read property of a notification received by a user.
type NotificationLocale ¶
type NotificationLocale struct { Title string `json:"title" bson:"title"` Text string `json:"text" bson:"text"` // long description Preview string `json:"preview" bson:"preview"` // short description }
NotificationLocale : struct of a locale of a notification.
type OwnAuthToken ¶
type OwnAuthToken struct { ID bson.ObjectId `json:"id"` Source string `json:"source"` Method string `json:"method"` Device OwnDevice `json:"device"` Location *OwnIPLocation `json:"location,omitempty"` CreatedAt time.Time `json:"created_at"` ExpiresAt time.Time `json:"expires_at"` }
OwnAuthToken : public version of the AuthToken struct
func NewOwnAuthToken ¶
func NewOwnAuthToken(token *AuthToken) *OwnAuthToken
NewOwnAuthToken : returns a new 'OwnAuthToken' struct.
func (*OwnAuthToken) HasLocation ¶
func (token *OwnAuthToken) HasLocation() bool
HasLocation : returns true if the token has a defined location.
func (*OwnAuthToken) URLParams ¶
func (token *OwnAuthToken) URLParams() map[string]string
URLParams : returns a struct containing the parameters to use into a url.
type OwnDevice ¶
type OwnDevice struct { Name string `json:"name" bson:"name"` Details string `json:"details" bson:"details"` Type string `json:"type" bson:"type"` NotificationSettings OwnDeviceNotification `json:"notification_settings" bson:"notificationSettings"` }
OwnDevice : struct
func NewOwnDevice ¶
NewOwnDevice : returns a new 'OwnDevice' struct.
type OwnDeviceNotification ¶
type OwnDeviceNotification struct { Enabled bool `json:"enabled" bson:"enabled"` Notifications []string `json:"notifications" bson:"notifications"` }
OwnDeviceNotification : struct
func NewOwnDeviceNotification ¶
func NewOwnDeviceNotification(deviceNotification DeviceNotification) OwnDeviceNotification
NewOwnDeviceNotification : returns a new 'OwnDeviceNotification' struct.
type OwnIPLocation ¶
type OwnIPLocation struct { IP string `json:"IP"` Region string `json:"region"` City string `json:"city"` Country IPLocationCountry `json:"country"` }
OwnIPLocation : public version of the IPLocation struct
func NewOwnIPLocation ¶
func NewOwnIPLocation(location IPLocation) *OwnIPLocation
NewOwnIPLocation : returns a new 'OwnIPLocation' struct.
func (*OwnIPLocation) IsEmpty ¶
func (location *OwnIPLocation) IsEmpty() bool
IsEmpty : returns true if this location is empty.
type OwnImage ¶
type OwnImage struct { Full OwnImageSize `json:"full" bson:"full"` Small OwnImageSize `json:"small" bson:"small"` Thumb OwnImageSize `json:"thumbnail" bson:"thumb"` }
OwnImage : struct of an image.
func NewOwnImage ¶
NewOwnImage : returns a new 'OwnImage' struct.
type OwnImageSize ¶
type OwnImageSize struct { Size1x string `json:"size1x" bson:"size1x"` Size2x string `json:"size2x" bson:"size2x"` }
OwnImageSize : struct of the size of an image.
type OwnNotification ¶
type OwnNotification struct { ID bson.ObjectId `json:"id,omitempty"` Type string `json:"type"` Data string `json:"data"` Image OwnImageSize `json:"image,omitempty"` Title string `json:"title"` Text string `json:"text"` Read bool `json:"read"` Notified bool `json:"notified"` CreatedAt time.Time `json:"created_at"` }
OwnNotification : own version of the Notification struct
func NewOwnNotification ¶
func NewOwnNotification(notification Notification, locale, defaultLocale string) OwnNotification
NewOwnNotification : returns a new 'OwnNotification' struct.
func (OwnNotification) URLParams ¶
func (notification OwnNotification) URLParams() map[string]string
URLParams : returns a struct containing the parameters to use into a url.
type OwnSummarizedNotification ¶
type OwnSummarizedNotification struct { ID bson.ObjectId `json:"id,omitempty"` Type string `json:"type"` Image OwnImageSize `json:"image,omitempty"` Title string `json:"title"` Preview string `json:"preview"` Read bool `json:"read"` Notified bool `json:"notified"` }
OwnSummarizedNotification : own version of the Notification struct
func NewOwnSummarizedNotification ¶
func NewOwnSummarizedNotification(notification Notification, locale, defaultLocale string) OwnSummarizedNotification
NewOwnSummarizedNotification : returns a new 'OwnSummarizedNotification' struct.
func (OwnSummarizedNotification) URLParams ¶
func (notification OwnSummarizedNotification) URLParams() map[string]string
URLParams : returns a struct containing the parameters to use into a url.
type OwnUser ¶
type OwnUser struct { ID bson.ObjectId `json:"id"` Username string `json:"username"` PublicInfos OwnUserPublicInfos `json:"public_infos"` PrivateInfos OwnUserPrivateInfos `json:"private_infos"` Settings OwnUserSettings `json:"settings"` Abilities []string `json:"abilities"` Verified bool `json:"verified"` VersionOfTermsAccepted string `json:"version_of_terms_accepted"` }
OwnUser : public version of the User struct
func (*OwnUser) HasAbility ¶
HasAbility : returns true if the user has the ability.
type OwnUserPrivateInfos ¶
type OwnUserPrivateInfos struct { FirstName string `json:"first_name"` LastName string `json:"last_name"` Email string `json:"email"` IsEmailValid bool `json:"is_email_valid"` }
OwnUserPrivateInfos : public version of the UserPrivateInfos struct
type OwnUserPublicInfos ¶
type OwnUserPublicInfos struct { Description map[string]string `json:"description,omitempty"` Facebook string `json:"facebook,omitempty"` Twitter string `json:"twitter,omitempty"` Instagram string `json:"instagram,omitempty"` Image OwnImage `json:"image,omitempty"` }
OwnUserPublicInfos : public informations of a user.
func (*OwnUserPublicInfos) LocalizedDescription ¶
func (publicInfos *OwnUserPublicInfos) LocalizedDescription(locale string) string
LocalizedDescription : returns the localized description of a user.
type OwnUserSettings ¶
type OwnUserSettings struct { Locale string `json:"locale" bson:"locale"` Timezone string `json:"timezone" bson:"timezone"` }
OwnUserSettings : settings of a user.
type PublicImage ¶
type PublicImage struct { Full PublicImageSize `json:"full" bson:"full"` Small PublicImageSize `json:"small" bson:"small"` Thumb PublicImageSize `json:"thumbnail" bson:"thumb"` }
PublicImage : struct of an image.
func NewPublicImage ¶
func NewPublicImage(image Image) PublicImage
NewPublicImage : returns a new 'PublicImage' struct.
type PublicImageSize ¶
type PublicImageSize struct { Size1x string `json:"size1x" bson:"size1x"` Size2x string `json:"size2x" bson:"size2x"` }
PublicImageSize : struct of the size of an image.
type PublicSummarizedImage ¶
type PublicSummarizedImage PublicImageSize
PublicSummarizedImage : struct of an image.
func NewPublicSummarizedImage ¶
func NewPublicSummarizedImage(image Image) PublicSummarizedImage
NewPublicSummarizedImage : returns a new 'PublicSummarizedImage' struct.
func NewPublicSummarizedImageFromPublicImage ¶
func NewPublicSummarizedImageFromPublicImage(image PublicImage) PublicSummarizedImage
NewPublicSummarizedImageFromPublicImage : returns a new 'PublicSummarizedImage' struct.
type SitemapUser ¶
type SitemapUser struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` Slug string `json:"slug" bson:"slug"` }
SitemapUser : sitemap version of the User struct
func GetSitemapUsers ¶
func GetSitemapUsers(offset, limit int, db *mgo.Database) ([]SitemapUser, error)
GetSitemapUsers : returns users.
func NewSitemapUser ¶
func NewSitemapUser(user User) SitemapUser
NewSitemapUser : returns a new 'SitemapUser' struct.
type UpdatePropertyProcess ¶
type UpdatePropertyProcess struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` UserID bson.ObjectId `json:"user_id" bson:"userId"` Type string `json:"type" bson:"type"` Value string `json:"value" bson:"value"` Code string `json:"code" bson:"code"` Tries uint `json:"-" bson:"tries"` TTLKey string `json:"-" bson:"userIdtype"` // This field is indexed with a TTL. A TTL index must use only one field, so the pair 'userId / type' can not be used. }
UpdatePropertyProcess : details about a property to update.
func NewDeleteAccountProcess ¶
func NewDeleteAccountProcess(userID string) *UpdatePropertyProcess
NewDeleteAccountProcess : returns a new 'UpdatePropertyProcess' struct.
func NewDisableAccountProcess ¶
func NewDisableAccountProcess(userID string) *UpdatePropertyProcess
NewDisableAccountProcess : returns a new 'UpdatePropertyProcess' struct.
func NewUpdateEmailAddressProcess ¶
func NewUpdateEmailAddressProcess(userID, value string) *UpdatePropertyProcess
NewUpdateEmailAddressProcess : returns a new 'UpdatePropertyProcess' struct.
func NewUpdatePasswordProcess ¶
func NewUpdatePasswordProcess(userID, value string) *UpdatePropertyProcess
NewUpdatePasswordProcess : returns a new 'UpdatePropertyProcess' struct.
func NewUpdatePropertyProcess ¶
func NewUpdatePropertyProcess(userID, t, value string) *UpdatePropertyProcess
NewUpdatePropertyProcess : returns a new 'UpdatePropertyProcess' struct.
func NewUpdateValidEmailAddressProcess ¶
func NewUpdateValidEmailAddressProcess(userID string) *UpdatePropertyProcess
NewUpdateValidEmailAddressProcess : returns a new 'UpdatePropertyProcess' struct.
func (*UpdatePropertyProcess) Delete ¶
func (process *UpdatePropertyProcess) Delete(db *mgo.Database) error
Delete : deletes the 'UpdatePropertyProcess' document from the collection, returns an error if needed.
func (*UpdatePropertyProcess) GetByID ¶
func (process *UpdatePropertyProcess) GetByID(id string, db *mgo.Database) error
GetByID : initializes the 'UpdatePropertyProcess' struct from the 'user' document with the ID.
func (*UpdatePropertyProcess) GetByUserIDAndType ¶
func (process *UpdatePropertyProcess) GetByUserIDAndType(userID, t string, db *mgo.Database) error
GetByUserIDAndType : returns a UpdatePropertyProcess struct with a user.
func (*UpdatePropertyProcess) GetDeleteAccountProcessByUserID ¶
func (process *UpdatePropertyProcess) GetDeleteAccountProcessByUserID(userID string, db *mgo.Database) error
GetDeleteAccountProcessByUserID : returns a UpdatePropertyProcess struct with a user.
func (*UpdatePropertyProcess) GetDisableAccountProcessByUserID ¶
func (process *UpdatePropertyProcess) GetDisableAccountProcessByUserID(userID string, db *mgo.Database) error
GetDisableAccountProcessByUserID : returns a UpdatePropertyProcess struct with a user.
func (*UpdatePropertyProcess) GetID ¶
func (process *UpdatePropertyProcess) GetID() string
GetID : returns the 'UpdatePropertyProcess' ID.
func (*UpdatePropertyProcess) GetUpdateEmailAddressProcessByUserID ¶
func (process *UpdatePropertyProcess) GetUpdateEmailAddressProcessByUserID(userID string, db *mgo.Database) error
GetUpdateEmailAddressProcessByUserID : returns a UpdatePropertyProcess struct with a user.
func (*UpdatePropertyProcess) GetUpdatePasswordProcessByUserID ¶
func (process *UpdatePropertyProcess) GetUpdatePasswordProcessByUserID(userID string, db *mgo.Database) error
GetUpdatePasswordProcessByUserID : returns a UpdatePropertyProcess struct with a user.
func (*UpdatePropertyProcess) GetUpdateValidEmailAddressProcessByUserID ¶
func (process *UpdatePropertyProcess) GetUpdateValidEmailAddressProcessByUserID(userID string, db *mgo.Database) error
GetUpdateValidEmailAddressProcessByUserID : returns a UpdatePropertyProcess struct with a user.
func (*UpdatePropertyProcess) Increment ¶
func (process *UpdatePropertyProcess) Increment(db *mgo.Database) error
Increment : increments the tries of a UpdatePropertyProcess document.
func (*UpdatePropertyProcess) IsSaved ¶
func (process *UpdatePropertyProcess) IsSaved() bool
IsSaved : returns true if the 'UpdatePropertyProcess' document if saved in the collection.
func (*UpdatePropertyProcess) Save ¶
func (process *UpdatePropertyProcess) Save(db *mgo.Database) (string, error)
Save : inserts the 'UpdatePropertyProcess' document in the collection, returns an error if needed.
func (*UpdatePropertyProcess) SetID ¶
func (process *UpdatePropertyProcess) SetID(id string)
SetID : initializes the 'UpdatePropertyProcess' ID.
type User ¶
type User struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` Username string `json:"username" bson:"username"` Slug string `json:"slug" bson:"slug"` Abilities []string `json:"abilities,omitempty" bson:"abilities,omitempty"` Notifications []string `json:"notifications" bson:"notifications"` NotificationsStats UserNotificationsStats `json:"notifications_stats" bson:"notificationsStats"` IdentificationMethods UserIdentificationMethods `json:"identification_methods,omitempty" bson:"identificationMethods,omitempty"` PublicInfos UserPublicInfos `json:"public_infos" bson:"publicInfos,omitempty"` PrivateInfos UserPrivateInfos `json:"private_infos" bson:"privateInfos,omitempty"` RegistrationInfos UserRegistrationInfos `json:"registration_infos,omitempty" bson:"registrationInfos,omitempty"` Settings UserSettings `json:"settings" bson:"settings"` IsAdmin bool `json:"is_admin" bson:"isAdmin"` IsAnonymous bool `json:"is_anonymous" bson:"isAnonymous"` Verified bool `json:"verified" bson:"verified"` LastLogin time.Time `json:"last_login,omitempty" bson:"lastLogin,omitempty"` VersionOfTermsAccepted string `json:"version_of_terms_accepted" bson:"versionOfTermsAccepted"` PrivateKey string `json:"-" bson:"privateKey"` }
User : properties of a user.
func GetAnonymousUser ¶
GetAnonymousUser : returns the anonymous user.
func GetUsersWithAbility ¶
GetUsersWithAbility : return the users with an ability.
func NewUserFromDisabledUser ¶
func NewUserFromDisabledUser(user *DisabledUser) *User
NewUserFromDisabledUser : returns a new 'User' struct.
func UserFromAuthToken ¶
UserFromAuthToken : returns a user with the values of a auth token.
func UserWithID ¶
UserWithID : returns a struct 'user' with a ID.
func (*User) AcceptVersionOfTerms ¶
AcceptVersionOfTerms : updates the version of the terms accepted.
func (*User) AddAbilities ¶
AddAbilities : adds some abilities to a user and saves the changes, returns an error if needed.
func (*User) CancelRegistrationByEmailAddress ¶
CancelRegistrationByEmailAddress : cancel the registration by email address.
func (*User) DecrementCountOfUnreadNotifications ¶
DecrementCountOfUnreadNotifications : decrements the count of unread notifications received by the user.
func (*User) Delete ¶
Delete : deletes the 'user' document from the collection, returns an error if needed.
func (*User) GenerateUnsubscribeKey ¶
GenerateUnsubscribeKey : generates an unsubscribe key. This key is using to unsubscribe a notification by email without authorization.
func (*User) GetByEmailAddress ¶
GetByEmailAddress : initializes the 'User' struct from the 'user' document with the email address.
func (*User) GetByFacebookUserID ¶
GetByFacebookUserID : initializes the 'User' struct from the 'user' document with the facebook userId.
func (*User) GetByGoogleUserID ¶
GetByGoogleUserID : initializes the 'User' struct from the 'user' document with the google userId.
func (*User) GetByID ¶
GetByID : initializes the 'User' struct from the 'user' document with the ID.
func (*User) GetByIDAndNotification ¶
GetByIDAndNotification : initializes the 'User' struct from the 'user' document with the email address and a notification type.
func (*User) GetByIdentifier ¶
GetByIdentifier : initializes the 'User' struct from the 'user' document with the username or the email address.
func (*User) GetByUsername ¶
GetByUsername : initializes the 'User' struct from the 'user' document with the username.
func (*User) HasAbility ¶
HasAbility : returns true if the user has the ability.
func (*User) RegisterByEmailAddress ¶
func (user *User) RegisterByEmailAddress(username, encryptedPassword, emailAddress, locale, termsVersion, registrationCode, privateKey, source, ip string, device authentication.Device, db *mgo.Database) error
RegisterByEmailAddress : register a new user with an email address.
func (*User) RegisterByThirdPartyToken ¶
func (user *User) RegisterByThirdPartyToken(username string, tokenInfos validator.TokenInfos, tokenSource, locale, termsVersion, registrationCode, privateKey, source, ip string, device authentication.Device, db *mgo.Database) error
RegisterByThirdPartyToken : register a new user with a third-party identification token.
func (*User) RemoveAbilities ¶
RemoveAbilities : removes some abilities from a user and saves the changes, returns an error if needed.
func (*User) Save ¶
Save : inserts the 'user' document in the collection, returns an error if needed.
func (*User) SaveFacebookInfos ¶
func (user *User) SaveFacebookInfos(token, userID, firstName, lastName, email string, createdAt, expiresAt time.Time, db *mgo.Database) error
SaveFacebookInfos : saves the facebook access token to the document.
func (*User) SaveGoogleInfos ¶
func (user *User) SaveGoogleInfos(token, userID, firstName, lastName, email string, createdAt, expiresAt time.Time, db *mgo.Database) error
SaveGoogleInfos : saves the google access token to the document.
func (*User) SetAbilities ¶
SetAbilities : sets some abilities up to a user and saves the changes, returns an error if needed.
func (*User) SetEmailAddressValid ¶
SetEmailAddressValid : updates the email address of a user.
func (*User) ToUser ¶
func (user *User) ToUser() authentication.User
ToUser : return a authentication.User struct from this model.User struct.
func (*User) UnsubscribeNotification ¶
UnsubscribeNotification : unsubscribe from a single notification.
func (*User) UpdateAllInformations ¶
func (user *User) UpdateAllInformations(firstName, lastName, emailAddress string, validEmailAddress bool, db *mgo.Database) error
UpdateAllInformations : updates the infos of an account.
func (*User) UpdateCountOfNotifications ¶
UpdateCountOfNotifications : updates the count of notifications received by the user.
func (*User) UpdateEmailAddress ¶
UpdateEmailAddress : updates the email address of a user.
func (*User) UpdateImage ¶
UpdateImage : updates the image of a user.
func (*User) UpdateInfos ¶
UpdateInfos : updates the infos of an account.
func (*User) UpdateLastLogin ¶
UpdateLastLogin : updates the last login date.
func (*User) UpdateNotifications ¶
UpdateNotifications : updates the notifications received by the user by email.
func (*User) UpdatePassword ¶
UpdatePassword : updates the password of a user.
func (*User) UpdatePublicProfile ¶
UpdatePublicProfile : updates the public profile of a user.
func (*User) UpdateSettings ¶
UpdateSettings : updates the settings of an account.
func (*User) UpdateSocialNetworks ¶
UpdateSocialNetworks : updates the social network profiles of a user.
type UserIdentificationMethods ¶
type UserIdentificationMethods struct { Password string `json:"-" bson:"password"` Facebook UserOAuthInfos `json:"facebook,omitempty" bson:"facebook,omitempty"` Google UserOAuthInfos `json:"google,omitempty" bson:"google,omitempty"` Twitter UserOAuthInfos `json:"twitter,omitempty" bson:"twitter,omitempty"` }
UserIdentificationMethods : identification methods of a user.
type UserNotificationTarget ¶
UserNotificationTarget target of a notification to send a user.
func GetUserNotificationTargetsByType ¶
func GetUserNotificationTargetsByType(userID, notificationType string, db *mgo.Database) []UserNotificationTarget
GetUserNotificationTargetsByType : returns the targets of a given notification type of a user.
type UserNotificationsStats ¶
type UserNotificationsStats struct { Total string `json:"total" bson:"total"` Unread int `json:"unread" bson:"unread"` }
UserNotificationsStats : informations about the notifications received by the user.
type UserOAuthInfos ¶
type UserOAuthInfos struct { UserID string `json:"user_id" bson:"userId"` Token string `json:"token" bson:"token"` FirstName string `json:"first_name" bson:"firstName,omitempty"` LastName string `json:"last_name" bson:"lastName,omitempty"` Email string `json:"email" bson:"email,omitempty"` CreatedAt time.Time `json:"created_at" bson:"createdAt,omitempty"` ExpiresAt time.Time `json:"expires_at" bson:"expiresAt,omitempty"` }
UserOAuthInfos : informations of a user from a oauth service.
func (*UserOAuthInfos) FromSocialNetworkOAuthInfos ¶
func (oauthInfos *UserOAuthInfos) FromSocialNetworkOAuthInfos(tokenInfos validator.TokenInfos)
FromSocialNetworkOAuthInfos : fills a UserOAuthInfos struct from a TokenInfos struct
type UserPrivateInfos ¶
type UserPrivateInfos struct { FirstName string `json:"first_name" bson:"firstName"` LastName string `json:"last_name" bson:"lastName"` Email string `json:"email" bson:"email"` IsEmailValid bool `json:"is_email_valid" bson:"isEmailValid"` }
UserPrivateInfos : private informations of a user.
type UserPublicInfos ¶
type UserPublicInfos struct { Description map[string]string `json:"description,omitempty" bson:"description,omitempty"` Facebook string `json:"facebook,omitempty" bson:"facebook,omitempty"` Twitter string `json:"twitter,omitempty" bson:"twitter,omitempty"` Instagram string `json:"instagram,omitempty" bson:"instagram,omitempty"` Image Image `json:"image,omitempty" bson:"image,omitempty"` }
UserPublicInfos : public informations of a user.
type UserRegistrationInfos ¶
type UserRegistrationInfos struct { Date time.Time `json:"date" bson:"date"` Source string `json:"source" bson:"source"` Method string `json:"method" bson:"method"` Device Device `json:"device" bson:"device"` IPAddress string `json:"ip_address" bson:"ip"` Code string `json:"-" bson:"code"` CodeAttempts uint `json:"-" bson:"codeAttempts"` }
UserRegistrationInfos : private informations of a user.
type UserSettings ¶
type UserSettings struct { Locale string `json:"locale" bson:"locale"` Timezone string `json:"timezone" bson:"timezone"` }
UserSettings : settings of a user.
Source Files ¶
- authToken_constants.go
- authToken_functions.go
- authToken_model.go
- authToken_model_admin.go
- authToken_model_admin_functions.go
- authToken_model_functions.go
- authToken_model_owned.go
- authToken_model_owned_functions.go
- common_image_model.go
- common_image_model_owned.go
- common_image_model_public.go
- contact_constants.go
- contact_functions.go
- contact_model.go
- contact_model_admin.go
- contact_model_admin_functions.go
- contact_model_functions.go
- deletedUser_constants.go
- deletedUser_functions.go
- deletedUser_model.go
- device_model.go
- device_model_admin.go
- device_model_owned.go
- disabledUser_constants.go
- disabledUser_functions.go
- disabledUser_model.go
- disabledUser_model_admin.go
- disabledUser_model_admin_functions.go
- forgotPasswordProcess_constants.go
- forgotPasswordProcess_functions.go
- forgotPasswordProcess_model.go
- forgotPasswordProcess_model_functions.go
- ipLocation_constants.go
- ipLocation_model.go
- ipLocation_model_admin.go
- ipLocation_model_admin_functions.go
- ipLocation_model_functions.go
- ipLocation_model_owned.go
- ipLocation_model_owned_functions.go
- notification_constants.go
- notification_functions.go
- notification_model.go
- notification_model_functions.go
- notification_model_owned.go
- updatePropertyProcess_constants.go
- updatePropertyProcess_functions.go
- updatePropertyProcess_model.go
- updatePropertyProcess_model_functions.go
- user_constants.go
- user_constants_abilities.go
- user_functions.go
- user_functions_abilities.go
- user_functions_notifications.go
- user_model.go
- user_model_admin.go
- user_model_admin_functions.go
- user_model_functions.go
- user_model_functions_abilities.go
- user_model_functions_authentication.go
- user_model_functions_management.go
- user_model_functions_notifications.go
- user_model_functions_private.go
- user_model_functions_registration.go
- user_model_functions_terms.go
- user_model_owned.go
- user_model_owned_functions.go
- user_model_sitemap.go
- user_model_sitemap_functions.go