Package fasthttputil provides utility functions for fasthttp.
This section is empty.
View Sourcevar ErrInmemoryListenerClosed = errors.New("InmemoryListener is already closed: use of closed network connection")
ErrInmemoryListenerClosed indicates that the InmemoryListener is already closed.
ErrTimeout is returned from Read() or Write() on timeout.
This section is empty.
type InmemoryListener struct { }
InmemoryListener provides in-memory dialer<->net.Listener implementation.
It may be used either for fast in-process client<->server communications without network stack overhead or for client<->server tests.
NewInmemoryListener returns new in-memory dialer<->net.Listener.
Accept implements net.Listener's Accept.
It is safe calling Accept from concurrently running goroutines.
Accept returns new connection per each Dial call.
Addr implements net.Listener's Addr.
Close implements net.Listener's Close.
Dial creates new client<->server connection. Just like a real Dial it only returns once the server has accepted the connection.
It is safe calling Dial from concurrently running goroutines.
DialWithLocalAddr creates new client<->server connection. Just like a real Dial it only returns once the server has accepted the connection. The local address of the client connection can be set with local.
It is safe calling Dial from concurrently running goroutines.
SetLocalAddr sets the (simulated) local address for the listener.
type PipeConns struct { }
PipeConns provides bi-directional connection pipe, which use in-process memory as a transport.
PipeConns must be created by calling NewPipeConns.
PipeConns has the following additional features comparing to connections returned from net.Pipe():
PipeConns is NOT safe for concurrent use by multiple goroutines!
NewPipeConns returns new bi-directional connection pipe.
PipeConns is NOT safe for concurrent use by multiple goroutines!
Close closes pipe connections.
Conn1 returns the first end of bi-directional pipe.
Data written to Conn1 may be read from Conn2. Data written to Conn2 may be read from Conn1.
Conn2 returns the second end of bi-directional pipe.
Data written to Conn2 may be read from Conn1. Data written to Conn1 may be read from Conn2.
func (pc *PipeConns) SetAddresses(localAddr1, remoteAddr1, localAddr2, remoteAddr2 net.Addr)
SetAddresses sets the local and remote addresses for the connection.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4