forked from hashicorp/terraform-plugin-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/fwschemadata: Replace fwserver duplicate logic, add data des…
…cription (hashicorp#464) Reference: hashicorp#365 Reference: hashicorp#366 This change represents another evolutionary step to move away from `tfsdk.Config`, `tfsdk.Plan`, and `tfsdk.State` types directly, where the temporarily duplicated logic in `internal/fwserver` which worked directly with those types is replaced with the shared data implementation.
- Loading branch information
Showing
19 changed files
with
145 additions
and
388 deletions.
There are no files selected for viewing
This file contains 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 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,43 @@ | ||
package fwschemadata | ||
|
||
const ( | ||
// DataDescriptionConfiguration is used for Data that represents | ||
// a configuration-based value. | ||
DataDescriptionConfiguration DataDescription = "configuration" | ||
|
||
// DataDescriptionPlan is used for Data that represents | ||
// a plan-based value. | ||
DataDescriptionPlan DataDescription = "plan" | ||
|
||
// DataDescriptionState is used for Data that represents | ||
// a state-based value. | ||
DataDescriptionState DataDescription = "state" | ||
) | ||
|
||
// DataDescription is a human friendly type for Data. Used in error | ||
// diagnostics. | ||
type DataDescription string | ||
|
||
// String returns the lowercase string of the description. | ||
func (d DataDescription) String() string { | ||
switch d { | ||
case "": | ||
return "data" | ||
default: | ||
return string(d) | ||
} | ||
} | ||
|
||
// Title returns the titlecase string of the description. | ||
func (d DataDescription) Title() string { | ||
switch d { | ||
case DataDescriptionConfiguration: | ||
return "Configuration" | ||
case DataDescriptionPlan: | ||
return "Plan" | ||
case DataDescriptionState: | ||
return "State" | ||
default: | ||
return "Data" | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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 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 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 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
Oops, something went wrong.