MCPcopy Create free account
hub / github.com/actiontech/dtle / SaveUser

Method SaveUser

driver/common/store.go:520–528  ·  view source on GitHub ↗
(user *User)

Source from the content-addressed store, hash-verified

518 return user, true, nil
519}
520func (sm *StoreManager) SaveUser(user *User) error {
521 key := fmt.Sprintf("dtleUser/%v/%v", user.Tenant, user.Username)
522 jobBytes, err := json.Marshal(user)
523 if err != nil {
524 return fmt.Errorf("save %v to consul, marshal err : %v", key, err)
525 }
526 err = sm.consulStore.Put(key, jobBytes, nil)
527 return err
528}
529
530func (sm *StoreManager) FindRoleList(tenant string) ([]*Role, error) {
531 key := fmt.Sprintf("%s/%s", "dtleRole", tenant)

Callers 3

createUserFunction · 0.95
UpdateUserV2Function · 0.95
ResetPasswordV2Function · 0.95

Calls 1

MarshalMethod · 0.65

Tested by

no test coverage detected