radish

Functions

pub fn connect(host: String, port: Int) -> Result(Socket, Error)
pub fn decr(socket: Socket, key: String) -> Result(Int, Error)

subtracts 1 from an integer and returns the new value

pub fn decr_by(
  socket: Socket,
  key: String,
  value: Int,
) -> Result(Int, Error)

subtracts an arbitrary value from an integer and returns the new value

pub fn del(
  socket: Socket,
  keys: List(String),
) -> Result(Int, Error)
pub fn exists(
  socket: Socket,
  keys: List(String),
) -> Result(Int, Error)
pub fn get(socket: Socket, key: String) -> Result(String, Error)
pub fn incr(socket: Socket, key: String) -> Result(Int, Error)

adds 1 to an integer and returns the new value

pub fn incr_by(
  socket: Socket,
  key: String,
  value: Int,
) -> Result(Int, Error)

adds an arbitrary value to an integer and returns the new value

pub fn incr_by_float(
  socket: Socket,
  key: String,
  value: Float,
) -> Result(Float, Error)

adds an arbitrary float value to a number and returns the new value

pub fn keys(
  socket: Socket,
  pattern: String,
) -> Result(List(String), Error)
pub fn set(
  socket: Socket,
  key: String,
  value: String,
  ttl: Option(Int),
) -> Result(String, Error)
pub fn set_existing(
  socket: Socket,
  key: String,
  value: String,
  ttl: Option(Int),
) -> Result(String, Error)

only sets a key if it already exists, returns the old value

pub fn set_new(
  socket: Socket,
  key: String,
  value: String,
  ttl: Option(Int),
) -> Result(String, Error)

only sets a key if it does not already exist

Search Document