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