Skip to content
No description, website, or topics provided.
Go HCL Shell Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.jenkins
deployment
handler
.dockerignore
.gitignore
.travis.yml
Dockerfile
Jenkinsfile
LICENSE
Procfile
README.md
go.mod
go.sum
heroku.yml

README.md

Build Status Coverage Status Go Report Card

AWS Lambda Based Event Handlder

a sample Lambda... It can be triggered either by SQS or API Gateway directly.

Event Message Flow

ScreenShot

Building

To deploy on AWS Lambda:

go build -o main ./handler/ && upx main && zip main.zip main

Docker image:

docker build -t handler . 

Testing

export API_KEY=... CLIENT_ID=... CLIENT_SECRET=...
gotest -v .

# more verbose:
gotest -v . -args -verbose

# with 'live server' instead of using the mock:
gotest -v . -args -live

# to get coverage report (user "-tags test" to exclude Lambda specific bits from the coverage):
gotest ./... -tags test -cover -coverprofile coverage.out  ; go tool cover -html=coverage.out -o coverage.html

Or create .env-file with environment variables.

# Copy this file to '.env'-file and change values
# ORCID Hub API client credentials:
CLIENT_ID=...
CLIENT_SECRET=...
# UoA API Key:
API_KEY=...
# PORT on which to server the handler (only for Docker)
PORT=5000

Runing Docker

# you need to create **.env** file...
docker run -it --env-file .env -p "5050:5050" handler
You can’t perform that action at this time.