mirror of https://github.com/pulumi/pulumi.git
7ff4b2c8be
Adds the pulumix subpackage implementing strongly-typed inputs, outputs, and combinators. internal/cmd/gen-pux-applyn generates all four variants of `Apply` for up to 8 parameters. **Note**: Input[T] is not a constraint for most combinators. Making Input[T] a constraint for the provided combinators results in annoying, unreadable type signatures. Users will not find these enjoyable to use. ```go func Apply8[ I1 Input[A1], I2 Input[A2], I3 Input[A3], I4 Input[A4], I5 Input[A5], I6 Input[A6], I7 Input[A7], I8 Input[A8], A1, A2, A3, A4, A5, A6, A7, A8, B any, ]( i1 I1, i2 I2, i3 I3, i4 I4, i5 I5, i6 I6, i7 I7, i8 I8, fn func(A1, A2, A3, A4, A5, A6, A7, A8) B, ) Output[B] ``` Versus: ```go func Apply8[A1, A2, A3, A4, A5, A6, A7, A8, B any]( i1 Input[A1], i2 Input[A2], i3 Input[A3], i4 Input[A4], i5 Input[A5], i6 Input[A6], i7 Input[A7], i8 Input[A8], fn func(A1, A2, A3, A4, A5, A6, A7, A8) B, ) Output[B] ``` Users of Go 1.21 or higher will not need to provide any type parameters for these functions with the new, improved type inference in Go 1.21. Users of prior versions will have to provide `A*` type parameters. We consider this an acceptable tradeoff for the usabililty and readability win of these APIs. |
||
---|---|---|
.. | ||
auto | ||
common | ||
internal | ||
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
.