Token
Represents a special or lazily-evaluated value.
Can be used to delay evaluation of a certain value in case, for example, that it requires some context or late-bound data. Can also be used to mark values that need special processing at document rendering time.
Tokens can be embedded into strings while retaining their original semantics.
Static Functions
Name | Description |
---|---|
AsAny |
Return a resolvable representation of the given value. |
AsList |
Return a reversible list representation of this token. |
AsNumber |
Return a reversible number representation of this token. |
AsString |
Return a reversible string representation of this token. |
IsUnresolved |
Returns true if obj represents an unresolved value. |
AsAny
import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore"
alicloudroscdkcore.Token_AsAny(value interface{}) IResolvable
Return a resolvable representation of the given value.
- Type: interface{}
AsList
import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore"
alicloudroscdkcore.Token_AsList(value interface{}, options EncodingOptions) *[]*string
Return a reversible list representation of this token.
- Type: interface{}
- Type: EncodingOptions
AsNumber
import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore"
alicloudroscdkcore.Token_AsNumber(value interface{}) *f64
Return a reversible number representation of this token.
- Type: interface{}
AsString
import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore"
alicloudroscdkcore.Token_AsString(value interface{}, options EncodingOptions) *string
Return a reversible string representation of this token.
If the Token is initialized with a literal, the stringified value of the literal is returned. Otherwise, a special quoted string representation of the Token is returned that can be embedded into other strings.
Strings with quoted Tokens in them can be restored back into
complex values with the Tokens restored by calling resolve()
on the string.
- Type: interface{}
- Type: EncodingOptions
IsUnresolved
import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore"
alicloudroscdkcore.Token_IsUnresolved(obj interface{}) *bool
Returns true if obj represents an unresolved value.
One of these must be true:
obj
is an IResolvableobj
is a string containing at least one encodedIResolvable
obj
is either an encoded number or list
This does NOT recurse into lists or objects to see if they containing resolvables.
- Type: interface{}
The object to test.