Documentation
¶
Overview ¶
Package transmit provides utility functions to proxy data through network connections, with control over timeouts.
Index ¶
Constants ¶
const DTU int64 = 1500
DTU is the default trasmitting unit used when copying data from one connection to another.
const DefaultIdleTimeout time.Duration = time.Minute * 5
DefaultIdleTimeout is the default duration of 5 minutes used to determine when to close an idle connection.
Variables ¶
This section is empty.
Functions ¶
func Data ¶
Data copies data from src to dst and the other way around. Closes the connections when no data is transferred for a defined duration, i.e. the idleTimeout value stored in the context or the DefaultIdleTimeout, if the former is not present.
func DurationFromContext ¶
DurationFromContext extracts the idleTimeout from the context.
func NewContext ¶
NewContext returns a context that stores the idleTimeout inside its Value field.
Types ¶
This section is empty.