pulumi/sdk/go/common/util
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
..
archive sdk/go/common/util cleanup 2023-03-10 08:49:00 +00:00
ciutil Use `SYSTEM_PULLREQUEST_SOURCECOMMITID` for AZ pipeline on GH PR (#15513) 2024-02-26 14:55:54 +00:00
cmdutil Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
contract sdk/contract: Deprecate non-f variants 2023-03-03 14:37:59 -08:00
deepcopy Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
env Rename self-managed to diy-backend (#15268) 2024-01-30 09:00:15 +00:00
executable Fix potential nil panic in FindExecutable (#16966) 2024-08-14 08:25:06 +00:00
fsutil Install missing python versions using pyenv during installation (#16855) 2024-08-19 15:55:54 +00:00
gitutil Fix incorrect caching of git auth method in error cases (#16652) 2024-07-16 14:53:32 +00:00
httputil retry post requests that timeout during handshake (#16576) 2024-07-03 16:22:24 +00:00
logging Use the Depth variants in glog calls (#15307) 2024-01-29 22:51:45 +00:00
mapper turn on the golangci-lint exhaustive linter (#15028) 2024-01-17 16:50:41 +00:00
result Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
retry sdk/common/retry: Fix extraneous backoff 2023-03-24 16:39:02 -07:00
rpcutil [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
yamlutil turn on the golangci-lint exhaustive linter (#15028) 2024-01-17 16:50:41 +00:00