Merge pull request #653 from micro/tunnel
Add back the old tunnel interface
This commit is contained in:
		| @@ -1,6 +1,5 @@ | |||||||
| language: go | language: go | ||||||
| go: | go: | ||||||
| - 1.11.x |  | ||||||
| - 1.12.x | - 1.12.x | ||||||
| env: | env: | ||||||
|   - GO111MODULE=on |   - GO111MODULE=on | ||||||
|   | |||||||
							
								
								
									
										46
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										46
									
								
								go.mod
									
									
									
									
									
								
							| @@ -3,8 +3,9 @@ module github.com/micro/go-micro | |||||||
| go 1.12 | go 1.12 | ||||||
|  |  | ||||||
| require ( | require ( | ||||||
| 	cloud.google.com/go v0.41.0 // indirect | 	cloud.google.com/go v0.43.0 // indirect | ||||||
| 	github.com/BurntSushi/toml v0.3.1 | 	github.com/BurntSushi/toml v0.3.1 | ||||||
|  | 	github.com/Microsoft/go-winio v0.4.14 // indirect | ||||||
| 	github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect | 	github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect | ||||||
| 	github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect | 	github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect | ||||||
| 	github.com/armon/go-radix v1.0.0 // indirect | 	github.com/armon/go-radix v1.0.0 // indirect | ||||||
| @@ -14,17 +15,16 @@ require ( | |||||||
| 	github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc // indirect | 	github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc // indirect | ||||||
| 	github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c | 	github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c | ||||||
| 	github.com/fsnotify/fsnotify v1.4.7 | 	github.com/fsnotify/fsnotify v1.4.7 | ||||||
| 	github.com/fsouza/go-dockerclient v1.4.1 | 	github.com/fsouza/go-dockerclient v1.4.2 | ||||||
| 	github.com/ghodss/yaml v1.0.0 | 	github.com/ghodss/yaml v1.0.0 | ||||||
| 	github.com/gliderlabs/ssh v0.2.2 // indirect |  | ||||||
| 	github.com/go-kit/kit v0.9.0 // indirect | 	github.com/go-kit/kit v0.9.0 // indirect | ||||||
| 	github.com/go-log/log v0.1.0 | 	github.com/go-log/log v0.1.0 | ||||||
| 	github.com/go-playground/locales v0.12.1 // indirect | 	github.com/go-playground/locales v0.12.1 // indirect | ||||||
| 	github.com/go-playground/universal-translator v0.16.0 // indirect | 	github.com/go-playground/universal-translator v0.16.0 // indirect | ||||||
| 	github.com/golang/protobuf v1.3.2 | 	github.com/golang/protobuf v1.3.2 | ||||||
|  | 	github.com/google/pprof v0.0.0-20190723021845-34ac40c74b70 // indirect | ||||||
| 	github.com/google/uuid v1.1.1 | 	github.com/google/uuid v1.1.1 | ||||||
| 	github.com/gorilla/handlers v1.4.1 | 	github.com/gorilla/handlers v1.4.2 | ||||||
| 	github.com/gorilla/mux v1.7.3 // indirect |  | ||||||
| 	github.com/gorilla/websocket v1.4.0 | 	github.com/gorilla/websocket v1.4.0 | ||||||
| 	github.com/hashicorp/consul/api v1.1.0 | 	github.com/hashicorp/consul/api v1.1.0 | ||||||
| 	github.com/hashicorp/go-immutable-radix v1.1.0 // indirect | 	github.com/hashicorp/go-immutable-radix v1.1.0 // indirect | ||||||
| @@ -33,19 +33,18 @@ require ( | |||||||
| 	github.com/hashicorp/go-rootcerts v1.0.1 // indirect | 	github.com/hashicorp/go-rootcerts v1.0.1 // indirect | ||||||
| 	github.com/hashicorp/go-sockaddr v1.0.2 // indirect | 	github.com/hashicorp/go-sockaddr v1.0.2 // indirect | ||||||
| 	github.com/hashicorp/go-version v1.2.0 // indirect | 	github.com/hashicorp/go-version v1.2.0 // indirect | ||||||
|  | 	github.com/hashicorp/golang-lru v0.5.3 // indirect | ||||||
| 	github.com/hashicorp/hcl v1.0.0 | 	github.com/hashicorp/hcl v1.0.0 | ||||||
| 	github.com/hashicorp/mdns v1.0.1 // indirect | 	github.com/hashicorp/mdns v1.0.1 // indirect | ||||||
| 	github.com/hashicorp/memberlist v0.1.4 | 	github.com/hashicorp/memberlist v0.1.4 | ||||||
| 	github.com/hashicorp/serf v0.8.3 // indirect | 	github.com/hashicorp/serf v0.8.3 // indirect | ||||||
| 	github.com/imdario/mergo v0.3.7 | 	github.com/imdario/mergo v0.3.7 | ||||||
| 	github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1 | 	github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1 | ||||||
| 	github.com/json-iterator/go v1.1.6 | 	github.com/json-iterator/go v1.1.7 | ||||||
| 	github.com/kevinburke/ssh_config v0.0.0-20190630040420-2e50c441276c // indirect |  | ||||||
| 	github.com/kisielk/errcheck v1.2.0 // indirect | 	github.com/kisielk/errcheck v1.2.0 // indirect | ||||||
| 	github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect | 	github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect | ||||||
| 	github.com/kr/pty v1.1.8 // indirect |  | ||||||
| 	github.com/leodido/go-urn v1.1.0 // indirect | 	github.com/leodido/go-urn v1.1.0 // indirect | ||||||
| 	github.com/lucas-clemente/quic-go v0.7.1-0.20190710050138-1441923ab031 | 	github.com/lucas-clemente/quic-go v0.12.0 | ||||||
| 	github.com/mattn/go-colorable v0.1.2 // indirect | 	github.com/mattn/go-colorable v0.1.2 // indirect | ||||||
| 	github.com/mattn/go-runewidth v0.0.4 // indirect | 	github.com/mattn/go-runewidth v0.0.4 // indirect | ||||||
| 	github.com/micro/cli v0.2.0 | 	github.com/micro/cli v0.2.0 | ||||||
| @@ -53,6 +52,9 @@ require ( | |||||||
| 	github.com/miekg/dns v1.1.15 // indirect | 	github.com/miekg/dns v1.1.15 // indirect | ||||||
| 	github.com/mitchellh/gox v1.0.1 // indirect | 	github.com/mitchellh/gox v1.0.1 // indirect | ||||||
| 	github.com/mitchellh/hashstructure v1.0.0 | 	github.com/mitchellh/hashstructure v1.0.0 | ||||||
|  | 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||||||
|  | 	github.com/modern-go/reflect2 v1.0.1 // indirect | ||||||
|  | 	github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect | ||||||
| 	github.com/nats-io/nats.go v1.8.1 | 	github.com/nats-io/nats.go v1.8.1 | ||||||
| 	github.com/nats-io/nkeys v0.1.0 // indirect | 	github.com/nats-io/nkeys v0.1.0 // indirect | ||||||
| 	github.com/nlopes/slack v0.5.0 | 	github.com/nlopes/slack v0.5.0 | ||||||
| @@ -61,24 +63,18 @@ require ( | |||||||
| 	github.com/onsi/gomega v1.5.0 // indirect | 	github.com/onsi/gomega v1.5.0 // indirect | ||||||
| 	github.com/pkg/errors v0.8.1 | 	github.com/pkg/errors v0.8.1 | ||||||
| 	github.com/posener/complete v1.2.1 // indirect | 	github.com/posener/complete v1.2.1 // indirect | ||||||
| 	github.com/prometheus/common v0.6.0 // indirect | 	github.com/prometheus/client_golang v1.1.0 // indirect | ||||||
| 	github.com/prometheus/procfs v0.0.3 // indirect |  | ||||||
| 	github.com/sirupsen/logrus v1.4.2 // indirect | 	github.com/sirupsen/logrus v1.4.2 // indirect | ||||||
| 	github.com/stretchr/objx v0.2.0 // indirect |  | ||||||
| 	github.com/technoweenie/multipartstreamer v1.0.1 // indirect | 	github.com/technoweenie/multipartstreamer v1.0.1 // indirect | ||||||
| 	golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 | 	golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 | ||||||
| 	golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f // indirect | 	golang.org/x/mobile v0.0.0-20190806162312-597adff16ade // indirect | ||||||
| 	golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9 // indirect | 	golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 | ||||||
| 	golang.org/x/mobile v0.0.0-20190711165009-e47acb2ca7f9 // indirect | 	golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa // indirect | ||||||
| 	golang.org/x/mod v0.1.0 // indirect | 	golang.org/x/tools v0.0.0-20190807201305-8be58fba6352 // indirect | ||||||
| 	golang.org/x/net v0.0.0-20190628185345-da137c7871d7 | 	google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 // indirect | ||||||
| 	golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542 // indirect | 	google.golang.org/grpc v1.22.1 | ||||||
| 	golang.org/x/tools v0.0.0-20190711191110-9a621aea19f8 // indirect | 	gopkg.in/go-playground/validator.v9 v9.29.1 | ||||||
| 	google.golang.org/genproto v0.0.0-20190708153700-3bdd9d9f5532 // indirect | 	gopkg.in/src-d/go-git.v4 v4.13.1 | ||||||
| 	google.golang.org/grpc v1.22.0 |  | ||||||
| 	gopkg.in/go-playground/validator.v9 v9.29.0 |  | ||||||
| 	gopkg.in/src-d/go-billy.v4 v4.3.1 // indirect |  | ||||||
| 	gopkg.in/src-d/go-git.v4 v4.12.0 |  | ||||||
| 	gopkg.in/telegram-bot-api.v4 v4.6.4 | 	gopkg.in/telegram-bot-api.v4 v4.6.4 | ||||||
| 	honnef.co/go/tools v0.0.0-20190614002413-cb51c254f01b // indirect | 	honnef.co/go/tools v0.0.1-2019.2.2 // indirect | ||||||
| ) | ) | ||||||
|   | |||||||
							
								
								
									
										58
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										58
									
								
								go.sum
									
									
									
									
									
								
							| @@ -3,15 +3,21 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT | |||||||
| cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= | ||||||
| cloud.google.com/go v0.40.0/go.mod h1:Tk58MuI9rbLMKlAjeO/bDnteAx7tX2gJIXw4T5Jwlro= | cloud.google.com/go v0.40.0/go.mod h1:Tk58MuI9rbLMKlAjeO/bDnteAx7tX2gJIXw4T5Jwlro= | ||||||
| cloud.google.com/go v0.41.0/go.mod h1:OauMR7DV8fzvZIl2qg6rkaIhD/vmgk4iwEw/h6ercmg= | cloud.google.com/go v0.41.0/go.mod h1:OauMR7DV8fzvZIl2qg6rkaIhD/vmgk4iwEw/h6ercmg= | ||||||
|  | cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= | ||||||
| github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= | github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= | ||||||
| github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= | github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= | ||||||
| github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= | ||||||
| github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= | ||||||
| github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= | github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= | ||||||
| github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= | github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= | ||||||
|  | github.com/Microsoft/go-winio v0.4.13/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= | ||||||
|  | github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= | ||||||
|  | github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= | ||||||
| github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= | github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= | ||||||
| github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= | ||||||
|  | github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= | ||||||
| github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= | ||||||
|  | github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= | ||||||
| github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= | github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= | ||||||
| github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= | github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= | ||||||
| github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= | github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= | ||||||
| @@ -26,6 +32,7 @@ github.com/beevik/ntp v0.2.0 h1:sGsd+kAXzT0bfVfzJfce04g+dSRfrs+tbQW8lweuYgw= | |||||||
| github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= | github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= | ||||||
| github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= | ||||||
| github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= | github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= | ||||||
|  | github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= | ||||||
| github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= | github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= | ||||||
| github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= | github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= | ||||||
| github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= | github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= | ||||||
| @@ -43,8 +50,12 @@ github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL | |||||||
| github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= | github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= | ||||||
| github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||||||
| github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||||||
|  | github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= | ||||||
|  | github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= | ||||||
| github.com/docker/docker v0.7.3-0.20190309235953-33c3200e0d16 h1:dmUn0SuGx7unKFwxyeQ/oLUHhEfZosEDrpmYM+6MTuc= | github.com/docker/docker v0.7.3-0.20190309235953-33c3200e0d16 h1:dmUn0SuGx7unKFwxyeQ/oLUHhEfZosEDrpmYM+6MTuc= | ||||||
| github.com/docker/docker v0.7.3-0.20190309235953-33c3200e0d16/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= | github.com/docker/docker v0.7.3-0.20190309235953-33c3200e0d16/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= | ||||||
|  | github.com/docker/docker v1.4.2-0.20190710153559-aa8249ae1b8b h1:+Ga+YpCDpcY1fln6GI0fiiirpqHGcob5/Vk3oKNuGdU= | ||||||
|  | github.com/docker/docker v1.4.2-0.20190710153559-aa8249ae1b8b/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= | ||||||
| github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= | github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= | ||||||
| github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= | github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= | ||||||
| github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= | github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= | ||||||
| @@ -61,6 +72,8 @@ github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV | |||||||
| github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= | ||||||
| github.com/fsouza/go-dockerclient v1.4.1 h1:W7wuJ3IB48WYZv/UBk9dCTIb9oX805+L9KIm65HcUYs= | github.com/fsouza/go-dockerclient v1.4.1 h1:W7wuJ3IB48WYZv/UBk9dCTIb9oX805+L9KIm65HcUYs= | ||||||
| github.com/fsouza/go-dockerclient v1.4.1/go.mod h1:PUNHxbowDqRXfRgZqMz1OeGtbWC6VKyZvJ99hDjB0qs= | github.com/fsouza/go-dockerclient v1.4.1/go.mod h1:PUNHxbowDqRXfRgZqMz1OeGtbWC6VKyZvJ99hDjB0qs= | ||||||
|  | github.com/fsouza/go-dockerclient v1.4.2 h1:dl6GfIWS5Qn4C6OfSnnoe6YuOV8lvKAE8W/YD1Q7udo= | ||||||
|  | github.com/fsouza/go-dockerclient v1.4.2/go.mod h1:COunfLZrsdwX/j3YVDAG8gIw3KutrI0x1+vGEJ5zxdI= | ||||||
| github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= | github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= | ||||||
| github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= | github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= | ||||||
| github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= | github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= | ||||||
| @@ -96,9 +109,11 @@ github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= | |||||||
| github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= | ||||||
| github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= | ||||||
| github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= | ||||||
|  | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= | ||||||
| github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= | ||||||
| github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= | ||||||
| github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= | ||||||
|  | github.com/google/pprof v0.0.0-20190723021845-34ac40c74b70/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= | ||||||
| github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= | ||||||
| github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= | github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= | ||||||
| github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | ||||||
| @@ -108,6 +123,8 @@ github.com/gorilla/handlers v1.4.0 h1:XulKRWSQK5uChr4pEgSE4Tc/OcmnU9GJuSwdog/tZs | |||||||
| github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= | github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= | ||||||
| github.com/gorilla/handlers v1.4.1 h1:BHvcRGJe/TrL+OqFxoKQGddTgeibiOjaBssV5a/N9sw= | github.com/gorilla/handlers v1.4.1 h1:BHvcRGJe/TrL+OqFxoKQGddTgeibiOjaBssV5a/N9sw= | ||||||
| github.com/gorilla/handlers v1.4.1/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= | github.com/gorilla/handlers v1.4.1/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= | ||||||
|  | github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg= | ||||||
|  | github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= | ||||||
| github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= | github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= | ||||||
| github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= | github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= | ||||||
| github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= | github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= | ||||||
| @@ -150,6 +167,8 @@ github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCO | |||||||
| github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= | ||||||
| github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= | github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= | ||||||
| github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= | ||||||
|  | github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= | ||||||
|  | github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= | ||||||
| github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= | github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= | ||||||
| github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= | github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= | ||||||
| github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= | github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= | ||||||
| @@ -174,12 +193,16 @@ github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1 h1:lnrOS18wZBYrzdD | |||||||
| github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1/go.mod h1:DFXrEwSRX0p/aSvxE21319menCBFeQO0jXpRj7LEZUA= | github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1/go.mod h1:DFXrEwSRX0p/aSvxE21319menCBFeQO0jXpRj7LEZUA= | ||||||
| github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= | github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= | ||||||
| github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= | ||||||
|  | github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= | ||||||
|  | github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= | ||||||
| github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= | ||||||
| github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= | ||||||
| github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e h1:RgQk53JHp/Cjunrr1WlsXSZpqXn+uREuHvUVcK82CV8= | github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e h1:RgQk53JHp/Cjunrr1WlsXSZpqXn+uREuHvUVcK82CV8= | ||||||
| github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= | github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= | ||||||
| github.com/kevinburke/ssh_config v0.0.0-20190630040420-2e50c441276c h1:VAx3LRNjVNvjtgO7KFRuT/3aye/0zJvwn01rHSfoolo= | github.com/kevinburke/ssh_config v0.0.0-20190630040420-2e50c441276c h1:VAx3LRNjVNvjtgO7KFRuT/3aye/0zJvwn01rHSfoolo= | ||||||
| github.com/kevinburke/ssh_config v0.0.0-20190630040420-2e50c441276c/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= | github.com/kevinburke/ssh_config v0.0.0-20190630040420-2e50c441276c/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= | ||||||
|  | github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= | ||||||
|  | github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= | ||||||
| github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= | ||||||
| github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= | 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/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= | ||||||
| @@ -197,6 +220,8 @@ github.com/lucas-clemente/quic-go v0.7.1-0.20190710050138-1441923ab031 h1:wjcGvg | |||||||
| github.com/lucas-clemente/quic-go v0.7.1-0.20190710050138-1441923ab031/go.mod h1:lb5aAxL68VvhZ00e7yYuQVK/9FLggtYy4qo7oI5qzqA= | github.com/lucas-clemente/quic-go v0.7.1-0.20190710050138-1441923ab031/go.mod h1:lb5aAxL68VvhZ00e7yYuQVK/9FLggtYy4qo7oI5qzqA= | ||||||
| github.com/lucas-clemente/quic-go v0.11.2 h1:Mop0ac3zALaBR3wGs6j8OYe/tcFvFsxTUFMkE/7yUOI= | github.com/lucas-clemente/quic-go v0.11.2 h1:Mop0ac3zALaBR3wGs6j8OYe/tcFvFsxTUFMkE/7yUOI= | ||||||
| github.com/lucas-clemente/quic-go v0.11.2/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw= | github.com/lucas-clemente/quic-go v0.11.2/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw= | ||||||
|  | github.com/lucas-clemente/quic-go v0.12.0 h1:dYHUyB50gEQlK3KqytmNySzuyzAcaQ3iuI2ZReAfVrE= | ||||||
|  | github.com/lucas-clemente/quic-go v0.12.0/go.mod h1:UXJJPE4RfFef/xPO5wQm0tITK8gNfqwTxjbE7s3Vb8s= | ||||||
| github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= | github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= | ||||||
| github.com/marten-seemann/qtls v0.2.3 h1:0yWJ43C62LsZt08vuQJDK1uC1czUc3FJeCLPoNAI4vA= | github.com/marten-seemann/qtls v0.2.3 h1:0yWJ43C62LsZt08vuQJDK1uC1czUc3FJeCLPoNAI4vA= | ||||||
| github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= | github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= | ||||||
| @@ -204,6 +229,8 @@ github.com/marten-seemann/qtls v0.2.4 h1:mCJ6i1jAqcsm9XODrSGvXECodoAb1STta+TkxJC | |||||||
| github.com/marten-seemann/qtls v0.2.4/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= | github.com/marten-seemann/qtls v0.2.4/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= | ||||||
| github.com/marten-seemann/qtls v0.3.1 h1:ySYIvhFjFY2JsNHY6VACvomMEDy3EvdPA6yciUFAiHw= | github.com/marten-seemann/qtls v0.3.1 h1:ySYIvhFjFY2JsNHY6VACvomMEDy3EvdPA6yciUFAiHw= | ||||||
| github.com/marten-seemann/qtls v0.3.1/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= | github.com/marten-seemann/qtls v0.3.1/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= | ||||||
|  | github.com/marten-seemann/qtls v0.3.2 h1:O7awy4bHEzSX/K3h+fZig3/Vo03s/RxlxgsAk9sYamI= | ||||||
|  | github.com/marten-seemann/qtls v0.3.2/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= | ||||||
| github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= | github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= | ||||||
| github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= | github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= | ||||||
| github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= | github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= | ||||||
| @@ -241,11 +268,14 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu | |||||||
| github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= | github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= | ||||||
| github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= | github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= | ||||||
| github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= | ||||||
|  | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | ||||||
| github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= | ||||||
| github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | ||||||
|  | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= | ||||||
| github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= | github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= | ||||||
| github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= | ||||||
| github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= | ||||||
|  | github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= | ||||||
| github.com/nats-io/nats.go v1.8.1 h1:6lF/f1/NN6kzUDBz6pyvQDEXO39jqXcWRLu/tKjtOUQ= | github.com/nats-io/nats.go v1.8.1 h1:6lF/f1/NN6kzUDBz6pyvQDEXO39jqXcWRLu/tKjtOUQ= | ||||||
| github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= | github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= | ||||||
| github.com/nats-io/nkeys v0.0.2 h1:+qM7QpgXnvDDixitZtQUBDY9w/s9mu1ghS+JIbsrx6M= | github.com/nats-io/nkeys v0.0.2 h1:+qM7QpgXnvDDixitZtQUBDY9w/s9mu1ghS+JIbsrx6M= | ||||||
| @@ -282,6 +312,7 @@ github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DK | |||||||
| github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= | ||||||
| github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= | github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= | ||||||
| github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= | github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= | ||||||
|  | github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= | ||||||
| github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= | ||||||
| github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= | github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= | ||||||
| github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= | github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= | ||||||
| @@ -301,6 +332,7 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm | |||||||
| github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= | ||||||
| github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME= | github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME= | ||||||
| github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= | github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= | ||||||
|  | github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= | ||||||
| github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= | github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= | ||||||
| github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= | github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= | ||||||
| github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4= | github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4= | ||||||
| @@ -339,9 +371,11 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL | |||||||
| golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= | ||||||
| golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= | ||||||
| golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= | golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= | ||||||
|  | golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= | ||||||
| golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= | ||||||
| golang.org/x/image v0.0.0-20190618124811-92942e4437e2/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= | golang.org/x/image v0.0.0-20190618124811-92942e4437e2/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= | ||||||
| golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= | golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= | ||||||
|  | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= | ||||||
| golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= | 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/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= | ||||||
| golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= | ||||||
| @@ -350,6 +384,7 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl | |||||||
| golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= | ||||||
| golang.org/x/mobile v0.0.0-20190607214518-6fa95d984e88/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= | golang.org/x/mobile v0.0.0-20190607214518-6fa95d984e88/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= | ||||||
| golang.org/x/mobile v0.0.0-20190711165009-e47acb2ca7f9/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= | golang.org/x/mobile v0.0.0-20190711165009-e47acb2ca7f9/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= | ||||||
|  | golang.org/x/mobile v0.0.0-20190806162312-597adff16ade/go.mod h1:AlhUtkH4DA4asiFC5RgK7ZKmauvtkAVcy9L0epCzlWo= | ||||||
| golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= | ||||||
| golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= | ||||||
| golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||||||
| @@ -375,6 +410,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwL | |||||||
| golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||||
| golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU= | golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU= | ||||||
| golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||||
|  | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk= | ||||||
|  | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/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/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= | ||||||
| golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | ||||||
| golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | ||||||
| @@ -408,6 +445,10 @@ golang.org/x/sys v0.0.0-20190621062556-bf70e4678053/go.mod h1:h1NjWce9XRLGQEsW7w | |||||||
| golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||||
| golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542 h1:6ZQFf1D2YYDDI7eSwW8adlkkavTB9sw5I24FVtEvNUQ= | golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542 h1:6ZQFf1D2YYDDI7eSwW8adlkkavTB9sw5I24FVtEvNUQ= | ||||||
| golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||||
|  | golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||||
|  | golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||||
|  | golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa h1:KIDDMLT1O0Nr7TSxp8xM5tJcdn8tgyAONntO829og1M= | ||||||
|  | golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||||
| golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= | ||||||
| golang.org/x/text v0.3.0/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.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||||||
| @@ -429,9 +470,14 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn | |||||||
| golang.org/x/tools v0.0.0-20190530171427-2b03ca6e44eb/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | golang.org/x/tools v0.0.0-20190530171427-2b03ca6e44eb/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | ||||||
| golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | ||||||
| golang.org/x/tools v0.0.0-20190620191750-1fa568393b23/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | golang.org/x/tools v0.0.0-20190620191750-1fa568393b23/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | ||||||
|  | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | ||||||
| golang.org/x/tools v0.0.0-20190624190245-7f2218787638/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | golang.org/x/tools v0.0.0-20190624190245-7f2218787638/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | ||||||
|  | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | ||||||
| golang.org/x/tools v0.0.0-20190710184609-286818132824/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= | golang.org/x/tools v0.0.0-20190710184609-286818132824/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= | ||||||
| golang.org/x/tools v0.0.0-20190711191110-9a621aea19f8/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= | golang.org/x/tools v0.0.0-20190711191110-9a621aea19f8/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= | ||||||
|  | golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= | ||||||
|  | golang.org/x/tools v0.0.0-20190807201305-8be58fba6352/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||||||
|  | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||||
| google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= | ||||||
| google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= | google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= | ||||||
| google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= | ||||||
| @@ -452,12 +498,17 @@ google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dT | |||||||
| google.golang.org/genproto v0.0.0-20190626174449-989357319d63/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= | google.golang.org/genproto v0.0.0-20190626174449-989357319d63/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= | ||||||
| google.golang.org/genproto v0.0.0-20190708153700-3bdd9d9f5532 h1:5pOB7se0B2+IssELuQUs6uoBgYJenkU2AQlvopc2sRw= | google.golang.org/genproto v0.0.0-20190708153700-3bdd9d9f5532 h1:5pOB7se0B2+IssELuQUs6uoBgYJenkU2AQlvopc2sRw= | ||||||
| google.golang.org/genproto v0.0.0-20190708153700-3bdd9d9f5532/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= | google.golang.org/genproto v0.0.0-20190708153700-3bdd9d9f5532/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= | ||||||
|  | google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= | ||||||
|  | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 h1:iKtrH9Y8mcbADOP0YFaEMth7OfuHY9xHOwNj4znpM1A= | ||||||
|  | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= | ||||||
| google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= | ||||||
| google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= | ||||||
| google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= | google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= | ||||||
| google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= | ||||||
| google.golang.org/grpc v1.22.0 h1:J0UbZOIrCAl+fpTOf8YLs4dJo8L/owV4LYVtAXQoPkw= | google.golang.org/grpc v1.22.0 h1:J0UbZOIrCAl+fpTOf8YLs4dJo8L/owV4LYVtAXQoPkw= | ||||||
| google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= | google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= | ||||||
|  | google.golang.org/grpc v1.22.1 h1:/7cs52RnTJmD43s3uxzlq2U7nqVTd/37viQwMrMNlOM= | ||||||
|  | google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= | ||||||
| gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= | ||||||
| gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||||||
| gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||||||
| @@ -465,18 +516,24 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= | |||||||
| gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= | ||||||
| gopkg.in/go-playground/validator.v9 v9.29.0 h1:5ofssLNYgAA/inWn6rTZ4juWpRJUwEnXc1LG2IeXwgQ= | gopkg.in/go-playground/validator.v9 v9.29.0 h1:5ofssLNYgAA/inWn6rTZ4juWpRJUwEnXc1LG2IeXwgQ= | ||||||
| gopkg.in/go-playground/validator.v9 v9.29.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= | gopkg.in/go-playground/validator.v9 v9.29.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= | ||||||
|  | gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc= | ||||||
|  | gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= | ||||||
| gopkg.in/src-d/go-billy.v4 v4.2.1 h1:omN5CrMrMcQ+4I8bJ0wEhOBPanIRWzFC953IiXKdYzo= | gopkg.in/src-d/go-billy.v4 v4.2.1 h1:omN5CrMrMcQ+4I8bJ0wEhOBPanIRWzFC953IiXKdYzo= | ||||||
| gopkg.in/src-d/go-billy.v4 v4.2.1/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= | gopkg.in/src-d/go-billy.v4 v4.2.1/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= | ||||||
| gopkg.in/src-d/go-billy.v4 v4.3.0 h1:KtlZ4c1OWbIs4jCv5ZXrTqG8EQocr0g/d4DjNg70aek= | gopkg.in/src-d/go-billy.v4 v4.3.0 h1:KtlZ4c1OWbIs4jCv5ZXrTqG8EQocr0g/d4DjNg70aek= | ||||||
| gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= | gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= | ||||||
| gopkg.in/src-d/go-billy.v4 v4.3.1 h1:OkK1DmefDy1Z6Veu82wdNj/cLpYORhdX4qdaYCPwc7s= | gopkg.in/src-d/go-billy.v4 v4.3.1 h1:OkK1DmefDy1Z6Veu82wdNj/cLpYORhdX4qdaYCPwc7s= | ||||||
| gopkg.in/src-d/go-billy.v4 v4.3.1/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= | gopkg.in/src-d/go-billy.v4 v4.3.1/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= | ||||||
|  | gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg= | ||||||
|  | gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= | ||||||
| gopkg.in/src-d/go-git-fixtures.v3 v3.1.1/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= | gopkg.in/src-d/go-git-fixtures.v3 v3.1.1/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= | ||||||
| gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= | gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= | ||||||
| gopkg.in/src-d/go-git.v4 v4.11.0 h1:cJwWgJ0DXifrNrXM6RGN1Y2yR60Rr1zQ9Q5DX5S9qgU= | gopkg.in/src-d/go-git.v4 v4.11.0 h1:cJwWgJ0DXifrNrXM6RGN1Y2yR60Rr1zQ9Q5DX5S9qgU= | ||||||
| gopkg.in/src-d/go-git.v4 v4.11.0/go.mod h1:Vtut8izDyrM8BUVQnzJ+YvmNcem2J89EmfZYCkLokZk= | gopkg.in/src-d/go-git.v4 v4.11.0/go.mod h1:Vtut8izDyrM8BUVQnzJ+YvmNcem2J89EmfZYCkLokZk= | ||||||
| gopkg.in/src-d/go-git.v4 v4.12.0 h1:CKgvBCJCcdfNnyXPYI4Cp8PaDDAmAPEN0CtfEdEAbd8= | gopkg.in/src-d/go-git.v4 v4.12.0 h1:CKgvBCJCcdfNnyXPYI4Cp8PaDDAmAPEN0CtfEdEAbd8= | ||||||
| gopkg.in/src-d/go-git.v4 v4.12.0/go.mod h1:zjlNnzc1Wjn43v3Mtii7RVxiReNP0fIu9npcXKzuNp4= | gopkg.in/src-d/go-git.v4 v4.12.0/go.mod h1:zjlNnzc1Wjn43v3Mtii7RVxiReNP0fIu9npcXKzuNp4= | ||||||
|  | gopkg.in/src-d/go-git.v4 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE= | ||||||
|  | gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8= | ||||||
| gopkg.in/telegram-bot-api.v4 v4.6.4 h1:hpHWhzn4jTCsAJZZ2loNKfy2QWyPDRJVl3aTFXeMW8g= | gopkg.in/telegram-bot-api.v4 v4.6.4 h1:hpHWhzn4jTCsAJZZ2loNKfy2QWyPDRJVl3aTFXeMW8g= | ||||||
| gopkg.in/telegram-bot-api.v4 v4.6.4/go.mod h1:5DpGO5dbumb40px+dXcwCpcjmeHNYLpk0bp3XRNvWDM= | gopkg.in/telegram-bot-api.v4 v4.6.4/go.mod h1:5DpGO5dbumb40px+dXcwCpcjmeHNYLpk0bp3XRNvWDM= | ||||||
| gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= | ||||||
| @@ -491,4 +548,5 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh | |||||||
| honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= | ||||||
| honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= | ||||||
| honnef.co/go/tools v0.0.0-20190614002413-cb51c254f01b/go.mod h1:JlmFZigtG9vBVR3QGIQ9g/Usz4BzH+Xm6Z8iHQWRYUw= | honnef.co/go/tools v0.0.0-20190614002413-cb51c254f01b/go.mod h1:JlmFZigtG9vBVR3QGIQ9g/Usz4BzH+Xm6Z8iHQWRYUw= | ||||||
|  | honnef.co/go/tools v0.0.1-2019.2.2/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= | ||||||
| rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= | ||||||
|   | |||||||
| @@ -1,79 +1,443 @@ | |||||||
| package tunnel | package tunnel | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
|  | 	"crypto/sha256" | ||||||
|  | 	"errors" | ||||||
|  | 	"fmt" | ||||||
| 	"sync" | 	"sync" | ||||||
|  |  | ||||||
|  | 	"github.com/google/uuid" | ||||||
| 	"github.com/micro/go-micro/transport" | 	"github.com/micro/go-micro/transport" | ||||||
|  | 	"github.com/micro/go-micro/util/log" | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  | // tun represents a network tunnel | ||||||
| type tun struct { | type tun struct { | ||||||
|  | 	options Options | ||||||
|  |  | ||||||
| 	sync.RWMutex | 	sync.RWMutex | ||||||
| 	tr        transport.Transport |  | ||||||
| 	options   Options | 	// to indicate if we're connected or not | ||||||
| 	connected bool | 	connected bool | ||||||
| 	closed    chan bool |  | ||||||
|  | 	// the send channel for all messages | ||||||
|  | 	send chan *message | ||||||
|  |  | ||||||
|  | 	// close channel | ||||||
|  | 	closed chan bool | ||||||
|  |  | ||||||
|  | 	// a map of sockets based on Micro-Tunnel-Id | ||||||
|  | 	sockets map[string]*socket | ||||||
|  |  | ||||||
|  | 	// outbound links | ||||||
|  | 	links map[string]*link | ||||||
|  |  | ||||||
|  | 	// listener | ||||||
|  | 	listener transport.Listener | ||||||
| } | } | ||||||
|  |  | ||||||
| func newTunnel(opts ...Option) Tunnel { | type link struct { | ||||||
| 	// initialize default options | 	transport.Socket | ||||||
| 	options := DefaultOptions() | 	id string | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // create new tunnel on top of a link | ||||||
|  | func newTunnel(opts ...Option) *tun { | ||||||
|  | 	options := DefaultOptions() | ||||||
| 	for _, o := range opts { | 	for _, o := range opts { | ||||||
| 		o(&options) | 		o(&options) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	// tunnel transport | 	return &tun{ | ||||||
| 	tr := newTransport() |  | ||||||
|  |  | ||||||
| 	t := &tun{ |  | ||||||
| 		tr:      tr, |  | ||||||
| 		options: options, | 		options: options, | ||||||
|  | 		send:    make(chan *message, 128), | ||||||
| 		closed:  make(chan bool), | 		closed:  make(chan bool), | ||||||
|  | 		sockets: make(map[string]*socket), | ||||||
|  | 		links:   make(map[string]*link), | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // getSocket returns a socket from the internal socket map. | ||||||
|  | // It does this based on the Micro-Tunnel-Id and Micro-Tunnel-Session | ||||||
|  | func (t *tun) getSocket(id, session string) (*socket, bool) { | ||||||
|  | 	// get the socket | ||||||
|  | 	t.RLock() | ||||||
|  | 	s, ok := t.sockets[id+session] | ||||||
|  | 	t.RUnlock() | ||||||
|  | 	return s, ok | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // newSocket creates a new socket and saves it | ||||||
|  | func (t *tun) newSocket(id, session string) (*socket, bool) { | ||||||
|  | 	// hash the id | ||||||
|  | 	h := sha256.New() | ||||||
|  | 	h.Write([]byte(id)) | ||||||
|  | 	id = fmt.Sprintf("%x", h.Sum(nil)) | ||||||
|  |  | ||||||
|  | 	// new socket | ||||||
|  | 	s := &socket{ | ||||||
|  | 		id:      id, | ||||||
|  | 		session: session, | ||||||
|  | 		closed:  make(chan bool), | ||||||
|  | 		recv:    make(chan *message, 128), | ||||||
|  | 		send:    t.send, | ||||||
|  | 		wait:    make(chan bool), | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	return t | 	// save socket | ||||||
|  | 	t.Lock() | ||||||
|  | 	_, ok := t.sockets[id+session] | ||||||
|  | 	if ok { | ||||||
|  | 		// socket already exists | ||||||
|  | 		t.Unlock() | ||||||
|  | 		return nil, false | ||||||
|  | 	} | ||||||
|  | 	t.sockets[id+session] = s | ||||||
|  | 	t.Unlock() | ||||||
|  |  | ||||||
|  | 	// return socket | ||||||
|  | 	return s, true | ||||||
| } | } | ||||||
|  |  | ||||||
| // Id returns tunnel id | // TODO: use tunnel id as part of the session | ||||||
| func (t *tun) Id() string { | func (t *tun) newSession() string { | ||||||
| 	return t.options.Id | 	return uuid.New().String() | ||||||
| } | } | ||||||
|  |  | ||||||
| // Options returns tunnel options | // process outgoing messages sent by all local sockets | ||||||
| func (t *tun) Options() Options { | func (t *tun) process() { | ||||||
| 	return t.options | 	// manage the send buffer | ||||||
|  | 	// all pseudo sockets throw everything down this | ||||||
|  | 	for { | ||||||
|  | 		select { | ||||||
|  | 		case msg := <-t.send: | ||||||
|  | 			nmsg := &transport.Message{ | ||||||
|  | 				Header: msg.data.Header, | ||||||
|  | 				Body:   msg.data.Body, | ||||||
|  | 			} | ||||||
|  |  | ||||||
|  | 			// set the tunnel id on the outgoing message | ||||||
|  | 			nmsg.Header["Micro-Tunnel-Id"] = msg.id | ||||||
|  |  | ||||||
|  | 			// set the session id | ||||||
|  | 			nmsg.Header["Micro-Tunnel-Session"] = msg.session | ||||||
|  |  | ||||||
|  | 			// send the message via the interface | ||||||
|  | 			t.RLock() | ||||||
|  | 			for _, link := range t.links { | ||||||
|  | 				link.Send(nmsg) | ||||||
|  | 			} | ||||||
|  | 			t.RUnlock() | ||||||
|  | 		case <-t.closed: | ||||||
|  | 			return | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| // Address returns tunnel listen address | // process incoming messages | ||||||
| func (t *tun) Address() string { | func (t *tun) listen(link transport.Socket, listener bool) { | ||||||
| 	return t.options.Address | 	for { | ||||||
|  | 		// process anything via the net interface | ||||||
|  | 		msg := new(transport.Message) | ||||||
|  | 		err := link.Recv(msg) | ||||||
|  | 		if err != nil { | ||||||
|  | 			return | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		// first check Micro-Tunnel | ||||||
|  | 		switch msg.Header["Micro-Tunnel"] { | ||||||
|  | 		case "connect": | ||||||
|  | 			// assuming new connection | ||||||
|  | 			// TODO: do something with this | ||||||
|  | 			continue | ||||||
|  | 		case "close": | ||||||
|  | 			// assuming connection closed | ||||||
|  | 			// TODO: do something with this | ||||||
|  | 			continue | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		// the tunnel id | ||||||
|  | 		id := msg.Header["Micro-Tunnel-Id"] | ||||||
|  |  | ||||||
|  | 		// the session id | ||||||
|  | 		session := msg.Header["Micro-Tunnel-Session"] | ||||||
|  |  | ||||||
|  | 		// if the session id is blank there's nothing we can do | ||||||
|  | 		// TODO: check this is the case, is there any reason | ||||||
|  | 		// why we'd have a blank session? Is the tunnel | ||||||
|  | 		// used for some other purpose? | ||||||
|  | 		if len(id) == 0 || len(session) == 0 { | ||||||
|  | 			continue | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		var s *socket | ||||||
|  | 		var exists bool | ||||||
|  |  | ||||||
|  | 		// if its a local listener then we use that as the session id | ||||||
|  | 		// e.g we're using a loopback connecting to ourselves | ||||||
|  | 		if listener { | ||||||
|  | 			s, exists = t.getSocket(id, "listener") | ||||||
|  | 		} else { | ||||||
|  | 			// get the socket based on the tunnel id and session | ||||||
|  | 			// this could be something we dialed in which case | ||||||
|  | 			// we have a session for it otherwise its a listener | ||||||
|  | 			s, exists = t.getSocket(id, session) | ||||||
|  | 			if !exists { | ||||||
|  | 				// try get it based on just the tunnel id | ||||||
|  | 				// the assumption here is that a listener | ||||||
|  | 				// has no session but its set a listener session | ||||||
|  | 				s, exists = t.getSocket(id, "listener") | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		// no socket in existence | ||||||
|  | 		if !exists { | ||||||
|  | 			// drop it, we don't care about | ||||||
|  | 			// messages we don't know about | ||||||
|  | 			continue | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		// is the socket closed? | ||||||
|  | 		select { | ||||||
|  | 		case <-s.closed: | ||||||
|  | 			// closed | ||||||
|  | 			delete(t.sockets, id) | ||||||
|  | 			continue | ||||||
|  | 		default: | ||||||
|  | 			// process | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		// is the socket new? | ||||||
|  | 		select { | ||||||
|  | 		// if its new the socket is actually blocked waiting | ||||||
|  | 		// for a connection. so we check if its waiting. | ||||||
|  | 		case <-s.wait: | ||||||
|  | 		// if its waiting e.g its new then we close it | ||||||
|  | 		default: | ||||||
|  | 			// set remote address of the socket | ||||||
|  | 			s.remote = msg.Header["Remote"] | ||||||
|  | 			close(s.wait) | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		// construct a new transport message | ||||||
|  | 		tmsg := &transport.Message{ | ||||||
|  | 			Header: msg.Header, | ||||||
|  | 			Body:   msg.Body, | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		// construct the internal message | ||||||
|  | 		imsg := &message{ | ||||||
|  | 			id:      id, | ||||||
|  | 			session: session, | ||||||
|  | 			data:    tmsg, | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		// append to recv backlog | ||||||
|  | 		// we don't block if we can't pass it on | ||||||
|  | 		select { | ||||||
|  | 		case s.recv <- imsg: | ||||||
|  | 		default: | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| // Transport returns tunnel client transport | func (t *tun) connect() error { | ||||||
| func (t *tun) Transport() transport.Transport { | 	l, err := t.options.Transport.Listen(t.options.Address) | ||||||
| 	return t.tr | 	if err != nil { | ||||||
| } | 		return err | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// save the listener | ||||||
|  | 	t.listener = l | ||||||
|  |  | ||||||
|  | 	go func() { | ||||||
|  | 		// accept inbound connections | ||||||
|  | 		err := l.Accept(func(sock transport.Socket) { | ||||||
|  | 			// save the link | ||||||
|  | 			id := uuid.New().String() | ||||||
|  | 			t.Lock() | ||||||
|  | 			t.links[id] = &link{ | ||||||
|  | 				Socket: sock, | ||||||
|  | 				id:     id, | ||||||
|  | 			} | ||||||
|  | 			t.Unlock() | ||||||
|  |  | ||||||
|  | 			// delete the link | ||||||
|  | 			defer func() { | ||||||
|  | 				t.Lock() | ||||||
|  | 				delete(t.links, id) | ||||||
|  | 				t.Unlock() | ||||||
|  | 			}() | ||||||
|  |  | ||||||
|  | 			// listen for inbound messages | ||||||
|  | 			t.listen(sock, true) | ||||||
|  | 		}) | ||||||
|  |  | ||||||
|  | 		t.Lock() | ||||||
|  | 		defer t.Unlock() | ||||||
|  |  | ||||||
|  | 		// still connected but the tunnel died | ||||||
|  | 		if err != nil && t.connected { | ||||||
|  | 			log.Logf("Tunnel listener died: %v", err) | ||||||
|  | 		} | ||||||
|  | 	}() | ||||||
|  |  | ||||||
|  | 	for _, node := range t.options.Nodes { | ||||||
|  | 		c, err := t.options.Transport.Dial(node) | ||||||
|  | 		if err != nil { | ||||||
|  | 			log.Debugf("Tunnel failed to connect to %s: %v", node, err) | ||||||
|  | 			continue | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		err = c.Send(&transport.Message{ | ||||||
|  | 			Header: map[string]string{ | ||||||
|  | 				"Micro-Tunnel": "connect", | ||||||
|  | 			}, | ||||||
|  | 		}) | ||||||
|  |  | ||||||
|  | 		if err != nil { | ||||||
|  | 			continue | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		// process incoming messages | ||||||
|  | 		go t.listen(c, false) | ||||||
|  |  | ||||||
|  | 		// save the link | ||||||
|  | 		id := uuid.New().String() | ||||||
|  | 		t.links[id] = &link{ | ||||||
|  | 			Socket: c, | ||||||
|  | 			id:     id, | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// process outbound messages to be sent | ||||||
|  | 	// process sends to all links | ||||||
|  | 	go t.process() | ||||||
|  |  | ||||||
| // Connect connects establishes point to point tunnel |  | ||||||
| func (t *tun) Connect() error { |  | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
| // Close closes the tunnel | func (t *tun) close() error { | ||||||
|  | 	// close all the links | ||||||
|  | 	for id, link := range t.links { | ||||||
|  | 		link.Send(&transport.Message{ | ||||||
|  | 			Header: map[string]string{ | ||||||
|  | 				"Micro-Tunnel": "close", | ||||||
|  | 			}, | ||||||
|  | 		}) | ||||||
|  | 		link.Close() | ||||||
|  | 		delete(t.links, id) | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// close the listener | ||||||
|  | 	return t.listener.Close() | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // Close the tunnel | ||||||
| func (t *tun) Close() error { | func (t *tun) Close() error { | ||||||
| 	return nil | 	t.Lock() | ||||||
| } | 	defer t.Unlock() | ||||||
|  |  | ||||||
|  | 	if !t.connected { | ||||||
|  | 		return nil | ||||||
|  | 	} | ||||||
|  |  | ||||||
| // Status returns tunnel status |  | ||||||
| func (t *tun) Status() Status { |  | ||||||
| 	select { | 	select { | ||||||
| 	case <-t.closed: | 	case <-t.closed: | ||||||
| 		return Closed | 		return nil | ||||||
| 	default: | 	default: | ||||||
| 		return Connected | 		// close all the sockets | ||||||
|  | 		for _, s := range t.sockets { | ||||||
|  | 			s.Close() | ||||||
|  | 		} | ||||||
|  | 		// close the connection | ||||||
|  | 		close(t.closed) | ||||||
|  | 		t.connected = false | ||||||
|  |  | ||||||
|  | 		// send a close message | ||||||
|  | 		// we don't close the link | ||||||
|  | 		// just the tunnel | ||||||
|  | 		return t.close() | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
| func (t *tun) String() string { | // Connect the tunnel | ||||||
| 	return "micro" | func (t *tun) Connect() error { | ||||||
|  | 	t.Lock() | ||||||
|  | 	defer t.Unlock() | ||||||
|  |  | ||||||
|  | 	// already connected | ||||||
|  | 	if t.connected { | ||||||
|  | 		return nil | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// send the connect message | ||||||
|  | 	if err := t.connect(); err != nil { | ||||||
|  | 		return err | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// set as connected | ||||||
|  | 	t.connected = true | ||||||
|  | 	// create new close channel | ||||||
|  | 	t.closed = make(chan bool) | ||||||
|  |  | ||||||
|  | 	return nil | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (t *tun) Init(opts ...Option) error { | ||||||
|  | 	for _, o := range opts { | ||||||
|  | 		o(&t.options) | ||||||
|  | 	} | ||||||
|  | 	return nil | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // Dial an address | ||||||
|  | func (t *tun) Dial(addr string) (Conn, error) { | ||||||
|  | 	c, ok := t.newSocket(addr, t.newSession()) | ||||||
|  | 	if !ok { | ||||||
|  | 		return nil, errors.New("error dialing " + addr) | ||||||
|  | 	} | ||||||
|  | 	// set remote | ||||||
|  | 	c.remote = addr | ||||||
|  | 	// set local | ||||||
|  | 	c.local = "local" | ||||||
|  |  | ||||||
|  | 	return c, nil | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // Accept a connection on the address | ||||||
|  | func (t *tun) Listen(addr string) (Listener, error) { | ||||||
|  | 	// create a new socket by hashing the address | ||||||
|  | 	c, ok := t.newSocket(addr, "listener") | ||||||
|  | 	if !ok { | ||||||
|  | 		return nil, errors.New("already listening on " + addr) | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// set remote. it will be replaced by the first message received | ||||||
|  | 	c.remote = "remote" | ||||||
|  | 	// set local | ||||||
|  | 	c.local = addr | ||||||
|  |  | ||||||
|  | 	tl := &tunListener{ | ||||||
|  | 		addr: addr, | ||||||
|  | 		// the accept channel | ||||||
|  | 		accept: make(chan *socket, 128), | ||||||
|  | 		// the channel to close | ||||||
|  | 		closed: make(chan bool), | ||||||
|  | 		// the connection | ||||||
|  | 		conn: c, | ||||||
|  | 		// the listener socket | ||||||
|  | 		socket: c, | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// this kicks off the internal message processor | ||||||
|  | 	// for the listener so it can create pseudo sockets | ||||||
|  | 	// per session if they do not exist or pass messages | ||||||
|  | 	// to the existign sessions | ||||||
|  | 	go tl.process() | ||||||
|  |  | ||||||
|  | 	// return the listener | ||||||
|  | 	return tl, nil | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										101
									
								
								tunnel/listener.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								tunnel/listener.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,101 @@ | |||||||
|  | package tunnel | ||||||
|  |  | ||||||
|  | import ( | ||||||
|  | 	"io" | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | type tunListener struct { | ||||||
|  | 	// address of the listener | ||||||
|  | 	addr string | ||||||
|  | 	// the accept channel | ||||||
|  | 	accept chan *socket | ||||||
|  | 	// the channel to close | ||||||
|  | 	closed chan bool | ||||||
|  | 	// the connection | ||||||
|  | 	conn Conn | ||||||
|  | 	// the listener socket | ||||||
|  | 	socket *socket | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (t *tunListener) process() { | ||||||
|  | 	// our connection map for session | ||||||
|  | 	conns := make(map[string]*socket) | ||||||
|  |  | ||||||
|  | 	for { | ||||||
|  | 		select { | ||||||
|  | 		case <-t.closed: | ||||||
|  | 			return | ||||||
|  | 		// receive a new message | ||||||
|  | 		case m := <-t.socket.recv: | ||||||
|  | 			// get a socket | ||||||
|  | 			sock, ok := conns[m.session] | ||||||
|  | 			if !ok { | ||||||
|  | 				// create a new socket session | ||||||
|  | 				sock = &socket{ | ||||||
|  | 					// our tunnel id | ||||||
|  | 					id: m.id, | ||||||
|  | 					// the session id | ||||||
|  | 					session: m.session, | ||||||
|  | 					// close chan | ||||||
|  | 					closed: make(chan bool), | ||||||
|  | 					// recv called by the acceptor | ||||||
|  | 					recv: make(chan *message, 128), | ||||||
|  | 					// use the internal send buffer | ||||||
|  | 					send: t.socket.send, | ||||||
|  | 					// wait | ||||||
|  | 					wait: make(chan bool), | ||||||
|  | 				} | ||||||
|  |  | ||||||
|  | 				// first message | ||||||
|  | 				sock.recv <- m | ||||||
|  |  | ||||||
|  | 				// save the socket | ||||||
|  | 				conns[m.session] = sock | ||||||
|  |  | ||||||
|  | 				// send to accept chan | ||||||
|  | 				select { | ||||||
|  | 				case <-t.closed: | ||||||
|  | 					return | ||||||
|  | 				case t.accept <- sock: | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  |  | ||||||
|  | 			// send this to the accept chan | ||||||
|  | 			select { | ||||||
|  | 			case <-sock.closed: | ||||||
|  | 				delete(conns, m.session) | ||||||
|  | 			case sock.recv <- m: | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (t *tunListener) Addr() string { | ||||||
|  | 	return t.addr | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (t *tunListener) Close() error { | ||||||
|  | 	select { | ||||||
|  | 	case <-t.closed: | ||||||
|  | 		return nil | ||||||
|  | 	default: | ||||||
|  | 		close(t.closed) | ||||||
|  | 	} | ||||||
|  | 	return nil | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // Everytime accept is called we essentially block till we get a new connection | ||||||
|  | func (t *tunListener) Accept() (Conn, error) { | ||||||
|  | 	select { | ||||||
|  | 	// if the socket is closed return | ||||||
|  | 	case <-t.closed: | ||||||
|  | 		return nil, io.EOF | ||||||
|  | 	// wait for a new connection | ||||||
|  | 	case c, ok := <-t.accept: | ||||||
|  | 		if !ok { | ||||||
|  | 			return nil, io.EOF | ||||||
|  | 		} | ||||||
|  | 		return c, nil | ||||||
|  | 	} | ||||||
|  | 	return nil, nil | ||||||
|  | } | ||||||
| @@ -3,6 +3,7 @@ package tunnel | |||||||
| import ( | import ( | ||||||
| 	"github.com/google/uuid" | 	"github.com/google/uuid" | ||||||
| 	"github.com/micro/go-micro/transport" | 	"github.com/micro/go-micro/transport" | ||||||
|  | 	"github.com/micro/go-micro/transport/quic" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| var ( | var ( | ||||||
| @@ -39,7 +40,7 @@ func Address(a string) Option { | |||||||
| } | } | ||||||
|  |  | ||||||
| // Nodes specify remote network nodes | // Nodes specify remote network nodes | ||||||
| func Nodes(n []string) Option { | func Nodes(n ...string) Option { | ||||||
| 	return func(o *Options) { | 	return func(o *Options) { | ||||||
| 		o.Nodes = n | 		o.Nodes = n | ||||||
| 	} | 	} | ||||||
| @@ -57,7 +58,6 @@ func DefaultOptions() Options { | |||||||
| 	return Options{ | 	return Options{ | ||||||
| 		Id:        uuid.New().String(), | 		Id:        uuid.New().String(), | ||||||
| 		Address:   DefaultAddress, | 		Address:   DefaultAddress, | ||||||
| 		Nodes:     make([]string, 0), | 		Transport: quic.NewTransport(), | ||||||
| 		Transport: transport.DefaultTransport, |  | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,25 +1,90 @@ | |||||||
| package tunnel | package tunnel | ||||||
|  |  | ||||||
| import "github.com/micro/go-micro/transport" | import ( | ||||||
|  | 	"errors" | ||||||
|  |  | ||||||
| type tunSocket struct{} | 	"github.com/micro/go-micro/transport" | ||||||
|  | ) | ||||||
|  |  | ||||||
| func (s *tunSocket) Recv(m *transport.Message) error { | // socket is our pseudo socket for transport.Socket | ||||||
|  | type socket struct { | ||||||
|  | 	// socket id based on Micro-Tunnel | ||||||
|  | 	id string | ||||||
|  | 	// the session id based on Micro.Tunnel-Session | ||||||
|  | 	session string | ||||||
|  | 	// closed | ||||||
|  | 	closed chan bool | ||||||
|  | 	// remote addr | ||||||
|  | 	remote string | ||||||
|  | 	// local addr | ||||||
|  | 	local string | ||||||
|  | 	// send chan | ||||||
|  | 	send chan *message | ||||||
|  | 	// recv chan | ||||||
|  | 	recv chan *message | ||||||
|  | 	// wait until we have a connection | ||||||
|  | 	wait chan bool | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // message is sent over the send channel | ||||||
|  | type message struct { | ||||||
|  | 	// tunnel id | ||||||
|  | 	id string | ||||||
|  | 	// the session id | ||||||
|  | 	session string | ||||||
|  | 	// transport data | ||||||
|  | 	data *transport.Message | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (s *socket) Remote() string { | ||||||
|  | 	return s.remote | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (s *socket) Local() string { | ||||||
|  | 	return s.local | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (s *socket) Id() string { | ||||||
|  | 	return s.id | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (s *socket) Session() string { | ||||||
|  | 	return s.session | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (s *socket) Send(m *transport.Message) error { | ||||||
|  | 	select { | ||||||
|  | 	case <-s.closed: | ||||||
|  | 		return errors.New("socket is closed") | ||||||
|  | 	default: | ||||||
|  | 		// no op | ||||||
|  | 	} | ||||||
|  | 	// append to backlog | ||||||
|  | 	s.send <- &message{id: s.id, session: s.session, data: m} | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
| func (s *tunSocket) Send(m *transport.Message) error { | func (s *socket) Recv(m *transport.Message) error { | ||||||
|  | 	select { | ||||||
|  | 	case <-s.closed: | ||||||
|  | 		return errors.New("socket is closed") | ||||||
|  | 	default: | ||||||
|  | 		// no op | ||||||
|  | 	} | ||||||
|  | 	// recv from backlog | ||||||
|  | 	msg := <-s.recv | ||||||
|  | 	// set message | ||||||
|  | 	*m = *msg.data | ||||||
|  | 	// return nil | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
| func (s *tunSocket) Close() error { | func (s *socket) Close() error { | ||||||
|  | 	select { | ||||||
|  | 	case <-s.closed: | ||||||
|  | 		// no op | ||||||
|  | 	default: | ||||||
|  | 		close(s.closed) | ||||||
|  | 	} | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
| func (s *tunSocket) Local() string { |  | ||||||
| 	return "" |  | ||||||
| } |  | ||||||
|  |  | ||||||
| func (s *tunSocket) Remote() string { |  | ||||||
| 	return "" |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -1,51 +0,0 @@ | |||||||
| package tunnel |  | ||||||
|  |  | ||||||
| import "github.com/micro/go-micro/transport" |  | ||||||
|  |  | ||||||
| type tunTransport struct { |  | ||||||
| 	options transport.Options |  | ||||||
| } |  | ||||||
|  |  | ||||||
| type tunClient struct { |  | ||||||
| 	*tunSocket |  | ||||||
| 	options transport.DialOptions |  | ||||||
| } |  | ||||||
|  |  | ||||||
| type tunListener struct { |  | ||||||
| 	conn chan *tunSocket |  | ||||||
| } |  | ||||||
|  |  | ||||||
| func newTransport(opts ...transport.Option) transport.Transport { |  | ||||||
| 	var options transport.Options |  | ||||||
|  |  | ||||||
| 	for _, o := range opts { |  | ||||||
| 		o(&options) |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	return &tunTransport{ |  | ||||||
| 		options: options, |  | ||||||
| 	} |  | ||||||
| } |  | ||||||
|  |  | ||||||
| func (t *tunTransport) Init(opts ...transport.Option) error { |  | ||||||
| 	for _, o := range opts { |  | ||||||
| 		o(&t.options) |  | ||||||
| 	} |  | ||||||
| 	return nil |  | ||||||
| } |  | ||||||
|  |  | ||||||
| func (t *tunTransport) Options() transport.Options { |  | ||||||
| 	return t.options |  | ||||||
| } |  | ||||||
|  |  | ||||||
| func (t *tunTransport) Dial(addr string, opts ...transport.DialOption) (transport.Client, error) { |  | ||||||
| 	return nil, nil |  | ||||||
| } |  | ||||||
|  |  | ||||||
| func (t *tunTransport) Listen(addr string, opts ...transport.ListenOption) (transport.Listener, error) { |  | ||||||
| 	return nil, nil |  | ||||||
| } |  | ||||||
|  |  | ||||||
| func (t *tunTransport) String() string { |  | ||||||
| 	return "micro" |  | ||||||
| } |  | ||||||
							
								
								
									
										30
									
								
								tunnel/transport/listener.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								tunnel/transport/listener.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | |||||||
|  | package transport | ||||||
|  |  | ||||||
|  | import ( | ||||||
|  | 	"github.com/micro/go-micro/transport" | ||||||
|  | 	"github.com/micro/go-micro/tunnel" | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | type tunListener struct { | ||||||
|  | 	l tunnel.Listener | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (t *tunListener) Addr() string { | ||||||
|  | 	return t.l.Addr() | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (t *tunListener) Close() error { | ||||||
|  | 	return t.l.Close() | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (t *tunListener) Accept(fn func(socket transport.Socket)) error { | ||||||
|  | 	for { | ||||||
|  | 		// accept connection | ||||||
|  | 		c, err := t.l.Accept() | ||||||
|  | 		if err != nil { | ||||||
|  | 			return err | ||||||
|  | 		} | ||||||
|  | 		// execute the function | ||||||
|  | 		go fn(c) | ||||||
|  | 	} | ||||||
|  | } | ||||||
							
								
								
									
										113
									
								
								tunnel/transport/transport.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										113
									
								
								tunnel/transport/transport.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,113 @@ | |||||||
|  | // Package transport provides a tunnel transport | ||||||
|  | package transport | ||||||
|  |  | ||||||
|  | import ( | ||||||
|  | 	"context" | ||||||
|  |  | ||||||
|  | 	"github.com/micro/go-micro/transport" | ||||||
|  | 	"github.com/micro/go-micro/tunnel" | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | type tunTransport struct { | ||||||
|  | 	options transport.Options | ||||||
|  |  | ||||||
|  | 	tunnel tunnel.Tunnel | ||||||
|  | } | ||||||
|  |  | ||||||
|  | type tunnelKey struct{} | ||||||
|  |  | ||||||
|  | type transportKey struct{} | ||||||
|  |  | ||||||
|  | func (t *tunTransport) Init(opts ...transport.Option) error { | ||||||
|  | 	for _, o := range opts { | ||||||
|  | 		o(&t.options) | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// close the existing tunnel | ||||||
|  | 	if t.tunnel != nil { | ||||||
|  | 		t.tunnel.Close() | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// get the tunnel | ||||||
|  | 	tun, ok := t.options.Context.Value(tunnelKey{}).(tunnel.Tunnel) | ||||||
|  | 	if !ok { | ||||||
|  | 		tun = tunnel.NewTunnel() | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// get the transport | ||||||
|  | 	tr, ok := t.options.Context.Value(transportKey{}).(transport.Transport) | ||||||
|  | 	if ok { | ||||||
|  | 		tun.Init(tunnel.Transport(tr)) | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// set the tunnel | ||||||
|  | 	t.tunnel = tun | ||||||
|  |  | ||||||
|  | 	return nil | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (t *tunTransport) Dial(addr string, opts ...transport.DialOption) (transport.Client, error) { | ||||||
|  | 	if err := t.tunnel.Connect(); err != nil { | ||||||
|  | 		return nil, err | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	c, err := t.tunnel.Dial(addr) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return nil, err | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return c, nil | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (t *tunTransport) Listen(addr string, opts ...transport.ListenOption) (transport.Listener, error) { | ||||||
|  | 	if err := t.tunnel.Connect(); err != nil { | ||||||
|  | 		return nil, err | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	l, err := t.tunnel.Listen(addr) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return nil, err | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return &tunListener{l}, nil | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (t *tunTransport) Options() transport.Options { | ||||||
|  | 	return t.options | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (t *tunTransport) String() string { | ||||||
|  | 	return "tunnel" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // NewTransport honours the initialiser used in | ||||||
|  | func NewTransport(opts ...transport.Option) transport.Transport { | ||||||
|  | 	t := &tunTransport{ | ||||||
|  | 		options: transport.Options{}, | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// initialise | ||||||
|  | 	t.Init(opts...) | ||||||
|  |  | ||||||
|  | 	return t | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // WithTransport sets the internal tunnel | ||||||
|  | func WithTunnel(t tunnel.Tunnel) transport.Option { | ||||||
|  | 	return func(o *transport.Options) { | ||||||
|  | 		if o.Context == nil { | ||||||
|  | 			o.Context = context.Background() | ||||||
|  | 		} | ||||||
|  | 		o.Context = context.WithValue(o.Context, tunnelKey{}, t) | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // WithTransport sets the internal transport | ||||||
|  | func WithTransport(t transport.Transport) transport.Option { | ||||||
|  | 	return func(o *transport.Options) { | ||||||
|  | 		if o.Context == nil { | ||||||
|  | 			o.Context = context.Background() | ||||||
|  | 		} | ||||||
|  | 		o.Context = context.WithValue(o.Context, transportKey{}, t) | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @@ -1,39 +1,44 @@ | |||||||
| // Package tunnel provides micro network tunnelling | // Package tunnel provides gre network tunnelling | ||||||
| package tunnel | package tunnel | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"github.com/micro/go-micro/transport" | 	"github.com/micro/go-micro/transport" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| // Status is tunnel status | // Tunnel creates a gre network tunnel on top of a link. | ||||||
| type Status int | // It establishes multiple streams using the Micro-Tunnel-Id header | ||||||
|  | // and Micro-Tunnel-Session header. The tunnel id is a hash of | ||||||
| const ( | // the address being requested. | ||||||
| 	// Connected means the tunnel is alive |  | ||||||
| 	Connected Status = iota |  | ||||||
| 	// Closed meands the tunnel has been disconnected |  | ||||||
| 	Closed |  | ||||||
| ) |  | ||||||
|  |  | ||||||
| // Tunnel creates a p2p network tunnel. |  | ||||||
| type Tunnel interface { | type Tunnel interface { | ||||||
| 	// Id returns tunnel id | 	Init(opts ...Option) error | ||||||
| 	Id() string |  | ||||||
| 	// Options returns the tunnel options |  | ||||||
| 	Options() Options |  | ||||||
| 	// Address returns tunnel address |  | ||||||
| 	Address() string |  | ||||||
| 	// Transport to use by tunne clients |  | ||||||
| 	Transport() transport.Transport |  | ||||||
| 	// Connect connects the tunnel | 	// Connect connects the tunnel | ||||||
| 	Connect() error | 	Connect() error | ||||||
| 	// Close closes the tunnel | 	// Close closes the tunnel | ||||||
| 	Close() error | 	Close() error | ||||||
| 	// Status returns tunnel status | 	// Dial an endpoint | ||||||
| 	Status() Status | 	Dial(addr string) (Conn, error) | ||||||
|  | 	// Accept connections | ||||||
|  | 	Listen(addr string) (Listener, error) | ||||||
| } | } | ||||||
|  |  | ||||||
| // NewTunnel creates a new tunnel on top of a link | // The listener provides similar constructs to the transport.Listener | ||||||
|  | type Listener interface { | ||||||
|  | 	Addr() string | ||||||
|  | 	Close() error | ||||||
|  | 	Accept() (Conn, error) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // Conn is a connection dialed or accepted which includes the tunnel id and session | ||||||
|  | type Conn interface { | ||||||
|  | 	// Specifies the tunnel id | ||||||
|  | 	Id() string | ||||||
|  | 	// The session | ||||||
|  | 	Session() string | ||||||
|  | 	// a transport socket | ||||||
|  | 	transport.Socket | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // NewTunnel creates a new tunnel | ||||||
| func NewTunnel(opts ...Option) Tunnel { | func NewTunnel(opts ...Option) Tunnel { | ||||||
| 	return newTunnel(opts...) | 	return newTunnel(opts...) | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										114
									
								
								tunnel/tunnel_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										114
									
								
								tunnel/tunnel_test.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,114 @@ | |||||||
|  | package tunnel | ||||||
|  |  | ||||||
|  | import ( | ||||||
|  | 	"sync" | ||||||
|  | 	"testing" | ||||||
|  |  | ||||||
|  | 	"github.com/micro/go-micro/transport" | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | // testAccept will accept connections on the transport, create a new link and tunnel on top | ||||||
|  | func testAccept(t *testing.T, tun Tunnel, wg *sync.WaitGroup) { | ||||||
|  | 	// listen on some virtual address | ||||||
|  | 	tl, err := tun.Listen("test-tunnel") | ||||||
|  | 	if err != nil { | ||||||
|  | 		t.Fatal(err) | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// accept a connection | ||||||
|  | 	c, err := tl.Accept() | ||||||
|  | 	if err != nil { | ||||||
|  | 		t.Fatal(err) | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	// get a message | ||||||
|  | 	for { | ||||||
|  | 		m := new(transport.Message) | ||||||
|  | 		if err := c.Recv(m); err != nil { | ||||||
|  | 			t.Fatal(err) | ||||||
|  | 		} | ||||||
|  | 		wg.Done() | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // testSend will create a new link to an address and then a tunnel on top | ||||||
|  | func testSend(t *testing.T, tun Tunnel) { | ||||||
|  | 	// dial a new session | ||||||
|  | 	c, err := tun.Dial("test-tunnel") | ||||||
|  | 	if err != nil { | ||||||
|  | 		t.Fatal(err) | ||||||
|  | 	} | ||||||
|  | 	defer c.Close() | ||||||
|  |  | ||||||
|  | 	m := transport.Message{ | ||||||
|  | 		Header: map[string]string{ | ||||||
|  | 			"test": "header", | ||||||
|  | 		}, | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if err := c.Send(&m); err != nil { | ||||||
|  | 		t.Fatal(err) | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func TestTunnel(t *testing.T) { | ||||||
|  | 	// create a new listener | ||||||
|  | 	tun := NewTunnel(Nodes("127.0.0.1:9096")) | ||||||
|  | 	err := tun.Connect() | ||||||
|  | 	if err != nil { | ||||||
|  | 		t.Fatal(err) | ||||||
|  | 	} | ||||||
|  | 	defer tun.Close() | ||||||
|  |  | ||||||
|  | 	var wg sync.WaitGroup | ||||||
|  |  | ||||||
|  | 	// start accepting connections | ||||||
|  | 	wg.Add(1) | ||||||
|  | 	go testAccept(t, tun, &wg) | ||||||
|  |  | ||||||
|  | 	// send a message | ||||||
|  | 	testSend(t, tun) | ||||||
|  |  | ||||||
|  | 	// wait until message is received | ||||||
|  | 	wg.Wait() | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func TestTwoTunnel(t *testing.T) { | ||||||
|  | 	// create a new tunnel client | ||||||
|  | 	tunA := NewTunnel( | ||||||
|  | 		Address("127.0.0.1:9096"), | ||||||
|  | 		Nodes("127.0.0.1:9097"), | ||||||
|  | 	) | ||||||
|  |  | ||||||
|  | 	// create a new tunnel server | ||||||
|  | 	tunB := NewTunnel( | ||||||
|  | 		Address("127.0.0.1:9097"), | ||||||
|  | 	) | ||||||
|  |  | ||||||
|  | 	// start tunB | ||||||
|  | 	err := tunB.Connect() | ||||||
|  | 	if err != nil { | ||||||
|  | 		t.Fatal(err) | ||||||
|  | 	} | ||||||
|  | 	defer tunB.Close() | ||||||
|  |  | ||||||
|  | 	// start tunA | ||||||
|  | 	err = tunA.Connect() | ||||||
|  | 	if err != nil { | ||||||
|  | 		t.Fatal(err) | ||||||
|  | 	} | ||||||
|  | 	defer tunA.Close() | ||||||
|  |  | ||||||
|  | 	var wg sync.WaitGroup | ||||||
|  |  | ||||||
|  | 	// start accepting connections | ||||||
|  | 	wg.Add(1) | ||||||
|  | 	go testAccept(t, tunB, &wg) | ||||||
|  |  | ||||||
|  | 	// send a message | ||||||
|  | 	testSend(t, tunA) | ||||||
|  |  | ||||||
|  | 	// wait until done | ||||||
|  | 	wg.Wait() | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user