mirror of https://github.com/pulumi/pulumi.git
c7ed4024ff
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. |
||
---|---|---|
.. | ||
auto | ||
common | ||
internal | ||
property | ||
pulumi | ||
pulumi-language-go | ||
pulumix | ||
Makefile | ||
README.md |
README.md
Pulumi Golang SDK
This directory contains support for writing Pulumi programs in the Go language. There are two aspects to this:
pulumi/
contains the client language bindings Pulumi program's code directly against;pulumi-language-go/
contains the language host plugin that the Pulumi engine uses to orchestrate updates.
To author a Pulumi program in Go, simply say so in your Pulumi.yaml
name: <my-project>
runtime: go
and ensure you have pulumi-language-go
on your path (it is distributed in the Pulumi download automatically).
By default, the language plugin will use your project's name, <my-project>
, as the executable that it loads. This too
must be on your path for the language provider to load it when you run pulumi preview
or pulumi up
.