Git Product home page Git Product logo

serverless-golang's Introduction

Serverless Golang

Serverless Gopher

Gopher by @flemay, inspired by @ashleymcnamara and Renee French artworks.

Serverless Badge Go example projects.

Go Meetup Presentation: https://www.slideshare.net/yunspace/amazingly-simple-serverless-go

Performance

For AWS, we leverage eawsy's python based AWS Lambda Go Shim for superior performance compared to Node.js shims:

Benchmark

Features

  • seamless integration with AWS Lambda event sources or API Gateway HTTP requests.
  • use docker and docker-compose for easy testing with localstack (example coming soon) and ensure consistent dependencies across golang, python and serverless
  • docker builder image immutably baked in with:
    • amazon linux base image for building AWS Lambda
    • go 1.9.2
    • vendor support via glide, trash and dep
    • python 2.7
    • node 6
    • serverless 1.25.0

Usage

Prerequisites:

  • have serverless, go, make and docker
  • have correct $GOPATH and your new project must reside in $GOPATH/src/path/your-app

See each individual example for detailed instructions:

Clients

Currently used by amaysim Australia to build strategic Microservices across 4 business verticals.

RoadMap

  • kinesis example
  • graphql example
  • dynamodb example with localstack tests #13
  • event-gateway and FDK support #17
  • sls plugins example #21
  • Azure support #15
  • OpenWhisk

serverless-golang's People

Contributors

cristim avatar dylanhillier avatar eminetto avatar kmarquardsen avatar muellermh avatar slotix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

serverless-golang's Issues

add dynamodb to examples

so that the RESTful api sample project can be complete with API Gateway, functions and persistence

build with private repos

I'm having trouble getting this package to work with private repositories. My function imports a package that exists on my local machine. However, dep tries to import it from its' private GitHub repo from within the docker container, causing the build to fail.

This seems like a pretty common use case, so is there a pattern to handle this?

Create serverless template

So that users can just run:

serverless create --template aws-golang-shim

and

serverless create --template aws-golang-net

Rather than copy and paste form this sample project

`make dockerDist deploy` errors unable to find package

✘-2 ~/Projects/personal/my-sls-golang-net
13:07 $ make deps
latest: Pulling from eawsy/aws-lambda-go-shim
Digest: sha256:a405f212c35de3ec61b75f3da2f9c3c2a9a5c999fa1a072b2df86aa393da57db
Status: Image is up to date for eawsy/aws-lambda-go-shim:latest
✔ ~/Projects/personal/my-sls-golang-net
13:07 $ make dockerDist deploy
docker run --rm -ti -e HANDLER=handler -e PACKAGE=handler -v /Users/mseiler/.go/:/go -v /Users/mseiler/Projects/personal/my-sls-golang-net:/tmp -w /tmp eawsy/aws-lambda-go-shim:latest  make dist
handler.go:9:2: cannot find package "github.com/eawsy/aws-lambda-go-net/service/lambda/runtime/net" in any of:
	/usr/local/go/src/github.com/eawsy/aws-lambda-go-net/service/lambda/runtime/net (from $GOROOT)
	/go/src/github.com/eawsy/aws-lambda-go-net/service/lambda/runtime/net (from $GOPATH)
handler.go:4:2: cannot find package "github.com/eawsy/aws-lambda-go-net/service/lambda/runtime/net/apigatewayproxy" in any of:
	/usr/local/go/src/github.com/eawsy/aws-lambda-go-net/service/lambda/runtime/net/apigatewayproxy (from $GOROOT)
	/go/src/github.com/eawsy/aws-lambda-go-net/service/lambda/runtime/net/apigatewayproxy (from $GOPATH)
handler.go:6:2: cannot find package "github.com/gorilla/mux" in any of:
	/usr/local/go/src/github.com/gorilla/mux (from $GOROOT)
	/go/src/github.com/gorilla/mux (from $GOPATH)
make: *** [build] Error 1
make: *** [dockerDist] Error 2

Running on localstack

Really struggling to run with localstack. Trying to use serverless-localstack plugin, but as soon as i drop it into .serverless_plugins make deps and make deploy get stuck forever. Running build outside of docker looks fine, trying to deploy it i'm getting Unable to find handler script in Lambda archive. Have absolutely no issues with real AWS though.

Is that the intended way to run on localstack even? Any chance to get some first steps explained?

graphql example

I was able to get started on this #29. I plan to build out the full todo example when I get some time

add nano functions example?

Is this possible/would it provide value?

functions:
  create:
    handler: todos/handler.Handler
    events:
      - http:
          path: todos
          method: post
          cors: true

  list:
    handler: todos/handler.Handler
    events:
      - http:
          path: todos
          method: get
          cors: true

  get:
    handler: todos/handler.Handler
    events:
      - http:
          path: todos/{id}
          method: get
          cors: true

  update:
    handler: todos/handler.Handler
    events:
      - http:
          path: todos/{id}
          method: put
          cors: true

  delete:
    handler: todos/handler.Handler
    events:
      - http:
          path: todos/{id}
          method: delete
          cors: true

No rule to make target

Getting these errors attempting to run examples - not sure where the breakdown is.

Running: make test build deploy

Results in:

docker-compose run --rm sls-go make _deps
make: *** No rule to make target `_deps'.  Stop.
Makefile:13: recipe for target 'deps' failed
make: *** [deps] Error 2

Any tips or pointers to troubleshoot/get this running would be much appreciated!

Cheers,
Reid

make package return error

I just sls install by the example and try to run make package
it ends up with this error:

package company.com/hello-world: directory "/Users/XXXX/golang/src/company.com/hello-world" is not using a known version control system
make: *** [deps] Error 1

Support in dep

since go dep doing to be the official dependency management tool for Golang. it's a good idea to support it in the build phase.

I try to do that by changing the Makefile but faced an issue with:
1)installing it - the usually way is go get -u github.com/golang/dep/cmd/dep which is required git installed
2)using the vendor folder for the completion(no not GOPATH)

Investigate package.zip size

As pointed out by @campoy at Golang Sydney meetup, the size of a default package.zip for a vanilla project is quite large (3.4mb for sls-golang-net). Need to consider ways to decrease this.

local server

What is the recommended way of starting a local web server? Thank you!

The security token included in the request is invalid.

Getting below errors, when trying deploy.

Serverless: Packaging service...

Serverless Error ---------------------------------------

The security token included in the request is invalid.

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Forums: forum.serverless.com
Chat: gitter.im/serverless/serverless

Your Environment Information -----------------------------
OS: linux
Node Version: 6.12.0
Serverless Version: 1.24.0

Passing lambda environment variables

When creating lambda manually I can pass environment variables like that

aws lambda create-function --function-name hello ... --environment Variables="{VAR1=var1,VAR2=2,VAR3='0.5'}" ...

How to pass them using serverless deploy?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.