pulumi/sdk
Fraser Waters c7ed4024ff Support for integers on the wire and state protocol
An exploration into how we could support int64 as well as float64 as a
first class type in Pulumi.

There's some inherit trickiness with this because we use JSON in a few
places, state files most obviously but `PropertyValue` on the wire is
using the protobuf `Struct` and `Value` types which are just mappings to
JSON as well.

JSON doesn't have an int64 type, and while the Go JSON marshaller can
read/write int64s it's not a great behaviour to rely on given mixed
support for that across languages. Further the protobuf `Value` type
only supports float64s.

So we support integers similar to our other special types (like assets)
and wrap them in an object with a special signature field. The value
itself is either a number (if it can safely roundtrip to float64 and
back again) or a string.

Providers, SDKs and the engine communicate support for integers via
`AcceptsIntegers` fields in their interfaces (or similar). When
transmitting to a peer that doesn't support integers (e.g. an old SDK,
or old provider) all integer values are mapped back to standard number
values.

As this changes the serialisation of property values in the state file
it will trigger errors if old engines try to load a state file
containing integers.
2024-08-23 13:36:45 +01:00
..
go Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
nodejs Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
proto/go Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
python Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
.version Prepare for v3.130.0 release (#17048) 2024-08-22 22:34:23 +00:00
README.md Cleanup sdk/README.md 2023-01-03 17:12:12 -05:00
go.mod Query language runtime for options during “pulumi new” (#16346) 2024-06-17 17:10:55 +00:00
go.sum Query language runtime for options during “pulumi new” (#16346) 2024-06-17 17:10:55 +00:00
version.go Move .version to /sdk and embed it (#15185) 2024-01-19 14:11:17 +00:00

README.md

Pulumi Language SDKs

This directory contains Pulumi SDKs for the following languages:

See the respective READMEs for information about installing and using these libraries.

The language providers work by implementing gRPC interfaces defined in the top level directory proto.