Documentation ¶
Overview ¶
The Pulumi value system (formerly resource.PropertyValue)
Index ¶
- Variables
- func EqualRelaxComputed(opts *eqOpts)
- type Archive
- type Array
- type Asset
- type EqualOption
- type GoValue
- type Map
- type ResourceReference
- type Value
- func (v Value) AsArchive() Archive
- func (v Value) AsArray() Array
- func (v Value) AsAsset() Asset
- func (v Value) AsBool() bool
- func (v Value) AsMap() Map
- func (v Value) AsNumber() float64
- func (v Value) AsResourceReference() ResourceReference
- func (v Value) AsString() string
- func (v Value) Dependencies() []urn.URN
- func (v Value) Equals(other Value, opts ...EqualOption) bool
- func (v Value) HasComputed() bool
- func (v Value) HasSecrets() bool
- func (v Value) IsArchive() bool
- func (v Value) IsArray() bool
- func (v Value) IsAsset() bool
- func (v Value) IsBool() bool
- func (v Value) IsComputed() bool
- func (v Value) IsMap() bool
- func (v Value) IsNull() bool
- func (v Value) IsNumber() bool
- func (v Value) IsResourceReference() bool
- func (v Value) IsString() bool
- func (v Value) Secret() bool
- func (v Value) WithDependencies(deps []urn.URN) Value
- func (v Value) WithSecret(isSecret bool) Value
Constants ¶
This section is empty.
Variables ¶
var ( // Mark a property as an untyped computed value. Computed computed // Mark a property as an untyped empty value. Null null )
Computed and Null are marker values of distinct singleton types.
Because the type of the variable is a singleton, it is not possible to mutate these values (there is no other value to mutate to).
Functions ¶
func EqualRelaxComputed ¶
func EqualRelaxComputed(opts *eqOpts)
See the doc comment for Value.Equals for the effect of EqualRelaxComputed.
Types ¶
type EqualOption ¶
type EqualOption func(*eqOpts)
type GoValue ¶
type GoValue interface { bool | float64 | string | Array | Map | Asset | Archive | ResourceReference | computed | null // marker singletons }
GoValue constrains the set of go values that can be contained inside a Value.
Value can also be a null value.
type ResourceReference ¶
ResourceReference is a property value that represents a reference to a Resource. The reference captures the resource's URN, ID, and the version of its containing package. Note that there are several cases to consider with respect to the ID:
- The reference may not contain an ID if the referenced resource is a component resource. In this case, the ID will be Null.
- The ID may be unknown (in which case it will be the Computed property value)
- Otherwise, the ID must be a string.
func (ResourceReference) Equal ¶
func (ref ResourceReference) Equal(other ResourceReference) bool
func (ResourceReference) IDString ¶
func (ref ResourceReference) IDString() (value string, hasID bool)
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is an imitable representation of a Pulumi value.
It may represent any type in GoValue. In addition, values may be secret or computed. It may have resource dependencies.
The zero value of Value is null.
func Any ¶
Any creates a new Value from a GoValue of unknown type. An error is returned if goValue is not a member of GoValue.
func WithGoValue ¶
WithGoValue creates a new Value with the inner value newGoValue.
To set to a null or computed value, pass Null or Computed as newGoValue.
func (Value) AsResourceReference ¶
func (v Value) AsResourceReference() ResourceReference
func (Value) Dependencies ¶
Dependencies returns the dependency set of v.
func (Value) Equals ¶
func (v Value) Equals(other Value, opts ...EqualOption) bool
Check if two Values are equal.
There are two corner cases that need to be called out here:
Secret equality is enforced. That means that:
{"a", secret: false} == {"a", secret: false}
{"a", secret: true} != {"a", secret: false}
{"b", secret: false} != {"c", secret: false}
Computed value equality has two different modes. By default, it works like Null equality: a.IsComputed() => (a.Equals(b) <=> b.IsComputed()) (up to secrets and dependencies).
If EqualRelaxComputed is passed, then computed values are considered equal to all other values. (up to secrets and dependencies)
func (Value) HasComputed ¶
HasComputed returns true if the Value or any nested Value is computed.
func (Value) HasSecrets ¶
HasSecrets returns true if the Value or any nested Value is secret.
func (Value) IsComputed ¶
func (Value) IsResourceReference ¶
func (Value) Secret ¶
Secret returns true if the Value is secret.
It does not check if a contained Value is secret.
func (Value) WithDependencies ¶
Set deps as the v.Dependencies() value of the returned Value.
func (Value) WithSecret ¶
WithSecret copies v where secret is true.