Codebase list golang-github-go-kit-kit / 75666f7
Update import paths Peter Bourgon 8 years ago
34 changed file(s) with 65 addition(s) and 65 deletion(s). Raw diff Collapse all Expand all
00 package main
11
22 import (
3 "github.com/peterbourgon/gokit/server"
43 "golang.org/x/net/context"
4
5 "github.com/go-kit/kit/server"
56 )
67
78 // makeEndpoint returns a server.Endpoint wrapping the passed Add. If Add were
22 import (
33 "time"
44
5 "github.com/peterbourgon/gokit/log"
5 "github.com/go-kit/kit/log"
66 )
77
88 func logging(logger log.Logger, add Add) Add {
44
55 "golang.org/x/net/context"
66
7 "github.com/peterbourgon/gokit/addsvc/pb"
8 "github.com/peterbourgon/gokit/metrics"
9 "github.com/peterbourgon/gokit/server"
7 "github.com/go-kit/kit/addsvc/pb"
8 "github.com/go-kit/kit/metrics"
9 "github.com/go-kit/kit/server"
1010 )
1111
1212 // A binding wraps an Endpoint so that it's usable by a transport. grpcBinding
33 "net/http"
44 "time"
55
6 "github.com/peterbourgon/gokit/metrics"
6 "github.com/go-kit/kit/metrics"
77 )
88
99 // HTTP bindings require no service-specific declarations, and so are defined
1818 "golang.org/x/net/context"
1919 "google.golang.org/grpc"
2020
21 thriftadd "github.com/peterbourgon/gokit/addsvc/_thrift/gen-go/add"
22 "github.com/peterbourgon/gokit/addsvc/pb"
23 kitlog "github.com/peterbourgon/gokit/log"
24 "github.com/peterbourgon/gokit/metrics"
25 "github.com/peterbourgon/gokit/metrics/expvar"
26 "github.com/peterbourgon/gokit/metrics/statsd"
27 "github.com/peterbourgon/gokit/server"
28 "github.com/peterbourgon/gokit/tracing/zipkin"
29 jsoncodec "github.com/peterbourgon/gokit/transport/codec/json"
30 httptransport "github.com/peterbourgon/gokit/transport/http"
21 thriftadd "github.com/go-kit/kit/addsvc/_thrift/gen-go/add"
22 "github.com/go-kit/kit/addsvc/pb"
23 kitlog "github.com/go-kit/kit/log"
24 "github.com/go-kit/kit/metrics"
25 "github.com/go-kit/kit/metrics/expvar"
26 "github.com/go-kit/kit/metrics/statsd"
27 "github.com/go-kit/kit/server"
28 "github.com/go-kit/kit/tracing/zipkin"
29 jsoncodec "github.com/go-kit/kit/transport/codec/json"
30 httptransport "github.com/go-kit/kit/transport/http"
3131 )
3232
3333 func main() {
44
55 "golang.org/x/net/context"
66
7 thriftadd "github.com/peterbourgon/gokit/addsvc/_thrift/gen-go/add"
8 "github.com/peterbourgon/gokit/metrics"
9 "github.com/peterbourgon/gokit/server"
7 thriftadd "github.com/go-kit/kit/addsvc/_thrift/gen-go/add"
8 "github.com/go-kit/kit/metrics"
9 "github.com/go-kit/kit/server"
1010 )
1111
1212 // A binding wraps an Endpoint so that it's usable by a transport.
22 import (
33 "testing"
44
5 "github.com/peterbourgon/gokit/log"
5 "github.com/go-kit/kit/log"
66 )
77
88 func benchmarkRunner(b *testing.B, logger log.Logger, f func(log.Logger)) {
44 "sync"
55 "testing"
66
7 "github.com/peterbourgon/gokit/log"
7 "github.com/go-kit/kit/log"
88 )
99
1010 // These test are designed to be run with the race detector.
55 "io/ioutil"
66 "testing"
77
8 "github.com/peterbourgon/gokit/log"
8 "github.com/go-kit/kit/log"
99 )
1010
1111 func TestJSONLogger(t *testing.T) {
33 "bytes"
44 "testing"
55
6 "github.com/peterbourgon/gokit/log"
6 "github.com/go-kit/kit/log"
77 )
88
99 func TestDefaultLevels(t *testing.T) {
44 "sync"
55 "testing"
66
7 "github.com/peterbourgon/gokit/log"
7 "github.com/go-kit/kit/log"
88 )
99
1010 var discard = log.Logger(log.LoggerFunc(func(...interface{}) error { return nil }))
55 "io/ioutil"
66 "testing"
77
8 "github.com/peterbourgon/gokit/log"
8 "github.com/go-kit/kit/log"
99 )
1010
1111 func TestPrefixLogger(t *testing.T) {
44 "testing"
55 "time"
66
7 "github.com/peterbourgon/gokit/log"
7 "github.com/go-kit/kit/log"
88 )
99
1010 func TestValueBinding(t *testing.T) {
2222 "sync"
2323 "time"
2424
25 "github.com/peterbourgon/gokit/metrics"
25 "github.com/codahale/hdrhistogram"
2626
27 "github.com/codahale/hdrhistogram"
27 "github.com/go-kit/kit/metrics"
2828 )
2929
3030 type counter struct {
44 "fmt"
55 "testing"
66
7 "github.com/peterbourgon/gokit/metrics/expvar"
8 "github.com/peterbourgon/gokit/metrics/teststat"
7 "github.com/go-kit/kit/metrics/expvar"
8 "github.com/go-kit/kit/metrics/teststat"
99 )
1010
1111 func TestHistogramQuantiles(t *testing.T) {
1414
1515 stdprometheus "github.com/prometheus/client_golang/prometheus"
1616
17 "github.com/peterbourgon/gokit/metrics"
18 "github.com/peterbourgon/gokit/metrics/expvar"
19 "github.com/peterbourgon/gokit/metrics/prometheus"
17 "github.com/go-kit/kit/metrics"
18 "github.com/go-kit/kit/metrics/expvar"
19 "github.com/go-kit/kit/metrics/prometheus"
2020 )
2121
2222 func TestMultiWith(t *testing.T) {
33 import (
44 "github.com/prometheus/client_golang/prometheus"
55
6 "github.com/peterbourgon/gokit/metrics"
6 "github.com/go-kit/kit/metrics"
77 )
88
99 // Prometheus has strong opinions about the dimensionality of fields. Users
55
66 stdprometheus "github.com/prometheus/client_golang/prometheus"
77
8 "github.com/peterbourgon/gokit/metrics"
9 "github.com/peterbourgon/gokit/metrics/prometheus"
10 "github.com/peterbourgon/gokit/metrics/teststat"
8 "github.com/go-kit/kit/metrics"
9 "github.com/go-kit/kit/metrics/prometheus"
10 "github.com/go-kit/kit/metrics/teststat"
1111 )
1212
1313 func TestPrometheusLabelBehavior(t *testing.T) {
22 import (
33 "testing"
44
5 "github.com/peterbourgon/gokit/metrics"
6 "github.com/peterbourgon/gokit/metrics/expvar"
5 "github.com/go-kit/kit/metrics"
6 "github.com/go-kit/kit/metrics/expvar"
77 )
88
99 func TestScaledHistogram(t *testing.T) {
1818 "log"
1919 "time"
2020
21 "github.com/peterbourgon/gokit/metrics"
21 "github.com/go-kit/kit/metrics"
2222 )
2323
2424 // statsd metrics take considerable influence from
66 "math/rand"
77 "testing"
88
9 "github.com/peterbourgon/gokit/metrics"
9 "github.com/go-kit/kit/metrics"
1010 )
1111
1212 const population = 1234
44 "testing"
55 "time"
66
7 "github.com/peterbourgon/gokit/metrics"
8 "github.com/peterbourgon/gokit/metrics/expvar"
7 "github.com/go-kit/kit/metrics"
8 "github.com/go-kit/kit/metrics/expvar"
99 )
1010
1111 func TestTimeHistogram(t *testing.T) {
1414 - Package metrics SHALL implement Gauges, Counters, and Histograms.
1515
1616 - Each metric type SHALL allow observations with an unlimited number of key/value field pairs,
17 similar to [package log](https://github.com/peterbourgon/gokit/blob/master/rfc/rfc004-package-log.md).
17 similar to [package log](https://github.com/go-kit/kit/blob/master/rfc/rfc004-package-log.md).
1818
1919 - Counter SHALL be an increment-only counter of type uint64.
2020
3434
3535 ## Implementation
3636
37 https://github.com/peterbourgon/gokit/tree/master/metrics
37 https://github.com/go-kit/kit/tree/master/metrics
3838
3939 ### Gauge
4040
99
1010 "github.com/apache/thrift/lib/go/thrift"
1111
12 "github.com/peterbourgon/gokit/log"
13 "github.com/peterbourgon/gokit/tracing/zipkin/_thrift/gen-go/scribe"
12 "github.com/go-kit/kit/log"
13 "github.com/go-kit/kit/tracing/zipkin/_thrift/gen-go/scribe"
1414 )
1515
1616 // Collector represents a Zipkin trace collector, which is probably a set of
1010
1111 "github.com/apache/thrift/lib/go/thrift"
1212
13 "github.com/peterbourgon/gokit/tracing/zipkin"
14 "github.com/peterbourgon/gokit/tracing/zipkin/_thrift/gen-go/scribe"
15 "github.com/peterbourgon/gokit/tracing/zipkin/_thrift/gen-go/zipkincore"
13 "github.com/go-kit/kit/tracing/zipkin"
14 "github.com/go-kit/kit/tracing/zipkin/_thrift/gen-go/scribe"
15 "github.com/go-kit/kit/tracing/zipkin/_thrift/gen-go/zipkincore"
1616 )
1717
1818 func TestScribeCollector(t *testing.T) {
33 "errors"
44 "time"
55
6 "github.com/peterbourgon/gokit/tracing/zipkin/_thrift/gen-go/zipkincore"
6 "github.com/go-kit/kit/tracing/zipkin/_thrift/gen-go/zipkincore"
77 )
88
99 var (
66
77 "golang.org/x/net/context"
88
9 "github.com/peterbourgon/gokit/server"
9 "github.com/go-kit/kit/server"
1010 )
1111
1212 // http://www.slideshare.net/johanoskarsson/zipkin-runtime-open-house
66 "sync/atomic"
77 "testing"
88
9 "github.com/peterbourgon/gokit/server"
10
119 "golang.org/x/net/context"
1210
13 "github.com/peterbourgon/gokit/tracing/zipkin"
11 "github.com/go-kit/kit/server"
12 "github.com/go-kit/kit/tracing/zipkin"
1413 )
1514
1615 func TestAnnotateEndpoint(t *testing.T) {
44
55 "golang.org/x/net/context"
66
7 "github.com/peterbourgon/gokit/server"
7 "github.com/go-kit/kit/server"
88 )
99
1010 // Codec defines how to decode and encode requests and responses. Decode takes
55
66 "golang.org/x/net/context"
77
8 "github.com/peterbourgon/gokit/server"
9 "github.com/peterbourgon/gokit/transport/codec"
8 "github.com/go-kit/kit/server"
9 "github.com/go-kit/kit/transport/codec"
1010 )
1111
1212 type jsonCodec struct{}
55
66 "golang.org/x/net/context"
77
8 jsoncodec "github.com/peterbourgon/gokit/transport/codec/json"
8 jsoncodec "github.com/go-kit/kit/transport/codec/json"
99 )
1010
1111 type request struct {
55
66 "golang.org/x/net/context"
77
8 "github.com/peterbourgon/gokit/server"
9 "github.com/peterbourgon/gokit/transport/codec"
8 "github.com/go-kit/kit/server"
9 "github.com/go-kit/kit/transport/codec"
1010 )
1111
1212 // BindingOption sets a parameter for the binding.
1010
1111 "golang.org/x/net/context"
1212
13 "github.com/peterbourgon/gokit/server"
14 jsoncodec "github.com/peterbourgon/gokit/transport/codec/json"
15 httptransport "github.com/peterbourgon/gokit/transport/http"
13 "github.com/go-kit/kit/server"
14 jsoncodec "github.com/go-kit/kit/transport/codec/json"
15 httptransport "github.com/go-kit/kit/transport/http"
1616 )
1717
1818 func TestBinding(t *testing.T) {
1212 }
1313
1414 function not_gokit {
15 grep -v 'peterbourgon/gokit'
15 grep -v 'go-kit/kit'
1616 }
1717
1818 function go_get_update {