-
Notifications
You must be signed in to change notification settings - Fork 17
/
awscdk_FeatureFlags.go
73 lines (61 loc) · 1.71 KB
/
awscdk_FeatureFlags.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
// Version 2 of the AWS Cloud Development Kit library
package awscdk
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/v2/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
"github.com/aws/constructs-go/constructs/v10"
)
// Features that are implemented behind a flag in order to preserve backwards compatibility for existing apps.
//
// The list of flags are available in the
// `@aws-cdk/cx-api` module.
//
// The state of the flag for this application is stored as a CDK context variable.
//
// Example:
// // The code below shows an example of how to instantiate this type.
// // The values are placeholders you should change.
// import cdk "github.com/aws/aws-cdk-go/awscdk"
//
// featureFlags := cdk.featureFlags.of(this)
//
type FeatureFlags interface {
// Check whether a feature flag is enabled.
//
// If configured, the flag is present in
// the construct node context. Falls back to the defaults defined in the `cx-api`
// module.
IsEnabled(featureFlag *string) *bool
}
// The jsii proxy struct for FeatureFlags
type jsiiProxy_FeatureFlags struct {
_ byte // padding
}
// Inspect feature flags on the construct node's context.
func FeatureFlags_Of(scope constructs.IConstruct) FeatureFlags {
_init_.Initialize()
if err := validateFeatureFlags_OfParameters(scope); err != nil {
panic(err)
}
var returns FeatureFlags
_jsii_.StaticInvoke(
"aws-cdk-lib.FeatureFlags",
"of",
[]interface{}{scope},
&returns,
)
return returns
}
func (f *jsiiProxy_FeatureFlags) IsEnabled(featureFlag *string) *bool {
if err := f.validateIsEnabledParameters(featureFlag); err != nil {
panic(err)
}
var returns *bool
_jsii_.Invoke(
f,
"isEnabled",
[]interface{}{featureFlag},
&returns,
)
return returns
}