/
base64decode.go
74 lines (59 loc) · 2.07 KB
/
base64decode.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// 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 std
import (
"context"
"reflect"
"github.com/pulumi/pulumi-std/sdk/go/std/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Given a base64-encoded string, decodes it and returns the original string.
func Base64decode(ctx *pulumi.Context, args *Base64decodeArgs, opts ...pulumi.InvokeOption) (*Base64decodeResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv Base64decodeResult
err := ctx.Invoke("std:index:base64decode", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type Base64decodeArgs struct {
Input string `pulumi:"input"`
}
type Base64decodeResult struct {
Result string `pulumi:"result"`
}
func Base64decodeOutput(ctx *pulumi.Context, args Base64decodeOutputArgs, opts ...pulumi.InvokeOption) Base64decodeResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (Base64decodeResult, error) {
args := v.(Base64decodeArgs)
r, err := Base64decode(ctx, &args, opts...)
var s Base64decodeResult
if r != nil {
s = *r
}
return s, err
}).(Base64decodeResultOutput)
}
type Base64decodeOutputArgs struct {
Input pulumi.StringInput `pulumi:"input"`
}
func (Base64decodeOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*Base64decodeArgs)(nil)).Elem()
}
type Base64decodeResultOutput struct{ *pulumi.OutputState }
func (Base64decodeResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Base64decodeResult)(nil)).Elem()
}
func (o Base64decodeResultOutput) ToBase64decodeResultOutput() Base64decodeResultOutput {
return o
}
func (o Base64decodeResultOutput) ToBase64decodeResultOutputWithContext(ctx context.Context) Base64decodeResultOutput {
return o
}
func (o Base64decodeResultOutput) Result() pulumi.StringOutput {
return o.ApplyT(func(v Base64decodeResult) string { return v.Result }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(Base64decodeResultOutput{})
}