broker

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmqpBroker

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

func NewAmqpBroker

func NewAmqpBroker(option *AmqpBrokerOptions) *AmqpBroker

func (*AmqpBroker) Consume

func (a *AmqpBroker) Consume(queue *Queue) error

func (*AmqpBroker) Health

func (a *AmqpBroker) Health() bool

func (*AmqpBroker) Publish

func (a *AmqpBroker) Publish(key string, body []byte) error

func (*AmqpBroker) PublishDelay

func (a *AmqpBroker) PublishDelay(queue string, body []byte, delay int64) error

type AmqpBrokerOptions

type AmqpBrokerOptions struct {
	Url          string
	Exchange     string
	ExchangeType string
}

type Broker

type Broker interface {
	Consume(queue *Queue) error
	Publish(key string, body []byte) error
	PublishDelay(queue string, body []byte, delay int64) error
	Health() bool
}

type Queue

type Queue struct {
	Name       string
	RouteKey   string
	RetryQueue []int64
	Handle     func([]byte) Status
}

type Status

type Status int
const (
	Success Status = iota
	Retry
)

Jump to

Keyboard shortcuts

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