RESP Arrays
RESP Bulk Strings
RESP Bulk Strings
There can be 2 cases:
null
bulk strings, where the length is -1 and no actual underlying string is presentNon-null BulkStrings can be constructed using the RESPBuilders#bulk method
import laserdisc.protocol.RESP._ val nonNullBulkString: NonNullBulkString = bulk("some string") val nullBulkString: NullBulkString = nullBulk
A forwarder for null
BulkStrings is present too and represented
using the final val
s RESPBuilders.nullBulk
RESP Errors
RESP Errors
RESP Errors are also scala.RuntimeExceptions, although where possible they will not contain stacktrace data
These can be constructed by using the RESPBuilders#err method
import laserdisc.protocol.RESP._ val error: Error = err("some error message")
RESP Integers
RESP Integers
These can be constructed by using the RESPBuilders#int method
import laserdisc.protocol.RESP._ val integer: Integer = int(42)
Sometimes the values 0 and 1 are used to represent boolean values. In this case 0 corresponds to False while 1 to True, respectively.
This is the special case of a non-nil RESP Array
This is the special case of a non-nil RESP Array
These can be constructed by using the RESPBuilders#arr(xs: Seq[RESP]) method
or
by resorting to the overloaded RESPBuilders#arr(one: RESP, rest: RESP*) method which expects one parameter to be supplied followed by a (possibly empty) sequence of RESPs (vararg).
This is the special case of a non-null RESP BulkString
This is the special case of a non-null RESP BulkString
These can be constructed by using the RESPBuilders#bulk method
This sealed trait represents the entire Redis Serialization Protocol algebra
Concrete instances of this trait must be created using this trait's companion object's methods, were scodec.Codecs for each are also defined
RESP Simple Strings
RESP Simple Strings
These can be constructed by using the RESPBuilders#str method
import laserdisc.protocol.RESP._ val simpleString: SimpleString = str("some string")
Sometimes the value "OK" is used to represent a successful acknowledgement/processing of a command.
RESP Arrays
There can be 2 cases:
nil
arrays, where the length is -1 and no array element is presentNon-nil Arrays can be constructed using the RESPBuilders#arr(xs: Seq[RESP]) method.
A forwarder for
,nil
is present too and represented using thefinal val
s RESPBuilders.nilArrayRESPBuilders#arr(one: RESP, rest: RESP*) is an overload which supports the creation of guaranteed non-empty sequences only. This is achieved through the usage of one fixed parameter followed by a var-arg of the same