MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / InitUserIndex

Function InitUserIndex

internal/users/index.go:65–73  ·  view source on GitHub ↗

InitUserIndex creates and initializes the singleton UserIndex. Called once at startup.

()

Source from the content-addressed store, hash-verified

63
64// InitUserIndex creates and initializes the singleton UserIndex. Called once at startup.
65func InitUserIndex() *UserIndex {
66 filename := util.FilePath(string(configs.GetFilePathsConfig().DataFiles), `/`, `users`, `/`, `users.idx`)
67 userIndex = &UserIndex{Filename: filename}
68 if userIndex.Exists() {
69 userIndex.metaData = userIndex.getMetaDataFromFile()
70 userIndex.loadRecords()
71 }
72 return userIndex
73}
74
75// GetUserIndex returns the singleton UserIndex, initializing it if needed.
76func GetUserIndex() *UserIndex {

Callers 4

mainFunction · 0.92
setupAuthTestUsersFunction · 0.92
createUserIndexFunction · 0.92
GetUserIndexFunction · 0.85

Calls 5

FilePathFunction · 0.92
GetFilePathsConfigFunction · 0.92
getMetaDataFromFileMethod · 0.80
loadRecordsMethod · 0.80
ExistsMethod · 0.45

Tested by 2

setupAuthTestUsersFunction · 0.74
createUserIndexFunction · 0.74