ende

package
v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package ende - ENcoding and DEcoding resource.Property* values

Index

Constants

View Source
const ArchiveSignature = "195f3948f6769324d4661e1e245f3a4d"

ArchiveSignature is a unique key for use for archives in the AssetOrArchive union type.

View Source
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

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

func (e Encoder) AllowUnknown(allowUnknowns bool) Encoder

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL