functions

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAbilitiesToUser

func AddAbilitiesToUser(c *gin.Context, abilities []string, userID string) error

AddAbilitiesToUser : adds some abilities to an user.

func BuildTokenFromID

func BuildTokenFromID(tokenID string) (*authentication.Token, error)

BuildTokenFromID : returns the content of an auth token.

func CancelUserRegistration

func CancelUserRegistration(c *gin.Context, userID, registrationKey string) error

CancelUserRegistration : cancel the registration of an user.

func CreateContact

func CreateContact(c *gin.Context, emailAddress, subject, text string) error

CreateContact : creates a contact.

func CreateNewDeleteAccountProcess

func CreateNewDeleteAccountProcess(c *gin.Context, userID string) (string, string, error)

CreateNewDeleteAccountProcess : creates a process and returns its unique ID.

func CreateNewDisableAccountProcess

func CreateNewDisableAccountProcess(c *gin.Context, userID string) (string, string, error)

CreateNewDisableAccountProcess : creates a process and returns its unique ID.

func CreateNewUpdateEmailAddressProcess

func CreateNewUpdateEmailAddressProcess(c *gin.Context, userID, emailAddress string) (string, string, error)

CreateNewUpdateEmailAddressProcess : creates a process and returns its unique ID.

func CreateNewUpdatePasswordProcess

func CreateNewUpdatePasswordProcess(c *gin.Context, userID, encryptedPassword string) (string, string, error)

CreateNewUpdatePasswordProcess : creates a process and returns its unique ID.

func CreateNewVerifyEmailAddressProcess

func CreateNewVerifyEmailAddressProcess(c *gin.Context, userID string) (string, string, error)

CreateNewVerifyEmailAddressProcess : creates a process and returns its unique ID.

func DeleteAccountPublicImage

func DeleteAccountPublicImage(c *gin.Context)

DeleteAccountPublicImage : deletes the image of the public profile.

func DeleteForgotPasswordProcess

func DeleteForgotPasswordProcess(c *gin.Context, processID string) error

DeleteForgotPasswordProcess : deletes a forgot password process.

func DeleteProcessByID

func DeleteProcessByID(c *gin.Context, processID string) error

DeleteProcessByID : deletes a process by its unique ID.

func DeleteTokenByID

func DeleteTokenByID(c *gin.Context, tokenID string) error

DeleteTokenByID : delete an auth token by its ID.

func DeleteTokenByIDByAdmin

func DeleteTokenByIDByAdmin(c *gin.Context, tokenID string) error

DeleteTokenByIDByAdmin : deletes a user's auth token by an admin.

func DeleteUserByID

func DeleteUserByID(c *gin.Context, userID string) error

DeleteUserByID : deletes an user by its ID.

func DeleteUserNotification

func DeleteUserNotification(c *gin.Context, userID, notificationID string) error

DeleteUserNotification : deletes a notification received by the user.

func DisableUserByID

func DisableUserByID(c *gin.Context, userID string) (authentication.User, error)

DisableUserByID : disables an user by its ID.

func DoesAccountWithEmailAddressExist

func DoesAccountWithEmailAddressExist(c *gin.Context, emailAddress string) bool

DoesAccountWithEmailAddressExist : returns true if an account with this email address exists.

func DoesAccountWithUsernameExist

func DoesAccountWithUsernameExist(c *gin.Context, username string) bool

DoesAccountWithUsernameExist : returns true if an account with this username exists.

func DoesUserWithFacebookUserIDExist

func DoesUserWithFacebookUserIDExist(c *gin.Context, userID string) bool

DoesUserWithFacebookUserIDExist : returns true if an account with this facebook id exists.

func DoesUserWithGoogleUserIDExist

func DoesUserWithGoogleUserIDExist(c *gin.Context, userID string) bool

DoesUserWithGoogleUserIDExist : returns true if an account with this google id exists.

func EnableUserByID

func EnableUserByID(c *gin.Context, userID string) (authentication.User, error)

EnableUserByID : enables an user by its ID.

func ExtendTokenExpirationDateFromID

func ExtendTokenExpirationDateFromID(tokenID string, ttl time.Duration) error

ExtendTokenExpirationDateFromID : extends the expiration date of an auth token.

func GetContactForAdmin

func GetContactForAdmin(c *gin.Context, contactID string) (interface{}, error)

GetContactForAdmin : gets a contact.

func GetContactsForAdmin

func GetContactsForAdmin(c *gin.Context, offset, limit int) (interface{}, error)

GetContactsForAdmin : returns the contacts for the admin panel.

func GetDisabledUsersForAdmin

func GetDisabledUsersForAdmin(c *gin.Context) (interface{}, error)

GetDisabledUsersForAdmin : returns the disabled users for the admin panel.

func GetEnabledUsersForAdmin

func GetEnabledUsersForAdmin(c *gin.Context) (interface{}, error)

GetEnabledUsersForAdmin : returns the enabled users for the admin panel.

func GetForgotPasswordProcessDetailsByID

func GetForgotPasswordProcessDetailsByID(c *gin.Context, processID string) (userID, processPrivateKey string, err error)

GetForgotPasswordProcessDetailsByID : returns the user ID and the private key a forgot passsword process.

func GetLatestVersionOfTermsAcceptedByUser

func GetLatestVersionOfTermsAcceptedByUser(c *gin.Context, userID string) string

GetLatestVersionOfTermsAcceptedByUser : returns the latest version of the terms accepted by the user.

func GetOwnedAccountDetails

func GetOwnedAccountDetails(c *gin.Context, userID string) interface{}

GetOwnedAccountDetails : returns the details of the user's account.

func GetOwnedTokenByID

func GetOwnedTokenByID(c *gin.Context, tokenID string) (interface{}, string, error)

GetOwnedTokenByID : returns an auth token by its ID for an user.

func GetOwnedTokens

func GetOwnedTokens(c *gin.Context, userID string) (interface{}, error)

GetOwnedTokens : returns the auth token for an user.

func GetRegistrationDetails

func GetRegistrationDetails(c *gin.Context, userID string) (*authentication.Details, error)

GetRegistrationDetails : returns the details of the registration of an user.

func GetTokenDetailsByID

func GetTokenDetailsByID(c *gin.Context, tokenID string) (authentication.Token, error)

GetTokenDetailsByID : returns the details of an auth token.

func GetTokenExpirationDate

func GetTokenExpirationDate(c *gin.Context, tokenID string) (time.Time, error)

GetTokenExpirationDate : returns the expiration date of an auth token.

func GetTokensForAdmin

func GetTokensForAdmin(c *gin.Context, userID string) (interface{}, error)

GetTokensForAdmin : returns the user's auth tokens for the admin panel.

func GetUserAbilities

func GetUserAbilities(c *gin.Context, userID string) (bool, []string)

GetUserAbilities ; returns the abilities of an user.

func GetUserAndLocaleFromAuthToken

func GetUserAndLocaleFromAuthToken(token *jwt.Token) (interface{}, string)

GetUserAndLocaleFromAuthToken : returns the user struct and the user's locale.

func GetUserDetailsAndEncryptedPasswordByIdentifierFromEnabledUser

func GetUserDetailsAndEncryptedPasswordByIdentifierFromEnabledUser(c *gin.Context, identifier string) (authentication.User, string, error)

GetUserDetailsAndEncryptedPasswordByIdentifierFromEnabledUser : returns the details of an user and its encrypted password by its identifier (email address or username).

func GetUserDetailsByFacebookUserID

func GetUserDetailsByFacebookUserID(c *gin.Context, userID string) (authentication.User, error)

GetUserDetailsByFacebookUserID : returns the details of an user by its unique facebook ID.

func GetUserDetailsByGoogleUserID

func GetUserDetailsByGoogleUserID(c *gin.Context, userID string) (authentication.User, error)

GetUserDetailsByGoogleUserID : returns the details of an user by its unique google ID.

func GetUserDetailsByID

func GetUserDetailsByID(c *gin.Context, userID string) (authentication.User, error)

GetUserDetailsByID : returns the details of an user by its ID.

func GetUserDetailsByIdentifier

func GetUserDetailsByIdentifier(c *gin.Context, identifier string) (authentication.User, error)

GetUserDetailsByIdentifier : returns the details of an user by its identifier (email address or username).

func IsValidAuthToken

func IsValidAuthToken(c *gin.Context, tokenID string) bool

IsValidAuthToken : returns trus if the auth token is valid.

func NewForgotPasswordProcessForUser

func NewForgotPasswordProcessForUser(c *gin.Context, userID, processPrivateKey string) (string, error)

NewForgotPasswordProcessForUser : returns the unique ID of a new forgot passsword process.

func NotificationReceivedByUser

func NotificationReceivedByUser(c *gin.Context, userID, notificationID string) (interface{}, error)

NotificationReceivedByUser : returns a notification received by the user.

func NotificationsReceivedByUser

func NotificationsReceivedByUser(c *gin.Context, userID string) (interface{}, error)

NotificationsReceivedByUser : returns the latest notifications received by the user.

func NotificationsSubscribedByUser

func NotificationsSubscribedByUser(c *gin.Context, userID string) []string

NotificationsSubscribedByUser : returns the notifications subscribed by the user.

func RegisterByEmailAddress

func RegisterByEmailAddress(c *gin.Context, username, encryptedPassword, emailAddress, locale, termsVersion, registrationCode, privateKey, source, ip string, device authentication.Device) error

RegisterByEmailAddress : saves the registration details of an user.

func RegisterByThirdPartyToken

func RegisterByThirdPartyToken(c *gin.Context, username string, tokenInfos validator.TokenInfos, tokenSource, locale, termsVersion, registrationCode, privateKey, source, ip string, device authentication.Device) error

RegisterByThirdPartyToken : saves the registration details of an user.

func RemoveAbilitiesFromUser

func RemoveAbilitiesFromUser(c *gin.Context, abilities []string, userID string) error

RemoveAbilitiesFromUser : remove some abilities from an user.

func SaveAuthenticationToken

func SaveAuthenticationToken(c *gin.Context, details authentication.Details) (tokenID string, knownIPAddress bool, err error)

SaveAuthenticationToken : saves an auth token.

func SaveFacebookUserTokenDetailsToUser

func SaveFacebookUserTokenDetailsToUser(c *gin.Context, userID string, tokenInfos validator.TokenInfos) error

SaveFacebookUserTokenDetailsToUser : saves the user's facebook details of an user.

func SaveGoogleUserTokenDetailsToUser

func SaveGoogleUserTokenDetailsToUser(c *gin.Context, userID string, tokenInfos validator.TokenInfos) error

SaveGoogleUserTokenDetailsToUser : saves the user's google details of an user.

func SetAbilitiesToUser

func SetAbilitiesToUser(c *gin.Context, abilities []string, userID string) error

SetAbilitiesToUser : sets the abilities to an user.

func SubscribeNotificationsToUser

func SubscribeNotificationsToUser(c *gin.Context, userID string, notifications []string) error

SubscribeNotificationsToUser : the user subscribes to these notifications.

func UnsubscribeNotificationFromUser

func UnsubscribeNotificationFromUser(c *gin.Context, userID, notification, unsubscribeKey string) error

UnsubscribeNotificationFromUser : the user has unsubscribed from a notification.

func UpdateAccountPublicImage

func UpdateAccountPublicImage(c *gin.Context)

UpdateAccountPublicImage : updates the image of the public profile.

func UpdateAccountPublicProfile

func UpdateAccountPublicProfile(c *gin.Context)

UpdateAccountPublicProfile : updates the public profile of an account.

func UpdateContact

func UpdateContact(c *gin.Context, contactID string, done bool) error

UpdateContact : updates a contact.

func UpdateTokenByID

func UpdateTokenByID(c *gin.Context, tokenID, name string, enableNotifications bool, notifications []string) error

UpdateTokenByID : updates the details of a token.

func UpdateUserDescriptionByAdmin

func UpdateUserDescriptionByAdmin(c *gin.Context, userID, locale, description string) error

UpdateUserDescriptionByAdmin : updates the description of a user by an admin.

func UpdateUserEmailAddress

func UpdateUserEmailAddress(c *gin.Context, userID, emailAddress string) error

UpdateUserEmailAddress : update the email address of an user.

func UpdateUserInformationsByAdmin

func UpdateUserInformationsByAdmin(c *gin.Context, userID, firstName, lastName, emailAddress string, validEmailAddress bool) error

UpdateUserInformationsByAdmin : updates the informations of a user by an admin.

func UpdateUserNotificationNotified

func UpdateUserNotificationNotified(c *gin.Context, userID, notificationID string) error

UpdateUserNotificationNotified : updates the notified flag of a notification received by the user.

func UpdateUserNotificationRead

func UpdateUserNotificationRead(c *gin.Context, userID, notificationID string) error

UpdateUserNotificationRead : updates the read flag of a notification received by the user.

func UpdateUserNotificationsByAdmin

func UpdateUserNotificationsByAdmin(c *gin.Context, userID string, notifications []string) error

UpdateUserNotificationsByAdmin : updates the notifications of a user by an admin.

func UpdateUserPassword

func UpdateUserPassword(c *gin.Context, userID, password string, isPasswordEncrypted bool) error

UpdateUserPassword : update the password of an user.

func UpdateUserPasswordByAdmin

func UpdateUserPasswordByAdmin(c *gin.Context, userID, password string) error

UpdateUserPasswordByAdmin : updates the password of a user by an admin.

func UpdateUserSettingsByAdmin

func UpdateUserSettingsByAdmin(c *gin.Context, userID, locale, timezone string) error

UpdateUserSettingsByAdmin : updates the settings of a user by an admin.

func UpdateUserSocialByAdmin

func UpdateUserSocialByAdmin(c *gin.Context, userID, facebook, twitter, instagram string) error

UpdateUserSocialByAdmin : updates the social networks of a user by an admin.

func UpdateUserSocialNetworks

func UpdateUserSocialNetworks(c *gin.Context, userID, facebook, twitter, instagram string) error

UpdateUserSocialNetworks : update the social network links of an user.

func UpdateVersionOfTermsAcceptedByUser

func UpdateVersionOfTermsAcceptedByUser(c *gin.Context, userID, termsVersion string) error

UpdateVersionOfTermsAcceptedByUser : the user has accepted this version of terms.

func UpdatedAccountInfos

func UpdatedAccountInfos(c *gin.Context, userID, firstName, lastName string) error

UpdatedAccountInfos : updates the details of an user's account.

func UpdatedAccountSettings

func UpdatedAccountSettings(c *gin.Context, userID, locale, timezone string) error

UpdatedAccountSettings : updates the settings of an user's account.

func UserEmailAddressIsVerified

func UserEmailAddressIsVerified(c *gin.Context, userID string) error

UserEmailAddressIsVerified : the email address of an user is verified.

func ValidateUserRegistration

func ValidateUserRegistration(c *gin.Context, userID, registrationKey string) error

ValidateUserRegistration : validate the registration of an user.

func VerifyProcess

func VerifyProcess(c *gin.Context, processID, key string) (string, string, error)

VerifyProcess : verify a process and returns its unique ID and its stored value.

func WrongAccessToForgotPasswordProcess

func WrongAccessToForgotPasswordProcess(c *gin.Context, processID string)

WrongAccessToForgotPasswordProcess : actions to execute when a wrong access to a forgot password process occurs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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