redis

package
v0.0.0-...-cb143e0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterMode = "cluster"
)

Variables

This section is empty.

Functions

func NewRedisPool

func NewRedisPool(cfg PoolOptions) rediscleint.UniversalClient

Types

type MQRedisRepository

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

func NewMQRedisRepository

func NewMQRedisRepository(client redisclient.UniversalClient) *MQRedisRepository

func (*MQRedisRepository) Pop

func (mqr *MQRedisRepository) Pop(ctx context.Context, topic string, partition int) (string, error)

func (*MQRedisRepository) Push

func (mqr *MQRedisRepository) Push(ctx context.Context, topic, payload string, partition int) error

type PoolOptions

type PoolOptions struct {
	URL         string
	Password    string
	MinIdle     int
	IdleTimeout int
	PoolSize    int
	Mode        string
}

type StorageSet

type StorageSet struct {
	*TopicRedisRepository
	*MQRedisRepository
}

func NewRedisStorageSet

func NewRedisStorageSet(opts PoolOptions) *StorageSet

type TopicRedisRepository

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

func NewTopicRedisRepository

func NewTopicRedisRepository(client redisclient.UniversalClient) *TopicRedisRepository

func (*TopicRedisRepository) CreateTopic

func (tr *TopicRedisRepository) CreateTopic(ctx context.Context, topic domain.Topic) error

func (*TopicRedisRepository) GetTopicPartitions

func (tr *TopicRedisRepository) GetTopicPartitions(ctx context.Context, topic string) (int, error)

Jump to

Keyboard shortcuts

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