respclient

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package respclient is a minimal blocking RESP client for talking to a running aki or Redis instance over the wire. MIGRATE uses it on the server side to push keys to a target, and the CLI uses it for networked dump and import. It writes requests as RESP arrays and parses replies with the shared decoder, holding one read buffer across calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is one connection to a remote instance. It is not safe for concurrent use: each call writes a command and reads its reply before returning.

func Dial

func Dial(addr string, timeout time.Duration) (*Client, error)

Dial connects to addr. A non-zero timeout arms a single deadline that bounds the whole conversation on the connection, which is how MIGRATE enforces its timeout. A zero timeout means no deadline.

func (*Client) Call

func (c *Client) Call(args ...[]byte) (resp.RESPValue, error)

Call writes one command as a RESP array of bulk strings and reads a single reply. Byte-slice arguments keep binary payloads such as a DUMP blob intact.

func (*Client) CallStr

func (c *Client) CallStr(args ...string) (resp.RESPValue, error)

CallStr is Call for commands whose arguments are all plain strings.

func (*Client) Close

func (c *Client) Close()

Close shuts the connection.

func (*Client) ReadReply

func (c *Client) ReadReply() (resp.RESPValue, error)

ReadReply decodes the next complete value from the connection, reading more bytes whenever the buffer holds only a partial value.

func (*Client) Send

func (c *Client) Send(args [][]byte) error

Send writes a command as a RESP array of bulk strings without reading a reply. It is exported so a caller can pipeline several commands and read the replies in order afterwards.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL