diff --git a/.gitignore b/.gitignore index f5010830..7897ead0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,8 @@ cover.out bin/ .idea/ vendor +cert.pem +key.pem +private.pem +redis-per-second.conf +redis.conf diff --git a/.travis.yml b/.travis.yml index 02bdf2e5..e6485c57 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ sudo: required language: go -go: "1.11" +go: "1.14" services: redis-server before_install: sudo apt-get update -y && sudo apt-get install stunnel4 -y install: make bootstrap bootstrap_redis_tls diff --git a/Dockerfile b/Dockerfile index 57173a93..706cefaa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,16 @@ -FROM golang:1.10.4 AS build -WORKDIR /go/src/github.com/lyft/ratelimit +FROM golang:1.14 AS build +WORKDIR /ratelimit + +ENV GOPROXY=https://proxy.golang.org +COPY go.mod go.sum /ratelimit/ +RUN go mod download COPY src src COPY script script -COPY vendor vendor -COPY glide.yaml glide.yaml -COPY glide.lock glide.lock COPY proto proto -RUN script/install-glide -RUN glide install - -RUN CGO_ENABLED=0 GOOS=linux go build -o /usr/local/bin/ratelimit -ldflags="-w -s" -v github.com/lyft/ratelimit/src/service_cmd +RUN CGO_ENABLED=0 GOOS=linux go build -o /go/bin/ratelimit -ldflags="-w -s" -v github.com/envoyproxy/ratelimit/src/service_cmd -FROM alpine:3.8 AS final +FROM alpine:3.11 AS final RUN apk --no-cache add ca-certificates -COPY --from=build /usr/local/bin/ratelimit /bin/ratelimit +COPY --from=build /go/bin/ratelimit /bin/ratelimit diff --git a/Makefile b/Makefile index 2110f107..ac0850ae 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,12 @@ -ifeq ("$(GOPATH)","") -$(error GOPATH must be set) -endif +export GO111MODULE=on +MODULE = github.com/envoyproxy/ratelimit SHELL := /bin/bash -GOREPO := ${GOPATH}/src/github.com/lyft/ratelimit .PHONY: bootstrap bootstrap: - script/install-glide - glide install + go get github.com/golang/mock/mockgen@v1.4.1 -.PHONY: bootstrap_tests -bootstrap_tests: - cd ./vendor/github.com/golang/mock/mockgen && go install define REDIS_STUNNEL cert = private.pem pid = /var/run/stunnel.pid @@ -33,6 +27,7 @@ redis.conf: echo "$$REDIS_STUNNEL" >> $@ redis-per-second.conf: echo "$$REDIS_PER_SECOND_STUNNEL" >> $@ + .PHONY: bootstrap_redis_tls bootstrap_redis_tls: redis.conf redis-per-second.conf openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \ @@ -51,27 +46,27 @@ docs_format: .PHONY: fix_format fix_format: script/docs_fix_format - go fmt $(shell glide nv) + go fmt $(MODULE)/... .PHONY: check_format check_format: docs_format - @gofmt -l $(shell glide nv | sed 's/\.\.\.//g') | tee /dev/stderr | read && echo "Files failed gofmt" && exit 1 || true + @gofmt -l $(shell go list -f '{{.Dir}}' ./...) | tee /dev/stderr | read && echo "Files failed gofmt" && exit 1 || true .PHONY: compile compile: - mkdir -p ${GOREPO}/bin - cd ${GOREPO}/src/service_cmd && go build -o ratelimit ./ && mv ./ratelimit ${GOREPO}/bin - cd ${GOREPO}/src/client_cmd && go build -o ratelimit_client ./ && mv ./ratelimit_client ${GOREPO}/bin - cd ${GOREPO}/src/config_check_cmd && go build -o ratelimit_config_check ./ && mv ./ratelimit_config_check ${GOREPO}/bin + mkdir -p ./bin + go build -mod=readonly -o ./bin/ratelimit $(MODULE)/src/service_cmd + go build -mod=readonly -o ./bin/ratelimit_client $(MODULE)/src/client_cmd + go build -mod=readonly -o ./bin/ratelimit_config_check $(MODULE)/src/config_check_cmd .PHONY: tests_unit tests_unit: compile - go test -race ./... + go test -race $(MODULE)/... .PHONY: tests tests: compile - go test -race -tags=integration ./... + go test -race -tags=integration $(MODULE)/... .PHONY: docker docker: tests - docker build . -t lyft/ratelimit:`git rev-parse HEAD` + docker build . -t envoyproxy/ratelimit:`git rev-parse HEAD` diff --git a/README.md b/README.md index 67290c44..fdc74919 100644 --- a/README.md +++ b/README.md @@ -40,10 +40,10 @@ decision is then returned to the caller. Envoy's data-plane-api defines a ratelimit service proto [rls.proto](https://github.com/envoyproxy/data-plane-api/blob/master/envoy/service/ratelimit/v2/rls.proto). Logically the data-plane-api [rls](https://github.com/envoyproxy/data-plane-api/blob/master/envoy/service/ratelimit/v2/rls.proto) -is equivalent to the [ratelimit.proto](https://github.com/lyft/ratelimit/blob/0ded92a2af8261d43096eba4132e45b99a3b8b14/proto/ratelimit/ratelimit.proto) +is equivalent to the [ratelimit.proto](https://github.com/envoyproxy/ratelimit/blob/0ded92a2af8261d43096eba4132e45b99a3b8b14/proto/ratelimit/ratelimit.proto) defined in this repo. However, due to the namespace differences and how gRPC routing works it is not possible to transparently route the -legacy ratelimit (ones based in the [ratelimit.proto](https://github.com/lyft/ratelimit/blob/0ded92a2af8261d43096eba4132e45b99a3b8b14/proto/ratelimit/ratelimit.proto) +legacy ratelimit (ones based in the [ratelimit.proto](https://github.com/envoyproxy/ratelimit/blob/0ded92a2af8261d43096eba4132e45b99a3b8b14/proto/ratelimit/ratelimit.proto) defined in this repo) requests to the data-plane-api definitions. Therefore, the ratelimit service will upgrade the requests, process them internally as it would process a data-plane-api ratelimit request, and then downgrade the response to send back to the client. This means that, @@ -54,7 +54,7 @@ for a slight performance hit for clients using the legacy proto, ratelimit is ba 1. `v1.0.0` tagged on commit `0ded92a2af8261d43096eba4132e45b99a3b8b14`. Ratelimit has been in production use at Lyft for over 2 years. 2. `v1.1.0` introduces the data-plane-api proto and initiates the deprecation of the legacy [ratelimit.proto](https://github.com/lyft/ratelimit/blob/0ded92a2af8261d43096eba4132e45b99a3b8b14/proto/ratelimit/ratelimit.proto). -3. `v2.0.0` deletes support for the legacy [ratelimit.proto](https://github.com/lyft/ratelimit/blob/0ded92a2af8261d43096eba4132e45b99a3b8b14/proto/ratelimit/ratelimit.proto). This version will be tagged by the end of 2018Q3 (~September 2018) +3. `v2.0.0` deletes support for the legacy [ratelimit.proto](https://github.com/envoyproxy/ratelimit/blob/0ded92a2af8261d43096eba4132e45b99a3b8b14/proto/ratelimit/ratelimit.proto). This version will be tagged by the end of 2018Q3 (~September 2018) to give time to community members running ratelimit off of `master`. @@ -97,7 +97,6 @@ go [here](https://golang.org/doc/install). The docker-compose setup has three containers: redis, ratelimit-build, and ratelimit. In order to run the docker-compose setup from the root of the repo, run ```bash -glide install docker-compose up ``` @@ -308,7 +307,7 @@ descriptors: The Ratelimit service uses a library written by Lyft called [goruntime](https://github.com/lyft/goruntime) to do configuration loading. Goruntime monitors a designated path, and watches for symlink swaps to files in the directory tree to reload configuration files. -The path to watch can be configured via the [settings](https://github.com/lyft/ratelimit/blob/master/src/settings/settings.go) +The path to watch can be configured via the [settings](https://github.com/envoyproxy/ratelimit/blob/master/src/settings/settings.go) package with the following environment variables: ``` @@ -324,7 +323,7 @@ For more information on how runtime works you can read its [README](https://gith # Request Fields For information on the fields of a Ratelimit gRPC request please read the information -on the RateLimitRequest message type in the Ratelimit [proto file.](https://github.com/lyft/ratelimit/blob/master/proto/ratelimit/ratelimit.proto) +on the RateLimitRequest message type in the Ratelimit [proto file.](https://github.com/envoyproxy/ratelimit/blob/master/proto/ratelimit/ratelimit.proto) # Statistics @@ -377,7 +376,7 @@ You can specify the debug port with the `DEBUG_PORT` environment variable. It de # Local Cache Ratelimit optionally uses [freecache](https://github.com/coocood/freecache) as its local caching layer, which stores the over-the-limit cache keys, and thus avoids reading the -redis cache again for the already over-the-limit keys. The local cache size can be configured via `LocalCacheSizeInBytes` in the [settings](https://github.com/lyft/ratelimit/blob/master/src/settings/settings.go). +redis cache again for the already over-the-limit keys. The local cache size can be configured via `LocalCacheSizeInBytes` in the [settings](https://github.com/envoyproxy/ratelimit/blob/master/src/settings/settings.go). If `LocalCacheSizeInBytes` is 0, local cache is disabled. # Redis diff --git a/docker-compose.yml b/docker-compose.yml index d2af278c..c4ab4443 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,11 +12,11 @@ services: # minimal container that builds the ratelimit service binary and exits. ratelimit-build: - image: golang:1.10-alpine - working_dir: /go/src/github.com/lyft/ratelimit - command: go build -o /usr/local/bin/ratelimit /go/src/github.com/lyft/ratelimit/src/service_cmd/main.go + image: golang:1.14-alpine + working_dir: /go/src/github.com/envoyproxy/ratelimit + command: go build -o /usr/local/bin/ratelimit ./src/service_cmd/main.go volumes: - - .:/go/src/github.com/lyft/ratelimit + - .:/go/src/github.com/envoyproxy/ratelimit - binary:/usr/local/bin/ ratelimit: diff --git a/glide.lock b/glide.lock deleted file mode 100644 index 2d7ff379..00000000 --- a/glide.lock +++ /dev/null @@ -1,142 +0,0 @@ -hash: 8cc8fb031b0204aa915eaa8947e364aa1ce4362a3a9eede8086ffa97ced02b4c -updated: 2019-12-19T15:33:02.225239-08:00 -imports: -- name: github.com/cespare/xxhash - version: d7df74196a9e781ede915320c11c378c1b2f3a1f -- name: github.com/coocood/freecache - version: 3c79a0a23c1940ab4479332fb3e0127265650ce3 -- name: github.com/envoyproxy/go-control-plane - version: 0ad6fa1cf0b9b6ca8f3617a7188a568e81f40b87 - subpackages: - - envoy/api/v2/core - - envoy/api/v2/ratelimit - - envoy/service/ratelimit/v2 - - envoy/type -- name: github.com/envoyproxy/protoc-gen-validate - version: ff6f7a9bc2e5fe006509b9f8c7594c41a953d50f -- name: github.com/fsnotify/fsnotify - version: 629574ca2a5df945712d3079857300b5e4da0236 -- name: github.com/gogo/protobuf - version: 5628607bb4c51c3157aacc3a50f0ab707582b805 - subpackages: - - gogoproto - - proto - - protoc-gen-gogo/descriptor - - protoc-gen-gogofast - - sortkeys - - types -- name: github.com/golang/mock - version: 41e7e9a91aa20115266b326233308d17079ea51c - subpackages: - - gomock -- name: github.com/golang/protobuf - version: b5d812f8a3706043e23a9cd5babf2e5423744d30 - subpackages: - - jsonpb - - proto - - protoc-gen-go/descriptor - - ptypes - - ptypes/any - - ptypes/duration - - ptypes/struct - - ptypes/timestamp -- name: github.com/google/protobuf - version: 6973c3a5041636c1d8dc5f7f6c8c1f3c15bc63d6 -- name: github.com/gorilla/mux - version: 49c01487a141b49f8ffe06277f3dca3ee80a55fa -- name: github.com/kavu/go_reuseport - version: 3d6c1e425f717ee59152524e73b904b67705eeb8 -- name: github.com/kelseyhightower/envconfig - version: ac12b1f15efba734211a556d8b125110dc538016 -- name: github.com/lyft/goruntime - version: a0d6acf20fcfd48f53e623ed62b87ffb7fe17038 - subpackages: - - loader - - snapshot - - snapshot/entry -- name: github.com/lyft/gostats - version: 943f43ede7b2dbf1d7162587689cb484d49ecd15 -- name: github.com/lyft/protoc-gen-validate - version: f9d2b11e44149635b23a002693b76512b01ae515 - subpackages: - - validate -- name: github.com/mediocregopher/radix.v2 - version: b67df6e626f993b64b3ca9f4b8630900e61002e3 - subpackages: - - pool - - redis -- name: github.com/sirupsen/logrus - version: d682213848ed68c0a260ca37d6dd5ace8423f5ba -- name: github.com/stretchr/testify - version: f390dcf405f7b83c997eac1b06768bb9f44dec18 - subpackages: - - assert -- name: golang.org/x/crypto - version: becbf705a91575484002d598f87d74f0002801e7 - subpackages: - - ssh/terminal -- name: golang.org/x/net - version: c0dbc17a35534bf2e581d7a942408dc936316da4 - subpackages: - - context - - http/httpguts - - http2 - - http2/hpack - - idna - - internal/timeseries - - trace -- name: golang.org/x/sys - version: acbc56fc7007d2a01796d5bde54f39e3b3e95945 - subpackages: - - unix - - windows -- name: golang.org/x/text - version: cbf43d21aaebfdfeb81d91a5f444d13a3046e686 - subpackages: - - secure/bidirule - - transform - - unicode/bidi - - unicode/norm -- name: google.golang.org/genproto - version: b31c10ee225f87dbb9f5f878ead9d64f34f5cbbb - subpackages: - - googleapis/rpc/status -- name: google.golang.org/grpc - version: 41344da2231b913fa3d983840a57a6b1b7b631a1 - subpackages: - - balancer - - balancer/base - - balancer/roundrobin - - channelz - - codes - - connectivity - - credentials - - encoding - - encoding/proto - - grpclb/grpc_lb_v1/messages - - grpclog - - health - - health/grpc_health_v1 - - internal - - keepalive - - metadata - - naming - - peer - - resolver - - resolver/dns - - resolver/passthrough - - stats - - status - - tap - - transport -- name: gopkg.in/yaml.v2 - version: 1f64d6156d11335c3f22d9330b0ad14fc1e789ce -testImports: -- name: github.com/davecgh/go-spew - version: 2df174808ee097f90d259e432cc04442cf60be21 - subpackages: - - spew -- name: github.com/pmezard/go-difflib - version: d8ed2627bdf02c080bf22230dbb337003b7aba2d - subpackages: - - difflib diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index 82fbcdc9..00000000 --- a/glide.yaml +++ /dev/null @@ -1,41 +0,0 @@ -package: github.com/lyft/ratelimit -import: -- package: github.com/golang/mock - version: master - subpackages: - - gomock -- package: github.com/kelseyhightower/envconfig - version: 1.1.0 -- package: github.com/lyft/gostats - version: v0.2.6 -- package: github.com/lyft/goruntime - version: v0.2.1 -- package: github.com/mediocregopher/radix.v2 - version: master - subpackages: - - pool - - redis -- package: github.com/sirupsen/logrus - version: ^1.0 -- package: golang.org/x/net - version: master - subpackages: - - context -- package: gopkg.in/yaml.v2 - version: master -- package: github.com/stretchr/testify - version: v1.1.3 -- package: google.golang.org/grpc - version: v1.12.0 -- package: github.com/kavu/go_reuseport - version: v1.2.0 -- package: github.com/envoyproxy/go-control-plane - version: v0.6.9 -- package: github.com/envoyproxy/protoc-gen-validate - version: v0.0.14 -- package: github.com/google/protobuf - version: v3.7.1 -- package: github.com/golang/protobuf/proto - version: v1.3.1 -- package: github.com/coocood/freecache - version: v1.1.0 diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..b05bd81e --- /dev/null +++ b/go.mod @@ -0,0 +1,33 @@ +module github.com/envoyproxy/ratelimit + +go 1.14 + +require ( + github.com/cespare/xxhash v1.1.0 // indirect + github.com/coocood/freecache v1.1.0 + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/envoyproxy/go-control-plane v0.6.9 + github.com/gogo/protobuf v1.3.1 // indirect + github.com/golang/mock v1.4.1 + github.com/golang/protobuf v1.3.2 + github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141 + github.com/kavu/go_reuseport v1.2.0 + github.com/kelseyhightower/envconfig v1.1.0 + github.com/lyft/goruntime v0.2.1 + github.com/lyft/gostats v0.2.6 + github.com/lyft/protoc-gen-validate v0.0.7-0.20180626203901-f9d2b11e4414 // indirect + github.com/mediocregopher/radix.v2 v0.0.0-20181115013041-b67df6e626f9 + github.com/onsi/ginkgo v1.12.0 // indirect + github.com/onsi/gomega v1.9.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/sirupsen/logrus v1.0.4 + github.com/stretchr/testify v1.1.3 + golang.org/x/crypto v0.0.0-20191219195013-becbf705a915 // indirect + golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 + golang.org/x/text v0.3.3-0.20191122225017-cbf43d21aaeb // indirect + google.golang.org/genproto v0.0.0-20191216205247-b31c10ee225f // indirect + google.golang.org/grpc v1.19.0 + gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect + gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect + gopkg.in/yaml.v2 v2.2.7 +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..3f0fe114 --- /dev/null +++ b/go.sum @@ -0,0 +1,119 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coocood/freecache v1.1.0 h1:ENiHOsWdj1BrrlPwblhbn4GdAsMymK3pZORJ+bJGAjA= +github.com/coocood/freecache v1.1.0/go.mod h1:ePwxCDzOYvARfHdr1pByNct1at3CoKnsipOHwKlNbzI= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.6.9 h1:deEH9W8ZAUGNbCdX+9iNzBOGrAOrnpJGoy0PcTqk/tE= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.2-0.20191213205753-41e7e9a91aa2 h1:hBrdHEwxv/6aUIcg0N6NHSRO9Y7jK4Jmu2XP8jUPI+o= +github.com/golang/mock v1.3.2-0.20191213205753-41e7e9a91aa2/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.4.1 h1:ocYkMQY5RrXTYgXl7ICpV0IXwlEQGwKIsery4gyXa1U= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141 h1:VQjjMh+uElTfioy6GnUrVrTMAiLTNF3xsrAlSwC+g8o= +github.com/gorilla/mux v1.7.4-0.20191121170500-49c01487a141/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/kavu/go_reuseport v1.2.0 h1:YO+pt6m5Z3WkVH9DjaDJzoSS/0FO2Q8x3CfObxk/i2E= +github.com/kavu/go_reuseport v1.2.0/go.mod h1:CG8Ee7ceMFSMnx/xr25Vm0qXaj2Z4i5PWoUx+JZ5/CU= +github.com/kelseyhightower/envconfig v1.1.0 h1:4htXR8ameS6KBfrNBoqEgpg0IK2D6rozN9ATOPwRfM0= +github.com/kelseyhightower/envconfig v1.1.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/lyft/goruntime v0.2.1 h1:7DebA8oMVuoQ5TQ0j1xR/X2xRagbGrm0e2SoMdt5tRs= +github.com/lyft/goruntime v0.2.1/go.mod h1:8rUh5gwIPQtyIkIXHbLN1j45HOb8cMgDhrw5GA7DF4g= +github.com/lyft/gostats v0.2.6 h1:m4XmqpBamBXaFjp76h2Ao4TrNpsIVODNClDrH0YTbjM= +github.com/lyft/gostats v0.2.6/go.mod h1:Tpx2xRzz4t+T2Tx0xdVgIoBdR2UMVz+dKnE3X01XSd8= +github.com/lyft/protoc-gen-validate v0.0.7-0.20180626203901-f9d2b11e4414 h1:kLCSHuk3X+SI8Up26wM71id7jz77B3zCZDp01UWMVbM= +github.com/lyft/protoc-gen-validate v0.0.7-0.20180626203901-f9d2b11e4414/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/mediocregopher/radix.v2 v0.0.0-20181115013041-b67df6e626f9 h1:ViNuGS149jgnttqhc6XQNPwdupEMBXqCx9wtlW7P3sA= +github.com/mediocregopher/radix.v2 v0.0.0-20181115013041-b67df6e626f9/go.mod h1:fLRUbhbSd5Px2yKUaGYYPltlyxi1guJz1vCmo1RQL50= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= +github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.0.4 h1:gzbtLsZC3Ic5PptoRG+kQj4L60qjK7H7XszrU163JNQ= +github.com/sirupsen/logrus v1.0.4/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/stretchr/testify v1.1.3 h1:76sIvNG1I8oBerx/MvuVHh5HBWBW7oxfsi3snKIsz5w= +github.com/stretchr/testify v1.1.3/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191219195013-becbf705a915 h1:aJ0ex187qoXrJHPo8ZasVTASQB7llQP6YeNzgDALPRk= +golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3-0.20191122225017-cbf43d21aaeb h1:MsKWO3hK1h941VWsQ8dKJqIdb3r3XP9/cDw8n/B95SM= +golang.org/x/text v0.3.3-0.20191122225017-cbf43d21aaeb/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262 h1:qsl9y/CJx34tuA7QCPNp86JNJe4spst6Ff8MjvPUdPg= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20191216205247-b31c10ee225f h1:0RYv5T9ZdroAqqfM2taEB0nJrArv0X1JpIdgUmY4xg8= +google.golang.org/genproto v0.0.0-20191216205247-b31c10ee225f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo= +gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/script/install-glide b/script/install-glide deleted file mode 100755 index 8b450e88..00000000 --- a/script/install-glide +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -set -e - -which glide > /dev/null 2>&1 && exit 0 - -if test "Darwin" == "$(uname)" - then brew install glide -fi - -which glide > /dev/null 2>&1 || { - mkdir -p ./glide - - curl -L https://github.com/Masterminds/glide/releases/download/v0.12.2/glide-v0.12.2-linux-amd64.tar.gz | tar xz -C ./glide --strip-components=1 - chmod 755 -R ./glide - - if which sudo >/dev/null; - then sudo mv ./glide/glide /usr/local/bin/ - else - mv ./glide/glide /usr/local/bin/ - fi -} - -which glide > /dev/null 2>&1 \ No newline at end of file diff --git a/src/config_check_cmd/main.go b/src/config_check_cmd/main.go index d2defbfa..f9f3c742 100644 --- a/src/config_check_cmd/main.go +++ b/src/config_check_cmd/main.go @@ -7,8 +7,8 @@ import ( "os" "path/filepath" + "github.com/envoyproxy/ratelimit/src/config" "github.com/lyft/gostats" - "github.com/lyft/ratelimit/src/config" ) func loadConfigs(allConfigs []config.RateLimitConfigToLoad) { diff --git a/src/redis/cache.go b/src/redis/cache.go index e5617c55..b090cc99 100644 --- a/src/redis/cache.go +++ b/src/redis/cache.go @@ -2,7 +2,7 @@ package redis import ( pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" - "github.com/lyft/ratelimit/src/config" + "github.com/envoyproxy/ratelimit/src/config" "golang.org/x/net/context" ) diff --git a/src/redis/cache_impl.go b/src/redis/cache_impl.go index b3a34f49..5cc7b63e 100644 --- a/src/redis/cache_impl.go +++ b/src/redis/cache_impl.go @@ -11,8 +11,8 @@ import ( "github.com/coocood/freecache" pb_struct "github.com/envoyproxy/go-control-plane/envoy/api/v2/ratelimit" pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" - "github.com/lyft/ratelimit/src/assert" - "github.com/lyft/ratelimit/src/config" + "github.com/envoyproxy/ratelimit/src/assert" + "github.com/envoyproxy/ratelimit/src/config" logger "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/src/redis/driver_impl.go b/src/redis/driver_impl.go index 5405bc8c..dbcf787e 100644 --- a/src/redis/driver_impl.go +++ b/src/redis/driver_impl.go @@ -4,8 +4,8 @@ import ( "crypto/tls" "net" + "github.com/envoyproxy/ratelimit/src/assert" stats "github.com/lyft/gostats" - "github.com/lyft/ratelimit/src/assert" "github.com/mediocregopher/radix.v2/pool" "github.com/mediocregopher/radix.v2/redis" logger "github.com/sirupsen/logrus" diff --git a/src/server/server_impl.go b/src/server/server_impl.go index d685f847..2b27f06c 100644 --- a/src/server/server_impl.go +++ b/src/server/server_impl.go @@ -8,7 +8,7 @@ import ( "net/http/pprof" "sort" - "github.com/lyft/ratelimit/src/redis" + "github.com/envoyproxy/ratelimit/src/redis" "os" "os/signal" @@ -17,11 +17,11 @@ import ( "net" "github.com/coocood/freecache" + "github.com/envoyproxy/ratelimit/src/settings" "github.com/gorilla/mux" reuseport "github.com/kavu/go_reuseport" "github.com/lyft/goruntime/loader" stats "github.com/lyft/gostats" - "github.com/lyft/ratelimit/src/settings" logger "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/health" diff --git a/src/service/ratelimit.go b/src/service/ratelimit.go index d9817721..3982a39e 100644 --- a/src/service/ratelimit.go +++ b/src/service/ratelimit.go @@ -5,11 +5,11 @@ import ( "sync" pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" + "github.com/envoyproxy/ratelimit/src/assert" + "github.com/envoyproxy/ratelimit/src/config" + "github.com/envoyproxy/ratelimit/src/redis" "github.com/lyft/goruntime/loader" "github.com/lyft/gostats" - "github.com/lyft/ratelimit/src/assert" - "github.com/lyft/ratelimit/src/config" - "github.com/lyft/ratelimit/src/redis" logger "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/src/service/ratelimit_legacy.go b/src/service/ratelimit_legacy.go index a8218279..e4654783 100644 --- a/src/service/ratelimit_legacy.go +++ b/src/service/ratelimit_legacy.go @@ -2,9 +2,9 @@ package ratelimit import ( pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" + pb_legacy "github.com/envoyproxy/ratelimit/proto/ratelimit" "github.com/golang/protobuf/jsonpb" "github.com/lyft/gostats" - pb_legacy "github.com/lyft/ratelimit/proto/ratelimit" "golang.org/x/net/context" ) @@ -12,7 +12,7 @@ type RateLimitLegacyServiceServer interface { pb_legacy.RateLimitServiceServer } -// legacyService is used to implement ratelimit.proto (https://github.com/lyft/ratelimit/blob/0ded92a2af8261d43096eba4132e45b99a3b8b14/proto/ratelimit/ratelimit.proto) +// legacyService is used to implement ratelimit.proto (https://github.com/envoyproxy/ratelimit/blob/0ded92a2af8261d43096eba4132e45b99a3b8b14/proto/ratelimit/ratelimit.proto) // the legacyService receives RateLimitRequests, converts the request, and calls the service's ShouldRateLimit method. type legacyService struct { s *service diff --git a/src/service_cmd/main.go b/src/service_cmd/main.go index 5df1ab03..a53b362b 100644 --- a/src/service_cmd/main.go +++ b/src/service_cmd/main.go @@ -1,6 +1,6 @@ package main -import "github.com/lyft/ratelimit/src/service_cmd/runner" +import "github.com/envoyproxy/ratelimit/src/service_cmd/runner" func main() { runner := runner.NewRunner() diff --git a/src/service_cmd/runner/runner.go b/src/service_cmd/runner/runner.go index 21c07d47..ee9da4b3 100644 --- a/src/service_cmd/runner/runner.go +++ b/src/service_cmd/runner/runner.go @@ -11,13 +11,13 @@ import ( "github.com/coocood/freecache" pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" - pb_legacy "github.com/lyft/ratelimit/proto/ratelimit" + pb_legacy "github.com/envoyproxy/ratelimit/proto/ratelimit" - "github.com/lyft/ratelimit/src/config" - "github.com/lyft/ratelimit/src/redis" - "github.com/lyft/ratelimit/src/server" - ratelimit "github.com/lyft/ratelimit/src/service" - "github.com/lyft/ratelimit/src/settings" + "github.com/envoyproxy/ratelimit/src/config" + "github.com/envoyproxy/ratelimit/src/redis" + "github.com/envoyproxy/ratelimit/src/server" + ratelimit "github.com/envoyproxy/ratelimit/src/service" + "github.com/envoyproxy/ratelimit/src/settings" logger "github.com/sirupsen/logrus" ) @@ -78,7 +78,7 @@ func (runner *Runner) Run() { // Ratelimit is compatible with two proto definitions // 1. data-plane-api rls.proto: https://github.com/envoyproxy/data-plane-api/blob/master/envoy/service/ratelimit/v2/rls.proto pb.RegisterRateLimitServiceServer(srv.GrpcServer(), service) - // 2. ratelimit.proto defined in this repository: https://github.com/lyft/ratelimit/blob/0ded92a2af8261d43096eba4132e45b99a3b8b14/proto/ratelimit/ratelimit.proto + // 2. ratelimit.proto defined in this repository: https://github.com/envoyproxy/ratelimit/blob/0ded92a2af8261d43096eba4132e45b99a3b8b14/proto/ratelimit/ratelimit.proto pb_legacy.RegisterRateLimitServiceServer(srv.GrpcServer(), service.GetLegacyService()) // (1) is the current definition, and (2) is the legacy definition. diff --git a/test/common/common.go b/test/common/common.go index ba3e7904..e3796f5d 100644 --- a/test/common/common.go +++ b/test/common/common.go @@ -5,7 +5,7 @@ import ( pb_struct "github.com/envoyproxy/go-control-plane/envoy/api/v2/ratelimit" pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" - pb_legacy "github.com/lyft/ratelimit/proto/ratelimit" + pb_legacy "github.com/envoyproxy/ratelimit/proto/ratelimit" ) type TestStatSink struct { diff --git a/test/config/config_test.go b/test/config/config_test.go index be5ff347..791cc109 100644 --- a/test/config/config_test.go +++ b/test/config/config_test.go @@ -6,8 +6,8 @@ import ( pb_struct "github.com/envoyproxy/go-control-plane/envoy/api/v2/ratelimit" pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" + "github.com/envoyproxy/ratelimit/src/config" "github.com/lyft/gostats" - "github.com/lyft/ratelimit/src/config" "github.com/stretchr/testify/assert" ) diff --git a/test/integration/integration_test.go b/test/integration/integration_test.go index 697cf896..b33683c8 100644 --- a/test/integration/integration_test.go +++ b/test/integration/integration_test.go @@ -11,9 +11,9 @@ import ( "time" pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" - pb_legacy "github.com/lyft/ratelimit/proto/ratelimit" - "github.com/lyft/ratelimit/src/service_cmd/runner" - "github.com/lyft/ratelimit/test/common" + pb_legacy "github.com/envoyproxy/ratelimit/proto/ratelimit" + "github.com/envoyproxy/ratelimit/src/service_cmd/runner" + "github.com/envoyproxy/ratelimit/test/common" "github.com/stretchr/testify/assert" "golang.org/x/net/context" "google.golang.org/grpc" @@ -41,7 +41,7 @@ func newDescriptorStatusLegacy( } } -// TODO: Once adding the ability of stopping the server in the runner (https://github.com/lyft/ratelimit/issues/119), +// TODO: Once adding the ability of stopping the server in the runner (https://github.com/envoyproxy/ratelimit/issues/119), // stop the server at the end of each test, thus we can reuse the grpc port among these integration tests. func TestBasicConfig(t *testing.T) { t.Run("WithoutPerSecondRedis", testBasicConfig("8083", "false", "0")) diff --git a/test/mocks/config/config.go b/test/mocks/config/config.go index b58f4268..e4ddc17b 100644 --- a/test/mocks/config/config.go +++ b/test/mocks/config/config.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/lyft/ratelimit/src/config (interfaces: RateLimitConfig,RateLimitConfigLoader) +// Source: github.com/envoyproxy/ratelimit/src/config (interfaces: RateLimitConfig,RateLimitConfigLoader) // Package mock_config is a generated GoMock package. package mock_config @@ -7,9 +7,9 @@ package mock_config import ( context "context" ratelimit "github.com/envoyproxy/go-control-plane/envoy/api/v2/ratelimit" + config "github.com/envoyproxy/ratelimit/src/config" gomock "github.com/golang/mock/gomock" gostats "github.com/lyft/gostats" - config "github.com/lyft/ratelimit/src/config" reflect "reflect" ) diff --git a/test/mocks/mocks.go b/test/mocks/mocks.go index 9b224c88..efe80f84 100644 --- a/test/mocks/mocks.go +++ b/test/mocks/mocks.go @@ -2,5 +2,5 @@ package mocks //go:generate mockgen -destination ./runtime/snapshot/snapshot.go github.com/lyft/goruntime/snapshot IFace //go:generate mockgen -destination ./runtime/loader/loader.go github.com/lyft/goruntime/loader IFace -//go:generate mockgen -destination ./config/config.go github.com/lyft/ratelimit/src/config RateLimitConfig,RateLimitConfigLoader -//go:generate mockgen -destination ./redis/redis.go github.com/lyft/ratelimit/src/redis RateLimitCache,Pool,Connection,Response,TimeSource,JitterRandSource +//go:generate mockgen -destination ./config/config.go github.com/envoyproxy/ratelimit/src/config RateLimitConfig,RateLimitConfigLoader +//go:generate mockgen -destination ./redis/redis.go github.com/envoyproxy/ratelimit/src/redis RateLimitCache,Pool,Connection,Response,TimeSource,JitterRandSource diff --git a/test/mocks/redis/redis.go b/test/mocks/redis/redis.go index ad8f4ec9..df24212a 100644 --- a/test/mocks/redis/redis.go +++ b/test/mocks/redis/redis.go @@ -1,13 +1,13 @@ // Automatically generated by MockGen. DO NOT EDIT! -// Source: github.com/lyft/ratelimit/src/redis (interfaces: RateLimitCache,Pool,Connection,Response,TimeSource,JitterRandSource) +// Source: github.com/envoyproxy/ratelimit/src/redis (interfaces: RateLimitCache,Pool,Connection,Response,TimeSource,JitterRandSource) package mock_redis import ( ratelimit "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" + config "github.com/envoyproxy/ratelimit/src/config" + redis "github.com/envoyproxy/ratelimit/src/redis" gomock "github.com/golang/mock/gomock" - config "github.com/lyft/ratelimit/src/config" - redis "github.com/lyft/ratelimit/src/redis" context "golang.org/x/net/context" ) diff --git a/test/redis/cache_impl_test.go b/test/redis/cache_impl_test.go index 57581f38..d4f94fc9 100644 --- a/test/redis/cache_impl_test.go +++ b/test/redis/cache_impl_test.go @@ -6,15 +6,15 @@ import ( "github.com/coocood/freecache" pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" + "github.com/envoyproxy/ratelimit/src/config" + "github.com/envoyproxy/ratelimit/src/redis" stats "github.com/lyft/gostats" - "github.com/lyft/ratelimit/src/config" - "github.com/lyft/ratelimit/src/redis" "math/rand" + "github.com/envoyproxy/ratelimit/test/common" + mock_redis "github.com/envoyproxy/ratelimit/test/mocks/redis" "github.com/golang/mock/gomock" - "github.com/lyft/ratelimit/test/common" - mock_redis "github.com/lyft/ratelimit/test/mocks/redis" "github.com/stretchr/testify/assert" ) diff --git a/test/server/health_test.go b/test/server/health_test.go index 21030ddd..a79e3642 100644 --- a/test/server/health_test.go +++ b/test/server/health_test.go @@ -8,7 +8,7 @@ import ( "syscall" "testing" - "github.com/lyft/ratelimit/src/server" + "github.com/envoyproxy/ratelimit/src/server" "google.golang.org/grpc" "google.golang.org/grpc/health" healthpb "google.golang.org/grpc/health/grpc_health_v1" diff --git a/test/service/ratelimit_legacy_test.go b/test/service/ratelimit_legacy_test.go index f0510f3d..ad7e6b94 100644 --- a/test/service/ratelimit_legacy_test.go +++ b/test/service/ratelimit_legacy_test.go @@ -5,14 +5,14 @@ import ( pb_struct "github.com/envoyproxy/go-control-plane/envoy/api/v2/ratelimit" pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" + pb_legacy "github.com/envoyproxy/ratelimit/proto/ratelimit" + "github.com/envoyproxy/ratelimit/src/config" + "github.com/envoyproxy/ratelimit/src/redis" + "github.com/envoyproxy/ratelimit/src/service" + "github.com/envoyproxy/ratelimit/test/common" "github.com/golang/mock/gomock" "github.com/golang/protobuf/jsonpb" "github.com/lyft/gostats" - pb_legacy "github.com/lyft/ratelimit/proto/ratelimit" - "github.com/lyft/ratelimit/src/config" - "github.com/lyft/ratelimit/src/redis" - "github.com/lyft/ratelimit/src/service" - "github.com/lyft/ratelimit/test/common" "github.com/stretchr/testify/assert" "golang.org/x/net/context" ) diff --git a/test/service/ratelimit_test.go b/test/service/ratelimit_test.go index df5de3eb..57fa0a65 100644 --- a/test/service/ratelimit_test.go +++ b/test/service/ratelimit_test.go @@ -5,16 +5,16 @@ import ( "testing" pb "github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2" + "github.com/envoyproxy/ratelimit/src/config" + "github.com/envoyproxy/ratelimit/src/redis" + "github.com/envoyproxy/ratelimit/src/service" + "github.com/envoyproxy/ratelimit/test/common" + "github.com/envoyproxy/ratelimit/test/mocks/config" + "github.com/envoyproxy/ratelimit/test/mocks/redis" + "github.com/envoyproxy/ratelimit/test/mocks/runtime/loader" + "github.com/envoyproxy/ratelimit/test/mocks/runtime/snapshot" "github.com/golang/mock/gomock" "github.com/lyft/gostats" - "github.com/lyft/ratelimit/src/config" - "github.com/lyft/ratelimit/src/redis" - "github.com/lyft/ratelimit/src/service" - "github.com/lyft/ratelimit/test/common" - "github.com/lyft/ratelimit/test/mocks/config" - "github.com/lyft/ratelimit/test/mocks/redis" - "github.com/lyft/ratelimit/test/mocks/runtime/loader" - "github.com/lyft/ratelimit/test/mocks/runtime/snapshot" "github.com/stretchr/testify/assert" "golang.org/x/net/context" )