pubsub

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pub

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

func (Pub) Name

func (pub Pub) Name() string

func (Pub) Publish

func (pub Pub) Publish(topic string, msg []byte) error

type Publisher

type Publisher interface {
	app.Service
	Publish(topic string, msg []byte) error
}

func NewPublisher

func NewPublisher(c PublisherConfig) Publisher

NewPublisher new redis publisher

type PublisherConfig

type PublisherConfig struct {
	dependencies.RedisClientConfig
}

type Sub

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

func (Sub) Name

func (sub Sub) Name() string

func (Sub) Run

func (sub Sub) Run()

func (Sub) Subscribe

func (sub Sub) Subscribe(s Subscription) error

type Subscriber

type Subscriber interface {
	app.Runner
	Subscribe(Subscription) error
}

func NewSubscriber

func NewSubscriber(c SubscriberConfig) Subscriber

NewSubscriber new redis subscriber

type SubscriberConfig

type SubscriberConfig struct {
	dependencies.RedisClientConfig
}

type Subscription

type Subscription interface {
	Topics() []string
	Handler(string, []byte)
}

Jump to

Keyboard shortcuts

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