Skip to content

Commit

Permalink
Merge pull request #69 from Clever/convert-to-dep
Browse files Browse the repository at this point in the history
Convert to dep
  • Loading branch information
rgarcia authored Nov 20, 2017
2 parents e66b460 + 26ca354 commit 2a1eb2c
Show file tree
Hide file tree
Showing 181 changed files with 178 additions and 38,471 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor/
bin
bin/*
deb/sphinx.deb
Expand Down
97 changes: 0 additions & 97 deletions Godeps/Godeps.json

This file was deleted.

5 changes: 0 additions & 5 deletions Godeps/Readme

This file was deleted.

73 changes: 73 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"


[[constraint]]
name = "github.com/Clever/leakybucket"

[[constraint]]
name = "github.com/pborman/uuid"

[[constraint]]
name = "github.com/stretchr/testify"

[[constraint]]
name = "gopkg.in/Clever/kayvee-go.v6"
version = "6.6.0"

[[constraint]]
branch = "v1"
name = "gopkg.in/yaml.v1"

[[constraint]]
name = "gopkg.in/tylerb/graceful.v1"
version = "1.2.15"
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
GIT_DIRTY=$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)
TESTS := $(shell find . -name "*_test.go" | sed s/\.go// | grep -v "./vendor")
BENCHES := $(addsuffix "_bench", $(TESTS))
.PHONY: test $(PKGS) run clean build-release vendor
$(eval $(call golang-version-check,1.8))
.PHONY: test $(PKGS) run clean build-release install_deps
$(eval $(call golang-version-check,1.9))

test: $(PKGS)
$(PKGS): golang-test-all-strict-deps
Expand Down Expand Up @@ -58,5 +58,5 @@ clean:
rm -f main/main
rm -f deb/sphinx.deb

vendor: golang-godep-vendor-deps
$(call golang-godep-vendor,$(PKGS))
install_deps: golang-dep-vendor-deps
$(call golang-dep-vendor)
10 changes: 8 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
machine:
post:
- cd $HOME && git clone --depth 1 -v [email protected]:clever/ci-scripts.git && cd ci-scripts && git show --oneline -s
- $HOME/ci-scripts/circleci/golang-install 1.8
- $HOME/ci-scripts/circleci/golang-install 1.9
services:
- docker
checkout:
post:
- $HOME/ci-scripts/circleci/golang-move-project
compile:
override:
- make install_deps
- make build
test:
override:
- make test
post:
- $HOME/ci-scripts/circleci/report-card $RC_DOCKER_USER $RC_DOCKER_PASS "$RC_DOCKER_EMAIL" $RC_GITHUB_TOKEN
deployment:
all:
master:
branch: master
owner: Clever
commands:
- $HOME/ci-scripts/circleci/docker-publish $DOCKER_USER $DOCKER_PASS "$DOCKER_EMAIL" $DOCKER_ORG
- make VERSION && make deb && cp deb/sphinx.deb sphinx-amd64.deb && $HOME/ci-scripts/circleci/github-release $GH_RELEASE_TOKEN sphinx-amd64.deb
non-master:
branch: /^(?!master$).*$/
owner: Clever
commands:
- $HOME/ci-scripts/circleci/docker-publish $DOCKER_USER $DOCKER_PASS "$DOCKER_EMAIL" $DOCKER_ORG
general:
build_dir: ../.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
3 changes: 2 additions & 1 deletion common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"gopkg.in/v1/yaml"
"net/http"
"sort"

"gopkg.in/yaml.v1"
)

// Request contains any info necessary to ratelimit a request
Expand Down
3 changes: 2 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package config
import (
"errors"
"fmt"
"gopkg.in/v1/yaml"
"io/ioutil"
"log"
"net"
"net/url"
"strings"

"gopkg.in/yaml.v1"
)

// Config holds the yaml data for the config file
Expand Down
5 changes: 4 additions & 1 deletion daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/Clever/sphinx/ratelimiter"
"github.com/pborman/uuid"
"gopkg.in/Clever/kayvee-go.v6/middleware"
"gopkg.in/tylerb/graceful.v1"
)

// Daemon represents a daemon server
Expand Down Expand Up @@ -48,7 +49,9 @@ func (d *daemon) Start() {
if d.healthCheck.Enabled {
setUpHealthCheckService(d.healthCheck.Port, d.healthCheck.Endpoint)
}
log.Fatal(http.ListenAndServe(d.proxy.Listen, d))
if err := graceful.RunWithErr(d.proxy.Listen, 30*time.Second, d); err != nil {
log.Fatal(err)
}
return
}

Expand Down
Loading

0 comments on commit 2a1eb2c

Please sign in to comment.