queue

package
v0.0.0-...-cd49875 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProcessSyncLog = "log.insert"
	ProcessExample = "example.consumer"
)

Functions

This section is empty.

Types

type Message

type Message struct {
	Queue         string
	ReplyTo       string
	ContentType   string
	CorrelationID string
	Priority      uint8
	Body          MessageBody
}

type MessageBody

type MessageBody struct {
	Data []byte
	Type string
}

type Queue

type Queue interface {
	Connect() error
	Close() error
	BindQueue(key string) (q amqp.Queue, err error)
	Reconnect() error
	HandleConsumedDeliveries(key string, handle func(payload map[string]interface{}) error)
	Publish(key string, message []byte, attempts int32) error
}

type RabbitMQ

type RabbitMQ struct {
	Ctx        context.Context
	Uri        string
	Exchange   string
	Kind       string
	Prefix     string
	RetryCount int
	Err        chan error
	// contains filtered or unexported fields
}

func (*RabbitMQ) BindQueue

func (c *RabbitMQ) BindQueue(key string) (q amqp.Queue, err error)

func (*RabbitMQ) Close

func (c *RabbitMQ) Close() error

func (*RabbitMQ) Connect

func (c *RabbitMQ) Connect() error

func (*RabbitMQ) HandleConsumedDeliveries

func (c *RabbitMQ) HandleConsumedDeliveries(key string, handle func(payload map[string]interface{}) error)

func (*RabbitMQ) Publish

func (c *RabbitMQ) Publish(key string, message []byte, attempts int32) error

Publisher Things

func (*RabbitMQ) Reconnect

func (c *RabbitMQ) Reconnect() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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