lint: fix all major issues

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-02-14 16:16:01 +03:00
parent a11dd00174
commit 4ec4c277b7
65 changed files with 302 additions and 146 deletions

View File

@@ -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...)

View File

@@ -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(),

View File

@@ -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