redis

package
v0.0.0-...-2d343b4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 8 Imported by: 0

README

Redis

利用了Redis的发布订阅命令

PUBLISH channel message

用于将信息发送到指定的频道。

SUBSCRIBE channel [channel …]

订阅给定的一个或多个频道的信息

UNSUBSCRIBE [channel [channel …]]

指退订给定的频道

PSUBSCRIBE pattern [pattern ...]

订阅一个或多个符合给定模式的频道

PUBSUB subcommand [argument [argument ...]]

查看订阅与发布系统状态

PUNSUBSCRIBE [pattern [pattern ...]]

退订所有给定模式的频道

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultMaxActive      = 0
	DefaultMaxIdle        = 5
	DefaultIdleTimeout    = 0 * time.Minute
	DefaultConnectTimeout = 5 * time.Second
	DefaultReadTimeout    = 5 * time.Second
	DefaultWriteTimeout   = 5 * time.Second
)

Functions

func ConnectTimeout

func ConnectTimeout(d time.Duration) broker.Option

func IdleTimeout

func IdleTimeout(d time.Duration) broker.Option

func MaxActive

func MaxActive(n int) broker.Option

func MaxIdle

func MaxIdle(n int) broker.Option

func NewBroker

func NewBroker(opts ...broker.Option) broker.Broker

NewBroker returns a new common implemented using the Redis pub/sub protocol. The connection address may be a fully qualified IANA address such as: redis://user:secret@localhost:6379/0?foo=bar&qux=baz

func ReadTimeout

func ReadTimeout(d time.Duration) broker.Option

func WithCommonOptions

func WithCommonOptions() broker.Option

func WriteTimeout

func WriteTimeout(d time.Duration) broker.Option

Types

This section is empty.

Jump to

Keyboard shortcuts

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