-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from sev-2/feature/paginate
enhance functionality
- Loading branch information
Showing
29 changed files
with
1,296 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package mock | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/valyala/fasthttp" | ||
) | ||
|
||
type MockClient struct { | ||
DoFn func(*fasthttp.Request, *fasthttp.Response) error | ||
DoTimeoutFn func(*fasthttp.Request, *fasthttp.Response, time.Duration) error | ||
} | ||
|
||
func (m *MockClient) Do(req *fasthttp.Request, rest *fasthttp.Response) error { | ||
return m.DoFn(req, rest) | ||
} | ||
|
||
func (m *MockClient) DoTimeout(req *fasthttp.Request, rest *fasthttp.Response, timeout time.Duration) error { | ||
return m.DoTimeoutFn(req, rest, timeout) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package paginate | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
type Item map[string]any | ||
|
||
type Driver interface { | ||
Paginate(ctx context.Context, statement string, page, limit int, withCount bool) (data []Item, cont int, err error) | ||
CursorPaginateNext(ctx context.Context, statement string, cursorRefColumn string, cursor any, limit int, withCount bool) (data []Item, count int, prevCursor any, nextCursor any, err error) | ||
CursorPaginatePrev(ctx context.Context, statement string, cursorRefColumn string, cursor any, limit int, withCount bool) (data []Item, count int, prevCursor any, nextCursor any, err error) | ||
} |
Oops, something went wrong.