Documentation
¶
Overview ¶
Package valkeyclient provides a lightweight Valkey/Redis RESP protocol client for health checking and replication monitoring.
Index ¶
- type Client
- func (c *Client) DBSize() (int, error)
- func (c *Client) InfoReplication() (*ReplicationInfo, error)
- func (c *Client) Ping() error
- func (c *Client) SentinelFailover(name string) error
- func (c *Client) SentinelMaster(name string) (*SentinelMasterInfo, error)
- func (c *Client) SentinelMonitorAdd(name, ip string, port, quorum int) error
- func (c *Client) SentinelRemove(name string) error
- func (c *Client) SentinelReset(pattern string) error
- func (c *Client) SentinelSet(name, option, value string) error
- func (c *Client) Wait(numReplicas int, timeoutMs int) (int, error)
- type ReplicationInfo
- type SentinelMasterInfo
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 a minimal Valkey/Redis client using raw RESP protocol. It does not depend on any external Redis Go client library.
func (*Client) DBSize ¶
DBSize sends the DBSIZE command and returns the number of keys in the current database.
func (*Client) InfoReplication ¶
func (c *Client) InfoReplication() (*ReplicationInfo, error)
InfoReplication sends INFO replication and parses the result.
func (*Client) SentinelFailover ¶
SentinelFailover sends SENTINEL FAILOVER <name> to trigger a manual failover.
func (*Client) SentinelMaster ¶
func (c *Client) SentinelMaster(name string) (*SentinelMasterInfo, error)
SentinelMaster sends SENTINEL MASTER <name> and parses the result.
func (*Client) SentinelMonitorAdd ¶
SentinelMonitorAdd sends SENTINEL MONITOR <name> <ip> <port> <quorum> to add a new master to sentinel monitoring.
func (*Client) SentinelRemove ¶
SentinelRemove sends SENTINEL REMOVE <name> to remove a monitored master and all its associated replicas and sentinels from sentinel's tracking.
func (*Client) SentinelReset ¶
SentinelReset sends SENTINEL RESET <pattern> to reset all matching masters. This clears the sentinel's internal failover cooldown state, allowing a new failover to be triggered immediately. The pattern "*" matches all masters.
func (*Client) SentinelSet ¶
SentinelSet sends SENTINEL SET <name> <option> <value> to change a sentinel configuration parameter for a monitored master.