many fixes for lint and context.Context usage (#5)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-11-03 02:02:32 +03:00
committed by GitHub
parent 40b0870cf8
commit 8a2b122015
44 changed files with 152 additions and 1175 deletions

View File

@@ -2,6 +2,7 @@
package tunnel
import (
"context"
"errors"
"time"
@@ -55,15 +56,15 @@ type Tunnel interface {
// Address returns the address the tunnel is listening on
Address() string
// Connect connects the tunnel
Connect() error
Connect(ctx context.Context) error
// Close closes the tunnel
Close() error
Close(ctx context.Context) error
// Links returns all the links the tunnel is connected to
Links() []Link
// Dial allows a client to connect to a channel
Dial(channel string, opts ...DialOption) (Session, error)
Dial(ctx context.Context, channel string, opts ...DialOption) (Session, error)
// Listen allows to accept connections on a channel
Listen(channel string, opts ...ListenOption) (Listener, error)
Listen(ctx context.Context, channel string, opts ...ListenOption) (Listener, error)
// String returns the name of the tunnel implementation
String() string
}