fix
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
aa667728a1
commit
1cbd1d2bad
@ -11,7 +11,7 @@ import (
|
||||
"github.com/unistack-org/micro/v3/router"
|
||||
"github.com/unistack-org/micro/v3/selector"
|
||||
"github.com/unistack-org/micro/v3/selector/random"
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/proxy"
|
||||
"github.com/unistack-org/micro/v3/router"
|
||||
"github.com/unistack-org/micro/v3/tunnel"
|
||||
"github.com/unistack-org/micro/v3/network/tunnel"
|
||||
)
|
||||
|
||||
type Option func(*Options)
|
||||
|
@ -7,8 +7,8 @@ import (
|
||||
|
||||
"github.com/unistack-org/micro/v3/broker"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/tunnel"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
"github.com/unistack-org/micro/v3/network/tunnel"
|
||||
)
|
||||
|
||||
type tunBroker struct {
|
@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
var (
|
@ -1,8 +1,8 @@
|
||||
package transport
|
||||
|
||||
import (
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/tunnel"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
"github.com/unistack-org/micro/v3/network/tunnel"
|
||||
)
|
||||
|
||||
type tunListener struct {
|
@ -5,8 +5,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/tunnel"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
"github.com/unistack-org/micro/v3/network/tunnel"
|
||||
)
|
||||
|
||||
type tunTransport struct {
|
@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
var (
|
@ -19,7 +19,7 @@ import (
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
"github.com/unistack-org/micro/v3/store"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
// Options for micro service
|
||||
|
@ -10,8 +10,16 @@ type HandlerOptions struct {
|
||||
Context context.Context
|
||||
}
|
||||
|
||||
func NewHandlerOptions() HandlerOptions {
|
||||
return HandlerOptions{Context: context.Background()}
|
||||
func NewHandlerOptions(opts ...HandlerOption) HandlerOptions {
|
||||
options := HandlerOptions{
|
||||
Context: context.Background(),
|
||||
}
|
||||
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
type SubscriberOption func(*SubscriberOptions)
|
||||
@ -26,16 +34,16 @@ type SubscriberOptions struct {
|
||||
}
|
||||
|
||||
func NewSubscriberOptions(opts ...SubscriberOption) SubscriberOptions {
|
||||
opt := SubscriberOptions{
|
||||
options := SubscriberOptions{
|
||||
AutoAck: true,
|
||||
Context: context.Background(),
|
||||
}
|
||||
|
||||
for _, o := range opts {
|
||||
o(&opt)
|
||||
o(&options)
|
||||
}
|
||||
|
||||
return opt
|
||||
return options
|
||||
}
|
||||
|
||||
// EndpointMetadata is a Handler option that allows metadata to be added to
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/registry"
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
rtreg "github.com/unistack-org/micro/v3/router/registry"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
grpcsrv "github.com/unistack-org/micro/v3/server/grpc"
|
||||
tmemory "github.com/unistack-org/micro/v3/transport/memory"
|
||||
tmemory "github.com/unistack-org/micro/v3/network/transport/memory"
|
||||
cw "github.com/unistack-org/micro/v3/util/client"
|
||||
)
|
||||
|
||||
|
@ -4,7 +4,7 @@ package io
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
type rwc struct {
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
type pool struct {
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/transport/memory"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
"github.com/unistack-org/micro/v3/network/transport/memory"
|
||||
)
|
||||
|
||||
func testPool(t *testing.T, size int, ttl time.Duration) {
|
||||
|
@ -3,7 +3,7 @@ package pool
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
|
@ -4,7 +4,7 @@ package pool
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
// Pool is an interface for connection pooling
|
||||
|
@ -4,7 +4,7 @@ package socket
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/unistack-org/micro/v3/transport"
|
||||
"github.com/unistack-org/micro/v3/network/transport"
|
||||
)
|
||||
|
||||
// Socket is our pseudo socket for transport.Socket
|
||||
|
Loading…
x
Reference in New Issue
Block a user