Skip to content

Commit

Permalink
logrus
Browse files Browse the repository at this point in the history
  • Loading branch information
zhao_lanbao committed Sep 24, 2019
1 parent 23c0bc3 commit e831581
Show file tree
Hide file tree
Showing 33 changed files with 63 additions and 63 deletions.
6 changes: 3 additions & 3 deletions buffer/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ import (
"reflect"

"github.com/mailgun/multibuf"
log "github.com/Sirupsen/logrus"
"github.com/aporeto-inc/oxy/utils"
log "github.com/sirupsen/logrus"
"github.com/zhaolanbao/oxy/utils"
)

const (
Expand Down Expand Up @@ -364,7 +364,7 @@ func (b *bufferWriter) expectBody(r *http.Request) bool {
if (b.code >= 100 && b.code < 200) || b.code == 204 || b.code == 304 {
return false
}
// refer to https://github.com/aporeto-inc/oxy/issues/113
// refer to https://github.com/zhaolanbao/oxy/issues/113
// if b.header.Get("Content-Length") == "" && b.header.Get("Transfer-Encoding") == "" {
// return false
// }
Expand Down
6 changes: 3 additions & 3 deletions buffer/buffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/forward"
"github.com/aporeto-inc/oxy/testutils"
"github.com/aporeto-inc/oxy/utils"
"github.com/zhaolanbao/oxy/forward"
"github.com/zhaolanbao/oxy/testutils"
"github.com/zhaolanbao/oxy/utils"
)

func TestSimple(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions buffer/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/forward"
"github.com/aporeto-inc/oxy/roundrobin"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/forward"
"github.com/zhaolanbao/oxy/roundrobin"
"github.com/zhaolanbao/oxy/testutils"
)

func TestSuccess(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions cbreaker/cbreaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (
"time"

"github.com/mailgun/timetools"
log "github.com/Sirupsen/logrus"
"github.com/aporeto-inc/oxy/memmetrics"
"github.com/aporeto-inc/oxy/utils"
log "github.com/sirupsen/logrus"
"github.com/zhaolanbao/oxy/memmetrics"
"github.com/zhaolanbao/oxy/utils"
)

// CircuitBreaker is http.Handler that implements circuit breaker pattern
Expand Down
4 changes: 2 additions & 2 deletions cbreaker/cbreaker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/memmetrics"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/memmetrics"
"github.com/zhaolanbao/oxy/testutils"
)

const triggerNetRatio = `NetworkErrorRatio() > 0.5`
Expand Down
4 changes: 2 additions & 2 deletions cbreaker/effect.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"net/url"
"strings"

log "github.com/Sirupsen/logrus"
"github.com/aporeto-inc/oxy/utils"
log "github.com/sirupsen/logrus"
"github.com/zhaolanbao/oxy/utils"
)

// SideEffect a side effect
Expand Down
4 changes: 2 additions & 2 deletions cbreaker/fallback.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/url"
"strconv"

log "github.com/Sirupsen/logrus"
"github.com/aporeto-inc/oxy/utils"
log "github.com/sirupsen/logrus"
"github.com/zhaolanbao/oxy/utils"
)

// Response response model
Expand Down
2 changes: 1 addition & 1 deletion cbreaker/predicates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/memmetrics"
"github.com/zhaolanbao/oxy/memmetrics"
)

func TestTripped(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cbreaker/ratio.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"github.com/mailgun/timetools"
log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

// ratioController allows passing portions traffic back to the endpoints,
Expand Down
4 changes: 2 additions & 2 deletions cbreaker/ratio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"testing"
"time"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/testutils"
)

func TestRampUp(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions connlimit/connlimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/http"
"sync"

log "github.com/Sirupsen/logrus"
"github.com/aporeto-inc/oxy/utils"
log "github.com/sirupsen/logrus"
"github.com/zhaolanbao/oxy/utils"
)

// ConnLimiter tracks concurrent connection per token
Expand Down
4 changes: 2 additions & 2 deletions connlimit/connlimit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/testutils"
"github.com/aporeto-inc/oxy/utils"
"github.com/zhaolanbao/oxy/testutils"
"github.com/zhaolanbao/oxy/utils"
)

// We've hit the limit and were able to proceed once the request has completed
Expand Down
4 changes: 2 additions & 2 deletions forward/fwd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"time"

"github.com/gorilla/websocket"
log "github.com/Sirupsen/logrus"
"github.com/aporeto-inc/oxy/utils"
log "github.com/sirupsen/logrus"
"github.com/zhaolanbao/oxy/utils"
)

// OxyLogger interface of the internal
Expand Down
4 changes: 2 additions & 2 deletions forward/fwd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/testutils"
"github.com/aporeto-inc/oxy/utils"
"github.com/zhaolanbao/oxy/testutils"
"github.com/zhaolanbao/oxy/utils"
)

// Makes sure hop-by-hop headers are removed
Expand Down
2 changes: 1 addition & 1 deletion forward/fwd_websocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
gorillawebsocket "github.com/gorilla/websocket"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/testutils"
"golang.org/x/net/websocket"
)

Expand Down
2 changes: 1 addition & 1 deletion forward/rewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"strings"

"github.com/aporeto-inc/oxy/utils"
"github.com/zhaolanbao/oxy/utils"
)

// HeaderRewriter is responsible for removing hop-by-hop headers and setting forwarding headers
Expand Down
2 changes: 1 addition & 1 deletion memmetrics/histogram_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/codahale/hdrhistogram"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/testutils"
)

func TestMerge(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion memmetrics/ratio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/testutils"
)

func TestNewRatioCounterInvalidParams(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion memmetrics/roundtrip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/mailgun/timetools"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/testutils"
)

func TestDefaults(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion ratelimit/bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/testutils"
)

func TestConsumeSingleToken(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion ratelimit/bucketset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/testutils"
)

// A value returned by `MaxPeriod` corresponds to the longest bucket time period.
Expand Down
4 changes: 2 additions & 2 deletions ratelimit/tokenlimiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/mailgun/timetools"
"github.com/mailgun/ttlmap"
log "github.com/Sirupsen/logrus"
"github.com/aporeto-inc/oxy/utils"
log "github.com/sirupsen/logrus"
"github.com/zhaolanbao/oxy/utils"
)

// DefaultCapacity default capacity
Expand Down
4 changes: 2 additions & 2 deletions ratelimit/tokenlimiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/testutils"
"github.com/aporeto-inc/oxy/utils"
"github.com/zhaolanbao/oxy/testutils"
"github.com/zhaolanbao/oxy/utils"
)

func TestRateSetAdd(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions roundrobin/rebalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"time"

"github.com/mailgun/timetools"
log "github.com/Sirupsen/logrus"
"github.com/aporeto-inc/oxy/memmetrics"
"github.com/aporeto-inc/oxy/utils"
log "github.com/sirupsen/logrus"
"github.com/zhaolanbao/oxy/memmetrics"
"github.com/zhaolanbao/oxy/utils"
)

// RebalancerOption - functional option setter for rebalancer
Expand Down
4 changes: 2 additions & 2 deletions roundrobin/rebalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/forward"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/forward"
"github.com/zhaolanbao/oxy/testutils"
)

func TestRebalancerNormalOperation(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions roundrobin/rr.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"net/url"
"sync"

log "github.com/Sirupsen/logrus"
"github.com/aporeto-inc/oxy/utils"
log "github.com/sirupsen/logrus"
"github.com/zhaolanbao/oxy/utils"
)

// Weight is an optional functional argument that sets weight of the server
Expand Down
6 changes: 3 additions & 3 deletions roundrobin/rr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/forward"
"github.com/aporeto-inc/oxy/testutils"
"github.com/aporeto-inc/oxy/utils"
"github.com/zhaolanbao/oxy/forward"
"github.com/zhaolanbao/oxy/testutils"
"github.com/zhaolanbao/oxy/utils"
)

func TestNoServers(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions roundrobin/stickysessions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/forward"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/forward"
"github.com/zhaolanbao/oxy/testutils"
)

func TestBasic(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ package stream
import (
"net/http"

log "github.com/Sirupsen/logrus"
"github.com/aporeto-inc/oxy/utils"
log "github.com/sirupsen/logrus"
"github.com/zhaolanbao/oxy/utils"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions stream/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"testing"
"time"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/forward"
"github.com/aporeto-inc/oxy/testutils"
"github.com/zhaolanbao/oxy/forward"
"github.com/zhaolanbao/oxy/testutils"
)

type noOpNextHTTPHandler struct{}
Expand Down
2 changes: 1 addition & 1 deletion testutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/mailgun/timetools"
"github.com/aporeto-inc/oxy/utils"
"github.com/zhaolanbao/oxy/utils"
)

// NewHandler creates a new Server
Expand Down
4 changes: 2 additions & 2 deletions trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"strconv"
"time"

log "github.com/Sirupsen/logrus"
"github.com/aporeto-inc/oxy/utils"
log "github.com/sirupsen/logrus"
"github.com/zhaolanbao/oxy/utils"
)

// Option is a functional option setter for Tracer
Expand Down
4 changes: 2 additions & 2 deletions trace/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/aporeto-inc/oxy/testutils"
"github.com/aporeto-inc/oxy/utils"
"github.com/zhaolanbao/oxy/testutils"
"github.com/zhaolanbao/oxy/utils"
)

func TestTraceSimple(t *testing.T) {
Expand Down

0 comments on commit e831581

Please sign in to comment.