Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOnCloseWriter ¶
func NewOnCloseWriter(buff LenReadWriter, f func(r io.Reader, len int64) (err error)) io.WriteCloser
NewOnCloseWriter returns a write-closer whose results (and length) will be fed to the named function at the close of the returned descriptor.
You may specify any 'bytes.Buffer' like object that offers Read/Write/Len functions or leave it nil, and a default bytes.NewBuffer() will be created
Types ¶
type LenReadWriter ¶
type LenReadWriter interface { io.ReadWriter Len() int }
LenReadWriter extends io.ReadWriter with a Len() func.
type OnCloseWriter ¶
type OnCloseWriter struct {
// contains filtered or unexported fields
}
OnCloseWriter invokes a callback on closing.
func (*OnCloseWriter) Close ¶
func (w *OnCloseWriter) Close() (err error)
Close closes this writer and invokes the onClose callback.
Click to show internal directories.
Click to hide internal directories.