queue

package
v0.0.0-...-e3263a0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockQueue

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

func (*MockQueue) Consume

func (mq *MockQueue) Consume(c chan<- QueueDto) error

func (*MockQueue) Publish

func (mq *MockQueue) Publish(msg []byte) error

type Queue

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

func New

func New(qt QueueType, cfg any) (q *Queue, err error)

func (*Queue) Consume

func (q *Queue) Consume(cdto chan<- QueueDto) error

func (*Queue) Publish

func (q *Queue) Publish(msg []byte) error

type QueueConnection

type QueueConnection interface {
	Publish([]byte) error
	Consume(chan<- QueueDto) error
}

type QueueDto

type QueueDto struct {
	Filename string `json:"filename"`
	Path     string `json:"path"`
	ID       int    `json:"id"`
}

func (*QueueDto) Marshal

func (q *QueueDto) Marshal() ([]byte, error)

func (*QueueDto) Unmarshal

func (q *QueueDto) Unmarshal(data []byte) error

type QueueType

type QueueType int
const (
	RabbitMQ QueueType = iota
	Mock
)

type RabbitConnection

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

func (*RabbitConnection) Consume

func (rc *RabbitConnection) Consume(cdto chan<- QueueDto) error

func (*RabbitConnection) Publish

func (rc *RabbitConnection) Publish(msg []byte) error

type RabbitMQConfig

type RabbitMQConfig struct {
	URL       string
	TopicName string
	Timeout   time.Duration
}

Jump to

Keyboard shortcuts

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