queue

package
v0.0.0-...-25c177e Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 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 Queue

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

func New

func New(queueType QueueType, cfg any) (queue *Queue, err error)

func (*Queue) Consume

func (q *Queue) Consume(chDTO 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
)

type RabbitMQConfig

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

type RabbitMQConnection

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

func (*RabbitMQConnection) Consume

func (rc *RabbitMQConnection) Consume(chDTO chan<- QueueDTO) error

func (*RabbitMQConnection) Publish

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

Jump to

Keyboard shortcuts

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