@@ -28,7 +28,9 @@ class GoSamProjectWizard : SamProjectWizard {
28
28
override fun createSdkSelectionPanel (projectLocation : TextFieldWithBrowseButton ? ): SdkSelector = GoSdkSelectionPanel ()
29
29
30
30
override fun listTemplates (): Collection <SamProjectTemplate > = listOf (
31
- SamHelloWorldGo ()
31
+ SamHelloWorldGo (),
32
+ SamEventBridgeHelloWorldGo (),
33
+ SamEventBridgeStarterAppGo ()
32
34
)
33
35
}
34
36
@@ -70,3 +72,45 @@ class SamHelloWorldGo : SamAppTemplateBased() {
70
72
71
73
override val dependencyManager: String = " mod"
72
74
}
75
+
76
+ class SamEventBridgeHelloWorldGo : SamAppTemplateBased () {
77
+ override fun postCreationAction (settings : SamNewProjectSettings , contentRoot : VirtualFile , rootModel : ModifiableRootModel , indicator : ProgressIndicator ) {
78
+ super .postCreationAction(settings, contentRoot, rootModel, indicator)
79
+ // Turn off indexing entire gopath for the project since we are using go modules
80
+ GoProjectLibrariesService .getInstance(rootModel.project).isIndexEntireGopath = false
81
+ // Turn on vgo integration, required for it to resolve dependencies properly
82
+ VgoProjectSettings .getInstance(rootModel.project).isIntegrationEnabled = true
83
+ }
84
+
85
+ override fun displayName () = message(" sam.init.template.event_bridge_hello_world.name" )
86
+ override fun description () = message(" sam.init.template.event_bridge_hello_world.description" )
87
+
88
+ override fun supportedZipRuntimes (): Set <LambdaRuntime > = setOf (LambdaRuntime .GO1_X )
89
+ override fun supportedImageRuntimes () = emptySet<LambdaRuntime >()
90
+
91
+ override val appTemplateName: String = " eventBridge-hello-world"
92
+
93
+ override val dependencyManager: String = " mod"
94
+ }
95
+
96
+ class SamEventBridgeStarterAppGo : SamAppTemplateBased () {
97
+ override fun postCreationAction (settings : SamNewProjectSettings , contentRoot : VirtualFile , rootModel : ModifiableRootModel , indicator : ProgressIndicator ) {
98
+ super .postCreationAction(settings, contentRoot, rootModel, indicator)
99
+ // Turn off indexing entire gopath for the project since we are using go modules
100
+ GoProjectLibrariesService .getInstance(rootModel.project).isIndexEntireGopath = false
101
+ // Turn on vgo integration, required for it to resolve dependencies properly
102
+ VgoProjectSettings .getInstance(rootModel.project).isIntegrationEnabled = true
103
+ }
104
+
105
+ override fun displayName () = message(" sam.init.template.event_bridge_starter_app.name" )
106
+ override fun description () = message(" sam.init.template.event_bridge_starter_app.description" )
107
+
108
+ override fun supportedZipRuntimes (): Set <LambdaRuntime > = setOf (LambdaRuntime .GO1_X )
109
+ override fun supportedImageRuntimes () = emptySet<LambdaRuntime >()
110
+
111
+ override val appTemplateName: String = " eventBridge-schema-app"
112
+
113
+ override fun supportsDynamicSchemas (): Boolean = true
114
+
115
+ override val dependencyManager: String = " mod"
116
+ }
0 commit comments