Sign in

    valkey

    Native async Valkey/Redis client for MoonBit

    Download zip
    Author
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    6 months ago
    Downloads
    158

    Metalymph/valkey does not have a README file

    RespError

    pub suberror RespError {
    InvalidPrefix(Int)
    UnexpectedEndOfStream
    MalformedNumber
    } derive(ToJson,
    Debug
    )
    RespError represents errors occurring during RESP parsing.

    ValkeyError

    pub suberror ValkeyError {
    ConnectionError(String)
    } derive(ToJson,
    Debug
    )
    ValkeyError represents the error types handled by the Valkey driver.

    Client

    pub struct Client {
    conn :
    Tcp

    }
    Client is a native Valkey/Redis client supporting asynchronous operations.

    Client::connect

    async fn Client::connect(host : String, port : Int) -> Client
    connect opens an asynchronous connection to the specified host and port.

    Client::send_command

    async fn Client::send_command(self : Client, args : Array[String]) -> Unit
    send_command encodes and sends a RESP (Redis Serialization Protocol) command to the server.

    RespParser

    pub struct RespParser[R] {
    reader : R
    }
    RespParser handles decoding RESP messages from a stream.

    RespParser::new

    fn[R] RespParser::new(reader : R) -> RespParser[R]
    new creates a new RespParser from an object implementing @io.Reader.

    RespParser::parse_value

    async fn[R :
    Reader
    ] RespParser::parse_value(self : RespParser[R]) -> RespValue
    parse_value decodes a single RespValue from the reader.

    RespValue

    pub enum RespValue {
    SimpleString(String)
    Error(String)
    Integer(Int64)
    BulkString(String?)
    Array(Array[RespValue]?)
    } derive(ToJson,
    Debug
    )
    RespValue represents the different types in the RESP (Redis Serialization Protocol).

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io