Documentation
¶
Index ¶
- type Caches
- type FallbackFn
- type Handler
- type Options
- func WithAddress(address string) Options
- func WithDatabaseNo(dbNo int) Options
- func WithMaxActive(maxActive int) Options
- func WithMaxIdle(maxIdle int) Options
- func WithMaxRetry(maxRetry int) Options
- func WithPassword(password string) Options
- func WithTimeout(timeout int) Options
- func WithUsername(username string) Options
- type RedisCfg
- type Store
- func (r *Store) Del(ctx context.Context, key string) (int64, error)
- func (r *Store) Get(ctx context.Context, key string, typeDestination any, fallbackFn ...FallbackFn) error
- func (r *Store) HDel(ctx context.Context, key, field string) error
- func (r *Store) HGet(ctx context.Context, key, field string, typeDestination any, ...) error
- func (r *Store) HGetAll(ctx context.Context, key string, dest interface{}) error
- func (r *Store) HSet(ctx context.Context, key, field string, value any, expire ...int) error
- func (r *Store) HSetBulk(ctx context.Context, key string, fields map[string]interface{}, expire ...int) error
- func (r *Store) PublishStream(ctx context.Context, streamName string, data ...map[string]any) (string, error)
- func (r *Store) Set(ctx context.Context, key string, value any, expire ...int) error
- func (r Store) SubscribeStream(ctx context.Context, streamName string, ...)
- func (r *Store) WrapToContext(ctx context.Context) context.Context
- func (r *Store) WrapToHandler(next http.Handler) http.Handler
- func (r *Store) XAck(ctx context.Context, streamKey, group, id string) (int64, error)
- func (r *Store) XGroupCreateMkStream(ctx context.Context, streamKey, group, startID string) error
- func (r *Store) XReadGroup(ctx context.Context, group, consumer string, streams []string, ids []string, ...) ([]StreamMessages, error)
- type StreamData
- type StreamMessages
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Caches ¶
type Caches interface {
Get(ctx context.Context, key string, typeDestination any, fallbackFn ...FallbackFn) error
Del(ctx context.Context, key string) (int64, error)
Set(ctx context.Context, key string, value any, expire ...int) error
HSet(ctx context.Context, key, field string, value any, expire ...int) error
HGet(ctx context.Context, key, field string, typeDestination any, fallbackFn ...FallbackFn) error
HDel(ctx context.Context, key, field string) error
HGetAll(ctx context.Context, key string, dest interface{}) error
HSetBulk(ctx context.Context, key string, fields map[string]interface{}, expire ...int) error
XGroupCreateMkStream(ctx context.Context, streamKey, group, startID string) error
XReadGroup(ctx context.Context, group, consumer string, streams []string, ids []string, block time.Duration, count int64) ([]StreamMessages, error)
XAck(ctx context.Context, streamKey, group, id string) (int64, error)
}
func GetCacheFromContext ¶ added in v2.21.2
type FallbackFn ¶ added in v2.25.0
type Options ¶ added in v2.4.1
type Options func(*RedisCfg)
func WithAddress ¶ added in v2.4.1
func WithDatabaseNo ¶ added in v2.39.0
func WithMaxActive ¶ added in v2.4.1
func WithMaxIdle ¶ added in v2.4.1
func WithMaxRetry ¶ added in v2.25.0
func WithPassword ¶ added in v2.4.4
func WithTimeout ¶ added in v2.4.1
func WithUsername ¶ added in v2.4.4
type Store ¶
type Store struct {
Pool Handler
// contains filtered or unexported fields
}
Store object
func (*Store) Get ¶
func (r *Store) Get(ctx context.Context, key string, typeDestination any, fallbackFn ...FallbackFn) error
Get string value
func (*Store) HGet ¶ added in v2.26.0
func (r *Store) HGet(ctx context.Context, key, field string, typeDestination any, fallbackFn ...FallbackFn) error
HGet set has map
func (*Store) PublishStream ¶ added in v2.39.0
func (Store) SubscribeStream ¶ added in v2.39.0
func (*Store) WrapToContext ¶ added in v2.21.2
func (*Store) WrapToHandler ¶ added in v2.21.2
func (*Store) XGroupCreateMkStream ¶ added in v2.52.16
type StreamData ¶ added in v2.39.0
type StreamMessages ¶ added in v2.52.16
type StreamMessages struct {
Stream string
Messages []StreamData
}
Click to show internal directories.
Click to hide internal directories.