Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultMinimumExpiryAge = time.Minute
Functions ¶
This section is empty.
Types ¶
type Handshake ¶
type Handshake func(net.Conn, codec.Encoder, codec.Decoder) (codec.Encoder, codec.Decoder, id.Signatory, error)
Handshake functions accept a connection, an encoder, and decoder. The encoder and decoder are used to establish an authenticated and encrypted connection. A new encoder and decoder are returned, which wrap the accpted encoder and decoder with any additional functionality required to perform authentication and encryption. The identity of the remote peer is also returned.
func Filter ¶
Filter accepts a filtering function and a Handshake function, and returns wrapping Handshake function that runs the wrapped Handshake before applying the filtering function to the remote peer ID. If the wrapped Handshake returns an error, the filtering function will be skipped, and the error will be returned. Otherwise, the filtering function will be called and its error returned.
func Insecure ¶
Insecure returns a Handshake that does no authentication or encryption. During the handshake, the local peer writes its own identity to the connection, and then reads the identity of the remote peer. No verification of identities is done. Insecure should only be used in private networks.
type OncePool ¶
type OncePool struct {
// contains filtered or unexported fields
}
func NewOncePool ¶
func NewOncePool(opts OncePoolOptions) OncePool
type OncePoolOptions ¶
func DefaultOncePoolOptions ¶
func DefaultOncePoolOptions() OncePoolOptions
func (OncePoolOptions) WithMinimumExpiryAge ¶
func (opts OncePoolOptions) WithMinimumExpiryAge(minExpiryAge time.Duration) OncePoolOptions