Use stdlib context instead of golang.org/x/net/context
Peter Bourgon
6 years ago
91 | 91 |
|
92 | 92 |
```go
|
93 | 93 |
import (
|
94 | |
"golang.org/x/net/context"
|
|
94 |
"context"
|
95 | 95 |
|
96 | 96 |
"github.com/go-kit/kit/auth/jwt"
|
97 | 97 |
"github.com/go-kit/kit/log"
|
0 | 0 |
package jwt
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"errors"
|
4 | 5 |
|
5 | 6 |
jwt "github.com/dgrijalva/jwt-go"
|
6 | |
"golang.org/x/net/context"
|
7 | 7 |
|
8 | 8 |
"github.com/go-kit/kit/endpoint"
|
9 | 9 |
)
|
0 | 0 |
package jwt
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"testing"
|
4 | 5 |
|
5 | 6 |
jwt "github.com/dgrijalva/jwt-go"
|
6 | |
|
7 | |
"golang.org/x/net/context"
|
8 | 7 |
)
|
9 | 8 |
|
10 | 9 |
var (
|
0 | 0 |
package jwt
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"fmt"
|
4 | 5 |
stdhttp "net/http"
|
5 | 6 |
"strings"
|
6 | 7 |
|
7 | |
"golang.org/x/net/context"
|
8 | 8 |
"google.golang.org/grpc/metadata"
|
9 | 9 |
|
10 | 10 |
"github.com/go-kit/kit/transport/grpc"
|
0 | 0 |
package jwt
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"fmt"
|
4 | 5 |
"net/http"
|
5 | 6 |
"testing"
|
6 | 7 |
|
7 | 8 |
"google.golang.org/grpc/metadata"
|
8 | |
|
9 | |
"golang.org/x/net/context"
|
10 | 9 |
)
|
11 | 10 |
|
12 | 11 |
func TestToHTTPContext(t *testing.T) {
|
0 | 0 |
package circuitbreaker
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
|
4 |
|
3 | 5 |
"github.com/sony/gobreaker"
|
4 | |
"golang.org/x/net/context"
|
5 | 6 |
|
6 | 7 |
"github.com/go-kit/kit/endpoint"
|
7 | 8 |
)
|
0 | 0 |
package circuitbreaker
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"time"
|
4 | 5 |
|
5 | 6 |
"github.com/streadway/handy/breaker"
|
6 | |
"golang.org/x/net/context"
|
7 | 7 |
|
8 | 8 |
"github.com/go-kit/kit/endpoint"
|
9 | 9 |
)
|
0 | 0 |
package circuitbreaker
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
|
4 |
|
3 | 5 |
"github.com/afex/hystrix-go/hystrix"
|
4 | |
"golang.org/x/net/context"
|
5 | 6 |
|
6 | 7 |
"github.com/go-kit/kit/endpoint"
|
7 | 8 |
)
|
0 | 0 |
package circuitbreaker_test
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"errors"
|
4 | 5 |
"fmt"
|
5 | 6 |
"path/filepath"
|
6 | 7 |
"runtime"
|
7 | 8 |
"testing"
|
8 | 9 |
"time"
|
9 | |
|
10 | |
"golang.org/x/net/context"
|
11 | 10 |
|
12 | 11 |
"github.com/go-kit/kit/endpoint"
|
13 | 12 |
)
|
0 | 0 |
package endpoint
|
1 | 1 |
|
2 | 2 |
import (
|
3 | |
"golang.org/x/net/context"
|
|
3 |
"context"
|
4 | 4 |
)
|
5 | 5 |
|
6 | 6 |
// Endpoint is the fundamental building block of servers and clients.
|
0 | 0 |
package endpoint_test
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"fmt"
|
4 | |
|
5 | |
"golang.org/x/net/context"
|
6 | 5 |
|
7 | 6 |
"github.com/go-kit/kit/endpoint"
|
8 | 7 |
)
|
0 | 0 |
package main
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"flag"
|
4 | 5 |
"fmt"
|
5 | 6 |
"os"
|
|
11 | 12 |
"github.com/lightstep/lightstep-tracer-go"
|
12 | 13 |
stdopentracing "github.com/opentracing/opentracing-go"
|
13 | 14 |
zipkin "github.com/openzipkin/zipkin-go-opentracing"
|
14 | |
"golang.org/x/net/context"
|
15 | 15 |
"google.golang.org/grpc"
|
16 | 16 |
"sourcegraph.com/sourcegraph/appdash"
|
17 | 17 |
appdashot "sourcegraph.com/sourcegraph/appdash/opentracing"
|
0 | 0 |
package main
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"flag"
|
4 | 5 |
"fmt"
|
5 | 6 |
"net"
|
|
15 | 16 |
stdopentracing "github.com/opentracing/opentracing-go"
|
16 | 17 |
zipkin "github.com/openzipkin/zipkin-go-opentracing"
|
17 | 18 |
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
18 | |
"golang.org/x/net/context"
|
19 | 19 |
"google.golang.org/grpc"
|
20 | 20 |
"sourcegraph.com/sourcegraph/appdash"
|
21 | 21 |
appdashot "sourcegraph.com/sourcegraph/appdash/opentracing"
|
8 | 8 |
"fmt"
|
9 | 9 |
"time"
|
10 | 10 |
|
11 | |
"golang.org/x/net/context"
|
|
11 |
"context"
|
12 | 12 |
|
13 | 13 |
"github.com/go-kit/kit/endpoint"
|
14 | 14 |
"github.com/go-kit/kit/log"
|
20 | 20 |
import math "math"
|
21 | 21 |
|
22 | 22 |
import (
|
23 | |
context "golang.org/x/net/context"
|
|
23 |
context "context"
|
24 | 24 |
grpc "google.golang.org/grpc"
|
25 | 25 |
)
|
26 | 26 |
|
6 | 6 |
"errors"
|
7 | 7 |
"time"
|
8 | 8 |
|
9 | |
"golang.org/x/net/context"
|
|
9 |
"context"
|
10 | 10 |
|
11 | 11 |
"github.com/go-kit/kit/log"
|
12 | 12 |
"github.com/go-kit/kit/metrics"
|
3 | 3 |
// It utilizes the transport/grpc.Server.
|
4 | 4 |
|
5 | 5 |
import (
|
|
6 |
"context"
|
6 | 7 |
stdopentracing "github.com/opentracing/opentracing-go"
|
7 | |
"golang.org/x/net/context"
|
8 | 8 |
|
9 | 9 |
"github.com/go-kit/kit/examples/addsvc/pb"
|
10 | 10 |
"github.com/go-kit/kit/log"
|
9 | 9 |
"io/ioutil"
|
10 | 10 |
"net/http"
|
11 | 11 |
|
|
12 |
"context"
|
12 | 13 |
stdopentracing "github.com/opentracing/opentracing-go"
|
13 | |
"golang.org/x/net/context"
|
14 | 14 |
|
15 | 15 |
"github.com/go-kit/kit/log"
|
16 | 16 |
"github.com/go-kit/kit/tracing/opentracing"
|
6 | 6 |
// yet. See https://github.com/go-kit/kit/issues/184.
|
7 | 7 |
|
8 | 8 |
import (
|
9 | |
"golang.org/x/net/context"
|
|
9 |
"context"
|
10 | 10 |
|
11 | 11 |
"github.com/go-kit/kit/endpoint"
|
12 | 12 |
thriftadd "github.com/go-kit/kit/examples/addsvc/thrift/gen-go/addsvc"
|
1 | 1 |
|
2 | 2 |
import (
|
3 | 3 |
"bytes"
|
|
4 |
"context"
|
4 | 5 |
"encoding/json"
|
5 | 6 |
"flag"
|
6 | 7 |
"fmt"
|
|
17 | 18 |
"github.com/gorilla/mux"
|
18 | 19 |
"github.com/hashicorp/consul/api"
|
19 | 20 |
stdopentracing "github.com/opentracing/opentracing-go"
|
20 | |
"golang.org/x/net/context"
|
21 | 21 |
|
22 | 22 |
"github.com/go-kit/kit/endpoint"
|
23 | 23 |
"github.com/go-kit/kit/examples/addsvc"
|
0 | 0 |
package main
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"flag"
|
4 | 5 |
"fmt"
|
5 | 6 |
"net/http"
|
6 | 7 |
"os"
|
7 | 8 |
"os/signal"
|
8 | 9 |
"syscall"
|
9 | |
|
10 | |
"golang.org/x/net/context"
|
11 | 10 |
|
12 | 11 |
"github.com/go-kit/kit/examples/profilesvc"
|
13 | 12 |
"github.com/go-kit/kit/log"
|
0 | 0 |
package profilesvc
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"net/url"
|
4 | 5 |
"strings"
|
5 | |
|
6 | |
"golang.org/x/net/context"
|
7 | 6 |
|
8 | 7 |
"github.com/go-kit/kit/endpoint"
|
9 | 8 |
httptransport "github.com/go-kit/kit/transport/http"
|
0 | 0 |
package profilesvc
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"time"
|
4 | |
|
5 | |
"golang.org/x/net/context"
|
6 | 5 |
|
7 | 6 |
"github.com/go-kit/kit/log"
|
8 | 7 |
)
|
0 | 0 |
package profilesvc
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"errors"
|
4 | 5 |
"sync"
|
5 | |
|
6 | |
"golang.org/x/net/context"
|
7 | 6 |
)
|
8 | 7 |
|
9 | 8 |
// Service is a simple CRUD interface for user profiles.
|
3 | 3 |
|
4 | 4 |
import (
|
5 | 5 |
"bytes"
|
|
6 |
"context"
|
6 | 7 |
"encoding/json"
|
7 | 8 |
"errors"
|
8 | 9 |
"io/ioutil"
|
9 | 10 |
"net/http"
|
10 | |
|
11 | 11 |
"net/url"
|
12 | 12 |
|
13 | 13 |
"github.com/gorilla/mux"
|
14 | |
"golang.org/x/net/context"
|
15 | 14 |
|
16 | 15 |
"github.com/go-kit/kit/log"
|
17 | 16 |
httptransport "github.com/go-kit/kit/transport/http"
|
0 | 0 |
package booking
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"time"
|
4 | |
|
5 | |
"golang.org/x/net/context"
|
6 | 5 |
|
7 | 6 |
"github.com/go-kit/kit/endpoint"
|
8 | 7 |
|
0 | 0 |
package booking
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"encoding/json"
|
4 | 5 |
"errors"
|
5 | 6 |
"net/http"
|
6 | 7 |
"time"
|
7 | 8 |
|
8 | 9 |
"github.com/gorilla/mux"
|
9 | |
"golang.org/x/net/context"
|
10 | 10 |
|
11 | 11 |
kitlog "github.com/go-kit/kit/log"
|
12 | 12 |
kithttp "github.com/go-kit/kit/transport/http"
|
0 | 0 |
package handling
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"time"
|
4 | |
|
5 | |
"golang.org/x/net/context"
|
6 | 5 |
|
7 | 6 |
"github.com/go-kit/kit/endpoint"
|
8 | 7 |
|
0 | 0 |
package handling
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"encoding/json"
|
4 | 5 |
"net/http"
|
5 | 6 |
"time"
|
6 | 7 |
|
7 | 8 |
"github.com/gorilla/mux"
|
8 | |
"golang.org/x/net/context"
|
9 | 9 |
|
10 | 10 |
kitlog "github.com/go-kit/kit/log"
|
11 | 11 |
kithttp "github.com/go-kit/kit/transport/http"
|
0 | 0 |
// Package inspection provides means to inspect cargos.
|
1 | 1 |
package inspection
|
2 | 2 |
|
3 | |
import "github.com/go-kit/kit/examples/shipping/cargo"
|
|
3 |
import (
|
|
4 |
"github.com/go-kit/kit/examples/shipping/cargo"
|
|
5 |
)
|
4 | 6 |
|
5 | 7 |
// EventHandler provides means of subscribing to inspection events.
|
6 | 8 |
type EventHandler interface {
|
0 | 0 |
// Package location provides the Location aggregate.
|
1 | 1 |
package location
|
2 | 2 |
|
3 | |
import "errors"
|
|
3 |
import (
|
|
4 |
"errors"
|
|
5 |
)
|
4 | 6 |
|
5 | 7 |
// UNLocode is the United Nations location code that uniquely identifies a
|
6 | 8 |
// particular location.
|
0 | 0 |
package main
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"flag"
|
4 | 5 |
"fmt"
|
5 | 6 |
"net/http"
|
|
10 | 11 |
"time"
|
11 | 12 |
|
12 | 13 |
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
13 | |
"golang.org/x/net/context"
|
14 | 14 |
|
15 | 15 |
"github.com/go-kit/kit/log"
|
16 | 16 |
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
|
0 | 0 |
package routing
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"encoding/json"
|
4 | 5 |
"net/http"
|
5 | 6 |
"net/url"
|
6 | 7 |
"time"
|
7 | |
|
8 | |
"golang.org/x/net/context"
|
9 | 8 |
|
10 | 9 |
"github.com/go-kit/kit/circuitbreaker"
|
11 | 10 |
"github.com/go-kit/kit/endpoint"
|
2 | 2 |
// bounded context.
|
3 | 3 |
package routing
|
4 | 4 |
|
5 | |
import "github.com/go-kit/kit/examples/shipping/cargo"
|
|
5 |
import (
|
|
6 |
"github.com/go-kit/kit/examples/shipping/cargo"
|
|
7 |
)
|
6 | 8 |
|
7 | 9 |
// Service provides access to an external routing service.
|
8 | 10 |
type Service interface {
|
0 | 0 |
package tracking
|
1 | 1 |
|
2 | 2 |
import (
|
3 | |
"golang.org/x/net/context"
|
|
3 |
"context"
|
4 | 4 |
|
5 | 5 |
"github.com/go-kit/kit/endpoint"
|
6 | 6 |
)
|
0 | 0 |
package tracking
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"encoding/json"
|
4 | 5 |
"errors"
|
5 | 6 |
"net/http"
|
6 | 7 |
|
7 | 8 |
"github.com/gorilla/mux"
|
8 | |
"golang.org/x/net/context"
|
9 | 9 |
|
10 | 10 |
kitlog "github.com/go-kit/kit/log"
|
11 | 11 |
kithttp "github.com/go-kit/kit/transport/http"
|
0 | 0 |
package main
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"encoding/json"
|
4 | 5 |
"errors"
|
5 | 6 |
"log"
|
6 | 7 |
"net/http"
|
7 | 8 |
"strings"
|
8 | |
|
9 | |
"golang.org/x/net/context"
|
10 | 9 |
|
11 | 10 |
"github.com/go-kit/kit/endpoint"
|
12 | 11 |
httptransport "github.com/go-kit/kit/transport/http"
|
0 | 0 |
package main
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"net/http"
|
4 | 5 |
"os"
|
5 | 6 |
|
6 | 7 |
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
7 | |
"golang.org/x/net/context"
|
8 | 8 |
|
9 | 9 |
"github.com/go-kit/kit/log"
|
10 | 10 |
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
|
0 | 0 |
package main
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"encoding/json"
|
4 | 5 |
"net/http"
|
5 | |
|
6 | |
"golang.org/x/net/context"
|
7 | 6 |
|
8 | 7 |
"github.com/go-kit/kit/endpoint"
|
9 | 8 |
)
|
0 | 0 |
package main
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"flag"
|
4 | 5 |
"net/http"
|
5 | 6 |
"os"
|
6 | 7 |
|
7 | 8 |
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
8 | |
"golang.org/x/net/context"
|
9 | 9 |
|
10 | 10 |
"github.com/go-kit/kit/log"
|
11 | 11 |
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
|
0 | 0 |
package main
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"errors"
|
4 | 5 |
"fmt"
|
5 | 6 |
"net/url"
|
|
8 | 9 |
|
9 | 10 |
jujuratelimit "github.com/juju/ratelimit"
|
10 | 11 |
"github.com/sony/gobreaker"
|
11 | |
"golang.org/x/net/context"
|
12 | 12 |
|
13 | 13 |
"github.com/go-kit/kit/circuitbreaker"
|
14 | 14 |
"github.com/go-kit/kit/endpoint"
|
1 | 1 |
|
2 | 2 |
import (
|
3 | 3 |
"bytes"
|
|
4 |
"context"
|
4 | 5 |
"encoding/json"
|
5 | 6 |
"io/ioutil"
|
6 | 7 |
"net/http"
|
7 | |
|
8 | |
"golang.org/x/net/context"
|
9 | 8 |
|
10 | 9 |
"github.com/go-kit/kit/endpoint"
|
11 | 10 |
)
|
0 | 0 |
package ratelimit
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"errors"
|
4 | 5 |
"time"
|
5 | 6 |
|
6 | 7 |
"github.com/juju/ratelimit"
|
7 | |
"golang.org/x/net/context"
|
8 | 8 |
|
9 | 9 |
"github.com/go-kit/kit/endpoint"
|
10 | 10 |
)
|
0 | 0 |
package ratelimit_test
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"math"
|
4 | 5 |
"testing"
|
5 | 6 |
"time"
|
6 | 7 |
|
7 | 8 |
jujuratelimit "github.com/juju/ratelimit"
|
8 | |
"golang.org/x/net/context"
|
9 | 9 |
|
10 | 10 |
"github.com/go-kit/kit/endpoint"
|
11 | 11 |
"github.com/go-kit/kit/ratelimit"
|
0 | 0 |
package consul
|
1 | 1 |
|
2 | |
import consul "github.com/hashicorp/consul/api"
|
|
2 |
import (
|
|
3 |
consul "github.com/hashicorp/consul/api"
|
|
4 |
)
|
3 | 5 |
|
4 | 6 |
// Client is a wrapper around the Consul API.
|
5 | 7 |
type Client interface {
|
0 | 0 |
package consul
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"errors"
|
4 | 5 |
"io"
|
5 | 6 |
"reflect"
|
6 | 7 |
"testing"
|
7 | 8 |
|
8 | 9 |
stdconsul "github.com/hashicorp/consul/api"
|
9 | |
"golang.org/x/net/context"
|
10 | 10 |
|
11 | 11 |
"github.com/go-kit/kit/endpoint"
|
12 | 12 |
)
|
0 | 0 |
package consul
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"testing"
|
4 | 5 |
|
5 | 6 |
consul "github.com/hashicorp/consul/api"
|
6 | |
"golang.org/x/net/context"
|
7 | 7 |
|
8 | 8 |
"github.com/go-kit/kit/log"
|
9 | 9 |
)
|
0 | 0 |
package etcd
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"crypto/tls"
|
4 | 5 |
"crypto/x509"
|
5 | 6 |
"errors"
|
|
9 | 10 |
"time"
|
10 | 11 |
|
11 | 12 |
etcd "github.com/coreos/etcd/client"
|
12 | |
"golang.org/x/net/context"
|
13 | 13 |
)
|
14 | 14 |
|
15 | 15 |
var (
|
0 | 0 |
package etcd
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"errors"
|
4 | 5 |
"reflect"
|
5 | 6 |
"testing"
|
6 | 7 |
"time"
|
7 | 8 |
|
8 | 9 |
etcd "github.com/coreos/etcd/client"
|
9 | |
"golang.org/x/net/context"
|
10 | 10 |
)
|
11 | 11 |
|
12 | 12 |
func TestNewClient(t *testing.T) {
|
0 | 0 |
package etcd
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"io"
|
4 | 5 |
"time"
|
5 | |
|
6 | |
"golang.org/x/net/context"
|
7 | 6 |
|
8 | 7 |
"github.com/go-kit/kit/endpoint"
|
9 | 8 |
"github.com/go-kit/kit/log"
|
2 | 2 |
package etcd
|
3 | 3 |
|
4 | 4 |
import (
|
|
5 |
"context"
|
5 | 6 |
"io"
|
6 | 7 |
"os"
|
7 | 8 |
"testing"
|
8 | 9 |
"time"
|
9 | |
|
10 | |
"golang.org/x/net/context"
|
11 | 10 |
|
12 | 11 |
"github.com/go-kit/kit/endpoint"
|
13 | 12 |
"github.com/go-kit/kit/log"
|
0 | 0 |
package lb
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"math"
|
4 | 5 |
"testing"
|
5 | 6 |
|
6 | 7 |
"github.com/go-kit/kit/endpoint"
|
7 | 8 |
"github.com/go-kit/kit/sd"
|
8 | |
"golang.org/x/net/context"
|
9 | 9 |
)
|
10 | 10 |
|
11 | 11 |
func TestRandom(t *testing.T) {
|
0 | 0 |
package lb
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"fmt"
|
4 | 5 |
"strings"
|
5 | 6 |
"time"
|
6 | |
|
7 | |
"golang.org/x/net/context"
|
8 | 7 |
|
9 | 8 |
"github.com/go-kit/kit/endpoint"
|
10 | 9 |
)
|
0 | 0 |
package lb_test
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"errors"
|
4 | 5 |
"testing"
|
5 | 6 |
"time"
|
6 | |
|
7 | |
"golang.org/x/net/context"
|
8 | 7 |
|
9 | 8 |
"github.com/go-kit/kit/endpoint"
|
10 | 9 |
"github.com/go-kit/kit/sd"
|
0 | 0 |
package lb
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"reflect"
|
4 | 5 |
"sync"
|
5 | 6 |
"sync/atomic"
|
6 | 7 |
"testing"
|
7 | 8 |
"time"
|
8 | |
|
9 | |
"golang.org/x/net/context"
|
10 | 9 |
|
11 | 10 |
"github.com/go-kit/kit/endpoint"
|
12 | 11 |
"github.com/go-kit/kit/sd"
|
0 | 0 |
package zk
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"errors"
|
4 | 5 |
"fmt"
|
5 | 6 |
"io"
|
|
7 | 8 |
"time"
|
8 | 9 |
|
9 | 10 |
"github.com/samuel/go-zookeeper/zk"
|
10 | |
"golang.org/x/net/context"
|
11 | 11 |
|
12 | 12 |
"github.com/go-kit/kit/endpoint"
|
13 | 13 |
"github.com/go-kit/kit/log"
|
0 | 0 |
package opentracing
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
|
4 |
|
3 | 5 |
"github.com/opentracing/opentracing-go"
|
4 | 6 |
otext "github.com/opentracing/opentracing-go/ext"
|
5 | |
"golang.org/x/net/context"
|
6 | 7 |
|
7 | 8 |
"github.com/go-kit/kit/endpoint"
|
8 | 9 |
)
|
0 | 0 |
package opentracing_test
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"testing"
|
4 | 5 |
|
5 | 6 |
"github.com/opentracing/opentracing-go"
|
6 | 7 |
"github.com/opentracing/opentracing-go/mocktracer"
|
7 | |
"golang.org/x/net/context"
|
8 | 8 |
|
9 | 9 |
"github.com/go-kit/kit/endpoint"
|
10 | 10 |
kitot "github.com/go-kit/kit/tracing/opentracing"
|
0 | 0 |
package opentracing
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"encoding/base64"
|
4 | 5 |
"strings"
|
5 | 6 |
|
6 | 7 |
"github.com/opentracing/opentracing-go"
|
7 | 8 |
"github.com/opentracing/opentracing-go/ext"
|
8 | |
"golang.org/x/net/context"
|
9 | 9 |
"google.golang.org/grpc/metadata"
|
10 | 10 |
|
11 | 11 |
"github.com/go-kit/kit/log"
|
0 | 0 |
package opentracing_test
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"testing"
|
4 | 5 |
|
5 | 6 |
"github.com/opentracing/opentracing-go"
|
6 | 7 |
"github.com/opentracing/opentracing-go/mocktracer"
|
7 | |
"golang.org/x/net/context"
|
8 | 8 |
"google.golang.org/grpc/metadata"
|
9 | 9 |
|
10 | 10 |
"github.com/go-kit/kit/log"
|
0 | 0 |
package opentracing
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"net"
|
4 | 5 |
"net/http"
|
5 | 6 |
"strconv"
|
6 | 7 |
|
7 | 8 |
"github.com/opentracing/opentracing-go"
|
8 | 9 |
"github.com/opentracing/opentracing-go/ext"
|
9 | |
"golang.org/x/net/context"
|
10 | 10 |
|
11 | 11 |
"github.com/go-kit/kit/log"
|
12 | 12 |
kithttp "github.com/go-kit/kit/transport/http"
|
0 | 0 |
package opentracing_test
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"net/http"
|
4 | 5 |
"reflect"
|
5 | 6 |
"testing"
|
|
7 | 8 |
"github.com/opentracing/opentracing-go"
|
8 | 9 |
"github.com/opentracing/opentracing-go/ext"
|
9 | 10 |
"github.com/opentracing/opentracing-go/mocktracer"
|
10 | |
"golang.org/x/net/context"
|
11 | 11 |
|
12 | 12 |
"github.com/go-kit/kit/log"
|
13 | 13 |
kitot "github.com/go-kit/kit/tracing/opentracing"
|
0 | 0 |
package grpc
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"fmt"
|
4 | 5 |
"reflect"
|
5 | 6 |
"strings"
|
6 | 7 |
|
7 | |
"golang.org/x/net/context"
|
8 | 8 |
"google.golang.org/grpc"
|
9 | 9 |
"google.golang.org/grpc/metadata"
|
10 | 10 |
|
0 | 0 |
package grpc
|
1 | 1 |
|
2 | |
import "golang.org/x/net/context"
|
|
2 |
import (
|
|
3 |
"context"
|
|
4 |
)
|
3 | 5 |
|
4 | 6 |
// DecodeRequestFunc extracts a user-domain request object from a gRPC request.
|
5 | 7 |
// It's designed to be used in gRPC servers, for server-side endpoints. One
|
0 | 0 |
package grpc
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"encoding/base64"
|
4 | 5 |
"strings"
|
5 | 6 |
|
6 | |
"golang.org/x/net/context"
|
7 | 7 |
"google.golang.org/grpc/metadata"
|
8 | 8 |
)
|
9 | 9 |
|
0 | 0 |
package grpc
|
1 | 1 |
|
2 | 2 |
import (
|
3 | |
"golang.org/x/net/context"
|
|
3 |
"context"
|
|
4 |
|
4 | 5 |
"google.golang.org/grpc/metadata"
|
5 | 6 |
|
6 | 7 |
"github.com/go-kit/kit/endpoint"
|
1 | 1 |
|
2 | 2 |
import (
|
3 | 3 |
"bytes"
|
|
4 |
"context"
|
4 | 5 |
"encoding/json"
|
5 | 6 |
"io/ioutil"
|
6 | 7 |
"net/http"
|
7 | 8 |
"net/url"
|
8 | 9 |
|
9 | |
"golang.org/x/net/context"
|
10 | 10 |
"golang.org/x/net/context/ctxhttp"
|
11 | 11 |
|
12 | 12 |
"github.com/go-kit/kit/endpoint"
|
0 | 0 |
package http_test
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"io"
|
4 | 5 |
"io/ioutil"
|
5 | 6 |
"net/http"
|
|
7 | 8 |
"net/url"
|
8 | 9 |
"testing"
|
9 | 10 |
"time"
|
10 | |
|
11 | |
"golang.org/x/net/context"
|
12 | 11 |
|
13 | 12 |
httptransport "github.com/go-kit/kit/transport/http"
|
14 | 13 |
)
|
0 | 0 |
package http
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"net/http"
|
4 | |
|
5 | |
"golang.org/x/net/context"
|
6 | 5 |
)
|
7 | 6 |
|
8 | 7 |
// DecodeRequestFunc extracts a user-domain request object from an HTTP
|
0 | 0 |
package http
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"fmt"
|
4 | 5 |
"net/http"
|
5 | 6 |
"net/http/httptest"
|
6 | |
|
7 | |
"golang.org/x/net/context"
|
8 | 7 |
)
|
9 | 8 |
|
10 | 9 |
func ExamplePopulateRequestContext() {
|
0 | 0 |
package http
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"net/http"
|
4 | |
|
5 | |
"golang.org/x/net/context"
|
6 | 5 |
)
|
7 | 6 |
|
8 | 7 |
// RequestFunc may take information from an HTTP request and put it into a
|
0 | 0 |
package http_test
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"net/http/httptest"
|
4 | 5 |
"testing"
|
5 | |
|
6 | |
"golang.org/x/net/context"
|
7 | 6 |
|
8 | 7 |
httptransport "github.com/go-kit/kit/transport/http"
|
9 | 8 |
)
|
0 | 0 |
package http
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"encoding/json"
|
4 | 5 |
"net/http"
|
5 | |
|
6 | |
"golang.org/x/net/context"
|
7 | 6 |
|
8 | 7 |
"github.com/go-kit/kit/endpoint"
|
9 | 8 |
"github.com/go-kit/kit/log"
|
0 | 0 |
package http_test
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"errors"
|
4 | 5 |
"io/ioutil"
|
5 | 6 |
"net/http"
|
6 | 7 |
"net/http/httptest"
|
7 | 8 |
"strings"
|
8 | 9 |
"testing"
|
9 | |
|
10 | |
"golang.org/x/net/context"
|
11 | 10 |
|
12 | 11 |
"github.com/go-kit/kit/endpoint"
|
13 | 12 |
httptransport "github.com/go-kit/kit/transport/http"
|
0 | 0 |
package httprp
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"net/http"
|
4 | 5 |
"net/http/httputil"
|
5 | 6 |
"net/url"
|
6 | |
|
7 | |
"golang.org/x/net/context"
|
8 | 7 |
)
|
9 | 8 |
|
10 | 9 |
// RequestFunc may take information from an HTTP request and put it into a
|
0 | 0 |
package httprp_test
|
1 | 1 |
|
2 | 2 |
import (
|
|
3 |
"context"
|
3 | 4 |
"io/ioutil"
|
4 | 5 |
"net/http"
|
5 | 6 |
"net/http/httptest"
|
6 | 7 |
"net/url"
|
7 | 8 |
"testing"
|
8 | |
|
9 | |
"golang.org/x/net/context"
|
10 | 9 |
|
11 | 10 |
httptransport "github.com/go-kit/kit/transport/httprp"
|
12 | 11 |
)
|