Skip to content

Merging in changes and simplified java #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@

java/target/
apis.txt
*.iml
*.ipr
37 changes: 19 additions & 18 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#!/bin/bash
declare -a folders=("csharp" "csharp2" "fsharp" "fsharp2" "go" "java" "python" "python3" "nodejs4" "nodejs6")

export AWS_PROFILE=personal

for i in `seq 1 10`;
do
for folder in "${folders[@]}"
do
cd $folder
pwd

sls deploy --region ap-southeast-2

cd ..
done

done
#!/bin/bash
declare -a folders=("csharp" "csharp2" "fsharp" "fsharp2" "go" "java" "python" "python3" "nodejs4" "nodejs6", "python-go")

export AWS_PROFILE=default
export AWS_REGION=us-east-1

for i in `seq 1 11`;
do
for folder in "${folders[@]}"
do
cd $folder
pwd

sls deploy --region $AWS_REGION

cd ..
done

done
4 changes: 0 additions & 4 deletions fsharp/Handler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ open Amazon.Lambda.Core
do ()

module Handler =
open System
open System.IO
open System.Text

type Response = { statusCode : int; body : string }

let hello(): Response = {
Expand Down
4 changes: 0 additions & 4 deletions fsharp2/Handler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ open Amazon.Lambda.Core
do ()

module Handler =
open System
open System.IO
open System.Text

type Response = { statusCode : int; body : string }

let hello(): Response = {
Expand Down
5 changes: 4 additions & 1 deletion go/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
build:
go get github.com/aws/aws-lambda-go/lambda
go get github.com/aws/aws-lambda-go/events
env GOOS=linux go build -o bin/main
env GOOS=linux go build -ldflags='-w -s' -o bin/main

compress:
upx --brute bin/main
4 changes: 2 additions & 2 deletions go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/aws/aws-lambda-go/lambda"
)

func Handler(ctx context.Context, request *events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
return events.APIGatewayProxyResponse{Body: "hello", StatusCode: 200}, nil
func Handler(ctx context.Context, request *events.APIGatewayProxyRequest) (*events.APIGatewayProxyResponse, error) {
return &events.APIGatewayProxyResponse{Body: "hello", StatusCode: 200}, nil
}

func main() {
Expand Down
20 changes: 0 additions & 20 deletions java/hello.iml

This file was deleted.

20 changes: 0 additions & 20 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,6 @@
<artifactId>aws-lambda-java-core</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-log4j</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.8.5</version>
</dependency>
</dependencies>

<build>
Expand Down
129 changes: 0 additions & 129 deletions java/src/main/java/com/serverless/ApiGatewayResponse.java

This file was deleted.

17 changes: 7 additions & 10 deletions java/src/main/java/com/serverless/Handler.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
package com.serverless;

import java.util.Map;

import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;

public class Handler implements RequestHandler<Map<String, Object>, ApiGatewayResponse> {
import java.util.Map;

public class Handler implements RequestHandler<Map<String, Object>, Response> {

@Override
public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) {
return ApiGatewayResponse.builder()
.setStatusCode(200)
.setObjectBody("hello")
.build();
}
@Override
public Response handleRequest(Map<String, Object> input, Context context) {
return new Response("hello", 200);
}
}
24 changes: 12 additions & 12 deletions java/src/main/java/com/serverless/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

public class Response {

private final String body;
private final Integer status;
private final String body;
private final Integer status;

public Response(String body, Integer status) {
this.body = body;
this.status = status;
}
Response(String body, Integer status) {
this.body = body;
this.status = status;
}

public String getBody() {
return this.body;
}
public String getBody() {
return this.body;
}

public Integer getInput() {
return this.status;
}
public Integer getInput() {
return this.status;
}
}
6 changes: 0 additions & 6 deletions java/src/main/resources/log4j.properties

This file was deleted.

16 changes: 16 additions & 0 deletions python-go/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# .env.example to illustrate possible values

# Serverless
ENV=dev

# Golang
WORKDIR=/go/src/github.com/yunspace/lambda-platform-perf-comparison/python-go

# AWS
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_REGION=ap-southeast-2

# Optional AWS STS fields if you use assume role
AWS_SESSION_TOKEN
AWS_SECURITY_TOKEN
5 changes: 5 additions & 0 deletions python-go/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.env
.serverless
*.so
*.zip
vendor
36 changes: 36 additions & 0 deletions python-go/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading