-
Notifications
You must be signed in to change notification settings - Fork 94
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
Introduce providerserver package, deprecate tfsdk server functionality #308
Conversation
Reference: #215 Reference: #294 Reference: #296 This change represents the first half of the work necessary to extract the `tfprotov6.ProviderServer` implementation and helper functions out of the `tfsdk` package and into separate packages. The `providerserver` package will be the provider developer facing functionality, while the next iteration of this refactoring will move the actual server implementation into a separate internal package. Once in that separate internal package, efforts can be made to make that code handle terraform-plugin-go type conversions "at the edge" better.
// Returns a protocol version 6 ProviderServer implementation based on the | ||
// given Provider and suitable for usage with the terraform-plugin-go | ||
// tf6server.Serve() function and various terraform-plugin-mux functions. | ||
func NewProtocol6ProviderServer(p Provider) func() tfprotov6.ProviderServer { |
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.
This is safe, as this function was not released as part of this package yet.
// acceptance testing helper/resource.TestCase.ProtoV6ProviderFactories. | ||
// | ||
// The error return is not currently used, but it may be in the future. | ||
func NewProtocol6ProviderServerWithError(p Provider) func() (tfprotov6.ProviderServer, error) { |
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.
This is safe, as this function was not released as part of this package yet.
providerserver/providerserver.go
Outdated
"github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server" | ||
) | ||
|
||
// Returns a protocol version 6 ProviderServer implementation based on the |
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.
Perhaps prefix with NewProtocol6
?
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.
Updated in 81cba2c -- we should figure out what linter is triggering the warnings so we can either explicitly enable or disable it per team preference.
…e function name at beginning
… package functions (#2256) Reference: hashicorp/terraform-plugin-framework#294 Reference: hashicorp/terraform-plugin-framework#308
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Reference: #215
Continues: #294
Continues: #296
This change represents the first half of the work necessary to extract the
tfprotov6.ProviderServer
implementation and helper functions out of thetfsdk
package and into separate packages. Theproviderserver
package will be the provider developer facing functionality, while the next iteration of this refactoring will move the actual server implementation into a separate internal package. Once in that separate internal package, efforts can be made to make that code handle terraform-plugin-go type conversions "at the edge" better.