More renames
This commit is contained in:
2
sdk/go/doc.go
Normal file
2
sdk/go/doc.go
Normal file
@@ -0,0 +1,2 @@
|
||||
// Description
|
||||
package docker
|
||||
@@ -1,13 +1,13 @@
|
||||
// Code generated by pulumi-language-go DO NOT EDIT.
|
||||
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package xyz
|
||||
package docker
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/blang/semver"
|
||||
"github.com/pulumi/pulumi-docker-native/sdk/go/xyz/internal"
|
||||
"github.com/pulumi/pulumi-docker-native/sdk/go/internal"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@ func (m *module) Version() semver.Version {
|
||||
|
||||
func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) {
|
||||
switch typ {
|
||||
case "xyz:index:Random":
|
||||
case "docker-native:index:Random":
|
||||
r = &Random{}
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown resource type: %s", typ)
|
||||
@@ -40,7 +40,7 @@ func (p *pkg) Version() semver.Version {
|
||||
}
|
||||
|
||||
func (p *pkg) ConstructProvider(ctx *pulumi.Context, name, typ, urn string) (pulumi.ProviderResource, error) {
|
||||
if typ != "pulumi:providers:xyz" {
|
||||
if typ != "pulumi:providers:docker-native" {
|
||||
return nil, fmt.Errorf("unknown provider type: %s", typ)
|
||||
}
|
||||
|
||||
@@ -55,12 +55,12 @@ func init() {
|
||||
version = semver.Version{Major: 1}
|
||||
}
|
||||
pulumi.RegisterResourceModule(
|
||||
"xyz",
|
||||
"docker-native",
|
||||
"index",
|
||||
&module{version},
|
||||
)
|
||||
pulumi.RegisterResourcePackage(
|
||||
"xyz",
|
||||
"docker-native",
|
||||
&pkg{version},
|
||||
)
|
||||
}
|
||||
@@ -15,6 +15,10 @@ import (
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
)
|
||||
|
||||
import (
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/internals"
|
||||
)
|
||||
|
||||
type envParser func(v string) interface{}
|
||||
|
||||
func ParseEnvBool(v string) interface{} {
|
||||
@@ -71,7 +75,7 @@ func PkgVersion() (semver.Version, error) {
|
||||
}
|
||||
type sentinal struct{}
|
||||
pkgPath := reflect.TypeOf(sentinal{}).PkgPath()
|
||||
re := regexp.MustCompile("^.*/pulumi-xyz/sdk(/v\\d+)?")
|
||||
re := regexp.MustCompile("^github.com/pulumi/pulumi-docker-native/sdk/go(/v\\d+)?")
|
||||
if match := re.FindStringSubmatch(pkgPath); match != nil {
|
||||
vStr := match[1]
|
||||
if len(vStr) == 0 { // If the version capture group was empty, default to v1.
|
||||
@@ -90,10 +94,77 @@ func IsZero(v interface{}) bool {
|
||||
return reflect.ValueOf(v).IsZero()
|
||||
}
|
||||
|
||||
func CallPlain(
|
||||
ctx *pulumi.Context,
|
||||
tok string,
|
||||
args pulumi.Input,
|
||||
output pulumi.Output,
|
||||
self pulumi.Resource,
|
||||
property string,
|
||||
resultPtr reflect.Value,
|
||||
errorPtr *error,
|
||||
opts ...pulumi.InvokeOption,
|
||||
) {
|
||||
res, err := callPlainInner(ctx, tok, args, output, self, opts...)
|
||||
if err != nil {
|
||||
*errorPtr = err
|
||||
return
|
||||
}
|
||||
|
||||
v := reflect.ValueOf(res)
|
||||
|
||||
// extract res.property field if asked to do so
|
||||
if property != "" {
|
||||
v = v.FieldByName("Res")
|
||||
}
|
||||
|
||||
// return by setting the result pointer; this style of returns shortens the generated code without generics
|
||||
resultPtr.Elem().Set(v)
|
||||
}
|
||||
|
||||
func callPlainInner(
|
||||
ctx *pulumi.Context,
|
||||
tok string,
|
||||
args pulumi.Input,
|
||||
output pulumi.Output,
|
||||
self pulumi.Resource,
|
||||
opts ...pulumi.InvokeOption,
|
||||
) (any, error) {
|
||||
o, err := ctx.Call(tok, args, output, self, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
outputData, err := internals.UnsafeAwaitOutput(ctx.Context(), o)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Ingoring deps silently. They are typically non-empty, r.f() calls include r as a dependency.
|
||||
known := outputData.Known
|
||||
value := outputData.Value
|
||||
secret := outputData.Secret
|
||||
|
||||
problem := ""
|
||||
if !known {
|
||||
problem = "an unknown value"
|
||||
} else if secret {
|
||||
problem = "a secret value"
|
||||
}
|
||||
|
||||
if problem != "" {
|
||||
return nil, fmt.Errorf("Plain resource method %q incorrectly returned %s. "+
|
||||
"This is an error in the provider, please report this to the provider developer.",
|
||||
tok, problem)
|
||||
}
|
||||
|
||||
return value, nil
|
||||
}
|
||||
|
||||
// PkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource.
|
||||
func PkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption {
|
||||
defaults := []pulumi.ResourceOption{}
|
||||
|
||||
defaults = append(defaults, pulumi.PluginDownloadURL("github.com/pulumi/pulumi-docker-native"))
|
||||
version := SdkVersion
|
||||
if !version.Equals(semver.Version{}) {
|
||||
defaults = append(defaults, pulumi.Version(version.String()))
|
||||
@@ -104,7 +175,7 @@ func PkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOptio
|
||||
// PkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke.
|
||||
func PkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption {
|
||||
defaults := []pulumi.InvokeOption{}
|
||||
|
||||
defaults = append(defaults, pulumi.PluginDownloadURL("github.com/pulumi/pulumi-docker-native"))
|
||||
version := SdkVersion
|
||||
if !version.Equals(semver.Version{}) {
|
||||
defaults = append(defaults, pulumi.Version(version.String()))
|
||||
@@ -1,14 +1,15 @@
|
||||
// Code generated by pulumi-language-go DO NOT EDIT.
|
||||
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package xyz
|
||||
package docker
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
|
||||
"github.com/pulumi/pulumi-docker-native/sdk/go/xyz/internal"
|
||||
"github.com/pulumi/pulumi-docker-native/sdk/go/internal"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -24,7 +25,7 @@ func NewProvider(ctx *pulumi.Context,
|
||||
|
||||
opts = internal.PkgResourceDefaultOpts(opts)
|
||||
var resource Provider
|
||||
err := ctx.RegisterResource("pulumi:providers:xyz", name, args, &resource, opts...)
|
||||
err := ctx.RegisterResource("pulumi:providers:docker-native", name, args, &resource, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -42,29 +43,10 @@ func (ProviderArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*providerArgs)(nil)).Elem()
|
||||
}
|
||||
|
||||
type ProviderInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToProviderOutput() ProviderOutput
|
||||
ToProviderOutputWithContext(ctx context.Context) ProviderOutput
|
||||
}
|
||||
|
||||
func (*Provider) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**Provider)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i *Provider) ToProviderOutput() ProviderOutput {
|
||||
return i.ToProviderOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput)
|
||||
}
|
||||
|
||||
type ProviderOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (ProviderOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**Provider)(nil)).Elem()
|
||||
return reflect.TypeOf((*Provider)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o ProviderOutput) ToProviderOutput() ProviderOutput {
|
||||
@@ -75,7 +57,12 @@ func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) Provide
|
||||
return o
|
||||
}
|
||||
|
||||
func (o ProviderOutput) ToOutput(ctx context.Context) pulumix.Output[Provider] {
|
||||
return pulumix.Output[Provider]{
|
||||
OutputState: o.OutputState,
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{})
|
||||
pulumi.RegisterOutputType(ProviderOutput{})
|
||||
}
|
||||
5
sdk/go/pulumi-plugin.json
Normal file
5
sdk/go/pulumi-plugin.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"resource": true,
|
||||
"name": "docker-native",
|
||||
"server": "github.com/pulumi/pulumi-docker-native"
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
// Code generated by pulumi-language-go DO NOT EDIT.
|
||||
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
package xyz
|
||||
package docker
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
|
||||
"errors"
|
||||
|
||||
"github.com/pulumi/pulumi-docker-native/sdk/go/xyz/internal"
|
||||
"github.com/pulumi/pulumi-docker-native/sdk/go/internal"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
|
||||
)
|
||||
|
||||
type Random struct {
|
||||
pulumi.CustomResourceState
|
||||
|
||||
Length pulumi.IntOutput `pulumi:"length"`
|
||||
Result pulumi.StringOutput `pulumi:"result"`
|
||||
Length pulumix.Output[int] `pulumi:"length"`
|
||||
Result pulumix.Output[string] `pulumi:"result"`
|
||||
}
|
||||
|
||||
// NewRandom registers a new resource with the given unique name, arguments, and options.
|
||||
@@ -32,7 +32,7 @@ func NewRandom(ctx *pulumi.Context,
|
||||
}
|
||||
opts = internal.PkgResourceDefaultOpts(opts)
|
||||
var resource Random
|
||||
err := ctx.RegisterResource("xyz:index:Random", name, args, &resource, opts...)
|
||||
err := ctx.RegisterResource("docker-native:index:Random", name, args, &resource, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -44,7 +44,7 @@ func NewRandom(ctx *pulumi.Context,
|
||||
func GetRandom(ctx *pulumi.Context,
|
||||
name string, id pulumi.IDInput, state *RandomState, opts ...pulumi.ResourceOption) (*Random, error) {
|
||||
var resource Random
|
||||
err := ctx.ReadResource("xyz:index:Random", name, id, state, &resource, opts...)
|
||||
err := ctx.ReadResource("docker-native:index:Random", name, id, state, &resource, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -68,36 +68,17 @@ type randomArgs struct {
|
||||
|
||||
// The set of arguments for constructing a Random resource.
|
||||
type RandomArgs struct {
|
||||
Length pulumi.IntInput
|
||||
Length pulumix.Input[int]
|
||||
}
|
||||
|
||||
func (RandomArgs) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((*randomArgs)(nil)).Elem()
|
||||
}
|
||||
|
||||
type RandomInput interface {
|
||||
pulumi.Input
|
||||
|
||||
ToRandomOutput() RandomOutput
|
||||
ToRandomOutputWithContext(ctx context.Context) RandomOutput
|
||||
}
|
||||
|
||||
func (*Random) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**Random)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (i *Random) ToRandomOutput() RandomOutput {
|
||||
return i.ToRandomOutputWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (i *Random) ToRandomOutputWithContext(ctx context.Context) RandomOutput {
|
||||
return pulumi.ToOutputWithContext(ctx, i).(RandomOutput)
|
||||
}
|
||||
|
||||
type RandomOutput struct{ *pulumi.OutputState }
|
||||
|
||||
func (RandomOutput) ElementType() reflect.Type {
|
||||
return reflect.TypeOf((**Random)(nil)).Elem()
|
||||
return reflect.TypeOf((*Random)(nil)).Elem()
|
||||
}
|
||||
|
||||
func (o RandomOutput) ToRandomOutput() RandomOutput {
|
||||
@@ -108,15 +89,22 @@ func (o RandomOutput) ToRandomOutputWithContext(ctx context.Context) RandomOutpu
|
||||
return o
|
||||
}
|
||||
|
||||
func (o RandomOutput) Length() pulumi.IntOutput {
|
||||
return o.ApplyT(func(v *Random) pulumi.IntOutput { return v.Length }).(pulumi.IntOutput)
|
||||
func (o RandomOutput) ToOutput(ctx context.Context) pulumix.Output[Random] {
|
||||
return pulumix.Output[Random]{
|
||||
OutputState: o.OutputState,
|
||||
}
|
||||
}
|
||||
|
||||
func (o RandomOutput) Result() pulumi.StringOutput {
|
||||
return o.ApplyT(func(v *Random) pulumi.StringOutput { return v.Result }).(pulumi.StringOutput)
|
||||
func (o RandomOutput) Length() pulumix.Output[int] {
|
||||
value := pulumix.Apply[Random](o, func(v Random) pulumix.Output[int] { return v.Length })
|
||||
return pulumix.Flatten[int, pulumix.Output[int]](value)
|
||||
}
|
||||
|
||||
func (o RandomOutput) Result() pulumix.Output[string] {
|
||||
value := pulumix.Apply[Random](o, func(v Random) pulumix.Output[string] { return v.Result })
|
||||
return pulumix.Flatten[string, pulumix.Output[string]](value)
|
||||
}
|
||||
|
||||
func init() {
|
||||
pulumi.RegisterInputType(reflect.TypeOf((*RandomInput)(nil)).Elem(), &Random{})
|
||||
pulumi.RegisterOutputType(RandomOutput{})
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
// Package xyz exports types, functions, subpackages for provisioning xyz resources.
|
||||
package xyz
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"resource": true,
|
||||
"name": "xyz"
|
||||
}
|
||||
Reference in New Issue
Block a user