aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/connections/connections.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-13 15:28:16 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-13 15:28:47 +0200
commitdf144e727a858ed07e3c9328d91efe052c4781e1 (patch)
treebfbfeea70f97ab3d4274c8e5add2c3aeeac1423b /graphql/connections/connections.go
parentf2f779c5a8b4efe67317bbffe110a9880c1f529a (diff)
downloadgit-bug-df144e727a858ed07e3c9328d91efe052c4781e1.tar.gz
fix some linting trouble
Diffstat (limited to 'graphql/connections/connections.go')
-rw-r--r--graphql/connections/connections.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/graphql/connections/connections.go b/graphql/connections/connections.go
index 84dc3750..8b905fab 100644
--- a/graphql/connections/connections.go
+++ b/graphql/connections/connections.go
@@ -13,17 +13,18 @@ import (
const cursorPrefix = "cursor:"
+// Edge define the contract for an edge in a relay connection
type Edge interface {
GetCursor() string
}
-// Creates the cursor string from an offset
+// OffsetToCursor create the cursor string from an offset
func OffsetToCursor(offset int) string {
str := fmt.Sprintf("%v%v", cursorPrefix, offset)
return base64.StdEncoding.EncodeToString([]byte(str))
}
-// Re-derives the offset from the cursor string.
+// CursorToOffset re-derives the offset from the cursor string.
func CursorToOffset(cursor string) (int, error) {
str := ""
b, err := base64.StdEncoding.DecodeString(cursor)