componentized/directory

componentized:valkey

interface

A WASM component client for Valkey (and Redis).

interface resp componentized:valkey/resp

Types

type error

  • string

type nested-value

Values nested within an aggregate type. Since WIT types are not allowed to depend on themselves, nested values are stored as encoded RESP.

  • list<u8>

variant value

Functions

functiondecode: func(data: list<u8>) -> result<value, error>

functionencode: func(value: value) -> result<list<u8>, error>

WIT

interface resp {
  type error = string;

  /// Values nested within an aggregate type. Since WIT types are not allowed to depend on
  /// themselves, nested values are stored as encoded RESP.
  type nested-value = list<u8>;

  variant value {
    %string(string),
    error(string),
    integer(s64),
    bulk-string(string),
    array(list<nested-value>),
    null,
    boolean(bool),
    double(f64),
    big-number(string),
    bulk-error(string),
    verbatim-string(tuple<string, string>),
    %map(list<tuple<nested-value, nested-value>>),
    set(list<nested-value>),
    push(list<nested-value>),
  }

  decode: func(data: list<u8>) -> result<value, error>;

  encode: func(value: value) -> result<list<u8>, error>;
}