func main() { apiStage := sparta.NewStage("v1") apiGateway := sparta.NewAPIGateway("SpartaImagerAPI", apiStage) apiGateway.CORSEnabled = true funcs, err := imagerFunctions(apiGateway) if err == nil { sparta.Main("SpartaImager", "This is a sample Sparta application", funcs, apiGateway, nil) } }
//////////////////////////////////////////////////////////////////////////////// // Main func main() { // Deploy it var lambdaFunctions []*sparta.LambdaAWSInfo lambdaFunctions = appendDynamicS3BucketLambda(lambdaFunctions) sparta.Main("SpartaDiscovery", fmt.Sprintf("Test sparta.Discover() function"), lambdaFunctions, nil, nil) }
func main() { stage := sparta.NewStage("prod") apiGateway := sparta.NewAPIGateway("MySpartaAPI", stage) apiGateway.CORSEnabled = true stackName := "SpartaApplication" sparta.Main(stackName, "Simple Sparta application", spartaLambdaData(apiGateway), apiGateway, nil) }
//////////////////////////////////////////////////////////////////////////////// // Main func main() { lambdaFn := sparta.NewLambda(sparta.IAMRoleDefinition{}, helloWorld, nil) var lambdaFunctions []*sparta.LambdaAWSInfo lambdaFunctions = append(lambdaFunctions, lambdaFn) err := sparta.Main("SpartaHelloWorld", fmt.Sprintf("Test HelloWorld resource command"), lambdaFunctions, nil, nil) if err != nil { os.Exit(1) } }