rabbitx

package
v0.0.0-...-3c82dbe Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupCloseHandler

func SetupCloseHandler(consumer *Consumer)

Types

type Consumer

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

func NewConsumer

func NewConsumer(ctx context.Context, cfgs RabbitmqConConf, handle func(deliveries <-chan amqp.Delivery, done chan error)) *Consumer

func (*Consumer) Shutdown

func (c *Consumer) Shutdown() error

type Producer

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

func NewProducer

func NewProducer(ctx context.Context, cfgs RabbitmqProConf) *Producer

func (*Producer) Publish

func (p *Producer) Publish(data []byte) error

func (*Producer) Shutdown

func (p *Producer) Shutdown() error

type RabbitmqConConf

type RabbitmqConConf struct {
	Address      string `yaml:"Address"`
	Exchange     string `yaml:"Exchange"`
	ExchangeType string `yaml:"ExchangeType"`
	Queue        string `yaml:"Queue"`
	BindingKey   string `yaml:"BindingKey"`
	ConsumerTag  string `yaml:"ConsumerTag"`
	LifeTime     int    `yaml:"LifeTime"`
	VerBose      bool   `yaml:"VerBose"`
	AutoACK      bool   `yaml:"AutoACK"`
}

type RabbitmqProConf

type RabbitmqProConf struct {
	Address      string `yaml:"Address"`
	Exchange     string `yaml:"Exchange"`
	ExchangeType string `yaml:"ExchangeType"`
	Queue        string `yaml:"Queue"`
	BindingKey   string `yaml:"BindingKey"`
	ConsumerTag  string `yaml:"ConsumerTag"`
	RoutingKey   string `yaml:"RoutingKey"`
	LifeTime     int    `yaml:"LifeTime"`
	AutoACK      bool   `yaml:"AutoACK"`
}

Jump to

Keyboard shortcuts

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