Skip to content

Commit

Permalink
Fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
italolelis committed Sep 19, 2016
2 parents 39d15a6 + ce60778 commit 5e01ea1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 28 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

This is a lightweight, API Gateway and Management Platform enables you to control who accesses your API,
when they access it and how they access it. API Gateway will also record detailed analytics on how your
users are interacting with your API and when things go wrong.
users are interacting with your API and when things go wrong.

## What is an API Gateway?

Expand All @@ -18,7 +18,7 @@ services instead of implementing management infrastructure. For example if you h
web service that provides geolocation data for all the cats in NYC, and you want to make it public,
integrating an API gateway is a faster, more secure route that writing your own authorisation middleware.

## Key Features
## Key Features

This API Gateway offers powerful, yet lightweight features that allow fine gained control over your API ecosystem.

Expand Down
9 changes: 2 additions & 7 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,6 @@ jobs:
context: unit-tests
status: pending

- put: prequest
params:
path: prequest
context: api-tests
status: pending

- aggregate:
- task: pullrequest unit test
config:
Expand All @@ -191,7 +185,7 @@ jobs:
username: {{quay_username}}
password: {{quay_password}}
run:
path: ci/tasks/unit-tests.sh
path: ./ci/tasks/unit-tests.sh
dir: prequest
inputs:
- name: prequest
Expand All @@ -209,3 +203,4 @@ jobs:
status: success
params:
PROJECT_SRC: {{project_src}}

15 changes: 0 additions & 15 deletions ci/tasks/unit-tests-pr.yml

This file was deleted.

1 change: 1 addition & 0 deletions ci/tasks/unit-tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
cd ${PROJECT_SRC}

pwd
make test
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ var config Specification
//loadConfigEnv loads environment variables
func loadConfigEnv() Specification {
err := envconfig.Process("", &config)
log.Info(config)
if err != nil {
log.Fatal(err.Error())
}
Expand Down Expand Up @@ -72,6 +71,7 @@ func main() {

accessor := initializeDatabase()
defer accessor.Close()

database := Database{accessor}
router.Use(database.Middleware())

Expand Down
7 changes: 4 additions & 3 deletions middleware_rate_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"strconv"
"time"

"net/http"

"github.com/etcinit/speedbump"
"github.com/gin-gonic/gin"
"net/http"
)

type RateLimitMiddleware struct {
Expand Down Expand Up @@ -46,7 +47,7 @@ func (m RateLimitMiddleware) ProcessRequest(req *http.Request, c *gin.Context) (
if !ok {
m.Logger.Debug("Rate limit exceeded.")
return errors.New("Rate limit exceeded. Try again in " + nextTime.String()), http.StatusTooManyRequests
} else {
return nil, http.StatusOK
}

return nil, http.StatusOK
}

0 comments on commit 5e01ea1

Please sign in to comment.