account

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: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NotificationsReceivedByUser : function to get all the notifications received by the user.
	NotificationsReceivedByUser NotificationsReceivedByUserFunc

	// NotificationReceivedByUser : function to get a notification received by the user.
	NotificationReceivedByUser NotificationReceivedByUserFunc

	// UpdateUserNotificationRead : function to update the read flag of a notification received by the user.
	UpdateUserNotificationRead UpdateUserNotificationReadFunc

	// UpdateUserNotificationNotified : function to update the notified flag of a notification received by the user.
	UpdateUserNotificationNotified UpdateUserNotificationNotifiedFunc

	// DeleteUserNotification : function to delete a notification received by the user.
	DeleteUserNotification DeleteUserNotificationFunc

	// NotificationsSubscribedByUser : function to get all the notifications subscribed by the user.
	NotificationsSubscribedByUser NotificationsSubscribedByUserFunc

	// SubscribeNotificationsToUser : function to subscribe some notifications to the user.
	SubscribeNotificationsToUser SubscribeNotificationsToUserFunc

	// UnsubscribeNotificationFromUser : function to unsubscribe a notification from a user.
	UnsubscribeNotificationFromUser UnsubscribeNotificationFromUserFunc

	// GetUserDetailsByIdentifier : function to get the user details from its identifier (username, email addresse, what you want.)
	GetUserDetailsByIdentifier GetUserDetailsByIdentifierFunc

	// GetUserDetailsByID : function to get the user details from its unique identifier.
	GetUserDetailsByID GetUserDetailsByIDFunc

	// GetUserDetailsByFacebookUserID : function to get the user details from its unique facebook identifier.
	GetUserDetailsByFacebookUserID GetUserDetailsBySocialNetworkIDFunc

	// GetUserDetailsByGoogleUserID : function to get the user details from its unique facebook identifier.
	GetUserDetailsByGoogleUserID GetUserDetailsBySocialNetworkIDFunc

	// GetUserDetailsAndEncryptedPasswordByIdentifierFromEnabledUser : function to get the user details from its identifier (username, email addresse, what you want.)
	GetUserDetailsAndEncryptedPasswordByIdentifierFromEnabledUser GetUserDetailsAndEncryptedPasswordByIdentifierFromEnabledUserFunc

	// NewForgotPasswordProcessForUser : function to create a new forgot password process for a user. Return the unique identifier of the process.
	NewForgotPasswordProcessForUser NewForgotPasswordProcessForUserFunc

	// GetForgotPasswordProcessDetailsByID : function to get the forgot password process details from its identifier.
	GetForgotPasswordProcessDetailsByID GetForgotPasswordProcessDetailsByIDFunc

	// WrongAccessToForgotPasswordProcess : function to avoid brute force, increment tries or delete the process.
	WrongAccessToForgotPasswordProcess WrongAccessToForgotPasswordProcessFunc

	// UpdateUserPassword : function to update the password of an user.
	UpdateUserPassword UpdateUserPasswordFunc

	// UpdateUserEmailAddress : function to update the email address of an user.
	UpdateUserEmailAddress UpdateUserEmailAddressFunc

	// UserEmailAddressIsVerified : function to flag the email address of a user as valid.
	UserEmailAddressIsVerified UserEmailAddressIsVerifiedFunc

	// UpdateUserSocialNetworks : updates the social network accounts of the user.
	UpdateUserSocialNetworks UpdateUserSocialNetworksFunc

	// DeleteForgotPasswordProcess : function to delete a forgot password process by ID.
	DeleteForgotPasswordProcess DeleteForgotPasswordProcessFunc

	// ValidateUserRegistration : function to validate the registration of a user by its ID.
	ValidateUserRegistration ValidateUserRegistrationFunc

	// CancelUserRegistration : function to cancel the registration of a user by its ID.
	CancelUserRegistration CancelUserRegistrationFunc

	// GetRegistrationDetails : function to get the details of the registration of a user.
	GetRegistrationDetails GetRegistrationDetailsFunc

	// SaveAuthenticationToken : function to save the authentication details and return the unique ID.
	SaveAuthenticationToken SaveAuthenticationTokenFunc

	// DoesAccountWithUsernameExist : returns true if an account with this username does exist already.
	DoesAccountWithUsernameExist DoesAccountWithUsernameExistFunc

	// DoesAccountWithEmailAddressExist : returns true if an account with this email address does exist already.
	DoesAccountWithEmailAddressExist DoesAccountWithEmailAddressExistFunc

	// RegisterByEmailAddress : saves a newly registered user.
	RegisterByEmailAddress RegisterByEmailAddressFunc

	// RegisterByThirdPartyToken : saves a newly registered user.
	RegisterByThirdPartyToken RegisterByThirdPartyTokenFunc

	// DoesUserWithFacebookUserIDExist : return true if a user with a facebook user id is registered already.
	DoesUserWithFacebookUserIDExist DoesUserWithSocialNetworkUserIDExistFunc

	// DoesUserWithGoogleUserIDExist : return true if a user with a google user id is registered already.
	DoesUserWithGoogleUserIDExist DoesUserWithSocialNetworkUserIDExistFunc

	// SaveFacebookUserTokenDetailsToUser : function to save the auth token details from facebook to an account.
	SaveFacebookUserTokenDetailsToUser SaveSocialNetworkUserTokenDetailsToUserFunc

	// SaveGoogleUserTokenDetailsToUser : function to save the auth token details from google to an account.
	SaveGoogleUserTokenDetailsToUser SaveSocialNetworkUserTokenDetailsToUserFunc

	// GetTokenExpirationDate : function to get the expiration date of a token from its unique identifier.
	GetTokenExpirationDate GetTokenExpirationDateFunc

	// DeleteTokenByID : delete an auth token by its ID.
	DeleteTokenByID DeleteTokenByIDFunc

	// GetTokenDetailsByID : function to get the token details from its unique identifier.
	GetTokenDetailsByID GetTokenDetailsByIDFunc

	// GetOwnedTokens : function to get the auth tokens of a user.
	GetOwnedTokens GetOwnedTokensFunc

	// GetOwnedTokenByID : function to get the auth token by its ID and the ID of the token's owner.
	GetOwnedTokenByID GetOwnedTokenByIDFunc

	// UpdateTokenByID : function to update the properties of a token.
	UpdateTokenByID UpdateTokenByIDFunc

	// GetOwnedAccountDetails : function to get the user details from its unique identifier.
	GetOwnedAccountDetails GetOwnedAccountDetailsFunc

	// UpdatedAccountInfos : function to update the user infos.
	UpdatedAccountInfos UpdatedAccountInfosFunc

	// UpdatedAccountSettings : function to update the user settings.
	UpdatedAccountSettings UpdatedAccountSettingsFunc

	// CreateNewDeleteAccountProcess : function to start a new process to delete an account.
	CreateNewDeleteAccountProcess CreateNewProcessFunc

	// CreateNewDisableAccountProcess : function to start a new process to disable an account.
	CreateNewDisableAccountProcess CreateNewProcessFunc

	// CreateNewUpdatePasswordProcess : function to start a new process to update the password of an account.
	CreateNewUpdatePasswordProcess CreateNewProcessWithValueFunc

	// CreateNewUpdateEmailAddressProcess : function to start a new process to update the email address of an account.
	CreateNewUpdateEmailAddressProcess CreateNewProcessWithValueFunc

	// CreateNewVerifyEmailAddressProcess : function to start a new process to verify the email address of an account.
	CreateNewVerifyEmailAddressProcess CreateNewProcessFunc

	// VerifyProcess : function to verify a process and get the ID of the bound user.
	VerifyProcess VerifyProcessFunc

	// DeleteProcessByID : deletes a process by its ID.
	DeleteProcessByID DeleteProcessByIDFunc

	// DeleteUserByID : deletes a user by its ID.
	DeleteUserByID DeleteUserByIDFunc

	// DisableUserByID : disables a user by its ID.
	DisableUserByID DisableUserByIDFunc

	// EnableUserByID : enables a user by its ID.
	EnableUserByID EnableUserByIDFunc
)

Functions

func CancelDeleteAccount

func CancelDeleteAccount(c *gin.Context)

CancelDeleteAccount : cancels the delete process.

func CancelDisableAccount

func CancelDisableAccount(c *gin.Context)

CancelDisableAccount : cancels the disable process.

func CancelForgotPassword

func CancelForgotPassword(c *gin.Context)

CancelForgotPassword : cancels the reset password.

func CancelRegistration

func CancelRegistration(c *gin.Context)

CancelRegistration cancels a new account.

func CancelUpdateEmailAddress

func CancelUpdateEmailAddress(c *gin.Context)

CancelUpdateEmailAddress : cancels the email address update.

func CancelUpdatePassword

func CancelUpdatePassword(c *gin.Context)

CancelUpdatePassword : cancels the password update.

func CheckUsernameParameter

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

CheckUsernameParameter : checks the username parameter.

func ConfirmEmailAddress

func ConfirmEmailAddress(c *gin.Context)

ConfirmEmailAddress : validates the new email address.

func DeleteAccount

func DeleteAccount(c *gin.Context)

DeleteAccount : starts the delete processus and sends a mail to confirm.

func DeleteAuthToken

func DeleteAuthToken(c *gin.Context)

DeleteAuthToken : revokes a token from an account.

func DeleteAuthTokenWithKey

func DeleteAuthTokenWithKey(c *gin.Context)

DeleteAuthTokenWithKey : revokes a token from an account with a key.

func DeleteNotification

func DeleteNotification(c *gin.Context)

DeleteNotification : deletes a notification object.

func DisableAccount

func DisableAccount(c *gin.Context)

DisableAccount : starts the disable processus and sends a mail to confirm.

func ForgotPassword

func ForgotPassword(c *gin.Context)

ForgotPassword : sends a mail to reset the password.

func GetAuthToken

func GetAuthToken(c *gin.Context)

GetAuthToken : gets the token properties of an account.

func GetAuthTokens

func GetAuthTokens(c *gin.Context)

GetAuthTokens : gets the tokens of an account.

func GetAvailability

func GetAvailability(c *gin.Context)

GetAvailability : returns true if the username is available.

func GetInfos

func GetInfos(c *gin.Context)

GetInfos : returns the details of an account.

func GetNotification

func GetNotification(c *gin.Context)

GetNotification : returns a notification received by the user.

func GetNotifications

func GetNotifications(c *gin.Context)

GetNotifications : returns the latest notifications received by the user.

func GetNotificationsSettings

func GetNotificationsSettings(c *gin.Context)

GetNotificationsSettings : returns all the notifications received or not by the user's devices.

func LoginWithFacebook

func LoginWithFacebook(c *gin.Context)

LoginWithFacebook : creates a token to log in an account.

func LoginWithGoogle

func LoginWithGoogle(c *gin.Context)

LoginWithGoogle : creates a token to log in an account.

func LoginWithPassword

func LoginWithPassword(c *gin.Context)

LoginWithPassword : creates a token to log in an account.

func Logout

func Logout(c *gin.Context)

Logout : deletes the token and log out.

func RefreshAuthToken

func RefreshAuthToken(c *gin.Context)

RefreshAuthToken : refreshes a auth token.

func RegisterWithFacebook

func RegisterWithFacebook(c *gin.Context)

RegisterWithFacebook creates a new account.

func RegisterWithGoogle

func RegisterWithGoogle(c *gin.Context)

RegisterWithGoogle creates a new account.

func RegisterWithPassword

func RegisterWithPassword(c *gin.Context)

RegisterWithPassword creates a new account.

func SaveNotificationsSettings

func SaveNotificationsSettings(c *gin.Context)

SaveNotificationsSettings : saves all the notifications received by the user's devices.

func UnsubscribeNotificationByKey

func UnsubscribeNotificationByKey(c *gin.Context)

UnsubscribeNotificationByKey : unsubscribes from an encrypted key.

func UpdateAuthToken

func UpdateAuthToken(c *gin.Context)

UpdateAuthToken : updates a token of an account.

func UpdateEmailAddress

func UpdateEmailAddress(c *gin.Context)

UpdateEmailAddress : updates the email address and sends a mail to confirm.

func UpdateInfos

func UpdateInfos(c *gin.Context)

UpdateInfos : updated the details of an account.

func UpdateNotificationNotified

func UpdateNotificationNotified(c *gin.Context)

UpdateNotificationNotified : updates a notification object.

func UpdateNotificationRead

func UpdateNotificationRead(c *gin.Context)

UpdateNotificationRead : updates a notification object.

func UpdatePassword

func UpdatePassword(c *gin.Context)

UpdatePassword : updates the password and sends a mail to confirm.

func UpdateSettings

func UpdateSettings(c *gin.Context)

UpdateSettings : updated the settings of an account.

func UpdateSocialNetworks

func UpdateSocialNetworks(c *gin.Context)

UpdateSocialNetworks : updates the social network profiles of the user.

func ValidateDeleteAccount

func ValidateDeleteAccount(c *gin.Context)

ValidateDeleteAccount : confirms the delete process.

func ValidateDisableAccount

func ValidateDisableAccount(c *gin.Context)

ValidateDisableAccount : confirms the disable process.

func ValidateForgotPassword

func ValidateForgotPassword(c *gin.Context)

ValidateForgotPassword : validates the reset password.

func ValidateNewEmailAddress

func ValidateNewEmailAddress(c *gin.Context)

ValidateNewEmailAddress : valiadtes the new email address.

func ValidateRegistration

func ValidateRegistration(c *gin.Context)

ValidateRegistration validates a new account.

func ValidateUpdateEmailAddress

func ValidateUpdateEmailAddress(c *gin.Context)

ValidateUpdateEmailAddress : confirms the email address update.

func ValidateUpdatePassword

func ValidateUpdatePassword(c *gin.Context)

ValidateUpdatePassword : confirms the password update.

Types

type Availability

type Availability struct {
	Available bool   `json:"available"`
	Message   string `json:"message"`
}

Availability : struct

type CancelUserRegistrationFunc

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

CancelUserRegistrationFunc : function to cancel the registration of a user by its ID.

type CreateNewProcessFunc

type CreateNewProcessFunc func(c *gin.Context, userID string) (processID, processKey string, err error)

CreateNewProcessFunc : function to start a new process bound to a user.

type CreateNewProcessWithValueFunc

type CreateNewProcessWithValueFunc func(c *gin.Context, userID, value string) (processID, processKey string, err error)

CreateNewProcessWithValueFunc : function to start a new process bound to a user.

type DeleteForgotPasswordProcessFunc

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

DeleteForgotPasswordProcessFunc : function to delete a forgot password process by ID.

type DeleteProcessByIDFunc

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

DeleteProcessByIDFunc : deletes a process by its ID.

type DeleteTokenByIDFunc

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

DeleteTokenByIDFunc : delete an auth token by its ID.

type DeleteUserByIDFunc

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

DeleteUserByIDFunc : deletes a user by its ID.

type DeleteUserNotificationFunc

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

DeleteUserNotificationFunc : function to delete a notification received by the user.

type DisableUserByIDFunc

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

DisableUserByIDFunc : disables a user by its ID.

type DoesAccountWithEmailAddressExistFunc

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

DoesAccountWithEmailAddressExistFunc : returns true if an account with this email address does exist already.

type DoesAccountWithUsernameExistFunc

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

DoesAccountWithUsernameExistFunc : returns true if an account with this username does exist already.

type DoesUserWithSocialNetworkUserIDExistFunc

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

DoesUserWithSocialNetworkUserIDExistFunc : function to know if a user with a social network user id is registered already.

type EnableUserByIDFunc

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

EnableUserByIDFunc : enables a user by its ID.

type GetForgotPasswordProcessDetailsByIDFunc

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

GetForgotPasswordProcessDetailsByIDFunc : function to get the forgot password process details from its identifier.

type GetOwnedAccountDetailsFunc

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

GetOwnedAccountDetailsFunc : function to get the user details from its unique identifier.

type GetOwnedTokenByIDFunc

type GetOwnedTokenByIDFunc func(c *gin.Context, tokenID string) (token interface{}, ownerID string, err error)

GetOwnedTokenByIDFunc : function to get the auth token by its ID and the ID of the token's owner.

type GetOwnedTokensFunc

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

GetOwnedTokensFunc : function to get the auth tokens of a user.

type GetRegistrationDetailsFunc

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

GetRegistrationDetailsFunc : function to get the details of the registration of a user.

type GetTokenDetailsByIDFunc

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

GetTokenDetailsByIDFunc : function to get the token details from its unique identifier.

type GetTokenExpirationDateFunc

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

GetTokenExpirationDateFunc : function to get the expiration date of a token from its unique identifier.

type GetUserDetailsAndEncryptedPasswordByIdentifierFromEnabledUserFunc

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

GetUserDetailsAndEncryptedPasswordByIdentifierFromEnabledUserFunc : function to get the user details and its encrypted password from its identifier (username, email addresse, what you want.)

type GetUserDetailsByIDFunc

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

GetUserDetailsByIDFunc : function to get the user details from its unique identifier.

type GetUserDetailsByIdentifierFunc

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

GetUserDetailsByIdentifierFunc : function to get the user details from its identifier (username, email addresse, what you want.)

type GetUserDetailsBySocialNetworkIDFunc

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

GetUserDetailsBySocialNetworkIDFunc : function to get the user details from its unique social network identifier.

type NewForgotPasswordProcessForUserFunc

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

NewForgotPasswordProcessForUserFunc : function to create a new forgot password process for a user. Return the unique identifier of the process.

type NotificationReceivedByUserFunc

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

NotificationReceivedByUserFunc : function to get a notification received by the user.

type NotificationsReceivedByUserFunc

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

NotificationsReceivedByUserFunc : function to get all the notifications received by the user.

type NotificationsSubscribedByUserFunc

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

NotificationsSubscribedByUserFunc : function to get all the notifications subscribed by the user.

type RegisterByEmailAddressFunc

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

RegisterByEmailAddressFunc : saves a newly registered user.

type RegisterByThirdPartyTokenFunc

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

RegisterByThirdPartyTokenFunc : saves a newly registered user.

type SaveAuthenticationTokenFunc

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

SaveAuthenticationTokenFunc : function to save the authentication details and return the unique ID.

type SaveSocialNetworkUserTokenDetailsToUserFunc

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

SaveSocialNetworkUserTokenDetailsToUserFunc : function to save the auth token details from a social network to an account.

type SubscribeNotificationsToUserFunc

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

SubscribeNotificationsToUserFunc : function to subscribe some notifications to the user.

type UnsubscribeNotificationFromUserFunc

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

UnsubscribeNotificationFromUserFunc : function to unsubscribe a notification from a user.

type UpdateTokenByIDFunc

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

UpdateTokenByIDFunc : function to update the properties of a token.

type UpdateUserEmailAddressFunc

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

UpdateUserEmailAddressFunc : function to update the email address of an user.

type UpdateUserNotificationNotifiedFunc

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

UpdateUserNotificationNotifiedFunc : function to update the notified flag of a notification received by the user.

type UpdateUserNotificationReadFunc

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

UpdateUserNotificationReadFunc : function to update the read flag of a notification received by the user.

type UpdateUserPasswordFunc

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

UpdateUserPasswordFunc : function to update the password of an user.

type UpdateUserSocialNetworksFunc

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

UpdateUserSocialNetworksFunc : updates the social network accounts of the user.

type UpdatedAccountInfosFunc

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

UpdatedAccountInfosFunc : function to update the user infos.

type UpdatedAccountSettingsFunc

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

UpdatedAccountSettingsFunc : function to update the user settings.

type UserEmailAddressIsVerifiedFunc

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

UserEmailAddressIsVerifiedFunc : function to flag the email address of a user as valid.

type ValidateUserRegistrationFunc

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

ValidateUserRegistrationFunc : function to validate the registration of a user by its ID.

type VerifyProcessFunc

type VerifyProcessFunc func(c *gin.Context, processID, key string) (userID, newValue string, err error)

VerifyProcessFunc : function to verify a process and get the ID of the bound user.

type WrongAccessToForgotPasswordProcessFunc

type WrongAccessToForgotPasswordProcessFunc func(c *gin.Context, processID string)

WrongAccessToForgotPasswordProcessFunc : function to avoid brute force, increment tries or delete the process.

Jump to

Keyboard shortcuts

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