Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Type ¶
Type attempts to process the given expression as a type expression and, if successful, returns the resulting type. If unsuccessful, error diagnostics are returned.
func TypeConstraint ¶
TypeConstraint attempts to parse the given expression as a type constraint and, if successful, returns the resulting type. If unsuccessful, error diagnostics are returned.
A type constraint has the same structure as a type, but it additionally allows the keyword "any" to represent cty.DynamicPseudoType, which is often used as a wildcard in type checking and type conversion operations.
func TypeString ¶
TypeString returns a string rendering of the given type as it would be expected to appear in the HCL native syntax.
This is primarily intended for showing types to the user in an application that uses typexpr, where the user can be assumed to be familiar with the type expression syntax. In applications that do not use typeexpr these results may be confusing to the user and so type.FriendlyName may be preferable, even though it's less precise.
TypeString produces reasonable results only for types like what would be produced by the Type and TypeConstraint functions. In particular, it cannot support capsule types.
Types ¶
This section is empty.