Documentation ¶
Overview ¶
Package ende - ENcoding and DEcoding resource.Property* values
Index ¶
- Constants
- type Encoder
- func Decode[T any](m resource.PropertyMap) (Encoder, T, mapper.MappingError)
- func DecodeAny(m resource.PropertyMap, dst any) (Encoder, mapper.MappingError)
- func DecodeConfig[T any](m resource.PropertyMap, dst T) (Encoder, mapper.MappingError)
- func DecodeTolerateMissing[T any](m resource.PropertyMap, dst T) (Encoder, mapper.MappingError)
Constants ¶
const ArchiveSignature = "195f3948f6769324d4661e1e245f3a4d"
ArchiveSignature is a unique key for use for archives in the AssetOrArchive union type.
const AssetSignature = "a9e28acb8ab501f883219e7c9f624fb6"
AssetSignature is a unique key for use for assets in the AssetOrArchive union type.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder holds a look-aside table of information that can be encoded into a resource.PropertyMap but cannot be encoded into a plain Go struct.
Encoder is a byproduct of Decode, and a non-zero Encoder should be used whenever possible. If it is not possible to derive an Encoder, it safe to use the zero value of Encoder.
func Decode ¶
func Decode[T any](m resource.PropertyMap) (Encoder, T, mapper.MappingError)
Decode a property map to a `pulumi:"x"` annotated struct.
The returned mapper can restore the metadata it removed when translating `dst` back to a property map. If the shape of `T` matches `m`, then this will be a no-op:
encoder, value, _ := Decode(m) m, _ = encoder.Encode(value)
func DecodeAny ¶ added in v0.16.0
func DecodeAny(m resource.PropertyMap, dst any) (Encoder, mapper.MappingError)
func DecodeConfig ¶
func DecodeConfig[T any](m resource.PropertyMap, dst T) (Encoder, mapper.MappingError)
func DecodeTolerateMissing ¶
func DecodeTolerateMissing[T any](m resource.PropertyMap, dst T) (Encoder, mapper.MappingError)
DecodeTolerateMissing is like Decode, but doesn't return an error for a missing value.
func (Encoder) AllowUnknown ¶
Mark an encoder as generating values only.
This is appropriate when you are encoding a value where all fields must be known, such as a non-preview create or update.
func (Encoder) Encode ¶
func (e Encoder) Encode(src any) (resource.PropertyMap, mapper.MappingError)