Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaybeWrapTransport ¶
func MaybeWrapTransport(t transport.Transport, nc NetworkCookie, opts ...Option) transport.Transport
MaybeWrapTransport adds a handshake wrapper around the Transport if network cookie nc is not empty, otherwise it just returns the transport.
Types ¶
type NetworkCookie ¶
type NetworkCookie []byte
NetworkCookie specifies a sequence of bytes that can be used to prevent peers from different networks from communicating with each other.
var NoNetworkCookie NetworkCookie = nil
NoNetworkCookie represents an empty NetworkCookie.
func (NetworkCookie) Empty ¶
func (nc NetworkCookie) Empty() bool
Empty returns true if the network cookie is empty.
func (NetworkCookie) Equal ¶
func (nc NetworkCookie) Equal(other NetworkCookie) bool
Equal returns true if this cookie is the same as the other cookie.
func (NetworkCookie) String ¶
func (nc NetworkCookie) String() string
String returns string representation of the NetworkCookie, which is a hex string.
type Option ¶
type Option func(w *transportWrapper)
Option specifies a handshake option.
func WithRetryInterval ¶
WithLog specifies handshake retry interval.
Click to show internal directories.
Click to hide internal directories.