github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/functions-secrets/go/mypkg/funcWithSecrets.go (about)

     1  // Code generated by test DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package mypkg
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    11  )
    12  
    13  func FuncWithSecrets(ctx *pulumi.Context, args *FuncWithSecretsArgs, opts ...pulumi.InvokeOption) (*FuncWithSecretsResult, error) {
    14  	var rv FuncWithSecretsResult
    15  	err := ctx.Invoke("mypkg::funcWithSecrets", args, &rv, opts...)
    16  	if err != nil {
    17  		return nil, err
    18  	}
    19  	return &rv, nil
    20  }
    21  
    22  type FuncWithSecretsArgs struct {
    23  	CryptoKey string `pulumi:"cryptoKey"`
    24  	Plaintext string `pulumi:"plaintext"`
    25  }
    26  
    27  type FuncWithSecretsResult struct {
    28  	Ciphertext string `pulumi:"ciphertext"`
    29  	CryptoKey  string `pulumi:"cryptoKey"`
    30  	Id         string `pulumi:"id"`
    31  	Plaintext  string `pulumi:"plaintext"`
    32  }
    33  
    34  func FuncWithSecretsOutput(ctx *pulumi.Context, args FuncWithSecretsOutputArgs, opts ...pulumi.InvokeOption) FuncWithSecretsResultOutput {
    35  	return pulumi.ToOutputWithContext(context.Background(), args).
    36  		ApplyT(func(v interface{}) (FuncWithSecretsResult, error) {
    37  			args := v.(FuncWithSecretsArgs)
    38  			r, err := FuncWithSecrets(ctx, &args, opts...)
    39  			var s FuncWithSecretsResult
    40  			if r != nil {
    41  				s = *r
    42  			}
    43  			return s, err
    44  		}).(FuncWithSecretsResultOutput)
    45  }
    46  
    47  type FuncWithSecretsOutputArgs struct {
    48  	CryptoKey pulumi.StringInput `pulumi:"cryptoKey"`
    49  	Plaintext pulumi.StringInput `pulumi:"plaintext"`
    50  }
    51  
    52  func (FuncWithSecretsOutputArgs) ElementType() reflect.Type {
    53  	return reflect.TypeOf((*FuncWithSecretsArgs)(nil)).Elem()
    54  }
    55  
    56  type FuncWithSecretsResultOutput struct{ *pulumi.OutputState }
    57  
    58  func (FuncWithSecretsResultOutput) ElementType() reflect.Type {
    59  	return reflect.TypeOf((*FuncWithSecretsResult)(nil)).Elem()
    60  }
    61  
    62  func (o FuncWithSecretsResultOutput) ToFuncWithSecretsResultOutput() FuncWithSecretsResultOutput {
    63  	return o
    64  }
    65  
    66  func (o FuncWithSecretsResultOutput) ToFuncWithSecretsResultOutputWithContext(ctx context.Context) FuncWithSecretsResultOutput {
    67  	return o
    68  }
    69  
    70  func (o FuncWithSecretsResultOutput) Ciphertext() pulumi.StringOutput {
    71  	return o.ApplyT(func(v FuncWithSecretsResult) string { return v.Ciphertext }).(pulumi.StringOutput)
    72  }
    73  
    74  func (o FuncWithSecretsResultOutput) CryptoKey() pulumi.StringOutput {
    75  	return o.ApplyT(func(v FuncWithSecretsResult) string { return v.CryptoKey }).(pulumi.StringOutput)
    76  }
    77  
    78  func (o FuncWithSecretsResultOutput) Id() pulumi.StringOutput {
    79  	return o.ApplyT(func(v FuncWithSecretsResult) string { return v.Id }).(pulumi.StringOutput)
    80  }
    81  
    82  func (o FuncWithSecretsResultOutput) Plaintext() pulumi.StringOutput {
    83  	return o.ApplyT(func(v FuncWithSecretsResult) string { return v.Plaintext }).(pulumi.StringOutput)
    84  }
    85  
    86  func init() {
    87  	pulumi.RegisterOutputType(FuncWithSecretsResultOutput{})
    88  }