Permalink
Browse files

Use stdlib context instead of golang.org/x/net/context

  • Loading branch information...
peterbourgon committed Dec 25, 2016
1 parent 4eb1e49 commit 4a2920475703ebd23281dfacdd609d347a9d3285
Showing with 90 additions and 105 deletions.
  1. +1 −1 auth/jwt/README.md
  2. +1 −1 auth/jwt/middleware.go
  3. +1 −2 auth/jwt/middleware_test.go
  4. +1 −1 auth/jwt/transport.go
  5. +1 −2 auth/jwt/transport_test.go
  6. +2 −1 circuitbreaker/gobreaker.go
  7. +1 −1 circuitbreaker/handy_breaker.go
  8. +2 −1 circuitbreaker/hystrix.go
  9. +1 −2 circuitbreaker/util_test.go
  10. +1 −1 endpoint/endpoint.go
  11. +1 −2 endpoint/endpoint_example_test.go
  12. +1 −1 examples/addsvc/cmd/addcli/main.go
  13. +1 −1 examples/addsvc/cmd/addsvc/main.go
  14. +1 −1 examples/addsvc/endpoints.go
  15. +1 −1 examples/addsvc/pb/addsvc.pb.go
  16. +1 −1 examples/addsvc/service.go
  17. +1 −1 examples/addsvc/transport_grpc.go
  18. +1 −1 examples/addsvc/transport_http.go
  19. +1 −1 examples/addsvc/transport_thrift.go
  20. +1 −1 examples/apigateway/main.go
  21. +1 −2 examples/profilesvc/cmd/profilesvc/main.go
  22. +1 −2 examples/profilesvc/endpoints.go
  23. +1 −2 examples/profilesvc/middlewares.go
  24. +1 −2 examples/profilesvc/service.go
  25. +1 −2 examples/profilesvc/transport.go
  26. +1 −2 examples/shipping/booking/endpoint.go
  27. +1 −1 examples/shipping/booking/transport.go
  28. +1 −2 examples/shipping/handling/endpoint.go
  29. +1 −1 examples/shipping/handling/transport.go
  30. +3 −1 examples/shipping/inspection/inspection.go
  31. +3 −1 examples/shipping/location/location.go
  32. +1 −1 examples/shipping/main.go
  33. +1 −2 examples/shipping/routing/proxying.go
  34. +3 −1 examples/shipping/routing/routing.go
  35. +1 −1 examples/shipping/tracking/endpoint.go
  36. +1 −1 examples/shipping/tracking/transport.go
  37. +1 −2 examples/stringsvc1/main.go
  38. +1 −1 examples/stringsvc2/main.go
  39. +1 −2 examples/stringsvc2/transport.go
  40. +1 −1 examples/stringsvc3/main.go
  41. +1 −1 examples/stringsvc3/proxying.go
  42. +1 −2 examples/stringsvc3/transport.go
  43. +1 −1 ratelimit/token_bucket.go
  44. +1 −1 ratelimit/token_bucket_test.go
  45. +3 −1 sd/consul/client.go
  46. +1 −1 sd/consul/client_test.go
  47. +1 −1 sd/consul/subscriber_test.go
  48. +1 −1 sd/etcd/client.go
  49. +1 −1 sd/etcd/client_test.go
  50. +1 −2 sd/etcd/example_test.go
  51. +1 −2 sd/etcd/integration_test.go
  52. +1 −1 sd/lb/random_test.go
  53. +1 −2 sd/lb/retry.go
  54. +1 −2 sd/lb/retry_test.go
  55. +1 −2 sd/lb/round_robin_test.go
  56. +1 −1 sd/zk/util_test.go
  57. +2 −1 tracing/opentracing/endpoint.go
  58. +1 −1 tracing/opentracing/endpoint_test.go
  59. +1 −1 tracing/opentracing/grpc.go
  60. +1 −1 tracing/opentracing/grpc_test.go
  61. +1 −1 tracing/opentracing/http.go
  62. +1 −1 tracing/opentracing/http_test.go
  63. +1 −1 transport/grpc/client.go
  64. +3 −1 transport/grpc/encode_decode.go
  65. +1 −1 transport/grpc/request_response_funcs.go
  66. +2 −1 transport/grpc/server.go
  67. +1 −1 transport/http/client.go
  68. +1 −2 transport/http/client_test.go
  69. +1 −2 transport/http/encode_decode.go
  70. +1 −2 transport/http/example_test.go
  71. +1 −2 transport/http/request_response_funcs.go
  72. +1 −2 transport/http/request_response_funcs_test.go
  73. +1 −2 transport/http/server.go
  74. +1 −2 transport/http/server_test.go
  75. +1 −2 transport/httprp/server.go
  76. +1 −2 transport/httprp/server_test.go
View
@@ -92,7 +92,7 @@ Example of use in a server:
```go
import (
"golang.org/x/net/context"
"context"
"github.com/go-kit/kit/auth/jwt"
"github.com/go-kit/kit/log"
View
@@ -1,10 +1,10 @@
package jwt
import (
"context"
"errors"
jwt "github.com/dgrijalva/jwt-go"
"golang.org/x/net/context"
"github.com/go-kit/kit/endpoint"
)
@@ -1,11 +1,10 @@
package jwt
import (
"context"
"testing"
jwt "github.com/dgrijalva/jwt-go"
"golang.org/x/net/context"
)
var (
View
@@ -1,11 +1,11 @@
package jwt
import (
"context"
"fmt"
stdhttp "net/http"
"strings"
"golang.org/x/net/context"
"google.golang.org/grpc/metadata"
"github.com/go-kit/kit/transport/grpc"
@@ -1,13 +1,12 @@
package jwt
import (
"context"
"fmt"
"net/http"
"testing"
"google.golang.org/grpc/metadata"
"golang.org/x/net/context"
)
func TestToHTTPContext(t *testing.T) {
@@ -1,8 +1,9 @@
package circuitbreaker
import (
"context"
"github.com/sony/gobreaker"
"golang.org/x/net/context"
"github.com/go-kit/kit/endpoint"
)
@@ -1,10 +1,10 @@
package circuitbreaker
import (
"context"
"time"
"github.com/streadway/handy/breaker"
"golang.org/x/net/context"
"github.com/go-kit/kit/endpoint"
)
@@ -1,8 +1,9 @@
package circuitbreaker
import (
"context"
"github.com/afex/hystrix-go/hystrix"
"golang.org/x/net/context"
"github.com/go-kit/kit/endpoint"
)
@@ -1,15 +1,14 @@
package circuitbreaker_test
import (
"context"
"errors"
"fmt"
"path/filepath"
"runtime"
"testing"
"time"
"golang.org/x/net/context"
"github.com/go-kit/kit/endpoint"
)
View
@@ -1,7 +1,7 @@
package endpoint
import (
"golang.org/x/net/context"
"context"
)
// Endpoint is the fundamental building block of servers and clients.
@@ -1,10 +1,9 @@
package endpoint_test
import (
"context"
"fmt"
"golang.org/x/net/context"
"github.com/go-kit/kit/endpoint"
)
@@ -1,6 +1,7 @@
package main
import (
"context"
"flag"
"fmt"
"os"
@@ -12,7 +13,6 @@ import (
"github.com/lightstep/lightstep-tracer-go"
stdopentracing "github.com/opentracing/opentracing-go"
zipkin "github.com/openzipkin/zipkin-go-opentracing"
"golang.org/x/net/context"
"google.golang.org/grpc"
"sourcegraph.com/sourcegraph/appdash"
appdashot "sourcegraph.com/sourcegraph/appdash/opentracing"
@@ -1,6 +1,7 @@
package main
import (
"context"
"flag"
"fmt"
"net"
@@ -16,7 +17,6 @@ import (
stdopentracing "github.com/opentracing/opentracing-go"
zipkin "github.com/openzipkin/zipkin-go-opentracing"
stdprometheus "github.com/prometheus/client_golang/prometheus"
"golang.org/x/net/context"
"google.golang.org/grpc"
"sourcegraph.com/sourcegraph/appdash"
appdashot "sourcegraph.com/sourcegraph/appdash/opentracing"
@@ -9,7 +9,7 @@ import (
"fmt"
"time"
"golang.org/x/net/context"
"context"
"github.com/go-kit/kit/endpoint"
"github.com/go-kit/kit/log"

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -7,7 +7,7 @@ import (
"errors"
"time"
"golang.org/x/net/context"
"context"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/metrics"
@@ -4,8 +4,8 @@ package addsvc
// It utilizes the transport/grpc.Server.
import (
"context"
stdopentracing "github.com/opentracing/opentracing-go"
"golang.org/x/net/context"
"github.com/go-kit/kit/examples/addsvc/pb"
"github.com/go-kit/kit/log"
@@ -10,8 +10,8 @@ import (
"io/ioutil"
"net/http"
"context"
stdopentracing "github.com/opentracing/opentracing-go"
"golang.org/x/net/context"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/tracing/opentracing"
@@ -7,7 +7,7 @@ package addsvc
// yet. See https://github.com/go-kit/kit/issues/184.
import (
"golang.org/x/net/context"
"context"
"github.com/go-kit/kit/endpoint"
thriftadd "github.com/go-kit/kit/examples/addsvc/thrift/gen-go/addsvc"
@@ -2,6 +2,7 @@ package main
import (
"bytes"
"context"
"encoding/json"
"flag"
"fmt"
@@ -18,7 +19,6 @@ import (
"github.com/gorilla/mux"
"github.com/hashicorp/consul/api"
stdopentracing "github.com/opentracing/opentracing-go"
"golang.org/x/net/context"
"github.com/go-kit/kit/endpoint"
"github.com/go-kit/kit/examples/addsvc"
@@ -1,15 +1,14 @@
package main
import (
"context"
"flag"
"fmt"
"net/http"
"os"
"os/signal"
"syscall"
"golang.org/x/net/context"
"github.com/go-kit/kit/examples/profilesvc"
"github.com/go-kit/kit/log"
)
@@ -1,11 +1,10 @@
package profilesvc
import (
"context"
"net/url"
"strings"
"golang.org/x/net/context"
"github.com/go-kit/kit/endpoint"
httptransport "github.com/go-kit/kit/transport/http"
)
@@ -1,10 +1,9 @@
package profilesvc
import (
"context"
"time"
"golang.org/x/net/context"
"github.com/go-kit/kit/log"
)
@@ -1,10 +1,9 @@
package profilesvc
import (
"context"
"errors"
"sync"
"golang.org/x/net/context"
)
// Service is a simple CRUD interface for user profiles.
@@ -4,15 +4,14 @@ package profilesvc
import (
"bytes"
"context"
"encoding/json"
"errors"
"io/ioutil"
"net/http"
"net/url"
"github.com/gorilla/mux"
"golang.org/x/net/context"
"github.com/go-kit/kit/log"
httptransport "github.com/go-kit/kit/transport/http"
@@ -1,10 +1,9 @@
package booking
import (
"context"
"time"
"golang.org/x/net/context"
"github.com/go-kit/kit/endpoint"
"github.com/go-kit/kit/examples/shipping/cargo"
@@ -1,13 +1,13 @@
package booking
import (
"context"
"encoding/json"
"errors"
"net/http"
"time"
"github.com/gorilla/mux"
"golang.org/x/net/context"
kitlog "github.com/go-kit/kit/log"
kithttp "github.com/go-kit/kit/transport/http"
@@ -1,10 +1,9 @@
package handling
import (
"context"
"time"
"golang.org/x/net/context"
"github.com/go-kit/kit/endpoint"
"github.com/go-kit/kit/examples/shipping/cargo"
@@ -1,12 +1,12 @@
package handling
import (
"context"
"encoding/json"
"net/http"
"time"
"github.com/gorilla/mux"
"golang.org/x/net/context"
kitlog "github.com/go-kit/kit/log"
kithttp "github.com/go-kit/kit/transport/http"
@@ -1,7 +1,9 @@
// Package inspection provides means to inspect cargos.
package inspection
import "github.com/go-kit/kit/examples/shipping/cargo"
import (
"github.com/go-kit/kit/examples/shipping/cargo"
)
// EventHandler provides means of subscribing to inspection events.
type EventHandler interface {
@@ -1,7 +1,9 @@
// Package location provides the Location aggregate.
package location
import "errors"
import (
"errors"
)
// UNLocode is the United Nations location code that uniquely identifies a
// particular location.
@@ -1,6 +1,7 @@
package main
import (
"context"
"flag"
"fmt"
"net/http"
@@ -11,7 +12,6 @@ import (
"time"
stdprometheus "github.com/prometheus/client_golang/prometheus"
"golang.org/x/net/context"
"github.com/go-kit/kit/log"
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
Oops, something went wrong.

0 comments on commit 4a29204

Please sign in to comment.