Skip to content

Commit a8f6289

Browse files
authored
Merge branch 'main' into feat/ingestion-push-endpoint
2 parents 3ad7b39 + 4455b77 commit a8f6289

File tree

9 files changed

+333
-177
lines changed

9 files changed

+333
-177
lines changed

clients/algoliasearch-client-go/algolia/search/api_search.go

Lines changed: 128 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

playground/go/ingestion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ func testIngestion(appID, apiKey string) int {
3333

3434
printResponse(createAuthenticationResponse)
3535

36-
listAuthenticationsResponse, err := ingestionClient.GetAuthentications(
37-
ingestionClient.NewApiGetAuthenticationsRequest().WithItemsPerPage(2),
36+
listAuthenticationsResponse, err := ingestionClient.ListAuthentications(
37+
ingestionClient.NewApiListAuthenticationsRequest().WithItemsPerPage(2),
3838
)
3939
if err != nil {
4040
fmt.Printf("request error with GetAuthentications: %v\n", err)

playground/go/search.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"context"
4+
"fmt"
55

66
"github.com/algolia/algoliasearch-client-go/v4/algolia/search"
77
)
@@ -13,9 +13,15 @@ func testSearch(appID, apiKey string) int {
1313
panic(err)
1414
}
1515

16-
res, err := searchClient.WaitForApiKey("test", search.API_KEY_OPERATION_ADD, search.WithContext(context.Background()), search.WithMaxRetries(4))
17-
print(res)
18-
print(err.Error())
16+
err = searchClient.BrowseObjects("test-flag", *search.NewEmptyBrowseParamsObject(), search.WithAggregator(func(res any, err error) {
17+
if err != nil {
18+
panic(err)
19+
}
20+
fmt.Println(len(res.(*search.BrowseResponse).Hits))
21+
}))
22+
if err != nil {
23+
panic(err)
24+
}
1925

2026
/*
2127
response, err := searchClient.AddOrUpdateObject(

scripts/cts/testServer/chunkWrapper.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ function addRoutes(app: Express): void {
3333
if (!chunkWrapperState[lang]) {
3434
chunkWrapperState[lang] = {};
3535
}
36+
37+
if (req.headers['x-algolia-api-key'] === 'wrong-api-key') {
38+
res.status(403).json({ message: 'Invalid Application-ID or API key', status: 403 });
39+
return;
40+
}
3641
chunkWrapperState[lang][helper] = (chunkWrapperState[lang][helper] ?? 0) + 1;
3742
switch (helper) {
3843
case 'saveObjects':

templates/go/api.mustache

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ type config struct {
4343
maxRetries int
4444
timeout func(int) time.Duration
4545
aggregator func(any, error)
46-
iterableError *IterableError
4746

4847
// -- WaitForApiKey options
4948
apiKey *ApiKey
@@ -187,12 +186,6 @@ func WithAggregator(aggregator func(any, error)) iterableOption {
187186
})
188187
}
189188

190-
func WithIterableError(iterableError *IterableError) iterableOption {
191-
return iterableOption(func(c *config) {
192-
c.iterableError = iterableError
193-
})
194-
}
195-
196189
// --------- WaitForKey options ---------.
197190

198191
type WaitForApiKeyOption interface {

0 commit comments

Comments
 (0)