Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/LiamDotPro/Go-Multitenancy
/ functions
Functions
57 in github.com/LiamDotPro/Go-Multitenancy
⨍
Functions
57
◇
Types & classes
15
↓ 4 callers
Method
GetConnection
Helper method that create's and returns the database connection.
tenants/TenantConnectionInformation.go:17
↓ 2 callers
Function
getMasterUser
Get a specific user from the database.
MasterUsers.go:141
↓ 2 callers
Function
getUser
Get a specific user from the database.
User.go:112
↓ 2 callers
Function
migrateTenantTables
Attempts to migrate tables using database connection
MigrateTenantTables.go:9
↓ 2 callers
Function
newClientProfile
()
LoginAttemptMiddleware.go:38
↓ 2 callers
Function
newHostProfile
()
LoginAttemptMiddleware.go:31
↓ 1 callers
Function
AutoMigrateTenantTableChanges
Simply migrates all of the tenant tables
Database.go:61
↓ 1 callers
Function
CORSMiddleware
()
Main.go:83
↓ 1 callers
Function
HandleLoginAttempt
Checks if a user is logged in with a session to the client dashboard
LoginAttemptMiddleware.go:197
↓ 1 callers
Function
HandleMasterLoginAttempt
Checks if a user is logged in with a session to the master dashboard
LoginAttemptMiddleware.go:46
↓ 1 callers
Function
createMasterUser
Creates a standard user in the database. Returns the inserted user id
MasterUsers.go:25
↓ 1 callers
Function
createNewTenant
Create's a tenant using a domain identifier
MasterUsers.go:114
↓ 1 callers
Function
createUser
Creates a standard user in the database. Returns the inserted user id
User.go:23
↓ 1 callers
Function
deleteMasterUser
Deletes a user in the database.
MasterUsers.go:103
↓ 1 callers
Function
deleteUser
Deletes a user in the database.
User.go:101
↓ 1 callers
Function
getSubdomainInformation
(hostStr string, Connection *gorm.DB)
middleware/TenantMiddleware.go:77
↓ 1 callers
Function
getTenantConnectionByHost
(hostStr string, c *gin.Context, Connection *gorm.DB)
middleware/TenantMiddleware.go:51
↓ 1 callers
Function
loginMasterUser
Logs a user in.
MasterUsers.go:60
↓ 1 callers
Function
loginUser
Logs a user in.
User.go:58
↓ 1 callers
Function
migrateMasterTenantDatabase
** This method uses the base tenant connection set out within init. */
MigrateMasterTables.go:8
↓ 1 callers
Function
open
Helper function that allows us to open a browser dependant on your OS
Main.go:66
↓ 1 callers
Function
setupMasterUsersRoutes
Init
MasterUsersRoutes.go:15
↓ 1 callers
Function
setupUsersRoutes
Init
UserRoutes.go:16
↓ 1 callers
Function
startDatabaseServices
()
Database.go:17
↓ 1 callers
Function
updateMasterUser
Updates a user in the database. A separate method is called when updating a company id
MasterUsers.go:82
↓ 1 callers
Function
updateUser
Updates a user in the database. A separate method is called when updating a company id
User.go:80
Function
CheckPasswordHash
Check a users password from a hash.
helpers/Helpers.go:23
Function
ContainsCapitalLetter
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
Function
ContainsSpecialCharacter
Checks a string to see if it contains a special character
helpers/Helpers.go:29
Function
FindTenancy
(Connection *gorm.DB)
middleware/TenantMiddleware.go:16
Function
HandleCreateNewTenant
@Summary Attempts to create a new tenant as a privileged user. @tags master/users @Router /master/api/users/createNewTenant [Post]
MasterUsersRoutes.go:318
Function
HandleCreateUser
@Summary Create a new user @tags users @Router /api/users/create [post]
UserRoutes.go:41
Function
HandleDeleteUser
@Summary Deletes a user using a user id @tags users @Router /api/users/deleteUser [delete]
UserRoutes.go:201
Function
HandleGetCurrentUser
@Summary Attempts to get the currently logged in user using there session id. @tags users @Router /api/users/getCurrentUser [get]
UserRoutes.go:259
Function
HandleGetUserById
@Summary Attempts to get a existing user by id @tags users @Router /api/users/getUserById [get]
UserRoutes.go:229
Function
HandleLogin
@Summary Attempt to login using user details @tags users @Router /api/users/login [post]
UserRoutes.go:97
Function
HandleMasterCreateUser
@Summary Create a new user @tags master/users @Router /master/api/users/create [post]
MasterUsersRoutes.go:37
Function
HandleMasterDeleteUser
@Summary Deletes a user using a user id @tags master/users @Router /master/api/users/deleteUser [delete]
MasterUsersRoutes.go:243
Function
HandleMasterGetCurrentUser
@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
Function
HandleMasterGetUserById
@Summary Attempts to get a existing user by id @tags master/users @Router /master/api/users/getUserById [get]
MasterUsersRoutes.go:268
Function
HandleMasterLogin
@Summary Attempt to login using user details @tags master/users @Router /master/api/users/login [post]
MasterUsersRoutes.go:90
Function
HandleMasterLogout
@Summary Logs a user out of the system @tags master/users @Router /master/api/users/logout [post]
MasterUsersRoutes.go:175
Function
HandleMasterUpdateUserDetails
@Summary Updates a users details @tags master/users @Router /master/api/users/updateUserDetails [post]
MasterUsersRoutes.go:217
Function
HandleTestGetter
(c *gin.Context)
UserRoutes.go:282
Function
HandleTestPoster
(c *gin.Context)
UserRoutes.go:305
Function
HandleUpdateUserDetails
@Summary Updates a users details @tags users @Router /api/users/updateUserDetails [post]
UserRoutes.go:172
Function
HashPassword
Hashes a password Running 4 rounds to comply with bcrypt recommendations for standard user.
helpers/Helpers.go:10
Function
HashPasswordAdmin
Hashes a password for a super user Running 8 rounds to comply with bcrypt recommendations for a super user.
helpers/Helpers.go:17
Function
IfAuthorized
Checks if a user is logged in with a session to a tenancy.
middleware/TenantAuthorization.go:10
Function
IfMasterAuthorized
Checks if a user is logged in with a session to the master dashboard;
middleware/MasterAuthorization.go:10
Function
TestCompareHashToPassword
Checks to see if a previously hashed password can be validated.
tests/helper_test.go:27
Function
TestContainsCapitalLetter
Test to see if a string contains a capital letter
tests/helper_test.go:57
Function
TestContainsSpecialCharacter
Tests to see if a special character is found
tests/helper_test.go:48
Function
TestHashPassword
Check to see if a password can be hashed correctly.
tests/helper_test.go:9
Function
TestHashPasswordAdmin
Check to see if a password can be hashed correctly.
tests/helper_test.go:18
Function
ValidateEmail
Validates an email address using a regular expression.
helpers/Helpers.go:59
Function
main
()
Main.go:16