Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RedirectFanIn ¶
func RedirectFanIn(Context context.Context, ChannelPool *ActiveChannelPool, FanInReceiver Receiver, FanInSender Sender, TunnelInitialier TunnelInitialier) error
RedirectFanIn will keep calling `FanInReceiver` to get a packet including data and a sender ID. Bridge the connection initialized with `TunnelInitialier` and returns its response back through `FanInSender`.
Types ¶
type ActiveChannelPool ¶ added in v0.0.27
type ActiveChannelPool struct {
// contains filtered or unexported fields
}
ActiveChannelPool keeps tracks of active UDP connections.
func NewChannelPool ¶ added in v0.0.27
func NewChannelPool(Context context.Context, Config *RedirectionConfig) *ActiveChannelPool
NewChannelPool creates a shared pool to store active connections safely.
type Receiver ¶
Receiver takes an empty buffer as input, returns from which offset to start, the end offset, the identifier of the sender, or an error.
type RedirectionConfig ¶
type RedirectionConfig struct { // The timeout of a connection in idle state. Timeout time.Duration // FanIn function will allocate buffer in `BufferSize` while listening. A too large size might cause OOMing. BufferSize int64 }
RedirectionConfig specifies the configuration of stateless fan-in forwarding.
Click to show internal directories.
Click to hide internal directories.