lint: fix all major issues
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/unistack-org/micro/v3/tracer"
|
||||
)
|
||||
|
||||
// Options struct holds the transport options
|
||||
type Options struct {
|
||||
Name string
|
||||
// Addrs is the list of intermediary addresses to connect to
|
||||
@@ -18,10 +19,6 @@ type Options struct {
|
||||
// Codec is the codec interface to use where headers are not supported
|
||||
// by the transport and the entire payload must be encoded
|
||||
Codec codec.Codec
|
||||
// Secure tells the transport to secure the connection.
|
||||
// In the case TLSConfig is not specified best effort self-signed
|
||||
// certs should be used
|
||||
Secure bool
|
||||
// TLSConfig to secure the connection. The assumption is that this
|
||||
// is mTLS keypair
|
||||
TLSConfig *tls.Config
|
||||
@@ -31,7 +28,7 @@ type Options struct {
|
||||
Logger logger.Logger
|
||||
// Meter sets the meter
|
||||
Meter meter.Meter
|
||||
// Tracer
|
||||
// Tracer sets the tracer
|
||||
Tracer tracer.Tracer
|
||||
// Other options for implementations of the interface
|
||||
// can be stored in a context
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
var (
|
||||
// DefaultTransport is the global default transport
|
||||
DefaultTransport Transport = NewTransport()
|
||||
// Default dial timeout
|
||||
// DefaultDialTimeout the default dial timeout
|
||||
DefaultDialTimeout = time.Second * 5
|
||||
)
|
||||
|
||||
|
||||
@@ -175,6 +175,7 @@ func (t *tunEvent) Error() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewBroker returns new tunnel broker
|
||||
func NewBroker(opts ...broker.Option) (broker.Broker, error) {
|
||||
options := broker.NewOptions(opts...)
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ import (
|
||||
var (
|
||||
// DefaultAddress is default tunnel bind address
|
||||
DefaultAddress = ":0"
|
||||
// The shared default token
|
||||
// DefaultToken the shared default token
|
||||
DefaultToken = "go.micro.tunnel"
|
||||
)
|
||||
|
||||
// Option func
|
||||
// Option func signature
|
||||
type Option func(*Options)
|
||||
|
||||
// Options provides network configuration options
|
||||
@@ -160,7 +160,7 @@ func DialWait(b bool) DialOption {
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultOptions returns router default options
|
||||
// NewOptions returns router default options with filled values
|
||||
func NewOptions(opts ...Option) Options {
|
||||
options := Options{
|
||||
Id: uuid.New().String(),
|
||||
|
||||
@@ -10,15 +10,16 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// DefaultTunnel contains default tunnel implementation
|
||||
DefaultTunnel Tunnel
|
||||
)
|
||||
|
||||
const (
|
||||
// send over one link
|
||||
// Unicast send over one link
|
||||
Unicast Mode = iota
|
||||
// send to all channel listeners
|
||||
// Multicast send to all channel listeners
|
||||
Multicast
|
||||
// send to all links
|
||||
// Broadcast send to all links
|
||||
Broadcast
|
||||
)
|
||||
|
||||
@@ -33,7 +34,7 @@ var (
|
||||
ErrLinkNotFound = errors.New("link not found")
|
||||
// ErrLinkDisconnected is returned when a link we attempt to send to is disconnected
|
||||
ErrLinkDisconnected = errors.New("link not connected")
|
||||
// ErrLinkLoppback is returned when attempting to send an outbound message over loopback link
|
||||
// ErrLinkLoopback is returned when attempting to send an outbound message over loopback link
|
||||
ErrLinkLoopback = errors.New("link is loopback")
|
||||
// ErrLinkRemote is returned when attempting to send a loopback message over remote link
|
||||
ErrLinkRemote = errors.New("link is remote")
|
||||
@@ -87,7 +88,7 @@ type Link interface {
|
||||
transport.Socket
|
||||
}
|
||||
|
||||
// The listener provides similar constructs to the transport.Listener
|
||||
// Listener provides similar constructs to the transport.Listener
|
||||
type Listener interface {
|
||||
Accept() (Session, error)
|
||||
Channel() string
|
||||
|
||||
Reference in New Issue
Block a user