radish

All timeouts are in milliseconds

Types

pub type ExpireCondition {
  NX
  XX
  GT
  LT
}

Constructors

  • NX
  • XX
  • GT
  • LT
pub type KeyType {
  Set
  List
  ZSet
  Hash
  String
  Stream
}

Constructors

  • Set
  • List
  • ZSet
  • Hash
  • String
  • Stream
pub type Message =
  client.Message
pub type Next {
  Continue
  UnsubscribeFromAll
  UnsubscribeFrom(List(String))
}

Constructors

  • Continue
  • UnsubscribeFromAll
  • UnsubscribeFrom(List(String))
pub type StartOption {
  Timeout(Int)
  Auth(String)
  AuthWithUsername(String, String)
}

Constructors

  • Timeout(Int)
  • Auth(String)
  • AuthWithUsername(String, String)

Functions

pub fn append(
  client: Subject(Message),
  key: String,
  value: String,
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn decr(
  client: Subject(Message),
  key: String,
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn decr_by(
  client: Subject(Message),
  key: String,
  value: Int,
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn del(
  client: Subject(Message),
  keys: List(String),
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn exists(
  client: Subject(Message),
  keys: List(String),
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn expire(
  client: Subject(Message),
  key: String,
  ttl: Int,
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn expire_if(
  client: Subject(Message),
  key: String,
  ttl: Int,
  condition: ExpireCondition,
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn get(
  client: Subject(Message),
  key: String,
  timeout: Int,
) -> Result(String, Error)

see here!

pub fn incr(
  client: Subject(Message),
  key: String,
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn incr_by(
  client: Subject(Message),
  key: String,
  value: Int,
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn incr_by_float(
  client: Subject(Message),
  key: String,
  value: Float,
  timeout: Int,
) -> Result(Float, Error)

see here!

pub fn key_type(
  client: Subject(Message),
  key: String,
  timeout: Int,
) -> Result(KeyType, Error)

see here!

pub fn keys(
  client: Subject(Message),
  pattern: String,
  timeout: Int,
) -> Result(List(String), Error)

see here!

pub fn mget(
  client: Subject(Message),
  keys: List(String),
  timeout: Int,
) -> Result(List(String), Error)

see here!

pub fn mset(
  client: Subject(Message),
  kv_list: List(#(String, String)),
  timeout: Int,
) -> Result(String, Error)

see here!

pub fn persist(
  client: Subject(Message),
  key: String,
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn ping(
  client: Subject(Message),
  timeout: Int,
) -> Result(String, Error)

see here! for use with a custom message, use ping_message/3.

pub fn ping_message(
  client: Subject(Message),
  message: String,
  timeout: Int,
) -> Result(String, Error)

see here!

pub fn publish(
  client: Subject(Message),
  channel: String,
  message: String,
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn random_key(
  client: Subject(Message),
  timeout: Int,
) -> Result(String, Error)

see here!

pub fn rename(
  client: Subject(Message),
  key: String,
  new_key: String,
  timeout: Int,
) -> Result(String, Error)

see here!

pub fn renamenx(
  client: Subject(Message),
  key: String,
  new_key: String,
  timeout: Int,
) -> Result(Int, Error)

see here!

pub fn scan(
  client: Subject(Message),
  cursor: Int,
  count: Int,
  timeout: Int,
) -> Result(#(List(String), Int), Error)

see here!

pub fn scan_pattern(
  client: Subject(Message),
  cursor: Int,
  pattern: String,
  count: Int,
  timeout: Int,
) -> Result(#(List(String), Int), Error)

see here!

pub fn scan_pattern_with_type(
  client: Subject(Message),
  cursor: Int,
  key_type: KeyType,
  pattern: String,
  count: Int,
  timeout: Int,
) -> Result(#(List(String), Int), Error)

see here!

pub fn scan_with_type(
  client: Subject(Message),
  cursor: Int,
  key_type: KeyType,
  count: Int,
  timeout: Int,
) -> Result(#(List(String), Int), Error)

see here!

pub fn set(
  client: Subject(Message),
  key: String,
  value: String,
  timeout: Int,
) -> Result(String, Error)

see here!

pub fn set_existing(
  client: Subject(Message),
  key: String,
  value: String,
  timeout: Int,
) -> Result(String, Error)

see here!

pub fn set_new(
  client: Subject(Message),
  key: String,
  value: String,
  timeout: Int,
) -> Result(String, Error)

see here!

pub fn shutdown(client: Subject(Message)) -> Nil
pub fn start(
  host: String,
  port: Int,
  options: List(StartOption),
) -> Result(Subject(Message), StartError)
pub fn subscribe(
  client: Subject(Message),
  channels: List(String),
  init_handler: fn(String, Int) -> Nil,
  message_handler: fn(String, String) -> Next,
  timeout: Int,
) -> Nil

see here! Also see here!

pub fn subscribe_to_patterns(
  client: Subject(Message),
  patterns: List(String),
  init_handler: fn(String, Int) -> Nil,
  message_handler: fn(String, String, String) -> Next,
  timeout: Int,
) -> Nil

see here! Also see here!

Search Document