Documentation ¶
Overview ¶
Package must defines fail-fast smart error handlers.
Index ¶
- type Handler
- type ReadWriter
- func (rw ReadWriter) Must(n int64, err error)
- func (rw ReadWriter) ReadByteArray(r io.Reader, length int) (v []byte)
- func (rw ReadWriter) ReadFloat32(r io.Reader) (v float32)
- func (rw ReadWriter) ReadFloat64(r io.Reader) (v float64)
- func (rw ReadWriter) ReadInt16(r io.Reader) (v int16)
- func (rw ReadWriter) ReadInt32(r io.Reader) (v int32)
- func (rw ReadWriter) ReadInt64(r io.Reader) (v int64)
- func (rw ReadWriter) ReadInt8(r io.Reader) (v int8)
- func (rw ReadWriter) Reset()
- func (rw ReadWriter) Result() (n int64, err error)
- func (rw ReadWriter) WriteByteArray(w io.Writer, value []byte)
- func (rw ReadWriter) WriteFloat32(w io.Writer, value float32)
- func (rw ReadWriter) WriteFloat64(w io.Writer, value float64)
- func (rw ReadWriter) WriteInt16(w io.Writer, value int16)
- func (rw ReadWriter) WriteInt32(w io.Writer, value int32)
- func (rw ReadWriter) WriteInt64(w io.Writer, value int64)
- func (rw ReadWriter) WriteInt8(w io.Writer, value int8)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
Err error
}
Handler errors out on the first error. It keeps a counter of bytes read.
type ReadWriter ¶
ReadWriter keeps a counter of bytes read or write when dealing with 'io.Reader's and/or 'io.Writer's. Whenever an error is found all pending reads and writes are ignored.
func (ReadWriter) Must ¶
func (rw ReadWriter) Must(n int64, err error)
Must provides a hook for foreign functions using 'io.Reader's or 'io.Writer's.
func (ReadWriter) ReadByteArray ¶
func (rw ReadWriter) ReadByteArray(r io.Reader, length int) (v []byte)
func (ReadWriter) ReadFloat32 ¶
func (rw ReadWriter) ReadFloat32(r io.Reader) (v float32)
func (ReadWriter) ReadFloat64 ¶
func (rw ReadWriter) ReadFloat64(r io.Reader) (v float64)
func (ReadWriter) Result ¶
func (rw ReadWriter) Result() (n int64, err error)
Result returns all bytes read and the first error found.
func (ReadWriter) WriteByteArray ¶
func (rw ReadWriter) WriteByteArray(w io.Writer, value []byte)
func (ReadWriter) WriteFloat32 ¶
func (rw ReadWriter) WriteFloat32(w io.Writer, value float32)
func (ReadWriter) WriteFloat64 ¶
func (rw ReadWriter) WriteFloat64(w io.Writer, value float64)
func (ReadWriter) WriteInt16 ¶
func (rw ReadWriter) WriteInt16(w io.Writer, value int16)
func (ReadWriter) WriteInt32 ¶
func (rw ReadWriter) WriteInt32(w io.Writer, value int32)
func (ReadWriter) WriteInt64 ¶
func (rw ReadWriter) WriteInt64(w io.Writer, value int64)
Click to show internal directories.
Click to hide internal directories.