MCPcopy Create free account
hub / github.com/Threadfin/Threadfin / saveDatabase

Function saveDatabase

src/internal/authentication/authentication.go:459–473  ·  view source on GitHub ↗
(tmpMap interface{})

Source from the content-addressed store, hash-verified

457}
458
459func saveDatabase(tmpMap interface{}) (err error) {
460
461 jsonString, err := json.MarshalIndent(tmpMap, "", " ")
462
463 if err != nil {
464 return
465 }
466
467 err = os.WriteFile(database, []byte(jsonString), 0600)
468 if err != nil {
469 return
470 }
471
472 return
473}
474
475func loadDatabase() (err error) {
476 jsonString, err := os.ReadFile(database)

Callers 7

InitFunction · 0.85
CreateDefaultUserFunction · 0.85
CreateNewUserFunction · 0.85
WriteUserDataFunction · 0.85
RemoveUserFunction · 0.85
ChangeCredentialsFunction · 0.85
GetAllUserDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected