pubsub

package
v0.1.44 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegPubSubCreator

func RegPubSubCreator(typeName string, creator PubSubCreatorFunc)

Types

type KafkaPubSubClient added in v0.1.20

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

func (*KafkaPubSubClient) Publish added in v0.1.20

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

func (*KafkaPubSubClient) QueueSubscribe added in v0.1.20

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

func (*KafkaPubSubClient) Request added in v0.1.20

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

func (*KafkaPubSubClient) RequestSubscribe added in v0.1.20

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

func (*KafkaPubSubClient) Subscribe added in v0.1.20

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

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