-
Notifications
You must be signed in to change notification settings - Fork 18
[Smithy 643] Update elasticsearch client version #1113
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ptzianos
merged 2 commits into
main
from
smithy-643-update-elasticsearch-client-version
Oct 13, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
77 changes: 77 additions & 0 deletions
77
components/reporters/elasticsearch/internal/reporter/es_clients.go
This file contains hidden or 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,77 @@ | ||
| package reporter | ||
|
|
||
| import ( | ||
| "io" | ||
|
|
||
| esv8 "github.com/elastic/go-elasticsearch/v8" | ||
| esapiv8 "github.com/elastic/go-elasticsearch/v8/esapi" | ||
|
|
||
| esv9 "github.com/elastic/go-elasticsearch/v9" | ||
| esapiv9 "github.com/elastic/go-elasticsearch/v9/esapi" | ||
| ) | ||
|
|
||
| // v8Client is a wrapper for the es v8 client | ||
| type v8Client struct { | ||
| client *esv8.Client | ||
| } | ||
|
|
||
| // Index calls the underlying v8 client's Index method and wraps the response | ||
| func (a *v8Client) Index(index string, body io.Reader) (esResponse, error) { | ||
| res, err := a.client.Index(index, body) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return &v8EsAPIRes{res}, nil | ||
| } | ||
|
|
||
| // Info calls the underlying v8 client's Info method and wraps the response | ||
| func (a *v8Client) Info() (esResponse, error) { | ||
| res, err := a.client.Info() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return &v8EsAPIRes{res}, nil | ||
| } | ||
|
|
||
| // v8EsAPIRes wraps the v8 ES API | ||
| type v8EsAPIRes struct { | ||
| res *esapiv8.Response | ||
| } | ||
|
|
||
| func (r *v8EsAPIRes) IsError() bool { return r.res.IsError() } | ||
| func (r *v8EsAPIRes) String() string { return r.res.String() } | ||
| func (r *v8EsAPIRes) StatusCode() int { return r.res.StatusCode } | ||
| func (r *v8EsAPIRes) Body() io.ReadCloser { return r.res.Body } | ||
|
|
||
| // v9Client is a wrapper for the es v9 client | ||
| type v9Client struct { | ||
| client *esv9.Client | ||
| } | ||
|
|
||
| // Index calls the underlying v9 client's Index method and wraps the response. | ||
| func (a *v9Client) Index(index string, body io.Reader) (esResponse, error) { | ||
| res, err := a.client.Index(index, body) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return &v9EsAPIRes{res}, nil | ||
| } | ||
|
|
||
| // Info calls the underlying v9 client's Info method and wraps the response | ||
| func (a *v9Client) Info() (esResponse, error) { | ||
| res, err := a.client.Info() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return &v9EsAPIRes{res}, nil | ||
| } | ||
|
|
||
| // v9EsAPIRes wraps the v9 ES API | ||
| type v9EsAPIRes struct { | ||
| res *esapiv9.Response | ||
| } | ||
|
|
||
| func (r *v9EsAPIRes) IsError() bool { return r.res.IsError() } | ||
| func (r *v9EsAPIRes) String() string { return r.res.String() } | ||
| func (r *v9EsAPIRes) StatusCode() int { return r.res.StatusCode } | ||
| func (r *v9EsAPIRes) Body() io.ReadCloser { return r.res.Body } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.