(mr mutationResponse, abort bool)
| 336 | } |
| 337 | |
| 338 | func commitWithTs(mr mutationResponse, abort bool) error { |
| 339 | url := addr + "/commit" |
| 340 | if mr.startTs != 0 { |
| 341 | url += "?startTs=" + strconv.FormatUint(mr.startTs, 10) |
| 342 | url += "&hash=" + mr.hash |
| 343 | } |
| 344 | if abort { |
| 345 | if mr.startTs != 0 { |
| 346 | url += "&abort=true" |
| 347 | } else { |
| 348 | url += "?abort=true" |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | m := make(map[string]interface{}) |
| 353 | m["keys"] = mr.keys |
| 354 | m["preds"] = mr.preds |
| 355 | b, err := json.Marshal(m) |
| 356 | if err != nil { |
| 357 | return err |
| 358 | } |
| 359 | req, err := http.NewRequest("POST", url, bytes.NewReader(b)) |
| 360 | if err != nil { |
| 361 | return err |
| 362 | } |
| 363 | _, _, _, err = runRequest(req) |
| 364 | return err |
| 365 | } |
| 366 | |
| 367 | func commitWithTsKeysOnly(keys []string, ts uint64, hash string) error { |
| 368 | url := addr + "/commit" |
no test coverage detected