pubsub

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTopicHandler

func AddTopicHandler(topic string, router chi.Router, handler func(event *CloudEvent) error)

AddTopicHandler is a way to plug in a handler for receiving messages from a Dapr pub-sub topic It's pretty simple and the handler is passed the CloudEvent data, for them to decode

func Subscribe

func Subscribe(pubSubName string, topics []string, router chi.Router)

Subscribe is a HTTP handler that lets Dapr know what topics we subscribe to

Types

type CloudEvent

type CloudEvent struct {
	ID   string      `json:"id"`
	Data interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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