-
Notifications
You must be signed in to change notification settings - Fork 96
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
attr: Add ValueFromFramework
and ToFrameworkValue
Interface Functions to attr.Value
#535
Labels
enhancement
New feature or request
Comments
bendbennett
added a commit
that referenced
this issue
Nov 11, 2022
… types.ListType and types.List (value), respectively (#535)
bendbennett
added a commit
that referenced
this issue
Nov 11, 2022
… types.MapType and types.Map (value), respectively (#535)
bendbennett
added a commit
that referenced
this issue
Nov 11, 2022
… types.SetType and types.Set (value), respectively (#535)
bendbennett
added a commit
that referenced
this issue
Nov 11, 2022
… types.ObjectType and types.Object (value), respectively (#535)
bendbennett
added a commit
that referenced
this issue
Nov 11, 2022
… primitive types and primitive values, respectively (#535)
bendbennett
added a commit
that referenced
this issue
Nov 11, 2022
bendbennett
added a commit
that referenced
this issue
Nov 14, 2022
…faces from ValueFrom<type> functions (#535)
bendbennett
added a commit
that referenced
this issue
Nov 14, 2022
bendbennett
added a commit
that referenced
this issue
Nov 14, 2022
bendbennett
added a commit
that referenced
this issue
Nov 14, 2022
… attribute plan modification and attribute validation for custom nested attribute types (#535)
bendbennett
added a commit
that referenced
this issue
Nov 15, 2022
* Adding ValueFromFramework and ToFrameworkValue interface functions to types.ListType and types.List (value), respectively (#535) * Adding ValueFromFramework and ToFrameworkValue interface functions to types.MapType and types.Map (value), respectively (#535) * Adding ValueFromFramework and ToFrameworkValue interface functions to types.SetType and types.Set (value), respectively (#535) * Adding ValueFromFramework and ToFrameworkValue interface functions to types.ObjectType and types.Object (value), respectively (#535) * Adding ValueFromFramework and ToFrameworkValue interface functions to primitive types and primitive values, respectively (#535) * Refactoring interface names to use -able suffix (#535) * Adding Go documentation and refactoring to return type-specific interfaces from ValueFrom<type> functions (#535) * Adding further Go documentation (#535) * Apply suggestions from code review Co-authored-by: Brian Flad <[email protected]> * Amending Go documentation (#535) * Adding changelog, amending Go documentation and adding unit tests for attribute plan modification and attribute validation for custom nested attribute types (#535) Co-authored-by: Brian Flad <[email protected]>
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Module version
Use-cases
A first step required for making the use of custom types for nested attributes feasible requires a mechanism for converting to/from the framework type (e.g.,
types.List
).Attempted Solutions
Using an interface implemented by custom types that is specific to the framework type (e.g.,
types.List
) that they embed and then using type assertion to determine if the type being used is either a framework type (e.g.,types.List
) or a type that implements an interface that gives access to the framework type (e.g.,types.List
) embedded in the custom type.Proposal
Introduce separate interfaces for each of the framework types that can be implemented by custom types to allow access to the embedded type and to obtain an instance of the custom type by passing the framework type.
Once these interfaces are in place then custom types that embed framework types (e.g.,
types.List
) can be created and used in place of framework types.References
The text was updated successfully, but these errors were encountered: