(nodeIndex int, webShellRequest *model.WebShellAllocRequest)
| 11 | ) |
| 12 | |
| 13 | func UpdateWebShellRequest(nodeIndex int, webShellRequest *model.WebShellAllocRequest) error { |
| 14 | webShellRequestKeyBase := fmt.Sprintf(key.NodeWebshellRequestKeyTemplate, nodeIndex) |
| 15 | webShellRequestKey := fmt.Sprintf("%s/%s", webShellRequestKeyBase, webShellRequest.WebShellID) |
| 16 | webShellRequestSeq, err := json.Marshal(webShellRequest) |
| 17 | if err != nil { |
| 18 | return fmt.Errorf("update webshell request error: %s", err.Error()) |
| 19 | } |
| 20 | _, err = utils.EtcdClient.Put( |
| 21 | context.Background(), |
| 22 | webShellRequestKey, |
| 23 | string(webShellRequestSeq), |
| 24 | ) |
| 25 | if err != nil { |
| 26 | return fmt.Errorf("update webshell request error: %s", err.Error()) |
| 27 | } |
| 28 | return nil |
| 29 | } |
| 30 | |
| 31 | func UpdateGetWebshellInfo(nodeIndex int, webShellID string, info *model.WebShellAllocInfo) error { |
| 32 | info.WebShellID = webShellID |
nothing calls this directly
no outgoing calls
no test coverage detected