pulumi/sdk/go/common
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
..
apitype Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
channel Send all events to the engine event stream (#14607) 2023-11-20 21:55:59 +00:00
constant Send update metadata about update plans 2022-10-12 22:55:59 +01:00
diag turn on the golangci-lint exhaustive linter (#15028) 2024-01-17 16:50:41 +00:00
encoding all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
env URL-based plugin source overrides via env var (#16648) 2024-07-26 10:37:09 +00:00
promise Use promise rather than `atomic.Value` to record step errors. (#14612) 2023-11-18 19:03:35 +00:00
resource Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
slice Engine support for remote transforms (#15290) 2024-02-21 16:30:46 +00:00
testing Use a new PULUMI_HOME for every test environment (#15559) 2024-03-01 21:32:49 +00:00
tokens Move resource.URN to urn.URN (#15689) 2024-03-14 15:28:32 +00:00
tools all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
util Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
version move pkg/version -> sdk/go/common/version 2020-03-18 15:25:25 -07:00
workspace Install missing python versions using pyenv during installation (#16855) 2024-08-19 15:55:54 +00:00