messaging

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImplNotification

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

ImplNotification is the pubsub notification service implementation

func NewNotification

func NewNotification(infrastructure infrastructure.Interactor) *ImplNotification

NewNotification initializes a pubsub notification service instance

func (*ImplNotification) Notify

func (n *ImplNotification) Notify(
	ctx context.Context,
	topicID string,
	uid string,
	flavour feedlib.Flavour,
	payload feedlib.Element,
	metadata map[string]interface{},
) error

Notify Send a message to a topic

func (*ImplNotification) Push

Push instructs a remote FCM service to send a push notification.

This is done over Google Cloud Pub-Sub.

func (*ImplNotification) ReverseSubscriptionIDs

func (n *ImplNotification) ReverseSubscriptionIDs() map[string]string

ReverseSubscriptionIDs gets reverse subscription IDs for the notification service

func (*ImplNotification) SubscriptionIDs

func (n *ImplNotification) SubscriptionIDs() map[string]string

SubscriptionIDs gets subscription IDs for the notification service

func (*ImplNotification) TopicIDs

func (n *ImplNotification) TopicIDs() []string

TopicIDs Ask the notification service about the topics that it knows about

type UsecaseNotification

type UsecaseNotification interface {
	// Send a message to a topic
	Notify(
		ctx context.Context,
		topicID string,
		uid string,
		flavour feedlib.Flavour,
		payload feedlib.Element,
		metadata map[string]interface{},
	) error

	// Ask the notification service about the topics that it knows about
	TopicIDs() []string

	SubscriptionIDs() map[string]string

	ReverseSubscriptionIDs() map[string]string

	Push(
		ctx context.Context,
		sender string,
		payload firebasetools.SendNotificationPayload,
	) error
}

UsecaseNotification defines pupsub notification service usecases interface

Jump to

Keyboard shortcuts

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