Skip to content
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

Add Transport Layer: AWS Lambda #814

Closed
suekto-andreas opened this issue Dec 23, 2018 · 1 comment
Closed

Add Transport Layer: AWS Lambda #814

suekto-andreas opened this issue Dec 23, 2018 · 1 comment

Comments

@suekto-andreas
Copy link
Contributor

suekto-andreas commented Dec 23, 2018

Motivation
Simplify the usage of go-kit in AWS Serverless stack via AWS Lambda.

Description
Add transport layer for interacting with AWS Lambda.

@suekto-andreas suekto-andreas changed the title Add Transport Layer: AWS Lambda APIGateway Events Add Transport Layer: AWS Lambda Dec 26, 2018
peterbourgon pushed a commit that referenced this issue Feb 22, 2019
* base serving, encode, decode functions

* logger

* add before encode options

* add ServerAfter functions

* add error encoder

* add finalizer

* add basic happy flow

* add ServerBefore tests

* test error flow on decoding stage

* complete the test scenarios

* refactor into more generic support by implementing lambda.Handler

* testing: ErrorEncoder to reflect behavior of encoding error as payload for AWS APIGateway event handling, as if we return error not nil to lambda it shall treated as error, and the API response would not be pretty

* add wrapper

* capitalize Lambda

* add particle an

* tidy up doc words as per suggested

* Update transport/awslambda/request_response_funcs.go

Co-Authored-By: suekto-andreas <suekto.andreas@gmail.com>

* Update transport/awslambda/request_response_funcs.go

Co-Authored-By: suekto-andreas <suekto.andreas@gmail.com>

* Update transport/awslambda/server.go

Co-Authored-By: suekto-andreas <suekto.andreas@gmail.com>

* Update transport/awslambda/request_response_funcs.go

Co-Authored-By: suekto-andreas <suekto.andreas@gmail.com>

* refactor multiline to keep them 1 per line

* remove \n from test

* defines a DefaultErrorEncoder, refactor the handling of errorEncoder during Invoke

* refactor Server into Handler

* remove wrapper

* refactor variable s into h

* simplify the return of errorEncoder

* Update transport/awslambda/handler.go

Co-Authored-By: suekto-andreas <suekto.andreas@gmail.com>

* Update transport/awslambda/handler.go

Co-Authored-By: suekto-andreas <suekto.andreas@gmail.com>

* Update transport/awslambda/handler.go

Co-Authored-By: suekto-andreas <suekto.andreas@gmail.com>

* DefaultErrorEncoder unit test
@peterbourgon
Copy link
Member

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants