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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAllCollections

func CreateAllCollections()

CreateAllCollections : creates the collections.

func CreateAllDefaultDocuments

func CreateAllDefaultDocuments(environment, version string)

CreateAllDefaultDocuments : populates the database with the initial documents.

func CreateAllIndexes

func CreateAllIndexes()

CreateAllIndexes : checks the indexes of the collections.

func CreateCollections

func CreateCollections(collections []CollectionToCreate)

CreateCollections : creates the collections.

func CreateDefaultDocuments

func CreateDefaultDocuments(environment, version string, f func(string, string, *mgo.Database))

CreateDefaultDocuments : populates the database with the initial documents.

func CreateIndexes

func CreateIndexes(indexes []IndexToCreate)

CreateIndexes : creates the indexes of the collections.

func DeleteExpiredTokens

func DeleteExpiredTokens() uint

DeleteExpiredTokens : delete the expired tokens.

func DeleteUserByID

func DeleteUserByID(updateDocumentsReferencingToDeletedUser func(userID string, mongoSession *mgo.Database)) func(userID string) map[string]time.Time

DeleteUserByID : deletes an user and all its bound documents.

func DisableUserByID

func DisableUserByID(updateDocumentsReferencingToDisabledUser func(userID string, mongoSession *mgo.Database)) func(userID string) map[string]time.Time

DisableUserByID : disables an user and all its bound documents.

func EnableUserByID

func EnableUserByID(updateDocumentsReferencingToEnabledUser func(userID string, mongoSession *mgo.Database)) func(userID string)

EnableUserByID : enables an user and all its bound documents.

func GetInactiveAccounts

func GetInactiveAccounts(intervalInMonths uint) []string

GetInactiveAccounts : returns the count of inactive accounts deleted.

func GetNeverUsedAccounts

func GetNeverUsedAccounts(intervalInDays uint) []string

GetNeverUsedAccounts : returns the count of unused accounts deleted (never logged in).

func GetNotificationTargetsByUserAndType

func GetNotificationTargetsByUserAndType(userID, notificationType string) []notifications.Target

GetNotificationTargetsByUserAndType : gets the targets of a notification sent to an user.

func IsEmailAddressValid

func IsEmailAddressValid(emailAddress string) bool

IsEmailAddressValid : returns true if the email address is valid and messages can be sent it.

func RemoveCollections

func RemoveCollections(collections []string)

RemoveCollections : removes the collections.

func RemoveDefaultDocuments

func RemoveDefaultDocuments(environment, version string, f func(string, string, *mgo.Database))

RemoveDefaultDocuments : removes some unused documents from the database.

func RemoveIndexes

func RemoveIndexes(indexes []IndexToDelete)

RemoveIndexes : removes indexes from the collections.

func RemoveUnusedCollections

func RemoveUnusedCollections()

RemoveUnusedCollections : removes the unused collections.

func RemoveUnusedDefaultDocuments

func RemoveUnusedDefaultDocuments(environment, version string)

RemoveUnusedDefaultDocuments : removes some unused documents from the database.

func RemoveUnusedIndexes

func RemoveUnusedIndexes()

RemoveUnusedIndexes : removes some indexes from the collections.

func SaveIPAddressDetails

func SaveIPAddressDetails(IPAddress, tokenID string, getIPAddressDetailsFunc func(IPAddress string) *location.IPAddressDetails)

SaveIPAddressDetails : save the IP address details.

func UpdateAllDefaultDocuments

func UpdateAllDefaultDocuments(environment, version string)

UpdateAllDefaultDocuments : updates some default documents from the database.

func UpdateDefaultDocuments

func UpdateDefaultDocuments(environment, version string, f func(string, string, *mgo.Database))

UpdateDefaultDocuments : updates some default documents from the database.

func UpdateUserSocialNetworksByID

func UpdateUserSocialNetworksByID(UpdateDocumentsReferencingToUpdatedUserSocialNetworks func(userID string, mongoSession *mgo.Database)) func(userID string)

UpdateUserSocialNetworksByID : updates the user's social networks to its bound documents.

Types

type CollectionToCreate

type CollectionToCreate struct {
	Name string
	Info mgo.CollectionInfo
}

CollectionToCreate : struct representing a collection.

type IndexToCreate

type IndexToCreate struct {
	Collection string
	Index      mgo.Index
}

IndexToCreate : struct representing the index of a collection.

type IndexToDelete

type IndexToDelete struct {
	Collection string
	IndexName  string
}

IndexToDelete : struct representing the index of a collection.

Jump to

Keyboard shortcuts

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