utils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyticsData

type AnalyticsData struct {
	TotalKeys        int64          `json:"totalKeys"`
	PersistentKeys   int64          `json:"persistentKeys"`
	ExpiringKeys     int64          `json:"expiringKeys"`
	MemoryUsedBytes  int64          `json:"memoryUsedBytes"`
	MemoryTotalBytes int64          `json:"memoryTotalBytes"`
	KeyExpirations   map[string]int `json:"keyExpirations"`
}

type RedisConnection

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

func NewRedisConnection

func NewRedisConnection() *RedisConnection

func (*RedisConnection) Close

func (rc *RedisConnection) Close() error

func (*RedisConnection) Connect

func (rc *RedisConnection) Connect(host string, port string) error

func (*RedisConnection) ExecuteCommand

func (rc *RedisConnection) ExecuteCommand(cmd string) (interface{}, error)

func (*RedisConnection) FlushAll

func (rc *RedisConnection) FlushAll() error

func (*RedisConnection) GetAllKeys

func (rc *RedisConnection) GetAllKeys() ([]string, error)

func (*RedisConnection) GetAnalytics

func (rc *RedisConnection) GetAnalytics() (*AnalyticsData, error)

Existing helper functions remain the same (GetAnalytics, getBucket, openBrowser)

func (*RedisConnection) GetTTL

func (rc *RedisConnection) GetTTL(key string) (time.Duration, error)

func (*RedisConnection) GetValue

func (rc *RedisConnection) GetValue(key string) (string, error)

func (*RedisConnection) IsConnected

func (rc *RedisConnection) IsConnected() bool

func (*RedisConnection) KeyExists

func (rc *RedisConnection) KeyExists(key string) (bool, error)

func (*RedisConnection) RefreshData

func (rc *RedisConnection) RefreshData() ([]string, error)

Optional: Refresh data method if needed

func (*RedisConnection) ServeAnalytics

func (rc *RedisConnection) ServeAnalytics() error

func (*RedisConnection) SetKeyWithTTL

func (rc *RedisConnection) SetKeyWithTTL(key string, value string, ttl time.Duration) error

func (*RedisConnection) UpdateKey

func (rc *RedisConnection) UpdateKey(key string, value string, keepTTL bool) error

Jump to

Keyboard shortcuts

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