dispatcher-api

command module
v0.0.0-...-3e6e532 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2018 License: MIT Imports: 16 Imported by: 0

README

Dispatch API CircleCI Go Report Card

API responsible for maintaining Source to Route information

API's include:

1. POST /sources/{sourcename}/routes

Body:

{
	"route": {
		"url": "String"
	},
	"withSourceCreation": "boolean"
}

Description:
Store route based on sourcename and create Lambda Route function that will bind to SQS queue. if withSourceCreation is set to true, then create the source as well. For now this will only support SQS (could include SNS in the future).

2. GET /sources

Description:
Retrieve all sources that are maintained by dispatcher

3. GET /sources/{sid}/routes

Retrieve all routes for a given source

Deployment

Application code

The Dispatcher API is built using aws lambda go for integration with aws lambda and the golang gin library

Build Code
$ make

This will execute the clean, dependencies, test, build, and package tasks

Deploy

The Dispatcher API uses the Serverless Application Model for deployment. The API is defined in the sam.yml file. This includes 2 steps:

  1. Package assets
$ aws cloudformation package \
    --template-file $(SAM_FILE) \
    --output-template-file $(SAM_OUTPUT) \
    --s3-bucket $(DEPLOYMENT_BUCKET) 

  1. Deploy assets
$ aws cloudformation deploy \
    --template-file $(SAM_OUTPUT) \
    --stack-name $(STACK_NAME) \
    --capabilities CAPABILITY_IAM \
    --parameter-overrides Environment=$(ENV)

Note that these can be found in the Makefile under the package and deploy tasks

	functionType := "nodejs8.10"
	
	creator.Lambda.CreateFunction(&lambda.CreateFunctionInput{
		Code:    &lambda.FunctionCode{},
		Runtime: &functionType,
    })

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL