generatePullRequestNodeID converts an int64 databaseID and repoID to a GraphQL Node ID format with the "PR_" prefix for pull requests
(repoID, pullRequestID int64)
| 540 | // generatePullRequestNodeID converts an int64 databaseID and repoID to a GraphQL Node ID format |
| 541 | // with the "PR_" prefix for pull requests |
| 542 | func generatePullRequestNodeID(repoID, pullRequestID int64) string { |
| 543 | buf := bytes.Buffer{} |
| 544 | parts := []int64{0, repoID, pullRequestID} |
| 545 | |
| 546 | encoder := msgpack.NewEncoder(&buf) |
| 547 | encoder.UseCompactInts(true) |
| 548 | |
| 549 | if err := encoder.Encode(parts); err != nil { |
| 550 | panic(err) |
| 551 | } |
| 552 | |
| 553 | encoded := base64.RawURLEncoding.EncodeToString(buf.Bytes()) |
| 554 | |
| 555 | return "PR_" + encoded |
| 556 | } |
| 557 | |
| 558 | func generateUserNodeID(userID int64) string { |
| 559 | buf := bytes.Buffer{} |
no outgoing calls
no test coverage detected