broker

package
v0.0.0-...-8f93eae Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Request

func Request[M Message, R any](broker *Broker, message M, dst *R) error

func Respond

func Respond[M Message](broker *Broker, message M, raw *nats.Msg) error

func Subscribe

func Subscribe[M Message](broker *Broker, cb func(message M, raw *nats.Msg)) error

Types

type Broker

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

func NewMessageBroker

func NewMessageBroker() *Broker

func (*Broker) Publish

func (b *Broker) Publish(subject string, data []byte) error

func (*Broker) RevokeSession

func (b *Broker) RevokeSession(sessionID string) error

func (*Broker) ValidateSession

func (b *Broker) ValidateSession(sessionID string) bool

type Message

type Message interface {
	Subject() string
}

Jump to

Keyboard shortcuts

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