nats

package
v0.0.0-...-fb9855a Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: ISC Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PubSub

type PubSub struct {
	Conn *nats.Conn
}

PubSub implementation using NATS server.

func (*PubSub) Pub

func (ps *PubSub) Pub(topic string, data []byte) error

Pub publishes some data to the given topic.

func (*PubSub) Sub

func (ps *PubSub) Sub(topic string, cb func(data []byte)) (unsub func() error, err error)

Sub subscribes the given callback function to the interested topic.

Jump to

Keyboard shortcuts

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