notification

package
v0.11.14 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Publish

func Publish(pubsub bahamut.PubSubClient, topic string, msg *Message) error

Publish sends a notification message using the given pubsub server.

func Subscribe

func Subscribe(ctx context.Context, pubsub bahamut.PubSubClient, topic string, handler Handler)

Subscribe registers a notification handler for the given topic.

Types

type Handler

type Handler func(msg *Message)

Handler is the type of function that can be Registered to handle a notification.

type Message

type Message struct {
	Type string `json:"t"`
	Data any    `json:"d"`
}

A Message represents the content of a notification.

Jump to

Keyboard shortcuts

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