Add ResourceOutput type to Go SDK (#4575)
This commit is contained in:
parent
1fe5b1cb26
commit
b445206101
|
@ -14,6 +14,9 @@ CHANGELOG
|
|||
|
||||
- Don't call IMocks.NewResourceAsync for the root stack resource
|
||||
[#4527](https://github.com/pulumi/pulumi/pull/4527)
|
||||
|
||||
- Add ResourceOutput type to Go SDK
|
||||
[#4575](https://github.com/pulumi/pulumi/pull/4575)
|
||||
|
||||
## 2.1.0 (2020-04-28)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016-2018, Pulumi Corporation.
|
||||
// Copyright 2016-2020, Pulumi Corporation.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
@ -14,7 +14,9 @@
|
|||
|
||||
package pulumi
|
||||
|
||||
import "reflect"
|
||||
import (
|
||||
"reflect"
|
||||
)
|
||||
|
||||
type (
|
||||
// ID is a unique identifier assigned by a resource provider to a resource.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016-2018, Pulumi Corporation.
|
||||
// Copyright 2016-2020, Pulumi Corporation.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
@ -893,3 +893,16 @@ func convert(v interface{}, to reflect.Type) interface{} {
|
|||
}
|
||||
return rv.Convert(to).Interface()
|
||||
}
|
||||
|
||||
// TODO: ResourceOutput and the init() should probably be code generated.
|
||||
// ResourceOutput is an Output that returns Resource values.
|
||||
type ResourceOutput struct{ *OutputState }
|
||||
|
||||
// ElementType returns the element type of this Output (Resource).
|
||||
func (ResourceOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*Resource)(nil)).Elem()
|
||||
}
|
||||
|
||||
func init() {
|
||||
RegisterOutputType(ResourceOutput{})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue