|
1 | 1 | func CreateIterable[T any](execute func(*T, error) (*T, error), validate func(*T, error) (bool, error), opts ...IterableOption) (*T, error) { |
2 | 2 | conf := config{ |
| 3 | + headerParams: map[string]string{}, |
3 | 4 | maxRetries: -1, |
4 | 5 | timeout: func(count int) time.Duration { |
5 | 6 | return 0 * time.Millisecond |
@@ -204,7 +205,7 @@ func (c *APIClient) WaitForApiKey( |
204 | 205 | operation ApiKeyOperation, |
205 | 206 | opts ...WaitForApiKeyOption, |
206 | 207 | ) (*GetApiKeyResponse, error) { |
207 | | - conf := config{} |
| 208 | + conf := config{headerParams: map[string]string{}} |
208 | 209 |
|
209 | 210 | for _, opt := range opts { |
210 | 211 | opt.apply(&conf) |
@@ -572,6 +573,7 @@ Helper: Replaces object content of all the given objects according to their resp |
572 | 573 | */ |
573 | 574 | func (c *APIClient) PartialUpdateObjects(indexName string, objects []map[string]any, opts ...PartialUpdateObjectsOption) ([]BatchResponse, error) { |
574 | 575 | conf := config{ |
| 576 | + headerParams: map[string]string{}, |
575 | 577 | createIfNotExists: true, |
576 | 578 | } |
577 | 579 |
|
@@ -602,6 +604,7 @@ ChunkedBatch chunks the given `objects` list in subset of 1000 elements max in o |
602 | 604 | */ |
603 | 605 | func (c *APIClient) ChunkedBatch(indexName string, objects []map[string]any, action Action, opts ...ChunkedBatchOption) ([]BatchResponse, error) { |
604 | 606 | conf := config{ |
| 607 | + headerParams: map[string]string{}, |
605 | 608 | waitForTasks: false, |
606 | 609 | batchSize: 1000, |
607 | 610 | } |
@@ -653,6 +656,7 @@ func (c *APIClient) ReplaceAllObjects(indexName string, objects []map[string]any |
653 | 656 | tmpIndexName := fmt.Sprintf("%s_tmp_%d", indexName, time.Now().UnixNano()) |
654 | 657 |
|
655 | 658 | conf := config{ |
| 659 | + headerParams: map[string]string{}, |
656 | 660 | scopes: []ScopeType{SCOPE_TYPE_SETTINGS, SCOPE_TYPE_RULES, SCOPE_TYPE_SYNONYMS}, |
657 | 661 | } |
658 | 662 |
|
|
0 commit comments