apiGatewayDeploy

package module
v0.0.1-demo Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2016 License: Apache-2.0 Imports: 16 Imported by: 1

README

apidVerifyAPIKey

This core plugin for apid responds to apidApigeeSync events and publishes an API that allows clients to deploy and update a locally configured gateway.

Functional description

This plugin simply tracks counters based on called URIs:

  • GET /deployments/current - retrieve current deployment
  • POST /deployments/{id} - update specified deployment

Building and running standalone

First, install prerequisites:

glide install

To run an apid test instance with just this plugin installed, change to the cmd/apidGatewayDeploy folder. From here, you may create an executable with:

go build 

Alternatively, you may run without creating an executable with:

go run main.go 

Command line options:

  • -manifest

If you use the -manifest option, the server will start using a clean database that contains only the deployment manifest specified.

Once the process is running, you should be able to manually give the plugin's API a whirl...

curl -i localhost:9000/deployments/current 
curl -i -X POST localhost:9000/deployments/entityId -d '{ "status": "SUCCESS" }' 

The following may be interesting env vars for configuration:

  • APID_API_PORT
  • APID_GATEWAYDEPLOY_GITHUB_ACCESSTOKEN

Running tests

To run the tests, just run:

go test

To generate coverage, you may run:

./cover.sh

Then open cover.html with your browser to see details.

Documentation

Index

Constants

View Source
const (
	RESPONSE_STATUS_SUCCESS = "SUCCESS"
	RESPONSE_STATUS_FAIL    = "FAIL"

	ERROR_CODE_TODO = 0 // todo: add error codes where this is used
)
View Source
const (
	DEPLOYMENT_STATE_INPROG   = 1
	DEPLOYMENT_STATE_ERR_APID = 2
	DEPLOYMENT_STATE_ERR_GWY  = 3
	DEPLOYMENT_STATE_READY    = 4
	DEPLOYMENT_STATE_SUCCESS  = 5

	BUNDLE_TYPE_SYS = 1
	BUNDLE_TYPE_DEP = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLExec

type SQLExec interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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