-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement CanImplement
method for providers
#3115
Conversation
Relates to #2845 Allows both the provider DB record as well as instances of the Provider interface to be queried to determine if they support a particular trait. Will be used more in future PRs.
return slices.Contains(p.Implements, impl) | ||
} | ||
|
||
// ProfileRow is an interface row in the profiles table |
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.
Moved across from store.go
- I think it's best to separate out these domain-level methods and data types
@@ -128,7 +128,7 @@ func NewProviderBuilder( | |||
|
|||
// Implements returns true if the provider implements the given type. | |||
func (pb *ProviderBuilder) Implements(impl db.ProviderType) bool { | |||
return slices.Contains(pb.p.Implements, impl) | |||
return pb.p.CanImplement(impl) |
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 have decided to leave this method for now. When my ProviderFactory
PR comes along, the ProviderBuilder
will be removed entirely. It doesn't seem like a good use of time to clean up all usages of this method.
CanImplement
method for providersCanImplement
method for providers
Relates to #2845
Allows both the provider DB record as well as instances of the Provider interface to be queried to determine if they support a particular trait. Will be used more in future PRs.
Summary
Provide a brief overview of the changes and the issue being addressed.
Explain the rationale and any background necessary for understanding the changes.
List dependencies required by this change, if any.
Fixes #(related issue)
Change Type
Mark the type of change your PR introduces:
Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.
Review Checklist: