The Wayback Machine - https://web.archive.org/web/20201017134219/https://github.com/deissh/lambda
Skip to content
This repository has been archived by the owner. It is now read-only.
golang
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
cmd
 
 
 
 
pkg
 
 
 
 
 
 
 
 
 
 

README.md

Simple Lambda Service

Codacy Badge

GitHub issues GitHub stars Twitter

img

Lambda is a framework for building Serverless functions with Docker which has first-class support for metrics. Any process can be packaged as a function enabling you to consume a range of web events without repetitive boiler-plate coding.

Deploy

  1. Install Docker with Docker Compose
  2. Create external docker network docker network create proxy
  3. Build and deploy project cd ./deployments && docker-compose up --build

API

Your function available on custom port. For example 8080 is function port.

Triger function

Allow all http methods

curl -X GET \
  http://localhost:3000/v1/function/{uuid}

Create new function

curl -X POST \
  http://localhost:3000/v1/create \
  -H 'Content-Type: application/json' \
  -d '{
	"name": "example",
	"runtime": {
		"executor": "/bin/cat",
		"cmd": ""
	},
	"repository": {
		"image": "deissh/lambda-runner:latest"
	},
	"service": {
		"port": "8080"
	}
}'

Result

{
    "uuid": "c80d737d0040dff9c9b0341908273dfd71f66f4e5eb8302a0b9d8b26e9b87089"
}

Inspect function

/v1/inspect/:uuid

curl -X GET \
  http://localhost:3000/v1/inspect/{uuid}

Delete function

/v1/delete/:uuid

You need change uuid befour use.

curl -X GET \
  http://localhost:3000/v1/delete/{uuid}
You can’t perform that action at this time.