Documentation
¶
Index ¶
- type ConnectivityCheck
- type CountCheck
- type Instance
- type MasterLinkCheck
- type MemoryUsageCheck
- type MinCountCheck
- type OpsPerSecondCheck
- type Partial
- type PersistenceCheck
- type RedisAccessor
- func (a *RedisAccessor) ClientList() (string, error)
- func (a *RedisAccessor) Close() error
- func (a *RedisAccessor) Command(args ...string) (string, error)
- func (a *RedisAccessor) ConfigGet(pattern string) (string, error)
- func (a *RedisAccessor) DBSize() (string, error)
- func (a *RedisAccessor) Info(section string) (map[string]string, error)
- func (a *RedisAccessor) InfoRaw(section string) (string, error)
- func (a *RedisAccessor) Ping() error
- func (a *RedisAccessor) SlowlogGet(count int) (string, error)
- func (a *RedisAccessor) Target() string
- type RedisAccessorConfig
- type RedisPlugin
- type ResponseTimeCheck
- type RoleCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectivityCheck ¶
type ConnectivityCheck struct {
Severity string `toml:"severity"`
}
type CountCheck ¶
type Instance ¶
type Instance struct {
config.InternalConfig
Partial string `toml:"partial"`
Targets []string `toml:"targets"`
Concurrency int `toml:"concurrency"`
Timeout config.Duration `toml:"timeout"`
ReadTimeout config.Duration `toml:"read_timeout"`
Username string `toml:"username"`
Password string `toml:"password"`
DB int `toml:"db"`
Connectivity ConnectivityCheck `toml:"connectivity"`
ResponseTime ResponseTimeCheck `toml:"response_time"`
Role RoleCheck `toml:"role"`
ConnectedClients CountCheck `toml:"connected_clients"`
BlockedClients CountCheck `toml:"blocked_clients"`
UsedMemory MemoryUsageCheck `toml:"used_memory"`
RejectedConn CountCheck `toml:"rejected_connections"`
MasterLink MasterLinkCheck `toml:"master_link_status"`
ConnectedSlaves MinCountCheck `toml:"connected_slaves"`
EvictedKeys CountCheck `toml:"evicted_keys"`
ExpiredKeys CountCheck `toml:"expired_keys"`
OpsPerSecond OpsPerSecondCheck `toml:"instantaneous_ops_per_sec"`
Persistence PersistenceCheck `toml:"persistence"`
tlscfg.ClientConfig
// contains filtered or unexported fields
}
type MasterLinkCheck ¶
type MemoryUsageCheck ¶
type MinCountCheck ¶
type OpsPerSecondCheck ¶
type Partial ¶
type Partial struct {
ID string `toml:"id"`
Concurrency int `toml:"concurrency"`
Timeout config.Duration `toml:"timeout"`
ReadTimeout config.Duration `toml:"read_timeout"`
Username string `toml:"username"`
Password string `toml:"password"`
DB int `toml:"db"`
tlscfg.ClientConfig
Connectivity ConnectivityCheck `toml:"connectivity"`
ResponseTime ResponseTimeCheck `toml:"response_time"`
Role RoleCheck `toml:"role"`
ConnectedClients CountCheck `toml:"connected_clients"`
BlockedClients CountCheck `toml:"blocked_clients"`
UsedMemory MemoryUsageCheck `toml:"used_memory"`
RejectedConn CountCheck `toml:"rejected_connections"`
MasterLink MasterLinkCheck `toml:"master_link_status"`
ConnectedSlaves MinCountCheck `toml:"connected_slaves"`
EvictedKeys CountCheck `toml:"evicted_keys"`
ExpiredKeys CountCheck `toml:"expired_keys"`
OpsPerSecond OpsPerSecondCheck `toml:"instantaneous_ops_per_sec"`
Persistence PersistenceCheck `toml:"persistence"`
}
type PersistenceCheck ¶
type RedisAccessor ¶
type RedisAccessor struct {
// contains filtered or unexported fields
}
RedisAccessor encapsulates a Redis connection and provides structured data access. It handles connection, authentication, protocol interaction, and response parsing. Thread-unsafe: callers must synchronize concurrent use.
func NewRedisAccessor ¶
func NewRedisAccessor(cfg RedisAccessorConfig) (*RedisAccessor, error)
NewRedisAccessor creates a connected and authenticated RedisAccessor.
func (*RedisAccessor) ClientList ¶
func (a *RedisAccessor) ClientList() (string, error)
ClientList executes CLIENT LIST and returns the raw response.
func (*RedisAccessor) Close ¶
func (a *RedisAccessor) Close() error
Close releases the underlying TCP connection.
func (*RedisAccessor) Command ¶
func (a *RedisAccessor) Command(args ...string) (string, error)
Command executes an arbitrary Redis command and returns the string reply. For use by diagnostic tools that need flexible access.
func (*RedisAccessor) ConfigGet ¶
func (a *RedisAccessor) ConfigGet(pattern string) (string, error)
ConfigGet executes CONFIG GET <pattern> and returns the raw key-value pairs. Sensitive fields (passwords, auth keys) are redacted.
func (*RedisAccessor) DBSize ¶
func (a *RedisAccessor) DBSize() (string, error)
DBSize executes DBSIZE and returns the reply.
func (*RedisAccessor) Info ¶
func (a *RedisAccessor) Info(section string) (map[string]string, error)
Info executes INFO <section> and returns the parsed key-value map.
func (*RedisAccessor) InfoRaw ¶
func (a *RedisAccessor) InfoRaw(section string) (string, error)
InfoRaw executes INFO <section> and returns the raw string output.
func (*RedisAccessor) Ping ¶
func (a *RedisAccessor) Ping() error
Ping sends PING and returns nil if the reply is PONG.
func (*RedisAccessor) SlowlogGet ¶
func (a *RedisAccessor) SlowlogGet(count int) (string, error)
SlowlogGet executes SLOWLOG GET <count> and returns the raw response.
func (*RedisAccessor) Target ¶
func (a *RedisAccessor) Target() string
Target returns the target address this accessor is connected to.
type RedisAccessorConfig ¶
type RedisAccessorConfig struct {
Target string
Username string
Password string
DB int
Timeout time.Duration
ReadTimeout time.Duration
TLSConfig *tls.Config
DialFunc func(network, address string) (net.Conn, error)
}
RedisAccessorConfig holds the connection parameters for creating a RedisAccessor.
type RedisPlugin ¶
type RedisPlugin struct {
config.InternalConfig
Partials []Partial `toml:"partials"`
Instances []*Instance `toml:"instances"`
}
func (*RedisPlugin) ApplyPartials ¶
func (p *RedisPlugin) ApplyPartials() error
func (*RedisPlugin) GetInstances ¶
func (p *RedisPlugin) GetInstances() []plugins.Instance
func (*RedisPlugin) RegisterDiagnoseTools ¶
func (p *RedisPlugin) RegisterDiagnoseTools(registry *diagnose.ToolRegistry)
RegisterDiagnoseTools implements plugins.Diagnosable for RedisPlugin. It registers read-only diagnostic tools and the accessor factory.