queue

package
v0.0.0-...-40ea64e Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	// Message is the message body
	Message string

	// Recepients is the list of recepients
	Recepients []string

	// Subject is the message subject
	Subject *string

	// Template is the message template
	Template *template.Template
}

Message is a message for a channel

type ReadWriter

type ReadWriter interface {
	Reader
	Writer
}

ReadWriter is used to read and write messages to a queue

type Reader

type Reader interface {
	// Pop returns and removes the next message from the queue
	Pop(channel string) (string, error)
}

Reader is used to read messages from a queue

type Redis

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

Redis is used to push and pop messages

func NewRedis

func NewRedis(endpoint, password string, db, retries int) *Redis

NewRedis creates a new Redis

func (*Redis) Pop

func (r *Redis) Pop(channel string) (string, error)

Pop returns and removes the next message from the queue

func (*Redis) Push

func (r *Redis) Push(req *apiv1.NotificationRequest, channel string) error

Push adds a message to the queue

type Writer

type Writer interface {
	// Push adds a message to the queue
	Push(req *apiv1.NotificationRequest, channel string) error
}

Writer is used to write messages to a queue

Jump to

Keyboard shortcuts

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