Documentation ¶
Overview ¶
rw is the read-write package for reading and writing types from the OrientDB binary network protocol. Reading is done via io.Reader and writing is done to bytes.Buffer (since the extra functionality of byte.Buffer is desired). All the OrientDB types are represented here for non-encoded forms. For varint and zigzag encoding/decoding handling use the obinary/varint package instead.
Index ¶
- Constants
- func ReadBool(rdr io.Reader) (bool, error)
- func ReadByte(rdr io.Reader) (byte, error)
- func ReadBytes(rdr io.Reader) ([]byte, error)
- func ReadDouble(rdr io.Reader) (float64, error)
- func ReadErrorResponse(rdr io.Reader) (oerror.OServerException, error)
- func ReadFloat(rdr io.Reader) (float32, error)
- func ReadInt(rdr io.Reader) (int32, error)
- func ReadLong(rdr io.Reader) (int64, error)
- func ReadShort(rdr io.Reader) (int16, error)
- func ReadString(rdr io.Reader) (string, error)
- func WriteBool(w io.Writer, b bool) error
- func WriteByte(w io.Writer, b byte) error
- func WriteBytes(w io.Writer, bs []byte) error
- func WriteDouble(w io.Writer, f float64) error
- func WriteFloat(w io.Writer, f float32) error
- func WriteInt(w io.Writer, n int32) error
- func WriteLong(w io.Writer, n int64) error
- func WriteNull(w io.Writer) error
- func WriteRawBytes(w io.Writer, bs []byte) error
- func WriteShort(w io.Writer, n int16) error
- func WriteString(w io.Writer, s string) error
- func WriteStrings(w io.Writer, ss ...string) error
Constants ¶
const DEFAULT_RETVAL = 255
Variables ¶
This section is empty.
Functions ¶
func ReadBool ¶
Reads one byte from the Reader. If the byte is zero, then false is returned, otherwise true. If error is non-nil, then the bool value is undefined.
func ReadBytes ¶
ReadBytes reads in an OrientDB byte array. It reads the first 4 bytes from the Reader as an int to determine the length of the byte array to read in. If the specified size of the byte array is 0 (empty) or negative (null) nil is returned for the []byte.
func ReadErrorResponse ¶
func ReadErrorResponse(rdr io.Reader) (oerror.OServerException, error)
ReadErrorResponse reads an "Exception" message from the OrientDB server. The OrientDB server can return multiple exceptions, all of which are incorporated into a single ogonori OServerException Error struct. If error (the second return arg) is not nil, then there was a problem reading the server exception on the wire.
func ReadString ¶
ReadString xxxx If the string size is 0 an empty string and nil error are returned
func WriteBool ¶
WriteBool writes byte(1) for true and byte(0) for false to the wfer, as specified by the OrientDB spec.
func WriteBytes ¶
WriteBytes is meant to be used for writing a structure that the OrientDB will interpret as a byte array, usually a serialized datastructure. This means the first thing written to the wfer is the size of the byte array. If you want to write bytes without the the size prefix, use WriteRawBytes instead.
func WriteDouble ¶
WriteDouble writes a float64 in big endian order to the wfer
func WriteFloat ¶
WriteFloat writes a float32 in big endian order to the wfer
func WriteRawBytes ¶
WriteRawBytes just writes the bytes, not prefixed by the size of the []byte
func WriteShort ¶
WriteShort writes a int16 in big endian order to the wfer
Types ¶
This section is empty.