Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NopWriteCloser ¶
func NopWriteCloser(writer io.Writer) io.WriteCloser
NopWriteCloser turns any io.Writer into a io.WriteCloser with a nop closer.
This can also be used to ignore Close() events on another WriteCloser. If you need a NopCloser for read, you can use io.NopCloser.
IMPORTANT: discarding a Close() will of course result in the file remaining
open, and corresponding buffers not being flushsed. Be careful when using this.
func ReadOnlyClose ¶
func ReadOnlyClose(woc ReadOnlyCloser) io.ReadCloser
ReadOnlyClose returns an io.ReadCloser that will only close the read channel of the connection passed.
When the object is "Close()", "ReadClose()" will be invoked instead.
func WriteOnlyClose ¶
func WriteOnlyClose(woc WriteOnlyCloser) io.WriteCloser
WriteOnlyClose returns an io.WriteCloser that will only close the write channel of the connection passed.
When the object is "Close()", "WriteClose()" will be invoked instead.
Types ¶
type CleanupListener ¶
type CleanupListener struct { FileListener Path string }
CleanupListener deletes the file at `path` after delegating to the wrapped FileListener's Close().
func (*CleanupListener) Close ¶
func (c *CleanupListener) Close() error
type FileListener ¶
FileListener can represent any net.Listener that also has a File() method.
type PortDescriptor ¶
func AllocatePort ¶
func AllocatePort() (*PortDescriptor, error)
type ReadOnlyCloser ¶
ReadOnlyCloser is any object that is capable of closing the read direction without closing the write direction.
This is typical of eg, TCP connection where a shutdown() call can close one direction but not the other.
type WriteOnlyCloser ¶
WriteOnlyCloser is any object that is capable of closing the write direction without closing the read direction.
This is typical of eg, TCP connection where a shutdown() call can close one direction but not the other.