internal

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DoubleStartError = errors.New("the subscription already started")

Functions

func StartAll

func StartAll(subscribers []SubscriberMonitor, logger *zerolog.Logger) error

Types

type AutoHandler

type AutoHandler interface {
	Handle(delivery amqp.Delivery) error
	io.Closer
}

type AutoSubscriber

type AutoSubscriber interface {
	Subscriber
	GetHandler() AutoHandler
}

func AsAutoSubscriber

func AsAutoSubscriber(subscriber Subscriber, pin string) (AutoSubscriber, error)

func NewAutoSubscriber

func NewAutoSubscriber(
	manager *connection.Manager,
	config *queue.DestinationConfig,
	pinName string,
	handler AutoHandler,
	metric string,
) AutoSubscriber

type ConfirmationHandler

type ConfirmationHandler interface {
	Handle(delivery amqp.Delivery, timer *prometheus.Timer) error
	io.Closer
}

type DeliveryConfirmation

type DeliveryConfirmation struct {
	Delivery *amqp.Delivery
	Timer    *prometheus.Timer

	Logger zerolog.Logger
}

func (DeliveryConfirmation) Confirm

func (dc DeliveryConfirmation) Confirm() error

func (DeliveryConfirmation) Reject

func (dc DeliveryConfirmation) Reject() error

type ManualSubscriber

type ManualSubscriber interface {
	Subscriber
	GetHandler() ConfirmationHandler
}

func AsManualSubscriber

func AsManualSubscriber(subscriber Subscriber, pin string) (ManualSubscriber, error)

type MultiplySubscribeMonitor

type MultiplySubscribeMonitor struct {
	SubscriberMonitors []SubscriberMonitor
}

func (MultiplySubscribeMonitor) Unsubscribe

func (sub MultiplySubscribeMonitor) Unsubscribe() error

type Subscriber

type Subscriber interface {
	IsStarted() bool
	Start() error
	Pin() string
	io.Closer
}

func NewManualSubscriber

func NewManualSubscriber(
	manager *connection.Manager,
	config *queue.DestinationConfig,
	pinName string,
	handler ConfirmationHandler,
	metric string,
) Subscriber

type SubscriberMonitor

type SubscriberMonitor interface {
	queue.Monitor
	GetSubscriber() Subscriber
}

func MonitorFor

func MonitorFor(subscriber Subscriber) SubscriberMonitor

func SubscribeAll

func SubscribeAll[T any](
	router T,
	pinFoundByAttrs map[string]queue.DestinationConfig,
	logger *zerolog.Logger,
	subscribeFunc func(router T, pinName string) (SubscriberMonitor, error),
) ([]SubscriberMonitor, error)

type SubscriberType

type SubscriberType = int
const (
	AutoSubscriberType SubscriberType = iota
	ManualSubscriberType
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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