pubsub

package
v0.0.0-...-8495beb Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build() fx.Option

Types

type Bus

type Bus interface {
	Declare(topic string) Topic
	Publish(topic Topic, message []byte) error
	Subscribe(topic Topic, handler func([]byte) (bool, error)) error
}

func NewRabbit

func NewRabbit(cfg config.Config) (Bus, error)

type Embedded

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

func NewEmbedded

func NewEmbedded() *Embedded

func (*Embedded) Declare

func (b *Embedded) Declare(topic string) Topic

func (*Embedded) Publish

func (b *Embedded) Publish(topic Topic, message []byte) error

func (*Embedded) Subscribe

func (b *Embedded) Subscribe(topic Topic, handler func([]byte) (bool, error)) error

type Rabbit

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

func (*Rabbit) Declare

func (r *Rabbit) Declare(t string) Topic

Declare is meant to be used like: const MyQueue string

MyQueue = Declare("name_of_queue")

ps.Publish(MyQueue, ...)

func (*Rabbit) Publish

func (r *Rabbit) Publish(topic Topic, message []byte) error

func (*Rabbit) Subscribe

func (r *Rabbit) Subscribe(topic Topic, handler func([]byte) (bool, error)) error

type Topic

type Topic string

Jump to

Keyboard shortcuts

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