(userID int64)
| 556 | } |
| 557 | |
| 558 | func generateUserNodeID(userID int64) string { |
| 559 | buf := bytes.Buffer{} |
| 560 | parts := []int64{0, userID} |
| 561 | |
| 562 | encoder := msgpack.NewEncoder(&buf) |
| 563 | encoder.UseCompactInts(true) |
| 564 | |
| 565 | if err := encoder.Encode(parts); err != nil { |
| 566 | panic(err) |
| 567 | } |
| 568 | |
| 569 | encoded := base64.RawURLEncoding.EncodeToString(buf.Bytes()) |
| 570 | |
| 571 | return "U_" + encoded |
| 572 | } |
| 573 | |
| 574 | func fromAPISession(s session) *Session { |
| 575 | result := Session{ |
no outgoing calls
no test coverage detected