-
Notifications
You must be signed in to change notification settings - Fork 127
Refactor pipelineResource into a separate package #639
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
Conversation
|
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
This helps the type to be reused by other packages
| } | ||
|
|
||
| // FileName returns the original filename associated with the pipeline. | ||
| func (p *Resource) FileName() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Filename
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| ) | ||
|
|
||
| // Resource represents a pipeline resource loaded from a file | ||
| type Resource struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking loud now, as the Resource may be too vague.
An alternative approach would be:
- create the
ingestpackage in theinternal/elasticsearchdirectory - add
pipelines.go - create the structure Pipeline.
or just move this file (with unit test) to the internal/elasticsearch directory, and rename to Pipeline. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and clear, well done.
This helps the type to be reused by other packages in the future.
First part of refactoring #585 into smaller PRs.