update to latest micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
9649cdc390
commit
f3fc6a0078
16
context.go
16
context.go
@ -1,16 +0,0 @@
|
|||||||
package tcp
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/unistack-org/micro/v3/server"
|
|
||||||
)
|
|
||||||
|
|
||||||
func setServerOption(k, v interface{}) server.Option {
|
|
||||||
return func(o *server.Options) {
|
|
||||||
if o.Context == nil {
|
|
||||||
o.Context = context.Background()
|
|
||||||
}
|
|
||||||
o.Context = context.WithValue(o.Context, k, v)
|
|
||||||
}
|
|
||||||
}
|
|
2
go.mod
2
go.mod
@ -5,6 +5,6 @@ go 1.13
|
|||||||
require (
|
require (
|
||||||
github.com/unistack-org/micro-broker-memory v0.0.0-20200905101815-4594aa2807e9
|
github.com/unistack-org/micro-broker-memory v0.0.0-20200905101815-4594aa2807e9
|
||||||
github.com/unistack-org/micro-registry-memory v0.0.0-20200905064113-34be66be749f
|
github.com/unistack-org/micro-registry-memory v0.0.0-20200905064113-34be66be749f
|
||||||
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200922101738-21d5ca1cddc1
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200922103357-4c4fa00a5d94
|
||||||
golang.org/x/net v0.0.0-20200904194848-62affa334b73
|
golang.org/x/net v0.0.0-20200904194848-62affa334b73
|
||||||
)
|
)
|
||||||
|
2
go.sum
2
go.sum
@ -297,6 +297,8 @@ github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200909210629-caec730248b1/go.m
|
|||||||
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200920135754-1cbd1d2bad83/go.mod h1:HUzMG4Mcy97958VxWTg8zuazZgwQ/aoLZ8wtBVONwRE=
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200920135754-1cbd1d2bad83/go.mod h1:HUzMG4Mcy97958VxWTg8zuazZgwQ/aoLZ8wtBVONwRE=
|
||||||
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200922101738-21d5ca1cddc1 h1:Ki+acK9YEn6OuqOQkZZPrGEslmeMvS9kPSObU01yn2E=
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200922101738-21d5ca1cddc1 h1:Ki+acK9YEn6OuqOQkZZPrGEslmeMvS9kPSObU01yn2E=
|
||||||
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200922101738-21d5ca1cddc1/go.mod h1:aL+8VhSXpx0SuEeXPOWUo5BgS7kyvWYobeXFay90UUM=
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200922101738-21d5ca1cddc1/go.mod h1:aL+8VhSXpx0SuEeXPOWUo5BgS7kyvWYobeXFay90UUM=
|
||||||
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200922103357-4c4fa00a5d94 h1:1I3f/gjKIw/L61VsZesdOhzWzbvga0U867MOckvzVB0=
|
||||||
|
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200922103357-4c4fa00a5d94/go.mod h1:aL+8VhSXpx0SuEeXPOWUo5BgS7kyvWYobeXFay90UUM=
|
||||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||||
github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA=
|
github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA=
|
||||||
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||||
|
@ -23,20 +23,20 @@ type netListener struct{}
|
|||||||
// send. Default maximum message size is 8K
|
// send. Default maximum message size is 8K
|
||||||
//
|
//
|
||||||
func MaxMsgSize(s int) server.Option {
|
func MaxMsgSize(s int) server.Option {
|
||||||
return setServerOption(maxMsgSizeKey{}, s)
|
return server.SetOption(maxMsgSizeKey{}, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuthTLS should be used to setup a secure authentication using TLS
|
// AuthTLS should be used to setup a secure authentication using TLS
|
||||||
func AuthTLS(t *tls.Config) server.Option {
|
func AuthTLS(t *tls.Config) server.Option {
|
||||||
return setServerOption(tlsAuth{}, t)
|
return server.SetOption(tlsAuth{}, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MaxConn specifies maximum number of max simultaneous connections to server
|
// MaxConn specifies maximum number of max simultaneous connections to server
|
||||||
func MaxConn(n int) server.Option {
|
func MaxConn(n int) server.Option {
|
||||||
return setServerOption(maxConnKey{}, n)
|
return server.SetOption(maxConnKey{}, n)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Listener specifies the net.Listener to use instead of the default
|
// Listener specifies the net.Listener to use instead of the default
|
||||||
func Listener(l net.Listener) server.Option {
|
func Listener(l net.Listener) server.Option {
|
||||||
return setServerOption(netListener{}, l)
|
return server.SetOption(netListener{}, l)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user