[BREAKING] Remove unidiomatic numerical types from Go SDK (#6143)
This commit is contained in:
parent
6a598bd704
commit
527b799974
|
@ -2,7 +2,9 @@ CHANGELOG
|
|||
=========
|
||||
|
||||
## HEAD (Unreleased)
|
||||
_(none)_
|
||||
|
||||
- [sdk/go] Take a breaking change to remove unidiomatic numerical types and drastically improve build performance (binary size and compilation time).
|
||||
[#6143](https://github.com/pulumi/pulumi/pull/6143)
|
||||
|
||||
## 2.18.2 (2021-01-22)
|
||||
|
||||
|
|
|
@ -56,11 +56,6 @@ func (c *Config) GetBool(key string) bool {
|
|||
return GetBool(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetFloat32 loads an optional float32 configuration value by its key, or returns 0 if it doesn't exist.
|
||||
func (c *Config) GetFloat32(key string) float32 {
|
||||
return GetFloat32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetFloat64 loads an optional float64 configuration value by its key, or returns 0 if it doesn't exist.
|
||||
func (c *Config) GetFloat64(key string) float64 {
|
||||
return GetFloat64(c.ctx, c.fullKey(key))
|
||||
|
@ -71,51 +66,6 @@ func (c *Config) GetInt(key string) int {
|
|||
return GetInt(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetInt16 loads an optional int16 configuration value by its key, or returns 0 if it doesn't exist.
|
||||
func (c *Config) GetInt16(key string) int16 {
|
||||
return GetInt16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetInt32 loads an optional int32 configuration value by its key, or returns 0 if it doesn't exist.
|
||||
func (c *Config) GetInt32(key string) int32 {
|
||||
return GetInt32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetInt64 loads an optional int64 configuration value by its key, or returns 0 if it doesn't exist.
|
||||
func (c *Config) GetInt64(key string) int64 {
|
||||
return GetInt64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetInt8 loads an optional int8 configuration value by its key, or returns 0 if it doesn't exist.
|
||||
func (c *Config) GetInt8(key string) int8 {
|
||||
return GetInt8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetUint loads an optional uint configuration value by its key, or returns 0 if it doesn't exist.
|
||||
func (c *Config) GetUint(key string) uint {
|
||||
return GetUint(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetUint16 loads an optional uint16 configuration value by its key, or returns 0 if it doesn't exist.
|
||||
func (c *Config) GetUint16(key string) uint16 {
|
||||
return GetUint16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetUint32 loads an optional uint32 configuration value by its key, or returns 0 if it doesn't exist.
|
||||
func (c *Config) GetUint32(key string) uint32 {
|
||||
return GetUint32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetUint64 loads an optional uint64 configuration value by its key, or returns 0 if it doesn't exist.
|
||||
func (c *Config) GetUint64(key string) uint64 {
|
||||
return GetUint64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetUint8 loads an optional uint8 configuration value by its key, or returns 0 if it doesn't exist.
|
||||
func (c *Config) GetUint8(key string) uint8 {
|
||||
return GetUint8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// Require loads a configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) Require(key string) string {
|
||||
return Require(c.ctx, c.fullKey(key))
|
||||
|
@ -132,11 +82,6 @@ func (c *Config) RequireBool(key string) bool {
|
|||
return RequireBool(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireFloat32 loads a float32 configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) RequireFloat32(key string) float32 {
|
||||
return RequireFloat32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireFloat64 loads a float64 configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) RequireFloat64(key string) float64 {
|
||||
return RequireFloat64(c.ctx, c.fullKey(key))
|
||||
|
@ -147,51 +92,6 @@ func (c *Config) RequireInt(key string) int {
|
|||
return RequireInt(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireInt16 loads a int16 configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) RequireInt16(key string) int16 {
|
||||
return RequireInt16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireInt32 loads a int32 configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) RequireInt32(key string) int32 {
|
||||
return RequireInt32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireInt64 loads a int64 configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) RequireInt64(key string) int64 {
|
||||
return RequireInt64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireInt8 loads a int8 configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) RequireInt8(key string) int8 {
|
||||
return RequireInt8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireUint loads a uint configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) RequireUint(key string) uint {
|
||||
return RequireUint(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireUint16 loads a uint16 configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) RequireUint16(key string) uint16 {
|
||||
return RequireUint16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireUint32 loads a uint32 configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) RequireUint32(key string) uint32 {
|
||||
return RequireUint32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireUint64 loads a uint64 configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) RequireUint64(key string) uint64 {
|
||||
return RequireUint64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireUint8 loads a uint8 configuration value by its key, or panics if it doesn't exist.
|
||||
func (c *Config) RequireUint8(key string) uint8 {
|
||||
return RequireUint8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// Try loads a configuration value by its key, returning a non-nil error if it doesn't exist.
|
||||
func (c *Config) Try(key string) (string, error) {
|
||||
return Try(c.ctx, c.fullKey(key))
|
||||
|
@ -208,11 +108,6 @@ func (c *Config) TryBool(key string) (bool, error) {
|
|||
return TryBool(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TryFloat32 loads an optional float32 configuration value by its key, or returns an error if it doesn't exist.
|
||||
func (c *Config) TryFloat32(key string) (float32, error) {
|
||||
return TryFloat32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TryFloat64 loads an optional float64 configuration value by its key, or returns an error if it doesn't exist.
|
||||
func (c *Config) TryFloat64(key string) (float64, error) {
|
||||
return TryFloat64(c.ctx, c.fullKey(key))
|
||||
|
@ -223,51 +118,6 @@ func (c *Config) TryInt(key string) (int, error) {
|
|||
return TryInt(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TryInt16 loads an optional int16 configuration value by its key, or returns an error if it doesn't exist.
|
||||
func (c *Config) TryInt16(key string) (int16, error) {
|
||||
return TryInt16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TryInt32 loads an optional int32 configuration value by its key, or returns an error if it doesn't exist.
|
||||
func (c *Config) TryInt32(key string) (int32, error) {
|
||||
return TryInt32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TryInt64 loads an optional int64 configuration value by its key, or returns an error if it doesn't exist.
|
||||
func (c *Config) TryInt64(key string) (int64, error) {
|
||||
return TryInt64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TryInt8 loads an optional int8 configuration value by its key, or returns an error if it doesn't exist.
|
||||
func (c *Config) TryInt8(key string) (int8, error) {
|
||||
return TryInt8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TryUint loads an optional uint configuration value by its key, or returns an error if it doesn't exist.
|
||||
func (c *Config) TryUint(key string) (uint, error) {
|
||||
return TryUint(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TryUint16 loads an optional uint16 configuration value by its key, or returns an error if it doesn't exist.
|
||||
func (c *Config) TryUint16(key string) (uint16, error) {
|
||||
return TryUint16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TryUint32 loads an optional uint32 configuration value by its key, or returns an error if it doesn't exist.
|
||||
func (c *Config) TryUint32(key string) (uint32, error) {
|
||||
return TryUint32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TryUint64 loads an optional uint64 configuration value by its key, or returns an error if it doesn't exist.
|
||||
func (c *Config) TryUint64(key string) (uint64, error) {
|
||||
return TryUint64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TryUint8 loads an optional uint8 configuration value by its key, or returns an error if it doesn't exist.
|
||||
func (c *Config) TryUint8(key string) (uint8, error) {
|
||||
return TryUint8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecret loads an optional configuration value by its key
|
||||
// or "" if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecret(key string) pulumi.StringOutput {
|
||||
|
@ -286,12 +136,6 @@ func (c *Config) GetSecretBool(key string) pulumi.BoolOutput {
|
|||
return GetSecretBool(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecretFloat32 loads an optional float32 configuration value by its key
|
||||
// or 0 if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecretFloat32(key string) pulumi.Float32Output {
|
||||
return GetSecretFloat32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecretFloat64 loads an optional float64 configuration value by its key
|
||||
// or 0 if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecretFloat64(key string) pulumi.Float64Output {
|
||||
|
@ -304,60 +148,6 @@ func (c *Config) GetSecretInt(key string) pulumi.IntOutput {
|
|||
return GetSecretInt(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecretInt16 loads an optional int16 configuration value by its key
|
||||
// or 0 if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecretInt16(key string) pulumi.Int16Output {
|
||||
return GetSecretInt16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecretInt32 loads an optional int32 configuration value by its key
|
||||
// or 0 if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecretInt32(key string) pulumi.Int32Output {
|
||||
return GetSecretInt32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecretInt64 loads an optional int64 configuration value by its key
|
||||
// or 0 if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecretInt64(key string) pulumi.Int64Output {
|
||||
return GetSecretInt64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecretInt8 loads an optional int8 configuration value by its key
|
||||
// or 0 if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecretInt8(key string) pulumi.Int8Output {
|
||||
return GetSecretInt8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecretUint loads an optional uint configuration value by its key
|
||||
// or 0 if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecretUint(key string) pulumi.UintOutput {
|
||||
return GetSecretUint(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecretUint16 loads an optional uint16 configuration value by its key
|
||||
// or 0 if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecretUint16(key string) pulumi.Uint16Output {
|
||||
return GetSecretUint16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecretUint32 loads an optional uint32 configuration value by its key
|
||||
// or 0 if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecretUint32(key string) pulumi.Uint32Output {
|
||||
return GetSecretUint32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecretUint64 loads an optional uint64 configuration value by its key
|
||||
// or 0 if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecretUint64(key string) pulumi.Uint64Output {
|
||||
return GetSecretUint64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// GetSecretUint8 loads an optional uint8 configuration value by its key
|
||||
// or 0 if it doesn't exist, and returns it wrapped in a secret Output.
|
||||
func (c *Config) GetSecretUint8(key string) pulumi.Uint8Output {
|
||||
return GetSecretUint8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecret loads a configuration value by its key
|
||||
// and returns it wrapped in a secret output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecret(key string) pulumi.StringOutput {
|
||||
|
@ -376,12 +166,6 @@ func (c *Config) RequireSecretBool(key string) pulumi.BoolOutput {
|
|||
return RequireSecretBool(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecretFloat32 loads a float32 configuration value by its key
|
||||
// and returns is wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecretFloat32(key string) pulumi.Float32Output {
|
||||
return RequireSecretFloat32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecretFloat64 loads a float64 configuration value by its key
|
||||
// and returns is wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecretFloat64(key string) pulumi.Float64Output {
|
||||
|
@ -394,60 +178,6 @@ func (c *Config) RequireSecretInt(key string) pulumi.IntOutput {
|
|||
return RequireSecretInt(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecretInt16 loads a int16 configuration value by its key
|
||||
// and returns is wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecretInt16(key string) pulumi.Int16Output {
|
||||
return RequireSecretInt16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecretInt32 loads a int32 configuration value by its key
|
||||
// and returns is wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecretInt32(key string) pulumi.Int32Output {
|
||||
return RequireSecretInt32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecretInt64 loads a int64 configuration value by its key
|
||||
// and returns is wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecretInt64(key string) pulumi.Int64Output {
|
||||
return RequireSecretInt64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecretInt8 loads a int8 configuration value by its key
|
||||
// and returns is wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecretInt8(key string) pulumi.Int8Output {
|
||||
return RequireSecretInt8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecretUint loads a uint configuration value by its key
|
||||
// and returns is wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecretUint(key string) pulumi.UintOutput {
|
||||
return RequireSecretUint(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecretUint16 loads a uint16 configuration value by its key
|
||||
// and returns is wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecretUint16(key string) pulumi.Uint16Output {
|
||||
return RequireSecretUint16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecretUint32 loads a uint32 configuration value by its key
|
||||
// and returns is wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecretUint32(key string) pulumi.Uint32Output {
|
||||
return RequireSecretUint32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecretUint64 loads a uint64 configuration value by its key
|
||||
// and returns is wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecretUint64(key string) pulumi.Uint64Output {
|
||||
return RequireSecretUint64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// RequireSecretUint8 loads a uint8 configuration value by its key
|
||||
// and returns is wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func (c *Config) RequireSecretUint8(key string) pulumi.Uint8Output {
|
||||
return RequireSecretUint8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecret loads a configuration value by its key, returning a non-nil error if it doesn't exist.
|
||||
func (c *Config) TrySecret(key string) (pulumi.StringOutput, error) {
|
||||
return TrySecret(c.ctx, c.fullKey(key))
|
||||
|
@ -464,12 +194,6 @@ func (c *Config) TrySecretBool(key string) (pulumi.BoolOutput, error) {
|
|||
return TrySecretBool(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecretFloat32 loads an optional float32 configuration value by its key into a secret Output,
|
||||
// or returns an error if it doesn't exist.
|
||||
func (c *Config) TrySecretFloat32(key string) (pulumi.Float32Output, error) {
|
||||
return TrySecretFloat32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecretFloat64 loads an optional float64 configuration value by its key into a secret Output,
|
||||
// or returns an error if it doesn't exist.
|
||||
func (c *Config) TrySecretFloat64(key string) (pulumi.Float64Output, error) {
|
||||
|
@ -481,57 +205,3 @@ func (c *Config) TrySecretFloat64(key string) (pulumi.Float64Output, error) {
|
|||
func (c *Config) TrySecretInt(key string) (pulumi.IntOutput, error) {
|
||||
return TrySecretInt(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecretInt16 loads an optional int16 configuration value by its key into a secret Output,
|
||||
// or returns an error if it doesn't exist.
|
||||
func (c *Config) TrySecretInt16(key string) (pulumi.Int16Output, error) {
|
||||
return TrySecretInt16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecretInt32 loads an optional int32 configuration value by its key into a secret Output,
|
||||
// or returns an error if it doesn't exist.
|
||||
func (c *Config) TrySecretInt32(key string) (pulumi.Int32Output, error) {
|
||||
return TrySecretInt32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecretInt64 loads an optional int64 configuration value by its key into a secret Output,
|
||||
// or returns an error if it doesn't exist.
|
||||
func (c *Config) TrySecretInt64(key string) (pulumi.Int64Output, error) {
|
||||
return TrySecretInt64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecretInt8 loads an optional int8 configuration value by its key into a secret Output,
|
||||
// or returns an error if it doesn't exist.
|
||||
func (c *Config) TrySecretInt8(key string) (pulumi.Int8Output, error) {
|
||||
return TrySecretInt8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecretUint loads an optional uint configuration value by its key into a secret Output,
|
||||
// or returns an error if it doesn't exist.
|
||||
func (c *Config) TrySecretUint(key string) (pulumi.UintOutput, error) {
|
||||
return TrySecretUint(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecretUint16 loads an optional uint16 configuration value by its key into a secret Output,
|
||||
// or returns an error if it doesn't exist.
|
||||
func (c *Config) TrySecretUint16(key string) (pulumi.Uint16Output, error) {
|
||||
return TrySecretUint16(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecretUint32 loads an optional uint32 configuration value by its key into a secret Output,
|
||||
// or returns an error if it doesn't exist.
|
||||
func (c *Config) TrySecretUint32(key string) (pulumi.Uint32Output, error) {
|
||||
return TrySecretUint32(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecretUint64 loads an optional uint64 configuration value by its key into a secret Output,
|
||||
// or returns an error if it doesn't exist.
|
||||
func (c *Config) TrySecretUint64(key string) (pulumi.Uint64Output, error) {
|
||||
return TrySecretUint64(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
||||
// TrySecretUint8 loads an optional uint8 configuration value by its key into a secret Output,
|
||||
// or returns an error if it doesn't exist.
|
||||
func (c *Config) TrySecretUint8(key string) (pulumi.Uint8Output, error) {
|
||||
return TrySecretUint8(c.ctx, c.fullKey(key))
|
||||
}
|
||||
|
|
|
@ -56,15 +56,6 @@ func GetBool(ctx *pulumi.Context, key string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// GetFloat32 loads an optional configuration value by its key, as a float32, or returns 0 if it doesn't exist.
|
||||
func GetFloat32(ctx *pulumi.Context, key string) float32 {
|
||||
key = ensureKey(ctx, key)
|
||||
if v, ok := ctx.GetConfig(key); ok {
|
||||
return cast.ToFloat32(v)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetFloat64 loads an optional configuration value by its key, as a float64, or returns 0 if it doesn't exist.
|
||||
func GetFloat64(ctx *pulumi.Context, key string) float64 {
|
||||
key = ensureKey(ctx, key)
|
||||
|
@ -83,87 +74,6 @@ func GetInt(ctx *pulumi.Context, key string) int {
|
|||
return 0
|
||||
}
|
||||
|
||||
// GetInt16 loads an optional configuration value by its key, as a int16, or returns 0 if it doesn't exist.
|
||||
func GetInt16(ctx *pulumi.Context, key string) int16 {
|
||||
key = ensureKey(ctx, key)
|
||||
if v, ok := ctx.GetConfig(key); ok {
|
||||
return cast.ToInt16(v)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetInt32 loads an optional configuration value by its key, as a int32, or returns 0 if it doesn't exist.
|
||||
func GetInt32(ctx *pulumi.Context, key string) int32 {
|
||||
key = ensureKey(ctx, key)
|
||||
if v, ok := ctx.GetConfig(key); ok {
|
||||
return cast.ToInt32(v)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetInt64 loads an optional configuration value by its key, as a int64, or returns 0 if it doesn't exist.
|
||||
func GetInt64(ctx *pulumi.Context, key string) int64 {
|
||||
key = ensureKey(ctx, key)
|
||||
if v, ok := ctx.GetConfig(key); ok {
|
||||
return cast.ToInt64(v)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetInt8 loads an optional configuration value by its key, as a int8, or returns 0 if it doesn't exist.
|
||||
func GetInt8(ctx *pulumi.Context, key string) int8 {
|
||||
key = ensureKey(ctx, key)
|
||||
if v, ok := ctx.GetConfig(key); ok {
|
||||
return cast.ToInt8(v)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetUint loads an optional configuration value by its key, as a uint, or returns 0 if it doesn't exist.
|
||||
func GetUint(ctx *pulumi.Context, key string) uint {
|
||||
key = ensureKey(ctx, key)
|
||||
if v, ok := ctx.GetConfig(key); ok {
|
||||
return cast.ToUint(v)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetUint16 loads an optional configuration value by its key, as a uint16, or returns 0 if it doesn't exist.
|
||||
func GetUint16(ctx *pulumi.Context, key string) uint16 {
|
||||
key = ensureKey(ctx, key)
|
||||
if v, ok := ctx.GetConfig(key); ok {
|
||||
return cast.ToUint16(v)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetUint32 loads an optional configuration value by its key, as a uint32, or returns 0 if it doesn't exist.
|
||||
func GetUint32(ctx *pulumi.Context, key string) uint32 {
|
||||
key = ensureKey(ctx, key)
|
||||
if v, ok := ctx.GetConfig(key); ok {
|
||||
return cast.ToUint32(v)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetUint64 loads an optional configuration value by its key, as a uint64, or returns 0 if it doesn't exist.
|
||||
func GetUint64(ctx *pulumi.Context, key string) uint64 {
|
||||
key = ensureKey(ctx, key)
|
||||
if v, ok := ctx.GetConfig(key); ok {
|
||||
return cast.ToUint64(v)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetUint8 loads an optional configuration value by its key, as a uint8, or returns 0 if it doesn't exist.
|
||||
func GetUint8(ctx *pulumi.Context, key string) uint8 {
|
||||
key = ensureKey(ctx, key)
|
||||
if v, ok := ctx.GetConfig(key); ok {
|
||||
return cast.ToUint8(v)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetSecret loads an optional configuration value by its key, or "" if it does not exist, into a secret Output.
|
||||
func GetSecret(ctx *pulumi.Context, key string) pulumi.StringOutput {
|
||||
key = ensureKey(ctx, key)
|
||||
|
@ -188,13 +98,6 @@ func GetSecretBool(ctx *pulumi.Context, key string) pulumi.BoolOutput {
|
|||
return pulumi.ToSecret(GetBool(ctx, key)).(pulumi.BoolOutput)
|
||||
}
|
||||
|
||||
// GetSecretFloat32 loads an optional float32 configuration value by its key,
|
||||
// or false if it does not exist, into a secret Output.
|
||||
func GetSecretFloat32(ctx *pulumi.Context, key string) pulumi.Float32Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(GetFloat32(ctx, key)).(pulumi.Float32Output)
|
||||
}
|
||||
|
||||
// GetSecretFloat64 loads an optional float64 configuration value by its key,
|
||||
// or false if it does not exist, into a secret Output.
|
||||
func GetSecretFloat64(ctx *pulumi.Context, key string) pulumi.Float64Output {
|
||||
|
@ -208,66 +111,3 @@ func GetSecretInt(ctx *pulumi.Context, key string) pulumi.IntOutput {
|
|||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(GetInt(ctx, key)).(pulumi.IntOutput)
|
||||
}
|
||||
|
||||
// GetSecretInt16 loads an optional int16 configuration value by its key,
|
||||
// or false if it does not exist, into a secret Output.
|
||||
func GetSecretInt16(ctx *pulumi.Context, key string) pulumi.Int16Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(GetInt16(ctx, key)).(pulumi.Int16Output)
|
||||
}
|
||||
|
||||
// GetSecretInt32 loads an optional int32 configuration value by its key,
|
||||
// or false if it does not exist, into a secret Output.
|
||||
func GetSecretInt32(ctx *pulumi.Context, key string) pulumi.Int32Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(GetInt32(ctx, key)).(pulumi.Int32Output)
|
||||
}
|
||||
|
||||
// GetSecretInt64 loads an optional int64 configuration value by its key,
|
||||
// or false if it does not exist, into a secret Output.
|
||||
func GetSecretInt64(ctx *pulumi.Context, key string) pulumi.Int64Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(GetInt64(ctx, key)).(pulumi.Int64Output)
|
||||
}
|
||||
|
||||
// GetSecretInt8 loads an optional int8 configuration value by its key,
|
||||
// or false if it does not exist, into a secret Output.
|
||||
func GetSecretInt8(ctx *pulumi.Context, key string) pulumi.Int8Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(GetInt8(ctx, key)).(pulumi.Int8Output)
|
||||
}
|
||||
|
||||
// GetSecretUint loads an optional uint configuration value by its key,
|
||||
// or false if it does not exist, into a secret Output.
|
||||
func GetSecretUint(ctx *pulumi.Context, key string) pulumi.UintOutput {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(GetUint(ctx, key)).(pulumi.UintOutput)
|
||||
}
|
||||
|
||||
// GetSecretUint16 loads an optional uint16 configuration value by its key,
|
||||
// or false if it does not exist, into a secret Output.
|
||||
func GetSecretUint16(ctx *pulumi.Context, key string) pulumi.Uint16Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(GetUint16(ctx, key)).(pulumi.Uint16Output)
|
||||
}
|
||||
|
||||
// GetSecretUint32 loads an optional uint32 configuration value by its key,
|
||||
// or false if it does not exist, into a secret Output.
|
||||
func GetSecretUint32(ctx *pulumi.Context, key string) pulumi.Uint32Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(GetUint32(ctx, key)).(pulumi.Uint32Output)
|
||||
}
|
||||
|
||||
// GetSecretUint64 loads an optional uint64 configuration value by its key,
|
||||
// or false if it does not exist, into a secret Output.
|
||||
func GetSecretUint64(ctx *pulumi.Context, key string) pulumi.Uint64Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(GetUint64(ctx, key)).(pulumi.Uint64Output)
|
||||
}
|
||||
|
||||
// GetSecretUint8 loads an optional uint8 configuration value by its key,
|
||||
// or false if it does not exist, into a secret Output.
|
||||
func GetSecretUint8(ctx *pulumi.Context, key string) pulumi.Uint8Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(GetUint8(ctx, key)).(pulumi.Uint8Output)
|
||||
}
|
||||
|
|
|
@ -50,13 +50,6 @@ func RequireBool(ctx *pulumi.Context, key string) bool {
|
|||
return cast.ToBool(v)
|
||||
}
|
||||
|
||||
// RequireFloat32 loads an optional configuration value by its key, as a float32, or panics if it doesn't exist.
|
||||
func RequireFloat32(ctx *pulumi.Context, key string) float32 {
|
||||
key = ensureKey(ctx, key)
|
||||
v := Require(ctx, key)
|
||||
return cast.ToFloat32(v)
|
||||
}
|
||||
|
||||
// RequireFloat64 loads an optional configuration value by its key, as a float64, or panics if it doesn't exist.
|
||||
func RequireFloat64(ctx *pulumi.Context, key string) float64 {
|
||||
key = ensureKey(ctx, key)
|
||||
|
@ -71,69 +64,6 @@ func RequireInt(ctx *pulumi.Context, key string) int {
|
|||
return cast.ToInt(v)
|
||||
}
|
||||
|
||||
// RequireInt16 loads an optional configuration value by its key, as a int16, or panics if it doesn't exist.
|
||||
func RequireInt16(ctx *pulumi.Context, key string) int16 {
|
||||
key = ensureKey(ctx, key)
|
||||
v := Require(ctx, key)
|
||||
return cast.ToInt16(v)
|
||||
}
|
||||
|
||||
// RequireInt32 loads an optional configuration value by its key, as a int32, or panics if it doesn't exist.
|
||||
func RequireInt32(ctx *pulumi.Context, key string) int32 {
|
||||
key = ensureKey(ctx, key)
|
||||
v := Require(ctx, key)
|
||||
return cast.ToInt32(v)
|
||||
}
|
||||
|
||||
// RequireInt64 loads an optional configuration value by its key, as a int64, or panics if it doesn't exist.
|
||||
func RequireInt64(ctx *pulumi.Context, key string) int64 {
|
||||
key = ensureKey(ctx, key)
|
||||
v := Require(ctx, key)
|
||||
return cast.ToInt64(v)
|
||||
}
|
||||
|
||||
// RequireInt8 loads an optional configuration value by its key, as a int8, or panics if it doesn't exist.
|
||||
func RequireInt8(ctx *pulumi.Context, key string) int8 {
|
||||
key = ensureKey(ctx, key)
|
||||
v := Require(ctx, key)
|
||||
return cast.ToInt8(v)
|
||||
}
|
||||
|
||||
// RequireUint loads an optional configuration value by its key, as a uint, or panics if it doesn't exist.
|
||||
func RequireUint(ctx *pulumi.Context, key string) uint {
|
||||
key = ensureKey(ctx, key)
|
||||
v := Require(ctx, key)
|
||||
return cast.ToUint(v)
|
||||
}
|
||||
|
||||
// RequireUint16 loads an optional configuration value by its key, as a uint16, or panics if it doesn't exist.
|
||||
func RequireUint16(ctx *pulumi.Context, key string) uint16 {
|
||||
key = ensureKey(ctx, key)
|
||||
v := Require(ctx, key)
|
||||
return cast.ToUint16(v)
|
||||
}
|
||||
|
||||
// RequireUint32 loads an optional configuration value by its key, as a uint32, or panics if it doesn't exist.
|
||||
func RequireUint32(ctx *pulumi.Context, key string) uint32 {
|
||||
key = ensureKey(ctx, key)
|
||||
v := Require(ctx, key)
|
||||
return cast.ToUint32(v)
|
||||
}
|
||||
|
||||
// RequireUint64 loads an optional configuration value by its key, as a uint64, or panics if it doesn't exist.
|
||||
func RequireUint64(ctx *pulumi.Context, key string) uint64 {
|
||||
key = ensureKey(ctx, key)
|
||||
v := Require(ctx, key)
|
||||
return cast.ToUint64(v)
|
||||
}
|
||||
|
||||
// RequireUint8 loads an optional configuration value by its key, as a uint8, or panics if it doesn't exist.
|
||||
func RequireUint8(ctx *pulumi.Context, key string) uint8 {
|
||||
key = ensureKey(ctx, key)
|
||||
v := Require(ctx, key)
|
||||
return cast.ToUint8(v)
|
||||
}
|
||||
|
||||
// RequireSecret loads a configuration value by its key returning it wrapped in a secret Output,
|
||||
// or panics if it doesn't exist.
|
||||
func RequireSecret(ctx *pulumi.Context, key string) pulumi.StringOutput {
|
||||
|
@ -156,13 +86,6 @@ func RequireSecretBool(ctx *pulumi.Context, key string) pulumi.BoolOutput {
|
|||
return pulumi.ToSecret(RequireBool(ctx, key)).(pulumi.BoolOutput)
|
||||
}
|
||||
|
||||
// RequireSecretFloat32 loads an optional configuration value by its key,
|
||||
// as a float32 wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func RequireSecretFloat32(ctx *pulumi.Context, key string) pulumi.Float32Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(RequireFloat32(ctx, key)).(pulumi.Float32Output)
|
||||
}
|
||||
|
||||
// RequireSecretFloat64 loads an optional configuration value by its key,
|
||||
// as a float64 wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func RequireSecretFloat64(ctx *pulumi.Context, key string) pulumi.Float64Output {
|
||||
|
@ -176,66 +99,3 @@ func RequireSecretInt(ctx *pulumi.Context, key string) pulumi.IntOutput {
|
|||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(RequireInt(ctx, key)).(pulumi.IntOutput)
|
||||
}
|
||||
|
||||
// RequireSecretInt16 loads an optional configuration value by its key,
|
||||
// as a int16 wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func RequireSecretInt16(ctx *pulumi.Context, key string) pulumi.Int16Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(RequireInt16(ctx, key)).(pulumi.Int16Output)
|
||||
}
|
||||
|
||||
// RequireSecretInt32 loads an optional configuration value by its key,
|
||||
// as a int32 wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func RequireSecretInt32(ctx *pulumi.Context, key string) pulumi.Int32Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(RequireInt32(ctx, key)).(pulumi.Int32Output)
|
||||
}
|
||||
|
||||
// RequireSecretInt64 loads an optional configuration value by its key,
|
||||
// as a int64 wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func RequireSecretInt64(ctx *pulumi.Context, key string) pulumi.Int64Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(RequireInt64(ctx, key)).(pulumi.Int64Output)
|
||||
}
|
||||
|
||||
// RequireSecretInt8 loads an optional configuration value by its key,
|
||||
// as a int8 wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func RequireSecretInt8(ctx *pulumi.Context, key string) pulumi.Int8Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(RequireInt8(ctx, key)).(pulumi.Int8Output)
|
||||
}
|
||||
|
||||
// RequireSecretUint loads an optional configuration value by its key,
|
||||
// as a uint wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func RequireSecretUint(ctx *pulumi.Context, key string) pulumi.UintOutput {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(RequireUint(ctx, key)).(pulumi.UintOutput)
|
||||
}
|
||||
|
||||
// RequireSecretUint16 loads an optional configuration value by its key,
|
||||
// as a uint16 wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func RequireSecretUint16(ctx *pulumi.Context, key string) pulumi.Uint16Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(RequireUint16(ctx, key)).(pulumi.Uint16Output)
|
||||
}
|
||||
|
||||
// RequireSecretUint32 loads an optional configuration value by its key,
|
||||
// as a uint32 wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func RequireSecretUint32(ctx *pulumi.Context, key string) pulumi.Uint32Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(RequireUint32(ctx, key)).(pulumi.Uint32Output)
|
||||
}
|
||||
|
||||
// RequireSecretUint64 loads an optional configuration value by its key,
|
||||
// as a uint64 wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func RequireSecretUint64(ctx *pulumi.Context, key string) pulumi.Uint64Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(RequireUint64(ctx, key)).(pulumi.Uint64Output)
|
||||
}
|
||||
|
||||
// RequireSecretUint8 loads an optional configuration value by its key,
|
||||
// as a uint8 wrapped in a secret Output, or panics if it doesn't exist.
|
||||
func RequireSecretUint8(ctx *pulumi.Context, key string) pulumi.Uint8Output {
|
||||
key = ensureKey(ctx, key)
|
||||
return pulumi.ToSecret(RequireUint8(ctx, key)).(pulumi.Uint8Output)
|
||||
}
|
||||
|
|
|
@ -55,16 +55,6 @@ func TryBool(ctx *pulumi.Context, key string) (bool, error) {
|
|||
return cast.ToBool(v), nil
|
||||
}
|
||||
|
||||
// TryFloat32 loads an optional configuration value by its key, as a float32, or returns an error if it doesn't exist.
|
||||
func TryFloat32(ctx *pulumi.Context, key string) (float32, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := Try(ctx, key)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return cast.ToFloat32(v), nil
|
||||
}
|
||||
|
||||
// TryFloat64 loads an optional configuration value by its key, as a float64, or returns an error if it doesn't exist.
|
||||
func TryFloat64(ctx *pulumi.Context, key string) (float64, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
|
@ -85,96 +75,6 @@ func TryInt(ctx *pulumi.Context, key string) (int, error) {
|
|||
return cast.ToInt(v), nil
|
||||
}
|
||||
|
||||
// TryInt16 loads an optional configuration value by its key, as a int16, or returns an error if it doesn't exist.
|
||||
func TryInt16(ctx *pulumi.Context, key string) (int16, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := Try(ctx, key)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return cast.ToInt16(v), nil
|
||||
}
|
||||
|
||||
// TryInt32 loads an optional configuration value by its key, as a int32, or returns an error if it doesn't exist.
|
||||
func TryInt32(ctx *pulumi.Context, key string) (int32, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := Try(ctx, key)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return cast.ToInt32(v), nil
|
||||
}
|
||||
|
||||
// TryInt64 loads an optional configuration value by its key, as a int64, or returns an error if it doesn't exist.
|
||||
func TryInt64(ctx *pulumi.Context, key string) (int64, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := Try(ctx, key)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return cast.ToInt64(v), nil
|
||||
}
|
||||
|
||||
// TryInt8 loads an optional configuration value by its key, as a int8, or returns an error if it doesn't exist.
|
||||
func TryInt8(ctx *pulumi.Context, key string) (int8, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := Try(ctx, key)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return cast.ToInt8(v), nil
|
||||
}
|
||||
|
||||
// TryUint loads an optional configuration value by its key, as a uint, or returns an error if it doesn't exist.
|
||||
func TryUint(ctx *pulumi.Context, key string) (uint, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := Try(ctx, key)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return cast.ToUint(v), nil
|
||||
}
|
||||
|
||||
// TryUint16 loads an optional configuration value by its key, as a uint16, or returns an error if it doesn't exist.
|
||||
func TryUint16(ctx *pulumi.Context, key string) (uint16, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := Try(ctx, key)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return cast.ToUint16(v), nil
|
||||
}
|
||||
|
||||
// TryUint32 loads an optional configuration value by its key, as a uint32, or returns an error if it doesn't exist.
|
||||
func TryUint32(ctx *pulumi.Context, key string) (uint32, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := Try(ctx, key)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return cast.ToUint32(v), nil
|
||||
}
|
||||
|
||||
// TryUint64 loads an optional configuration value by its key, as a uint64, or returns an error if it doesn't exist.
|
||||
func TryUint64(ctx *pulumi.Context, key string) (uint64, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := Try(ctx, key)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return cast.ToUint64(v), nil
|
||||
}
|
||||
|
||||
// TryUint8 loads an optional configuration value by its key, as a uint8, or returns an error if it doesn't exist.
|
||||
func TryUint8(ctx *pulumi.Context, key string) (uint8, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := Try(ctx, key)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return cast.ToUint8(v), nil
|
||||
}
|
||||
|
||||
// TrySecret loads a configuration value by its key, returning a non-nil error if it doesn't exist.
|
||||
func TrySecret(ctx *pulumi.Context, key string) (pulumi.StringOutput, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
|
@ -210,18 +110,6 @@ func TrySecretBool(ctx *pulumi.Context, key string) (pulumi.BoolOutput, error) {
|
|||
return pulumi.ToSecret(pulumi.Bool(v)).(pulumi.BoolOutput), nil
|
||||
}
|
||||
|
||||
// TrySecretFloat32 loads an optional configuration value by its key, as a float32,
|
||||
// or returns an error if it doesn't exist.
|
||||
func TrySecretFloat32(ctx *pulumi.Context, key string) (pulumi.Float32Output, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := TryFloat32(ctx, key)
|
||||
if err != nil {
|
||||
var empty pulumi.Float32Output
|
||||
return empty, err
|
||||
}
|
||||
return pulumi.ToSecret(pulumi.Float32(v)).(pulumi.Float32Output), nil
|
||||
}
|
||||
|
||||
// TrySecretFloat64 loads an optional configuration value by its key, as a float64,
|
||||
// or returns an error if it doesn't exist.
|
||||
func TrySecretFloat64(ctx *pulumi.Context, key string) (pulumi.Float64Output, error) {
|
||||
|
@ -245,111 +133,3 @@ func TrySecretInt(ctx *pulumi.Context, key string) (pulumi.IntOutput, error) {
|
|||
}
|
||||
return pulumi.ToSecret(pulumi.Int(v)).(pulumi.IntOutput), nil
|
||||
}
|
||||
|
||||
// TrySecretInt16 loads an optional configuration value by its key, as a int16,
|
||||
// or returns an error if it doesn't exist.
|
||||
func TrySecretInt16(ctx *pulumi.Context, key string) (pulumi.Int16Output, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := TryInt16(ctx, key)
|
||||
if err != nil {
|
||||
var empty pulumi.Int16Output
|
||||
return empty, err
|
||||
}
|
||||
return pulumi.ToSecret(pulumi.Int16(v)).(pulumi.Int16Output), nil
|
||||
}
|
||||
|
||||
// TrySecretInt32 loads an optional configuration value by its key, as a int32,
|
||||
// or returns an error if it doesn't exist.
|
||||
func TrySecretInt32(ctx *pulumi.Context, key string) (pulumi.Int32Output, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := TryInt32(ctx, key)
|
||||
if err != nil {
|
||||
var empty pulumi.Int32Output
|
||||
return empty, err
|
||||
}
|
||||
return pulumi.ToSecret(pulumi.Int32(v)).(pulumi.Int32Output), nil
|
||||
}
|
||||
|
||||
// TrySecretInt64 loads an optional configuration value by its key, as a int64,
|
||||
// or returns an error if it doesn't exist.
|
||||
func TrySecretInt64(ctx *pulumi.Context, key string) (pulumi.Int64Output, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := TryInt64(ctx, key)
|
||||
if err != nil {
|
||||
var empty pulumi.Int64Output
|
||||
return empty, err
|
||||
}
|
||||
return pulumi.ToSecret(pulumi.Int64(v)).(pulumi.Int64Output), nil
|
||||
}
|
||||
|
||||
// TrySecretInt8 loads an optional configuration value by its key, as a int8,
|
||||
// or returns an error if it doesn't exist.
|
||||
func TrySecretInt8(ctx *pulumi.Context, key string) (pulumi.Int8Output, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := TryInt8(ctx, key)
|
||||
if err != nil {
|
||||
var empty pulumi.Int8Output
|
||||
return empty, err
|
||||
}
|
||||
return pulumi.ToSecret(pulumi.Int8(v)).(pulumi.Int8Output), nil
|
||||
}
|
||||
|
||||
// TrySecretUint loads an optional configuration value by its key, as a uint,
|
||||
// or returns an error if it doesn't exist.
|
||||
func TrySecretUint(ctx *pulumi.Context, key string) (pulumi.UintOutput, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := TryUint(ctx, key)
|
||||
if err != nil {
|
||||
var empty pulumi.UintOutput
|
||||
return empty, err
|
||||
}
|
||||
return pulumi.ToSecret(pulumi.Uint(v)).(pulumi.UintOutput), nil
|
||||
}
|
||||
|
||||
// TrySecretUint16 loads an optional configuration value by its key, as a uint16,
|
||||
// or returns an error if it doesn't exist.
|
||||
func TrySecretUint16(ctx *pulumi.Context, key string) (pulumi.Uint16Output, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := TryUint16(ctx, key)
|
||||
if err != nil {
|
||||
var empty pulumi.Uint16Output
|
||||
return empty, err
|
||||
}
|
||||
return pulumi.ToSecret(pulumi.Uint16(v)).(pulumi.Uint16Output), nil
|
||||
}
|
||||
|
||||
// TrySecretUint32 loads an optional configuration value by its key, as a uint32,
|
||||
// or returns an error if it doesn't exist.
|
||||
func TrySecretUint32(ctx *pulumi.Context, key string) (pulumi.Uint32Output, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := TryUint32(ctx, key)
|
||||
if err != nil {
|
||||
var empty pulumi.Uint32Output
|
||||
return empty, err
|
||||
}
|
||||
return pulumi.ToSecret(pulumi.Uint32(v)).(pulumi.Uint32Output), nil
|
||||
}
|
||||
|
||||
// TrySecretUint64 loads an optional configuration value by its key, as a uint64,
|
||||
// or returns an error if it doesn't exist.
|
||||
func TrySecretUint64(ctx *pulumi.Context, key string) (pulumi.Uint64Output, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := TryUint64(ctx, key)
|
||||
if err != nil {
|
||||
var empty pulumi.Uint64Output
|
||||
return empty, err
|
||||
}
|
||||
return pulumi.ToSecret(pulumi.Uint64(v)).(pulumi.Uint64Output), nil
|
||||
}
|
||||
|
||||
// TrySecretUint8 loads an optional configuration value by its key, as a uint8,
|
||||
// or returns an error if it doesn't exist.
|
||||
func TrySecretUint8(ctx *pulumi.Context, key string) (pulumi.Uint8Output, error) {
|
||||
key = ensureKey(ctx, key)
|
||||
v, err := TryUint8(ctx, key)
|
||||
if err != nil {
|
||||
var empty pulumi.Uint8Output
|
||||
return empty, err
|
||||
}
|
||||
return pulumi.ToSecret(pulumi.Uint8(v)).(pulumi.Uint8Output), nil
|
||||
}
|
||||
|
|
|
@ -58,8 +58,7 @@ func (b builtin) DefineInputMethods() bool {
|
|||
|
||||
func (b builtin) ImplementsPtrType() bool {
|
||||
switch b.Type {
|
||||
case "bool", "float32", "float64", "ID", "int", "int16", "int32", "int64", "int8", "string", "URN", "uint",
|
||||
"uint16", "uint32", "uint64", "uint8":
|
||||
case "bool", "float64", "ID", "int", "string", "URN":
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
@ -120,22 +119,12 @@ var builtins = makeBuiltins([]*builtin{
|
|||
{Name: "Asset", Type: "Asset", inputType: "*asset", implements: []string{"AssetOrArchive"}, Example: "NewFileAsset(\"foo.txt\")"},
|
||||
{Name: "AssetOrArchive", Type: "AssetOrArchive", Example: "NewFileArchive(\"foo.zip\")"},
|
||||
{Name: "Bool", Type: "bool", Example: "Bool(true)", GenerateConfig: true, DefaultConfig: "false"},
|
||||
{Name: "Float32", Type: "float32", Example: "Float32(1.3)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
{Name: "Float64", Type: "float64", Example: "Float64(999.9)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
{Name: "ID", Type: "ID", inputType: "ID", implements: []string{"String"}, Example: "ID(\"foo\")"},
|
||||
{Name: "Input", Type: "interface{}", Example: "String(\"any\")"},
|
||||
{Name: "Int", Type: "int", Example: "Int(42)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
{Name: "Int16", Type: "int16", Example: "Int16(33)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
{Name: "Int32", Type: "int32", Example: "Int32(24)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
{Name: "Int64", Type: "int64", Example: "Int64(15)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
{Name: "Int8", Type: "int8", Example: "Int8(6)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
{Name: "String", Type: "string", Example: "String(\"foo\")"},
|
||||
{Name: "URN", Type: "URN", inputType: "URN", implements: []string{"String"}, Example: "URN(\"foo\")"},
|
||||
{Name: "Uint", Type: "uint", Example: "Uint(42)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
{Name: "Uint16", Type: "uint16", Example: "Uint16(33)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
{Name: "Uint32", Type: "uint32", Example: "Uint32(24)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
{Name: "Uint64", Type: "uint64", Example: "Uint64(15)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
{Name: "Uint8", Type: "uint8", Example: "Uint8(6)", GenerateConfig: true, DefaultConfig: "0"},
|
||||
})
|
||||
|
||||
func unexported(s string) string {
|
||||
|
|
|
@ -206,7 +206,7 @@ func TestMarshalRoundtrip(t *testing.T) {
|
|||
FileArchive: NewFileArchive("foo.zip"),
|
||||
RemoteArchive: NewRemoteArchive("https://pulumi.com/fake/archive.zip"),
|
||||
E: out,
|
||||
Array: Array{Int(0), Float32(1.3), String("x"), Bool(false)},
|
||||
Array: Array{Int(0), Float64(1.3), String("x"), Bool(false)},
|
||||
Map: Map{
|
||||
"x": String("y"),
|
||||
"y": Float64(999.9),
|
||||
|
@ -259,7 +259,7 @@ func TestMarshalRoundtrip(t *testing.T) {
|
|||
assert.Equal(t, 4, len(aa))
|
||||
assert.Equal(t, 0.0, aa[0])
|
||||
assert.Less(t, 1.3-aa[1].(float64), 0.00001)
|
||||
assert.Greater(t, 1.3-aa[1].(float64), 0.0)
|
||||
assert.Equal(t, 1.3-aa[1].(float64), 0.0)
|
||||
assert.Equal(t, "x", aa[2])
|
||||
assert.Equal(t, false, aa[3])
|
||||
am := res["fMap"].(map[string]interface{})
|
||||
|
@ -364,20 +364,10 @@ type testResourceArgs struct {
|
|||
Array []interface{} `pulumi:"array"`
|
||||
Asset Asset `pulumi:"asset"`
|
||||
Bool bool `pulumi:"bool"`
|
||||
Float32 float32 `pulumi:"float32"`
|
||||
Float64 float64 `pulumi:"float64"`
|
||||
Int int `pulumi:"int"`
|
||||
Int8 int8 `pulumi:"int8"`
|
||||
Int16 int16 `pulumi:"int16"`
|
||||
Int32 int32 `pulumi:"int32"`
|
||||
Int64 int64 `pulumi:"int64"`
|
||||
Map map[string]interface{} `pulumi:"map"`
|
||||
String string `pulumi:"string"`
|
||||
Uint uint `pulumi:"uint"`
|
||||
Uint8 uint8 `pulumi:"uint8"`
|
||||
Uint16 uint16 `pulumi:"uint16"`
|
||||
Uint32 uint32 `pulumi:"uint32"`
|
||||
Uint64 uint64 `pulumi:"uint64"`
|
||||
|
||||
Nested nestedType `pulumi:"nested"`
|
||||
}
|
||||
|
@ -391,20 +381,10 @@ type testResourceInputs struct {
|
|||
Array ArrayInput
|
||||
Asset AssetInput
|
||||
Bool BoolInput
|
||||
Float32 Float32Input
|
||||
Float64 Float64Input
|
||||
Int IntInput
|
||||
Int8 Int8Input
|
||||
Int16 Int16Input
|
||||
Int32 Int32Input
|
||||
Int64 Int64Input
|
||||
Map MapInput
|
||||
String StringInput
|
||||
Uint UintInput
|
||||
Uint8 Uint8Input
|
||||
Uint16 Uint16Input
|
||||
Uint32 Uint32Input
|
||||
Uint64 Uint64Input
|
||||
|
||||
Nested nestedTypeInput
|
||||
}
|
||||
|
@ -421,20 +401,10 @@ type testResource struct {
|
|||
Array ArrayOutput `pulumi:"array"`
|
||||
Asset AssetOutput `pulumi:"asset"`
|
||||
Bool BoolOutput `pulumi:"bool"`
|
||||
Float32 Float32Output `pulumi:"float32"`
|
||||
Float64 Float64Output `pulumi:"float64"`
|
||||
Int IntOutput `pulumi:"int"`
|
||||
Int8 Int8Output `pulumi:"int8"`
|
||||
Int16 Int16Output `pulumi:"int16"`
|
||||
Int32 Int32Output `pulumi:"int32"`
|
||||
Int64 Int64Output `pulumi:"int64"`
|
||||
Map MapOutput `pulumi:"map"`
|
||||
String StringOutput `pulumi:"string"`
|
||||
Uint UintOutput `pulumi:"uint"`
|
||||
Uint8 Uint8Output `pulumi:"uint8"`
|
||||
Uint16 Uint16Output `pulumi:"uint16"`
|
||||
Uint32 Uint32Output `pulumi:"uint32"`
|
||||
Uint64 Uint64Output `pulumi:"uint64"`
|
||||
|
||||
Nested nestedTypeOutput `pulumi:"nested"`
|
||||
}
|
||||
|
@ -452,20 +422,10 @@ func TestResourceState(t *testing.T) {
|
|||
Array: Array{String("foo")},
|
||||
Asset: NewStringAsset("put a lime in the coconut"),
|
||||
Bool: Bool(true),
|
||||
Float32: Float32(42.0),
|
||||
Float64: Float64(3.14),
|
||||
Int: Int(-1),
|
||||
Int8: Int8(-2),
|
||||
Int16: Int16(-3),
|
||||
Int32: Int32(-4),
|
||||
Int64: Int64(-5),
|
||||
Map: Map{"foo": String("bar")},
|
||||
String: String("qux"),
|
||||
Uint: Uint(1),
|
||||
Uint8: Uint8(2),
|
||||
Uint16: Uint16(3),
|
||||
Uint32: Uint32(4),
|
||||
Uint64: Uint64(5),
|
||||
|
||||
Nested: nestedTypeInputs{
|
||||
Foo: String("bar"),
|
||||
|
@ -486,20 +446,10 @@ func TestResourceState(t *testing.T) {
|
|||
Array: theResource.Array,
|
||||
Asset: theResource.Asset,
|
||||
Bool: theResource.Bool,
|
||||
Float32: theResource.Float32,
|
||||
Float64: theResource.Float64,
|
||||
Int: theResource.Int,
|
||||
Int8: theResource.Int8,
|
||||
Int16: theResource.Int16,
|
||||
Int32: theResource.Int32,
|
||||
Int64: theResource.Int64,
|
||||
Map: theResource.Map,
|
||||
String: theResource.String,
|
||||
Uint: theResource.Uint,
|
||||
Uint8: theResource.Uint8,
|
||||
Uint16: theResource.Uint16,
|
||||
Uint32: theResource.Uint32,
|
||||
Uint64: theResource.Uint64,
|
||||
Nested: theResource.Nested,
|
||||
}
|
||||
resolved, pdeps, deps, err := marshalInputs(input)
|
||||
|
@ -512,20 +462,10 @@ func TestResourceState(t *testing.T) {
|
|||
"array": {"foo"},
|
||||
"asset": {"foo"},
|
||||
"bool": {"foo"},
|
||||
"float32": {"foo"},
|
||||
"float64": {"foo"},
|
||||
"int": {"foo"},
|
||||
"int8": {"foo"},
|
||||
"int16": {"foo"},
|
||||
"int32": {"foo"},
|
||||
"int64": {"foo"},
|
||||
"map": {"foo"},
|
||||
"string": {"foo"},
|
||||
"uint": {"foo"},
|
||||
"uint8": {"foo"},
|
||||
"uint16": {"foo"},
|
||||
"uint32": {"foo"},
|
||||
"uint64": {"foo"},
|
||||
"nested": {"foo"},
|
||||
}, pdeps)
|
||||
assert.Equal(t, []URN{"foo"}, deps)
|
||||
|
@ -541,20 +481,10 @@ func TestResourceState(t *testing.T) {
|
|||
"array": []interface{}{"foo"},
|
||||
"asset": NewStringAsset("put a lime in the coconut"),
|
||||
"bool": true,
|
||||
"float32": 42.0,
|
||||
"float64": 3.14,
|
||||
"int": -1.0,
|
||||
"int8": -2.0,
|
||||
"int16": -3.0,
|
||||
"int32": -4.0,
|
||||
"int64": -5.0,
|
||||
"map": map[string]interface{}{"foo": "bar"},
|
||||
"string": "qux",
|
||||
"uint": 1.0,
|
||||
"uint8": 2.0,
|
||||
"uint16": 3.0,
|
||||
"uint32": 4.0,
|
||||
"uint64": 5.0,
|
||||
"nested": map[string]interface{}{
|
||||
"foo": "bar",
|
||||
"bar": 42.0,
|
||||
|
@ -623,7 +553,7 @@ func TestMarshalRoundtripNestedSecret(t *testing.T) {
|
|||
FileArchive: NewFileArchive("foo.zip"),
|
||||
RemoteArchive: NewRemoteArchive("https://pulumi.com/fake/archive.zip"),
|
||||
E: out,
|
||||
Array: Array{Int(0), Float32(1.3), String("x"), Bool(false)},
|
||||
Array: Array{Int(0), Float64(1.3), String("x"), Bool(false)},
|
||||
Map: Map{
|
||||
"x": String("y"),
|
||||
"y": Float64(999.9),
|
||||
|
@ -669,7 +599,7 @@ func TestMarshalRoundtripNestedSecret(t *testing.T) {
|
|||
assert.Equal(t, 4, len(aa))
|
||||
assert.Equal(t, 0.0, aa[0])
|
||||
assert.Less(t, 1.3-aa[1].(float64), 0.00001)
|
||||
assert.Greater(t, 1.3-aa[1].(float64), 0.0)
|
||||
assert.Equal(t, 1.3-aa[1].(float64), 0.0)
|
||||
assert.Equal(t, "x", aa[2])
|
||||
assert.Equal(t, false, aa[3])
|
||||
am := res["fMap"].(map[string]interface{})
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue