OffsetToCursor create the cursor string from an offset
(offset int)
| 19 | |
| 20 | // OffsetToCursor create the cursor string from an offset |
| 21 | func OffsetToCursor(offset int) string { |
| 22 | str := fmt.Sprintf("%v%v", cursorPrefix, offset) |
| 23 | return base64.StdEncoding.EncodeToString([]byte(str)) |
| 24 | } |
| 25 | |
| 26 | // CursorToOffset re-derives the offset from the cursor string. |
| 27 | func CursorToOffset(cursor string) (int, error) { |
no outgoing calls
no test coverage detected