I have following complex structure:
utils:
- utils.go
function1:
pkg1_specific_to_fn1:
-pkg1_specific_to_fn1.go
pkg2_specific_to_fn1:
-pkg2_specific_to_fn1.go
main.go
function2:
pkg1_specific_to_fn1:
-pkg1_specific_to_fn2.go
pkg2_specific_to_fn1:
-pkg2_specific_to_fn2.go
main.go
function3:
pkg1_specific_to_fn1:
-pkg1_specific_to_fn3.go
pkg2_specific_to_fn1:
-pkg2_specific_to_fn3.go
main.go
How do I create .YML deployment file for all these functions in GoLang? Will there be any issues if all of these functions have their own main? I am new to GoLang, but as far as I know, package can contain only one main.go file, and in YML file for handler
property I have to specify executable from bin
. Here is what I had in mind:
service: myService
provider:
name: aws
runtime: go1.x
functions:
function1:
handler: bin/function1/main
description: ..
events: ..
function2:
handler: bin/function2/main
events: ..
function3:
handler: bin/function3/main
Since I have multiple packages representing multiple Lambda functions, it should be okay for me to have main.go in each of them, correct? If not then what is the right way to do this? Also, if this is fine, how do I specify correct main
binary for each function, and is this really the convention to deploy multiple lambdas with GoLang?
NOTE: in each main.go there is a corresponding function Handler.