Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Implement unified pagination and add template versions support#1308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
21 commits
Select commitHold shift + click to select a range
475dcf9
feat: Implement pagination for template versions
mafredriMay 5, 2022
01a52d1
Use codersdk.Pagination in users endpoint
mafredriMay 5, 2022
d1478a9
Avoid user sort side-effect in databasefake
mafredriMay 5, 2022
7a36610
Return sql.ErrNoRows for GetUsers in databasefake
mafredriMay 5, 2022
61c60c6
Sync codepaths in databasefake
mafredriMay 5, 2022
62fa273
Fix test with better handling of sql.ErrNoRows in coderd
mafredriMay 5, 2022
878d633
Remove an unused require.NoError
mafredriMay 5, 2022
5c840fd
Return empty list for sql.ErrNoRows in coderd users endpoint
mafredriMay 5, 2022
07e590c
Add t.Parallel() to sub tests
mafredriMay 5, 2022
be8ba6c
Reinit tt due to parallel test
mafredriMay 5, 2022
5ab9ad5
Remove unused variable
mafredriMay 5, 2022
e2a3741
Fix copy pasta in query comments
mafredriMay 5, 2022
61410a5
Move ParsePagination from httpapi to coderd and unexport, return code…
mafredriMay 5, 2022
8a67746
codersdk: Create requestOption type
mafredriMay 5, 2022
55028d2
codersdk: Add test for Pagination.asRequestOption
mafredriMay 5, 2022
ea2371e
coderd: Handle http response errors in parsePagination
mafredriMay 5, 2022
66af4ec
codersdk: Use parallel test
mafredriMay 5, 2022
067f912
Fix created_at edge case for pagination cursor in queries
mafredriMay 5, 2022
b8be7a8
Fix copy paste issue
mafredriMay 5, 2022
13fc406
Run make gen
mafredriMay 10, 2022
aab400c
feat: Add support for json omitempty and embedded structs in apitypin…
mafredriMay 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
codersdk: Create requestOption type
  • Loading branch information
@mafredri
mafredri committedMay 10, 2022
commit8a67746c152f673ce6cc5546b89a75eaa14a3ad5
4 changes: 3 additions & 1 deletioncodersdk/client.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,9 +33,11 @@ type Client struct {
URL *url.URL
}

type requestOption func(*http.Request)

// request performs an HTTP request with the body provided.
// The caller is responsible for closing the response body.
func (c *Client) request(ctx context.Context, method, path string, body interface{}, opts ...func(r *http.Request)) (*http.Response, error) {
func (c *Client) request(ctx context.Context, method, path string, body interface{}, opts ...requestOption) (*http.Response, error) {
serverURL, err := c.URL.Parse(path)
if err != nil {
return nil, xerrors.Errorf("parse url: %w", err)
Expand Down
2 changes: 1 addition & 1 deletioncodersdk/pagination.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,7 +28,7 @@ type Pagination struct {

// asRequestOption returns a function that can be used in (*Client).request.
// It modifies the request query parameters.
func (p Pagination) asRequestOption()func(*http.Request) {
func (p Pagination) asRequestOption()requestOption {
return func(r *http.Request) {
q := r.URL.Query()
if p.AfterID != uuid.Nil {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp