Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Request

Builder for REDIS requests that will be encoded according to the RESP protocol was introduced in Redis 1.2. Which became the standard way for talking with the Redis server in Redis 2.0.

Redis protocol documentation states:

Clients send commands to a Redis server as a RESP Array of Bulk Strings.

So all non String/Bulk types will be encoded to Bulk for convenience.

Hierarchy

  • Request

Index

Methods

arg

  • Adds a String argument using UTF8 character encoding

    Parameters

    • arg: string

    Returns Request

  • Adds a String using a specific character encoding argument

    Parameters

    • arg: string
    • enc: string

    Returns Request

  • Adds a String key argument

    Parameters

    • arg: Buffer

    Returns Request

  • Adds a long encoded to string

    Parameters

    • arg: number

    Returns Request

  • Adds a boolean encoded to string

    Parameters

    • arg: boolean

    Returns Request

  • Adds a JsonObject argument, the encoding will serialize the json as key0, value0, key1, value1, ... keyN, valueN. This is a non-optimized serialization and will just use the string encoding of the values for non buffers.

    Parameters

    • arg: {}
      • [key: string]: any

    Returns Request

  • Adds a JsonArray argument, the encoding will serialize the json as value0, value1, ... valueN. This is a non-optimized serialization and will just use the string encoding of the values for non buffers.

    Parameters

    • arg: any[]

    Returns Request

  • Adds a byte array

    Parameters

    • arg: number[]

    Returns Request

  • Adds a int encoded to string

    Parameters

    • arg: number

    Returns Request

  • Adds a short encoded to string

    Parameters

    • arg: number

    Returns Request

  • Adds a byte encoded to string

    Parameters

    • arg: number

    Returns Request

command

  • Get the Command that is to be used by this request.

    Returns Command

nullArg

  • Adds a NULL encoded string

    Returns Request

Static cmd

  • Parameters

    Returns Request

Generated using TypeDoc