Introduce internal/fwserver package and migrate GetProviderSchema #319
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.
Reference: #215
This step of the provider server refactoring introduces a new
internal/fwserver
package that will contain the provider server implementation for any protocol version, there only being a version 6 implementation at the moment. This package will contain only framework-native types that aren't already defined by thetfsdk
package that are used by provider developers today, which is necessary to prevent import cycles. The protocol specific implementations will then wrap this framework server implementation and handle any necessary conversion of protocol specific types to framework specific types and back. Eventually, the existinginternal/proto6server
implementation will make no reference to any framework native types except the framework server and protocol type conversions.For now, only the
GetProviderSchema
RPC is migrated to show what this refactoring will look like for the rest of the RPCs.This has a few benefits which can be seen here including clear abstractions for protocol specific handling versus generic framework handling and unit testing at those abstraction boundaries.
Please note that much of the "end-to-end" unit testing is already in the
internal/proto6server
package, which shows no changes in behavior, and therefore can help gain confidence in this change not introducing potential regressions.