Documentation
¶
Index ¶
- type Reader
- func (r *Reader) GetBuffer() *bytes.Buffer
- func (r *Reader) Read(p []byte) (n int, err error)
- func (r *Reader) ReadArray() ([]types.FieldValue, error)
- func (r *Reader) ReadBoolean() (bool, error)
- func (r *Reader) ReadByte() (byte, error)
- func (r *Reader) ReadByteArray() ([]byte, error)
- func (r *Reader) ReadByteArrayWithInt() ([]byte, error)
- func (r *Reader) ReadDouble() (float64, error)
- func (r *Reader) ReadFieldValue() (types.FieldValue, error)
- func (r *Reader) ReadInt() (int, error)
- func (r *Reader) ReadInt16() (int16, error)
- func (r *Reader) ReadMap() (*types.MapValue, error)
- func (r *Reader) ReadNonNilString() (string, error)
- func (r *Reader) ReadPackedInt() (int, error)
- func (r *Reader) ReadPackedLong() (int64, error)
- func (r *Reader) ReadString() (*string, error)
- func (r *Reader) ReadVersion() (types.Version, error)
- type Writer
- func (w *Writer) Bytes() []byte
- func (w *Writer) Reset()
- func (w *Writer) Size() int
- func (w *Writer) Write(p []byte) (n int, err error)
- func (w *Writer) WriteArray(value []types.FieldValue) (n int, err error)
- func (w *Writer) WriteBoolean(value bool) (int, error)
- func (w *Writer) WriteByte(b byte) error
- func (w *Writer) WriteByteArray(value []byte) (n int, err error)
- func (w *Writer) WriteByteArrayWithInt(value []byte) (n int, err error)
- func (w *Writer) WriteCapacityMode(lm types.CapacityMode, serialVersion int16) (int, error)
- func (w *Writer) WriteConsistency(c types.Consistency) (int, error)
- func (w *Writer) WriteDouble(value float64) (int, error)
- func (w *Writer) WriteDurability(c types.Durability, serialVersion int16) (int, error)
- func (w *Writer) WriteFieldRange(fieldRange *types.FieldRange) (n int, err error)
- func (w *Writer) WriteFieldValue(value types.FieldValue) (int, error)
- func (w *Writer) WriteInt(value int) (int, error)
- func (w *Writer) WriteInt16(value int16) (int, error)
- func (w *Writer) WriteIntAtOffset(value int, offset int) (int, error)
- func (w *Writer) WriteMap(value *types.MapValue) (n int, err error)
- func (w *Writer) WriteOpCode(op proto.OpCode) (int, error)
- func (w *Writer) WritePackedInt(value int) (int, error)
- func (w *Writer) WritePackedLong(value int64) (int, error)
- func (w *Writer) WriteSerialVersion(v int16) (int, error)
- func (w *Writer) WriteString(value *string) (n int, err error)
- func (w *Writer) WriteTTL(ttl *types.TimeToLive) (n int, err error)
- func (w *Writer) WriteTimeout(timeout time.Duration) (int, error)
- func (w *Writer) WriteVersion(version types.Version) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reads byte sequences from the underlying io.Reader and decodes the bytes to construct in-memory representations according to the Binary Protocol which defines the data exchange format between the Oracle NoSQL Database proxy and drivers.
Reader implements the io.Reader and io.ByteReader interfaces.
func (*Reader) Read ¶
Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered.
func (*Reader) ReadArray ¶
func (r *Reader) ReadArray() ([]types.FieldValue, error)
ReadArray reads a structured byte sequences that represent the encoding of an array, decodes the bytes and returns as a slice of types.FieldValue.
func (*Reader) ReadBoolean ¶
ReadBoolean reads and decodes a single byte as a bool value. A zero byte is decoded as false, and any other non-zero byte is decoded as true.
func (*Reader) ReadByteArray ¶
ReadByteArray reads byte sequences and returns as a slice of byte or any error encountered. The returned bytes could be nil.
func (*Reader) ReadByteArrayWithInt ¶
ReadByteArrayWithInt reads byte sequences and returns as a slice of byte or any error encountered. The returned bytes is non-nil.
func (*Reader) ReadDouble ¶
ReadDouble reads and decodes 8 bytes as a float64 value.
func (*Reader) ReadFieldValue ¶
func (r *Reader) ReadFieldValue() (types.FieldValue, error)
ReadFieldValue reads a fixed or variable length of bytes, decodes them as a value of a table field and returns the value or any error encountered.
func (*Reader) ReadMap ¶
ReadMap reads a structured byte sequences that represent the encoding of a Map value, decodes the bytes and returns as an ordered *types.MapValue.
func (*Reader) ReadNonNilString ¶ added in v1.4.0
ReadNonNilString reads a string. If there is an error, it will return an empty string and the error.
func (*Reader) ReadPackedInt ¶
ReadPackedInt reads a variable length of bytes that is an encoding of packed integer, decodes the bytes as an int32 value.
func (*Reader) ReadPackedLong ¶
ReadPackedLong reads a variable length of bytes that is an encoding of packed long value, decodes the bytes as an int64 value.
func (*Reader) ReadString ¶
ReadString reads a variable length of bytes that is an encoding of packed UTF-8 string value, decodes the bytes as a string. It returns a pointer to the string value or any error encountered.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer encodes data into the wire format for the Binary Protocol and writes to a buffer. The Binary Protocol defines the data exchange format between the Oracle NoSQL Database proxy and drivers.
Writer implements the io.Write and io.ByteWriter interfaces.
func (*Writer) WriteArray ¶
func (w *Writer) WriteArray(value []types.FieldValue) (n int, err error)
WriteArray encodes and writes an array of FieldValues to the buffer.
func (*Writer) WriteBoolean ¶
WriteBoolean encodes and writes the bool value to the buffer. A true value is encoded as 1 while a false value is encoded as 0.
func (*Writer) WriteByteArray ¶
WriteByteArray encodes and writes a slice of bytes to the buffer. The slice of bytes could be nil.
func (*Writer) WriteByteArrayWithInt ¶
WriteByteArrayWithInt encodes and writes a slice of bytes to the buffer. The slice of bytes must be non-nil.
func (*Writer) WriteCapacityMode ¶ added in v1.3.0
WriteCapacityMode encodes and writes the limits mode value to the buffer.
func (*Writer) WriteConsistency ¶
func (w *Writer) WriteConsistency(c types.Consistency) (int, error)
WriteConsistency encodes and writes the consistency value to the buffer.
func (*Writer) WriteDouble ¶
WriteDouble encodes and writes the float64 value to the buffer.
func (*Writer) WriteDurability ¶ added in v1.3.0
WriteDurability encodes and writes the Durability value to the buffer.
func (*Writer) WriteFieldRange ¶
func (w *Writer) WriteFieldRange(fieldRange *types.FieldRange) (n int, err error)
WriteFieldRange encodes and writes the FieldRange to the buffer.
func (*Writer) WriteFieldValue ¶
func (w *Writer) WriteFieldValue(value types.FieldValue) (int, error)
WriteFieldValue encodes and writes the specified field value to the buffer.
func (*Writer) WriteInt ¶
WriteInt encodes and writes the int value to the buffer. It assumes the provided value fits into a signed 32-bit integer.
func (*Writer) WriteInt16 ¶
WriteInt16 encodes and writes the int16 value to the buffer.
func (*Writer) WriteIntAtOffset ¶ added in v1.4.0
WriteIntAtOffset encodes and writes the int value to the buffer at a specific offset. It assumes the provided value fits into a signed 32-bit integer.
func (*Writer) WriteOpCode ¶
WriteOpCode encodes and writes the OpCode op to the buffer.
func (*Writer) WritePackedInt ¶
WritePackedInt encodes the int value using packed integer encoding and writes to the buffer. It assumes the provided value fits into a signed 32-bit integer.
func (*Writer) WritePackedLong ¶
WritePackedLong encodes the int64 value using packed long encoding and writes to the buffer.
func (*Writer) WriteSerialVersion ¶
WriteSerialVersion encodes and writes the SerialVersion v to the buffer.
func (*Writer) WriteString ¶
WriteString encodes and writes the string value to the buffer.
func (*Writer) WriteTTL ¶
func (w *Writer) WriteTTL(ttl *types.TimeToLive) (n int, err error)
WriteTTL encodes and writes the TTL value to the buffer.
func (*Writer) WriteTimeout ¶
WriteTimeout encodes and writes the timeout value to the buffer.