Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Provider ¶
type Provider interface {
// Provider name
Name() string
// Create Tunnel from context bytes
FromContext(context []byte) (Tunnel, error)
// Create new tunnel with initialized context
New(params Params) (Tunnel, error)
}
Provider Tunnel protocol provider
type Tunnel ¶
type Tunnel interface {
// Send encrypt msg and send through provide transport
Send(msg []byte, transport Transport) error
// Recv recv msg through provide transport and decrypt
Recv(transport Transport) ([]byte, error)
// Disconnect send disconnect msg to peer
Disconnect(transport Transport) error
// Connect send connect msg to peer if need
Connect(transport Transport) error
// Get tunnel marshable context
Context() ([]byte, error)
}
Tunnel tunnel protocol object
func FromContext ¶
FromContext create tunnel with context
type TunnelCloser ¶
TunnelCloser Tunnel object with close function
Click to show internal directories.
Click to hide internal directories.