redis

package
v0.0.0-...-abf0de2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package redis mq base on redis

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptFunc

type OptFunc func(t *Type) error

OptFunc optional arguments

func WithKeyPrefix

func WithKeyPrefix(prefix string) OptFunc

WithKeyPrefix set redis key prefix

func WithLogger

func WithLogger(l *gutils.LoggerType) OptFunc

WithLogger set internal logger

func WithRDBCli

func WithRDBCli(rdb *redis.Client) OptFunc

WithRDBCli set redis client

type Type

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

Type mq base on redis

func New

func New(optfs ...OptFunc) (t *Type, err error)

New create mq depends on redis

func (*Type) Commit

func (t *Type) Commit(ctx context.Context, evt *types.Event) error

FIXME: not implement

func (*Type) Get

func (t *Type) Get(ctx context.Context, topic types.EventTopic) (<-chan *types.Event, <-chan error)

Get get evt from mq

func (*Type) Name

func (t *Type) Name() string

Name get name of mq

func (*Type) Put

func (t *Type) Put(ctx context.Context, evt *types.Event) error

Put put event into mq

func (*Type) RDBKey

func (t *Type) RDBKey(topic types.EventTopic) string

RDBKey generate redis key by topic

Jump to

Keyboard shortcuts

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