package
0.3.5
Repository: https://github.com/nguyendang2000/shared-go.git
Documentation: pkg.go.dev

# Functions

NewService initializes a Redis connection using the provided configuration and context.

# Constants

DefaultClaimCount sets the default number of pending messages to claim when using the XAutoClaim command.
DefaultGroupLastID is the default ID for the XReadGroup command.
DefaultLastID represents the default ID for the XRead command, which starts reading messages from the beginning of the stream.
DefaultMinIdleConns specifies the default minimum number of idle connections maintained in the connection pool to improve response times.
DefaultPoolSize defines the default number of connections in the Redis connection pool.
DefaultStartID is the default ID used when creating consumer groups.
DefaultStreamID is the default ID for auto-generating stream entries.
DefaultTimeout specifies the default timeout in seconds for Redis operations.
ErrAcknowledgeMessage is returned when acknowledging a message in a Redis stream fails.
ErrAddToStream is returned when adding an entry to a Redis stream fails.
ErrClaimPendingMessages is returned when claiming pending messages in a Redis stream fails.
ErrCreateConsumerGroup is returned when creating a Redis consumer group fails.
ErrDelete is returned when a DELETE operation for one or more keys fails.
ErrExists is returned when checking the existence of one or more keys fails.
ErrExpire is returned when setting an expiration time for a key fails.
ErrGet is returned when a GET operation for a key fails.
ErrHDel is returned when deleting fields from a hash fails.
ErrHExists is returned when checking if a field exists in a hash fails.
ErrHExpire is returned when setting expiration for hash fields fails.
ErrHGet is returned when retrieving a field from a hash fails.
ErrHGetAll is returned when retrieving all fields and values from a hash fails.
ErrHIncrBy is returned when incrementing a hash field by a specified value fails.
ErrHKeys is returned when retrieving all field names from a hash fails.
ErrHLen is returned when retrieving the length (number of fields) of a hash fails.
ErrHSet is returned when setting fields and values in a hash fails.
ErrHTTL is returned when retrieving TTL for hash fields fails.
ErrHVals is returned when retrieving all values from a hash fails.
ErrIncr is returned when incrementing a key by 1 fails.
ErrIncrBy is returned when incrementing a key by a specified value fails.
ErrPingRedis is returned when a connection ping to Redis fails.
ErrReadFromStream is returned when reading from a Redis stream fails.
ErrReadGroupFromStream is returned when reading from a Redis consumer group fails.
ErrSet is returned when a SET operation for a key fails.
ErrTTL is returned when retrieving the TTL of a key fails.

# Structs

Config represents the configuration settings for connecting to a Redis instance.
Service represents a wrapper around a Redis client connection.