gfrds

package
v0.0.0-...-3810ba9 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumeOption

type ConsumeOption func(options *consumeOptions)

func WithConsumeName

func WithConsumeName(name string) ConsumeOption

func WithReadCount

func WithReadCount(count int64) ConsumeOption

func WithReconnectSec

func WithReconnectSec(timeSec int32) ConsumeOption

type ProduceOption

type ProduceOption func(options *produceOptions)

func WithDefaultKey

func WithDefaultKey(key string) ProduceOption

type RedisPubSub

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

func NewRedisPubSub

func NewRedisPubSub(cli *redis.Client) *RedisPubSub

func (*RedisPubSub) Publish

func (r *RedisPubSub) Publish(ctx context.Context, channel string, msg interface{}) error

func (*RedisPubSub) Subscribe

func (r *RedisPubSub) Subscribe(ctx context.Context, channel string, fn subscribeFunc) error

type RedisStream

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

func NewRedisStream

func NewRedisStream(cli *redis.Client) *RedisStream

func (*RedisStream) Consume

func (r *RedisStream) Consume(ctx context.Context, stream, group string, fn consumeFunc, opts ...ConsumeOption) error

func (*RedisStream) Produce

func (r *RedisStream) Produce(ctx context.Context, stream string, msg interface{}, opts ...ProduceOption) error

Jump to

Keyboard shortcuts

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