package protocol
- Source
- package.scala
- Alphabetic
- By Inheritance
- protocol
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class Arr(elements: List[RESP]) extends GenArr with Product with Serializable
This is the special case of a non-nil RESP GenArr
This is the special case of a non-nil RESP GenArr
These can be constructed either by the default case class' apply by resorting to the overloaded Arr#apply(one: RESP, rest: RESP*) method which expects one parameter to be supplied followed by a (possibly empty) sequence of RESPs (vararg).
- elements
The wrapped array values, as a scala.List of RESP
- trait BListBaseP extends AnyRef
- trait BListExtP extends AnyRef
- trait BListP extends BListBaseP with BListExtP
- final case class Bulk(value: String) extends GenBulk with Product with Serializable
This is the special case of a non-null RESP GenBulk
This is the special case of a non-null RESP GenBulk
These can be constructed by using the RESPBuilders#bulk method
- value
The wrapped bulk string value
- trait ClusterP extends AnyRef
- trait ConnectionP extends AnyRef
- final case class Err(message: String) extends LaserDiscRuntimeError with RESP with Product with Serializable
RESP Errors
RESP Errors
RESP Errs are also scala.RuntimeExceptions, although where possible they will not contain stacktrace data
- message
The wrapped exception's message
val e: Err = Err("some error message")
Example: - sealed trait GenArr extends RESP
RESP Arrays
RESP Arrays
There can be 2 cases:
nil
arrays, where the length is -1 and no array element is present- actual (non-nil) arrays, where the length is >= 0
val arr: Arr = Arr(List(Str("hello"), Str("world"))) val guaranteedNonEmpty: Arr = Arr(Str("hello"), Str("world")) val empty: Arr = Arr(List.empty) val nil: NilArr = NilArr
- Note
Arr#apply(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
Example: - sealed trait GenBulk extends RESP
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 present- actual (non-null) bulk strings, where the length is >= 0
val b: Bulk = Bulk("some string") val nb: NullBulk = NullBulk
- See also
Example: - trait GeoBaseP extends AnyRef
- trait GeoExtP extends AnyRef
- trait GeoP extends GeoBaseP with GeoExtP
- trait HashBaseP extends AnyRef
- trait HashExtP extends AnyRef
- trait HashP extends HashBaseP with HashExtP
- trait HyperLogLogBaseP extends AnyRef
- trait HyperLogLogExtP extends AnyRef
- trait HyperLogLogP extends HyperLogLogBaseP with HyperLogLogExtP
- trait KeyBaseP extends AnyRef
- trait KeyExtP extends AnyRef
- trait KeyP extends KeyBaseP with KeyExtP
- final class LenientStringCodec extends Codec[String]
- trait ListBaseP extends AnyRef
- trait ListExtP extends AnyRef
- trait ListP extends ListBaseP with ListExtP
- final case class Num(value: Long) extends RESP with Product with Serializable
RESP Integers
RESP Integers
- value
The wrapped long value
val n: Num = Num(42)
- Note
Sometimes the values 0 and 1 are used to represent boolean values. In this case 0 corresponds to False while 1 to True, respectively.
Example: - sealed trait Protocol extends Request with Response
- sealed trait ProtocolCodec[A] extends Any
- trait PublishP extends AnyRef
- sealed trait RESP extends Serializable
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
- See also
RESPBuilders
- sealed trait RESPCodecs extends BitVectorSyntax
- sealed trait RESPCoproduct extends AnyRef
- final case class RESPDecErr(message: String) extends LaserDiscRespProtocolDecodingError with Product with Serializable
- sealed trait RESPFunctions extends EitherSyntax
- trait RESPParamWrite[A] extends AnyRef
- Annotations
- @implicitNotFound("""Implicit not found RESPParamWrite[${A}].
Normally you would not need to define one manually, as one will be derived for you automatically iff:
- an instance of Show[${A}] is in scope
- ${A} is a List whose LUB has a RESPParamWrite instance defined
- ${A} is an HList whose elements all have a RESPParamWrite instance defined
""")
- trait RESPRead[A] extends AnyRef
- Annotations
- @implicitNotFound("""Implicit not found RESPRead[${A}].
You should not need to define one manually, as one will be derived for you automatically iff:
- evidence of a Read instance from some sum/co-product to ${A} can be provided
- this sum/co-product is a subset of the sum-co-product for RESP
""")
- trait Read[A, B] extends AnyRef
- Annotations
- @implicitNotFound("""Implicit not found Read[${A}, ${B}].
Try writing your own, for example:
implicit final val myRead: Read[${A}, ${B}] = new Read[${A}, ${B}] {
override final def read(a: ${A}): Option[${B}] = ???
}
Note 1: you can use the factory method Read.instance instead of creating it manually as shown above
Note 2: make sure to inspect the combinators as you may be able to leverage some other Read instance
""")
- trait ReadInstances0 extends ReadInstances1
- trait ReadInstances1 extends EitherSyntax with ReadInstances2
- sealed trait ReadInstances2 extends AnyRef
- sealed trait Request extends AnyRef
- sealed trait Response extends AnyRef
- trait ServerP extends AnyRef
- trait SetBaseP extends AnyRef
- trait SetExtP extends AnyRef
- trait SetP extends SetBaseP with SetExtP
- trait Show[A] extends AnyRef
- Annotations
- @implicitNotFound("""Implicit not found Show[${A}].
Try writing your own, for example:
implicit final val myShow: Show[${A}] = new Show[${A}] {
override final def show(a: ${A}): String = ???
}
""")
- trait SortedSetBaseP extends AnyRef
- trait SortedSetExtP extends AnyRef
- trait SortedSetP extends SortedSetBaseP with SortedSetExtP
- final case class Str(value: String) extends RESP with Product with Serializable
RESP Simple Strings
RESP Simple Strings
- value
The wrapped string value
val s: Str = Str("some string")
- Note
Sometimes the value "OK" is used to represent a successful acknowledgement/processing of a command.
Example: - trait StringBaseP extends AnyRef
- trait StringExtP extends AnyRef
- trait StringP extends StringBaseP with StringExtP
- trait TransactionP extends AnyRef
Value Members
- object Arr extends Serializable
- object BitVectorDecoding
- object Bulk extends Serializable
- object ClusterP
- object GeoP
- object KeyP
- object ListP
- case object NilArr extends GenArr with Product with Serializable
- case object NullBulk extends GenBulk with Product with Serializable
- object Protocol
- object RESP extends RESPCodecs with RESPCoproduct with RESPFunctions with Serializable
- object RESPParamWrite extends RESPParamWriteInstances
- object RESPRead
- object Read extends ReadInstances0
- object ServerP
- object Show extends ShowInstances
- object SortedSetP
- object Str extends Serializable
- object StringP