Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
// FragmentSizeLength is the length of the encoded size of a message
FragmentSizeLength = 4
)
Functions ¶
func DecodeRead ¶
func DecodeRead(conn net.Conn, obj Serializable) (err error)
DecodeRead tries to decode a serialized object that was encoded via the Iterum defaults as described in `transmit.Encode` and Read from the passed connection
func EncodeSend ¶
func EncodeSend(conn net.Conn, obj Serializable) (err error)
EncodeSend encodes a serializable object via the Iterum defaults:
unsigned 32bit int msg length, followed by the encoded object
If the message size exceeds 2^16 it is send in chunks of 2^16 bytes Then it sends it on the target connection
Types ¶
type ConnectionError ¶
type ConnectionError struct {
Err error
}
ConnectionError is raised when something with net.Conn fails (such as reading or writing)
func ErrConnection ¶
func ErrConnection(err error) *ConnectionError
ErrConnection is used to raise a ConnectionError embedding another error
func (ConnectionError) Error ¶
func (err ConnectionError) Error() string
func (*ConnectionError) Unwrap ¶
func (err *ConnectionError) Unwrap() error
type Serializable ¶
Serializable is an interface describing structures that can be encoded and decoded
type SerializationError ¶
type SerializationError struct {
Err error
}
SerializationError is raised when serialize or deserialize fails
func ErrSerialization ¶
func ErrSerialization(err error) *SerializationError
ErrSerialization is used to raise a SerializationError embedding another error
func (*SerializationError) Error ¶
func (err *SerializationError) Error() string
func (*SerializationError) Unwrap ¶
func (err *SerializationError) Unwrap() error