pubsub

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFactory added in v1.0.6

func AddFactory(provider conf.TransportProvider, factory factory)

Types

type Message

type Message struct {
	Topic    string
	Data     []byte
	Response MessageResponse
}

type MessageHandler

type MessageHandler func(ctx context.Context, msg *Message) error

type MessageResponse added in v1.0.1

type MessageResponse func(data []byte) error

type PubSub

type PubSub interface {
	Publish(topic string, data []byte) error
	Subscribe(topic string, callback MessageHandler) error
	Close() error
}

func NewPubSub added in v1.0.6

func NewPubSub(provider conf.TransportProvider, cfg conf.Instance) (PubSub, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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