pubsub

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegPubSubCreator

func RegPubSubCreator(typeName string, creator PubSubCreatorFunc)

Types

type NatsPubSubClient

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

func (*NatsPubSubClient) Publish

func (o *NatsPubSubClient) Publish(subject string, msg interface{}) error

func (*NatsPubSubClient) QueueSubscribe

func (o *NatsPubSubClient) QueueSubscribe(subject string, queue string, eventHandler PubSubEventHandler)

func (*NatsPubSubClient) Request

func (o *NatsPubSubClient) Request(subject string, msg interface{}, timeOut ...time.Duration) (string, error)

func (*NatsPubSubClient) RequestSubscribe

func (o *NatsPubSubClient) RequestSubscribe(subject string, eventHandler PubSubReqEventHandler)

func (*NatsPubSubClient) Subscribe

func (o *NatsPubSubClient) Subscribe(subject string, eventHandler PubSubEventHandler)

type PubSubClient

type PubSubClient interface {
	Publish(subject string, msg interface{}) error
	Request(subject string, msg interface{}, timeOut ...time.Duration) (string, error)
	Subscribe(subject string, eventHandler PubSubEventHandler)
	RequestSubscribe(subject string, eventHandler PubSubReqEventHandler)
	QueueSubscribe(subject string, queue string, eventHandler PubSubEventHandler)
}

func Get

func Get(name ...string) PubSubClient

type PubSubCreatorFunc

type PubSubCreatorFunc func(connString string) (PubSubClient, error)

type PubSubEventHandler

type PubSubEventHandler func(name string, msg string)

type PubSubReqEventHandler

type PubSubReqEventHandler func(name string, msg string) string

Jump to

Keyboard shortcuts

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