deissh / lambda

πŸš€ Very simple FaaS with auto scaling.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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}

About

πŸš€ Very simple FaaS with auto scaling.


Languages

Language:Go 93.5%Language:Dockerfile 6.5%