MCPcopy Create free account

hub / github.com/LiamDotPro/Go-Multitenancy / functions

Functions57 in github.com/LiamDotPro/Go-Multitenancy

↓ 4 callersMethodGetConnection
Helper method that create's and returns the database connection.
tenants/TenantConnectionInformation.go:17
↓ 2 callersFunctiongetMasterUser
Get a specific user from the database.
MasterUsers.go:141
↓ 2 callersFunctiongetUser
Get a specific user from the database.
User.go:112
↓ 2 callersFunctionmigrateTenantTables
Attempts to migrate tables using database connection
MigrateTenantTables.go:9
↓ 2 callersFunctionnewClientProfile
()
LoginAttemptMiddleware.go:38
↓ 2 callersFunctionnewHostProfile
()
LoginAttemptMiddleware.go:31
↓ 1 callersFunctionAutoMigrateTenantTableChanges
Simply migrates all of the tenant tables
Database.go:61
↓ 1 callersFunctionCORSMiddleware
()
Main.go:83
↓ 1 callersFunctionHandleLoginAttempt
Checks if a user is logged in with a session to the client dashboard
LoginAttemptMiddleware.go:197
↓ 1 callersFunctionHandleMasterLoginAttempt
Checks if a user is logged in with a session to the master dashboard
LoginAttemptMiddleware.go:46
↓ 1 callersFunctioncreateMasterUser
Creates a standard user in the database. Returns the inserted user id
MasterUsers.go:25
↓ 1 callersFunctioncreateNewTenant
Create's a tenant using a domain identifier
MasterUsers.go:114
↓ 1 callersFunctioncreateUser
Creates a standard user in the database. Returns the inserted user id
User.go:23
↓ 1 callersFunctiondeleteMasterUser
Deletes a user in the database.
MasterUsers.go:103
↓ 1 callersFunctiondeleteUser
Deletes a user in the database.
User.go:101
↓ 1 callersFunctiongetSubdomainInformation
(hostStr string, Connection *gorm.DB)
middleware/TenantMiddleware.go:77
↓ 1 callersFunctiongetTenantConnectionByHost
(hostStr string, c *gin.Context, Connection *gorm.DB)
middleware/TenantMiddleware.go:51
↓ 1 callersFunctionloginMasterUser
Logs a user in.
MasterUsers.go:60
↓ 1 callersFunctionloginUser
Logs a user in.
User.go:58
↓ 1 callersFunctionmigrateMasterTenantDatabase
** This method uses the base tenant connection set out within init. */
MigrateMasterTables.go:8
↓ 1 callersFunctionopen
Helper function that allows us to open a browser dependant on your OS
Main.go:66
↓ 1 callersFunctionsetupMasterUsersRoutes
Init
MasterUsersRoutes.go:15
↓ 1 callersFunctionsetupUsersRoutes
Init
UserRoutes.go:16
↓ 1 callersFunctionstartDatabaseServices
()
Database.go:17
↓ 1 callersFunctionupdateMasterUser
Updates a user in the database. A separate method is called when updating a company id
MasterUsers.go:82
↓ 1 callersFunctionupdateUser
Updates a user in the database. A separate method is called when updating a company id
User.go:80
FunctionCheckPasswordHash
Check a users password from a hash.
helpers/Helpers.go:23
FunctionContainsCapitalLetter
Checks a string to make sure there is at least one capital letter A side effect of this method is that one alphabet character must be present.
helpers/Helpers.go:47
FunctionContainsSpecialCharacter
Checks a string to see if it contains a special character
helpers/Helpers.go:29
FunctionFindTenancy
(Connection *gorm.DB)
middleware/TenantMiddleware.go:16
FunctionHandleCreateNewTenant
@Summary Attempts to create a new tenant as a privileged user. @tags master/users @Router /master/api/users/createNewTenant [Post]
MasterUsersRoutes.go:318
FunctionHandleCreateUser
@Summary Create a new user @tags users @Router /api/users/create [post]
UserRoutes.go:41
FunctionHandleDeleteUser
@Summary Deletes a user using a user id @tags users @Router /api/users/deleteUser [delete]
UserRoutes.go:201
FunctionHandleGetCurrentUser
@Summary Attempts to get the currently logged in user using there session id. @tags users @Router /api/users/getCurrentUser [get]
UserRoutes.go:259
FunctionHandleGetUserById
@Summary Attempts to get a existing user by id @tags users @Router /api/users/getUserById [get]
UserRoutes.go:229
FunctionHandleLogin
@Summary Attempt to login using user details @tags users @Router /api/users/login [post]
UserRoutes.go:97
FunctionHandleMasterCreateUser
@Summary Create a new user @tags master/users @Router /master/api/users/create [post]
MasterUsersRoutes.go:37
FunctionHandleMasterDeleteUser
@Summary Deletes a user using a user id @tags master/users @Router /master/api/users/deleteUser [delete]
MasterUsersRoutes.go:243
FunctionHandleMasterGetCurrentUser
@Summary Attempts to get the currently logged in user using there session id. @tags master/users @Router /master/api/users/getCurrentUser [get]
MasterUsersRoutes.go:295
FunctionHandleMasterGetUserById
@Summary Attempts to get a existing user by id @tags master/users @Router /master/api/users/getUserById [get]
MasterUsersRoutes.go:268
FunctionHandleMasterLogin
@Summary Attempt to login using user details @tags master/users @Router /master/api/users/login [post]
MasterUsersRoutes.go:90
FunctionHandleMasterLogout
@Summary Logs a user out of the system @tags master/users @Router /master/api/users/logout [post]
MasterUsersRoutes.go:175
FunctionHandleMasterUpdateUserDetails
@Summary Updates a users details @tags master/users @Router /master/api/users/updateUserDetails [post]
MasterUsersRoutes.go:217
FunctionHandleTestGetter
(c *gin.Context)
UserRoutes.go:282
FunctionHandleTestPoster
(c *gin.Context)
UserRoutes.go:305
FunctionHandleUpdateUserDetails
@Summary Updates a users details @tags users @Router /api/users/updateUserDetails [post]
UserRoutes.go:172
FunctionHashPassword
Hashes a password Running 4 rounds to comply with bcrypt recommendations for standard user.
helpers/Helpers.go:10
FunctionHashPasswordAdmin
Hashes a password for a super user Running 8 rounds to comply with bcrypt recommendations for a super user.
helpers/Helpers.go:17
FunctionIfAuthorized
Checks if a user is logged in with a session to a tenancy.
middleware/TenantAuthorization.go:10
FunctionIfMasterAuthorized
Checks if a user is logged in with a session to the master dashboard;
middleware/MasterAuthorization.go:10
FunctionTestCompareHashToPassword
Checks to see if a previously hashed password can be validated.
tests/helper_test.go:27
FunctionTestContainsCapitalLetter
Test to see if a string contains a capital letter
tests/helper_test.go:57
FunctionTestContainsSpecialCharacter
Tests to see if a special character is found
tests/helper_test.go:48
FunctionTestHashPassword
Check to see if a password can be hashed correctly.
tests/helper_test.go:9
FunctionTestHashPasswordAdmin
Check to see if a password can be hashed correctly.
tests/helper_test.go:18
FunctionValidateEmail
Validates an email address using a regular expression.
helpers/Helpers.go:59
Functionmain
()
Main.go:16