Code Monkey home page Code Monkey logo

sparta-1's Introduction

Sparta

Build Status

GoDoc

Go Report Card

Visit gosparta.io for complete documentation.

Overview

Sparta takes a set of golang functions and automatically provisions them in AWS Lambda as a logical unit.

AWS Lambda functions are defined using the standard AWS Lambda signatures:

  • func()
  • func() error
  • func(TIn) error
  • func() (TOut, error)
  • func(context.Context) error
  • func(context.Context, TIn) error
  • func(context.Context) (TOut, error)
  • func(context.Context, TIn) (TOut, error)

The TIn and TOut parameters represent encoding/json un/marshallable types.

For instance:

// Standard AWS λ function
func helloWorld(ctx context.Context) (string, error) {
  ...
}

where

  • ctx : The request context that includes Sparta both the AWS Context as well as Sparta specific values

Consumers define a set of lambda functions and provide them to Sparta to create a self-documenting, self-deploying AWS Lambda binary:

	lambdaFn := sparta.HandleAWSLambda("Hello World",
		helloWorld,
		sparta.IAMRoleDefinition{})

	var lambdaFunctions []*sparta.LambdaAWSInfo
	lambdaFunctions = append(lambdaFunctions, lambdaFn)

	err := sparta.Main("HelloWorldStack",
		"My Hello World stack",
		lambdaFunctions,
		nil,
		nil)

Given a set of registered golang functions, Sparta will:

  • Either verify or provision the defined IAM roles
  • Build a deployable application via Provision()
  • Zip the contents and associated proxying logic
  • Dynamically create a CloudFormation template to either create or update the service state.
  • Optionally:
    • Register with S3 and SNS for push source configuration
    • Provision an API Gateway service to make your functions publicly available
    • Provision an S3 static website

Visit gosparta.io for complete documentation.

Contributors

Thanks to all Sparta contributors (alphabetical)

sparta-1's People

Contributors

bbigras avatar mjuarez avatar mweagle avatar nylar avatar ryansb avatar sdbeard avatar solarkennedy avatar thomshutt avatar

Watchers

 avatar

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.